root/branches/streaming-rework/src/ser.cpp

Revision 407, 0.8 kB (checked in by pieterpalmers, 17 years ago)

- Changed the way the device class configure options are handled. Now they are handled in the makefiles instead of the source files. The only source file that still contains the #ifdef's is devicemanager.cpp, to conditionally include the device class include files and to conditionally probe the classes that might be supported.
- added a configure option to disable the compilation of the test programs in tests/
- cleaned up the ADMTP transmit streamprocessor. Now it sends silenced packets when in the disabled state, instead of no-data packets
- added a getNodeID() to ieee1394service
- made comments in ieee1394service.h doxygen compliant

Line 
1 #include "devicemanager.h"
2 #include "libutil/serialize.h"
3
4 #include <iostream>
5
6 const char FileName[] = "bebob.xml";
7
8 static bool
9 serialize( const char* pFileName )
10 {
11     DeviceManager devMgr;
12     devMgr.initialize( 0 );
13     devMgr.discover( 0 );
14     return devMgr.saveCache( pFileName );
15 }
16
17 static bool
18 deserialize( const char* pFileName )
19 {
20     DeviceManager devMgr;
21     devMgr.initialize( 0 );
22     return devMgr.loadCache( pFileName );
23 }
24
25 int
26 main(  int argc,  char** argv )
27 {
28     if ( !serialize( FileName ) ) {
29         std::cerr << "serializing failed" << std::endl;
30         return -1;
31     }
32     if ( !deserialize( FileName ) ) {
33         std::cerr << "deserializing failed" << std::endl;
34         return -1;
35     }
36
37     std::cout << "passed" << std::endl;
38     return 0;
39 }
Note: See TracBrowser for help on using the browser.