Compare commits

..
Author SHA1 Message Date
Mark Pictor f148fc7c34 add files to test binary indexing - incomplete 2012-02-18 20:38:39 -05:00
Mark Pictor 6e4fcafbc3 fix bug with binary values not being saved to disk
For SDAI_Binary, STEPattribute::is_null() cleared the value instead of
merely reporting whether it was null, like it does with other types.
2012-02-18 20:38:39 -05:00
233 changed files with 125001 additions and 155495 deletions
-1
View File
@@ -13,7 +13,6 @@ Morrison, Christopher Sean (sean, morrison, brlcad)
Paviot, Thomas (tpaviot)
Pictor, Mark (mpictor)
Thomas, Dawn (homovulgaris, madant)
Wouters, Dave (davyw)
Yapp, Clifford (starseeker)
Special thanks:
+105 -195
View File
@@ -38,61 +38,36 @@
# This file contains the top level CMakeLists.txt logic for the
# SCL software package.
PROJECT(SCL)
# SCL version
SET(SCL_VERSION_MAJOR 0)
SET(SCL_VERSION_MINOR 5-dev)
SET(SCL_VERSION ${SCL_VERSION_MAJOR}.${SCL_VERSION_MINOR})
# SCL ABI version. SCL_ABI_SOVERSION should be incremented
# for each release introducing API incompatibilities
SET(SCL_ABI_SOVERSION 2)
SET(SCL_ABI_VERSION ${SCL_ABI_SOVERSION}.0.0)
# Minimum required version of CMake
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
IF(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0003 NEW)
CMAKE_POLICY(SET CMP0003 NEW)
ENDIF(COMMAND CMAKE_POLICY)
IF( NOT DEFINED SCL_BUILD_TYPE )
SET( SCL_BUILD_TYPE "Debug" CACHE STRING "Build type" ) # By default set debug build
ENDIF( NOT DEFINED SCL_BUILD_TYPE )
IF(NOT SCL_IS_SUBBUILD)
SET(CMAKE_BUILD_TYPE ${SCL_BUILD_TYPE} CACHE INTERNAL "Build type, immutable" FORCE )
ELSE(NOT SCL_IS_SUBBUILD)
SET(CMAKE_BUILD_TYPE ${SCL_BUILD_TYPE} )
ENDIF(NOT SCL_IS_SUBBUILD)
# set CMake project name
PROJECT(SCL)
# Define helper macro OPTION_WITH_DEFAULT
MACRO( OPTION_WITH_DEFAULT OPTION_NAME OPTION_STRING OPTION_DEFAULT )
IF( NOT DEFINED ${OPTION_NAME} )
SET( ${OPTION_NAME} ${OPTION_DEFAULT} )
ENDIF( NOT DEFINED ${OPTION_NAME} )
OPTION( ${OPTION_NAME} "${OPTION_STRING}" ${${OPTION_NAME}} )
ENDMACRO( OPTION_WITH_DEFAULT OPTION_NAME OPTION_STRING OPTION_DEFAULT )
if( CMAKE_BUILD_TYPE STREQUAL "" )
message( "-- Debug build - to override, rerun cmake with '-DCMAKE_BUILD_TYPE=Release'." )
set( CMAKE_BUILD_TYPE Debug )
endif()
# build shared libs by default
OPTION_WITH_DEFAULT(SCL_BUILD_SHARED_LIBS "Build shared libs" ON )
OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON)
# don't build static libs by default
OPTION_WITH_DEFAULT(SCL_BUILD_STATIC_LIBS "Build static libs" OFF)
# build static libs by default
OPTION(BUILD_STATIC_LIBS "Build static libraries" OFF)
OPTION_WITH_DEFAULT(SCL_PYTHON_GENERATOR "Compile fedex_python" ON)
OPTION_WITH_DEFAULT(SCL_CPP_GENERATOR "Compile fedex_plus" ON)
OPTION_WITH_DEFAULT(SCL_MEMMGR_ENABLE_CHECKS "Enable scl_memmgr's memory leak detection" OFF)
OPTION_WITH_DEFAULT(SCL_TRACE_FPRINTF "Enable extra comments in generated code so the code's source in fedex_plus may be located" OFF)
# Set version
SET(SCL_VERSION_MAJOR "3")
SET(SCL_VERSION_MINOR "2")
SET(SCL_VERSION_PATCH "0")
SET(SCL_VERSION "${SCL_VERSION_MAJOR}.${SCL_VERSION_MINOR}.${SCL_VERSION_PATCH}")
# CMake derives much of its functionality from modules, typically
# stored in one directory - let CMake know where to find them.
SET(SCL_CMAKE_DIR "${SCL_SOURCE_DIR}/cmake")
if(NOT IS_SUBBUILD)
SET(CMAKE_MODULE_PATH "${SCL_CMAKE_DIR};${CMAKE_MODULE_PATH}")
else(NOT IS_SUBBUILD)
SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${SCL_CMAKE_DIR}")
endif(NOT IS_SUBBUILD)
SET(CMAKE_MODULE_PATH "${SCL_CMAKE_DIR};${CMAKE_MODULE_PATH}")
INCLUDE(${SCL_CMAKE_DIR}/SCL_Utils.cmake)
@@ -102,89 +77,91 @@ SET(_orig_lc_all $ENV{LC_ALL})
SET(_orig_lc_messages $ENV{LC_MESSAGES})
SET(_orig_lang $ENV{LANG})
IF(_orig_lc_all)
SET(ENV{LC_ALL} C)
SET(ENV{LC_ALL} C)
ENDIF(_orig_lc_all)
IF(_orig_lc_messages)
SET(ENV{LC_MESSAGES} C)
SET(ENV{LC_MESSAGES} C)
ENDIF(_orig_lc_messages)
IF(_orig_lang)
SET(ENV{LANG} C)
SET(ENV{LANG} C)
ENDIF(_orig_lang)
# For NFS volumes, to ensure proper file creation.
IF(NOT WIN32)
IF(NOT UMASK)
EXEC_PROGRAM(umask ARGS 022 OUTPUT_VARIABLE exec_out)
ELSE(NOT UMASK)
EXEC_PROGRAM(umask ARGS ${UMASK} OUTPUT_VARIABLE exec_out)
ENDIF(NOT UMASK)
ENDIF(NOT WIN32)
#---------------------------------------------------------------------
# Testing option
OPTION_WITH_DEFAULT( SCL_ENABLE_TESTING "Enable unittesting framework" OFF )
IF(SCL_ENABLE_TESTING)
if( NOT DEFINED SCL_BUILD_SCHEMAS )
set( SCL_BUILD_SCHEMAS "ALL" ) #test all schemas, unless otherwise specified
endif()
INCLUDE(CTest)
ENABLE_TESTING()
ENDIF(SCL_ENABLE_TESTING)
OPTION( ENABLE_TESTING "Enable unittesting framework" OFF )
IF(ENABLE_TESTING)
set( CMAKE_EXE_LINKER_FLAGS "-fprofile-arcs -ftest-coverage" ) #for code coverage
set( CMAKE_SHARED_LINKER_FLAGS "-fprofile-arcs -ftest-coverage" )
if( NOT DEFINED BUILD_SCHEMAS )
set( BUILD_SCHEMAS "ALL" ) #test all schemas, unless otherwise specified
endif()
INCLUDE(CTest)
ENABLE_TESTING()
ENDIF(ENABLE_TESTING)
#---------------------------------------------------------------------
# Coverage option
OPTION_WITH_DEFAULT( SCL_ENABLE_COVERAGE "Enable code coverage test" OFF )
IF(SCL_ENABLE_COVERAGE)
SET(SCL_ENABLE_TESTING ON CACHE BOOL "Testing enabled by coverage option" FORCE)
# build static libs, better coverage report
SET(SCL_BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE )
SET(SCL_BUILD_STATIC_LIBS ON CACHE BOOL "Build static libs" FORCE )
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -fprofile-arcs -ftest-coverage" CACHE STRING "Extra compile flags required by code coverage" FORCE)
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -fprofile-arcs -ftest-coverage" CACHE STRING "Extra compile flags required by code coverage" FORCE)
SET(CMAKE_MODULE_LINKER_FLAGS_DEBUG "-fprofile-arcs -ftest-coverage" CACHE STRING "Extra linker flags required by code coverage" FORCE)
SET(SCL_BUILD_TYPE "Debug" CACHE STRING "Build type required by testing framework" FORCE)
ENDIF(SCL_ENABLE_COVERAGE)
#---------------------------------------------------------------------
# The following logic is what allows binaries to run successfully in
# the build directory AND install directory. Thanks to plplot for
# The following logic is what allows binaries to run successfully in
# the build directory AND install directory. Thanks to plplot for
# identifying the necessity of setting CMAKE_INSTALL_NAME_DIR on OSX.
# Documentation of these options is available at
# http://www.cmake.org/Wiki/CMake_RPATH_handling
# use, i.e. don't skip the full RPATH for the build tree
set(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already
# (but later on when installing)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
# the RPATH/INSTALL_NAME_DIR to be used when installing
if (NOT APPLE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:\$ORIGIN/../lib")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif(NOT APPLE)
# On OSX, we need to set INSTALL_NAME_DIR instead of RPATH
# http://www.cmake.org/cmake/help/cmake-2-8-docs.html#variable:CMAKE_INSTALL_NAME_DIR
set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
SET(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
# add the automatically determined parts of the RPATH which point to
# add the automatically determined parts of the RPATH which point to
# directories outside the build tree to the install RPATH
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
#-----------------------------------------------------------------------------
# Output directories.
IF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
IF(WIN32)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all libraries.")
ELSE(WIN32)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
ENDIF(WIN32)
ENDIF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
IF(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
ENDIF(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
IF(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
ENDIF(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
FOREACH(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
STRING(TOUPPER "${CFG_TYPE}" CFG_TYPE)
IF(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
SET("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
ENDIF(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
IF(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
SET("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
ENDIF(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
IF(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
SET("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
ENDIF(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
STRING(TOUPPER "${CFG_TYPE}" CFG_TYPE)
IF(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
IF(WIN32)
SET("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all libraries.")
ELSE(WIN32)
SET("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
ENDIF(WIN32)
ENDIF(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
IF(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
SET("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
ENDIF(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
IF(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
SET("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
ENDIF(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
ENDFOREACH()
@@ -194,46 +171,33 @@ ENDFOREACH()
# The location in which to install SCL. Need a good Debug location
# for Windows. Only do this if CMAKE_INSTALL_PREFIX hasn't been set
# already, to try and allow parent builds (if any) some control.
if(NOT SCL_IS_SUBBUILD)
IF(NOT WIN32)
IF (${CMAKE_BUILD_TYPE} MATCHES "Debug")
SET(SCL_INSTALL_PREFIX "${SCL_SOURCE_DIR}/../scl-install")
ELSE()
SET(SCL_INSTALL_PREFIX "/usr/local")
ENDIF()
ENDIF(NOT WIN32)
SET( SCL_INSTALL_PREFIX ${SCL_INSTALL_PREFIX} CACHE
PATH "Install prefix prepended to target to create install location" )
SET( CMAKE_INSTALL_PREFIX ${SCL_INSTALL_PREFIX} CACHE INTERNAL "Prefix prepended to install directories if target destination is not absolute, immutable" FORCE )
endif(NOT SCL_IS_SUBBUILD)
IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
IF(NOT WIN32)
IF ("${CMAKE_BUILD_TYPE}" MATCHES "Release")
SET(CMAKE_INSTALL_PREFIX "/usr")
ELSEIF ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
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")
ENDIF(NOT WIN32)
SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE STRING "SCL install prefix" FORCE)
SET(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 0)
ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
OPTION(SCL_BUILD_EXPRESS_ONLY "Only build express parser." OFF)
MARK_AS_ADVANCED(SCL_BUILD_EXPRESS_ONLY)
OPTION(SCL-BUILD_EXPRESS_ONLY "Only build express parser." OFF)
MARK_AS_ADVANCED(SCL-BUILD_EXPRESS_ONLY)
# Take the scl config file template as the starting point for
# scl_cf.h.in - scripts may need to append to the template, so
# it is read into memory initially.
# Take the scl config file template and copy it to the build directory so CMake
# scripts can append to it if need be
configure_file(${SCL_SOURCE_DIR}/include/scl_cf_cmake.h.in ${SCL_BINARY_DIR}/include/scl_cf.h.in COPYONLY)
SET(CONFIG_H_FILE ${SCL_BINARY_DIR}/include/scl_cf.h.in)
set(CMAKE_CURRENT_PROJECT SCL)
define_property(GLOBAL PROPERTY SCL_CONFIG_H_CONTENTS BRIEF_DOCS "config.h.in contents" FULL_DOCS "config.h.in contents for SCL project")
if(NOT COMMAND CONFIG_H_APPEND)
macro(CONFIG_H_APPEND PROJECT_NAME NEW_CONTENTS)
if(PROJECT_NAME)
get_property(${PROJECT_NAME}_CONFIG_H_CONTENTS GLOBAL PROPERTY ${PROJECT_NAME}_CONFIG_H_CONTENTS)
set(${PROJECT_NAME}_CONFIG_H_FILE_CONTENTS "${${PROJECT_NAME}_CONFIG_H_CONTENTS}${NEW_CONTENTS}")
set_property(GLOBAL PROPERTY ${PROJECT_NAME}_CONFIG_H_CONTENTS "${${PROJECT_NAME}_CONFIG_H_FILE_CONTENTS}")
endif(PROJECT_NAME)
endmacro(CONFIG_H_APPEND NEW_CONTENTS)
endif(NOT COMMAND CONFIG_H_APPEND)
file(READ ${SCL_SOURCE_DIR}/include/scl_cf_cmake.h.in CONFIG_H_FILE_CONTENTS)
CONFIG_H_APPEND(SCL "${CONFIG_H_FILE_CONTENTS}")
INCLUDE(CheckLibraryExists)
INCLUDE(CheckIncludeFile)
INCLUDE(CheckFunctionExists)
INCLUDE(CheckTypeSize)
INCLUDE(CMakePushCheckState)
INCLUDE(CheckCXXSourceRuns)
INCLUDE(${SCL_CMAKE_DIR}/FindLEX.cmake)
INCLUDE(${SCL_CMAKE_DIR}/FindYACC.cmake)
@@ -255,110 +219,56 @@ CHECK_FUNCTION_EXISTS(getopt HAVE_GETOPT)
CHECK_TYPE_SIZE("ssize_t" SSIZE_T)
set( TEST_STD_THREAD "
#include <iostream>
#include <thread>
void do_work() {
std::cout << \"thread\" << std::endl;
}
int main() {
std::thread t(do_work);
t.join();
}
" )
cmake_push_check_state()
if( UNIX )
set( CMAKE_REQUIRED_FLAGS "-pthread -std=c++0x" )
else( UNIX )
# vars probably need set for MSVC11, embarcadero, etc
endif( UNIX )
CHECK_CXX_SOURCE_RUNS( "${TEST_STD_THREAD}" HAVE_STD_THREAD ) #quotes are *required*!
cmake_pop_check_state()
# Now that all the tests are done, configure the scl_cf.h file:
get_property(CONFIG_H_FILE_CONTENTS GLOBAL PROPERTY SCL_CONFIG_H_CONTENTS)
file(WRITE ${CONFIG_H_FILE} "${CONFIG_H_FILE_CONTENTS}")
configure_file(${CONFIG_H_FILE} ${SCL_BINARY_DIR}/include/scl_cf.h)
configure_file(${SCL_BINARY_DIR}/include/scl_cf.h.in ${SCL_BINARY_DIR}/include/scl_cf.h)
################ 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.
configure_file(${SCL_CMAKE_DIR}/scl_version_string.cmake ${SCL_BINARY_DIR}/scl_version_string.cmake @ONLY)
add_custom_target(version_string ALL DEPENDS ver_string )
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_BINARY_DIR}/scl_version_string.cmake)
-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 )
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 )
# 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__ )
add_definitions( -D__BORLAND__ -D__WIN32__ )
else()
add_definitions( -pedantic -W -Wall -Wundef -Wfloat-equal -Wshadow -Winline -Wno-long-long )
add_definitions( -pedantic -W -Wall -Wundef -Wfloat-equal -Wshadow -Winline -Wno-long-long )
endif()
include_directories(
${SCL_SOURCE_DIR}/include
${SCL_BINARY_DIR}/include
)
${SCL_SOURCE_DIR}/include
${SCL_BINARY_DIR}/include
)
ADD_SUBDIRECTORY(src/base)
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(SCL_ENABLE_TESTING)
ADD_SUBDIRECTORY( test )
ENDIF(SCL_ENABLE_TESTING)
IF(ENABLE_TESTING)
ADD_SUBDIRECTORY( test )
ENDIF(ENABLE_TESTING)
ADD_SUBDIRECTORY(doc)
# this is for testing - 'make core' builds everything that isn't generated
add_custom_target( core )
add_dependencies( core stepdai check-express stepeditor fedex_plus )
if(NOT SCL_IS_SUBBUILD)
###############################################################################
# SCL Packaging #
# $make package #
###############################################################################
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "STEP Class Library")
SET(CPACK_SET_DESTDIR "ON")
SET(CPACK_PACKAGE_VERSION_MAJOR ${SCL_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${SCL_VERSION_MINOR})
SET(CPACK_PACKAGE_NAME SCL )
SET(CPACK_PACKAGE_CONTACT "SCL Developers <scl-dev@googlegroups.com>")
INCLUDE(CPack)
########################################################################################
# Uninstall code #
# From http://www.cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F #
# ######################################################################################
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif(NOT SCL_IS_SUBBUILD)
+7 -30
View File
@@ -6,7 +6,7 @@ STEP Class Library.
These installation requires that you have the following software
available:
- C and C++ compilers (Tested with GCC, MSVC, Embarcadero)
- C and C++ compilers (only gcc has been tested recently)
- bison, byacc, or yacc (only bison has been tested recently)
- flex or lex (only flex has been tested recently)
- CMake
@@ -21,22 +21,12 @@ Installation
* Build system uses CMake now: configure, Makefile, and all
autotools files have been removed, as has mkProbe.
* 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
* 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"
@@ -55,16 +45,3 @@ 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`
-18
View File
@@ -1,23 +1,5 @@
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:
+36 -5
View File
@@ -1,10 +1,12 @@
***********************************************************************
Step Class Library v0.5 -- http://github.com/mpictor/StepClassLibrary
Step Class Library v0.4 -- 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. In addition to C++, v0.5 includes experimental
support for Python.
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.
* SCL is packaged along with some other tools. See
"THE NIST STEP TOOLSET", below. In particular, Data Probe
@@ -19,7 +21,36 @@ Step Class Library v0.5 -- http://github.com/mpictor/StepClassLibrary
* Build system uses only CMake now: configure, Makefile, and all
autotools files have been removed, as has mkProbe.
* Building and testing SCL - see the INSTALL file
* 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`
***********************************************************************
+1 -1
View File
@@ -1 +1 @@
0.5
0.4
+3
View File
@@ -151,6 +151,9 @@ IF(LEX_EXECUTABLE)
SET(FILE_RUN_DEFINITIONS "-DYYTEXT_POINTER=1")
CHECK_C_FILE_RUNS(${CMAKE_CURRENT_SOURCE_DIR}/cmake/test_srcs/sys_wait_test.c YYTEXT_POINTER)
SET(FILE_RUN_DEFINITIONS)
IF(CONFIG_H_FILE)
FILE(APPEND ${CONFIG_H_FILE} "#cmakedefine YYTEXT_POINTER 1\n")
ENDIF(CONFIG_H_FILE)
ENDIF(LEX_EXECUTABLE)
+5 -5
View File
@@ -33,15 +33,15 @@ MACRO(SCL_ADDLIB libname srcs libs)
STRING(REGEX REPLACE " " ";" libslist1 "${libs}")
STRING(REGEX REPLACE "-framework;" "-framework " libslist "${libslist1}")
DLL_DEFINE(${libname})
IF(SCL_BUILD_SHARED_LIBS)
IF(BUILD_SHARED_LIBS)
add_library(${libname} SHARED ${srcslist})
if(NOT ${libs} MATCHES "NONE")
target_link_libraries(${libname} ${libslist})
endif(NOT ${libs} MATCHES "NONE")
SET_TARGET_PROPERTIES(${libname} PROPERTIES VERSION ${SCL_ABI_VERSION} SOVERSION ${SCL_ABI_SOVERSION} )
SET_TARGET_PROPERTIES(${libname} PROPERTIES VERSION ${SCL_VERSION_MAJOR}.${SCL_VERSION_MINOR} SOVERSION ${SCL_VERSION_MAJOR} )
INSTALL(TARGETS ${libname} DESTINATION lib)
ENDIF(SCL_BUILD_SHARED_LIBS)
IF(SCL_BUILD_STATIC_LIBS AND NOT MSVC)
ENDIF(BUILD_SHARED_LIBS)
IF(BUILD_STATIC_LIBS AND NOT MSVC)
add_library(${libname}-static STATIC ${srcslist})
if(NOT ${libs} MATCHES "NONE")
target_link_libraries(${libname}-static ${libslist})
@@ -56,7 +56,7 @@ MACRO(SCL_ADDLIB libname srcs libs)
SET_TARGET_PROPERTIES(${libname}-static PROPERTIES PREFIX "lib")
ENDIF(WIN32)
INSTALL(TARGETS ${libname}-static DESTINATION lib)
ENDIF(SCL_BUILD_STATIC_LIBS AND NOT MSVC)
ENDIF(BUILD_STATIC_LIBS AND NOT MSVC)
# Enable extra compiler flags if local libraries and/or global options dictate
SET(LOCAL_COMPILE_FLAGS "")
FOREACH(extraarg ${ARGN})
-22
View File
@@ -1,22 +0,0 @@
if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
list(REVERSE files)
foreach (file ${files})
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
if (EXISTS "$ENV{DESTDIR}${file}")
execute_process(
COMMAND ${CMAKE_COMMAND} -E remove "$ENV{DESTDIR}${file}"
OUTPUT_VARIABLE rm_out
RESULT_VARIABLE rm_retval
)
if(NOT ${rm_retval} EQUAL 0)
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
endif (NOT ${rm_retval} EQUAL 0)
else (EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
endif (EXISTS "$ENV{DESTDIR}${file}")
endforeach(file)
+7 -17
View File
@@ -7,8 +7,6 @@
#scl_version_string.h defines scl_version() which returns a pretty commit description and a build timestamp.
set(SCL_IS_SUBBUILD "@SCL_IS_SUBBUILD@")
set(VERS_FILE ${SOURCE_DIR}/SCL_VERSION.txt )
if( EXISTS ${SOURCE_DIR}/.git )
find_package(Git QUIET)
@@ -16,21 +14,15 @@ if( EXISTS ${SOURCE_DIR}/.git )
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 )
if(NOT SCL_IS_SUBBUILD)
message( WARNING "Git failed (probably no tags in repo). Build will contain revision info from ${VERS_FILE}." )
endif(NOT SCL_IS_SUBBUILD)
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 )
if(NOT SCL_IS_SUBBUILD)
message( WARNING "Git not found. Build will contain revision info from ${VERS_FILE}." )
endif(NOT SCL_IS_SUBBUILD)
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 )
if(NOT SCL_IS_SUBBUILD)
message( WARNING "Git failed ('.git' not found). Build will contain revision info from ${VERS_FILE}." )
endif(NOT SCL_IS_SUBBUILD)
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} )
@@ -38,10 +30,10 @@ 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 at TIME on DATE\", where test is the\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 TIME\n"
"** and DATE are substituted by the compiler.\n*/\n\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"
@@ -53,6 +45,4 @@ file(WRITE scl_version_string.h.txt ${vstring} )
# reduces needless rebuilds
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
scl_version_string.h.txt ${BINARY_DIR}/include/scl_version_string.h)
if(NOT SCL_IS_SUBBUILD)
message("-- scl_version_string.h is up-to-date.")
endif(NOT SCL_IS_SUBBUILD)
message("-- scl_version_string.h is up-to-date.")
+36 -4
View File
@@ -8,17 +8,49 @@ set( CTEST_MEMORYCHECK_COMMAND /usr/bin/valgrind )
set( CTEST_INITIAL_CACHE "
SITE:STRING=${CTEST_SITE}
BUILDNAME:STRING=${CTEST_BUILD_NAME}
SCL_ENABLE_TESTING:BOOL=ON
SCL_BUILD_TYPE:STRING=Debug
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 -DSCL_ENABLE_TESTING=ON )
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}" INCLUDE_LABEL "cpp_schema_....*" )
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
+9 -13
View File
@@ -2,13 +2,13 @@
#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
FUNCTION( TESTABLE_TARGET target )
if(SCL_ENABLE_TESTING)
if(ENABLE_TESTING)
set_target_properties( ${target} PROPERTIES EXCLUDE_FROM_ALL ON )
endif()
ENDFUNCTION( TESTABLE_TARGET )
# To build one or more schemas, configure with
# 'cmake -DSCL_BUILD_SCHEMAS="path/to/schema.exp;path/to/schema2.exp"
# 'cmake -DBUILD_SCHEMAS="path/to/schema.exp;path/to/schema2.exp"
# This function runs fedex on one express file. The generated source goes in a dir
# in the build dir, and it is compiled into a library. A p21read executable is
@@ -51,7 +51,7 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
# multiple schemas, each one will use the include dirs from all previous schemas. Since
# one header (schema.h) is always named the same, this will not work. only workaround
# 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 -I${SCL_SOURCE_DIR}/src/base" )
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_cpp_${SCHEMA_SHORT_NAME} SOURCES ${FEDEX_OUT} )
add_custom_command( OUTPUT ${SCHEMA_OUTPUT_DIR}
@@ -65,21 +65,17 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
VERBATIM )
if(MSVC OR BORLAND)
add_definitions( -DSCL_SCHEMA_DLL_EXPORTS )
add_definitions( -DSCL_BASE_DLL_IMPORTS )
add_definitions( -DSCL_EXPRESS_DLL_IMPORTS )
add_definitions( -DSCL_UTILS_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 steputils base )
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_cpp_${SCHEMA_SHORT_NAME}
@@ -121,11 +117,11 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
ENDFUNCTION(BUILD_A_SCHEMA)
if( DEFINED SCL_BUILD_SCHEMAS )
if( SCL_BUILD_SCHEMAS STREQUAL "ALL" )
file( GLOB_RECURSE SCL_BUILD_SCHEMAS ${SCL_SOURCE_DIR}/data/*.exp )
if( DEFINED BUILD_SCHEMAS )
if( BUILD_SCHEMAS STREQUAL "ALL" )
file( GLOB_RECURSE BUILD_SCHEMAS ${SCL_SOURCE_DIR}/data/*.exp )
endif()
foreach( ap ${SCL_BUILD_SCHEMAS} )
foreach( ap ${BUILD_SCHEMAS} )
BUILD_A_SCHEMA( ${ap} )
endforeach()
endif()
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 it is too large Load Diff
Binary file not shown.
File diff suppressed because it is too large Load Diff
+5 -12
View File
@@ -1,14 +1,7 @@
SET(scl_MANS
man/man1/dataprobe.1
man/man1/fedex.1
man/man1/fedex_plus.1
man/man1/mkProbe.1
man/man1/dataprobe.1
man/man1/fedex.1
man/man1/fedex_plus.1
man/man1/mkProbe.1
)
if(NOT DEFINED MAN_DIR)
set(MAN_DIR share/man)
endif(NOT DEFINED MAN_DIR)
IF(NOT WIN32)
INSTALL(FILES ${scl_MANS} DESTINATION ${CMAKE_INSTALL_PREFIX}/${MAN_DIR}/man1)
ENDIF(NOT WIN32)
INSTALL(FILES ${scl_MANS} DESTINATION ${MAN_DIR}/man1)
Binary file not shown.
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
Binary file not shown.
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 it is too large Load Diff
Binary file not shown.
File diff suppressed because one or more lines are too long
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
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+6105
View File
File diff suppressed because it is too large Load Diff
-1
View File
@@ -106,7 +106,6 @@ GLOBAL SCL_EXPRESS_EXPORT char DICT_type; /**< set as a side-effect of DICT loo
/***********************/
extern SCL_EXPRESS_EXPORT void DICTinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void DICTcleanup 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 * ) );
-2
View File
@@ -184,12 +184,10 @@ static_inline void ERRORflush_messages( void ) {
extern SCL_EXPRESS_EXPORT void ERRORinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void ERRORinitialize_after_LIST PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void ERRORcleanup 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, ... ) );
extern SCL_EXPRESS_EXPORT void ERRORdestroy PROTO( ( Error ) );
struct Symbol_; /* mention Symbol to avoid warning on following line */
extern SCL_EXPRESS_EXPORT void ERRORreport_with_symbol PROTO( ( Error, struct Symbol_ *, ... ) );
-1
View File
@@ -270,7 +270,6 @@ extern SCL_EXPRESS_EXPORT Expression BIN_EXPcreate PROTO( ( Op_Code, Expressio
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 void EXPcleanup PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT Type EXPtype PROTO( ( Expression, struct Scope_ * ) );
extern SCL_EXPRESS_EXPORT int EXPget_integer_value PROTO( ( Expression ) );
-2
View File
@@ -266,10 +266,8 @@ GLOBAL SCL_EXPRESS_EXPORT char * KW_XOR INITIALLY( "XOR" );
/***********************/
extern SCL_EXPRESS_EXPORT Express EXPRESScreate PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void EXPRESSdestroy PROTO( ( Express ) );
extern SCL_EXPRESS_EXPORT void EXPRESSparse PROTO( ( Express, FILE *, char * ) );
extern SCL_EXPRESS_EXPORT void EXPRESSinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void EXPRESScleanup 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 ) );
-1
View File
@@ -135,7 +135,6 @@ GLOBAL SCL_EXPRESS_EXPORT Linked_List LINK__l; /* for LISTcreate_with macro
/***********************/
extern SCL_EXPRESS_EXPORT void LISTinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void LISTcleanup 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 ) );
-1
View File
@@ -108,7 +108,6 @@ GLOBAL SCL_EXPRESS_EXPORT struct Object * OBJ;
/***********************/
extern SCL_EXPRESS_EXPORT void OBJinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void OBJcleanup 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 ) );
-9
View File
@@ -65,14 +65,6 @@ GLOBAL SCL_EXPRESS_EXPORT Error ERROR_circular_reference INITIALLY( ERROR_
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_ambiguous_attribute INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_ambiguous_group INITIALLY( ERROR_none );
/** If we're inside a conditional statement (within a function, procedure, etc)
* then this variable points to that statement. Currently the only use is to
* suppress errors when the test in an IF...ENDIF always evaluates one way.
* Set within STMTresolve().
* \sa STMTresolve
*/
GLOBAL SCL_EXPRESS_EXPORT Statement currCondStmt INITIALLY(0);
#undef GLOBAL
#undef INITIALLY
@@ -90,7 +82,6 @@ GLOBAL SCL_EXPRESS_EXPORT Statement currCondStmt INITIALLY(0);
/***********************/
extern SCL_EXPRESS_EXPORT void RESOLVEinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void RESOLVEcleanup 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 ) );
-1
View File
@@ -155,7 +155,6 @@ extern SCL_EXPRESS_EXPORT Generic SCHEMAfind PROTO( ( Schema, char * name, int
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 void SCOPEdestroy PROTO( ( Scope ) );
extern SCL_EXPRESS_EXPORT Linked_List SCHEMAget_entities_use PROTO( ( Scope ) );
extern SCL_EXPRESS_EXPORT Linked_List SCHEMAget_entities_ref PROTO( ( Scope ) );
-3
View File
@@ -235,8 +235,6 @@ GLOBAL SCL_EXPRESS_EXPORT 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_)
@@ -304,7 +302,6 @@ 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 ) );
extern SCL_EXPRESS_EXPORT void TYPEcleanup PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT bool TYPEinherits_from PROTO( ( Type, enum type_enum ) );
extern SCL_EXPRESS_EXPORT Type TYPEget_nonaggregate_base_type PROTO( ( Type ) );
-6
View File
@@ -13,10 +13,6 @@
#cmakedefine HAVE_PROCESS_H 1
#cmakedefine HAVE_IO_H 1
#cmakedefine YYTEXT_POINTER 1
#cmakedefine SCL_TRACE_FPRINTF 1
#cmakedefine SCL_MEMMGR_ENABLE_CHECKS 1
#cmakedefine HAVE_ABS 1
#cmakedefine HAVE_MEMCPY 1
#cmakedefine HAVE_MEMMOVE 1
@@ -24,6 +20,4 @@
#cmakedefine HAVE_SSIZE_T 1
#cmakedefine HAVE_STD_THREAD 1
#endif /* SCL_CF_H */
-13
View File
@@ -1,19 +1,6 @@
#ifndef SCL_EXPORT_H
#define SCL_EXPORT_H
/* Import/Export flags for base. */
#ifndef SCL_BASE_EXPORT
# if defined(SCL_BASE_DLL_EXPORTS) && defined(SCL_BASE_DLL_IMPORTS)
# error "Only SCL_BASE_DLL_EXPORTS or SCL_BASE_DLL_IMPORTS can be defined, not both."
# elif defined(SCL_BASE_DLL_EXPORTS)
# define SCL_BASE_EXPORT __declspec(dllexport)
# elif defined(SCL_BASE_DLL_IMPORTS)
# define SCL_BASE_EXPORT __declspec(dllimport)
# else
# define SCL_BASE_EXPORT
# endif
#endif
/* Import/Export flags for express. */
#ifndef SCL_EXPRESS_EXPORT
# if defined(SCL_EXPRESS_DLL_EXPORTS) && defined(SCL_EXPRESS_DLL_IMPORTS)
-229
View File
@@ -1,229 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<!--
EXPRESS syntax definition based on sql-mysql.xml by Shane Wright (me@shanewright.co.uk)
This is for Kate, the KDE editor. Rename to express.xml and place in the syntax directory (on Debian, this is /usr/share/kde4/apps/katepart/syntax )
-->
<language name="EXPRESS" version="0.1" kateversion="2.5" section="Database" extensions="*.exp;*.EXP;*.p11" mimetype="text/x-express" casesensitive="0" author="Mark Pictor (mpictor@gmail.com)" license="">
<highlighting>
<list name="keywords">
<item> of </item>
<item> or </item>
<item> to </item>
<item> where </item>
<item> subtype </item>
<item> supertype </item>
<item> abstract </item>
<item> oneof </item>
<item> not </item>
<item> in </item>
<item> and </item>
<item> return </item>
<item> then </item>
<item> derive </item>
<item> optional </item>
<!-- put SCHEMA and END_SCHEMA here so code folding will fold
everything in a schema, and not collapse the schema itself -->
<item> schema </item>
<item> end_schema </item>
</list>
<list name="kw_begin"> <!-- kw's that can begin a foldable region -->
<item> type </item>
<item> entity </item>
<item> function </item>
<item> rule </item>
<item> constant </item>
<item> if </item>
<item> local </item>
<item> repeat </item>
<item> begin </item>
<item> case </item>
</list>
<list name="kw_end"> <!-- kw's that can end a foldable region -->
<item> end </item>
<item> end_type </item>
<item> end_entity </item>
<item> end_function </item>
<item> end_rule </item>
<item> end_constant </item>
<item> end_if </item>
<item> end_local </item>
<item> end_repeat </item>
<item> end_case </item>
</list>
<list name="kw_end_begin"> <!-- end one foldable region, begin another -->
<item> else </item>
</list>
<list name="interface_specification"> <!-- USE FROM, REFERENCE FROM -->
<item> use </item>
<item> reference </item>
</list>
<list name="operators">
<item> : </item>
<item> , </item>
<item> || </item>
<item> . </item>
<item> = </item>
<item> ** </item>
<item> | </item>
<item> &lt;* </item>
<item> &gt;= </item>
<item> &gt; </item>
<item> :=: </item>
<item> :&lt;&gt;: </item>
<item> [ </item>
<item> { </item>
<item> ( </item>
<item> &lt;= </item>
<item> &lt; </item>
<item> - </item>
<item> &lt;&gt; </item>
<item> + </item>
<item> / </item>
<item> ] </item>
<item> } </item>
<item> ) </item>
<item> * </item>
<item> \\ </item>
</list>
<list name="functions">
<item> ABS </item>
<item> ACOS </item>
<item> ASIN </item>
<item> ATAN </item>
<item> BLENGTH </item>
<item> COS </item>
<item> EXISTS </item>
<item> EXP </item>
<item> FORMAT </item>
<item> HIBOUND </item>
<item> HIINDEX </item>
<item> LENGTH </item>
<item> LOBOUND </item>
<item> LOINDEX </item>
<item> LOG </item>
<item> LOG2 </item>
<item> LOG10 </item>
<item> NVL </item>
<item> ODD </item>
<item> ROLESOF </item>
<item> SIN </item>
<item> SIZEOF </item>
<item> SQRT </item>
<item> TAN </item>
<item> TYPEOF </item>
<item> USEDIN </item>
<item> VALUE </item>
<item> VALUE_IN </item>
<item> VALUE_UNIQUE </item>
<item> QUERY </item>
</list>
<list name="constants">
<item> CONST_E </item>
<item> PI </item>
<item> SELF </item>
<!-- <item> ? </item> -->
</list>
<list name="types">
<item> binary </item>
<item> boolean </item>
<item> integer </item>
<item> logical </item>
<item> number </item>
<item> real </item>
<item> string </item>
<item> enumeration </item>
<item> select </item>
<item> array </item>
<item> list </item>
<item> bag </item>
<item> set </item>
<item> generic </item>
</list>
<contexts>
<context name="Normal" attribute="Normal Text" lineEndContext="#stay">
<DetectSpaces />
<!-- Make code folding work for SCHEMA/END_SCHEMA, TYPE/END_TYPE, etc -->
<!-- <RegExpr attribute="Block" context="#stay" String="(?:^|[^\w'])(?:SCHEMA|TYPE|ENTITY|FUNCTION|RULE|CONSTANT|IF|LOCAL|REPEAT|BEGIN)" insensitive="false" beginRegion="Blk" firstNonSpace="false" /> -->
<!-- <RegExpr attribute="Block" context="#stay" String="END_(?:SCHEMA|TYPE|ENTITY|FUNCTION|RULE|CONSTANT|IF|LOCAL|REPEAT)" insensitive="false" endRegion="Blk" firstNonSpace="false" /> -->
<!-- <RegExpr attribute="Block" context="#stay" String="END(?:[^_]|$)" endRegion="Blk" firstNonSpace="false" /> -->
<!-- <RegExpr attribute="Block" context="#stay" String="(?:^|[^\w])ELSE(?:$|[^\w])" endRegion="Blk" beginRegion="Blk" firstNonSpace="false" /> -->
<!-- using the lists -->
<keyword attribute="Keyword" context="#stay" String="keywords"/>
<keyword attribute="Keyword" context="#stay" String="kw_begin" beginRegion="Blk" firstNonSpace="false"/>
<keyword attribute="Keyword" context="#stay" String="kw_end_begin" endRegion="Blk" beginRegion="Blk" firstNonSpace="false" />
<keyword attribute="Keyword" context="#stay" String="kw_end" endRegion="Blk" firstNonSpace="false"/>
<keyword attribute="Operator" context="#stay" String="operators"/>
<keyword attribute="Function" context="#stay" String="functions"/>
<keyword attribute="Constants" context="#stay" String="constants"/>
<keyword attribute="Data Type" context="#stay" String="types"/>
<keyword attribute="Interface Specification" context="Interface Specification" String="interface_specification" firstNonSpace="true" />
<DetectIdentifier />
<!-- extra data types -->
<!-- numbers -->
<HlCHex attribute="Hex" context="#stay"/>
<Float attribute="Float" context="#stay"/>
<Int attribute="Decimal" context="#stay"/>
<!-- strings -->
<DetectChar attribute="String" context="String" char="'"/>
<DetectChar attribute="String" context="String2" char="&quot;"/>
<!-- comments -->
<Detect2Chars attribute="Comment" context="SingleLineComment" char="-" char1="-"/>
<Detect2Chars attribute="Comment" context="MultiLineComment" char="(" char1="*" beginRegion="Comment"/>
<DetectChar attribute="Constants" context="#stay" char="?"/>
</context>
<!-- 'string' -->
<context name="String" attribute="String" lineEndContext="#stay">
<LineContinue attribute="String" context="#pop"/>
<DetectChar attribute="String" context="#pop" char="'"/>
</context>
<!-- "string", extra context needed to enable "str'ing" and 'str"ing' -->
<context name="String2" attribute="String" lineEndContext="#stay">
<LineContinue attribute="String" context="#pop"/>
<HlCStringChar attribute="String Char" context="#stay"/>
<DetectChar attribute="String" context="#pop" char="&quot;"/>
</context>
<!-- comments -->
<context name="SingleLineComment" attribute="Comment" lineEndContext="#pop"/>
<context name="MultiLineComment" attribute="Comment" lineEndContext="#stay">
<Detect2Chars attribute="Comment" context="#pop" char="*" char1=")" endRegion="Comment" />
</context>
<context name="Interface Specification" attribute="Interface Specification" >
<!-- lineEndContext="#pop" -->
<DetectChar attribute="Interface Specification" context="#pop" char=";"/>
</context>
</contexts>
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/>
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/>
<itemData name="Block" defStyleNum="dsKeyword" spellChecking="false"/>
<itemData name="Operator" defStyleNum="dsNormal" spellChecking="false"/>
<itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/>
<itemData name="Constants" defStyleNum="dsOthers" spellChecking="false"/>
<itemData name="Data Type" defStyleNum="dsDataType" spellChecking="false"/>
<itemData name="Decimal" defStyleNum="dsDecVal" spellChecking="false"/>
<itemData name="Float" defStyleNum="dsFloat" spellChecking="false"/>
<itemData name="Hex" defStyleNum="dsBaseN" spellChecking="false"/>
<itemData name="String" defStyleNum="dsString"/>
<itemData name="String Char" defStyleNum="dsChar" spellChecking="false"/>
<itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="Interface Specification" defStyleNum="dsOthers" spellChecking="false"/>
</itemDatas>
</highlighting>
<general>
<comments>
<comment name="singleLine" start="--"/>
<comment name="multiLine" start="(*" end="*)"/>
</comments>
<keywords casesensitive="0" additionalDeliminator="'" />
<!-- weakDeliminator="+-*/|=!&lt;&gt;~^:." -->
</general>
</language>
@@ -1,36 +0,0 @@
<NotepadPlus>
<UserLang name="Express Schema" ext="exp">
<Settings>
<Global caseIgnored="yes" />
<TreatAsSymbol comment="no" commentLine="no" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">000000</Keywords>
<Keywords name="Folder+">type entity function rule constant if local repeat begin case else</Keywords>
<Keywords name="Folder-">end_type end_entity end_function end_rule end_constant end_if end_local end_repeat end end_base else</Keywords>
<Keywords name="Operators">&quot; , . / : ; [ \ ] { | } &lt; = &gt;</Keywords>
<Keywords name="Comment"> 1(* 2*) 0--</Keywords>
<Keywords name="Words1">of or to where subtype supertype abstract oneof not in and return then derive optional schema end_schema</Keywords>
<Keywords name="Words2">abs acos asin atan blength cos exists exp format hibound hiindex length lobound loindex log log2 log10 nvl odd rolesof sin sizeof sqrt tan typeof usedin value value_in value_unique query</Keywords>
<Keywords name="Words3">const_e pi self</Keywords>
<Keywords name="Words4">binary boolean integer logical number real string enumeration select array list bag set generic</Keywords>
</KeywordLists>
<Styles>
<WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="FOLDEROPEN" styleID="12" fgColor="800000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="800000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="KEYWORD1" styleID="5" fgColor="800000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="KEYWORD2" styleID="6" fgColor="800000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="KEYWORD3" styleID="7" fgColor="FF8000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="KEYWORD4" styleID="8" fgColor="0000FF" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="COMMENT" styleID="1" fgColor="008000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="COMMENT LINE" styleID="2" fgColor="008000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="NUMBER" styleID="4" fgColor="000000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="OPERATOR" styleID="10" fgColor="FF0000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="DELIMINER1" styleID="14" fgColor="000000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="DELIMINER2" styleID="15" fgColor="000000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontStyle="0" />
</Styles>
</UserLang>
</NotepadPlus>
+42 -21
View File
@@ -8,8 +8,8 @@ set( CTEST_MEMORYCHECK_COMMAND /usr/bin/valgrind )
set( CTEST_INITIAL_CACHE "
SITE:STRING=${CTEST_SITE}
BUILDNAME:STRING=${CTEST_BUILD_NAME}
SCL_ENABLE_TESTING:BOOL=ON
SCL_BUILD_TYPE:STRING=Debug
ENABLE_TESTING:BOOL=ON
CMAKE_BUILD_TYPE:STRING=Debug
")
@@ -50,6 +50,38 @@ function( SUBMIT_TEST part )
endif()
endfunction( SUBMIT_TEST part )
# 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}")
######################################################
##### To disable reporting of a set of tests, comment
##### out the SUBMIT_TEST line immediately following
@@ -62,33 +94,29 @@ endfunction( SUBMIT_TEST part )
ctest_start(Experimental)
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
file(WRITE "${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake" "
set( CTEST_CUSTOM_ERROR_EXCEPTION \"{standard input}:[0-9][0-9]*: WARNING: \")
")
ctest_configure( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND OPTIONS -DSCL_ENABLE_TESTING=ON )
ctest_configure( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND OPTIONS -DENABLE_TESTING=ON )
SUBMIT_TEST( Configure )
ctest_build( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND )
SUBMIT_TEST( Build )
# ctest_memcheck( BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res )
# 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
INCLUDE_LABEL "unitary_schemas" )
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
INCLUDE_LABEL "cpp_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
INCLUDE_LABEL "cpp_schema_build" )
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
INCLUDE_LABEL "cpp_schema_rw" )
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "cpp_schema_rw" )
SUBMIT_TEST( Test )
endif()
endif()
@@ -97,19 +125,12 @@ endif()
if(NOT SKIP_TEST_EXCHANGE_FILE )
if( SKIP_CPP_TEST_SCHEMA_BUILD )
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
INCLUDE "build_cpp_sdai_AP214E3_2010" )
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE "build_cpp_sdai_AP214E3_2010" )
SUBMIT_TEST( Test )
endif()
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
INCLUDE_LABEL "exchange_file" )
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "exchange_file" )
SUBMIT_TEST( Test )
endif()
if(NOT SKIP_TEST_CPP_SCHEMA_SPECIFIC )
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
INCLUDE_LABEL "cpp_schema_specific" )
SUBMIT_TEST( Test )
endif()
# ctest_coverage( )
-15
View File
@@ -1,15 +0,0 @@
set(SCL_BASE_SOURCES
scl_memmgr.cc
scl_trace_fprintf.c
)
include_directories(
${SCL_SOURCE_DIR}/include
)
if(MSVC OR BORLAND)
add_definitions( -DSCL_BASE_DLL_EXPORTS )
endif()
SCL_ADDLIB(base "${SCL_BASE_SOURCES}" "")
-408
View File
@@ -1,408 +0,0 @@
#define SCL_MEMMGR_CC
#include <scl_cf.h>
#include "scl_memmgr.h"
#if __APPLE__
# include <malloc/malloc.h>
#else
# include <malloc.h>
#endif
#include <stdio.h>
#include <string>
#include <set>
#ifdef SCL_MEMMGR_ENABLE_CHECKS
/**
scl_memmgr_error definition
*/
class scl_memmgr_error {
private:
std::string _srcfile;
unsigned int _srcline;
unsigned int _occurences;
public:
scl_memmgr_error( const std::string &file, const unsigned int line );
scl_memmgr_error( const scl_memmgr_error &rhs );
~scl_memmgr_error( void );
bool operator<( const scl_memmgr_error &rhs ) const;
std::string getsrcfile( void ) const;
unsigned int getsrcline( void ) const;
unsigned int getoccurences( void ) const;
};
typedef std::set<scl_memmgr_error> scl_memmgr_errors;
typedef std::set<scl_memmgr_error>::iterator scl_memmgr_error_iterator;
/**
scl_memmgr_record definition
*/
class scl_memmgr_record {
private:
void * _addr;
size_t _size;
std::string _srcfile;
unsigned int _srcline;
public:
scl_memmgr_record( void * addr, size_t size, const char *file, const unsigned int line );
scl_memmgr_record( void * addr );
scl_memmgr_record( const scl_memmgr_record &rhs );
~scl_memmgr_record( void );
bool operator<( const scl_memmgr_record &rhs ) const;
void * getaddr( void ) const;
size_t getsize( void ) const;
std::string getsrcfile( void ) const;
unsigned int getsrcline( void ) const;
};
typedef std::set<scl_memmgr_record> scl_memmgr_records;
typedef std::set<scl_memmgr_record>::iterator scl_memmgr_record_iterator;
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
/**
scl_memmgr definition
*/
class scl_memmgr {
private:
#ifdef SCL_MEMMGR_ENABLE_CHECKS
bool _record_insert_busy, _record_erase_busy;
// memory allocation/reallocation records, inserted at allocation, erased at deallocation.
scl_memmgr_records _records;
// memory stats
unsigned int _allocated; // amount of memory allocated simultaniously
unsigned int _maximum_allocated; // maximum amount of memory allocated simultaniously
unsigned int _allocated_total; // total amount of memory allocated in bytes
unsigned int _reallocated_total; // total amount of memory reallocated in bytes
unsigned int _deallocated_total; // total amount of memory deallocated in bytes
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
protected:
public:
scl_memmgr(void);
~scl_memmgr(void);
void * allocate( size_t size, const char *file, const int line );
void * reallocate( void * addr, size_t size, const char *file, const int line );
void deallocate( void * addr, const char *file, const int line );
};
/**
scl_memmgr instance.
There should be one static instance of memmgr.
This instance is automatically destroyed when application exits, so this allows us to add
memory leak detection in it's destructor.
*/
scl_memmgr memmgr;
/**
c memory functions implementation
*/
extern "C" {
void * scl_malloc_fn( unsigned int size, const char * file, const int line ) {
return memmgr.allocate(size, file, line);
}
void * scl_calloc_fn( unsigned int count, unsigned int size, const char * file, const int line ) {
return memmgr.allocate(count * size, file, line);
}
void * scl_realloc_fn( void * addr, unsigned int size, const char * file, const int line ) {
return memmgr.reallocate(addr, size, file, line);
}
void scl_free_fn( void * addr ) {
memmgr.deallocate(addr, "", 0);
}
}
/**
c++ memory operators implementation
*/
void * scl_operator_new( size_t size, const char * file, const int line ) {
return memmgr.allocate(size, file, line);
}
void scl_operator_delete( void * addr, const char * file, const int line ) {
memmgr.deallocate(addr, file, line);
}
void scl_operator_delete( void * addr ) {
memmgr.deallocate(addr, "", 0);
}
/**
scl_memmgr implementation
*/
scl_memmgr::scl_memmgr(void) {
#ifdef SCL_MEMMGR_ENABLE_CHECKS
_record_insert_busy = false;
_record_erase_busy = false;
_allocated = 0;
_maximum_allocated = 0;
_allocated_total = 0;
_reallocated_total = 0;
_deallocated_total = 0;
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
}
/**
Destructor:
scl_memmgr::~scl_memmgr(void)
Description:
The scl_memmgr destructor is used to check for memory leaks when enabled.
All records still present when scl_memmgr instance is destroyed can be considered as
memory leaks.
*/
scl_memmgr::~scl_memmgr(void) {
#ifdef SCL_MEMMGR_ENABLE_CHECKS
scl_memmgr_record_iterator irecord;
scl_memmgr_errors errors;
scl_memmgr_error_iterator ierror;
// Check if total allocated equals total deallocated
if (_allocated_total != _deallocated_total) {
// todo: generate warning for possible memory leaks, enable full memory leak checking
printf("scl_memmgr warning: Possible memory leaks detected (%d of %d bytes)\n", _allocated_total - _deallocated_total, _allocated_total);
}
// Compact leaks into an error list to prevent same leak being reported multiple times.
_record_insert_busy = true;
_record_erase_busy = true;
for (irecord = _records.begin();
irecord != _records.end();
irecord ++) {
scl_memmgr_error error(irecord->getsrcfile(), irecord->getsrcline());
ierror = errors.find(error);
if (ierror == errors.end())
errors.insert(error);
//else
// ierror->occurences ++;
}
_record_insert_busy = false;
_record_erase_busy = false;
// Loop through memory leaks to generate/buffer errors
for (ierror = errors.begin();
ierror != errors.end();
ierror ++) {
// todo: generate error for memory leak
printf("scl_memmgr warning: Possible memory leak in %s line %d\n", ierror->getsrcfile().c_str(), ierror->getsrcline());
}
// Clear remaining records
_record_erase_busy = true;
_records.clear();
errors.clear();
_record_erase_busy = false;
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
}
void * scl_memmgr::allocate( size_t size, const char *file, const int line ) {
void * addr;
// Allocate
addr = malloc(size);
if (addr == NULL) {
// todo: error allocation failed
printf("scl_memmgr error: Memory allocation failed in %s line %d\n", file, line);
}
// Some stl implementations (for example debian gcc) use the new operator to construct
// new elements when inserting scl_memmgr_record. When this our new operator gets used
// for this operation, this would result in an infinite loop. This is fixed by the
// _record_insert_busy flag.
#ifdef SCL_MEMMGR_ENABLE_CHECKS
if (!_record_insert_busy)
{
// Store record for this allocation
_record_insert_busy = true;
_records.insert(scl_memmgr_record(addr, size, file, line));
_record_insert_busy = false;
// Update stats
_allocated += size;
if (_allocated > _maximum_allocated)
_maximum_allocated = _allocated;
_allocated_total += size;
}
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
return addr;
}
void * scl_memmgr::reallocate( void * addr, size_t size, const char *file, const int line ) {
#ifdef SCL_MEMMGR_ENABLE_CHECKS
scl_memmgr_record_iterator record;
if (!_record_insert_busy)
{
// Find record of previous allocation/reallocation
record = _records.find(scl_memmgr_record(addr));
if (record == _records.end()) {
// todo: error reallocating memory not allocated?
printf("scl_memmgr warning: Reallocation of not allocated memory at %s line %d\n", file, line);
}
else {
// Update stats
_allocated -= record->getsize();
_deallocated_total += record->getsize();
// Erase previous allocation/reallocation
_record_erase_busy = true;
_records.erase(record);
_record_erase_busy = false;
}
}
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
// Reallocate
addr = realloc(addr, size);
if (addr == NULL) {
// todo: error reallocation failed
printf("scl_memmgr error: Reallocation failed at %s line %d\n", file, line);
}
#ifdef SCL_MEMMGR_ENABLE_CHECKS
if (!_record_insert_busy)
{
// Store record for this reallocation
_record_insert_busy = true;
_records.insert(scl_memmgr_record(addr, size, file, line));
_record_insert_busy = false;
// Update stats
_allocated += size;
if (_allocated > _maximum_allocated)
_maximum_allocated = _allocated;
_allocated_total += size;
_reallocated_total += size;
}
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
return addr;
}
void scl_memmgr::deallocate( void * addr, const char *file, const int line ) {
#ifdef SCL_MEMMGR_ENABLE_CHECKS
scl_memmgr_record_iterator record;
if (!_record_erase_busy)
{
// Find record of previous allocation/reallocation
record = _records.find(scl_memmgr_record(addr));
if (record == _records.end()) {
// todo: error free called for not allocated memory?
printf("scl_memmgr warning: Deallocate of not allocated memory at %s line %d\n", file, line);
}
else {
// Update stats
_allocated -= record->getsize();
_deallocated_total += record->getsize();
// Erase record
_record_erase_busy = true;
_records.erase(record);
_record_erase_busy = false;
}
}
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
// Deallocate
free(addr);
}
#ifdef SCL_MEMMGR_ENABLE_CHECKS
/**
scl_memmgr_error implementation
*/
scl_memmgr_error::scl_memmgr_error( const std::string &file, const unsigned int line ) {
_srcfile = file;
_srcline = line;
_occurences = 1;
}
scl_memmgr_error::scl_memmgr_error( const scl_memmgr_error &rhs ) {
_srcfile = rhs._srcfile;
_srcline = rhs._srcline;
_occurences = rhs._occurences;
}
scl_memmgr_error::~scl_memmgr_error( void ) {
}
bool scl_memmgr_error::operator<( const scl_memmgr_error &rhs ) const {
if (_srcfile == rhs._srcfile)
return _srcline < rhs._srcline;
return _srcfile < rhs._srcfile;
}
std::string scl_memmgr_error::getsrcfile( void ) const {
return _srcfile;
}
unsigned int scl_memmgr_error::getsrcline( void ) const {
return _srcline;
}
unsigned int scl_memmgr_error::getoccurences( void ) const {
return _occurences;
}
/**
scl_memmgr_record implementation
*/
scl_memmgr_record::scl_memmgr_record( void * addr, size_t size, const char *file, const unsigned int line ) {
_addr = addr;
_size = size;
_srcfile = file;
_srcline = line;
}
scl_memmgr_record::scl_memmgr_record( void * addr ) {
_addr = addr;
_size = 0;
_srcfile = "";
_srcline = -1;
}
scl_memmgr_record::scl_memmgr_record( const scl_memmgr_record &rhs ) {
_addr = rhs._addr;
_size = rhs._size;
_srcfile = rhs._srcfile;
_srcline = rhs._srcline;
}
scl_memmgr_record::~scl_memmgr_record( void ) {
}
bool scl_memmgr_record::operator<( const scl_memmgr_record &rhs ) const {
return _addr < rhs._addr;
}
void * scl_memmgr_record::getaddr( void ) const {
return _addr;
}
size_t scl_memmgr_record::getsize( void ) const {
return _size;
}
std::string scl_memmgr_record::getsrcfile( void ) const {
return _srcfile;
}
unsigned int scl_memmgr_record::getsrcline( void ) const {
return _srcline;
}
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
-80
View File
@@ -1,80 +0,0 @@
#ifndef SCL_MEMMGR_H
#define SCL_MEMMGR_H
#include <scl_export.h>
/**
Platform specific defines
*/
#if defined(__MSVC__) || defined(__BORLAND__)
#define THROW_STD_BAD_ALLOC
#define THROW_EMPTY
#else
#define THROW_STD_BAD_ALLOC throw (std::bad_alloc)
#define THROW_EMPTY throw ()
#endif
#ifdef __cplusplus
#include <cstddef>
extern "C" {
#endif /* __cplusplus */
SCL_BASE_EXPORT void * scl_malloc_fn( unsigned int size, const char *file, const int line );
SCL_BASE_EXPORT void * scl_calloc_fn( unsigned int count, unsigned int size, const char *file, const int line );
SCL_BASE_EXPORT void * scl_realloc_fn( void * addr, unsigned int size, const char *file, const int line );
SCL_BASE_EXPORT void scl_free_fn( void * addr );
#ifdef __cplusplus
}
#endif /* __cplusplus */
#ifdef __cplusplus
SCL_BASE_EXPORT void * scl_operator_new( size_t size, const char * file, const int line );
SCL_BASE_EXPORT void scl_operator_delete( void * addr, const char *file, const int line );
SCL_BASE_EXPORT void scl_operator_delete( void * addr );
#endif /* __cplusplus */
#ifndef SCL_MEMMGR_CC
#define scl_malloc(size) scl_malloc_fn(size, __FILE__, __LINE__)
#define scl_calloc(count, size) scl_calloc_fn(count, size, __FILE__, __LINE__)
#define scl_realloc(addr, size) scl_realloc_fn(addr, size, __FILE__, __LINE__)
#define scl_free(addr) scl_free_fn(addr)
#ifdef __cplusplus
#include <new>
inline void * operator new( size_t size, const char *file, const int line ) THROW_STD_BAD_ALLOC {
return scl_operator_new(size, file, line);
}
inline void * operator new[]( size_t size, const char *file, const int line ) THROW_STD_BAD_ALLOC {
return scl_operator_new(size, file, line);
}
inline void operator delete( void *addr, const char *file, const int line ) THROW_STD_BAD_ALLOC {
scl_operator_delete(addr, file, line);
}
inline void operator delete[]( void *addr, const char *file, const int line ) THROW_STD_BAD_ALLOC {
scl_operator_delete(addr, file, line);
}
inline void operator delete( void * addr ) THROW_EMPTY {
scl_operator_delete(addr);
}
inline void operator delete[]( void * addr ) THROW_EMPTY {
scl_operator_delete(addr);
}
#define new new(__FILE__, __LINE__)
#endif /* __cplusplus */
#endif /* SCL_MEMMGR_CC */
#endif /* SCL_MEMMGR_H */
-16
View File
@@ -1,16 +0,0 @@
#include <stdarg.h>
#include <stdio.h>
#include "scl_trace_fprintf.h"
void trace_fprintf (char const *sourcefile, int line, FILE* file, const char *format, ...) {
va_list args;
if( (file != stdout) && (file != stderr ) ) {
fprintf(file, "/* source: %s:%d */", sourcefile, line);
}
va_start (args, format);
vfprintf(file, format, args);
va_end (args);
}
-32
View File
@@ -1,32 +0,0 @@
#ifndef SCL_TRACE_FPRINTF_H
#define SCL_TRACE_FPRINTF_H
/** \file scl_trace_fprintf.h
* Used to track the source file and line where generated code is printed from
* When enabled, comments are printed into the generated files for every 'fprintf':
* / * source: scl/src/fedex_plus/selects.c:1375 * /
* To enable, configure with 'cmake .. -DSCL_TRACE_FPRINTF=ON'
*
* This header must be included *after* all other headers, otherwise the compiler will
* report errors in system headers.
* \sa trace_fprintf
**/
#include "scl_export.h"
/** used to find where generated c++ originates from in fedex_plus
* To enable, configure with 'cmake .. -DSCL_TRACE_FPRINTF=ON'
*/
#ifdef __cplusplus
extern "C" {
#endif
SCL_BASE_EXPORT void trace_fprintf (char const *sourcefile, int line, FILE* file, const char *format, ...);
#ifdef __cplusplus
}
#endif
#ifdef SCL_TRACE_FPRINTF
# define fprintf(...) trace_fprintf(__FILE__, __LINE__, __VA_ARGS__)
#endif /* SCL_TRACE_FPRINTF */
#endif /* SCL_TRACE_FPRINTF_H */
+2 -6
View File
@@ -30,21 +30,17 @@ SET(LIBSTEPDAI_PRIVATE_HDRS
IF(MSVC OR BORLAND)
add_definitions( -DSCL_DAI_DLL_EXPORTS )
add_definitions( -DSCL_BASE_DLL_IMPORTS )
add_definitions( -DSCL_UTILS_DLL_IMPORTS )
ENDIF()
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${SCL_SOURCE_DIR}/src/base
${SCL_SOURCE_DIR}/src/clstepcore
${SCL_SOURCE_DIR}/src/clutils
)
SCL_ADDLIB(stepdai "${LIBSTEPDAI_SRCS}" "steputils base")
SCL_ADDLIB(stepdai "${LIBSTEPDAI_SRCS}" "steputils")
if(APPLE)
if(SCL_BUILD_SHARED_LIBS)
set_target_properties(stepdai PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
endif(SCL_BUILD_SHARED_LIBS)
set_target_properties(stepdai PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
endif(APPLE)
@@ -29,7 +29,6 @@
#include <memory.h>
#include <math.h>
#include "scl_memmgr.h"
// to help ObjectCenter
#ifndef HAVE_MEMMOVE
-1
View File
@@ -11,7 +11,6 @@
#include <sstream>
#include <sdai.h>
#include "scl_memmgr.h"
SDAI_Binary::SDAI_Binary( const char * str, int max ) {
content = std::string( str, max );
-1
View File
@@ -3,7 +3,6 @@
#include <math.h>
#include <sdai.h>
#include "scl_memmgr.h"
// to help ObjectCenter
#ifndef HAVE_MEMMOVE
-1
View File
@@ -3,7 +3,6 @@
//#include <EntityExtent.h>
#include <sdai.h>
#include "scl_memmgr.h"
SDAI_Entity_extent::SDAI_Entity_extent( )
: _definition( 0 ), _definition_name( 0 ), _owned_by( 0 ) {
-1
View File
@@ -27,7 +27,6 @@
#include <math.h>
#include <sdai.h>
#include "scl_memmgr.h"
/*
#include <EntityExtent.h>
-1
View File
@@ -1,6 +1,5 @@
#include <sdai.h>
#include "scl_memmgr.h"
/*
* NIST STEP Core Class Library
-1
View File
@@ -1,6 +1,5 @@
#include <sdai.h>
#include "scl_memmgr.h"
///////// SDAI_Model_contents_instances
-1
View File
@@ -24,7 +24,6 @@
* UArray implementation.
*/
#include <sdai.h>
#include "scl_memmgr.h"
// to help ObjectCenter
#ifndef HAVE_MEMMOVE
-1
View File
@@ -1,5 +1,4 @@
#include <sdai.h>
#include "scl_memmgr.h"
SDAI_sdaiObject::SDAI_sdaiObject() {
}
-1
View File
@@ -1,5 +1,4 @@
#include <sdai.h>
#include "scl_memmgr.h"
SDAI_Session_instance::SDAI_Session_instance() {
}
-1
View File
@@ -11,7 +11,6 @@
#include <sdai.h>
#include <sstream>
#include "scl_memmgr.h"
SDAI_String::SDAI_String( const char * str, int max ) {
content = std::string( str, max );
+2 -6
View File
@@ -35,7 +35,6 @@ SET(LIBSTEPEDITOR_PRIVATE_HDRS
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${SCL_SOURCE_DIR}/src/base
${SCL_SOURCE_DIR}/src/cldai
${SCL_SOURCE_DIR}/src/clstepcore
${SCL_SOURCE_DIR}/src/clutils
@@ -43,16 +42,13 @@ include_directories(
if(MSVC OR BORLAND)
add_definitions( -DSCL_EDITOR_DLL_EXPORTS )
add_definitions( -DSCL_BASE_DLL_IMPORTS )
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 stepdai steputils base")
SCL_ADDLIB(stepeditor "${LIBSTEPEDITOR_SRCS}" stepcore stepdai steputils)
if(APPLE)
if(SCL_BUILD_SHARED_LIBS)
set_target_properties(stepeditor PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
endif(SCL_BUILD_SHARED_LIBS)
set_target_properties(stepeditor PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
endif(APPLE)
+740 -160
View File
File diff suppressed because it is too large Load Diff
+19 -25
View File
@@ -49,35 +49,29 @@ class SCL_EDITOR_EXPORT STEPfile {
Registry & reg() {
return _reg;
}
int _fileIdIncr; ///< Increment value to be added to FileId Numbers on input
int _fileIdIncr; //Increment value to be added to FileId Numbers on input
//header information
InstMgr * _headerInstances;
Registry * _headerRegistry;
int _headerId; ///< STEPfile_id given to SDAI_Application_instance from header section
int _headerId; //STEPfile_id given to SDAI_Application_instance from header section
//file information
DirObj * _currentDir;
std::string _fileName;
//the following are used to compute read/write progress
std::ifstream::pos_type _iFileSize; ///< input file size
std::ifstream::pos_type _iFileCurrentPosition; ///< input file position (from ifstream::tellg())
bool _iFileStage1Done; ///< set immediately before ReadData1() returns
int _oFileInstsWritten; ///< number of instances that have been written
//error information
ErrorDescriptor _error;
// new errors
int _entsNotCreated; ///< num entities not created in first pass
int _entsInvalid; ///< num entities that had invalid attr values
int _entsIncomplete; /**< num entities that had missing attr values
(includes entities that had invalid values
for required attrs)*/
int _entsWarning; /**< num entities that may have had problems
with attrs - reported as an attr user msg */
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;
@@ -117,8 +111,6 @@ class SCL_EDITOR_EXPORT STEPfile {
}
const std::string SetFileName( const std::string name = "" );
const std::string TruncFileName( const std::string name ) const;
float GetReadProgress() const;
float GetWriteProgress() const;
//error information
ErrorDescriptor & Error() { /* const */
@@ -173,8 +165,8 @@ class SCL_EDITOR_EXPORT STEPfile {
protected:
//member functions
const std::string schemaName(); /**< Returns and copies out schema name from header instances.
Called by ReadExchangeFile */
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 );
@@ -186,8 +178,9 @@ class SCL_EDITOR_EXPORT STEPfile {
int HeaderId( int increment = 1 );
int HeaderId( const std::string name );
int ReadData1( istream & in ); /**< First pass, to create instances */
int ReadData2( istream & in, bool useTechCor = true ); /**< Second pass, to read instances */
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 );
@@ -195,17 +188,18 @@ class SCL_EDITOR_EXPORT STEPfile {
void ReadRestOfFile( istream & in );
/// create instance - used by ReadData1()
// create instance - used by ReadData1()
SDAI_Application_instance * CreateInstance( istream & in, ostream & out );
/// create complex instance - used by CreateInstance()
// create complex instance - used by CreateInstance()
SDAI_Application_instance * CreateSubSuperInstance( istream & in, int fileid,
ErrorDescriptor & );
/// read the instance - used by ReadData2()
// 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, CreateScopeInstances and ReadScopeInstances are stubs
// 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);
+3 -16
View File
@@ -17,7 +17,6 @@
#include <cmath>
#include <cstring>
#include "scl_memmgr.h"
extern void HeaderSchemaInit( Registry & reg );
@@ -29,9 +28,7 @@ STEPfile::STEPfile( Registry & r, InstMgr & i, const std::string filename, bool
_instances( i ), _reg( r ), _fileIdIncr( 0 ), _headerId( 0 ),
_entsNotCreated( 0 ), _entsInvalid( 0 ), _entsIncomplete( 0 ),
_entsWarning( 0 ), _errorCount( 0 ), _warningCount( 0 ),
_maxErrorCount( 5000 ), _strict( strict ),_iFileSize( 0 ),
_iFileCurrentPosition( 0 ), _oFileInstsWritten( 0 ),
_iFileStage1Done( false ) {
_maxErrorCount( 5000 ), _strict( strict ) {
SetFileType( VERSION_CURRENT );
SetFileIdIncrement();
_currentDir = new DirObj( "" );
@@ -45,6 +42,8 @@ STEPfile::STEPfile( Registry & r, InstMgr & i, const std::string filename, bool
STEPfile::~STEPfile() {
delete _currentDir;
// remove everything from the Registry before deleting it
_headerRegistry->DeleteContents();
delete _headerRegistry;
_headerInstances->DeleteInstances();
@@ -174,8 +173,6 @@ Severity STEPfile::AppendWorkingFile( const std::string filename, bool useTechCo
/******************************************************/
istream * STEPfile::OpenInputFile( const std::string filename ) {
_iFileCurrentPosition = 0;
// if there's no filename to use, fail
if( filename.empty() && FileName().empty() ) {
_error.AppendToUserMsg( "Unable to open file for input. No current file name.\n" );
@@ -207,10 +204,6 @@ istream * STEPfile::OpenInputFile( const std::string filename ) {
return ( 0 );
}
//check size of file
in->seekg( 0, std::ifstream::end );
_iFileSize = in->tellg();
in->seekg( 0, std::ifstream::beg );
return in;
}
@@ -219,10 +212,6 @@ void STEPfile::CloseInputFile( istream * in ) {
if( in && *in != std::cin ) {
delete in;
}
//reset file size
_iFileSize = 0;
_iFileCurrentPosition = 0;
}
@@ -250,12 +239,10 @@ ofstream * STEPfile::OpenOutputFile( const std::string filename ) {
_error.AppendToUserMsg( "unable to open file for output\n" );
_error.GreaterSeverity( SEVERITY_INPUT_ERROR );
}
_oFileInstsWritten = 0;
return out;
}
void STEPfile::CloseOutputFile( ostream * out ) {
_oFileInstsWritten = 0;
delete out;
}
-1
View File
@@ -13,7 +13,6 @@ extern ofstream * logStream;
#include <ExpDict.h>
#include <STEPattribute.h>
#include <SdaiHeaderSchema.h>
#include "scl_memmgr.h"
Schema * s_header_section_schema = 0;
-1
View File
@@ -5,7 +5,6 @@
// regenerate it.
#include <SdaiHeaderSchema.h>
#include "scl_memmgr.h"
void HeaderInitSchemasAndEnts( Registry & reg ) {
Uniqueness_rule_ptr ur;
+12 -19
View File
@@ -8,7 +8,6 @@
#include <ExpDict.h>
#include <STEPattribute.h>
#include <SdaiHeaderSchema.h>
#include "scl_memmgr.h"
void SdaiHEADER_SECTION_SCHEMAInit( Registry & reg ) {
header_section_schemat_time_stamp_text->ReferentType( t_sdaiSTRING );
@@ -53,13 +52,12 @@ void SdaiHEADER_SECTION_SCHEMAInit( Registry & reg ) {
header_section_schemae_file_population->AddExplicitAttr( a_3determination_method );
SetTypeDescriptor * t_0 = new SetTypeDescriptor;
t_0->AssignAggrCreator( ( AggregateCreator ) create_StringAggregate ); // Creator function
t_0->SetBound1( 1 );
t_0->SetBound2( 2147483647 );
t_0->Bound1( 1 );
t_0->Bound2( 2147483647 );
t_0->FundamentalType( SET_TYPE );
t_0->Description( "SET [1:?] OF section_name" );
t_0->OriginatingSchema( s_header_section_schema );
t_0->ReferentType( header_section_schemat_section_name );
s_header_section_schema->AddUnnamedType(t_0);
a_4governed_sections =
new AttrDescriptor( "governed_sections", t_0, LTrue, LFalse, AttrType_Explicit,
*header_section_schemae_file_population );
@@ -81,26 +79,24 @@ void SdaiHEADER_SECTION_SCHEMAInit( Registry & reg ) {
header_section_schemae_file_name->AddExplicitAttr( a_6time_stamp );
ListTypeDescriptor * t_1 = new ListTypeDescriptor;
t_1->AssignAggrCreator( ( AggregateCreator ) create_StringAggregate ); // Creator function
t_1->SetBound1( 1 );
t_1->SetBound2( 2147483647 );
t_1->Bound1( 1 );
t_1->Bound2( 2147483647 );
t_1->FundamentalType( LIST_TYPE );
t_1->Description( "LIST [1:?] OF STRING (256)" );
t_1->OriginatingSchema( s_header_section_schema );
t_1->ReferentType( t_sdaiSTRING );
s_header_section_schema->AddUnnamedType(t_1);
a_7author =
new AttrDescriptor( "author", t_1, LFalse, LFalse, AttrType_Explicit,
*header_section_schemae_file_name );
header_section_schemae_file_name->AddExplicitAttr( a_7author );
ListTypeDescriptor * t_2 = new ListTypeDescriptor;
t_2->AssignAggrCreator( ( AggregateCreator ) create_StringAggregate ); // Creator function
t_2->SetBound1( 1 );
t_2->SetBound2( 2147483647 );
t_2->Bound1( 1 );
t_2->Bound2( 2147483647 );
t_2->FundamentalType( LIST_TYPE );
t_2->Description( "LIST [1:?] OF STRING (256)" );
t_2->OriginatingSchema( s_header_section_schema );
t_2->ReferentType( t_sdaiSTRING );
s_header_section_schema->AddUnnamedType(t_2);
a_8organization =
new AttrDescriptor( "organization", t_2, LFalse, LFalse, AttrType_Explicit,
*header_section_schemae_file_name );
@@ -132,13 +128,12 @@ void SdaiHEADER_SECTION_SCHEMAInit( Registry & reg ) {
header_section_schemae_section_context->AddExplicitAttr( a_12section );
ListTypeDescriptor * t_3 = new ListTypeDescriptor;
t_3->AssignAggrCreator( ( AggregateCreator ) create_StringAggregate ); // Creator function
t_3->SetBound1( 1 );
t_3->SetBound2( 2147483647 );
t_3->Bound1( 1 );
t_3->Bound2( 2147483647 );
t_3->FundamentalType( LIST_TYPE );
t_3->Description( "LIST [1:?] OF context_name" );
t_3->OriginatingSchema( s_header_section_schema );
t_3->ReferentType( header_section_schemat_context_name );
s_header_section_schema->AddUnnamedType(t_3);
a_13context_identifiers =
new AttrDescriptor( "context_identifiers", t_3, LFalse, LFalse, AttrType_Explicit,
*header_section_schemae_section_context );
@@ -150,13 +145,12 @@ void SdaiHEADER_SECTION_SCHEMAInit( Registry & reg ) {
ListTypeDescriptor * t_4 = new ListTypeDescriptor;
t_4->AssignAggrCreator( ( AggregateCreator ) create_StringAggregate ); // Creator function
t_4->SetBound1( 1 );
t_4->SetBound2( 2147483647 );
t_4->Bound1( 1 );
t_4->Bound2( 2147483647 );
t_4->FundamentalType( LIST_TYPE );
t_4->Description( "LIST [1:?] OF STRING (256)" );
t_4->OriginatingSchema( s_header_section_schema );
t_4->ReferentType( t_sdaiSTRING );
s_header_section_schema->AddUnnamedType(t_4);
a_14description =
new AttrDescriptor( "description", t_4, LFalse, LFalse, AttrType_Explicit,
*header_section_schemae_file_description );
@@ -173,14 +167,13 @@ void SdaiHEADER_SECTION_SCHEMAInit( Registry & reg ) {
ListTypeDescriptor * t_5 = new ListTypeDescriptor;
t_5->AssignAggrCreator( ( AggregateCreator ) create_StringAggregate ); // Creator function
t_5->SetBound1( 1 );
t_5->SetBound2( 2147483647 );
t_5->Bound1( 1 );
t_5->Bound2( 2147483647 );
t_5->UniqueElements( LTrue );
t_5->FundamentalType( LIST_TYPE );
t_5->Description( "LIST [1:?] OF UNIQUE schema_name" );
t_5->OriginatingSchema( s_header_section_schema );
t_5->ReferentType( header_section_schemat_schema_name );
s_header_section_schema->AddUnnamedType(t_5);
a_16schema_identifiers =
new AttrDescriptor( "schema_identifiers", t_5, LFalse, LFalse, AttrType_Explicit,
*header_section_schemae_file_schema );
-1
View File
@@ -5,7 +5,6 @@
// regenerate it.
#include <SdaiSchemaInit.h>
#include "scl_memmgr.h"
void HeaderSchemaInit( Registry & reg ) {
HeaderInitSchemasAndEnts( reg );
+1 -1
View File
@@ -11,7 +11,7 @@
*/
#include <cmdmgr.h>
#include "scl_memmgr.h"
ReplicateLinkNode * ReplicateList::FindNode( MgrNode * mn ) {
ReplicateLinkNode * rln = ( ReplicateLinkNode * )GetHead();
-1
View File
@@ -18,7 +18,6 @@
#include <dispnode.h>
#include <dispnodelist.h>
#include "scl_memmgr.h"
// define this to be the name of the display object
class StepEntityEditor;
+1 -1
View File
@@ -19,7 +19,7 @@
#include <mgrnodelist.h>
#include <dispnode.h>
#include <dispnodelist.h>
#include "scl_memmgr.h"
void DisplayNodeList::Remove( GenericNode * node ) {
GenNodeList::Remove( node );
-1
View File
@@ -18,7 +18,6 @@
#include <sdai.h>
#include <instmgr.h>
#include "scl_memmgr.h"
///////////////////////////////////////////////////////////////////////////////
// debug_level >= 2 => tells when a command is chosen
+2 -2
View File
@@ -53,11 +53,11 @@ class SCL_EDITOR_EXPORT InstMgr {
virtual ~InstMgr();
// MASTER LIST OPERATIONS
int InstanceCount() const {
int InstanceCount() {
return master->Count();
}
int OwnsInstances() const {
int OwnsInstances() {
return _ownsInstances;
}
void OwnsInstances( int ownsInstances ) {
-1
View File
@@ -22,7 +22,6 @@
#include <sdai.h>
#include <iostream>
#include "scl_memmgr.h"
void * MgrNode::SEE() {
return ( di ? di->SEE() : 0 );
+1 -1
View File
@@ -37,7 +37,7 @@ static int PrintFunctionTrace = 2;
#include <sdai.h>
#include <string.h> // to get bcopy() - ANSI
#include "scl_memmgr.h"
//////////////////////////////////////////////////////////////////////////////
// class MgrNodeArray member functions
+1 -1
View File
@@ -16,7 +16,7 @@
#include <mgrnodelist.h>
#include <dispnode.h>
#include <dispnodelist.h>
#include "scl_memmgr.h"
MgrNodeList::MgrNodeList( stateEnum type ) : GenNodeList( new MgrNode() ) {
// if(debug_level >= PrintFunctionTrace)
-1
View File
@@ -1,5 +1,4 @@
#include <needFunc.h>
#include "scl_memmgr.h"
///////////////////////////////////////////////////////////////////////////////
// Function defined as a stub (necessary to use the scl)
+2 -6
View File
@@ -49,7 +49,6 @@ endif()
if(MSVC OR BORLAND)
add_definitions( -DSCL_CORE_DLL_EXPORTS )
add_definitions( -DSCL_BASE_DLL_IMPORTS )
add_definitions( -DSCL_EXPRESS_DLL_IMPORTS )
add_definitions( -DSCL_UTILS_DLL_IMPORTS )
add_definitions( -DSCL_DAI_DLL_IMPORTS )
@@ -79,15 +78,12 @@ SET(LIBSTEPCORE_PRIVATE_HDRS
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${SCL_SOURCE_DIR}/src/base
${SCL_SOURCE_DIR}/src/cldai
${SCL_SOURCE_DIR}/src/cleditor
${SCL_SOURCE_DIR}/src/clutils
)
SCL_ADDLIB(stepcore "${LIBSTEPCORE_SRCS} ${LIBDEPEND_SRCS}" "express steputils stepdai base")
SCL_ADDLIB(stepcore "${LIBSTEPCORE_SRCS} ${LIBDEPEND_SRCS}" "express steputils stepdai")
if(APPLE)
if(SCL_BUILD_SHARED_LIBS)
set_target_properties(stepcore PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
endif(SCL_BUILD_SHARED_LIBS)
set_target_properties(stepcore PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
endif(APPLE)
+17 -26
View File
@@ -18,7 +18,6 @@
#include <ExpDict.h>
#include <STEPaggregate.h>
#include "scl_memmgr.h"
Explicit_item_id__set::Explicit_item_id__set( int defaultSize ) {
@@ -322,8 +321,11 @@ Interface_spec::~Interface_spec() {
//////////////////////////////////////////////////////////////////////////////
void Schema::AddFunction( const std::string & f ) {
_function_list.push_back( f );
void Schema::AddFunction( const char * f ) {
if( _function_list == 0 ) {
_function_list = new scl_char_str__list;
}
_function_list->Append( ( char * )f );
}
void Schema::AddGlobal_rule( Global_rule_ptr gr ) {
@@ -337,8 +339,11 @@ void Schema::AddGlobal_rule( Global_rule_ptr gr ) {
void Schema::global_rules_( Global_rule__set_var & grs ) {
}
void Schema::AddProcedure( const std::string & p ) {
_procedure_list.push_back( p );
void Schema::AddProcedure( const char * p ) {
if( _procedure_list == 0 ) {
_procedure_list = new scl_char_str__list;
}
_procedure_list->Append( ( char * )p );
}
/// the whole schema
@@ -363,18 +368,18 @@ void Schema::GenerateExpress( ostream & out ) const {
out << endl << ( *_global_rules )[i]->rule_text_() << endl;
}
}
if( !_function_list.empty() ) {
if( _function_list != 0 ) {
out << "(* *************FUNCTIONS************* *)" << endl;
count = _function_list.size();
count = _function_list->Count();
for( i = 0; i < count; i++ ) {
out << endl << _function_list[i] << endl;
out << endl << ( *_function_list )[i] << endl;
}
}
if( !_procedure_list.empty() ) {
if( _procedure_list != 0 ) {
out << "(* *************PROCEDURES************* *)" << endl;
count = _procedure_list.size();
count = _procedure_list->Count();
for( i = 0; i < count; i++ ) {
out << endl << _procedure_list[i] << endl;
out << endl << ( *_procedure_list )[i] << endl;
}
}
out << endl << "END_SCHEMA;" << endl;
@@ -1025,8 +1030,6 @@ Where_rule__list::Where_rule__list( int defaultSize ) {
}
Where_rule__list::~Where_rule__list() {
Clear();
delete _buf;
}
@@ -1104,9 +1107,6 @@ int Where_rule__list::Count() {
}
void Where_rule__list::Clear() {
for ( int i = 0; i < _count ; i ++ ) {
delete _buf[i];
}
_count = 0;
}
@@ -1135,8 +1135,6 @@ Uniqueness_rule__set::Uniqueness_rule__set( int defaultSize ) {
}
Uniqueness_rule__set::~Uniqueness_rule__set() {
Clear();
delete _buf;
}
@@ -1214,9 +1212,6 @@ int Uniqueness_rule__set::Count() {
}
void Uniqueness_rule__set::Clear() {
for ( int i = 0; i < _count; i ++ ) {
delete _buf[i];
}
_count = 0;
}
@@ -1226,7 +1221,7 @@ Global_rule::Global_rule()
: _entities( 0 ), _where_rules( 0 ), _parent_schema( 0 ) {
}
Global_rule::Global_rule( const char * n, Schema_ptr parent_sch, const std::string & rt )
Global_rule::Global_rule( const char * n, Schema_ptr parent_sch, const char * rt )
: _name( n ), _entities( 0 ), _where_rules( 0 ), _parent_schema( parent_sch ),
_rule_text( rt ) {
}
@@ -1257,7 +1252,6 @@ Global_rule__set::Global_rule__set( int defaultSize ) {
}
Global_rule__set::~Global_rule__set() {
Clear();
delete _buf;
}
@@ -1335,9 +1329,6 @@ int Global_rule__set::Count() {
}
void Global_rule__set::Clear() {
for ( int i = 0; i < _count; i ++ ) {
delete _buf[i];
}
_count = 0;
}
+19 -87
View File
@@ -15,10 +15,6 @@
#include <scl_export.h>
#include <sdai.h>
#include <deque>
#include <string>
#include <assert.h>
typedef SDAI_Application_instance * ( * Creator )() ;
enum AttrType_Enum {
@@ -28,18 +24,12 @@ enum AttrType_Enum {
AttrType_Redefining
};
enum AggrBoundTypeEnum {
bound_unset = 0,
bound_constant,
bound_runtime,
bound_funcall
};
#include <SingleLinkList.h>
#include <baseType.h>
#include <dictdefs.h>
#include <Str.h>
#include <scl_char_str_list.h>
// defined and created in Registry.inline.cc
extern SCL_CORE_EXPORT const TypeDescriptor * t_sdaiINTEGER;
@@ -530,7 +520,7 @@ class SCL_CORE_EXPORT Global_rule : public Dictionary_instance {
std::string _rule_text; // non-SDAI
Global_rule();
Global_rule( const char * n, Schema_ptr parent_sch, const std::string & rt );
Global_rule( const char * n, Schema_ptr parent_sch, const char * rt );
Global_rule( Global_rule & ); // not fully implemented
virtual ~Global_rule();
@@ -665,14 +655,13 @@ class SCL_CORE_EXPORT Schema : public Dictionary_instance {
const char * _name ;
EntityDescriptorList _entList; // list of entities in the schema
TypeDescriptorList _typeList; // list of types in the schema
TypeDescriptorList _unnamed_typeList; // list of unnamed types in the schema (for cleanup)
Interface_spec _interface; // list of USE and REF interfaces (SDAI)
// non-SDAI lists
Interface_spec__set_var _use_interface_list; // list of USE interfaces
Interface_spec__set_var _ref_interface_list; // list of REFERENCE interfaces
std::deque< std::string > _function_list; // of EXPRESS functions
std::deque< std::string > _procedure_list; // of EXPRESS procedures
scl_char_str__list_var _function_list; // of EXPRESS functions
scl_char_str__list_var _procedure_list; // of EXPRESS procedures
Global_rule__set_var _global_rules;
@@ -706,11 +695,11 @@ class SCL_CORE_EXPORT Schema : public Dictionary_instance {
return _ref_interface_list;
}
std::deque< std::string > function_list_() {
scl_char_str__list_var function_list_() {
return _function_list;
}
void AddFunction( const std::string & f );
void AddFunction( const char * f );
Global_rule__set_var global_rules_() { // const
return _global_rules;
@@ -720,11 +709,11 @@ class SCL_CORE_EXPORT Schema : public Dictionary_instance {
void global_rules_( Global_rule__set_var & grs ); // not implemented
std::deque< std::string > procedure_list_() {
scl_char_str__list_var procedure_list_() {
return _procedure_list;
}
void AddProcedure( const std::string & p );
void AddProcedure( const char * p );
EntityDescLinkNode * AddEntity( EntityDescriptor * ed ) {
return _entList.AddNode( ed );
@@ -734,10 +723,6 @@ class SCL_CORE_EXPORT Schema : public Dictionary_instance {
return _typeList.AddNode( td );
}
TypeDescLinkNode * AddUnnamedType( TypeDescriptor * td ) {
return _unnamed_typeList.AddNode( td );
}
// the whole schema
void GenerateExpress( ostream & out ) const;
@@ -1303,7 +1288,9 @@ class SCL_CORE_EXPORT TypeDescriptor {
TypeDescriptor( const char * nm, PrimitiveType ft,
Schema * origSchema, const char * d );
TypeDescriptor( );
virtual ~TypeDescriptor();
virtual ~TypeDescriptor() {
/* if ( altNames ) delete altNames; */
}
virtual const char * GenerateExpress( std::string & buf ) const;
@@ -1557,7 +1544,7 @@ class SCL_CORE_EXPORT EntityDescriptor : public TypeDescriptor {
void AddSubtype( EntityDescriptor * ed ) {
_subtypes.AddNode( ed );
}
void AddSupertype_Stmt( const std::string & s ) {
void AddSupertype_Stmt( const char * s ) {
_supertype_stmt = s;
}
const char * Supertype_Stmt() {
@@ -1644,8 +1631,6 @@ SCL_CORE_EXPORT RealAggregate * create_RealAggregate();
SCL_CORE_EXPORT IntAggregate * create_IntAggregate();
typedef SDAI_Integer (*boundCallbackFn)(SDAI_Application_instance *);
/**
* \class AggrTypeDescriptor
* I think we decided on a simplistic representation of aggr. types for now?
@@ -1661,15 +1646,12 @@ class SCL_CORE_EXPORT AggrTypeDescriptor : public TypeDescriptor {
protected:
SDAI_Integer _bound1, _bound2;
SDAI_Integer _bound1 ;
SDAI_Integer _bound2 ;
SDAI_LOGICAL _uniqueElements ;
TypeDescriptor * _aggrDomainType ;
AggregateCreator CreateNewAggr;
AggrBoundTypeEnum _bound1_type, _bound2_type;
boundCallbackFn _bound1_callback, _bound2_callback;
std::string _bound1_str, _bound2_str;
public:
void AssignAggrCreator( AggregateCreator f = 0 ) {
@@ -1685,72 +1667,22 @@ class SCL_CORE_EXPORT AggrTypeDescriptor : public TypeDescriptor {
AggrTypeDescriptor( const char * nm, PrimitiveType ft,
Schema * origSchema, const char * d,
AggregateCreator f = 0 )
: TypeDescriptor( nm, ft, origSchema, d ), CreateNewAggr( f ) { }
: TypeDescriptor( nm, ft, origSchema, d ), CreateNewAggr( f ) { }
virtual ~AggrTypeDescriptor();
/// find bound type
AggrBoundTypeEnum Bound1Type() const { return _bound1_type; };
/// get a constant bound
SDAI_Integer Bound1( ) const {
assert( _bound1_type == bound_constant );
SDAI_Integer & Bound1() {
return _bound1;
}
/// get a runtime bound using an object's 'this' pointer
SDAI_Integer Bound1Runtime( SDAI_Application_instance* this_ptr) const {
assert( this_ptr && ( _bound1_type == bound_runtime ) );
return _bound1_callback(this_ptr) ;
}
/// get a bound's EXPRESS function call string
std::string Bound1Funcall() const {
return _bound1_str;
}
/// set bound to a constant
void SetBound1( SDAI_Integer b1 ) {
void Bound1( SDAI_Integer b1 ) {
_bound1 = b1;
_bound1_type = bound_constant;
}
///set bound's callback fn. only for bounds dependent on an attribute
void SetBound1FromMemberAccessor( boundCallbackFn callback ) {
_bound1_callback = callback;
_bound1_type = bound_runtime;
}
///set bound from express function call. currently, this only stores the function call as a string.
void SetBound1FromExpressFuncall( std::string s ) {
_bound1_str = s;
_bound1_type = bound_funcall;
}
/// find bound type
AggrBoundTypeEnum Bound2Type() const { return _bound2_type; };
/// get a constant bound
SDAI_Integer Bound2( ) const {
assert( _bound2_type == bound_constant );
SDAI_Integer & Bound2() {
return _bound2;
}
/// get a runtime bound using an object's 'this' pointer
SDAI_Integer Bound2Runtime( SDAI_Application_instance* this_ptr) const {
assert( this_ptr && ( _bound2_type == bound_runtime ) );
return _bound2_callback(this_ptr) ;
}
/// get a bound's EXPRESS function call string
std::string Bound2Funcall() const {
return _bound2_str;
}
/// set bound to a constant
void SetBound2( SDAI_Integer b2 ) {
void Bound2( SDAI_Integer b2 ) {
_bound2 = b2;
_bound2_type = bound_constant;
}
///set bound's callback fn
void SetBound2FromMemberAccessor( boundCallbackFn callback ){
_bound2_callback = callback;
_bound2_type = bound_runtime;
}
///set bound from express function call. currently, this only stores the function call as a string.
void SetBound2FromExpressFuncall( std::string s ) {
_bound2_str = s;
_bound2_type = bound_funcall;
}
SDAI_LOGICAL & UniqueElements() {
+6 -24
View File
@@ -11,7 +11,6 @@
*/
#include <ExpDict.h>
#include "scl_memmgr.h"
Dictionary_instance::~Dictionary_instance() {
}
@@ -25,22 +24,21 @@ Schema::Schema( const char * schemaName )
}
Schema::~Schema() {
TypeDescLinkNode *node;
if( _use_interface_list != 0 ) {
delete _use_interface_list;
}
if( _ref_interface_list != 0 ) {
delete _ref_interface_list;
}
if( _function_list != 0 ) {
delete _function_list;
}
if( _procedure_list != 0 ) {
delete _procedure_list;
}
if( _global_rules != 0 ) {
delete _global_rules;
}
node = (TypeDescLinkNode*) _unnamed_typeList.GetHead();
while ( node ) {
delete node->TypeDesc();
node = (TypeDescLinkNode*) node->NextNode();
}
}
Interfaced_item::Interfaced_item() {
@@ -123,9 +121,6 @@ AttrDescLinkNode::AttrDescLinkNode() {
}
AttrDescLinkNode::~AttrDescLinkNode() {
if ( _attrDesc ) {
delete _attrDesc;
}
}
AttrDescItr::AttrDescItr( const AttrDescriptorList & adList ) : adl( adList ) {
@@ -146,13 +141,6 @@ Inverse_attributeList::Inverse_attributeList() {
}
Inverse_attributeList::~Inverse_attributeList() {
Inverse_attributeLinkNode *node;
node = ( Inverse_attributeLinkNode* ) head;
while ( node ) {
delete node->Inverse_attr();
node = ( Inverse_attributeLinkNode* ) node->NextNode();
}
}
Inverse_attributeLinkNode * Inverse_attributeList::AddNode( Inverse_attribute * ad ) {
@@ -221,12 +209,6 @@ TypeDescriptor::TypeDescriptor
_where_rules( 0 ) {
}
TypeDescriptor::~TypeDescriptor() {
if ( _where_rules ) {
delete _where_rules;
}
}
/**
* Determines the current name of this. Normally, this is simply _name.
* If "schnm" is set to a value, however, then this function becomes a
+1 -1
View File
@@ -35,7 +35,7 @@ class SCL_CORE_EXPORT Registry {
all_ents_cnt;
HashEntry cur_entity;
HashEntry cur_schema;
HashEntry cur_type;
HashEntry cur_type;
// used by AddEntity() and RemoveEntity() to deal with renamings of an
// entity done in a USE or REFERENCE clause - see header comments in

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