Loading...
Searching...
No Matches
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.
 
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.
 
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

◆ count()

template<class B , class S >
virtual size_t count ( ) const
inlinevirtual

Implements ClonerBase< B >.

◆ drop()

template<class B , class S >
virtual bool drop ( index_t  i) const
inlinevirtual

Remove cloned entry.

Implements ClonerBase< B >.

◆ getCloned() [1/2]

template<class B , class S >
B & getCloned ( ) const
inlinevirtual

Implements interface.

Implements ClonerBase< B >.

◆ getCloned() [2/2]

template<class B , class S >
virtual B & getCloned ( index_t  i) const
inlinevirtual

Returns.

Returns a reference to the instance with index i.

Implements ClonerBase< B >.

◆ getClonerEntry()

template<class B , class S >
virtual entry_t getClonerEntry ( ) const
inlinevirtual

Implements ClonerBase< B >.

◆ getSource() [1/2]

template<class B , class S >
virtual B & getSource ( )
inlinevirtual

Returns a reference to a default instance.

Implements ClonerBase< B >.

◆ getSource() [2/2]

template<class B , class S >
virtual const B & getSource ( ) const
inlinevirtual

Returns a const reference to a default instance.

Implements ClonerBase< B >.


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