33
44#include < map>
55#include < iostream>
6- #include " sdaiApplication_instance.h"
7-
8- typedef long instanceID;
9-
10- // FIXME need to include sectionReader* in below type
11- // typedef std::pair< std::streampos, std::streampos > streamRange;
12-
13- // typedefs for instanceRefMMap, instanceTypeMMap, instancesLoaded, instanceStreamPosMap
6+ // #include "sdaiApplication_instance.h"
7+
8+ class SDAI_Application_instance ;
9+ class sectionReader ;
10+ class lazyFileReader ;
11+
12+ typedef long instanceID; // /< the number assigned to an instance in the file
13+ typedef int sectionID; // /< the index of a sectionReader in a sectionReaderVec_t
14+
15+ /* * This struct contains all the information necessary to locate an instance. It is primarily
16+ * for instances that are present in a file but not memory. It could be useful in other
17+ * situations, so the information should be kept up-to-date.
18+ */
19+ typedef struct {
20+ std::streampos begin, end;
21+ sectionID section;
22+ /* bool modified; */ /* this will be useful when writing instances - if an instance is
23+ unmodified, simply copy it from the input file to the output file */
24+ } lazyInstance;
25+
26+ // instanceRefMMap - multimap between an instanceID and instances that refer to it
1427typedef std::multimap< instanceID, instanceID > instanceRefMMap_t;
1528typedef std::pair< instanceID, instanceID > instanceRefMMap_pair;
1629typedef std::pair< instanceRefMMap_t::iterator, instanceRefMMap_t::iterator > instanceRefMMap_range;
30+
31+ // instanceTypeMMap - multimap from instance type to instanceID's
1732typedef std::multimap< std::string, instanceID > instanceTypeMMap_t;
1833typedef std::pair< std::string, instanceID > instanceTypeMMap_pair;
1934typedef std::pair< instanceTypeMMap_t::iterator, instanceTypeMMap_t::iterator > instanceTypeMMap_range;
35+
36+ // instancesLoaded - fully created instances
2037typedef std::map< instanceID, SDAI_Application_instance * > instancesLoaded_t;
2138typedef std::pair< instanceID, SDAI_Application_instance * > instancesLoaded_pair;
22- typedef std::map< instanceID, streamRange > instanceStreamPosMap_t;
23- typedef std::pair< instanceID, streamRange > instanceStreamPosMap_pair;
24-
25- // typedef std::map< instanceID, lazyInstance * > instancesLazy_t;
26- // typedef std::pair< instanceID, lazyInstance * > instancesLazy_pair;
2739
40+ // instanceStreamPosMap - map instance id to a range in a particular file
41+ typedef std::map< instanceID, lazyInstance > instanceStreamPosMap_t;
42+ typedef std::pair< instanceID, lazyInstance > instanceStreamPosMap_pair;
2843
44+ // data sections
45+ typedef std::vector< sectionReader * > dataSectionReaderVec_t;
2946
47+ typedef std::vector< lazyFileReader * > lazyFileReaderVec_t;
3048
31- #endif // LAZYTYPES_H
49+ #endif // LAZYTYPES_H
0 commit comments