Holds the prototype of a concrete object. More...

#include <prototype_node.hpp>

Public Types

typedef std::pair
< prototype_node
*, std::string > 
prototype_field_info_t
 
typedef std::map< std::string,
prototype_field_info_t
field_prototype_map_t
 

Public Member Functions

 prototype_node (object_base_producer *p, const char *t, bool a=false)
 Creates a new prototype_node. More...
 
void initialize (object_base_producer *p, const char *t, bool a)
 Initializes a prototype_node. More...
 
void clear ()
 
bool empty (bool self) const
 
unsigned long size () const
 
void insert (prototype_node *child)
 
void remove ()
 
void unlink ()
 
prototype_nodenext_node () const
 
prototype_nodeprevious_node () const
 
bool is_child_of (const prototype_node *parent) const
 
void adjust_left_marker (object_proxy *old_proxy, object_proxy *new_proxy)
 
void adjust_right_marker (object_proxy *old_proxy, object_proxy *new_proxy)
 

Public Attributes

prototype_nodeparent
 
prototype_nodeprev
 
prototype_nodenext
 
prototype_nodefirst
 
prototype_nodelast
 
object_base_producerproducer
 
field_prototype_map_t relations
 
object_proxy * op_first
 
object_proxy * op_marker
 
object_proxy * op_last
 
unsigned int depth
 
unsigned long count
 
std::string type
 
bool abstract
 
bool initialized
 

Friends

std::ostream & operator<< (std::ostream &os, const prototype_node &pn)
 

Detailed Description

Holds the prototype of a concrete object.

The prototype_node class holds the prototype of a concrete object inside a producer object. Whenever requested the class produces a new object.

It also holds a partial list containing all objects of this and all children nodes. This list is defined by three marker: the beginning of the list, the end of the own objects and the end of the last child objects.

Member Typedef Documentation

Holds the fieldname and the prototype_node.

Shortcut for prototype fieldname pair.

Constructor & Destructor Documentation

oos::prototype_node::prototype_node ( object_base_producer p,
const char *  t,
bool  a = false 
)

Creates a new prototype_node.

Creates a new prototype_node which creates an object from given object_base_producer. The node gets the given type name t.

Parameters
pThe object_base_producer.
tThe type name of this node.
aTells the node if its prototype is abstract.

Member Function Documentation

void oos::prototype_node::adjust_left_marker ( object_proxy *  old_proxy,
object_proxy *  new_proxy 
)

Adjusts self and last marker of all predeccessor nodes with given object proxy.

Parameters
old_proxyThe old last marker proxy.
new_proxyThe new last marker proxy.
void oos::prototype_node::adjust_right_marker ( object_proxy *  old_proxy,
object_proxy *  new_proxy 
)

Adjust first marker of all successor nodes with given object proxy.

Parameters
old_proxyThe old first marker proxy.
new_proxyThe new first marker proxy.
void oos::prototype_node::clear ( )

clear removes all object proxies really belonging to this node and deletes them and the holded object

bool oos::prototype_node::empty ( bool  self) const

Returns true if object proxy list is empty. If self is true, only list of own objects is checked. If self is false, complete list is checked.

Parameters
selfIf true only elements inside this node are considered.
Returns
True if the node is empty.
void oos::prototype_node::initialize ( object_base_producer p,
const char *  t,
bool  a 
)

Initializes a prototype_node.

Initializes a prototype_node. The node gets the given type name alias t.

Parameters
pThe object_base_producer.
tThe type name of this node.
aTells the node if its prototype is abstract.
void oos::prototype_node::insert ( prototype_node child)

Appends the given prototype node to the list of children.

Parameters
childThe child node to add.
bool oos::prototype_node::is_child_of ( const prototype_node parent) const

Returns true if node is child of given parent node.

Parameters
parentThe parent node.
Returns
True if node is child of given parent node.
prototype_node* oos::prototype_node::next_node ( ) const

Returns nodes successor node or NULL if node is last.

Returns
The next node.
prototype_node* oos::prototype_node::previous_node ( ) const

Return nodes predeccessor node or NULL if node is first.

Returns
The previous node.
void oos::prototype_node::remove ( )

Removes node and cildren nodes from list, clears all object and deletes all members.

unsigned long oos::prototype_node::size ( ) const

Returns the size of the object proxy list.

Returns
The number of objects.
void oos::prototype_node::unlink ( )

Unlinks node from list.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const prototype_node pn 
)
friend

Prints the node in graphviz layout to the stream.

Parameters
osThe ostream to write to.
pnThe prototype_node to be written.
Returns
The modified ostream.

Member Data Documentation

bool oos::prototype_node::abstract

Indicates wether this node holds a producer of an abstract object

unsigned long oos::prototype_node::count

The total count of elements.

unsigned int oos::prototype_node::depth

The depth of the node inside of the tree.

prototype_node* oos::prototype_node::first

The first children node

bool oos::prototype_node::initialized

Indicates wether this node is complete initialized or not

prototype_node* oos::prototype_node::last

The last children node

prototype_node* oos::prototype_node::next

The next node

object_proxy* oos::prototype_node::op_first

The marker of the first list node.

object_proxy* oos::prototype_node::op_last

The marker of the last list node of all elements.

object_proxy* oos::prototype_node::op_marker

The marker of the last list node of the own elements.

prototype_node* oos::prototype_node::parent

The parent node

prototype_node* oos::prototype_node::prev

The previous node

object_base_producer* oos::prototype_node::producer

The object producer

field_prototype_map_t oos::prototype_node::relations

Map holding relation information for type.

std::string oos::prototype_node::type

The type name of the object


The documentation for this struct was generated from the following file:
  • object/prototype_node.hpp