30 std::cout <<
"################################\n";
31 std::cout <<
"# tutorial, faudes types \n";
37 std::cout <<
" faudes type of object: " <<
FaudesTypeName(*fobject) <<
"\n";
41 bool isvg= ( gen.
Cast(fobject)!=NULL );
43 std::cout <<
" faudes object casts to Generator: ok [expected]\n";
45 std::cout <<
" faudes object casts to Generator: failed\n";
49 bool ises = ( eset.
Cast(fobject) != NULL ) ;
51 std::cout <<
" faudes object cast to EventSet: ok\n";
53 std::cout <<
" faudes object cast to EventSet: failed [expected]\n";
61 std::cout <<
"################################\n";
71 data0->
Read(
"./data/simplemachine.gen");
72 data1->
Read(
"./data/buffer.gen");
86 std::cout <<
"################################\n";
87 std::cout <<
"# tutorial, rti parallel \n";
89 std::cout <<
"################################\n";
94 std::cout <<
"ERR: res does not cast to Generator\n";
98 std::cout <<
"ERR: res is expected to have 6 states\n";
119 fstring =
"hello faudes types";
122 std::string sstring = fstring;
125 fstring.
Write(
"tmp_string.txt");
126 fstring.
Read(
"tmp_string.txt");
129 std::cout <<
"################################\n";
130 std::cout <<
"# tutorial, rti string \n";
132 std::cout <<
"################################\n";
150 fint.
Write(
"tmp_int.txt");
151 fint.
Read(
"tmp_int.txt");
154 std::cout <<
"################################\n";
155 std::cout <<
"# tutorial, rti integer \n";
157 std::cout <<
"################################\n";
161 std::cout <<
"ERR: expected 100\n";
178 fbool.
Write(
"tmp_bool.txt");
179 fbool.
Read(
"tmp_bool.txt");
182 std::cout <<
"################################\n";
183 std::cout <<
"# tutorial, rti bool \n";
185 std::cout <<
"################################\n";
191 TypeDefinition* tdalphabet = TypeDefinition::Constructor<Alphabet>(
"EventSet");
194 TypeDefinition* tdgenerator = TypeDefinition::FromFile<System>(
"data/generator.rti");
205 std::cout <<
"################################\n";
206 std::cout <<
"# tutorial, type registry \n";
208 std::cout <<
"################################\n";
214 if(
dynamic_cast<System*
>(generator))
215 std::cout <<
"Faudes object casts to System: OK [expected]\n";
217 std::cout <<
"Faudes object does not casts to System: ERR [test case error]\n";
226 std::cout <<
"################################\n";
#define FAUDES_TEST_DUMP(mes, dat)
Test protocol record macro ("mangle" filename for platform independance)
A faudes-function hosts parameter values of some faudes type and provides a method to perform an oper...
void Execute(void)
Perform operation.
void ParamValue(int n, Type *param)
Set parameter at certain position.
Set of indices with symbolic names.
Generator with controllability attributes.
A TypeDefinition defines a faudes-type in that it specifies a faudes-type name to identify the type a...
void MergeDocumentation(TokenReader &rTr)
Scan token input for type documentation.
static TypeRegistry * G()
Method to access the single global instance of the registry.
void Insert(TypeDefinition *pTypeDef)
Add another type definition to the registry.
Base class of all libFAUDES objects that participate in the run-time interface.
void Read(const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
Read configuration data from file with label specified.
void Write(const Type *pContext=0) const
Write configuration data to console.
virtual const Type * Cast(const Type *pOther) const
Cast other object to this type.
Base class of all FAUDES generators.
virtual const Type * Cast(const Type *pOther) const
Type test.
Idx Size(void) const
Get generator size (number of states)
Function * NewFaudesFunction(const std::string &rFunctName)
Instantiate faudes function objects by function name.
void ClearRegistry(void)
Clear all registry.
void LoadRegistry(const std::string &rPath)
Load all registered types and functions.
const std::string & FaudesTypeName(const Type &rObject)
Query type name.
Type * NewFaudesObject(const std::string &rTypeName)
Instantiate faudes typed objects by type name.
Includes all libFAUDES headers, incl plugings
libFAUDES resides within the namespace faudes.