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"
11 BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,RandomString)
12 BBTK_BLACK_BOX_IMPLEMENTATION(RandomString,bbtk::AtomicBlackBox);
14 // 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)
18 static const char alphanum[] =
21 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
22 "abcdefghijklmnopqrstuvwxyz";
30 void RandomString::Process()
33 // THE MAIN PROCESSING METHOD BODY
34 // Here we simply set the input 'In' value to the output 'Out'
35 // And print out the output value
36 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
37 // void bbSet{Input|Output}NAME(const TYPE&)
38 // const TYPE& bbGet{Input|Output}NAME() const
40 // * NAME is the name of the input/output
41 // (the one provided in the attribute 'name' of the tag 'input')
42 // * TYPE is the C++ type of the input/output
43 // (the one provided in the attribute 'type' of the tag 'input')
44 // bbSetOutputOut( bbGetInputIn() );
45 // std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
47 int stringLength = sizeof(alphanum) - 1;
50 for(unsigned int i = 0; i < 8; ++i)
52 STR += alphanum[rand() % stringLength];
54 bbSetOutputOut( STR );
55 printf("EED RandomString::Process randomString=%s\n",STR.c_str());
59 // 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)
61 void RandomString::bbUserSetDefaultValues()
64 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
65 // Here we initialize the input 'In' to 0
70 // 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)
72 void RandomString::bbUserInitializeProcessing()
75 // THE INITIALIZATION METHOD BODY :
77 // but this is where you should allocate the internal/output pointers
83 // 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)
85 void RandomString::bbUserFinalizeProcessing()
88 // THE FINALIZATION METHOD BODY :
90 // but this is where you should desallocate the internal/output pointers