[odb-users] Composing object view attribute

Roman Shametko shametko.roman at gmail.com
Sun Apr 12 12:05:46 EDT 2015

Hi, guys.  I need some help:

Suppose I have some class like

class AdjacencyListItem {
     std::shared_ptr<AdjacencyListItem> m_parent;
     std::string m_nodeName;

     std::string nodePath() {...}

Which represents, for instance, file tree. Assume that class is 
persistent (not gonna write pragmas in example).
So AdjacencyListItem stores it's name and reference to it's parent, and 
nodePath glues all parent node names and produces some kind of path.

Now I want to create view containing, in addition to other members, 
"glued path" which can be prodused by nodePath method. So I need to get 
something like this

class View {
      std::string m_nodePath; // path, created by 

So my question is: Is there any way to supply Views with manually 
composed values?

More information about the odb-users mailing list