INTRODUCTION Overview Download and Install Quick Start Documentation Publications NONFRAMEWORK CODE Driver Interfaces Drivers Libraries Utilities FRAMEWORK CODE Interfaces Components Libraries Utilities Full Software Listings DEVELOPER Tutorials Examples Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
Slice2Log
|
Generates functions for reading/writing ASCII logs from Slice definition files.
This utility is used for autogenerating code from Slice definitions.
$ slice2util --help
Slice2String generates toString() function for every Slice-defined:
Example:
// C++ #include <orcaifacestring/datetime.h> #include <orcaifacestring/bros1.h> orca::Time t; t.seconds = 123; t.useconds = 45; cout<<ifacestring::toString( t )<<endl; orca::Frame2d f; f.p.x = 1.2; f.p.y = 3.4; f.o = 5.6; cout<<ifacestring::toString( f )<<endl;
This program will produce the following output:
struct orca::Time seconds = 123 useconds = 45 struct orca::Frame2d p = struct orca::CartesianPoint2d x = 1.2 y = 3.4 o = 5.6
The signature of the toString() function is the same for all data types. E.g. for a data type Type
in Slice module module
(e.g. orca), the generated function would have the following signature:
std::string toString( const module::Type& obj, int recurse=1000, int expand=-1, int indent=0 );
where
recurse
is the number of recursive calls, toString() will make. Default is 1000, i.e. it will most likely recurse through entire type hierarchy.expand
is the number of sequence or dictionary elements toString() will print out. Default is -1, which means "all elements".indent
determines the number of characters used to indent to top level of the data type. This parameter is incremented as toString() is called recursively.Examples:
// C++ cout<<ifacestring::toString( scan )<<endl<<endl; // output class orca::RangeScanner2dData timeStamp = struct orca::Time seconds = 123 useconds = 45 ranges = sequence (2) [0] 3 [1] 13 minRange = 0 maxRange = 33 fieldOfView = 77 startAngle = 13
// C++ cout<<ifacestring::toString( scan, 0 )<<endl // output class orca::RangeScanner2dData
// C++ cout<<ifacestring::toString( scan, 1 )<<endl // output class orca::RangeScanner2dData timeStamp = struct orca::Time ranges = sequence (2) [0] 3 [1] 13 minRange = 0 maxRange = 33 fieldOfView = 77 startAngle = 13
// C++ cout<<ifacestring::toString( scan, 1000, 0 )<<endl<<endl; // output class orca::RangeScanner2dData timeStamp = struct orca::Time seconds = 123 useconds = 45 ranges = sequence (2) minRange = 0 maxRange = 33 fieldOfView = 77 startAngle = 13
Slice2Log generates toLogStream() and fromLogStream() functions for every Slice-defined:
The signature of the toLog() function is the same for all data types. E.g. for a data type Type
in Slice module module
(e.g. orca), the generated function would have the following signature:
void toLogStream( const module::Type& obj, std::ostream& os ); void fromLogStream( module::Type& obj, std::istream& is );
They can be used with std::[i/o]fstream (logging) or std::[i/o]stringstream (easier for testing) objects
This tool is limited compared to slice2cpp.
slice2util
on the Ice-supplied types.Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)