33 #ifndef WALLAROO_CONFIGURATION_H_
34 #define WALLAROO_CONFIGURATION_H_
110 std::ifstream f( file.c_str() );
111 if ( !f )
throw WrongFile( file +
" not found" );
131 for ( std::size_t i = 0; i < libraries.size(); ++i )
145 for ( std::size_t i = 0; i < objects.size(); ++i )
147 const Object& o = objects[ i ];
148 catalog.
Create( o.instance, o.type );
150 for ( std::size_t i = 0; i < attributes.size(); ++i )
152 const Attribute& a = attributes[ i ];
155 for ( std::size_t i = 0; i < dependencies.size(); ++i )
157 const Dependency& d = dependencies[ i ];
158 use( catalog[ d.value ] ).
as( d.dependency ).
of( catalog[ d.object ] );
166 Object(
const std::string& i,
const std::string& c ) :
167 instance( i ), type( c ) {}
168 std::string instance;
174 Attribute(
const std::string& obj,
const std::string& att,
const std::string& v ) :
175 object( obj ), attribute( att ), value( v ) {}
177 std::string attribute;
183 Dependency(
const std::string& obj,
const std::string& dep,
const std::string& v ) :
184 object( obj ), dependency( dep ), value( v ) {}
186 std::string dependency;
192 void Load(
const std::string& library )
194 libraries.push_back( library );
196 void AssignAttribute(
const std::string& lvalue,
const std::string& attId,
const std::string& attValue )
198 attributes.push_back(
Attribute( lvalue, attId, attValue ) );
200 void Create(
const std::string& lvalue,
const std::string& rvalue )
202 objects.push_back( Object( lvalue, rvalue ) );
204 void AssignDep(
const std::string& lvalue,
const std::string& dep,
const std::string& rvalue )
206 dependencies.push_back( Dependency( lvalue, dep, rvalue ) );
209 std::vector< std::string > libraries;
210 std::vector< Object > objects;
211 std::vector< Attribute > attributes;
212 std::vector< Dependency > dependencies;
218 #endif // WALLAROO_CONFIGURATION_H_
Definition: attribute.h:93
static std::string Suffix()
Definition: dynamic_loader.h:86
void LoadPlugins()
Definition: configuration.h:129
SetOfExpression of(const detail::PartShell &part)
Definition: catalog.h:345
Configuration(std::istream &s)
Definition: configuration.h:120
UseAsExpression as(const std::string &attribute)
Definition: catalog.h:287
UseExpression use(const detail::PartShell &destClass)
Definition: catalog.h:300
void to(const T &value)
Definition: catalog.h:329
Configuration(const std::string &file)
Definition: configuration.h:108
void of(const detail::PartShell &srcClass)
Definition: catalog.h:257
void Parse()
Definition: grammar.h:97
Definition: attribute.h:45
Definition: exceptions.h:176
Definition: configuration.h:100
SetExpression set_attribute(const std::string &attribute)
Definition: catalog.h:364
void Fill(Catalog &catalog)
Definition: configuration.h:143
static cxx0x::shared_ptr< Plugin > Load(const std::string &fileName)
Definition: dynamic_loader.h:69
detail::PartShell Create(const std::string &id, const std::string &className, const P1 &p1, const P2 &p2)
Definition: catalog.h:130