Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
60141ce
abstract class with non-virtual destructor
mpictor Oct 13, 2013
5b14529
warning about comparison that was always true
mpictor Oct 13, 2013
bf39d90
_mainRegistry wasn't initialized
mpictor Oct 13, 2013
ffd0da9
default to case insensitive when searching by instance type
mpictor Oct 13, 2013
6419146
functions to look up instance type in file
mpictor Dec 6, 2013
2d060e7
minor changes to judyLArray.h, judy.c
mpictor Dec 8, 2013
6004ba4
remove outdated comment from inverse_attr2.cc
mpictor Dec 9, 2013
9144443
doxify comments in classes_misc.c
mpictor Dec 15, 2013
259750e
split a big fprintf up for readability
mpictor Dec 15, 2013
57d3d2f
improve some comments for doxygen
mpictor Dec 17, 2013
7867505
macro CONST -> const
mpictor Dec 19, 2013
f3cd328
add a FIXME
mpictor Mar 6, 2014
6e636d1
add variable names to some prototypes in ErrorDescriptor header
mpictor Mar 16, 2014
d1062cd
use lazyInstMgr for inverse_attr3.cc
mpictor Oct 13, 2013
b1387b7
improve comments, a few other small changes that don't affect behavior
mpictor Oct 13, 2013
35ead38
include subsuperiterators header
mpictor Oct 28, 2013
0188910
add lazyRefs.h
mpictor Oct 28, 2013
b3b4646
trivial changes
mpictor Dec 6, 2013
ca56023
use lazyRefs in lazyInstMgr
mpictor Dec 8, 2013
bd402b2
add STEPinvAttrList for inv attr descs and setter/getter pointers
mpictor Dec 15, 2013
d5f693a
use STEPinvAttrList in sdaiApplication_Instance
mpictor Dec 15, 2013
e17938a
generated c++: static setter/getter for inverse attrs
mpictor Dec 15, 2013
ef2c01d
in generated c++: in constructors, populate iAttrs
mpictor Dec 15, 2013
647ecbc
in generated c++: ensure that pointers are zeroed (DataMemberInitiali…
mpictor Dec 16, 2013
1fddd17
in generated c++: ensure pointer is non-null before calling shallowCopy
mpictor Dec 17, 2013
4b3e433
in generated c++: create data members for null pointers
mpictor Dec 17, 2013
f6078d8
eliminate unused buffer
mpictor Dec 16, 2013
ebb7a92
use InstMgrBase instead of InstMgr in most stepcore classes
mpictor Dec 17, 2013
51acb99
whoops, don't pretend an instance can't be found if it is already loaded
mpictor Dec 17, 2013
7222c91
update inverse attr test 3
mpictor Dec 17, 2013
fdcdd5a
forgot to replace InstMgr with InstMgrBase in selects.c
mpictor Dec 17, 2013
d9c89b9
when printing initializers, skip derived attrs
mpictor Dec 17, 2013
a74dc1d
forgot to add 'const' keyword in several places after changing the ..…
mpictor Dec 19, 2013
800453e
split entity methods out of ATTRprint_access_methods into 2 new funcs
mpictor Dec 19, 2013
d4f13e0
replace entity access member code with call to new func
mpictor Dec 19, 2013
aaa1ca0
fix a few comments
mpictor Dec 19, 2013
23a5a62
formatting
mpictor Dec 19, 2013
2ae605d
rename var - 'class' may not be a C keyword, but it's confusing
mpictor Mar 1, 2014
64dd1d2
two libstructor_print calls missing neededAttr param
mpictor Mar 1, 2014
118d8b2
merge with instMgrBase commit
mpictor Mar 1, 2014
6cb750a
don't print const for getter
mpictor Mar 1, 2014
d6bb20d
use instMgrBase in SDAI_Select operator test
mpictor Mar 2, 2014
236778a
generated code: also print a const getter in class header when attr i…
mpictor Mar 2, 2014
d64bbc3
move count var so that derived attrs are counted
mpictor Mar 2, 2014
5c0bea3
add braces and indenting to two LISTdo..LISTod's
mpictor Mar 2, 2014
3132089
note that unity headers are probably useless since the main schema he…
mpictor Mar 2, 2014
4a01038
fix a couple comments
mpictor Mar 2, 2014
cd08570
print const and non-const getters for select attrs
mpictor Mar 2, 2014
f638355
move string/binary access methods into 2 small funcs
mpictor Mar 2, 2014
47d42ad
invert sense of test in logging code - wouldn't print unless null
mpictor Mar 2, 2014
521a999
change const getter for entity attr's
mpictor Mar 2, 2014
62ef3c6
add const getter for string/bin attr's
mpictor Mar 2, 2014
14d7b32
remove duplicate function prototypes that masked a signature change
mpictor Mar 4, 2014
ea339e2
exp2cxx: move select getters into own function, print const and non-c…
mpictor Mar 4, 2014
9cf54cf
add attrIsObj(), which returns true if const and non-const methods ar…
mpictor Mar 4, 2014
acdc338
static setter/getter won't always have the same signature
mpictor Mar 4, 2014
ea24200
make STEPinvAttrList work with the new setter/getter variants
mpictor Mar 4, 2014
b9db456
CONST -> const in a few more places
mpictor Mar 4, 2014
6117e53
move much of ATTRprint_access_methods into a series of smaller funcs
mpictor Mar 4, 2014
3133165
modify const-ness in AGGRprint_access_methods
mpictor Mar 4, 2014
9e1d078
add 2 protos to classes_attribute header
mpictor Mar 4, 2014
66deaaf
change behavior of attrIsObj() fn in classes_attribute
mpictor Mar 4, 2014
73b3c1b
fix assertion - can either be aggregate or instance
mpictor Mar 6, 2014
06bfc7d
handle both aggr and non-aggr inverses
mpictor Mar 6, 2014
b31ffa3
more changes to attrIsObj()
mpictor Mar 6, 2014
6955a03
check for both aggr and non-aggr inverse attributes
mpictor Mar 16, 2014
4bde538
add comment with express that fails
mpictor Mar 16, 2014
4093158
fix test dependency so 'make test ARGS=-jN' works
mpictor Mar 30, 2014
7089bdb
when loading instance dependencies, seek to original position afterwards
mpictor Mar 30, 2014
9db1170
improve some comments in lazy loading code
mpictor Mar 30, 2014
674fa94
delete the array of names after creating a STEPcomplex
mpictor Mar 30, 2014
c2c0a64
reformat some error message code, add one message for complex insts
mpictor Mar 30, 2014
7842742
redo some comments
mpictor May 11, 2014
4df86e5
schema name changed for some p21 tests - update it
mpictor May 11, 2014
1e95f8f
remove LIBcopy_constructor() - unused since 1992(!)
mpictor May 18, 2014
7ae3434
indents in generated code
mpictor May 19, 2014
168e7a9
split up a 32-line fprintf
mpictor May 19, 2014
712d965
improve comments, whitespace
mpictor Jun 1, 2014
01db378
silence a signed-unsigned warning by using size_t
mpictor Jun 1, 2014
14689c6
split ENTITYprint_new() into two, print into different files
mpictor Jun 1, 2014
c6d8417
initialize entity iAttrs using eDesc
mpictor Jun 1, 2014
2374029
cleanup
mpictor Jun 1, 2014
65c703b
work on inverse attrs
mpictor Aug 21, 2014
98283dc
more work on inverse attrs, code generation
mpictor Nov 29, 2014
9efd75e
add some small schemas and a .p21; should be examined, maybe moved/si…
mpictor Nov 29, 2014
c8cfac3
some types still print in SdaiAll
mpictor Nov 29, 2014
86bbc32
cleanup
mpictor Nov 29, 2014
d36d12c
fix failing schema
mpictor Dec 8, 2014
0b42b2f
oops, move eDesc initialization back into SdaiAll
mpictor Dec 8, 2014
7976c8b
loop through ed's with inverse attrs, connecting them to what they po…
mpictor Dec 8, 2014
febbb63
allow const or non-const for ed iter
mpictor Dec 8, 2014
c91109b
add functions to access schema class members
mpictor Dec 8, 2014
87c66bb
flesh out InitIAttrs() in eDesc, instance
mpictor Dec 8, 2014
31bf315
const correctness in superInvAttrIter
mpictor Dec 8, 2014
5df2f69
inching forward on inverse attrs
mpictor Dec 22, 2014
921de86
closer...
mpictor Dec 22, 2014
9313b8e
move some attr-specific stuff from classes_entity to classes_attribut…
mpictor Dec 23, 2014
ff3fd1f
_complex is now bool, not int - update STEPcomplex ctors
mpictor Dec 26, 2014
6bac26d
add index to struct Variable_, fix some whitespace
mpictor Dec 26, 2014
37901af
redo attribute numbering, print inverse attr access members separately
mpictor Dec 26, 2014
efb8285
don't print code for inverse data members, they're in iAMap now
mpictor Dec 26, 2014
8273ce1
lazyRefs works now
mpictor Dec 26, 2014
5f702fb
fix dumpComplexInst func, stupid mistake - was using wrong data member
mpictor Dec 26, 2014
653625f
fix crash with lazy loading and unexpected newlines, found in cd209 f…
mpictor Dec 26, 2014
e74d4dc
fix inverse attr initialization; attr was being found but it wasn't e…
mpictor Dec 26, 2014
50452e8
fix inv attr code in SDAI_Application_instance
mpictor Dec 26, 2014
dfe69a9
bug in superInvAttrIter allowed null pointer return for ia
mpictor Dec 26, 2014
bfbd8df
minor cleanup
mpictor Dec 26, 2014
0f5179e
oops, forgot an include
mpictor Dec 26, 2014
c8f14a0
bump version (0.8), update AUTHORS, NEWS for v0.8, add travis-ci buil…
mpictor Dec 26, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,26 @@ http://brlcad.svn.sourceforge.net/viewvc/brlcad/brlcad/trunk/src/other/step/?vie
In alphabetical order:
Bertucat, Roch (rbertucat)
Bowman, W. Keith (indianlarry)
da Costa, Raphael Kubo (rakuco)
DeGraw, Jason (jasondegraw)
Easterbrook, Zach (lainiwakurax)
Greenwald, Erik (erikg, erikgreenwald)
Horler, Chris (cshorler)
Lanning, Craig (craigl64)
Loman, David (davidloman)
McDonald, Rob (ramcdona)
Mittal, Pulkit (hoiji09)
Morrison, Christopher Sean (sean, morrison, brlcad)
Paviot, Thomas (tpaviot)
Pictor, Mark (mpictor)
Reed, Nick (nickreed)
Shah, Kesha (kesha)
Shah, Kesha (kesha, keshashah)
Thomas, Dawn (homovulgaris, madant)
Wouters, Dave (davyw)
Yapp, Clifford (starseeker)

Special thanks:
Hunten, Keith (Lockheed Martin)
Lubbell, Joshua (NIST)
Stirk, Charlie (CostVision)
Thurman, Tom (TRThurman)
Expand Down
21 changes: 21 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
STEPcode -- http://github.com/stepcode/stepcode -- http://stepcode.org
************************************************************************
Release 0.8 (December, 2014)

New since v0.7:
* handle diamond inheritance, derived Attributes
* rename fedex_python, fedex_plus to exp2py, exp2cxx
* many changes to the pretty printer, due to use in reformatting draft
and IS schemas (Thanks Tom!)
* parser was also changed due to errors caught while pretty printing
- we can be much more confident that the parser is correct now
* fix incorrect quoting of timestamp in p21 header
* fix various copy constructors and ShallowCopy() members
* split generated code into many small files
- far easier to open generated code in editors
- support more compilers
- small files are combined (via #include statements) into a few
large files for faster "unitary" builds, if the compiler can handle it
- unitary builds are faster than the previous builds
* most compiler warnings fixed
* finally, all tests pass!

************************************************************************
Release 0.7 (April, 2013)

Expand Down
7 changes: 5 additions & 2 deletions README
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Travis-CI build status:
[![Build Status](https://travis-ci.org/stepcode/stepcode.svg?branch=master)](https://travis-ci.org/stepcode/stepcode)

***********************************************************************
STEPcode v0.7 -- stepcode.org, github.com/stepcode/stepcode
STEPcode v0.8 -- stepcode.org, github.com/stepcode/stepcode

* What is STEPcode? SC reads ISO10303-11 EXPRESS schemas and generates
C++ source code that can read and write Part 21 files conforming
Expand Down Expand Up @@ -54,4 +57,4 @@ Download astyle from http://sourceforge.net/projects/astyle/files/astyle/

***********************************************************************

For more info, see the wiki.
For more info, see the wiki.
2 changes: 1 addition & 1 deletion SC_VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7
0.8
2 changes: 1 addition & 1 deletion cmake/SC_CXX_schema_macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ macro(SCHEMA_TESTS)
COMMAND ${CMAKE_COMMAND} --build .
--target lazy_${PROJECT_NAME}
--config $<CONFIGURATION>)
set_tests_properties(build_lazy_cpp_${PROJECT_NAME} PROPERTIES DEPENDS generate_cpp_${PROJECT_NAME} LABELS cpp_schema_build)
set_tests_properties(build_lazy_cpp_${PROJECT_NAME} PROPERTIES DEPENDS build_cpp_${PROJECT_NAME} LABELS cpp_schema_build)
endif(NOT WIN32)
endmacro(SCHEMA_TESTS)

Expand Down
5 changes: 3 additions & 2 deletions include/express/variable.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ typedef struct Variable_ * Variable;
/***************************/

struct Variable_ {
Expression name; /**< Symbol is inside of 'name' */
Expression name; /**< Symbol is inside of 'name' */
Type type;
Expression initializer; /**< or 'derived' */
int offset; /**< used for attr order in Entitys, and for decl order in LOCAL vars. these two uses should never conflict! */
int offset; /**< used for attr order in Entitys, and for decl order in LOCAL vars. these two uses should never conflict! */
int idx; /**< used in exp2cxx to simplify calculation of attrDescriptor names in generated code */

struct {
unsigned int optional : 1; /**< OPTIONAL keyword */
Expand Down
3 changes: 2 additions & 1 deletion src/base/judy/src/judy.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,8 +903,9 @@ JudySlot * judy_last( Judy * judy, JudySlot next, unsigned int off, unsigned int
JudySlot * judy_end( Judy * judy ) {
judy->level = 0;
return judy_last( judy, *judy->root, 0, 0 );
} // judy_nxt: return next entry
}

// judy_nxt: return next entry
JudySlot * judy_nxt( Judy * judy ) {
JudySlot * table, *inner;
int slot, size, cnt;
Expand Down
20 changes: 12 additions & 8 deletions src/base/judy/src/judyLArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ struct judylKVpair {
*/
template< typename JudyKey, typename JudyValue >
class judyLArray {
public:
typedef judylKVpair< JudyKey, JudyValue > pair;
protected:
Judy * _judyarray;
unsigned int _maxLevels, _depth;
JudyValue * _lastSlot;
JudyKey _buff[1];
bool _success;
pair _kv;
public:
typedef judylKVpair< JudyKey, JudyValue > pair;
judyLArray(): _maxLevels( sizeof( JudyKey ) ), _depth( 1 ), _lastSlot( 0 ), _success( true ) {
assert( sizeof( JudyKey ) == JUDY_key_size && "JudyKey *must* be the same size as a pointer!" );
assert( sizeof( JudyValue ) == JUDY_key_size && "JudyValue *must* be the same size as a pointer!" );
Expand All @@ -55,9 +57,12 @@ class judyLArray {
judy_close( _judyarray );
}

void clear() {
void clear( bool deleteContents = false ) {
JudyKey key = 0;
while( 0 != ( _lastSlot = ( JudyValue * ) judy_strt( _judyarray, ( const unsigned char * ) &key, 0 ) ) ) {
if( deleteContents ) {
delete *_lastSlot;
}
judy_del( _judyarray );
}
}
Expand Down Expand Up @@ -112,18 +117,17 @@ class judyLArray {
}

/// retrieve the key-value pair for the most recent judy query.
inline const pair mostRecentPair() {
pair kv;
inline const pair & mostRecentPair() {
judy_key( _judyarray, ( unsigned char * ) _buff, _depth * JUDY_key_size );
if( _lastSlot ) {
kv.value = *_lastSlot;
_kv.value = *_lastSlot;
_success = true;
} else {
kv.value = ( JudyValue ) 0;
_kv.value = ( JudyValue ) 0;
_success = false;
}
kv.key = _buff[0];
return kv;
_kv.key = _buff[0];
return _kv;
}

/// retrieve the first key-value pair in the array
Expand Down
2 changes: 1 addition & 1 deletion src/cllazyfile/headerSectionReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class SC_LAZYFILE_EXPORT headerSectionReader: public sectionReader {
return _headerInstances;
}

~headerSectionReader() {
virtual ~headerSectionReader() {
//FIXME delete each instance?! maybe add to clear, since it iterates over everything already
//enum clearHow { rawData, deletePointers }
_headerInstances->clear();
Expand Down
11 changes: 6 additions & 5 deletions src/cllazyfile/instMgrHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
* This class is used when creating SDAI_Application_instance's and using a lazyInstMgr. It is returned
* by instMgrAdapter. SDAI_Application_instance only uses the GetSTEPentity function.
*/
class mgrNodeHelper: protected MgrNode {
class mgrNodeHelper: public MgrNodeBase {
protected:
lazyInstMgr * _lim;
instanceID _id;
public:
mgrNodeHelper( lazyInstMgr * lim ) {
_lim = lim;
_id = 0;
prev = next = 0;
}
inline void setInstance( instanceID id ) {
_id = id;
}
inline SDAI_Application_instance * GetSTEPentity() {
// unsigned int c = _lim->countDataSections();
return _lim->loadInstance( _id );
return _lim->loadInstance( _id, true );
}
};

Expand All @@ -40,13 +40,14 @@ class mgrNodeHelper: protected MgrNode {
* when an instance is looked up, this uses lazyInstMgr to load it, and then returns a pointer to it.
*/

class instMgrAdapter: public InstMgr {
class instMgrAdapter: public InstMgrBase {
protected:
mgrNodeHelper _mn;
public:
instMgrAdapter( lazyInstMgr * lim ): InstMgr( 0 ), _mn( lim ) {}
instMgrAdapter( lazyInstMgr * lim ): InstMgrBase(), _mn( lim ) {}

inline mgrNodeHelper * FindFileId( int fileId ) {
//TODO check if fileId exists. if not, return null
_mn.setInstance( fileId );
return &_mn;
}
Expand Down
44 changes: 35 additions & 9 deletions src/cllazyfile/lazyInstMgr.cc
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
#include "lazyTypes.h"
#include "lazyInstMgr.h"
#include "Registry.h"
#include <SubSuperIterators.h>
#include "SdaiSchemaInit.h"
#include "instMgrHelper.h"
#include "lazyRefs.h"

lazyInstMgr::lazyInstMgr() {
_headerRegistry = new Registry( HeaderSchemaInit );
_instanceTypes = new instanceTypes_t( 255 ); //NOTE arbitrary max of 255 chars for a type name
_lazyInstanceCount = 0;
_loadedInstanceCount = 0;
_longestTypeNameLen = 0;
_mainRegistry = 0;
_errors = new ErrorDescriptor();
_ima = new instMgrAdapter( this );
}
Expand Down Expand Up @@ -38,16 +41,20 @@ sectionID lazyInstMgr::registerDataSection( lazyDataSectionReader * sreader ) {

void lazyInstMgr::addLazyInstance( namedLazyInstance inst ) {
_lazyInstanceCount++;
assert( inst.loc.begin > 0 && inst.loc.instance > 0 && inst.loc.section >= 0 );
assert( inst.loc.begin > 0 && inst.loc.instance > 0 );
int len = strlen( inst.name );
if( len > _longestTypeNameLen ) {
_longestTypeNameLen = len;
_longestTypeName = inst.name;
}
_instanceTypes->insert( inst.name, inst.loc.instance );
/* store 16 bits of section id and 48 of instance offset into one 64-bit int
* TODO: check and warn if anything is lost (in calling code?)
* does 32bit need anything special?
** TODO: check and warn if anything is lost (in calling code?)
** does 32bit need anything special?
**
** create conversion class?
** could then initialize conversion object with number of bits
** also a good place to check for data loss
*/
positionAndSection ps = inst.loc.section;
ps <<= 48;
Expand Down Expand Up @@ -85,18 +92,29 @@ unsigned long lazyInstMgr::getNumTypes() const {
}

void lazyInstMgr::openFile( std::string fname ) {
_files.push_back( new lazyFileReader( fname, this, _files.size() ) );
//don't want to hold a lock for the entire time we're reading the file.
//create a place in the vector and remember its location, then free lock
///FIXME begin atomic op
size_t i = _files.size();
_files.push_back( (lazyFileReader * ) 0 );
///FIXME end atomic op
lazyFileReader * lfr = new lazyFileReader( fname, this, i );
_files[i] = lfr;
/// TODO resolve inverse attr references
//between instances, or eDesc --> inst????
}

SDAI_Application_instance * lazyInstMgr::loadInstance( instanceID id ) {
SDAI_Application_instance * lazyInstMgr::loadInstance( instanceID id, bool reSeek ) {
assert( _mainRegistry && "Main registry has not been initialized. Do so with initRegistry() or setRegistry()." );
SDAI_Application_instance * inst = 0;
std::streampos oldPos;
positionAndSection ps;
sectionID sid;
inst = _instancesLoaded.find( id );
SDAI_Application_instance * inst = _instancesLoaded.find( id );
if( inst ) {
return inst;
}
instanceStreamPos_t::cvector * cv;
if( !inst && 0 != ( cv = _instanceStreamPos.find( id ) ) ) {
//FIXME _instanceStreamPos.find( id ) can return nonzero for nonexistent key?!
if( 0 != ( cv = _instanceStreamPos.find( id ) ) ) {
switch( cv->size() ) {
case 0:
std::cerr << "Instance #" << id << " not found in any section." << std::endl;
Expand All @@ -107,7 +125,13 @@ SDAI_Application_instance * lazyInstMgr::loadInstance( instanceID id ) {
off = ps & 0xFFFFFFFFFFFFULL;
sid = ps >> 48;
assert( _dataSections.size() > sid );
if( reSeek ) {
oldPos = _dataSections[sid]->tellg();
}
inst = _dataSections[sid]->getRealInstance( _mainRegistry, off, id );
if( reSeek ) {
_dataSections[sid]->seekg( oldPos );
}
break;
default:
std::cerr << "Instance #" << id << " exists in multiple sections. This is not yet supported." << std::endl;
Expand All @@ -116,6 +140,8 @@ SDAI_Application_instance * lazyInstMgr::loadInstance( instanceID id ) {
if( ( inst ) && ( inst != & NilSTEPentity ) ) {
_instancesLoaded.insert( id, inst );
_loadedInstanceCount++;
lazyRefs lr( this, inst );
lazyRefs::referentInstances_t insts = lr.result();
} else {
std::cerr << "Error loading instance #" << id << "." << std::endl;
}
Expand Down
Loading