33 #ifndef WALLAROO_PART_H_
34 #define WALLAROO_PART_H_
86 void Wire(
const std::string& dependency,
const cxx0x::shared_ptr< Part >& part )
88 Dependencies::iterator i = dependencies.find( dependency );
90 ( i -> second ) -> Link( part );
100 template <
typename T >
103 std::ostringstream stream;
104 if ( !( stream << std::boolalpha << value ) )
throw WrongType();
105 SetStringAttribute( attribute, stream.str() );
114 Dependencies::const_iterator i = dependencies.begin();
115 i != dependencies.end();
118 if ( ! i -> second -> WiringOk() )
140 template <
class T1,
class T2 >
friend class Class;
141 void Source(
const cxx0x::shared_ptr< Plugin >& p )
148 template <
typename T,
typename P,
template <
typename X >
class Ownership >
150 void Register(
const std::string&
id,
Dependency* c )
152 dependencies[ id ] = c;
160 attributes[ id ] = attribute;
166 void SetStringAttribute(
const std::string& attribute,
const std::string& value )
168 Attributes::iterator i = attributes.find( attribute );
170 ( i -> second ) -> Value( value );
173 typedef cxx0x::unordered_map< std::string, Dependency* > Dependencies;
174 Dependencies dependencies;
176 typedef cxx0x::unordered_map< std::string, DeserializableValue* > Attributes;
177 Attributes attributes;
179 cxx0x::shared_ptr< Plugin > plugin;
192 SetStringAttribute( attribute, value );
void SetAttribute(const std::string &attribute, const T &value)
Definition: part.h:101
void Wire(const std::string &dependency, const cxx0x::shared_ptr< Part > &part)
Definition: part.h:86
Part * GetPart() const
Definition: part.h:60
bool MultiplicitiesOk() const
Definition: part.h:111
Definition: attribute.h:93
virtual void Init()
Definition: part.h:130
RegToken RegistrationToken()
Definition: part.h:133
Definition: exceptions.h:128
virtual ~Part()
Definition: part.h:80
Definition: attribute.h:45
Definition: deserializable_value.h:47
Definition: exceptions.h:110
Definition: dependency.h:49
Definition: collaborator.h:165