Wallaroo  0.8
Public Member Functions | Protected Member Functions | Friends | List of all members
wallaroo::Part Class Reference

#include <part.h>

Public Member Functions

virtual ~Part ()
 
void Wire (const std::string &dependency, const cxx0x::shared_ptr< Part > &part)
 
template<typename T >
void SetAttribute (const std::string &attribute, const T &value)
 
bool MultiplicitiesOk () const
 
virtual void Init ()
 
template<>
void SetAttribute (const std::string &attribute, const std::string &value)
 

Protected Member Functions

RegToken RegistrationToken ()
 

Friends

template<class T1 , class T2 >
class Class
 
template<typename T , typename P , template< typename X > class Ownership>
class Collaborator
 
template<class T >
class Attribute
 

Detailed Description

This class represents a "part" that owns dependencies (collaborators) and attributes. You can link its dependencies to other parts using the method Part::Wire and assign a value to its attributes using the method SetAttribute, but wallaroo provides mechanisms more flexible for these tasks (i.e., the DSL constructs "use().as().of()" and "set_attribute().of().to()" and the configuration files).

Constructor & Destructor Documentation

virtual wallaroo::Part::~Part ( )
inlinevirtual

Member Function Documentation

virtual void wallaroo::Part::Init ( )
inlinevirtual

This method get called by Catalog::Init(). If you have work to be done for the initialization of your class, you should implement this method in the derived class. This is useful if you want to do your initialization after collaborators are been wired and attributes set. Keep in mind that in the constructor the wiring has not be performed yet.

bool wallaroo::Part::MultiplicitiesOk ( ) const
inline

Check the multiplicity of its collaborators.

Returns
true If the check pass
RegToken wallaroo::Part::RegistrationToken ( )
inlineprotected
template<typename T >
void wallaroo::Part::SetAttribute ( const std::string &  attribute,
const T &  value 
)
inline

Assign a value to an attribute of the Part.

Parameters
attributeThe name of the attribute.
valueThe value to assign.
Exceptions
ElementNotFoundIf attribute does not exist in this part.
WrongTypeIf value has not a type compatible with the attribute.
template<>
void wallaroo::Part::SetAttribute ( const std::string &  attribute,
const std::string &  value 
)
inline

Assign a value to a string attribute of the part.

Parameters
attributeThe name of the attribute.
valueThe value to assign.
Exceptions
ElementNotFoundIf attribute does not exist in this part.
void wallaroo::Part::Wire ( const std::string &  dependency,
const cxx0x::shared_ptr< Part > &  part 
)
inline

Link the dependency dependency of this part into the Part part.

Exceptions
ElementNotFoundIf dependency does not exist in this part.
WrongTypeIf part has not a type compatible with the dependency.

Friends And Related Function Documentation

template<class T >
friend class Attribute
friend
template<class T1 , class T2 >
friend class Class
friend
template<typename T , typename P , template< typename X > class Ownership>
friend class Collaborator
friend

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