Skip to content

Commit f9b9383

Browse files
committed
finish cleanup in src/clstepcore
1 parent 07d8791 commit f9b9383

27 files changed

+646
-1100
lines changed

src/clstepcore/ExpDict.cc

Lines changed: 146 additions & 340 deletions
Large diffs are not rendered by default.

src/clstepcore/ExpDict.h

Lines changed: 133 additions & 152 deletions
Large diffs are not rendered by default.

src/clstepcore/ExpDict.inline.cc

Lines changed: 20 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,10 @@ TypeDescriptor::TypeDescriptor
206206
const char * d )
207207
: _name( nm ), altNames( 0 ), _fundamentalType( ft ),
208208
_originatingSchema( origSchema ), _referentType( 0 ), _description( d ),
209-
_where_rules( 0 )
210-
211-
{
209+
_where_rules( 0 ) {
212210
}
213211

214-
const char *
215-
TypeDescriptor::Name( const char * schnm ) const
216-
/*
212+
/**
217213
* Determines the current name of this. Normally, this is simply _name.
218214
* If "schnm" is set to a value, however, then this function becomes a
219215
* request for our name when referenced by schnm. (This will be diff from
@@ -223,7 +219,7 @@ TypeDescriptor::Name( const char * schnm ) const
223219
* and returns the new name if found. (See header comments to function
224220
* SchRename::rename().)
225221
*/
226-
{
222+
const char * TypeDescriptor::Name( const char * schnm ) const {
227223
if( schnm == NULL ) {
228224
return _name;
229225
}
@@ -235,13 +231,11 @@ TypeDescriptor::Name( const char * schnm ) const
235231
return _name;
236232
}
237233

238-
const char *
239-
TypeDescriptor::BaseTypeName() const {
234+
const char * TypeDescriptor::BaseTypeName() const {
240235
return BaseTypeDescriptor() ? BaseTypeDescriptor() -> Name() : 0;
241236
}
242237

243-
const TypeDescriptor *
244-
TypeDescriptor::BaseTypeIsA( const TypeDescriptor * td ) const {
238+
const TypeDescriptor * TypeDescriptor::BaseTypeIsA( const TypeDescriptor * td ) const {
245239
switch( NonRefType() ) {
246240
case AGGREGATE_TYPE:
247241
return AggrElemTypeDescriptor() -> IsA( td );
@@ -250,20 +244,17 @@ TypeDescriptor::BaseTypeIsA( const TypeDescriptor * td ) const {
250244
default:
251245
return IsA( td );
252246
}
253-
254247
}
255248

256-
int
257-
TypeDescriptor::CurrName( const char * other, const char * schNm ) const
258-
/*
249+
/**
259250
* Check if our "current" name = other. CurrName may be different from
260251
* _name if schNm tells us the current schema is a different one from the
261252
* one in which we're defined. If so, we may have an alternate name for
262253
* that schema (it may be listed in our altNames list). This would be the
263254
* case if schNm USEs or REFERENCEs type and renames it in the process
264255
* (e.g., "USE (X as Y)".
265256
*/
266-
{
257+
int TypeDescriptor::CurrName( const char * other, const char * schNm ) const {
267258
if( !schNm || *schNm == '\0' ) {
268259
// If there's no current schema, accept any possible name of this.
269260
// (I.e., accept its actual name or any substitute):
@@ -280,35 +271,29 @@ TypeDescriptor::CurrName( const char * other, const char * schNm ) const
280271
}
281272
}
282273

283-
int
284-
TypeDescriptor::PossName( const char * nm ) const
285-
/*
274+
/**
286275
* return TRUE if nm is either our name or one of the possible alternates.
287276
*/
288-
{
277+
int TypeDescriptor::PossName( const char * nm ) const {
289278
return ( OurName( nm ) || AltName( nm ) );
290279
}
291280

292-
int
293-
TypeDescriptor::OurName( const char * nm ) const {
281+
int TypeDescriptor::OurName( const char * nm ) const {
294282
return !StrCmpIns( nm, _name );
295283
}
296284

297-
int
298-
TypeDescriptor::AltName( const char * nm ) const {
285+
int TypeDescriptor::AltName( const char * nm ) const {
299286
if( altNames ) {
300287
return ( altNames->choice( nm ) );
301288
}
302289
return 0;
303290
}
304291

305-
void
306-
TypeDescriptor::addAltName( const char * schnm, const char * newnm )
307-
/*
292+
/**
308293
* Creates a SchRename consisting of schnm & newnm. Places it in alphabe-
309294
* tical order in this's altNames list.
310295
*/
311-
{
296+
void TypeDescriptor::addAltName( const char * schnm, const char * newnm ) {
312297
SchRename * newpair = new SchRename( schnm, newnm ),
313298
*node = ( SchRename * )altNames, *prev = NULL;
314299

@@ -327,13 +312,11 @@ TypeDescriptor::addAltName( const char * schnm, const char * newnm )
327312
}
328313
}
329314

330-
int
331-
SchRename::choice( const char * nm ) const
332-
/*
315+
/**
333316
* See if nm = one of our choices (either ours or that of a SchRename
334317
* later in the list.
335318
*/
336-
{
319+
int SchRename::choice( const char * nm ) const {
337320
if( !StrCmpIns( nm, newName ) ) {
338321
return 1;
339322
}
@@ -343,16 +326,14 @@ SchRename::choice( const char * nm ) const
343326
return 0;
344327
}
345328

346-
char *
347-
SchRename::rename( const char * schnm, char * newnm ) const
348-
/*
329+
/**
349330
* Check if this SchRename represents the rename of its owning TypeDesc for
350331
* schema schnm. (This will be the case if schnm = schName.) If so, the
351332
* new name is returned and copied into newnm. If not, ::rename is called
352333
* on next. Thus, this function will tell us if this or any later SchRe-
353334
* name in this list provide a new name for TypeDesc for schema schnm.
354335
*/
355-
{
336+
char * SchRename::rename( const char * schnm, char * newnm ) const {
356337
if( !StrCmpIns( schnm, schName ) ) {
357338
strcpy( newnm, newName );
358339
return newnm;
@@ -405,37 +386,9 @@ Logical AttrDescriptor::Deriving() const {
405386
return LFalse;
406387
}
407388

408-
/*
409-
// outdated function
410-
void
411-
AttrDescriptor::Derived( SCLP23( LOGICAL ) x ) {
412-
if( x.asInt() ) {
413-
_attrType = AttrType_Deriving;
414-
} else {
415-
_attrType = AttrType_Explicit;
416-
}
417-
}
418-
419-
// outdated function
420-
void
421-
AttrDescriptor::Derived( Logical x ) {
422-
if( x == LTrue ) {
423-
_attrType = AttrType_Deriving;
424-
} else {
425-
_attrType = AttrType_Explicit;
426-
}
427-
}
428-
429-
// outdated function
430-
void
431-
AttrDescriptor::Derived( const char * x ) {
432-
if( !strcmp( x, "LTrue" ) || !strcmp( x, "T" ) ) {
433-
_attrType = AttrType_Deriving;
434-
} else {
435-
_attrType = AttrType_Explicit;
436-
}
437-
}
438-
*/
389+
///////////////////////////////////////////////////////////////////////////////
390+
// Derived_attribute functions
391+
///////////////////////////////////////////////////////////////////////////////
439392

440393
Derived_attribute::Derived_attribute( const char * name, const TypeDescriptor * domainType,
441394
Logical optional, Logical unique, AttrType_Enum at, const EntityDescriptor & owner )

src/clstepcore/Registry.inline.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Registry::Registry( CF_init initFunct )
6262

6363
initFunct( *this );
6464
HASHlistinit( active_types, &cur_type );
65-
HASHlistinit( primordialSwamp, &cur_entity ); // initialize cur\'s
65+
HASHlistinit( primordialSwamp, &cur_entity ); // initialize cur's
6666
HASHlistinit( active_schemas, &cur_schema );
6767
}
6868

src/clstepcore/STEPaggregate.cc

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ STEPaggregate & STEPaggregate::ShallowCopy( const STEPaggregate & a ) {
4848
return *this;
4949
}
5050

51-
// do not require exchange file format
51+
/// do not require exchange file format
5252
Severity STEPaggregate::AggrValidLevel( const char * value, ErrorDescriptor * err,
5353
const TypeDescriptor * elem_type, InstMgr * insts,
5454
int optional, char * tokenList, int addFileId,
@@ -68,7 +68,7 @@ Severity STEPaggregate::AggrValidLevel( const char * value, ErrorDescriptor * er
6868
return err->severity();
6969
}
7070

71-
// require exchange file format
71+
/// require exchange file format
7272
Severity STEPaggregate::AggrValidLevel( istream & in, ErrorDescriptor * err,
7373
const TypeDescriptor * elem_type, InstMgr * insts,
7474
int optional, char * tokenList, int addFileId,
@@ -86,7 +86,7 @@ Severity STEPaggregate::AggrValidLevel( istream & in, ErrorDescriptor * err,
8686
return err->severity();
8787
}
8888

89-
// if exchangeFileFormat == 1 then paren delims are required.
89+
/// if exchangeFileFormat == 1 then paren delims are required.
9090

9191
Severity STEPaggregate::ReadValue( istream & in, ErrorDescriptor * err,
9292
const TypeDescriptor * elem_type, InstMgr * insts,
@@ -454,7 +454,7 @@ EntityAggregate::~EntityAggregate() {
454454
}
455455

456456

457-
// if exchangeFileFormat == 1 then delims are required.
457+
/// if exchangeFileFormat == 1 then delims are required.
458458
Severity EntityAggregate::ReadValue( istream & in, ErrorDescriptor * err,
459459
const TypeDescriptor * elem_type, InstMgr * insts,
460460
int addFileId, int assignVal,
@@ -692,7 +692,7 @@ SelectAggregate::~SelectAggregate() {
692692
}
693693

694694

695-
// if exchangeFileFormat == 1 then delims are required.
695+
/// if exchangeFileFormat == 1 then delims are required.
696696
Severity SelectAggregate::ReadValue( istream & in, ErrorDescriptor * err,
697697
const TypeDescriptor * elem_type, InstMgr * insts,
698698
int addFileId, int assignVal,
@@ -813,8 +813,7 @@ STEPaggregate & SelectAggregate::ShallowCopy( const STEPaggregate & a ) {
813813
}
814814

815815

816-
SingleLinkNode *
817-
SelectAggregate::NewNode() {
816+
SingleLinkNode * SelectAggregate::NewNode() {
818817
return new SelectNode();
819818
}
820819

@@ -1118,7 +1117,7 @@ void BinaryNode::STEPwrite( ostream & out ) {
11181117
// EnumAggregate
11191118
///////////////////////////////////////////////////////////////////////////////
11201119

1121-
// COPY
1120+
/// COPY
11221121
STEPaggregate & EnumAggregate::ShallowCopy( const STEPaggregate & a ) {
11231122
const EnumNode * tmp = ( const EnumNode * ) a.GetHead();
11241123
EnumNode * to;
@@ -1174,19 +1173,18 @@ EnumNode::EnumNode() {
11741173
EnumNode::~EnumNode() {
11751174
}
11761175

1176+
/// defined in subclass
11771177
SingleLinkNode * EnumNode::NewNode() {
1178-
// defined in subclass
11791178
cerr << "Internal error: " << __FILE__ << ": " << __LINE__ << "\n" ;
11801179
cerr << "function: EnumNode::NewNode () called instead of virtual function. \n"
11811180
<< _POC_ << "\n";
11821181
return 0;
11831182
}
11841183

1185-
///////////////////////////////////////////////////////////////////////////////
1186-
// non-whitespace chars following s are considered garbage and is an error.
1187-
// a valid value will still be assigned if it exists before the garbage.
1188-
///////////////////////////////////////////////////////////////////////////////
1189-
1184+
/**
1185+
* non-whitespace chars following s are considered garbage and is an error.
1186+
* a valid value will still be assigned if it exists before the garbage.
1187+
*/
11901188
Severity EnumNode::StrToVal( const char * s, ErrorDescriptor * err ) {
11911189
return STEPread( s, err );
11921190
}
@@ -1316,7 +1314,7 @@ SingleLinkNode * IntAggregate::NewNode() {
13161314
return new IntNode();
13171315
}
13181316

1319-
// COPY
1317+
/// COPY
13201318
STEPaggregate & IntAggregate::ShallowCopy( const STEPaggregate & a ) {
13211319
const IntNode * tmp = ( const IntNode * ) a.GetHead();
13221320
IntNode * to;

src/clstepcore/STEPaggregate.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ class STEPaggregate : public SingleLinkList
8585
};
8686

8787
/****************************************************************//**
88+
** \class GenericAggregate
8889
** This class supports LIST OF:
8990
** SELECT_TYPE, BINARY_TYPE, GENERIC_TYPE, ENUM_TYPE, UNKNOWN_TYPE type
9091
******************************************************************/
@@ -125,6 +126,7 @@ typedef EntityAggregate * EntityAggregate_ptr;
125126
typedef EntityAggregate_ptr EntityAggregate_var;
126127

127128
/****************************************************************//**
129+
** \class SelectAggregate
128130
** This is a minimal represention for a collection of SCLP23(Select)
129131
******************************************************************/
130132
class SelectAggregate : public STEPaggregate
@@ -147,6 +149,7 @@ typedef SelectAggregate * SelectAggregate_ptr;
147149
typedef SelectAggregate_ptr SelectAggregate_var;
148150

149151
/****************************************************************//**
152+
** \class StringAggregate
150153
** This class supports LIST OF STRING type
151154
******************************************************************/
152155
class StringAggregate : public STEPaggregate
@@ -164,6 +167,7 @@ typedef StringAggregate_ptr StringAggregate_var;
164167

165168

166169
/****************************************************************//**
170+
** \class BinaryAggregate
167171
** This class supports LIST OF BINARY type
168172
******************************************************************/
169173
class BinaryAggregate : public STEPaggregate
@@ -181,6 +185,7 @@ typedef BinaryAggregate * BinaryAggregate_ptr;
181185
typedef BinaryAggregate_ptr BinaryAggregate_var;
182186

183187
/**************************************************************//**
188+
** \class EnumAggregate
184189
** This is a minimal representions for a collection ofSCLP23(Enum)
185190
******************************************************************/
186191
class EnumAggregate : public STEPaggregate
@@ -275,6 +280,7 @@ class STEPnode : public SingleLinkNode {
275280
typedef STEPnode * STEPnodeH;
276281

277282
/**************************************************************//**
283+
** \class GenericAggregate
278284
** This class is for the Nodes of GenericAggregates
279285
******************************************************************/
280286
class GenericAggrNode : public STEPnode {
@@ -361,6 +367,7 @@ class EntityNode : public STEPnode {
361367
///////////////////////////////////////////////////////////////////////////
362368

363369
/**************************************************************//**
370+
** \class SelectNode
364371
** This is a minimal representions for node in lists of SCLP23(Select)
365372
******************************************************************/
366373
class SelectNode : public STEPnode {
@@ -419,6 +426,7 @@ class SelectNode : public STEPnode {
419426
};
420427

421428
/**************************************************************//**
429+
** \class StringNode
422430
** This class is for the Nodes of StringAggregates
423431
******************************************************************/
424432
class StringNode : public STEPnode {
@@ -448,6 +456,7 @@ class StringNode : public STEPnode {
448456
///////////////////////////////////////////////////////////////////////////
449457

450458
/**************************************************************//**
459+
** \class BinaryNode
451460
** This class is for the Nodes of BinaryAggregates
452461
******************************************************************/
453462
class BinaryNode : public STEPnode {
@@ -475,6 +484,7 @@ class BinaryNode : public STEPnode {
475484
};
476485

477486
/**************************************************************//**
487+
** \class EnumNode
478488
** This is a minimal representions for node in lists of SCLP23(Enum)
479489
******************************************************************/
480490
class EnumNode : public STEPnode {

0 commit comments

Comments
 (0)