Compare commits

..
214 Commits
Author SHA1 Message Date
Mark 4d68ec0b19 Merge pull request #146 from mpictor/ver-0.5
Release v0.5 - update INSTALL, NEWS, README
2012-02-23 14:53:29 -08:00
Mark Pictor 69e0813cf7 improve installation instructions 2012-02-23 17:41:11 -05:00
Mark d0e2c156a1 Merge pull request #145 from mpictor/tp/python-generator-dev
Tp/python generator dev
2012-02-23 05:58:30 -08:00
tpaviot b84921e9d8 Fixed unittest failure 2012-02-23 05:25:28 +01:00
Mark Pictor d3418ed48c add python to README 2012-02-22 19:58:33 -05:00
Mark Pictor 96f5f28058 update docs for v0.5 2012-02-22 19:34:30 -05:00
tpaviot ca155ce50d Fixed regression 2012-02-22 23:16:24 +01:00
tpaviot 1bbbc219ba Fixed version and url in setup.py 2012-02-22 23:09:04 +01:00
tpaviot 59cf7ec1ed Fixed unbounded list support 2012-02-22 23:06:51 +01:00
tpaviot f053df82db Added other examples from unitary_schemas directory 2012-02-22 17:58:55 +01:00
tpaviot 8cad6ec2aa Improvements in SELECT and ENUMERATION support 2012-02-22 17:57:23 +01:00
tpaviot 5f345c700e Better support for enum and aggr typedefs 2012-02-22 17:57:23 +01:00
tpaviot 37594fc4a2 Code clean-up: remove unused code 2012-02-22 17:57:23 +01:00
tpaviot d6da97ec30 Small spelling fix 2012-02-22 17:57:23 +01:00
tpaviot 5f88f509b2 Improved docstring for aggregate 2012-02-22 17:57:22 +01:00
tpaviot d87d07a26c Added Model module/class 2012-02-22 17:57:22 +01:00
tpaviot 50b9032d32 LIST better implementation 2012-02-22 17:57:22 +01:00
tpaviot d56795946c Improvements in the aggregates support and Part21 importer as well 2012-02-22 17:57:22 +01:00
tpaviot 117ba3972f SCL unittest fix 2012-02-22 17:57:22 +01:00
tpaviot 8595a291cb Code cleanup 2012-02-22 17:57:22 +01:00
tpaviot ee78ba9c52 Moved AggregationDataType module name to AggregationDataTypes 2012-02-22 17:57:22 +01:00
tpaviot 575c77dda9 Bugfix: segfault when processing ap203 schema 2012-02-22 17:57:22 +01:00
tpaviot bd9942dc36 * Made ARRAY implementation strictly comply with ISO 10303-11:1994
* Updated SCL unittest.
2012-02-22 17:57:22 +01:00
tpaviot 10999e7a48 First draft for a SCL python generator 2012-02-22 17:57:21 +01:00
Mark becb8405ba Merge pull request #135 from mpictor/review/gcc_incomplete_type
Fix the incomplete type errors in AP210, AP235, AP242
2012-02-21 17:09:12 -08:00
Mark Pictor dca5e0c843 add 4 ap210e2 exchange files from wikistep
one had DOS line endings - "warning: CRLF will be replaced by LF in data/ap210e2/PDES-181.stp"
2012-02-21 20:06:02 -05:00
Mark Pictor 47ecd2088f fix linker issue on OSX 2012-02-21 20:04:42 -05:00
Mark Pictor 1cc2774b52 rewrite format_for_std_stringout(), eliminate use of 'tmpstr' buffer 2012-02-16 20:51:13 -05:00
Mark f12e16b3a7 Merge pull request #139 from mpictor/review/multiple-declarations
fix multiple declaration error when compiling ap210e3 (issue 138), add test schema

the problem @davyw is having isn't specific to this branch, so I'm going to merge
2012-02-14 18:09:38 -08:00
Mark ee689a10e1 Merge pull request #140 from mpictor/review/memory-leak-fix
Fixed memory leak in HASHfind() function
2012-02-14 18:07:20 -08:00
Mark Pictor 3fd222218f Replace the scl_char_str__list class with std::deque
Also use std::string in place of char * in various places
2012-02-14 21:00:40 -05:00
Mark Pictor 212c11453e break up huge strings in generated code 2012-02-14 20:00:48 -05:00
Mark 92d83ef14a Merge pull request #137 from mpictor/review/embarcadero_fixes
Review/embarcadero fixes
2012-02-13 14:32:35 -08:00
tpaviot 950407a067 Fixed memory leak in HASHfind() function 2012-02-12 13:33:54 +01:00
Mark Pictor fb79eb2183 fix multiple declaration error when compiling ap210e3 (#138), add test schema 2012-02-11 17:35:46 -05:00
davyw 572e9adc0b Added comment for StrCmpIns function. 2012-02-10 22:57:43 +01:00
davyw ac702af7f3 Fix segfault when file not found for p21read.
* When invalid file name passed to p21read, a segfault occured because
  p21read tried to continue parsing even though no file was found.
  An extra check for errors and early exit fixes this issue.
2012-02-10 22:39:47 +01:00
davyw c316f21fe6 Use of internal StrCmpIns function in stead of runtime stricmp/strcasecmp.
* Because of incompatible implementations of string comparison functions
  on different platforms (uppercase vs lowercase compares) it is better
  to have an scl specific StrCmpIns function. This fixes issues creating
  and validating complex structures in stepfile.cc.
2012-02-10 22:37:18 +01:00
davyw 14926414c3 Cleanup of unused variable exchange_file. 2012-02-10 22:34:43 +01:00
Mark Pictor 260fd55f10 fix segfault - initialize members that are pointer-to-aggregate 2012-02-09 19:02:37 -05:00
Mark Pictor d94a44944b a little cleanup in src/fedex_plus 2012-02-09 19:02:37 -05:00
Mark Pictor 2be1cc40be add small schema exposing incomplete type bug 2012-02-09 19:02:36 -05:00
Mark Pictor 809e1dd495 in generated code, use pointer for all aggregate members 2012-02-09 19:02:36 -05:00
Mark Pictor 3aee5f353c selects.c: don't print tabs into schema files, also some minor cleanup 2012-02-09 19:02:36 -05:00
Mark 6e6fb8197c Merge pull request #134 from mpictor/review/cleanup_for_issue30
Review/cleanup for issue30
2012-02-09 12:48:06 -08:00
Mark 235b1e6ca3 Merge pull request #131 from mpictor/review/cleanup
cleanup src/express and include/express
2012-02-08 15:16:00 -08:00
davyw e99240a780 Removed CORBA (PART26) references.
* Cleaned up all PART26 references for issue #30.
2012-02-05 22:07:58 +01:00
davyw ca0824dd0d Removed __O3DB__ references.
* Cleaned up all __O3DB__ references for issue #30.
2012-02-05 21:48:47 +01:00
Mark Pictor 5dc04396ad cleanup and doxify files in include/express 2012-02-02 19:07:54 -05:00
Mark Pictor 3e8c11661d cleanup and doxify src/express 2012-02-02 19:06:50 -05:00
Mark Pictor a63ac738af eliminate "backwards compatibility" types from type.h, remove unused func
Removed macros and typedefs from type.h

Removed unused function from type.c that used those macros, and
 replaced the macros where used in fedex_plus/. For example:
 sed -i -e 's/Class_Integer_Type/integer_/g;' *

The typedefs were not in use anywhere.
2012-02-02 19:01:29 -05:00
Mark Pictor 7a6ba24f81 remove 'typedef char* String', 'STRINGequal' macro 2012-02-02 18:56:54 -05:00
Mark Pictor 1481950409 Remove obsolete fn macros OBJequal OBJfree OBJreference OBJget_data
These macros were defined in object.h as being "for backwards compatibility".
The only code that used them was in #if 0...#endif blocks. Additionally,
OBJfree is mentioned in express/Changes, dated 1992, as being unnecessary. It
seems safe to remove all of this code - it is very very old.
2012-02-02 18:55:13 -05:00
Mark Pictor 0073b386ef remove useless header src/express/conf.h 2012-02-02 18:48:00 -05:00
Mark Pictor 2d7ed17697 remove unused function PrintModelContentsSchema() 2012-02-02 18:48:00 -05:00
Mark ffdeac2552 Merge pull request #125 from mpictor/review/second-edition-error
Add a warning for unsupported language features, and print it for indexing upon a binary
2012-02-02 12:48:14 -08:00
Mark 8dcfec46c9 Merge pull request #129 from mpictor/review/enums
fix segfault in review/enums
2012-02-02 12:48:04 -08:00
Mark Pictor 14985062f7 fix segfault 2012-01-31 18:25:24 -05:00
Mark e9e576e4f8 Merge pull request #124 from mpictor/review/enums
put enums in separate table
2012-01-29 05:02:40 -08:00
Mark fad0cf4b3d Merge pull request #127 from mpictor/review/embarcadero
Fixed issue for bcc32 v6.30 and up.
2012-01-29 05:01:27 -08:00
Mark Pictor 4cd7e7c806 Add a warning for unsupported language features, and print it for indexing upon a binary 2012-01-26 20:11:59 -05:00
davyw 22cbb3efcf Fixed issue for bcc32 v6.30 and up.
* _Bool type is a known keyword for bcc32 v6.30 and up.
2012-01-18 21:09:49 +01:00
Mark Pictor c415e49894 put enums in separate table 2012-01-17 20:38:31 -05:00
Mark 064a2b41b5 Merge pull request #120 from mpictor/review/borland
Review/borland
2012-01-06 15:00:38 -08:00
Mark fffaba61f2 Merge pull request #119 from mpictor/review/msvc_fixes
Review/msvc fixes
2012-01-06 15:00:21 -08:00
davyw 4ab01a7773 Ran astyle to fix code style. 2012-01-06 19:56:32 +01:00
davyw 873a86de8b Ran astyle to fix code style. 2012-01-06 19:54:57 +01:00
davyw 3a9fa997b3 Added default namespace for Boolean type.
* In borland type Boolean conflicts with System::Boolean so it is needed
  to replace Boolean with ::Boolean.
2012-01-04 23:12:47 +01:00
davyw 2d26da7d24 Changed xgetopt module to remove unicode support.
* Since the unicode support (TCHAR, _T, ...) did not build with borland
  makefiles target I removed unicode support temporarily since most scl
  code does not support unicode yet.
2012-01-04 23:12:46 +01:00
davyw c0c423c625 Added support for cmake 'Borland Makefiles' generator.
* Added __BORLAND__ flag to a number of places in the code.
* Added BORLAND specific stuff to CMakeLists.txt files.
2012-01-04 23:12:46 +01:00
davyw 555a574eef Added support for cmake 'Borland Makefiles'.
* Added BORLAND target to several CMakeLists.txt.
  (MSVC and BORLAND require similar behaviour for imports/exports)
* Added __BORLAND__ ifdefs where needed.
2012-01-04 23:12:45 +01:00
davyw 82898d74a4 Changed classes inherited from std::string from is-a to has-a std::string.
* Removed std::string base class for SDAI_String and SDAI_Binary.
* Added necessary std::string interface functions to SDAI_String and SDAI_Binary.
* Removed msvc specific code from sdaiString.h
2012-01-04 22:24:54 +01:00
davyw 09f347234b Fixed local variable declarations to be msvc compliant. 2012-01-04 21:00:59 +01:00
Mark 3ce06bce27 Merge pull request #117 from mpictor/review/matrix-python-ctest
Create schema matrix using python and ctest
2012-01-03 01:10:47 -08:00
Mark Pictor e7d3c2a075 python/ctest for matrix seems to work now 2011-12-30 09:21:31 -05:00
Mark Pictor e1b374a7d6 initial work on creating matrix with ctest and python 2011-12-29 22:06:31 -05:00
Mark 33c66b0954 Merge pull request #116 from mpictor/review/msvc2010
Fixed linker error for MSVC2010.
2011-12-26 04:00:08 -08:00
Mark eb61193bcf Merge pull request #115 from mpictor/review/aggr-index
Indexing on aggregates and generics
2011-12-24 03:16:02 -08:00
davyw 2535a4f8b2 Fixed linker error for MSVC2010.
* In MSVC2010 std::string::npos is not exported from std libs but
  since it's a constant value it's safe to declare this in the header
  file so every lib that's using it has a local instance.
2011-12-19 13:55:34 +01:00
Mark Pictor ed76f0b625 handle indexing on GENERICs 2011-12-18 19:34:14 -05:00
Mark Pictor f3a82debec forgot to add the test express schema for aggregate indexing 2011-12-17 20:41:35 -05:00
Mark Pictor 1da31f6501 cleanup 2011-12-17 20:37:55 -05:00
Mark Pictor 67f8897429 avoid index error on select types (issue #96) 2011-12-17 20:37:55 -05:00
Mark 81b82cdd24 Merge pull request #113 from mpictor/review/msvc2
[no regressions](http://my.cdash.org/buildSummary.php?buildid=272314), so I'm going to merge
2011-12-17 07:02:03 -08:00
Mark 28a988854f Merge pull request #114 from mpictor/review/doc
add some documents, and rename existing ones (substitute underscore for space)
2011-12-17 05:48:06 -08:00
Mark e36a1a69bd Merge pull request #112 from mpictor/review/p21-comments
Part 21: look for comments within entities
2011-12-17 05:47:53 -08:00
Mark Pictor defd675944 add some files, and rename existing ones (substitute underscore for space) 2011-12-14 20:15:35 -05:00
davyw ec97362602 Fixed generation of nextnn variables.
* Added one more nextnn variable.
2011-12-14 22:08:13 +01:00
davyw 586b8f8996 Fixed typo in create_builtin_type_decl.
* Forgot a ',' which is now added.
2011-12-12 15:06:38 +01:00
davyw c1b57435b2 Fixed warnings in generated code nextnn variables unused.
* maxlevel is determined to create the amount of variables
  needed in the generated code, no more, no less.
2011-12-12 15:00:21 +01:00
davyw 2b0da3fd41 Fixed possible loss of data.
* The old implementation (still in comment) had a possible loss of data
  warning in msvc.
2011-12-12 15:00:20 +01:00
davyw 15f9c40c54 Removes inconsistent dll-linkage warning.
* Removes warning for inconsistent dll-linkage on CheckRemainingInput function.
2011-12-12 15:00:18 +01:00
davyw 0aa9b5dd97 Removed SCL_EXPRESS_EXPORT flag for EXPRESSgetopt_options[].
* Since EXPRESSgetopt_options[] is locally defined for each usage (fedex.c and fedex_main.c)
  it should not be exported from express lib.
* This also removes 3 warnings in MSVC.
2011-12-12 15:00:17 +01:00
davyw 97ef6d97ed Added dependency on utils lib in p21read.
* Added utils lib to p21read dependencies.
* Added SCL_UTILS_DLL_IMPORTS flag for p21read.
2011-12-12 15:00:15 +01:00
davyw d0293fd0c7 Added dependency on utils lib in editor lib.
* Since editor lib uses gennode.cc, gennodearray.cc and gennodelist.cc
  from utils lib it should be dependent on it.
2011-12-12 15:00:14 +01:00
davyw 355f08f50e Removed unused variable list.
* Linked_List list was never used.
2011-12-12 15:00:13 +01:00
davyw f688f2a0c9 Removes warning for one path not returning a value.
* Default returns empty string even though this path is never reached.
2011-12-12 15:00:12 +01:00
davyw 07ed8f6968 Removes performance warning in MSVC.
* Removes performance warning about forcing int to true/false.
2011-12-12 15:00:11 +01:00
davyw 993167ede1 Added io.h include and check if available through cmake.
* io.h defines chmod on WIN32 systems.
2011-12-12 15:00:09 +01:00
davyw 870edbffa8 Added process.h include and check if available through cmake.
* process.h defines getpid on WIN32 systems.
2011-12-12 15:00:08 +01:00
davyw 0f3b6262cd Removes warnings by adding explicit casts for float/double conversions.
* Added ( float ) casts to prevent warnings in MSVC.
2011-12-12 15:00:07 +01:00
davyw 03fd892382 Removes several times warning C4018 in MSVC.
* Removes signed/unsigned mismatch warning.
2011-12-12 15:00:06 +01:00
davyw 7712b9bb23 Removes several times warning C4133 in MSVC.
* Removes incompatible types warning by adding casts.
2011-12-12 15:00:05 +01:00
davyw dcdd77a49d Removes several times warning C4133 in MSVC.
* Removes incompatible types from '...' to 'Generic' warning.
2011-12-12 15:00:04 +01:00
davyw 166425a9b8 Removes several times warning C4018 in MSVC.
* Removes signed/unsigned mismatch warning.
2011-12-12 15:00:03 +01:00
davyw ca4940e6e9 Removes several times warning C4018 in MSVC.
* Removes signed/unsigned mismatch warning.
2011-12-12 15:00:02 +01:00
davyw 3156ea7fb6 Removes 3 times warning C4355 in MSVC.
* Removes 'this': used in base member initializer list warning.
2011-12-12 15:00:01 +01:00
davyw 2179c8a83b Removes 3 times warning C4113 in MSVC.
* Removes 'void (__cdecl*)()' differs in parameter list from 'void (__cdecl*)(void)' warning.
2011-12-12 15:00:00 +01:00
davyw 80208dcdd6 Added msvc import/export scheme for fedex_plus generated code.
* Added IMPORTS/EXPORTS flags in data/CmakeLists.txt.
* Added EXPORT flags for fedex_plus generated code variables and functions.
2011-12-12 14:59:59 +01:00
davyw 737c53ef28 Fixed struct inconsistency for struct Hash_Table.
* scl_hash.h and hash.h have similar struct for struct Hash_Table
  and should have same members and types.
* fixed signed/unsigned comparison warning in HASHCreate function.
2011-12-12 14:59:58 +01:00
Mark Pictor ae9dbbd70e add p21 test for comments within entities 2011-12-11 19:51:32 -05:00
Mark Pictor 4ddce869b2 Look for comments within entities 2011-12-11 19:33:26 -05:00
Mark 3bff65bc9b Merge pull request #111 from mpictor/review/fix-parallel-ctest
change scl_version_string.cmake to fix parallel ctest issue
2011-12-11 16:23:33 -08:00
Mark 81dc369b03 Merge pull request #110 from mpictor/rebase/msvc
Windows / MSVC support - rebase
2011-12-11 16:23:19 -08:00
Mark Pictor 388901d20c run astyle on all files. changed args to catch more files (src/*.h) 2011-12-07 19:03:07 -05:00
davyw 90dc1d6592 Fixed check-express linkage for MSVC.
* Added SCL_EXPRESS_EXPORT flag for yydebug,yydbg_upper_limit,yydbg_lower_limit and yydbg_verbose
* Added xgetopt.cc for check-express/MSVC.
* Added inithook for check-express/MSVC?
* Used set_target_properties COMPILE_DEFINITIONS in stead of add_definitions
  for SCL_EXPRESS_EXPORTS/SCL_EXPRESS_IMPORTS.
2011-12-07 18:57:51 -05:00
davyw d0a425f403 Fixed HAVE_SYS_PARAM_H.
* Include file check for sys/param.h fixed.
2011-12-07 18:57:51 -05:00
davyw 2647e16a53 Added editor files to core lib.
* Added editor files to prevent link editor on core library.
2011-12-07 18:57:51 -05:00
davyw 0869e41b28 Uncommented lines of code that should not have been commented.
* Undo of commenting that should not have made it into a previous commit.
2011-12-07 18:57:51 -05:00
davyw 5e9dfd7e94 Fix array overflows in classes_misc.c
* Functions EnumName and SelectName had an array overflow bug.
2011-12-07 18:57:51 -05:00
davyw dc302ea085 Moved xgetopt.h.
* Moved 'xgetopt.h' from src/fedex_plus to include folder.
2011-12-07 18:57:51 -05:00
davyw c771b270f3 Added editor dll import/export scheme for MSVC.
* Added SCL_EDITOR_EXPORT flag.
* Added SCL_EDITOR_DLL_EXPORTS flag.
* Added SCL_CORE_DLL_IMPORTS flag.
* Added SCL_DAI_DLL_IMPORTS flag.
* Removed double EntityClassName function declarations.
2011-12-07 18:57:51 -05:00
davyw 5c8c5aaca6 Removed double CheckRemainingInput declarations.
* CheckRemainingInput is an utils function, but was also declared in a
  core header file.
2011-12-07 18:57:51 -05:00
davyw 2e01a01bf5 Updated scl_export.h include references.
* Moved around some includes of scl_export.h
2011-12-07 18:57:50 -05:00
davyw 0705c500a5 Added core dll import/export scheme for MSVC.
* Added SCL_CORE_EXPORT flag.
* Added SCL_CORE_DLL_EXPORTS flag.
* Added SCL_EXPRESS_DLL_IMPORTS flag.
* Added SCL_DAI_DLL_IMPORTS flag.
* Added SCL_CORE_DLL_IMPORTS flag.
* Removed sdaiEnum/sdaiString/sdaiBinary (moved to cldai).
2011-12-07 18:57:50 -05:00
davyw c409145b25 Added dai dll import/export scheme for MSVC.
* Added SCL_DAI_EXPORT flag.
* Added SCL_DAI_DLL_EXPORTS flag.
* Added SCL_UTILS_DLL_IMPORTS flag.
2011-12-07 18:57:50 -05:00
davyw 457d51e303 Added utils dll import/export scheme for MSVC.
* Added SCL_UTILS_EXPORT flag.
* Added SCL_UTILS_DLL_EXPORTS flag for exppp CMakeLists.txt
2011-12-07 18:57:50 -05:00
davyw 69acdf329d Moved sources to prevent circular deps.
* Moved sdaiEnum.cc/sdaiBinary.cc/sdaiString.cc from clstepcore to cldai.
2011-12-07 18:57:50 -05:00
davyw c3f9ff563f Made fedex_plus MSVC compatible.
* Selected correct PROTO define for __MSVC__.
* Renamed static function min to minimum to prevent conflict in MSVC.
* Added condition __MSVC__ when __attribute( ( unused ) ) was used.
* Added {} in classes.c to prevent local variable definitions which
  are not allowed in MSVC for c files.
* Added xgetopt.cc/xgetopt.h for getopt functionality.
* Added SCL_EXPRESS_DLL_IMPORTS/SCL_EXPPP_DLL_IMPORTS to CMakeLists.txt.
2011-12-07 18:57:50 -05:00
davyw d6b1570894 Removed __STDC__ defined for MSVC. 2011-12-07 18:45:42 -05:00
davyw f853b997d7 Added exppp dll import/export scheme for MSVC.
* Added SCL_EXPPP_EXPORT flag for all global variables in headers.
* Added SCL_EXPPP_EXPORT flag for all function prototypes in headers.
* Added SCL_EXPRESS_DLL_IMPORTS flag for exppp CMakeLists.txt
* Added SCL_EXPPP_DLL_EXPORTS flag for exppp CMakeLists.txt

Signed-off-by: davyw <davy.wouters@gmail.com>
2011-12-07 18:45:42 -05:00
davyw ba12196a88 Added dll import/export scheme for MSVC.
* Added scl_export.h with conditional flags for import/export.
* Added SCL_EXPRESS_EXPORT flag for all global variables in headers.
* Added SCL_EXPRESS_EXPORT flag for all function prototypes in headers.
* Added SCL_EXPRESS_DLL_EXPORTS flag for express CMakeLists.txt
2011-12-07 18:45:42 -05:00
davyw 879f5092b7 Made changes to prevent compiler/linker errors of express.
* Renamed __in to __i in LISTdo_links macro because __in is a reserved macro for MSVC.
* Renamed isascii to __isascii for MSVC.
* Added __MSVC__ to compiler flags and use it.
2011-12-07 18:45:42 -05:00
davyw 6226717d18 Made changes to prevent compiler/linker errors of clutils.
* Added shlwapi.lib for MSVC target.
* Added pure Win32 alternative implementation for DirObj::Reset function.
2011-12-07 18:45:42 -05:00
davyw 784285605e Added MSVC Global Compiler flags.
* Added __STDC__ and __WIN32__ define since MSVC defaults are different.
* Added _CRT_SECURE_NO_WARNINGS to prevent warnings for secure crt functions.
  (for example strcpy should be strcpy_s)
* Added _CRT_NONSTDC_NO_WARNINGS to prevent deprecated warning for posix functions.
2011-12-07 18:45:41 -05:00
davyw 71bd7b235a Made non MSVC include files conditional.
* Made unistd.h include conditional by cmake HAVE_UNISTD_H flag.
* Made dirent.h include conditional by cmake HAVE_DIRENT_H flag.
* Made sys/params.h include conditional by cmake HAVE_SYS_PARAMS_H flag.
* Made stdbool.h include conditinal by cmake HAVE_STDBOOL_H flag.
* Added scl_stdbool.h as an alternative for stdbool.h.
* Added xgetopt.cc/xgetopt.h to be included when HAVE_GETOPT flag false.
2011-12-07 18:45:41 -05:00
Mark Pictor 13204e4027 change scl_version_string.cmake to fix parallel ctest issue
This replaces use of the system time command with __DATE__ and __TIME__

I think the following two errors are caused by fedex_plus being rebuilt for each test:

Linking CXX executable ../../bin/fedex_plus
CMakeFiles/fedex_plus.dir/__/express/fedex.c.o: file not recognized: File truncated

and

[ 87%] Running fedex_plus for AP214E3_2010...
/bin/sh: /opt/step/test-scl/build_ctest/bin/fedex_plus: Text file busy

fedex_plus is being rebuilt because the version string changes, since it contains the date and time.
2011-12-07 18:44:43 -05:00
Mark 48dff49299 Merge pull request #108 from mpictor/review/namespace
Review/namespace
2011-12-07 15:36:51 -08:00
Mark Pictor 3ed8797097 use namespace for globals, part 3. fix problems with ifc2x3 2011-12-03 19:43:12 -05:00
Mark Pictor a13ba2152a remove goto 2011-12-03 19:19:52 -05:00
Mark Pictor ed8474e132 move one func decl to header, remove a CORBA function 2011-12-03 19:19:52 -05:00
Mark Pictor da0a395c2d use namespace for global variables, part 2. example schema builds now. 2011-12-03 19:19:27 -05:00
Mark Pictor 0bb182b4e7 cleanup classes_wrapper 2011-12-03 19:19:27 -05:00
Mark Pictor 1cfb41d6b3 cleanup generated code, including tabs printed in classes_wrapper.cc 2011-12-03 19:19:27 -05:00
Mark Pictor 65791a2812 doxify some comments in classes.c 2011-12-03 19:19:27 -05:00
Mark Pictor ca50d5352f remove variables marked with __attribute__((unused)) 2011-12-03 19:19:27 -05:00
Mark Pictor cb35164af7 clean up classes.h, remove two macros 2011-12-03 19:19:27 -05:00
Mark Pictor 88e9634541 use namespace for global variables, part 1 2011-12-03 19:19:09 -05:00
Mark Pictor e54780743a add assertions to STEPattribute ctors 2011-11-30 21:29:33 -05:00
Mark Pictor 6aa4695322 use ?: in STEPattribute::NonRefType() to ensure that aDesc ptr is valid 2011-11-30 21:29:33 -05:00
Mark deb55618fe Merge pull request #107 from mpictor/review/cleanup-classes.c
Review/cleanup
2011-11-30 12:59:10 -08:00
Mark c4dd81a0bc Merge pull request #106 from mpictor/review/git-version
Generate version info and timestamp at build time
2011-11-30 12:58:03 -08:00
Mark Pictor 402225e3e8 [warning-fix][-Wsign-compare] classes.c 2011-11-28 19:08:58 -05:00
Mark Pictor 73cc97f8ff [warning-fix][-Wunused-variable] classes.c 2011-11-28 19:06:56 -05:00
Mark Pictor 86b9f12098 remove all tabs from code generated by classes.c, replace with spaces 2011-11-27 18:14:27 -05:00
Mark Pictor d6aa13f4b2 remove almost all of the rest of the corba code from classes.c 2011-11-27 18:02:49 -05:00
Mark Pictor 93678232d8 remove more corba and oodb, misc cleanup 2011-11-27 18:01:51 -05:00
Mark Pictor 04d29c0bfb comment out unused variable in fedex_plus output 2011-11-27 18:01:35 -05:00
Mark Pictor 4dc08910c6 change TYPEis_builtin() return type to bool 2011-11-27 17:50:16 -05:00
Mark Pictor 4c5a8e038d Skip printing some oodb/part26/corba stuff. Also doxify a few comments. 2011-11-27 17:50:03 -05:00
Mark Pictor d06753403c no need to print OODB stuff 2011-11-27 17:49:54 -05:00
Mark Pictor d35f73f87f change return type to bool for one func, remove a const_cast elsewhere 2011-11-27 17:49:39 -05:00
Mark Pictor d190a1e042 for version info, read SCL_VERSION.txt if git fails 2011-11-27 11:41:27 -05:00
Mark Pictor dc30ee21fd Generate version info and timestamp at build time
* Print this info from `p21read -v` and in a comment in generated source, not just from `fedex_plus -v`

* Use a function `const char* scl_version()`, instead of using the macro `SCL_COMMIT_ID`

* Fail gracefully if the `.git` directory does not exist (thanks CY!)

* Fixes issue #89
2011-11-27 11:12:54 -05:00
Mark Pictor fa615a1786 print fedex version in generated code 2011-11-27 11:04:24 -05:00
Mark 59349657da Merge pull request #102 from mpictor/review/create-missing-attributes
Review/create missing attributes
2011-11-27 07:27:55 -08:00
Mark dbdf7a99f1 Merge pull request #103 from mpictor/review/warnings
turn on more gcc warnings
2011-11-17 14:26:58 -08:00
Mark ee908d69ed Merge pull request #105 from mpictor/review/lexact-fix
Fixed SCANsave_comment
2011-11-17 13:52:03 -08:00
Mark d2e40ddf91 Merge pull request #104 from mpictor/review/ifc2x3_sample
Add two ifc2x3 files. Currently, p21read fails with both.
2011-11-16 08:29:22 -08:00
tpaviot c6bc7ec185 Fixed SCANsave_comment 2011-11-16 10:02:56 +01:00
Mark Pictor f491d500a6 Add two ifc2x3 files. Currently, p21read fails with both.
* Need to fix issue #87 before p21read will load PlayersTheater.stp
* Bien-Zenker_Jasmin-Sun-AC14-V2.ifc causes a segfault
2011-11-15 20:27:47 -05:00
Mark Pictor 3ed94ababd p21read should exit(1) for write errors _and_ read errors 2011-11-14 21:18:19 -05:00
Mark Pictor 96fdcf9e54 add two tests for 'missing and required' attributes 2011-11-14 21:01:20 -05:00
Mark Pictor dd4538ce50 turn on more warnings 2011-11-14 20:37:05 -05:00
Mark Pictor 373d415a07 Use bool strict - if false, create values for numeric and string attrs
If strict is true, behavior should be identical to old behavior
2011-11-14 20:34:11 -05:00
Mark Pictor de3495d03f add bool strict 2011-11-14 20:34:08 -05:00
Mark Pictor 6871bc4eca use peek() and ignore() instead of get() and putback() 2011-11-14 20:33:13 -05:00
Mark Pictor 6b95067732 remove another BUFSIZ char array 2011-11-14 20:30:46 -05:00
Mark Pictor 99abb18825 print more details in STEPread_error() 2011-11-14 20:28:41 -05:00
Mark Pictor c4971681e5 cleanup 2011-11-13 21:01:33 -05:00
Mark Pictor b277759f58 int useTechCor -> bool useTechCor 2011-11-13 21:01:33 -05:00
Mark Pictor 88a1229a23 update NEWS and README for v0.4 2011-11-13 11:26:57 -05:00
Mark c987ad03d2 Merge pull request #100 from mpictor/review/matrix
update matrix script, change schema name in ap210e3 WIP
2011-11-13 07:33:44 -08:00
Mark Pictor 6418c44e30 update schema matrix, change schema name for ap210e3 WIP so that it will work alongside ap210e2 2011-11-12 15:55:40 -05:00
Mark d4517fbe64 Merge pull request #85 from mpictor/review/more-tests
ctest - add p21read schema name tests, re-enable unitary_schema tests, etc
2011-11-12 11:31:20 -08:00
charliestirk 6d84278f86 Merge pull request #97 from mpictor/review/ap210
Add ap210e2, rename ap210e3 to conform with data/README and to remove extra '.'
2011-11-12 11:09:40 -08:00
Mark Pictor 5eeba5b34b Add ap210e2, rename ap210e3 to conform with data/README and to remove extra '.' 2011-11-12 13:06:02 -05:00
Mark Pictor f2cafe04ff ctest - add p21read schema name tests, re-enable unitary_schema tests, etc
* data/CMakeLists.txt
   * don't install anything
   * add 'cpp' to c++ test names and labels
* test/CMakeLists.txt: add label for run_ctest.cmake script
* add test/p21 for part 21 tests
   * all that's in here now is part 21 schema name tests
* fix test/unitary_schemas/aggregate_array.exp - ctest works, no sense having this fail
* update run_ctest.cmake
2011-11-12 08:20:29 -05:00
Mark Pictor d08ffa5eb4 update build_all.sh, fix schema dir name in data/CMakeLists.txt 2011-11-12 08:20:29 -05:00
Mark 89055ea452 Merge pull request #95 from mpictor/review/enum-redeclaration
Fix issue #71 - it is legal for enum values and entities have the same name
2011-11-12 03:51:12 -08:00
Mark d0c9541679 Merge pull request #92 from mpictor/review/local-label
Fix issue #72 - incorrect handling of GENERICs
2011-11-12 03:50:59 -08:00
Mark Pictor 392dfc6352 add two small schemas that should compile successfully 2011-11-06 20:15:55 -05:00
Mark Pictor 157c747d18 minor cleanup 2011-11-06 20:15:54 -05:00
Mark Pictor f5a130a3b7 Fix issue #71 - it is legal for enum values and entities have the same name 2011-11-06 20:15:54 -05:00
Mark 79e77ff65c Merge pull request #93 from mpictor/review/fedex-optimization
fedex_plus optimization - dramatically speed up fedex_plus.
2011-11-06 16:32:01 -08:00
Mark dba8c3fd9d Merge pull request #86 from mpictor/review/p21read-exit-err
p21read - exit(1) if errors occur
2011-11-06 03:12:30 -08:00
Mark Pictor 1faaf698fd remove a function which does nothing 2011-11-05 19:18:29 -04:00
Mark Pictor 27ce5604c2 make utype_member faster 2011-11-05 19:16:50 -04:00
tpaviot 1ad14e1334 check for upper or lower case SELF 2011-11-05 19:13:16 -04:00
Mark Pictor fffd710005 terminate string, fix infinite loop when string contains space or newline 2011-11-05 13:45:00 -04:00
tpaviot 770e4a885e Modified generate_attribute_name function 2011-11-05 16:48:47 +01:00
Mark Pictor 254b5a3dfb Fix issue #72 - incorrect handling of GENERICS
Part 11 does not require a variable defined in a LOCAL to have a type label.
ap242 error: Return type or local variable requires type label in
             'validate_dependently_instantiable_entity_data_types'
2011-11-05 11:18:52 -04:00
Mark Pictor b12562a639 p21read - exit(1) if errors occur. previously, p21read always reported success 2011-11-04 14:29:02 -04:00
Mark db00ec914f Merge pull request #88 from mpictor/review/apple
on osx, link libs with -flat_namespace -undefined suppress
2011-11-04 11:26:53 -07:00
Mark Pictor 73b69e2df6 on osx, link libs with -flat_namespace -undefined suppress 2011-11-04 12:22:22 -04:00
Mark bbaed49beb Merge pull request #70 from mpictor/review/remove-sclp
remove SCLP23 macros, sclprefixes.h, and HAVE_CONFIG_H checks

http://my.cdash.org/buildSummary.php?buildid=253754 - doesn't affect tests
2011-10-30 07:39:03 -07:00
Mark Pictor d6d7c48230 remove SCLP23 macros, sclprefixes.h, and HAVE_CONFIG_H
* remove all uses of SCLP23 and SCLP23_NAME macros, and don't include sclprefixes.h anywhere:
    for i in `grep -rl SCLP23 *`; do echo $i; sed -i 's/SCLP23_NAME( *\([A-Za-z][a-zA-Z0-9_]*\) *)/SDAI_\1/g;' $i; done
    for i in `grep -rl SCLP23 *`; do echo $i; sed -i 's/SCLP23( *\([A-Za-z][a-zA-Z0-9_]*\) *)/SDAI_\1/g;' $i; done
    for i in `grep -nr sclprefixes.h *`; do sed -i 's/#include <sclprefixes.h>//g;' $i; done
* delete sclprefixes.h
* remove HAVE_CONFIG_H in all *.c, *.cc, *.h, and */CMakeLists.txt - with cmake, we'll always have scl_cf.h
2011-10-30 10:00:53 -04:00
Mark 995c19d6da Merge pull request #83 from mpictor/review/strncpy
Review/strncpy - improve p21read speed by ~ 30%

CTest pass/fail numbers are the same, so I'm merging this
2011-10-30 06:16:18 -07:00
Mark Pictor aef6e73a60 include cmath, remove extern ceil 2011-10-30 09:13:18 -04:00
Mark Pictor b8fc557543 avoid using strncpy in STEPFile::schemaName() 2011-10-30 09:13:18 -04:00
Mark Pictor be58f09ec0 make numbers in formula floats
The original compiler must have assumed that numbers were floats.
With that assumption, the formula makes sense.
2011-10-30 09:13:18 -04:00
Mark Pictor e72ca29407 cleanup while working on dp 2011-10-30 09:13:18 -04:00
Mark da7639aa2f Merge pull request #82 from mpictor/review/doc
add sclnotes.ps, replace two mangled .ps docs with .pdf
2011-10-30 06:11:54 -07:00
Mark Pictor ec7e8ac2d1 add sclnotes, replace two other mangled ps docs with pdf 2011-10-25 20:18:08 -04:00
285 changed files with 514982 additions and 26216 deletions
+42 -20
View File
@@ -48,7 +48,7 @@ ENDIF(COMMAND CMAKE_POLICY)
PROJECT(SCL)
if( CMAKE_BUILD_TYPE STREQUAL "" )
message( "Debug build - to override, rerun cmake with '-DCMAKE_BUILD_TYPE=Release'." )
message( "-- Debug build - to override, rerun cmake with '-DCMAKE_BUILD_TYPE=Release'." )
set( CMAKE_BUILD_TYPE Debug )
endif()
@@ -58,6 +58,9 @@ OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON)
# build static libs by default
OPTION(BUILD_STATIC_LIBS "Build static libraries" OFF)
OPTION(PYTHON_GENERATOR "Compile fedex_plus_python" ON)
OPTION(CPP_GENERATOR "Compile fedex_plus" ON)
# Set version
SET(SCL_VERSION_MAJOR "3")
SET(SCL_VERSION_MINOR "2")
@@ -106,7 +109,6 @@ IF(ENABLE_TESTING)
endif()
INCLUDE(CTest)
ENABLE_TESTING()
SUBDIRS(test)
ENDIF(ENABLE_TESTING)
#---------------------------------------------------------------------
@@ -177,8 +179,8 @@ IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
IF ("${CMAKE_BUILD_TYPE}" MATCHES "Release")
SET(CMAKE_INSTALL_PREFIX "/usr")
ELSEIF ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
MESSAGE("setting debug output dir")
SET(CMAKE_INSTALL_PREFIX "${SCL_SOURCE_DIR}/../scl-install")
MESSAGE("--- Setting debug install dir to ${CMAKE_INSTALL_PREFIX}")
ELSE("${CMAKE_BUILD_TYPE}" MATCHES "Release")
SET(CMAKE_INSTALL_PREFIX "/usr/local")
ENDIF ("${CMAKE_BUILD_TYPE}" MATCHES "Release")
@@ -205,35 +207,51 @@ INCLUDE(${SCL_CMAKE_DIR}/FindYACC.cmake)
CHECK_INCLUDE_FILE(ndir.h HAVE_NDIR_H)
CHECK_INCLUDE_FILE(stdarg.h HAVE_STDARG_H)
CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
CHECK_INCLUDE_FILE(sys/param.h HAVE_SYS_PARAM_H)
CHECK_INCLUDE_FILE(sysent.h HAVE_SYSENT_H)
CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
CHECK_INCLUDE_FILE(dirent.h HAVE_DIRENT_H)
CHECK_INCLUDE_FILE(stdbool.h HAVE_STDBOOL_H)
CHECK_INCLUDE_FILE(process.h HAVE_PROCESS_H)
CHECK_INCLUDE_FILE(io.h HAVE_IO_H)
CHECK_FUNCTION_EXISTS(abs HAVE_ABS)
CHECK_FUNCTION_EXISTS(memcpy HAVE_MEMCPY)
CHECK_FUNCTION_EXISTS(memmove HAVE_MEMMOVE)
CHECK_FUNCTION_EXISTS(getopt HAVE_GETOPT)
CHECK_TYPE_SIZE("ssize_t" SSIZE_T)
#set GIT_COMMIT_ID to the output of `git describe`
find_package(Git)
if(GIT_FOUND)
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags RESULT_VARIABLE res_var OUTPUT_VARIABLE GIT_COM_ID )
if( NOT ${res_var} EQUAL 0 )
set( GIT_COMMIT_ID "unknown (git failed!)")
message( WARNING "Git failed (not a repo?). Build will not contain git revision info." )
endif()
string( REPLACE "\n" "" GIT_COMMIT_ID ${GIT_COM_ID} )
else()
set( GIT_COMMIT_ID "unknown (git not found!)")
message( WARNING "Git not found. Build will not contain git revision info." )
endif()
# Now that all the tests are done, configure the scl_cf.h file:
configure_file(${SCL_BINARY_DIR}/include/scl_cf.h.in ${SCL_BINARY_DIR}/include/scl_cf.h)
add_definitions(
-DHAVE_CONFIG_H -Wall
)
################ create scl_version_string.h, http://stackoverflow.com/questions/3780667
# Using 'ver_string' instead of 'scl_version_string.h' is a trick to force the
# command to always execute when the custom target is built. It works because
# a file by that name never exists.
add_custom_target(version_string ALL
DEPENDS ver_string )
# creates scl_version_string.h using cmake script
add_custom_command(OUTPUT ver_string ${CMAKE_CURRENT_BINARY_DIR}/include/scl_version_string.h
COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${SCL_SOURCE_DIR}
-DBINARY_DIR=${SCL_BINARY_DIR}
-P ${SCL_CMAKE_DIR}/scl_version_string.cmake)
# scl_version_string.h is a generated file
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/include/scl_version_string.h
PROPERTIES GENERATED TRUE
HEADER_FILE_ONLY TRUE )
################
if(MSVC)
# add_definitions( -Wall )
add_definitions( -D__MSVC__ -D__WIN32__ )
# Disable warning for preferred usage of secure functions (example strcpy should be strcpy_s, ...)
add_definitions( -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS )
elseif(BORLAND)
add_definitions( -D__BORLAND__ -D__WIN32__ )
else()
add_definitions( -pedantic -W -Wall -Wundef -Wfloat-equal -Wshadow -Winline -Wno-long-long )
endif()
include_directories(
${SCL_SOURCE_DIR}/include
@@ -243,12 +261,16 @@ include_directories(
ADD_SUBDIRECTORY(src/express)
ADD_SUBDIRECTORY(src/exppp)
ADD_SUBDIRECTORY(src/fedex_plus)
ADD_SUBDIRECTORY(src/fedex_python)
ADD_SUBDIRECTORY(src/clstepcore)
ADD_SUBDIRECTORY(src/cleditor)
ADD_SUBDIRECTORY(src/cldai)
ADD_SUBDIRECTORY(src/clutils)
ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(data)
IF(ENABLE_TESTING)
ADD_SUBDIRECTORY( test )
ENDIF(ENABLE_TESTING)
ADD_SUBDIRECTORY(doc)
# this is for testing - 'make core' builds everything that isn't generated
+30 -7
View File
@@ -6,7 +6,7 @@ STEP Class Library.
These installation requires that you have the following software
available:
- C and C++ compilers (only gcc has been tested recently)
- C and C++ compilers (Tested with GCC, MSVC, Embarcadero)
- bison, byacc, or yacc (only bison has been tested recently)
- flex or lex (only flex has been tested recently)
- CMake
@@ -21,12 +21,22 @@ Installation
* Build system uses CMake now: configure, Makefile, and all
autotools files have been removed, as has mkProbe.
* To build:
cd scl
mkdir build
cd build
cmake ..
make
* Building SCL from the command prompt:
- cd scl
- mkdir build
- cd build
- cmake ..
- make
- make install # optional
* Building SCL from the GUI:
- Run cmake-gui, set it to build in scl/build
- Select the correct build file generator
- Press Configure
- Change options as necessary, configuring again afterwards
- If there are errors, some options may not be visible until the error is resolved
- Press Generate
- Open the main build file using your preferred build tool
* Build options (append to the 'cmake ..' line):
-DBUILD_SCHEMAS="path/to/schema.exp;path/to/schema2.exp"
@@ -45,3 +55,16 @@ Installation
-DCMAKE_BUILD_TYPE=Release
- this causes binaries to be built without debugging information
- without this, cmake defaults to a Debug build
* Using CTest to test SCL:
- Read the comments in run_ctest.cmake
- (OPTIONAL) Create scl/../.SCL_CTEST_PREFS.cmake, and set variables
in it (this file is required for CDash submission to be enabled)
- Run tests with `ctest -S run_ctest.cmake`
* Using CTest to regenerate the schema matrix on the github SCL wiki:
- Requires:
- git
- python
- a clone of the git repo for the wiki at scl/../wiki-scl
- run `ctest -S ctest_matrix.cmake`
+32 -1
View File
@@ -1,5 +1,36 @@
STEP Class Library ------ https://github.com/mpictor/StepClassLibrary
STEP Class Library ------ http://github.com/mpictor/StepClassLibrary
************************************************************************
Release 0.5 (Feb 23, 2012)
New since v0.4:
* MSVC and Embarcadero support, along with many warning fixes
* Experimental Python support
* Now handles most features of EXPRESS - all included schemas,
with the exception of AP209 CD, are parsed without error. Enums are
now in their own dictionary. Allow indexing on aggregates, generics,
and binaries.
* Changes to fedex_plus that improve the generated c++ - use a
namespace, break up large static strings, make EXPRESS multiple
inheritance work by not printing multiple copies of inherited members.
All schemas now compile without error, but there are numerous warnings.
* Exchange files: handle all comments, fill in some missing attributes.
* More cleanup of source code, more documentation in scl/doc
* Special thanks to @davyw and @tpaviot for their large contributions
(MSVC and Python, respectively)
************************************************************************
Release 0.4 (Nov 13, 2011)
New since v0.3:
* Improve p21read performance by ~30%
* Improve fedex_plus performance by ~4300% (!)
* A variable defined in a LOCAL is not required to have a type label
(affected ap242,210e3,209)
* Enums and entities are allowed to have the same names
(affected ap242,210e3,209)
* Remove the SCLP23 macro
http://github.com/mpictor/StepClassLibrary/wiki/changelog-v0.4
************************************************************************
Release 0.3 (Oct 29, 2011)
What's new since v0.2?
+5 -36
View File
@@ -1,12 +1,10 @@
***********************************************************************
Step Class Library v0.3 -- https://github.com/mpictor/StepClassLibrary
Step Class Library v0.5 -- http://github.com/mpictor/StepClassLibrary
* What is SCL? SCL reads ISO10303-11 EXPRESS schemas and generates
C++ source code that can read and write Part 21 files conforming
to that schema. SCL once worked with ObjectStore, OODB, and
CORBA IDL - but that code has not been used in a very long time.
We are in the process of removing this code because ObjectStore,
CORBA, etc. are no longer part of the STEP standard.
C++ source code that can read and write Part 21 files conforming
to that schema. In addition to C++, v0.5 includes experimental
support for Python.
* SCL is packaged along with some other tools. See
"THE NIST STEP TOOLSET", below. In particular, Data Probe
@@ -21,36 +19,7 @@ Step Class Library v0.3 -- https://github.com/mpictor/StepClassLibrary
* Build system uses only CMake now: configure, Makefile, and all
autotools files have been removed, as has mkProbe.
* To build:
cd scl
mkdir build
cd build
cmake ..
make
* Build options (append to the 'cmake ..' line):
-DBUILD_SCHEMAS="path/to/schema.exp;path/to/schema2.exp"
- this generates c++ for the schema, and compiles it into a
library. Also works with directories, as long as each dir only
has one express file.
- multiple files/directories are separated by semicolons
- this also builds a 'p21read' program, which reads one step file
and writes another. It may change whitespace or remove comments;
otherwise, the input and output files should be identical. If
they are not identical, either the file does not match the
schema, or SCL generated incorrect source code.
-DBUILD_SCHEMAS=ALL
- Added to make use of ctest easier. If BUILD_SCHEMAS == ALL,
then CMake adds each *.exp file found in data/.
-DCMAKE_BUILD_TYPE=Release
- this causes binaries to be built without debugging information
- without this, cmake defaults to a Debug build
* Using CTest to test SCL:
- Read the comments in run_ctest.cmake
- (OPTIONAL) Create scl/../.SCL_CTEST_PREFS.cmake, and set variables
in it (this file is required for CDash submission to be enabled)
- Run tests with `ctest -S run_ctest.cmake`
* Building and testing SCL - see the INSTALL file
***********************************************************************
+1
View File
@@ -0,0 +1 @@
0.5
+48
View File
@@ -0,0 +1,48 @@
#use git for a pretty commit id
#uses 'git describe --tags', so tags are required in the repo
#create a tag with 'git tag <name>' and 'git push --tags'
# http://stackoverflow.com/questions/3780667
# http://www.cmake.org/pipermail/cmake/2009-February/027014.html
#scl_version_string.h defines scl_version() which returns a pretty commit description and a build timestamp.
set(VERS_FILE ${SOURCE_DIR}/SCL_VERSION.txt )
if( EXISTS ${SOURCE_DIR}/.git )
find_package(Git QUIET)
if(GIT_FOUND)
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags RESULT_VARIABLE res_var OUTPUT_VARIABLE GIT_COMMIT_ID )
if( NOT ${res_var} EQUAL 0 )
file( READ ${VERS_FILE} GIT_COMMIT_ID LIMIT 255 )
message( WARNING "Git failed (probably no tags in repo). Build will contain revision info from ${VERS_FILE}." )
endif()
else(GIT_FOUND)
file( READ ${VERS_FILE} GIT_COMMIT_ID LIMIT 255 )
message( WARNING "Git not found. Build will contain revision info from ${VERS_FILE}." )
endif(GIT_FOUND)
else()
file( READ ${VERS_FILE} GIT_COMMIT_ID LIMIT 255 )
message( WARNING "Git failed ('.git' not found). Build will contain revision info from ${VERS_FILE}." )
endif()
string( REPLACE "\n" "" GIT_COMMIT_ID ${GIT_COMMIT_ID} )
set( vstring "//scl_version_string.h - written by cmake. Changes will be lost!\n"
"#ifndef SCL_VERSION_STRING\n"
"#define SCL_VERSION_STRING\n\n"
"/*\n** Returns a string like \"test-1-g5e1fb47, built on <timestamp>\", where test is the\n"
"** name of the last tagged git revision, 1 is the number of commits since that tag,\n"
"** 'g' is unknown, 5e1fb47 is the first 7 chars of the git sha1 commit id, and\n"
"** <timestamp> is the output of your system's 'date' command.\n*/\n\n"
"const char* scl_version() {\n"
" return \"git commit id ${GIT_COMMIT_ID}, built at \"__TIME__\" on \"__DATE__\;\n"
"}\n\n"
"#endif\n"
)
file(WRITE scl_version_string.h.txt ${vstring} )
# copy the file to the final header only if the version changes
# reduces needless rebuilds
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
scl_version_string.h.txt ${BINARY_DIR}/include/scl_version_string.h)
message("-- scl_version_string.h is up-to-date.")
+57
View File
@@ -0,0 +1,57 @@
# run_ctest.cmake
# `ctest -S run_ctest.cmake`
set( CTEST_SOURCE_DIRECTORY . )
set( CTEST_BINARY_DIRECTORY build_matrix )
set( CTEST_CMAKE_GENERATOR "Unix Makefiles" )
set( CTEST_MEMORYCHECK_COMMAND /usr/bin/valgrind )
set( CTEST_INITIAL_CACHE "
SITE:STRING=${CTEST_SITE}
BUILDNAME:STRING=${CTEST_BUILD_NAME}
ENABLE_TESTING:BOOL=ON
CMAKE_BUILD_TYPE:STRING=Debug
")
# find number of processors, for faster builds
# from http://www.kitware.com/blog/home/post/63
if(NOT DEFINED PROCESSOR_COUNT)
# Unknown:
set(PROCESSOR_COUNT 0)
# Linux:
set(cpuinfo_file "/proc/cpuinfo")
if(EXISTS "${cpuinfo_file}")
file(STRINGS "${cpuinfo_file}" procs REGEX "^processor.: [0-9]+$")
list(LENGTH procs PROCESSOR_COUNT)
endif()
# Mac:
if(APPLE)
find_program(cmd_sys_pro "system_profiler")
if(cmd_sys_pro)
execute_process(COMMAND ${cmd_sys_pro} OUTPUT_VARIABLE info)
string(REGEX REPLACE "^.*Total Number Of Cores: ([0-9]+).*$" "\\1"
PROCESSOR_COUNT "${info}")
endif()
endif()
# Windows:
if(WIN32)
set(PROCESSOR_COUNT "$ENV{NUMBER_OF_PROCESSORS}")
endif()
endif()
set(CTEST_BUILD_FLAGS "-j${PROCESSOR_COUNT}")
ctest_start(matrix)
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
ctest_configure( BUILD "${CTEST_BINARY_DIRECTORY}" OPTIONS -DENABLE_TESTING=ON )
ctest_build( BUILD "${CTEST_BINARY_DIRECTORY}" )
message("running tests")
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL ${PROCESSOR_COUNT}
INCLUDE_LABEL "cpp_schema_....*" )
message("running python script")
execute_process( COMMAND python ../misc/wiki-scripts/update-matrix.py
WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} )
+29 -47
View File
@@ -1,38 +1,3 @@
IF( INSTALL_DATA )
SET(ap203_data
ap203/203wseds.exp
ap203/cube1.p21
ap203/cube2.p21
ap203/g_r_assembly1.p21
ap203/gasket1.p21
ap203/gasket2.p21
ap203/gasket3.p21
ap203/hex_prism1.p21
ap203/rod_aspect1.p21
ap203/star1.p21
)
INSTALL(FILES ${ap203_data} DESTINATION ${DATA_DIR}/data/ap203)
SET(ap227_data
ap227/ap227.exp
ap227/mitre.p21
ap227/mitre.step.txt
)
INSTALL(FILES ${ap227_data} DESTINATION ${DATA_DIR}/data/ap227)
SET(step_example_data
example/example.exp
)
INSTALL(FILES ${step_example_data} DESTINATION ${DATA_DIR}/data/example)
SET(step_datafiles
pdmnet.exp
select.exp
)
INSTALL(FILES ${step_datafiles} DESTINATION ${DATA_DIR}/data)
ENDIF( INSTALL_DATA )
#this sets a property so that the target doesn't get built by 'make' or 'make all'
#useful when testing generation of schema code/compiling schem libs/etc
@@ -69,7 +34,8 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
file(STRINGS ${SCHEMA_FILE} SCHEMA_STATEMENT LIMIT_COUNT 1 REGEX "^SCHEMA .*")
string(REGEX REPLACE "^SCHEMA \(.*\)\;$" "\\1" SCHEMA_N ${SCHEMA_STATEMENT} )
string(TOUPPER ${SCHEMA_N} SCHEMA_LONG_NAME) #fedex_plus always uses upper case for file names
get_filename_component(SCHEMA_SHORT_NAME ${SCHEMA_FILE} NAME_WE)
get_filename_component( SCHEMA_SN ${SCHEMA_FILE} NAME )
string( REGEX REPLACE "\(.*\).[Ee][Xx][Pp]" "\\1" SCHEMA_SHORT_NAME ${SCHEMA_SN} )
project( sdai_${SCHEMA_SHORT_NAME} )
message( STATUS "Generating code for ${SCHEMA_SHORT_NAME}.")
@@ -87,7 +53,7 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
# seems to be set_target_properties( <target> PROPERTIES COMPILE_FLAGS <flags> )
set( ${PROJECT_NAME}_COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR} -I${SCL_SOURCE_DIR}/src/cldai -I${SCL_SOURCE_DIR}/src/cleditor -I${SCL_SOURCE_DIR}/src/clutils -I${SCHEMA_OUTPUT_DIR} -I${SCL_SOURCE_DIR}/src/clstepcore" )
add_custom_target( generate_${SCHEMA_SHORT_NAME} SOURCES ${FEDEX_OUT} )
add_custom_target( generate_cpp_${SCHEMA_SHORT_NAME} SOURCES ${FEDEX_OUT} )
add_custom_command( OUTPUT ${SCHEMA_OUTPUT_DIR}
COMMAND cmake ARGS -E make_directory ${SCHEMA_OUTPUT_DIR}
COMMENT "Creating ${SCHEMA_OUTPUT_DIR} for schema ${SCHEMA_SHORT_NAME}")
@@ -97,29 +63,45 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
WORKING_DIRECTORY ${SCHEMA_OUTPUT_DIR}
COMMENT "Running fedex_plus for ${SCHEMA_SHORT_NAME}..."
VERBATIM )
if(MSVC OR BORLAND)
add_definitions( -DSCL_SCHEMA_DLL_EXPORTS )
add_definitions( -DSCL_EXPRESS_DLL_IMPORTS )
add_definitions( -DSCL_UTILS_DLL_IMPORTS )
add_definitions( -DSCL_DAI_DLL_IMPORTS )
add_definitions( -DSCL_CORE_DLL_IMPORTS )
add_definitions( -DSCL_EDITOR_DLL_IMPORTS )
endif()
add_library( ${PROJECT_NAME} SHARED ${FEDEX_OUT} )
target_link_libraries(${PROJECT_NAME} stepdai stepcore express stepeditor )
add_dependencies( ${PROJECT_NAME} generate_${SCHEMA_SHORT_NAME} )
target_link_libraries(${PROJECT_NAME} stepdai stepcore express stepeditor steputils )
add_dependencies( ${PROJECT_NAME} generate_cpp_${SCHEMA_SHORT_NAME} )
set_target_properties( ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS
${${PROJECT_NAME}_COMPILE_FLAGS} )
if(APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
endif(APPLE)
TESTABLE_TARGET( ${PROJECT_NAME} )
add_test( NAME generate_${SCHEMA_SHORT_NAME}
add_test( NAME generate_cpp_${SCHEMA_SHORT_NAME}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} --build .
--target generate_${SCHEMA_SHORT_NAME}
--target generate_cpp_${SCHEMA_SHORT_NAME}
--config $<CONFIGURATION> )
add_test( NAME build_${PROJECT_NAME}
add_test( NAME build_cpp_${PROJECT_NAME}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} --build .
--target p21read_${PROJECT_NAME}
--config $<CONFIGURATION> )
# label the tests and set dependencies
set_tests_properties( generate_${SCHEMA_SHORT_NAME} PROPERTIES LABELS schema_gen )
set_tests_properties( build_${PROJECT_NAME} PROPERTIES DEPENDS generate_${SCHEMA_SHORT_NAME} LABELS schema_build )
set_tests_properties( generate_cpp_${SCHEMA_SHORT_NAME} PROPERTIES LABELS cpp_schema_gen )
set_tests_properties( build_cpp_${PROJECT_NAME} PROPERTIES DEPENDS generate_cpp_${SCHEMA_SHORT_NAME} LABELS cpp_schema_build )
add_executable( p21read_${PROJECT_NAME} ${SCL_SOURCE_DIR}/src/test/p21read/p21read.cc )
if(MSVC OR BORLAND)
add_executable( p21read_${PROJECT_NAME} ${SCL_SOURCE_DIR}/src/test/p21read/p21read.cc ${SCL_SOURCE_DIR}/src/fedex_plus/xgetopt.cc )
else()
add_executable( p21read_${PROJECT_NAME} ${SCL_SOURCE_DIR}/src/test/p21read/p21read.cc )
endif()
add_dependencies( p21read_${PROJECT_NAME} version_string )
target_link_libraries( p21read_${PROJECT_NAME} ${PROJECT_NAME} )
set_target_properties( p21read_${PROJECT_NAME} PROPERTIES COMPILE_FLAGS
${${PROJECT_NAME}_COMPILE_FLAGS} )
@@ -130,10 +112,10 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
file( GLOB_RECURSE P21_FILES ${SCHEMA_DIR}/*.stp ${SCHEMA_DIR}/*.step ${SCHEMA_DIR}/*.p21 )
foreach( TEST_FILE ${P21_FILES} )
get_filename_component( FNAME ${TEST_FILE} NAME_WE )
add_test( NAME read_write_${SCHEMA_SHORT_NAME}_${FNAME}
add_test( NAME read_write_cpp_${SCHEMA_SHORT_NAME}_${FNAME}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND p21read_${PROJECT_NAME} ${TEST_FILE} )
set_tests_properties( read_write_${SCHEMA_SHORT_NAME}_${FNAME} PROPERTIES DEPENDS build_${PROJECT_NAME} LABELS schema_rw )
set_tests_properties( read_write_cpp_${SCHEMA_SHORT_NAME}_${FNAME} PROPERTIES DEPENDS build_cpp_${PROJECT_NAME} LABELS cpp_schema_rw )
endforeach()
ENDFUNCTION(BUILD_A_SCHEMA)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
@@ -5,7 +5,7 @@
(* The schema is converted from ISO10303 P11-2003 to ISO10303 P11-1994 *)
(* ===================================================================================== *)
SCHEMA Ap210_electronic_assembly_interconnect_and_packaging_design_mim_LF;
SCHEMA wip210_electronic_assembly_interconnect_and_packaging_design_mim_LF;
CONSTANT
@@ -15,7 +15,7 @@ CONSTANT
dummy_gri : geometric_representation_item := representation_item('')||
geometric_representation_item();
schema_prefix : STRING := 'AP210_ELECTRONIC_ASSEMBLY_INTERCONNECT_AND_PACKAGING_DESIGN_MIM_LF.';
schema_prefix : STRING := 'WIP210_ELECTRONIC_ASSEMBLY_INTERCONNECT_AND_PACKAGING_DESIGN_MIM_LF.';
the_empty_maths_tuple : maths_tuple := [];
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+6105
View File
File diff suppressed because it is too large Load Diff
+49 -48
View File
@@ -1,57 +1,58 @@
extern int exppp_nesting_indent; /* default nesting indent */
extern int exppp_continuation_indent; /* default nesting indent for */
#include <scl_export.h>
extern SCL_EXPPP_EXPORT int exppp_nesting_indent; /* default nesting indent */
extern SCL_EXPPP_EXPORT int exppp_continuation_indent; /* default nesting indent for */
/* continuation lines */
extern int exppp_linelength; /* leave some slop for closing */
extern SCL_EXPPP_EXPORT int exppp_linelength; /* leave some slop for closing */
/* parens. \n is not included in */
/* this count either */
extern bool exppp_rmpp; /* if true, create rmpp */
extern bool exppp_alphabetize; /* if true, alphabetize */
extern bool exppp_terse; /* don't describe action to stdout */
extern bool exppp_reference_info; /* if true, add commentary */
extern SCL_EXPPP_EXPORT bool exppp_rmpp; /* if true, create rmpp */
extern SCL_EXPPP_EXPORT bool exppp_alphabetize; /* if true, alphabetize */
extern SCL_EXPPP_EXPORT bool exppp_terse; /* don't describe action to stdout */
extern SCL_EXPPP_EXPORT bool exppp_reference_info; /* if true, add commentary */
/* about where things came from */
extern bool exppp_preserve_comments; /* if true, preserve comments where */
extern SCL_EXPPP_EXPORT bool exppp_preserve_comments; /* if true, preserve comments where */
/* possible */
extern char * exppp_output_filename; /* force output filename */
extern bool exppp_output_filename_reset; /* if true, force output filename */
extern SCL_EXPPP_EXPORT char * exppp_output_filename; /* force output filename */
void EXPRESSout( Express e );
SCL_EXPPP_EXPORT void EXPRESSout( Express e );
void ENTITYout( Entity e );
void EXPRout( Expression expr );
void FUNCout( Function f );
void PROCout( Procedure p );
void RULEout( Rule r );
char * SCHEMAout( Schema s );
void SCHEMAref_out( Schema s );
void STMTout( Statement s );
void TYPEout( Type t );
void TYPEhead_out( Type t );
void TYPEbody_out( Type t );
void WHEREout( Linked_List w );
SCL_EXPPP_EXPORT void ENTITYout( Entity e );
SCL_EXPPP_EXPORT void EXPRout( Expression expr );
SCL_EXPPP_EXPORT void FUNCout( Function f );
SCL_EXPPP_EXPORT void PROCout( Procedure p );
SCL_EXPPP_EXPORT void RULEout( Rule r );
SCL_EXPPP_EXPORT char * SCHEMAout( Schema s );
SCL_EXPPP_EXPORT void SCHEMAref_out( Schema s );
SCL_EXPPP_EXPORT void STMTout( Statement s );
SCL_EXPPP_EXPORT void TYPEout( Type t );
SCL_EXPPP_EXPORT void TYPEhead_out( Type t );
SCL_EXPPP_EXPORT void TYPEbody_out( Type t );
SCL_EXPPP_EXPORT void WHEREout( Linked_List w );
char * REFto_string( Dictionary refdict, Linked_List reflist, char * type, int level );
char * ENTITYto_string( Entity e );
char * SUBTYPEto_string( Expression e );
char * EXPRto_string( Expression expr );
char * FUNCto_string( Function f );
char * PROCto_string( Procedure p );
char * RULEto_string( Rule r );
char * SCHEMAref_to_string( Schema s );
char * STMTto_string( Statement s );
char * TYPEto_string( Type t );
char * TYPEhead_to_string( Type t );
char * TYPEbody_to_string( Type t );
char * WHEREto_string( Linked_List w );
SCL_EXPPP_EXPORT char * REFto_string( Dictionary refdict, Linked_List reflist, char * type, int level );
SCL_EXPPP_EXPORT char * ENTITYto_string( Entity e );
SCL_EXPPP_EXPORT char * SUBTYPEto_string( Expression e );
SCL_EXPPP_EXPORT char * EXPRto_string( Expression expr );
SCL_EXPPP_EXPORT char * FUNCto_string( Function f );
SCL_EXPPP_EXPORT char * PROCto_string( Procedure p );
SCL_EXPPP_EXPORT char * RULEto_string( Rule r );
SCL_EXPPP_EXPORT char * SCHEMAref_to_string( Schema s );
SCL_EXPPP_EXPORT char * STMTto_string( Statement s );
SCL_EXPPP_EXPORT char * TYPEto_string( Type t );
SCL_EXPPP_EXPORT char * TYPEhead_to_string( Type t );
SCL_EXPPP_EXPORT char * TYPEbody_to_string( Type t );
SCL_EXPPP_EXPORT char * WHEREto_string( Linked_List w );
int REFto_buffer( Dictionary refdict, Linked_List reflist, char * type, int level, char * buffer, int length );
int ENTITYto_buffer( Entity e, char * buffer, int length );
int EXPRto_buffer( Expression e, char * buffer, int length );
int FUNCto_buffer( Function e, char * buffer, int length );
int PROCto_buffer( Procedure e, char * buffer, int length );
int RULEto_buffer( Rule e, char * buffer, int length );
int SCHEMAref_to_buffer( Schema s, char * buffer, int length );
int STMTto_buffer( Statement s, char * buffer, int length );
int TYPEto_buffer( Type t, char * buffer, int length );
int TYPEhead_to_buffer( Type t, char * buffer, int length );
int TYPEbody_to_buffer( Type t, char * buffer, int length );
int WHEREto_buffer( Linked_List w, char * buffer, int length );
SCL_EXPPP_EXPORT int REFto_buffer( Dictionary refdict, Linked_List reflist, char * type, int level, char * buffer, int length );
SCL_EXPPP_EXPORT int ENTITYto_buffer( Entity e, char * buffer, int length );
SCL_EXPPP_EXPORT int EXPRto_buffer( Expression e, char * buffer, int length );
SCL_EXPPP_EXPORT int FUNCto_buffer( Function e, char * buffer, int length );
SCL_EXPPP_EXPORT int PROCto_buffer( Procedure e, char * buffer, int length );
SCL_EXPPP_EXPORT int RULEto_buffer( Rule e, char * buffer, int length );
SCL_EXPPP_EXPORT int SCHEMAref_to_buffer( Schema s, char * buffer, int length );
SCL_EXPPP_EXPORT int STMTto_buffer( Statement s, char * buffer, int length );
SCL_EXPPP_EXPORT int TYPEto_buffer( Type t, char * buffer, int length );
SCL_EXPPP_EXPORT int TYPEhead_to_buffer( Type t, char * buffer, int length );
SCL_EXPPP_EXPORT int TYPEbody_to_buffer( Type t, char * buffer, int length );
SCL_EXPPP_EXPORT int WHEREto_buffer( Linked_List w, char * buffer, int length );
+22 -43
View File
@@ -1,10 +1,8 @@
#ifndef ALGORITHM_H
#define ALGORITHM_H
/* $Id: alg.h,v 1.4 1997/01/21 19:17:11 dar Exp $ */
/************************************************************************
** Module: Algorithm
/** **********************************************************************
** Module: Algorithm \file alg.h
** Description: This module implements the Algorithm abstraction. An
** algorithm can be a procedure, a function, or a rule. It consists
** of a name, a return type (for functions and rules), a list of
@@ -69,50 +67,47 @@ typedef struct Where_ * Where;
/* hidden type definitions */
/***************************/
/* each formal tag has one of these structs allocated to it */
/* As each (real) call is resolved, the tag->type is temporarily borrowed */
/** each formal tag has one of these structs allocated to it
* As each (real) call is resolved, the tag->type is temporarily borrowed
*/
struct tag {
char * name;
Type type;
};
/* location of fulltext of algorithm in source file */
/** location of fulltext of algorithm in source file */
struct FullText {
char * filename;
unsigned int start, end;
};
/* 'parameters' are lists of lists of (type) expressions */
/** 'parameters' are lists of lists of (type) expressions */
struct Procedure_ {
int pcount; /* # of parameters */
int tag_count; /* # of different parameter tags */
int pcount; /**< # of parameters */
int tag_count; /**< # of different parameter tags */
Linked_List parameters;
Linked_List body;
struct FullText text;
int builtin; /* builtin if true */
int builtin; /**< builtin if true */
};
struct Function_ {
int pcount; /* # of parameters */
int tag_count; /* # of different parameter/return value tags */
int pcount; /**< # of parameters */
int tag_count; /**< # of different parameter/return value tags */
Linked_List parameters;
Linked_List body;
Type return_type;
struct FullText text;
int builtin; /* builtin if true */
int builtin; /**< builtin if true */
};
struct Rule_ {
Linked_List parameters;
Linked_List body;
struct FullText text;
/*
Linked_List where;
moved to Scope - DEL 22-Jul-1993
*/
};
/* define a where clause */
/** define a where clause */
struct Where_ {
Symbol * label;
Expression expr;
@@ -128,11 +123,11 @@ struct Where_ {
#include "decstart.h"
#endif /* ALGORITHM_C */
GLOBAL struct freelist_head ALG_fl;
GLOBAL struct freelist_head FUNC_fl;
GLOBAL struct freelist_head RULE_fl;
GLOBAL struct freelist_head PROC_fl;
GLOBAL struct freelist_head WHERE_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head ALG_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head FUNC_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head RULE_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head PROC_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head WHERE_fl;
#include "de_end.h"
@@ -175,32 +170,16 @@ GLOBAL struct freelist_head WHERE_fl;
#define FUNCget_return_type(f) ((f)->u.func->return_type)
#define RULEget_where(r) ((r)->where)
#define RULEput_where(r,w) ((r)->where = (w))
/*
#define RULEget_where_clause(r) ((r)->u.rule->where)
*/
#define WHEREget_label(w) ((w)->label)
#define WHEREget_expression(w) ((w)->expr)
#if 0
extern void ALGput_parameters PROTO( ( Algorithm, Linked_List ) );
extern void ALGput_body PROTO( ( Algorithm, Linked_List ) );
extern void FUNCput_return_type PROTO( ( Algorithm, Type ) );
extern void RULEput_where_clause PROTO( ( Algorithm, Linked_List ) );
#endif
/***********************/
/* function prototypes */
/***********************/
extern Scope ALGcreate PROTO( ( char ) );
extern void ALGinitialize PROTO( ( void ) );
extern void ALGput_full_text PROTO( ( Scope, int, int ) );
extern SCL_EXPRESS_EXPORT Scope ALGcreate PROTO( ( char ) );
extern SCL_EXPRESS_EXPORT void ALGinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void ALGput_full_text PROTO( ( Scope, int, int ) );
/********************/
/* inline functions */
/********************/
#if supports_inline_functions || defined(ALGORITHM_C)
#endif /* supports_inline_functions || defined(ALGORITHM_C) */
#endif /* ALGORITHM_H */
+9 -16
View File
@@ -1,7 +1,6 @@
#ifndef BASIC_H
#define BASIC_H
/* $Id: basic.h,v 1.8 1997/10/22 16:06:28 sauderd Exp $ */
/*
* This work was supported by the United States Government, and is
@@ -72,14 +71,19 @@
*
*/
#include <scl_cf.h>
#include <scl_export.h>
#include <stdio.h>
/******************************/
/* type Boolean and constants */
/******************************/
#include <stdbool.h>
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#else
# include <scl_stdbool.h>
#endif
/************************/
/* Generic pointer type */
@@ -107,7 +111,7 @@ typedef int ( *intFuncptr )();
/******************************/
#if !defined(static_inline)
#if !defined(__GNUC__) || defined(__STRICT_ANSI)
#if (!defined(__GNUC__) && !defined(__MSVC__)) || defined(__STRICT_ANSI)
#define static_inline
#undef supports_inline_functions
#else
@@ -132,7 +136,7 @@ typedef int ( *intFuncptr )();
# define PROTO(x) x
# else
# ifdef __CLCC__
# if defined(__CLCC__) || defined(__MSVC__) || defined(__BORLAND__)
# define PROTO(x) x
#else
# define PROTO(x) ()
@@ -141,17 +145,6 @@ typedef int ( *intFuncptr )();
# endif
#endif
/* pacify IBM's c89 */
#if !defined(_POSIX_SOURCE)
#define _POSIX_SOURCE
#endif
/* backward compatibility */
typedef char * String;
#define STRINGequal(x,y) (0 == strcmp((x),(y)))
#endif /* */
+5 -14
View File
@@ -1,10 +1,8 @@
#ifndef CASE_ITEM_H
#define CASE_ITEM_H
/* $Id: caseitem.h,v 1.3 1997/01/21 19:17:11 dar Exp $ */
/************************************************************************
** Module: Case_Item
/** **********************************************************************
** Module: Case_Item \file caseitem.h
** Description: This module implements the Case_Item abstraction. A
** case item represents a single branch in a case statement; it
** thus consists of a list of labels and a statement to execute
@@ -78,7 +76,7 @@ struct Case_Item_ {
#include "decstart.h"
#endif /*CASE_ITEM_C*/
GLOBAL struct freelist_head CASE_IT_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head CASE_IT_fl;
#include "de_end.h"
@@ -96,14 +94,7 @@ GLOBAL struct freelist_head CASE_IT_fl;
#define CASE_IT_new() (struct Case_Item_ *)MEM_new(&CASE_IT_fl)
#define CASE_IT_destroy(x) MEM_destroy(&CASE_IT_fl,(Freelist *)(Generic)x)
extern Case_Item CASE_ITcreate PROTO( ( Linked_List, struct Statement_ * ) );
extern void CASE_ITinitialize PROTO( ( void ) );
/********************/
/* inline functions */
/********************/
#if supports_inline_functions || defined(CASE_ITEM_C)
#endif /* supports_inline_functions || defined(CASE_ITEM_C) */
extern SCL_EXPRESS_EXPORT Case_Item CASE_ITcreate PROTO( ( Linked_List, struct Statement_ * ) );
extern SCL_EXPRESS_EXPORT void CASE_ITinitialize PROTO( ( void ) );
#endif /*CASE_ITEM_H*/
+13 -24
View File
@@ -1,10 +1,8 @@
#ifndef DICTIONARY_H
#define DICTIONARY_H
/* $Id: dict.h,v 1.4 1997/01/21 19:17:11 dar Exp $ */
/************************************************************************
** Module: Dictionary
/** **********************************************************************
** Module: Dictionary \file dict.h
** Description: This module implements the dictionary abstraction. A
** dictionary is a repository for a number of objects, all of which
** can be named using the same function. A dictionary is limited to
@@ -52,7 +50,6 @@
#include "hash.h"
#include "error.h"
#include "dict.h"
/************/
/* typedefs */
@@ -81,8 +78,7 @@ typedef HashEntry DictionaryEntry;
#include "decstart.h"
#endif /*DICTIONARY_C*/
GLOBAL char DICT_type; /* set as a side-effect of DICT lookup routines */
/* to type of object found */
GLOBAL SCL_EXPRESS_EXPORT char DICT_type; /**< set as a side-effect of DICT lookup routines to type of object found */
#include "de_end.h"
@@ -91,12 +87,12 @@ GLOBAL char DICT_type; /* set as a side-effect of DICT lookup routines */
/*******************************/
#define DICTcreate(estimated_max_size) HASHcreate(estimated_max_size)
/* should really can DICTdo_init and rename do_type_init to do_init! */
/** should really can DICTdo_init and rename do_type_init to do_init! */
#define DICTdo_init(dict,de) HASHlistinit((dict),(de))
#define DICTdo_type_init(dict,de,t) HASHlistinit_by_type((dict),(de),(t))
#define DICTdo_end(hash_entry) HASHlistend(hash_entry)
/* modify dictionary entry in-place */
/** modify dictionary entry in-place */
#define DICTchange(e,obj,sym,typ) { \
(e)->data = (obj); \
(e)->symbol = (sym); \
@@ -109,20 +105,13 @@ GLOBAL char DICT_type; /* set as a side-effect of DICT lookup routines */
/* function prototypes */
/***********************/
extern void DICTinitialize PROTO( ( void ) );
extern int DICTdefine PROTO( ( Dictionary, char *, Generic, Symbol *, char ) );
extern int DICT_define PROTO( ( Dictionary, char *, Generic, Symbol *, char ) );
extern void DICTundefine PROTO( ( Dictionary, char * ) );
extern Generic DICTlookup PROTO( ( Dictionary, char * ) );
extern Generic DICTlookup_symbol PROTO( ( Dictionary, char *, Symbol ** ) );
extern Generic DICTdo PROTO( ( DictionaryEntry * ) );
extern void DICTprint PROTO( ( Dictionary ) );
/********************/
/* inline functions */
/********************/
#if supports_inline_functions || defined(DICTIONARY_C)
#endif /*supports_inline_functions || defined(DICTIONARY_C)*/
extern SCL_EXPRESS_EXPORT void DICTinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT int DICTdefine PROTO( ( Dictionary, char *, Generic, Symbol *, char ) );
extern SCL_EXPRESS_EXPORT int DICT_define PROTO( ( Dictionary, char *, Generic, Symbol *, char ) );
extern SCL_EXPRESS_EXPORT void DICTundefine PROTO( ( Dictionary, char * ) );
extern SCL_EXPRESS_EXPORT Generic DICTlookup PROTO( ( Dictionary, char * ) );
extern SCL_EXPRESS_EXPORT Generic DICTlookup_symbol PROTO( ( Dictionary, char *, Symbol ** ) );
extern SCL_EXPRESS_EXPORT Generic DICTdo PROTO( ( DictionaryEntry * ) );
extern SCL_EXPRESS_EXPORT void DICTprint PROTO( ( Dictionary ) );
#endif /*DICTIONARY_H*/
+31 -60
View File
@@ -1,10 +1,8 @@
#ifndef ENTITY_H
#define ENTITY_H
/* $Id: entity.h,v 1.12 1997/01/21 19:17:11 dar Exp $ */
/************************************************************************
** Module: Entity
/** **********************************************************************
** Module: Entity \file entity.h
** Description: This module represents Express entity definitions. An
** entity definition consists of a name, a list of attributes, a
** collection of uniqueness sets, a specification of the entity's
@@ -62,6 +60,7 @@
/* packages used */
/*****************/
#include <scl_export.h>
#include "expbasic.h" /* get basic definitions */
#include "symbol.h"
#include "scope.h"
@@ -85,25 +84,18 @@ typedef struct Scope_ * Entity;
/***************************/
struct Entity_ {
Linked_List supertype_symbols; /* linked list of original symbols*/
/* as generated by parser */
Linked_List supertypes; /* linked list of supertypes (as entities) */
Linked_List subtypes; /* simple list of subtypes */
/* useful for simple lookups */
Expression subtype_expression; /* DAG of subtypes, with complete */
/* information including, OR, AND, and ONEOF */
Linked_List attributes; /* explicit attributes */
int inheritance; /* total number of attributes */
/* inherited from supertypes */
int attribute_count;
Linked_List unique; /* list of identifiers that are unique */
Linked_List instances; /* hook for applications */
int mark; /* usual hack - prevent traversing sub/super */
/* graph twice */
bool abstract;/* is this an abstract supertype? */
Type type; /* type pointing back to ourself */
/* Useful to have when evaluating */
/* expressions involving entities */
Linked_List supertype_symbols; /**< linked list of original symbols as generated by parser */
Linked_List supertypes; /**< linked list of supertypes (as entities) */
Linked_List subtypes; /**< simple list of subtypes useful for simple lookups */
Expression subtype_expression; /**< DAG of subtypes, with complete information including, OR, AND, and ONEOF */
Linked_List attributes; /**< explicit attributes */
int inheritance; /**< total number of attributes inherited from supertypes */
int attribute_count;
Linked_List unique; /**< list of identifiers that are unique */
Linked_List instances; /**< hook for applications */
int mark; /**< usual hack - prevent traversing sub/super graph twice */
bool abstract; /**< is this an abstract supertype? */
Type type; /**< type pointing back to ourself, useful to have when evaluating expressions involving entities */
};
/********************/
@@ -116,9 +108,9 @@ struct Entity_ {
#include "decstart.h"
#endif /* ENTITY_C */
GLOBAL struct freelist_head ENTITY_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head ENTITY_fl;
GLOBAL int ENTITY_MARK INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT int ENTITY_MARK INITIALLY( 0 );
#include "de_end.h"
@@ -157,40 +149,19 @@ GLOBAL int ENTITY_MARK INITIALLY( 0 );
/* function prototypes */
/***********************/
extern struct Scope_ * ENTITYcreate PROTO( ( struct Symbol_ * ) );
extern void ENTITYinitialize PROTO( ( void ) );
extern void ENTITYadd_attribute PROTO( ( struct Scope_ *, struct Variable_ * ) );
extern struct Scope_ * ENTITYcopy PROTO( ( struct Scope_ * ) );
extern Entity ENTITYfind_inherited_entity PROTO( ( struct Scope_ *, char *, int ) );
extern Variable ENTITYfind_inherited_attribute PROTO( ( struct Scope_ *, char *, struct Symbol_ ** ) );
extern Variable ENTITYresolve_attr_ref PROTO( ( Entity, Symbol *, Symbol * ) );
extern bool ENTITYhas_immediate_supertype PROTO( ( Entity, Entity ) );
extern Variable ENTITYget_named_attribute PROTO( ( Entity, char * ) );
extern Linked_List ENTITYget_all_attributes PROTO( ( Entity ) );
extern bool ENTITYhas_supertype PROTO( ( Entity, Entity ) );
extern void ENTITYadd_instance PROTO( ( Entity, Generic ) );
extern int ENTITYget_initial_offset PROTO( ( Entity ) );
extern bool ENTITYdeclares_variable PROTO( ( Entity, struct Variable_ * ) );
#if 0
extern void ENTITYdelete_instance PROTO( ( Entity, Generic ) );
extern bool ENTITYhas_subtype PROTO( ( Entity, Entity ) );
extern Entity ENTITYget_supertype PROTO( ( Entity, String ) );
extern Entity ENTITYget_subtype PROTO( ( Entity, String ) );
extern bool ENTITYhas_immediate_subtype PROTO( ( Entity, Entity ) );
extern Expression ENTITYget_subtype_expression PROTO( ( Entity ) );
extern int ENTITYget_attribute_offset PROTO( ( Entity, Variable ) );
extern int ENTITYget_named_attribute_offset PROTO( ( Entity, String ) );
extern Linked_List ENTITYget_uniqueness_list PROTO( ( Entity ) );
extern Linked_List ENTITYget_constraints PROTO( ( Entity ) );
extern Linked_List ENTITYget_instances PROTO( ( Entity ) );
#endif /*0*/
/********************/
/* inline functions */
/********************/
#if supports_inline_functions || defined(ENTITY_C)
#endif /* supports_inline_functions || defined(ENTITY_C) */
extern SCL_EXPRESS_EXPORT struct Scope_ * ENTITYcreate PROTO( ( struct Symbol_ * ) );
extern SCL_EXPRESS_EXPORT void ENTITYinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void ENTITYadd_attribute PROTO( ( struct Scope_ *, struct Variable_ * ) );
extern SCL_EXPRESS_EXPORT struct Scope_ * ENTITYcopy PROTO( ( struct Scope_ * ) );
extern SCL_EXPRESS_EXPORT Entity ENTITYfind_inherited_entity PROTO( ( struct Scope_ *, char *, int ) );
extern SCL_EXPRESS_EXPORT Variable ENTITYfind_inherited_attribute PROTO( ( struct Scope_ *, char *, struct Symbol_ ** ) );
extern SCL_EXPRESS_EXPORT Variable ENTITYresolve_attr_ref PROTO( ( Entity, Symbol *, Symbol * ) );
extern SCL_EXPRESS_EXPORT bool ENTITYhas_immediate_supertype PROTO( ( Entity, Entity ) );
extern SCL_EXPRESS_EXPORT Variable ENTITYget_named_attribute PROTO( ( Entity, char * ) );
extern SCL_EXPRESS_EXPORT Linked_List ENTITYget_all_attributes PROTO( ( Entity ) );
extern SCL_EXPRESS_EXPORT bool ENTITYhas_supertype PROTO( ( Entity, Entity ) );
extern SCL_EXPRESS_EXPORT void ENTITYadd_instance PROTO( ( Entity, Generic ) );
extern SCL_EXPRESS_EXPORT int ENTITYget_initial_offset PROTO( ( Entity ) );
extern SCL_EXPRESS_EXPORT bool ENTITYdeclares_variable PROTO( ( Entity, struct Variable_ * ) );
#endif /* ENTITY_H */
+56 -59
View File
@@ -1,10 +1,8 @@
#ifndef ERROR_H
#define ERROR_H
/* $Id: error.h,v 1.8 1997/01/21 19:16:55 dar Exp $ */
/************************************************************************
** Module: Error
/** **********************************************************************
** Module: Error \file error.h
** Description: This module implements the ERROR abstraction.
************************************************************************/
@@ -30,8 +28,9 @@
* prettied up interface to print_objects_when_running
*/
#include <scl_export.h>
#include "basic.h" /* get basic definitions */
#include "setjmp.h"
#include <setjmp.h>
/*************/
/* constants */
@@ -88,29 +87,29 @@ typedef struct Error_Warning_ {
#include "decstart.h"
#endif /* ERROR_C */
GLOBAL bool __ERROR_buffer_errors INITIALLY( false );
GLOBAL char * current_filename INITIALLY( "stdin" );
GLOBAL SCL_EXPRESS_EXPORT bool __ERROR_buffer_errors INITIALLY( false );
GLOBAL SCL_EXPRESS_EXPORT char * current_filename INITIALLY( "stdin" );
/* flag to remember whether non-warning errors have occurred */
GLOBAL bool ERRORoccurred INITIALLY( false );
GLOBAL SCL_EXPRESS_EXPORT bool ERRORoccurred INITIALLY( false );
GLOBAL Error experrc INITIALLY( ERROR_none );
GLOBAL Error ERROR_subordinate_failed INITIALLY( ERROR_none );
GLOBAL Error ERROR_syntax_expecting INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error experrc INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_subordinate_failed INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_syntax_expecting INITIALLY( ERROR_none );
/* all of these are 1 if true, 0 if false switches */
/* for debugging fedex */
GLOBAL int ERRORdebugging INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT int ERRORdebugging INITIALLY( 0 );
/* for debugging malloc during resolution */
GLOBAL int malloc_debug_resolve INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT int malloc_debug_resolve INITIALLY( 0 );
/* for debugging yacc/lex */
GLOBAL int debug INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT int debug INITIALLY( 0 );
GLOBAL struct Linked_List_ * ERRORwarnings;
GLOBAL struct freelist_head ERROR_OPT_fl;
GLOBAL SCL_EXPRESS_EXPORT struct Linked_List_ * ERRORwarnings;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head ERROR_OPT_fl;
GLOBAL void ( *ERRORusage_function ) PROTO( ( void ) );
GLOBAL SCL_EXPRESS_EXPORT void ( *ERRORusage_function ) PROTO( ( void ) );
#include "de_end.h"
@@ -121,6 +120,14 @@ GLOBAL void ( *ERRORusage_function ) PROTO( ( void ) );
#define ERROR_OPT_new() (struct Error_Warning_ *)MEM_new(&ERROR_OPT_fl)
#define ERROR_OPT_destroy(x) MEM_destroy(&ERROR_OPT_fl,(Freelist *)(Generic)x)
/***********************/
/* function prototypes */
/***********************/
#if defined(__MSVC__) || defined(__BORLAND__)
extern SCL_EXPRESS_EXPORT void ERROR_start_message_buffer PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void ERROR_flush_message_buffer PROTO( ( void ) );
#endif
/********************/
/* Inline functions */
@@ -128,34 +135,27 @@ GLOBAL void ( *ERRORusage_function ) PROTO( ( void ) );
#if supports_inline_functions || defined(ERROR_C)
static_inline
void
ERRORdisable( Error error ) {
static_inline void ERRORdisable( Error error ) {
if( error != ERROR_none ) {
error->enabled = false;
}
}
static_inline
void
ERRORenable( Error error ) {
static_inline void ERRORenable( Error error ) {
if( error != ERROR_none ) {
error->enabled = true;
}
}
static_inline
bool
ERRORis_enabled( Error error ) {
static_inline bool ERRORis_enabled( Error error ) {
return error->enabled;
}
static_inline
void
ERRORbuffer_messages( bool flag ) {
static_inline void ERRORbuffer_messages( bool flag ) {
#if !defined(__MSVC__) && !defined(__BORLAND__)
extern void ERROR_start_message_buffer( void ),
ERROR_flush_message_buffer( void );
#endif
__ERROR_buffer_errors = flag;
if( __ERROR_buffer_errors ) {
ERROR_start_message_buffer();
@@ -164,11 +164,11 @@ ERRORbuffer_messages( bool flag ) {
}
}
static_inline
void
ERRORflush_messages( void ) {
static_inline void ERRORflush_messages( void ) {
#if !defined(__MSVC__) && !defined(__BORLAND__)
extern void ERROR_start_message_buffer( void ),
ERROR_flush_message_buffer( void );
#endif
if( __ERROR_buffer_errors ) {
ERROR_flush_message_buffer();
@@ -182,33 +182,30 @@ ERRORflush_messages( void ) {
/* function prototypes */
/***********************/
extern void ERRORinitialize PROTO( ( void ) );
extern void ERRORinitialize_after_LIST PROTO( ( void ) );
extern void ERRORnospace PROTO( ( void ) );
extern void ERRORabort PROTO( ( int ) );
extern Error ERRORcreate PROTO( ( char *, Severity ) );
extern void ERRORreport PROTO( ( Error, ... ) );
/*SUPPRESS 652*/ /* 1.? */
/*SUPPRESS 842*/ /* 4.0.2 */
extern SCL_EXPRESS_EXPORT void ERRORinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void ERRORinitialize_after_LIST PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void ERRORnospace PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void ERRORabort PROTO( ( int ) );
extern SCL_EXPRESS_EXPORT Error ERRORcreate PROTO( ( char *, Severity ) );
extern SCL_EXPRESS_EXPORT void ERRORreport PROTO( ( Error, ... ) );
struct Symbol_; /* mention Symbol to avoid warning on following line */
extern void ERRORreport_with_symbol PROTO( ( Error, struct Symbol_ *, ... ) );
extern void ERRORreport_with_line PROTO( ( Error, int, ... ) );
extern void ERRORbuffer_messages PROTO( ( bool ) );
extern void ERRORflush_messages PROTO( ( void ) );
extern void ERROR_start_message_buffer PROTO( ( void ) );
extern void ERROR_flush_message_buffer PROTO( ( void ) );
extern void ERRORcreate_warning PROTO( ( char *, Error ) );
extern void ERRORset_warning PROTO( ( char *, int ) );
extern void ERRORset_all_warnings PROTO( ( int ) );
extern void ERRORsafe PROTO( ( jmp_buf env ) );
extern void ERRORunsafe PROTO( ( void ) );
#if deprecated
extern void ERRORdisable PROTO( ( Error ) );
extern void ERRORenable PROTO( ( Error ) );
extern Boolean ERRORis_enabled PROTO( ( Error ) );
extern SCL_EXPRESS_EXPORT void ERRORreport_with_symbol PROTO( ( Error, struct Symbol_ *, ... ) );
extern SCL_EXPRESS_EXPORT void ERRORreport_with_line PROTO( ( Error, int, ... ) );
#if !supports_inline_functions
extern SCL_EXPRESS_EXPORT void ERRORbuffer_messages PROTO( ( bool ) );
extern SCL_EXPRESS_EXPORT void ERRORflush_messages PROTO( ( void ) );
#endif
#if !defined(__MSVC__) && !defined(__BORLAND__)
extern SCL_EXPRESS_EXPORT void ERROR_start_message_buffer PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void ERROR_flush_message_buffer PROTO( ( void ) );
#endif
extern SCL_EXPRESS_EXPORT void ERRORcreate_warning PROTO( ( char *, Error ) );
extern SCL_EXPRESS_EXPORT void ERRORset_warning PROTO( ( char *, int ) );
extern SCL_EXPRESS_EXPORT void ERRORset_all_warnings PROTO( ( int ) );
extern SCL_EXPRESS_EXPORT void ERRORsafe PROTO( ( jmp_buf env ) );
extern SCL_EXPRESS_EXPORT void ERRORunsafe PROTO( ( void ) );
#endif /* ERROR_H */
+29 -33
View File
@@ -1,4 +1,3 @@
/* $Id: expbasic.h,v 1.7 1997/01/21 19:17:11 dar Exp $ */
/*
* This software was developed by U.S. Government employees as part of
@@ -72,84 +71,81 @@ typedef char * Binary;
#define UNRESOLVED 0x0
#define RESOLVED 0x1
#define RESOLVE_FAILED 0x2
#define RESOLVE_IN_PROGRESS 0x4 /* only if actively being resolved */
/* not if it's just between passes */
#define RESOLVE_IN_PROGRESS 0x4 /**< only if actively being resolved not if it's just between passes */
/* used during rename resolution to catch recursive USE/REFs */
/** used during rename resolution to catch recursive USE/REFs */
#define is_resolve_in_progress_raw(x) ((x)->resolved & RESOLVE_IN_PROGRESS)
#define resolve_in_progress_raw(x) (x)->resolved |= RESOLVE_IN_PROGRESS
#define resolve_not_in_progress_raw(x) (x)->resolved &= ~RESOLVE_IN_PROGRESS
/* and type resolution to catch recursive types (A = B and B = A) */
/** and type resolution to catch recursive types (A = B and B = A) */
#define resolve_in_progress(x) (x)->symbol.resolved |= RESOLVE_IN_PROGRESS
/* test/set whether anything has failed resolution */
/** test/set whether anything has failed resolution */
#define is_resolve_failed(x) ((x)->symbol.resolved & RESOLVE_FAILED)
#define is_resolve_failed_raw(x) ((x)->resolved & RESOLVE_FAILED)
#define resolve_failed(x) (x)->symbol.resolved |= RESOLVE_FAILED
#define resolve_failed_raw(x) (x)->resolved |= RESOLVE_FAILED
/* test/set whether anything has succeeded resolution */
/** test/set whether anything has succeeded resolution */
#define is_resolved(x) ((x)->symbol.resolved & RESOLVED)
/* test possibility of future resolution */
/** test possibility of future resolution */
#define is_resolvable(x) (!is_not_resolvable(x))
#define is_not_resolvable(x) ((x)->symbol.resolved & (RESOLVE_FAILED|RESOLVED|RESOLVE_IN_PROGRESS))
/* mark something resolved */
/** mark something resolved */
#define resolved_all(x) x->symbol.resolved = RESOLVED
/* define the object types that can appear in a symbol table */
/* basically anything that is usefully named, but that cannot be */
/* differentiated from another type when handed a generic pointer */
/* Entity, schema and alg can be differentiated but it is just very */
/* useful to be able to differentiate this way. */
#define OBJ_ANY '*' /* Matches anything - special to DICT funcs */
#define OBJ_EXPRESS '!' /* I can't figure out the mnemonic either! */
/** define the object types that can appear in a symbol table
* basically anything that is usefully named, but that cannot be
* differentiated from another type when handed a generic pointer
* Entity, schema and alg can be differentiated but it is just very
* useful to be able to differentiate this way. */
#define OBJ_ANY '*' /**< Matches anything - special to DICT funcs */
#define OBJ_EXPRESS '!' /**< I can't figure out the mnemonic either! */
#define OBJ_PASS '#'
/* The following are all odd-ball scopes, that aren't ever looked up by */
/* type - but the data structures might as well be descriptive */
/** The following are all odd-ball scopes, that aren't ever looked up by
* type - but the data structures might as well be descriptive */
#define OBJ_INCREMENT '+'
#define OBJ_ALIAS 'a'
#define OBJ_QUERY 'q' /* isn't even stored anywhere! */
#define OBJ_QUERY 'q' /**< isn't even stored anywhere! */
#define OBJ_PROCEDURE 'p'
#define OBJ_RENAME 'n'
#define OBJ_RULE 'r'
#define OBJ_FUNCTION 'f'
#define OBJ_TAG 'g' /* a type, but only when used as a type tag */
#define OBJ_TAG 'g' /**< a type, but only when used as a type tag */
#define OBJ_ENTITY 'e'
#define OBJ_SCHEMA 's'
#define OBJ_TYPE 't'
#define OBJ_UNKNOWN 'u' /*things that won't ever be looked up by type*/
#define OBJ_UNKNOWN 'u' /**< things that won't ever be looked up by type*/
#define OBJ_VARIABLE 'v'
#define OBJ_WHERE 'w'
#define OBJ_EXPRESSION 'x' /* so far only enums get looked up by name & */
#define OBJ_ENUM 'x' /* appear this way, perhaps they should be */
/* variables? */
#define OBJ_AMBIG_ENUM 'z' /* enumerations of the same name which are */
/* visible in the same scope when qualified */
/* z is of no mnemonic significance (so far) */
#define OBJ_EXPRESSION 'x' /**< so far only enums get looked up by name & */
#define OBJ_ENUM 'x' /**< appear this way, perhaps they should be variables? */
#define OBJ_AMBIG_ENUM 'z' /**< enumerations of the same name which are
* visible in the same scope when qualified
* z is of no mnemonic significance (so far) */
#define IS_ENUM(x) (((x) == OBJ_ENUM) || ((x) == OBJ_AMBIG_ENUM))
/* these represent a different way of selecting classes of objects */
/* these are particularly useful when looking for multiple types concurrently */
/** these represent a different way of selecting classes of objects
* these are particularly useful when looking for multiple types concurrently */
#define OBJ_TYPE_BITS 0x1
#define OBJ_ENTITY_BITS 0x2
#define OBJ_FUNCTION_BITS 0x4
#define OBJ_PROCEDURE_BITS 0x8
#define OBJ_PASS_BITS 0x10 /* i.e., EXPRESSpass */
#define OBJ_PASS_BITS 0x10 /**< i.e., EXPRESSpass */
#define OBJ_RULE_BITS 0x20
#define OBJ_EXPRESSION_BITS 0x40 /* as above, only used for */
/* finding enums */
#define OBJ_EXPRESSION_BITS 0x40 /**< as above, only used for finding enums */
#define OBJ_SCHEMA_BITS 0x80
#define OBJ_VARIABLE_BITS 0x100
#define OBJ_WHERE_BITS 0x200
#define OBJ_ANYTHING_BITS 0x0fffffff
#define OBJ_UNFINDABLE_BITS 0x10000000 /* should never be found */
#define OBJ_UNFINDABLE_BITS 0x10000000 /**< should never be found */
#define OBJ_ALGORITHM_BITS (OBJ_FUNCTION_BITS | OBJ_PROCEDURE_BITS | \
OBJ_RULE_BITS)
#define OBJ_SCOPE_BITS (OBJ_ALGORITHM_BITS | OBJ_ENTITY_BITS | \
+50 -57
View File
@@ -1,10 +1,8 @@
#ifndef EXPRESSION_H
#define EXPRESSION_H
/* $Id: expr.h,v 1.4 1997/01/21 19:17:11 dar Exp $ */
/************************************************************************
** Module: Expression
/** **********************************************************************
** Module: Expression \file expr.h
** Description: This module implements the Expression abstraction.
** Several types of expressions are supported: identifiers,
** literals, operations (arithmetic, logical, array indexing,
@@ -62,6 +60,7 @@
/* packages used */
/*****************/
#include <scl_export.h>
#include <math.h>
#include "expbasic.h" /* get basic definitions */
@@ -85,7 +84,7 @@ typedef enum {
OP_NOT, OP_NOT_EQUAL, OP_OR,
OP_PLUS, OP_REAL_DIV, OP_SUBCOMPONENT,
OP_TIMES, OP_XOR, OP_UNKNOWN,
OP_LAST /* must be last - used only to size tables */
OP_LAST /**< must be last - used only to size tables */
} Op_Code;
typedef struct Qualified_Attr Qualified_Attr;
@@ -117,7 +116,7 @@ typedef Literal Aggregate_Literal, Integer_Literal,
/* expression types */
struct Qualified_Attr {
struct Expression_ * complex; /* complex entity instance */
struct Expression_ * complex; /**< complex entity instance */
Symbol * entity;
Symbol * attribute;
};
@@ -131,22 +130,20 @@ struct Op_Subexpression {
struct Query_ {
Variable local;
Expression aggregate; /* set from which to test */
Expression expression; /* logical expression */
Expression aggregate; /**< set from which to test */
Expression expression; /**< logical expression */
struct Scope_ * scope;
};
struct Funcall {
struct Scope_ * function; /* can also be an entity because entities */
/* can be called as functions */
struct Scope_ * function; /**< can also be an entity because entities can be called as functions */
Linked_List list;
};
union expr_union {
int integer;
float real;
/* char *string; find string name in symbol in Expression */
char * attribute; /* inverse .... for 'attr' */
char * attribute; /**< inverse .... for 'attr' */
char * binary;
int logical;
bool boolean;
@@ -156,35 +153,31 @@ union expr_union {
/* if etype == aggregate, list of expressions */
/* if etype == funcall, 1st element of list is funcall or entity */
/* remaining elements are parameters */
Linked_List list; /* aggregates (bags, lists, sets, arrays) */
/* or lists for oneof expressions */
Expression expression; /* derived value in derive attrs, or*/
/* initializer in local vars, or */
/* enumeration tags */
/* or oneof value */
struct Scope_ * entity; /* used by subtype exp, group expr */
/* and self expr, some funcall's and any */
/* expr that results in an entity */
Variable variable; /* attribute reference */
Linked_List list; /**< aggregates (bags, lists, sets, arrays) or lists for oneof expressions */
Expression expression; /**< derived value in derive attrs, or
* initializer in local vars, or
* enumeration tags
* or oneof value */
struct Scope_ * entity; /**< used by subtype exp, group expr
* and self expr, some funcall's and any
* expr that results in an entity */
Variable variable; /**< attribute reference */
};
/** The difference between 'type' and 'return_type' is illustrated
* by "func(a)". Here, 'type' is Type_Function while 'return_type'
* might be Type_Integer (assuming func returns an integer). */
struct Expression_ {
Symbol symbol; /* contains things like funcall names */
/* string names, binary values, */
/* enumeration names */
Symbol symbol; /**< contains things like funcall names, string names, binary values, enumeration names */
Type type;
Type return_type; /* type of value returned by expression */
/* The difference between 'type' and 'return_type' is */
/* illustrated by "func(a)". Here, 'type' is Type_Function */
/* while 'return_type' might be Type_Integer (assuming func */
/* returns an integer). */
Type return_type; /**< type of value returned by expression */
struct Op_Subexpression e;
union expr_union u;
};
/* indexed by the op enumeration values */
/** indexed by the op enumeration values */
struct EXPop_entry {
char * token; /* literal token, e.g., "<>" */
char * token; /**< literal token, e.g., "<>" */
Type( *resolve ) PROTO( ( Expression, struct Scope_ * ) );
};
@@ -198,23 +191,23 @@ struct EXPop_entry {
#include "decstart.h"
#endif /*EXPRESSION_C*/
GLOBAL struct EXPop_entry EXPop_table[OP_LAST];
GLOBAL SCL_EXPRESS_EXPORT struct EXPop_entry EXPop_table[OP_LAST];
GLOBAL Expression LITERAL_E INITIALLY( EXPRESSION_NULL );
GLOBAL Expression LITERAL_INFINITY INITIALLY( EXPRESSION_NULL );
GLOBAL Expression LITERAL_PI INITIALLY( EXPRESSION_NULL );
GLOBAL Expression LITERAL_ZERO INITIALLY( EXPRESSION_NULL );
GLOBAL Expression LITERAL_ONE;
GLOBAL SCL_EXPRESS_EXPORT Expression LITERAL_E INITIALLY( EXPRESSION_NULL );
GLOBAL SCL_EXPRESS_EXPORT Expression LITERAL_INFINITY INITIALLY( EXPRESSION_NULL );
GLOBAL SCL_EXPRESS_EXPORT Expression LITERAL_PI INITIALLY( EXPRESSION_NULL );
GLOBAL SCL_EXPRESS_EXPORT Expression LITERAL_ZERO INITIALLY( EXPRESSION_NULL );
GLOBAL SCL_EXPRESS_EXPORT Expression LITERAL_ONE;
GLOBAL Error ERROR_bad_qualification INITIALLY( ERROR_none );
GLOBAL Error ERROR_integer_expression_expected INITIALLY( ERROR_none );
GLOBAL Error ERROR_implicit_downcast INITIALLY( ERROR_none );
GLOBAL Error ERROR_ambig_implicit_downcast INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_bad_qualification INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_integer_expression_expected INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_implicit_downcast INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_ambig_implicit_downcast INITIALLY( ERROR_none );
GLOBAL struct freelist_head EXP_fl;
GLOBAL struct freelist_head OP_fl;
GLOBAL struct freelist_head QUERY_fl;
GLOBAL struct freelist_head QUAL_ATTR_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head EXP_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head OP_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head QUERY_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head QUAL_ATTR_fl;
#include "de_end.h"
@@ -244,7 +237,7 @@ GLOBAL struct freelist_head QUAL_ATTR_fl;
#define FCALLget_parameters(e) ((e)->u.funcall.list)
#define FCALLput_function(expr,func) ((e)->u.funcall.function = (func))
#define FCALLget_function(e) ((e)->u.funcall.function)
/* assumes the function is not an entity-function! */
/** assumes the function is not an entity-function! */
#define FCALLget_algorithm(e) ((e)->u.funcall.function->u.function->body)
#define INT_LITget_value(e) ((e)->u.integer)
@@ -269,16 +262,16 @@ GLOBAL struct freelist_head QUAL_ATTR_fl;
/* function prototypes */
/***********************/
extern Expression EXPcreate PROTO( ( Type ) );
extern Expression EXPcreate_simple PROTO( ( Type ) );
extern Expression EXPcreate_from_symbol PROTO( ( Type, Symbol * ) );
extern Expression UN_EXPcreate PROTO( ( Op_Code, Expression ) );
extern Expression BIN_EXPcreate PROTO( ( Op_Code, Expression, Expression ) );
extern Expression TERN_EXPcreate PROTO( ( Op_Code, Expression, Expression, Expression ) );
extern Expression QUERYcreate PROTO( ( Symbol *, Expression ) );
extern void EXPinitialize PROTO( ( void ) );
extern Type EXPtype PROTO( ( Expression, struct Scope_ * ) );
extern int EXPget_integer_value PROTO( ( Expression ) );
extern SCL_EXPRESS_EXPORT Expression EXPcreate PROTO( ( Type ) );
extern SCL_EXPRESS_EXPORT Expression EXPcreate_simple PROTO( ( Type ) );
extern SCL_EXPRESS_EXPORT Expression EXPcreate_from_symbol PROTO( ( Type, Symbol * ) );
extern SCL_EXPRESS_EXPORT Expression UN_EXPcreate PROTO( ( Op_Code, Expression ) );
extern SCL_EXPRESS_EXPORT Expression BIN_EXPcreate PROTO( ( Op_Code, Expression, Expression ) );
extern SCL_EXPRESS_EXPORT Expression TERN_EXPcreate PROTO( ( Op_Code, Expression, Expression, Expression ) );
extern SCL_EXPRESS_EXPORT Expression QUERYcreate PROTO( ( Symbol *, Expression ) );
extern SCL_EXPRESS_EXPORT void EXPinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT Type EXPtype PROTO( ( Expression, struct Scope_ * ) );
extern SCL_EXPRESS_EXPORT int EXPget_integer_value PROTO( ( Expression ) );
/********************/
/* inline functions */
+156 -161
View File
@@ -1,8 +1,6 @@
#ifndef EXPRESS_H
#define EXPRESS_H
/* $Id: express.h,v 1.13 1997/01/21 19:16:42 dar Exp $ */
/*
* Express package manager.
*
@@ -83,7 +81,7 @@ typedef struct Scope_ * Express;
struct Express_ {
FILE * file;
char * filename;
char * basename; /* name of file but without directory or .exp suffix */
char * basename; /**< name of file but without directory or .exp suffix */
};
/********************/
@@ -98,150 +96,158 @@ struct Express_ {
# define INITIALLY(value)
#endif /*EXPRESS_C*/
GLOBAL Linked_List EXPRESS_path;
GLOBAL int EXPRESSpass;
#ifdef YYDEBUG
extern SCL_EXPRESS_EXPORT int yydebug;
extern SCL_EXPRESS_EXPORT int yydbg_upper_limit;
extern SCL_EXPRESS_EXPORT int yydbg_lower_limit;
extern SCL_EXPRESS_EXPORT int yydbg_verbose;
#endif
GLOBAL void ( *EXPRESSinit_args ) PROTO( ( int, char ** ) ) INITIALLY( 0 );
GLOBAL void ( *EXPRESSinit_parse ) PROTO( ( void ) ) INITIALLY( 0 );
GLOBAL int ( *EXPRESSfail ) PROTO( ( Express ) ) INITIALLY( 0 );
GLOBAL int ( *EXPRESSsucceed ) PROTO( ( Express ) ) INITIALLY( 0 );
GLOBAL void ( *EXPRESSbackend ) PROTO( ( Express ) ) INITIALLY( 0 );
GLOBAL char * EXPRESSprogram_name;
extern char EXPRESSgetopt_options[]; /* initialized elsewhere */
GLOBAL int ( *EXPRESSgetopt ) PROTO( ( int, char * ) ) INITIALLY( 0 );
GLOBAL bool EXPRESSignore_duplicate_schemas INITIALLY( false );
GLOBAL SCL_EXPRESS_EXPORT Linked_List EXPRESS_path;
GLOBAL SCL_EXPRESS_EXPORT int EXPRESSpass;
GLOBAL Dictionary EXPRESSbuiltins; /* procedures/functions */
GLOBAL SCL_EXPRESS_EXPORT void ( *EXPRESSinit_args ) PROTO( ( int, char ** ) ) INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT void ( *EXPRESSinit_parse ) PROTO( ( void ) ) INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT int ( *EXPRESSfail ) PROTO( ( Express ) ) INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT int ( *EXPRESSsucceed ) PROTO( ( Express ) ) INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT void ( *EXPRESSbackend ) PROTO( ( Express ) ) INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT char * EXPRESSprogram_name;
extern char EXPRESSgetopt_options[256]; /**< initialized elsewhere */
GLOBAL SCL_EXPRESS_EXPORT int ( *EXPRESSgetopt ) PROTO( ( int, char * ) ) INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT bool EXPRESSignore_duplicate_schemas INITIALLY( false );
GLOBAL Error ERROR_bail_out INITIALLY( ERROR_none );
GLOBAL Error ERROR_syntax INITIALLY( ERROR_none );
GLOBAL Error ERROR_unlabelled_param_type INITIALLY( ERROR_none );
GLOBAL Error ERROR_file_unreadable;
GLOBAL Error ERROR_file_unwriteable;
GLOBAL SCL_EXPRESS_EXPORT Dictionary EXPRESSbuiltins; /**< procedures/functions */
GLOBAL struct Scope_ * FUNC_NVL;
GLOBAL struct Scope_ * FUNC_USEDIN;
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_bail_out INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_syntax INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unlabelled_param_type INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_file_unreadable;
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_file_unwriteable;
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_warn_unsupported_lang_feat;
GLOBAL char * KW_ABS INITIALLY( "ABS" );
GLOBAL char * KW_ABSTRACT INITIALLY( "ABSTRACT" );
GLOBAL char * KW_ACOS INITIALLY( "ACOS" );
GLOBAL char * KW_AGGREGATE INITIALLY( "AGGREGATE" );
GLOBAL char * KW_ALIAS INITIALLY( "ALIAS" );
GLOBAL char * KW_AND INITIALLY( "AND" );
GLOBAL char * KW_ANDOR INITIALLY( "ANDOR" );
GLOBAL char * KW_ARRAY INITIALLY( "ARRAY" );
GLOBAL char * KW_AS INITIALLY( "AS" );
GLOBAL char * KW_ASIN INITIALLY( "ASIN" );
GLOBAL char * KW_ATAN INITIALLY( "ATAN" );
GLOBAL char * KW_BAG INITIALLY( "BAG" );
GLOBAL char * KW_BEGIN INITIALLY( "BEGIN" );
GLOBAL char * KW_BINARY INITIALLY( "BINARY" );
GLOBAL char * KW_BLENGTH INITIALLY( "BLENGTH" );
GLOBAL char * KW_BOOLEAN INITIALLY( "BOOLEAN" );
GLOBAL char * KW_BY INITIALLY( "BY" );
GLOBAL char * KW_CASE INITIALLY( "CASE" );
GLOBAL char * KW_CONST_E INITIALLY( "CONST_E" );
GLOBAL char * KW_CONSTANT INITIALLY( "CONSTANT" );
GLOBAL char * KW_CONTEXT INITIALLY( "CONTEXT" );
GLOBAL char * KW_COS INITIALLY( "COS" );
GLOBAL char * KW_DERIVE INITIALLY( "DERIVE" );
GLOBAL char * KW_DIV INITIALLY( "DIV" );
GLOBAL char * KW_ELSE INITIALLY( "ELSE" );
GLOBAL char * KW_END INITIALLY( "END" );
GLOBAL char * KW_END_ALIAS INITIALLY( "END_ALIAS" );
GLOBAL char * KW_END_CASE INITIALLY( "END_CASE" );
GLOBAL char * KW_END_CONSTANT INITIALLY( "END_CONSTANT" );
GLOBAL char * KW_END_CONTEXT INITIALLY( "END_CONTEXT" );
GLOBAL char * KW_END_ENTITY INITIALLY( "END_ENTITY" );
GLOBAL char * KW_END_FUNCTION INITIALLY( "END_FUNCTION" );
GLOBAL char * KW_END_IF INITIALLY( "END_IF" );
GLOBAL char * KW_END_LOCAL INITIALLY( "END_LOCAL" );
GLOBAL char * KW_END_MODEL INITIALLY( "END_MODEL" );
GLOBAL char * KW_END_PROCEDURE INITIALLY( "END_PROCEDURE" );
GLOBAL char * KW_END_REPEAT INITIALLY( "END_REPEAT" );
GLOBAL char * KW_END_RULE INITIALLY( "END_RULE" );
GLOBAL char * KW_END_SCHEMA INITIALLY( "END_SCHEMA" );
GLOBAL char * KW_END_TYPE INITIALLY( "END_TYPE" );
GLOBAL char * KW_ENTITY INITIALLY( "ENTITY" );
GLOBAL char * KW_ENUMERATION INITIALLY( "ENUMERATION" );
GLOBAL char * KW_ESCAPE INITIALLY( "ESCAPE" );
GLOBAL char * KW_EXISTS INITIALLY( "EXISTS" );
GLOBAL char * KW_EXP INITIALLY( "EXP" );
GLOBAL char * KW_FALSE INITIALLY( "FALSE" );
GLOBAL char * KW_FIXED INITIALLY( "FIXED" );
GLOBAL char * KW_FOR INITIALLY( "FOR" );
GLOBAL char * KW_FORMAT INITIALLY( "FORMAT" );
GLOBAL char * KW_FROM INITIALLY( "FROM" );
GLOBAL char * KW_FUNCTION INITIALLY( "FUNCTION" );
GLOBAL char * KW_GENERIC INITIALLY( "GENERIC" );
GLOBAL char * KW_HIBOUND INITIALLY( "HIBOUND" );
GLOBAL char * KW_HIINDEX INITIALLY( "HIINDEX" );
GLOBAL char * KW_IF INITIALLY( "IF" );
GLOBAL char * KW_IN INITIALLY( "IN" );
GLOBAL char * KW_INCLUDE INITIALLY( "INCLUDE" );
GLOBAL char * KW_INSERT INITIALLY( "INSERT" );
GLOBAL char * KW_INTEGER INITIALLY( "INTEGER" );
GLOBAL char * KW_INVERSE INITIALLY( "INVERSE" );
GLOBAL char * KW_LENGTH INITIALLY( "LENGTH" );
GLOBAL char * KW_LIKE INITIALLY( "LIKE" );
GLOBAL char * KW_LIST INITIALLY( "LIST" );
GLOBAL char * KW_LOBOUND INITIALLY( "LOBOUND" );
GLOBAL char * KW_LOCAL INITIALLY( "LOCAL" );
GLOBAL char * KW_LOG INITIALLY( "LOG" );
GLOBAL char * KW_LOG10 INITIALLY( "LOG10" );
GLOBAL char * KW_LOG2 INITIALLY( "LOG2" );
GLOBAL char * KW_LOGICAL INITIALLY( "LOGICAL" );
GLOBAL char * KW_LOINDEX INITIALLY( "LOINDEX" );
GLOBAL char * KW_MOD INITIALLY( "MOD" );
GLOBAL char * KW_MODEL INITIALLY( "MODEL" );
GLOBAL char * KW_NOT INITIALLY( "NOT" );
GLOBAL char * KW_NUMBER INITIALLY( "NUMBER" );
GLOBAL char * KW_NVL INITIALLY( "NVL" );
GLOBAL char * KW_ODD INITIALLY( "ODD" );
GLOBAL char * KW_OF INITIALLY( "OF" );
GLOBAL char * KW_ONEOF INITIALLY( "ONEOF" );
GLOBAL char * KW_OPTIONAL INITIALLY( "OPTIONAL" );
GLOBAL char * KW_OR INITIALLY( "OR" );
GLOBAL char * KW_OTHERWISE INITIALLY( "OTHERWISE" );
GLOBAL char * KW_PI INITIALLY( "PI" );
GLOBAL char * KW_PROCEDURE INITIALLY( "PROCEDURE" );
GLOBAL char * KW_QUERY INITIALLY( "QUERY" );
GLOBAL char * KW_REAL INITIALLY( "REAL" );
GLOBAL char * KW_REFERENCE INITIALLY( "REFERENCE" );
GLOBAL char * KW_REMOVE INITIALLY( "REMOVE" );
GLOBAL char * KW_REPEAT INITIALLY( "REPEAT" );
GLOBAL char * KW_RETURN INITIALLY( "RETURN" );
GLOBAL char * KW_ROLESOF INITIALLY( "ROLESOF" );
GLOBAL char * KW_RULE INITIALLY( "RULE" );
GLOBAL char * KW_SCHEMA INITIALLY( "SCHEMA" );
GLOBAL char * KW_SELECT INITIALLY( "SELECT" );
GLOBAL char * KW_SELF INITIALLY( "SELF" );
GLOBAL char * KW_SET INITIALLY( "SET" );
GLOBAL char * KW_SIN INITIALLY( "SIN" );
GLOBAL char * KW_SIZEOF INITIALLY( "SIZEOF" );
GLOBAL char * KW_SKIP INITIALLY( "SKIP" );
GLOBAL char * KW_SQRT INITIALLY( "SQRT" );
GLOBAL char * KW_STRING INITIALLY( "STRING" );
GLOBAL char * KW_SUBTYPE INITIALLY( "SUBTYPE" );
GLOBAL char * KW_SUPERTYPE INITIALLY( "SUPERTYPE" );
GLOBAL char * KW_TAN INITIALLY( "TAN" );
GLOBAL char * KW_THEN INITIALLY( "THEN" );
GLOBAL char * KW_TO INITIALLY( "TO" );
GLOBAL char * KW_TRUE INITIALLY( "TRUE" );
GLOBAL char * KW_TYPE INITIALLY( "TYPE" );
GLOBAL char * KW_TYPEOF INITIALLY( "TYPEOF" );
GLOBAL char * KW_UNIQUE INITIALLY( "UNIQUE" );
GLOBAL char * KW_UNKNOWN INITIALLY( "UNKNOWN" );
GLOBAL char * KW_UNTIL INITIALLY( "UNTIL" );
GLOBAL char * KW_USE INITIALLY( "USE" );
GLOBAL char * KW_USEDIN INITIALLY( "USEDIN" );
GLOBAL char * KW_VALUE INITIALLY( "VALUE" );
GLOBAL char * KW_VALUE_IN INITIALLY( "VALUE_IN" );
GLOBAL char * KW_VALUE_UNIQUE INITIALLY( "VALUE_UNIQUE" );
GLOBAL char * KW_VAR INITIALLY( "VAR" );
GLOBAL char * KW_WHERE INITIALLY( "WHERE" );
GLOBAL char * KW_WHILE INITIALLY( "WHILE" );
GLOBAL char * KW_XOR INITIALLY( "XOR" );
GLOBAL SCL_EXPRESS_EXPORT struct Scope_ * FUNC_NVL;
GLOBAL SCL_EXPRESS_EXPORT struct Scope_ * FUNC_USEDIN;
GLOBAL SCL_EXPRESS_EXPORT char * KW_ABS INITIALLY( "ABS" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ABSTRACT INITIALLY( "ABSTRACT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ACOS INITIALLY( "ACOS" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_AGGREGATE INITIALLY( "AGGREGATE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ALIAS INITIALLY( "ALIAS" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_AND INITIALLY( "AND" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ANDOR INITIALLY( "ANDOR" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ARRAY INITIALLY( "ARRAY" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_AS INITIALLY( "AS" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ASIN INITIALLY( "ASIN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ATAN INITIALLY( "ATAN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_BAG INITIALLY( "BAG" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_BEGIN INITIALLY( "BEGIN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_BINARY INITIALLY( "BINARY" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_BLENGTH INITIALLY( "BLENGTH" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_BOOLEAN INITIALLY( "BOOLEAN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_BY INITIALLY( "BY" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_CASE INITIALLY( "CASE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_CONST_E INITIALLY( "CONST_E" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_CONSTANT INITIALLY( "CONSTANT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_CONTEXT INITIALLY( "CONTEXT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_COS INITIALLY( "COS" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_DERIVE INITIALLY( "DERIVE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_DIV INITIALLY( "DIV" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ELSE INITIALLY( "ELSE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END INITIALLY( "END" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_ALIAS INITIALLY( "END_ALIAS" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_CASE INITIALLY( "END_CASE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_CONSTANT INITIALLY( "END_CONSTANT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_CONTEXT INITIALLY( "END_CONTEXT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_ENTITY INITIALLY( "END_ENTITY" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_FUNCTION INITIALLY( "END_FUNCTION" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_IF INITIALLY( "END_IF" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_LOCAL INITIALLY( "END_LOCAL" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_MODEL INITIALLY( "END_MODEL" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_PROCEDURE INITIALLY( "END_PROCEDURE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_REPEAT INITIALLY( "END_REPEAT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_RULE INITIALLY( "END_RULE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_SCHEMA INITIALLY( "END_SCHEMA" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_TYPE INITIALLY( "END_TYPE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ENTITY INITIALLY( "ENTITY" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ENUMERATION INITIALLY( "ENUMERATION" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ESCAPE INITIALLY( "ESCAPE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_EXISTS INITIALLY( "EXISTS" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_EXP INITIALLY( "EXP" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_FALSE INITIALLY( "FALSE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_FIXED INITIALLY( "FIXED" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_FOR INITIALLY( "FOR" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_FORMAT INITIALLY( "FORMAT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_FROM INITIALLY( "FROM" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_FUNCTION INITIALLY( "FUNCTION" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_GENERIC INITIALLY( "GENERIC" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_HIBOUND INITIALLY( "HIBOUND" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_HIINDEX INITIALLY( "HIINDEX" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_IF INITIALLY( "IF" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_IN INITIALLY( "IN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_INCLUDE INITIALLY( "INCLUDE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_INSERT INITIALLY( "INSERT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_INTEGER INITIALLY( "INTEGER" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_INVERSE INITIALLY( "INVERSE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_LENGTH INITIALLY( "LENGTH" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_LIKE INITIALLY( "LIKE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_LIST INITIALLY( "LIST" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOBOUND INITIALLY( "LOBOUND" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOCAL INITIALLY( "LOCAL" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOG INITIALLY( "LOG" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOG10 INITIALLY( "LOG10" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOG2 INITIALLY( "LOG2" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOGICAL INITIALLY( "LOGICAL" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOINDEX INITIALLY( "LOINDEX" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_MOD INITIALLY( "MOD" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_MODEL INITIALLY( "MODEL" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_NOT INITIALLY( "NOT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_NUMBER INITIALLY( "NUMBER" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_NVL INITIALLY( "NVL" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ODD INITIALLY( "ODD" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_OF INITIALLY( "OF" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ONEOF INITIALLY( "ONEOF" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_OPTIONAL INITIALLY( "OPTIONAL" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_OR INITIALLY( "OR" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_OTHERWISE INITIALLY( "OTHERWISE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_PI INITIALLY( "PI" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_PROCEDURE INITIALLY( "PROCEDURE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_QUERY INITIALLY( "QUERY" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_REAL INITIALLY( "REAL" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_REFERENCE INITIALLY( "REFERENCE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_REMOVE INITIALLY( "REMOVE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_REPEAT INITIALLY( "REPEAT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_RETURN INITIALLY( "RETURN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ROLESOF INITIALLY( "ROLESOF" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_RULE INITIALLY( "RULE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_SCHEMA INITIALLY( "SCHEMA" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_SELECT INITIALLY( "SELECT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_SELF INITIALLY( "SELF" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_SET INITIALLY( "SET" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_SIN INITIALLY( "SIN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_SIZEOF INITIALLY( "SIZEOF" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_SKIP INITIALLY( "SKIP" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_SQRT INITIALLY( "SQRT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_STRING INITIALLY( "STRING" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_SUBTYPE INITIALLY( "SUBTYPE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_SUPERTYPE INITIALLY( "SUPERTYPE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_TAN INITIALLY( "TAN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_THEN INITIALLY( "THEN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_TO INITIALLY( "TO" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_TRUE INITIALLY( "TRUE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_TYPE INITIALLY( "TYPE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_TYPEOF INITIALLY( "TYPEOF" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_UNIQUE INITIALLY( "UNIQUE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_UNKNOWN INITIALLY( "UNKNOWN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_UNTIL INITIALLY( "UNTIL" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_USE INITIALLY( "USE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_USEDIN INITIALLY( "USEDIN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_VALUE INITIALLY( "VALUE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_VALUE_IN INITIALLY( "VALUE_IN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_VALUE_UNIQUE INITIALLY( "VALUE_UNIQUE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_VAR INITIALLY( "VAR" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_WHERE INITIALLY( "WHERE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_WHILE INITIALLY( "WHILE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_XOR INITIALLY( "XOR" );
#undef GLOBAL
#undef INITIALLY
@@ -255,29 +261,18 @@ GLOBAL char * KW_XOR INITIALLY( "XOR" );
#define EXPRESSput_basename(e,n) ((e)->u.express->basename = (n))
#define EXPRESSput_filename(e,n) ((e)->u.express->filename = (n))
/********************/
/* Inline functions */
/********************/
#if supports_inline_functions || defined(EXPRESS_C)
#endif /*supports_inline_functions || defined(EXPRESS_C)*/
/***********************/
/* function prototypes */
/***********************/
extern Express EXPRESScreate PROTO( ( void ) );
extern void EXPRESSparse PROTO( ( Express, FILE *, char * ) );
extern void EXPRESSinitialize PROTO( ( void ) );
extern void EXPRESSresolve PROTO( ( Express ) );
extern char * EXPRESSversion PROTO( ( void ) );
extern int EXPRESS_fail PROTO( ( Express ) );
extern int EXPRESS_succeed PROTO( ( Express ) );
extern SCL_EXPRESS_EXPORT Express EXPRESScreate PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void EXPRESSparse PROTO( ( Express, FILE *, char * ) );
extern SCL_EXPRESS_EXPORT void EXPRESSinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void EXPRESSresolve PROTO( ( Express ) );
extern SCL_EXPRESS_EXPORT char * EXPRESSversion PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT int EXPRESS_fail PROTO( ( Express ) );
extern SCL_EXPRESS_EXPORT int EXPRESS_succeed PROTO( ( Express ) );
extern void EXPRESSinit_init PROTO( ( void ) );
#if 0
extern void EXPRESSdump_model PROTO( ( Express ) );
#endif /*0*/
extern void build_complex( Express );
extern SCL_EXPRESS_EXPORT void build_complex( Express );
#endif /*EXPRESS_H*/
+32 -38
View File
@@ -1,9 +1,8 @@
#ifndef HASH_H
#define HASH_H
/* $Id: hash.h,v 1.6 1997/10/22 16:36:49 sauderd Exp $ */
/************************************************************************
/** **********************************************************************
* \file hash.h
** Hash_Table: Hash_Table
** Description:
**
@@ -90,9 +89,9 @@
#define HASH_NULL (Hash_Table)NULL
#define SEGMENT_SIZE 256
#define SEGMENT_SIZE_SHIFT 8 /* log2(SEGMENT_SIZE) */
#define SEGMENT_SIZE_SHIFT 8 /**< log2(SEGMENT_SIZE) */
#define DIRECTORY_SIZE 256
#define DIRECTORY_SIZE_SHIFT 8 /* log2(DIRECTORY_SIZE) */
#define DIRECTORY_SIZE_SHIFT 8 /**< log2(DIRECTORY_SIZE) */
#define PRIME1 37
#define PRIME2 1048583
#define MAX_LOAD_FACTOR 5
@@ -101,6 +100,7 @@
/* packages used */
/*****************/
#include <scl_export.h>
#ifdef HASH_C
#include <assert.h>
#endif /*HASH_C*/
@@ -123,42 +123,39 @@ typedef struct Element_ {
char * key;
char * data;
struct Element_ * next;
Symbol * symbol;/* for debugging hash conflicts */
char type; /* user-supplied type */
Symbol * symbol; /**< for debugging hash conflicts */
char type; /**< user-supplied type */
} * Element;
typedef Element * Segment;
typedef struct Hash_Table_ {
#if 0
int in_use; /* If someone is traversing the hash table */
int in_use; /**< If someone is traversing the hash table */
#endif
unsigned int p; /* Next bucket to be split */
unsigned int maxp; /* upper bound on p during expansion */
long KeyCount; /* current # keys */
unsigned int SegmentCount; /* current # segments */
unsigned int p; /**< Next bucket to be split */
unsigned int maxp; /**< upper bound on p during expansion */
long KeyCount; /**< current # keys */
unsigned int SegmentCount; /**< current # segments */
unsigned int MinLoadFactor;
unsigned int MaxLoadFactor;
Segment Directory[DIRECTORY_SIZE];
} * Hash_Table;
typedef struct {
int i; /* segment index (i think) */
int j; /* key index in segment (ditto) */
Element p; /* usually the next element to be returned */
unsigned int i; /**< segment index (i think) */
unsigned int j; /**< key index in segment (ditto) */
Element p; /**< usually the next element to be returned */
Hash_Table table;
char type;
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 */
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;
/****************/
/* modules used */
/****************/
/********************/
/* global variables */
/********************/
@@ -171,8 +168,8 @@ typedef struct {
# define INITIALLY(value)
#endif /*HASH_C*/
GLOBAL struct freelist_head HASH_Table_fl;
GLOBAL struct freelist_head HASH_Element_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head HASH_Table_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head HASH_Element_fl;
#undef GLOBAL
#undef INITIALLY
@@ -185,7 +182,7 @@ GLOBAL struct freelist_head HASH_Element_fl;
** Fast arithmetic, relying on powers of 2
*/
/*
/**
The centerline compiler was having problems with MUL and DIV. Where DIV
was called like this DIV(NewAddress, SEGMENT_SIZE) it is now being called like
DIV(NewAddress, SEGMENT_SIZE_SHIFT). The compiler was mentioning some kind of
@@ -211,16 +208,13 @@ This change only seems to have affected hash.h and hash.c
/* function prototypes */
/***********************/
extern void HASHinitialize PROTO( ( void ) );
extern Hash_Table HASHcreate PROTO( ( unsigned ) );
extern Hash_Table HASHcopy PROTO( ( Hash_Table ) );
extern void HASHdestroy PROTO( ( Hash_Table ) );
extern Element HASHsearch PROTO( ( Hash_Table, Element, Action ) );
extern void HASHlistinit PROTO( ( Hash_Table, HashEntry * ) );
extern void HASHlistinit_by_type PROTO( ( Hash_Table, HashEntry *, char ) );
extern Element HASHlist PROTO( ( HashEntry * ) );
#if 0
extern void HASHlistend PROTO( ( HashEntry * ) );
#endif
extern SCL_EXPRESS_EXPORT void HASHinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT Hash_Table HASHcreate PROTO( ( unsigned ) );
extern SCL_EXPRESS_EXPORT Hash_Table HASHcopy PROTO( ( Hash_Table ) );
extern SCL_EXPRESS_EXPORT void HASHdestroy PROTO( ( Hash_Table ) );
extern SCL_EXPRESS_EXPORT Element HASHsearch PROTO( ( Hash_Table, Element, Action ) );
extern SCL_EXPRESS_EXPORT void HASHlistinit PROTO( ( Hash_Table, HashEntry * ) );
extern SCL_EXPRESS_EXPORT void HASHlistinit_by_type PROTO( ( Hash_Table, HashEntry *, char ) );
extern SCL_EXPRESS_EXPORT Element HASHlist PROTO( ( HashEntry * ) );
#endif /*HASH_H*/
+35 -32
View File
@@ -1,8 +1,6 @@
#ifndef LEX_ACTIONS_H
#define LEX_ACTIONS_H
/* $Id: lexact.h,v 1.5 1995/04/05 13:55:40 clark dec96 $ */
/*
* This software was developed by U.S. Government employees as part of
* their official duties and is not subject to copyright.
@@ -40,6 +38,7 @@
/* packages used */
/*****************/
#include <scl_export.h>
#include <ctype.h>
#include "basic.h"
#include "error.h"
@@ -77,19 +76,19 @@ typedef struct Scan_Buffer {
# define INITIALLY(value)
#endif /* LEX_ACTIONS_C */
GLOBAL Scan_Buffer SCAN_buffers[SCAN_NESTING_DEPTH];
GLOBAL int SCAN_current_buffer INITIALLY( 0 );
GLOBAL char * SCANcurrent;
GLOBAL SCL_EXPRESS_EXPORT Scan_Buffer SCAN_buffers[SCAN_NESTING_DEPTH];
GLOBAL SCL_EXPRESS_EXPORT int SCAN_current_buffer INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT char * SCANcurrent;
GLOBAL Error ERROR_include_file INITIALLY( ERROR_none );
GLOBAL Error ERROR_unmatched_close_comment INITIALLY( ERROR_none );
GLOBAL Error ERROR_unmatched_open_comment INITIALLY( ERROR_none );
GLOBAL Error ERROR_unterminated_string INITIALLY( ERROR_none );
GLOBAL Error ERROR_encoded_string_bad_digit INITIALLY( ERROR_none );
GLOBAL Error ERROR_encoded_string_bad_count INITIALLY( ERROR_none );
GLOBAL Error ERROR_bad_identifier INITIALLY( ERROR_none );
GLOBAL Error ERROR_unexpected_character INITIALLY( ERROR_none );
GLOBAL Error ERROR_nonascii_char;
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_include_file INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unmatched_close_comment INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unmatched_open_comment INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unterminated_string INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_encoded_string_bad_digit INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_encoded_string_bad_count INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_bad_identifier INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unexpected_character INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_nonascii_char;
#undef GLOBAL
@@ -112,27 +111,27 @@ GLOBAL Error ERROR_nonascii_char;
/* function prototypes */
/***********************/
extern int yylex PROTO( ( void ) ); /* the scanner */
extern SCL_EXPRESS_EXPORT int yylex PROTO( ( void ) ); /* the scanner */
extern void SCANinitialize PROTO( ( void ) );
extern int SCANprocess_real_literal PROTO( ( void ) );
extern int SCANprocess_integer_literal PROTO( ( void ) );
extern int SCANprocess_binary_literal PROTO( ( void ) );
extern int SCANprocess_logical_literal PROTO( ( char * ) );
extern int SCANprocess_identifier_or_keyword PROTO( ( void ) );
extern int SCANprocess_string PROTO( ( void ) );
extern int SCANprocess_encoded_string PROTO( ( void ) );
extern int SCANprocess_semicolon PROTO( ( int ) );
extern void SCANsave_comment PROTO( ( void ) );
extern bool SCANread PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void SCANinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT int SCANprocess_real_literal PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT int SCANprocess_integer_literal PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT int SCANprocess_binary_literal PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT int SCANprocess_logical_literal PROTO( ( char * ) );
extern SCL_EXPRESS_EXPORT int SCANprocess_identifier_or_keyword PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT int SCANprocess_string PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT int SCANprocess_encoded_string PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT int SCANprocess_semicolon PROTO( ( int ) );
extern SCL_EXPRESS_EXPORT void SCANsave_comment PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT bool SCANread PROTO( ( void ) );
#if macros_bit_the_dust
extern void SCANdefine_macro PROTO( ( char *, char * ) );
extern SCL_EXPRESS_EXPORT void SCANdefine_macro PROTO( ( char *, char * ) );
#endif
extern void SCANinclude_file PROTO( ( char * ) );
void SCANlowerize PROTO( ( char * ) );
void SCANupperize PROTO( ( char * ) );
extern char * SCANstrdup PROTO( ( char * ) );
extern long SCANtell PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void SCANinclude_file PROTO( ( char * ) );
SCL_EXPRESS_EXPORT void SCANlowerize PROTO( ( char * ) );
SCL_EXPRESS_EXPORT void SCANupperize PROTO( ( char * ) );
extern SCL_EXPRESS_EXPORT char * SCANstrdup PROTO( ( char * ) );
extern SCL_EXPRESS_EXPORT long SCANtell PROTO( ( void ) );
/*******************************/
/* inline function definitions */
@@ -162,7 +161,11 @@ SCANnextchar( char * buffer ) {
SCANbuffer.numRead--;
#endif
buffer[0] = *( SCANcurrent++ );
#ifdef __MSVC__
if( !__isascii( buffer[0] ) ) {
#else
if( !isascii( buffer[0] ) ) {
#endif
ERRORreport_with_line( ERROR_nonascii_char, yylineno,
0xff & buffer[0] );
buffer[0] = ' '; /* substitute space */
+42 -39
View File
@@ -1,8 +1,6 @@
#ifndef LINKED_LIST_H
#define LINKED_LIST_H
/* $Id: linklist.h,v 1.3 1997/01/21 19:15:23 dar Exp $ */
/*
* This work was supported by the United States Government, and is
* not subject to copyright.
@@ -38,6 +36,7 @@
/* packages used */
/*****************/
#include <scl_export.h>
#include "basic.h"
#include "memory.h"
@@ -47,10 +46,6 @@
typedef struct Linked_List_ * Linked_List;
#ifdef __STDC__
#else /* old C */
#endif /*__STDC__*/
/****************/
/* modules used */
/****************/
@@ -81,10 +76,10 @@ struct Linked_List_ {
#include "decstart.h"
#endif /*LINKED_LIST_C*/
GLOBAL Error ERROR_empty_list INITIALLY( ERROR_none );
GLOBAL struct freelist_head LINK_fl;
GLOBAL struct freelist_head LIST_fl;
GLOBAL Linked_List LINK__l; /* for LISTcreate_with macro - ugh */
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_empty_list INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head LINK_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head LIST_fl;
GLOBAL SCL_EXPRESS_EXPORT Linked_List LINK__l; /* for LISTcreate_with macro - ugh */
#include "de_end.h"
@@ -97,37 +92,38 @@ GLOBAL Linked_List LINK__l; /* for LISTcreate_with macro - ugh */
#define LIST_new() (struct Linked_List_ *)MEM_new(&LIST_fl)
#define LIST_destroy(x) MEM_destroy(&LIST_fl,(Freelist *)(Generic)x)
/* following could be optimized */
/** following could be optimized */
#define LISTcreate_with(x) (LINK__l = LISTcreate()),\
LISTadd(LINK__l,x),\
LINK_l)
/* accessing links */
/** accessing links */
#define LINKdata(link) (link)->data
#define LINKnext(link) (link)->next
#define LINKprev(link) (link)->prev
/* iteration */
#define LISTdo(list, elt, type) \
{struct Linked_List_ * __l = (list); \
type elt; \
Link __p; \
if (__l) { \
/** iteration */
#define LISTdo(list, elt, type) \
{struct Linked_List_ * __l = (list); \
type elt; \
Link __p; \
if (__l) { \
for (__p = __l->mark; (__p = __p->next) != __l->mark; ) { \
(elt) = (type)((__p)->data);
#define LISTdo_links(list, link) \
{Linked_List __in = (list); \
Link link; \
if (__in != LIST_NULL) { \
for ((link) = __in->mark; ((link) = (link)->next) != __in->mark; ) {
{Linked_List __i = (list); \
Link link; \
if (__i != LIST_NULL) { \
for ((link) = __i->mark; ((link) = (link)->next) != __i->mark; ) {
#define LISTod }}}
/* accessing */
/** accessing */
#define LISTpeek_first(list) \
(((struct Linked_List_*)list)->mark->next->data)
/* function aliases */
/** function aliases */
#define LISTadd(list, item) LISTadd_last(list, item)
#define LISTadd_all(list, items) \
LISTdo(items, e, Generic) \
@@ -138,26 +134,27 @@ GLOBAL Linked_List LINK__l; /* for LISTcreate_with macro - ugh */
/* function prototypes */
/***********************/
extern void LISTinitialize PROTO( ( void ) );
extern Linked_List LISTcreate PROTO( ( void ) );
/*extern Linked_List LISTcreate_with PROTO((Generic));*/
extern Linked_List LISTcopy PROTO( ( Linked_List ) );
extern Generic LISTadd_first PROTO( ( Linked_List, Generic ) );
extern Generic LISTadd_last PROTO( ( Linked_List, Generic ) );
extern Generic LISTadd_after PROTO( ( Linked_List, Link, Generic ) );
extern Generic LISTadd_before PROTO( ( Linked_List, Link, Generic ) );
extern Generic LISTremove_first PROTO( ( Linked_List ) );
extern Generic LISTremove PROTO( ( Linked_List, Link ) );
extern Generic LISTget_first PROTO( ( Linked_List ) );
extern Generic LISTget_second PROTO( ( Linked_List ) );
extern Generic LISTget_nth PROTO( ( Linked_List, int ) );
extern void LISTfree PROTO( ( Linked_List ) );
extern int LISTget_length PROTO( ( Linked_List ) );
extern SCL_EXPRESS_EXPORT void LISTinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT Linked_List LISTcreate PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT Linked_List LISTcopy PROTO( ( Linked_List ) );
extern SCL_EXPRESS_EXPORT Generic LISTadd_first PROTO( ( Linked_List, Generic ) );
extern SCL_EXPRESS_EXPORT Generic LISTadd_last PROTO( ( Linked_List, Generic ) );
extern SCL_EXPRESS_EXPORT Generic LISTadd_after PROTO( ( Linked_List, Link, Generic ) );
extern SCL_EXPRESS_EXPORT Generic LISTadd_before PROTO( ( Linked_List, Link, Generic ) );
extern SCL_EXPRESS_EXPORT Generic LISTremove_first PROTO( ( Linked_List ) );
extern SCL_EXPRESS_EXPORT Generic LISTremove PROTO( ( Linked_List, Link ) );
extern SCL_EXPRESS_EXPORT Generic LISTget_first PROTO( ( Linked_List ) );
extern SCL_EXPRESS_EXPORT Generic LISTget_second PROTO( ( Linked_List ) );
extern SCL_EXPRESS_EXPORT Generic LISTget_nth PROTO( ( Linked_List, int ) );
extern SCL_EXPRESS_EXPORT void LISTfree PROTO( ( Linked_List ) );
extern SCL_EXPRESS_EXPORT int LISTget_length PROTO( ( Linked_List ) );
/*******************************/
/* inline function definitions */
/*******************************/
#if !defined(__BORLAND__)
#if supports_inline_functions || defined(LINKED_LIST_C)
static_inline
@@ -174,4 +171,10 @@ LISTempty( Linked_List list ) {
#endif /* supports_inline_functions || defined(LINKED_LIST_C) */
#else
extern SCL_EXPRESS_EXPORT bool LISTempty( Linked_List list );
#endif
#endif /*LINKED_LIST_H*/
+18 -19
View File
@@ -1,8 +1,6 @@
#ifndef MEMORY_H
#define MEMORY_H
/* $Id: memory.h,v 1.5 1997/01/21 19:17:11 dar Exp $ */
/*
* This work was supported by the United States Government, and is
* not subject to copyright.
@@ -30,29 +28,30 @@
/* packages used */
/*****************/
/* mem.h - defs for fixed size block memory allocator */
#include <scl_export.h>
/** \file memory.h - defs for fixed size block memory allocator */
typedef long Align;
union freelist {
union freelist * next; /* next block on freelist */
char memory; /* user data */
Align aligner; /* force alignment of blocks */
union freelist * next; /**< next block on freelist */
char memory; /**< user data */
Align aligner; /**< force alignment of blocks */
};
typedef union freelist Freelist;
struct freelist_head {
int size_elt; /* size of a single elt */
int size_elt; /**< size of a single elt */
#ifndef NOSTAT
int alloc; /* # of allocations */
int alloc; /**< # of allocations */
int dealloc;
int create; /* number of calls to create a new freelist */
Generic max; /* end of freelist */
int create; /**< number of calls to create a new freelist */
Generic max; /**< end of freelist */
#endif
int size; /* size of a single elt incl. next ptr */
int bytes; /* if we run out, allocate memory by this
many bytes */
int size; /**< size of a single elt incl. next ptr */
int bytes; /**< if we run out, allocate memory by this many bytes */
Freelist * freelist;
#if SPACE_PROFILE
int count;
@@ -76,17 +75,17 @@ char * nnew();
extern int yylineno;
/* CALLOC grabs and initializes to all 0s space for the indicated */
/* number of instances of the indicated type */
/** CALLOC grabs and initializes to all 0s space for the indicated
* number of instances of the indicated type */
#define CALLOC(ptr, num, type) \
if (((ptr) = (type*)calloc((num), (unsigned)sizeof(type)))==NULL) { \
fprintf(stderr,"fedex: out of space");\
} else {}
void _MEMinitialize PROTO( ( void ) );
void MEMinitialize PROTO( ( struct freelist_head *, int, int, int ) );
void MEM_destroy PROTO( ( struct freelist_head *, Freelist * ) );
Generic MEM_new PROTO( ( struct freelist_head * ) );
SCL_EXPRESS_EXPORT void _MEMinitialize PROTO( ( void ) );
SCL_EXPRESS_EXPORT void MEMinitialize PROTO( ( struct freelist_head *, int, int, int ) );
SCL_EXPRESS_EXPORT void MEM_destroy PROTO( ( struct freelist_head *, Freelist * ) );
SCL_EXPRESS_EXPORT Generic MEM_new PROTO( ( struct freelist_head * ) );
#include "de_end.h"
+13 -29
View File
@@ -1,10 +1,8 @@
#ifndef OBJECT_H
#define OBJECT_H
/* $Id: object.h,v 1.9 1997/01/21 19:17:11 dar Exp $ */
/************************************************************************
** Module: Object
/** **********************************************************************
** Module: Object \file object.h
** Description: This module implements the Object abstraction.
** Constants:
** OBJECT_NULL - the null class
@@ -48,15 +46,16 @@
/* constants */
/*************/
/* each object has an index - current the index is a mnemonic character */
/* hence the array is rather sparse, but the extra slop is only a hundred */
/* or so bytes, so it's nothing to sweat about */
/** each object has an index - current the index is a mnemonic character
* hence the array is rather sparse, but the extra slop is only a hundred
* or so bytes, so it's nothing to sweat about */
#define MAX_OBJECT_TYPES 127 /* really could be a LOT less */
/*****************/
/* packages used */
/*****************/
#include <scl_export.h>
#include "basic.h" /* get basic definitions */
#include "symbol.h"
@@ -70,9 +69,8 @@
struct Object {
struct Symbol_ * ( *get_symbol )();
char * type; /* should complete the phrase "X is ..." */
/* i.e., "an entity", "a type", "of unknown type" */
int bits; /* a bitwise selector of a type, i.e. OBJ_XX_BITS */
char * type; /**< should complete the phrase "X is ..." - i.e., "an entity", "a type", "of unknown type" */
int bits; /**< a bitwise selector of a type, i.e. OBJ_XX_BITS */
};
/****************/
@@ -89,7 +87,7 @@ struct Object {
#include "decstart.h"
#endif /*OBJECT_C */
GLOBAL struct Object * OBJ;
GLOBAL SCL_EXPRESS_EXPORT struct Object * OBJ;
#include "de_end.h"
@@ -103,28 +101,14 @@ GLOBAL struct Object * OBJ;
#define OBJtype_is_oneof(_type_,class) (OBJ[(int)_type_].bits & (class))
#define OBJget_name(obj,type) (OBJget_symbol(obj,type)->name)
/* for backwards compatibility */
#define OBJequal(x,y) ((x) == (y))
#define OBJfree(x)
#define OBJreference(x) (x)
#define OBJget_data(obj,type,err) (obj)
/* removed #define statements for obsolete fn macros OBJequal OBJfree OBJreference OBJget_data */
/***********************/
/* function prototypes */
/***********************/
extern void OBJinitialize PROTO( ( void ) );
extern void OBJcreate PROTO( ( char, struct Symbol_ * ( * )( Generic ), char *, int ) );
extern Symbol * UNK_get_symbol PROTO( ( Generic x ) );
#if 0
extern void OBJcreate( char, struct Symbol * ( * )( Generic ), char *, int );
#endif
/********************/
/* inline functions */
/********************/
#if supports_inline_functions || defined(OBJECT_C)
#endif /* supports_inline_functions || defined(OBJECT_C) */
extern SCL_EXPRESS_EXPORT void OBJinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void OBJcreate PROTO( ( char, struct Symbol_ * ( * )( Generic ), char *, int ) );
extern SCL_EXPRESS_EXPORT Symbol * UNK_get_symbol PROTO( ( Generic x ) );
#endif /*OBJECT_H*/
+19 -22
View File
@@ -1,8 +1,6 @@
#ifndef RESOLVE_H
#define RESOLVE_H
/* $Id: resolve.h,v 1.6 1994/11/10 19:20:03 clark dec96 $ */
/*
* This software was developed by U.S. Government employees as part of
* their official duties and is not subject to copyright.
@@ -30,6 +28,7 @@
* Initial revision
*/
#include <scl_export.h>
#include "expbasic.h" /* get basic definitions */
#include "type.h"
#include "variable.h"
@@ -54,17 +53,17 @@
# define INITIALLY(value)
#endif /*RESOLVE_C*/
GLOBAL int print_objects_while_running INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT int print_objects_while_running INITIALLY( 0 );
GLOBAL Error ERROR_undefined_attribute INITIALLY( ERROR_none );
GLOBAL Error ERROR_undefined_type INITIALLY( ERROR_none );
GLOBAL Error ERROR_undefined_schema INITIALLY( ERROR_none );
GLOBAL Error ERROR_unknown_attr_in_entity INITIALLY( ERROR_none );
GLOBAL Error ERROR_unknown_subtype INITIALLY( ERROR_none );
GLOBAL Error ERROR_unknown_supertype INITIALLY( ERROR_none );
GLOBAL Error ERROR_circular_reference INITIALLY( ERROR_none );
GLOBAL Error ERROR_ambiguous_attribute INITIALLY( ERROR_none );
GLOBAL Error ERROR_ambiguous_group INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_undefined_attribute INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_undefined_type INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_undefined_schema INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unknown_attr_in_entity INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unknown_subtype INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unknown_supertype INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_circular_reference INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_ambiguous_attribute INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_ambiguous_group INITIALLY( ERROR_none );
#undef GLOBAL
#undef INITIALLY
@@ -73,7 +72,6 @@ GLOBAL Error ERROR_ambiguous_group INITIALLY( ERROR_none );
/* cheaper doing the check here, then inside the function call. Return */
/* immediately for RESOLVED, FAILED_TO_RESOLVE, and RESOLVE_IN_PROGRESS */
/*#define TYPEresolve(t,s) if (is_resolvable((*(t)))) TYPE_resolve((t),(s))*/
#define TYPEresolve(t,s) if (is_resolvable((*(t)))) TYPE_resolve((t))
#define VARresolve_types(v,s) if (is_resolvable((v)->name)) VAR_resolve_types((v),(s))
#define VARresolve_expressions(v,s) if (is_resolvable((v)->name)) VAR_resolve_expressions((v),(s))
@@ -83,14 +81,13 @@ GLOBAL Error ERROR_ambiguous_group INITIALLY( ERROR_none );
/* function prototypes */
/***********************/
extern void RESOLVEinitialize PROTO( ( void ) );
extern void SCOPEresolve_expressions_statements PROTO( ( Scope ) );
extern void SCOPEresolve_subsupers PROTO( ( Scope ) );
extern void SCOPEresolve_types PROTO( ( Scope ) );
/*extern void TYPE_resolve PROTO((Type *,Scope));*/
extern void TYPE_resolve PROTO( ( Type * ) );
extern void EXP_resolve PROTO( ( Expression, Scope, Type ) );
extern void ALGresolve PROTO( ( Scope ) );
extern void SCHEMAresolve PROTO( ( Scope ) );
extern SCL_EXPRESS_EXPORT void RESOLVEinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void SCOPEresolve_expressions_statements PROTO( ( Scope ) );
extern SCL_EXPRESS_EXPORT void SCOPEresolve_subsupers PROTO( ( Scope ) );
extern SCL_EXPRESS_EXPORT void SCOPEresolve_types PROTO( ( Scope ) );
extern SCL_EXPRESS_EXPORT void TYPE_resolve PROTO( ( Type * ) );
extern SCL_EXPRESS_EXPORT void EXP_resolve PROTO( ( Expression, Scope, Type ) );
extern SCL_EXPRESS_EXPORT void ALGresolve PROTO( ( Scope ) );
extern SCL_EXPRESS_EXPORT void SCHEMAresolve PROTO( ( Scope ) );
#endif /*RESOLVE_H*/
+33 -52
View File
@@ -1,10 +1,8 @@
#ifndef SCHEMA_H
#define SCHEMA_H
/* $Id: schema.h,v 1.11 1997/02/25 19:49:01 dar Exp $ */
/************************************************************************
** Module: Schema
/** **********************************************************************
** Module: Schema \file schema.h
** Description: This module implements the Schema abstraction, which
** basically amounts to a named symbol table.
** Constants:
@@ -48,23 +46,15 @@
* prettied up interface to print_objects_when_running
*/
/*************/
/* constants */
/*************/
/*****************/
/* packages used */
/*****************/
#include <scl_export.h>
#include "expbasic.h" /* get basic definitions */
#include "symbol.h"
#include "scope.h"
/************/
/* typedefs */
/************/
/*typedef struct Scope *Schema;*/
/****************/
/* modules used */
@@ -86,30 +76,28 @@ typedef struct Rename {
Schema schema;
struct Symbol_ * old;
struct Symbol_ * nnew;
Generic object; /* once object has been looked up */
char type; /* drat, need to remember this */
/* once renames have been resolved to avoid */
/* looking them up in the dictionary again */
Generic object; /**< once object has been looked up */
char type; /**< drat, need to remember this once renames have been
* resolved to avoid looking them up in the dictionary again */
enum rename_type rename_type;
int userdata; /* generic for user */
int userdata; /**< generic for user */
} Rename;
struct Schema_ {
Linked_List rules;
#if 0
struct Express_ * express;
#endif
Linked_List reflist;
Linked_List uselist;
/* dictionarys into which are entered renames for each specific */
/* object specified in a rename clause (even if it uses the same */
/* name */
/** \var refdict, usedict
* dictionarys into which are entered renames for each specific
* object specified in a rename clause (even if it uses the same
* name */
Dictionary refdict;
Dictionary usedict;
/* lists of schemas that are fully ref/use'd */
/* entries can be 0 if schemas weren't found during RENAMEresolve */
Linked_List use_schemas;
Linked_List ref_schemas;
Linked_List use_schemas; /**< lists of schemas that are fully use'd
* entries can be 0 if schemas weren't found during RENAMEresolve */
Linked_List ref_schemas; /**< lists of schemas that are fully ref'd
* entries can be 0 if schemas weren't found during RENAMEresolve */
};
/********************/
@@ -124,11 +112,11 @@ struct Schema_ {
# define INITIALLY(value)
#endif /* SCHEMA_C */
GLOBAL struct freelist_head REN_fl;
GLOBAL struct freelist_head SCOPE_fl;
GLOBAL struct freelist_head SCHEMA_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head REN_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head SCOPE_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head SCHEMA_fl;
GLOBAL int __SCOPE_search_id INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT int __SCOPE_search_id INITIALLY( 0 );
#undef GLOBAL
#undef INITIALLY
@@ -156,26 +144,19 @@ GLOBAL int __SCOPE_search_id INITIALLY( 0 );
/* function prototypes */
/***********************/
extern Variable VARfind PROTO( ( Scope, char *, int ) );
extern Schema SCHEMAcreate PROTO( ( void ) );
extern void SCHEMAinitialize PROTO( ( void ) );
extern void SCHEMAadd_use PROTO( ( Schema, Symbol *, Symbol *, Symbol * ) );
extern void SCHEMAadd_reference PROTO( ( Schema, Symbol *, Symbol *, Symbol * ) );
extern void SCHEMAdefine_use PROTO( ( Schema, Rename * ) );
extern void SCHEMAdefine_reference PROTO( ( Schema, Rename * ) );
extern Generic SCHEMAfind PROTO( ( Schema, char * name, int search_refs ) );
extern Scope SCOPEcreate PROTO( ( char ) );
extern Scope SCOPEcreate_tiny PROTO( ( char ) );
extern Scope SCOPEcreate_nostab PROTO( ( char ) );
extern Linked_List SCHEMAget_entities_use PROTO( ( Scope ) );
extern Linked_List SCHEMAget_entities_ref PROTO( ( Scope ) );
/********************/
/* inline functions */
/********************/
#if supports_inline_functions || defined(SCHEMA_C)
#endif /* supports_inline_functions || defined(SCHEMA_C) */
extern SCL_EXPRESS_EXPORT Variable VARfind PROTO( ( Scope, char *, int ) );
extern SCL_EXPRESS_EXPORT Schema SCHEMAcreate PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void SCHEMAinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void SCHEMAadd_use PROTO( ( Schema, Symbol *, Symbol *, Symbol * ) );
extern SCL_EXPRESS_EXPORT void SCHEMAadd_reference PROTO( ( Schema, Symbol *, Symbol *, Symbol * ) );
extern SCL_EXPRESS_EXPORT void SCHEMAdefine_use PROTO( ( Schema, Rename * ) );
extern SCL_EXPRESS_EXPORT void SCHEMAdefine_reference PROTO( ( Schema, Rename * ) );
extern SCL_EXPRESS_EXPORT Generic SCHEMAfind PROTO( ( Schema, char * name, int search_refs ) );
extern SCL_EXPRESS_EXPORT Scope SCOPEcreate PROTO( ( char ) );
extern SCL_EXPRESS_EXPORT Scope SCOPEcreate_tiny PROTO( ( char ) );
extern SCL_EXPRESS_EXPORT Scope SCOPEcreate_nostab PROTO( ( char ) );
extern SCL_EXPRESS_EXPORT Linked_List SCHEMAget_entities_use PROTO( ( Scope ) );
extern SCL_EXPRESS_EXPORT Linked_List SCHEMAget_entities_ref PROTO( ( Scope ) );
#endif /* SCHEMA_H */
+16 -42
View File
@@ -1,10 +1,8 @@
#ifndef SCOPE_H
#define SCOPE_H
/* $Id: scope.h,v 1.10 1997/01/21 19:17:11 dar Exp $ */
/************************************************************************
** Module: Scope
/** **********************************************************************
** Module: Scope \file scope.h
** Description: This module implements a hierarchical (i.e., scoped)
** symbol table. The symbol table can store definitions of entities,
** types, algorithms, and variables, as well as containing a list
@@ -47,16 +45,11 @@
#define SCOPE_NULL (Scope)0
/************/
/* typedefs */
/************/
/*typedef struct Scope *Scope;*/
/****************/
/* modules used */
/****************/
#include <scl_export.h>
#include "type.h"
#include "variable.h"
#include "entity.h"
@@ -85,14 +78,13 @@
#define SCOPE_FIND_ANYTHING OBJ_ANYTHING_BITS
struct Scope_ {
Symbol symbol;
char type; /* see above */
ClientData clientData; /* user may use this for any purpose */
int search_id; /* key to avoid searching this scope twice */
Dictionary symbol_table;
Symbol symbol;
char type; /* see above */
ClientData clientData; /**< user may use this for any purpose */
int search_id; /**< key to avoid searching this scope twice */
Dictionary symbol_table,enum_table;
struct Scope_ * superscope;
union {
/* struct Constant *constant;*/
struct Procedure_ * proc;
struct Function_ * func;
struct Rule_ * rule;
@@ -101,10 +93,10 @@ struct Scope_ {
struct Express_ * express;
struct Increment_ * incr;
struct TypeHead_ * type;
/* no, query owns a scope rather than scope owning a query */
/* struct Query *query;*/
/* no, query owns a scope rather than scope owning a query
* struct Query *query; */
} u;
Linked_List where; /* optional where clause */
Linked_List where; /**< optional where clause */
};
/********************/
@@ -128,9 +120,6 @@ struct Scope_ {
#define SCOPEget_symbol(scope) (&(scope)->symbol)
#define SCOPEput_name(scope,name) ((scope)->symbol.name = name)
#define SCOPEget_name(scope) ((scope)->symbol.name)
/* get_superscope's' for backward compat */
#define SCOPEget_superscope(scope) ((scope)->superscope)
#define SCOPEget_superscope(scope) ((scope)->superscope)
#define SCOPEget_resolved(scope) ((scope)->symbol.resolved)
#define SCOPEget_clientData(s) ((s)->clientData)
@@ -149,25 +138,10 @@ struct Scope_ {
/* function prototypes */
/***********************/
extern struct Symbol_ * SCOPE_get_symbol PROTO( ( Generic ) );
/*extern struct Scope * SCOPEget_nearest_enclosing_entity PROTO((Scope));*/
extern void SCOPE_get_entities PROTO( ( Scope, Linked_List ) );
extern Linked_List SCOPEget_entities PROTO( ( Scope ) );
extern Linked_List SCOPEget_entities_superclass_order PROTO( ( Scope ) );
extern Generic SCOPEfind PROTO( ( Scope, char *, int ) );
extern SCL_EXPRESS_EXPORT struct Symbol_ * SCOPE_get_symbol PROTO( ( Generic ) );
extern SCL_EXPRESS_EXPORT void SCOPE_get_entities PROTO( ( Scope, Linked_List ) );
extern SCL_EXPRESS_EXPORT Linked_List SCOPEget_entities PROTO( ( Scope ) );
extern SCL_EXPRESS_EXPORT Linked_List SCOPEget_entities_superclass_order PROTO( ( Scope ) );
extern SCL_EXPRESS_EXPORT Generic SCOPEfind PROTO( ( Scope, char *, int ) );
#if 0
extern Linked_List SCOPEget_types PROTO( ( Scope ) );
extern Linked_List SCOPEget_variables PROTO( ( Scope ) );
extern Linked_List SCOPEget_algorithms PROTO( ( Scope ) );
extern Linked_List SCOPEget_constants PROTO( ( Scope ) );
#endif
/********************/
/* inline functions */
/********************/
#if supports_inline_functions || defined(SCOPE_C)
#endif /* supports_inline_functions || defined(SCOPE_C) */
#endif /* SCOPE_H */
+35 -44
View File
@@ -1,10 +1,8 @@
#ifndef STATEMENT_H
#define STATEMENT_H
/* $Id: stmt.h,v 1.3 1997/01/21 19:17:11 dar Exp $ */
/************************************************************************
** Module: Statement
/** **********************************************************************
** Module: Statement \file stmt.h
** Description: This module implements the Statement abstraction. A
** statement is, in effect, a typeless Expression. Due to the
** existence of complex language constructs, however, it often is
@@ -50,6 +48,7 @@
/* packages used */
/*****************/
#include <scl_export.h>
#include "expbasic.h" /* get basic definitions */
#include "scope.h"
@@ -94,9 +93,8 @@ typedef struct Scope_ * Increment;
/* these should probably all be expression types */
struct Statement_ {
Symbol symbol; /* can hold pcall or alias name */
/* but otherwise is not used for anything */
int type; /* one of STMT_XXX above */
Symbol symbol; /**< can hold pcall or alias name but otherwise is not used for anything */
int type; /**< one of STMT_XXX above */
/* hey, is there nothing in common beside symbol and private data?? */
union u_statement {
struct Alias_ * alias;
@@ -114,7 +112,7 @@ struct Statement_ {
struct Alias_ {
struct Scope_ * scope;
struct Variable_ * variable;
Linked_List statements; /* list of statements */
Linked_List statements; /**< list of statements */
};
struct Assignment_ {
@@ -133,18 +131,18 @@ struct Compound_Statement_ {
struct Conditional_ {
Expression test;
Linked_List code; /* list of statements */
Linked_List otherwise; /* list of statements */
Linked_List code; /**< list of statements */
Linked_List otherwise; /**< list of statements */
};
struct Loop_ {
struct Scope_ * scope; /* scope for increment control */
struct Scope_ * scope; /**< scope for increment control */
Expression while_expr;
Expression until_expr;
Linked_List statements; /* list of statements */
Linked_List statements; /**< list of statements */
};
/* this is an element in the optional Loop scope */
/** this is an element in the optional Loop scope */
struct Increment_ {
Expression init;
Expression end;
@@ -153,7 +151,7 @@ struct Increment_ {
struct Procedure_Call_ {
struct Scope_ * procedure;
Linked_List parameters; /* list of expressions */
Linked_List parameters; /**< list of expressions */
};
struct Return_Statement_ {
@@ -172,20 +170,20 @@ struct Return_Statement_ {
#include "decstart.h"
#endif /*STATEMENT_C*/
GLOBAL struct freelist_head STMT_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head STMT_fl;
GLOBAL struct freelist_head ALIAS_fl;
GLOBAL struct freelist_head ASSIGN_fl;
GLOBAL struct freelist_head CASE_fl;
GLOBAL struct freelist_head COMP_STMT_fl;
GLOBAL struct freelist_head COND_fl;
GLOBAL struct freelist_head LOOP_fl;
GLOBAL struct freelist_head PCALL_fl;
GLOBAL struct freelist_head RET_fl;
GLOBAL struct freelist_head INCR_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head ALIAS_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head ASSIGN_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head CASE_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head COMP_STMT_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head COND_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head LOOP_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head PCALL_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head RET_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head INCR_fl;
GLOBAL Statement STATEMENT_ESCAPE INITIALLY( STATEMENT_NULL );
GLOBAL Statement STATEMENT_SKIP INITIALLY( STATEMENT_NULL );
GLOBAL SCL_EXPRESS_EXPORT Statement STATEMENT_ESCAPE INITIALLY( STATEMENT_NULL );
GLOBAL SCL_EXPRESS_EXPORT Statement STATEMENT_SKIP INITIALLY( STATEMENT_NULL );
#include "de_end.h"
@@ -235,24 +233,17 @@ GLOBAL Statement STATEMENT_SKIP INITIALLY( STATEMENT_NULL );
/* function prototypes */
/***********************/
extern Statement STMTcreate PROTO( ( int ) );
extern Statement ALIAScreate PROTO( ( struct Scope_ *, Variable, Linked_List ) );
extern Statement CASEcreate PROTO( ( Expression , Linked_List ) );
extern Statement ASSIGNcreate PROTO( ( Expression , Expression ) );
extern Statement COMP_STMTcreate PROTO( ( Linked_List ) );
extern Statement CONDcreate PROTO( ( Expression, Linked_List, Linked_List ) );
extern Statement LOOPcreate PROTO( ( struct Scope_ *, Expression, Expression, Linked_List ) );
extern Statement PCALLcreate PROTO( ( Linked_List ) );
extern Statement RETcreate PROTO( ( Expression ) );
extern void STMTinitialize PROTO( ( void ) );
extern struct Scope_ * INCR_CTLcreate PROTO( ( Symbol *, Expression start,
extern SCL_EXPRESS_EXPORT Statement STMTcreate PROTO( ( int ) );
extern SCL_EXPRESS_EXPORT Statement ALIAScreate PROTO( ( struct Scope_ *, Variable, Linked_List ) );
extern SCL_EXPRESS_EXPORT Statement CASEcreate PROTO( ( Expression , Linked_List ) );
extern SCL_EXPRESS_EXPORT Statement ASSIGNcreate PROTO( ( Expression , Expression ) );
extern SCL_EXPRESS_EXPORT Statement COMP_STMTcreate PROTO( ( Linked_List ) );
extern SCL_EXPRESS_EXPORT Statement CONDcreate PROTO( ( Expression, Linked_List, Linked_List ) );
extern SCL_EXPRESS_EXPORT Statement LOOPcreate PROTO( ( struct Scope_ *, Expression, Expression, Linked_List ) );
extern SCL_EXPRESS_EXPORT Statement PCALLcreate PROTO( ( Linked_List ) );
extern SCL_EXPRESS_EXPORT Statement RETcreate PROTO( ( Expression ) );
extern SCL_EXPRESS_EXPORT void STMTinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT struct Scope_ * INCR_CTLcreate PROTO( ( Symbol *, Expression start,
Expression end, Expression increment ) );
/********************/
/* inline functions */
/********************/
#if supports_inline_functions || defined(STATEMENT_C)
#endif /* supports_inline_functions || defined(STATEMENT_C) */
#endif /*STATEMENT_H*/
+6 -18
View File
@@ -1,10 +1,8 @@
#ifndef SYMBOL_H
#define SYMBOL_H
/* $Id: symbol.h,v 1.8 1997/01/21 19:17:11 dar Exp $ */
/************************************************************************
** Module: Symbol
/** **********************************************************************
** Module: Symbol \file symbol.h
** Description: This module implements the Symbol abstraction.
** Constants:
** SYMBOL_NULL - the null Symbol
@@ -45,9 +43,7 @@
/* packages used */
/*****************/
#ifdef SYMBOL_C
#endif /* SYMBOL_C */
#include <scl_export.h>
#include "basic.h" /* get basic definitions */
#include "memory.h"
@@ -82,7 +78,7 @@ struct Symbol_ {
#include "decstart.h"
#endif /* SYMBOL_C */
GLOBAL struct freelist_head SYMBOL_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head SYMBOL_fl;
#include "de_end.h"
@@ -95,21 +91,13 @@ GLOBAL struct freelist_head SYMBOL_fl;
#define SYMBOLset(obj) obj->symbol.line = yylineno; \
obj->symbol.filename = current_filename
/* for backwards compatibility only, no one should ever need this */
#define SYMBOLget_name(sym) ((sym)->name)
/***********************/
/* function prototypes */
/***********************/
extern void SYMBOLinitialize PROTO( ( void ) );
Symbol * SYMBOLcreate PROTO( ( char *, int, char * ) );
extern SCL_EXPRESS_EXPORT void SYMBOLinitialize( void );
SCL_EXPRESS_EXPORT Symbol * SYMBOLcreate( char * name, int line, char * filename );
/********************/
/* inline functions */
/********************/
#if supports_inline_functions || defined(SYMBOL_C)
#endif /* supports_inline_functions || defined(SYMBOL_C) */
#endif /* SYMBOL_H */
+79 -142
View File
@@ -1,10 +1,8 @@
#ifndef TYPE_H
#define TYPE_H
/* $Id: type.h,v 1.14 1997/09/19 18:25:10 dar Exp $ */
/************************************************************************
** Module: Type
/** **********************************************************************
** Module: Type \file type.h
** Description: This module implements the type abstraction. It is
** rather unpleasant, since this abstraction is quite well suited
** to an object-oriented environment with inheritance.
@@ -55,16 +53,16 @@
/*************/
#define TYPE_NULL (Type)0
/* since we can't evaluate true size of many aggregates, prepare */
/* to grow them by chunks of this size */
/** since we can't evaluate true size of many aggregates,
* prepare to grow them by chunks of this size */
#define AGGR_CHUNK_SIZE 30
/* these are all orthogonal types */
/** these are all orthogonal types */
enum type_enum {
unknown_ = 0, /* 0 catches uninit. errors */
special_, /* placeholder, given meaning by it's owner, */
/* such as Type_Dont_Care, Type_Bad, Type_User_Def */
runtime_, /* cannot be further determined until runtime */
unknown_ = 0, /**< 0 catches uninit. errors */
special_, /**< placeholder, given meaning by it's owner, such as Type_Dont_Care, Type_Bad, Type_User_Def */
runtime_, /**< cannot be further determined until runtime */
integer_,
real_,
string_,
@@ -77,32 +75,29 @@ enum type_enum {
generic_,
/* aggregates */
aggregate_, /* as a formal */
aggregate_, /**< as a formal */
array_,
bag_,
set_,
list_,
last_aggregate_,/* not real, just for easier computation */
last_aggregate_,/**< not real, just for easier computation */
oneof_,
/* while they are really used for different */
/* purposes, it might be worth considering */
/* collapsing entity_ and entity_list_ */
entity_, /* single entity */
entity_list_, /* linked list of entities */
/** while they are really used for different purposes, it might be worth considering collapsing entity_ and entity_list_ */
entity_, /**< single entity */
entity_list_, /**< linked list of entities */
enumeration_,
select_,
reference_, /* something only defined by a base type, i.e., a */
/* type reference */
reference_, /**< something only defined by a base type, i.e., a type reference */
query_,
op_, /* something with an operand */
inverse_, /* is? an inverse */
op_, /**< something with an operand */
inverse_, /**< is? an inverse */
identifier_, /* simple identifier in an expression */
attribute_, /* attribute reference (i.e., expr->u.variable) */
derived_,/*?*/
funcall_, /* a function call and actual parameters */
identifier_, /**< simple identifier in an expression */
attribute_, /**< attribute reference (i.e., expr->u.variable) */
derived_, /**< ?*/
funcall_, /**< a function call and actual parameters */
self_
};
@@ -111,53 +106,25 @@ enum type_enum {
/* packages used */
/*****************/
#include <scl_export.h>
#include "expbasic.h" /* get basic definitions */
#include "symbol.h"
#include "object.h"
/*#include "scope.h"*/
/************/
/* typedefs */
/************/
/*typedef struct Scope *Type;*/
typedef struct TypeHead_ * TypeHead;
typedef struct TypeBody_ * TypeBody;
typedef enum type_enum TypeType;
/* following are all for backwards compatibility - not otherwise necessary */
typedef Type Aggregate_Type, Composed_Type, Sized_Type, Type_Reference;
typedef Aggregate_Type Array_Type, List_Type, Bag_Type;
typedef Bag_Type Set_Type;
typedef Composed_Type Entity_Type, Enumeration_Type, Select_Type;
typedef Sized_Type Integer_Type, Real_Type, String_Type, Binary_Type;
/* provide a replacement for Class */
typedef enum type_enum Class_Of_Type;
typedef enum type_enum Class;
#define OBJget_class(typ) ((typ)->u.type->body->type)
#define CLASSinherits_from TYPEinherits_from
/* backwards compatibility */
#define Class_Integer_Type integer_
#define Class_Number_Type number_
#define Class_Real_Type real_
#define Class_Entity_Type entity_
#define Class_Entity_List_Type entity_list_
#define Class_Enumeration_Type enumeration_
#define Class_Boolean_Type boolean_
#define Class_Logical_Type logical_
#define Class_Binary_Type binary_
#define Class_String_Type string_
#define Class_Array_Type array_
#define Class_List_Type list_
#define Class_Set_Type set_
#define Class_Bag_Type bag_
#define Class_Generic_Type generic_
#define Class_Select_Type select_
#define Class_Reference_Type reference_
#define Class_Aggregate_Type aggregate_
/****************/
/* modules used */
/****************/
@@ -172,9 +139,8 @@ typedef enum type_enum Class;
/***************************/
struct TypeHead_ {
Type head; /* if we are a defined type */
/* this is who we point to */
struct TypeBody_ * body; /* true type, ignoring defined types */
Type head; /**< if we are a defined type this is who we point to */
struct TypeBody_ * body; /**< true type, ignoring defined types */
#if 0
/* if we are concerned about memory (over time) uncomment this and */
/* other references to refcount in parser and TYPEresolve. It is */
@@ -185,30 +151,25 @@ struct TypeHead_ {
struct TypeBody_ {
#if 1
struct TypeHead_ * head; /* for debugging only */
struct TypeHead_ * head; /**< for debugging only */
#endif
enum type_enum type; /* bits describing this type, int, real, etc */
enum type_enum type; /**< bits describing this type, int, real, etc */
struct {
unsigned unique : 1;
unsigned optional : 1;
unsigned fixed : 1;
unsigned shared : 1; /* type is shared */
unsigned repeat : 1; /* expression is a repeat count*/
unsigned encoded : 1; /* encoded string */
unsigned shared : 1; /**< type is shared */
unsigned repeat : 1; /**< expression is a repeat count*/
unsigned encoded : 1; /**< encoded string */
} flags;
Type base; /* underlying base type if any */
/* can also contain true type if this type */
/* is a type reference */
Type tag; /* optional tag */
Type base; /**< underlying base type if any can also contain true type if this type is a type reference */
Type tag; /**< optional tag */
/* a lot of the stuff below can be unionized */
Expression precision;
Linked_List list; /* used by select_types */
/* and composed types, such as for a */
/* list of entities in an instance */
/* Dictionary enumeration; *//* only used by enumerations */
Linked_List list; /**< used by select_types and composed types, such as for a list of entities in an instance */
Expression upper;
Expression lower;
struct Scope_ * entity; /* only used by entity types */
struct Scope_ * entity; /**< only used by entity types */
};
/********************/
@@ -223,41 +184,41 @@ struct TypeBody_ {
/* Very commonly-used read-only types */
/* non-constant versions probably aren't necessary? */
GLOBAL Type Type_Bad;
GLOBAL Type Type_Unknown;
GLOBAL Type Type_Dont_Care;
GLOBAL Type Type_Runtime; /* indicates that this object can't be */
/* calculated now but must be deferred */
/* til (the mythical) runtime */
GLOBAL Type Type_Binary;
GLOBAL Type Type_Boolean;
GLOBAL Type Type_Enumeration;
GLOBAL Type Type_Expression;
GLOBAL Type Type_Aggregate;
GLOBAL Type Type_Integer;
GLOBAL Type Type_Integer;
GLOBAL Type Type_Number;
GLOBAL Type Type_Real;
GLOBAL Type Type_String;
GLOBAL Type Type_String_Encoded;
GLOBAL Type Type_Logical;
GLOBAL Type Type_Set;
GLOBAL Type Type_Attribute;
GLOBAL Type Type_Entity;
GLOBAL Type Type_Funcall;
GLOBAL Type Type_Generic;
GLOBAL Type Type_Identifier;
GLOBAL Type Type_Oneof;
GLOBAL Type Type_Query;
GLOBAL Type Type_Self;
GLOBAL Type Type_Set_Of_String;
GLOBAL Type Type_Set_Of_Generic;
GLOBAL Type Type_Bag_Of_Generic;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Bad;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Unknown;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Dont_Care;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Runtime; /**< indicates that this object can't be
calculated now but must be deferred
until (the mythical) runtime */
GLOBAL SCL_EXPRESS_EXPORT Type Type_Binary;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Boolean;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Enumeration;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Expression;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Aggregate;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Integer;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Integer;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Number;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Real;
GLOBAL SCL_EXPRESS_EXPORT Type Type_String;
GLOBAL SCL_EXPRESS_EXPORT Type Type_String_Encoded;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Logical;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Set;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Attribute;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Entity;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Funcall;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Generic;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Identifier;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Oneof;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Query;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Self;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Set_Of_String;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Set_Of_Generic;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Bag_Of_Generic;
GLOBAL struct freelist_head TYPEHEAD_fl;
GLOBAL struct freelist_head TYPEBODY_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head TYPEHEAD_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head TYPEBODY_fl;
GLOBAL Error ERROR_corrupted_type INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_corrupted_type INITIALLY( ERROR_none );
#include "de_end.h"
@@ -274,12 +235,13 @@ GLOBAL Error ERROR_corrupted_type INITIALLY( ERROR_none );
#define TYPEis_identifier(t) ((t)->u.type->body->type == identifier_)
#define TYPEis_logical(t) ((t)->u.type->body->type == logical_)
#define TYPEis_boolean(t) ((t)->u.type->body->type == boolean_)
#define TYPEis_real(t) ((t)->u.type->body->type == real_)
#define TYPEis_integer(t) ((t)->u.type->body->type == integer_)
#define TYPEis_string(t) ((t)->u.type->body->type == string_)
#define TYPEis_expression(t) ((t)->u.type->body->type == op_)
#define TYPEis_oneof(t) ((t)->u.type->body->type == oneof_)
#define TYPEis_entity(t) ((t)->u.type->body->type == entity_)
#define TYPEis_enumeration(t) ((t)->u.type->body->type == enumeration_)
/*#define TYPEis_aggregate(t) ((t)->u.type->body->type >= aggregate_ && (t)->u.type->body->type < last_aggregate_)*/
#define TYPEis_aggregate(t) ((t)->u.type->body->base)
#define TYPEis_aggregate_raw(t) ((t)->u.type->body->type == aggregate_)
#define TYPEis_array(t) ((t)->u.type->body->type == array_)
@@ -315,7 +277,6 @@ GLOBAL Error ERROR_corrupted_type INITIALLY( ERROR_none );
#define COMP_TYPEput_items(t,lis) ((t)->u.type->body->list = (lis))
#define COMP_TYPEadd_items(t,lis) LISTadd_all((t)->u.type->body->list, (lis));
/*#define ENUM_TYPEput_items(type,list) COMP_TYPEput_items(type, list)*/
#define ENUM_TYPEget_items(t) ((t)->symbol_table)
#define TYPEget_optional(t) ((t)->u.type->body->flags.optional)
#define TYPEget_unique(t) ((t)->u.type->body->flags.unique)
@@ -328,9 +289,6 @@ GLOBAL Error ERROR_corrupted_type INITIALLY( ERROR_none );
#define TYPEget_enum_tags(t) ((t)->symbol_table)
/* for backwards compatibility */
#define AGGR_TYPEget_base_type TYPEget_base_type
#define TYPEget_clientData(t) ((t)->clientData)
#define TYPEput_clientData(t,d) ((t)->clientData = (d))
@@ -338,40 +296,19 @@ GLOBAL Error ERROR_corrupted_type INITIALLY( ERROR_none );
/* function prototypes */
/***********************/
extern Type TYPEcreate_partial PROTO( ( struct Symbol_ *, Scope ) );
extern SCL_EXPRESS_EXPORT Type TYPEcreate_partial PROTO( ( struct Symbol_ *, Scope ) );
extern Type TYPEcreate PROTO( ( enum type_enum ) );
extern Type TYPEcreate_from_body_anonymously PROTO( ( TypeBody ) );
extern Type TYPEcreate_name PROTO( ( struct Symbol_ * ) );
extern Type TYPEcreate_nostab PROTO( ( struct Symbol_ *, Scope, char ) );
/*extern Type TYPEcreate_typedef PROTO((Type, TypeBody,
Scope,struct Symbol *));*/
extern TypeBody TYPEBODYcreate PROTO( ( enum type_enum ) );
/*extern Type TYPEcopy_shallow PROTO((Type));*/
extern void TYPEinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT Type TYPEcreate PROTO( ( enum type_enum ) );
extern SCL_EXPRESS_EXPORT Type TYPEcreate_from_body_anonymously PROTO( ( TypeBody ) );
extern SCL_EXPRESS_EXPORT Type TYPEcreate_name PROTO( ( struct Symbol_ * ) );
extern SCL_EXPRESS_EXPORT Type TYPEcreate_nostab PROTO( ( struct Symbol_ *, Scope, char ) );
extern SCL_EXPRESS_EXPORT TypeBody TYPEBODYcreate PROTO( ( enum type_enum ) );
extern SCL_EXPRESS_EXPORT void TYPEinitialize PROTO( ( void ) );
#if 0
extern Dictionary TYPEget_enum_tags PROTO( ( Type ) );
#endif
extern bool TYPEinherits_from PROTO( ( Type, enum type_enum ) );
extern Type TYPEget_nonaggregate_base_type PROTO( ( Type ) );
extern SCL_EXPRESS_EXPORT bool TYPEinherits_from PROTO( ( Type, enum type_enum ) );
extern SCL_EXPRESS_EXPORT Type TYPEget_nonaggregate_base_type PROTO( ( Type ) );
extern Type TYPEcreate_user_defined_type PROTO( ( Type, Scope, struct Symbol_ * ) );
extern Type TYPEcreate_user_defined_tag PROTO( ( Type, Scope, struct Symbol_ * ) );
#if 0
extern int TYPEget_size PROTO( ( Type ) );
extern bool TYPEcompatible PROTO( ( Type, Type ) );
extern Expression SZD_TYPEget_precision PROTO( ( Sized_Type ) );
extern bool SZD_TYPEget_varying PROTO( ( Sized_Type ) );
extern Expression TYPE_REFget_full_name PROTO( ( Type_Reference * ) );
#endif /*0*/
/********************/
/* inline functions */
/********************/
#if supports_inline_functions || defined(TYPE_C)
#endif /* supports_inline_functions || defined(TYPE_C) */
extern SCL_EXPRESS_EXPORT Type TYPEcreate_user_defined_type PROTO( ( Type, Scope, struct Symbol_ * ) );
extern SCL_EXPRESS_EXPORT Type TYPEcreate_user_defined_tag PROTO( ( Type, Scope, struct Symbol_ * ) );
#endif /* TYPE_H */
+18 -50
View File
@@ -1,10 +1,8 @@
#ifndef VARIABLE_H
#define VARIABLE_H
/* $Id: variable.h,v 1.10 1997/01/21 19:17:11 dar Exp $ */
/************************************************************************
** Module: Variable
/** **********************************************************************
** Module: Variable \file variable.h
** Description: This module implements the Variable abstraction. A
** Variable consists of a name, a type, a reference class, and
** some flags, e.g. 'optional', 'variable'. It is used to represent
@@ -78,26 +76,23 @@ typedef struct Variable_ * Variable;
/***************************/
struct Variable_ {
/* Symbol is inside of 'name' below */
Expression name;
Type type;
Expression initializer; /* or 'derived' */
int offset;
Expression name; /**< Symbol is inside of 'name' below */
Type type;
Expression initializer; /**< or 'derived' */
int offset;
struct {
int optional : 1; /* OPTIONAL keyword */
int var : 1; /* VAR keyword */
int constant : 1; /* from CONSTANT...END_CONSTANT */
int unique : 1; /* appears in UNIQUE list */
int parameter : 1; /* is a formal parameter */
int attribute : 1; /* is an attribute (rule parameters */
/* are marked this way, too) */
int optional : 1; /**< OPTIONAL keyword */
int var : 1; /**< VAR keyword */
int constant : 1; /**< from CONSTANT...END_CONSTANT */
int unique : 1; /**< appears in UNIQUE list */
int parameter : 1; /**< is a formal parameter */
int attribute : 1; /**< is an attribute (rule parameters are marked this way, too) */
} flags;
#define query_symbol inverse_symbol
Symbol * inverse_symbol; /* entity symbol */
Variable inverse_attribute; /* attribute related by */
/* inverse relationship */
Symbol * inverse_symbol; /**< entity symbol */
Variable inverse_attribute; /**< attribute related by inverse relationship */
};
/********************/
@@ -110,7 +105,7 @@ struct Variable_ {
#include "decstart.h"
#endif /* VARIABLE_C */
GLOBAL struct freelist_head VAR_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head VAR_fl;
#include "de_end.h"
@@ -133,40 +128,13 @@ GLOBAL struct freelist_head VAR_fl;
#define VARis_derived(v) ((v)->initializer != 0)
#define VARget_inverse(v) ((v)->inverse_attribute)
/* for backwards compatibility */
#define VARget_derived VARis_derived
/***********************/
/* function prototypes */
/***********************/
extern Variable VARcreate PROTO( ( Expression, Type ) );
extern void VARinitialize PROTO( ( void ) );
extern char * VARget_simple_name PROTO( ( Variable ) );
#if 0
extern void VARput_type PROTO( ( Variable *, Type ) );
extern void VARput_initializer PROTO( ( Variable *, Expression ) );
extern void VARput_derived PROTO( ( Variable *, Boolean ) );
extern void VARput_optional PROTO( ( Variable *, Boolean ) );
extern void VARput_variable PROTO( ( Variable *, Boolean ) );
extern void VARput_reference PROTO( ( Variable *, Expression ) );
/*Mextern void VARput_offset PROTO((Variable *, int));*/
extern void VARput_inverse PROTO( ( Variable *, Symbol * ) );
/*M extern Type VARget_type PROTO((Variable *));*/
/*Mextern Boolean VARget_derived PROTO((Variable *));*/
extern Boolean VARget_optional PROTO( ( Variable * ) );
extern Boolean VARget_variable PROTO( ( Variable * ) );
extern Expression VARget_reference PROTO( ( Variable * ) );
/*Mextern int VARget_offset PROTO((Variable *));*/
#endif /*0*/
/********************/
/* inline functions */
/********************/
#if supports_inline_functions || defined(VARIABLE_C)
#endif /* supports_inline_functions || defined(VARIABLE_C) */
extern SCL_EXPRESS_EXPORT Variable VARcreate PROTO( ( Expression, Type ) );
extern SCL_EXPRESS_EXPORT void VARinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT char * VARget_simple_name PROTO( ( Variable ) );
#endif /* VARIABLE_H */
+12 -2
View File
@@ -1,13 +1,23 @@
#ifndef SCL_CF_H
#define SCL_CF_H
/**** Define statements for CMake ****/
#cmakedefine HAVE_NDIR_H 1
#cmakedefine HAVE_STDARG_H 1
#cmakedefine HAVE_SYS_STAT_H 1
#cmakedefine HAVE_SYS_PARAM_H 1
#cmakedefine HAVE_SYSENT_H 1
#cmakedefine HAVE_UNISTD_H 1
#cmakedefine HAVE_DIRENT_H 1
#cmakedefine HAVE_STDBOOL_H 1
#cmakedefine HAVE_PROCESS_H 1
#cmakedefine HAVE_IO_H 1
#cmakedefine HAVE_ABS 1
#cmakedefine HAVE_MEMCPY 1
#cmakedefine HAVE_MEMMOVE 1
#cmakedefine HAVE_GETOPT 1
#cmakedefine HAVE_SSIZE_T 1
//cmake updates this at build time
#define SCL_COMMIT_ID "@GIT_COMMIT_ID@"
#endif /* SCL_CF_H */
+82
View File
@@ -0,0 +1,82 @@
#ifndef SCL_EXPORT_H
#define SCL_EXPORT_H
/* Import/Export flags for express. */
#ifndef SCL_EXPRESS_EXPORT
# if defined(SCL_EXPRESS_DLL_EXPORTS) && defined(SCL_EXPRESS_DLL_IMPORTS)
# error "Only SCL_EXPRESS_DLL_EXPORTS or SCL_EXPRESS_DLL_IMPORTS can be defined, not both."
# elif defined(SCL_EXPRESS_DLL_EXPORTS)
# define SCL_EXPRESS_EXPORT __declspec(dllexport)
# elif defined(SCL_EXPRESS_DLL_IMPORTS)
# define SCL_EXPRESS_EXPORT __declspec(dllimport)
# else
# define SCL_EXPRESS_EXPORT
# endif
#endif
/* Import/Export flags for exppp. */
#ifndef SCL_EXPPP_EXPORT
# if defined(SCL_EXPPP_DLL_EXPORTS) && defined(SCL_EXPPP_DLL_IMPORTS)
# error "Only SCL_EXPPP_DLL_EXPORTS or SCL_EXPPP_DLL_IMPORTS can be defined, not both."
# elif defined(SCL_EXPPP_DLL_EXPORTS)
# define SCL_EXPPP_EXPORT __declspec(dllexport)
# elif defined(SCL_EXPPP_DLL_IMPORTS)
# define SCL_EXPPP_EXPORT __declspec(dllimport)
# else
# define SCL_EXPPP_EXPORT
# endif
#endif
/* Import/Export flags for utils. */
#ifndef SCL_UTILS_EXPORT
# if defined(SCL_UTILS_DLL_EXPORTS) && defined(SCL_UTILS_DLL_IMPORTS)
# error "Only SCL_UTILS_DLL_EXPORTS or SCL_UTILS_DLL_IMPORTS can be defined, not both."
# elif defined(SCL_UTILS_DLL_EXPORTS)
# define SCL_UTILS_EXPORT __declspec(dllexport)
# elif defined(SCL_UTILS_DLL_IMPORTS)
# define SCL_UTILS_EXPORT __declspec(dllimport)
# else
# define SCL_UTILS_EXPORT
# endif
#endif
/* Import/Export flags for dai. */
#ifndef SCL_DAI_EXPORT
# if defined(SCL_DAI_DLL_EXPORTS) && defined(SCL_DAI_DLL_IMPORTS)
# error "Only SCL_DAI_DLL_EXPORTS or SCL_DAI_DLL_IMPORTS can be defined, not both."
# elif defined(SCL_DAI_DLL_EXPORTS)
# define SCL_DAI_EXPORT __declspec(dllexport)
# elif defined(SCL_DAI_DLL_IMPORTS)
# define SCL_DAI_EXPORT __declspec(dllimport)
# else
# define SCL_DAI_EXPORT
# endif
#endif
/* Import/Export flags for core. */
#ifndef SCL_CORE_EXPORT
# if defined(SCL_CORE_DLL_EXPORTS) && defined(SCL_CORE_DLL_IMPORTS)
# error "Only SCL_CORE_DLL_EXPORTS or SCL_CORE_DLL_IMPORTS can be defined, not both."
# elif defined(SCL_CORE_DLL_EXPORTS)
# define SCL_CORE_EXPORT __declspec(dllexport)
# elif defined(SCL_CORE_DLL_IMPORTS)
# define SCL_CORE_EXPORT __declspec(dllimport)
# else
# define SCL_CORE_EXPORT
# endif
#endif
/* Import/Export flags for editor. */
#ifndef SCL_EDITOR_EXPORT
# if defined(SCL_EDITOR_DLL_EXPORTS) && defined(SCL_EDITOR_DLL_IMPORTS)
# error "Only SCL_EDITOR_DLL_EXPORTS or SCL_EDITOR_DLL_IMPORTS can be defined, not both."
# elif defined(SCL_EDITOR_DLL_EXPORTS)
# define SCL_EDITOR_EXPORT __declspec(dllexport)
# elif defined(SCL_EDITOR_DLL_IMPORTS)
# define SCL_EDITOR_EXPORT __declspec(dllimport)
# else
# define SCL_EDITOR_EXPORT
# endif
#endif
#endif /* SCL_EXPORT_H */
+54
View File
@@ -0,0 +1,54 @@
#ifndef STDBOOL_H_
#define STDBOOL_H_
/**
* stdbool.h - ISO C99 Boolean type
* Author - Bill Chatfield
* E-mail - bill underscore chatfield at yahoo dot com
* Copyright - You are free to use for any purpose except illegal acts
* Warrenty - None: don't blame me if it breaks something
*
* In ISO C99, stdbool.h is a standard header and _Bool is a keyword, but
* some compilers don't offer these yet. This header file is an
* implementation of the standard ISO C99 stdbool.h header file. It checks
* for various compiler versions and defines things that are missing in
* those versions.
*
* The GNU and Watcom compilers include a stdbool.h, but the Borland
* C/C++ 5.5.1 compiler and the Microsoft compilers do not.
*
* See http://predef.sourceforge.net/precomp.html for compile macros.
*/
#ifndef __cplusplus
/**
* Borland C++ 5.5.1 does not define _Bool.
*/
#if defined(__BORLANDC__) && __BORLANDC__ < 0x630
typedef int _Bool;
#endif
/**
* Microsoft C/C++ version 14.00.50727.762, which comes with Visual C++ 2005,
* and version 15.00.30729.01, which comes with Visual C++ 2008, do not
* define _Bool.
*/
#if defined(_MSC_VER)
typedef int _Bool;
#endif
/**
* Define the Boolean macros only if they are not already defined.
*/
#ifndef __bool_true_false_are_defined
#define bool _Bool
#define Boolean _Bool
#define false 0
#define true 1
#define __bool_true_false_are_defined 1
#endif
#endif /* __cplusplus */
#endif /*STDBOOL_H_*/
-245
View File
@@ -1,245 +0,0 @@
#ifndef SCLPREFIXES_H
#define SCLPREFIXES_H
/* **********************
The macro SCLP23_NAME is used in header files and for constructor/destructor
class function names in corresponding .cc files.
The macro SCLP23 is used everywhere else.
********************* */
// *note* Currently the IDL generated code is not in a namespace.
//#undef NO_P26_NAMESPACE
//#define NO_P26_NAMESPACE 1
// P stands for Part (yeah, it's just to make it short & unique - hopefully)
// as in Part 23 or Part 26.
#ifdef PART26 // SCL's Part 23 is providing the implementation for the Part 26
// Orbix-generated software interface.
// The namespace is specified to be SDAI by Part 26 and Part 23
// Since Part 23 and Part 26 defined objects are suppose to have the same
// names and are supposed to be defined in a namespace called SDAI, define
// the namespaces names for Part 23 and 26 to be different (to avoid conflict)
// This is the namespace for SCL's Part 23 SDAI.
#define P23_NAMESPACE P23
// Whenever you have something like P23_NAMESPACE##_name the preprocessor
// does the concatenation first then substitutes things. Thus you get
// P23_NAMESPACE_name instead of <whatever P23_NAMESPACE is>_name. If you
// call P23_NAMESPACE_F() like P23_NAMESPACE_F(_name) you get
// whatever P23_NAMESPACE is>_name like you want. The user never has to
// use this macro. It is used in the definition of macros the user uses like
// SCLP23() and SCLP23_NAME().
#define P23_NAMESPACE_F(x) P23##x
// This was used by the ITI code. It holds the same meaning as P23_NAMESPACE
#define IMP_NAMESPACE P23_NAMESPACE
#define IMP_NAMESPACE_F(x) P23_NAMESPACE_F(x)
// as defined by original ITI code
// #define IMP_NAMESPACE P26_SDAI
// This is the namespace used by the IDL generated code implementing Part 26.
//
// define NO_P26_NAMESPACE if you are not going to define an encapsulating
// module in the idl. If you define a module named SDAI then you will have to
// refer to the class for interface PID (e.g.) as SDAI::PID and you will have
// to refer to the macros as DEF_TIE_SDAI_PID() and TIE_SDAI_PID() instead of
// DEF_TIE_PID() and TIE_PID(). DEF_TIE_IDL_MODULE() and TIE_IDL_MODULE()
// handle this problem in the code.
// You should define P26_NAMESPACE the same as the name you use for the idl
// module. Without a module you should define NO_P26_NAMESPACE
//
// DEF_TIE_IDL_MODULE handles the DEF_TIE macro depending on whether a module
// name was used in the idl. e.g. for class/interface named PID
//#define SDAI_DEF_TIE_PID(X) DEF_TIE_IDL_MODULE(PID,X)
// replaces either of these two stmts in your code depending on whether a
// module name SDAI was used.
//#define SDAI_DEF_TIE_PID(X) DEF_TIE_PID(X)
//#define SDAI_DEF_TIE_PID(X) DEF_TIE_SDAI_PID(X)
//
// TIE_IDL_MODULE handles the TIE macro depending on whether a module
// name was used in the idl. e.g. for class/interface named PID
//#define _SDAI_TIE_PID_(X) TIE_IDL_MODULE(PID,X)
// replaces either of these two stmts in your code depending on whether a
// module name SDAI was used.
//#define _SDAI_TIE_PID_(X) TIE_PID(X)
//#define _SDAI_TIE_PID_(X) TIE_SDAI_PID(X)
#ifdef NO_P26_NAMESPACE
#define P26_NAMESPACE
#define P26_NAMESPACE_F(x) x
#define DEF_TIE_IDL_MODULE(x,y) DEF_TIE_##x(y)
#define TIE_IDL_MODULE(x,y) TIE_##x(y)
#else
// edit "SDAI" here to match the name of your module
#define P26_NAMESPACE SDAI
#define P26_NAMESPACE_F(x) SDAI##x
#define DEF_TIE_IDL_MODULE(x,y) DEF_TIE_SDAI_##x(y)
#define TIE_IDL_MODULE(x,y) TIE_SDAI_##x(y)
#endif
// This would be the namespace for your application schema.
// This is for the ITI-developed code. It really shouldn't go here - DAS
#define APP_NAMESPACE P26_Simple_geometry
#else // SCL's Part 23 is not providing the implementation for the Part 26
// Orbix-generated software interface.
// This is the namespace for SCL's Part 23 SDAI.
#define P23_NAMESPACE SDAI
#define P23_NAMESPACE_F(x) SDAI##x
// This was used by the ITI code. It holds the same meaning as P23_NAMESPACE
#define IMP_NAMESPACE P23_NAMESPACE
#define IMP_NAMESPACE_F(x) P23_NAMESPACE_F(x)
// as defined by original ITI code
// #define IMP_NAMESPACE SDAI
// This is the namespace used by the IDL generated code implementing Part 26.
// **Note this should never be used if PART26 is not defined.
#define P26_NAMESPACE
#define P26_NAMESPACE_F(x) x
// This would be the namespace for your application schema.
// This is for the ITI-developed code. It really shouldn't go here - DAS
#define APP_NAMESPACE Simple_geometry
#endif
#define CC_NO_NESTED_CLASSES 1
#ifdef CC_NO_NESTED_CLASSES
///////////////////////
// Use this macro to enclose objects generated from IDL interface types.
// i.e. Part 26 based generated types.
// Use this with types that will ONLY ever be Part 26 types. For types
// that can switch use PART22() macro.
// Used with the IDL compiler generated C++ - DAS
#define SCLP26(X) P26_NAMESPACE_F(_##X)
// Used by ITI code to enclose objects generated from IDL interface types.
// This is used for function arguments and return types that need to be
// either the Part 26 version or the Part 23 version depending on whether
// the Part 23 interface is being used standalone or to implement Orbix
// implementation objects using the TIE approach. - DAS
// This one is defined to use the Part 26 defined type for use with Orbix.
#define SCLP22_NAME(X) P26_NAMESPACE_F(_##X)
#define SCLP22(X) P26_NAMESPACE_F(_##X)
// as defined by ITI
// #define SCLP22(X) SDAI_##X
// Use this macro to enclose references to CORBA types.
// Used with the Orbix base C++ types/classes #included via CORBA.h.
// i.e. not used with types/interfaces generated from a users IDL schema.
// DAS
#define CORBA_REF(X) CORBA_##X
// I don't understand why this is necessary - DAS
// Use this macro to enclose references to CORBA Object and Object_ptr
#define SCLP22_BASE(X) CORBA_##X
// SCLP23_NAME is used in header files and for constructor/destructor
// class function names in corresponding .cc files.
// Use this macro to enclose declarations of implementation types.
#define SCLP23_NAME(x) P23_NAMESPACE_F(_##x)
// SCLP23 is used everywhere else.
// Use this macro to enclose uses of Part 23 based (implementation) types.
#define SCLP23(x) P23_NAMESPACE_F(_##x)
// Use this macro to enclose references to implementation types
// whose names have already been qualified
// I don't understand this macros use - DAS
#define SCLP23_SPACE(x) x
// INTEGRATION appmacros here...
#define SCLP22_SIMPLE_GEOMETRY(X) SDAI_Simple_geometry_##X
#define SCLP23_SIMPLE_GEOMETRY_NAME(x) APP_NAMESPACE##_##x
#define SCLP23_SIMPLE_GEOMETRY(x) APP_NAMESPACE##_##x
///////////////////////////////////
#else // nested classes are allowed by the compiler
/////////////////////////////////////
///////////////////////
// Use this macro to enclose objects generated from IDL interface types.
// i.e. Part 26 based generated types.
// Used with the IDL compiler generated C++ - DAS
#ifdef NO_P26_NAMESPACE
#define SCLP26(X) X
#else
#define SCLP26(X) P26_NAMESPACE_F(::##X)
#endif
// Used by ITI code to enclose objects generated from IDL interface types.
// This is used for function arguments and return types that need to be
// either the Part 26 version or the Part 23 version depending on whether
// the Part 23 interface is being used standalone or to implement Orbix
// implementation objects using the TIE approach. - DAS
// This one is defined to use the Part 26 defined type for use with Orbix.
#ifdef NO_P26_NAMESPACE
#define SCLP22_NAME(X) X
#define SCLP22(X) X
#else
#define SCLP22_NAME(X) P26_NAMESPACE_F(::##X)
#define SCLP22(X) P26_NAMESPACE_F(::##X)
#endif
// as defined by ITI
// #define SCLP22(X) SDAI::##X
// Use this macro to enclose references to CORBA types.
// Used with the Orbix base C++ types/classes #included via CORBA.h.
// i.e. not used with types/interfaces generated from a users IDL schema.
// DAS
#define CORBA_REF(X) CORBA::##X
// I don't understand why this is necessary - DAS
// Use this macro to enclose references to CORBA Object and Object_ptr
#define SCLP22_BASE(X) CORBA::##X
// SCLP23_NAME is used in header files and for constructor/destructor
// class function names in corresponding .cc files.
// Use this macro to enclose declarations of implementation types.
#ifdef PART26
#define SCLP23_NAME(x) P23_NAMESPACE_F(_imp##x)
// #define SCLP23_NAME(x) imp##x
#else
#define SCLP23_NAME(x) x
#endif
// SCLP23 is used everywhere else.
// Use this macro to enclose uses of Part 23 based (implementation) types.
#ifdef PART26
#define SCLP23(x) P23_NAMESPACE_F(_imp##x)
// #define SCLP23(x) P23_NAMESPACE_F(::##imp##x)
#else
#define SCLP23(x) P23_NAMESPACE_F(::##x)
#endif
// as defined by ITI
// #define SCLP23(x) IMP_NAMESPACE_F(::imp##x)
// Use this macro to enclose references to implementation types
// whose names have already been qualified
// I don't understand this macros use - DAS
#ifdef PART26
#define SCLP23_SPACE(x) P23_NAMESPACE_F(_imp##x)
// #define SCLP23_SPACE(x) P23_NAMESPACE_F(::##imp##x)
#else
#define SCLP23_SPACE(x) IMP_NAMESPACE_F(::x)
#endif
// INTEGRATION appmacros here...
#define SCLP22_SIMPLE_GEOMETRY(X) SDAI::Simple_geometry::##X
#define SCLP23_SIMPLE_GEOMETRY_NAME(x) imp##x
#define SCLP23_SIMPLE_GEOMETRY(x) APP_NAMESPACE::imp##x
/////////////////////////////////////
#endif
#endif
+31
View File
@@ -0,0 +1,31 @@
// XGetopt.h Version 1.2
//
// Author: Hans Dietrich
// hdietrich2@hotmail.com
//
// This software is released into the public domain.
// You are free to use it in any way you like.
//
// This software is provided "as is" with no expressed
// or implied warranty. I accept no liability for any
// damage or loss of business that this software may cause.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef XGETOPT_H
#define XGETOPT_H
#ifdef __cplusplus
extern "C" {
#endif
extern int optind, opterr;
extern char * optarg;
int getopt( int argc, char * argv[], char * optstring );
#ifdef __cplusplus
}
#endif
#endif //XGETOPT_H
+1 -1
View File
@@ -4,7 +4,7 @@
# astyle --options=misc/astyle.cfg path/to/file
#run astyle on all files: from the scl root dir, use
# astyle --options=misc/astyle.cfg --recursive "src/*.c" "src/*.cc" "include/*.h"
# astyle --options=misc/astyle.cfg --recursive "src/*.c" "src/*.cc" "include/*.h" "src/*.h"
# in the above line, the double quotes *are* necessary
# DO NOT run astyle on flex/bison input such as expparse.y and expscan.l!
+6 -4
View File
@@ -9,7 +9,7 @@ result_dir="."
mk="make -j4"
#separated by ; for cmake
schemas="../data/ap203/203wseds.exp;../data/ap203e2/ap203e2_mim_lf.exp;../data/ap210e3/ap210e3_wip1.41_mim_lf.exp;../data/ap214e3/AP214E3_2010.exp;../data/ap227/ap227.exp;../data/ap235/AP235-aim-long.exp;../data/ap240/AP240_aim_lf.exp;../data/cd209/part409cdts_wg3n2617mim_lf.exp;../data/cd242/242_n2813_mim_lf.exp;../data/ifc2x3/IFC2X3_TC1.exp;../data/ifc2x4/IFC2X4_RC2.exp;../data/ISO15926/15926-0002-lifecycle_integration.exp"
schemas="../data/203wseds/203wseds.exp;../data/ap203e2/ap203e2_mim_lf.exp;../data/ap210e2/ap210e2_v1_40_mim_lf.exp;../data/wip210e3/210e3_wip_v1_41_mim_lf.exp;../data/ap214e3/AP214E3_2010.exp;../data/ap227/ap227.exp;../data/ap235/AP235_TC_engineering_properties_schema_20110222.exp;../data/ap240/AP240_aim_lf.exp;../data/cd209/part409cdts_wg3n2617mim_lf.exp;../data/cd242/242_n2813_mim_lf.exp;../data/ifc2x3/IFC2X3_TC1.exp;../data/ifc2x4/IFC2X4_RC3.exp;../data/ISO15926/15926-0002-lifecycle_integration.exp"
#count warnings and errors, append to $matrix_file. creates hypertext links to stderr,stdout txt
# $1 is the name of the row, $2 is the path and first part of the filename, $3 is the schema
function count_we {
@@ -78,11 +78,12 @@ function fedex_details {
function build_one_schema {
#set $i to the schema name, all caps (to match fedex_plus output)
i=`sed -ne '0,/^\s*SCHEMA/s/^.*SCHEMA\s\+\(.*\);.*$/\1/p;' $1|tr a-z A-Z`
d=`echo $1|sed -e 's|^.*/\([^/]*\)\.exp$|\1|;'`
echo "Running fedex_plus and gcc for $i..."
make -f data/CMakeFiles/sdai_$i.dir/build.make $i/compstructs.cc 2>"$result_dir/fedex_"$i"_stderr.txt" >"$result_dir/fedex_"$i"_stdout.txt" && \
$mk sdai_$i >/dev/null 2>"$result_dir/compile_libsdai_"$i"_stderr.txt" && \
$mk p21read_sdai_$i >/dev/null 2>"$result_dir/compile_p21read_sdai_"$i"_stderr.txt"
make generate_cpp_$d 2>"$result_dir/fedex_"$i"_stderr.txt" >"$result_dir/fedex_"$i"_stdout.txt" && \
$mk sdai_$d >/dev/null 2>"$result_dir/compile_libsdai_"$i"_stderr.txt" && \
$mk p21read_sdai_$d >/dev/null 2>"$result_dir/compile_p21read_sdai_"$i"_stderr.txt"
#todo: test p21read_sdai_$i
}
@@ -130,6 +131,7 @@ function gen_wiki {
git log --decorate=short -n1 |\
head -n1 |\
sed -e 's|^.*commit \([a-z0-9]\+\) .*$|### Current as of commit [\1](http://github.com/mpictor/StepClassLibrary/commit/\1)|;' >>$matrix_file
echo -e "\n## See also [PLIB build matrix](http://github.com/mpictor/StepClassLibrary/wiki/PLIB-build-matrix)\n\n" >>$matrix_file
echo "<table border=1>" >>$matrix_file
echo "<tr><th>Key</th></tr><tr><td><table width=100%>" >>$matrix_file
echo "<tr><th>Item</th><th>Description</th></tr>" >>$matrix_file
+235
View File
@@ -0,0 +1,235 @@
#!/usr/bin/env python
#you probably want to run the ctest script that calls this instead:
# ctest -S ctest_matrix.cmake
#must be ran from scl/build_matrix
from xml.etree import ElementTree as ET
import os
from datetime import date
import subprocess
import codecs
import io
#ctest xml file layout
#<Site ...=...>
# <testing>
# <StartDateTime>..</>
# <StartTestTime>..</>
# <TestList>..</>
# <Test status=..>..</>
# <EndDateTime>Dec 28 17:49 EST</EndDateTime>
# <EndTestTime>1325112579</EndTestTime>
# <ElapsedMinutes>1.9</ElapsedMinutes>
# </Testing>
#</Site>
#summary (aka 's') is a table near the top of the document
#body (aka 'b') contains the details for all schemas
def main():
xml_file = find_xml()
wikipath, matrix = find_wiki()
#codecs.open is deprecated but io.open doesn't seem to work, and open() complains of unicode
out = codecs.open(matrix,encoding='utf-8',mode='w')
out.write( header() )
out.write( read_tests(xml_file) )
out.close()
git_push(wikipath, matrix)
def find_xml():
#find xml file
i = 0
for dirname in os.listdir("Testing"):
if str(date.today().year) in dirname:
i += 1
if i > 1:
print "Too many directories, exiting"
exit(1)
xml = os.path.join("Testing", dirname, "Test.xml")
return xml
def find_wiki():
#find wiki and matrix file, issue 'git pull'
wikipath = os.path.abspath("../../wiki-scl")
if not os.path.isdir(os.path.join(wikipath,".git")):
print "Can't find wiki or not a git repo"
exit(1)
p = subprocess.call(["git", "pull", "origin"], cwd=wikipath)
if not p == 0:
print "'git pull' exited with error"
exit(1)
matrix = os.path.join(wikipath, "Schema-build-matrix.md")
if not os.path.isfile(matrix):
print "Matrix file doesn't exist or isn't a file"
exit(1)
return wikipath,matrix
def git_push(path,f):
p = subprocess.call(["git", "add", f], cwd=path)
if not p == 0:
print "'git add' exited with error"
exit(1)
msg = date.today().__str__() + " - schema matrix updated by update-matrix.py"
p = subprocess.call(["git", "commit", "-m", msg ], cwd=path)
if not p == 0:
print "'git commit' exited with error"
exit(1)
p = subprocess.call(["git", "push", "origin"], cwd=path)
if not p == 0:
print "'git push' exited with error"
exit(1)
def header():
h = "## Created " + date.today().__str__() + "\n" + "### Current as of commit "
l = subprocess.check_output(["git", "log", """--pretty=format:%H Commit Summary: %s<br>Author: %aN<br>Date: %aD""", "-n1"])
h += "[" + l[:8] + "](http://github.com/mpictor/StepClassLibrary/commit/" + l[:l.find(" ")]
h += ") --\n<font color=grey>" + l[l.find(" ")+1:] + "</font>\n\n----\n"
h += "### Summary\n<table width=100%><tr><th>Schema</th><th>Generate</th><th>Build</th></tr>"
return h
def read_tests(xml):
# read all <Test>s in xml, create mixed html/markdown
try:
tree = ET.parse(xml)
except Exception, inst:
print "Unexpected error opening %s: %s" % (xml, inst)
return
root = tree.getroot()
testing = root.find("Testing")
tests = testing.findall("Test")
summary = ""
body = ""
for test in tests:
s,b = schema_info(test,tests)
summary += s
body += b
summary += "</table>\n\n"
return summary + body
def schema_info(test,tests):
# this returns html & markdown formatted summary and body strings
# for the generate and build tests for a single schema
s=""
b=""
name = test.find("Name").text
if name.startswith("generate_cpp_"):
#print this one. if it passes, find and print build.
ap = name[len("generate_cpp_"):]
s += "<tr><td><a href=#" + ap + ">" + ap.title() + "</a></td><td>"
s += test_status(test) + "</td><td>"
b += "----\n<a name=\"wiki-" + ap + "\"></a>\n"
b += "### Schema " + ap.title()
b += "<table width=100%>"
b += test_table("generation",test)
if test.get("Status") == "passed":
for build in tests:
if build.find("Name").text == "build_cpp_sdai_" + ap:
s += test_status(build) + "</td></tr>\n"
b += test_table("compilation",build)
break
else:
s += "----</td></tr>\n"
b += "</table>\n"
return s,b
def test_table(ttype, test):
# populate the table for one test
# returns: html & markdown formatted text to be added to 'body'
b = "<tr><td>Code " + ttype
output = test.find("Results").find("Measurement").find("Value").text
w = output.count("WARNING")
w += output.count("warning")
lines = output.split("\n")
if "The rest of the test output was removed since it exceeds the threshold of" in lines[-2]:
trunc1 = "at least "
trunc2 = "(ctest truncated output)"
else:
trunc1 = ""
trunc2 = ""
if test.get("Status") == "passed":
#print summary in b
b += " succeeded with " + trunc1 + w.__str__() + " warnings " + trunc2
if w == 0: #nothing to print in the table, so skip it
b += "</td></tr>\n"
return b
else:
#print warnings and errors in b
e = output.count("ERROR")
e += output.count("error")
b += " failed with %s%d warnings and %d errors %s" %(trunc1, w, e, trunc2)
b += "<br>\n<table border=1 width=100%>\n"
b += "<tr><th>Line</th><th>Text</th></tr>\n"
# ERRORs
# 242_n2813_mim_lf.exp:2278: --ERROR: Expected a type...
# gcc errors look like ???
l=0
for line in lines:
if ": --ERROR:" in line:
l += 1
c1 = line.find(":")
c2 = line.find(":",c1+1)
b += "<tr><td>" + line[c1+1:c2] + "</td><td>" + line[c2+4:] + "</td></tr>\n"
elif ": error:" in line:
l += 1
c1 = line.find(":")
c2 = line.find(":",c1+1)
c3 = line.find(":",c2+1) #skip the character number
b += "<tr><td>" + line[c1+1:c2] + "</td><td>" + line[c3+2:] + "</td></tr>\n"
if l > 20:
b += "<tr><td>-</td><td><font color=red>-- maximum number of errors printed --</font></td></tr>\n"
break
# WARNINGs
# ap239_arm_lf.exp:2731: WARNING: Implicit downcast...
# WARNING: in SELECT TYPE date_or_date... (multi-line warning)
# compstructs.cc:28:23: warning: unused
l=0
for line in lines:
if ": WARNING" in line:
l += 1
c1 = line.find(":")
c2 = line.find(":",c1+1)
b += "<tr><td>" + line[c1+1:c2] + "</td><td>" + line[c2+2:] + "</td></tr>\n"
elif "WARNING" in line:
b += "<tr><td>????</td><td>" + line + "</td></tr>\n"
elif ": warning:" in line:
l += 1
c1 = line.find(":")
c2 = line.find(":",c1+1)
c3 = line.find(":",c2+1) #skip the character number
b += "<tr><td>" + line[c1+1:c2] + "</td><td>" + line[c3+2:] + "</td></tr>\n"
if l > 20:
b += "<tr><td>-</td><td><font color=red>-- maximum number of warnings printed --</font></td></tr>\n"
break
b += "</table></td></tr>\n"
return b
def test_status(test):
t = ""
for m in test.find("Results").findall("NamedMeasurement"):
if m.get("name") == "Execution Time":
t = " in " + m.find("Value").text + "s"
break
if test.get("Status") == "passed":
s = "<font color=green>PASS</font>"
elif test.get("Status") == "failed":
s = "<font color=red>FAIL</font>"
else:
s = "<font color=cyan>" + test.get("Status") + "</font>"
return s + t
if __name__ == "__main__":
# Someone is launching this directly
main()
+29 -12
View File
@@ -26,7 +26,7 @@ endif()
# use config variables such as these in
# ../.SCL_CTEST_PREFS.cmake
#
#set( CTEST_SITE "your name here")
#set( CTEST_SITE "username")
#set( CTEST_BUILD_NAME "build type, os, arch")
#
#
@@ -35,6 +35,8 @@ endif()
# SKIP_CPP_TEST_SCHEMA_GEN
# SKIP_CPP_TEST_SCHEMA_BUILD
# SKIP_CPP_TEST_SCHEMA_RW
# SKIP_TEST_UNITARY_SCHEMAS
# SKIP_TEST_EXCHANGE_FILE
#
# setting this one disables result submission to my.cdash.org
# SKIP_SUBMISSION
@@ -83,9 +85,7 @@ set(CTEST_BUILD_FLAGS "-j${PROCESSOR_COUNT}")
######################################################
##### To disable reporting of a set of tests, comment
##### out the SUBMIT_TEST line immediately following
##### the set you wish to disable. If other tests
##### depend on those tests, they will be executed
##### but not reported.
##### the set you wish to disable.
#####
##### To do this for all tests:
##### set( SKIP_SUBMISSION TRUE )
@@ -100,19 +100,36 @@ ctest_build( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND )
SUBMIT_TEST( Build )
# ctest_memcheck( BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL ${PROCESSOR_COUNT} )
if(NOT SKIP_TEST_UNITARY_SCHEMAS )
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "unitary_schemas" )
SUBMIT_TEST( Test )
endif()
if(NOT SKIP_CPP_TEST_SCHEMA_GEN )
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "schema_gen" )
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "cpp_schema_gen" )
SUBMIT_TEST( Test )
if(NOT SKIP_CPP_TEST_SCHEMA_BUILD )
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "cpp_schema_build" )
SUBMIT_TEST( Test )
if(NOT SKIP_CPP_TEST_SCHEMA_RW )
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "cpp_schema_rw" )
SUBMIT_TEST( Test )
endif()
endif()
endif()
if(NOT SKIP_CPP_TEST_SCHEMA_BUILD_CPP )
if(NOT SKIP_TEST_EXCHANGE_FILE )
if( SKIP_CPP_TEST_SCHEMA_BUILD )
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE "build_cpp_sdai_AP214E3_2010" )
SUBMIT_TEST( Test )
endif()
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "schema_build" )
SUBMIT_TEST( Test )
endif()
if(NOT SKIP_CPP_TEST_SCHEMA_RW )
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "schema_rw" )
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "exchange_file" )
SUBMIT_TEST( Test )
endif()
@@ -16,11 +16,6 @@ extern ofstream * logStream;
static int debug_access_hooks = 0;
#ifdef PART26
const char * sclHostName = CORBA::Orbix.myHost(); // Default is local host
#endif
Schema * s_example_schema = 0;
/* ************** TYPES */
@@ -126,15 +121,6 @@ SdaiPoly_line::SdaiPoly_line( SdaiPoly_line & e ) {
}
SdaiPoly_line::~SdaiPoly_line() { }
#ifdef __O3DB__
void
SdaiPoly_line::oodb_reInit() {
eDesc = example_schemae_poly_line;
attributes [0].aDesc = a_0points;
}
#endif
SdaiPoly_line::SdaiPoly_line( SCLP23( Application_instance ) *se, int * addAttrs ) {
/* Set this to point to the head entity. */
HeadEntity( se );
@@ -199,17 +185,6 @@ SdaiShape::SdaiShape( SdaiShape & e ) {
}
SdaiShape::~SdaiShape() { }
#ifdef __O3DB__
void
SdaiShape::oodb_reInit() {
eDesc = example_schemae_shape;
attributes [0].aDesc = a_1item_name;
attributes [1].aDesc = a_2item_color;
attributes [2].aDesc = a_3number_of_sides;
}
#endif
SdaiShape::SdaiShape( SCLP23( Application_instance ) *se, int * addAttrs ) {
/* Set this to point to the head entity. */
HeadEntity( se );
@@ -363,15 +338,6 @@ create_SdaiRectangle( os_database * db ) {
}
#endif
#ifdef __O3DB__
void
SdaiRectangle::oodb_reInit() {
eDesc = example_schemae_rectangle;
attributes [3].aDesc = a_4height;
attributes [4].aDesc = a_5width;
}
#endif
SdaiRectangle::SdaiRectangle( SCLP23( Application_instance ) *se, int * addAttrs ) : SdaiShape( se, ( addAttrs ? &addAttrs[1] : 0 ) ) {
/* Set this to point to the head entity. */
HeadEntity( se );
@@ -450,13 +416,6 @@ SdaiSquare::SdaiSquare( SdaiSquare & e ) {
}
SdaiSquare::~SdaiSquare() { }
#ifdef __O3DB__
void
SdaiSquare::oodb_reInit() {
eDesc = example_schemae_square;
}
#endif
SdaiSquare::SdaiSquare( SCLP23( Application_instance ) *se, int * addAttrs ) : SdaiRectangle( se, ( addAttrs ? &addAttrs[1] : 0 ) ) {
/* Set this to point to the head entity. */
HeadEntity( se );
@@ -504,16 +463,6 @@ SdaiTriangle::SdaiTriangle( SdaiTriangle & e ) {
}
SdaiTriangle::~SdaiTriangle() { }
#ifdef __O3DB__
void
SdaiTriangle::oodb_reInit() {
eDesc = example_schemae_triangle;
attributes [3].aDesc = a_6side1_length;
attributes [4].aDesc = a_7side2_length;
attributes [5].aDesc = a_8side3_length;
}
#endif
SdaiTriangle::SdaiTriangle( SCLP23( Application_instance ) *se, int * addAttrs ) : SdaiShape( se, ( addAttrs ? &addAttrs[1] : 0 ) ) {
/* Set this to point to the head entity. */
HeadEntity( se );
@@ -620,14 +569,6 @@ SdaiCircle::SdaiCircle( SdaiCircle & e ) {
}
SdaiCircle::~SdaiCircle() { }
#ifdef __O3DB__
void
SdaiCircle::oodb_reInit() {
eDesc = example_schemae_circle;
attributes [3].aDesc = a_9radius;
}
#endif
SdaiCircle::SdaiCircle( SCLP23( Application_instance ) *se, int * addAttrs ) : SdaiShape( se, ( addAttrs ? &addAttrs[1] : 0 ) ) {
/* Set this to point to the head entity. */
HeadEntity( se );
@@ -691,16 +632,6 @@ SdaiLine::SdaiLine( SdaiLine & e ) {
}
SdaiLine::~SdaiLine() { }
#ifdef __O3DB__
void
SdaiLine::oodb_reInit() {
eDesc = example_schemae_line;
attributes [0].aDesc = a_10end_point_one;
attributes [1].aDesc = a_11end_point_two;
}
#endif
SdaiLine::SdaiLine( SCLP23( Application_instance ) *se, int * addAttrs ) {
/* Set this to point to the head entity. */
HeadEntity( se );
@@ -788,16 +719,6 @@ SdaiCartesian_point::SdaiCartesian_point( SdaiCartesian_point & e ) {
}
SdaiCartesian_point::~SdaiCartesian_point() { }
#ifdef __O3DB__
void
SdaiCartesian_point::oodb_reInit() {
eDesc = example_schemae_cartesian_point;
attributes [0].aDesc = a_12x;
attributes [1].aDesc = a_13y;
attributes [2].aDesc = a_14z;
}
#endif
SdaiCartesian_point::SdaiCartesian_point( SCLP23( Application_instance ) *se, int * addAttrs ) {
/* Set this to point to the head entity. */
HeadEntity( se );
+242 -285
View File
@@ -5,450 +5,407 @@
// regenerate it.
/* $Id$ */
#ifdef __O3DB__
#include <OpenOODB.h>
#endif
#ifndef SCHEMA_H
#include <schema.h>
#endif
#ifdef PART26
#include <corbaIncludes.h>
// Create a corbaSchema.h file in this directory with a #include in
// it for your IDL generated schema-specific .hh file.
#include <corbaSchema.h>
#endif
/* ************** TYPES */
/* ************** TYPES */
////////// ENUMERATION TYPE color
enum Color {
Color__red,
Color__green,
Color__blue,
Color__yellow,
Color__orange,
Color__white,
Color__black,
Color__brown,
Color_unset
Color__red,
Color__green,
Color__blue,
Color__yellow,
Color__orange,
Color__white,
Color__black,
Color__brown,
Color_unset
};
class SdaiColor_var : public SCLP23(Enum) {
class SdaiColor_var : public SCLP23( Enum ) {
protected:
EnumTypeDescriptor *type;
protected:
EnumTypeDescriptor * type;
public:
SdaiColor_var (const char * n =0, EnumTypeDescriptor *et =example_schemat_color);
SdaiColor_var (Color e, EnumTypeDescriptor *et =example_schemat_color)
: type(et) { set_value (e); }
~SdaiColor_var () { }
SdaiColor_var& operator= (const SdaiColor_var& e)
{ set_value (e); return *this; }
operator Color () const;
public:
SdaiColor_var( const char * n = 0, EnumTypeDescriptor * et = example_schemat_color );
SdaiColor_var( Color e, EnumTypeDescriptor * et = example_schemat_color )
: type( et ) {
set_value( e );
}
~SdaiColor_var() { }
SdaiColor_var & operator= ( const SdaiColor_var & e ) {
set_value( e );
return *this;
}
operator Color() const;
inline virtual const char * Name () const
{ return type->Name(); }
inline virtual int no_elements () const { return 8; }
virtual const char * element_at (int n) const;
inline virtual const char * Name() const {
return type->Name();
}
inline virtual int no_elements() const {
return 8;
}
virtual const char * element_at( int n ) const;
};
typedef SdaiColor_var * SdaiColor_var_ptr;
SCLP23(Enum) * create_SdaiColor_var ();
SCLP23( Enum ) * create_SdaiColor_var();
class SdaiColor_vars : public EnumAggregate {
protected:
EnumTypeDescriptor *enum_type;
protected:
EnumTypeDescriptor * enum_type;
public:
SdaiColor_vars( EnumTypeDescriptor * =example_schemat_color);
virtual ~SdaiColor_vars();
virtual SingleLinkNode * NewNode()
{ return new EnumNode (new SdaiColor_var( "", enum_type )); }
public:
SdaiColor_vars( EnumTypeDescriptor * = example_schemat_color );
virtual ~SdaiColor_vars();
virtual SingleLinkNode * NewNode() {
return new EnumNode( new SdaiColor_var( "", enum_type ) );
}
};
typedef SdaiColor_vars * SdaiColor_vars_ptr;
STEPaggregate * create_SdaiColor_vars ();
STEPaggregate * create_SdaiColor_vars();
////////// END ENUMERATION color
// ***** Build the SELECT Types
// ***** Build the SELECT Types
/* ************** ENTITIES */
/* ************** ENTITIES */
// ***** Print Entity Classes
// ***** Print Entity Classes
///////// ENTITY poly_line
///////// ENTITY poly_line
extern AttrDescriptor *a_0points;
extern AttrDescriptor * a_0points;
class SdaiPoly_line : public SCLP23(Application_instance) {
class SdaiPoly_line : public SCLP23( Application_instance ) {
protected:
EntityAggregate _points ; // of line
protected:
EntityAggregate _points ; // of line
public:
public:
SdaiPoly_line ( );
SdaiPoly_line (SCLP23(Application_instance) *se, int *addAttrs = 0);
SdaiPoly_line (SdaiPoly_line& e );
~SdaiPoly_line ();
SdaiPoly_line( );
SdaiPoly_line( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
SdaiPoly_line( SdaiPoly_line & e );
~SdaiPoly_line();
#ifdef __O3DB__
void oodb_reInit();
#endif
int opcode () { return 0 ; }
const EntityAggregate_ptr points_() const;
void points_ (const EntityAggregate_ptr x);
int opcode() {
return 0 ;
}
const EntityAggregate_ptr points_() const;
void points_( const EntityAggregate_ptr x );
};
#ifdef __O3DB__
inline SCLP23(Application_instance_ptr)
create_SdaiPoly_line () { return (SCLP23(Application_instance_ptr)) new SdaiPoly_line ; }
#else
inline SdaiPoly_line *
create_SdaiPoly_line () { return new SdaiPoly_line ; }
#endif
create_SdaiPoly_line() {
return new SdaiPoly_line ;
}
///////// END_ENTITY poly_line
///////// END_ENTITY poly_line
///////// ENTITY shape
///////// ENTITY shape
extern AttrDescriptor *a_1item_name;
extern AttrDescriptor *a_2item_color;
extern AttrDescriptor *a_3number_of_sides;
extern AttrDescriptor * a_1item_name;
extern AttrDescriptor * a_2item_color;
extern AttrDescriptor * a_3number_of_sides;
class SdaiShape : public SCLP23(Application_instance) {
class SdaiShape : public SCLP23( Application_instance ) {
protected:
SCLP23(String) _item_name ;
SdaiColor_var _item_color ; // OPTIONAL
SCLP23(Integer) _number_of_sides ;
public:
protected:
SCLP23( String ) _item_name ;
SdaiColor_var _item_color ; // OPTIONAL
SCLP23( Integer ) _number_of_sides ;
public:
SdaiShape ( );
SdaiShape (SCLP23(Application_instance) *se, int *addAttrs = 0);
SdaiShape (SdaiShape& e );
~SdaiShape ();
SdaiShape( );
SdaiShape( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
SdaiShape( SdaiShape & e );
~SdaiShape();
#ifdef __O3DB__
void oodb_reInit();
#endif
int opcode() {
return 1 ;
}
const SdaiLabel item_name_() const;
void item_name_( const SdaiLabel x );
int opcode () { return 1 ; }
const SdaiLabel item_name_() const;
void item_name_ (const SdaiLabel x);
const SdaiColor_var item_color_() const;
void item_color_( const SdaiColor_var x );
const SdaiColor_var item_color_() const;
void item_color_ (const SdaiColor_var x);
const SCLP23(Integer) number_of_sides_() const;
void number_of_sides_ (const SCLP23(Integer) x);
const SCLP23( Integer ) number_of_sides_() const;
void number_of_sides_( const SCLP23( Integer ) x );
};
#ifdef __O3DB__
inline SCLP23(Application_instance_ptr)
create_SdaiShape () { return (SCLP23(Application_instance_ptr)) new SdaiShape ; }
#else
inline SdaiShape *
create_SdaiShape () { return new SdaiShape ; }
#endif
create_SdaiShape() {
return new SdaiShape ;
}
///////// END_ENTITY shape
///////// END_ENTITY shape
///////// ENTITY rectangle
///////// ENTITY rectangle
extern AttrDescriptor *a_4height;
extern AttrDescriptor *a_5width;
extern AttrDescriptor * a_4height;
extern AttrDescriptor * a_5width;
class SdaiRectangle : public SdaiShape {
protected:
SCLP23(Real) _height ;
SCLP23(Real) _width ;
public:
SdaiRectangle ( );
SdaiRectangle (SCLP23(Application_instance) *se, int *addAttrs = 0);
SdaiRectangle (SdaiRectangle& e );
~SdaiRectangle ();
protected:
SCLP23( Real ) _height ;
SCLP23( Real ) _width ;
public:
#ifdef __O3DB__
void oodb_reInit();
#endif
SdaiRectangle( );
SdaiRectangle( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
SdaiRectangle( SdaiRectangle & e );
~SdaiRectangle();
int opcode () { return 2 ; }
const SdaiLength_measure height_() const;
void height_ (const SdaiLength_measure x);
int opcode() {
return 2 ;
}
const SdaiLength_measure height_() const;
void height_( const SdaiLength_measure x );
const SdaiLength_measure width_() const;
void width_ (const SdaiLength_measure x);
const SdaiLength_measure width_() const;
void width_( const SdaiLength_measure x );
/* The first parent's access functions are */
/* above or covered by inherited functions. */
/* The first parent's access functions are */
/* above or covered by inherited functions. */
};
#ifdef __O3DB__
inline SCLP23(Application_instance_ptr)
create_SdaiRectangle () { return (SCLP23(Application_instance_ptr)) new SdaiRectangle ; }
#else
inline SdaiRectangle *
create_SdaiRectangle () { return new SdaiRectangle ; }
#endif
create_SdaiRectangle() {
return new SdaiRectangle ;
}
///////// END_ENTITY rectangle
///////// END_ENTITY rectangle
///////// ENTITY square
///////// ENTITY square
class SdaiSquare : public SdaiRectangle {
protected:
public:
SdaiSquare ( );
SdaiSquare (SCLP23(Application_instance) *se, int *addAttrs = 0);
SdaiSquare (SdaiSquare& e );
~SdaiSquare ();
protected:
public:
#ifdef __O3DB__
void oodb_reInit();
#endif
SdaiSquare( );
SdaiSquare( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
SdaiSquare( SdaiSquare & e );
~SdaiSquare();
int opcode () { return 3 ; }
/* The first parent's access functions are */
/* above or covered by inherited functions. */
int opcode() {
return 3 ;
}
/* The first parent's access functions are */
/* above or covered by inherited functions. */
};
#ifdef __O3DB__
inline SCLP23(Application_instance_ptr)
create_SdaiSquare () { return (SCLP23(Application_instance_ptr)) new SdaiSquare ; }
#else
inline SdaiSquare *
create_SdaiSquare () { return new SdaiSquare ; }
#endif
create_SdaiSquare() {
return new SdaiSquare ;
}
///////// END_ENTITY square
///////// END_ENTITY square
///////// ENTITY triangle
///////// ENTITY triangle
extern AttrDescriptor *a_6side1_length;
extern AttrDescriptor *a_7side2_length;
extern AttrDescriptor *a_8side3_length;
extern AttrDescriptor * a_6side1_length;
extern AttrDescriptor * a_7side2_length;
extern AttrDescriptor * a_8side3_length;
class SdaiTriangle : public SdaiShape {
protected:
SCLP23(Real) _side1_length ;
SCLP23(Real) _side2_length ;
SCLP23(Real) _side3_length ;
public:
SdaiTriangle ( );
SdaiTriangle (SCLP23(Application_instance) *se, int *addAttrs = 0);
SdaiTriangle (SdaiTriangle& e );
~SdaiTriangle ();
protected:
SCLP23( Real ) _side1_length ;
SCLP23( Real ) _side2_length ;
SCLP23( Real ) _side3_length ;
public:
#ifdef __O3DB__
void oodb_reInit();
#endif
SdaiTriangle( );
SdaiTriangle( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
SdaiTriangle( SdaiTriangle & e );
~SdaiTriangle();
int opcode () { return 4 ; }
const SdaiLength_measure side1_length_() const;
void side1_length_ (const SdaiLength_measure x);
int opcode() {
return 4 ;
}
const SdaiLength_measure side1_length_() const;
void side1_length_( const SdaiLength_measure x );
const SdaiLength_measure side2_length_() const;
void side2_length_ (const SdaiLength_measure x);
const SdaiLength_measure side2_length_() const;
void side2_length_( const SdaiLength_measure x );
const SdaiLength_measure side3_length_() const;
void side3_length_ (const SdaiLength_measure x);
const SdaiLength_measure side3_length_() const;
void side3_length_( const SdaiLength_measure x );
/* The first parent's access functions are */
/* above or covered by inherited functions. */
/* The first parent's access functions are */
/* above or covered by inherited functions. */
};
#ifdef __O3DB__
inline SCLP23(Application_instance_ptr)
create_SdaiTriangle () { return (SCLP23(Application_instance_ptr)) new SdaiTriangle ; }
#else
inline SdaiTriangle *
create_SdaiTriangle () { return new SdaiTriangle ; }
#endif
create_SdaiTriangle() {
return new SdaiTriangle ;
}
///////// END_ENTITY triangle
///////// END_ENTITY triangle
///////// ENTITY circle
///////// ENTITY circle
extern AttrDescriptor *a_9radius;
extern AttrDescriptor * a_9radius;
class SdaiCircle : public SdaiShape {
protected:
SCLP23(Real) _radius ;
public:
SdaiCircle ( );
SdaiCircle (SCLP23(Application_instance) *se, int *addAttrs = 0);
SdaiCircle (SdaiCircle& e );
~SdaiCircle ();
protected:
SCLP23( Real ) _radius ;
public:
#ifdef __O3DB__
void oodb_reInit();
#endif
SdaiCircle( );
SdaiCircle( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
SdaiCircle( SdaiCircle & e );
~SdaiCircle();
int opcode () { return 5 ; }
const SCLP23(Real) radius_() const;
void radius_ (const SCLP23(Real) x);
int opcode() {
return 5 ;
}
const SCLP23( Real ) radius_() const;
void radius_( const SCLP23( Real ) x );
/* The first parent's access functions are */
/* above or covered by inherited functions. */
/* The first parent's access functions are */
/* above or covered by inherited functions. */
};
#ifdef __O3DB__
inline SCLP23(Application_instance_ptr)
create_SdaiCircle () { return (SCLP23(Application_instance_ptr)) new SdaiCircle ; }
#else
inline SdaiCircle *
create_SdaiCircle () { return new SdaiCircle ; }
#endif
create_SdaiCircle() {
return new SdaiCircle ;
}
///////// END_ENTITY circle
///////// END_ENTITY circle
///////// ENTITY line
///////// ENTITY line
extern AttrDescriptor *a_10end_point_one;
extern AttrDescriptor *a_11end_point_two;
extern AttrDescriptor * a_10end_point_one;
extern AttrDescriptor * a_11end_point_two;
class SdaiLine : public SCLP23(Application_instance) {
class SdaiLine : public SCLP23( Application_instance ) {
protected:
SCLP23(Application_instance_ptr) _end_point_one ;
SCLP23(Application_instance_ptr) _end_point_two ;
public:
protected:
SCLP23( Application_instance_ptr ) _end_point_one ;
SCLP23( Application_instance_ptr ) _end_point_two ;
public:
SdaiLine ( );
SdaiLine (SCLP23(Application_instance) *se, int *addAttrs = 0);
SdaiLine (SdaiLine& e );
~SdaiLine ();
SdaiLine( );
SdaiLine( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
SdaiLine( SdaiLine & e );
~SdaiLine();
#ifdef __O3DB__
void oodb_reInit();
#endif
int opcode() {
return 6 ;
}
const SdaiCartesian_point_ptr end_point_one_() const;
void end_point_one_( const SdaiCartesian_point_ptr x );
int opcode () { return 6 ; }
const SdaiCartesian_point_ptr end_point_one_() const;
void end_point_one_ (const SdaiCartesian_point_ptr x);
const SdaiCartesian_point_ptr end_point_two_() const;
void end_point_two_ (const SdaiCartesian_point_ptr x);
const SdaiCartesian_point_ptr end_point_two_() const;
void end_point_two_( const SdaiCartesian_point_ptr x );
};
#ifdef __O3DB__
inline SCLP23(Application_instance_ptr)
create_SdaiLine () { return (SCLP23(Application_instance_ptr)) new SdaiLine ; }
#else
inline SdaiLine *
create_SdaiLine () { return new SdaiLine ; }
#endif
create_SdaiLine() {
return new SdaiLine ;
}
///////// END_ENTITY line
///////// END_ENTITY line
///////// ENTITY cartesian_point
///////// ENTITY cartesian_point
extern AttrDescriptor *a_12x;
extern AttrDescriptor *a_13y;
extern AttrDescriptor *a_14z;
extern AttrDescriptor * a_12x;
extern AttrDescriptor * a_13y;
extern AttrDescriptor * a_14z;
class SdaiCartesian_point : public SCLP23(Application_instance) {
class SdaiCartesian_point : public SCLP23( Application_instance ) {
protected:
SCLP23(Real) _x ;
SCLP23(Real) _y ;
SCLP23(Real) _z ; // OPTIONAL
public:
protected:
SCLP23( Real ) _x ;
SCLP23( Real ) _y ;
SCLP23( Real ) _z ; // OPTIONAL
public:
SdaiCartesian_point ( );
SdaiCartesian_point (SCLP23(Application_instance) *se, int *addAttrs = 0);
SdaiCartesian_point (SdaiCartesian_point& e );
~SdaiCartesian_point ();
SdaiCartesian_point( );
SdaiCartesian_point( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
SdaiCartesian_point( SdaiCartesian_point & e );
~SdaiCartesian_point();
#ifdef __O3DB__
void oodb_reInit();
#endif
int opcode() {
return 7 ;
}
const SdaiPoint x_() const;
void x_( const SdaiPoint x );
int opcode () { return 7 ; }
const SdaiPoint x_() const;
void x_ (const SdaiPoint x);
const SdaiPoint y_() const;
void y_( const SdaiPoint x );
const SdaiPoint y_() const;
void y_ (const SdaiPoint x);
const SdaiPoint z_() const;
void z_ (const SdaiPoint x);
const SdaiPoint z_() const;
void z_( const SdaiPoint x );
};
#ifdef __O3DB__
inline SCLP23(Application_instance_ptr)
create_SdaiCartesian_point () { return (SCLP23(Application_instance_ptr)) new SdaiCartesian_point ; }
#else
inline SdaiCartesian_point *
create_SdaiCartesian_point () { return new SdaiCartesian_point ; }
#endif
create_SdaiCartesian_point() {
return new SdaiCartesian_point ;
}
///////// END_ENTITY cartesian_point
///////// END_ENTITY cartesian_point
// ***** generate Model related pieces
// ***** generate Model related pieces
class SdaiModel_contents_example_schema : public SCLP23(Model_contents) {
class SdaiModel_contents_example_schema : public SCLP23( Model_contents ) {
public:
public:
SdaiModel_contents_example_schema();
SdaiModel_contents_example_schema();
SdaiPoly_line__set_var SdaiPoly_line_get_extents();
SdaiPoly_line__set_var SdaiPoly_line_get_extents();
SdaiShape__set_var SdaiShape_get_extents();
SdaiShape__set_var SdaiShape_get_extents();
SdaiRectangle__set_var SdaiRectangle_get_extents();
SdaiRectangle__set_var SdaiRectangle_get_extents();
SdaiSquare__set_var SdaiSquare_get_extents();
SdaiSquare__set_var SdaiSquare_get_extents();
SdaiTriangle__set_var SdaiTriangle_get_extents();
SdaiTriangle__set_var SdaiTriangle_get_extents();
SdaiCircle__set_var SdaiCircle_get_extents();
SdaiCircle__set_var SdaiCircle_get_extents();
SdaiLine__set_var SdaiLine_get_extents();
SdaiLine__set_var SdaiLine_get_extents();
SdaiCartesian_point__set_var SdaiCartesian_point_get_extents();
SdaiCartesian_point__set_var SdaiCartesian_point_get_extents();
};
@@ -456,6 +413,6 @@ class SdaiModel_contents_example_schema : public SCLP23(Model_contents) {
typedef SdaiModel_contents_example_schema * SdaiModel_contents_example_schema_ptr;
typedef SdaiModel_contents_example_schema_ptr SdaiModel_contents_example_schema_var;
SCLP23(Model_contents_ptr) create_SdaiModel_contents_example_schema();
SCLP23( Model_contents_ptr ) create_SdaiModel_contents_example_schema();
#endif
+57 -57
View File
@@ -3,85 +3,85 @@
// 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.
/* $Id$ */
/* $Id$ */
#include <schema.h>
// Schema: SdaiEXAMPLE_SCHEMA
extern Schema * s_example_schema;
extern Schema * s_example_schema;
// Types:
class SdaiColor_vars;
extern EnumTypeDescriptor *example_schemat_color;
typedef SCLP23(String) SdaiLabel;
extern TypeDescriptor *example_schemat_label;
typedef SCLP23(Real) SdaiPoint;
extern TypeDescriptor *example_schemat_point;
typedef SCLP23(Real) SdaiLength_measure;
extern TypeDescriptor *example_schemat_length_measure;
extern EnumTypeDescriptor * example_schemat_color;
typedef SCLP23( String ) SdaiLabel;
extern TypeDescriptor * example_schemat_label;
typedef SCLP23( Real ) SdaiPoint;
extern TypeDescriptor * example_schemat_point;
typedef SCLP23( Real ) SdaiLength_measure;
extern TypeDescriptor * example_schemat_length_measure;
// Entities:
class SdaiPoly_line;
typedef SdaiPoly_line * SdaiPoly_lineH;
typedef SdaiPoly_line * SdaiPoly_line_ptr;
typedef SdaiPoly_line_ptr SdaiPoly_line_var;
#define SdaiPoly_line__set SCLP23(DAObject__set)
#define SdaiPoly_line__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor *example_schemae_poly_line;
typedef SdaiPoly_line * SdaiPoly_lineH;
typedef SdaiPoly_line * SdaiPoly_line_ptr;
typedef SdaiPoly_line_ptr SdaiPoly_line_var;
#define SdaiPoly_line__set SCLP23(DAObject__set)
#define SdaiPoly_line__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor * example_schemae_poly_line;
class SdaiShape;
typedef SdaiShape * SdaiShapeH;
typedef SdaiShape * SdaiShape_ptr;
typedef SdaiShape_ptr SdaiShape_var;
#define SdaiShape__set SCLP23(DAObject__set)
#define SdaiShape__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor *example_schemae_shape;
typedef SdaiShape * SdaiShapeH;
typedef SdaiShape * SdaiShape_ptr;
typedef SdaiShape_ptr SdaiShape_var;
#define SdaiShape__set SCLP23(DAObject__set)
#define SdaiShape__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor * example_schemae_shape;
class SdaiRectangle;
typedef SdaiRectangle * SdaiRectangleH;
typedef SdaiRectangle * SdaiRectangle_ptr;
typedef SdaiRectangle_ptr SdaiRectangle_var;
#define SdaiRectangle__set SCLP23(DAObject__set)
#define SdaiRectangle__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor *example_schemae_rectangle;
typedef SdaiRectangle * SdaiRectangleH;
typedef SdaiRectangle * SdaiRectangle_ptr;
typedef SdaiRectangle_ptr SdaiRectangle_var;
#define SdaiRectangle__set SCLP23(DAObject__set)
#define SdaiRectangle__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor * example_schemae_rectangle;
class SdaiSquare;
typedef SdaiSquare * SdaiSquareH;
typedef SdaiSquare * SdaiSquare_ptr;
typedef SdaiSquare_ptr SdaiSquare_var;
#define SdaiSquare__set SCLP23(DAObject__set)
#define SdaiSquare__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor *example_schemae_square;
typedef SdaiSquare * SdaiSquareH;
typedef SdaiSquare * SdaiSquare_ptr;
typedef SdaiSquare_ptr SdaiSquare_var;
#define SdaiSquare__set SCLP23(DAObject__set)
#define SdaiSquare__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor * example_schemae_square;
class SdaiTriangle;
typedef SdaiTriangle * SdaiTriangleH;
typedef SdaiTriangle * SdaiTriangle_ptr;
typedef SdaiTriangle_ptr SdaiTriangle_var;
#define SdaiTriangle__set SCLP23(DAObject__set)
#define SdaiTriangle__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor *example_schemae_triangle;
typedef SdaiTriangle * SdaiTriangleH;
typedef SdaiTriangle * SdaiTriangle_ptr;
typedef SdaiTriangle_ptr SdaiTriangle_var;
#define SdaiTriangle__set SCLP23(DAObject__set)
#define SdaiTriangle__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor * example_schemae_triangle;
class SdaiCircle;
typedef SdaiCircle * SdaiCircleH;
typedef SdaiCircle * SdaiCircle_ptr;
typedef SdaiCircle_ptr SdaiCircle_var;
#define SdaiCircle__set SCLP23(DAObject__set)
#define SdaiCircle__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor *example_schemae_circle;
typedef SdaiCircle * SdaiCircleH;
typedef SdaiCircle * SdaiCircle_ptr;
typedef SdaiCircle_ptr SdaiCircle_var;
#define SdaiCircle__set SCLP23(DAObject__set)
#define SdaiCircle__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor * example_schemae_circle;
class SdaiLine;
typedef SdaiLine * SdaiLineH;
typedef SdaiLine * SdaiLine_ptr;
typedef SdaiLine_ptr SdaiLine_var;
#define SdaiLine__set SCLP23(DAObject__set)
#define SdaiLine__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor *example_schemae_line;
typedef SdaiLine * SdaiLineH;
typedef SdaiLine * SdaiLine_ptr;
typedef SdaiLine_ptr SdaiLine_var;
#define SdaiLine__set SCLP23(DAObject__set)
#define SdaiLine__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor * example_schemae_line;
class SdaiCartesian_point;
typedef SdaiCartesian_point * SdaiCartesian_pointH;
typedef SdaiCartesian_point * SdaiCartesian_point_ptr;
typedef SdaiCartesian_point_ptr SdaiCartesian_point_var;
#define SdaiCartesian_point__set SCLP23(DAObject__set)
#define SdaiCartesian_point__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor *example_schemae_cartesian_point;
typedef SdaiCartesian_point * SdaiCartesian_pointH;
typedef SdaiCartesian_point * SdaiCartesian_point_ptr;
typedef SdaiCartesian_point_ptr SdaiCartesian_point_var;
#define SdaiCartesian_point__set SCLP23(DAObject__set)
#define SdaiCartesian_point__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor * example_schemae_cartesian_point;
#endif
+6 -10
View File
@@ -8,10 +8,6 @@
#include <sys/time.h>
#endif
#ifdef __O3DB__
#include <OpenOODB.h>
#endif
#include <sdai.h>
@@ -26,13 +22,13 @@
#include <STEPattribute.h>
#include <Sdaiclasses.h>
extern void SchemaInit (Registry &);
extern void InitSchemasAndEnts (Registry &);
#include <SdaiEXAMPLE_SCHEMA.h>
extern void SdaiEXAMPLE_SCHEMAInit (Registry & r);
extern void SchemaInit( Registry & );
extern void InitSchemasAndEnts( Registry & );
#include <SdaiEXAMPLE_SCHEMA.h>
extern void SdaiEXAMPLE_SCHEMAInit( Registry & r );
#include <complexSupport.h>
ComplexCollect *gencomplex();
ComplexCollect * gencomplex();
SCLP23(Model_contents_ptr) GetModelContents(char *schemaName);
SCLP23( Model_contents_ptr ) GetModelContents( char * schemaName );
#endif
+15 -4
View File
@@ -8,6 +8,9 @@ set(LIBSTEPDAI_SRCS
sdaiEntity_extent_set.cc
sdaiModel_contents.cc
sdaiModel_contents_list.cc
sdaiEnum.cc
sdaiString.cc
sdaiBinary.cc
)
SET(LIBSTEPDAI_PRIVATE_HDRS
@@ -20,16 +23,24 @@ SET(LIBSTEPDAI_PRIVATE_HDRS
sdaiObject.h
sdaiSession_instance.h
StrUtil.hh
sdaiEnum.h
sdaiString.h
sdaiBinary.h
)
IF(MSVC OR BORLAND)
add_definitions( -DSCL_DAI_DLL_EXPORTS )
add_definitions( -DSCL_UTILS_DLL_IMPORTS )
ENDIF()
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${SCL_SOURCE_DIR}/src/clstepcore
${SCL_SOURCE_DIR}/src/clutils
)
add_definitions(
-DHAVE_CONFIG_H
)
SCL_ADDLIB(stepdai "${LIBSTEPDAI_SRCS}" "steputils")
SCL_ADDLIB(stepdai "${LIBSTEPDAI_SRCS}" "steputils stepcore")
if(APPLE)
set_target_properties(stepdai PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
endif(APPLE)
+21 -21
View File
@@ -40,36 +40,36 @@ extern "C"
/*****************************************************************************/
SCLP23( Application_instance__set )::SCLP23_NAME( Application_instance__set )( int defaultSize ) {
SDAI_Application_instance__set::SDAI_Application_instance__set( int defaultSize ) {
_bufsize = defaultSize;
_buf = new SCLP23( Application_instance_ptr )[_bufsize];
_buf = new SDAI_Application_instance_ptr[_bufsize];
_count = 0;
}
SCLP23( Application_instance__set )::~SCLP23_NAME( Application_instance__set )() {
SDAI_Application_instance__set::~SDAI_Application_instance__set() {
delete _buf;
}
void SCLP23( Application_instance__set )::Check( int index ) {
SCLP23( Application_instance_ptr )* newbuf;
void SDAI_Application_instance__set::Check( int index ) {
SDAI_Application_instance_ptr * newbuf;
if( index >= _bufsize ) {
_bufsize = ( index + 1 ) * 2;
newbuf = new SCLP23( Application_instance_ptr )[_bufsize];
memmove( newbuf, _buf, _count * sizeof( SCLP23( Application_instance_ptr ) ) );
newbuf = new SDAI_Application_instance_ptr[_bufsize];
memmove( newbuf, _buf, _count * sizeof( SDAI_Application_instance_ptr ) );
delete _buf;
_buf = newbuf;
}
}
void SCLP23( Application_instance__set )::Insert( SCLP23( Application_instance_ptr ) v, int index ) {
SCLP23( Application_instance_ptr )* spot;
void SDAI_Application_instance__set::Insert( SDAI_Application_instance_ptr v, int index ) {
SDAI_Application_instance_ptr * spot;
index = ( index < 0 ) ? _count : index;
if( index < _count ) {
Check( _count + 1 );
spot = &_buf[index];
memmove( spot + 1, spot, ( _count - index )*sizeof( SCLP23( Application_instance_ptr ) ) );
memmove( spot + 1, spot, ( _count - index )*sizeof( SDAI_Application_instance_ptr ) );
} else {
Check( index );
@@ -79,14 +79,14 @@ void SCLP23( Application_instance__set )::Insert( SCLP23( Application_instance_p
++_count;
}
void SCLP23( Application_instance__set )::Append( SCLP23( Application_instance_ptr ) v ) {
void SDAI_Application_instance__set::Append( SDAI_Application_instance_ptr v ) {
int index = _count;
SCLP23( Application_instance_ptr )* spot;
SDAI_Application_instance_ptr * spot;
if( index < _count ) {
Check( _count + 1 );
spot = &_buf[index];
memmove( spot + 1, spot, ( _count - index )*sizeof( SCLP23( Application_instance_ptr ) ) );
memmove( spot + 1, spot, ( _count - index )*sizeof( SDAI_Application_instance_ptr ) );
} else {
Check( index );
@@ -96,22 +96,22 @@ void SCLP23( Application_instance__set )::Append( SCLP23( Application_instance_p
++_count;
}
void SCLP23( Application_instance__set )::Remove( int index ) {
void SDAI_Application_instance__set::Remove( int index ) {
if( 0 <= index && index < _count ) {
--_count;
SCLP23( Application_instance_ptr )* spot = &_buf[index];
memmove( spot, spot + 1, ( _count - index )*sizeof( SCLP23( Application_instance_ptr ) ) );
SDAI_Application_instance_ptr * spot = &_buf[index];
memmove( spot, spot + 1, ( _count - index )*sizeof( SDAI_Application_instance_ptr ) );
}
}
void SCLP23( Application_instance__set )::Remove( SCLP23( Application_instance_ptr ) a ) {
void SDAI_Application_instance__set::Remove( SDAI_Application_instance_ptr a ) {
int index = Index( a );
if( !( index < 0 ) ) {
Remove( index );
}
}
int SCLP23( Application_instance__set )::Index( SCLP23( Application_instance_ptr ) v ) {
int SDAI_Application_instance__set::Index( SDAI_Application_instance_ptr v ) {
for( int i = 0; i < _count; ++i ) {
if( _buf[i] == v ) {
return i;
@@ -120,7 +120,7 @@ int SCLP23( Application_instance__set )::Index( SCLP23( Application_instance_ptr
return -1;
}
SCLP23( Application_instance_ptr ) & SCLP23( Application_instance__set )::operator[]( int index ) {
SDAI_Application_instance_ptr & SDAI_Application_instance__set::operator[]( int index ) {
Check( index );
// _count = max(_count, index+1);
_count = ( ( _count > index + 1 ) ? _count : ( index + 1 ) );
@@ -128,11 +128,11 @@ SCLP23( Application_instance_ptr ) & SCLP23( Application_instance__set )::operat
}
int
SCLP23( Application_instance__set )::Count() {
SDAI_Application_instance__set::Count() {
return _count;
}
void
SCLP23( Application_instance__set )::Clear() {
SDAI_Application_instance__set::Clear() {
_count = 0;
}
+24 -24
View File
@@ -30,35 +30,35 @@
#ifndef SDAI_APPLICATION_INSTANCE_SET_h
#define SDAI_APPLICATION_INSTANCE_SET_h
#include <scl_export.h>
//#include <STEPentity.h>
class SCLP23_NAME(Application_instance__set);
typedef SCLP23_NAME(Application_instance__set) *
SCLP23_NAME(Application_instance__set_ptr);
typedef SCLP23_NAME(Application_instance__set_ptr)
SCLP23_NAME(Application_instance__set_var);
class SDAI_Application_instance__set;
typedef SDAI_Application_instance__set *
SDAI_Application_instance__set_ptr;
typedef SDAI_Application_instance__set_ptr
SDAI_Application_instance__set_var;
class SCLP23_NAME(Application_instance__set)
{
public:
SCLP23_NAME(Application_instance__set)(int = 16);
~SCLP23_NAME(Application_instance__set)();
class SCL_DAI_EXPORT SDAI_Application_instance__set {
public:
SDAI_Application_instance__set( int = 16 );
~SDAI_Application_instance__set();
SCLP23_NAME(Application_instance_ptr)& operator[](int index);
void Insert(SCLP23_NAME(Application_instance_ptr), int index);
void Append(SCLP23_NAME(Application_instance_ptr));
void Remove(int index);
void Remove(SCLP23_NAME(Application_instance_ptr));
int Index(SCLP23_NAME(Application_instance_ptr));
SDAI_Application_instance_ptr & operator[]( int index );
void Insert( SDAI_Application_instance_ptr, int index );
void Append( SDAI_Application_instance_ptr );
void Remove( int index );
void Remove( SDAI_Application_instance_ptr );
int Index( SDAI_Application_instance_ptr );
int Count();
void Clear();
private:
void Check(int index);
private:
SCLP23_NAME(Application_instance_ptr)* _buf;
int _bufsize;
int _count;
int Count();
void Clear();
private:
void Check( int index );
private:
SDAI_Application_instance_ptr * _buf;
int _bufsize;
int _count;
};
#endif
@@ -12,16 +12,35 @@
#include <sstream>
#include <sdai.h>
extern Severity CheckRemainingInput( istream & in, ErrorDescriptor * err,
const char * typeName, // used in error message
const char * tokenList ); // e.g. ",)"
SCLP23( Binary ) & SCLP23( Binary )::operator= ( const char * s ) {
std::string::operator= ( s );
SDAI_Binary::SDAI_Binary( const char * str, int max ) {
content = std::string( str, max );
}
SDAI_Binary::SDAI_Binary( const std::string & s ) {
content = std::string( s );
}
SDAI_Binary::~SDAI_Binary( void ) {
}
SDAI_Binary & SDAI_Binary::operator= ( const char * s ) {
content = std::string( s );
return *this;
}
void SCLP23( Binary )::STEPwrite( ostream & out ) const {
void SDAI_Binary::clear( void ) {
content.clear();
}
bool SDAI_Binary::empty( void ) const {
return content.empty();
}
const char * SDAI_Binary::c_str( void ) const {
return content.c_str();
}
void SDAI_Binary::STEPwrite( ostream & out ) const {
const char * str = 0;
if( empty() ) {
out << "$";
@@ -36,7 +55,7 @@ void SCLP23( Binary )::STEPwrite( ostream & out ) const {
}
}
const char * SCLP23( Binary )::STEPwrite( std::string & s ) const {
const char * SDAI_Binary::STEPwrite( std::string & s ) const {
const char * str = 0;
if( empty() ) {
s = "$";
@@ -52,8 +71,8 @@ const char * SCLP23( Binary )::STEPwrite( std::string & s ) const {
return const_cast<char *>( s.c_str() );
}
Severity SCLP23( Binary )::ReadBinary( istream & in, ErrorDescriptor * err, int AssignVal,
int needDelims ) {
Severity SDAI_Binary::ReadBinary( istream & in, ErrorDescriptor * err, int AssignVal,
int needDelims ) {
if( AssignVal ) {
clear();
}
@@ -123,7 +142,7 @@ Severity SCLP23( Binary )::ReadBinary( istream & in, ErrorDescriptor * err, int
return err->severity();
}
Severity SCLP23( Binary )::StrToVal( const char * s, ErrorDescriptor * err ) {
Severity SDAI_Binary::StrToVal( const char * s, ErrorDescriptor * err ) {
istringstream in( ( char * )s ); // sz defaults to length of s
return ReadBinary( in, err, 1, 0 );
}
@@ -131,11 +150,11 @@ Severity SCLP23( Binary )::StrToVal( const char * s, ErrorDescriptor * err ) {
/////////////////////////////////////////////////
/// reads a binary in exchange file format delimited by double quotes
Severity SCLP23( Binary )::STEPread( istream & in, ErrorDescriptor * err ) {
Severity SDAI_Binary::STEPread( istream & in, ErrorDescriptor * err ) {
return ReadBinary( in, err, 1, 1 );
}
Severity SCLP23( Binary )::STEPread( const char * s, ErrorDescriptor * err ) {
Severity SDAI_Binary::STEPread( const char * s, ErrorDescriptor * err ) {
istringstream in( ( char * )s );
return STEPread( in, err );
}
@@ -159,9 +178,9 @@ Severity SCLP23( Binary )::STEPread( const char * s, ErrorDescriptor * err ) {
** null then attrValue must only contain a valid value and nothing else
** following.
******************************************************************************/
Severity SCLP23( Binary )::BinaryValidLevel( istream & in, ErrorDescriptor * err,
int optional, char * tokenList,
int needDelims, int clearError ) {
Severity SDAI_Binary::BinaryValidLevel( istream & in, ErrorDescriptor * err,
int optional, char * tokenList,
int needDelims, int clearError ) {
if( clearError ) {
err->ClearErrorMsg();
}
@@ -194,9 +213,9 @@ Severity SCLP23( Binary )::BinaryValidLevel( istream & in, ErrorDescriptor * err
return err->severity();
}
Severity SCLP23( Binary )::BinaryValidLevel( const char * value, ErrorDescriptor * err,
int optional, char * tokenList,
int needDelims, int clearError ) {
Severity SDAI_Binary::BinaryValidLevel( const char * value, ErrorDescriptor * err,
int optional, char * tokenList,
int needDelims, int clearError ) {
istringstream in( ( char * )value );
return BinaryValidLevel( in, err, optional, tokenList,
needDelims, clearError );
+56
View File
@@ -0,0 +1,56 @@
#ifndef SDAIBINARY_H
#define SDAIBINARY_H 1
#include <scl_export.h>
#include <string>
/*
* NIST STEP Core Class Library
* clstepcore/sdaiBinary.h
* April 1997
* KC Morris
* Development of this software was funded by the United States Government,
* and is not subject to copyright.
*/
class SCL_DAI_EXPORT SDAI_Binary {
private:
std::string content;
public:
//constructor(s) & destructor
SDAI_Binary( const char * str = 0, int max = 0 );
SDAI_Binary( const std::string & s );
~SDAI_Binary( void );
// operators
SDAI_Binary & operator= ( const char * s );
void clear( void );
bool empty( void ) const;
const char * c_str( void ) const;
// format for STEP
const char * asStr() const {
return c_str();
}
void STEPwrite( ostream & out = cout ) const;
const char * STEPwrite( std::string & 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 );
};
#endif
+34 -54
View File
@@ -13,62 +13,42 @@ extern "C"
#endif
SCLP23( PID )::SCLP23_NAME( PID )() {
SDAI_PID::SDAI_PID() {
}
SCLP23( PID )::~SCLP23_NAME( PID )() {
SDAI_PID::~SDAI_PID() {
}
SCLP23( PID_DA )::SCLP23_NAME( PID_DA )() {
SDAI_PID_DA::SDAI_PID_DA() {
}
SCLP23( PID_DA )::~SCLP23_NAME( PID_DA )() {
SDAI_PID_DA::~SDAI_PID_DA() {
}
SCLP23( PID_SDAI )::SCLP23_NAME( PID_SDAI )() {
SDAI_PID_SDAI::SDAI_PID_SDAI() {
}
SCLP23( PID_SDAI )::~SCLP23_NAME( PID_SDAI )() {
SDAI_PID_SDAI::~SDAI_PID_SDAI() {
}
SCLP23( DAObject )::SCLP23_NAME( DAObject )() {
SDAI_DAObject::SDAI_DAObject() {
}
SCLP23( DAObject )::~SCLP23_NAME( DAObject )() {
SDAI_DAObject::~SDAI_DAObject() {
}
#ifdef PART26
//SCLP26(Application_instance_ptr)
IDL_Application_instance_ptr
SCLP23( DAObject )::create_TIE() {
cout << "ERROR DAObject::create_TIE() called." << endl;
return 0;
}
#endif
SCLP23( DAObject_SDAI )::SCLP23_NAME( DAObject_SDAI )() {
SDAI_DAObject_SDAI::SDAI_DAObject_SDAI() {
}
/*
SCLP23(DAObject_SDAI)::SCLP23_NAME(DAObject_SDAI)(const DAObject_SDAI&)
SDAI_DAObject_SDAI::SDAI_DAObject_SDAI(const DAObject_SDAI&)
{
}
*/
SCLP23( DAObject_SDAI )::~SCLP23_NAME( DAObject_SDAI )() {
SDAI_DAObject_SDAI::~SDAI_DAObject_SDAI() {
}
#ifdef PART26
//SCLP26(Application_instance_ptr)
IDL_Application_instance_ptr
SCLP23( DAObject_SDAI )::create_TIE() {
cout << "ERROR DAObject_SDAI::create_TIE() called." << endl;
return 0;
}
#endif
/*
* Copyright (c) 1990, 1991 Stanford University
*
@@ -97,39 +77,39 @@ SCLP23( DAObject_SDAI )::create_TIE() {
/*****************************************************************************/
SCLP23( DAObject__set )::SCLP23_NAME( DAObject__set )( int defaultSize ) {
SDAI_DAObject__set::SDAI_DAObject__set( int defaultSize ) {
_bufsize = defaultSize;
_buf = new SCLP23( DAObject_ptr )[_bufsize];
_buf = new SDAI_DAObject_ptr[_bufsize];
_count = 0;
}
SCLP23( DAObject__set )::~SCLP23_NAME( DAObject__set )() {
SDAI_DAObject__set::~SDAI_DAObject__set() {
delete _buf;
}
void SCLP23( DAObject__set )::Check( int index ) {
void SDAI_DAObject__set::Check( int index ) {
SCLP23( DAObject_ptr )* newbuf;
SDAI_DAObject_ptr * newbuf;
if( index >= _bufsize ) {
_bufsize = ( index + 1 ) * 2;
newbuf = new SCLP23( DAObject_ptr )[_bufsize];
memmove( newbuf, _buf, _count * sizeof( SCLP23( DAObject_ptr ) ) );
newbuf = new SDAI_DAObject_ptr[_bufsize];
memmove( newbuf, _buf, _count * sizeof( SDAI_DAObject_ptr ) );
delete _buf;
_buf = newbuf;
}
}
void
SCLP23( DAObject__set )::Insert( SCLP23( DAObject_ptr ) v, int index ) {
SDAI_DAObject__set::Insert( SDAI_DAObject_ptr v, int index ) {
SCLP23( DAObject_ptr )* spot;
SDAI_DAObject_ptr * spot;
index = ( index < 0 ) ? _count : index;
if( index < _count ) {
Check( _count + 1 );
spot = &_buf[index];
memmove( spot + 1, spot, ( _count - index )*sizeof( SCLP23( DAObject_ptr ) ) );
memmove( spot + 1, spot, ( _count - index )*sizeof( SDAI_DAObject_ptr ) );
} else {
Check( index );
@@ -139,15 +119,15 @@ SCLP23( DAObject__set )::Insert( SCLP23( DAObject_ptr ) v, int index ) {
++_count;
}
void SCLP23( DAObject__set )::Append( SCLP23( DAObject_ptr ) v ) {
void SDAI_DAObject__set::Append( SDAI_DAObject_ptr v ) {
int index = _count;
SCLP23( DAObject_ptr )* spot;
SDAI_DAObject_ptr * spot;
if( index < _count ) {
Check( _count + 1 );
spot = &_buf[index];
memmove( spot + 1, spot, ( _count - index )*sizeof( SCLP23( DAObject_ptr ) ) );
memmove( spot + 1, spot, ( _count - index )*sizeof( SDAI_DAObject_ptr ) );
} else {
Check( index );
@@ -157,16 +137,16 @@ void SCLP23( DAObject__set )::Append( SCLP23( DAObject_ptr ) v ) {
++_count;
}
void SCLP23( DAObject__set )::Remove( int index ) {
void SDAI_DAObject__set::Remove( int index ) {
if( 0 <= index && index < _count ) {
--_count;
SCLP23( DAObject_ptr )* spot = &_buf[index];
memmove( spot, spot + 1, ( _count - index )*sizeof( SCLP23( DAObject_ptr ) ) );
SDAI_DAObject_ptr * spot = &_buf[index];
memmove( spot, spot + 1, ( _count - index )*sizeof( SDAI_DAObject_ptr ) );
}
}
int SCLP23( DAObject__set )::Index( SCLP23( DAObject_ptr ) v ) {
int SDAI_DAObject__set::Index( SDAI_DAObject_ptr v ) {
for( int i = 0; i < _count; ++i ) {
if( _buf[i] == v ) {
@@ -176,12 +156,12 @@ int SCLP23( DAObject__set )::Index( SCLP23( DAObject_ptr ) v ) {
return -1;
}
SCLP23( DAObject_ptr )
SCLP23( DAObject__set )::retrieve( int index ) {
SDAI_DAObject_ptr
SDAI_DAObject__set::retrieve( int index ) {
return operator[]( index );
}
SCLP23( DAObject_ptr ) & SCLP23( DAObject__set )::operator[]( int index ) {
SDAI_DAObject_ptr & SDAI_DAObject__set::operator[]( int index ) {
Check( index );
// _count = max(_count, index+1);
@@ -190,16 +170,16 @@ SCLP23( DAObject_ptr ) & SCLP23( DAObject__set )::operator[]( int index ) {
}
int
SCLP23( DAObject__set )::Count() {
SDAI_DAObject__set::Count() {
return _count;
}
int
SCLP23( DAObject__set )::is_empty() {
SDAI_DAObject__set::is_empty() {
return _count;
}
void
SCLP23( DAObject__set )::Clear() {
SDAI_DAObject__set::Clear() {
_count = 0;
}
+315 -303
View File
@@ -1,90 +1,94 @@
#ifndef SDAIDAOBJECT_H
#define SDAIDAOBJECT_H 1
typedef char* SCLP23_NAME(DAObjectID);
#include <scl_export.h>
// interface PID (ISO/DIS 10303-23:1996(E) 5.3.10.1)
// Also, CORBA POS specification, Section 5.4
//
// The PID class maintains the persistent object identifier for every
// persistent object, objects of class DAObject, and objects of any class
// derived directly or indirectly from DAObject.
//
// POS: The PID identifies one or more locations within a Datastore that
// represent the persistent data of an object and generates a string
// identifier for that data. An object must have a PID in order to store
// its data persistently.
//
typedef char * SDAI_DAObjectID;
// interface PID (ISO/DIS 10303-23:1996(E) 5.3.10.1)
// Also, CORBA POS specification, Section 5.4
//
// The PID class maintains the persistent object identifier for every
// persistent object, objects of class DAObject, and objects of any class
// derived directly or indirectly from DAObject.
//
// POS: The PID identifies one or more locations within a Datastore that
// represent the persistent data of an object and generates a string
// identifier for that data. An object must have a PID in order to store
// its data persistently.
//
/*
The EXPRESS ENTITY application_instance from the SDAI_data_type_schema from
clause 10 in ISO 10303-22, shall be mapped to the C++ class
Application_instance. The class Application_instance shall be a subtype of
the C++ class DAObject and of the C++ class Entity_instance.
The class DAObject is supported by the classes PID, PID_SDAI and the type
SCLP23(DAObjectID) as follows:
The EXPRESS ENTITY application_instance from the SDAI_data_type_schema from
clause 10 in ISO 10303-22, shall be mapped to the C++ class
Application_instance. The class Application_instance shall be a subtype of
the C++ class DAObject and of the C++ class Entity_instance.
The class DAObject is supported by the classes PID, PID_SDAI and the type
SDAI_DAObjectID as follows:
*/
class SCLP23_NAME(PID) : public SCLP23_NAME(sdaiObject)
{
public:
class SCL_DAI_EXPORT SDAI_PID : public SDAI_sdaiObject {
public:
// These are in the IDL generated code for Part 26. I will have to think about
// These are in the IDL generated code for Part 26. I will have to think about
// why they should be here (for Part 23). DAS
// static PID_ptr _duplicate(PID_ptr);
// static PID_ptr _narrow(SCLP23_NAME(sdaiObject_ptr));
// static PID_ptr _narrow(SDAI_sdaiObject_ptr);
// static PID_ptr _nil();
SCLP23_NAME(String) _datastore_type ;
SCLP23_NAME(String) _pidstring ;
SDAI_String _datastore_type ;
SDAI_String _pidstring ;
// constructor/destructor
SCLP23_NAME(PID)();
virtual ~SCLP23_NAME(PID)();
// constructor/destructor
SDAI_PID();
virtual ~SDAI_PID();
/*
The Datestore_type attribute shall identify the type of the underlying
datastore.
*/
char* Datastore_type() const { return const_cast<char *>(_datastore_type.c_str()); }
void Datastore_type(char *x) { _datastore_type = x; }
/*
The Datestore_type attribute shall identify the type of the underlying
datastore.
*/
char * Datastore_type() const {
return const_cast<char *>( _datastore_type.c_str() );
}
void Datastore_type( char * x ) {
_datastore_type = x;
}
/*
This function shall return a string version of the receiver.
*/
char* get_PIDString();
/*
This function shall return a string version of the receiver.
*/
char * get_PIDString();
};
typedef SCLP23_NAME(PID)* SCLP23_NAME(PID_ptr);
typedef SCLP23_NAME(PID_ptr) SCLP23_NAME(PID_var);
typedef SDAI_PID * SDAI_PID_ptr;
typedef SDAI_PID_ptr SDAI_PID_var;
// interface PID_DA (ISO/DIS 10303-23:1996(E) 5.3.10.3)
// Also, CORBA POS specification, Direct Access Protocol, Section 5.10.1
//
// The Direct Access Protocol supports direct access to persistent data
// through typed attributes organized in data objects that are defined
// in a Data Definition Language (DDL). An object using this protocol
// whould represent its persistent data as one or more interconnected
// data objects, For uniformity, the persistent data of an object is
// described as a single data object; however, that data object might be
// the root of a graph of data objects interconnected by stored data
// object references. If an object uses multiple data objects, the
// object traverses the graph by following stored data object references.
//
// The PID_DA class maintains the persistent object identifier for an
// application DAObject.
//
// POS: The Persistent Identifiers (PIDs) used by the PDS_DA contain
// an object identifier that is local to the particular PDS. This value
// may be accessed through this extension to the CosPersistencePID
// interface.
//
// interface PID_DA (ISO/DIS 10303-23:1996(E) 5.3.10.3)
// Also, CORBA POS specification, Direct Access Protocol, Section 5.10.1
//
// The Direct Access Protocol supports direct access to persistent data
// through typed attributes organized in data objects that are defined
// in a Data Definition Language (DDL). An object using this protocol
// whould represent its persistent data as one or more interconnected
// data objects, For uniformity, the persistent data of an object is
// described as a single data object; however, that data object might be
// the root of a graph of data objects interconnected by stored data
// object references. If an object uses multiple data objects, the
// object traverses the graph by following stored data object references.
//
// The PID_DA class maintains the persistent object identifier for an
// application DAObject.
//
// POS: The Persistent Identifiers (PIDs) used by the PDS_DA contain
// an object identifier that is local to the particular PDS. This value
// may be accessed through this extension to the CosPersistencePID
// interface.
//
class SCLP23_NAME(PID_DA): public SCLP23_NAME(PID)
{
public:
class SCL_DAI_EXPORT SDAI_PID_DA: public SDAI_PID {
public:
SCLP23_NAME(String) _oid ;
SDAI_String _oid ;
// oid (ISO/DIS 10303-23:1996(E) 5.3.10.3)
//
// This attribute shall set and return the string representation of the
@@ -92,71 +96,76 @@ class SCLP23_NAME(PID_DA): public SCLP23_NAME(PID)
// referred to by this object.
//
// POS: This returns the data object identifier used by this PDS for
// the data object specified by the PID. The SCLP23(DAObjectID) type is
// defined as an unbounded sequence of bytes that may be
// the data object specified by the PID. The SDAI_DAObjectID type is
// defined as an unbounded sequence of bytes that may be
// vendor-dependent.
//
// constructor/destructor
SCLP23_NAME(PID_DA)();
virtual ~SCLP23_NAME(PID_DA)();
// constructor/destructor
SDAI_PID_DA();
virtual ~SDAI_PID_DA();
virtual void oid (const SCLP23_NAME(DAObjectID) x) { _oid = x; }
virtual SCLP23_NAME(DAObjectID) oid () const
{ return const_cast<char *>(_oid.c_str()); }
virtual void oid( const SDAI_DAObjectID x ) {
_oid = x;
}
virtual SDAI_DAObjectID oid() const {
return const_cast<char *>( _oid.c_str() );
}
};
typedef SCLP23_NAME(PID_DA)* SCLP23_NAME(PID_DA_ptr);
typedef SCLP23_NAME(PID_DA_ptr) SCLP23_NAME(PID_DA_var);
typedef SDAI_PID_DA * SDAI_PID_DA_ptr;
typedef SDAI_PID_DA_ptr SDAI_PID_DA_var;
// interface PID_SDAI (ISO/DIS 10303-23:1996(E) 5.3.10.2)
//
// The PID_SDAI class maintains the persistent object identifier for
// a Model_contents object.
//
class SCLP23_NAME(PID_SDAI) : public SCLP23_NAME(PID)
{
public:
SCLP23_NAME(String) _modelid ;
// interface PID_SDAI (ISO/DIS 10303-23:1996(E) 5.3.10.2)
//
// The PID_SDAI class maintains the persistent object identifier for
// a Model_contents object.
//
class SCL_DAI_EXPORT SDAI_PID_SDAI : public SDAI_PID {
public:
SDAI_String _modelid ;
// constructor/destructor
SCLP23_NAME(PID_SDAI)();
virtual ~SCLP23_NAME(PID_SDAI)();
// constructor/destructor
SDAI_PID_SDAI();
virtual ~SDAI_PID_SDAI();
// Modelid (ISO/DIS 10303-23:1996(E) 5.3.10.3)
//
// This attribute shall set and return the string representation of
// the persistent identifier of the cluster of data for the
// the persistent identifier of the cluster of data for the
// Model_contents referred to by this PID.
//
virtual void Modelid (const char * x) { _modelid = x; }
virtual char * Modelid () const { return const_cast<char *>(_modelid.c_str()); }
virtual void Modelid( const char * x ) {
_modelid = x;
}
virtual char * Modelid() const {
return const_cast<char *>( _modelid.c_str() );
}
};
typedef SCLP23_NAME(PID_SDAI)* SCLP23_NAME(PID_SDAI_ptr);
typedef SCLP23_NAME(PID_SDAI_ptr) SCLP23_NAME(PID_SDAI_var);
typedef SDAI_PID_SDAI * SDAI_PID_SDAI_ptr;
typedef SDAI_PID_SDAI_ptr SDAI_PID_SDAI_var;
// interface DAObject (ISO/DIS 10303-23:1996(E) 5.3.10.5)
// Also, CORBA POS Section 5.10.2, Direct Access Protocol.
//
// From POS: The DAObject interface provides operations that many data
// object clients need. A Datastore implementation may provide support
// for these operations automatically for its data objects. A data object
// is not required to support this interface. A client can obtain access
// to these operations by narrowing a data object reference to the
// DAObject interface.
//
// interface DAObject (ISO/DIS 10303-23:1996(E) 5.3.10.5)
// Also, CORBA POS Section 5.10.2, Direct Access Protocol.
//
// From POS: The DAObject interface provides operations that many data
// object clients need. A Datastore implementation may provide support
// for these operations automatically for its data objects. A data object
// is not required to support this interface. A client can obtain access
// to these operations by narrowing a data object reference to the
// DAObject interface.
//
// predefine these _ptr since they are used inside this class
class SCLP23_NAME(DAObject);
typedef SCLP23_NAME(DAObject)* SCLP23_NAME(DAObject_ptr);
typedef SCLP23_NAME(DAObject_ptr) SCLP23_NAME(DAObject_var);
// predefine these _ptr since they are used inside this class
class SDAI_DAObject;
typedef SDAI_DAObject * SDAI_DAObject_ptr;
typedef SDAI_DAObject_ptr SDAI_DAObject_var;
class SCLP23_NAME(DAObject) : public SCLP23_NAME(sdaiObject)
{
public:
class SCL_DAI_EXPORT SDAI_DAObject : public SDAI_sdaiObject {
public:
SCLP23_NAME(String) _dado_oid;
SDAI_String _dado_oid;
// dado_same (ISO/DIS 10303-23:1996(E) 5.3.10.5)
//
@@ -168,13 +177,13 @@ class SCLP23_NAME(DAObject) : public SCLP23_NAME(sdaiObject)
// identity.
//
// constructor/destructor
SCLP23_NAME(DAObject)();
virtual ~SCLP23_NAME(DAObject)();
// constructor/destructor
SDAI_DAObject();
virtual ~SDAI_DAObject();
Logical dado_same(SCLP23_NAME(DAObject_ptr) obj) {
return LUnknown;
}
Logical dado_same( SDAI_DAObject_ptr obj ) {
return LUnknown;
}
// Get persistent label (ISO/DIS 10303-22:1996(E) 10.11.6)
//
@@ -191,33 +200,36 @@ class SCLP23_NAME(DAObject) : public SCLP23_NAME(sdaiObject)
// sdaiTR_NAVL The transaction is currently not available
// sdaiTR_EAB The transaction ended abnormally
// sdaiRP_NOPN The repository is not open
// sdaiEI_NEXS The entity instance does not exist
// sdaiEI_NEXS The entity instance does not exist
// sdaiFN_NAVL This function is not supported by the implementation
// sdaiSY_ERR An underlying system error occurred
//
// POS specification description: This returns the object identifier
// for the data object. The scope of data object identifiers is
// implementation-specific, but is not guaranteed to be global.
//
//
/* jg == The return value of this function in Part 23 is PID_DA which
seems wrong. We follow the CORBAservices specification here.
(Persistent Object Service Specification, Section 5.10). Also
note that the return value as described in the text above
should be a string type.
*/
SCLP23_NAME(DAObjectID) dado_oid()
{ return const_cast<char *>(_dado_oid.c_str()); }
SDAI_DAObjectID dado_oid() {
return const_cast<char *>( _dado_oid.c_str() );
}
// dado_pid
//
// POS specification description: This returns a PID_DA for the
// POS specification description: This returns a PID_DA for the
// data object.
//
/* jg == This function is not included in Part 23 and 26. However, it is
/* jg == This function is not included in Part 23 and 26. However, it is
part of interface DAObject in the specification of the
Persistent Object Service.
Persistent Object Service.
*/
SCLP23_NAME(PID_DA_ptr) dado_pid() { return 0; }
SDAI_PID_DA_ptr dado_pid() {
return 0;
}
// dado_remove (ISO/DIS 10303-23:1996(E) 5.3.10.5)
//
@@ -228,281 +240,281 @@ class SCLP23_NAME(DAObject) : public SCLP23_NAME(sdaiObject)
// POS specification description: This deletes the object from the
// persistent store and deletes the in-memory data object.
//
void dado_remove() { }
void dado_remove() { }
// dado_free (ISO/DIS 10303-23:1996(E) 5.3.10.5)
//
//
// This function shall inform the implementation that it is free
// to move the object back to the persistent store.
//
// POS specification description: This informs the PDS (Persistent
//
// POS specification description: This informs the PDS (Persistent
// Data Service) that the data object is not required for the time
// being, and the PDS may move it back to persistent store. The data
// object must be preserved and must be brought back the next time it is
// object must be preserved and must be brought back the next time it is
// referenced. This operation is only a hint and is provided to improve
// performance and resource usage.
// performance and resource usage.
//
void dado_free() { }
void dado_free() { }
};
/*
5.3.10.1 DAObject_SDAI
*/
class SCLP23_NAME(DAObject_SDAI) : public SCLP23_NAME(DAObject) {
class SCL_DAI_EXPORT SDAI_DAObject_SDAI : public SDAI_DAObject {
public:
SCLP23_NAME(DAObject_SDAI)();
public:
SDAI_DAObject_SDAI();
virtual ~SCLP23_NAME(DAObject_SDAI)();
virtual ~SDAI_DAObject_SDAI();
/*
5.3.10.1.1 Find entity instance SDAI-model
*/
/*
5.3.10.1.1 Find entity instance SDAI-model
*/
// Model_ptr Owning_model() const;
/*
The Owning_model function shall implement the SDAI operation, Find
entity instance SDAI-model.
/*
The Owning_model function shall implement the SDAI operation, Find
entity instance SDAI-model.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
SDAI C++
------ -------
Object receiver
Model return value
SDAI C++
------ -------
Object receiver
Model return value
5.3.10.1.2 Find entity instance users
*/
5.3.10.1.2 Find entity instance users
*/
// Object__list_var FindObjectUsers(const
// Schema_instance__list_var& aggr) const;
// Schema_instance__list_var& aggr) const;
/*
The FindObjectUsers function shall implement the SDAI operation,
Find entity instance users.
/*
The FindObjectUsers function shall implement the SDAI operation,
Find entity instance users.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
SDAI C++
-------- --------
Instance receiver
Domain aggr
Result return value
SDAI C++
-------- --------
Instance receiver
Domain aggr
Result return value
5.3.10.1.3 Is same
*/
5.3.10.1.3 Is same
*/
Logical IsSame(const SCLP23_NAME(sdaiObject_ptr)& otherEntity) const;
Logical IsSame( const SDAI_sdaiObject_ptr & otherEntity ) const;
/*
Function:
The IsSame function shall determine whether the parameter otherEntity
refers to the same instance as the receiver. This function shall
implement the behaviour of the EXPRESS operator (:=:).
/*
Function:
The IsSame function shall determine whether the parameter otherEntity
refers to the same instance as the receiver. This function shall
implement the behaviour of the EXPRESS operator (:=:).
Output:
This function shall return TRUE if the two instances are identical.
This function shall return FALSE if the two instances are not identical.
This function shall return UNKNOWN if either instance is unset.
Output:
This function shall return TRUE if the two instances are identical.
This function shall return FALSE if the two instances are not identical.
This function shall return UNKNOWN if either instance is unset.
Possible error indicators:
sdaiMX_NDEF // SDAI-model access not defined
sdaiEI_NEXS // Entity instance does not exist
sdaiTY_NDEF // Type not defined
sdaiSY_ERR // Underlying system error
Possible error indicators:
sdaiMX_NDEF // SDAI-model access not defined
sdaiEI_NEXS // Entity instance does not exist
sdaiTY_NDEF // Type not defined
sdaiSY_ERR // Underlying system error
Origin: Convenience function
Origin: Convenience function
5.3.10.1.4 Get attribute
*/
5.3.10.1.4 Get attribute
*/
#ifdef SDAI_CPP_LATE_BINDING
Any_var GetAttr(const Attribute_ptr& attDef);
Any_var GetAttr(const char* attName);
Any_var GetAttr( const Attribute_ptr & attDef );
Any_var GetAttr( const char * attName );
#endif
/*
The GetAttr functions shall implement the SDAI operation, Get attribute.
/*
The GetAttr functions shall implement the SDAI operation, Get attribute.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
SDAI C++
------ ---------
Object receiver
Attribute attDef, attName
Value return value
SDAI C++
------ ---------
Object receiver
Attribute attDef, attName
Value return value
5.3.10.1.5 Get instance type
*/
5.3.10.1.5 Get instance type
*/
#ifdef SDAI_CPP_LATE_BINDING
const Entity_ptr GetInstanceType() const;
const Entity_ptr GetInstanceType() const;
#endif
/*
Function:
/*
Function:
The GetInstanceType functions shall implement the SDAI operation,
Get instance type.
The GetInstanceType functions shall implement the SDAI operation,
Get instance type.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
SDAI C++
------ --------
Object receiver
Type return value
SDAI C++
------ --------
Object receiver
Type return value
5.3.10.1.6 Is instance of
*/
5.3.10.1.6 Is instance of
*/
Boolean IsInstanceOf(const char* typeName) const;
::Boolean IsInstanceOf( const char * typeName ) const;
#ifdef SDAI_CPP_LATE_BINDING
Boolean IsInstanceOf(const Entity_ptr& otherEntity) const;
::Boolean IsInstanceOf( const Entity_ptr & otherEntity ) const;
#endif
/*
Function:
The IsInstanceOf functions shall implement the SDAI operation Is
instance of.
/*
Function:
The IsInstanceOf functions shall implement the SDAI operation Is
instance of.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
SDAI C++
------ --------
Object receiver
Type typeName, otherEntity
Result return value
SDAI C++
------ --------
Object receiver
Type typeName, otherEntity
Result return value
5.3.10.1.7 Is kind of
*/
5.3.10.1.7 Is kind of
*/
Boolean IsKindOf(const char* typeName) const;
::Boolean IsKindOf( const char * typeName ) const;
#ifdef SDAI_CPP_LATE_BINDING
Boolean IsKindOf(const Entity_ptr& theType) const;
::Boolean IsKindOf( const Entity_ptr & theType ) const;
#endif
/*
The IsKindOf functions shall implement the SDAI operation, Is kind of.
/*
The IsKindOf functions shall implement the SDAI operation, Is kind of.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
SDAI C++
------ --------
Object receiver
Type typeName, theType
Result return value
SDAI C++
------ --------
Object receiver
Type typeName, theType
Result return value
5.3.10.1.8 Is SDAI kind of
*/
5.3.10.1.8 Is SDAI kind of
*/
Boolean IsSDAIKindOf(const char* typeName) const;
::Boolean IsSDAIKindOf( const char * typeName ) const;
#ifdef SDAI_CPP_LATE_BINDING
Boolean IsSDAIKindOf(const Entity_ptr& theType) const;
::Boolean IsSDAIKindOf( const Entity_ptr & theType ) const;
#endif
/*
The IsSDAIKindOf functions shall implement the SDAI operation,
Is SDAI Kind Of.
/*
The IsSDAIKindOf functions shall implement the SDAI operation,
Is SDAI Kind Of.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
SDAI C++
------ --------
Object receiver
Type typeName, theType
Result return value
SDAI C++
------ --------
Object receiver
Type typeName, theType
Result return value
5.3.10.1.9 Test attribute
*/
5.3.10.1.9 Test attribute
*/
#ifdef SDAI_CPP_LATE_BINDING
Boolean TestAttr(const Attribute_ptr& attDef);
Boolean TestAttr(const char* attName) const;
Boolean TestAttr( const Attribute_ptr & attDef );
Boolean TestAttr( const char * attName ) const;
#endif
/*
The TestAttr functions shall implement the SDAI operation,
Test attribute.
/*
The TestAttr functions shall implement the SDAI operation,
Test attribute.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
SDAI C++
------ ---------
Object receiver
Attribute attDef, attName
Result return value
5.3.10.1.10 Get instance type name
*/
SDAI C++
------ ---------
Object receiver
Attribute attDef, attName
Result return value
5.3.10.1.10 Get instance type name
*/
#ifndef SDAI_CPP_LATE_BINDING
char * GetInstanceTypeName() const;
char * GetInstanceTypeName() const;
#endif
/*
Function:
The GetInstanceType function shall retrieve the name of the type of
the receiver.
/*
Function:
The GetInstanceType function shall retrieve the name of the type of
the receiver.
Output:
This function shall return a String which contains the name of the
type of the receiver. The returned name shall be the name as it
appears in the Dictionary Model.
Output:
This function shall return a String which contains the name of the
type of the receiver. The returned name shall be the name as it
appears in the Dictionary Model.
Possible error indicators:
sdaiMX_NDEF // SDAI-model access not defined
sdaiEI_NEXS // Entity instance does not exist
sdaiSY_ERR // Underlying system error
Possible error indicators:
sdaiMX_NDEF // SDAI-model access not defined
sdaiEI_NEXS // Entity instance does not exist
sdaiSY_ERR // Underlying system error
Origin: Convenience function
*/
Origin: Convenience function
*/
};
typedef SCLP23_NAME(DAObject_SDAI)* SCLP23_NAME(DAObject_SDAI_ptr);
typedef SCLP23_NAME(DAObject_SDAI_ptr) SCLP23_NAME(DAObject_SDAI_var);
typedef SDAI_DAObject_SDAI * SDAI_DAObject_SDAI_ptr;
typedef SDAI_DAObject_SDAI_ptr SDAI_DAObject_SDAI_var;
class SCLP23_NAME(DAObject__set) {
public:
SCLP23_NAME(DAObject__set)(int = 16);
~SCLP23_NAME(DAObject__set)();
class SCL_DAI_EXPORT SDAI_DAObject__set {
public:
SDAI_DAObject__set( int = 16 );
~SDAI_DAObject__set();
SCLP23_NAME(DAObject_ptr) retrieve(int index);
int is_empty();
SDAI_DAObject_ptr retrieve( int index );
int is_empty();
SCLP23_NAME(DAObject_ptr)& operator[](int index);
SDAI_DAObject_ptr & operator[]( int index );
void Insert(SCLP23_NAME(DAObject_ptr), int index);
void Append(SCLP23_NAME(DAObject_ptr));
void Remove(int index);
void Insert( SDAI_DAObject_ptr, int index );
void Append( SDAI_DAObject_ptr );
void Remove( int index );
int Index(SCLP23_NAME(DAObject_ptr));
int Index( SDAI_DAObject_ptr );
void Clear();
int Count();
void Clear();
int Count();
private:
void Check(int index);
private:
SCLP23_NAME(DAObject_ptr)* _buf;
int _bufsize;
int _count;
private:
void Check( int index );
private:
SDAI_DAObject_ptr * _buf;
int _bufsize;
int _count;
public:
public:
};
typedef SCLP23_NAME(DAObject__set)* SCLP23_NAME(DAObject__set_ptr);
typedef SCLP23_NAME(DAObject__set_ptr) SCLP23_NAME(DAObject__set_var);
typedef SDAI_DAObject__set * SDAI_DAObject__set_ptr;
typedef SDAI_DAObject__set_ptr SDAI_DAObject__set_var;
#endif
+18 -18
View File
@@ -4,7 +4,7 @@
#include <sdai.h>
SCLP23( Entity_extent )::SCLP23_NAME( Entity_extent )( )
SDAI_Entity_extent::SDAI_Entity_extent( )
: _definition( 0 ), _definition_name( 0 ), _owned_by( 0 ) {
/*
_definition = 0;
@@ -14,7 +14,7 @@ SCLP23( Entity_extent )::SCLP23_NAME( Entity_extent )( )
}
/*
SCLP23(Entity_extent)::SCLP23_NAME(Entity_extent)(const SCLP23(Entity_extent)& ee)
SDAI_Entity_extent::SDAI_Entity_extent(const SDAI_Entity_extent& ee)
{
// { CopyAs((STEPentityH) &e); }
_definition = 0;
@@ -22,54 +22,54 @@ SCLP23(Entity_extent)::SCLP23_NAME(Entity_extent)(const SCLP23(Entity_extent)& e
}
*/
SCLP23( Entity_extent )::~SCLP23_NAME( Entity_extent )() {
SDAI_Entity_extent::~SDAI_Entity_extent() {
delete _definition_name;
}
const Entity_ptr
SCLP23( Entity_extent )::definition_() const {
SDAI_Entity_extent::definition_() const {
return _definition;
}
/*
const SCLP23(Entity_name)
SCLP23(Entity_extent)::definition_name_() const
const SDAI_Entity_name
SDAI_Entity_extent::definition_name_() const
{
return _definition_name;
}
*/
void
SCLP23( Entity_extent )::definition_( const Entity_ptr & ep ) {
SDAI_Entity_extent::definition_( const Entity_ptr & ep ) {
_definition = ep;
}
void
SCLP23( Entity_extent )::definition_name_( const SCLP23( Entity_name )& en ) {
SDAI_Entity_extent::definition_name_( const SDAI_Entity_name & en ) {
_definition_name = new char[strlen( en ) + 1];
strncpy( _definition_name, en, strlen( en ) + 1 );
}
void
SCLP23( Entity_extent )::owned_by_( SCLP23_NAME( Model_contents__list_var )& mclv ) {
SDAI_Entity_extent::owned_by_( SDAI_Model_contents__list_var & mclv ) {
// _owned_by = mcp;
}
const SCLP23( Model_contents__list_var )
SCLP23( Entity_extent )::owned_by_() const {
return ( const SCLP23( Model_contents__list_var ) ) &_owned_by;
const SDAI_Model_contents__list_var
SDAI_Entity_extent::owned_by_() const {
return ( const SDAI_Model_contents__list_var ) &_owned_by;
}
/*
SCLP23(DAObject__set_var) instances_()
SDAI_DAObject__set_var instances_()
{
return &_instances;
}
const
SCLP23(DAObject__set_var) instances_() const
SDAI_DAObject__set_var instances_() const
{
return (const SCLP23(DAObject__set_var))&_instances;
return (const SDAI_DAObject__set_var)&_instances;
}
*/
@@ -92,7 +92,7 @@ SCLP23(DAObject__set_var) instances_() const
*/
void
SCLP23( Entity_extent )::AddInstance( const SCLP23( DAObject_ptr )& appInst ) {
SDAI_Entity_extent::AddInstance( const SDAI_DAObject_ptr & appInst ) {
_instances.Append( appInst );
}
@@ -114,8 +114,8 @@ SCLP23( Entity_extent )::AddInstance( const SCLP23( DAObject_ptr )& appInst ) {
void
SCLP23( Entity_extent )::RemoveInstance( const SCLP23( DAObject_ptr )& appInst ) {
SDAI_Entity_extent::RemoveInstance( const SDAI_DAObject_ptr & appInst ) {
_instances.Remove( _instances.Index( appInst ) );
}
///////// END_ENTITY SCLP23(Entity_extent)
///////// END_ENTITY SDAI_Entity_extent
+74 -68
View File
@@ -1,6 +1,8 @@
#ifndef ENTITYEXTENT_H
#define ENTITYEXTENT_H 1
#include <scl_export.h>
/*
//#include <sdaiDefs.h>
//#include <ApplInstanceSet.h>
@@ -8,110 +10,114 @@
//#include <ModelContents.h>
*/
/*
/*
7.3.3 Entity extent
*/
class SCLP23_NAME(Entity_extent);
typedef SCLP23_NAME(Entity_extent) * SCLP23_NAME(Entity_extent_ptr);
typedef SCLP23_NAME(Entity_extent_ptr) SCLP23_NAME(Entity_extent_var);
class SDAI_Entity_extent;
typedef SDAI_Entity_extent * SDAI_Entity_extent_ptr;
typedef SDAI_Entity_extent_ptr SDAI_Entity_extent_var;
class SCLP23_NAME(Entity_extent) : public SCLP23_NAME(Session_instance) {
class SCL_DAI_EXPORT SDAI_Entity_extent : public SDAI_Session_instance {
friend class SCLP23_NAME(Model_contents);
/*
NOTE - The ModelContent class is a friend so that ModelContent may add
instances to Entity_extent instances.
*/
friend class SDAI_Model_contents;
/*
NOTE - The ModelContent class is a friend so that ModelContent may add
instances to Entity_extent instances.
*/
public: //for now
public: //for now
// protected:
Entity_ptr _definition ;
SCLP23_NAME(Entity_name) _definition_name ;
SCLP23_NAME(DAObject__set) _instances ; // of Application_instance
// Entity_instance__set _instances ; // of entity_instance
// EntityAggregate _instances ; // of entity_instance
Entity_ptr _definition ;
SDAI_Entity_name _definition_name ;
SDAI_DAObject__set _instances ; // of Application_instance
// Entity_instance__set _instances ; // of entity_instance
// EntityAggregate _instances ; // of entity_instance
// Express in part 22 - INVERSE owned_by : sdai_model_contents FOR folders;
SCLP23_NAME(Model_contents__list) _owned_by ; // ADDED in Part 22
SDAI_Model_contents__list _owned_by ; // ADDED in Part 22
// private:
SCLP23_NAME(Entity_extent)();
// SCLP23_NAME(Entity_extent)(const SCLP23_NAME(Entity_extent)& ee);
~SCLP23_NAME(Entity_extent)(); // not in part 23
SDAI_Entity_extent();
// SDAI_Entity_extent(const SDAI_Entity_extent& ee);
~SDAI_Entity_extent(); // not in part 23
public:
public:
SCLP23_NAME(Entity_name) definition_name_() const
{ return _definition_name; }
SDAI_Entity_name definition_name_() const {
return _definition_name;
}
const Entity_ptr definition_() const;
const Entity_ptr definition_() const;
#ifdef SDAI_CPP_LATE_BINDING
// const Entity_ptr definition_() const;
#endif
SCLP23_NAME(DAObject__set_var) instances_() { return &_instances; }
SCLP23_NAME(DAObject__set_var) instances_() const
{ return (const SCLP23_NAME(DAObject__set_var))&_instances; }
SDAI_DAObject__set_var instances_() {
return &_instances;
}
SDAI_DAObject__set_var instances_() const {
return ( const SDAI_DAObject__set_var )&_instances;
}
// need to implement Model_contents__list
const SCLP23_NAME(Model_contents__list_var) owned_by_() const;
const SDAI_Model_contents__list_var owned_by_() const;
// static SCLP23_NAME(Entity_extent_ptr)
// _duplicate(SCLP23_NAME(Entity_extent_ptr) eep);
// static SCLP23_NAME(Entity_extent_ptr) _narrow(Object_ptr op);
// static SCLP23_NAME(Entity_extent_ptr) _nil();
// static SDAI_Entity_extent_ptr
// _duplicate(SDAI_Entity_extent_ptr eep);
// static SDAI_Entity_extent_ptr _narrow(Object_ptr op);
// static SDAI_Entity_extent_ptr _nil();
// private:
void definition_(const Entity_ptr& ep);
void definition_( const Entity_ptr & ep );
#ifdef SDAI_CPP_LATE_BINDING
// void definition_(const Entity_ptr& ep);
#endif
void definition_name_(const SCLP23_NAME(Entity_name)& ep);
void owned_by_(SCLP23_NAME(Model_contents__list_var)& mcp);
void definition_name_( const SDAI_Entity_name & ep );
void owned_by_( SDAI_Model_contents__list_var & mcp );
/*
7.3.3.1 SDAI operation declarations
/*
7.3.3.1 SDAI operation declarations
7.3.3.1.1 AddInstance
*/
7.3.3.1.1 AddInstance
*/
// this is no longer in Part 23
void AddInstance(const SCLP23_NAME(DAObject_ptr)& appInst);
// this is no longer in Part 23
void AddInstance( const SDAI_DAObject_ptr & appInst );
/*
Function:
/*
Function:
The AddInstance function shall add the entity instance entity
handle to the instances set of the receiver.
The AddInstance function shall add the entity instance entity
handle to the instances set of the receiver.
Possible error indicators:
sdaiSS_NOPN // Session not open
sdaiRP_NOPN // Repository not open
sdaiMO_NEXS // SDAI-model does not exist
sdaiMX_NRW // SDAI-model access not read-write
sdaiSY_ERR // Underlying system error
Possible error indicators:
sdaiSS_NOPN // Session not open
sdaiRP_NOPN // Repository not open
sdaiMO_NEXS // SDAI-model does not exist
sdaiMX_NRW // SDAI-model access not read-write
sdaiSY_ERR // Underlying system error
Origin: Convenience function
*/
Origin: Convenience function
*/
// this is no longer in Part 23
void RemoveInstance(const SCLP23_NAME(DAObject_ptr)& appInst);
// this is no longer in Part 23
void RemoveInstance( const SDAI_DAObject_ptr & appInst );
/*
7.3.3.1.2 RemoveInstance
Function:
The RemoveInstance function shall remove the entity instance entity
handle from the instances set of the receiver.
/*
7.3.3.1.2 RemoveInstance
Function:
The RemoveInstance function shall remove the entity instance entity
handle from the instances set of the receiver.
Possible error indicators:
sdaiSS_NOPN // Session not open
sdaiRP_NOPN // Repository not open
sdaiMO_NEXS // SDAI-model does not exist
sdaiMX_NRW // SDAI-model access not read-write
sdaiSY_ERR // Underlying system error
Possible error indicators:
sdaiSS_NOPN // Session not open
sdaiRP_NOPN // Repository not open
sdaiMO_NEXS // SDAI-model does not exist
sdaiMX_NRW // SDAI-model access not read-write
sdaiSY_ERR // Underlying system error
Origin: Convenience function
*/
Origin: Convenience function
*/
};
+23 -23
View File
@@ -43,39 +43,39 @@ extern "C"
/*****************************************************************************/
SCLP23( Entity_extent__set )::SCLP23_NAME( Entity_extent__set )( int defaultSize ) {
SDAI_Entity_extent__set::SDAI_Entity_extent__set( int defaultSize ) {
_bufsize = defaultSize;
_buf = new SCLP23( Entity_extent_ptr )[_bufsize];
_buf = new SDAI_Entity_extent_ptr[_bufsize];
_count = 0;
}
SCLP23( Entity_extent__set )::~SCLP23_NAME( Entity_extent__set )() {
SDAI_Entity_extent__set::~SDAI_Entity_extent__set() {
delete _buf;
}
void SCLP23( Entity_extent__set )::Check( int index ) {
void SDAI_Entity_extent__set::Check( int index ) {
SCLP23( Entity_extent_ptr )* newbuf;
SDAI_Entity_extent_ptr * newbuf;
if( index >= _bufsize ) {
_bufsize = ( index + 1 ) * 2;
newbuf = new SCLP23( Entity_extent_ptr )[_bufsize];
memmove( newbuf, _buf, _count * sizeof( SCLP23( Entity_extent_ptr ) ) );
newbuf = new SDAI_Entity_extent_ptr[_bufsize];
memmove( newbuf, _buf, _count * sizeof( SDAI_Entity_extent_ptr ) );
delete _buf;
_buf = newbuf;
}
}
void
SCLP23( Entity_extent__set )::Insert( SCLP23( Entity_extent_ptr ) v, int index ) {
SDAI_Entity_extent__set::Insert( SDAI_Entity_extent_ptr v, int index ) {
SCLP23( Entity_extent_ptr )* spot;
SDAI_Entity_extent_ptr * spot;
index = ( index < 0 ) ? _count : index;
if( index < _count ) {
Check( _count + 1 );
spot = &_buf[index];
memmove( spot + 1, spot, ( _count - index )*sizeof( SCLP23( Entity_extent_ptr ) ) );
memmove( spot + 1, spot, ( _count - index )*sizeof( SDAI_Entity_extent_ptr ) );
} else {
Check( index );
@@ -85,15 +85,15 @@ SCLP23( Entity_extent__set )::Insert( SCLP23( Entity_extent_ptr ) v, int index )
++_count;
}
void SCLP23( Entity_extent__set )::Append( SCLP23( Entity_extent_ptr ) v ) {
void SDAI_Entity_extent__set::Append( SDAI_Entity_extent_ptr v ) {
int index = _count;
SCLP23( Entity_extent_ptr )* spot;
SDAI_Entity_extent_ptr * spot;
if( index < _count ) {
Check( _count + 1 );
spot = &_buf[index];
memmove( spot + 1, spot, ( _count - index )*sizeof( SCLP23( Entity_extent_ptr ) ) );
memmove( spot + 1, spot, ( _count - index )*sizeof( SDAI_Entity_extent_ptr ) );
} else {
Check( index );
@@ -103,16 +103,16 @@ void SCLP23( Entity_extent__set )::Append( SCLP23( Entity_extent_ptr ) v ) {
++_count;
}
void SCLP23( Entity_extent__set )::Remove( int index ) {
void SDAI_Entity_extent__set::Remove( int index ) {
if( 0 <= index && index < _count ) {
--_count;
SCLP23( Entity_extent_ptr )* spot = &_buf[index];
memmove( spot, spot + 1, ( _count - index )*sizeof( SCLP23( Entity_extent_ptr ) ) );
SDAI_Entity_extent_ptr * spot = &_buf[index];
memmove( spot, spot + 1, ( _count - index )*sizeof( SDAI_Entity_extent_ptr ) );
}
}
int SCLP23( Entity_extent__set )::Index( SCLP23( Entity_extent_ptr ) v ) {
int SDAI_Entity_extent__set::Index( SDAI_Entity_extent_ptr v ) {
for( int i = 0; i < _count; ++i ) {
if( _buf[i] == v ) {
@@ -122,12 +122,12 @@ int SCLP23( Entity_extent__set )::Index( SCLP23( Entity_extent_ptr ) v ) {
return -1;
}
SCLP23( Entity_extent_ptr )
SCLP23( Entity_extent__set )::retrieve( int index ) {
SDAI_Entity_extent_ptr
SDAI_Entity_extent__set::retrieve( int index ) {
return operator[]( index );
}
SCLP23( Entity_extent_ptr ) & SCLP23( Entity_extent__set )::operator[]( int index ) {
SDAI_Entity_extent_ptr & SDAI_Entity_extent__set::operator[]( int index ) {
Check( index );
// _count = max(_count, index+1);
_count = ( ( _count > index + 1 ) ? _count : ( index + 1 ) );
@@ -135,17 +135,17 @@ SCLP23( Entity_extent_ptr ) & SCLP23( Entity_extent__set )::operator[]( int inde
}
int
SCLP23( Entity_extent__set )::Count() {
SDAI_Entity_extent__set::Count() {
return _count;
}
int
SCLP23( Entity_extent__set )::is_empty() {
SDAI_Entity_extent__set::is_empty() {
return _count;
}
void
SCLP23( Entity_extent__set )::Clear() {
SDAI_Entity_extent__set::Clear() {
_count = 0;
}
+21 -21
View File
@@ -35,36 +35,36 @@
//#include <EntityExtent.h>
*/
class SCLP23_NAME(Entity_extent__set) {
public:
class SCL_DAI_EXPORT SDAI_Entity_extent__set {
public:
SCLP23_NAME(Entity_extent__set)(int = 16);
~SCLP23_NAME(Entity_extent__set)();
SDAI_Entity_extent__set( int = 16 );
~SDAI_Entity_extent__set();
SCLP23_NAME(Entity_extent_ptr) retrieve(int index);
int is_empty();
SDAI_Entity_extent_ptr retrieve( int index );
int is_empty();
SCLP23_NAME(Entity_extent_ptr)& operator[](int index);
SDAI_Entity_extent_ptr & operator[]( int index );
void Insert(SCLP23_NAME(Entity_extent_ptr), int index);
void Append(SCLP23_NAME(Entity_extent_ptr));
void Remove(int index);
int Index(SCLP23_NAME(Entity_extent_ptr));
void Insert( SDAI_Entity_extent_ptr, int index );
void Append( SDAI_Entity_extent_ptr );
void Remove( int index );
int Index( SDAI_Entity_extent_ptr );
void Clear();
int Count();
void Clear();
int Count();
private:
void Check(int index);
private:
SCLP23_NAME(Entity_extent_ptr)* _buf;
int _bufsize;
int _count;
private:
void Check( int index );
private:
SDAI_Entity_extent_ptr * _buf;
int _bufsize;
int _count;
};
typedef SCLP23_NAME(Entity_extent__set)* SCLP23_NAME(Entity_extent__set_ptr);
typedef SCLP23_NAME(Entity_extent__set_ptr) SCLP23_NAME(Entity_extent__set_var);
typedef SDAI_Entity_extent__set * SDAI_Entity_extent__set_ptr;
typedef SDAI_Entity_extent__set_ptr SDAI_Entity_extent__set_var;
/*
class Entity_extent__set {
@@ -18,19 +18,19 @@
// class Logical
///////////////////////////////////////////////////////////////////////////////
SCLP23( LOGICAL )::SCLP23_NAME( LOGICAL )( char * val ) {
SDAI_LOGICAL::SDAI_LOGICAL( char * val ) {
set_value( val );
}
SCLP23( LOGICAL )::SCLP23_NAME( LOGICAL )( Logical state ) {
SDAI_LOGICAL::SDAI_LOGICAL( Logical state ) {
set_value( state );
}
SCLP23( LOGICAL )::SCLP23_NAME( LOGICAL )( const SCLP23( LOGICAL )& source ) {
SDAI_LOGICAL::SDAI_LOGICAL( const SDAI_LOGICAL & source ) {
set_value( source.asInt() );
}
SCLP23( LOGICAL )::SCLP23_NAME( LOGICAL )( int i ) {
SDAI_LOGICAL::SDAI_LOGICAL( int i ) {
if( i == 0 ) {
v = LFalse ;
} else {
@@ -38,18 +38,18 @@ SCLP23( LOGICAL )::SCLP23_NAME( LOGICAL )( int i ) {
}
}
SCLP23( LOGICAL )::~SCLP23_NAME( LOGICAL )() {
SDAI_LOGICAL::~SDAI_LOGICAL() {
}
const char * SCLP23( LOGICAL )::Name() const {
const char * SDAI_LOGICAL::Name() const {
return "Logical";
}
int SCLP23( LOGICAL )::no_elements() const {
int SDAI_LOGICAL::no_elements() const {
return 3;
}
const char * SCLP23( LOGICAL )::element_at( int n ) const {
const char * SDAI_LOGICAL::element_at( int n ) const {
switch( n ) {
case LUnknown :
return "U";
@@ -62,15 +62,15 @@ const char * SCLP23( LOGICAL )::element_at( int n ) const {
}
}
int SCLP23( LOGICAL )::exists() const { // return 0 if unset otherwise return 1
int SDAI_LOGICAL::exists() const { // return 0 if unset otherwise return 1
return !( v == 2 );
}
void SCLP23( LOGICAL )::nullify() { // change the receiver to an unset status
void SDAI_LOGICAL::nullify() { // change the receiver to an unset status
v = 2;
}
SCLP23( LOGICAL )::operator Logical() const {
SDAI_LOGICAL::operator Logical() const {
switch( v ) {
case LFalse :
return LFalse ;
@@ -86,19 +86,19 @@ SCLP23( LOGICAL )::operator Logical() const {
SCLP23( LOGICAL ) & SCLP23( LOGICAL )::operator= ( const SCLP23( LOGICAL )& t ) {
SDAI_LOGICAL & SDAI_LOGICAL::operator= ( const SDAI_LOGICAL & t ) {
set_value( t.asInt() );
return *this;
}
SCLP23( LOGICAL ) SCLP23( LOGICAL )::operator ==( const SCLP23( LOGICAL )& t ) const {
SDAI_LOGICAL SDAI_LOGICAL::operator ==( const SDAI_LOGICAL & t ) const {
if( v == t.asInt() ) {
return LTrue ;
}
return LFalse ;
}
int SCLP23( LOGICAL )::set_value( const int i ) {
int SDAI_LOGICAL::set_value( const int i ) {
if( i > no_elements() + 1 ) {
v = 2;
return v;
@@ -114,7 +114,7 @@ int SCLP23( LOGICAL )::set_value( const int i ) {
return no_elements() + 1 ;
}
int SCLP23( LOGICAL )::set_value( const char * n ) {
int SDAI_LOGICAL::set_value( const char * n ) {
// assigns the appropriate value based on n
if( !n || ( !strcmp( n, "" ) ) ) {
nullify();
@@ -136,8 +136,8 @@ int SCLP23( LOGICAL )::set_value( const char * n ) {
}
Severity SCLP23( LOGICAL )::ReadEnum( istream & in, ErrorDescriptor * err, int AssignVal,
int needDelims ) {
Severity SDAI_LOGICAL::ReadEnum( istream & in, ErrorDescriptor * err, int AssignVal,
int needDelims ) {
if( AssignVal ) {
set_null();
}
@@ -259,30 +259,30 @@ Severity SCLP23( LOGICAL )::ReadEnum( istream & in, ErrorDescriptor * err, int A
// class BOOLEAN Jan 97
///////////////////////////////////////////////////////////////////////////////
const char * SCLP23( BOOLEAN )::Name() const {
const char * SDAI_BOOLEAN::Name() const {
return "Bool";
}
SCLP23( BOOLEAN )::SCLP23_NAME( BOOLEAN )( char * val ) {
SDAI_BOOLEAN::SDAI_BOOLEAN( char * val ) {
set_value( val );
}
SCLP23( BOOLEAN )::SCLP23_NAME( BOOLEAN )( Boolean state ) {
SDAI_BOOLEAN::SDAI_BOOLEAN( Boolean state ) {
set_value( state );
}
SCLP23( BOOLEAN )::SCLP23_NAME( BOOLEAN )( const SCLP23_NAME( BOOLEAN )& source ) {
SDAI_BOOLEAN::SDAI_BOOLEAN( const SDAI_BOOLEAN & source ) {
set_value( source.asInt() );
}
SCLP23( BOOLEAN )::~SCLP23_NAME( BOOLEAN )() {
SDAI_BOOLEAN::~SDAI_BOOLEAN() {
}
int SCLP23( BOOLEAN )::no_elements() const {
int SDAI_BOOLEAN::no_elements() const {
return 2;
}
SCLP23( BOOLEAN )::SCLP23_NAME( BOOLEAN )( int i ) {
SDAI_BOOLEAN::SDAI_BOOLEAN( int i ) {
if( i == 0 ) {
v = BFalse ;
} else {
@@ -290,7 +290,7 @@ SCLP23( BOOLEAN )::SCLP23_NAME( BOOLEAN )( int i ) {
}
}
SCLP23( BOOLEAN )::SCLP23_NAME( BOOLEAN )( const SCLP23( LOGICAL )& val ) {
SDAI_BOOLEAN::SDAI_BOOLEAN( const SDAI_LOGICAL & val ) {
if( val.asInt() == LUnknown ) {
// this should set error code sdaiVT_NVLD i.e. Invalid value type.
v = BUnset;
@@ -299,7 +299,7 @@ SCLP23( BOOLEAN )::SCLP23_NAME( BOOLEAN )( const SCLP23( LOGICAL )& val ) {
set_value( val );
}
SCLP23( BOOLEAN )::operator Boolean() const {
SDAI_BOOLEAN::operator Boolean() const {
switch( v ) {
case BFalse :
return BFalse ;
@@ -311,17 +311,17 @@ SCLP23( BOOLEAN )::operator Boolean() const {
}
}
SCLP23( BOOLEAN ) & SCLP23( BOOLEAN )::operator= ( const SCLP23( LOGICAL )& t ) {
SDAI_BOOLEAN & SDAI_BOOLEAN::operator= ( const SDAI_LOGICAL & t ) {
set_value( t.asInt() );
return *this;
}
SCLP23( BOOLEAN ) & SCLP23( BOOLEAN )::operator= ( const Boolean t ) {
SDAI_BOOLEAN & SDAI_BOOLEAN::operator= ( const Boolean t ) {
v = t;
return *this;
}
const char * SCLP23( BOOLEAN )::element_at( int n ) const {
const char * SDAI_BOOLEAN::element_at( int n ) const {
switch( n ) {
case BFalse :
return "F";
@@ -332,7 +332,7 @@ const char * SCLP23( BOOLEAN )::element_at( int n ) const {
}
}
SCLP23( LOGICAL ) SCLP23( BOOLEAN )::operator ==( const SCLP23( LOGICAL )& t ) const {
SDAI_LOGICAL SDAI_BOOLEAN::operator ==( const SDAI_LOGICAL & t ) const {
if( v == t.asInt() ) {
return LTrue ;
}
@@ -341,36 +341,36 @@ SCLP23( LOGICAL ) SCLP23( BOOLEAN )::operator ==( const SCLP23( LOGICAL )& t ) c
///////////////////////////////////////////////////////////////////////////////
SCLP23( Enum )::SCLP23_NAME( Enum )() {
SDAI_Enum::SDAI_Enum() {
v = 0;
}
SCLP23( Enum )::~SCLP23_NAME( Enum )() {
SDAI_Enum::~SDAI_Enum() {
}
/**
* \copydoc set_value( const char * n )
*/
int SCLP23( Enum )::put( int val ) {
int SDAI_Enum::put( int val ) {
return set_value( val );
}
/**
* \copydoc set_value( const char * n )
*/
int SCLP23( Enum )::put( const char * n ) {
int SDAI_Enum::put( const char * n ) {
return set_value( n );
}
/// return 0 if unset otherwise return 1
int SCLP23( Enum )::exists() const {
int SDAI_Enum::exists() const {
return !( v > no_elements() );
}
/**
* change the receiver to an unset status
* unset is generated to be 1 greater than last element
*/
void SCLP23( Enum )::nullify() {
void SDAI_Enum::nullify() {
set_value( no_elements() + 1 );
}
@@ -379,7 +379,7 @@ void SCLP23( Enum )::nullify() {
** debugging purposes
** Status: ok 2/1/91
******************************************************************/
void SCLP23( Enum )::DebugDisplay( ostream & out ) const {
void SDAI_Enum::DebugDisplay( ostream & out ) const {
std::string tmp;
out << "Current " << Name() << " value: " << endl
<< " cardinal: " << v << endl
@@ -405,15 +405,15 @@ void SCLP23( Enum )::DebugDisplay( ostream & out ) const {
** \returns Severity of the error.
** \param err error message and error Severity is written to ErrorDescriptor *err.
** \param AssignVal is:
** true => value is assigned to the SCLP23(Enum);
** true => value is assigned to the SDAI_Enum;
** true or false => value is read and appropriate error info is set and returned.
** \param int needDelims is:
** false => absence of the period delimiters is not an error;
** true => delimiters must be valid;
** true or false => non-matching delimiters are flagged as an error
*/
Severity SCLP23( Enum )::ReadEnum( istream & in, ErrorDescriptor * err, int AssignVal,
int needDelims ) {
Severity SDAI_Enum::ReadEnum( istream & in, ErrorDescriptor * err, int AssignVal,
int needDelims ) {
if( AssignVal ) {
set_null();
}
@@ -531,7 +531,7 @@ Severity SCLP23( Enum )::ReadEnum( istream & in, ErrorDescriptor * err, int Assi
return err->severity();
}
Severity SCLP23( Enum )::StrToVal( const char * s, ErrorDescriptor * err, int optional ) {
Severity SDAI_Enum::StrToVal( const char * s, ErrorDescriptor * err, int optional ) {
istringstream in( ( char * )s ); // sz defaults to length of s
ReadEnum( in, err, 1, 0 );
@@ -543,13 +543,13 @@ Severity SCLP23( Enum )::StrToVal( const char * s, ErrorDescriptor * err, int op
}
/// reads an enumerated value in STEP file format
Severity SCLP23( Enum )::STEPread( const char * s, ErrorDescriptor * err, int optional ) {
Severity SDAI_Enum::STEPread( const char * s, ErrorDescriptor * err, int optional ) {
istringstream in( ( char * )s );
return STEPread( in, err, optional );
}
/// reads an enumerated value in STEP file format
Severity SCLP23( Enum )::STEPread( istream & in, ErrorDescriptor * err, int optional ) {
Severity SDAI_Enum::STEPread( istream & in, ErrorDescriptor * err, int optional ) {
ReadEnum( in, err, 1, 1 );
if( ( err->severity() == SEVERITY_INCOMPLETE ) && optional ) {
err->severity( SEVERITY_NULL );
@@ -558,7 +558,7 @@ Severity SCLP23( Enum )::STEPread( istream & in, ErrorDescriptor * err, int opti
return err->severity();
}
const char * SCLP23( Enum )::asStr( std::string & s ) const {
const char * SDAI_Enum::asStr( std::string & s ) const {
if( exists() ) {
return const_cast<char *>( ( s = element_at( v ) ).c_str() );
} else {
@@ -566,7 +566,7 @@ const char * SCLP23( Enum )::asStr( std::string & s ) const {
}
}
void SCLP23( Enum )::STEPwrite( ostream & out ) const {
void SDAI_Enum::STEPwrite( ostream & out ) const {
if( is_null() ) {
out << '$';
} else {
@@ -575,7 +575,7 @@ void SCLP23( Enum )::STEPwrite( ostream & out ) const {
}
}
const char * SCLP23( Enum )::STEPwrite( std::string & s ) const {
const char * SDAI_Enum::STEPwrite( std::string & s ) const {
if( is_null() ) {
s.clear();
} else {
@@ -587,9 +587,9 @@ const char * SCLP23( Enum )::STEPwrite( std::string & s ) const {
return const_cast<char *>( s.c_str() );
}
Severity SCLP23( Enum )::EnumValidLevel( istream & in, ErrorDescriptor * err,
int optional, char * tokenList,
int needDelims, int clearError ) {
Severity SDAI_Enum::EnumValidLevel( istream & in, ErrorDescriptor * err,
int optional, char * tokenList,
int needDelims, int clearError ) {
if( clearError ) {
err->ClearErrorMsg();
}
@@ -624,9 +624,9 @@ Severity SCLP23( Enum )::EnumValidLevel( istream & in, ErrorDescriptor * err,
return err->severity();
}
Severity SCLP23( Enum )::EnumValidLevel( const char * value, ErrorDescriptor * err,
int optional, char * tokenList,
int needDelims, int clearError ) {
Severity SDAI_Enum::EnumValidLevel( const char * value, ErrorDescriptor * err,
int optional, char * tokenList,
int needDelims, int clearError ) {
istringstream in( ( char * )value );
return EnumValidLevel( in, err, optional, tokenList, needDelims,
clearError );
@@ -638,12 +638,12 @@ Severity SCLP23( Enum )::EnumValidLevel( const char * value, ErrorDescriptor * e
** warning is printed and processing continues
**
** set_value is the same function as put
**
**
** Parameter: value to be set
** Status: ok 2.91
** \returns: value set
******************************************************************/
int SCLP23( Enum )::set_value( const char * n ) {
int SDAI_Enum::set_value( const char * n ) {
// assigns the appropriate value based on n
// if ( !n || (!strcmp (n, "")) ) return set_value (ENUM_NULL);
if( !n || ( !strcmp( n, "" ) ) ) {
@@ -668,7 +668,7 @@ int SCLP23( Enum )::set_value( const char * n ) {
/**
* \copydoc set_value( const char * n )
*/
int SCLP23( Enum )::set_value( const int i ) {
int SDAI_Enum::set_value( const int i ) {
if( i > no_elements() ) {
v = no_elements() + 1;
return v;
@@ -685,17 +685,17 @@ int SCLP23( Enum )::set_value( const int i ) {
}
SCLP23( Enum ) & SCLP23( Enum )::operator= ( const int i ) {
SDAI_Enum & SDAI_Enum::operator= ( const int i ) {
put( i );
return *this;
}
SCLP23( Enum ) & SCLP23( Enum )::operator= ( const SCLP23( Enum )& Senum ) {
SDAI_Enum & SDAI_Enum::operator= ( const SDAI_Enum & Senum ) {
put( Senum.asInt() );
return *this;
}
ostream & operator<< ( ostream & out, const SCLP23( Enum )& a ) {
ostream & operator<< ( ostream & out, const SDAI_Enum & a ) {
std::string tmp;
out << a.asStr( tmp );
return out;
+150
View File
@@ -0,0 +1,150 @@
#ifndef P23ENUM_H
#define P23ENUM_H
/*
* NIST STEP Core Class Library
* clstepcore/Enum.h
* April 1997
* K. C. Morris
* David Sauder
* Development of this software was funded by the United States Government,
* and is not subject to copyright.
*/
#include <scl_export.h>
class SCL_DAI_EXPORT SDAI_Enum {
friend ostream & operator<< ( ostream &, const SDAI_Enum & );
protected:
int v; // integer value of enumeration instance
// mapped to a symbolic value in the elements
virtual int set_value( const char * n );
virtual int set_value( const int n );
SDAI_Enum();
virtual ~SDAI_Enum();
public:
void PrintContents( ostream & out = cout ) const {
DebugDisplay( out );
}
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( std::string & s ) const;
void STEPwrite( ostream & out = cout ) const;
const char * STEPwrite( std::string & 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 );
virtual int put( int val );
virtual int put( const char * n );
int is_null() const {
return !( exists() );
}
void set_null() {
nullify();
}
SDAI_Enum & operator= ( const int );
SDAI_Enum & operator= ( const SDAI_Enum & );
virtual int exists() const;
virtual void nullify();
void DebugDisplay( ostream & out = cout ) const;
protected:
virtual Severity ReadEnum( istream & in, ErrorDescriptor * err,
int AssignVal = 1, int needDelims = 1 );
};
class SDAI_LOGICAL;
class SDAI_BOOLEAN;
enum Boolean { BFalse, BTrue, BUnset };
enum Logical { LFalse, LTrue, LUnset, LUnknown };
class SCL_DAI_EXPORT SDAI_LOGICAL :
public SDAI_Enum {
public:
const char * Name() const;
SDAI_LOGICAL( char * val = 0 );
SDAI_LOGICAL( Logical state );
SDAI_LOGICAL( const SDAI_LOGICAL & source );
SDAI_LOGICAL( int i );
virtual ~SDAI_LOGICAL();
virtual int no_elements() const;
virtual const char * element_at( int n ) const;
operator Logical() const;
SDAI_LOGICAL & operator=( const SDAI_LOGICAL & t );
SDAI_LOGICAL operator==( const SDAI_LOGICAL & t ) const;
// these 2 are redefined because LUnknown has cardinal value > LUnset
int exists() const; // return 0 if unset otherwise return 1
void nullify(); // change the receiver to an unset status
protected:
virtual int set_value( const int n );
virtual int set_value( const char * n );
virtual Severity ReadEnum( istream & in, ErrorDescriptor * err,
int AssignVal = 1, int needDelims = 1 );
};
class SCL_DAI_EXPORT SDAI_BOOLEAN :
public SDAI_Enum {
public:
const char * Name() const;
SDAI_BOOLEAN( char * val = 0 );
SDAI_BOOLEAN( ::Boolean state );
SDAI_BOOLEAN( const SDAI_BOOLEAN & source );
SDAI_BOOLEAN( int i );
SDAI_BOOLEAN( const SDAI_LOGICAL & val );
virtual ~SDAI_BOOLEAN();
virtual int no_elements() const;
virtual const char * element_at( int n ) const;
operator ::Boolean() const;
SDAI_BOOLEAN & operator=( const SDAI_LOGICAL & t );
SDAI_BOOLEAN & operator=( const ::Boolean t );
SDAI_LOGICAL operator==( const SDAI_LOGICAL & t ) const;
};
static const SDAI_BOOLEAN SDAI_TRUE;
static const SDAI_BOOLEAN SDAI_FALSE;
static const SDAI_BOOLEAN SDAI_UNSET;
static const SDAI_LOGICAL SDAI_UNKNOWN;
#endif
+36 -36
View File
@@ -1,90 +1,90 @@
#include <sdai.h>
///////// SCLP23(Model_contents_instances)
///////// SDAI_Model_contents_instances
SCLP23( Model_contents_instances )::SCLP23_NAME( Model_contents_instances )( ) {
SDAI_Model_contents_instances::SDAI_Model_contents_instances( ) {
}
/*
SCLP23(Model_contents_instances)::SCLP23_NAME(Model_contents_instances) (const SCLP23(Model_contents_instances)& e )
SDAI_Model_contents_instances::SDAI_Model_contents_instances (const SDAI_Model_contents_instances& e )
{
}
*/
SCLP23( Model_contents_instances )::~SCLP23_NAME( Model_contents_instances )() {
SDAI_Model_contents_instances::~SDAI_Model_contents_instances() {
}
///////// SCLP23(Model_contents)
///////// SDAI_Model_contents
SCLP23( Model_contents )::SCLP23_NAME( Model_contents )( ) {
SDAI_Model_contents::SDAI_Model_contents( ) {
}
/*
SCLP23(Model_contents)::SCLP23_NAME(Model_contents) (const SCLP23(Model_contents)& e )
SDAI_Model_contents::SDAI_Model_contents (const SDAI_Model_contents& e )
{
// CopyAs((STEPentityH) &e);
}
*/
SCLP23( Model_contents )::~SCLP23_NAME( Model_contents )() {
SDAI_Model_contents::~SDAI_Model_contents() {
}
// const Entity_instance__set_var instances() const;
//const SDAIAGGRH(Set, EntityInstanceH) Instances() const;
SCLP23( Model_contents_instances_ptr )
SCLP23( Model_contents )::instances_() {
SDAI_Model_contents_instances_ptr
SDAI_Model_contents::instances_() {
return &_instances;
}
const SCLP23( Model_contents_instances_ptr )
SCLP23( Model_contents )::instances_() const {
return ( const SCLP23( Model_contents_instances_ptr ) ) &_instances;
const SDAI_Model_contents_instances_ptr
SDAI_Model_contents::instances_() const {
return ( const SDAI_Model_contents_instances_ptr ) &_instances;
}
SCLP23( Entity_extent__set_var )
SCLP23( Model_contents )::folders_() {
SDAI_Entity_extent__set_var
SDAI_Model_contents::folders_() {
return &_folders;
}
const SCLP23( Entity_extent__set_var )
SCLP23( Model_contents )::folders_() const {
return ( const SCLP23( Entity_extent__set_var ) )&_folders;
const SDAI_Entity_extent__set_var
SDAI_Model_contents::folders_() const {
return ( const SDAI_Entity_extent__set_var )&_folders;
}
SCLP23( Entity_extent__set_var )
SCLP23( Model_contents )::populated_folders_() {
SDAI_Entity_extent__set_var
SDAI_Model_contents::populated_folders_() {
return &_populated_folders;
}
const SCLP23( Entity_extent__set_var )
SCLP23( Model_contents )::populated_folders_() const {
return ( const SCLP23( Entity_extent__set_var ) )&_populated_folders;
const SDAI_Entity_extent__set_var
SDAI_Model_contents::populated_folders_() const {
return ( const SDAI_Entity_extent__set_var )&_populated_folders;
}
SCLP23( PID_DA_ptr )
SCLP23( Model_contents )::get_object_pid( const SCLP23( DAObject_ptr & d ) )
SDAI_PID_DA_ptr
SDAI_Model_contents::get_object_pid( const SDAI_DAObject_ptr & d )
const {
return 0;
}
SCLP23( DAObject_ptr )
SCLP23( Model_contents )::lookup( const SCLP23( PID_DA_ptr & p ) ) const {
SDAI_DAObject_ptr
SDAI_Model_contents::lookup( const SDAI_PID_DA_ptr & p ) const {
return 0;
}
SCLP23( DAObject_ptr )
SCLP23( Model_contents )::CreateEntityInstance( const char * Type ) {
SDAI_DAObject_ptr
SDAI_Model_contents::CreateEntityInstance( const char * Type ) {
return 0;
}
void
SCLP23( Model_contents )::AddInstance( const SCLP23( DAObject_SDAI_ptr )& appInst ) {
SDAI_Model_contents::AddInstance( const SDAI_DAObject_SDAI_ptr & appInst ) {
_instances.contents_()->Append( appInst );
}
void
SCLP23( Model_contents )::RemoveInstance( SCLP23( DAObject_SDAI_ptr )& appInst ) {
SDAI_Model_contents::RemoveInstance( SDAI_DAObject_SDAI_ptr & appInst ) {
_instances.contents_()->Remove( _instances.contents_()->Index( appInst ) );
}
@@ -93,19 +93,19 @@ SCLP23( Model_contents )::RemoveInstance( SCLP23( DAObject_SDAI_ptr )& appInst )
#if 0 // for now
Any_var
SCLP23( Model_contents )::GetEntity_extent( const std::string & entityName ) {
SDAI_Model_contents::GetEntity_extent( const std::string & entityName ) {
}
const Any_var
SCLP23( Model_contents )::GetEntity_extent( const std::string & entityName ) const {
SDAI_Model_contents::GetEntity_extent( const std::string & entityName ) const {
}
Any_var
SCLP23( Model_contents )::GetEntity_extent( const Entity_ptr & ep ) {
SDAI_Model_contents::GetEntity_extent( const Entity_ptr & ep ) {
}
const Any_var
SCLP23( Model_contents )::GetEntity_extent( const Entity_ptr & ep ) const {
SDAI_Model_contents::GetEntity_extent( const Entity_ptr & ep ) const {
}
#endif
@@ -134,4 +134,4 @@ SCLP23( Model_contents )::GetEntity_extent( const Entity_ptr & ep ) const {
*/
#endif
//////// END SCLP23(Model_contents)
//////// END SDAI_Model_contents
+144 -141
View File
@@ -1,10 +1,11 @@
#ifndef SDAIMODEL_CONTENTS_H
#define SDAIMODEL_CONTENTS_H 1
//SCLP23_NAME(Model_contents)
#include <scl_export.h>
//SDAI_Model_contents
/*
7.3.2 SCLP23_NAME(Model_contents)
7.3.2 SDAI_Model_contents
*/
/*
@@ -22,193 +23,195 @@
//#include <SessionInstance.h>
*/
// The class SCLP23_NAME(Model_contents)_instances shall implement convenience functions by
// SCLP23_NAME(Model_contents) in this part of ISO 10303
// The class SDAI_Model_contents_instances shall implement convenience functions by
// SDAI_Model_contents in this part of ISO 10303
class SCLP23_NAME(Model_contents_instances) : public SCLP23_NAME(DAObject)
{
public:
class SCL_DAI_EXPORT SDAI_Model_contents_instances : public SDAI_DAObject {
public:
SCLP23_NAME(DAObject__set) _instances;
SDAI_DAObject__set _instances;
SCLP23_NAME(Model_contents_instances)();
virtual ~SCLP23_NAME(Model_contents_instances)();
SDAI_Model_contents_instances();
virtual ~SDAI_Model_contents_instances();
// This function shall return the set of DAObjects contained in
// the receiver.
SCLP23_NAME(DAObject__set_var) contents_() { return &_instances; }
const SCLP23_NAME(DAObject__set_var) contents_() const
{ return (const SCLP23_NAME(DAObject__set_var)) &_instances; };
// This function shall return the set of DAObjects contained in
// the receiver.
SDAI_DAObject__set_var contents_() {
return &_instances;
}
const SDAI_DAObject__set_var contents_() const {
return ( const SDAI_DAObject__set_var ) &_instances;
};
};
typedef SCLP23_NAME(Model_contents_instances) *
SCLP23_NAME(Model_contents_instances_ptr);
typedef SCLP23_NAME(Model_contents_instances_ptr)
SCLP23_NAME(Model_contents_instances_var);
typedef SDAI_Model_contents_instances *
SDAI_Model_contents_instances_ptr;
typedef SDAI_Model_contents_instances_ptr
SDAI_Model_contents_instances_var;
// Model_contents_ptr def pushed ahead of #include for Entity_extent
//class SCLP23_NAME(Model_contents);
//typedef SCLP23_NAME(Model_contents) SCLP23_NAME(Model_contents_ptr);
//class SDAI_Model_contents;
//typedef SDAI_Model_contents SDAI_Model_contents_ptr;
class SCLP23_NAME(Model_contents) : public SCLP23_NAME(Session_instance) {
class SCL_DAI_EXPORT SDAI_Model_contents : public SDAI_Session_instance {
//friend class SCLP23_NAME(Model);
//friend class SDAI_Model;
/*
NOTE - Model is a friend so that Model may access the contents of
the Entity_extents folders.
/*
NOTE - Model is a friend so that Model may access the contents of
the Entity_extents folders.
DATA MEMBERS
*/
public:
DATA MEMBERS
*/
public:
// protected: // for now
// contains Application_instances (i.e. STEPentities)
SCLP23_NAME(Model_contents_instances) _instances;
SDAI_Model_contents_instances _instances;
SCLP23_NAME(Entity_extent__set) _folders; // of entity_extent
SDAI_Entity_extent__set _folders; // of entity_extent
SCLP23_NAME(Entity_extent__set) _populated_folders; // of entity_extent
SDAI_Entity_extent__set _populated_folders; // of entity_extent
// EntityAggregate _instances; // of Entity_instance
// EntityAggregate _instances; // of Entity_instance
// EntityAggregate _folders; // of entity_extent
// EntityAggregate _populated_folders; // of entity_extent
/*
Constructor declarations
*/
public: // for now at least
/*
Constructor declarations
*/
public: // for now at least
// private:
SCLP23_NAME(Model_contents)();
// SCLP23_NAME(Model_contents)(const SCLP23_NAME(Model_contents)& mc);
~SCLP23_NAME(Model_contents)();
/*
Access function declarations
*/
public:
SCLP23_NAME(Model_contents_instances_ptr) instances_();
const SCLP23_NAME(Model_contents_instances_ptr) instances_() const;
SDAI_Model_contents();
// SDAI_Model_contents(const SDAI_Model_contents& mc);
~SDAI_Model_contents();
/*
Access function declarations
*/
public:
SDAI_Model_contents_instances_ptr instances_();
const SDAI_Model_contents_instances_ptr instances_() const;
SCLP23_NAME(Entity_extent__set_var) folders_();
const SCLP23_NAME(Entity_extent__set_var) folders_() const;
SDAI_Entity_extent__set_var folders_();
const SDAI_Entity_extent__set_var folders_() const;
//Boolean TestFolders() const;
//Boolean TestFolders() const;
const SCLP23_NAME(Entity_extent__set_var) populated_folders_() const;
SCLP23_NAME(Entity_extent__set_var) populated_folders_();
//Boolean TestPopulated_folders() const;
const SDAI_Entity_extent__set_var populated_folders_() const;
SDAI_Entity_extent__set_var populated_folders_();
//Boolean TestPopulated_folders() const;
// static SCLP23_NAME(Model_contents_ptr)
// _duplicate(SCLP23_NAME(Model_contents_ptr));
// static SCLP23_NAME(Model_contents_ptr) _narrow(Object_ptr);
// static SCLP23_NAME(Model_contents_ptr) _nil();
// static SDAI_Model_contents_ptr
// _duplicate(SDAI_Model_contents_ptr);
// static SDAI_Model_contents_ptr _narrow(Object_ptr);
// static SDAI_Model_contents_ptr _nil();
SCLP23_NAME(PID_DA_ptr)
get_object_pid(const SCLP23_NAME(DAObject_ptr &d)) const;
SDAI_PID_DA_ptr
get_object_pid( const SDAI_DAObject_ptr & d ) const;
SCLP23_NAME(DAObject_ptr) lookup(const SCLP23_NAME(PID_DA_ptr &p)) const;
SDAI_DAObject_ptr lookup( const SDAI_PID_DA_ptr & p ) const;
/*
SDAI operation declarations
/*
SDAI operation declarations
7.3.2.1 SDAI operation declarations
7.3.2.1 SDAI operation declarations
7.3.2.1.1 Add instance
*/
7.3.2.1.1 Add instance
*/
// private:
public: // for now at least
SCLP23_NAME(DAObject_ptr)
CreateEntityInstance(const char * Type);
public: // for now at least
SDAI_DAObject_ptr
CreateEntityInstance( const char * Type );
// until we find out what this should really be in the spec
void AddInstance(const SCLP23_NAME(DAObject_SDAI_ptr)& appInst);
// until we find out what this should really be in the spec
void AddInstance( const SDAI_DAObject_SDAI_ptr & appInst );
// void AddInstance(const Entity_instance_ptr& entityHandle);
//void AddInstance(EntityInstanceH& entityHandle);
/* Function:
The AddInstance function shall add the entity instance entity handle
to the instances set of the receiver. This function shall add the
entity instance entityHandle to each Entity_extent in the folders
attribute of the receiver for which the type or a subtype of the
type contained in the folder corresponds to the type of entityHandle.
This function shall add the entity instance entityHandle to each
Entity_extent in the populated_folders attribute of the receiver for
which the type or a subtype of the type contained in the folder
corresponds to the type of entityHandle.
//void AddInstance(EntityInstanceH& entityHandle);
/* Function:
The AddInstance function shall add the entity instance entity handle
to the instances set of the receiver. This function shall add the
entity instance entityHandle to each Entity_extent in the folders
attribute of the receiver for which the type or a subtype of the
type contained in the folder corresponds to the type of entityHandle.
This function shall add the entity instance entityHandle to each
Entity_extent in the populated_folders attribute of the receiver for
which the type or a subtype of the type contained in the folder
corresponds to the type of entityHandle.
Possible error indicators:
sdaiSS_NOPN // Session not open
sdaiRP_NOPN // Repository not open
sdaiMO_NEXS // SDAI-model does not exist
sdaiMX_NRW // SDAI-model access not read-write
sdaiSY_ERR // Underlying system error
Possible error indicators:
sdaiSS_NOPN // Session not open
sdaiRP_NOPN // Repository not open
sdaiMO_NEXS // SDAI-model does not exist
sdaiMX_NRW // SDAI-model access not read-write
sdaiSY_ERR // Underlying system error
Origin: Convenience function
*/
Origin: Convenience function
*/
// until we find out what this should really be in the spec
void RemoveInstance(SCLP23_NAME(DAObject_SDAI_ptr)& appInst);
// void RemoveInstance(Entity_instance_ptr& entityHandle);
//void RemoveInstance(EntityInstanceH& entityHandle);
/* Function
The RemoveInstance function shall remove the entity instance entity
handle from the instances set of the receiver. This function shall
remove the entity instance entityHandle from each Entity_extent in
the folders attribute of the receiver for which the type or a
subtype of the type contained in the folder corresponds to the
type of entityHandle. This function shall remove the entity
instance entityHandle from each Entity_extent in the
populated_folders attribute of the receiver for which the type or
a subtype of the type contained in the folder corresponds to the
type of entityHandle.
// until we find out what this should really be in the spec
void RemoveInstance( SDAI_DAObject_SDAI_ptr & appInst );
// void RemoveInstance(Entity_instance_ptr& entityHandle);
//void RemoveInstance(EntityInstanceH& entityHandle);
/* Function
The RemoveInstance function shall remove the entity instance entity
handle from the instances set of the receiver. This function shall
remove the entity instance entityHandle from each Entity_extent in
the folders attribute of the receiver for which the type or a
subtype of the type contained in the folder corresponds to the
type of entityHandle. This function shall remove the entity
instance entityHandle from each Entity_extent in the
populated_folders attribute of the receiver for which the type or
a subtype of the type contained in the folder corresponds to the
type of entityHandle.
Possible error indicators
sdaiSS_NOPN // Session not open
sdaiRP_NOPN // Repository not open
sdaiMO_NEXS // SDAI-model does not exist
sdaiMX_NRW // SDAI-model access not read-write
sdaiSY_ERR // Underlying system error
Possible error indicators
sdaiSS_NOPN // Session not open
sdaiRP_NOPN // Repository not open
sdaiMO_NEXS // SDAI-model does not exist
sdaiMX_NRW // SDAI-model access not read-write
sdaiSY_ERR // Underlying system error
Origin: Convenience function
*/
public:
/*
7.3.2.1.3 Get entity extent
*/
Origin: Convenience function
*/
public:
/*
7.3.2.1.3 Get entity extent
*/
#ifdef SDAI_CPP_LATE_BINDING
#if 0 // for now
Any_var GetEntity_extent(const std::string& entityName);
const Any_var GetEntity_extent(const std::string& entityName) const;
Any_var GetEntity_extent(const Entity_ptr& ep);
const Any_var GetEntity_extent(const Entity_ptr& ep) const;
Any_var GetEntity_extent( const std::string & entityName );
const Any_var GetEntity_extent( const std::string & entityName ) const;
Any_var GetEntity_extent( const Entity_ptr & ep );
const Any_var GetEntity_extent( const Entity_ptr & ep ) const;
#endif
/* Function:
The GetEntity_extent function shall retrieve an entity folder from
the folders attribute within the contents attribute of the receiver.
This folder shall contain all of the instances of a particular type
and its subtypes within the model. The type may be specified
indirectly by the entityName parameter or directly by the entity.
Subsequent access to the returned aggregate shall be restricted to
read-only functionality.
/* Function:
The GetEntity_extent function shall retrieve an entity folder from
the folders attribute within the contents attribute of the receiver.
This folder shall contain all of the instances of a particular type
and its subtypes within the model. The type may be specified
indirectly by the entityName parameter or directly by the entity.
Subsequent access to the returned aggregate shall be restricted to
read-only functionality.
Output:
This function shall return an aggregate handle used as an argument
for subsequent SDAI function calls. Otherwise, this function shall
return a null handle.
Output:
This function shall return an aggregate handle used as an argument
for subsequent SDAI function calls. Otherwise, this function shall
return a null handle.
Possible error indicators:
sdaiSS_NOPN // Session not open
sdaiRP_NOPN // Repository not open
sdaiMO_NEXS // SDAI-model does not exist
sdaiED_NDEF // Entity definition unknown in this model
sdaiSY_ERR // Underlying system error
Possible error indicators:
sdaiSS_NOPN // Session not open
sdaiRP_NOPN // Repository not open
sdaiMO_NEXS // SDAI-model does not exist
sdaiED_NDEF // Entity definition unknown in this model
sdaiSY_ERR // Underlying system error
Origin: Convenience function
*/
Origin: Convenience function
*/
#endif
// void instances (SCLP23_NAME(Model_contents_instances_ptr) x);
// void instances (SDAI_Model_contents_instances_ptr x);
// void folders (Entity_extent__set x);
// void populated_folders (Entity_extent__set x);
+24 -24
View File
@@ -35,39 +35,39 @@ extern "C"
/*****************************************************************************/
SCLP23( Model_contents__list )::SCLP23_NAME( Model_contents__list )( int defaultSize ) {
SDAI_Model_contents__list::SDAI_Model_contents__list( int defaultSize ) {
_bufsize = defaultSize;
_buf = new SCLP23( Model_contents_ptr )[_bufsize];
_buf = new SDAI_Model_contents_ptr[_bufsize];
_count = 0;
}
SCLP23( Model_contents__list )::~SCLP23_NAME( Model_contents__list )() {
SDAI_Model_contents__list::~SDAI_Model_contents__list() {
delete _buf;
}
void SCLP23( Model_contents__list )::Check( int index ) {
void SDAI_Model_contents__list::Check( int index ) {
SCLP23( Model_contents_ptr )* newbuf;
SDAI_Model_contents_ptr * newbuf;
if( index >= _bufsize ) {
_bufsize = ( index + 1 ) * 2;
newbuf = new SCLP23( Model_contents_ptr )[_bufsize];
memmove( newbuf, _buf, _count * sizeof( SCLP23( Model_contents_ptr ) ) );
newbuf = new SDAI_Model_contents_ptr[_bufsize];
memmove( newbuf, _buf, _count * sizeof( SDAI_Model_contents_ptr ) );
delete _buf;
_buf = newbuf;
}
}
void
SCLP23( Model_contents__list )::Insert( SCLP23( Model_contents_ptr ) v, int index ) {
SDAI_Model_contents__list::Insert( SDAI_Model_contents_ptr v, int index ) {
SCLP23( Model_contents_ptr )* spot;
SDAI_Model_contents_ptr * spot;
index = ( index < 0 ) ? _count : index;
if( index < _count ) {
Check( _count + 1 );
spot = &_buf[index];
memmove( spot + 1, spot, ( _count - index )*sizeof( SCLP23( Model_contents_ptr ) ) );
memmove( spot + 1, spot, ( _count - index )*sizeof( SDAI_Model_contents_ptr ) );
} else {
Check( index );
@@ -77,15 +77,15 @@ SCLP23( Model_contents__list )::Insert( SCLP23( Model_contents_ptr ) v, int inde
++_count;
}
void SCLP23( Model_contents__list )::Append( SCLP23( Model_contents_ptr ) v ) {
void SDAI_Model_contents__list::Append( SDAI_Model_contents_ptr v ) {
int index = _count;
SCLP23( Model_contents_ptr )* spot;
SDAI_Model_contents_ptr * spot;
if( index < _count ) {
Check( _count + 1 );
spot = &_buf[index];
memmove( spot + 1, spot, ( _count - index )*sizeof( SCLP23( Model_contents_ptr ) ) );
memmove( spot + 1, spot, ( _count - index )*sizeof( SDAI_Model_contents_ptr ) );
} else {
Check( index );
@@ -95,16 +95,16 @@ void SCLP23( Model_contents__list )::Append( SCLP23( Model_contents_ptr ) v ) {
++_count;
}
void SCLP23( Model_contents__list )::Remove( int index ) {
void SDAI_Model_contents__list::Remove( int index ) {
if( 0 <= index && index < _count ) {
--_count;
SCLP23( Model_contents_ptr )* spot = &_buf[index];
memmove( spot, spot + 1, ( _count - index )*sizeof( SCLP23( Model_contents_ptr ) ) );
SDAI_Model_contents_ptr * spot = &_buf[index];
memmove( spot, spot + 1, ( _count - index )*sizeof( SDAI_Model_contents_ptr ) );
}
}
int SCLP23( Model_contents__list )::Index( SCLP23( Model_contents_ptr ) v ) {
int SDAI_Model_contents__list::Index( SDAI_Model_contents_ptr v ) {
for( int i = 0; i < _count; ++i ) {
if( _buf[i] == v ) {
@@ -114,13 +114,13 @@ int SCLP23( Model_contents__list )::Index( SCLP23( Model_contents_ptr ) v ) {
return -1;
}
SCLP23( Model_contents_ptr )
SCLP23( Model_contents__list )::retrieve( int index ) {
SDAI_Model_contents_ptr
SDAI_Model_contents__list::retrieve( int index ) {
return operator[]( index );
}
SCLP23( Model_contents_ptr ) &
SCLP23( Model_contents__list )::operator[]( int index ) {
SDAI_Model_contents_ptr &
SDAI_Model_contents__list::operator[]( int index ) {
Check( index );
// _count = max(_count, index+1);
@@ -129,17 +129,17 @@ SCLP23( Model_contents__list )::operator[]( int index ) {
}
int
SCLP23( Model_contents__list )::Count() {
SDAI_Model_contents__list::Count() {
return _count;
}
int
SCLP23( Model_contents__list )::is_empty() {
SDAI_Model_contents__list::is_empty() {
return _count;
}
void
SCLP23( Model_contents__list )::Clear() {
SDAI_Model_contents__list::Clear() {
_count = 0;
}
+25 -23
View File
@@ -1,35 +1,37 @@
#ifndef SDAIMODEL_CONTENTS_LIST_H
#define SDAIMODEL_CONTENTS_LIST_H 1
class SCLP23_NAME(Model_contents__list) {
public:
SCLP23_NAME(Model_contents__list)(int = 16);
~SCLP23_NAME(Model_contents__list)();
#include <scl_export.h>
SCLP23_NAME(Model_contents_ptr) retrieve(int index);
int is_empty();
class SCL_DAI_EXPORT SDAI_Model_contents__list {
public:
SDAI_Model_contents__list( int = 16 );
~SDAI_Model_contents__list();
SCLP23_NAME(Model_contents_ptr)& operator[](int index);
SDAI_Model_contents_ptr retrieve( int index );
int is_empty();
void Insert(SCLP23_NAME(Model_contents_ptr), int index);
void Append(SCLP23_NAME(Model_contents_ptr));
void Remove(int index);
int Index(SCLP23_NAME(Model_contents_ptr));
SDAI_Model_contents_ptr & operator[]( int index );
void Clear();
int Count();
void Insert( SDAI_Model_contents_ptr, int index );
void Append( SDAI_Model_contents_ptr );
void Remove( int index );
int Index( SDAI_Model_contents_ptr );
private:
void Check(int index);
private:
SCLP23_NAME(Model_contents_ptr)* _buf;
int _bufsize;
int _count;
void Clear();
int Count();
private:
void Check( int index );
private:
SDAI_Model_contents_ptr * _buf;
int _bufsize;
int _count;
};
typedef SCLP23_NAME(Model_contents__list)*
SCLP23_NAME(Model_contents__list_ptr);
typedef SCLP23_NAME(Model_contents__list_ptr)
SCLP23_NAME(Model_contents__list_var);
typedef SDAI_Model_contents__list *
SDAI_Model_contents__list_ptr;
typedef SDAI_Model_contents__list_ptr
SDAI_Model_contents__list_var;
#endif
+2 -12
View File
@@ -1,17 +1,7 @@
#include <sdai.h>
SCLP23( sdaiObject )::SCLP23_NAME( sdaiObject )() {
SDAI_sdaiObject::SDAI_sdaiObject() {
}
SCLP23( sdaiObject )::~SCLP23_NAME( sdaiObject )() {
SDAI_sdaiObject::~SDAI_sdaiObject() {
}
#ifdef PART26
//SCLP26(Application_instance_ptr)
IDL_Application_instance_ptr
SCLP23( sdaiObject )::create_TIE() {
cout << "ERROR sdaiObject::create_TIE() called." << endl;
return 0;
}
#endif
+20 -24
View File
@@ -2,38 +2,34 @@
#ifndef SDAIOBJECT_H
#define SDAIOBJECT_H 1
#include <scl_export.h>
/*
#include <sclprefixes.h>
*/
/*
The EXPRESS ENTITY entity_instance from the SDAI_data_type_schema from
The EXPRESS ENTITY entity_instance from the SDAI_data_type_schema from
clause 10 in ISO 10303-22, shall be mapped to the C++ class Entity_instance.
The class Entity_instance shall be a subtype of the C++ class Object:
*/
class SCLP23_NAME(sdaiObject)
{
public:
SCLP23_NAME(sdaiObject)();
virtual ~SCLP23_NAME(sdaiObject)();
class SCL_DAI_EXPORT SDAI_sdaiObject {
public:
SDAI_sdaiObject();
virtual ~SDAI_sdaiObject();
// static Object_ptr _duplicate(Object_ptr);
// static Object_ptr _nil();
#ifdef PART26
// virtual SCLP26(Application_instance_ptr) create_TIE();
virtual IDL_Application_instance_ptr create_TIE();
#endif
};
typedef SCLP23_NAME(sdaiObject)* SCLP23_NAME(sdaiObject_ptr);
typedef SCLP23_NAME(sdaiObject_ptr) SCLP23_NAME(sdaiObject_var);
typedef SDAI_sdaiObject * SDAI_sdaiObject_ptr;
typedef SDAI_sdaiObject_ptr SDAI_sdaiObject_var;
/*
The class Object shall be accessed through the handle types Object_ptr and
Object_var. For handles to the C++ class representing a EXPRESS ENTITY data
type A, the following implicit widening operations shall be supported:
A_ptr to Object_ptr and A_var to Object_ptr. An implementation need not
The class Object shall be accessed through the handle types Object_ptr and
Object_var. For handles to the C++ class representing a EXPRESS ENTITY data
type A, the following implicit widening operations shall be supported:
A_ptr to Object_ptr and A_var to Object_ptr. An implementation need not
support implicit widening of A_var to Object_var.
This binding shall support the following functions:
@@ -42,20 +38,20 @@ typedef SCLP23_NAME(sdaiObject_ptr) SCLP23_NAME(sdaiObject_var);
//void release(Object_ptr obj);
/*
The release function indicates that the caller will no longer access the
The release function indicates that the caller will no longer access the
reference obj.
*/
//Boolean is_nil(Object_ptr obj);
/*
The is_nil function shall return true if obj is a nil handle; otherwise it
The is_nil function shall return true if obj is a nil handle; otherwise it
returns false.
This binding does not specify that all base classes in the application
schema be virtual base classes; however, it does require that no multiply
inherited derived class contain multiple instantiations of any of its base
classes. This requirement applies to all classes, even classes used to
This binding does not specify that all base classes in the application
schema be virtual base classes; however, it does require that no multiply
inherited derived class contain multiple instantiations of any of its base
classes. This requirement applies to all classes, even classes used to
instantiate complex instances.
*/
+2 -2
View File
@@ -1,7 +1,7 @@
#include <sdai.h>
SCLP23( Session_instance )::SCLP23_NAME( Session_instance )() {
SDAI_Session_instance::SDAI_Session_instance() {
}
SCLP23( Session_instance )::~SCLP23_NAME( Session_instance )() {
SDAI_Session_instance::~SDAI_Session_instance() {
}
+16 -16
View File
@@ -2,31 +2,31 @@
#ifndef SESSION_INSTANCE_H
#define SESSION_INSTANCE_H 1
#include <scl_export.h>
//#include <sdai.h>
class SCLP23_NAME(Session_instance) : public SCLP23_NAME(sdaiObject)
{
class SCL_DAI_EXPORT SDAI_Session_instance : public SDAI_sdaiObject {
public:
int x;
public:
int x;
SCLP23_NAME(Session_instance)();
virtual ~SCLP23_NAME(Session_instance)();
// SCLP23_NAME(Session_instance)(const SCLP23_NAME(Session_instance)& si) {}
SDAI_Session_instance();
virtual ~SDAI_Session_instance();
// SDAI_Session_instance(const SDAI_Session_instance& si) {}
// static SCLP23_NAME(Session_instance_ptr)
// _duplicate(SCLP23_NAME(Session_instance_ptr) sip);
// static SCLP23_NAME(Session_instance_ptr)
// _narrow(SCLP23_NAME(Object_ptr) o);
// static SCLP23_NAME(Session_instance_ptr) _nil();
// static SDAI_Session_instance_ptr
// _duplicate(SDAI_Session_instance_ptr sip);
// static SDAI_Session_instance_ptr
// _narrow(SDAI_Object_ptr o);
// static SDAI_Session_instance_ptr _nil();
};
typedef SCLP23_NAME(Session_instance)* SCLP23_NAME(Session_instance_ptr);
typedef SCLP23_NAME(Session_instance_ptr) SCLP23_NAME(Session_instance_var);
typedef SDAI_Session_instance * SDAI_Session_instance_ptr;
typedef SDAI_Session_instance_ptr SDAI_Session_instance_var;
// the old names
//typedef SCLP23_NAME(Session_instance) SCLP23_NAME(SessionInstance);
//typedef SCLP23_NAME(Session_instance_ptr) SCLP23_NAME(SessionInstanceH);
//typedef SDAI_Session_instance SDAI_SessionInstance;
//typedef SDAI_Session_instance_ptr SDAI_SessionInstanceH;
#endif
+107
View File
@@ -0,0 +1,107 @@
/*
* NIST STEP Core Class Library
* clstepcore/sdaiString.cc
* April 1997
* KC Morris
* Development of this software was funded by the United States Government,
* and is not subject to copyright.
*/
#include <sdai.h>
#include <sstream>
SDAI_String::SDAI_String( const char * str, int max ) {
content = std::string( str, max );
}
SDAI_String::SDAI_String( const std::string & s ) {
content = std::string( s );
}
SDAI_String::SDAI_String( const SDAI_String & s ) {
content = std::string( s.c_str() );
}
SDAI_String::~SDAI_String( void ) {
}
SDAI_String & SDAI_String::operator= ( const char * s ) {
content = std::string( s );
return *this;
}
bool SDAI_String::operator== ( const char * s ) const {
return ( content == s );
}
void SDAI_String::clear( void ) {
content.clear();
}
bool SDAI_String::empty( void ) const {
return content.empty();
}
const char * SDAI_String::c_str( void ) const {
return content.c_str();
}
void SDAI_String::STEPwrite( ostream & out ) const {
out << c_str();
}
void SDAI_String::STEPwrite( std::string & s ) const {
s += c_str();
}
Severity SDAI_String::StrToVal( const char * s ) {
operator= ( s );
if( ! strcmp( c_str(), s ) ) {
return SEVERITY_NULL ;
} else {
return SEVERITY_INPUT_ERROR;
}
}
/**
* STEPread reads a string in exchange file format
* starting with a single quote
*/
Severity SDAI_String::STEPread( istream & in, ErrorDescriptor * err ) {
clear(); // clear the old string
// remember the current format state to restore the previous settings
ios_base::fmtflags flags = in.flags();
in.unsetf( ios::skipws );
// extract the string from the inputstream
string s = ToExpressStr( in, err );
content += s;
// retrieve current severity
Severity sev = err -> severity();
// Not missing closing quote on string value
if( sev != SEVERITY_INPUT_ERROR && s.compare( "" ) != 0 ) {
sev = SEVERITY_NULL;
}
// There was no quote
if( !( sev == SEVERITY_INPUT_ERROR || sev == SEVERITY_NULL ) ) {
in.flags( flags ); // set the format state back to previous settings
clear();
err -> GreaterSeverity( SEVERITY_INCOMPLETE );
sev = SEVERITY_INCOMPLETE;
}
return sev;
}
/**
* \copydoc STEPread( istream & in, ErrorDescriptor * err )
*/
Severity SDAI_String::STEPread( const char * s, ErrorDescriptor * err ) {
istringstream in( ( char * )s );
return STEPread( in, err );
}
+46
View File
@@ -0,0 +1,46 @@
#ifndef STEPSTRING_H
#define STEPSTRING_H 1
/*
* NIST STEP Core Class Library
* clstepcore/sdaiString.h
* April 1997
* KC Morris
* Development of this software was funded by the United States Government,
* and is not subject to copyright.
*/
#include <scl_export.h>
class SCL_DAI_EXPORT SDAI_String {
private:
std::string content;
public:
//constructor(s) & destructor
SDAI_String( const char * str = 0, int max = 0 );
SDAI_String( const std::string & s );
SDAI_String( const SDAI_String & s );
~SDAI_String( void );
// operators
SDAI_String & operator= ( const char * s );
bool operator== ( const char * s ) const;
void clear( void );
bool empty( void ) const;
const char * c_str( void ) const;
// format for STEP
const char * asStr( std::string & s ) const {
return s.c_str();
}
void STEPwrite( ostream & out = cout ) const;
void STEPwrite( std::string & s ) const;
Severity StrToVal( const char * s );
Severity STEPread( istream & in, ErrorDescriptor * err );
Severity STEPread( const char * s, ErrorDescriptor * err );
};
#endif
+11 -4
View File
@@ -40,8 +40,15 @@ include_directories(
${SCL_SOURCE_DIR}/src/clutils
)
add_definitions(
-DHAVE_CONFIG_H
)
if(MSVC OR BORLAND)
add_definitions( -DSCL_EDITOR_DLL_EXPORTS )
add_definitions( -DSCL_CORE_DLL_IMPORTS )
add_definitions( -DSCL_DAI_DLL_IMPORTS )
add_definitions( -DSCL_UTILS_DLL_IMPORTS )
endif()
SCL_ADDLIB(stepeditor "${LIBSTEPEDITOR_SRCS}" stepcore)
SCL_ADDLIB(stepeditor "${LIBSTEPEDITOR_SRCS}" stepcore stepdai steputils)
if(APPLE)
set_target_properties(stepeditor PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
endif(APPLE)
+101 -118
View File
@@ -75,8 +75,12 @@ STEPfile::ReadHeader( istream & in ) {
std::string cmtStr;
InstMgr * im = new InstMgr;
SCLP23( Application_instance )* obj;
SDAI_Application_instance * obj;
#if defined(__MSVC__) || defined(__BORLAND__)
Severity objsev = SEVERITY_NULL;
#else
__attribute__( ( unused ) ) Severity objsev = SEVERITY_NULL;
#endif
int endsec = 0;
int userDefined = 0;
@@ -126,7 +130,7 @@ STEPfile::ReadHeader( istream & in ) {
break; //from while-loop
} else {
//create and read the header instance
// SCLP23(Application_instance)::STEPread now reads the opening parenthesis
// SDAI_Application_instance::STEPread now reads the opening parenthesis
//create header instance
buf[0] = '\0';
@@ -162,7 +166,7 @@ STEPfile::ReadHeader( istream & in ) {
keywd << "\'.\n\tdata lost: " << strbuf << "\n";
_error.GreaterSeverity( SEVERITY_WARNING );
} else { //not ENTITY_NULL
//read the header instance
//read the header instance
//check obj's Error Descriptor
objsev = AppendEntityErrorMsg( &( obj->Error() ) );
@@ -171,9 +175,9 @@ STEPfile::ReadHeader( istream & in ) {
fileid = HeaderId( keywd );
//read the values from the istream
objsev = obj->STEPread( fileid, 0, ( InstMgr * )0, in );
objsev = obj->STEPread( fileid, 0, ( InstMgr * )0, in, NULL, true, _strict );
if( !cmtStr.empty() ) {
obj->AddP21Comment( cmtStr );
obj->PrependP21Comment( cmtStr );
}
in >> ws;
@@ -210,7 +214,7 @@ Severity
STEPfile::HeaderVerifyInstances( InstMgr * im ) {
int err = 0;
int fileid;
SCLP23( Application_instance )* obj;
SDAI_Application_instance * obj;
//check File_Name
fileid = HeaderId( "File_Name" );
@@ -250,7 +254,7 @@ STEPfile::HeaderVerifyInstances( InstMgr * im ) {
return SEVERITY_WARNING;
}
SCLP23( Application_instance ) *
SDAI_Application_instance *
STEPfile::HeaderDefaultFileName() {
SdaiFile_name * fn = new SdaiFile_name;
StringAggregate_ptr tmp = new StringAggregate;
@@ -258,16 +262,16 @@ STEPfile::HeaderDefaultFileName() {
fn->name_( "" );
fn->time_stamp_( "" );
tmp->StrToVal( "", &_error,
fn->attributes[2].
aDesc -> DomainType(),
_headerInstances );
fn->author_(tmp);
fn->attributes[2].
aDesc -> DomainType(),
_headerInstances );
fn->author_( tmp );
tmp->StrToVal( "", &_error,
fn->attributes[3].
aDesc -> DomainType(),
_headerInstances );
fn->organization_(tmp);
fn->organization_( tmp );
fn->preprocessor_version_( "" );
fn->originating_system_( "" );
@@ -278,7 +282,7 @@ STEPfile::HeaderDefaultFileName() {
return fn;
}
SCLP23( Application_instance ) *
SDAI_Application_instance *
STEPfile::HeaderDefaultFileDescription() {
SdaiFile_description * fd = new SdaiFile_description;
@@ -289,16 +293,16 @@ STEPfile::HeaderDefaultFileDescription() {
return fd;
}
SCLP23( Application_instance ) *
SDAI_Application_instance *
STEPfile::HeaderDefaultFileSchema() {
SdaiFile_schema * fs = new SdaiFile_schema;
StringAggregate_ptr tmp = new StringAggregate;
tmp->StrToVal( "", &_error,
fs->attributes[0].
aDesc -> DomainType(),
_headerInstances );
fs->schema_identifiers_(tmp);
fs->attributes[0].
aDesc -> DomainType(),
_headerInstances );
fs->schema_identifiers_( tmp );
fs->STEPfile_id = HeaderId( "File_Schema" );
@@ -328,8 +332,8 @@ header section entites. The file id numbers are important.
***************************/
void
STEPfile::HeaderMergeInstances( InstMgr * im ) {
SCLP23( Application_instance )* se = 0;
SCLP23( Application_instance )* from = 0;
SDAI_Application_instance * se = 0;
SDAI_Application_instance * from = 0;
int idnum;
@@ -434,7 +438,7 @@ STEPfile::ReadData1( istream & in ) {
buf[0] = '\0';
std::string tmpbuf;
SCLP23( Application_instance ) * obj = ENTITY_NULL;
SDAI_Application_instance * obj = ENTITY_NULL;
stateEnum inst_state = noStateSE; // used if reading working file
ErrorDescriptor e;
@@ -553,7 +557,7 @@ STEPfile::ReadData1( istream & in ) {
buf[0] = '\0';
std::string tmpbuf;
SCLP23( Application_instance ) * obj;
SDAI_Application_instance * obj;
stateEnum inst_state; // used if reading working file
ReadTokenSeparator( in ); // also skips white space
@@ -696,7 +700,7 @@ STEPfile::ReadWorkingData1( istream & in ) {
std::string tmpbuf;
// PASS 1: create instances
SCLP23( Application_instance ) * obj;
SDAI_Application_instance * obj;
stateEnum inst_state;
int endsec = 0;
@@ -830,7 +834,7 @@ STEPfile::ReadWorkingData1( istream & in ) {
** in an exchange file
******************************************************************/
int
STEPfile::ReadData2( istream & in, int useTechCor ) {
STEPfile::ReadData2( istream & in, bool useTechCor ) {
_entsInvalid = 0;
_entsIncomplete = 0;
_entsWarning = 0;
@@ -847,7 +851,7 @@ STEPfile::ReadData2( istream & in, int useTechCor ) {
buf[0] = '\0';
std::string tmpbuf;
SCLP23( Application_instance ) * obj = ENTITY_NULL;
SDAI_Application_instance * obj = ENTITY_NULL;
std::string cmtStr;
// ReadTokenSeparator(in, &cmtStr);
@@ -975,7 +979,7 @@ STEPfile::ReadData2( istream & in ) {
buf[0] = '\0';
std::string tmpbuf;
SCLP23( Application_instance ) * obj;
SDAI_Application_instance * obj;
std::string cmtStr;
ReadTokenSeparator( in, &cmtStr );
@@ -1096,7 +1100,7 @@ STEPfile::ReadData2( istream & in ) {
int valid_insts = 0; // used for exchange file only
SCLP23( Application_instance ) * obj = ENTITY_NULL;
SDAI_Application_instance * obj = ENTITY_NULL;
ReadTokenSeparator( in );
@@ -1133,7 +1137,7 @@ STEPfile::ReadData2( istream & in ) {
#endif
int
STEPfile::ReadWorkingData2( istream & in, int useTechCor ) {
STEPfile::ReadWorkingData2( istream & in, bool useTechCor ) {
return ReadData2( in, useTechCor );
#ifdef junk
_errorCount = 0; // reset error count
@@ -1143,7 +1147,7 @@ STEPfile::ReadWorkingData2( istream & in, int useTechCor ) {
std::string tmpbuf;
int total_instances = 0;
SCLP23( Application_instance ) * obj = ENTITY_NULL;
SDAI_Application_instance * obj = ENTITY_NULL;
// PASS 2: read data
int endsec = 0;
@@ -1214,7 +1218,7 @@ STEPfile::ReadWorkingData2( istream & in, int useTechCor ) {
int
STEPfile::FindDataSection( istream & in ) {
ErrorDescriptor errs;
SCLP23( String ) tmp;
SDAI_String tmp;
std::string s; // used if need to read a comment
char c;
@@ -1308,19 +1312,18 @@ an ENTITY_INSTANCE consists of:
'#'(int)'=' [SCOPE] SUBSUPER_RECORD ';'
The '#' is read from the istream before CreateInstance is called.
***************************/
SCLP23( Application_instance ) *
SDAI_Application_instance *
STEPfile::CreateInstance( istream & in, ostream & out ) {
std::string tmpbuf;
std::string objnm;
char c;
char schnm[BUFSIZ];
schnm[0] = '\0';
std::string schnm;
int fileid = -1;
SCLP23( Application_instance_ptr ) * scopelist = 0;
SDAI_Application_instance_ptr * scopelist = 0;
SCLP23( Application_instance )* obj;
SDAI_Application_instance * obj;
ErrorDescriptor result;
// Sent down to CreateSubSuperInstance() to receive error info
@@ -1395,8 +1398,8 @@ STEPfile::CreateInstance( istream & in, ostream & out ) {
<< endl;
return ENTITY_NULL;
} else {
schemaName( schnm );
obj = reg().ObjCreate( objnm.c_str(), schnm );
schnm = schemaName();
obj = reg().ObjCreate( objnm.c_str(), schnm.c_str() );
if( obj == ENTITY_NULL ) {
// This will be the case if objnm does not exist in the reg.
result.UserMsg( "Unknown ENTITY type" );
@@ -1448,13 +1451,13 @@ STEPfile::CreateInstance( istream & in, ostream & out ) {
< SEVERITY_BUG: fatal
**************************************************/
Severity
STEPfile::CreateScopeInstances( istream & in, SCLP23( Application_instance_ptr ) ** scopelist ) {
STEPfile::CreateScopeInstances( istream & in, SDAI_Application_instance_ptr ** scopelist ) {
Severity rval = SEVERITY_NULL;
SCLP23( Application_instance ) * se;
SDAI_Application_instance * se;
std::string tmpbuf;
char c;
int exportid;
SCLP23( Application_instance_ptr ) inscope [BUFSIZ];
SDAI_Application_instance_ptr inscope [BUFSIZ];
int i = 0;
std::string keywd;
@@ -1496,9 +1499,9 @@ STEPfile::CreateScopeInstances( istream & in, SCLP23( Application_instance_ptr )
in.get( c );
}
in.putback( c );
*scopelist = new SCLP23( Application_instance_ptr ) [i];
*scopelist = new SDAI_Application_instance_ptr [i];
while( i > 0 ) {
*scopelist [i-1] = inscope [i];
*scopelist [i - 1] = inscope [i];
i--;
}
@@ -1542,14 +1545,13 @@ STEPfile::CreateScopeInstances( istream & in, SCLP23( Application_instance_ptr )
return rval;
}
SCLP23( Application_instance ) *
SDAI_Application_instance *
STEPfile::CreateSubSuperInstance( istream & in, int fileid, ErrorDescriptor & e ) {
std::string tmpstr;
SCLP23( Application_instance ) * obj = ENTITY_NULL;
SDAI_Application_instance * obj = ENTITY_NULL;
char c;
char schnm[BUFSIZ];
schnm[0] = '\0';
std::string schnm;
std::string buf; // used to hold the simple record that is read
ErrorDescriptor err; // used to catch error msgs
@@ -1584,9 +1586,9 @@ STEPfile::CreateSubSuperInstance( istream & in, int fileid, ErrorDescriptor & e
}
}
entNmArr[enaIndex] = 0;
schemaName( schnm );
schnm = schemaName();
obj = new STEPcomplex( &_reg, ( const std::string ** )entNmArr, fileid, schnm );
obj = new STEPcomplex( &_reg, ( const std::string ** )entNmArr, fileid, schnm.c_str() );
if( obj->Error().severity() <= SEVERITY_WARNING ) {
// If obj is not legal, record its error info and delete it:
@@ -1609,7 +1611,7 @@ STEPfile::CreateSubSuperInstance( istream & in, int fileid, ErrorDescriptor & e
Severity
STEPfile::ReadScopeInstances( istream & in ) {
Severity rval = SEVERITY_NULL;
SCLP23( Application_instance ) * se;
SDAI_Application_instance * se;
std::string tmpbuf;
char c;
int exportid;
@@ -1738,28 +1740,27 @@ void ReadEntityError( char c, int i, istream & in ) {
/*****************************************************
description:
This function populates a SCLP23(Application_instance) with the values read from
This function populates a SDAI_Application_instance with the values read from
the istream.
This function must keeps track of error messages encountered when
reading the SCLP23(Application_instance). It passes SCLP23(Application_instance) error information onto
reading the SDAI_Application_instance. It passes SDAI_Application_instance error information onto
the STEPfile ErrorDescriptor.
*****************************************************/
SCLP23( Application_instance ) *
SDAI_Application_instance *
STEPfile::ReadInstance( istream & in, ostream & out, std::string & cmtStr,
int useTechCor ) {
bool useTechCor ) {
Severity sev = SEVERITY_NULL;
std::string tmpbuf;
char errbuf[BUFSIZ];
errbuf[0] = '\0';
char currSch[BUFSIZ];
currSch[0] = '\0';
std::string currSch;
std::string objnm;
char c;
int fileid;
SCLP23( Application_instance )* obj = ENTITY_NULL;
SDAI_Application_instance * obj = ENTITY_NULL;
int idIncrNum = FileIdIncr();
ReadComment( in, cmtStr );
@@ -1825,13 +1826,13 @@ STEPfile::ReadInstance( istream & in, ostream & out, std::string & cmtStr,
in.putback( c );
}
schemaName( currSch );
currSch = schemaName();
//check for subtype/supertype record
if( c == '(' ) {
// TODO
sev = obj->STEPread( fileid, idIncrNum, &instances(), in, currSch,
useTechCor );
sev = obj->STEPread( fileid, idIncrNum, &instances(), in, currSch.c_str(),
useTechCor, _strict );
ReadTokenSeparator( in, &cmtStr );
@@ -1860,7 +1861,7 @@ STEPfile::ReadInstance( istream & in, ostream & out, std::string & cmtStr,
if( !in.good() ) {
out << "ERROR: instance #" << fileid
<< " Unexpected file problem in "
<< "STEPfile::CreateInstance.\n";
<< "STEPfile::ReadInstance." << endl;;
}
ReadTokenSeparator( in, &cmtStr );
@@ -1868,8 +1869,8 @@ STEPfile::ReadInstance( istream & in, ostream & out, std::string & cmtStr,
if( userDefined ) {
SkipInstance( in, tmpbuf );
out << "WARNING: #" << fileid <<
". Ignoring User defined entity.\n\tdata lost: !"
<< objnm << tmpbuf << "\n";
". Ignoring User defined entity." << endl << " data lost: !"
<< objnm << tmpbuf << endl;
++_warningCount;
return ENTITY_NULL;
}
@@ -1877,8 +1878,8 @@ STEPfile::ReadInstance( istream & in, ostream & out, std::string & cmtStr,
// NOTE: this function is called for all FileTypes
// (WORKING_SESSION included)
sev = obj->STEPread( fileid, idIncrNum, &instances(), in, currSch,
useTechCor );
sev = obj->STEPread( fileid, idIncrNum, &instances(), in, currSch.c_str(),
useTechCor, _strict );
ReadTokenSeparator( in, &cmtStr );
@@ -1964,17 +1965,17 @@ BUG: doesn't check to see if the backup command works.
void
STEPfile::MakeBackupFile() {
std::string bckup = FileName();
bckup.append(".bak");
bckup.append( ".bak" );
std::fstream f(FileName().c_str(), std::fstream::in|std::fstream::binary);
std::fstream f( FileName().c_str(), std::fstream::in | std::fstream::binary );
f << std::noskipws;
std::istream_iterator<unsigned char> begin(f);
std::istream_iterator<unsigned char> begin( f );
std::istream_iterator<unsigned char> end;
std::fstream f2(bckup.c_str(), std::fstream::out|std::fstream::trunc|std::fstream::binary);
std::ostream_iterator<char> begin2(f2);
std::fstream f2( bckup.c_str(), std::fstream::out | std::fstream::trunc | std::fstream::binary );
std::ostream_iterator<char> begin2( f2 );
copy(begin, end, begin2);
copy( begin, end, begin2 );
_error.AppendToDetailMsg( "Making backup file: " );
_error.AppendToDetailMsg( bckup.c_str() );
@@ -2083,7 +2084,7 @@ The header section entities must be numbered in the following manner:
int STEPfile::HeaderId( const std::string name ) {
std::string tmp = name;
std::transform(tmp.begin(), tmp.end(), tmp.begin(), ::toupper);
std::transform( tmp.begin(), tmp.end(), tmp.begin(), ::toupper );
if( tmp == "FILE_DESCRIPTION" ) {
return 1;
@@ -2108,7 +2109,7 @@ STEPfile::WriteHeader( ostream & out ) {
WriteHeaderInstanceFileSchema( out );
// Write the rest of the header instances
SCLP23( Application_instance )* se;
SDAI_Application_instance * se;
int n = _headerInstances->InstanceCount();
for( int i = 0; i < n; ++i ) {
se = _headerInstances->GetMgrNode( i ) ->GetApplication_instance();
@@ -2126,7 +2127,7 @@ STEPfile::WriteHeader( ostream & out ) {
/***************************
***************************/
void
STEPfile::WriteHeaderInstance( SCLP23( Application_instance )* obj, ostream & out ) {
STEPfile::WriteHeaderInstance( SDAI_Application_instance * obj, ostream & out ) {
std::string tmp;
if( !obj->P21Comment().empty() ) {
out << obj->P21Comment();
@@ -2147,10 +2148,10 @@ STEPfile::WriteHeaderInstance( SCLP23( Application_instance )* obj, ostream & ou
void
STEPfile::WriteHeaderInstanceFileName( ostream & out ) {
// Get the FileName instance from _headerInstances
SCLP23( Application_instance ) *se = 0;
SDAI_Application_instance * se = 0;
se = _headerInstances->GetApplication_instance( "File_Name" );
if( se == ENTITY_NULL ) {
se = ( SCLP23( Application_instance ) * )HeaderDefaultFileName();
se = ( SDAI_Application_instance * )HeaderDefaultFileName();
}
//set some of the attribute values at time of output
@@ -2174,22 +2175,22 @@ STEPfile::WriteHeaderInstanceFileName( ostream & out ) {
void STEPfile::WriteHeaderInstanceFileDescription( ostream & out ) {
// Get the FileDescription instance from _headerInstances
SCLP23( Application_instance ) *se = 0;
SDAI_Application_instance * se = 0;
se = _headerInstances->GetApplication_instance( "File_Description" );
if( se == ENTITY_NULL ) {
se = ( SCLP23( Application_instance ) * )HeaderDefaultFileDescription();
se = ( SDAI_Application_instance * )HeaderDefaultFileDescription();
}
WriteHeaderInstance( se, out );
}
void STEPfile::WriteHeaderInstanceFileSchema( ostream & out ) {
SCLP23( Application_instance ) *se = 0;
SDAI_Application_instance * se = 0;
// Get the FileName instance from _headerInstances
se = _headerInstances->GetApplication_instance( "File_Schema" );
if( se == ENTITY_NULL ) {
se = ( SCLP23( Application_instance ) * ) HeaderDefaultFileSchema();
se = ( SDAI_Application_instance * ) HeaderDefaultFileSchema();
}
WriteHeaderInstance( se, out );
}
@@ -2199,16 +2200,12 @@ void STEPfile::WriteHeaderInstanceFileSchema( ostream & out ) {
***************************/
void STEPfile::WriteData( ostream & out, int writeComments ) {
char currSch[BUFSIZ];
currSch[0] = '\0';
std::string currSch = schemaName();
out << "DATA;\n";
schemaName( currSch );
int n = instances().InstanceCount();
for( int i = 0; i < n; ++i )
{
instances().GetMgrNode( i )->GetApplication_instance()->STEPwrite( out, currSch, writeComments );
for( int i = 0; i < n; ++i ) {
instances().GetMgrNode( i )->GetApplication_instance()->STEPwrite( out, currSch.c_str(), writeComments );
}
out << "ENDSEC;\n";
@@ -2217,26 +2214,20 @@ void STEPfile::WriteData( ostream & out, int writeComments ) {
/***************************
***************************/
void
STEPfile::WriteValuePairsData( ostream & out, int writeComments, int mixedCase ) {
char currSch[BUFSIZ];
currSch[0] = '\0';
schemaName( currSch );
void STEPfile::WriteValuePairsData( ostream & out, int writeComments, int mixedCase ) {
std::string currSch = schemaName();
int n = instances().InstanceCount();
for( int i = 0; i < n; ++i )
{
instances().GetMgrNode( i )->GetApplication_instance()->WriteValuePairs( out, currSch, writeComments, mixedCase );
for( int i = 0; i < n; ++i ) {
instances().GetMgrNode( i )->GetApplication_instance()->WriteValuePairs( out, currSch.c_str(), writeComments, mixedCase );
}
}
Severity
STEPfile::AppendFile( istream * in, int useTechCor ) {
Severity STEPfile::AppendFile( istream * in, bool useTechCor ) {
Severity rval = SEVERITY_NULL;
char errbuf[BUFSIZ];
SetFileIdIncrement();
int total_insts = 0, valid_insts = 0;
__attribute__( ( unused ) ) int exchange_file = -1;
ReadTokenSeparator( *in );
std::string keywd = GetKeyword( *in, "; #", _error );
@@ -2246,11 +2237,9 @@ STEPfile::AppendFile( istream * in, int useTechCor ) {
if( !strncmp( const_cast<char *>( keywd.c_str() ), "ISO-10303-21",
strlen( const_cast<char *>( keywd.c_str() ) ) ) ) {
exchange_file = 1;
SetFileType( VERSION_CURRENT );
} else if( !strncmp( const_cast<char *>( keywd.c_str() ), "STEP_WORKING_SESSION",
strlen( const_cast<char *>( keywd.c_str() ) ) ) ) {
exchange_file = 0;
if( _fileType != WORKING_SESSION ) {
_error.AppendToUserMsg(
"Warning: Reading in file as Working Session file.\n" );
@@ -2269,7 +2258,7 @@ STEPfile::AppendFile( istream * in, int useTechCor ) {
return SEVERITY_INPUT_ERROR;
}
cout << "Reading Data from " << ( ( FileName().compare( "-" ) == 0 ) ? "standard input" : FileName() ) << "...\n";
cout << "Reading Data from " << ( ( FileName().compare( "-" ) == 0 ) ? "standard input" : FileName().c_str() ) << "...\n";
// Read header
rval = ReadHeader( *in );
@@ -2393,8 +2382,7 @@ STEPfile::AppendFile( istream * in, int useTechCor ) {
/******************************************************/
Severity
STEPfile::WriteWorkingFile( ostream & out, int clearError, int writeComments ) {
Severity STEPfile::WriteWorkingFile( ostream & out, int clearError, int writeComments ) {
SetFileType( WORKING_SESSION );
if( clearError ) {
_error.ClearErrorMsg();
@@ -2416,9 +2404,8 @@ STEPfile::WriteWorkingFile( ostream & out, int clearError, int writeComments ) {
}
/******************************************************/
Severity
STEPfile::WriteWorkingFile( const std::string filename, int clearError,
int writeComments ) {
Severity STEPfile::WriteWorkingFile( const std::string filename, int clearError,
int writeComments ) {
if( clearError ) {
_error.ClearErrorMsg();
}
@@ -2435,36 +2422,32 @@ STEPfile::WriteWorkingFile( const std::string filename, int clearError,
/***************************
***************************/
void
STEPfile::WriteWorkingData( ostream & out, int writeComments ) {
char currSch[BUFSIZ];
currSch[0] = '\0';
schemaName( currSch );
void STEPfile::WriteWorkingData( ostream & out, int writeComments ) {
std::string currSch = schemaName();
out << "DATA;\n";
// SCLP23(Application_instance)* se;
int n = instances().InstanceCount();
for( int i = 0; i < n; ++i ) {
switch( instances().GetMgrNode( i )->CurrState() ) {
case deleteSE:
out << wsDelete;
instances().GetMgrNode( i )->GetApplication_instance()->
STEPwrite( out, currSch, writeComments );
STEPwrite( out, currSch.c_str(), writeComments );
break;
case completeSE:
out << wsSaveComplete;
instances().GetMgrNode( i )->GetApplication_instance()->
STEPwrite( out, currSch, writeComments );
STEPwrite( out, currSch.c_str(), writeComments );
break;
case incompleteSE:
out << wsSaveIncomplete;
instances().GetMgrNode( i )->GetApplication_instance()->
STEPwrite( out, currSch, writeComments );
STEPwrite( out, currSch.c_str(), writeComments );
break;
case newSE:
out << wsNew;
instances().GetMgrNode( i )->GetApplication_instance()->
STEPwrite( out, currSch, writeComments );
STEPwrite( out, currSch.c_str(), writeComments );
break;
case noStateSE:
_error.AppendToUserMsg( "no state information for this node\n" );
@@ -2478,7 +2461,7 @@ STEPfile::WriteWorkingData( ostream & out, int writeComments ) {
description:
This function sends messages to 'cerr'
based on the values in the given ErrorDescriptor (e), which is
supposed to be from a SCLP23(Application_instance) object, being manipulated by one
supposed to be from a SDAI_Application_instance object, being manipulated by one
of the STEPfile member functions.
The given error descriptor's messages are then cleared.
@@ -2494,7 +2477,7 @@ STEPfile::AppendEntityErrorMsg( ErrorDescriptor * e ) {
if( ( sev < SEVERITY_MAX ) || ( sev > SEVERITY_NULL ) ) {
//ERROR: something wrong with ErrorDescriptor
//_error.AppendToDetailMsg("Error: in AppendEntityErrorMsg(ErrorDesriptor& e). Incomplete ErrorDescriptor, unable to report error message in SCLP23(Application_instance).\n");
//_error.AppendToDetailMsg("Error: in AppendEntityErrorMsg(ErrorDesriptor& e). Incomplete ErrorDescriptor, unable to report error message in SDAI_Application_instance.\n");
_error.GreaterSeverity( SEVERITY_WARNING );
return SEVERITY_BUG;
}
+153 -130
View File
@@ -1,5 +1,5 @@
#ifndef _STEPFILE_H
#define _STEPFILE_H
#define _STEPFILE_H
/*
* NIST STEP Core Class Library
@@ -13,6 +13,7 @@
* and is not subject to copyright.
*/
#include <scl_export.h>
#include <instmgr.h>
#include <Registry.h>
#include <fstream>
@@ -27,186 +28,208 @@
#define READ_INCOMPLETE 20
enum FileTypeCode {
TYPE_UNKNOWN = -2,
VERSION_OLD = -1,
VERSION_UNKNOWN = 0,
VERSION_CURRENT = 1,
WORKING_SESSION = 2,
TYPE_UNKNOWN = -2,
VERSION_OLD = -1,
VERSION_UNKNOWN = 0,
VERSION_CURRENT = 1,
WORKING_SESSION = 2,
OLD_WORKING_SESSION = 3
};
};
class STEPfile
{
protected:
//data members
class SCL_EDITOR_EXPORT STEPfile {
protected:
//data members
InstMgr& _instances;
Registry& _reg;
InstMgr & _instances;
Registry & _reg;
InstMgr & instances () { return _instances; }
Registry & reg () { return _reg; }
int _fileIdIncr; //Increment value to be added to FileId Numbers on input
InstMgr & instances() {
return _instances;
}
Registry & reg() {
return _reg;
}
int _fileIdIncr; //Increment value to be added to FileId Numbers on input
//header information
InstMgr* _headerInstances;
Registry *_headerRegistry;
int _headerId; //STEPfile_id given to SCLP23(Application_instance) from header section
InstMgr * _headerInstances;
Registry * _headerRegistry;
int _headerId; //STEPfile_id given to SDAI_Application_instance from header section
//file information
DirObj* _currentDir;
std::string _fileName;
DirObj * _currentDir;
std::string _fileName;
//error information
ErrorDescriptor _error;
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
// 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;
// old errors
int _errorCount;
int _warningCount;
int _maxErrorCount;
int _maxErrorCount;
bool _strict; ///< If false, "missing and required" attributes are replaced with a generic value when file is read
protected:
protected:
//file type information
FileTypeCode _fileType;
char ENTITY_NAME_DELIM;
char* FILE_DELIM;
char* END_FILE_DELIM;
FileTypeCode _fileType;
char ENTITY_NAME_DELIM;
char * FILE_DELIM;
char * END_FILE_DELIM;
//public member functions
public:
public:
//public access to member variables
//header information
InstMgr* HeaderInstances() { return _headerInstances; }
const Registry *HeaderRegistry() { return _headerRegistry; }
InstMgr * HeaderInstances() {
return _headerInstances;
}
const Registry * HeaderRegistry() {
return _headerRegistry;
}
// to create header instances
SCLP23(Application_instance)* HeaderDefaultFileName();
SCLP23(Application_instance)* HeaderDefaultFileDescription();
SCLP23(Application_instance)* HeaderDefaultFileSchema();
SDAI_Application_instance * HeaderDefaultFileName();
SDAI_Application_instance * HeaderDefaultFileDescription();
SDAI_Application_instance * HeaderDefaultFileSchema();
//file information
const std::string FileName() const { return _fileName; }
const std::string SetFileName (const std::string name = "");
const std::string TruncFileName (const std::string name) const;
const std::string FileName() const {
return _fileName;
}
const std::string SetFileName( const std::string name = "" );
const std::string TruncFileName( const std::string name ) const;
//error information
ErrorDescriptor& Error() /* const */ { return _error; }
int ErrorCount() const { return _errorCount; }
int WarningCount() const { return _warningCount; }
Severity AppendEntityErrorMsg (ErrorDescriptor *e);
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 std::string filename = "", int useTechCor =1);
Severity AppendExchangeFile (const std::string filename = "", int useTechCor =1);
FileTypeCode FileType() const {
return _fileType;
}
void FileType( FileTypeCode ft ) {
_fileType = ft;
}
int SetFileType( FileTypeCode ft = VERSION_CURRENT );
Severity ReadWorkingFile (const std::string filename = "", int useTechCor =1);
Severity AppendWorkingFile (const std::string filename = "", int useTechCor =1);
//Reading and Writing
Severity ReadExchangeFile( const std::string filename = "", bool useTechCor = true );
Severity AppendExchangeFile( const std::string filename = "", bool useTechCor = true );
Severity AppendFile (istream* in, int useTechCor =1) ;
Severity ReadWorkingFile( const std::string filename = "", bool useTechCor = true );
Severity AppendWorkingFile( const std::string filename = "", bool useTechCor = true );
Severity WriteExchangeFile (ostream& out, int validate =1,
int clearError = 1, int writeComments = 1);
Severity WriteExchangeFile (const std::string filename = "", int validate =1,
int clearError = 1, int writeComments = 1);
Severity WriteValuePairsFile(ostream& out, int validate =1,
int clearError =1,
int writeComments = 1, int mixedCase = 1);
Severity AppendFile( istream * in, bool useTechCor = true ) ;
Severity WriteWorkingFile (ostream& out, int clearError = 1,
int writeComments = 1);
Severity WriteWorkingFile (const std::string filename = "", int clearError = 1,
int writeComments = 1);
Severity WriteExchangeFile( ostream & out, int validate = 1,
int clearError = 1, int writeComments = 1 );
Severity WriteExchangeFile( const std::string filename = "", int validate = 1,
int clearError = 1, int writeComments = 1 );
Severity WriteValuePairsFile( ostream & out, int validate = 1,
int clearError = 1,
int writeComments = 1, int mixedCase = 1 );
stateEnum EntityWfState(char c);
void Renumber ();
Severity WriteWorkingFile( ostream & out, int clearError = 1,
int writeComments = 1 );
Severity WriteWorkingFile( const std::string filename = "", int clearError = 1,
int writeComments = 1 );
stateEnum EntityWfState( char c );
void Renumber();
//constructors
STEPfile (Registry& r, InstMgr& i, const std::string filename = "");
virtual ~STEPfile();
STEPfile( Registry & r, InstMgr & i, const std::string filename = "", bool strict = true );
virtual ~STEPfile();
protected:
protected:
//member functions
char *schemaName( char * ); // returns and copies out schema name from
// header instances
const std::string schemaName(); // returns and copies out schema name from header instances
//called by ReadExchangeFile
istream* OpenInputFile (const std::string filename = "");
void CloseInputFile(istream* in);
Severity ReadHeader(istream& in);
istream * OpenInputFile( const std::string filename = "" );
void CloseInputFile( istream * in );
Severity HeaderVerifyInstances(InstMgr* im);
void HeaderMergeInstances(InstMgr* im);
int HeaderId (int increment =1);
int HeaderId (const std::string name);
Severity ReadHeader( istream & in );
int ReadData1 (istream& in); // first pass to create instances
// second pass to read instances
int ReadData2 (istream& in, int useTechCor =1);
Severity HeaderVerifyInstances( InstMgr * im );
void HeaderMergeInstances( InstMgr * im );
int HeaderId( int increment = 1 );
int HeaderId( const std::string name );
int ReadData1( istream & in ); // first pass to create instances
// second pass to read instances
int ReadData2( istream & in, bool useTechCor = true );
// obsolete
int ReadWorkingData1 (istream& in);
int ReadWorkingData2 (istream& in, int useTechCor =1);
int ReadWorkingData1( istream & in );
int ReadWorkingData2( istream & in, bool useTechCor = true );
void ReadRestOfFile(istream& in);
void ReadRestOfFile( istream & in );
// create instance - used by ReadData1()
SCLP23(Application_instance) * CreateInstance(istream& in, ostream& out);
// create complex instance - used by CreateInstance()
SCLP23(Application_instance) * CreateSubSuperInstance(istream& in, int fileid,
ErrorDescriptor &);
// create instance - used by ReadData1()
SDAI_Application_instance * CreateInstance( istream & in, ostream & out );
// create complex instance - used by CreateInstance()
SDAI_Application_instance * CreateSubSuperInstance( istream & in, int fileid,
ErrorDescriptor & );
// read the instance - used by ReadData2()
SCLP23(Application_instance) * ReadInstance(istream& in, ostream& out,
std::string &cmtStr, int useTechCor =1);
// read the instance - used by ReadData2()
SDAI_Application_instance * ReadInstance( istream & in, ostream & out,
std::string & cmtStr, bool useTechCor = true );
// reading scopes are still incomplete
// these functions are stubs
Severity CreateScopeInstances(istream& in, SCLP23(Application_instance_ptr) ** scopelist);
Severity ReadScopeInstances(istream& in);
// reading scopes are still incomplete
// these functions are stubs
Severity CreateScopeInstances( istream & in, SDAI_Application_instance_ptr ** scopelist );
Severity ReadScopeInstances( istream & in );
// Severity ReadSubSuperInstance(istream& in);
int FindDataSection (istream& in);
int FindHeaderSection (istream& in);
int FindDataSection( istream & in );
int FindHeaderSection( istream & in );
// writing working session files
void WriteWorkingData(ostream& out, int writeComments = 1);
void WriteWorkingData( ostream & out, int writeComments = 1 );
//called by WriteExchangeFile
ofstream* OpenOutputFile(const std::string filename = "");
void CloseOutputFile(ostream* out);
ofstream * OpenOutputFile( const std::string filename = "" );
void CloseOutputFile( ostream * out );
void WriteHeader (ostream& out);
void WriteHeaderInstance (SCLP23(Application_instance) *obj, ostream& out);
void WriteHeaderInstanceFileName (ostream& out);
void WriteHeaderInstanceFileDescription (ostream& out);
void WriteHeaderInstanceFileSchema (ostream& out);
void WriteHeader( ostream & out );
void WriteHeaderInstance( SDAI_Application_instance * obj, ostream & out );
void WriteHeaderInstanceFileName( ostream & out );
void WriteHeaderInstanceFileDescription( ostream & out );
void WriteHeaderInstanceFileSchema( ostream & out );
void WriteData (ostream& out, int writeComments = 1);
void WriteValuePairsData(ostream& out, int writeComments = 1,
int mixedCase = 1);
int IncrementFileId (int fileid);
int FileIdIncr() { return _fileIdIncr; }
void SetFileIdIncrement ();
void MakeBackupFile();
void WriteData( ostream & out, int writeComments = 1 );
void WriteValuePairsData( ostream & out, int writeComments = 1,
int mixedCase = 1 );
int IncrementFileId( int fileid );
int FileIdIncr() {
return _fileIdIncr;
}
void SetFileIdIncrement();
void MakeBackupFile();
// void ReadWhiteSpace(istream& in);
};
+34 -36
View File
@@ -14,26 +14,21 @@
#include <STEPfile.h>
#include <SdaiHeaderSchema.h>
#include <STEPaggregate.h>
#include <cmath>
#include <cstring>
extern "C" {
double ceil( double );
}
extern void HeaderSchemaInit( Registry & reg );
//To Be inline functions
//constructor & destructor
STEPfile::STEPfile( Registry & r, InstMgr & i, const std::string filename ) :
STEPfile::STEPfile( Registry & r, InstMgr & i, const std::string filename, bool strict ) :
_instances( i ), _reg( r ), _fileIdIncr( 0 ), _headerId( 0 ),
_entsNotCreated( 0 ), _entsInvalid( 0 ), _entsIncomplete( 0 ),
_entsWarning( 0 ), _errorCount( 0 ), _warningCount( 0 ),
_maxErrorCount( 5000 )
{
_maxErrorCount( 5000 ), _strict( strict ) {
SetFileType( VERSION_CURRENT );
SetFileIdIncrement();
_currentDir = new DirObj( "" );
@@ -96,17 +91,17 @@ const std::string STEPfile::TruncFileName( const std::string filename ) const {
#else
char slash = '/';
#endif
size_t l = filename.find_last_of(slash);
size_t l = filename.find_last_of( slash );
if( l == std::string::npos ) {
return filename;
} else {
return filename.substr(l);
return filename.substr( l );
}
}
/******************************************************/
Severity STEPfile::ReadExchangeFile( const std::string filename, int useTechCor ) {
Severity STEPfile::ReadExchangeFile( const std::string filename, bool useTechCor ) {
_error.ClearErrorMsg();
_errorCount = 0;
istream * in = OpenInputFile( filename );
@@ -125,7 +120,7 @@ Severity STEPfile::ReadExchangeFile( const std::string filename, int useTechCor
return rval;
}
Severity STEPfile::AppendExchangeFile( const std::string filename, int useTechCor ) {
Severity STEPfile::AppendExchangeFile( const std::string filename, bool useTechCor ) {
_error.ClearErrorMsg();
_errorCount = 0;
istream * in = OpenInputFile( filename );
@@ -139,7 +134,7 @@ Severity STEPfile::AppendExchangeFile( const std::string filename, int useTechCo
}
/******************************************************/
Severity STEPfile::ReadWorkingFile( const std::string filename, int useTechCor ) {
Severity STEPfile::ReadWorkingFile( const std::string filename, bool useTechCor ) {
_error.ClearErrorMsg();
_errorCount = 0;
istream * in = OpenInputFile( filename );
@@ -159,7 +154,7 @@ Severity STEPfile::ReadWorkingFile( const std::string filename, int useTechCor )
}
Severity STEPfile::AppendWorkingFile( const std::string filename, int useTechCor ) {
Severity STEPfile::AppendWorkingFile( const std::string filename, bool useTechCor ) {
_error.ClearErrorMsg();
_errorCount = 0;
istream * in = OpenInputFile( filename );
@@ -258,53 +253,56 @@ int STEPfile::IncrementFileId( int fileid ) {
return ( fileid + FileIdIncr() );
}
void STEPfile::SetFileIdIncrement() {
if( instances().MaxFileId() < 0 ) {
_fileIdIncr = 0;
} else _fileIdIncr =
( int )( ( ceil( ( double )( ( instances().MaxFileId() + 99 ) / 1000 ) ) + 1 ) * 1000 );
// FIXME: Is this correct? Why put an integer expression into ceil()?
( int )( ( ceil( ( ( instances().MaxFileId() + 99.0 ) / 1000.0 ) ) + 1.0 ) * 1000.0 );
}
char * STEPfile::schemaName( char * schName )
/*
/**
* Returns the schema name from the file schema header section (or the 1st
* one if more than one exists). Copies this value into schName. If there
* is no header section or no value for file schema, NULL is returned and
* schName is unset.
*/
{
const std::string STEPfile::schemaName() {
SdaiFile_schema * fs;
std::string tmp;
std::string schName;
STEPnode * n;
if( _headerInstances == NULL ) {
return NULL;
return schName;
}
fs = ( SdaiFile_schema * )_headerInstances->GetApplication_instance( "File_Schema" );
if( fs == ENTITY_NULL ) {
return NULL;
return schName;
}
n = ( STEPnode * )fs->schema_identifiers_()->GetHead();
// (take the first one)
if( n == NULL ) {
return NULL;
return schName;
}
n->STEPwrite( tmp );
if( *tmp.c_str() == '\0' || *tmp.c_str() == '$' ) {
return NULL;
n->STEPwrite( schName );
if( schName.empty() || schName[0] == '$' ) {
schName.clear();
return schName;
} else if( schName[0] == '\0' ) {
//probably never - it seems that putting null in std::string takes effort
_error.AppendToUserMsg( "In STEPfile::schemaName: schName contains \\0 - it should be empty." );
_error.GreaterSeverity( SEVERITY_WARNING );
schName.clear();
return schName;
}
// tmp.c_str() returns the string we want plus a beginning and ending
// quote mark ('). We remove these below.
strncpy( schName, tmp.c_str() + 1, BUFSIZ - 1 );
// "+1" to remove beginning '.
if( *( schName + strlen( schName ) - 1 ) == '\'' ) {
// Remove trailing '. This condition checks that it wasn't removed
// already. That may have happend if strncpy had truncated schName
// (it were >= BUFSIZ).
*( schName + strlen( schName ) - 1 ) = '\0';
if( schName[ schName.length() - 1 ] == '\'' ) {
schName = schName.substr( 1, schName.length() - 2 );
} else {
_error.AppendToUserMsg( "In STEPfile::schemaName: schName was truncated." );
_error.GreaterSeverity( SEVERITY_WARNING );
schName = schName.substr( 1, schName.length() - 1 );
}
return schName;
}
File diff suppressed because it is too large Load Diff
+139 -114
View File
@@ -4,6 +4,7 @@
// it since your modifications will be lost if fedex_plus is used to
// regenerate it.
#include <scl_export.h>
#include <sdai.h>
#include <Registry.h>
#include <STEPaggregate.h>
@@ -12,241 +13,265 @@
///////// ENTITY section_language
extern AttrDescriptor *a_0section;
extern AttrDescriptor *a_1default_language;
extern SCL_EDITOR_EXPORT AttrDescriptor * a_0section;
extern SCL_EDITOR_EXPORT AttrDescriptor * a_1default_language;
class SdaiSection_language : public SCLP23(Application_instance) {
protected:
SCLP23(String) _section ; // OPTIONAL
SCLP23(String) _default_language ;
public:
class SCL_EDITOR_EXPORT SdaiSection_language : public SDAI_Application_instance {
protected:
SDAI_String _section ; // OPTIONAL
SDAI_String _default_language ;
public:
SdaiSection_language ( );
SdaiSection_language (SCLP23(Application_instance) *se, int *addAttrs = 0);
SdaiSection_language (SdaiSection_language& e );
~SdaiSection_language ();
SdaiSection_language( );
SdaiSection_language( SDAI_Application_instance * se, int * addAttrs = 0 );
SdaiSection_language( SdaiSection_language & e );
~SdaiSection_language();
int opcode () { return 0 ; }
int opcode() {
return 0 ;
}
const SdaiSection_name section_() const;
void section_ (const SdaiSection_name x);
void section_( const SdaiSection_name x );
const SdaiLanguage_name default_language_() const;
void default_language_ (const SdaiLanguage_name x);
void default_language_( const SdaiLanguage_name x );
};
inline SdaiSection_language *
create_SdaiSection_language () { return new SdaiSection_language ; }
create_SdaiSection_language() {
return new SdaiSection_language ;
}
///////// END_ENTITY section_language
///////// ENTITY file_population
extern AttrDescriptor *a_2governing_schema;
extern AttrDescriptor *a_3determination_method;
extern AttrDescriptor *a_4governed_sections;
extern SCL_EDITOR_EXPORT AttrDescriptor * a_2governing_schema;
extern SCL_EDITOR_EXPORT AttrDescriptor * a_3determination_method;
extern SCL_EDITOR_EXPORT AttrDescriptor * a_4governed_sections;
class SdaiFile_population : public SCLP23(Application_instance) {
protected:
SCLP23(String) _governing_schema ;
SCLP23(String) _determination_method ;
class SCL_EDITOR_EXPORT SdaiFile_population : public SDAI_Application_instance {
protected:
SDAI_String _governing_schema ;
SDAI_String _determination_method ;
StringAggregate _governed_sections ; // OPTIONAL // of section_name
public:
public:
SdaiFile_population ( );
SdaiFile_population (SCLP23(Application_instance) *se, int *addAttrs = 0);
SdaiFile_population (SdaiFile_population& e );
~SdaiFile_population ();
SdaiFile_population( );
SdaiFile_population( SDAI_Application_instance * se, int * addAttrs = 0 );
SdaiFile_population( SdaiFile_population & e );
~SdaiFile_population();
int opcode () { return 1 ; }
int opcode() {
return 1 ;
}
const SdaiSchema_name governing_schema_() const;
void governing_schema_ (const SdaiSchema_name x);
void governing_schema_( const SdaiSchema_name x );
const SdaiExchange_structure_identifier determination_method_() const;
void determination_method_ (const SdaiExchange_structure_identifier x);
void determination_method_( const SdaiExchange_structure_identifier x );
const StringAggregate_ptr governed_sections_() const;
void governed_sections_ (const StringAggregate_ptr x);
void governed_sections_( const StringAggregate_ptr x );
};
inline SdaiFile_population *
create_SdaiFile_population () { return new SdaiFile_population ; }
create_SdaiFile_population() {
return new SdaiFile_population ;
}
///////// END_ENTITY file_population
///////// ENTITY file_name
extern AttrDescriptor *a_5name;
extern AttrDescriptor *a_6time_stamp;
extern AttrDescriptor *a_7author;
extern AttrDescriptor *a_8organization;
extern AttrDescriptor *a_9preprocessor_version;
extern AttrDescriptor *a_10originating_system;
extern AttrDescriptor *a_11authorization;
extern AttrDescriptor * a_5name;
extern AttrDescriptor * a_6time_stamp;
extern AttrDescriptor * a_7author;
extern AttrDescriptor * a_8organization;
extern AttrDescriptor * a_9preprocessor_version;
extern AttrDescriptor * a_10originating_system;
extern AttrDescriptor * a_11authorization;
class SdaiFile_name : public SCLP23(Application_instance) {
protected:
SCLP23(String) _name ;
SCLP23(String) _time_stamp ;
class SCL_EDITOR_EXPORT SdaiFile_name : public SDAI_Application_instance {
protected:
SDAI_String _name ;
SDAI_String _time_stamp ;
StringAggregate _author ;
StringAggregate _organization ;
SCLP23(String) _preprocessor_version ;
SCLP23(String) _originating_system ;
SCLP23(String) _authorization ;
public:
SDAI_String _preprocessor_version ;
SDAI_String _originating_system ;
SDAI_String _authorization ;
public:
SdaiFile_name ( );
SdaiFile_name (SCLP23(Application_instance) *se, int *addAttrs = 0);
SdaiFile_name (SdaiFile_name& e );
~SdaiFile_name ();
SdaiFile_name( );
SdaiFile_name( SDAI_Application_instance * se, int * addAttrs = 0 );
SdaiFile_name( SdaiFile_name & e );
~SdaiFile_name();
int opcode () { return 2 ; }
const SCLP23(String) name_() const;
void name_ (const SCLP23(String) x);
int opcode() {
return 2 ;
}
const SDAI_String name_() const;
void name_( const SDAI_String x );
const SdaiTime_stamp_text time_stamp_() const;
void time_stamp_ (const SdaiTime_stamp_text x);
void time_stamp_( const SdaiTime_stamp_text x );
const StringAggregate_ptr author_() const;
void author_ (const StringAggregate_ptr x);
void author_( const StringAggregate_ptr x );
const StringAggregate_ptr organization_() const;
void organization_ (const StringAggregate_ptr x);
void organization_( const StringAggregate_ptr x );
const SCLP23(String) preprocessor_version_() const;
void preprocessor_version_ (const SCLP23(String) x);
const SDAI_String preprocessor_version_() const;
void preprocessor_version_( const SDAI_String x );
const SCLP23(String) originating_system_() const;
void originating_system_ (const SCLP23(String) x);
const SDAI_String originating_system_() const;
void originating_system_( const SDAI_String x );
const SCLP23(String) authorization_() const;
void authorization_ (const SCLP23(String) x);
const SDAI_String authorization_() const;
void authorization_( const SDAI_String x );
};
inline SdaiFile_name *
create_SdaiFile_name () { return new SdaiFile_name ; }
create_SdaiFile_name() {
return new SdaiFile_name ;
}
///////// END_ENTITY file_name
///////// ENTITY section_context
extern AttrDescriptor *a_12section;
extern AttrDescriptor *a_13context_identifiers;
extern SCL_EDITOR_EXPORT AttrDescriptor * a_12section;
extern SCL_EDITOR_EXPORT AttrDescriptor * a_13context_identifiers;
class SdaiSection_context : public SCLP23(Application_instance) {
protected:
SCLP23(String) _section ; // OPTIONAL
class SCL_EDITOR_EXPORT SdaiSection_context : public SDAI_Application_instance {
protected:
SDAI_String _section ; // OPTIONAL
StringAggregate _context_identifiers ; // of context_name
public:
public:
SdaiSection_context ( );
SdaiSection_context (SCLP23(Application_instance) *se, int *addAttrs = 0);
SdaiSection_context (SdaiSection_context& e );
~SdaiSection_context ();
SdaiSection_context( );
SdaiSection_context( SDAI_Application_instance * se, int * addAttrs = 0 );
SdaiSection_context( SdaiSection_context & e );
~SdaiSection_context();
int opcode () { return 3 ; }
int opcode() {
return 3 ;
}
const SdaiSection_name section_() const;
void section_ (const SdaiSection_name x);
void section_( const SdaiSection_name x );
const StringAggregate_ptr context_identifiers_() const;
void context_identifiers_ (const StringAggregate_ptr x);
void context_identifiers_( const StringAggregate_ptr x );
};
inline SdaiSection_context *
create_SdaiSection_context () { return new SdaiSection_context ; }
create_SdaiSection_context() {
return new SdaiSection_context ;
}
///////// END_ENTITY section_context
///////// ENTITY file_description
extern AttrDescriptor *a_14description;
extern AttrDescriptor *a_15implementation_level;
extern SCL_EDITOR_EXPORT AttrDescriptor * a_14description;
extern SCL_EDITOR_EXPORT AttrDescriptor * a_15implementation_level;
class SdaiFile_description : public SCLP23(Application_instance) {
protected:
class SCL_EDITOR_EXPORT SdaiFile_description : public SDAI_Application_instance {
protected:
StringAggregate _description ;
SCLP23(String) _implementation_level ;
public:
SDAI_String _implementation_level ;
public:
SdaiFile_description ( );
SdaiFile_description (SCLP23(Application_instance) *se, int *addAttrs = 0);
SdaiFile_description (SdaiFile_description& e );
~SdaiFile_description ();
SdaiFile_description( );
SdaiFile_description( SDAI_Application_instance * se, int * addAttrs = 0 );
SdaiFile_description( SdaiFile_description & e );
~SdaiFile_description();
int opcode () { return 4 ; }
int opcode() {
return 4 ;
}
const StringAggregate_ptr description_() const;
void description_ (const StringAggregate_ptr x);
void description_( const StringAggregate_ptr x );
const SCLP23(String) implementation_level_() const;
void implementation_level_ (const SCLP23(String) x);
const SDAI_String implementation_level_() const;
void implementation_level_( const SDAI_String x );
};
inline SdaiFile_description *
create_SdaiFile_description () { return new SdaiFile_description ; }
create_SdaiFile_description() {
return new SdaiFile_description ;
}
///////// END_ENTITY file_description
///////// ENTITY file_schema
extern AttrDescriptor *a_16schema_identifiers;
extern SCL_EDITOR_EXPORT AttrDescriptor * a_16schema_identifiers;
class SdaiFile_schema : public SCLP23(Application_instance) {
protected:
class SCL_EDITOR_EXPORT SdaiFile_schema : public SDAI_Application_instance {
protected:
StringAggregate _schema_identifiers ; // of schema_name
public:
public:
SdaiFile_schema ( );
SdaiFile_schema (SCLP23(Application_instance) *se, int *addAttrs = 0);
SdaiFile_schema (SdaiFile_schema& e );
~SdaiFile_schema ();
SdaiFile_schema( );
SdaiFile_schema( SDAI_Application_instance * se, int * addAttrs = 0 );
SdaiFile_schema( SdaiFile_schema & e );
~SdaiFile_schema();
int opcode () { return 5 ; }
int opcode() {
return 5 ;
}
const StringAggregate_ptr schema_identifiers_() const;
void schema_identifiers_ (const StringAggregate_ptr x);
void schema_identifiers_( const StringAggregate_ptr x );
};
inline SdaiFile_schema *
create_SdaiFile_schema () { return new SdaiFile_schema ; }
create_SdaiFile_schema() {
return new SdaiFile_schema ;
}
///////// END_ENTITY file_schema
// ***** generate Model related pieces
class SdaiModel_contents_header_section_schema : public SCLP23(Model_contents) {
class SCL_EDITOR_EXPORT SdaiModel_contents_header_section_schema : public SDAI_Model_contents {
public:
SdaiModel_contents_header_section_schema();
public:
SdaiModel_contents_header_section_schema();
SdaiSection_language__set_var SdaiSection_language_get_extents();
SdaiSection_language__set_var SdaiSection_language_get_extents();
SdaiFile_population__set_var SdaiFile_population_get_extents();
SdaiFile_population__set_var SdaiFile_population_get_extents();
SdaiFile_name__set_var SdaiFile_name_get_extents();
SdaiFile_name__set_var SdaiFile_name_get_extents();
SdaiSection_context__set_var SdaiSection_context_get_extents();
SdaiSection_context__set_var SdaiSection_context_get_extents();
SdaiFile_description__set_var SdaiFile_description_get_extents();
SdaiFile_description__set_var SdaiFile_description_get_extents();
SdaiFile_schema__set_var SdaiFile_schema_get_extents();
SdaiFile_schema__set_var SdaiFile_schema_get_extents();
};
typedef SdaiModel_contents_header_section_schema * SdaiModel_contents_header_section_schema_ptr;
typedef SdaiModel_contents_header_section_schema_ptr SdaiModel_contents_header_section_schema_var;
SCLP23(Model_contents_ptr) create_SdaiModel_contents_header_section_schema();
SCL_EDITOR_EXPORT SDAI_Model_contents_ptr create_SdaiModel_contents_header_section_schema();
#endif

Some files were not shown because too many files have changed in this diff Show More