formatting, dead code
This commit is contained in:
1 parent
1a130a1361
commit
657a2831f2
16 files changed
+121
-507
No files matched your search
+15
-217
@@ -10,8 +10,6 @@
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* $Id: STEPfile.cc,v 3.0.1.10 1998/02/17 18:04:30 sauderd Exp $ */
|
||||
|
||||
/********************************************************************
|
||||
TODO LIST:
|
||||
- ReadHeader doesn't merge the information from more than one instance
|
||||
@@ -1709,15 +1707,7 @@ STEPfile::CreateSubSuperInstance( istream & in, int fileid, ErrorDescriptor & e
|
||||
entNmArr[enaIndex] = 0;
|
||||
schemaName( schnm );
|
||||
|
||||
#ifdef __O3DB__
|
||||
obj = new STEPcomplex( _reg, ( const std::string ** )entNmArr, fileid,
|
||||
schnm );
|
||||
#else
|
||||
obj = new STEPcomplex( &_reg, ( const std::string ** )entNmArr, fileid,
|
||||
schnm );
|
||||
#endif
|
||||
|
||||
// SkipInstance(in, tmpstr);
|
||||
obj = new STEPcomplex( &_reg, ( const std::string ** )entNmArr, fileid, schnm );
|
||||
|
||||
if( obj->Error().severity() <= SEVERITY_WARNING ) {
|
||||
// If obj is not legal, record its error info and delete it:
|
||||
@@ -1813,25 +1803,13 @@ STEPfile::ReadScopeInstances( istream & in ) {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Severity
|
||||
STEPfile::ReadSubSuperInstance (istream& in)
|
||||
{
|
||||
std::string tmp;
|
||||
SkipInstance(in, tmp);
|
||||
return SEVERITY_NULL;
|
||||
}
|
||||
*/
|
||||
|
||||
#ifdef junk
|
||||
void
|
||||
ReadEntityError( char c, int i, istream & in ) {
|
||||
//FIXME: do we keep this?
|
||||
void ReadEntityError( char c, int i, istream & in ) {
|
||||
char errStr[BUFSIZ];
|
||||
errStr[0] = '\0';
|
||||
|
||||
/* sprintf(errStr, " for instance #%d : %s\n", STEPfile_id, EntityName());*/
|
||||
/* _error.AppendToDetailMsg(errStr);*/
|
||||
|
||||
if( ( i >= 0 ) && ( i < attributes.list_length() ) ) { // i is an attribute
|
||||
sprintf( errStr, " invalid data for type \'%s\'\n",
|
||||
attributes[i].TypeName() );
|
||||
@@ -1851,8 +1829,6 @@ ReadEntityError( char c, int i, istream & in ) {
|
||||
_error.AppendToDetailMsg( " data lost looking for end of entity:" );
|
||||
|
||||
// scan over the rest of the instance and echo it
|
||||
// cerr << " ERROR Trying to find the end of the ENTITY to recover...\n";
|
||||
// cerr << " skipping the following input:\n";
|
||||
|
||||
in.clear();
|
||||
int foundEnd = 0;
|
||||
@@ -1864,14 +1840,11 @@ ReadEntityError( char c, int i, istream & in ) {
|
||||
while( in.good() && ( c != ')' ) ) {
|
||||
in.get( c );
|
||||
tmp.Append( c );
|
||||
// cerr << c;
|
||||
}
|
||||
if( in.good() && ( c == ')' ) ) {
|
||||
in >> ws; // skip whitespace
|
||||
in.get( c );
|
||||
tmp.Append( c );
|
||||
// cerr << c;
|
||||
// cerr << "\n";
|
||||
if( c == ';' ) {
|
||||
foundEnd = 1;
|
||||
}
|
||||
@@ -1978,7 +1951,6 @@ STEPfile::ReadInstance( istream & in, ostream & out, std::string & cmtStr,
|
||||
//check for subtype/supertype record
|
||||
if( c == '(' ) {
|
||||
// TODO
|
||||
// ReadSubSuperInstance(in);
|
||||
sev = obj->STEPread( fileid, idIncrNum, &instances(), in, currSch,
|
||||
useTechCor );
|
||||
|
||||
@@ -1992,7 +1964,6 @@ STEPfile::ReadInstance( istream & in, ostream & out, std::string & cmtStr,
|
||||
if( c != 'E' ) {
|
||||
in >> c; // read the semicolon
|
||||
}
|
||||
// return ENTITY_NULL;
|
||||
} else {
|
||||
ReadTokenSeparator( in, &cmtStr );
|
||||
c = in.peek();
|
||||
@@ -2212,10 +2183,7 @@ STEPfile::WriteValuePairsFile( ostream & out, int validate, int clearError,
|
||||
}
|
||||
}
|
||||
|
||||
// out << FILE_DELIM << "\n";
|
||||
// WriteHeader(out);
|
||||
WriteValuePairsData( out, writeComments, mixedCase );
|
||||
// out << END_FILE_DELIM << "\n";
|
||||
return rval;
|
||||
}
|
||||
|
||||
@@ -2250,21 +2218,10 @@ STEPfile::HeaderId( const char * name ) {
|
||||
|
||||
/***************************
|
||||
***************************/
|
||||
int
|
||||
STEPfile::HeaderIdOld( const char * name ) {
|
||||
/*
|
||||
char* nms[5] =
|
||||
{
|
||||
"FILE_IDENTIFICATION\0",
|
||||
"FILE_DESCRIPTION\0",
|
||||
"IMP_LEVEL\0",
|
||||
"CLASSIFICATION\0",
|
||||
"MAXSIG\0"
|
||||
};
|
||||
*/
|
||||
int STEPfile::HeaderIdOld( const char * name ) {
|
||||
const char * nms[5];
|
||||
nms[0] = "FILE_IDENTIFICATION",
|
||||
nms[1] = "FILE_DESCRIPTION";
|
||||
nms[1] = "FILE_DESCRIPTION";
|
||||
nms[2] = "IMP_LEVEL";
|
||||
nms[3] = "CLASSIFICATION";
|
||||
nms[4] = "MAXSIG";
|
||||
@@ -2293,7 +2250,6 @@ STEPfile::WriteHeader( ostream & out ) {
|
||||
SCLP23( Application_instance )* se;
|
||||
int n = _headerInstances->InstanceCount();
|
||||
for( int i = 0; i < n; ++i ) {
|
||||
/* se = (*_headerInstances)[i]->GetApplication_instance();*/
|
||||
se = _headerInstances->GetMgrNode( i ) ->GetApplication_instance();
|
||||
if( !(
|
||||
( se->StepFileId() == HeaderId( "File_Name" ) ) ||
|
||||
@@ -2302,8 +2258,6 @@ STEPfile::WriteHeader( ostream & out ) {
|
||||
) )
|
||||
WriteHeaderInstance(
|
||||
_headerInstances->GetMgrNode( i )->GetApplication_instance(), out );
|
||||
/* WriteHeaderInstance((*_headerInstances)[i] -> GetApplication_instance(),
|
||||
out );*/
|
||||
}
|
||||
out << "ENDSEC;\n";
|
||||
}
|
||||
@@ -2335,9 +2289,6 @@ STEPfile::WriteHeaderInstanceFileName( ostream & out ) {
|
||||
SCLP23( Application_instance ) *se = 0;
|
||||
se = _headerInstances->GetApplication_instance( "File_Name" );
|
||||
if( se == ENTITY_NULL ) {
|
||||
// ERROR: no File_Name instance in _headerInstances
|
||||
// create a File_Name instance
|
||||
// (p21DIS_File_name*)se = HeaderDefaultFileName();
|
||||
se = ( SCLP23( Application_instance ) * )HeaderDefaultFileName();
|
||||
}
|
||||
|
||||
@@ -2354,173 +2305,39 @@ STEPfile::WriteHeaderInstanceFileName( ostream & out ) {
|
||||
struct tm * timeptr = localtime( &t );
|
||||
char time_buf[26];
|
||||
strftime( time_buf, 26, "%Y-%m-%dT%H:%M:%S", timeptr );
|
||||
//s_String s = fn->time_stamp();
|
||||
//strncpy((char*)s,time_buf,27);
|
||||
fn->time_stamp( time_buf );
|
||||
|
||||
//output the values to the file
|
||||
WriteHeaderInstance( se, out );
|
||||
}
|
||||
|
||||
|
||||
/**************************************************
|
||||
DAVE, should this section be deleted now?
|
||||
|
||||
p21DIS_File_name * fn;
|
||||
int fileid = HeaderId("File_Name");
|
||||
MgrNode * mn = _headerInstances->FindFileId(fileid);
|
||||
if (!mn)
|
||||
{
|
||||
// ERROR: no File_Name instance in _headerInstances
|
||||
// create a File_Name instance
|
||||
(SCLP23(Application_instance)*)fn = HeaderDefaultFileName();
|
||||
}
|
||||
else
|
||||
{
|
||||
(SCLP23(Application_instance)*)fn = _headerInstances->GetApplication_instance(mn);
|
||||
}
|
||||
|
||||
// Write the values for the FileName instance to the ostream
|
||||
std::string tmp;
|
||||
out << StrToUpper (fn->EntityName()) << "(";
|
||||
|
||||
// write name
|
||||
//out << "\'" << (char*)fn->name() << "\',";
|
||||
SCLP23(String) * s = new SCLP23(String)((char*)fn->name());
|
||||
s->STEPwrite(out);
|
||||
delete s;
|
||||
out << ",";
|
||||
|
||||
// write time_stamp (as specified in ISO Standard 8601)
|
||||
// output the current system time to the file, using the following format:
|
||||
// example: '1994-04-12 15:27:46'
|
||||
// for Calendar Date, 12 April 1994, 27 minute 46 seconds past 15 hours
|
||||
time_t t = time(NULL);
|
||||
struct tm *timeptr = localtime(&t);
|
||||
char time_buf[26];
|
||||
strftime(time_buf,26,"%Y-%m-%d %H:%M:%S",timeptr);
|
||||
out << '\'' << time_buf << "\',";
|
||||
|
||||
// write author
|
||||
fn->author().STEPwrite(out);
|
||||
out << ",";
|
||||
|
||||
// write organization
|
||||
fn->organization().STEPwrite(out);
|
||||
out << ",";
|
||||
|
||||
// write preprocessor_version
|
||||
s = new SCLP23(String)((char*)fn->preprocessor_version());
|
||||
s->STEPwrite(out);
|
||||
delete s;
|
||||
out << ",";
|
||||
|
||||
// write originating_system
|
||||
s = new SCLP23(String)((char*)fn->originating_system());
|
||||
s->STEPwrite(out);
|
||||
delete s;
|
||||
out << ",";
|
||||
|
||||
// write authorization
|
||||
s = new SCLP23(String)((char*)fn->authorization());
|
||||
s->STEPwrite(out);
|
||||
delete s;
|
||||
out << ");\n";
|
||||
|
||||
}
|
||||
**************************************************/
|
||||
|
||||
|
||||
void
|
||||
STEPfile::WriteHeaderInstanceFileDescription( ostream & out ) {
|
||||
void STEPfile::WriteHeaderInstanceFileDescription( ostream & out ) {
|
||||
// Get the FileDescription instance from _headerInstances
|
||||
SCLP23( Application_instance ) *se = 0;
|
||||
se = _headerInstances->GetApplication_instance( "File_Description" );
|
||||
if( se == ENTITY_NULL ) {
|
||||
// ERROR: no File_Name instance in _headerInstances
|
||||
// create a File_Name instance
|
||||
// (s_File_Description*)se = HeaderDefaultFileDescription();
|
||||
se = ( SCLP23( Application_instance ) * )HeaderDefaultFileDescription();
|
||||
}
|
||||
|
||||
WriteHeaderInstance( se, out );
|
||||
|
||||
/**************************************************
|
||||
|
||||
p21DIS_File_description * fd;
|
||||
int fileid = HeaderId("File_Description");
|
||||
MgrNode * mn = _headerInstances->FindFileId(fileid);
|
||||
if (!mn)
|
||||
{
|
||||
// ERROR: no File_Description instance in _headerInstances
|
||||
// create a File_Description instance
|
||||
(SCLP23(Application_instance)*)fd = HeaderDefaultFileDescription();
|
||||
}
|
||||
else
|
||||
{
|
||||
(SCLP23(Application_instance)*)fd = _headerInstances->GetApplication_instance(mn);
|
||||
}
|
||||
// Write the values for the FileDescription instance to the ostream
|
||||
out << StrToUpper (fd->EntityName()) << "(";
|
||||
|
||||
//write description
|
||||
fd->description().STEPwrite(out,&_error,a_16DESCRIPTION);
|
||||
out << ",";
|
||||
|
||||
//write implementation_level
|
||||
SCLP23(String) *s = new SCLP23(String)((char*)fd->implementation_level());
|
||||
s->STEPwrite(out);
|
||||
delete s;
|
||||
out << ");\n";
|
||||
|
||||
**************************************************/
|
||||
}
|
||||
|
||||
void
|
||||
STEPfile::WriteHeaderInstanceFileSchema( ostream & out ) {
|
||||
// Get the FileName instance from _headerInstances
|
||||
void STEPfile::WriteHeaderInstanceFileSchema( ostream & out ) {
|
||||
SCLP23( Application_instance ) *se = 0;
|
||||
|
||||
// Get the FileName instance from _headerInstances
|
||||
se = _headerInstances->GetApplication_instance( "File_Schema" );
|
||||
if( se == ENTITY_NULL ) {
|
||||
// ERROR: no File_Name instance in _headerInstances
|
||||
// create a File_Name instance
|
||||
// (p21DIS_File_schema*)se = HeaderDefaultFileSchema();
|
||||
se = ( SCLP23( Application_instance ) * ) HeaderDefaultFileSchema();
|
||||
}
|
||||
|
||||
WriteHeaderInstance( se, out );
|
||||
|
||||
/**************************************************
|
||||
|
||||
p21DIS_File_schema * fs;
|
||||
int fileid = HeaderId("File_Schema");
|
||||
MgrNode * mn = _headerInstances->FindFileId(fileid);
|
||||
if (!mn)
|
||||
{
|
||||
// ERROR: no File_Schema instance in _headerInstances
|
||||
// create a File_Schema instance
|
||||
(SCLP23(Application_instance)*)fs = HeaderDefaultFileSchema();
|
||||
}
|
||||
else
|
||||
{
|
||||
(SCLP23(Application_instance)*)fs = _headerInstances->GetApplication_instance(mn);
|
||||
}
|
||||
// Write the values for the FileName instance to the ostream
|
||||
out << StrToUpper (fs->EntityName()) << "(";
|
||||
|
||||
// write schema_identifiers
|
||||
fs->schema_identifiers().STEPwrite(out);
|
||||
out << ");\n";
|
||||
**************************************************/
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***************************
|
||||
***************************/
|
||||
|
||||
void
|
||||
STEPfile::WriteData( ostream & out, int writeComments ) {
|
||||
void STEPfile::WriteData( ostream & out, int writeComments ) {
|
||||
char currSch[BUFSIZ];
|
||||
currSch[0] = '\0';
|
||||
|
||||
@@ -2529,7 +2346,6 @@ STEPfile::WriteData( ostream & out, int writeComments ) {
|
||||
schemaName( currSch );
|
||||
int n = instances().InstanceCount();
|
||||
for( int i = 0; i < n; ++i )
|
||||
/* instances ()[i] -> GetApplication_instance()->STEPwrite(out);*/
|
||||
{
|
||||
instances().GetMgrNode( i )->GetApplication_instance()->STEPwrite( out, currSch, writeComments );
|
||||
}
|
||||
@@ -2544,18 +2360,12 @@ void
|
||||
STEPfile::WriteValuePairsData( ostream & out, int writeComments, int mixedCase ) {
|
||||
char currSch[BUFSIZ];
|
||||
currSch[0] = '\0';
|
||||
|
||||
// out << "DATA;\n";
|
||||
|
||||
schemaName( currSch );
|
||||
int n = instances().InstanceCount();
|
||||
for( int i = 0; i < n; ++i )
|
||||
/* instances ()[i] -> GetApplication_instance()->STEPwrite(out);*/
|
||||
{
|
||||
instances().GetMgrNode( i )->GetApplication_instance()->WriteValuePairs( out, currSch, writeComments, mixedCase );
|
||||
}
|
||||
|
||||
// out << "ENDSEC;\n";
|
||||
}
|
||||
|
||||
Severity
|
||||
@@ -2650,14 +2460,12 @@ STEPfile::AppendFile( istream * in, int useTechCor ) {
|
||||
// parsing. SO we are using istreams and this works, but could
|
||||
// be better.
|
||||
|
||||
// reset the error count so you\'re not counting things twice:
|
||||
// reset the error count so you're not counting things twice:
|
||||
_errorCount = 0;
|
||||
// delete in; // yikes -- deleted by caller
|
||||
istream * in2;
|
||||
if( !( ( in2 = OpenInputFile() ) && ( in2 -> good() ) ) ) {
|
||||
// if the stream is not readable, there's an error
|
||||
_error.AppendToUserMsg( "Cannot open file for 2nd pass -- No data read.\n" );
|
||||
// return total_insts;
|
||||
CloseInputFile( in2 );
|
||||
return SEVERITY_INPUT_ERROR;
|
||||
}
|
||||
@@ -2675,7 +2483,6 @@ STEPfile::AppendFile( istream * in, int useTechCor ) {
|
||||
break;
|
||||
|
||||
case WORKING_SESSION:
|
||||
// valid_insts = ReadWorkingData2 (*in2);
|
||||
valid_insts = ReadData2( *in2, useTechCor );
|
||||
break;
|
||||
default:
|
||||
@@ -2686,14 +2493,6 @@ STEPfile::AppendFile( istream * in, int useTechCor ) {
|
||||
|
||||
//check for "ENDSEC;"
|
||||
ReadTokenSeparator( *in2 );
|
||||
// keywd = GetKeyword(*in2,";", _error);
|
||||
// if ( strncmp (keywd, "ENDSEC;",strlen(keywd)) || !in2 -> good () )
|
||||
// {
|
||||
// _error.AppendToUserMsg("Unknown value in DATA section. Terminated parsing.\n\tvalue was: %s\n");
|
||||
// _error.AppendToUserMsg(keywd);
|
||||
// _error.GreaterSeverity(SEVERITY_WARNING);
|
||||
// }
|
||||
|
||||
if( total_insts != valid_insts ) {
|
||||
sprintf( errbuf, "%d invalid instances in file: %s\n",
|
||||
total_insts - valid_insts, ( ( FileName().compare( "-" ) == 0 ) ? "standard input" : FileName().c_str() ) );
|
||||
@@ -2722,6 +2521,8 @@ STEPfile::AppendFile( istream * in, int useTechCor ) {
|
||||
in2->get( c );
|
||||
if( c == ';' ) {
|
||||
;
|
||||
} else {
|
||||
//FIXME shouldn't *something* be done based upon the value of c? MAP, 9/2011
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2741,8 +2542,7 @@ STEPfile::AppendFile( istream * in, int useTechCor ) {
|
||||
|
||||
|
||||
|
||||
/***************************
|
||||
***************************/
|
||||
/******************************************************/
|
||||
Severity
|
||||
STEPfile::WriteWorkingFile( ostream & out, int clearError, int writeComments ) {
|
||||
SetFileType( WORKING_SESSION );
|
||||
@@ -2765,8 +2565,7 @@ STEPfile::WriteWorkingFile( ostream & out, int clearError, int writeComments ) {
|
||||
return _error.severity();
|
||||
}
|
||||
|
||||
/***************************
|
||||
***************************/
|
||||
/******************************************************/
|
||||
Severity
|
||||
STEPfile::WriteWorkingFile( const std::string filename, int clearError,
|
||||
int writeComments ) {
|
||||
@@ -2855,7 +2654,6 @@ STEPfile::AppendEntityErrorMsg( ErrorDescriptor * e ) {
|
||||
return SEVERITY_NULL;
|
||||
|
||||
default: {
|
||||
// cerr << e->UserMsg();
|
||||
cerr << e->DetailMsg();
|
||||
e->ClearErrorMsg();
|
||||
|
||||
|
||||
+4
-13
@@ -13,13 +13,6 @@
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* $Id: STEPfile.h,v 3.0.1.6 1998/02/17 18:04:30 sauderd Exp $ */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
/*#include <math.h>*/
|
||||
#include <instmgr.h>
|
||||
#include <Registry.h>
|
||||
#include <fstream>
|
||||
@@ -57,8 +50,6 @@ class STEPfile
|
||||
//header information
|
||||
InstMgr* _headerInstances;
|
||||
Registry *_headerRegistry;
|
||||
//Registry *_headerUserDefined;
|
||||
// Registry *_headerRegistryOld;
|
||||
|
||||
int _headerId; //STEPfile_id given to SCLP23(Application_instance) from header section
|
||||
|
||||
@@ -73,10 +64,10 @@ class STEPfile
|
||||
int _entsNotCreated; // num entities not created in first pass
|
||||
int _entsInvalid; // num entities that had invalid attr values
|
||||
int _entsIncomplete; // num entities that had missing attr values
|
||||
// (includes entities that had invalid values
|
||||
// for required attrs)
|
||||
int _entsWarning; // num entities that may have had problems
|
||||
// with attrs - reported as an attr user msg
|
||||
// (includes entities that had invalid values
|
||||
// for required attrs)
|
||||
int _entsWarning; // num entities that may have had problems
|
||||
// with attrs - reported as an attr user msg
|
||||
|
||||
// old errors
|
||||
int _errorCount;
|
||||
|
||||
@@ -11,19 +11,12 @@
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* $Id: STEPfile.inline.cc,v 3.0.1.4 1997/11/05 22:11:46 sauderd DP3.1 $ */
|
||||
|
||||
#include <STEPfile.h>
|
||||
#include <s_HEADER_SCHEMA.h>
|
||||
#include <STEPaggregate.h>
|
||||
|
||||
/* for strrchr */
|
||||
#include <cstring>
|
||||
|
||||
//#ifdef __GNUG__
|
||||
//#ifdef __SUNCPLUSPLUS__
|
||||
//#ifdef __OBJECTCENTER__
|
||||
//#ifdef __xlC__
|
||||
extern "C" {
|
||||
double ceil( double );
|
||||
}
|
||||
@@ -44,7 +37,6 @@ STEPfile::STEPfile( Registry & r, InstMgr & i, const std::string filename ) :
|
||||
SetFileType( VERSION_CURRENT );
|
||||
SetFileIdIncrement();
|
||||
_currentDir = new DirObj( "" );
|
||||
// _headerRegistry = new Registry(&s_HeaderSchemaInit);
|
||||
_headerRegistry = new Registry( HeaderSchemaInit );
|
||||
_headerInstances = new InstMgr;
|
||||
if( !filename.empty() ) {
|
||||
@@ -63,8 +55,7 @@ STEPfile::~STEPfile() {
|
||||
delete _headerInstances;
|
||||
}
|
||||
|
||||
int
|
||||
STEPfile::SetFileType( FileTypeCode ft ) {
|
||||
int STEPfile::SetFileType( FileTypeCode ft ) {
|
||||
FileType( ft );
|
||||
|
||||
switch( _fileType ) {
|
||||
@@ -72,12 +63,6 @@ STEPfile::SetFileType( FileTypeCode ft ) {
|
||||
ENTITY_NAME_DELIM = '@';
|
||||
FILE_DELIM = ( char * )"STEP;";
|
||||
END_FILE_DELIM = ( char * )"ENDSTEP;";
|
||||
/*DAS
|
||||
if (!_headerRegistryOld)
|
||||
_headerRegistryOld =
|
||||
new Registry(& s_Header_Section_Schema_N279Init);
|
||||
*/
|
||||
|
||||
break;
|
||||
case( VERSION_UNKNOWN ):
|
||||
case( VERSION_CURRENT ):
|
||||
@@ -117,19 +102,11 @@ const std::string STEPfile::TruncFileName( const std::string filename ) const {
|
||||
} else {
|
||||
return filename.substr(l);
|
||||
}
|
||||
// const char * tmp = strrchr( filename, '/' );
|
||||
// if( tmp ) {
|
||||
// return tmp++;
|
||||
// } else {
|
||||
// return filename;
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
/******************************************************/
|
||||
Severity
|
||||
STEPfile::ReadExchangeFile( const std::string filename, int useTechCor ) {
|
||||
Severity STEPfile::ReadExchangeFile( const std::string filename, int useTechCor ) {
|
||||
_error.ClearErrorMsg();
|
||||
_errorCount = 0;
|
||||
istream * in = OpenInputFile( filename );
|
||||
@@ -148,8 +125,7 @@ STEPfile::ReadExchangeFile( const std::string filename, int useTechCor ) {
|
||||
return rval;
|
||||
}
|
||||
|
||||
Severity
|
||||
STEPfile::AppendExchangeFile( const std::string filename, int useTechCor ) {
|
||||
Severity STEPfile::AppendExchangeFile( const std::string filename, int useTechCor ) {
|
||||
_error.ClearErrorMsg();
|
||||
_errorCount = 0;
|
||||
istream * in = OpenInputFile( filename );
|
||||
@@ -163,8 +139,7 @@ STEPfile::AppendExchangeFile( const std::string filename, int useTechCor ) {
|
||||
}
|
||||
|
||||
/******************************************************/
|
||||
Severity
|
||||
STEPfile::ReadWorkingFile( const std::string filename, int useTechCor ) {
|
||||
Severity STEPfile::ReadWorkingFile( const std::string filename, int useTechCor ) {
|
||||
_error.ClearErrorMsg();
|
||||
_errorCount = 0;
|
||||
istream * in = OpenInputFile( filename );
|
||||
@@ -184,8 +159,7 @@ STEPfile::ReadWorkingFile( const std::string filename, int useTechCor ) {
|
||||
}
|
||||
|
||||
|
||||
Severity
|
||||
STEPfile::AppendWorkingFile( const std::string filename, int useTechCor ) {
|
||||
Severity STEPfile::AppendWorkingFile( const std::string filename, int useTechCor ) {
|
||||
_error.ClearErrorMsg();
|
||||
_errorCount = 0;
|
||||
istream * in = OpenInputFile( filename );
|
||||
@@ -224,8 +198,6 @@ istream * STEPfile::OpenInputFile( const std::string filename ) {
|
||||
if( filename.compare( "-" ) == 0 ) {
|
||||
in = &std::cin;
|
||||
} else {
|
||||
// istream* in = new istream(FileName(), io_readonly, a_useonly);
|
||||
// port 29-Mar-1994 kcm
|
||||
in = new ifstream( FileName().c_str() );
|
||||
}
|
||||
|
||||
@@ -241,8 +213,7 @@ istream * STEPfile::OpenInputFile( const std::string filename ) {
|
||||
}
|
||||
|
||||
/******************************************************/
|
||||
void
|
||||
STEPfile::CloseInputFile( istream * in ) {
|
||||
void STEPfile::CloseInputFile( istream * in ) {
|
||||
if( in && *in != std::cin ) {
|
||||
delete in;
|
||||
}
|
||||
@@ -276,22 +247,19 @@ ofstream * STEPfile::OpenOutputFile( const std::string filename ) {
|
||||
return out;
|
||||
}
|
||||
|
||||
void
|
||||
STEPfile::CloseOutputFile( ostream * out ) {
|
||||
void STEPfile::CloseOutputFile( ostream * out ) {
|
||||
delete out;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/******************************************************/
|
||||
int
|
||||
STEPfile::IncrementFileId( int fileid ) {
|
||||
int STEPfile::IncrementFileId( int fileid ) {
|
||||
return ( fileid + FileIdIncr() );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
STEPfile::SetFileIdIncrement() {
|
||||
void STEPfile::SetFileIdIncrement() {
|
||||
if( instances().MaxFileId() < 0 ) {
|
||||
_fileIdIncr = 0;
|
||||
} else _fileIdIncr =
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* $Id: instmgr.cc,v 3.0.1.5 1997/11/05 22:11:42 sauderd DP3.1 $ */
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// InstMgr member functions
|
||||
@@ -19,7 +17,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <sdai.h>
|
||||
//#include <STEPentity.h>
|
||||
#include <instmgr.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -65,16 +62,12 @@ InstMgr::~InstMgr() {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void InstMgr::ClearInstances() {
|
||||
// delete master;
|
||||
// master = new MgrNodeArray();
|
||||
master->ClearEntries();
|
||||
sortedMaster->ClearEntries();
|
||||
maxFileId = -1;
|
||||
}
|
||||
|
||||
void InstMgr::DeleteInstances() {
|
||||
// delete master;
|
||||
// master = new MgrNodeArray();
|
||||
master->DeleteEntries();
|
||||
sortedMaster->ClearEntries();
|
||||
maxFileId = -1;
|
||||
|
||||
@@ -13,9 +13,7 @@
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* $Id: instmgr.h,v 3.0.1.4 1997/11/05 22:11:42 sauderd DP3.1 $ */
|
||||
|
||||
///// future? ////////////////
|
||||
///// future? TODO? ////////////////
|
||||
// InstMgr can maintain an undo list for the last operation
|
||||
// performed on a node
|
||||
// InstMgr can have a startUndo() and endUndo() so it knows when to
|
||||
@@ -23,10 +21,6 @@
|
||||
/////////////////////
|
||||
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
typedef unsigned boolean;
|
||||
extern char * EntityClassName ( char *);
|
||||
|
||||
@@ -35,7 +29,6 @@ extern char * EntityClassName ( char *);
|
||||
|
||||
#include <gennode.h>
|
||||
#include <gennodelist.h>
|
||||
//#include <gennode.inline.h>
|
||||
#include <gennodearray.h>
|
||||
|
||||
#include <mgrnode.h>
|
||||
|
||||
+19
-19
@@ -25,19 +25,19 @@ typedef struct Hash_Table * HashTable;
|
||||
|
||||
class Registry;
|
||||
extern char * EntityClassName ( char *);
|
||||
typedef void (* CF_init) (Registry &); // pointer to creation initialization
|
||||
typedef void (* CF_init) (Registry &); // pointer to creation initialization
|
||||
|
||||
class Registry {
|
||||
protected:
|
||||
HashTable primordialSwamp; // dictionary of EntityDescriptors
|
||||
HashTable active_schemas; // dictionary of Schemas
|
||||
HashTable active_types; // dictionary of TypeDescriptors
|
||||
ComplexCollect *col; // struct containing all complex entity info
|
||||
HashTable primordialSwamp; // dictionary of EntityDescriptors
|
||||
HashTable active_schemas; // dictionary of Schemas
|
||||
HashTable active_types; // dictionary of TypeDescriptors
|
||||
ComplexCollect *col; // struct containing all complex entity info
|
||||
|
||||
int entity_cnt,
|
||||
all_ents_cnt;
|
||||
HashEntry cur_entity;
|
||||
HashEntry cur_schema;
|
||||
HashEntry cur_entity;
|
||||
HashEntry cur_schema;
|
||||
HashEntry cur_type;
|
||||
|
||||
// used by AddEntity() and RemoveEntity() to deal with renamings of an
|
||||
@@ -56,22 +56,22 @@ class Registry {
|
||||
const Schema* FindSchema (const char *, int check_case =0) const;
|
||||
const TypeDescriptor* FindType (const char *, int check_case =0) const;
|
||||
|
||||
void AddEntity (const EntityDescriptor&);
|
||||
void AddSchema (const Schema&);
|
||||
void AddType (const TypeDescriptor&);
|
||||
void AddEntity (const EntityDescriptor&);
|
||||
void AddSchema (const Schema&);
|
||||
void AddType (const TypeDescriptor&);
|
||||
|
||||
void RemoveEntity (const char *);
|
||||
void RemoveSchema (const char *);
|
||||
void RemoveType (const char *);
|
||||
void RemoveEntity (const char *);
|
||||
void RemoveSchema (const char *);
|
||||
void RemoveType (const char *);
|
||||
|
||||
int GetEntityCnt ();
|
||||
int GetFullEntCnt () { return all_ents_cnt; }
|
||||
int GetEntityCnt ();
|
||||
int GetFullEntCnt () { return all_ents_cnt; }
|
||||
|
||||
void ResetEntities ();
|
||||
const EntityDescriptor * NextEntity ();
|
||||
void ResetEntities ();
|
||||
const EntityDescriptor * NextEntity ();
|
||||
|
||||
void ResetSchemas ();
|
||||
const Schema * NextSchema ();
|
||||
void ResetSchemas ();
|
||||
const Schema * NextSchema ();
|
||||
|
||||
void ResetTypes ();
|
||||
const TypeDescriptor * NextType ();
|
||||
|
||||
@@ -10,14 +10,11 @@
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* $Id: STEPaggregate.cc,v 3.0.1.7 1997/11/05 21:59:28 sauderd DP3.1 $ */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <read_func.h>
|
||||
#include <STEPaggregate.h>
|
||||
#include <STEPattribute.h>
|
||||
//#include <STEPentity.h>
|
||||
#include <instmgr.h>
|
||||
#include <ExpDict.h>
|
||||
|
||||
|
||||
@@ -9,18 +9,11 @@
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* $Id: STEPattribute.cc,v 3.0.1.9 1998/02/17 18:12:41 sauderd Exp $ */
|
||||
|
||||
//static char rcsid[] ="$Id: STEPattribute.cc,v 3.0.1.9 1998/02/17 18:12:41 sauderd Exp $";
|
||||
|
||||
|
||||
#include <read_func.h>
|
||||
#include <STEPattribute.h>
|
||||
//#include <sdai.h>
|
||||
#include <instmgr.h>
|
||||
#include <STEPundefined.h>
|
||||
#include <STEPaggregate.h>
|
||||
//#include <STEPentity.h>
|
||||
#include <ExpDict.h>
|
||||
#include <sdai.h>
|
||||
|
||||
|
||||
@@ -12,14 +12,8 @@
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* $Id: STEPattribute.h,v 3.0.1.8 1997/11/05 21:59:24 sauderd DP3.1 $ */
|
||||
|
||||
#include <sclprefixes.h>
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errordesc.h>
|
||||
#include <baseType.h>
|
||||
@@ -30,26 +24,18 @@
|
||||
// in STEPaggregate.cc and STEPattribute.cc
|
||||
#define REAL_NUM_PRECISION 15
|
||||
|
||||
//typedef unsigned short BOOLEAN;
|
||||
typedef double real;
|
||||
|
||||
class InstMgr;
|
||||
class SCLP23(Application_instance);
|
||||
class STEPaggregate;
|
||||
class SCLundefined;
|
||||
//class SCLP23(Enum);
|
||||
//class SCLP23(Select);
|
||||
//class SCLP23(Binary);
|
||||
//class SCLP23(String);
|
||||
|
||||
class TypeDescriptor;
|
||||
class AttrDescriptor;
|
||||
class EntityDescriptor;
|
||||
|
||||
#include <sstream>
|
||||
//#include <ExpDict.h>
|
||||
|
||||
//#define s_String char *
|
||||
|
||||
extern int SetErrOnNull(const char *attrValue, ErrorDescriptor *error);
|
||||
////////////////////
|
||||
@@ -103,10 +89,6 @@ PushPastImbedAggr (istream& in, std::string& s, ErrorDescriptor *err);
|
||||
extern void
|
||||
PushPastAggr1Dim(istream& in, std::string& s, ErrorDescriptor *err);
|
||||
|
||||
//extern Severity ValidateEntityType(SCLP23(Application_instance) *se,
|
||||
// const AttrDescriptor *ad,
|
||||
// ErrorDescriptor *error);
|
||||
|
||||
class STEPattribute {
|
||||
|
||||
friend ostream &operator<< ( ostream&, STEPattribute& );
|
||||
@@ -114,7 +96,7 @@ class STEPattribute {
|
||||
// The CenterLine compiler couldn't handle this friend declaration.
|
||||
// Here is the error
|
||||
// "../../../src/clstepcore/STEPattribute.h", line 118: internal << AT&T C++ Translator 3.0.2 - ObjectCenter Version 2.1>> error: cannot find friend P23::Application_instance
|
||||
// We may want to change the next two lines back at some point? DAS
|
||||
// We may want to change the next two lines back at some point? DAS FIXME
|
||||
// friend class SCLP23(Application_instance);
|
||||
// protected:
|
||||
public:
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* $Id: STEPattribute.inline.cc,v 3.0.1.7 1997/11/05 21:59:25 sauderd DP3.1 $ */
|
||||
|
||||
#include <STEPattribute.h>
|
||||
#include <sdai.h>
|
||||
#include <ExpDict.h>
|
||||
@@ -46,11 +44,6 @@ STEPattribute::STEPattribute( const class AttrDescriptor & d, SCLP23( Real ) *p
|
||||
ptr.r = p;
|
||||
}
|
||||
|
||||
// REAL_PTR
|
||||
/*STEPattribute::STEPattribute (const class AttrDescriptor& d, real **p)
|
||||
: aDesc (&d), _derive (0), _redefAttr (0)
|
||||
{ ptr.rp = p; }
|
||||
*/
|
||||
// ENTITY
|
||||
STEPattribute::STEPattribute( const class AttrDescriptor & d,
|
||||
SCLP23( Application_instance )* *p )
|
||||
@@ -122,14 +115,6 @@ STEPattribute::BaseType() const {
|
||||
return aDesc->BaseType();
|
||||
}
|
||||
|
||||
/*
|
||||
const EntityDescriptor *
|
||||
STEPattribute::ReferentEntity() const
|
||||
{
|
||||
return aDesc->ReferentEntity();
|
||||
}
|
||||
*/
|
||||
|
||||
const TypeDescriptor *
|
||||
STEPattribute::ReferentType() const {
|
||||
if( _redefAttr ) {
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include <sdai.h>
|
||||
#include <baseType.h>
|
||||
#include <ExpDict.h>
|
||||
//#include <STEPentity.h>
|
||||
#include <Registry.h>
|
||||
|
||||
class STEPcomplex : public SCLP23(Application_instance) {
|
||||
@@ -18,43 +17,38 @@ class STEPcomplex : public SCLP23(Application_instance) {
|
||||
public:
|
||||
STEPcomplex(Registry *registry, int fileid);
|
||||
STEPcomplex(Registry *registry, const std::string **names, int fileid,
|
||||
const char *schnm =0);
|
||||
const char *schnm =0);
|
||||
STEPcomplex(Registry *registry, const char **names, int fileid,
|
||||
const char *schnm =0);
|
||||
const char *schnm =0);
|
||||
virtual ~STEPcomplex();
|
||||
|
||||
int EntityExists(const char *name, const char *currSch =0);
|
||||
STEPcomplex *EntityPart(const char *name, const char *currSch =0);
|
||||
|
||||
/*
|
||||
// page 241 Stroustrup
|
||||
STEPcomplex &operator[](const char *name);
|
||||
STEPcomplex &operator[](const int index);
|
||||
*/
|
||||
|
||||
virtual const EntityDescriptor * IsA(const EntityDescriptor *) const;
|
||||
|
||||
virtual Severity ValidLevel(ErrorDescriptor *error, InstMgr *im,
|
||||
int clearError = 1);
|
||||
int clearError = 1);
|
||||
// READ
|
||||
virtual Severity STEPread(int id, int addFileId,
|
||||
class InstMgr * instance_set,
|
||||
istream& in =cin, const char *currSch =NULL,
|
||||
int useTechCor =1);
|
||||
class InstMgr * instance_set,
|
||||
istream& in =cin, const char *currSch =NULL,
|
||||
int useTechCor =1);
|
||||
|
||||
virtual void STEPread_error(char c, int index, istream& in);
|
||||
|
||||
// WRITE
|
||||
virtual void STEPwrite(ostream& out =cout, const char *currSch =NULL,
|
||||
int writeComment = 1);
|
||||
int writeComment = 1);
|
||||
virtual const char * STEPwrite(std::string &buf, const char *currSch =NULL);
|
||||
|
||||
SCLP23(Application_instance) *Replicate();
|
||||
|
||||
virtual void WriteExtMapEntities(ostream& out =cout,
|
||||
const char *currSch =NULL);
|
||||
const char *currSch =NULL);
|
||||
virtual const char * WriteExtMapEntities(std::string &buf,
|
||||
const char *currSch =NULL);
|
||||
const char *currSch =NULL);
|
||||
virtual void AppendEntity(STEPcomplex *stepc);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -10,12 +10,8 @@
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* $Id: sdaiApplication_instance.cc,v 1.5 1998/02/17 18:56:53 sauderd DP3.1 $ */
|
||||
|
||||
//static char rcsid[] ="$Id: sdaiApplication_instance.cc,v 1.5 1998/02/17 18:56:53 sauderd DP3.1 $";
|
||||
|
||||
#include <sdai.h>
|
||||
//#include <STEPentity.h>
|
||||
#include <instmgr.h>
|
||||
#include <STEPcomplex.h>
|
||||
#include <STEPattribute.h>
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
#ifndef STEPENTITY_H
|
||||
#define STEPENTITY_H 1
|
||||
|
||||
//#ifdef PART26
|
||||
//#include <CORBA.h>
|
||||
//#include <corbaIncludes.h>
|
||||
//#endif
|
||||
#define STEPENTITY_H 1
|
||||
|
||||
/*
|
||||
* NIST STEP Core Class Library
|
||||
@@ -17,27 +12,6 @@
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* $Id: sdaiApplication_instance.h,v 1.5 1998/02/17 18:29:43 sauderd DP3.1 $ */
|
||||
|
||||
//#ifdef __O3DB__
|
||||
//#include <OpenOODB.h>
|
||||
//#endif
|
||||
|
||||
//#include <stdio.h>
|
||||
//#include <STEPattributeList.h>
|
||||
|
||||
//#include <EntityInstance.h>
|
||||
|
||||
//#include <sdai.h>
|
||||
|
||||
//class STEPattributeList;
|
||||
//class STEPattribute;
|
||||
|
||||
//#include <ctype.h>
|
||||
//#include <Str.h>
|
||||
|
||||
//class InstMgr;
|
||||
//class EntityDescriptor;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// SCLP23(Application_instance) used to be STEPentity
|
||||
@@ -46,23 +20,23 @@
|
||||
class SCLP23_NAME(Application_instance) : public SCLP23_NAME(DAObject_SDAI)
|
||||
{
|
||||
private:
|
||||
int _cur; // provides a built-in way of accessing attributes in order.
|
||||
int _cur; // provides a built-in way of accessing attributes in order.
|
||||
|
||||
public:
|
||||
STEPattributeList attributes;
|
||||
int STEPfile_id;
|
||||
int STEPfile_id;
|
||||
ErrorDescriptor _error;
|
||||
std::string *p21Comment;
|
||||
// registry additions
|
||||
std::string *p21Comment;
|
||||
// registry additions
|
||||
EntityDescriptor *eDesc;
|
||||
|
||||
// head entity for multiple inheritance. If it is null then this
|
||||
// SCLP23_NAME(Application_instance) is not part of a multiply inherited entity. If it
|
||||
// points to a SCLP23_NAME(Application_instance) then this SCLP23_NAME(Application_instance) is part of a mi entity
|
||||
// and head points at the root SCLP23_NAME(Application_instance) of the primary inheritance
|
||||
// path (the one that is the root of the leaf entity).
|
||||
// head entity for multiple inheritance. If it is null then this
|
||||
// SCLP23_NAME(Application_instance) is not part of a multiply inherited entity. If it
|
||||
// points to a SCLP23_NAME(Application_instance) then this SCLP23_NAME(Application_instance) is part of a mi entity
|
||||
// and head points at the root SCLP23_NAME(Application_instance) of the primary inheritance
|
||||
// path (the one that is the root of the leaf entity).
|
||||
SCLP23_NAME(Application_instance) *headMiEntity;
|
||||
// these form a chain of other entity parents for multiple inheritance
|
||||
// these form a chain of other entity parents for multiple inheritance
|
||||
SCLP23_NAME(Application_instance) *nextMiEntity;
|
||||
|
||||
protected:
|
||||
@@ -75,37 +49,8 @@ class SCLP23_NAME(Application_instance) : public SCLP23_NAME(DAObject_SDAI)
|
||||
|
||||
int IsComplex() const { return _complex; }
|
||||
|
||||
#ifdef PART26
|
||||
// virtual P26::Application_instance_ptr create_TIE();
|
||||
virtual IDL_Application_instance_ptr create_TIE();
|
||||
#endif
|
||||
|
||||
#ifndef PART26
|
||||
void StepFileId (int fid) { STEPfile_id = fid; }
|
||||
int StepFileId() const { return STEPfile_id; }
|
||||
#else
|
||||
void StepFileId (CORBA::Long fid,
|
||||
CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ())
|
||||
throw (CORBA::SystemException)
|
||||
{ STEPfile_id = fid; }
|
||||
CORBA::Long StepFileId (CORBA::Environment &IT_env=
|
||||
CORBA::IT_chooseDefaultEnv ())
|
||||
throw (CORBA::SystemException)
|
||||
{ return STEPfile_id; }
|
||||
|
||||
// The IDL for the following 2 functions
|
||||
// string GetPersistentLabel() raises(SDAIException);
|
||||
// string GetDescription() raises(SDAIException);
|
||||
|
||||
// virtual char * GetPersistentLabel (CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException, SCLP26(SDAIException))
|
||||
virtual char * GetPersistentLabel (CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException, SDAIException)
|
||||
{ return 0; }
|
||||
|
||||
// virtual char * GetDescription (CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException, SCLP26(SDAIException))
|
||||
virtual char * GetDescription (CORBA::Environment &IT_env=CORBA::IT_chooseDefaultEnv ()) throw (CORBA::SystemException, SDAIException)
|
||||
{ return 0; }
|
||||
|
||||
#endif
|
||||
|
||||
void AddP21Comment(std::string &s, int replace = 1);
|
||||
void AddP21Comment(const char *s, int replace = 1);
|
||||
@@ -113,23 +58,23 @@ class SCLP23_NAME(Application_instance) : public SCLP23_NAME(DAObject_SDAI)
|
||||
|
||||
// guaranteed a string (may be null string)
|
||||
const char *P21Comment()
|
||||
{ return ( p21Comment ? const_cast<char *>(p21Comment->c_str()) : "" ); }
|
||||
{ return ( p21Comment ? const_cast<char *>(p21Comment->c_str()) : "" ); }
|
||||
// returns null if no comment exists
|
||||
// Note: Jul-24-2011, confirm that we want to change p21Comment->rep() to
|
||||
// const_cast<char *>(p21Comment->c_str())
|
||||
const char *P21CommentRep()
|
||||
{ return ( p21Comment ? const_cast<char *>(p21Comment->c_str()) : 0 ); }
|
||||
{ return ( p21Comment ? const_cast<char *>(p21Comment->c_str()) : 0 ); }
|
||||
|
||||
const char *EntityName( const char *schnm =NULL) const;
|
||||
|
||||
virtual const EntityDescriptor * IsA(const EntityDescriptor *) const;
|
||||
|
||||
virtual Severity ValidLevel(ErrorDescriptor *error, InstMgr *im,
|
||||
int clearError = 1);
|
||||
ErrorDescriptor &Error() { return _error; }
|
||||
// clears entity's error and optionally all attr's errors
|
||||
int clearError = 1);
|
||||
ErrorDescriptor &Error() { return _error; }
|
||||
// clears entity's error and optionally all attr's errors
|
||||
void ClearError(int clearAttrs = 1);
|
||||
// clears all attr's errors
|
||||
// clears all attr's errors
|
||||
void ClearAttrError();
|
||||
// void EnforceOptionality(int on = 1);
|
||||
|
||||
@@ -138,24 +83,24 @@ class SCLP23_NAME(Application_instance) : public SCLP23_NAME(DAObject_SDAI)
|
||||
// ACCESS attributes in order.
|
||||
int AttributeCount();
|
||||
STEPattribute * NextAttribute();
|
||||
void ResetAttributes() { _cur =0; }
|
||||
void ResetAttributes() { _cur =0; }
|
||||
|
||||
// READ
|
||||
virtual Severity STEPread(int id, int addFileId,
|
||||
class InstMgr * instance_set,
|
||||
istream& in =cin, const char *currSch =NULL,
|
||||
int useTechCor =1);
|
||||
class InstMgr * instance_set,
|
||||
istream& in =cin, const char * currSch = NULL,
|
||||
int useTechCor =1);
|
||||
virtual void STEPread_error(char c, int index, istream& in);
|
||||
|
||||
// WRITE
|
||||
virtual void STEPwrite(ostream& out =cout, const char *currSch =NULL,
|
||||
int writeComments = 1);
|
||||
int writeComments = 1);
|
||||
virtual const char * STEPwrite(std::string &buf, const char *currSch =NULL);
|
||||
|
||||
void WriteValuePairs(ostream& out, const char *currSch =NULL,
|
||||
int writeComments = 1, int mixedCase = 1);
|
||||
int writeComments = 1, int mixedCase = 1);
|
||||
|
||||
void STEPwrite_reference (ostream& out =cout);
|
||||
void STEPwrite_reference (ostream& out =cout);
|
||||
const char * STEPwrite_reference (std::string &buf);
|
||||
|
||||
void beginSTEPwrite(ostream& out =cout); // writes out the SCOPE section
|
||||
@@ -175,7 +120,7 @@ class SCLP23_NAME(Application_instance) : public SCLP23_NAME(DAObject_SDAI)
|
||||
STEPattribute * GetSTEPattribute (const char *);
|
||||
STEPattribute * MakeDerived (const char *);
|
||||
STEPattribute * MakeRedefined (STEPattribute *redefiningAttr,
|
||||
const char * nm);
|
||||
const char * nm);
|
||||
|
||||
virtual void CopyAs (SCLP23_NAME(Application_instance) *);
|
||||
void PrependEntityErrMsg();
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* $Id: sdaiSelect.h,v 1.5 1997/11/05 21:59:15 sauderd DP3.1 $ */
|
||||
|
||||
/**********
|
||||
class definition for the select superclass SCLP23_NAME(Select).
|
||||
**********/
|
||||
|
||||
+7
-24
@@ -7,9 +7,6 @@
|
||||
* also, hcreate/hdestroy routines added to simulate hsearch(3).
|
||||
*/
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
#include <scl_hash.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -19,7 +16,6 @@
|
||||
/* constants */
|
||||
/*************/
|
||||
|
||||
/*#define NULL 0*/
|
||||
#define HASH_NULL (Hash_TableP)NULL
|
||||
|
||||
#define SEGMENT_SIZE 256
|
||||
@@ -28,9 +24,6 @@
|
||||
#define PRIME2 1048583
|
||||
#define MAX_LOAD_FACTOR 5
|
||||
|
||||
/*void *malloc(unsigned);*/
|
||||
/*void *calloc(unsigned,unsigned);*/
|
||||
|
||||
/************/
|
||||
/* typedefs */
|
||||
/************/
|
||||
@@ -49,13 +42,9 @@ typedef unsigned long Address;
|
||||
#define DIV(x,y) ((x) >> (y##_SHIFT))
|
||||
#define MOD(x,y) ((x) & ((y)-1))
|
||||
|
||||
/*#define HASH_Table_new() malloc(sizeof(struct Hash_Table))*/
|
||||
#define HASH_Table_new() new Hash_Table
|
||||
/*#define HASH_Table_destroy(x) free((char *) x)*/
|
||||
#define HASH_Table_destroy(x) delete x
|
||||
/*#define HASH_Element_new() malloc(sizeof(struct Element))*/
|
||||
#define HASH_Element_new() new Element
|
||||
/*#define HASH_Element_destroy(x) free((char *) x)*/
|
||||
#define HASH_Element_destroy(x) delete x
|
||||
|
||||
typedef struct Element * ElementP;
|
||||
@@ -89,7 +78,7 @@ HASHinsert( Hash_TableP t, char * s, void * data ) {
|
||||
|
||||
e.key = s;
|
||||
e.data = data;
|
||||
e.symbol = 0; /* initialize to 0 - 25-Apr-1994 - kcm */
|
||||
e.symbol = 0;
|
||||
e2 = HASHsearch( t, &e, HASH_INSERT );
|
||||
if( e2 ) {
|
||||
printf( "Redeclaration of %s\n", s );
|
||||
@@ -123,9 +112,7 @@ HASHcreate( unsigned count ) {
|
||||
/*
|
||||
** Allocate initial 'i' segments of buckets
|
||||
*/
|
||||
for( i = 0; i < count; i++ )
|
||||
/* table->Directory[i] = (struct Element **) calloc(SEGMENT_SIZE,sizeof(struct Element));*/
|
||||
{
|
||||
for( i = 0; i < count; i++ ) {
|
||||
table->Directory[i] = new struct Element * [SEGMENT_SIZE];
|
||||
for( int h = 0; h < SEGMENT_SIZE; h++ ) { // initialize to NULL
|
||||
table->Directory[i][h] = 0;
|
||||
@@ -158,7 +145,7 @@ HASHlistinit( Hash_TableP table, HashEntry * he ) {
|
||||
he->p = 0;
|
||||
he->table = table;
|
||||
he->type = '*';
|
||||
he->e = 0; /* initialize to 0 - 25-Apr-1994 - kcm */
|
||||
he->e = 0;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -167,7 +154,7 @@ HASHlistinit_by_type( Hash_TableP table, HashEntry * he, char type ) {
|
||||
he->p = 0;
|
||||
he->table = table;
|
||||
he->type = type;
|
||||
he->e = 0; /* initialize to 0 - 25-Apr-1994 - kcm */
|
||||
he->e = 0;
|
||||
}
|
||||
|
||||
/* provide a way to step through the hash */
|
||||
@@ -341,9 +328,7 @@ HASHhash( char * Key, Hash_TableP table ) {
|
||||
/*
|
||||
** Convert string to integer
|
||||
*/
|
||||
/*SUPPRESS 112*/
|
||||
while( *k )
|
||||
/*SUPPRESS 8*/ { /*SUPPRESS 112*/
|
||||
while( *k ) {
|
||||
h = h * PRIME1 ^( *k++ - ' ' );
|
||||
}
|
||||
h %= PRIME2;
|
||||
@@ -376,9 +361,7 @@ HASHexpand_table( Hash_TableP table ) {
|
||||
NewAddress = table->maxp + table->p;
|
||||
NewSegmentDir = ( int ) DIV( NewAddress, SEGMENT_SIZE );
|
||||
NewSegmentIndex = ( int ) MOD( NewAddress, SEGMENT_SIZE );
|
||||
if( NewSegmentIndex == 0 )
|
||||
/* table->Directory[NewSegmentDir] = (struct Element **) calloc(SEGMENT_SIZE,sizeof(struct Element));*/
|
||||
{
|
||||
if( NewSegmentIndex == 0 ) {
|
||||
table->Directory[NewSegmentDir] = new struct Element * [SEGMENT_SIZE];
|
||||
for( int h = 0; h < SEGMENT_SIZE; h++ ) { // initialize to NULL
|
||||
table->Directory[NewSegmentDir][h] = 0;
|
||||
@@ -391,7 +374,7 @@ HASHexpand_table( Hash_TableP table ) {
|
||||
*/
|
||||
table->p++;
|
||||
if( table->p == table->maxp ) {
|
||||
table->maxp <<= 1; /* table->maxp *= 2 */
|
||||
table->maxp <<= 1;
|
||||
table->p = 0;
|
||||
}
|
||||
table->SegmentCount++;
|
||||
|
||||
+31
-33
@@ -12,16 +12,14 @@
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* $Id: scl_hash.h,v 3.0.1.2 1997/11/05 22:33:49 sauderd DP3.1 $ */
|
||||
|
||||
/************************************************************************
|
||||
** Hash_Table: Hash_Table
|
||||
** Description:
|
||||
**
|
||||
** Hash_Table: Hash_Table
|
||||
** Description:
|
||||
**
|
||||
** Largely based on code written by ejp@ausmelb.oz
|
||||
**
|
||||
** Constants:
|
||||
** HASH_TABLE_NULL - the null Hash_Table
|
||||
** HASH_TABLE_NULL - the null Hash_Table
|
||||
**
|
||||
************************************************************************/
|
||||
|
||||
@@ -96,32 +94,32 @@
|
||||
typedef enum { HASH_FIND, HASH_INSERT, HASH_DELETE } Action;
|
||||
|
||||
struct Element {
|
||||
char *key;
|
||||
void *data;
|
||||
struct Element *next;
|
||||
struct Symbol *symbol;/* for debugging hash conflicts */
|
||||
char type; /* user-supplied type */
|
||||
char *key;
|
||||
void *data;
|
||||
struct Element *next;
|
||||
struct Symbol *symbol; //for debugging hash conflicts
|
||||
char type; //user-supplied type
|
||||
};
|
||||
|
||||
struct Hash_Table {
|
||||
short p; /* Next bucket to be split */
|
||||
short maxp; /* upper bound on p during expansion */
|
||||
long KeyCount; /* current # keys */
|
||||
short SegmentCount; /* current # segments */
|
||||
short MinLoadFactor;
|
||||
short MaxLoadFactor;
|
||||
#define DIRECTORY_SIZE 256
|
||||
#define DIRECTORY_SIZE_SHIFT 8 /* log2(DIRECTORY_SIZE) */
|
||||
struct Element **Directory[DIRECTORY_SIZE];
|
||||
short p; // Next bucket to be split
|
||||
short maxp; // upper bound on p during expansion
|
||||
long KeyCount; // current # keys
|
||||
short SegmentCount; // current # segments
|
||||
short MinLoadFactor;
|
||||
short MaxLoadFactor;
|
||||
#define DIRECTORY_SIZE 256
|
||||
#define DIRECTORY_SIZE_SHIFT 8 // log2(DIRECTORY_SIZE)
|
||||
struct Element **Directory[DIRECTORY_SIZE];
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
int i; /* segment index (i think) */
|
||||
int j; /* key index in segment (ditto) */
|
||||
struct Element *p; /* usually the next element to be returned */
|
||||
struct Hash_Table *table;
|
||||
char type;
|
||||
struct Element *e; /* originally thought of as a place for */
|
||||
int i; // segment index (i think)
|
||||
int j; // key index in segment (ditto)
|
||||
struct Element *p; // usually the next element to be returned
|
||||
struct Hash_Table *table;
|
||||
char type;
|
||||
struct Element *e; /* originally thought of as a place for */
|
||||
/* the caller of HASHlist to temporarily stash the return value */
|
||||
/* to allow the caller (i.e., DICTdo) to be macroized, but now */
|
||||
/* conveniently used by HASHlist, which both stores the ultimate */
|
||||
@@ -132,15 +130,15 @@ typedef struct {
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct Hash_Table *HASHcreate(unsigned);
|
||||
struct Hash_Table *HASHcreate(unsigned);
|
||||
void HASHinitialize(void);
|
||||
void *HASHfind(struct Hash_Table *, char *);
|
||||
void HASHinsert(struct Hash_Table *, char *,void *);
|
||||
void HASHdestroy(struct Hash_Table *);
|
||||
struct Element *HASHsearch(struct Hash_Table *,struct Element *, Action);
|
||||
void HASHlistinit(struct Hash_Table *,HashEntry *);
|
||||
void HASHlistinit_by_type(struct Hash_Table *,HashEntry *,char);
|
||||
struct Element *HASHlist(HashEntry *);
|
||||
void HASHinsert(struct Hash_Table *, char *,void *);
|
||||
void HASHdestroy(struct Hash_Table *);
|
||||
struct Element *HASHsearch(struct Hash_Table *,const struct Element *, Action);
|
||||
void HASHlistinit(struct Hash_Table *,HashEntry *);
|
||||
void HASHlistinit_by_type(struct Hash_Table *,HashEntry *,char);
|
||||
struct Element *HASHlist(HashEntry *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user