Skip to content

Commit b1387b7

Browse files
committed
improve comments, a few other small changes that don't affect behavior
1 parent d1062cd commit b1387b7

File tree

4 files changed

+29
-21
lines changed

4 files changed

+29
-21
lines changed

src/cllazyfile/lazyInstMgr.cc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,12 @@ void lazyInstMgr::addLazyInstance( namedLazyInstance inst ) {
4747
}
4848
_instanceTypes->insert( inst.name, inst.loc.instance );
4949
/* store 16 bits of section id and 48 of instance offset into one 64-bit int
50-
* TODO: check and warn if anything is lost (in calling code?)
51-
* does 32bit need anything special?
50+
** TODO: check and warn if anything is lost (in calling code?)
51+
** does 32bit need anything special?
52+
**
53+
** create conversion class?
54+
** could then initialize conversion object with number of bits
55+
** also a good place to check for data loss
5256
*/
5357
positionAndSection ps = inst.loc.section;
5458
ps <<= 48;
@@ -91,10 +95,9 @@ void lazyInstMgr::openFile( std::string fname ) {
9195

9296
SDAI_Application_instance * lazyInstMgr::loadInstance( instanceID id ) {
9397
assert( _mainRegistry && "Main registry has not been initialized. Do so with initRegistry() or setRegistry()." );
94-
SDAI_Application_instance * inst = 0;
9598
positionAndSection ps;
9699
sectionID sid;
97-
inst = _instancesLoaded.find( id );
100+
SDAI_Application_instance * inst = _instancesLoaded.find( id );
98101
instanceStreamPos_t::cvector * cv;
99102
if( !inst && 0 != ( cv = _instanceStreamPos.find( id ) ) ) {
100103
//FIXME _instanceStreamPos.find( id ) can return nonzero for nonexistent key?!

src/cllazyfile/lazyInstMgr.h

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ class instMgrAdapter;
2222

2323
class lazyInstMgr {
2424
protected:
25-
/** map from instance number to instances that it refers to
25+
/** multimap from instance number to instances that it refers to
2626
* \sa instanceRefs_pair
2727
*/
2828
instanceRefs_t _fwdInstanceRefs;
29-
/** map from instance number to instances that refer to it
29+
/** multimap from instance number to instances that refer to it
3030
* \sa instanceRefs_pair
3131
*/
3232
instanceRefs_t _revInstanceRefs;
@@ -39,6 +39,8 @@ class lazyInstMgr {
3939

4040
/** map from instance number to instance pointer (loaded instances only)
4141
* \sa instancesLoaded_pair
42+
* TODO should be multimap to allow use of instances in multiple data sections?
43+
* a unique instance ID (containing sectionID and instanceID) would also work
4244
*/
4345
instancesLoaded_t _instancesLoaded;
4446

@@ -65,7 +67,6 @@ class lazyInstMgr {
6567
public:
6668
lazyInstMgr();
6769
~lazyInstMgr();
68-
void addSchema( void ( *initFn )() ); //?
6970
void openFile( std::string fname );
7071

7172
void addLazyInstance( namedLazyInstance inst );
@@ -174,20 +175,25 @@ class lazyInstMgr {
174175
}
175176

176177
// TODO implement these
177-
//list all instances that one instance depends on (recursive)
178-
//std::vector<instanceID> instanceDependencies( instanceID id ); //set is faster?
179178

180-
// TODO implement these
181-
/* * the opposite of instanceDependencies() - all instances that are *not* dependencies of one particular instance
179+
// add another schema to registry
180+
//void addSchema( void ( *initFn )() );
181+
182+
//list all instances that one instance depends on (recursive)
183+
//std::vector<instanceID> instanceDependencies( instanceID id ); //set is faster?
184+
185+
/* * the opposite of instanceDependencies() - all instances that are *not* dependencies of one particular instance
182186
same as above, but with list of instances */
183-
//std::vector<instanceID> notDependencies(...)
184-
185-
//renumber instances so that they are numbered 1..N where N is the total number of instances
186-
//void normalizeInstanceIds();
187-
//find data that is repeated and eliminate, if possible
188-
//void eliminateDuplicates();
189-
//tell instMgr to use instances from this section
190-
//void useDataSection( sectionID id );
187+
//std::vector<instanceID> notDependencies(...)
188+
189+
//renumber instances so that they are numbered 1..N where N is the total number of instances
190+
//void normalizeInstanceIds();
191+
192+
//find data that is repeated and eliminate, if possible
193+
//void eliminateDuplicates();
194+
195+
//tell instMgr to use instances from this section
196+
//void useDataSection( sectionID id );
191197

192198
// TODO support references from one file to another
193199
};

test/cpp/schema_specific/inverse_attr2.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** \file inverse_attr.cc
1+
/** \file inverse_attr2.cc
22
** 1-Jul-2012
33
** Test inverse attributes; uses a tiny schema similar to a subset of IFC2x3
44
**

test/cpp/schema_specific/inverse_attr3.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77
#include <sc_cf.h>
88
extern void SchemaInit( class Registry & );
9-
#include "sc_version_string.h"
109
#include <lazyInstMgr.h>
1110
#include <lazyRefs.h>
1211
#include <sdai.h>

0 commit comments

Comments
 (0)