Wallaroo  0.8
Public Types | Public Member Functions | List of all members
wallaroo::Collaborator< T, P, Ownership > Class Template Reference

#include <collaborator.h>

Inheritance diagram for wallaroo::Collaborator< T, P, Ownership >:
wallaroo::Dependency

Public Types

typedef Ownership< T > Ptr
 
typedef cxx0x::shared_ptr< T > SharedPtr
 

Public Member Functions

 Collaborator (const std::string &name, const RegToken &token)
 
void Link (const cxx0x::shared_ptr< Part > &dev)
 
SharedPtr operator-> ()
 
const SharedPtr operator-> () const
 
 operator SharedPtr ()
 
 operator const SharedPtr () const
 
 operator bool () const
 
virtual bool WiringOk () const
 
- Public Member Functions inherited from wallaroo::Dependency
virtual ~Dependency ()
 

Detailed Description

template<typename T, typename P = mandatory, template< typename X > class Ownership = cxx0x::weak_ptr>
class wallaroo::Collaborator< T, P, Ownership >

This represents a "collaborator" of a "part" that you can link with another "part".

If the part1 has the collaborator1 linked to part2, part1 will basically get a pointer to part2.

Template Parameters
TThe type of the Part contained
PThis represents the kind of Collaborator (mandatory if you must link a part (this is the default), optional if you can leave this collaborator unlinked, collection if you can link many parts to this collaborator, bounded_collection if you need to specify the lower and/or upper bound for the number of parts you can link to this collaborator).
ContainerIf P = collection, this represents the std container the Collaborator will derive from.
Ownership

Member Typedef Documentation

template<typename T, typename P = mandatory, template< typename X > class Ownership = cxx0x::weak_ptr>
typedef Ownership< T > wallaroo::Collaborator< T, P, Ownership >::Ptr
template<typename T, typename P = mandatory, template< typename X > class Ownership = cxx0x::weak_ptr>
typedef cxx0x::shared_ptr< T > wallaroo::Collaborator< T, P, Ownership >::SharedPtr

Constructor & Destructor Documentation

template<typename T, typename P = mandatory, template< typename X > class Ownership = cxx0x::weak_ptr>
wallaroo::Collaborator< T, P, Ownership >::Collaborator ( const std::string &  name,
const RegToken token 
)
inline

Create a Collaborator and register it to its Part for later wiring.

Parameters
nameThe name of this collaborator
tokenThe registration token you can get by calling Part::RegistrationToken()

Member Function Documentation

template<typename T, typename P = mandatory, template< typename X > class Ownership = cxx0x::weak_ptr>
void wallaroo::Collaborator< T, P, Ownership >::Link ( const cxx0x::shared_ptr< Part > &  dev)
inlinevirtual

Link this collaborator with a Part

Parameters
devThe part you want link with this collaborator
Exceptions
WrongTypeIf dev is not a subclass of T

Implements wallaroo::Dependency.

template<typename T, typename P = mandatory, template< typename X > class Ownership = cxx0x::weak_ptr>
wallaroo::Collaborator< T, P, Ownership >::operator bool ( ) const
inline

Returns true if the collaborator has been wired and the embedded part has not been deleted.

Returns
true If the embedded part exists.
template<typename T, typename P = mandatory, template< typename X > class Ownership = cxx0x::weak_ptr>
wallaroo::Collaborator< T, P, Ownership >::operator const SharedPtr ( ) const
inline

Convert to a const shared ptr.

Exceptions
DeletedPartErrorIf the embedded part has been deleted.
template<typename T, typename P = mandatory, template< typename X > class Ownership = cxx0x::weak_ptr>
wallaroo::Collaborator< T, P, Ownership >::operator SharedPtr ( )
inline

Convert to a shared ptr.

Exceptions
DeletedPartErrorIf the embedded part has been deleted.
template<typename T, typename P = mandatory, template< typename X > class Ownership = cxx0x::weak_ptr>
SharedPtr wallaroo::Collaborator< T, P, Ownership >::operator-> ( )
inline

Give access to the embedded part.

Exceptions
DeletedPartErrorIf the embedded part has been deleted.
template<typename T, typename P = mandatory, template< typename X > class Ownership = cxx0x::weak_ptr>
const SharedPtr wallaroo::Collaborator< T, P, Ownership >::operator-> ( ) const
inline

Give access to the embedded part as const.

Exceptions
DeletedPartErrorIf the embedded part has been deleted.
template<typename T, typename P = mandatory, template< typename X > class Ownership = cxx0x::weak_ptr>
virtual bool wallaroo::Collaborator< T, P, Ownership >::WiringOk ( ) const
inlinevirtual

Check if this Collaborator is correctly wired according to the P template parameter policy.

Returns
true If the check pass.

Implements wallaroo::Dependency.


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