Import Geant4 0.0.0 source tree
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: EntityInst.h,v 2.0 1998/07/02 17:04:04 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef ENTITYINST_H
|
||||
#define ENTITYINST_H 1
|
||||
|
||||
// This entity is the supertype of all entities whose instances may be
|
||||
// queried or manipulated through the SDAI (i.e., application schema
|
||||
// entities, SDAI session schema entities, and SDAI dictionary schema
|
||||
// entities).
|
||||
|
||||
typedef class EntityInstance* EntityInstanceH;
|
||||
|
||||
class EntityInstance {
|
||||
|
||||
//friend class SdaiInstance;
|
||||
//friend class AppInstance;
|
||||
|
||||
public:
|
||||
EntityInstance() {}
|
||||
//EntityInstance(const EntityInstance&);
|
||||
|
||||
virtual ~EntityInstance() {}
|
||||
|
||||
public:
|
||||
|
||||
//const ModelH FindEntityInstanceModel() const;
|
||||
|
||||
//virtual Boolean IsInstanceOf(const String& typeName) const;
|
||||
|
||||
//virtual Boolean IsKindOf(const String& typeName) const;
|
||||
|
||||
//virtual Boolean IsSDAIKindOf(const String& typeName) const;
|
||||
|
||||
//Logical IsSame(const EntityInstanceH& entInst) const;
|
||||
|
||||
//virtual Logical IsEqual(const EntityInstanceH& entInst);
|
||||
|
||||
#ifdef SDAI_CPP_LATE_BINDING
|
||||
PrimitiveH GetAttr(const AttrH& attDef);
|
||||
PrimitiveH GetAttr(const String& attName);
|
||||
#endif
|
||||
|
||||
//static const SDAIAGGRH(Set, EntityInstanceH)
|
||||
//GetEntityExtents(const ModelH& model);
|
||||
|
||||
//static SDAIAGGRH(Set, EntityInstanceH) GetEntityExtents(ModelH& model);
|
||||
|
||||
#ifdef SDAI_CPP_LATE_BINDING
|
||||
virtual const EntityTypeSetH GetInstanceType() const;
|
||||
#endif
|
||||
|
||||
#ifdef SDAI_CPP_LATE_BINDING
|
||||
virtual Boolean IsInstanceOf(const EntityTypeSetH& typeSet)
|
||||
const;
|
||||
#endif
|
||||
|
||||
#ifdef SDAI_CPP_LATE_BINDING
|
||||
virtual Boolean IsKindOf(const EntityTypeSetH& typeSet) const;
|
||||
#endif
|
||||
|
||||
#ifdef SDAI_CPP_LATE_BINDING
|
||||
virtual Boolean IsSDAIKindOf(const EntityTypeSetH& typeSet)
|
||||
const;
|
||||
#endif
|
||||
|
||||
#ifdef SDAI_CPP_LATE_BINDING
|
||||
virtual Boolean TestAttr(const AttrH& attDef) ;
|
||||
virtual Boolean TestAttr(const name& attName) const;
|
||||
#endif
|
||||
|
||||
//String GetInstanceTypeName() const;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,176 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: Enumeration.h,v 2.1 1998/07/13 16:53:11 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef ENUMERATION_H
|
||||
#define ENUMERATION_H
|
||||
|
||||
/*
|
||||
* NIST STEP Core Class Library
|
||||
* clstepcore/Enumeration.h
|
||||
* May 1995
|
||||
* K. C. Morris
|
||||
* David Sauder
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
#include <Str.h>
|
||||
#include <errordesc.h>
|
||||
|
||||
#define ENUM_NULL -1
|
||||
|
||||
class STEPenumeration {
|
||||
friend ostream &operator<< ( ostream&, const STEPenumeration& );
|
||||
protected:
|
||||
int v; // integer value of enumeration instance
|
||||
// mapped to a symbolic value in the elements
|
||||
|
||||
int set_value (const char * n);
|
||||
int set_value (const int n);
|
||||
virtual ~STEPenumeration () {
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
virtual int no_elements () const =0;
|
||||
virtual const char * Name () const =0;
|
||||
const char * get_value_at (int n) const { return element_at (n); }
|
||||
virtual const char * element_at (int n) const =0;
|
||||
|
||||
Severity EnumValidLevel(const char *value, ErrorDescriptor *err,
|
||||
int optional, char *tokenList,
|
||||
int needDelims = 0, int clearError = 1);
|
||||
|
||||
Severity EnumValidLevel(istream &in, ErrorDescriptor *err,
|
||||
int optional, char *tokenList,
|
||||
int needDelims = 0, int clearError = 1);
|
||||
|
||||
const int asInt () const { return v; }
|
||||
|
||||
const char * asStr (SCLstring &s) const;
|
||||
void STEPwrite (ostream& out = G4cout) const;
|
||||
const char * STEPwrite (SCLstring &s) const;
|
||||
|
||||
Severity StrToVal (const char * s, ErrorDescriptor *err, int optional = 1);
|
||||
Severity STEPread(istream& in, ErrorDescriptor *err, int optional = 1);
|
||||
Severity STEPread(const char *s, ErrorDescriptor *err, int optional = 1);
|
||||
|
||||
int put (int val) { return set_value (val); }
|
||||
int put (const char * n) { return set_value (n); }
|
||||
int is_null () const { return ( v == ENUM_NULL ); }
|
||||
int set_null() { return put (ENUM_NULL); }
|
||||
STEPenumeration& operator= (const int);
|
||||
STEPenumeration& operator= (const STEPenumeration&);
|
||||
|
||||
void DebugDisplay (ostream& out =G4cout) const;
|
||||
protected:
|
||||
Severity ReadEnum(istream& in, ErrorDescriptor *err, int AssignVal = 1,
|
||||
int needDelims = 1);
|
||||
};
|
||||
|
||||
|
||||
enum LOGICAL { sdaiFALSE, sdaiTRUE, sdaiUNKNOWN };
|
||||
|
||||
#define F sdaiFALSE
|
||||
#define U sdaiUNKNOWN
|
||||
#define T sdaiTRUE
|
||||
|
||||
class Boolean :
|
||||
public STEPenumeration {
|
||||
public:
|
||||
const char * Name () const {
|
||||
return "Boolean";
|
||||
}
|
||||
|
||||
Boolean (char * val =0) {
|
||||
set_value (val);
|
||||
}
|
||||
Boolean (LOGICAL val);
|
||||
virtual ~Boolean () {
|
||||
}
|
||||
inline virtual int no_elements () const {
|
||||
return 2;
|
||||
}
|
||||
operator LOGICAL () const;
|
||||
operator int () const;
|
||||
int operator ==( LOGICAL log ) const;
|
||||
|
||||
virtual const char * element_at (int n) const;
|
||||
|
||||
}
|
||||
;
|
||||
|
||||
inline Boolean * create_Boolean () { return new Boolean ; }
|
||||
|
||||
class Logical :
|
||||
public STEPenumeration {
|
||||
public:
|
||||
const char * Name () const {
|
||||
return "Logical";
|
||||
}
|
||||
|
||||
Logical (char * val =0) {
|
||||
set_value (val);
|
||||
}
|
||||
Logical (LOGICAL val) {
|
||||
set_value (val);
|
||||
}
|
||||
|
||||
// Josh L, 3/24/95
|
||||
Logical (const Boolean& boolean) {
|
||||
v = boolean.asInt();
|
||||
}
|
||||
|
||||
virtual ~Logical () {
|
||||
}
|
||||
inline virtual int no_elements () const {
|
||||
return 3;
|
||||
}
|
||||
operator LOGICAL () const;
|
||||
|
||||
virtual const char * element_at (int n) const;
|
||||
|
||||
}
|
||||
;
|
||||
|
||||
inline Logical * create_Logical () { return new Logical ; }
|
||||
|
||||
// Josh L, 3/24/95
|
||||
// These constants are required for Part 23. We declare them as statics
|
||||
// inside a struct in order to prevent name conflicts when linking with
|
||||
// other libraries. This technique is discussed in "Effective C++" by
|
||||
// Scott Meyers, Addison-Wesley, 1992, pp. 93-95.
|
||||
|
||||
// GEANT4 workaround:
|
||||
// TRUE and FALSE are sometimes defined as preprocessor symbols
|
||||
// let's get rid of them until the struct has been parsed
|
||||
|
||||
struct SDAI {
|
||||
static const Logical UNKNOWN;
|
||||
static const Boolean SdaiTRUE;
|
||||
static const Boolean SdaiFALSE;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,76 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: Registry.h,v 2.0 1998/07/02 17:03:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef _REGISTRY_H
|
||||
#define _REGISTRY_H
|
||||
|
||||
/*
|
||||
* NIST STEP Core Class Library
|
||||
* clstepcore/Registry.h
|
||||
* May 1995
|
||||
* K. C. Morris
|
||||
* David Sauder
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#include <STEPentity.h>
|
||||
#include <errordesc.h>
|
||||
#include <scl_hash.h>
|
||||
typedef struct Hash_Table * HashTable;
|
||||
|
||||
class Registry;
|
||||
extern char * EntityClassName ( char *);
|
||||
typedef void (* CF_init) (Registry &); // pointer to creation initialization
|
||||
|
||||
class Registry {
|
||||
protected:
|
||||
HashTable primordialSwamp; // dictionary of EntityDescriptors
|
||||
HashTable active_schemas; // dictionary of SchemaDescriptors
|
||||
HashTable active_types; // dictionary of TypeDescriptors
|
||||
|
||||
int entity_cnt;
|
||||
HashEntry cur_entity;
|
||||
HashEntry cur_schema;
|
||||
|
||||
public:
|
||||
Registry (CF_init initFunct);
|
||||
~Registry ();
|
||||
void DeleteContents (); // CAUTION: calls delete on all the descriptors
|
||||
|
||||
const EntityDescriptor* FindEntity (const char *, int check_case =1) const;
|
||||
const SchemaDescriptor* FindSchema (const char *, int check_case =1) const;
|
||||
const TypeDescriptor* FindType (const char *, int check_case =1) const;
|
||||
|
||||
void AddEntity (const EntityDescriptor&);
|
||||
void AddSchema (const SchemaDescriptor&);
|
||||
void AddType (const TypeDescriptor&);
|
||||
|
||||
void RemoveEntity (const char *);
|
||||
void RemoveSchema (const char *);
|
||||
void RemoveType (const char *);
|
||||
|
||||
int GetEntityCnt ();
|
||||
void ResetEntities ();
|
||||
const EntityDescriptor * NextEntity ();
|
||||
|
||||
void ResetSchemas () ;
|
||||
const SchemaDescriptor * NextSchema ();
|
||||
|
||||
STEPentity* ObjCreate (const char * nm, int check_case =1) const;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,629 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: STEPaggregate.h,v 2.1 1998/07/13 16:53:13 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef STEPAGGREGATE_H
|
||||
#define STEPAGGREGATE_H
|
||||
|
||||
/*
|
||||
* NIST STEP Core Class Library
|
||||
* clstepcore/STEPaggregate.h
|
||||
* May 1995
|
||||
* K. C. Morris
|
||||
* David Sauder
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
class InstMgr;
|
||||
class STEPaggregate;
|
||||
class Logical;
|
||||
class Boolean;
|
||||
class TypeDescriptor;
|
||||
|
||||
#include "globals.hh"
|
||||
#include <errordesc.h>
|
||||
#include <SingleLinkList.h>
|
||||
#include <sdai.h>
|
||||
#include <baseType.h>
|
||||
#include <SdaiBinary.h>
|
||||
#include <STEPundefined.h>
|
||||
#include <scl_string.h>
|
||||
|
||||
class STEPentity;
|
||||
#define S_ENTITY_NULL &NilSTEPentity
|
||||
extern STEPentity NilSTEPentity;
|
||||
|
||||
|
||||
#define AGGR_NULL &NilSTEPaggregate
|
||||
extern STEPaggregate NilSTEPaggregate;
|
||||
|
||||
typedef unsigned short BOOLEAN;
|
||||
class SingleLinkNode;
|
||||
|
||||
/******************************************************************************
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
typedef STEPaggregate * STEPaggregateH;
|
||||
class STEPaggregate : public SingleLinkList
|
||||
{
|
||||
protected:
|
||||
int _null;
|
||||
|
||||
protected:
|
||||
|
||||
virtual Severity ReadValue(istream &in, ErrorDescriptor *err,
|
||||
const TypeDescriptor *elem_type,
|
||||
InstMgr *insts, int addFileId =0,
|
||||
int assignVal =1, int ExchangeFileFormat =1);
|
||||
public:
|
||||
|
||||
int is_null() { return _null; }
|
||||
|
||||
virtual Severity AggrValidLevel(const char *value, ErrorDescriptor *err,
|
||||
const TypeDescriptor *elem_type, InstMgr *insts,
|
||||
int optional, char *tokenList, int addFileId =0,
|
||||
int clearError =0);
|
||||
|
||||
|
||||
virtual Severity AggrValidLevel(istream &in, ErrorDescriptor *err,
|
||||
const TypeDescriptor *elem_type, InstMgr *insts,
|
||||
int optional, char *tokenList, int addFileId =0,
|
||||
int clearError =0);
|
||||
|
||||
// INPUT
|
||||
virtual Severity StrToVal(const char *s, ErrorDescriptor *err =0,
|
||||
const TypeDescriptor *elem_type =0,
|
||||
InstMgr *insts =0, int addFileId = 0);
|
||||
virtual Severity STEPread (istream& in, ErrorDescriptor *err,
|
||||
const TypeDescriptor *elem_type =0,
|
||||
InstMgr *insts =0, int addFileId =0);
|
||||
// OUTPUT
|
||||
virtual const char *asStr(SCLstring & s) const;
|
||||
virtual void STEPwrite (ostream& out =G4cout) const;
|
||||
|
||||
// SingleLinkNode * GetHead () const
|
||||
// { return (STEPnode *) SingleLinkList::GetHead(); }
|
||||
|
||||
virtual SingleLinkNode * NewNode ();
|
||||
void AddNode (SingleLinkNode *);
|
||||
void Empty ();
|
||||
|
||||
STEPaggregate ();
|
||||
virtual ~STEPaggregate ();
|
||||
|
||||
// COPY - defined in subtypes
|
||||
virtual STEPaggregate& ShallowCopy (const STEPaggregate&);
|
||||
|
||||
};
|
||||
|
||||
/******************************************************************
|
||||
** Class: GenericAggregate
|
||||
** Description: This class supports LIST OF:
|
||||
** SELECT_TYPE, BINARY_TYPE, GENERIC_TYPE, ENUM_TYPE, UNKNOWN_TYPE type
|
||||
******************************************************************/
|
||||
|
||||
class GenericAggregate : public STEPaggregate
|
||||
{
|
||||
public:
|
||||
virtual SingleLinkNode *NewNode();
|
||||
virtual STEPaggregate& ShallowCopy (const STEPaggregate&);
|
||||
|
||||
GenericAggregate () { }
|
||||
virtual ~GenericAggregate () { }
|
||||
};
|
||||
typedef GenericAggregate * GenericAggregateH;
|
||||
|
||||
/******************************************************************************
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
class EntityAggregate : public STEPaggregate
|
||||
{
|
||||
public:
|
||||
virtual Severity ReadValue(istream &in, ErrorDescriptor *err,
|
||||
const TypeDescriptor *elem_type,
|
||||
InstMgr *insts, int addFileId =0,
|
||||
int assignVal =1, int ExchangeFileFormat =1);
|
||||
|
||||
virtual SingleLinkNode *NewNode();
|
||||
virtual STEPaggregate& ShallowCopy (const STEPaggregate&);
|
||||
|
||||
EntityAggregate ();
|
||||
virtual ~EntityAggregate ();
|
||||
};
|
||||
typedef EntityAggregate * EntityAggregateH;
|
||||
|
||||
/******************************************************************
|
||||
** Class: SelectAggregate
|
||||
** Description: this is a minimal representions for a collection of
|
||||
** STEPenumerations
|
||||
******************************************************************/
|
||||
class SelectAggregate : public STEPaggregate
|
||||
{
|
||||
public:
|
||||
virtual Severity ReadValue(istream &in, ErrorDescriptor *err,
|
||||
const TypeDescriptor *elem_type,
|
||||
InstMgr *insts, int addFileId =0,
|
||||
int assignVal =1, int ExchangeFileFormat =1);
|
||||
|
||||
virtual SingleLinkNode *NewNode ();
|
||||
virtual STEPaggregate& ShallowCopy (const STEPaggregate&);
|
||||
|
||||
SelectAggregate ();
|
||||
virtual ~SelectAggregate ();
|
||||
};
|
||||
typedef SelectAggregate * SelectAggregateH;
|
||||
|
||||
/******************************************************************
|
||||
** Class: StringAggregate
|
||||
** Description: This class supports LIST OF STRING type
|
||||
******************************************************************/
|
||||
class StringAggregate : public STEPaggregate
|
||||
{
|
||||
public:
|
||||
virtual SingleLinkNode *NewNode();
|
||||
virtual STEPaggregate& ShallowCopy (const STEPaggregate&);
|
||||
|
||||
StringAggregate () { }
|
||||
virtual ~StringAggregate () { }
|
||||
};
|
||||
typedef StringAggregate * StringAggregateH;
|
||||
|
||||
|
||||
/******************************************************************
|
||||
** Class: BinaryAggregate
|
||||
** Description: This class supports LIST OF BINARY type
|
||||
******************************************************************/
|
||||
class BinaryAggregate : public STEPaggregate
|
||||
{
|
||||
public:
|
||||
virtual SingleLinkNode *NewNode();
|
||||
virtual STEPaggregate& ShallowCopy (const STEPaggregate&);
|
||||
|
||||
BinaryAggregate () { }
|
||||
virtual ~BinaryAggregate () { }
|
||||
};
|
||||
typedef BinaryAggregate * BinaryAggregateH;
|
||||
|
||||
/******************************************************************
|
||||
** Class: EnumAggregate
|
||||
** Description: this is a minimal representions for a collection of
|
||||
** STEPenumerations
|
||||
******************************************************************/
|
||||
class EnumAggregate : public STEPaggregate
|
||||
{
|
||||
public:
|
||||
virtual SingleLinkNode *NewNode ();
|
||||
virtual STEPaggregate& ShallowCopy (const STEPaggregate&);
|
||||
|
||||
EnumAggregate ();
|
||||
virtual ~EnumAggregate ();
|
||||
};
|
||||
typedef EnumAggregate * EnumAggregateH;
|
||||
|
||||
class Logicals : public EnumAggregate
|
||||
{
|
||||
public:
|
||||
virtual SingleLinkNode * NewNode ();
|
||||
|
||||
Logicals () { }
|
||||
virtual ~Logicals () { }
|
||||
};
|
||||
typedef Logicals * LogicalsH;
|
||||
inline Logicals * create_Logicals () { return new Logicals ; }
|
||||
|
||||
|
||||
class Booleans : public EnumAggregate
|
||||
{
|
||||
public:
|
||||
virtual SingleLinkNode * NewNode ();
|
||||
|
||||
Booleans () { }
|
||||
virtual ~Booleans () { }
|
||||
};
|
||||
typedef Booleans * BooleansH;
|
||||
inline Booleans * create_Booleans () { return new Booleans ; }
|
||||
|
||||
class RealAggregate : public STEPaggregate {
|
||||
|
||||
public:
|
||||
virtual SingleLinkNode *NewNode();
|
||||
virtual STEPaggregate& ShallowCopy (const STEPaggregate&);
|
||||
|
||||
RealAggregate () { }
|
||||
virtual ~RealAggregate () { }
|
||||
};
|
||||
typedef RealAggregate * RealAggregateH;
|
||||
|
||||
class IntAggregate : public STEPaggregate {
|
||||
|
||||
public:
|
||||
virtual SingleLinkNode *NewNode();
|
||||
virtual STEPaggregate& ShallowCopy (const STEPaggregate&);
|
||||
|
||||
IntAggregate () { }
|
||||
virtual ~IntAggregate () { }
|
||||
};
|
||||
typedef IntAggregate * IntAggregateH;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class STEPnode : public SingleLinkNode {
|
||||
protected:
|
||||
int _null;
|
||||
|
||||
public:
|
||||
int is_null() { return _null; }
|
||||
void set_null() { _null = 1; }
|
||||
|
||||
// INPUT
|
||||
virtual Severity StrToVal(const char *s, ErrorDescriptor *err);
|
||||
virtual Severity StrToVal(istream &in, ErrorDescriptor *err);
|
||||
|
||||
virtual Severity STEPread(const char *s, ErrorDescriptor *err);
|
||||
virtual Severity STEPread(istream &in, ErrorDescriptor *err);
|
||||
|
||||
// OUTPUT
|
||||
virtual const char *asStr(SCLstring & s);
|
||||
virtual const char *STEPwrite(SCLstring &s);
|
||||
virtual void STEPwrite (ostream& out =G4cout);
|
||||
};
|
||||
typedef STEPnode * STEPnodeH;
|
||||
|
||||
/******************************************************************
|
||||
** Class: GenericNode
|
||||
** Description: This class is for the Nodes of GenericAggregates
|
||||
******************************************************************/
|
||||
|
||||
class GenericAggrNode : public STEPnode {
|
||||
public:
|
||||
|
||||
SCLundefined value;
|
||||
|
||||
public:
|
||||
// INPUT
|
||||
virtual Severity StrToVal(const char *s, ErrorDescriptor *err);
|
||||
virtual Severity StrToVal(istream &in, ErrorDescriptor *err);
|
||||
|
||||
virtual Severity STEPread(const char *s, ErrorDescriptor *err);
|
||||
virtual Severity STEPread(istream &in, ErrorDescriptor *err);
|
||||
|
||||
// OUTPUT
|
||||
virtual const char *asStr(SCLstring & s);
|
||||
virtual const char *STEPwrite(SCLstring &s);
|
||||
virtual void STEPwrite (ostream& out =G4cout);
|
||||
|
||||
// CONSTRUCTORS
|
||||
GenericAggrNode (const char *str);
|
||||
GenericAggrNode (GenericAggrNode& gan);
|
||||
GenericAggrNode ();
|
||||
~GenericAggrNode ();
|
||||
|
||||
virtual SingleLinkNode * NewNode ();
|
||||
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class EntityNode : public STEPnode {
|
||||
public:
|
||||
STEPentity * node;
|
||||
|
||||
// INPUT
|
||||
virtual Severity StrToVal(const char *s, ErrorDescriptor *err,
|
||||
const TypeDescriptor *elem_type,
|
||||
InstMgr *insts, int addFileId = 0);
|
||||
virtual Severity StrToVal(istream &in, ErrorDescriptor *err,
|
||||
const TypeDescriptor *elem_type,
|
||||
InstMgr *insts, int addFileId = 0);
|
||||
|
||||
virtual Severity STEPread(const char *s, ErrorDescriptor *err,
|
||||
const TypeDescriptor *elem_type,
|
||||
InstMgr *insts, int addFileId = 0);
|
||||
virtual Severity STEPread(istream &in, ErrorDescriptor *err,
|
||||
const TypeDescriptor *elem_type,
|
||||
InstMgr *insts, int addFileId = 0);
|
||||
// OUTPUT
|
||||
virtual const char *asStr(SCLstring & s);
|
||||
virtual const char *STEPwrite (SCLstring &s);
|
||||
virtual void STEPwrite (ostream& out =G4cout);
|
||||
|
||||
// CONSTRUCTORS
|
||||
EntityNode (STEPentity * e);
|
||||
EntityNode () { }
|
||||
~EntityNode () { }
|
||||
|
||||
virtual SingleLinkNode * NewNode ();
|
||||
|
||||
// Calling these funtions is an error.
|
||||
Severity StrToVal(const char *s, ErrorDescriptor *err)
|
||||
{
|
||||
G4cerr << "Internal error: " << __FILE__ << __LINE__
|
||||
<< "\n" << _POC_ "\n";
|
||||
return StrToVal(s, err, 0, 0, 0);
|
||||
}
|
||||
Severity StrToVal(istream &in, ErrorDescriptor *err)
|
||||
{
|
||||
G4cerr << "Internal error: " << __FILE__ << __LINE__
|
||||
<< "\n" << _POC_ "\n";
|
||||
return StrToVal(in, err, 0, 0, 0);
|
||||
}
|
||||
|
||||
Severity STEPread(const char *s, ErrorDescriptor *err)
|
||||
{
|
||||
G4cerr << "Internal error: " << __FILE__ << __LINE__
|
||||
<< "\n" << _POC_ "\n";
|
||||
return STEPread(s, err, 0, 0, 0);
|
||||
}
|
||||
Severity STEPread(istream &in, ErrorDescriptor *err)
|
||||
{
|
||||
G4cerr << "Internal error: " << __FILE__ << __LINE__
|
||||
<< "\n" << _POC_ "\n";
|
||||
return STEPread(in, err, 0, 0, 0);
|
||||
}
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/******************************************************************
|
||||
** Class: SelectNode
|
||||
** Description: this is a minimal representions for node in lists of
|
||||
** STEPenumerations
|
||||
******************************************************************/
|
||||
|
||||
class SelectNode : public STEPnode {
|
||||
public:
|
||||
|
||||
SdaiSelect * node;
|
||||
|
||||
public:
|
||||
// INPUT
|
||||
virtual Severity StrToVal(const char *s, ErrorDescriptor *err,
|
||||
const TypeDescriptor *elem_type,
|
||||
InstMgr *insts, int addFileId = 0);
|
||||
virtual Severity StrToVal(istream &in, ErrorDescriptor *err,
|
||||
const TypeDescriptor *elem_type,
|
||||
InstMgr *insts, int addFileId = 0);
|
||||
|
||||
virtual Severity STEPread(const char *s, ErrorDescriptor *err,
|
||||
const TypeDescriptor *elem_type,
|
||||
InstMgr *insts, int addFileId = 0);
|
||||
virtual Severity STEPread(istream &in, ErrorDescriptor *err,
|
||||
const TypeDescriptor *elem_type,
|
||||
InstMgr *insts, int addFileId = 0);
|
||||
// OUTPUT
|
||||
virtual const char *asStr(SCLstring & s);
|
||||
virtual const char *STEPwrite (SCLstring &s);
|
||||
virtual void STEPwrite (ostream& out =G4cout);
|
||||
|
||||
// CONSTRUCTORS
|
||||
SelectNode (SdaiSelect * s) : node (s) { }
|
||||
SelectNode () { }
|
||||
~SelectNode () { }
|
||||
|
||||
virtual SingleLinkNode * NewNode ();
|
||||
|
||||
// Calling these funtions is an error.
|
||||
Severity StrToVal(const char *s, ErrorDescriptor *err)
|
||||
{
|
||||
G4cerr << "Internal error: " << __FILE__ << __LINE__
|
||||
<< "\n" << _POC_ "\n";
|
||||
return StrToVal(s, err, 0, 0, 0);
|
||||
}
|
||||
Severity StrToVal(istream &in, ErrorDescriptor *err)
|
||||
{
|
||||
G4cerr << "Internal error: " << __FILE__ << __LINE__
|
||||
<< "\n" << _POC_ "\n";
|
||||
return StrToVal(in, err, 0, 0, 0);
|
||||
}
|
||||
|
||||
Severity STEPread(const char *s, ErrorDescriptor *err)
|
||||
{
|
||||
G4cerr << "Internal error: " << __FILE__ << __LINE__
|
||||
<< "\n" << _POC_ "\n";
|
||||
return STEPread(s, err, 0, 0, 0);
|
||||
}
|
||||
Severity STEPread(istream &in, ErrorDescriptor *err)
|
||||
{
|
||||
G4cerr << "Internal error: " << __FILE__ << __LINE__
|
||||
<< "\n" << _POC_ "\n";
|
||||
return STEPread(in, err, 0, 0, 0);
|
||||
}
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/******************************************************************
|
||||
** Class: StringNode
|
||||
** Description: This class is for the Nodes of StringAggregates
|
||||
******************************************************************/
|
||||
|
||||
class StringNode : public STEPnode {
|
||||
public:
|
||||
|
||||
SdaiString value;
|
||||
|
||||
public:
|
||||
// INPUT
|
||||
virtual Severity StrToVal(const char *s, ErrorDescriptor *err);
|
||||
virtual Severity StrToVal(istream &in, ErrorDescriptor *err);
|
||||
|
||||
virtual Severity STEPread(const char *s, ErrorDescriptor *err);
|
||||
virtual Severity STEPread(istream &in, ErrorDescriptor *err);
|
||||
|
||||
// OUTPUT
|
||||
virtual const char *asStr(SCLstring & s);
|
||||
virtual const char *STEPwrite (SCLstring &s);
|
||||
virtual void STEPwrite (ostream& out =G4cout);
|
||||
|
||||
// CONSTRUCTORS
|
||||
StringNode(StringNode& sn);
|
||||
StringNode (const char * sStr);
|
||||
StringNode () { value = 0; }
|
||||
~StringNode () { }
|
||||
|
||||
virtual SingleLinkNode * NewNode ();
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/******************************************************************
|
||||
** Class: BinaryNode
|
||||
** Description: This class is for the Nodes of BinaryAggregates
|
||||
******************************************************************/
|
||||
|
||||
class BinaryNode : public STEPnode {
|
||||
public:
|
||||
|
||||
SdaiBinary value;
|
||||
|
||||
public:
|
||||
// INPUT
|
||||
virtual Severity StrToVal(const char *s, ErrorDescriptor *err);
|
||||
virtual Severity StrToVal(istream &in, ErrorDescriptor *err);
|
||||
|
||||
virtual Severity STEPread(const char *s, ErrorDescriptor *err);
|
||||
virtual Severity STEPread(istream &in, ErrorDescriptor *err);
|
||||
|
||||
// OUTPUT
|
||||
virtual const char *asStr(SCLstring & s);
|
||||
virtual const char *STEPwrite (SCLstring &s);
|
||||
virtual void STEPwrite (ostream& out =G4cout);
|
||||
|
||||
// CONSTRUCTORS
|
||||
BinaryNode(BinaryNode& bn);
|
||||
BinaryNode (const char * sStr);
|
||||
BinaryNode () { value = 0; }
|
||||
~BinaryNode () { }
|
||||
|
||||
virtual SingleLinkNode * NewNode ();
|
||||
};
|
||||
|
||||
/******************************************************************
|
||||
** Class: EnumNode
|
||||
** Description: this is a minimal representions for node in lists of
|
||||
** STEPenumerations
|
||||
******************************************************************/
|
||||
|
||||
class EnumNode : public STEPnode {
|
||||
public:
|
||||
|
||||
STEPenumeration * node;
|
||||
|
||||
public:
|
||||
// INPUT
|
||||
virtual Severity StrToVal(const char *s, ErrorDescriptor *err);
|
||||
virtual Severity StrToVal(istream &in, ErrorDescriptor *err);
|
||||
|
||||
virtual Severity STEPread(const char *s, ErrorDescriptor *err);
|
||||
virtual Severity STEPread(istream &in, ErrorDescriptor *err);
|
||||
|
||||
// OUTPUT
|
||||
virtual const char *asStr(SCLstring & s);
|
||||
virtual const char *STEPwrite (SCLstring &s);
|
||||
virtual void STEPwrite (ostream& out =G4cout);
|
||||
|
||||
// CONSTRUCTORS
|
||||
EnumNode (STEPenumeration * e) : node (e) { }
|
||||
EnumNode () { }
|
||||
~EnumNode () { }
|
||||
|
||||
virtual SingleLinkNode * NewNode ();
|
||||
};
|
||||
|
||||
class RealNode : public STEPnode {
|
||||
public:
|
||||
SdaiReal value; // double
|
||||
|
||||
public:
|
||||
// INPUT
|
||||
virtual Severity StrToVal(const char *s, ErrorDescriptor *err);
|
||||
virtual Severity StrToVal(istream &in, ErrorDescriptor *err);
|
||||
|
||||
virtual Severity STEPread(const char *s, ErrorDescriptor *err);
|
||||
virtual Severity STEPread(istream &in, ErrorDescriptor *err);
|
||||
|
||||
// OUTPUT
|
||||
virtual const char *asStr(SCLstring & s);
|
||||
virtual const char *STEPwrite (SCLstring &s);
|
||||
virtual void STEPwrite (ostream& out =G4cout);
|
||||
|
||||
// CONSTRUCTORS
|
||||
RealNode () { value = S_REAL_NULL; }
|
||||
~RealNode () { }
|
||||
|
||||
virtual SingleLinkNode * NewNode ();
|
||||
};
|
||||
|
||||
class IntNode : public STEPnode {
|
||||
public:
|
||||
SdaiInteger value; // long int
|
||||
|
||||
public:
|
||||
// INPUT
|
||||
virtual Severity StrToVal(const char *s, ErrorDescriptor *err);
|
||||
virtual Severity StrToVal(istream &in, ErrorDescriptor *err);
|
||||
|
||||
virtual Severity STEPread(const char *s, ErrorDescriptor *err);
|
||||
virtual Severity STEPread(istream &in, ErrorDescriptor *err);
|
||||
|
||||
// OUTPUT
|
||||
virtual const char *asStr(SCLstring & s);
|
||||
virtual const char *STEPwrite (SCLstring &s);
|
||||
virtual void STEPwrite (ostream& out =G4cout);
|
||||
|
||||
// CONSTRUCTORS
|
||||
IntNode () { value = S_INT_NULL; }
|
||||
~IntNode () { }
|
||||
|
||||
virtual SingleLinkNode * NewNode ();
|
||||
};
|
||||
|
||||
/******************************************************************
|
||||
** The following classes are currently stubs
|
||||
**
|
||||
**/
|
||||
|
||||
class Array : public STEPaggregate {
|
||||
public:
|
||||
int lowerBound;
|
||||
int upperBound;
|
||||
};
|
||||
|
||||
class Bag : public STEPaggregate {
|
||||
public:
|
||||
int min_ele;
|
||||
int max_ele;
|
||||
};
|
||||
|
||||
class List : public STEPaggregate {
|
||||
int min_ele;
|
||||
int max_ele;
|
||||
List *prev;
|
||||
};
|
||||
|
||||
class Set :
|
||||
public STEPaggregate {
|
||||
int cnt;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,222 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: STEPattribute.h,v 2.1 1998/07/13 16:53:14 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef STEPATTRIBUTE_H
|
||||
#define STEPATTRIBUTE_H 1
|
||||
|
||||
/*
|
||||
* NIST STEP Core Class Library
|
||||
* clstepcore/STEPattribute.h
|
||||
* May 1995
|
||||
* K. C. Morris
|
||||
* David Sauder
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errordesc.h>
|
||||
#include <baseType.h>
|
||||
|
||||
// this is used to set a const int Real_Num_Precision
|
||||
// in STEPaggregate.cc and STEPattribute.cc
|
||||
#define REAL_NUM_PRECISION 15
|
||||
|
||||
typedef unsigned short BOOLEAN;
|
||||
typedef double real;
|
||||
|
||||
class InstMgr;
|
||||
class STEPentity;
|
||||
class STEPenumeration;
|
||||
class STEPaggregate;
|
||||
class SCLundefined;
|
||||
class SdaiSelect;
|
||||
class SdaiBinary;
|
||||
|
||||
class TypeDescriptor;
|
||||
class AttrDescriptor;
|
||||
class EntityDescriptor;
|
||||
|
||||
#ifdef WIN32
|
||||
# include <Strstrea.h>
|
||||
#else
|
||||
# include <strstream.h>
|
||||
#endif
|
||||
#include <ExpDict.h>
|
||||
|
||||
#define s_String char *
|
||||
|
||||
extern int SetErrOnNull(const char *attrValue, ErrorDescriptor *error);
|
||||
////////////////////
|
||||
////////////////////
|
||||
|
||||
extern Severity
|
||||
CheckRemainingInput(istream &in, ErrorDescriptor *err,
|
||||
const char *typeName, // used in error message
|
||||
const char *tokenList); // e.g. ",)"
|
||||
|
||||
extern STEPentity *
|
||||
ReadEntityRef(istream &in, ErrorDescriptor *err, char *tokenList,
|
||||
InstMgr * instances, int addFileId);
|
||||
|
||||
extern STEPentity *
|
||||
ReadEntityRef(const char * s, ErrorDescriptor *err, char *tokenList,
|
||||
InstMgr * instances, int addFileId);
|
||||
|
||||
extern Severity
|
||||
EntityValidLevel(STEPentity *se,
|
||||
const TypeDescriptor *ed, // entity type that entity se needs
|
||||
// to match. (this must be an
|
||||
// EntityDescriptor)
|
||||
ErrorDescriptor *err);
|
||||
|
||||
extern Severity
|
||||
EntityValidLevel(const char *attrValue, // string contain entity ref
|
||||
const TypeDescriptor *ed, // entity type that entity in
|
||||
// attrValue (if it exists) needs
|
||||
// to match. (this must be an
|
||||
// EntityDescriptor)
|
||||
ErrorDescriptor *err, InstMgr *im, int clearError);
|
||||
|
||||
////////////////////
|
||||
////////////////////
|
||||
|
||||
extern STEPentity *STEPread_reference (const char * s, ErrorDescriptor *err,
|
||||
InstMgr * instances, int addFileId);
|
||||
////////////////////
|
||||
|
||||
extern int QuoteInString(istream& in);
|
||||
|
||||
extern void AppendChar(char c, int& index, char *&s, int& sSize);
|
||||
|
||||
extern void
|
||||
PushPastString (istream& in, SCLstring &s, ErrorDescriptor *err);
|
||||
|
||||
extern void
|
||||
PushPastImbedAggr (istream& in, SCLstring &s, ErrorDescriptor *err);
|
||||
|
||||
extern void
|
||||
PushPastAggr1Dim(istream& in, SCLstring &s, ErrorDescriptor *err);
|
||||
|
||||
//extern Severity ValidateEntityType(STEPentity *se,
|
||||
// const AttrDescriptor *ad,
|
||||
// ErrorDescriptor *error);
|
||||
|
||||
class STEPattribute {
|
||||
|
||||
friend ostream &operator<< ( ostream&, STEPattribute& );
|
||||
friend class STEPentity;
|
||||
|
||||
protected:
|
||||
ErrorDescriptor _error;
|
||||
unsigned int _derive : 1;
|
||||
int Derive (unsigned int n =1) { return _derive =n; }
|
||||
|
||||
public:
|
||||
const AttrDescriptor * aDesc;
|
||||
|
||||
// You know which of these to use based on the return value of
|
||||
// NonRefType() - see below. BASE_TYPE is defined in baseType.h
|
||||
// This variable points to an appropriate member variable in the entity
|
||||
// class in the generated schema class library (the entity class is
|
||||
// inherited from STEPentity)
|
||||
union {
|
||||
SdaiInteger *i; // INTEGER_TYPE // SdaiInteger is a long int
|
||||
class SdaiString *S; // STRING_TYPE
|
||||
class SdaiBinary *b; // BINARY_TYPE
|
||||
SdaiReal *r; // REAL_TYPE and NUMBER_TYPE // SdaiReal is a double
|
||||
class STEPentity* *c; // ENTITY_TYPE
|
||||
STEPaggregate *a; // AGGREGATE_TYPE
|
||||
STEPenumeration *e; // ENUM_TYPE, BOOLEAN_TYPE, and LOGICAL_TYPE
|
||||
class SdaiSelect *sh; // SELECT_TYPE
|
||||
SCLundefined *u; // UNKNOWN_TYPE
|
||||
|
||||
void *p;
|
||||
|
||||
} ptr;
|
||||
|
||||
protected:
|
||||
char SkipBadAttr(istream& in, char *StopChars);
|
||||
void AddErrorInfo();
|
||||
|
||||
public:
|
||||
|
||||
///////////// Read, Write, Assign attr value
|
||||
|
||||
Severity StrToVal(const char *s, InstMgr *instances =0,
|
||||
int addFileId =0);
|
||||
Severity STEPread(istream& in = cin, InstMgr *instances =0,
|
||||
int addFileId =0);
|
||||
|
||||
const char * asStr(SCLstring &) const; // return the attr value as a string
|
||||
void STEPwrite(ostream& out = G4cout);
|
||||
|
||||
BOOLEAN ShallowCopy(STEPattribute *sa);
|
||||
|
||||
Severity set_null();
|
||||
|
||||
////////////// Return info on attr
|
||||
|
||||
BOOLEAN Nullable() const; // may this attribute be null?
|
||||
BOOLEAN is_null () const; // is this attribute null?
|
||||
int IsDerived () const { return _derive; }
|
||||
|
||||
const s_String Name() const;
|
||||
const s_String TypeName() const;
|
||||
const BASE_TYPE Type() const;
|
||||
const BASE_TYPE NonRefType() const;
|
||||
const BASE_TYPE BaseType() const;
|
||||
|
||||
const TypeDescriptor *ReferentType() const;
|
||||
|
||||
ErrorDescriptor &Error() { return _error; }
|
||||
void ClearErrorMsg() { _error.ClearErrorMsg(); }
|
||||
|
||||
Severity ValidLevel (const char *attrValue, ErrorDescriptor *error,
|
||||
InstMgr *im, int clearError = 1);
|
||||
public:
|
||||
|
||||
////////////////// Constructors
|
||||
|
||||
STEPattribute (const STEPattribute& a);
|
||||
STEPattribute () {};
|
||||
|
||||
~STEPattribute () {};
|
||||
|
||||
// INTEGER
|
||||
STEPattribute (const class AttrDescriptor& d, SdaiInteger *p);
|
||||
// BINARY
|
||||
STEPattribute (const class AttrDescriptor& d, SdaiBinary *p);
|
||||
// STRING
|
||||
STEPattribute (const class AttrDescriptor& d, SdaiString *p);
|
||||
// REAL & NUMBER
|
||||
STEPattribute (const class AttrDescriptor& d, SdaiReal *p);
|
||||
// ENTITY
|
||||
STEPattribute (const class AttrDescriptor& d, STEPentity* *p);
|
||||
// AGGREGATE
|
||||
STEPattribute (const class AttrDescriptor& d, STEPaggregate *p);
|
||||
// ENUMERATION and Logical
|
||||
STEPattribute (const class AttrDescriptor& d, STEPenumeration *p);
|
||||
// SELECT
|
||||
STEPattribute (const class AttrDescriptor& d, class SdaiSelect *p);
|
||||
// UNDEFINED
|
||||
STEPattribute (const class AttrDescriptor& d, SCLundefined *p);
|
||||
|
||||
friend int operator == (STEPattribute &a1, STEPattribute &a2);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,83 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: STEPattributeList.h,v 2.1 1998/07/12 02:57:15 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef _STEPattributeList_h
|
||||
#define _STEPattributeList_h 1
|
||||
|
||||
/*
|
||||
* NIST STEP Core Class Library
|
||||
* clstepcore/STEPattributeList.h
|
||||
* May 1995
|
||||
* K. C. Morris
|
||||
* David Sauder
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
//#ifndef _STEPattribute_typedefs
|
||||
//#define _STEPattribute_typedefs 1
|
||||
|
||||
#include <STEPattribute.h>
|
||||
#include <SingleLinkList.h>
|
||||
|
||||
//class STEPattribute;
|
||||
class STEPattributeList;
|
||||
//class AttrListNode;
|
||||
|
||||
class AttrListNode : public SingleLinkNode
|
||||
{
|
||||
friend class STEPattributeList;
|
||||
|
||||
protected:
|
||||
STEPattribute *attr;
|
||||
|
||||
public:
|
||||
AttrListNode(STEPattribute *a) { attr = a; }
|
||||
};
|
||||
|
||||
class STEPattributeList : public SingleLinkList
|
||||
{
|
||||
public:
|
||||
STEPattributeList() { }
|
||||
|
||||
STEPattribute& operator [] (int n);
|
||||
int list_length();
|
||||
void push(STEPattribute *a);
|
||||
|
||||
};
|
||||
|
||||
/*****************************************************************
|
||||
** **
|
||||
** This file defines the type STEPattributeList -- a List **
|
||||
** of pointers to STEPattribute objects. The nodes on the **
|
||||
** List point to STEPattributes.
|
||||
** **
|
||||
USED TO BE - DAS
|
||||
** The file was generated by using GNU's genclass.sh **
|
||||
** script with the List prototype definitions. The **
|
||||
** command to Generate it was as follows: **
|
||||
|
||||
genclass.sh STEPattribute ref List STEPattribute
|
||||
|
||||
** The file is dependent on the file "STEPattribute.h" **
|
||||
** which contains the definition of STEPattribute. **
|
||||
** **
|
||||
** 1/15/91 kcm **
|
||||
*****************************************************************/
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,68 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: STEPcomplex.h,v 2.1 1998/07/13 16:53:16 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef STEPCOMPLEX_H
|
||||
#define STEPCOMPLEX_H
|
||||
|
||||
#include <errordesc.h>
|
||||
#include <sdai.h>
|
||||
#include <baseType.h>
|
||||
#include <ExpDict.h>
|
||||
#include <STEPentity.h>
|
||||
#include <Registry.h>
|
||||
|
||||
class STEPcomplex : public STEPentity {
|
||||
public:
|
||||
STEPcomplex * sc;
|
||||
STEPcomplex * head;
|
||||
Registry * _registry;
|
||||
int visited; // used when reading (or as you wish?)
|
||||
|
||||
public:
|
||||
STEPcomplex(Registry *registry, int fileid);
|
||||
STEPcomplex(Registry *registry, const SCLstring **names, int fileid);
|
||||
STEPcomplex(Registry *registry, const char **names, int fileid);
|
||||
|
||||
virtual ~STEPcomplex();
|
||||
|
||||
int EntityExists(const char *name);
|
||||
STEPcomplex *EntityPart(const char *name);
|
||||
|
||||
/*
|
||||
// page 241 Stroustrup
|
||||
STEPcomplex &operator[](const char *name);
|
||||
STEPcomplex &operator[](const int index);
|
||||
*/
|
||||
|
||||
virtual Severity ValidLevel(ErrorDescriptor *error, InstMgr *im,
|
||||
int clearError = 1);
|
||||
// READ
|
||||
virtual Severity STEPread(int id, int addFileId,
|
||||
InstMgr * instance_set,
|
||||
istream& in =cin);
|
||||
virtual void STEPread_error(char c, int index, istream& in);
|
||||
|
||||
// WRITE
|
||||
virtual void STEPwrite(ostream& out =G4cout, int writeComment = 1);
|
||||
virtual const char * STEPwrite(SCLstring &buf);
|
||||
|
||||
virtual void WriteExtMapEntities(ostream& out =G4cout);
|
||||
virtual const char * WriteExtMapEntities(SCLstring &buf);
|
||||
virtual void AppendEntity(STEPcomplex *stepc);
|
||||
|
||||
protected:
|
||||
virtual void CopyAs (STEPentity *);
|
||||
void BuildAttrs(const char *s );
|
||||
void AddEntityPart(const char *name);
|
||||
void AssignDerives();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,165 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: STEPentity.h,v 2.1 1998/07/13 16:53:17 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef STEPENTITY_H
|
||||
#define STEPENTITY_H 1
|
||||
|
||||
/*
|
||||
* NIST STEP Core Class Library
|
||||
* clstepcore/STEPentity.h
|
||||
* May 1995
|
||||
* K. C. Morris
|
||||
* David Sauder
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <STEPattributeList.h>
|
||||
|
||||
#include <EntityInst.h>
|
||||
|
||||
#include <sdai.h>
|
||||
|
||||
class STEPattributeList;
|
||||
class STEPattribute;
|
||||
|
||||
#include <ctype.h>
|
||||
#include <Str.h>
|
||||
|
||||
class InstMgr;
|
||||
class EntityDescriptor;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// STEPentity is like the corresponding SDAI object AppInstance.
|
||||
|
||||
class STEPentity : public EntityInstance {
|
||||
private:
|
||||
int _cur; // provides a built-in way of accessing attributes in order.
|
||||
|
||||
public:
|
||||
STEPattributeList attributes;
|
||||
int STEPfile_id;
|
||||
ErrorDescriptor _error;
|
||||
SCLstring *p21Comment;
|
||||
// registry additions
|
||||
EntityDescriptor *eDesc;
|
||||
|
||||
// head entity for multiple inheritance. If it is null then this
|
||||
// STEPentity is not part of a multiply inherited entity. If it
|
||||
// points to a STEPentity then this STEPentity is part of a mi entity
|
||||
// and head points at the root STEPentity of the primary inheritance
|
||||
// path (the one that is the root of the leaf entity).
|
||||
STEPentity *headMiEntity;
|
||||
// these form a chain of other entity parents for multiple inheritance
|
||||
STEPentity *nextMiEntity;
|
||||
|
||||
protected:
|
||||
int _complex;
|
||||
|
||||
public:
|
||||
STEPentity ();
|
||||
STEPentity (int fileid, int complex = 0);
|
||||
virtual ~STEPentity();
|
||||
|
||||
int IsComplex() { return _complex; }
|
||||
int SetFileId(int fid) { return STEPfile_id = fid; }
|
||||
int GetFileId() const { return STEPfile_id; }
|
||||
int FileId (int fid) { return STEPfile_id = fid; }
|
||||
int FileId() const { return STEPfile_id; }
|
||||
|
||||
void AddP21Comment(SCLstring &s, int replace = 1);
|
||||
void AddP21Comment(const char *s, int replace = 1);
|
||||
void DeleteP21Comment() { delete p21Comment; p21Comment = 0; }
|
||||
|
||||
// guaranteed a string (may be null string)
|
||||
const char *P21Comment()
|
||||
{ return ( p21Comment ? p21Comment->chars() : "" ); }
|
||||
// returns null if no comment exists
|
||||
const char *P21CommentRep()
|
||||
{ return ( p21Comment ? p21Comment->rep() : 0 ); }
|
||||
|
||||
const char *EntityName() const { return eDesc->Name(); }
|
||||
|
||||
virtual Severity ValidLevel(ErrorDescriptor *error, InstMgr *im,
|
||||
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
|
||||
void ClearAttrError();
|
||||
// void EnforceOptionality(int on = 1);
|
||||
|
||||
STEPentity *Replicate();
|
||||
|
||||
// ACCESS attributes in order.
|
||||
int AttributeCount();
|
||||
STEPattribute * NextAttribute();
|
||||
void ResetAttributes() { _cur =0; }
|
||||
|
||||
// READ
|
||||
virtual Severity STEPread(int id, int addFileId,
|
||||
class InstMgr * instance_set,
|
||||
istream& in =cin);
|
||||
virtual void STEPread_error(char c, int index, istream& in);
|
||||
|
||||
// WRITE
|
||||
virtual void STEPwrite(ostream& out =G4cout, int writeComment = 1);
|
||||
virtual const char * STEPwrite(SCLstring &buf);
|
||||
|
||||
void STEPwrite_reference (ostream& out =G4cout);
|
||||
const char * STEPwrite_reference (SCLstring &buf);
|
||||
|
||||
void beginSTEPwrite(ostream& out =G4cout); // writes out the SCOPE section
|
||||
void endSTEPwrite(ostream& out =G4cout);
|
||||
|
||||
// MULTIPLE INHERITANCE
|
||||
int MultipleInheritance() { return !(headMiEntity == 0); }
|
||||
|
||||
void HeadEntity(STEPentity *se) { headMiEntity = se; }
|
||||
STEPentity * HeadEntity() { return headMiEntity; }
|
||||
|
||||
STEPentity *GetNextMiEntity() { return nextMiEntity; }
|
||||
STEPentity *GetMiEntity(char *EntityName);
|
||||
void AppendMultInstance(STEPentity *se);
|
||||
|
||||
protected:
|
||||
STEPattribute * GetSTEPattribute (const char *);
|
||||
STEPattribute * MakeDerived (const char *);
|
||||
|
||||
virtual void CopyAs (STEPentity *);
|
||||
void PrependEntityErrMsg();
|
||||
}
|
||||
;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern STEPentity NilSTEPentity;
|
||||
#define ENTITY_NULL &NilSTEPentity
|
||||
#define NULL_ENTITY &NilSTEPentity
|
||||
|
||||
typedef STEPentity* STEPentityPtr;
|
||||
typedef STEPentity* STEPentityH;
|
||||
|
||||
extern STEPentity *
|
||||
ReadEntityRef(istream &in, ErrorDescriptor *err, char *tokenList,
|
||||
InstMgr * instances, int addFileId);
|
||||
|
||||
//typedef STEPentity * (* Creator) () const;
|
||||
//typedef STEPentity * (* Creator) () ;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,235 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: STEPfile.h,v 2.2 1998/10/30 22:49:10 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef _STEPFILE_H
|
||||
#define _STEPFILE_H
|
||||
|
||||
/*
|
||||
* NIST STEP Core Class Library
|
||||
* cleditor/STEPfile.h
|
||||
* May 1995
|
||||
* Peter Carr
|
||||
* K. C. Morris
|
||||
* David Sauder
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
#include "globals.hh"
|
||||
//#include <math.h>
|
||||
|
||||
|
||||
//typedef unsigned boolean;
|
||||
|
||||
#include <instmgr.h>
|
||||
#include <Registry.h>
|
||||
#include <fstream.h>
|
||||
#include <dirobj.h>
|
||||
#include <errordesc.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <read_func.h>
|
||||
|
||||
//error reporting level
|
||||
#define READ_COMPLETE 10
|
||||
#define READ_INCOMPLETE 20
|
||||
|
||||
enum FileTypeCode {
|
||||
TYPE_UNKNOWN = -2,
|
||||
VERSION_OLD = -1,
|
||||
VERSION_UNKNOWN = 0,
|
||||
VERSION_CURRENT = 1,
|
||||
WORKING_SESSION = 2,
|
||||
OLD_WORKING_SESSION = 3
|
||||
};
|
||||
|
||||
class STEPfile
|
||||
{
|
||||
protected:
|
||||
//data members
|
||||
|
||||
#ifdef __O3DB__
|
||||
InstMgr * _instances;
|
||||
Registry * _reg;
|
||||
|
||||
InstMgr & instances () { return *_instances; }
|
||||
Registry & reg () { return *_reg; }
|
||||
#else
|
||||
InstMgr& _instances;
|
||||
Registry& _reg;
|
||||
|
||||
InstMgr & instances () { return _instances; }
|
||||
Registry & reg () { return _reg; }
|
||||
#endif
|
||||
int _fileIdIncr; //Increment value to be added to FileId Numbers on input
|
||||
|
||||
//header information
|
||||
InstMgr* _headerInstances;
|
||||
Registry *_headerRegistry;
|
||||
//Registry *_headerUserDefined;
|
||||
// Registry *_headerRegistryOld;
|
||||
|
||||
int _headerId; //STEPfile_id given to STEPentity from header section
|
||||
|
||||
//file information
|
||||
DirObj* _currentDir;
|
||||
char* _fileName;
|
||||
|
||||
//error information
|
||||
ErrorDescriptor _error;
|
||||
|
||||
// new errors
|
||||
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
|
||||
|
||||
// old errors
|
||||
int _errorCount;
|
||||
int _warningCount;
|
||||
|
||||
int _maxErrorCount;
|
||||
|
||||
protected:
|
||||
|
||||
//file type information
|
||||
FileTypeCode _fileType;
|
||||
char ENTITY_NAME_DELIM;
|
||||
char* FILE_DELIM;
|
||||
char* END_FILE_DELIM;
|
||||
|
||||
//public member functions
|
||||
public:
|
||||
|
||||
//public access to member variables
|
||||
//header information
|
||||
InstMgr* HeaderInstances() { return _headerInstances; }
|
||||
|
||||
//file information
|
||||
const char* FileName() const { return _fileName; }
|
||||
const char* SetFileName (const char* name = "");
|
||||
const char* TruncFileName (const char* name) const;
|
||||
|
||||
//error information
|
||||
ErrorDescriptor& Error() /* const */ { return _error; }
|
||||
int ErrorCount() const { return _errorCount; }
|
||||
int WarningCount() const { return _warningCount; }
|
||||
Severity AppendEntityErrorMsg (ErrorDescriptor *e);
|
||||
|
||||
//version information
|
||||
FileTypeCode FileType() const { return _fileType; }
|
||||
void FileType (FileTypeCode ft) { _fileType = ft; }
|
||||
int SetFileType (FileTypeCode ft = VERSION_CURRENT);
|
||||
|
||||
//Reading and Writing
|
||||
Severity ReadExchangeFile (const char* filename =0);
|
||||
Severity AppendExchangeFile (const char* filename =0);
|
||||
|
||||
Severity ReadWorkingFile (const char* filename =0);
|
||||
Severity AppendWorkingFile (const char* filename =0);
|
||||
|
||||
Severity AppendFile (istream* in) ;
|
||||
|
||||
Severity WriteExchangeFile (ostream& out, int validate =1);
|
||||
Severity WriteExchangeFile (const char* filename =0, int validate =1);
|
||||
|
||||
Severity WriteWorkingFile (ostream& out);
|
||||
Severity WriteWorkingFile (const char* filename =0);
|
||||
|
||||
stateEnum EntityWfState(char c);
|
||||
|
||||
void Renumber ();
|
||||
|
||||
//constructors
|
||||
STEPfile (Registry& r, InstMgr& i, const char *filename = (const char*)0);
|
||||
~STEPfile();
|
||||
|
||||
protected:
|
||||
//member functions
|
||||
|
||||
//called by ReadExchangeFile
|
||||
istream* OpenInputFile (const char* filename = "");
|
||||
void CloseInputFile(istream* in);
|
||||
|
||||
Severity ReadHeader(istream& in);
|
||||
|
||||
InstMgr* HeaderConvertToNew(InstMgr& oldinst);
|
||||
Severity HeaderVerifyInstances(InstMgr* im);
|
||||
void HeaderMergeInstances(InstMgr* im);
|
||||
STEPentity* HeaderDefaultFileName();
|
||||
STEPentity* HeaderDefaultFileDescription();
|
||||
STEPentity* HeaderDefaultFileSchema();
|
||||
|
||||
int HeaderId (int Increment ); // =1);
|
||||
int HeaderId (const char* nm); // ="\0"); // DELETED both defaults !!
|
||||
// J.Apostolakis Oct 30, 98
|
||||
int HeaderIdOld (const char* nm ="\0");
|
||||
|
||||
int ReadData1 (istream& in); // first pass to create instances
|
||||
int ReadData2 (istream& in); // second pass to read instances
|
||||
|
||||
// obsolete
|
||||
int ReadWorkingData1 (istream& in);
|
||||
int ReadWorkingData2 (istream& in);
|
||||
|
||||
void ReadRestOfFile(istream& in);
|
||||
|
||||
// create instance - used by ReadData1()
|
||||
STEPentity * CreateInstance(istream& in, ostream& out);
|
||||
// create complex instance - used by CreateInstance()
|
||||
STEPentity * CreateSubSuperInstance(istream& in, int fileid);
|
||||
|
||||
// read the instance - used by ReadData2()
|
||||
STEPentity * ReadInstance (istream& in, ostream& out, SCLstring &cmtStr);
|
||||
|
||||
// reading scopes are still incomplete
|
||||
// these functions are stubs
|
||||
Severity CreateScopeInstances(istream& in, STEPentityH ** scopelist);
|
||||
Severity ReadScopeInstances(istream& in);
|
||||
// Severity ReadSubSuperInstance(istream& in);
|
||||
|
||||
int FindDataSection (istream& in);
|
||||
int FindHeaderSection (istream& in);
|
||||
|
||||
// writing working session files
|
||||
void WriteWorkingData(ostream& out);
|
||||
|
||||
//called by WriteExchangeFile
|
||||
ofstream* OpenOutputFile(const char* filename =0);
|
||||
void CloseOutputFile(ostream* out);
|
||||
|
||||
void WriteHeader (ostream& out);
|
||||
void WriteHeaderInstance (STEPentity *obj, ostream& out);
|
||||
void WriteHeaderInstanceFileName (ostream& out);
|
||||
void WriteHeaderInstanceFileDescription (ostream& out);
|
||||
void WriteHeaderInstanceFileSchema (ostream& out);
|
||||
|
||||
void WriteData (ostream& out);
|
||||
|
||||
int IncrementFileId (int fileid);
|
||||
int FileIdIncr() { return _fileIdIncr; }
|
||||
void SetFileIdIncrement ();
|
||||
void MakeBackupFile();
|
||||
|
||||
// void ReadWhiteSpace(istream& in);
|
||||
};
|
||||
|
||||
//inline functions
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: STEPselect.h,v 2.1 1998/07/13 16:53:18 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef _STEPSELECT_H
|
||||
#define _STEPSELECT_H
|
||||
|
||||
/*
|
||||
* NIST STEP Core Class Library
|
||||
* clstepcore/STEPselect.h
|
||||
* May 1995
|
||||
* Dave Helfrick
|
||||
* KC Morris
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
#include <baseType.h>
|
||||
#include <scl_string.h>
|
||||
#include <sdai.h>
|
||||
#include <errordesc.h>
|
||||
#include <read_func.h>
|
||||
|
||||
class TypeDescriptor;
|
||||
class SelectTypeDescriptor;
|
||||
class InstMgr;
|
||||
|
||||
/**********
|
||||
class definition for the select superclass SdaiSelect.
|
||||
**********/
|
||||
class SdaiSelect {
|
||||
protected:
|
||||
const SelectTypeDescriptor *_type;
|
||||
const TypeDescriptor * underlying_type;
|
||||
BASE_TYPE base_type; // used by the subtypes
|
||||
|
||||
SdaiString val;
|
||||
ErrorDescriptor _error;
|
||||
const TypeDescriptor * SetUnderlyingType (const TypeDescriptor *);
|
||||
|
||||
const TypeDescriptor * CanBe (const char *) const;
|
||||
const TypeDescriptor * CanBe (BASE_TYPE) const;
|
||||
const TypeDescriptor * CanBe (const TypeDescriptor * td) const;
|
||||
|
||||
virtual const TypeDescriptor * AssignEntity (STEPentity * se) =0;
|
||||
virtual SdaiSelect * NewSelect () =0;
|
||||
public:
|
||||
Severity severity() const;
|
||||
Severity severity( Severity );
|
||||
const char *Error();
|
||||
void Error( char * );
|
||||
// clears select's error
|
||||
void ClearError();
|
||||
// clears error
|
||||
|
||||
// constructors
|
||||
SdaiSelect (const SelectTypeDescriptor * s =0,
|
||||
const TypeDescriptor * td =0)
|
||||
: _type (s), underlying_type (td) { }
|
||||
|
||||
virtual ~SdaiSelect () { };
|
||||
|
||||
// from SDAI binding
|
||||
SdaiString UnderlyingTypeName () const;
|
||||
const TypeDescriptor * CurrentUnderlyingType() const;
|
||||
int exists() const;
|
||||
void nullify();
|
||||
|
||||
Severity SelectValidLevel(const char *attrValue, ErrorDescriptor *err,
|
||||
InstMgr *im, int clearError);
|
||||
|
||||
// reading and writing
|
||||
const char * STEPwrite(SCLstring& s) const;
|
||||
void STEPwrite (ostream& out =G4cout) const;
|
||||
virtual void STEPwrite_content (ostream& out) const =0;
|
||||
// char * asStr() const;
|
||||
|
||||
|
||||
Severity StrToVal(const char *val, const char *selectType,
|
||||
ErrorDescriptor *err, InstMgr * instances =0);
|
||||
virtual Severity StrToVal_content (const char *,
|
||||
InstMgr * instances =0) =0;
|
||||
|
||||
Severity STEPread(istream& in, ErrorDescriptor *err,
|
||||
InstMgr * instances = 0, int addFileId =0);
|
||||
|
||||
// abstract function
|
||||
virtual Severity STEPread_content (istream& in =cin,
|
||||
InstMgr * instances =0,
|
||||
int addFileId =0) =0;
|
||||
|
||||
virtual SdaiSelect& operator =( const SdaiSelect& ) { return *this; }
|
||||
|
||||
int set_null();
|
||||
int is_null();
|
||||
}; /** end class **/
|
||||
|
||||
typedef SdaiSelect * SdaiSelectH ;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,68 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: STEPstring.h,v 2.1 1998/07/13 16:53:20 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef STEPSTRING_H
|
||||
#define STEPSTRING_H 1
|
||||
|
||||
/*
|
||||
* NIST STEP Core Class Library
|
||||
* clstepcore/STEPstring.h
|
||||
* May 1995
|
||||
* KC Morris
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
class ErrorDescriptor;
|
||||
#include <scl_string.h>
|
||||
#include <errordesc.h>
|
||||
|
||||
#ifndef STRING_DELIM
|
||||
#define STRING_DELIM '\''
|
||||
#endif
|
||||
|
||||
class SdaiString : public SCLstring {
|
||||
public:
|
||||
|
||||
//constructor(s) & destructor
|
||||
SdaiString (const char * str = 0, int max =0) : SCLstring (str,max) { }
|
||||
SdaiString (const SCLstring& s) : SCLstring (s) { }
|
||||
SdaiString (const SdaiString& s) : SCLstring (s) { }
|
||||
~SdaiString () { }
|
||||
|
||||
// operators
|
||||
SdaiString& operator= (const char* s);
|
||||
|
||||
// format for STEP
|
||||
const char * asStr (SCLstring & s) const { return s = chars (); }
|
||||
void STEPwrite (ostream& out =G4cout) const;
|
||||
void STEPwrite (SCLstring &s) const;
|
||||
|
||||
Severity StrToVal (const char *s);
|
||||
Severity STEPread (istream& in, ErrorDescriptor *err);
|
||||
Severity STEPread (const char *s, ErrorDescriptor *err);
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
inline
|
||||
SdaiString&
|
||||
SdaiString::operator= (const char* s)
|
||||
{ SCLstring::operator= (s);
|
||||
return *this; }
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,61 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: STEPundefined.h,v 2.1 1998/07/13 16:53:21 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef STEPUNDEFINED_H
|
||||
#define STEPUNDEFINED_H
|
||||
|
||||
/*
|
||||
* NIST STEP Core Class Library
|
||||
* clstepcore/STEPundefined.h
|
||||
* May 1995
|
||||
* KC Morris
|
||||
* David Sauder
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
#include <errordesc.h>
|
||||
#include <scl_string.h>
|
||||
#include <read_func.h>
|
||||
|
||||
class SCLundefined {
|
||||
protected:
|
||||
SCLstring val;
|
||||
|
||||
public:
|
||||
// INPUT
|
||||
virtual Severity StrToVal(const char *s, ErrorDescriptor *err);
|
||||
virtual Severity StrToVal(istream &in, ErrorDescriptor *err);
|
||||
|
||||
virtual Severity STEPread(const char *s, ErrorDescriptor *err);
|
||||
virtual Severity STEPread(istream &in, ErrorDescriptor *err);
|
||||
|
||||
// OUTPUT
|
||||
virtual const char *asStr(SCLstring &s) const;
|
||||
virtual const char *STEPwrite(SCLstring &s);
|
||||
virtual void STEPwrite (ostream& out =G4cout);
|
||||
|
||||
int set_null ();
|
||||
int is_null ();
|
||||
SCLundefined& operator= (const SCLundefined&);
|
||||
SCLundefined& operator= (const char *str);
|
||||
SCLundefined ();
|
||||
virtual ~SCLundefined ();
|
||||
}
|
||||
;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,92 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: SdaiBinary.h,v 2.1 1998/07/13 16:53:23 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef SDAIBINARY_H
|
||||
#define SDAIBINARY_H 1
|
||||
|
||||
/*
|
||||
* NIST STEP Core Class Library
|
||||
* clstepcore/SdaiBinary.h
|
||||
* May 1995
|
||||
* KC Morris
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* $Id: SdaiBinary.h,v */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifdef WIN32
|
||||
# include <Strstrea.h>
|
||||
#else
|
||||
# include <strstream.h>
|
||||
#endif
|
||||
|
||||
class ErrorDescriptor;
|
||||
#include <scl_string.h>
|
||||
#include <errordesc.h>
|
||||
|
||||
#ifndef BINARY_DELIM
|
||||
#define BINARY_DELIM '\"'
|
||||
#endif
|
||||
|
||||
class SdaiBinary : public SCLstring
|
||||
{
|
||||
public:
|
||||
|
||||
//constructor(s) & destructor
|
||||
SdaiBinary (const char * str = 0, int max =0) : SCLstring (str,max) { }
|
||||
|
||||
//Josh L, 3/28/95
|
||||
// SdaiBinary (SCLstring& s) : SCLstring (s) { }
|
||||
// SdaiBinary (SdaiBinary& s) : SCLstring (s) { }
|
||||
SdaiBinary (const SCLstring& s) : SCLstring (s) { }
|
||||
|
||||
|
||||
~SdaiBinary () { }
|
||||
|
||||
// operators
|
||||
SdaiBinary& operator= (const char* s);
|
||||
|
||||
// format for STEP
|
||||
const char * asStr () const { return chars (); }
|
||||
void STEPwrite (ostream& out =G4cout) const;
|
||||
const char * STEPwrite (SCLstring &s) const;
|
||||
|
||||
Severity StrToVal (const char *s, ErrorDescriptor *err);
|
||||
Severity STEPread (istream& in, ErrorDescriptor *err);
|
||||
Severity STEPread (const char *s, ErrorDescriptor *err);
|
||||
|
||||
Severity BinaryValidLevel (const char *value, ErrorDescriptor *err,
|
||||
int optional, char *tokenList,
|
||||
int needDelims = 0, int clearError = 1);
|
||||
Severity BinaryValidLevel (istream &in, ErrorDescriptor *err,
|
||||
int optional, char *tokenList,
|
||||
int needDelims = 0, int clearError = 1);
|
||||
|
||||
protected:
|
||||
Severity ReadBinary(istream& in, ErrorDescriptor *err, int AssignVal = 1,
|
||||
int needDelims = 1);
|
||||
};
|
||||
|
||||
inline
|
||||
SdaiBinary&
|
||||
SdaiBinary::operator= (const char* s)
|
||||
{ SCLstring::operator= (s);
|
||||
return *this; }
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,69 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: SingleLinkList.h,v 2.0 1998/07/02 17:03:20 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef singlelinklist_h
|
||||
#define singlelinklist_h
|
||||
|
||||
/*
|
||||
* NIST STEP Core Class Library
|
||||
* clstepcore/SingleLinkList.h
|
||||
* May 1995
|
||||
* David Sauder
|
||||
* KC Morris
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
class SingleLinkNode {
|
||||
friend class SingleLinkList;
|
||||
protected:
|
||||
|
||||
public:
|
||||
SingleLinkNode* next;
|
||||
|
||||
public:
|
||||
virtual SingleLinkNode *NextNode () const;
|
||||
SingleLinkNode() { next =0; }
|
||||
virtual ~SingleLinkNode() { }
|
||||
};
|
||||
|
||||
class SingleLinkList {
|
||||
|
||||
// node which represents the value is contained in the subclass
|
||||
// since it may have different types for different lists
|
||||
|
||||
protected:
|
||||
|
||||
SingleLinkNode * head;
|
||||
SingleLinkNode * tail;
|
||||
|
||||
public:
|
||||
|
||||
virtual SingleLinkNode *NewNode();
|
||||
virtual void AppendNode (SingleLinkNode *);
|
||||
|
||||
virtual void Empty ();
|
||||
virtual SingleLinkNode * GetHead () const;
|
||||
|
||||
int EntryCount() const;
|
||||
|
||||
SingleLinkList ();
|
||||
virtual ~SingleLinkList ();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,59 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: Str.h,v 2.0 1998/07/02 17:03:22 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef STR_H
|
||||
#define STR_H
|
||||
|
||||
/*
|
||||
* NIST Utils Class Library
|
||||
* clutils/Str.h
|
||||
* May 1995
|
||||
* K. C. Morris
|
||||
* David Sauder
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
//#include <std.h> // not found in CenterLine C++
|
||||
// the two includes stdio.h and stdlib.h below are replacing std.h since
|
||||
// CenterLine doesn't have std.h
|
||||
|
||||
#include <stdio.h> // added to have the definition for BUFSIZE
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <scl_string.h>
|
||||
#include <errordesc.h>
|
||||
|
||||
char ToLower (const char c);
|
||||
char ToUpper (const char c);
|
||||
const char * StrToLower (const char * word, SCLstring &s);
|
||||
const char * StrToUpper (const char * word, SCLstring &s);
|
||||
const char * StrToConstant (const char * word, SCLstring &s);
|
||||
const char * PrettyTmpName (const char * oldname);
|
||||
char * PrettyNewName (const char * oldname);
|
||||
char * EntityClassName ( char * oldname);
|
||||
|
||||
extern Severity CheckRemainingInput
|
||||
(istream &in, ErrorDescriptor *err,
|
||||
const char *typeName, // used in error message
|
||||
const char *tokenList); // e.g. ",)"
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,81 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: baseType.h,v 2.0 1998/07/02 17:03:23 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef BASETYPE_H
|
||||
#define BASETYPE_H
|
||||
|
||||
/*
|
||||
* NIST STEP Core Class Library
|
||||
* clstepcore/baseType.h
|
||||
* May 1995
|
||||
* David Sauder
|
||||
* KC Morris
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
// ************** TYPES of attributes
|
||||
|
||||
enum PrimitiveType {
|
||||
sdaiINTEGER = 0,
|
||||
sdaiREAL,
|
||||
sdaiBOOLEAN,
|
||||
sdaiLOGICAL,
|
||||
sdaiSTRING,
|
||||
sdaiBINARY,
|
||||
sdaiENUMERATION,
|
||||
sdaiSELECT,
|
||||
sdaiINSTANCE,
|
||||
sdaiAGGR,
|
||||
sdaiNUMBER,
|
||||
// The elements defined below are not part of part 23
|
||||
ARRAY_TYPE, // DAS
|
||||
BAG_TYPE, // DAS
|
||||
SET_TYPE, // DAS
|
||||
LIST_TYPE, // DAS
|
||||
GENERIC_TYPE,
|
||||
REFERENCE_TYPE,
|
||||
UNKNOWN_TYPE
|
||||
};
|
||||
|
||||
// for backwards compatibility with our previous implementation
|
||||
typedef PrimitiveType BASE_TYPE;
|
||||
|
||||
// the previous element types of the enum BASE_TYPE that have been redefined
|
||||
#define INTEGER_TYPE sdaiINTEGER
|
||||
#define REAL_TYPE sdaiREAL
|
||||
#define BOOLEAN_TYPE sdaiBOOLEAN
|
||||
#define LOGICAL_TYPE sdaiLOGICAL
|
||||
#define STRING_TYPE sdaiSTRING
|
||||
#define BINARY_TYPE sdaiBINARY
|
||||
#define ENUM_TYPE sdaiENUMERATION
|
||||
#define SELECT_TYPE sdaiSELECT
|
||||
#define ENTITY_TYPE sdaiINSTANCE
|
||||
#define AGGREGATE_TYPE sdaiAGGR
|
||||
#define NUMBER_TYPE sdaiNUMBER
|
||||
|
||||
/* not defined in part 23
|
||||
ARRAY_TYPE, // DAS
|
||||
BAG_TYPE, // DAS
|
||||
SET_TYPE, // DAS
|
||||
LIST_TYPE, // DAS
|
||||
GENERIC_TYPE,
|
||||
REFERENCE_TYPE,
|
||||
UNKNOWN_TYPE
|
||||
*/
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,123 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: classes.h,v 2.1 1998/07/12 02:57:16 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
/*
|
||||
** Fed-x parser output module for generating C++ class definitions
|
||||
** December 5, 1989
|
||||
** release 2 17-Feb-1992
|
||||
** release 3 March 1993
|
||||
** release 4 December 1993
|
||||
** K. C. Morris
|
||||
**
|
||||
** Development of Fed-x was funded by the United States Government,
|
||||
** and is not subject to copyright.
|
||||
|
||||
*******************************************************************
|
||||
The conventions used in this binding Follow the proposed specification
|
||||
for the STEP Standard Data Access Interface as defined in document
|
||||
N350 ( August 31, 1993 ) of ISO 10303 TC184/SC4/WG7.
|
||||
*******************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
#include "express.h"
|
||||
#include "exppp.h"
|
||||
#include <dict.h>
|
||||
|
||||
#ifdef __CENTERLINE__
|
||||
#define CONST
|
||||
#else
|
||||
#define CONST const
|
||||
#endif
|
||||
|
||||
#define MAX_LEN 240
|
||||
#define DEBUG if (0) printf
|
||||
|
||||
#define TD_PREFIX "t_"
|
||||
#define ATTR_PREFIX "a_"
|
||||
#define ENT_PREFIX "e_"
|
||||
#define SCHEMA_PREFIX "s_"
|
||||
|
||||
#define TYPEprefix(t) (TYPEis_entity (t) ? ENT_PREFIX : TD_PREFIX)
|
||||
|
||||
#define SCHEMA_FILE_PREFIX "Sdai"
|
||||
#define TYPE_PREFIX "Sdai"
|
||||
#define ENTITYCLASS_PREFIX TYPE_PREFIX
|
||||
#define ENUM_PREFIX "sdai"
|
||||
|
||||
#define move(b) (b = (b + strlen(b)))
|
||||
#define TYPEtd_name(t,s) TypeDescriptorName ((t), (s))
|
||||
|
||||
typedef struct file_holder {
|
||||
FILE* inc; /* include file */
|
||||
FILE* lib; /* library file */
|
||||
FILE* incall; /* include file for collecting all include files */
|
||||
FILE* initall; /* for registering all entities from all schemas */
|
||||
FILE* make; /* for indicating schema source files in makefile */
|
||||
FILE* code;
|
||||
FILE* init; /* contains function to Initialize program
|
||||
to use schema's entities */
|
||||
|
||||
} File_holder, FILES;
|
||||
|
||||
typedef struct EntityTag *EntityTag;
|
||||
struct EntityTag {
|
||||
/* these fields are used so that ENTITY types are processed in order
|
||||
* when appearing in differnt schemas */
|
||||
unsigned int started :1; /* marks the beginning of processing */
|
||||
unsigned int complete :1; /* marks the end of processing */
|
||||
|
||||
Entity superclass; /* the entity being used as the supertype
|
||||
* - with multiple inheritance only chose one */
|
||||
};
|
||||
|
||||
Entity ENTITYget_superclass (Entity entity);
|
||||
Entity ENTITYput_superclass (Entity entity);
|
||||
int ENTITYhas_explicit_attributes (Entity e);
|
||||
|
||||
typedef struct SelectTag *SelectTag;
|
||||
struct SelectTag {
|
||||
/* these fields are used so that SELECT types are processed in order */
|
||||
unsigned int started :1; /* marks the beginning of processing */
|
||||
unsigned int complete :1; /* marks the end of processing */
|
||||
};
|
||||
|
||||
#define String const char *
|
||||
const char * CheckWord( const char *);
|
||||
const char * StrToLower(const char *);
|
||||
const char * StrToUpper (const char *);
|
||||
const char * FirstToUpper (const char *);
|
||||
const char * SelectName (const char *);
|
||||
FILE *FILEcreate(const char *);
|
||||
void FILEclose(FILE *);
|
||||
const char * ClassName(const char *);
|
||||
const char * ENTITYget_classname(Entity);
|
||||
void ENTITYPrint(Entity,FILES *,Schema);
|
||||
const char * StrToConstant(const char *);
|
||||
void TYPEprint_definition(Type, FILES *,Schema);
|
||||
const char * PrettyTmpName (const char * oldname);
|
||||
const char * EnumName (const char * oldname) ;
|
||||
const char * TypeDescriptorName (Type , Schema );
|
||||
char * TypeDescription (const Type t);
|
||||
const char * TypeName (Type t);
|
||||
const char * AccessType (Type t);
|
||||
const char * TYPEget_ctype (const Type t);
|
||||
|
||||
/*Variable*/
|
||||
/*VARis_simple_explicit (Variable a)*/
|
||||
#define VARis_simple_explicit(a) (!VARis_type_shifter(a))
|
||||
|
||||
/*Variable*/
|
||||
/*VARis_simple_derived (Variable a)*/
|
||||
#define VARis_simple_derived(a) (!VARis_overrider(a))
|
||||
|
||||
@@ -0,0 +1,202 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: cmdmgr.h,v 2.1 1998/07/12 02:57:17 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef cmdmgr_h
|
||||
#define cmdmgr_h
|
||||
|
||||
/*
|
||||
* NIST STEP Editor Class Library
|
||||
* cleditor/cmdmgr.h
|
||||
* May 1995
|
||||
* David Sauder
|
||||
* K. C. Morris
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
#include <gennode.h>
|
||||
#include <gennodelist.h>
|
||||
#include <gennodearray.h>
|
||||
|
||||
#include <editordefines.h>
|
||||
#include <mgrnode.h>
|
||||
#include <mgrnodelist.h>
|
||||
#include <dispnode.h>
|
||||
#include <dispnodelist.h>
|
||||
#include <SingleLinkList.h>
|
||||
|
||||
typedef unsigned short BOOLEAN;
|
||||
|
||||
//#define NUM_CMDMGR_CMDS 9
|
||||
// this is the number of columns that contain cmds (as opposed
|
||||
// to state info)
|
||||
#define NUM_CMD_COLUMNS 3
|
||||
|
||||
// **** each of CMD_CHAR must be a unique char.
|
||||
#define SAVE_COMPLETE_CMD_CHAR 's'
|
||||
#define SAVE_COMPLETE_CMD_COL 0
|
||||
#define SAVE_COMPLETE_STATE_CHAR ' '
|
||||
#define SAVE_COMPLETE_STATE_COL 4
|
||||
|
||||
#define SAVE_INCOMPLETE_CMD_CHAR 'i'
|
||||
#define SAVE_INCOMPLETE_CMD_COL 0
|
||||
#define SAVE_INCOMPLETE_STATE_CHAR 'I'
|
||||
#define SAVE_INCOMPLETE_STATE_COL 4
|
||||
|
||||
// backup to last save
|
||||
//#define CANCEL_CMD_CHAR 'c'
|
||||
//#define CANCEL_CMD_COL 0
|
||||
|
||||
#define NEW_STATE_CHAR 'N'
|
||||
#define NEW_STATE_COL 4
|
||||
|
||||
#define DELETE_CMD_CHAR 'd'
|
||||
#define DELETE_CMD_COL 0
|
||||
#define DELETE_STATE_CHAR 'D'
|
||||
#define DELETE_STATE_COL 4
|
||||
|
||||
// close will try to save it to its previous status
|
||||
#define CLOSE_CMD_CHAR 'c'
|
||||
#define CLOSE_CMD_COL 2
|
||||
|
||||
#define MODIFY_CMD_CHAR 'm'
|
||||
#define MODIFY_CMD_COL 2
|
||||
#define MODIFY_STATE_CHAR 'M'
|
||||
#define MODIFY_STATE_COL 3
|
||||
|
||||
#define VIEW_CMD_CHAR 'v'
|
||||
#define VIEW_CMD_COL 2
|
||||
#define VIEW_STATE_CHAR 'V'
|
||||
#define VIEW_STATE_COL 3
|
||||
|
||||
#define REPLICATE_CMD_CHAR 'r'
|
||||
#define REPLICATE_CMD_COL 1
|
||||
|
||||
#define EXECUTE_CMD_CHAR 'x'
|
||||
#define EXECUTE_CMD_COL 5
|
||||
|
||||
#define UNMARK_CMD_CHAR 'u'
|
||||
#define UNMARK_CMD_COL 5
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class ReplicateLinkNode : public SingleLinkNode {
|
||||
private:
|
||||
protected:
|
||||
MgrNode * _repNode;
|
||||
public:
|
||||
ReplicateLinkNode() { _repNode = 0; }
|
||||
~ReplicateLinkNode() { }
|
||||
|
||||
char *ClassName () { return "ReplicateLinkNode"; }
|
||||
|
||||
MgrNode *ReplicateNode() { return _repNode; }
|
||||
void ReplicateNode(MgrNode *rn) { _repNode = rn; }
|
||||
};
|
||||
|
||||
class ReplicateList : public SingleLinkList {
|
||||
private:
|
||||
protected:
|
||||
public:
|
||||
ReplicateList() { }
|
||||
~ReplicateList() { }
|
||||
|
||||
virtual SingleLinkNode * NewNode () { return new ReplicateLinkNode; }
|
||||
|
||||
BOOLEAN IsOnList(MgrNode *mn);
|
||||
ReplicateLinkNode *FindNode(MgrNode *mn);
|
||||
|
||||
ReplicateLinkNode * AddNode (MgrNode * rn) {
|
||||
ReplicateLinkNode *node = (ReplicateLinkNode *) NewNode();
|
||||
node->ReplicateNode(rn);
|
||||
SingleLinkList::AppendNode(node);
|
||||
return node;
|
||||
}
|
||||
|
||||
BOOLEAN Remove(ReplicateLinkNode *rln);
|
||||
BOOLEAN Remove(MgrNode *rn);
|
||||
|
||||
char *ClassName () { return "ReplicateList"; }
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class CmdMgr
|
||||
{
|
||||
protected:
|
||||
MgrNodeList *completeList;
|
||||
MgrNodeList *incompleteList;
|
||||
MgrNodeList *cancelList;
|
||||
MgrNodeList *deleteList;
|
||||
|
||||
DisplayNodeList *mappedWriteList;
|
||||
DisplayNodeList *mappedViewList;
|
||||
DisplayNodeList *closeList;
|
||||
|
||||
ReplicateList *replicateList;
|
||||
public:
|
||||
|
||||
CmdMgr();
|
||||
|
||||
// STATE LIST OPERATIONS
|
||||
MgrNode *GetHead(stateEnum listType);
|
||||
DisplayNode *GetHead(displayStateEnum listType);
|
||||
ReplicateLinkNode *GetReplicateHead()
|
||||
{ return (ReplicateLinkNode *)(replicateList->GetHead()); }
|
||||
|
||||
void ClearEntries(stateEnum listType);
|
||||
void ClearEntries(displayStateEnum listType);
|
||||
void ClearReplicateEntries() { replicateList->Empty(); }
|
||||
ReplicateList *RepList() { return replicateList; }
|
||||
|
||||
// searches current List for fileId
|
||||
MgrNode *StateFindFileId(stateEnum s, int fileId);
|
||||
// returns stateNext or statePrev member variables
|
||||
// i.e. next or previous node on curr state List
|
||||
|
||||
int SaveCompleteCmdList(MgrNode *mn)
|
||||
{ return mn->ChangeList(completeList); }
|
||||
int SaveIncompleteCmdList(MgrNode *mn)
|
||||
{ return mn->ChangeList(incompleteList); }
|
||||
int CancelCmdList(MgrNode *mn)
|
||||
{ return mn->ChangeList(cancelList); }
|
||||
int DeleteCmdList(MgrNode *mn)
|
||||
{ return mn->ChangeList(deleteList); }
|
||||
int ModifyCmdList(MgrNode *mn)
|
||||
{ return mn->ChangeList(mappedWriteList); }
|
||||
int ViewCmdList(MgrNode *mn)
|
||||
{ return mn->ChangeList(mappedViewList); }
|
||||
int CloseCmdList(MgrNode *mn)
|
||||
{ return ( ( mn->DisplayState() == mappedWrite ) ||
|
||||
( mn->DisplayState() == mappedView ) ) ?
|
||||
mn->ChangeList(closeList) : 0;
|
||||
}
|
||||
/*
|
||||
// { if(mn->DisplayState() == mappedWrite ||
|
||||
// mn->DisplayState() == mappedView)
|
||||
// return mn->ChangeList(closeList);
|
||||
// else return 0;
|
||||
// }
|
||||
*/
|
||||
int ReplicateCmdList(MgrNode *mn);
|
||||
|
||||
void ClearInstances();
|
||||
protected:
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,52 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: dir.h,v 2.0 1998/07/02 17:03:24 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989 Stanford University
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided
|
||||
* that the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of Stanford not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. Stanford makes no representations about
|
||||
* the suitability of this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*
|
||||
* STANFORD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
* IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* C++ interface to Unix file system dir structure
|
||||
*/
|
||||
|
||||
#ifndef sys_dir_h
|
||||
#define sys_dir_h 1
|
||||
|
||||
#ifdef WIN32
|
||||
# include <dir.h>
|
||||
#else
|
||||
# include <sys/types.h>
|
||||
# include <dirent.h>
|
||||
#endif /* WIN32 */
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,214 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: dirobj.h,v 2.1 1998/07/12 02:57:17 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef dirobj_h
|
||||
#define dirobj_h
|
||||
|
||||
/*
|
||||
* NIST Utils Class Library
|
||||
* clutils/dirobj.h
|
||||
* May 1995
|
||||
* David Sauder
|
||||
* K. C. Morris
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* DirObj - This object contains a List of files in a directory.
|
||||
* Can be used for interpreting a tilde, checking paths etc.
|
||||
* based on InterViews FBDirectory
|
||||
* Copyright (c) 1987, 1988, 1989 Stanford University from
|
||||
* /depot/iv/src/libInterViews/filebrowser.c <= notice
|
||||
* I commented it, changed variable and function names, added a
|
||||
* few things, and made it so we can actually use it.
|
||||
* David Sauder
|
||||
*/
|
||||
|
||||
//#include <InterViews/filebrowser.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// These header files are a pain between compilers etc ... and
|
||||
// I agree they are in a mess. You will have to CHECK them yourself
|
||||
// depending on what you are using -- it works the way it is with g++
|
||||
// but you need -I/depot/gnu/lib/g++-include
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifdef WIN32
|
||||
# include <sys/Stat.h>
|
||||
# ifndef MAXNAMLEN
|
||||
# define MAXNAMLEN 255
|
||||
# endif
|
||||
#else
|
||||
# include <stat.h>
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef __OBJECTCENTER__
|
||||
#include <sysent.h> // needed to declare getuid()
|
||||
#include <sys/stat.h>
|
||||
// extern int getuid();
|
||||
#endif
|
||||
#ifdef __GNUC__
|
||||
#include <unistd.h> // needed to declare getuid() with new GNU 2.3.3
|
||||
//extern _G_uid_t getuid _G_ARGS((void));
|
||||
#include <stat.h>
|
||||
#endif
|
||||
#ifdef __SUNCPLUSPLUS__
|
||||
#include <sysent.h>
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#ifndef WIN32
|
||||
# include <pwd.h>
|
||||
#endif
|
||||
//#include <InterViews/Std/os/auth.h>
|
||||
//#include <InterViews/Std/os/fs.h>
|
||||
// the below is good for g++
|
||||
// if getting it from /usr/include change to __string_h
|
||||
#ifndef _std_h
|
||||
#include <string.h>
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
# ifndef MAXPATHLEN
|
||||
# define MAXPATHLEN 1024
|
||||
# endif
|
||||
typedef struct __dirstream DIR;
|
||||
#else
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
//#include <InterViews/Std/sys/dir.h>
|
||||
//#include <InterViews/Std/sys/stat.h>
|
||||
#include "dir.h"
|
||||
#include "globals.hh"
|
||||
//typedef unsigned boolean;
|
||||
|
||||
#ifndef nil
|
||||
#define nil 0
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
class DirObj {
|
||||
public:
|
||||
DirObj(const char* dirName);
|
||||
virtual ~DirObj();
|
||||
|
||||
HepBoolean LoadDirectory(const char*);
|
||||
const char* Normalize(const char*);
|
||||
const char* ValidDirectories(const char*);
|
||||
|
||||
int Index(const char*);
|
||||
const char* File(int index);
|
||||
// check for file in the currently loaded directory
|
||||
HepBoolean FileExists(const char* file) { return Index(file) ? true : false;};
|
||||
int Count();
|
||||
|
||||
HepBoolean IsADirectory(const char*);
|
||||
private:
|
||||
const char* Home(const char* x = nil);
|
||||
const char* ElimDot(const char*);
|
||||
const char* ElimDotDot(const char*);
|
||||
const char* InterpSlashSlash(const char*);
|
||||
const char* InterpTilde(const char*);
|
||||
const char* ExpandTilde(const char*, int);
|
||||
const char* RealPath(const char*);
|
||||
|
||||
HepBoolean Reset(const char*);
|
||||
void ClearFileList();
|
||||
void CheckIndex(int index);
|
||||
void InsertFile(const char*, int index);
|
||||
void AppendFile(const char*);
|
||||
void RemoveFile(int index);
|
||||
virtual int Position(const char*);
|
||||
private:
|
||||
char** fileList;
|
||||
int fileCount;
|
||||
int fileListSize;
|
||||
};
|
||||
|
||||
//////////////////////////////// Count() //////////////////////////////////////
|
||||
//
|
||||
// Return the number of files in the loaded directory.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline int DirObj::Count () { return fileCount; }
|
||||
|
||||
//////////////////////////////// AppendFile() /////////////////////////////////
|
||||
//
|
||||
// Insert a new file into the fileList.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline void DirObj::AppendFile (const char* s) { InsertFile(s, fileCount); }
|
||||
|
||||
//////////////////////////////// File() ///////////////////////////////////////
|
||||
//
|
||||
// Return the file at the given index (starting at 0) in the fileList
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline const char* DirObj::File (int index) {
|
||||
return (0 <= index && index < fileCount) ? fileList[index] : nil;
|
||||
}
|
||||
|
||||
//////////////////////////////// strdup() /////////////////////////////////////
|
||||
//
|
||||
// Duplicate a string.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//inline char* strdup (const char* s) {
|
||||
// char* dup = new char[strlen(s) + 1];
|
||||
// strcpy(dup, s);
|
||||
// return dup;
|
||||
//}
|
||||
|
||||
//////////////////////////////// DotSlash() ///////////////////////////////////
|
||||
//
|
||||
// Return 1 if the first char in 'path' is '.' and second char is
|
||||
// '/' or '\0'; otherwise return 0
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline HepBoolean DotSlash (const char* path) {
|
||||
return
|
||||
path[0] != '\0' && path[0] == '.' &&
|
||||
(path[1] == '/' || path[1] == '\0')? true : false;
|
||||
}
|
||||
|
||||
//////////////////////////////// DotDotSlash() ////////////////////////////////
|
||||
//
|
||||
// Return 1 if the first char in 'path' is '.', the second char is '.',
|
||||
// and the third char is '/' or '\0'; otherwise return 0
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline HepBoolean DotDotSlash (const char* path) {
|
||||
return
|
||||
path[0] != '\0' && path[1] != '\0' &&
|
||||
path[0] == '.' && path[1] == '.' &&
|
||||
(path[2] == '/' || path[2] == '\0')? true : false;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,85 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: dispnode.h,v 2.0 1998/07/02 17:03:29 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef dispnode_h
|
||||
#define dispnode_h
|
||||
|
||||
/*
|
||||
* NIST STEP Editor Class Library
|
||||
* cleditor/dispnode.h
|
||||
* May 1995
|
||||
* David Sauder
|
||||
* K. C. Morris
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
/*#include <STEPattribute.h>*/
|
||||
/*#include <STEPentity.h>*/
|
||||
#include <sdai.h>
|
||||
|
||||
#include <gennode.h>
|
||||
#include <gennodelist.h>
|
||||
#include <editordefines.h>
|
||||
//#include <mgrnode.h>
|
||||
class MgrNode;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// class DisplayNode
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class DisplayNode : public GenericNode
|
||||
{
|
||||
protected:
|
||||
friend class GenNodeList;
|
||||
friend class DisplayNodeList;
|
||||
|
||||
MgrNode *mn;
|
||||
void *see;
|
||||
displayStateEnum displayState; // = { mappedWrite, mappedView, notMapped }
|
||||
|
||||
public:
|
||||
// this should probably only be used to create head nodes for dispnodelists
|
||||
DisplayNode() { displayState = noMapState; }
|
||||
DisplayNode(MgrNode *node) { mn = node; displayState = noMapState; }
|
||||
~DisplayNode();
|
||||
|
||||
void SEE(void *s) { see = s; }
|
||||
virtual void *SEE() { return see; };
|
||||
|
||||
void mgrNode(MgrNode *node) { mn = node; }
|
||||
class MgrNode *mgrNode() { return mn; }
|
||||
|
||||
displayStateEnum DisplayState() { return displayState; }
|
||||
int DisplayListMember(displayStateEnum ds) { return (displayState == ds); }
|
||||
|
||||
int ChangeState(displayStateEnum s);
|
||||
int ChangeList(DisplayNodeList *cmdList);
|
||||
|
||||
void Remove();
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// class DisplayNode inline functions
|
||||
// these functions don't rely on any inline functions (its own or
|
||||
// other classes) that aren't in this file except for Generic functions
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,85 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: dispnodelist.h,v 2.1 1998/07/12 02:57:18 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef dispnodelist_h
|
||||
#define dispnodelist_h
|
||||
|
||||
/*
|
||||
* NIST STEP Editor Class Library
|
||||
* cleditor/dispnodelist.h
|
||||
* May 1995
|
||||
* David Sauder
|
||||
* K. C. Morris
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
#include <gennode.h>
|
||||
#include <editordefines.h>
|
||||
#include <mgrnode.h>
|
||||
#include <dispnode.h>
|
||||
#include <gennodelist.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// class DisplayNodeList
|
||||
// This will be used to represent the display state lists.
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class DisplayNodeList : public GenNodeList
|
||||
{
|
||||
public:
|
||||
DisplayNodeList(displayStateEnum type);
|
||||
~DisplayNodeList() { }
|
||||
|
||||
// ADDED functions
|
||||
displayStateEnum GetState() { return listType; }
|
||||
|
||||
// REDEFINED functions
|
||||
// deletes node from its previous List & appends
|
||||
virtual void Append(GenericNode *node);
|
||||
// deletes newNode from its previous List & inserts in
|
||||
// relation to existNode
|
||||
virtual void InsertAfter(GenericNode *newNode, GenericNode *existNode);
|
||||
virtual void InsertBefore(GenericNode *newNode, GenericNode *existNode);
|
||||
virtual void Remove(GenericNode *node);
|
||||
|
||||
protected:
|
||||
private:
|
||||
displayStateEnum listType;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// class DisplayNodeList inline functions
|
||||
// these functions don't rely on any inline functions (its own or
|
||||
// other classes) that aren't in this file except for Generic functions
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline DisplayNodeList::DisplayNodeList(displayStateEnum type)
|
||||
: GenNodeList(new DisplayNode())
|
||||
{
|
||||
listType = type;
|
||||
((DisplayNode *)head)->displayState = type;
|
||||
}
|
||||
|
||||
inline void DisplayNodeList::Remove(GenericNode *node)
|
||||
{
|
||||
GenNodeList::Remove(node);
|
||||
// DON'T DO THIS ((DisplayNode *)node)->displayState = noMapState;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,67 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: editordefines.h,v 2.1 1998/07/12 02:57:19 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef editordefines_h
|
||||
#define editordefines_h
|
||||
|
||||
/*
|
||||
* NIST STEP Editor Class Library
|
||||
* cleditor/editordefines.h
|
||||
* May 1995
|
||||
* David Sauder
|
||||
* K. C. Morris
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
class GenericNode;
|
||||
class GenNodeList;
|
||||
|
||||
class MgrNode;
|
||||
class MgrNodeList;
|
||||
|
||||
class DisplayNode;
|
||||
class DisplayNodeList;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
enum displayStateEnum {
|
||||
mappedWrite, // has a writable SEE on the screen
|
||||
mappedView, // has a view only SEE on the screen
|
||||
notMapped,
|
||||
noMapState
|
||||
} ;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
enum stateEnum {
|
||||
noStateSE, // state undefined, not on a List
|
||||
completeSE, // on saved complete List
|
||||
incompleteSE, // on saved incomplete List
|
||||
deleteSE, // on delete List
|
||||
newSE // on newly created List
|
||||
} ;
|
||||
|
||||
/*
|
||||
these variable are used by the STEPfile for reading and writing
|
||||
files in working session format.
|
||||
None of these variable should be set to 'E' as it will disrupt
|
||||
the way the read function finds the "ENDSEC;" token.
|
||||
*/
|
||||
static const char wsSaveComplete = 'C';
|
||||
static const char wsSaveIncomplete = 'I';
|
||||
static const char wsDelete = 'D';
|
||||
static const char wsNew = 'N';
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,151 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: errordesc.h,v 2.1 1998/07/13 16:53:31 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef ERRORDESC_H
|
||||
#define ERRORDESC_H
|
||||
|
||||
/*
|
||||
* NIST Utils Class Library
|
||||
* clutils/errordesc.h
|
||||
* May 1995
|
||||
* David Sauder
|
||||
* K. C. Morris
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
#include <scl_string.h>
|
||||
#include "G4ios.hh"
|
||||
|
||||
typedef enum Severity {
|
||||
SEVERITY_MAX = -5,
|
||||
SEVERITY_DUMP = -4,
|
||||
SEVERITY_EXIT = -3, // fatal
|
||||
SEVERITY_BUG = -2, // non-recoverable error -- probably bug
|
||||
SEVERITY_INPUT_ERROR = -1, // non-recoverable error
|
||||
SEVERITY_WARNING = 0, // recoverable error
|
||||
SEVERITY_INCOMPLETE = 1, // incomplete data
|
||||
SEVERITY_USERMSG = 2, // possibly an error
|
||||
SEVERITY_NULL = 3 // no error or message
|
||||
} Severity;
|
||||
|
||||
/* DAS not used
|
||||
enum Enforcement {
|
||||
ENFORCE_OFF,
|
||||
ENFORCE_OPTIONALITY,
|
||||
ENFORCE_ALL
|
||||
|
||||
} ;
|
||||
*/
|
||||
|
||||
enum DebugLevel {
|
||||
DEBUG_OFF =0,
|
||||
DEBUG_USR =1,
|
||||
DEBUG_ALL =2
|
||||
|
||||
};
|
||||
|
||||
/******************************************************************
|
||||
** Class: ErrorDescriptor
|
||||
** Data Members:
|
||||
** severity level of error
|
||||
** user message
|
||||
** detailed message
|
||||
** Description:
|
||||
** the error is a detailed error message + a severity level
|
||||
** also keeps a user message separately
|
||||
** detailed message gets sent to ostream
|
||||
** uses SCLstring class to keep the user messages
|
||||
** keeps severity of error
|
||||
** created with or without error
|
||||
** Status:
|
||||
******************************************************************/
|
||||
|
||||
class ErrorDescriptor {
|
||||
// friend istream &operator<< ( istream&, ErrorDescriptor& );
|
||||
protected:
|
||||
|
||||
Severity _severity;
|
||||
|
||||
static DebugLevel _debug_level;
|
||||
static ostream* _out;
|
||||
|
||||
SCLstring *_userMsg;
|
||||
SCLstring *_detailMsg;
|
||||
public:
|
||||
|
||||
ErrorDescriptor (Severity s = SEVERITY_NULL,
|
||||
DebugLevel d = DEBUG_OFF);
|
||||
~ErrorDescriptor () { delete _userMsg; delete _detailMsg; }
|
||||
|
||||
void ClearErrorMsg() {
|
||||
_severity = SEVERITY_NULL;
|
||||
delete _userMsg; _userMsg = 0;
|
||||
delete _detailMsg; _detailMsg = 0;
|
||||
}
|
||||
|
||||
Severity severity() const { return _severity; }
|
||||
Severity severity(Severity s) { return (_severity = s); }
|
||||
Severity GreaterSeverity(Severity s)
|
||||
{ return ((s < _severity) ? _severity = s : _severity); }
|
||||
|
||||
const char * UserMsg () const; // UserMsg is from String
|
||||
void UserMsg ( const char *);
|
||||
void AppendToUserMsg ( const char *);
|
||||
void PrependToUserMsg ( const char *);
|
||||
void AppendToUserMsg ( const char c)
|
||||
{
|
||||
if(!_userMsg) _userMsg = new SCLstring;
|
||||
_userMsg -> Append(c);
|
||||
}
|
||||
|
||||
const char * DetailMsg () const;
|
||||
void DetailMsg ( const char *);
|
||||
void AppendToDetailMsg ( const char *);
|
||||
void PrependToDetailMsg ( const char *);
|
||||
void AppendToDetailMsg ( const char c)
|
||||
{
|
||||
if(!_detailMsg) _detailMsg = new SCLstring;
|
||||
_detailMsg -> Append(c);
|
||||
}
|
||||
|
||||
Severity AppendFromErrorArg(ErrorDescriptor *err)
|
||||
{
|
||||
GreaterSeverity( err->severity() );
|
||||
AppendToDetailMsg( err->DetailMsg() );
|
||||
AppendToUserMsg( err->UserMsg() );
|
||||
return severity();
|
||||
}
|
||||
|
||||
DebugLevel debug_level() const { return _debug_level; }
|
||||
void debug_level(DebugLevel d) { _debug_level = d; }
|
||||
void SetOutput(ostream *o) { _out = o; }
|
||||
|
||||
// void operator = (const char* y) { SCLstring::operator = (y); }
|
||||
|
||||
/*
|
||||
// Enforcement _enforcement_level;
|
||||
ErrorDescriptor (Severity s = SEVERITY_NULL,
|
||||
Enforcement e = ENFORCE_OFF,
|
||||
DebugLevel d = DEBUG_OFF);
|
||||
Enforcement enforcement() const { return _enforcement_level; }
|
||||
void enforcement(Enforcement e) { _enforcement_level = e; }
|
||||
*/
|
||||
} ;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,83 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: gennode.h,v 2.2 1998/07/13 16:53:32 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef gennode_h
|
||||
#define gennode_h
|
||||
|
||||
/*
|
||||
* NIST Utils Class Library
|
||||
* clutils/gennode.h
|
||||
* May 1995
|
||||
* David Sauder
|
||||
* K. C. Morris
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
# include "G4ios.hh"
|
||||
#else
|
||||
# include <stream.h>
|
||||
#endif
|
||||
class GenNodeList;
|
||||
class MgrNodeList;
|
||||
class DisplayNodeList;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// GenericNode
|
||||
// If you delete this object it first removes itself from any List it is in.
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class GenericNode
|
||||
{
|
||||
friend class GenNodeList;
|
||||
friend class MgrNodeList;
|
||||
friend class DisplayNodeList;
|
||||
|
||||
protected:
|
||||
GenericNode *next;
|
||||
GenericNode *prev;
|
||||
public:
|
||||
GenericNode() { next = 0; prev = 0; }
|
||||
virtual ~GenericNode() { Remove(); }
|
||||
GenericNode *Next() { return next; }
|
||||
GenericNode *Prev() { return prev; }
|
||||
virtual void Append(GenNodeList *List);
|
||||
virtual void Remove()
|
||||
{
|
||||
(next) ? (next->prev = prev) : 0;
|
||||
(prev) ? (prev->next = next) : 0;
|
||||
/*
|
||||
// if(next)
|
||||
// next->prev = prev;
|
||||
// if(prev)
|
||||
// prev->next = next;
|
||||
*/
|
||||
next = 0;
|
||||
prev = 0;
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// GenericNode inline functions
|
||||
// these functions don't rely on any inline functions (its own or
|
||||
// other classes) that aren't in this file
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,129 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: gennodearray.h,v 2.0 1998/07/02 17:03:40 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef gennodearray_h
|
||||
#define gennodearray_h
|
||||
|
||||
/*
|
||||
* NIST Utils Class Library
|
||||
* clutils/gennode.h
|
||||
* May 1995
|
||||
* David Sauder
|
||||
* K. C. Morris
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
/*
|
||||
* GenNodeArray - dynamic array object of GenericNodes.
|
||||
* the array part of this is copied from Unidraws UArray - dynamic array object
|
||||
* Copyright (c) 1990 Stanford University
|
||||
*/
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h> // to get bcopy for CenterLine
|
||||
|
||||
#include <gennode.h>
|
||||
|
||||
// the initial size of the array
|
||||
#define ARRAY_DEFAULT_SIZE (1024)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// GenNodeArray
|
||||
// If you delete this object, it does not delete the entries it points to.
|
||||
// If you want it to delete the entries it points to you need to call
|
||||
// DeleteEntries().
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class GenNodeArray
|
||||
{
|
||||
public:
|
||||
GenNodeArray(int defaultSize = ARRAY_DEFAULT_SIZE);
|
||||
virtual ~GenNodeArray();
|
||||
|
||||
GenericNode*& operator[](int index);
|
||||
virtual int Index(GenericNode* gn);
|
||||
virtual int Index(GenericNode** gn);
|
||||
|
||||
int Count();
|
||||
|
||||
virtual void Append(GenericNode* gn);
|
||||
virtual int Insert(GenericNode* gn);
|
||||
virtual int Insert(GenericNode* gn, int index);
|
||||
virtual void Remove(int index);
|
||||
virtual void ClearEntries();
|
||||
virtual void DeleteEntries();
|
||||
|
||||
protected:
|
||||
virtual void Check(int index);
|
||||
|
||||
GenericNode** _buf; // the array
|
||||
int _bufsize; // the possible number of entries in the array
|
||||
int _count; // the number of entries in the array
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// class GenNodeArray inline public functions
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline GenNodeArray::GenNodeArray (int defaultSize)
|
||||
{
|
||||
_bufsize = defaultSize;
|
||||
_buf = new GenericNode*[_bufsize];
|
||||
memset(_buf, 0, _bufsize*sizeof(GenericNode*));
|
||||
_count = 0;
|
||||
}
|
||||
|
||||
inline GenNodeArray::~GenNodeArray ()
|
||||
{
|
||||
|
||||
// int i;
|
||||
// this is dangerous because several things point at these nodes
|
||||
// also whatever is derived from this thing might do this
|
||||
// for(i = 0; i < _count; i++)
|
||||
// delete _buf[i];
|
||||
delete [] _buf;
|
||||
}
|
||||
|
||||
inline GenericNode*& GenNodeArray::operator[] (int index)
|
||||
{
|
||||
Check(index);
|
||||
return _buf[index];
|
||||
}
|
||||
|
||||
inline int GenNodeArray::Index (GenericNode** gn)
|
||||
{
|
||||
return ((gn - _buf) / sizeof(GenericNode*));
|
||||
}
|
||||
|
||||
inline void GenNodeArray::Append(GenericNode* gn)
|
||||
{
|
||||
Insert(gn, _count);
|
||||
}
|
||||
|
||||
inline int GenNodeArray::Insert(GenericNode* gn)
|
||||
{
|
||||
return Insert(gn, _count);
|
||||
}
|
||||
|
||||
inline int GenNodeArray::Count ()
|
||||
{
|
||||
return _count;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,109 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: gennodelist.h,v 2.2 1998/07/13 16:53:34 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef gennodelist_h
|
||||
#define gennodelist_h
|
||||
|
||||
/*
|
||||
* NIST Utils Class Library
|
||||
* clutils/gennodelist.h
|
||||
* May 1995
|
||||
* David Sauder
|
||||
* K. C. Morris
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
# include "G4ios.hh"
|
||||
#else
|
||||
# include <stream.h>
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// class GenNodeList
|
||||
// this class implements a doubly linked List by default.
|
||||
// If you delete this object it does not delete all of its entries,
|
||||
// only its head. If you want it to delete all of its entries as well
|
||||
// as its head, you need to call DeleteEntries().
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class GenNodeList {
|
||||
public:
|
||||
GenNodeList(GenericNode *headNode);
|
||||
virtual ~GenNodeList() { delete head; }
|
||||
|
||||
GenericNode *GetHead() { return head; }
|
||||
|
||||
virtual void ClearEntries(){;}
|
||||
virtual void DeleteEntries(){;}
|
||||
// deletes node from its previous List & appends
|
||||
virtual void Append(GenericNode *node);
|
||||
// deletes newNode from its previous List & inserts in
|
||||
// relation to existNode
|
||||
virtual void InsertAfter(GenericNode *newNode, GenericNode *existNode);
|
||||
virtual void InsertBefore(GenericNode *newNode, GenericNode *existNode);
|
||||
|
||||
virtual void Remove(GenericNode *node){ if (node) node->Remove(); }
|
||||
|
||||
protected:
|
||||
GenericNode *head;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// class GenNodeList inline functions
|
||||
// these functions don't rely on any inline functions (its own or
|
||||
// other classes) that aren't in this file
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline GenNodeList::GenNodeList(GenericNode *headNode)
|
||||
{
|
||||
head = headNode;
|
||||
head->next = head;
|
||||
head->prev = head;
|
||||
}
|
||||
|
||||
// inserts after existNode
|
||||
inline void GenNodeList::InsertAfter(GenericNode *newNode,
|
||||
GenericNode *existNode)
|
||||
{
|
||||
newNode->next = existNode->next;
|
||||
newNode->next->prev = newNode;
|
||||
|
||||
newNode->prev = existNode;
|
||||
existNode->next = newNode;
|
||||
}
|
||||
|
||||
// inserts before existNode
|
||||
inline void GenNodeList::InsertBefore(GenericNode *newNode,
|
||||
GenericNode *existNode)
|
||||
{
|
||||
existNode->prev->next = newNode;
|
||||
newNode->prev = existNode->prev;
|
||||
|
||||
newNode->next = existNode;
|
||||
existNode->prev = newNode;
|
||||
}
|
||||
|
||||
// inserts before the head node
|
||||
inline void GenNodeList::Append(GenericNode *node)
|
||||
{
|
||||
InsertBefore(node, head);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,119 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: instmgr.h,v 2.2 1998/11/17 17:21:53 broglia Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef instmgr_h
|
||||
#define instmgr_h
|
||||
|
||||
/*
|
||||
* NIST STEP Editor Class Library
|
||||
* cleditor/instmgr.h
|
||||
* May 1995
|
||||
* David Sauder
|
||||
* K. C. Morris
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
///// future? ////////////////
|
||||
// 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
|
||||
// start a new undo List and delete the old undo List.
|
||||
/////////////////////
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
extern char * EntityClassName ( char *);
|
||||
|
||||
// IT IS VERY IMPORTANT THAT THE ORDER OF THE FOLLOWING INCLUDE FILES
|
||||
// BE PRESERVED
|
||||
|
||||
#include <gennode.h>
|
||||
#include <gennodelist.h>
|
||||
#include <gennodearray.h>
|
||||
|
||||
#include <mgrnode.h>
|
||||
#include <mgrnodelist.h>
|
||||
|
||||
#include <dispnode.h>
|
||||
#include <dispnodelist.h>
|
||||
|
||||
#include <mgrnodearray.h>
|
||||
|
||||
class InstMgr
|
||||
{
|
||||
protected:
|
||||
MgrNodeArray *master; // master array of all MgrNodes made up of
|
||||
// complete, incomplete, new, delete MgrNodes lists
|
||||
// this corresponds to the display List object by index
|
||||
MgrNodeArraySorted *sortedMaster; // master array sorted by fileId
|
||||
// StateList *master; // this will be an sorted array of ptrs to MgrNodes
|
||||
|
||||
int maxFileId;
|
||||
|
||||
public:
|
||||
InstMgr();
|
||||
~InstMgr() {};
|
||||
|
||||
// MASTER LIST OPERATIONS
|
||||
int InstanceCount() { return master->Count(); }
|
||||
void ClearInstances();
|
||||
Severity VerifyInstances(ErrorDescriptor& e);
|
||||
|
||||
// DAS PORT possible BUG two funct's below may create a temp for the cast
|
||||
MgrNode *&operator[](int index)
|
||||
{ return (MgrNode* &)((*master)[index]); }
|
||||
MgrNode *&GetMgrNode(int index)
|
||||
{ return (MgrNode* &)((*master)[index]); }
|
||||
|
||||
MgrNode *FindFileId(int fileId);
|
||||
// get the index into display List given a STEPentity
|
||||
// called by see initiated functions
|
||||
int GetIndex(STEPentity *se);
|
||||
int GetIndex(MgrNode *mn);
|
||||
|
||||
// L. Broglia : new
|
||||
int GetIndex(const char* entityKeyword, int starting_index);
|
||||
|
||||
int VerifyEntity(int fileId, const char *expectedType);
|
||||
|
||||
// void Append(MgrNode *node);
|
||||
MgrNode *Append(STEPentity *se, stateEnum listState);
|
||||
// deletes node from master List structure
|
||||
void Delete(MgrNode *node);
|
||||
void Delete(STEPentity *se);
|
||||
|
||||
void ChangeState(MgrNode *node, stateEnum listState);
|
||||
|
||||
int MaxFileId() { return maxFileId; }
|
||||
int NextFileId() { return maxFileId = maxFileId +1; }
|
||||
int EntityKeywordCount(const char* name);
|
||||
STEPentity *GetSTEPentity(int index);
|
||||
STEPentity *GetSTEPentity(const char* entityKeyword,
|
||||
int starting_index =0);
|
||||
|
||||
STEPentity *GetSTEPentity(MgrNode *node)
|
||||
{ return node->GetSTEPentity(); };
|
||||
void *GetSEE(int index);
|
||||
void *GetSEE(MgrNode *node) { return node->SEE(); };
|
||||
|
||||
void PrintSortedFileIds();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,140 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: mgrnode.h,v 2.1 1998/07/12 02:57:21 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef mgrnode_h
|
||||
#define mgrnode_h
|
||||
|
||||
/*
|
||||
* NIST STEP Editor Class Library
|
||||
* cleditor/mgrnode.h
|
||||
* May 1995
|
||||
* David Sauder
|
||||
* K. C. Morris
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
class DisplayNode;
|
||||
class STEPentity;
|
||||
|
||||
#include <gennode.h>
|
||||
#include <gennodelist.h>
|
||||
|
||||
#include <editordefines.h>
|
||||
|
||||
class InstMgr;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// class MgrNode
|
||||
// If you delete this object, it deletes the STEPentity it represents,
|
||||
// the DisplayNode, and removes itself from any List it is in.
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class MgrNode : public GenericNode
|
||||
{
|
||||
friend class GenNodeList;
|
||||
friend class MgrNodeList;
|
||||
friend class InstMgr;
|
||||
|
||||
protected:
|
||||
// currState, next, prev implement several lists
|
||||
// based on currState:
|
||||
// currState = (completeSE, incompleteSE, newSE, or deleteSE)
|
||||
// every node will be on one of the four lists implemented by these:
|
||||
stateEnum currState;
|
||||
|
||||
// STEPentity this node is representing info for
|
||||
STEPentity *se;
|
||||
// this is the index (in the InstMgr master array) of the ptr to
|
||||
// this node.
|
||||
int arrayIndex;
|
||||
|
||||
// display info (SEE, etc) for this node
|
||||
DisplayNode *di;
|
||||
|
||||
public:
|
||||
// used for sentinel node on lists of MgrNodes
|
||||
MgrNode();
|
||||
MgrNode(STEPentity *se);
|
||||
// 'listState' ==
|
||||
// completeSE - if reading valid exchange file
|
||||
// incompleteSE or completeSE - if reading working session file
|
||||
// newSE - if instance is created by user using editor (probe)
|
||||
MgrNode(STEPentity *se, stateEnum listState);
|
||||
MgrNode(STEPentity *se, stateEnum listState, MgrNodeList *List);
|
||||
virtual ~MgrNode();
|
||||
|
||||
// STATE LIST OPERATIONS
|
||||
int MgrNodeListMember(stateEnum s) { return (currState == s); }
|
||||
stateEnum CurrState() { return currState; }
|
||||
// returns next or prev member variables
|
||||
// i.e. next or previous node on curr state List
|
||||
// searches current List for fileId
|
||||
MgrNode *StateFindFileId(int fileId);
|
||||
|
||||
// deletes from previous cmd List,
|
||||
// & puts on cmd List cmdList
|
||||
int ChangeList(MgrNodeList *cmdList);
|
||||
int ChangeState(stateEnum s);
|
||||
|
||||
// Removes from current List.
|
||||
// Called before adding to diff List or when destructor is called.
|
||||
void Remove();
|
||||
|
||||
// DISPLAY LIST OPERATIONS
|
||||
void *SEE();
|
||||
|
||||
displayStateEnum DisplayState();
|
||||
int IsDisplayState(displayStateEnum ds);
|
||||
|
||||
// returns next or prev member variables
|
||||
// i.e. next or previous node on display state List
|
||||
GenericNode *NextDisplay();
|
||||
GenericNode *PrevDisplay();
|
||||
|
||||
// deletes from previous cmd List,
|
||||
// & puts on cmd List cmdList
|
||||
int ChangeList(DisplayNodeList *cmdList);
|
||||
// deletes from previous display List, assigns ds to
|
||||
// displayState & puts on List dsList
|
||||
int ChangeState(displayStateEnum ds);
|
||||
|
||||
// might not want these three? since it won't actually map them?
|
||||
void MapModifiable(DisplayNodeList *dnList);
|
||||
void MapViewable(DisplayNodeList *dnList);
|
||||
void UnMap(DisplayNodeList *dnList);
|
||||
|
||||
// ACCESS FUNCTIONS
|
||||
int GetFileId();
|
||||
STEPentity *GetSTEPentity() { return se; }
|
||||
DisplayNode *&displayNode() { return di; }
|
||||
int ArrayIndex() { return arrayIndex; }
|
||||
void ArrayIndex(int index) { arrayIndex = index; }
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
void Init(STEPentity *s, stateEnum listState, MgrNodeList *List);
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// class MgrNode inline functions
|
||||
// these functions don't rely on any inline functions (its own or
|
||||
// other classes) that aren't in this file except for Generic functions
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,112 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: mgrnodearray.h,v 2.3 1998/07/14 03:15:40 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef mgrnodearray_h
|
||||
#define mgrnodearray_h
|
||||
|
||||
/*
|
||||
* NIST STEP Editor Class Library
|
||||
* cleditor/mgrnodearray.h
|
||||
* May 1995
|
||||
* David Sauder
|
||||
* K. C. Morris
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <gennode.h>
|
||||
#include <gennodelist.h>
|
||||
|
||||
#include <mgrnode.h>
|
||||
#include <mgrnodelist.h>
|
||||
|
||||
#include <gennodearray.h>
|
||||
|
||||
#define ARRAY_DEFAULT_SIZE (1024)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// class MgrNodeArray
|
||||
// This class implements the array of MgrNodes representing the
|
||||
// master List for the seInstMgr which will have a one to one
|
||||
// mapping by index to the display List of corresponding STEPentities.
|
||||
// If you delete this object it deletes all of the entries it points to.
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class MgrNodeArray : public GenNodeArray
|
||||
{
|
||||
public:
|
||||
MgrNodeArray(int defaultSize = ARRAY_DEFAULT_SIZE)
|
||||
: GenNodeArray(defaultSize) { }
|
||||
~MgrNodeArray();
|
||||
|
||||
// REDEFINED functions
|
||||
// need to redefine Append() & Insert(GenericNode *) so they call
|
||||
// MgrNodeArray::Insert(GenericNode *, int index);
|
||||
virtual int Insert(GenericNode* gn, int index);
|
||||
virtual void Append(GenericNode* gn) { Insert(gn, _count); }
|
||||
virtual int Insert(GenericNode* gn) { return Insert(gn, _count); }
|
||||
virtual void Remove(int index);
|
||||
virtual void ClearEntries();
|
||||
virtual void DeleteEntries();
|
||||
|
||||
// ADDED functions
|
||||
virtual int MgrNodeIndex(int fileId);
|
||||
void AssignIndexAddress(int index);
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// class MgrNodeArraySorted
|
||||
// This class implements the array of MgrNodes representing the
|
||||
// sorted master List for the seInstMgr. This List is sorted by
|
||||
// STEPentity::fileId.
|
||||
// If you delete this object it won't delete the entries it points to.
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class MgrNodeArraySorted : public GenNodeArray {
|
||||
public:
|
||||
MgrNodeArraySorted(int defaultSize = ARRAY_DEFAULT_SIZE)
|
||||
: GenNodeArray(defaultSize) {}
|
||||
~MgrNodeArraySorted() { }
|
||||
|
||||
// REDEFINED functions
|
||||
virtual int Index(GenericNode* gn);
|
||||
virtual int Index(GenericNode** gn);
|
||||
|
||||
virtual int Insert(GenericNode* gn);
|
||||
virtual int Insert(GenericNode* gn, int index)
|
||||
{ cerr <<
|
||||
"Call MgrNodeArraySorted::Insert() without index argument instead.\n"
|
||||
<< "index argument: " << index << " being ignored.\n";
|
||||
return Insert(gn); }
|
||||
virtual void Append(GenericNode* gn) { Insert(gn); }
|
||||
virtual void ClearEntries();
|
||||
virtual void DeleteEntries();
|
||||
|
||||
// ADDED functions
|
||||
virtual int MgrNodeIndex(int fileId);
|
||||
int FindInsertPosition (const int fileId);
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// class MgrNodeArray inline public functions
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,71 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: mgrnodelist.h,v 2.1 1998/07/12 02:57:23 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef mgrnodelist_h
|
||||
#define mgrnodelist_h
|
||||
|
||||
/*
|
||||
* NIST STEP Editor Class Library
|
||||
* cleditor/mgrnodelist.h
|
||||
* May 1995
|
||||
* David Sauder
|
||||
* K. C. Morris
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
#include <gennode.h>
|
||||
#include <gennodelist.h>
|
||||
#include <editordefines.h>
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// class MgrNodeList
|
||||
// This will be used to represent the state lists.
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class MgrNode;
|
||||
|
||||
class MgrNodeList : public GenNodeList
|
||||
{
|
||||
public:
|
||||
MgrNodeList(stateEnum type);
|
||||
virtual ~MgrNodeList() { }
|
||||
|
||||
// ADDED functions
|
||||
virtual MgrNode *FindFileId(int fileId);
|
||||
|
||||
// REDEFINED functions
|
||||
// deletes node from its previous List & appends
|
||||
virtual void Append(GenericNode *node);
|
||||
// deletes newNode from its previous List & inserts in
|
||||
// relation to existNode
|
||||
virtual void InsertAfter(GenericNode *newNode, GenericNode *existNode);
|
||||
virtual void InsertBefore(GenericNode *newNode, GenericNode *existNode);
|
||||
virtual void Remove(GenericNode *node);
|
||||
|
||||
protected:
|
||||
stateEnum listType;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// class MgrNodeList inline functions
|
||||
// these functions don't rely on any inline functions (its own or
|
||||
// other classes) that aren't in this file except for Generic functions
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,104 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: read_func.h,v 2.1 1998/07/12 02:57:24 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef READ_FUNC_H
|
||||
#define READ_FUNC_H
|
||||
|
||||
#include <sdai.h>
|
||||
|
||||
#define MAX_COMMENT_LENGTH 512
|
||||
|
||||
// Print Error information for debugging purposes
|
||||
extern void PrintErrorState(ErrorDescriptor &err);
|
||||
|
||||
// Print istream error information for debugging purposes
|
||||
extern void IStreamState(istream &in);
|
||||
|
||||
extern int
|
||||
ReadInteger(SdaiInteger &val, istream &in, ErrorDescriptor *err,
|
||||
char *tokenList);
|
||||
|
||||
extern int
|
||||
ReadInteger(SdaiInteger &val, const char *s, ErrorDescriptor *err,
|
||||
char *tokenList);
|
||||
|
||||
extern Severity
|
||||
IntValidLevel (const char *attrValue, ErrorDescriptor *err,
|
||||
int clearError, int optional, char *tokenList);
|
||||
|
||||
extern int
|
||||
ReadReal(SdaiReal &val, istream &in, ErrorDescriptor *err,
|
||||
char *tokenList);
|
||||
|
||||
extern int
|
||||
ReadReal(SdaiReal &val, const char *s, ErrorDescriptor *err,
|
||||
char *tokenList);
|
||||
|
||||
extern Severity
|
||||
RealValidLevel (const char *attrValue, ErrorDescriptor *err,
|
||||
int clearError, int optional, char *tokenList);
|
||||
|
||||
extern int
|
||||
ReadNumber(SdaiReal &val, istream &in, ErrorDescriptor *err,
|
||||
char *tokenList);
|
||||
|
||||
extern int
|
||||
ReadNumber(SdaiReal &val, const char *s, ErrorDescriptor *err,
|
||||
char *tokenList);
|
||||
|
||||
extern Severity
|
||||
NumberValidLevel (const char *attrValue, ErrorDescriptor *err,
|
||||
int clearError, int optional, char *tokenList);
|
||||
|
||||
|
||||
////////////////////
|
||||
|
||||
extern int QuoteInString(istream& in);
|
||||
|
||||
extern void
|
||||
PushPastString (istream& in, SCLstring &s, ErrorDescriptor *err);
|
||||
|
||||
extern void
|
||||
PushPastImbedAggr (istream& in, SCLstring &s, ErrorDescriptor *err);
|
||||
|
||||
extern void
|
||||
PushPastAggr1Dim(istream& in, SCLstring &s, ErrorDescriptor *err);
|
||||
|
||||
////////////////////
|
||||
|
||||
extern Severity
|
||||
FindStartOfInstance(istream& in, SCLstring& inst);
|
||||
|
||||
// used for instances that aren\'t valid - reads to next \';\'
|
||||
extern Severity
|
||||
SkipInstance (istream& in, SCLstring & inst);
|
||||
|
||||
extern const char *
|
||||
SkipSimpleRecord(istream &in, SCLstring &buf, ErrorDescriptor *err);
|
||||
|
||||
// this includes entity names
|
||||
extern const char *
|
||||
ReadStdKeyword(istream& in, SCLstring &buf, int skipInitWS = 1);
|
||||
|
||||
extern const char*
|
||||
GetKeyword(istream& in, const char* delims, ErrorDescriptor &err);
|
||||
|
||||
extern int
|
||||
FoundEndSecKywd(istream& in, ErrorDescriptor &err);
|
||||
|
||||
extern const char *ReadComment(SCLstring &ss, const char *s);
|
||||
|
||||
extern const char *ReadComment(istream& in, SCLstring &s);
|
||||
|
||||
extern Severity ReadPcd(istream& in); //Print control directive
|
||||
|
||||
extern void ReadTokenSeparator(istream& in, SCLstring *comments = 0);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,287 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: s_HEADER_SCHEMA.h,v 2.0 1998/07/02 17:03:54 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef S_HEADER_SCHEMA_H
|
||||
#define S_HEADER_SCHEMA_H
|
||||
|
||||
/*
|
||||
* NIST STEP Editor Class Library
|
||||
* cleditor/s_HEADER_SCHEMA.h
|
||||
* May 1995
|
||||
* David Sauder
|
||||
* K. C. Morris
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
// This file was generated by fedex_plus. You probably don't want to edit
|
||||
// it since your modifications will be lost if fedex_plus is used to
|
||||
// regenerate it.
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
#include <sdai.h>
|
||||
#include <Registry.h>
|
||||
#include <STEPaggregate.h>
|
||||
#include <STEPentity.h>
|
||||
|
||||
/* ************** TYPES */
|
||||
extern TypeDescriptor *HEADER_SCHEMAt_SCHEMA_NAME;
|
||||
typedef SdaiString p21DIS_Schema_name;
|
||||
|
||||
/* ************** ENTITIES */
|
||||
extern EntityDescriptor *HEADER_SCHEMAe_FILE_IDENTIFICATION;
|
||||
extern AttrDescriptor *a_0FILE_NAME;
|
||||
extern AttrDescriptor *a_1DATE;
|
||||
extern AttrDescriptor *a_2AUTHOR;
|
||||
extern AttrDescriptor *a_3ORGANIZATION;
|
||||
extern AttrDescriptor *a_4PREPROCESSOR_VERSION;
|
||||
extern AttrDescriptor *a_5ORIGINATING_SYSTEM;
|
||||
|
||||
class s_N279_file_identification : public STEPentity {
|
||||
protected:
|
||||
SdaiString _file_name ;
|
||||
SdaiString _date ;
|
||||
StringAggregate _author ;
|
||||
StringAggregate _organization ;
|
||||
SdaiString _preprocessor_version ;
|
||||
SdaiString _originating_system ;
|
||||
public:
|
||||
|
||||
s_N279_file_identification ( );
|
||||
s_N279_file_identification (s_N279_file_identification& e );
|
||||
~s_N279_file_identification ();
|
||||
#ifdef __O3DB__
|
||||
void oodb_reInit();
|
||||
#endif
|
||||
char *Name () { return "File_Identification"; }
|
||||
int opcode () { return 0 ; }
|
||||
const SdaiString & file_name() const;
|
||||
void file_name (const char * x);
|
||||
const SdaiString & date() const;
|
||||
void date (const char * x);
|
||||
StringAggregate & author();
|
||||
void author (StringAggregate & x);
|
||||
StringAggregate & organization();
|
||||
void organization (StringAggregate & x);
|
||||
const SdaiString & preprocessor_version() const;
|
||||
void preprocessor_version (const char * x);
|
||||
const SdaiString & originating_system() const;
|
||||
void originating_system (const char * x);
|
||||
};
|
||||
inline STEPentity *
|
||||
create_s_N279_file_identification () { return (STEPentity*) new s_N279_file_identification ; }
|
||||
extern EntityDescriptor *HEADER_SCHEMAe_IMP_LEVEL;
|
||||
extern AttrDescriptor *a_6IMPLEMENTATION_LEVEL;
|
||||
|
||||
class s_N279_imp_level : public STEPentity {
|
||||
protected:
|
||||
SdaiString _implementation_level ;
|
||||
public:
|
||||
|
||||
s_N279_imp_level ( );
|
||||
s_N279_imp_level (s_N279_imp_level& e );
|
||||
~s_N279_imp_level ();
|
||||
#ifdef __O3DB__
|
||||
void oodb_reInit();
|
||||
#endif
|
||||
char *Name () { return "Imp_Level"; }
|
||||
int opcode () { return 1 ; }
|
||||
const SdaiString & implementation_level() const;
|
||||
void implementation_level (const char * x);
|
||||
};
|
||||
inline STEPentity *
|
||||
create_s_N279_imp_level () { return (STEPentity*) new s_N279_imp_level ; }
|
||||
extern EntityDescriptor *HEADER_SCHEMAe_FILE_NAME;
|
||||
extern AttrDescriptor *a_7NAME;
|
||||
extern AttrDescriptor *a_8TIME_STAMP;
|
||||
extern AttrDescriptor *a_9AUTHOR;
|
||||
extern AttrDescriptor *a_10ORGANIZATION;
|
||||
extern AttrDescriptor *a_11STEP_VERSION;
|
||||
extern AttrDescriptor *a_12PREPROCESSOR_VERSION;
|
||||
extern AttrDescriptor *a_13ORIGINATING_SYSTEM;
|
||||
extern AttrDescriptor *a_14AUTHORISATION;
|
||||
|
||||
class p21DIS_File_name : public STEPentity {
|
||||
protected:
|
||||
SdaiString _name ;
|
||||
SdaiString _time_stamp ;
|
||||
StringAggregate _author ;
|
||||
StringAggregate _organization ;
|
||||
// SdaiString _step_version ;
|
||||
SdaiString _preprocessor_version ;
|
||||
SdaiString _originating_system ;
|
||||
SdaiString _authorisation ;
|
||||
public:
|
||||
|
||||
p21DIS_File_name ( );
|
||||
p21DIS_File_name (p21DIS_File_name& e );
|
||||
~p21DIS_File_name ();
|
||||
#ifdef __O3DB__
|
||||
void oodb_reInit();
|
||||
#endif
|
||||
char *Name () { return "File_Name"; }
|
||||
int opcode () { return 2 ; }
|
||||
const SdaiString & name() const;
|
||||
void name (const char * x);
|
||||
const SdaiString & time_stamp() const;
|
||||
void time_stamp (const char * x);
|
||||
StringAggregate & author();
|
||||
void author (StringAggregate & x);
|
||||
StringAggregate & organization();
|
||||
void organization (StringAggregate & x);
|
||||
// const SdaiString & step_version() const;
|
||||
// void step_version (const char * x);
|
||||
const SdaiString & preprocessor_version() const;
|
||||
void preprocessor_version (const char * x);
|
||||
const SdaiString & originating_system() const;
|
||||
void originating_system (const char * x);
|
||||
const SdaiString & authorisation() const;
|
||||
void authorisation (const char * x);
|
||||
};
|
||||
inline STEPentity *
|
||||
create_p21DIS_File_name () { return (STEPentity*) new p21DIS_File_name ; }
|
||||
extern EntityDescriptor *HEADER_SCHEMAe_FILE_DESCRIPTION;
|
||||
extern AttrDescriptor *a_15DESCRIPTION;
|
||||
extern AttrDescriptor *a_16IMPLEMENTATION_LEVEL;
|
||||
|
||||
class p21DIS_File_description : public STEPentity {
|
||||
protected:
|
||||
StringAggregate _description ;
|
||||
SdaiString _implementation_level ;
|
||||
public:
|
||||
|
||||
p21DIS_File_description ( );
|
||||
p21DIS_File_description (p21DIS_File_description& e );
|
||||
~p21DIS_File_description ();
|
||||
#ifdef __O3DB__
|
||||
void oodb_reInit();
|
||||
#endif
|
||||
char *Name () { return "File_Description"; }
|
||||
int opcode () { return 3 ; }
|
||||
StringAggregate & description();
|
||||
void description (StringAggregate & x);
|
||||
const SdaiString & implementation_level() const;
|
||||
void implementation_level (const char * x);
|
||||
};
|
||||
inline STEPentity *
|
||||
create_p21DIS_File_description () { return (STEPentity*) new p21DIS_File_description ; }
|
||||
extern EntityDescriptor *HEADER_SCHEMAe_S_CLASSIFICATION;
|
||||
extern AttrDescriptor *a_17SECURITY_CLASSIFICATION;
|
||||
|
||||
class s_N279_classification : public STEPentity {
|
||||
protected:
|
||||
SdaiString _security_classification ;
|
||||
public:
|
||||
|
||||
s_N279_classification ( );
|
||||
s_N279_classification (s_N279_classification& e );
|
||||
~s_N279_classification ();
|
||||
#ifdef __O3DB__
|
||||
void oodb_reInit();
|
||||
#endif
|
||||
char *Name () { return "S_Classification"; }
|
||||
int opcode () { return 4 ; }
|
||||
const SdaiString & security_classification() const;
|
||||
void security_classification (const char * x);
|
||||
};
|
||||
inline STEPentity *
|
||||
create_s_N279_classification () { return (STEPentity*) new s_N279_classification ; }
|
||||
extern EntityDescriptor *HEADER_SCHEMAe_S_FILE_DESCRIPTION;
|
||||
extern AttrDescriptor *a_18DESCRIPTION;
|
||||
|
||||
class s_N279_file_description : public STEPentity {
|
||||
protected:
|
||||
SdaiString _description ;
|
||||
public:
|
||||
|
||||
s_N279_file_description ( );
|
||||
s_N279_file_description (s_N279_file_description& e );
|
||||
~s_N279_file_description ();
|
||||
#ifdef __O3DB__
|
||||
void oodb_reInit();
|
||||
#endif
|
||||
char *Name () { return "S_File_Description"; }
|
||||
int opcode () { return 5 ; }
|
||||
const SdaiString & description() const;
|
||||
void description (const char * x);
|
||||
};
|
||||
inline STEPentity *
|
||||
create_s_N279_file_description () { return (STEPentity*) new s_N279_file_description ; }
|
||||
extern EntityDescriptor *HEADER_SCHEMAe_MAXSIG;
|
||||
extern AttrDescriptor *a_19MAXIMUM_SIGNIFICANT_DIGIT;
|
||||
|
||||
class p21DIS_Maxsig : public STEPentity {
|
||||
protected:
|
||||
SdaiInteger _maximum_significant_digit ;
|
||||
public:
|
||||
|
||||
p21DIS_Maxsig ( );
|
||||
p21DIS_Maxsig (p21DIS_Maxsig& e );
|
||||
~p21DIS_Maxsig ();
|
||||
#ifdef __O3DB__
|
||||
void oodb_reInit();
|
||||
#endif
|
||||
char *Name () { return "Maxsig"; }
|
||||
int opcode () { return 6 ; }
|
||||
SdaiInteger maximum_significant_digit();
|
||||
void maximum_significant_digit (SdaiInteger x);
|
||||
};
|
||||
inline STEPentity *
|
||||
create_p21DIS_Maxsig () { return (STEPentity*) new p21DIS_Maxsig ; }
|
||||
extern EntityDescriptor *HEADER_SCHEMAe_CLASSIFICATION;
|
||||
extern AttrDescriptor *a_20SECURITY_CLASSIFICATION;
|
||||
|
||||
class p21DIS_Classification : public STEPentity {
|
||||
protected:
|
||||
SdaiString _security_classification ;
|
||||
public:
|
||||
|
||||
p21DIS_Classification ( );
|
||||
p21DIS_Classification (p21DIS_Classification& e );
|
||||
~p21DIS_Classification ();
|
||||
#ifdef __O3DB__
|
||||
void oodb_reInit();
|
||||
#endif
|
||||
char *Name () { return "Classification"; }
|
||||
int opcode () { return 7 ; }
|
||||
const SdaiString & security_classification() const;
|
||||
void security_classification (const char * x);
|
||||
};
|
||||
inline STEPentity *
|
||||
create_p21DIS_Classification () { return (STEPentity*) new p21DIS_Classification ; }
|
||||
extern EntityDescriptor *HEADER_SCHEMAe_FILE_SCHEMA;
|
||||
extern AttrDescriptor *a_21SCHEMA_IDENTIFIERS;
|
||||
|
||||
class p21DIS_File_schema : public STEPentity {
|
||||
protected:
|
||||
StringAggregate _schema_identifiers ; // of SCHEMA_NAME
|
||||
|
||||
public:
|
||||
|
||||
p21DIS_File_schema ( );
|
||||
p21DIS_File_schema (p21DIS_File_schema& e );
|
||||
~p21DIS_File_schema ();
|
||||
#ifdef __O3DB__
|
||||
void oodb_reInit();
|
||||
#endif
|
||||
char *Name () { return "File_Schema"; }
|
||||
int opcode () { return 8 ; }
|
||||
StringAggregate & schema_identifiers();
|
||||
void schema_identifiers (StringAggregate & x);
|
||||
};
|
||||
inline STEPentity *
|
||||
create_p21DIS_File_schema () { return (STEPentity*) new p21DIS_File_schema ; }
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,34 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: schema.h,v 2.0 1998/07/02 17:03:56 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef SCHEMA_H
|
||||
#define SCHEMA_H
|
||||
// This file was generated by fedex_plus. You probably don't want to edit
|
||||
// it since your modifications will be lost if fedex_plus is used to
|
||||
// regenerate it.
|
||||
/* */
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
#include <sdai.h>
|
||||
|
||||
|
||||
#include <Registry.h>
|
||||
|
||||
#include <STEPaggregate.h>
|
||||
|
||||
#include <STEPentity.h>
|
||||
|
||||
#include <STEPundefined.h>
|
||||
extern void SchemaInit (Registry &);
|
||||
#include <SdaiCONFIG_CONTROL_DESIGN.h>
|
||||
extern void SdaiCONFIG_CONTROL_DESIGNInit (Registry & r);
|
||||
#endif
|
||||
@@ -0,0 +1,162 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: scl_hash.h,v 2.0 1998/07/02 17:03:57 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifndef SCL_HASH_H
|
||||
#define SCL_HASH_H
|
||||
|
||||
/*
|
||||
* NIST Utils Class Library
|
||||
* clutils/scl_hash.h
|
||||
* May 1995
|
||||
* David Sauder
|
||||
* K. C. Morris
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
/************************************************************************
|
||||
** Hash_Table: Hash_Table
|
||||
** Description:
|
||||
**
|
||||
** Largely based on code written by ejp@ausmelb.oz
|
||||
**
|
||||
** Constants:
|
||||
** HASH_TABLE_NULL - the null Hash_Table
|
||||
**
|
||||
************************************************************************/
|
||||
|
||||
/*
|
||||
* This work was supported by the United States Government, and is
|
||||
* not subject to copyright.
|
||||
*
|
||||
* $Log: scl_hash.h,v $
|
||||
* Revision 2.0 1998/07/02 17:03:57 gunter
|
||||
* Set version 2.0
|
||||
*
|
||||
* Revision 1.1 1998/07/02 15:41:11 gunter
|
||||
* Import for geant4beta
|
||||
*
|
||||
* Revision 1.4 1997/08/06 15:51:01 jsulkimo
|
||||
* Going back to Gabrielle's changes - kept only the newly modified
|
||||
* SdaiCONFIG_CONTROL_DESIGN.h.
|
||||
*
|
||||
* Revision 1.2 1997/06/28 00:15:30 gcosmo
|
||||
* Porting on DEC-OSF1
|
||||
*
|
||||
* Revision 1.1.1.1 1997/02/12 10:52:33 tsasaki
|
||||
* GEANT4 alpha
|
||||
*
|
||||
* Revision 1.1 1996/08/20 15:32:59 jsulkimo
|
||||
* created
|
||||
*
|
||||
* Revision 2.1.0.1 1995/05/16 14:35:29 lubell
|
||||
* setting state to dp21
|
||||
*
|
||||
* Revision 2.1.0.0 1995/05/12 14:13:33 lubell
|
||||
* setting branch
|
||||
*
|
||||
* Revision 2.1 1995/05/12 14:13:32 lubell
|
||||
* changing version to 2.1
|
||||
*
|
||||
* Revision 2.0.1.2 1995/05/09 20:04:42 lubell
|
||||
* Changed the date from 2/94 to 5/95
|
||||
*
|
||||
* Revision 2.0.1.1 1994/04/05 16:44:11 sauderd
|
||||
* Changed the date from 1993 to 1994
|
||||
*
|
||||
* Revision 2.0.1.0 1994/02/04 21:32:20 sauderd
|
||||
* Setting the first branch
|
||||
*
|
||||
* Revision 2.0 1994/02/04 21:32:18 sauderd
|
||||
* STEP Class Library Release 2.0
|
||||
*
|
||||
* Revision 1.3 1994/09/30 20:58:22 sauderd
|
||||
* Administrative stuff for the release. Added the name of the file, library,
|
||||
* the date, contact people, and $id $ for RCS. Did general cleaning, etc.
|
||||
*
|
||||
* Revision 1.2 1992/12/15 14:07:52 kc
|
||||
* made parameters to HASHfind and HASHinsert const
|
||||
*
|
||||
* Revision 1.1 1992/10/07 18:37:20 kc
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.1 1992/10/06 22:06:30 kc
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.1 1992/09/29 15:44:19 libes
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.1 1992/08/19 18:49:59 libes
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.2 1992/05/31 08:36:48 libes
|
||||
* multiple files
|
||||
*
|
||||
*/
|
||||
|
||||
typedef enum { HASH_FIND, HASH_INSERT, HASH_DELETE } Action;
|
||||
|
||||
struct Symbol { }; /* empty if not used */
|
||||
|
||||
struct Element {
|
||||
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];
|
||||
};
|
||||
|
||||
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 */
|
||||
/* 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 */
|
||||
/* value here as well as returns it via the return value of HASHlist */
|
||||
} HashEntry;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct Hash_Table *HASHcreate(unsigned);
|
||||
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 *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SCL_HASH_H */
|
||||
@@ -0,0 +1,106 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: scl_string.h,v 2.1 1998/07/13 16:53:36 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef _SCL_STRING_H
|
||||
#define _SCL_STRING_H
|
||||
|
||||
/*
|
||||
* NIST Utils Class Library
|
||||
* clutils/scl_string.h
|
||||
* May 1995
|
||||
* K. C. Morris
|
||||
* David Sauder
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
/* point of contact for bug reports */
|
||||
#define _POC_ " report problem to dp2@cme.nist.gov "
|
||||
|
||||
//#include <std.h> // not found in CenterLine C++
|
||||
#ifdef __OBJECTCENTER__
|
||||
// this file is not in gnu C++ but it doesn't seem to be needed.
|
||||
#include <stdarg.h>
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
# include "G4ios.hh"
|
||||
#else
|
||||
# include <stream.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
|
||||
/******************************************************************
|
||||
** Class: SCLstring
|
||||
** Description: implements a few basic string handling functions -
|
||||
** hopefully will be replaced by a standard clas
|
||||
** Status: 26-Jan-1994 kc
|
||||
******************************************************************/
|
||||
|
||||
class SCLstring {
|
||||
protected:
|
||||
char * _strBuf; // initially empty
|
||||
int _strBufSize; // size of buffer
|
||||
int _max_len; // should be const, but some db\'s don\'t handle that
|
||||
|
||||
int newBufSize (int len) const;
|
||||
|
||||
public:
|
||||
// returns 1 if _strBuf is a null ptr or if it is an empty string ("")
|
||||
int is_null() const;
|
||||
// returns 1 if _strBuf is a null ptr, and 0 otherwise
|
||||
int is_undefined() const;
|
||||
// deletes _strBuf
|
||||
void set_undefined() ;
|
||||
// sets _strBuf space to be zeroed out
|
||||
int set_null() ;
|
||||
int StrBufSize() const;
|
||||
int Length() const;
|
||||
int MaxLength() const { return _max_len; }
|
||||
|
||||
const char * chars () const
|
||||
{ return _strBuf ? _strBuf : ""; }
|
||||
|
||||
const char * rep() const
|
||||
{ return _strBuf; }
|
||||
|
||||
// operators
|
||||
SCLstring& operator= (const char*); // must be NULL terminated string
|
||||
SCLstring& operator= (char* s) // must be NULL terminated string
|
||||
{ operator= ((const char *)s); return *this; }
|
||||
operator const char * () const;
|
||||
int operator== (const char*) const;
|
||||
SCLstring& Append (const char *);
|
||||
SCLstring& Append (const char);
|
||||
SCLstring& Append (const long int);
|
||||
SCLstring& Append (const int);
|
||||
|
||||
// Josh L, 4/11/95
|
||||
SCLstring& operator=(const SCLstring& s);
|
||||
|
||||
SCLstring& Append (const double, const int precision =15);
|
||||
SCLstring& Prepend (const char *);
|
||||
|
||||
//constructor(s) & destructor
|
||||
SCLstring (const char * str = 0, int max =0);
|
||||
SCLstring (const SCLstring& s);
|
||||
~SCLstring ();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: sdai.h,v 2.0 1998/07/02 17:04:01 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef SDAI_H
|
||||
#define SDAI_H
|
||||
|
||||
/*
|
||||
* NIST STEP Core Class Library
|
||||
* clstepcore/sdai.h
|
||||
* May 1995
|
||||
* David Sauder
|
||||
* KC Morris
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
|
||||
* This file is included to support the proposed SDAI/C++ Language Binding
|
||||
* specified in Annex D of STEP Part 22.
|
||||
|
||||
* This file specifies the appropriate naming conventions and NULL
|
||||
* values for the EXPRESS base types.
|
||||
*/
|
||||
|
||||
/* */
|
||||
|
||||
#ifdef __O3DB__
|
||||
/* OpenOODB.h must be the first include file. */
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
//#include <values.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
// The values used here to represent NULL values for numeric types come from
|
||||
// the ANSI C standard
|
||||
|
||||
// INTEGER
|
||||
// may not a good idea because the def SdaiInteger &i may not be legal
|
||||
//typedef long int SdaiInteger;
|
||||
|
||||
#define SdaiInteger long
|
||||
//#define s_Integer SdaiInteger
|
||||
|
||||
// C++ from values.h DAS PORT
|
||||
//#define S_INT_NULL MAXLONG
|
||||
// C++ from limits.h DAS PORT
|
||||
#define S_INT_NULL LONG_MAX
|
||||
|
||||
// REAL
|
||||
//typedef double SdaiReal;
|
||||
#define SdaiReal double
|
||||
//#define s_Real SdaiReal
|
||||
|
||||
// C++ from values.h DAS PORT
|
||||
//# define S_REAL_NULL MINFLOAT
|
||||
// C++ from limits.h DAS PORT
|
||||
#define S_REAL_NULL FLT_MIN
|
||||
|
||||
// NUMBER
|
||||
// arbitrary choice by me for number DAS
|
||||
|
||||
// C++ from values.h DAS PORT
|
||||
//#define S_NUMBER_NULL MINFLOAT
|
||||
// C++ from limits.h DAS PORT
|
||||
#define S_NUMBER_NULL FLT_MIN
|
||||
|
||||
// STRING
|
||||
#define S_STRING_NULL ""
|
||||
#include <STEPstring.h>
|
||||
|
||||
// ENTITY
|
||||
class STEPentity;
|
||||
extern STEPentity NilSTEPentity;
|
||||
#define S_ENTITY_NULL &NilSTEPentity
|
||||
|
||||
/******************************************************************************
|
||||
ENUMERATION
|
||||
These types do not use the interface specified.
|
||||
The interface used is to enumerated values. The enumerations are
|
||||
mapped in the following way:
|
||||
* enumeration-item-from-schema ==> enumeration item in c++ enum clause
|
||||
* all enumeration items in c++ enum are in upper case
|
||||
* the value ENUM_NULL is used to represent NULL for all enumerated types
|
||||
*****************************************************************************/
|
||||
|
||||
#include <Enumeration.h>
|
||||
|
||||
/******************************************************************************
|
||||
BOOLEAN and LOGICAL
|
||||
|
||||
Logical are implemented as an enumeration in Enumeration.h:
|
||||
* it\'s possible values are sdaiFALSE, sdaiTRUE, sdaiUNKNOWN
|
||||
* or F, T, U
|
||||
|
||||
Boolean are implemented as an enumeration in Enumeration.h:
|
||||
* it\'s possible values are sdaiFALSE, sdaiTRUE
|
||||
* or F, T
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
typedef Logical s_Logical;
|
||||
typedef Logical SdaiLogical;
|
||||
|
||||
typedef Boolean s_Boolean;
|
||||
typedef Boolean SdaiBoolean;
|
||||
|
||||
#include <SdaiBinary.h>
|
||||
|
||||
/******************************************************************************
|
||||
AGGREGATE TYPES
|
||||
|
||||
Aggregate types are accessed generically. (There are not seperate
|
||||
classes for the different types of aggregates.) Aggregates are
|
||||
implemented through the STEPaggregate class.
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
SELECT
|
||||
|
||||
Selects are represented as subclasses of the SdaiSelectH class in
|
||||
STEPselect.h
|
||||
|
||||
******************************************************************************/
|
||||
#include <STEPselect.h>
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,58 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: seeinfodefault.h,v 2.0 1998/07/02 17:04:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef seeinfodefault_h
|
||||
#define seeinfodefault_h
|
||||
|
||||
/*
|
||||
* NIST STEP Editor Class Library
|
||||
* cleditor/schemaheader.cc
|
||||
* May 1995
|
||||
* David Sauder
|
||||
* K. C. Morris
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
// this is a default seeinfo that does nothing... thus it is not
|
||||
// dependent on a user interface toolkit
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
class MgrNode;
|
||||
class DisplayNode;
|
||||
class DisplayNodelist;
|
||||
class STEPentity;
|
||||
|
||||
#include <editordefines.h>
|
||||
|
||||
class seeInfo : public DisplayNode
|
||||
{
|
||||
public:
|
||||
seeInfo(MgrNode *node,
|
||||
STEPentity *se,
|
||||
DisplayNodeList *dnl, displayStateEnum displaySt = mappedWrite);
|
||||
|
||||
void *GetSEE() { return see; }
|
||||
};
|
||||
|
||||
inline seeInfo::seeInfo(MgrNode *node, STEPentity *se,
|
||||
DisplayNodeList *dnl, displayStateEnum displaySt)
|
||||
{
|
||||
mn = node;
|
||||
see = 0;
|
||||
displayState = displaySt;
|
||||
dnl->Append(this);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,72 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: stat.h,v 2.3 1998/08/25 02:52:41 lfelawka Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989 Stanford University
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided
|
||||
* that the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of Stanford not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. Stanford makes no representations about
|
||||
* the suitability of this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*
|
||||
* STANFORD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
* IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* C++ interface to Unix file system stat structure
|
||||
*/
|
||||
|
||||
#ifndef sys_stat_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define KERNEL
|
||||
#ifdef WIN32
|
||||
# include <sys/Stat.h>
|
||||
#else
|
||||
#ifdef __FreeBSD__
|
||||
# include <sys/time.h>
|
||||
#endif
|
||||
# include "//usr/include/sys/stat.h"
|
||||
#endif
|
||||
#undef KERNEL
|
||||
|
||||
/* just in case standard header didn't */
|
||||
#ifndef sys_stat_h
|
||||
#define sys_stat_h
|
||||
#endif
|
||||
|
||||
extern int stat(const char* path, struct stat*);
|
||||
extern int fstat(int fd, struct stat*);
|
||||
extern int lstat(const char* path, struct stat*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user