2 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
4 #include "bbstdRandomString.h"
5 #include "bbstdPackage.h"
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,RandomString)
10 BBTK_BLACK_BOX_IMPLEMENTATION(RandomString,bbtk::AtomicBlackBox);
12 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
16 static const char alphanum[] =
19 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
20 "abcdefghijklmnopqrstuvwxyz";
28 void RandomString::Process()
31 // THE MAIN PROCESSING METHOD BODY
32 // Here we simply set the input 'In' value to the output 'Out'
33 // And print out the output value
34 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
35 // void bbSet{Input|Output}NAME(const TYPE&)
36 // const TYPE& bbGet{Input|Output}NAME() const
38 // * NAME is the name of the input/output
39 // (the one provided in the attribute 'name' of the tag 'input')
40 // * TYPE is the C++ type of the input/output
41 // (the one provided in the attribute 'type' of the tag 'input')
42 // bbSetOutputOut( bbGetInputIn() );
43 // std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
45 int stringLength = sizeof(alphanum) - 1;
48 for(unsigned int i = 0; i < 8; ++i)
50 STR += alphanum[rand() % stringLength];
52 bbSetOutputOut( STR );
53 printf("EED RandomString::Process randomString=%s\n",STR.c_str());
57 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
59 void RandomString::bbUserSetDefaultValues()
62 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
63 // Here we initialize the input 'In' to 0
68 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
70 void RandomString::bbUserInitializeProcessing()
73 // THE INITIALIZATION METHOD BODY :
75 // but this is where you should allocate the internal/output pointers
81 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
83 void RandomString::bbUserFinalizeProcessing()
86 // THE FINALIZATION METHOD BODY :
88 // but this is where you should desallocate the internal/output pointers