Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Cloner< B, S > Struct Template Reference

Wrapper for derived class S, returning base class T. More...

#include <Cloner.h>

Inheritance diagram for Cloner< B, S >:
Inheritance graph
[legend]
Collaboration diagram for Cloner< B, S >:
Collaboration graph
[legend]

Public Types

typedef ClonerBase< B > clonerbase_t
 
typedef clonerbase_t::index_t index_t
 
typedef clonerbase_t::entry_t entry_t
 
typedef std::map< index_t, S * > ptr_container_t
 
- Public Types inherited from ClonerBase< B >
typedef size_t index_t
 Each cloned entry has an index. More...
 
typedef std::pair< index_t, B * > entry_t
 

Public Member Functions

 Cloner (const Cloner< B, S > &c)
 Copy constructor.
 
 Cloner (const S &s)
 Constructor with source object (copied)
 
B & getCloned () const
 Implements interface.
 
virtual B & getCloned (index_t i) const
 Returns. More...
 
S & getClonedSrc () const
 Returns a object of class S, initialized with the source.
 
virtual entry_t getClonerEntry () const
 
virtual const B & getSource () const
 Returns a const reference to a default instance.
 
virtual B & getSource ()
 Returns a reference to a default instance.
 
virtual const S & getSourceOrig () const
 Returns a const reference to a default instance, in actual class.
 
virtual S & getSourceOrig ()
 Returns a reference to a default instance, in actual class.
 
virtual size_t count () const
 
virtual bool drop (index_t i) const
 Remove cloned entry.
 

Public Attributes

src
 Default instance, also the source for cloning.
 

Protected Member Functions

index_t getNewIndex () const
 Remove cloned entries.
 

Protected Attributes

ptr_container_t ptrs
 

Detailed Description

template<class B, class S>
struct drain::Cloner< B, S >

Wrapper for derived class S, returning base class T.

Template Parameters
T- visible base class
S- internal wrapped class derived from T

Member Function Documentation

◆ getCloned()

virtual B& getCloned ( index_t  i) const
inlinevirtual

Returns.

Returns a reference to the instance with index i.

Implements ClonerBase< B >.


The documentation for this struct was generated from the following file: