// read_path.cpp #include #include #include #include #include "objstream/StdObjStream.hpp" #include "trffit/register_trffit_types.h" #include "trffind/register_trffind_types.h" #include "trfcyl/register_trfcyl_types.h" #include "SimpleCFTDetector.h" using std::ifstream; using std::cout; using std::endl; using std::istringstream; using namespace trf; int main(int argc, char* argv[]) { assert( argv > 0 ); istringstream read1( argv[1] ); int expected_count; read1 >> expected_count; // Register the TRF++ types. register_trffit_types(); register_trffind_types(); register_trfcyl_types(); // Build the detector and register its layers.. SimpleCFTDetector det; det.register_with_objtable(); // Build the input object stream. ifstream strm("cft_path.obs"); assert( strm != 0 ); StdObjStream obstr(strm); // Read the path from the stream. int count = obstr.read_all_objects(); cout << "***> read_path: Expected " << expected_count << " objects."; cout << endl; cout << "***> read_path: Successfully read " << count << " objects."; cout << endl; assert( count == expected_count ); return 0; }