Files
Clifford Yapp 6e18e57380 Implemented the first major API v2 scalability feature
Opt in with either:

exp2cxx --api-version 2 schema.exp

or:

cmake -DSC_EXP2CXX_API_VERSION=2 ...

Version 1 remains the default, and the regression test verifies default
output is byte-identical to explicit v1
output.

API v2 now provides:

- Compact SELECT classes backed by shared descriptor-driven runtime code
  instead of repeated generated parsing, assignment, and serialization
  bodies.

- Generic Set* and typed getter APIs in
  include/clstepcore/sdaiSelect.h:109.
- Dependency-bounded entity headers and source-owned dependencies in
  src/exp2cxx/classes_entity.c:968.
- Out-of-line entity creators.
- Unity chunks that no longer include the all-entity header.
- C++11 output; C++17 did not offer enough additional benefit for this
  tranche.

The command-line handling is in src/exp2cxx/fedex_main.c:85, while
compact SELECT generation begins in src/exp2cxx/selects.c:702.

Measured using the BRL-CAD ap242e4.exp, Release builds, eight parallel
jobs, and 64:8 unity chunks:

 Metric                           API v1    Final API v2    Reduction
━━━━━━━━━━━━━━━━━━━━━━━━  ━━━━━━━━━━━━━━━  ━━━━━━━━━━━━━━  ━━━━━━━━━━━
 Generated C++ lines           1,210,640         522,445        56.8%
────────────────────────  ───────────────  ──────────────  ───────────
 Generated bytes              57,566,051      27,202,644        52.7%
────────────────────────  ───────────────  ──────────────  ───────────
 Schema build wall time         183.22 s         88.31 s        51.8%
────────────────────────  ───────────────  ──────────────  ───────────
 Compiler CPU time              641.53 s        378.49 s        41.0%
────────────────────────  ───────────────  ──────────────  ───────────
 Peak RSS                  1,035,112 KiB     916,412 KiB        11.5%
────────────────────────  ───────────────  ──────────────  ───────────
 Object-file bytes            70,472,952      40,031,088        43.2%
────────────────────────  ───────────────  ──────────────  ───────────
 Shared-library text          34,361,400      19,420,467        43.5%
────────────────────────  ───────────────  ──────────────  ───────────
 Generation wall time             1.52 s          0.69 s        54.6%
2026-08-02 06:15:25 -04:00

102 lines
3.5 KiB
C++

#ifndef STEPAGGRSELECT_H
#define STEPAGGRSELECT_H
#include "clstepcore/STEPaggregate.h"
#include <sc_export.h>
class SelectTypeDescriptor;
/** \file STEPaggrSelect.h
* classes SelectAggregate, SelectNode
*/
/**
* * \class SelectAggregate
** This is a minimal representation for a collection of SDAI_Select
*/
class SC_CORE_EXPORT SelectAggregate : public STEPaggregate {
protected:
const SelectTypeDescriptor * _select_type;
public:
virtual Severity ReadValue( istream & in, ErrorDescriptor * err,
const TypeDescriptor * elem_type,
InstMgrBase * insts, int addFileId = 0,
int assignVal = 1, int ExchangeFileFormat = 1,
const char * currSch = 0 );
virtual SingleLinkNode * NewNode();
virtual STEPaggregate & ShallowCopy( const STEPaggregate & );
explicit SelectAggregate( const SelectTypeDescriptor * select_type = 0 );
virtual ~SelectAggregate();
};
typedef SelectAggregate * SelectAggregateH;
typedef SelectAggregate * SelectAggregate_ptr;
typedef const SelectAggregate * SelectAggregate_ptr_c;
typedef SelectAggregate_ptr SelectAggregate_var;
/**
* * \class SelectNode
** This is a minimal representation for node in lists of SDAI_Select
*/
class SC_CORE_EXPORT SelectNode : public STEPnode {
public:
SDAI_Select * node;
// INPUT
virtual Severity StrToVal( const char * s, ErrorDescriptor * err,
const TypeDescriptor * elem_type,
InstMgrBase * insts, int addFileId = 0 );
virtual Severity StrToVal( istream & in, ErrorDescriptor * err,
const TypeDescriptor * elem_type,
InstMgrBase * insts, int addFileId = 0,
const char * currSch = 0 );
virtual Severity STEPread( const char * s, ErrorDescriptor * err,
const TypeDescriptor * elem_type,
InstMgrBase * insts, int addFileId = 0 );
virtual Severity STEPread( istream & in, ErrorDescriptor * err,
const TypeDescriptor * elem_type,
InstMgrBase * insts, int addFileId = 0,
const char * currSch = 0 );
// OUTPUT
virtual const char * asStr( std::string & s );
virtual const char * STEPwrite( std::string & s, const char * = 0 );
virtual void STEPwrite( ostream & out = cout );
// CONSTRUCTORS
SelectNode( SDAI_Select * s );
SelectNode();
~SelectNode();
virtual SingleLinkNode * NewNode();
// Calling these functions is an error.
Severity StrToVal( const char * s, ErrorDescriptor * err ) {
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return StrToVal( s, err, 0, 0, 0 );
}
Severity StrToVal( istream & in, ErrorDescriptor * err ) {
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return StrToVal( in, err, 0, 0, 0 );
}
Severity STEPread( const char * s, ErrorDescriptor * err ) {
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return STEPread( s, err, 0, 0, 0 );
}
Severity STEPread( istream & in, ErrorDescriptor * err ) {
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
return STEPread( in, err, 0, 0, 0 );
}
};
#endif //STEPAGGRSELECT_H