diff --git a/thirdparty/GenICam/License_ReadMe.txt b/thirdparty/GenICam/License_ReadMe.txt new file mode 100644 index 0000000..9eb60da --- /dev/null +++ b/thirdparty/GenICam/License_ReadMe.txt @@ -0,0 +1,74 @@ +============== +== Licenses == +============== + + +Version 1.0 + + +GenICam comes in two versions +~ a runtime version +~ a development version. + + +The runtime version comes under the following license: + + Copyright (c) 2006, . + All rights reserved + + Redistribution and use in source and binary forms, without modification, + are permitted provided that the following conditions are met: + + ~ Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + ~ Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + ~ Neither the name of the GenICam standard group nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +The development version comes under the GenICam license (see below). + + +GenICam uses the following 3rd party software packages: + + +Package License Internet +================================================================================== +Mathparser LGPL http://kirya.narod.ru/mathparser.html + http://www.sama.ru/~despair/ccalc/ +Xerces Apache http://xerces.apache.org +Xalan Apache http://xalan.apache.org +Log4Cpp LGPL http://log4cpp.sourceforge.net +CppUnit LGPL http://cppunit.sourceforge.net +setx Win2k ressource kit http://www.microsoft.com + +All license texts come as part of the GenICam distribution in the licenses +subdiretory. If not you can download them from the internet. + +License File Internet +================================================================================== +LGPL LGPL.txt http://www.gnu.org/licenses/lgpl.html +Apache Apache.txt http://www.apache.org/licenses/LICENSE-2.0 +GenICam GenICam_License.pdf http://www.genicam.org +setx setx_license.txt http://www.microsoft.com + + +Last but not least GenICam redistributes the C/C++ runtime DLLs of the +Microsoft Visual C++ compiler in the version 7.1 and 8.0 + diff --git a/thirdparty/GenICam/README b/thirdparty/GenICam/README new file mode 100644 index 0000000..04413b2 --- /dev/null +++ b/thirdparty/GenICam/README @@ -0,0 +1,35 @@ + +Installation on a Windows system +================================ +The provided Merge module are supposed to be integrated into a setup by your API supplier. + +For testing purposes use the GenApiTestBinSetup_win32_vc80_v1_1.msi resp. GenApiTestBinSetup_win64_vc80_v1_1.msi In a shell (DOS-box) setup your environment for testing. +set GENICAM_ROOT_V1_1=c:\Projectes\GenICamTest +set GENICAM_LOG_CONFIG=c:\Projects\GenICamTest\log\config\TestLogging.properties +set TEST_RESULT_FILE=c:\Projects\GenICamTest\log\mylog.txt + +Installation on a Linux system +================================ +Installation on a Linux-i686 system extract the files with the -i686 suffix. On a Linux-x64_86 system use the corresponding packages with the -x64_86.tgz suffix. + +mkdir /opt/genicam +tar xzvf genicam-1.1.2-linux-i686.tgz -C /opt/genicam +tar xzvf genicam-sdk-1.1.2-linux-i686.tgz -C /opt/genicam +tar xzvf genicam-tests-1.1.2-linux-i686.tgz -C /opt/genicam + +Add these variables to your environment, e.g. by placing these lines in your profile or .bashrc file. +export GENICAM_ROOT_V1_1=/opt/genicam +export GENICAM_CACHE=$HOME/tmp + +In order to execute the GenApi test using the standard test setting do the following +export GENICAM_LOG_CONFIG=/opt/genicam/share/genicam/log/config/TestLogging.properties +export TEST_RESULT_FILE=$HOME/tmp/mylog.txt +/opt/genicam/bin/GenicamPluginTester /opt/genicam/lib/libgenicam_test.so + +Installation of the GenICam-packages at alternative locations is also possible, e.g. if /opt/genicam is not available. Simply adopt the steps above by replacing the path /opt/genicam by a path you prefer. + +In case you develop application using the GenICam SDK add +the GenICam include path to your preproceccesor options, e.g: +CPPFLAGS += $(GENICAM_ROOT_V1_1)/include +and the GenICam lib resp. lib64 path to your linker options, e.g: +LDFLAGS += $(GENICAM_ROOT_V1_1)/lib -lgenicam_base -l genciam_genapi -lgenicam_mathparser -lgenicam_log. diff --git a/thirdparty/GenICam/bin/gcxalan b/thirdparty/GenICam/bin/gcxalan new file mode 100755 index 0000000..1c2cabd Binary files /dev/null and b/thirdparty/GenICam/bin/gcxalan differ diff --git a/thirdparty/GenICam/examples/CPP/GenApi/Generic/UsingGenApi_1/UsingGenApi.cpp b/thirdparty/GenICam/examples/CPP/GenApi/Generic/UsingGenApi_1/UsingGenApi.cpp new file mode 100644 index 0000000..3ad2f0f --- /dev/null +++ b/thirdparty/GenICam/examples/CPP/GenApi/Generic/UsingGenApi_1/UsingGenApi.cpp @@ -0,0 +1,130 @@ +//----------------------------------------------------------------------------- +// (c) 2006, 2007 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/examples/CPP/GenApi/Generic/UsingGenApi_1/UsingGenApi.cpp,v 1.9 2007/12/17 13:58:10 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! + \file + \brief Shows how to use GenApi +*/ + +#if WIN32 +// Required for SetDllDirectory; this function exists only with WinXK SP1 or higher +#define _WIN32_WINNT 0x0502 +#include +#endif +#include +#include +#include + +// Required for using GenApi +#include +using namespace GenICam; +using namespace GenApi; + +#if WIN32 +int setenv( const char name[], const char value[], int replace ) +{ + GC_UNUSED( replace ); + ::SetEnvironmentVariable( name, value ); + return 0; +} +#endif + +int main(int /*argc*/, char* /*argv[]*/) +{ + // Setup the environment variables pointing out GenICam's home directory + // The following code assumes that an environment variable GENICAM_ROOT exists + // Note that this variable is normally not present at runtime + std::string MyGenICamRoot( getenv("GENICAM_ROOT") ); + + // GENICAM_ROOT_VERSION holds the path to the GenICam root directory + // GENICAM_ROOT_VERSION expands to something like "GENICAM_ROOT_V1_0" depending on the GenICam version used + // This variable must be present at runtime + setenv(GENICAM_ROOT_VERSION, MyGenICamRoot.c_str(), false ); + + // GENICAM_CACHE holds a path to a location were cached XML files are stored + // This location must be writable therefore it is normally different from the home directory + // were users without admin rights cannot write files. + std::string MyGenICamBCache( MyGenICamRoot ); + MyGenICamBCache += "/xml/GenApi/cache"; + setenv("GENICAM_CACHE", MyGenICamBCache.c_str(), false ); + +#if WIN32 + // The GenICam DLLs from the installation must be in the PATH. + // Note that SetDllDirectory is avaliable only under WinXP SP1 and higher + std::string MyGenICamBin( MyGenICamRoot ); + MyGenICamBin += "/bin/Win32_i86"; + ::SetDllDirectory( MyGenICamBin.c_str() ); +#endif + + // Get a camera description file + // This is an example for a very primitive camera description file + const GenICam::gcstring CameraDescriptionFile = + " \n" + " \n" + " \n" + " \n" + " 0 \n" + " \n" + " \n" + " \n"; + + + // Create a camera access object and load the camera description file + CNodeMapRef Camera; + Camera._LoadXMLFromString(CameraDescriptionFile); + + // Get the Value node and access it + CIntegerPtr ptrValue = Camera._GetNode("TheValue"); + + // access the node + assert( 0 == *ptrValue()); + *ptrValue = 42; + int64_t Value = *ptrValue(); + assert( 42 == Value); + + printf("UsingGenApi_1 : GenICam worked all right.\n"); + + return ! (42 == Value); + +} + + + + diff --git a/thirdparty/GenICam/include/Base/GCBase.h b/thirdparty/GenICam/include/Base/GCBase.h new file mode 100644 index 0000000..1b2120c --- /dev/null +++ b/thirdparty/GenICam/include/Base/GCBase.h @@ -0,0 +1,41 @@ +/**************************************************************************** + (c) 2005 by STEMMER IMAGING + + License: This file is published under the license of the EMVA GenICam Standard Group. + A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. + If for some reason you are missing this file please contact the EMVA or visit the website + (http://www.genicam.org) for a full copy. + + THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +****************************************************************************/ + + /// \file + /// \brief Common GenICam base include file. + /// \version $Revision: 1.8 $ + /// \date $Date: 2007/02/16 15:45:09 $ + /// \ingroup Base_PublicUtilities + + +#ifndef GENICAM_GCBASE_H +#define GENICAM_GCBASE_H + +#include "GCTypes.h" +#include "GCString.h" +#include "GCStringVector.h" +#include "GCException.h" +#include "GCError.h" + +#include "GCUtilities.h" + +#endif // GENICAM_GCBASE_H diff --git a/thirdparty/GenICam/include/Base/GCError.h b/thirdparty/GenICam/include/Base/GCError.h new file mode 100644 index 0000000..4430f64 --- /dev/null +++ b/thirdparty/GenICam/include/Base/GCError.h @@ -0,0 +1,75 @@ +//*************************************************************************** +// (C) 2005 STEMMER IMAGING +// +/// \file +/// GenICam Common Error Values +/// \author Rupert Stelz (STEMMER IMAGING) +/// \version 0.1 +/// \date 2005 + /// \ingroup Base_PublicUtilities +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//*************************************************************************** + +// TLIClientDummy.dll GenICam TransportLayer Dummy Client + +#ifndef GC_ERROR_DEF_H +#define GC_ERROR_DEF_H + +#include "GCTypes.h" + +namespace GenICam +{ + /// Gen Cam Error + //! \ingroup Base_PublicUtilities + typedef int32_t GC_ERROR; + + //! Define a list wich maps error ids to error descrtiptions + //! The list is filled in the cpp file + //! \ingroup Base_PublicUtilities + enum GCErrorID + { + GC_ERR_SUCCESS = 0, + GC_ERR_INVALID_BUFFER_SIZE = -1, + GC_ERR_INVALID_HANDLE = -2, + GC_ERR_INVALID_ID = -3, + GC_ERR_ACCESS_DENIED = -4, + GC_ERR_NO_DATA = -5, + GC_ERR_ERROR = -6, + GC_ERR_INVALID_PARAMETER = -7, + GC_ERR_TIMEOUT = -8, + GC_ERR_INVALID_FILENAME = -9, + GC_ERR_INVALID_ADDRESS = -10, + GC_ERR_FILE_IO = -11 + }; + + //! Modules were errors can come from + //! \ingroup Base_PublicUtilities + enum GCModuleID { + GC_MOD_SYSTEM = 0x0, + GC_MOD_TLICLIENT = 0x20000000, + GC_MOD_TLISYSTEM = 0x10000000, + GC_MOD_FACTORY = 0x08000000, + GC_MOD_GENAPI = 0x04000000 + + }; + + #define GC_GET_ERROR(ErrorCode) (((ErrorCode ) & 0xFFFF ) | 0xFFFF0000) + #define GC_IS_ERROR(ErrorCode) (((ErrorCode ) & 0x80000000) ? true : false) +} +#endif //GC_ERROR_DEF_H diff --git a/thirdparty/GenICam/include/Base/GCException.h b/thirdparty/GenICam/include/Base/GCException.h new file mode 100644 index 0000000..fcfd513 --- /dev/null +++ b/thirdparty/GenICam/include/Base/GCException.h @@ -0,0 +1,261 @@ +//----------------------------------------------------------------------------- +// (c) 2004 by Basler Vision Technologies +// Section: Vision Components +// Project: GenICam +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/Base/GCException.h,v 1.15 2007/08/16 13:56:44 hartmut_nebelung Exp $ +// +// 14.03.2005 Stemmer, RS +// changed minor things like namespace +// added a AccessException +// added a TimeoutException +// +// 21.02.2006 Stemmer, SD +// used _vsnprintf_s function for VS8 and higher (compiler fork) +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! + \file + Standard GenICam Exceptions + \ingroup Base_PublicUtilities +*/ + +#ifndef GENCAM_EXCEPTION_H_ +#define GENCAM_EXCEPTION_H_ + +#include +#include +#include +#include +#include +#include +#include "GCTypes.h" +#include "GCString.h" + +#pragma pack(push, 8) + +namespace GenICam +{ + + /** + \brief GenICam's exception class + \ingroup Base_PublicUtilities + */ + class GCBASE_API GenericException : public std::exception + { + public: + //! Constructor + GenericException( const char* description, const char *sourceFileName, unsigned int sourceLine ); + + //! Get error description + const char* + GetDescription() const throw(); + + //! Get filename in which the error occurred + const char* + GetSourceFileName() const throw(); + + //! Get line number at which the error occurred + unsigned int + GetSourceLine() const throw(); + + //! Get error description (overwrite from std:exception) + virtual const char *what() const throw(); + + virtual ~GenericException() throw(); + + protected: + //! Line number at which the error occurred + unsigned int m_SourceLine; + + //! Filename in which the error occurred + gcstring m_SourceFileName; + + //! Error description + gcstring m_Description; + + //! Complete error message, including file name and line number + gcstring m_What; + + }; + + //! Creates an exception with the same functionality as the GenericException but being of different type + //! \ingroup Base_PublicUtilities + #define DECLARE_EXCEPTION( name ) \ + class GCBASE_API name : public GenICam::GenericException \ + { \ + public: \ + name(const char* description, const char *pSourceFileName, int SourceLine ); \ + } + + //! \addtogroup Base_PublicUtilities + //! \{ + + //! Exception fired if an argument is invalid + DECLARE_EXCEPTION( InvalidArgumentException ); + + //! Exception fired if an argument is out of range + DECLARE_EXCEPTION( OutOfRangeException ); + + //! Exception fired if a property access fails + DECLARE_EXCEPTION( PropertyException ); + + //! Runtime exception + DECLARE_EXCEPTION( RuntimeException ); + + //! Exception to be thrown to indicate logical errors in program flow + DECLARE_EXCEPTION( LogicalErrorException ); + + //! Exception to be thrown to indicate an access error + DECLARE_EXCEPTION( AccessException ); + + //! Exception to be thrown to indicate an access error + DECLARE_EXCEPTION( TimeoutException ); + + //! Exception to be thrown to indicate the the result of a dynamic cast was zero + DECLARE_EXCEPTION( DynamicCastException ); + + //! \} + + /*-----------------------------------------------------------------*/ + // Utilities + /*-----------------------------------------------------------------*/ + + /** + \brief printf like creation of exceptions + \ingroup Base_PublicImpl + */ + template + class ExceptionReporter + { + public: + ExceptionReporter( const char* sourceFileName, unsigned int sourceLine ) + : m_SourceFileName( sourceFileName ) + , m_SourceLine( sourceLine ) + { } + + E + Report( const char* pFormat, ... ) + { + char pBuffer[ 256 ]; + va_list vap; + va_start( vap, pFormat ); + +#if defined (_MSC_VER) +# if (_MSC_VER >= 1400) // new VS8 secure crt + vsnprintf_s( pBuffer, sizeof pBuffer, _TRUNCATE, pFormat, vap ); +# else // defined (_MSC_VER >= 1400) + _vsnprintf( pBuffer, sizeof pBuffer, pFormat, vap ); +# endif // defined (_MSC_VER >= 1400) +#else //defined (_MSC_VER) + // others as gcc + vsnprintf( pBuffer, sizeof pBuffer, pFormat, vap ); +#endif // defined (_MSC_VER) + + return E( pBuffer, m_SourceFileName.c_str(), m_SourceLine ); + }; + + E + Report( const std::string &s ) + { + return E( s.c_str(), m_SourceFileName.c_str(), m_SourceLine ); + } + + E + Report( const std::stringstream& str) + { + return E(str.str().c_str(), m_SourceFileName.c_str(), m_SourceLine); + } + + + private: + gcstring m_SourceFileName; + unsigned int m_SourceLine; + + }; + + //! \addtogroup Base_PublicImpl + //! \{ + + //! Fires an exception, e.g. throw EXCEPTION("%ld too large", Value); + #define GENERIC_EXCEPTION GenICam::ExceptionReporter(__FILE__, __LINE__).Report + + //! Fires an invalid argument exception, e.g. throw INVALID_ARGUMENT("%ld too large", Value); + #define INVALID_ARGUMENT_EXCEPTION GenICam::ExceptionReporter(__FILE__, __LINE__).Report + + //! Fires an out of range exception, e.g. throw OUT_OF_RANGE_EXCEPTION("%ld too large", Value); + #define OUT_OF_RANGE_EXCEPTION GenICam::ExceptionReporter(__FILE__, __LINE__).Report + + //! Fires an property exception, e.g. throw PROPERTY_EXCEPTION("%ld too large", Value); + #define PROPERTY_EXCEPTION GenICam::ExceptionReporter(__FILE__, __LINE__).Report + + //! Fires a runtime exception, e.g. throw RUNTIME_EXCEPTION("buh!") + #define RUNTIME_EXCEPTION GenICam::ExceptionReporter(__FILE__, __LINE__).Report + + //! Fires a logical error exception, e.g. throw LOGICAL_ERROR_EXCEPTION("Should never reach this point") + #define LOGICAL_ERROR_EXCEPTION GenICam::ExceptionReporter(__FILE__, __LINE__).Report + + //! Fires a access error exception, e.g. throw ACCESS_ERROR_EXCEPTION("Not ecverybody") + #define ACCESS_EXCEPTION GenICam::ExceptionReporter(__FILE__, __LINE__).Report + + //! Fires a timeout error exception, e.g. throw TIMEOUT_EXCEPTION("Not ecverybody") + #define TIMEOUT_EXCEPTION GenICam::ExceptionReporter(__FILE__, __LINE__).Report + + //! Fires a dynamic cast exception, e.g. throw DYNAMICCAST_EXCEPTION("Not ecverybody") + #define DYNAMICCAST_EXCEPTION GenICam::ExceptionReporter(__FILE__, __LINE__).Report + +#ifdef _MSC_VER + //! Range check for int64 + #define CHECK_RANGE_I64(_Value, _Min, _Max, _Inc) \ + if((int64_t)(_Value) < (int64_t)(_Min)) \ + throw OUT_OF_RANGE_EXCEPTION("Value = %I64d must be equal or greater than Min = %I64d", (int64_t)(_Value), (int64_t)(_Min)); \ + else if((int64_t)(_Value) > (int64_t)(_Max)) \ + throw OUT_OF_RANGE_EXCEPTION("Value = %I64d must be equal or smaller than Max = %I64d", (int64_t)(_Value), (int64_t)(_Max)); \ + else if( (int64_t)(_Inc)!= 0 && ((int64_t)(_Value) - (int64_t)(_Min)) % (int64_t)(_Inc) != 0) \ + throw OUT_OF_RANGE_EXCEPTION("The difference between Value = %I64d and Min = %I64d must be dividable without rest by Inc = %I64d", (int64_t)(_Value), (int64_t)(_Min), (int64_t)(_Inc)); +#else + //! Range check for int64 + #define CHECK_RANGE_I64(_Value, _Min, _Max, _Inc) \ + if((int64_t)(_Value) < (int64_t)(_Min)) \ + throw OUT_OF_RANGE_EXCEPTION("Value = %Ld must be equal or greater than Min = %Ld", (int64_t)(_Value), (int64_t)(_Min)); \ + else if((int64_t)(_Value) > (int64_t)(_Max)) \ + throw OUT_OF_RANGE_EXCEPTION("Value = %Ld must be equal or smaller than Max = %Ld", (int64_t)(_Value), (int64_t)(_Max)); \ + else if( ((int64_t)(_Value) - (int64_t)(_Min)) % (int64_t)(_Inc) != 0) \ + throw OUT_OF_RANGE_EXCEPTION("The difference between Value = %Ld and Min = %Ld must be dividable without rest by Inc = %Ld", (int64_t)(_Value), (int64_t)(_Min), (int64_t)(_Inc)); +#endif + + //! Range check for float + #define CHECK_RANGE_FLT(_Value, _Min, _Max) \ + if ((_Value) < (_Min)) \ + throw OUT_OF_RANGE_EXCEPTION( "Value %f must be greater than or equal %f", (_Value), (_Min) ); \ + else if ((_Value) > (_Max)) \ + throw OUT_OF_RANGE_EXCEPTION( "Value %f must be smaller than or equal %f", (_Value), (_Max) ); + + //! Checks if a dynamic_cast is possible + #define CHECK_DYNAMIC_CAST_POINTER( _Pointer )\ + assert( (_Pointer) != NULL ); \ + if (NULL == (_Pointer)) throw LOGICAL_ERROR_EXCEPTION( "Unexpected type in dynamic cast" ) + + //! \} + +} + +#pragma pack(pop) + +#endif // GENCAM_EXCEPTION_H_ diff --git a/thirdparty/GenICam/include/Base/GCLinkage.h b/thirdparty/GenICam/include/Base/GCLinkage.h new file mode 100644 index 0000000..a94059e --- /dev/null +++ b/thirdparty/GenICam/include/Base/GCLinkage.h @@ -0,0 +1,100 @@ +//{{NO_DEPENDENCIES}} +//@tab=(8,4) + +//----------------------------------------------------------------------------- +// (c) 2007 by Basler Vision Technologies +// Section: Vision Components +// Project: GenICam +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/Base/GCLinkage.h,v 1.2.2.1 2008/07/14 08:37:44 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief helpers for pragma linkage +*/ + +#ifndef LINKAGE_H +#define LINKAGE_H + +#if defined (_MSC_VER) + +# if (defined (WIN32) || defined (_WIN32)) && defined (_MT ) +# if defined(_DEBUG) +# define CONFIGURATION "MDd" +# elif defined(NDEBUG) +# define CONFIGURATION "MD" +# else +# error Invalid configuraiton +# endif +# else +# error Invalid configuration +# endif + +# if !defined(COMPILER) // COMPILER may be force set from outside +# if _MSC_VER==1310 // Visual C++ .NET 2003 +# define COMPILER "VC71" +# elif _MSC_VER==1400 // Visual C++ 2005 +# define COMPILER "VC80" +# else +# error Invalid compiler +# endif +# endif + +# define GENICAM_SUFFIX( CONFIGURATION, COMPILER, VERSION_MAJOR, VERSION_MINOR, EXTENSION ) \ + "_" CONFIGURATION "_" COMPILER "_v" VERSION_MAJOR "_" VERSION_MINOR "." EXTENSION + +# define LIB_SUFFIX \ + GENICAM_SUFFIX( CONFIGURATION, COMPILER, GENICAM_VERSION_MAJOR_STR, GENICAM_VERSION_MINOR_STR, "lib" ) +# define DLL_SUFFIX \ + GENICAM_SUFFIX( CONFIGURATION, COMPILER, GENICAM_VERSION_MAJOR_STR, GENICAM_VERSION_MINOR_STR, "dll" ) +# define EXE_SUFFIX \ + GENICAM_SUFFIX( CONFIGURATION, COMPILER, GENICAM_VERSION_MAJOR_STR, GENICAM_VERSION_MINOR_STR, "exe" ) + +#elif defined (__GNUC__) && defined (__ELF__) +# if defined (NDEBUG) +# define CONFIGURATION "" +# else +# define CONFIGURATION "_g" +# endif + +# define GENICAM_SUFFIX( CONFIGURATION, VERSION_MAJOR, VERSION_MINOR, EXTENSION ) \ + CONFIGURATION "." VERSION_MAJOR "." VERSION_MINOR "." EXTENSION + +# define LIB_SUFFIX \ + GENICAM_SUFFIX( CONFIGURATION, GENICAM_VERSION_MAJOR_STR, GENICAM_VERSION_MINOR_STR, "lib" ) +# define DLL_SUFFIX \ + GENICAM_SUFFIX( CONFIGURATION, GENICAM_VERSION_MAJOR_STR, GENICAM_VERSION_MINOR_STR, "dll" ) +# define EXE_SUFFIX \ + GENICAM_SUFFIX( CONFIGURATION, GENICAM_VERSION_MAJOR_STR, GENICAM_VERSION_MINOR_STR, "exe" ) + +#else +# error Unknown shared library support +#endif + +#define LIB_NAME( MODULE ) \ + MODULE ## LIB_SUFFIX + +#define DLL_NAME( MODULE ) \ + MODULE ## DLL_SUFFIX + +#define EXE_NAME( MODULE ) \ + MODULE ## EXE_SUFFIX + +#endif // LINKAGE_H diff --git a/thirdparty/GenICam/include/Base/GCString.h b/thirdparty/GenICam/include/Base/GCString.h new file mode 100644 index 0000000..4e8994d --- /dev/null +++ b/thirdparty/GenICam/include/Base/GCString.h @@ -0,0 +1,137 @@ +/**************************************************************************** + (c) 2005 by STEMMER IMAGING + + // License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + + +****************************************************************************/ + + /// \file + /// \brief Portable string implementation + /// \version $Revision: 1.13.2.2 $ + /// \date $Date: 2009/01/30 17:04:10 $ + /// \ingroup Base_PublicUtilities + + +#ifndef GENICAM_GCSTRING_H +#define GENICAM_GCSTRING_H + +#include + +#include +#include "GCTypes.h" + +#pragma pack(push, 8) + +namespace GenICam +{ + /** + \brief A string class which is a clone of std::string + \ingroup Base_PublicUtilities + */ + class GCBASE_API gcstring + { + // Ctor / Dtor + // ------------------------------------------------------------------------- + public: + gcstring ( const char *pc = 0 ); + gcstring ( size_t count, char ch ); + gcstring ( const gcstring &str ); + virtual ~gcstring ( void ); + + // Data access + // ------------------------------------------------------------------------- + public: + virtual gcstring & append ( const gcstring &str ); + virtual gcstring & append ( size_t count, char ch ); + virtual gcstring & assign ( const gcstring &str ); + virtual gcstring & assign ( size_t count, char ch ); + virtual int compare ( const gcstring &str ) const; + virtual const char *c_str ( void ) const; + virtual bool empty ( void ) const; + virtual size_t find ( char ch, size_t offset = 0 ) const; + virtual size_t find ( const gcstring &str, size_t offset = 0 ) const; + virtual size_t find ( const gcstring &str, size_t offset, size_t count ) const; + virtual size_t find ( const char* pc, size_t offset = 0) const; + virtual size_t find ( const char* pc, size_t offset, size_t count ) const; + virtual size_t length ( void ) const; + virtual size_t size ( void ) const; + virtual gcstring substr ( size_t offset = 0, size_t count = npos ) const; + + + // Operators + // ------------------------------------------------------------------------- + public: + bool operator != ( const gcstring &str ) const; + bool operator != ( const char *pc ) const; + gcstring & operator += ( const gcstring &str ); +// gcstring operator += ( const gcstring &str ) const; + gcstring & operator += ( char ch ); +// gcstring operator += ( char ch ) const; + gcstring & operator = ( const gcstring &str ); + bool operator == ( const gcstring &str ) const; + bool operator == ( const char *pc ) const; + bool operator < ( const gcstring &str ) const; + bool operator > ( const gcstring &str ) const; + // to be removed? + operator const char * ( void ) const; + void operator delete ( void *pWhere ); + void operator delete ( void *pWhere, void *pNewWhere ); + void * operator new ( size_t uiSize ); + void * operator new ( size_t uiSize, void *pWhere ); + GCBASE_API + friend gcstring operator + ( const gcstring &left, const gcstring &right ); + GCBASE_API + friend gcstring operator + ( const gcstring &left, const char *right ); + GCBASE_API + friend gcstring operator + ( const char *left, const gcstring &right ); + + // Member + // ------------------------------------------------------------------------- + private: + std::string * _ps; + + // Constants + // ------------------------------------------------------------------------- + public: + static const size_t npos; + }; + + GCBASE_API + std::istream & getline ( std::istream& is, GenICam::gcstring& str ); + GCBASE_API + std::istream & getline ( std::istream& is, GenICam::gcstring& str, char delim ); +} + +//! STL operator out +//! \ingroup Base_PublicUtilities +inline std::ostream & operator <<(std::ostream &ostr, const GenICam::gcstring &str) { return ostr << str.c_str(); } + +//! STL operator in +//! \ingroup Base_PublicUtilities +inline std::istream & operator >>(std::istream &istr, GenICam::gcstring &str) +{ + std::string tmp; + istr >> tmp; + str = tmp.c_str(); + return istr; +} + +#pragma pack(pop) + +#endif // GENICAM_GCSTRING_H diff --git a/thirdparty/GenICam/include/Base/GCStringVector.h b/thirdparty/GenICam/include/Base/GCStringVector.h new file mode 100644 index 0000000..17d9801 --- /dev/null +++ b/thirdparty/GenICam/include/Base/GCStringVector.h @@ -0,0 +1,211 @@ +/**************************************************************************** + (c) 2005 by STEMMER IMAGING + + // License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + + +****************************************************************************/ + + /// \file + /// \brief Portable string vector implementation + /// \version $Revision: 1.12 $ + /// \date $Date: 2007/10/16 12:25:57 $ + /// \ingroup Base_PublicUtilities + + + +#ifndef GENICAM_GCSTRINGLIST_H +#define GENICAM_GCSTRINGLIST_H + +#include "GCTypes.h" +#include "GCString.h" + +#pragma pack(push, 8) + + +#if defined (_WIN32) + + +namespace std +{ + template class allocator; + template class vector; +} + +namespace GenICam +{ + + /** + \brief A vector of gcstrings which is a clone of std::vector + \ingroup Base_PublicUtilities + */ + class GCBASE_API gcstring_vector + { + // Nested types + // --------------------------------------------------------------------------- + public: + class GCBASE_API const_iterator + { + // Ctor / Dtor + // ------------------------------------------------------------------------- + public: + const_iterator ( gcstring *pStr = 0 ); + + // Operators + // ------------------------------------------------------------------------- + public: + const gcstring & operator * ( void ) const; + const gcstring * operator -> ( void ) const; + const_iterator & operator ++ ( void ); + const_iterator operator ++ ( int ); + const_iterator & operator -- ( void ); + const_iterator operator -- ( int ); + const_iterator & operator += ( intptr_t iInc ); + const_iterator operator + ( intptr_t iInc ) const; + const_iterator & operator -= ( intptr_t iDec ); + intptr_t operator - ( const const_iterator &iter ) const; + const_iterator operator - ( intptr_t iDec ) const; + const gcstring & operator [] ( intptr_t iIndex ) const; + bool operator == ( const const_iterator &iter ) const; + bool operator != ( const const_iterator &iter ) const; + bool operator < ( const const_iterator &iter ) const; + bool operator > ( const const_iterator &iter ) const; + bool operator <= ( const const_iterator &iter ) const; + bool operator >= ( const const_iterator &iter ) const; + GCBASE_API + friend const_iterator operator + ( intptr_t iInc, const const_iterator &iter); + + // Member + // ------------------------------------------------------------------------- + protected: + gcstring * _ps; + }; + + class GCBASE_API iterator : + public const_iterator + { + // Ctor / Dtor + // ------------------------------------------------------------------------- + public: + iterator ( gcstring *pStr = 0 ); + + // Operators + // ------------------------------------------------------------------------- + public: + gcstring & operator * ( void ) const; + gcstring * operator -> ( void ) const; + iterator & operator ++ ( void ); + iterator operator ++ ( int ); + iterator & operator -- ( void ); + iterator operator -- ( int ); + iterator & operator += ( intptr_t iInc ); + iterator operator + ( intptr_t iInc ) const; + iterator & operator -= ( intptr_t iDec ); + intptr_t operator - ( const iterator &iter ) const; + iterator operator - ( intptr_t iDec ) const; + gcstring & operator [] ( intptr_t iIndex ) const; + GCBASE_API + friend iterator operator + ( intptr_t iInc, const iterator &iter); + }; + + // Ctor / Dtor + // --------------------------------------------------------------------------- + public: + gcstring_vector ( void ); + explicit gcstring_vector ( size_t uiSize, const gcstring &str = gcstring() ); + gcstring_vector ( const gcstring_vector &obj); + virtual ~gcstring_vector ( void ); + + // Element access + // --------------------------------------------------------------------------- + public: + virtual void assign ( size_t n, const gcstring &val); + virtual void clear ( void ); + virtual iterator erase ( iterator pos ); + virtual gcstring & at ( size_t uiIndex ); + virtual const gcstring & at ( size_t uiIndex ) const; + virtual gcstring & back ( void ); + virtual const gcstring & back ( void ) const; + virtual iterator begin ( void ); + virtual const_iterator begin ( void ) const; + virtual size_t capacity ( void ) const; + virtual iterator end ( void ); + virtual const_iterator end ( void ) const; + virtual gcstring & front ( void ); + virtual const gcstring & front ( void ) const; + virtual size_t max_size ( void ) const; + virtual size_t size ( void ) const; + virtual iterator insert ( iterator pos, const gcstring &str ); + virtual bool empty ( void ) const; + virtual void pop_back ( void ); + virtual void push_back ( const gcstring &str ); + virtual void resize ( size_t uiSize, const gcstring &str = gcstring() ); + virtual void reserve ( size_t uiSize ); + + // Do not use the methods below - they only exist for + // backwards compatibility + virtual gcstring_vector & assign ( const gcstring_vector &obj ); + virtual void erase ( size_t uiIndex ); + virtual void insert ( size_t uiIndex, const gcstring &str ); + + + // Operators + // --------------------------------------------------------------------------- + public: + gcstring_vector & operator = ( const gcstring_vector &obj ); + gcstring & operator [] ( size_t uiIndex ); + const gcstring & operator [] ( size_t uiIndex ) const; + void operator delete ( void *pWhere ); + void * operator new ( size_t uiSize ); + + // Member + // --------------------------------------------------------------------------- + private: + std::vector > * const _pv; + }; +} + + +#elif defined (__GNUC__) || defined (__ELF__) + +#include + + +/* MANTIS 0000067 */ +namespace GenICam { typedef std::vector gcstring_vector; } + +inline GenICam::gcstring_vector::const_iterator +operator +(intptr_t i, const GenICam::gcstring_vector::const_iterator &it) +{ + return it + i; +} + +inline GenICam::gcstring_vector::iterator +operator +(intptr_t i, const GenICam::gcstring_vector::iterator &it) +{ + return it + i; +} + + +#else +# error No known support for shared libraries +#endif + +#pragma pack(pop) + +#endif // GENICAM_GCSTRINGLIST_H diff --git a/thirdparty/GenICam/include/Base/GCTypes.h b/thirdparty/GenICam/include/Base/GCTypes.h new file mode 100644 index 0000000..311e433 --- /dev/null +++ b/thirdparty/GenICam/include/Base/GCTypes.h @@ -0,0 +1,218 @@ +/**************************************************************************** + (c) 2004 by Basler Vision Technologies + (c) 2005 STEMMER IMAGING + + // License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + + +****************************************************************************/ + + /// \file + /// \brief Platform-dependent type definitions + /// \version $Revision: 1.15.2.3 $ + /// \date $Date: 2008/08/29 09:26:14 $ + /// \ingroup Base_PublicUtilities + + +#ifndef GENICAM_TYPES_H +#define GENICAM_TYPES_H + +#if defined (__unix__) +# define __STDC_LIMIT_MACROS +# define __STDC_CONSTANT_MACROS +# include +# include +# include +#elif defined (_WIN32) + //! \addtogroup Base_PublicUtilities + //! \{ + +// tag to perform 64 compatibility warnings checks on a type +# if !defined(GC_W64) +# if defined(_M_IX86) && _MSC_VER >= 1300 +# define GC_W64 __w64 +# else +# define GC_W64 +# endif +# endif + + //! makes int 8 portable across different platforms + typedef char int8_t; + //! makes char 8 portable across different platforms + typedef char char8_t; + //! makes unsigned char portable across different platforms + typedef unsigned char uint8_t; + //! makes char 8 portable across different platforms + typedef unsigned char uchar8_t; + + //! makes short portable across different platforms + typedef short int16_t; + //! makes unsigned short portable across different platforms + typedef unsigned short uint16_t; + + //! makes __int32 portable across different platforms + typedef __int32 int32_t; + //! makes unsigned int32 portable across different platforms + typedef unsigned __int32 uint32_t; + + //! makes int64 portable across different platforms + typedef __int64 int64_t; + //! makes unsigned int64 portable across different platforms + typedef unsigned __int64 uint64_t; + + //! use a universal platform dependend int + typedef __int64 int_t; + //! use a universal platform dependend unsigned int + typedef unsigned __int64 uint_t; + + #ifndef _SIZE_T_DEFINED + #ifdef _WIN64 + //! use a universal platform dependend unsigned int + typedef unsigned __int64 size_t; + #else + //! use a universal platform dependend unsigned int + typedef GC_W64 unsigned int size_t; + #endif + #define _SIZE_T_DEFINED + #endif + + #ifndef _INTPTR_T_DEFINED + #ifdef _WIN64 + //! use a universal platform dependend intptr_t + typedef __int64 intptr_t; + #else + //! use a universal platform dependend intptr_t + typedef GC_W64 int intptr_t; + #endif + #define _INTPTR_T_DEFINED + #endif + + #ifndef _UINTPTR_T_DEFINED + #ifdef _WIN64 + //! use a universal platform dependend uintptr_t + typedef unsigned __int64 uintptr_t; + #else + //! use a universal platform dependend intptr_t + typedef GC_W64 unsigned int uintptr_t; + #endif + #define _UINTPTR_T_DEFINED + #endif +#else +# error No platform-specific type definitions +#endif /* __unix__ */ + + + +#ifndef INT64_MAX +# define INT64_MAX 0x7fffffffffffffffLL /* maximum signed int64 value */ +#endif + +#ifndef INT64_MIN +# define INT64_MIN 0x8000000000000000LL /* minimum signed int64 value */ +#endif + +#ifndef UINT64_MAX +# define UINT64_MAX 0xffffffffffffffffULL /* maximum unsigned int64 value */ +#endif + +#ifndef INT32_MAX +# define INT32_MAX 0x000000007fffffffLL /* maximum signed int32 value */ +#endif + +#ifndef INT32_MIN +# define INT32_MIN 0xffffffff80000000LL /* minimum signed int32 value */ +#endif + +#ifndef UINT32_MAX +# define UINT32_MAX 0x00000000ffffffffULL /* maximum unsigned int32 value */ +#endif + +#ifndef INT8_MAX +# define INT8_MAX 0x000000000000007fLL /* maximum signed int8 value */ +#endif + +#ifndef INT8_MIN +# define INT8_MIN 0xffffffffffffff80LL /* minimum signed int8 value */ +#endif + +#ifndef UINT8_MAX +# define UINT8_MAX 0x00000000000000ffULL /* maximum unsigned int8 value */ +#endif + +//! \addtogroup Base_PublicUtilities +//! \{ + +// Utility Types +#if defined(__cplusplus) +//! 8 bit bool +typedef bool bool8_t; +#else +typedef uint8_t bool8_t; +#endif +//! universal pointer to 8 bit const char +typedef const char * pcchar8_t; +//! universal pointer to 8 bit char +typedef char * pchar8_t; +//! 32 bit floating point +typedef float float32_t; +//! 64 bit floating point +typedef double float64_t; + +//! \} + + + +// gc base import/export +#if defined(_MSC_VER) +# ifdef GCBASE_EXPORTS +# define GCBASE_API __declspec( dllexport ) +# else +# define GCBASE_API __declspec( dllimport ) +# endif +#elif defined (__GNUC__) +# if (__GNUC__ >= 4) && defined (__ELF__) +# define GCBASE_API __attribute__((visibility("default"))) +# else // (__GNUC__ >= 4) && defined (__ELF__) +# define GCBASE_API +# endif // (__GNUC__ >= 4) && defined (__ELF__) +#else +# error Unsupported compiler or platform +#endif + + + +//! version +typedef struct +{ + uint16_t Major; //!> a is incompatible with b if a != b + uint16_t Minor; //!> a is incompatible b a > b + uint16_t SubMinor; //!> a is aways compatible with b +} Version_t; + + +// mark a variable as unused. This prevents unused parameter/ unused local variable warnings on warning level 4. +#if defined(_MSC_VER) +# define GC_UNUSED(unused_var) (void)(unused_var) +#elif defined(__GNUC__) +# define GC_UNUSED(unused_var) // no changes to unused params with GCC +#else +# error Unsupported compiler or platform +#endif + + +#endif // GENICAM_TYPES_H diff --git a/thirdparty/GenICam/include/Base/GCUtilities.h b/thirdparty/GenICam/include/Base/GCUtilities.h new file mode 100644 index 0000000..06b573d --- /dev/null +++ b/thirdparty/GenICam/include/Base/GCUtilities.h @@ -0,0 +1,130 @@ +//----------------------------------------------------------------------------- +// (c) 2005 by Basler Vision Technologies +// Section: Vision Components +// Project: GenICam +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/Base/GCUtilities.h,v 1.11.2.2 2008/12/05 17:44:20 hartmut_nebelung Exp $ +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief GenICam common utilities +\ingroup Base_PublicUtilities +*/ + +#ifndef GENAPI_GENAPIUTILITIES_DEF_H_ +#define GENAPI_GENAPIUTILITIES_DEF_H_ + +#if defined (_WIN32) +# include +#endif + +#include "../GenICamVersion.h" + +#include "GCTypes.h" +#include "GCString.h" +#include "GCException.h" +#include "GCLinkage.h" + +namespace GenICam +{ + template + inline Td INTEGRAL_CAST2( Ts s ) + { + const Td d = static_cast( s ); + if ( !static_cast( d ) == s ){ + RUNTIME_EXCEPTION("INTEGRAL_CAST failed"); + } + return d; + } + template + inline T INTEGRAL_CAST( int64_t ll ) + { + return INTEGRAL_CAST2( ll ); + } + + //! Retrieve the value of an environment variable + //! \throw runtime_exception if not found + GCBASE_API gcstring GetValueOfEnvironmentVariable( const gcstring &Name ); + //! Replaces $(ENVIRONMENT_VARIABLES) in a string and replace ' ' with %20 + //! \ingroup Base_PublicUtilities + GCBASE_API void ReplaceEnvironmentVariables(gcstring &Buffer, bool ReplaceBlankBy20 = false); + + //! retrieve the root folder of the GenICam installation + /*! This function retrieves the content of the environment variable GENICAM_ROOT_V1_2 + whereas the actual version numbers depend on the GenICam version used + */ + GCBASE_API gcstring GetGenICamRootFolder(void); + + //! retrieves the bin folder of the GenICam installation + inline gcstring GetGenICamDLLFolder(void) + { + gcstring DLLFolder(GetGenICamRootFolder()); +#if defined (_MSC_VER) +# if defined (_WIN64) + DLLFolder += "\\Bin\\Win64_x64"; +# else + DLLFolder += "\\Bin\\Win32_i86"; +# endif +#elif defined (__GNUC__) +# if defined (__LP64__) + DLLFolder += "/lib64"; +# else + DLLFolder += "/lib"; +# endif +#else +# error Unknown Platform +#endif + + return DLLFolder; + } + + //! retrieves the full name of a module's DLL + inline gcstring GetGenICamDLLName(const gcstring& ModuleName ) + { + gcstring DLLName(ModuleName); + DLLName += DLL_SUFFIX; + return DLLName; + } + + //! retrieves the full path of a module's DLL + inline gcstring GetGenICamDLLPath(const gcstring& ModuleName ) + { + gcstring DLLPath(GetGenICamRootFolder()); +#if defined (_MSC_VER) +# if defined (_WIN64) + DLLPath += "\\Bin\\Win64_x64\\"; +# else + DLLPath += "\\Bin\\Win32_i86\\"; +# endif +#elif defined (__GNUC__) +# if defined (__LP64__) + DLLPath += "/lib64/"; +# else + DLLPath += "/lib/"; +# endif +#else +# error Unknown Platform +#endif + DLLPath += GetGenICamDLLName( ModuleName ); + return DLLPath; + } + +} + +#endif // GENAPI_GENAPIUTILITIES_DEF_H_ diff --git a/thirdparty/GenICam/include/GenApi/Callback.h b/thirdparty/GenICam/include/GenApi/Callback.h new file mode 100644 index 0000000..213ae16 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/Callback.h @@ -0,0 +1,123 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Hartmut Nebelung +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/Callback.h,v 1.9.2.1 2008/07/14 08:30:46 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of template Base_Callback1Body and Callback1 +\ingroup GenApi_PublicImpl + +Defines a bunch of templates for creating callback-functors taking 1 Parameter +(=> Callback1) and returning void. + +\note does not work with all stl containers, i.e. std::map + +*/ + +#ifndef GENAPI_CALLBACK_H +#define GENAPI_CALLBACK_H + +#include + +namespace GenApi +{ + /** + \brief abstract callback container + \ingroup GenApi_PublicImpl + */ + template + class Base_Callback1Body + { + public: + //! destructor + virtual ~Base_Callback1Body() + {}; + + //! do operation with P1 as argument + virtual void operator()(P1) const = 0; + + //! deep copy + virtual Base_Callback1Body* clone() const = 0; + }; + + /** + \brief callback object with one parameter P1 + \ingroup GenApi_PublicImpl + */ + template + class GENAPI_DECL Callback1 + { + public: + + //! constructor, taking lifetime control of body + Callback1( Base_Callback1Body* pBody) : + m_pBody(pBody) + { + } + + //! copy constructor doing deep copy + Callback1(const Callback1& callback) : + m_pBody(callback.m_pBody ? callback.m_pBody->clone() : NULL) + { + } + + //! destructor, destroying body + ~Callback1() + { + delete m_pBody; + m_pBody = NULL; + } + + //! assignment operator + Callback1& operator=(const Callback1& callback) + { + if (this != &callback) + { + delete m_pBody; + m_pBody = callback.m_pBody ? callback.m_pBody->clone() : NULL; + } + return *this; + } + + //! do operation defined in body + void operator()(P1 p1) + { + if (m_pBody) + (*m_pBody)(p1); + else + assert( false && "Callback1:Empty body" ); + } + + bool HasValidBody() const + { + return m_pBody != NULL; + } + + private: + Base_Callback1Body *m_pBody; + }; + + +} + +#endif // ifndef GENAPI_CALLBACK_H diff --git a/thirdparty/GenICam/include/GenApi/ChunkAdapter.h b/thirdparty/GenICam/include/GenApi/ChunkAdapter.h new file mode 100644 index 0000000..196a1b5 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/ChunkAdapter.h @@ -0,0 +1,108 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/ChunkAdapter.h,v 1.11 2007/08/16 13:56:37 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/** +\file +\brief Declaration of the CChunkAdapter class. +\ingroup GenApi_PublicUtilities +*/ + +#ifndef GENAPI_CHUNKADAPTER_H +#define GENAPI_CHUNKADAPTER_H + +#include "Types.h" +#include "INodeMap.h" +#include "ChunkPort.h" +#include + +#pragma warning( push ) +#pragma warning( disable: 4251 ) // GenApi::CChunkAdapter::m_pChunkPorts' : class 'std::vector<_Ty>' needs to have dll-interface + +namespace GenApi +{ + + // some useful macros + #if defined( _MSC_VER ) + #define PACK_STRUCT_FIELD(x) x + #define PACK_STRUCT_STRUCT + #else // assume GNU system + #define PACK_STRUCT_FIELD(x) x __attribute__((packed)) + #define PACK_STRUCT_STRUCT __attribute__((packed)) + #endif + + //! Delivers information about the attached chunks and nodes + //! \ingroup GenApi_PublicUtilities + typedef struct AttachStatistics_t + { + int NumChunkPorts; //!< Number of chunk ports found in the node map + int NumChunks; //!< Number of chunks found in the buffer + int NumAttachedChunks; //!< Number of chunks from the buffer attached to a chunk port + } AttachStatistics_t; + + + /** + \brief Connects a chunked buffer to a node map + \ingroup GenApi_PublicUtilities + */ + class GENAPI_DECL CChunkAdapter + { + + public: + //! Destructor + virtual ~CChunkAdapter(); + + //! Attaches to a node map and retrieves the chunk ports + void AttachNodeMap(INodeMap* pNodeMap); + + //! Detaches from the node map + void DetachNodeMap(); + + //! Checks if a buffer contains chunks in a known format + /*! Implement that for a specific buffer layout */ + virtual bool CheckBufferLayout(uint8_t *pBuffer, int64_t BufferLength) = 0; + + //! Attaches a buffer to the matching ChunkPort + /*! Implement that for a specific buffer layout */ + virtual void AttachBuffer(uint8_t *pBuffer, int64_t BufferLength, AttachStatistics_t *pAttachStatistics = NULL) = 0; + + //! Detaches a buffer + void DetachBuffer(); + + //! Updates the base address of the buffer + void UpdateBuffer(uint8_t *pBaseAddress); + + protected: + + //! Serves as default constructor + CChunkAdapter(INodeMap* pNodeMap = NULL); + + //! An array of attached ChunkPorts + std::vector m_pChunkPorts; + + }; + +} + +#pragma warning(pop) +#endif // GENAPI_CHUNKADAPTER_H diff --git a/thirdparty/GenICam/include/GenApi/ChunkAdapterDcam.h b/thirdparty/GenICam/include/GenApi/ChunkAdapterDcam.h new file mode 100644 index 0000000..f97cc50 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/ChunkAdapterDcam.h @@ -0,0 +1,97 @@ +//----------------------------------------------------------------------------- +// (c) 2004 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/ChunkAdapterDcam.h,v 1.7.2.2 2008/12/08 14:40:19 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/** +\file +\brief Declaration of the CChunkAdapterDcam class. +*/ + +#ifndef GENAPI_CHUNKADAPTERDCAM_H +#define GENAPI_CHUNKADAPTERDCAM_H + +#include "ChunkAdapter.h" +#include "impl/Compatibility.h" + +namespace GenApi +{ + // set the value of a GUID + #define SET_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ + name.Data1 = l, name.Data2 = w1, name.Data3 = w2, \ + name.Data4[0] = b1, name.Data4[1] = b2, name.Data4[2] = b3, name.Data4[3] = b4, \ + name.Data4[4] = b5, name.Data4[5] = b6, name.Data4[6] = b7, name.Data4[7] = b8 + + // make sure everything is properly packed + #pragma pack(push, 1) + + typedef struct DCAM_CHUNK_TRAILER + { + PACK_STRUCT_FIELD( GUID ChunkID ); + PACK_STRUCT_FIELD( uint32_t ChunkLength ); + PACK_STRUCT_FIELD( uint32_t InverseChunkLength ); + } PACK_STRUCT_STRUCT DCAM_CHUNK_TRAILER; + + typedef struct DCAM_CHECKSUM + { + PACK_STRUCT_FIELD( uint32_t CRCChecksum ); + } PACK_STRUCT_STRUCT DCAM_CHECKSUM; + + // restore the previous packing + #pragma pack(pop) + /* ------------------------------------------- */ + + //! Connects a chunked DCAM buffer to a node map + class GENAPI_DECL CChunkAdapterDcam : public CChunkAdapter + { + + public: + //! Constructor + CChunkAdapterDcam(INodeMap* pNodeMap = NULL); + + //! Destructor + virtual ~CChunkAdapterDcam(); + + //! Checks if a buffer contains chunks in a known format + virtual bool CheckBufferLayout(uint8_t *pBuffer, int64_t BufferLength); + + //! Attaches a buffer to the matching ChunkPort + virtual void AttachBuffer(uint8_t *pBuffer, int64_t BufferLength, AttachStatistics_t *pAttachStatistics = NULL); + + //! Checks if buffer has a CRC attached + bool HasCRC(uint8_t *pBuffer, int64_t BufferLength); + + //! Checks CRC sum of buffer + bool CheckCRC(uint8_t *pBuffer, int64_t BufferLength); + + protected: + //! Checks the CRC of a buffer + uint32_t CRC16(const unsigned char *pData, uint32_t nbyLength ); + + //! Checks the CRC of a buffer + bool CheckBuffer(const unsigned char* pData, uint32_t nbyLength ); + + }; + +} + +#endif // GENAPI_CHUNKADAPTERDCAM_H diff --git a/thirdparty/GenICam/include/GenApi/ChunkAdapterGEV.h b/thirdparty/GenICam/include/GenApi/ChunkAdapterGEV.h new file mode 100644 index 0000000..ddc2f8d --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/ChunkAdapterGEV.h @@ -0,0 +1,78 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/ChunkAdapterGEV.h,v 1.7.2.1 2008/12/08 14:40:19 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/** +\file +\brief Declaration of the CChunkAdapterGEV class. +*/ + +#ifndef GENAPI_CHUNKADAPTERGEV_H +#define GENAPI_CHUNKADAPTERGEV_H + +#include "ChunkAdapter.h" + +namespace GenApi +{ + + /* ------------------------------------------- */ + // Declartion of GigE Vision Chunk message trailer + + // make sure everything is properly packed + #pragma pack(push, 1) + + //! header of a GVCP request packet + typedef struct GVCP_CHUNK_TRAILER + { + PACK_STRUCT_FIELD(uint32_t ChunkID); + PACK_STRUCT_FIELD(uint32_t ChunkLength); + } + PACK_STRUCT_STRUCT GVCP_CHUNK_TRAILER; + + // restore the previous packing + #pragma pack(pop) + /* ------------------------------------------- */ + + + //! Connects a chunked DCAM buffer to a node map + class GENAPI_DECL CChunkAdapterGEV : public CChunkAdapter + { + + public: + //! Constructor + CChunkAdapterGEV(INodeMap* pNodeMap = NULL); + + //! Destructor + virtual ~CChunkAdapterGEV(); + + //! Checks if a buffer contains chunks in a known format + virtual bool CheckBufferLayout(uint8_t *pBuffer, int64_t BufferLength); + + //! Attaches a buffer to the matching ChunkPort + virtual void AttachBuffer(uint8_t *pBuffer, int64_t BufferLength, AttachStatistics_t *pAttachStatistics = NULL); + + }; + +} + +#endif // GENAPI_CHUNKADAPTERGEV_H diff --git a/thirdparty/GenICam/include/GenApi/ChunkPort.h b/thirdparty/GenICam/include/GenApi/ChunkPort.h new file mode 100644 index 0000000..66eaaa4 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/ChunkPort.h @@ -0,0 +1,145 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/ChunkPort.h,v 1.13 2008/01/16 13:35:33 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/** +\file +\brief Declaration of the CChunkPort class. +\ingroup GenApi_PublicUtilities +*/ + +#ifndef GENAPI_CHUNKPORT_H +#define GENAPI_CHUNKPORT_H + +#include "GenApi.h" + +#pragma warning(push) +#pragma warning(disable: 4251) // GenApi::CChunkPort::m_ptrPort' : class 'GenApi::CPointer' needs to have dll-interface +#pragma warning ( disable : 4068 ) // unknown pragma; refers to BullsEyeCoverage + +namespace GenApi +{ + + /** + \brief Port attachable to a chunk in a buffer + \ingroup GenApi_PublicUtilities + */ + class GENAPI_DECL CChunkPort : public IPortConstruct + { + + public: + //! Constructor; can attach to a port + CChunkPort(IPort* pPort = NULL); + + //! Destructor; detaches from the port + ~CChunkPort(); + + //------------------------------------------------------------- + // IPortConstruct implementation + //------------------------------------------------------------- + + //! Get the access mode of the node + virtual EAccessMode GetAccessMode() const; + + //! Reads a chunk of bytes from the port + virtual void Read(void *pBuffer, int64_t Address, int64_t Length); + + //! Writes a chunk of bytes to the port + virtual void Write(const void *pBuffer, int64_t Address, int64_t Length); + + //! Called from the port node to give the chunk port a pointer to itself + virtual void SetPortImpl(GenApi::IPort* pPort); + + //! Determines if the port adapter must perform an endianess swap + #pragma BullseyeCoverage off + virtual EYesNo GetSwapEndianess() + { + return No; + } + #pragma BullseyeCoverage on + + //--------------------------------------------------------------- + // Implementation + //--------------------------------------------------------------- + + // Invalidates the chunk port node + void InvalidateNode(); + + //------------------------------------------------------------- + // Initializing + //------------------------------------------------------------- + + //! Attaches the ChunkPort to the Port + bool AttachPort(GenApi::IPort* pPort); + + //! Detaches the ChunkPort to the Port + void DetachPort(); + + //! Attaches the Chunk to the ChunkPort + void AttachChunk(uint8_t *pBaseAddress, int64_t ChunkOffset, int64_t Length); + + //! Detaches the Chunk from the ChunkPort + void DetachChunk(); + + //! Gets the ChunkID length + int GetChunkIDLength() + { + return m_ChunkIDLength; + } + + //! Checks if a ChunkID matches + bool CheckChunkID(uint8_t* pChunkIDBuffer, int ChunkIDLength); + + //! Updates the base address of the chunk + void UpdateBuffer(uint8_t *pBaseAddress); + + protected: + + //------------------------------------------------------------- + // Member variables + //------------------------------------------------------------- + + //! Pointer to the begin of the buffer + uint8_t *m_pBaseAddress; + + //! The chunk's offset within the buffer + int64_t m_ChunkOffset; + + //! Length of the chunk + int64_t m_Length; + + //! Pointer to the node holding a reference to this implementation + CNodePtr m_ptrPort; + + //! Binary version of the chunk ID + uint8_t *m_pChunkIDBuffer; + + //! Length of the chunk ID buffer + int m_ChunkIDLength; + }; + +} + +#pragma warning(pop) + +#endif // GENAPI_CHUNKPORT_H diff --git a/thirdparty/GenICam/include/GenApi/Container.h b/thirdparty/GenICam/include/GenApi/Container.h new file mode 100644 index 0000000..b17cfbf --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/Container.h @@ -0,0 +1,412 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Alex Happe +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/Container.h,v 1.9 2007/10/16 12:25:57 alexander_happe Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/** +\file +\brief Portable container classes for INode & IValue pointers. +\ingroup GenApi_PublicImpl +*/ + +#ifndef GENICAM_GENAPI_NODEVECTOR_H +#define GENICAM_GENAPI_NODEVECTOR_H + + +#include "GenApiDll.h" + +#if defined (_WIN32) + + +namespace std +{ + template class allocator; + template class vector; +} + + +namespace GenApi +{ + struct INode; + struct IValue; + + + //************************************************************* + // N O D E _ V E C T O R + //************************************************************* + + /** + \brief A vector of INode pointers + \ingroup GenApi_PublicImpl + */ + class GENAPI_DECL node_vector + { + typedef INode* T; + + // Nested types + // --------------------------------------------------------------------------- + public: + class GENAPI_DECL const_iterator + { + // iterator traits + // ------------------------------------------------------------------------ + public: + typedef std::random_access_iterator_tag iterator_category; + typedef T value_type; + typedef ptrdiff_t difference_type; + typedef T* pointer; + typedef T& reference; + // Ctor / Dtor + // ------------------------------------------------------------------------- + public: + const_iterator ( T *pPtr = 0 ); + + // Operators + // ------------------------------------------------------------------------- + public: + const T & operator * ( void ) const; + const_iterator & operator ++ ( void ); + const_iterator operator ++ ( int ); + const_iterator & operator -- ( void ); + const_iterator operator -- ( int ); + const_iterator & operator += ( intptr_t iInc ); + const_iterator operator += ( intptr_t iInc ) const; + const_iterator operator + ( intptr_t iInc ) const; + const_iterator & operator -= ( intptr_t iDec ); + const_iterator operator -= ( intptr_t iDec ) const; + intptr_t operator - ( const const_iterator &iter ) const; + const_iterator operator - ( intptr_t iDec ) const; + const T & operator [] ( intptr_t iIndex ) const; + bool operator == ( const const_iterator &iter ) const; + bool operator != ( const const_iterator &iter ) const; + bool operator < ( const const_iterator &iter ) const; + bool operator > ( const const_iterator &iter ) const; + bool operator <= ( const const_iterator &iter ) const; + bool operator >= ( const const_iterator &iter ) const; + GENAPI_DECL + friend const_iterator operator + ( intptr_t iInc, const const_iterator &iter); + + // Member + // ------------------------------------------------------------------------- + protected: + T * _ps; + }; + + class GENAPI_DECL iterator : + public const_iterator + { + public: + // iterator traits + // ------------------------------------------------------------------------- + typedef std::random_access_iterator_tag iterator_category; + typedef T value_type; + typedef const_iterator::difference_type difference_type; + typedef const_iterator::pointer pointer; + typedef const_iterator::reference reference; + // Ctor / Dtor + // ------------------------------------------------------------------------- + public: + iterator ( T *pPtr = 0 ); + + // Operators + // ------------------------------------------------------------------------- + public: + T & operator * ( void ) const; + iterator & operator ++ ( void ); + iterator operator ++ ( int ); + iterator & operator -- ( void ); + iterator operator -- ( int ); + iterator & operator += ( intptr_t iInc ); + iterator operator += ( intptr_t iInc ) const; + iterator operator + ( intptr_t iInc ) const; + iterator & operator -= ( intptr_t iDec ); + iterator operator -= ( intptr_t iDec ) const; + intptr_t operator - ( const iterator &iter ) const; + iterator operator - ( intptr_t iDec ) const; + T & operator [] ( intptr_t iIndex ) const; + GENAPI_DECL + friend iterator operator + ( intptr_t iInc, const iterator &iter); + }; + + // Ctor / Dtor + // --------------------------------------------------------------------------- + public: + node_vector ( void ); + explicit node_vector ( size_t uiSize); + node_vector ( const node_vector &obj); + virtual ~node_vector ( void ); + + // Element access + // --------------------------------------------------------------------------- + public: + virtual void assign ( size_t n, const T &val ); + virtual void clear ( void ); + virtual iterator erase ( iterator pos ); + virtual T & at ( size_t uiIndex ); + virtual const T & at ( size_t uiIndex ) const; + virtual T & back ( void ); + virtual const T & back ( void ) const; + virtual iterator begin ( void ); + virtual const_iterator begin ( void ) const; + virtual size_t capacity ( void ) const; + virtual iterator end ( void ); + virtual const_iterator end ( void ) const; + virtual T & front ( void ); + virtual const T & front ( void ) const; + virtual size_t max_size ( void ) const; + virtual size_t size ( void ) const; + virtual iterator insert ( iterator pos, const T& val) ; + virtual bool empty ( void ) const; + virtual void pop_back ( void ); + virtual void push_back ( const T &val ); + virtual void resize ( size_t uiSize ); + virtual void reserve ( size_t uiSize ); + + // Do not use - only left in for backwards compatibility! + virtual void erase (size_t uiIndex); + virtual void insert (size_t uiIndex, const T &val); + +// Operators + // --------------------------------------------------------------------------- + public: + node_vector & operator = ( const node_vector &obj ); + T & operator [] ( size_t uiIndex ); + const T & operator [] ( size_t uiIndex ) const; + void operator delete ( void *pWhere ); + void * operator new ( size_t uiSize ); + + // Member + // --------------------------------------------------------------------------- + private: + typedef std::vector > vector_t; + vector_t *_pv; + }; + + + + //************************************************************* + // V A L U E _ V E C T O R + //************************************************************* + + /** + \brief A vector of IValue pointers + \ingroup GenApi_PublicImpl + */ + class GENAPI_DECL value_vector + { + typedef IValue* T; + // Nested types + // --------------------------------------------------------------------------- + public: + class GENAPI_DECL const_iterator + { + // iterator traits + // ------------------------------------------------------------------------ + public: + typedef std::random_access_iterator_tag iterator_category; + typedef T value_type; + typedef ptrdiff_t difference_type; + typedef T* pointer; + typedef T& reference; + + // Ctor / Dtor + // ------------------------------------------------------------------------- + public: + const_iterator ( T *pPtr = 0 ); + + // Operators + // ------------------------------------------------------------------------- + public: + const T & operator * ( void ) const; + const_iterator & operator ++ ( void ); + const_iterator operator ++ ( int ); + const_iterator & operator -- ( void ); + const_iterator operator -- ( int ); + const_iterator & operator += ( intptr_t iInc ); + const_iterator operator += ( intptr_t iInc ) const; + const_iterator operator + ( intptr_t iInc ) const; + const_iterator & operator -= ( intptr_t iDec ); + const_iterator operator -= ( intptr_t iDec ) const; + intptr_t operator - ( const const_iterator &iter ) const; + const_iterator operator - ( intptr_t iDec ) const; + const T & operator [] ( intptr_t iIndex ) const; + bool operator == ( const const_iterator &iter ) const; + bool operator != ( const const_iterator &iter ) const; + bool operator < ( const const_iterator &iter ) const; + bool operator > ( const const_iterator &iter ) const; + bool operator <= ( const const_iterator &iter ) const; + bool operator >= ( const const_iterator &iter ) const; + GENAPI_DECL + friend const_iterator operator + ( intptr_t iInc, const const_iterator &iter); + + // Member + // ------------------------------------------------------------------------- + protected: + T * _ps; + }; + + class GENAPI_DECL iterator : + public const_iterator + { + public: + // iterator traits + // ------------------------------------------------------------------------- + typedef std::random_access_iterator_tag iterator_category; + typedef T value_type; + typedef const_iterator::difference_type difference_type; + typedef const_iterator::pointer pointer; + typedef const_iterator::reference reference; + // Ctor / Dtor + // ------------------------------------------------------------------------- + public: + iterator ( T *pPtr = 0 ); + + // Operators + // ------------------------------------------------------------------------- + public: + T & operator * ( void ) const; + iterator & operator ++ ( void ); + iterator operator ++ ( int ); + iterator & operator -- ( void ); + iterator operator -- ( int ); + iterator & operator += ( intptr_t iInc ); + iterator operator += ( intptr_t iInc ) const; + iterator operator + ( intptr_t iInc ) const; + iterator & operator -= ( intptr_t iDec ); + iterator operator -= ( intptr_t iDec ) const; + intptr_t operator - ( const iterator &iter ) const; + iterator operator - ( intptr_t iDec ) const; + T & operator [] ( intptr_t iIndex ) const; + GENAPI_DECL + friend iterator operator + ( intptr_t iInc, const iterator &iter); + }; + + // Ctor / Dtor + // --------------------------------------------------------------------------- + public: + value_vector ( void ); + explicit value_vector ( size_t uiSize); + value_vector ( const value_vector &obj); + virtual ~value_vector ( void ); + + // Element access + // --------------------------------------------------------------------------- + public: + virtual void assign ( size_t n, const T &obj ); + virtual void clear ( void ); + virtual iterator erase ( iterator pos ); + virtual T & at ( size_t uiIndex ); + virtual const T & at ( size_t uiIndex ) const; + virtual T & back ( void ); + virtual const T & back ( void ) const; + virtual iterator begin ( void ); + virtual const_iterator begin ( void ) const; + virtual size_t capacity ( void ) const; + virtual iterator end ( void ); + virtual const_iterator end ( void ) const; + virtual T & front ( void ); + virtual const T & front ( void ) const; + virtual size_t max_size ( void ) const; + virtual size_t size ( void ) const; + virtual iterator insert ( iterator pos, const T& val) ; + virtual bool empty ( void ) const; + virtual void pop_back ( void ); + virtual void push_back ( const T &val ); + virtual void resize ( size_t uiSize, const T &val ); + virtual void reserve ( size_t uiSize ); + + + // Do not use - only left in for backwards compatibility! + virtual void erase (size_t uiIndex); + virtual void insert (size_t uiIndex, const T &val); + +// Operators + // --------------------------------------------------------------------------- + public: + value_vector & operator = ( const value_vector &obj ); + T & operator [] ( size_t uiIndex ); + const T & operator [] ( size_t uiIndex ) const; + void operator delete ( void *pWhere ); + void * operator new ( size_t uiSize ); + + // Member + // --------------------------------------------------------------------------- + private: + typedef std::vector > vector_t; + vector_t *_pv; + }; + + //! a list of feature references + typedef value_vector FeatureList_t; +} // namespace GenApi; + + + +#elif defined (__GNUC__) && defined (__ELF__) + +#include +#include + +namespace GenApi +{ + struct INode; + struct IValue; + + // ELF shared libraries do not have the problems addressed + // by the wrapper. + /* MANTIS 0000067 */ + typedef std::vector node_vector; + typedef std::vector value_vector; + + //! a list of feature references + typedef value_vector FeatureList_t; +} // namespace GenApi; + +inline GenApi::node_vector::const_iterator +operator +(intptr_t i, const GenApi::node_vector::const_iterator &it) +{ + return it + i; +} + +inline GenApi::node_vector::iterator +operator +(intptr_t i, const GenApi::node_vector::iterator &it) +{ + return it + i; +} + +inline GenApi::value_vector::const_iterator +operator +(intptr_t i, const GenApi::value_vector::const_iterator &it) +{ + return it + i; +} + +inline GenApi::value_vector::iterator +operator +(intptr_t i, const GenApi::value_vector::iterator &it) +{ + return it + i; +} + +#else +# error Unknown platform +#endif + +#endif // GENICAM_GENAPI_NODEVECTOR_H diff --git a/thirdparty/GenICam/include/GenApi/DLLLoad.h b/thirdparty/GenICam/include/GenApi/DLLLoad.h new file mode 100644 index 0000000..9af8889 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/DLLLoad.h @@ -0,0 +1,56 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/DLLLoad.h,v 1.7 2007/02/16 16:47:15 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of function for laoding a DLL dynamically +\ingroup GenApi_PublicImpl +*/ + +#ifndef GENAPI_DLLLOAD_H +#define GENAPI_DLLLOAD_H + +#include +#include + +#if defined (_MSC_VER) +// nothing +#elif defined (__GNUC__) +# define __cdecl __attribute__((cdecl)) +#else +# error Unsupported compiler +#endif + +namespace GenApi +{ + //! Function prototype for the create function implemented by GenApi DLLs + //! \ingroup GenApi_PublicImpl + typedef INodeMap* (__cdecl * Create_f)(const char* pDeviceName); + + //! Function prototype for checking the DLL's GenApi version + //! \ingroup GenApi_PublicImpl + typedef void (__cdecl * GetGenApiVersion_f)(Version_t &Version); +} + +#endif // ifndef GENAPI_DLLLOAD_H diff --git a/thirdparty/GenICam/include/GenApi/EnumClasses.h b/thirdparty/GenICam/include/GenApi/EnumClasses.h new file mode 100644 index 0000000..aa99e52 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/EnumClasses.h @@ -0,0 +1,487 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/EnumClasses.h,v 1.5 2007/08/16 13:56:38 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of enum classes for Sign, Endianess, Access mode and Visibility +*/ + +#ifndef GENAPI_ENUMCLASSES_H +#define GENAPI_ENUMCLASSES_H +#include "Types.h" + +namespace GenApi +{ + //************************************************************* + // Build in enummeration classes + //************************************************************* + + //! ESignClass holds conversion methods for the sign enumeration + + class GENAPI_DECL ESignClass + { + public: + //! Converts a string to enum value + static bool FromString(const GenICam::gcstring &ValueStr, ESign *pValue) + { + if (!pValue) return false; + if( ValueStr == "Signed" ) + *pValue = Signed; + else if( ValueStr == "Unsigned" ) + *pValue = Unsigned; + else + return false; + return true; + } + //! Converts a string to an int32_t property + static void ToString(GenICam::gcstring &ValueStr, ESign *pValue) + { + + if( ! pValue ) throw INVALID_ARGUMENT_EXCEPTION( "NULL argument pValue" ); + if( *pValue == Signed ) + ValueStr = "Signed"; + else if( *pValue == Unsigned ) + ValueStr = "Unsigned"; + else + ValueStr = "_UndefinedSign"; + } + + //! Converts a string to an int32_t property + static GenICam::gcstring ToString(ESign Value) + { + GenICam::gcstring Result; + ToString(Result, &Value); + return Result; + } + }; + + /** + \brief EEndianessClass holds conversion methods for the endianess enumeration + */ + class GENAPI_DECL EEndianessClass + { + public: + //! Converts a string to enum value + static bool FromString(const GenICam::gcstring &ValueStr, EEndianess *pValue) + { + if (!pValue) return false; + if( ValueStr == "BigEndian" ) + *pValue = BigEndian; + else if( ValueStr == "LittleEndian" ) + *pValue = LittleEndian; + else + return false; + return true; + } + //! Converts a string to an int32_t property + static void ToString(GenICam::gcstring &ValueStr, EEndianess *pValue) + { + + if( ! pValue ) throw INVALID_ARGUMENT_EXCEPTION( "NULL argument pValue" ); + if( *pValue == BigEndian ) + ValueStr = "BigEndian"; + else if( *pValue == LittleEndian ) + ValueStr = "LittleEndian"; + else + ValueStr = "_UndefinedEndian"; + } + + //! Converts a string to an int32_t property + static GenICam::gcstring ToString(EEndianess Value) + { + GenICam::gcstring Result; + ToString(Result, &Value); + return Result; + } + }; + + /** + \brief ERepresentationClass holds conversion methods for the representation enumeration + */ + class GENAPI_DECL ERepresentationClass + { + public: + //! Converts a string to enum value + static bool FromString(const GenICam::gcstring &ValueStr, ERepresentation *pValue) + { + if (!pValue) return false; + if( ValueStr == "Linear" ) + *pValue = Linear; + else if( ValueStr == "Logarithmic" ) + *pValue = Logarithmic; + else if( ValueStr == "Boolean" ) + *pValue = Boolean; + else if( ValueStr == "PureNumber" ) + *pValue = PureNumber; + else if( ValueStr == "HexNumber" ) + *pValue = HexNumber; + else + return false; + return true; + } + //! Converts a string to an int32_t property + static void ToString(GenICam::gcstring &ValueStr, ERepresentation *pValue) + { + if( ! pValue ) throw INVALID_ARGUMENT_EXCEPTION( "NULL argument pValue" ); + if( *pValue == Linear ) + ValueStr = "Linear"; + else if( *pValue == Logarithmic ) + ValueStr = "Logarithmic"; + else if( *pValue == Boolean ) + ValueStr = "Boolean"; + else if( *pValue == PureNumber ) + ValueStr = "PureNumber"; + else if( *pValue == HexNumber ) + ValueStr = "HexNumber"; + else + ValueStr = "_UndefinedRepresentation"; + } + + //! Converts a string to an int32_t property + static GenICam::gcstring ToString(ERepresentation Value) + { + GenICam::gcstring Result; + ToString(Result, &Value); + return Result; + } + }; + + /** + \brief EVisibilityClass holds conversion methods for the visibility enumeration + */ + class GENAPI_DECL EVisibilityClass + { + public: + //! Converts a string to enum value + static bool FromString(const GenICam::gcstring &ValueStr, EVisibility *pValue) + { + if (!pValue) return false; + if( ValueStr == "Beginner" ) + *pValue = Beginner; + else if( ValueStr == "Expert" ) + *pValue = Expert; + else if( ValueStr == "Guru" ) + *pValue = Guru; + else if( ValueStr == "Invisible" ) + *pValue = Invisible; + else + return false; + return true; + } + //! Converts a string to an int32_t property + static void ToString(GenICam::gcstring &ValueStr, EVisibility *pValue) + { + if( ! pValue ) throw INVALID_ARGUMENT_EXCEPTION( "NULL argument pValue" ); + if( *pValue == Beginner ) + ValueStr = "Beginner"; + else if( *pValue == Expert ) + ValueStr = "Expert"; + else if( *pValue == Guru ) + ValueStr = "Guru"; + else if( *pValue == Invisible ) + ValueStr = "Invisible"; + else + ValueStr = "_UndefinedVisibility"; + } + //! Converts a string to an int32_t property + static GenICam::gcstring ToString(EVisibility Value) + { + GenICam::gcstring Result; + ToString(Result, &Value); + return Result; + } + }; + + /** + \brief EAccessModeClass holds conversion methods for the access mode enumeration + */ + class GENAPI_DECL EAccessModeClass + { + public: + //! Converts a string to enum value + static bool FromString(const GenICam::gcstring &ValueStr, EAccessMode *pValue) + { + + if (!pValue) return false; + if( ValueStr == "RW" ) + *pValue = RW; + else if( ValueStr == "RO" ) + *pValue = RO; + else if( ValueStr == "WO" ) + *pValue = WO; + else if( ValueStr == "NA" ) + *pValue = NA; + else if( ValueStr == "NI" ) + *pValue = NI; + else + return false; + return true; + } + //! Converts a string to an int32_t property + static void ToString(GenICam::gcstring &ValueStr, EAccessMode *pValue) + { + if( ! pValue ) throw INVALID_ARGUMENT_EXCEPTION( "NULL argument pValue" ); + if( *pValue == RW ) + ValueStr = "RW"; + else if( *pValue == RO ) + ValueStr = "RO"; + else if( *pValue == WO ) + ValueStr = "WO"; + else if( *pValue == NI ) + ValueStr = "NI"; + else if( *pValue == NA ) + ValueStr = "NA"; + else + ValueStr = "_UndefinedAccessMode"; + } + + //! Converts a string to an int32_t property + static GenICam::gcstring ToString(EAccessMode Value) + { + GenICam::gcstring Result; + ToString(Result, &Value); + return Result; + } + }; + + /** + \brief ECachingModeClass holds conversion methods for the caching mode enumeration + */ + class GENAPI_DECL ECachingModeClass + { + public: + //! Converts a string to enum value + static bool FromString(const GenICam::gcstring &ValueStr, ECachingMode *pValue ) + { + if( ! pValue ) return false; + if( ValueStr == "NoCache" ) + *pValue = NoCache; + else if( ValueStr == "WriteThrough" ) + *pValue = WriteThrough; + else if( ValueStr == "WriteAround" ) + *pValue = WriteAround; + else + return false; + return true; + } + static void ToString(GenICam::gcstring &ValueStr, ECachingMode *pValue) + { + if( ! pValue ) throw INVALID_ARGUMENT_EXCEPTION( "NULL argument pValue" ); + if( *pValue == NoCache ) + ValueStr = "NoCache"; + else if( *pValue == WriteThrough ) + ValueStr = "WriteThrough"; + else if( *pValue == WriteAround ) + ValueStr = "WriteAround"; + else + ValueStr = "_UndefinedCachingMode"; + } + //! Converts a string to an int32_t property + static GenICam::gcstring ToString(ECachingMode Value) + { + GenICam::gcstring Result; + ToString(Result, &Value); + return Result; + } + + }; + + /** + \brief Holds conversion methods for the namespace enumeration + */ + class GENAPI_DECL ENameSpaceClass + { + public: + //! Converts a string to enum value + static bool FromString(const GenICam::gcstring &ValueStr, ENameSpace *pValue) + { + if (!pValue) return false; + if( ValueStr == "Custom" ) + *pValue = Custom; + else if( ValueStr == "Standard" ) + *pValue = Standard; + else + return false; + return true; + } + //! Converts a string to an int32_t property + static void ToString(GenICam::gcstring &ValueStr, ENameSpace *pValue) + { + if( ! pValue ) throw INVALID_ARGUMENT_EXCEPTION( "NULL argument pValue" ); + if( *pValue == Custom ) + ValueStr = "Custom"; + else if( *pValue == Standard ) + ValueStr = "Standard"; + else + ValueStr = "_UndefinedNameSpace"; + } + //! Converts a string to an int32_t property + static GenICam::gcstring ToString(ENameSpace Value) + { + GenICam::gcstring Result; + ToString(Result, &Value); + return Result; + } + }; + + /** + \brief Holds conversion methods for the standard namespace enumeration + */ + class GENAPI_DECL EYesNoClass + { + public: + //! Converts a string to enum value + static bool FromString(const GenICam::gcstring &ValueStr, EYesNo *pValue) + { + if (!pValue) return false; + if( ValueStr == "Yes" ) + *pValue = Yes; + else if( ValueStr == "No" ) + *pValue = No; + else + return false; + return true; + } + //! Converts a string to an int32_t property + static void ToString(GenICam::gcstring &ValueStr, EYesNo *pValue) + { + if( ! pValue ) throw INVALID_ARGUMENT_EXCEPTION( "NULL argument pValue" ); + if( *pValue == Yes) + ValueStr = "Yes"; + else if( *pValue == No ) + ValueStr = "No"; + else + ValueStr = "_UndefinedYesNo"; + } + + //! Converts a string to an int32_t property + static GenICam::gcstring ToString(EYesNo Value) + { + GenICam::gcstring Result; + ToString(Result, &Value); + return Result; + } + }; + + /** + \brief Holds conversion methods for the standard namespace enumeration + */ + class GENAPI_DECL EStandardNameSpaceClass + { + public: + //! Converts a string to enum value + static bool FromString(const GenICam::gcstring &ValueStr, EStandardNameSpace *pValue) + { + if (!pValue) return false; + if( ValueStr == "None" ) + *pValue = None; + else if( ValueStr == "GEV" ) + *pValue = GEV; + else if( ValueStr == "IIDC" ) + *pValue = IIDC; + else if( ValueStr == "CL" ) + *pValue = CL; + else + return false; + return true; + } + //! Converts a string to an int32_t property + static void ToString(GenICam::gcstring &ValueStr, EStandardNameSpace *pValue) + { + if( ! pValue ) throw INVALID_ARGUMENT_EXCEPTION( "NULL argument pValue" ); + if( *pValue == None ) + ValueStr = "None"; + else if( *pValue == GEV ) + ValueStr = "GEV"; + else if( *pValue == IIDC ) + ValueStr = "IIDC"; + else if( *pValue == CL ) + ValueStr = "CL"; + else + ValueStr = "_UndefinedStandardNameSpace"; + } + //! Converts a string to an int32_t property + static GenICam::gcstring ToString(EStandardNameSpace Value) + { + GenICam::gcstring Result; + ToString(Result, &Value); + return Result; + } + }; + + /** + \brief Holds conversion methods for the converter formulas + */ + class GENAPI_DECL ESlopeClass + { + public: + //! Converts a string to enum value + static bool FromString(const GenICam::gcstring &ValueStr, ESlope *pValue) + { + if (!pValue) + return false; + + if( ValueStr == "Increasing" ) + *pValue = Increasing; + else if( ValueStr == "Decreasing" ) + *pValue = Decreasing; + else if( ValueStr == "Varying" ) + *pValue = Varying; + else if( ValueStr == "Automatic" ) + *pValue = Automatic; + else + return false; + + return true; + } + //! Converts a string to an int32_t property + static void ToString(GenICam::gcstring &ValueStr, ESlope *pValue) + { + if( ! pValue ) + throw INVALID_ARGUMENT_EXCEPTION( "NULL argument pValue" ); + + if( *pValue == Increasing ) + ValueStr = "Increasing"; + else if( *pValue == Decreasing ) + ValueStr = "Decreasing"; + else if( *pValue == Varying ) + ValueStr = "Varying"; + else if( *pValue == Automatic ) + ValueStr = "Automatic"; + else + ValueStr = "_UndefinedESlope"; + } + //! Converts a string to an int32_t property + static GenICam::gcstring ToString(ESlope Value) + { + GenICam::gcstring Result; + ToString(Result, &Value); + return Result; + } + }; + +}; + + +#endif // ifndef GENAPI_ENUMCLASSES_H diff --git a/thirdparty/GenICam/include/GenApi/EventAdapter.h b/thirdparty/GenICam/include/GenApi/EventAdapter.h new file mode 100644 index 0000000..597d04d --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/EventAdapter.h @@ -0,0 +1,78 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/EventAdapter.h,v 1.8 2007/08/16 13:56:38 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/** +\file +\brief Declaration of the CEventAdapter class. +\ingroup GenApi_PublicUtilities +*/ + +#ifndef GENAPI_EVENTADAPTER_H +#define GENAPI_EVENTADAPTER_H + +#include "Types.h" +#include "INodeMap.h" +#include "EventPort.h" + +#include + +namespace GenApi +{ + + /** + \brief Delivers Events to ports + \ingroup GenApi_PublicUtilities + */ + class GENAPI_DECL CEventAdapter + { + + public: + //! Constructor + CEventAdapter(INodeMap* pNodeMap = NULL); + + //! Destructor + virtual ~CEventAdapter(); + + //! Attaches to a node map and retrieves the chunk ports + virtual void AttachNodeMap(INodeMap* pNodeMap); + + //! Detaches from the node emap + virtual void DetachNodeMap(); + + //! Deliver message + virtual void DeliverMessage( const uint8_t msg[], uint32_t numBytes ) = 0; + + + protected: + + //! An array of attached ChunkPorts +#pragma warning( push ) +#pragma warning( disable: 4251 ) + std::vector m_pEventPorts; +#pragma warning( pop ) + }; + +} + +#endif // GENAPI_EVENTADAPTER_H diff --git a/thirdparty/GenICam/include/GenApi/EventAdapter1394.h b/thirdparty/GenICam/include/GenApi/EventAdapter1394.h new file mode 100644 index 0000000..84acf9f --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/EventAdapter1394.h @@ -0,0 +1,86 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Hartmut Nebelung +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/EventAdapter1394.h,v 1.2 2007/08/16 13:56:38 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/** +\file +\brief Declaration of the CEventAdapter1394 class. +*/ +#ifndef __EVENTADAPTER1394_H__ +#define __EVENTADAPTER1394_H__ + + +#if _MSC_VER > 1000 +#pragma once +#endif + +#include "EventAdapter.h" +#include "Log.h" + +namespace GenApi +{ + // the opaque event data on IEEE 1394 + struct EventData1394; + + //! Distribute the events to the node map + class GENAPI_DECL CEventAdapter1394 : public GenApi::CEventAdapter + { + public: + //! constructor + explicit CEventAdapter1394( INodeMap* pNodeMap=NULL ); + private: + //! not implemented: copy constructor + CEventAdapter1394( const CEventAdapter1394& ); + //! not implemented: assignment operator + CEventAdapter1394& operator=( const CEventAdapter1394& ); + + public: + virtual void DeliverMessage( const uint8_t msg[], uint32_t numBytes ); + //! distributes events to node map + void DeliverEventMessage( EventData1394& Event, uint32_t numBytes ); + private: +#ifdef LOG4C + //! Logger for messages concerning the AccessMode + log4cpp::Category *m_pAccessLog; + + //! Logger for messages concerning the getting and setting values + log4cpp::Category *m_pValueLog; + + //! Logger for messages concerning the range check + log4cpp::Category *m_pRangeLog; + + //! Logger for messages concerning the port access + log4cpp::Category *m_pPortLog; + + //! Logger for messages concerning the caching access + log4cpp::Category *m_pCacheLog; + + //! Logger for messages concerning administrative access, e.g. GetNode() + log4cpp::Category *m_pAdminLog; + + //! Logger for messages concerning miscellaneoud access which does not fit to the other categories + log4cpp::Category *m_pMiscLog; +#endif + }; +} +#endif //__EVENTADAPTER1394_H__ diff --git a/thirdparty/GenICam/include/GenApi/EventAdapterGEV.h b/thirdparty/GenICam/include/GenApi/EventAdapterGEV.h new file mode 100644 index 0000000..2b3221e --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/EventAdapterGEV.h @@ -0,0 +1,128 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/EventAdapterGEV.h,v 1.8 2007/08/16 13:56:38 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/** +\file +\brief Declaration of the CEventAdapterGEV class. +*/ + +#ifndef GENAPI_EVENTADAPTERGEV_H +#define GENAPI_EVENTADAPTERGEV_H + +#include "EventAdapter.h" + +namespace GenApi +{ + + /* ------------------------------------------- */ + // Declaration of GigE Vision Event message structures + + // some useful macros + #if defined( _MSC_VER ) + #define PACK_STRUCT + #elif defined (__GNUC__) + // While gcc-4 understands #pragma pack, + // gcc-3 does not + #define PACK_STRUCT __attribute__((packed)) + #else + # error Unknown platform + #endif + + // make sure everything is properly packed +#pragma pack(push, 1) + + //! header of a GVCP request packet + typedef struct PACK_STRUCT GVCP_REQUEST_HEADER + { + uint8_t Magic; + uint8_t Flags; + uint16_t Command; + uint16_t Length; + uint16_t ReqId; + } GVCP_REQUEST_HEADER; + + //! header describing a GVCP event item + typedef struct PACK_STRUCT GVCP_EVENT_ITEM + { + uint16_t Reserved; + uint16_t EventId; + uint16_t StreamChannelId; + uint16_t BlockId; + uint32_t TimestampHigh; + uint32_t TimestampLow; + } GVCP_EVENT_ITEM; + + //! Layout of a GVCP event request packet + typedef struct PACK_STRUCT GVCP_EVENT_REQUEST + { + GVCP_REQUEST_HEADER Header; + GVCP_EVENT_ITEM Items[ 1 ]; + } GVCP_EVENT_REQUEST; + + //! Layout of a GVCP event data request packet + typedef struct PACK_STRUCT GVCP_EVENTDATA_REQUEST + { + GVCP_REQUEST_HEADER Header; + GVCP_EVENT_ITEM Event; + uint32_t Data[ 1 ]; + } GVCP_EVENTDATA_REQUEST; + + const uint8_t COMMAND_MAGIC = 0x42; + + typedef enum GVCP_MESSAGE_TAGS + { + TAG_EVENT_CMD = 0xc0, + TAG_EVENTDATA_CMD = 0xc2, + } GVCP_MESSAGE_TAGS; + + // restore the previous packing +#pragma pack(pop) + /* ------------------------------------------- */ + + + //! Connects a GigE Event to a node map + class GENAPI_DECL CEventAdapterGEV : public CEventAdapter + { + public: + //! Constructor + CEventAdapterGEV(INodeMap* pNodeMap = NULL); + + //! Destructor + virtual ~CEventAdapterGEV(); + + virtual void DeliverMessage( const uint8_t msg[], uint32_t numBytes ); + + //! Delivers the Events listed in the Event packet + void DeliverEventMessage(const GVCP_EVENT_REQUEST *pEvent); + + //! Delivers the Event + Data listed in the EventData packet + void DeliverEventMessage(const GVCP_EVENTDATA_REQUEST *pEventData); + + private: + void DeliverEventItem( const GVCP_EVENT_ITEM *pItem, unsigned int length); + + }; +} + +#endif // GENAPI_EVENTADAPTERGEV_H diff --git a/thirdparty/GenICam/include/GenApi/EventPort.h b/thirdparty/GenICam/include/GenApi/EventPort.h new file mode 100644 index 0000000..157dc7c --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/EventPort.h @@ -0,0 +1,138 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/EventPort.h,v 1.12 2008/01/16 13:36:07 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/** +\file +\brief Declaration of the CEventPort class. +\ingroup GenApi_PublicUtilities +*/ + +#ifndef GENAPI_EVENTPORT_H +#define GENAPI_EVENTPORT_H + +#pragma warning(push) +#pragma warning ( disable : 4068 ) // unknown pragma; refers to BullsEyeCoverage +#include "GenApi.h" + +namespace GenApi +{ + + /** + \brief Port attachable to an event + \ingroup GenApi_PublicUtilities + */ + class GENAPI_DECL CEventPort : public IPortConstruct + { + + public: + //! Constructor; can attach to a node + CEventPort(INode* pNode = NULL); + + //! Destructor; detaches from the port + ~CEventPort(); + + //------------------------------------------------------------- + // IPortConstruct implementation + //------------------------------------------------------------- + + //! Get the access mode of the node + virtual EAccessMode GetAccessMode() const; + + //! Reads a chunk of bytes from the port + virtual void Read(void *pBuffer, int64_t Address, int64_t Length); + + //! Writes a chunk of bytes to the port + virtual void Write(const void *pBuffer, int64_t Address, int64_t Length); + + //! Called from the port node to give the chunk port a pointer to itself + virtual void SetPortImpl(GenApi::IPort* pPort); + + //! Determines if the port adapter must perform an endianess swap + #pragma BullseyeCoverage off + virtual EYesNo GetSwapEndianess() + { + return No; + } + #pragma BullseyeCoverage on + + //--------------------------------------------------------------- + // Implementation + //--------------------------------------------------------------- + + // Invalidates the chunk port node + void InvalidateNode(); + + //------------------------------------------------------------- + // Initializing + //------------------------------------------------------------- + + //! Attaches to the Node + bool AttachNode(GenApi::INode* pNode); + + //! Detaches from the Node + void DetachNode(); + + //! Gets the EventID length + int GetEventIDLength() + { + return m_EventIDLength; + } + + //! Checks if a ChunkID matches + bool CheckEventID(uint8_t* pEventIDBuffer, int EventIDLength); + + //! Attaches the an Event to the EventPort + void AttachEvent(uint8_t *pBaseAddress, int64_t Length); + + //! Detaches the Event from the EventPort + void DetachEvent(); + + + protected: + + //------------------------------------------------------------- + // Member variables + //------------------------------------------------------------- + + //! Pointer to the begin of the buffer + uint8_t *m_pEventData; + + //! Length of the chunk + int64_t m_EventDataLength; +#pragma warning( push ) +#pragma warning( disable: 4251 ) + //! Pointer to the node holding a reference to this implementation + CNodePtr m_ptrNode; +#pragma warning( pop ) + + //! Binary version of the EventID + uint8_t *m_pEventIDBuffer; + + //! Length of the EventID buffer + int m_EventIDLength; + }; + +} +#pragma warning(pop) +#endif // GENAPI_EVENTPORT_H diff --git a/thirdparty/GenICam/include/GenApi/Filestream.h b/thirdparty/GenICam/include/GenApi/Filestream.h new file mode 100644 index 0000000..bbf5168 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/Filestream.h @@ -0,0 +1,906 @@ +//----------------------------------------------------------------------------- +// (c) 2007 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Thies Moeller +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/Filestream.h,v 1.5.2.6 2009/01/14 14:38:42 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of ODevFileStream and IDevFileStream +*/ + +#ifndef GENAPI_FILESTREAM_H_ +#define GENAPI_FILESTREAM_H_ + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#ifdef _MSC_VER +#pragma push_macro("min") +#undef min +#endif + +namespace GenICam +{ + + /*! + * @brief + * Align an integer + * + * @param v + * value to align + * + * @param i + * alignement + * + * @returns + * v aligned at i + * + */ + inline + int64_t Align( int64_t v, const int64_t i ){ + if (i==1) { + return v; + } else if (i>1) { + int64_t r = (v+(i-1))/i; + return r*i; + } else { + throw LOGICAL_ERROR_EXCEPTION( "Unexpected increment %d", i ); + } + }; + + /*! + * @brief + * Adapter between the std::iostreambuf and the SFNC Features representing the device filesystem + * + * The adapter assumes, that the features provide stdio fileaccess + * compatible semantic + * + */ + class FileProtocolAdapter { + public: + /*! + * @brief + * Constructor + * + */ + FileProtocolAdapter() + : m_pInterface(0) +#ifdef LOG4C + , m_pMiscLog(NULL) +#endif + {}; +/*! + * @brief + * attach file protocol adapter to nodemap + * + * @param pInterface + * NodeMap of the device to which the FileProtocolAdapter is attached + * + * @return true if attach was successful, false if not + * + */ + bool attach(GenApi::INodeMap * pInterface ){ + + m_pInterface = pInterface; + + #ifdef LOG4C + // init logging + GenICam::gcstring Name( "FileProtocolAdapter" ); + + GenICam::gcstring DeviceName = "NO_DEVICE"; + if (m_pInterface){ + DeviceName = pInterface->GetDeviceName(); + } + + m_pMiscLog = &( GenICam::CLog::GetLogger("GenApi." + DeviceName + ".Misc." + Name)); + #endif + + // fetch all required nodes + bool success = true; + + m_ptrFileSelector = m_pInterface->GetNode("FileSelector"); + if( !m_ptrFileSelector.IsValid() ){ + success &= false; + #ifdef LOG4C + m_pMiscLog->warn( "FileSelector invalid\n"); + #endif + } + + m_ptrFileOperationSelector = m_pInterface->GetNode("FileOperationSelector"); + if( !m_ptrFileOperationSelector.IsValid() ){ + success &= false; + #ifdef LOG4C + m_pMiscLog->warn( "FileOperationSelector invalid\n"); + #endif + } else { + // missing operations trigger exceptions in the adapter code + } + + m_ptrFileOperationExecute = m_pInterface->GetNode("FileOperationExecute"); + if( !m_ptrFileOperationExecute.IsValid() ){ + success &= false; + #ifdef LOG4C + m_pMiscLog->warn( "FileOperationExecute invalid\n"); + #endif + } + + m_ptrFileOpenMode = m_pInterface->GetNode("FileOpenMode"); + if( !m_ptrFileOpenMode.IsValid() ){ + success &= false; + #ifdef LOG4C + m_pMiscLog->warn( "FileOpenMode invalid\n"); + #endif + } + + m_ptrFileAccessOffset = m_pInterface->GetNode("FileAccessOffset"); + if( !m_ptrFileAccessOffset.IsValid() ){ + success &= false; + #ifdef LOG4C + m_pMiscLog->warn( "FileAccessOffset invalid\n"); + #endif + } + + m_ptrFileAccessLength = m_pInterface->GetNode("FileAccessLength"); + if( !m_ptrFileAccessLength.IsValid() ){ + success &= false; + #ifdef LOG4C + m_pMiscLog->warn( "FileAccessLength invalid\n"); + #endif + } + + m_ptrFileAccessBuffer = m_pInterface->GetNode("FileAccessBuffer"); + if( !m_ptrFileAccessBuffer.IsValid() ){ + success &= false; + #ifdef LOG4C + m_pMiscLog->warn( "FileAccessBuffer invalid\n"); + #endif + } + + m_ptrFileOperationStatus = m_pInterface->GetNode("FileOperationStatus"); + if( !m_ptrFileOperationStatus.IsValid() ){ + success &= false; + #ifdef LOG4C + m_pMiscLog->warn( "FileOperationStatus invalid\n"); + #endif + } else { + // missing success code trigger exceptions in the adapter code + } + + m_ptrFileOperationResult = m_pInterface->GetNode("FileOperationResult"); + if( !m_ptrFileOperationResult.IsValid() ){ + success &= false; + #ifdef LOG4C + m_pMiscLog->warn( "FileOperationResult invalid\n"); + #endif + } + return success; + }; + + + + /*! + * @brief + * open a file on the device + * + * @param pFileName + * filename of the file to open. The filename must exist in the Enumeration FileSelector + * + * @param mode + * mode to open the file. The mode must exist in the Enunmeration FileOpenMode + * + * @returns + * true on success, false on error + * + */ + bool openFile(const char * pFileName, std::ios_base::openmode mode){ + + if ( ! m_ptrFileSelector.IsValid() ){ + #ifdef LOG4C + m_pMiscLog->info("IsDone..."); + #endif + return false; + } + m_ptrFileSelector->FromString(pFileName); + + if (mode & (std::ios_base::out | std::ios_base::trunc)){ + m_ptrFileOpenMode->FromString("Write"); + } + else if (mode & (std::ios_base::in)){ + m_ptrFileOpenMode->FromString("Read"); + } + else{ + return false; + } + + m_ptrFileOperationSelector->FromString("Open"); + m_ptrFileOperationExecute->Execute(); + + return m_ptrFileOperationStatus->ToString() == "Success"; + } + + + /*! + * @brief + * close a file on the device + * + * @param pFileName + * filename of the file to open. The filename must exist in the Enumeration FileSelector + * + * @returns + * true on success, false on error + */ + bool closeFile(const char * pFileName){ + m_ptrFileSelector->FromString(pFileName); + m_ptrFileOperationSelector->FromString("Close"); + m_ptrFileOperationExecute->Execute(); + return m_ptrFileOperationStatus->ToString() == "Success"; + } + + /*! + * @brief + * writes data into a file. + * + * @param buf + * source buffer + * + * @param offs + * offset into the device file + * + * @param len + * count of bytes to write + * + * @param pFileName + * filename of the file to write into The filename must exist in the Enumeration FileSelector + * + * @returns + * count of bytes written + * + */ + std::streamsize write(const char * buf, int64_t offs, int64_t len, const char * pFileName) + { + m_ptrFileSelector->FromString(pFileName); + m_ptrFileOperationSelector->FromString("Write"); + + const std::streamsize maxWriteLen((std::streamsize)(m_ptrFileAccessBuffer->GetLength())); + + std::streamsize bytesWritten = 0; + while (bytesWritten < len){ + // copy streamdata to xchange buffer + const int64_t + remain(len - bytesWritten), + writeSize(remain <= maxWriteLen ? remain : maxWriteLen); + + + // offset + if ( offs + bytesWritten > m_ptrFileAccessOffset->GetMax()){ + // we cannot move the outbuffer any further + break; + } + m_ptrFileAccessOffset->SetValue(offs + bytesWritten); + + // writesize + m_ptrFileAccessLength->SetValue(writeSize); + + // set the buffer + m_ptrFileAccessBuffer->Set((const uint8_t *)buf+bytesWritten,Align(writeSize,4)); + + // trigger Command + m_ptrFileOperationExecute->Execute(); + + bytesWritten += INTEGRAL_CAST(m_ptrFileOperationResult->GetValue()); + + if (m_ptrFileOperationStatus->ToString() != "Success"){ + // no more space on device + break; + } + } + return bytesWritten; + }; + + /*! + * @brief + * read data from the device into a buffer + * + * @param buf + * target buffer + * + * @param offs + * offset in the device file to read from + * + * @param len + * count of bytes to read + * + * @param pFileName + * filename of the file to write into The filename must exist in the Enumeration FileSelector + * + * @returns + * count of bytes successfully read + * + */ + std::streamsize read(char * buf, int64_t offs, std::streamsize len, const char * pFileName) + { + + m_ptrFileSelector->FromString(pFileName); + m_ptrFileOperationSelector->FromString("Read"); + const std::streamsize maxReadLen = INTEGRAL_CAST(m_ptrFileAccessBuffer->GetLength()); + + std::streamsize bytesRead = 0; + while (bytesRead < len){ + // copy xchange buffer to streamdata + const std::streamsize readSize = std::min(len - bytesRead, maxReadLen); + // offset + if ( offs + bytesRead > m_ptrFileAccessOffset->GetMax()){ + // we cannot move the inbuffer any further + break; + } + m_ptrFileAccessOffset->SetValue(offs + bytesRead); + + // readsize + m_ptrFileAccessLength->SetValue(readSize); + + // fetch file data into xchange buffer + m_ptrFileOperationExecute->Execute(); + + std::streamsize result = INTEGRAL_CAST(m_ptrFileOperationResult->GetValue()); + m_ptrFileAccessBuffer->Get((uint8_t *)buf + bytesRead,readSize); + + bytesRead += result; + if (m_ptrFileOperationStatus->ToString() != "Success"){ + // reached end of file + break; + } + } + return bytesRead; + + }; + + /*! + * @brief + * fetch max FileAccessBuffer length for a file + * + * @param pFileName + * filename of the file to open. The filename must exist in the Enumeration FileSelector + * + * @param mode + * mode to open the file. The mode must exist in the Enunmeration FileOpenMode + * + * @returns + * max length of FileAccessBuffer in the given mode on the given file + * + */ + int64_t getBufSize(const char * pFileName, std::ios_base::openmode mode){ + + m_ptrFileSelector->FromString(pFileName); + + if (mode & (std::ios_base::out | std::ios_base::trunc)){ + m_ptrFileOperationSelector->FromString("Write"); + return m_ptrFileAccessBuffer->GetLength(); + } + else if (mode & (std::ios_base::in)){ + m_ptrFileOperationSelector->FromString("Read"); + return m_ptrFileAccessBuffer->GetLength(); + } + else{ + return 0; + } + } + private: + // the device nodemap + GenApi::INodeMap * m_pInterface; + + GenApi::CEnumerationPtr m_ptrFileSelector; + GenApi::CEnumerationPtr m_ptrFileOperationSelector; + GenApi::CCommandPtr m_ptrFileOperationExecute; + GenApi::CEnumerationPtr m_ptrFileOpenMode; + GenApi::CIntegerPtr m_ptrFileAccessOffset; + GenApi::CIntegerPtr m_ptrFileAccessLength; + GenApi::CRegisterPtr m_ptrFileAccessBuffer; + GenApi::CEnumerationPtr m_ptrFileOperationStatus; + GenApi::CIntegerPtr m_ptrFileOperationResult; + + private: +#ifdef LOG4C + //! Logger for messages concerning miscellaneoud access which does not fit to the other categories + log4cpp::Category *m_pMiscLog; +#endif + + + }; + + + template class IDevFileStreamBuf + : public std::basic_streambuf { + + typedef Traits traits_type; + typedef typename Traits::int_type int_type; + typedef typename Traits::char_type char_type; + typedef IDevFileStreamBuf filebuf_type; + + // GET next ptr + using std::basic_streambuf::gptr; + // GET end ptr + using std::basic_streambuf::egptr; + // GET begin ptr + using std::basic_streambuf::eback; + // increment next pointer + using std::basic_streambuf::gbump; + // set buffer info + using std::basic_streambuf::setg; + + public: + IDevFileStreamBuf() + : m_file(0), m_pAdapter(0), m_fpos(0) { + // This already handled by the base class constructor, right? + // std::basic_streambuf::_Init(); + }; + + + ~IDevFileStreamBuf(){ + this->close(); + } + + filebuf_type *open(GenApi::INodeMap * pInterface, const char * pFileName, std::ios_base::openmode mode = std::ios_base::in ) { + // get file protocol adapter + m_pAdapter = new FileProtocolAdapter(); + + // open file via Adapter + if (!m_pAdapter || !m_pAdapter->attach(pInterface)){ + delete m_pAdapter; + m_pAdapter = 0; + return 0; + } + + // open file via Adapter + if (!(m_pAdapter->openFile(pFileName, mode ))){ + delete m_pAdapter; + m_pAdapter = 0; + return 0; + } + + m_file = pFileName; + // alocate buffer according to fileinfo + m_BufSize = (std::streamsize)m_pAdapter->getBufSize(m_file,mode); + m_pBuffer = new char_type[m_BufSize / sizeof(char_type)]; + + // setg(buffer+pbSize, buffer+pbSize, buffer+pbSize); + setg(m_pBuffer, m_pBuffer + m_BufSize,m_pBuffer + m_BufSize); + + #ifdef _MSC_VER + // is this reasonable? + std::basic_streambuf::_Init(); + #endif + + return this; + } + + + + bool + is_open() const + { + return m_pAdapter != 0; + } + + filebuf_type *close() { + filebuf_type * ret = 0; + if (this->is_open()) { + // close file + if(m_pAdapter->closeFile(m_file)){ + // no error + ret = this; + } + delete m_pAdapter; + m_pAdapter = 0; + // buffer + delete[] m_pBuffer; + m_pBuffer = 0; + } + return ret; + } + + + protected: + int_type underflow() { + if (gptr() < egptr() ) + return traits_type::to_int_type(*gptr()); + + if (buffer_in() < 0) + return traits_type::eof(); + else + return traits_type::to_int_type(*gptr()); + + } + + int_type pbackfail(int_type c) { + if (gptr() != eback() || eback()(traits_type::not_eof(c)); + return traits_type::not_eof(c); + } else + return traits_type::eof(); + } + + private: + char_type * m_pBuffer; + std::streamsize m_BufSize; + + const char * m_file; + FileProtocolAdapter * m_pAdapter; + int64_t m_fpos; + + + + int buffer_in() { + + std::streamsize retval = m_pAdapter->read(m_pBuffer , m_fpos, m_BufSize,m_file); + + if (retval <= 0) { + setg(0, 0, 0); + return -1; + } else { + setg(m_pBuffer, m_pBuffer , m_pBuffer + retval); + m_fpos += retval; + return INTEGRAL_CAST2(retval); + } + } + + + // prohibit copying and assignment + IDevFileStreamBuf(const IDevFileStreamBuf&); + IDevFileStreamBuf& operator=(const IDevFileStreamBuf&); + }; + + + template class ODevFileStreamBuf + : public std::basic_streambuf { + typedef Traits traits_type; + + typedef typename Traits::int_type int_type; + typedef typename Traits::char_type char_type; + typedef typename Traits::pos_type pos_type; + typedef typename Traits::off_type off_type; + + typedef ODevFileStreamBuf filebuf_type; + + + // PUT begin + using std::basic_streambuf::pbase; + // PUT next + using std::basic_streambuf::pptr; + // PUT end + using std::basic_streambuf::epptr; + // increment next pointer + using std::basic_streambuf::pbump; + + public: + ODevFileStreamBuf() + : m_file(0), m_pAdapter(0), m_fpos(0) { + } + + ~ODevFileStreamBuf() { + this->close(); + } + + filebuf_type *open(GenApi::INodeMap * pInterface, const char * pFileName, std::ios_base::openmode mode) { + + // create Genicam Access + m_pAdapter = new FileProtocolAdapter(); + + // attach to nodemap + if (!m_pAdapter || !m_pAdapter->attach(pInterface)){ + delete m_pAdapter; + m_pAdapter = 0; + return 0; + } + + + // open file via Adapter + if (!(m_pAdapter->openFile(pFileName, mode ))){ + delete m_pAdapter; + m_pAdapter = 0; + return 0; + } + + m_file = pFileName; + // allocate buffer according to fileinfo + const int64_t bufSize = m_pAdapter->getBufSize(m_file,mode); + m_pBuffer = new char_type[INTEGRAL_CAST(bufSize) / sizeof(char_type)]; + setp(m_pBuffer, m_pBuffer + bufSize); + + return this; + } + + bool + is_open() const { + return m_pAdapter != 0; + } + + filebuf_type *close() { + filebuf_type * ret = 0; + bool syncFailed = false; + if (this->is_open()) { + if (sync()){ + syncFailed = true; + }; + // close file + if(m_pAdapter->closeFile(m_file)){ + // no error + if ( syncFailed ){ + ret = 0; + } else { + ret = this; + } + } + delete m_pAdapter; + m_pAdapter = 0; + // buffer + delete[] m_pBuffer; + m_pBuffer = 0; + } + return ret; + } + + protected: + std::streamsize xsputn(const char_type * s, std::streamsize n) { + if (n < epptr() - pptr() ) { + memcpy(pptr(), s, n * sizeof(char_type)); + pbump( INTEGRAL_CAST2(n) ); + return n; + } else { + for (std::streamsize i = 0; i(c)); + else + return traits_type::not_eof(c); + } + + } + int sync() { + return INTEGRAL_CAST(buffer_out()); + } + + private: + char_type * m_pBuffer; // buffer[bufSize]; + const char * m_file; + FileProtocolAdapter * m_pAdapter; + int64_t m_fpos; + + int64_t buffer_out() { + int64_t cnt = pptr() - pbase(); + + int64_t retval; + int64_t res = m_pAdapter->write(m_pBuffer, m_fpos, cnt, m_file); + + if (res != cnt) { + retval = -1; + } else { + retval = 0; + } + m_fpos += res; + + pbump(- INTEGRAL_CAST(cnt)); + return retval; + } + + // prohibit copying assignment + ODevFileStreamBuf(const ODevFileStreamBuf&); + ODevFileStreamBuf & operator =(const ODevFileStreamBuf&); + }; + + template class ODevFileStreamBase + : public std::basic_ostream { + public: + // Non-standard types: + typedef ODevFileStreamBuf filebuf_type; + typedef std::basic_ios ios_type; + typedef std::basic_ostream ostream_type; + + private: + filebuf_type m_streambuf; + public: + +#if defined (_MSC_VER) + ODevFileStreamBase() + : ostream_type(std::_Noinit), m_streambuf() { + this->init(&m_streambuf); + } + + ODevFileStreamBase(GenApi::INodeMap * pInterface, const char * pFileName, std::ios_base::openmode mode = std::ios_base::out|std::ios_base::trunc) + : ostream_type(std::_Noinit), m_streambuf() { + this->init(&m_streambuf); + this->open(pInterface, pFileName, mode); + } + ; + +#elif defined (__GNUC__) + ODevFileStreamBase() + : ostream_type(), m_streambuf() { + this->init(&m_streambuf); + } + + ODevFileStreamBase(GenApi::INodeMap * pInterface, const char * pFileName, std::ios_base::openmode mode = std::ios_base::out|std::ios_base::trunc) + : ostream_type(), m_streambuf() { + this->init(&m_streambuf); + this->open(pInterface, pFileName, mode); + } + ; + + +#else +# error Unknown C++ library +#endif + + + + filebuf_type *rdbuf() const { + return const_cast(&m_streambuf); + } + + /* bool is_open() { + return m_streambuf.is_open(); + } */ + + bool is_open() const { + return m_streambuf.is_open(); + } + + /** + * @brief + * Open file on device in write mode + * + * @param pInterface NodeMap of the device to which the FileProtocolAdapter is attached + * @param pFileName Name of the file to open + * @param mode open mode + * + */ + void open(GenApi::INodeMap * pInterface, const char * pFileName, + std::ios_base::openmode mode = std::ios_base::out | std::ios_base::trunc) { + if (!m_streambuf.open(pInterface,pFileName, mode)){ + this->setstate(std::ios_base::failbit); + } + else{ + this->clear(); + } + } + + /** + * @brief Close the file on device + * + */ + void close() { + if (!m_streambuf.close()) + this->setstate(std::ios_base::failbit); + } + }; + + template class IDevFileStreamBase + : public std::basic_istream { + public: + + // Non-standard types: + typedef IDevFileStreamBuf filebuf_type; + typedef std::basic_ios ios_type; + typedef std::basic_istream istream_type; + + private: + filebuf_type m_streambuf; + public: + +#if defined (_MSC_VER) + IDevFileStreamBase() + : istream_type(std::_Noinit), m_streambuf() { + this->init(&m_streambuf); + } + + IDevFileStreamBase(GenApi::INodeMap * pInterface, const char * pFileName, + std::ios_base::openmode mode = std::ios_base::in) + : istream_type(std::_Noinit), m_streambuf() { + this->init(&m_streambuf); + this->open(pInterface, pFileName, mode); + } + ; + +#elif defined (__GNUC__) + IDevFileStreamBase() + : istream_type(), m_streambuf() { + this->init(&m_streambuf); + } + + IDevFileStreamBase(GenApi::INodeMap * pInterface, const char * pFileName, + std::ios_base::openmode mode = std::ios_base::in) + : istream_type(), m_streambuf() { + this->init(&m_streambuf); + this->open(pInterface, pFileName, mode); + } + ; + +#else +# error Unknown C++ library +#endif + + + filebuf_type *rdbuf() const { + return const_cast(&m_streambuf); + } + + /* bool is_open() { + return m_streambuf.is_open(); + } */ + + bool is_open() const { + return m_streambuf.is_open(); + } + + /* @brief + * Open file on device in write mode + * + * @param pInterface NodeMap of the device to which the FileProtocolAdapter is attached + * @param pFileName Name of the file to open + * @param mode open mode + */ + void open(GenApi::INodeMap * pInterface, const char * pFileName, + std::ios_base::openmode mode = std::ios_base::in) { + if (!m_streambuf.open(pInterface,pFileName, mode)) + this->setstate(std::ios_base::failbit); + else + this->clear(); + } + + /** + * @brief Close the file on the device + */ + void close() { + if (!m_streambuf.close()) + this->setstate(std::ios_base::failbit); + } + }; + + typedef ODevFileStreamBase > ODevFileStream; + typedef IDevFileStreamBase > IDevFileStream; +} + +#ifdef _MSC_VER +#pragma pop_macro("min") +#endif + +#endif /*GENAPI_FILESTREAM_H_*/ diff --git a/thirdparty/GenICam/include/GenApi/GenApi.h b/thirdparty/GenICam/include/GenApi/GenApi.h new file mode 100644 index 0000000..57994a0 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/GenApi.h @@ -0,0 +1,46 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/GenApi.h,v 1.14.2.1 2008/07/14 08:25:14 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Main include file for using GenApi with smart pointers +\ingroup GenApi_PublicInterface +*/ + +#ifndef GENAPI_GENAPI_H +#define GENAPI_GENAPI_H + +#include +#include +#include "GenApiVersion.h" +#include "Pointer.h" +#include "NodeMapRef.h" +#include "NodeCallbackImpl.h" +#include "Persistence.h" + +#if defined (_MSC_VER) +# include "GenApiLinkage.h" +#endif + +#endif diff --git a/thirdparty/GenICam/include/GenApi/GenApiDll.h b/thirdparty/GenICam/include/GenApi/GenApiDll.h new file mode 100644 index 0000000..688efa2 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/GenApiDll.h @@ -0,0 +1,56 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/GenApiDll.h,v 1.9 2007/11/13 19:41:09 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief declspec's to be used for GenApi Windows dll +\ingroup GenApi_PublicImpl +*/ + +#ifndef GENAPIDLL_H +#define GENAPIDLL_H + +#if defined(_MSC_VER) +# pragma once +# ifdef GENAPI_EXPORTS +# define GENAPI_DECL __declspec(dllexport) +# else +# define GENAPI_DECL __declspec(dllimport) +# define GENAPI_EXPIMP_TEMPL extern +# endif +#elif defined (__GNUC__) && (__GNUC__ > 3) && defined (__ELF__) +# ifdef GENAPI_EXPORTS +# define GENAPI_DECL __attribute__((visibility("default"))) +# else +# define GENAPI_DECL +# define GENAPI_EXPIMP_TEMPL extern +# endif +#else +# define GENAPI_DECL +# ifndef GENAPI_EXPORTS +# define GENAPI_EXPIMP_TEMPL extern +# endif +#endif + +#endif /* GENAPIDLL_H */ diff --git a/thirdparty/GenICam/include/GenApi/GenApiVersion.h b/thirdparty/GenICam/include/GenApi/GenApiVersion.h new file mode 100644 index 0000000..672a5d7 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/GenApiVersion.h @@ -0,0 +1,44 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/GenApiVersion.h,v 1.7 2007/11/13 19:41:09 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief central versioning counters +*/ + +#ifndef GENAPI_VERSION_H +#define GENAPI_VERSION_H + +#include "../GenICamVersion.h" + +// CAUTION: the following symbols exist for compatibility reasons only +// For new clde please use the GENICAM_ symbols from GenICamVersion.h only + +#define GENAPI_VERSION_MAJOR GENICAM_VERSION_MAJOR +#define GENAPI_VERSION_MINOR GENICAM_VERSION_MINOR +#define GENAPI_VERSION_SUBMINOR GENICAM_VERSION_SUBMINOR +#define GENAPI_VERSION_BUILD GENICAM_VERSION_BUILD + + +#endif // GENAPI_VERSION_H diff --git a/thirdparty/GenICam/include/GenApi/IBase.h b/thirdparty/GenICam/include/GenApi/IBase.h new file mode 100644 index 0000000..56c723c --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/IBase.h @@ -0,0 +1,94 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/IBase.h,v 1.14 2007/08/16 13:56:39 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of interface IBase +\ingroup GenApi_PublicInterface +*/ + + +#ifndef GENAPI_IBASE_H +#define GENAPI_IBASE_H + +#include "GenApiDll.h" +#include "Types.h" +#include "Reference.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY + +namespace GenApi +{ + //************************************************************* + // IBase interface + //************************************************************* + + /** + \brief Base interface common to all nodes + \ingroup GenApi_PublicInterface + */ + interface IBase + { + //! Get the access mode of the node + virtual EAccessMode GetAccessMode() const = 0; + }; + + //************************************************************* + // CBaseRef class + //************************************************************* + + /** + \internal + \brief Reference to an IBase pointer + \ingroup GenApi_PublicImpl + */ + template + class CBaseRefT : public CReferenceT + { + typedef CReferenceT ref; + + public: + /*--------------------------------------------------------*/ + // IBase + /*--------------------------------------------------------*/ + + //! Get the access mode of the node + virtual EAccessMode GetAccessMode() const + { + if(ref::m_Ptr) + return ref::m_Ptr->GetAccessMode(); + else + return NI; + } + }; + + //! Reference to an IBase pointer + //! \ingroup GenApi_PublicImpl + typedef CBaseRefT CBaseRef; + +} +#pragma warning ( pop ) + +#endif // ifndef GENAPI_IBASE_H diff --git a/thirdparty/GenICam/include/GenApi/IBoolean.h b/thirdparty/GenICam/include/GenApi/IBoolean.h new file mode 100644 index 0000000..21dc472 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/IBoolean.h @@ -0,0 +1,138 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/IBoolean.h,v 1.14 2007/11/13 19:41:09 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of IBoolean interface +\ingroup GenApi_PublicInterface +*/ + +#ifndef GENAPI_IBOOLEAN_H +#define GENAPI_IBOOLEAN_H + +#include "GenApiDll.h" +#include "Types.h" +#include "IValue.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY + +namespace GenApi +{ + //************************************************************* + // IBoolean interface + //************************************************************* + + /** + \brief Interface for Boolean properties + \ingroup GenApi_PublicInterface + */ + interface IBoolean : virtual public IValue + { + public: + //! Set node value + virtual void SetValue(bool Value, bool Verify = true) = 0; + + //! Set node value + virtual void operator=(bool Value){ SetValue( Value ); } + + //! Get node value + virtual bool GetValue() const = 0; + + //! Get node value + virtual bool operator()() const { return GetValue(); } + }; + + + //************************************************************* + // CBooleanRef class + //************************************************************* + + /** + \internal + \brief Reference to an IInteger pointer + \ingroup GenApi_PublicImpl + */ + template + class CBooleanRefT : public CValueRefT + { + typedef CValueRefT ref; + + public: + /*--------------------------------------------------------*/ + // IBoolean + /*--------------------------------------------------------*/ + + //! Set node value + virtual void SetValue(bool Value, bool Verify = true) + { + if(ref::m_Ptr) + return ref::m_Ptr->SetValue(Value); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + + // unused param *JS* (removed warning) + GC_UNUSED(Verify); + } + + //! Set node value + virtual void operator=(bool Value) + { + if(ref::m_Ptr) + return ref::m_Ptr->operator=(Value); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get node value + virtual bool GetValue() const + { + if(ref::m_Ptr) + return ref::m_Ptr->GetValue(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get node value + virtual bool operator()() const + { + if(ref::m_Ptr) + return ref::m_Ptr->operator()(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + }; + + //! Reference to an IBoolean pointer + //! \ingroup GenApi_PublicImpl + typedef CBooleanRefT CBooleanRef; + + + +} + +#pragma warning ( pop ) + +#endif // ifndef GENAPI_IBOOLEAN_H diff --git a/thirdparty/GenICam/include/GenApi/ICategory.h b/thirdparty/GenICam/include/GenApi/ICategory.h new file mode 100644 index 0000000..604647a --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/ICategory.h @@ -0,0 +1,107 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/ICategory.h,v 1.13 2007/08/16 13:56:39 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of interface ICategory and types FeatureList_t : +\ingroup GenApi_PublicInterface +*/ + + +#ifndef GENAPI_ICATEGORY_H +#define GENAPI_ICATEGORY_H + +#include "GenApiDll.h" +#include "Types.h" +#include "IValue.h" +#include +#include "Container.h" + +#include + +#pragma warning ( push ) +#pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY + + +namespace GenApi +{ + + interface INode; + + + //************************************************************* + // ICategory interface + //************************************************************* + + /** + \brief Gives access to a category node + \ingroup GenApi_PublicInterface + */ + interface ICategory : virtual public IValue + { + + //! Get all features of the category (including sub-categories) + virtual void GetFeatures(FeatureList_t &Features) const = 0; + + }; + + + //************************************************************* + // CCategoryRef class + //************************************************************* + + /** + \internal + \brief Reference to an ICategory pointer + \ingroup GenApi_PublicImpl + */ + template + class CCategoryRefT : public CValueRefT + { + typedef CValueRefT ref; + + public: + /*--------------------------------------------------------*/ + // ICategory + /*--------------------------------------------------------*/ + + //! Get all features of the category (including sub-categories) + virtual void GetFeatures(FeatureList_t &Features) const + { + if(ref::m_Ptr) + return ref::m_Ptr->GetFeatures(Features); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + }; + + //! Reference to an ICategory pointer + //! \ingroup GenApi_PublicImpl + typedef CCategoryRefT CCategoryRef; + +} +#pragma warning ( pop ) + +#endif // ifndef GENAPI_ICATEGORY_H diff --git a/thirdparty/GenICam/include/GenApi/IChunkPort.h b/thirdparty/GenICam/include/GenApi/IChunkPort.h new file mode 100644 index 0000000..62c6781 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/IChunkPort.h @@ -0,0 +1,61 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/IChunkPort.h,v 1.11 2007/08/16 13:56:39 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of interface IChunkPort +\ingroup GenApi_PublicInterface +*/ + +#ifndef GENAPI_ICHUNKPORT_H +#define GENAPI_ICHUNKPORT_H + +#include +#include "GenApiDll.h" +#include "Types.h" +#include "IPort.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY + +namespace GenApi +{ + //************************************************************* + // IChunkPort interface + //************************************************************* + + /** + \brief Interface for ports attached to a chunk + \ingroup GenApi_PublicInterface + */ + interface IChunkPort : virtual public IPort + { + //! Get the Id of the chunk the port should be attached to + virtual GenICam::gcstring GetChunkID() const = 0; + }; +} + +#pragma warning ( pop ) + +#endif // ifndef GENAPI_ICHUNKPORT_H diff --git a/thirdparty/GenICam/include/GenApi/ICommand.h b/thirdparty/GenICam/include/GenApi/ICommand.h new file mode 100644 index 0000000..ee718aa --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/ICommand.h @@ -0,0 +1,125 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Hartmut Nebelung +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/ICommand.h,v 1.11 2007/08/16 13:56:39 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of ICommand interface +\ingroup GenApi_PublicInterface +*/ + +#ifndef GENAPI_ICOMMAND_H +#define GENAPI_ICOMMAND_H + +#include "GenApiDll.h" +#include "Types.h" +#include "IValue.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY + +namespace GenApi +{ + //************************************************************* + // ICommand interface + //************************************************************* + + //! Interface for command like properties + //! \ingroup GenApi_PublicInterface + interface ICommand : virtual public IValue + { + public: + + //! Execute the command + virtual void Execute() = 0; + + //! Execute the command + virtual void operator()() = 0; + + //! Query whether the command is executed + virtual bool IsDone() const = 0; + + + }; + + + //************************************************************* + // CCommandRef class + //************************************************************* + + /** + \internal + \brief Reference to an IInteger pointer + \ingroup GenApi_PublicImpl + */ + template + class CCommandRefT : public CValueRefT + { + typedef CValueRefT ref; + + public: + /*--------------------------------------------------------*/ + // ICommand + /*--------------------------------------------------------*/ + + //! Execute the command + virtual void Execute() + { + if(ref::m_Ptr) + return ref::m_Ptr->Execute(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Execute the command + virtual void operator()() + { + if(ref::m_Ptr) + ref::m_Ptr->operator()(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Query whether the command is executed + virtual bool IsDone() const + { + if(ref::m_Ptr) + return ref::m_Ptr->IsDone(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + + }; + + //! Reference to an ICommand pointer + //! \ingroup GenApi_PublicImpl + typedef CCommandRefT CCommandRef; + + + +} + +#pragma warning ( pop ) + +#endif // ifndef GENAPI_ICOMMAND_H diff --git a/thirdparty/GenICam/include/GenApi/IDestroy.h b/thirdparty/GenICam/include/GenApi/IDestroy.h new file mode 100644 index 0000000..f618eb8 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/IDestroy.h @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------------- +// (c) 2004 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/IDestroy.h,v 1.8 2007/08/16 13:56:39 hartmut_nebelung Exp $ +//----------------------------------------------------------------------------- +/*! +\file IDestroy.h +\brief Definition of interface IDestroy +*/ + +#ifndef GENAPI_IDESTROY_H +#define GENAPI_IDESTROY_H + +#include + +#pragma warning ( push ) +#pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY + +namespace GenApi +{ + + //************************************************************* + // IDestroy interface + //************************************************************* + /** + * \ingroup internal_itf + * \brief Interface to destroy an object + */ + + interface IDestroy + { + //! Makes the object to destro itself + virtual void Destroy() = 0; + + }; + +} + +#pragma warning ( pop ) + +#endif // GENAPI_IDESTROY_H diff --git a/thirdparty/GenICam/include/GenApi/IDeviceInfo.h b/thirdparty/GenICam/include/GenApi/IDeviceInfo.h new file mode 100644 index 0000000..a781faf --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/IDeviceInfo.h @@ -0,0 +1,83 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/IDeviceInfo.h,v 1.11 2007/08/16 13:56:39 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of interface INodeMap +\ingroup GenApi_PublicInterface +*/ + +#ifndef GENAPI_DEVICEINFO_H +#define GENAPI_DEVICEINFO_H + +#include + +#pragma warning ( push ) +#pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY + +namespace GenApi +{ + + //************************************************************* + // IDeviceInfo interface + //************************************************************* + + /** + \brief Interface to get information about the device (= nodemap) + \ingroup GenApi_PublicInterface + */ + interface IDeviceInfo + { + //! Get the model name + virtual GenICam::gcstring GetModelName() = 0; + + //! Get the vendor name + virtual GenICam::gcstring GetVendorName() = 0; + + //! Get tool tip + virtual GenICam::gcstring GetToolTip() = 0; + + //! Get the standard name space + virtual GenICam::gcstring GetStandardNameSpace() = 0; + + //! Get the version of the DLL's GenApi implementation + virtual void GetGenApiVersion(Version_t &Version, uint16_t &Build) = 0; + + //! Get the schema version number + virtual void GetSchemaVersion(Version_t &Version) = 0; + + //! Get the version of the device description file + virtual void GetDeviceVersion(Version_t &Version) = 0; + + //! Get the Guid describing the product + virtual GenICam::gcstring GetProductGuid() = 0; + + //! Get the Guid describing the product version + virtual GenICam::gcstring GetVersionGuid() = 0; + }; +} + +#pragma warning ( pop ) + +#endif // ifndef GENAPI_IDEVICEINFO_H diff --git a/thirdparty/GenICam/include/GenApi/IEnumEntry.h b/thirdparty/GenICam/include/GenApi/IEnumEntry.h new file mode 100644 index 0000000..3f072e7 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/IEnumEntry.h @@ -0,0 +1,111 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/IEnumEntry.h,v 1.14 2007/08/16 13:56:39 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\ingroup GenApi_PublicInterface +*/ + +#ifndef GENAPI_IENUMENTRY_H +#define GENAPI_IENUMENTRY_H + + +#include +#include "GenApiDll.h" +#include "IValue.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY + +namespace GenApi +{ + + //************************************************************* + // IEnumEntry interface + //************************************************************* + + /** + \brief Interface of single enum value + \ingroup GenApi_PublicInterfa + */ + /*! Maps of Enum Values to symbolic values */ + interface IEnumEntry : virtual public IValue + { + + public: + //! Get numeric enum value + virtual int64_t GetValue() = 0; + //! Get symbolic enum value + virtual GenICam::gcstring GetSymbolic()const = 0; + }; + + //************************************************************* + // CEnumEntryRef class + //************************************************************* + + /** + \internal + \brief Reference to an IEnumEntry pointer + \ingroup GenApi_PublicImpl + */ + template + class CEnumEntryRefT : public CValueRefT + { + typedef CValueRefT ref; + + public: + /*--------------------------------------------------------*/ + // IEnumEntry + /*--------------------------------------------------------*/ + + //! Get numeric enum value + virtual int64_t GetValue() + { + if(ref::m_Ptr) + return ref::m_Ptr->GetValue(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get symbolic enum value + virtual GenICam::gcstring GetSymbolic()const + { + if(ref::m_Ptr) + return ref::m_Ptr->GetSymbolic(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + }; + + //! Reference to an IEnumEntry pointer + //! \ingroup GenApi_PublicImpl + typedef CEnumEntryRefT CEnumEntryRef; + + +} + +#pragma warning ( pop ) + +#endif // ifndef GENAPI_IENUMENTRY_H diff --git a/thirdparty/GenICam/include/GenApi/IEnumeration.h b/thirdparty/GenICam/include/GenApi/IEnumeration.h new file mode 100644 index 0000000..3f31278 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/IEnumeration.h @@ -0,0 +1,84 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/IEnumeration.h,v 1.15 2007/08/16 13:56:40 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of interface IEnumeration +\ingroup GenApi_PublicInterface +*/ + +#ifndef GENAPI_IENUMERATION_H +#define GENAPI_IENUMERATION_H + +#include +#include "GenApiDll.h" +#include "IEnumEntry.h" +#include "Types.h" +#include "IValue.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY + + +namespace GenApi +{ + //************************************************************* + // Enumeration interface + //************************************************************* + + /** + \brief Interface for enumeration properties + \ingroup GenApi_PublicInterface + */ + interface IEnumeration : virtual public IValue + { + + //! Get list of symbolic Values + virtual void GetSymbolics(StringList_t & Symbolics) = 0; + + //! Get list of entry nodes + virtual void GetEntries(NodeList_t & Entries) = 0; + + //! Set string node value + virtual IEnumeration& operator=(const GenICam::gcstring& ValueStr) = 0; + + //! Set integer node value + virtual void SetIntValue(int64_t Value, bool Verify = true) = 0; + + //! Get string node value + virtual GenICam::gcstring operator*() = 0; + + //! Get integer node value + virtual int64_t GetIntValue(bool Verify = false) = 0; + + //! Get an entry node by name + virtual IEnumEntry *GetEntryByName(const GenICam::gcstring& EntryName) = 0; + + }; + +} + +#pragma warning ( pop ) + +#endif // ifndef GENAPI_IENUMERATION_H diff --git a/thirdparty/GenICam/include/GenApi/IEnumerationT.h b/thirdparty/GenICam/include/GenApi/IEnumerationT.h new file mode 100644 index 0000000..de8104f --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/IEnumerationT.h @@ -0,0 +1,324 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/IEnumerationT.h,v 1.12.2.2 2009/03/27 19:00:12 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of interface IEnumerationT +\ingroup GenApi_PublicInterface +*/ + +#ifndef GENAPI_IENUMERATIONT_H +#define GENAPI_IENUMERATIONT_H + +#include "GenApiDll.h" +#include "Types.h" +#include "Pointer.h" +#include "IEnumeration.h" +#include + +namespace GenApi +{ + //************************************************************* + // Enumeration template interface + //************************************************************* + + /** + \brief Interface for enumeration properties + \ingroup GenApi_PublicInterface + */ + template< typename EnumT > + interface IEnumerationT : public IEnumeration + { + //! Set node value + virtual void SetValue(EnumT Value, bool Verify = true) = 0; + + //! Set node value + virtual IEnumeration& operator=(EnumT Value) = 0; + + //! Get node value + virtual EnumT GetValue(bool Verify = false) = 0; + + //! Get node value + virtual EnumT operator()() = 0; + + //! Set node value + /*! Note : the operator= is not inherited thus the operator= versions + from IEnumeration must be implemented again */ + virtual IEnumeration& operator=(const GenICam::gcstring& ValueStr) = 0; + + }; + + //************************************************************* + // CEnumerationTRef class + //************************************************************* + + /** + \internal + \brief Reference to an IEnumerationT pointer + \ingroup GenApi_PublicImpl + */ + template< class EnumT > + class CEnumerationTRef : public IEnumerationT< EnumT >, public IReference, public IEnumReference + { + public: + // Constructor + CEnumerationTRef() : + m_Ptr(NULL) + {} + + /*--------------------------------------------------------*/ + // IReference + /*--------------------------------------------------------*/ + + //! sets the implementation to the reference + virtual void SetReference( IBase *ptr ) + { + m_Ptr = dynamic_cast< IEnumeration *>( ptr ); + } + + /*--------------------------------------------------------*/ + // IEnumReference + /*--------------------------------------------------------*/ + + //! sets the number of enum vallues + virtual void SetNumEnums( int NumEnums ) + { + m_EnumExists.resize(NumEnums); + m_EnumValues.resize(NumEnums); + + std::vector::iterator ptr; + for(ptr = m_EnumExists.begin(); ptr != m_EnumExists.end(); ptr++) + *ptr = false; + + } + + //! sets the Enum value corresponding to a value + virtual void SetEnumReference( int Index, GenICam::gcstring Name) + { + if ( m_Ptr ) + { + CEnumEntryPtr ptrEnumEntry = GetEntryByName(Name); + + if( ptrEnumEntry.IsValid() ) + { + m_EnumExists[Index] = true; + m_EnumValues[Index] = ptrEnumEntry->GetValue(); + } + } + } + + + /*--------------------------------------------------------*/ + // IBase + /*--------------------------------------------------------*/ + + //! Get the access mode of the node + virtual EAccessMode GetAccessMode() const + { + if(m_Ptr) + return m_Ptr->GetAccessMode(); + else + return NI; + } + + /*--------------------------------------------------------*/ + // IValue + /*--------------------------------------------------------*/ + + //! Get the INode interface of the node + virtual INode* GetNode() + { + if(m_Ptr) + return m_Ptr->GetNode(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get content of the node as string + virtual GenICam::gcstring ToString(bool /*Verify = false*/) + { + if(m_Ptr) + return m_Ptr->ToString(false); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Set content of the node as string + virtual void FromString(const GenICam::gcstring& ValueStr, bool Verify = true) + { + if(m_Ptr) + return m_Ptr->FromString(ValueStr, Verify); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + /*--------------------------------------------------------*/ + // IEnumeration + /*--------------------------------------------------------*/ + + //! Get list of symbolic Values + virtual void GetSymbolics(StringList_t & Symbolics) + { + if(m_Ptr) + return m_Ptr->GetSymbolics(Symbolics); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get list of entry nodes + virtual void GetEntries(NodeList_t & Entries) + { + if(m_Ptr) + return m_Ptr->GetEntries(Entries); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Set node value + virtual IEnumeration& operator=(const GenICam::gcstring& ValueStr) + { + if(m_Ptr) + return m_Ptr->operator=(ValueStr); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Set node value + virtual IEnumeration& operator=(const char *pValueStr) + { + if(m_Ptr) + return m_Ptr->operator=(pValueStr); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Set node value + virtual void SetIntValue(int64_t Value, bool Verify = true) + { + if(m_Ptr) + m_Ptr->SetIntValue(Value, Verify); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get node value + virtual GenICam::gcstring operator*() + { + if(m_Ptr) + return m_Ptr->operator*(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get node value + virtual int64_t GetIntValue(bool Verify = false) + { + if(m_Ptr) + return m_Ptr->GetIntValue(Verify); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get an entry node by name + virtual IEnumEntry *GetEntryByName(const GenICam::gcstring& EntryName) + { + if(m_Ptr) + return m_Ptr->GetEntryByName(EntryName); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + + /*--------------------------------------------------------*/ + // IEnumerationT + /*--------------------------------------------------------*/ + + //! Set node value + virtual void SetValue(EnumT Value, bool Verify = true) + { + if(m_Ptr) + { + if( m_EnumExists[Value] ) + { + int64_t EnumValue = m_EnumValues[Value]; + m_Ptr->SetIntValue(EnumValue, Verify); + } + else + throw ACCESS_EXCEPTION("EnumEntry %d not present", Value); + } + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Set node value + virtual IEnumeration& operator=(EnumT Value) + { + SetValue(Value); + return *this; + } + + //! Get node value + virtual EnumT GetValue(bool Verify = false) + { + if(m_Ptr) + { + int64_t IntValue = m_Ptr->GetIntValue(Verify); + std::vector::iterator ptr; + for ( unsigned int idx = 0; idx < m_EnumValues.size(); ++idx ) + { + if( m_EnumExists[idx] && m_EnumValues[idx] == IntValue) + return (EnumT) idx; + } +#ifdef _WIN32 + throw ACCESS_EXCEPTION("Unknown IntValue %I64d", IntValue); +#else + throw ACCESS_EXCEPTION("Unknown IntValue %lld", IntValue); +#endif + } + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get node value + virtual EnumT operator()() + { + return GetValue(); + } + + protected: + //! Pointer to the implementation the reference references to + IEnumeration *m_Ptr; + + //! The values for enums with a given index + std::vector m_EnumValues; + + //! Inidcates it an enum with a given index exists + std::vector m_EnumExists; + + }; + + +} + +#endif // ifndef GENAPI_IENUMERATIONT_H diff --git a/thirdparty/GenICam/include/GenApi/IFloat.h b/thirdparty/GenICam/include/GenApi/IFloat.h new file mode 100644 index 0000000..839f939 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/IFloat.h @@ -0,0 +1,193 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/IFloat.h,v 1.16 2007/08/16 13:56:40 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of the IFloat interface +\ingroup GenApi_PublicInterface +*/ + +#ifndef GENAPI_IFLOAT_H +#define GENAPI_IFLOAT_H + +#include "GenApiDll.h" +#include "Types.h" +#include "IValue.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY + +namespace GenApi +{ + //************************************************************* + // IFloat interface + //************************************************************* + + /** + \brief Interface for float properties + \ingroup GenApi_PublicInterface + */ + interface IFloat : virtual public IValue + { + //! Set node value + virtual void SetValue(double Value, bool Verify = true) = 0; + + //! Set node value + virtual IFloat& operator=(double Value) = 0; + + //! Get node value + virtual double GetValue(bool Verify = false) = 0; + + //! Get node value + virtual double operator()() = 0; + + //! Get node value + virtual double operator*() = 0; + + //! Get minimum value allowed + virtual double GetMin() = 0; + + //! Get maximum value allowed + virtual double GetMax() = 0; + + //! Get recommended representation + virtual ERepresentation GetRepresentation() = 0; + + //! Get the physical unit name + virtual GenICam::gcstring GetUnit() const = 0; + }; + + + //************************************************************* + // CFloatRef class + //************************************************************* + + /** + \internal + \brief Reference to an IEnumEntry pointer + \ingroup GenApi_PublicImpl + */ + template + class CFloatRefT : public CValueRefT + { + typedef CValueRefT ref; + + public: + /*--------------------------------------------------------*/ + // IFloat + /*--------------------------------------------------------*/ + + //! Set node value + virtual void SetValue(double Value, bool Verify = true) + { + if(ref::m_Ptr) + return ref::m_Ptr->SetValue(Value, Verify); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Set node value + virtual IFloat& operator=(double Value) + { + if(ref::m_Ptr) + return ref::m_Ptr->operator=(Value); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get node value + virtual double GetValue(bool Verify = false) + { + if(ref::m_Ptr) + return ref::m_Ptr->GetValue(Verify); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get node value + virtual double operator()() + { + if(ref::m_Ptr) + return ref::m_Ptr->operator()(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get node value + virtual double operator*() + { + if(ref::m_Ptr) + return ref::m_Ptr->operator*(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get minimum value allowed + virtual double GetMin() + { + if(ref::m_Ptr) + return ref::m_Ptr->GetMin(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get maximum value allowed + virtual double GetMax() + { + if(ref::m_Ptr) + return ref::m_Ptr->GetMax(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get recommended representation + virtual ERepresentation GetRepresentation() + { + if(ref::m_Ptr) + return ref::m_Ptr->GetRepresentation(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get unit + virtual GenICam::gcstring GetUnit() const + { + if (ref::m_Ptr) + return ref::m_Ptr->GetUnit(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + }; + + //! Reference to an IFloat pointer + //! \ingroup GenApi_PublicImpl + typedef CFloatRefT CFloatRef; + + +} + +#pragma warning ( pop ) + +#endif // ifndef GENAPI_IFLOAT_H diff --git a/thirdparty/GenICam/include/GenApi/IInteger.h b/thirdparty/GenICam/include/GenApi/IInteger.h new file mode 100644 index 0000000..0928a80 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/IInteger.h @@ -0,0 +1,190 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/IInteger.h,v 1.14 2007/08/16 13:56:40 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of the interface IInteger. +\ingroup GenApi_PublicInterface +*/ + +#ifndef GENAPI_IIINTEGER_H +#define GENAPI_IIINTEGER_H + +#include "GenApiDll.h" +#include "Types.h" +#include "IValue.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY + +namespace GenApi +{ + //************************************************************* + // IInteger interface + //************************************************************* + + /** + \brief Interface for integer properties + \ingroup GenApi_PublicInterface + */ + interface IInteger : virtual public IValue + { + //! Set node value + virtual void SetValue(int64_t Value, bool Verify = true) = 0; + + //! Set node value + virtual IInteger& operator=(int64_t Value) = 0; + + //! Get node value + virtual int64_t GetValue(bool Verify = false) = 0; + + //! Get node value + virtual int64_t operator()() = 0; + + //! Get node value + virtual int64_t operator*() = 0; + + //! Get minimum value allowed + virtual int64_t GetMin() = 0; + + //! Get maximum value allowed + virtual int64_t GetMax() = 0; + + //! Get increment + virtual int64_t GetInc() = 0; + + //! Get recommended representation + virtual ERepresentation GetRepresentation() = 0; + }; + + //************************************************************* + // CIntegerRef class + //************************************************************* + + /** + \internal + \brief Reference to an IInteger pointer + \ingroup GenApi_PublicImpl + */ + template + class CIntegerRefT : public CValueRefT + { + typedef CValueRefT ref; + + public: + /*--------------------------------------------------------*/ + // IInteger + /*--------------------------------------------------------*/ + + //! Set node value + virtual void SetValue(int64_t Value, bool Verify = true) + { + if(ref::m_Ptr) + return ref::m_Ptr->SetValue(Value, Verify); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Set node value + virtual IInteger& operator=(int64_t Value) + { + if(ref::m_Ptr) + return ref::m_Ptr->operator=(Value); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get node value + virtual int64_t GetValue(bool Verify = false) + { + if(ref::m_Ptr) + return ref::m_Ptr->GetValue(Verify); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get node value + virtual int64_t operator()() + { + if(ref::m_Ptr) + return ref::m_Ptr->operator()(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get node value + virtual int64_t operator*() + { + if(ref::m_Ptr) + return ref::m_Ptr->operator*(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get minimum value allowed + virtual int64_t GetMin() + { + if(ref::m_Ptr) + return ref::m_Ptr->GetMin(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get maximum value allowed + virtual int64_t GetMax() + { + if(ref::m_Ptr) + return ref::m_Ptr->GetMax(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get increment + virtual int64_t GetInc() + { + if(ref::m_Ptr) + return ref::m_Ptr->GetInc(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get recommended representation + virtual ERepresentation GetRepresentation() + { + if(ref::m_Ptr) + return ref::m_Ptr->GetRepresentation(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + }; + + //! Reference to an IInteger pointer + //! \ingroup GenApi_PublicImpl + typedef CIntegerRefT CIntegerRef; +} + +#pragma warning ( pop ) + +#endif // ifndef GENAPI_IIINTEGER_H diff --git a/thirdparty/GenICam/include/GenApi/INode.h b/thirdparty/GenICam/include/GenApi/INode.h new file mode 100644 index 0000000..b351f09 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/INode.h @@ -0,0 +1,261 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/INode.h,v 1.25 2008/01/17 16:54:03 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of interface INode and types NodeList_t and CallbackHandleType: +\ingroup GenApi_PublicInterface +*/ + + +#ifndef GENAPI_INODE_H +#define GENAPI_INODE_H + +#include "GenApiDll.h" +#include "Types.h" +#include "IBase.h" +#include +#include "Container.h" + +#include + +#pragma warning ( push ) +#pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY + +namespace GenApi +{ + + interface INode; + interface INodeMap; + + //! a list of node references + typedef node_vector NodeList_t; + + //! the callback handle for nodes + typedef intptr_t CallbackHandleType; + + class NodeCallback; + + //************************************************************* + // INode interface + //************************************************************* + + /** + \brief Interface common to all nodes + \ingroup GenApi_PublicInterface + */ + interface INode : virtual public IBase + { + //! Get node name + virtual GenICam::gcstring GetName(bool FullQualified=false) const = 0; + + //! Get name space + virtual GenApi::ENameSpace GetNameSpace() const = 0; + + //! Get the recommended visibility of the node + virtual EVisibility GetVisibility() const = 0; + + //! Set/reset changed status + virtual void InvalidateNode() = 0; + + //! Is the node value cachable + virtual bool IsCachable() const = 0; + + //! Get Caching Mode + virtual ECachingMode GetCachingMode() const = 0; + + //! recommended polling time (for not cachable nodes) + virtual int64_t GetPollingTime() const = 0; + + //! Get a short description of the node + virtual GenICam::gcstring GetToolTip() const = 0; + + //! Get a long description of the node + virtual GenICam::gcstring GetDescription() const = 0; + + //! Get a name string for display + virtual GenICam::gcstring GetDisplayName() const = 0; + + //! Get all children of the node + virtual void GetChildren(NodeList_t &Children) const = 0; + + //! Register change callback + virtual CallbackHandleType RegisterCallback( NodeCallback& ) = 0; + + //! Deregister change callback + virtual CallbackHandleType DeregisterCallback( CallbackHandleType )=0; + + //! Retrieves the central node map + virtual INodeMap* GetNodeMap() const = 0; + + //! Get the EventId of the node + virtual GenICam::gcstring GetEventID() const = 0; + + //! True if the node is streamable + virtual bool IsStreamable() const = 0; + + //! Returns a list of the names all properties set during initialization + virtual void GetPropertyNames(GenICam::gcstring_vector &PropertyNames) const = 0; + + //! Retrieves a property plus an additional attribute by name + /*! If a property has multiple values/attribute they come with Tabs as delimiters */ + virtual bool GetProperty(const GenICam::gcstring& PropertyName, GenICam::gcstring& ValueStr, GenICam::gcstring& AttributeStr) = 0; + + //! Imposes an access mode to the natural access mode of the node + virtual void ImposeAccessMode(EAccessMode ImposedAccessMode) = 0; + + //! Imposes a visibility to the natural visibility of the node + virtual void ImposeVisibility(EVisibility ImposedVisibility) = 0; + + //! Retrieves the a node which describes the same feature in a different way + virtual INode* GetAlias() const = 0; + + }; + + //! \addtogroup GenApi_PublicInterface + //! \{ + + //! Tests if readable + inline bool IsReadable( EAccessMode AccessMode ) + { + return RO == AccessMode || RW == AccessMode; + } + + //! Checks if a node is readable + inline bool IsReadable( const IBase* p) + { + return IsReadable( p->GetAccessMode() ); + } + + //! Checks if a node is readable + inline bool IsReadable( const IBase& r) + { + return IsReadable( r.GetAccessMode() ); + } + + //! Tests if writable + inline bool IsWritable( EAccessMode AccessMode ) + { + return WO == AccessMode || RW == AccessMode; + } + + //! Checks if a node is writable + inline bool IsWritable( const IBase* p) + { + return IsWritable( p->GetAccessMode() ); + } + + //! Checks if a node is writable + inline bool IsWritable( const IBase& r) + { + return IsWritable( r.GetAccessMode() ); + } + + //! Tests if implemented + inline bool IsImplemented( EAccessMode AccessMode ) + { + return AccessMode != NI; + } + + //! Checks if a node is implemented + inline bool IsImplemented( const IBase* p) + { + return IsImplemented(p->GetAccessMode() ); + } + + //! Checks if a node is implemented + inline bool IsImplemented( const IBase& r) + { + return IsImplemented(&r); + } + + //! Tests if available + inline bool IsAvailable( EAccessMode AccessMode ) + { + return ! ( AccessMode == NA || AccessMode == NI ); + } + //! Checks if a node is available + inline bool IsAvailable( const IBase* p) + { + return IsAvailable(p->GetAccessMode() ); + } + //! Checks if a node is available + inline bool IsAvailable( const IBase& r) + { + return IsAvailable(r.GetAccessMode() ); + } + + //! Computes which access mode the two guards allow together + inline EAccessMode Combine(EAccessMode Peter, EAccessMode Paul) + { + assert( Peter != _UndefinedAccesMode ); + assert( Paul != _UndefinedAccesMode ); + + if( Peter == NI || Paul == NI ) + return NI; + else if( Peter == NA || Paul == NA ) + return NA; + else if( (Peter == RO && Paul == WO) || (Peter == WO && Paul == RO) ) + return NA; + else if( Peter == WO || Paul == WO ) + return WO; + else if( Peter == RO || Paul == RO ) + return RO; + else + return RW; + } + + + //! Tests Visibility + /*! CAVE : this relys on the EVisibility enum's coding */ + inline bool IsVisible( EVisibility Visibility, EVisibility MaxVisiblity ) + { + return (Visibility <= MaxVisiblity); + } + + + //! Computes which visibility the two guards allow together + inline EVisibility Combine(EVisibility Peter, EVisibility Paul) + { + assert( Peter != _UndefinedVisibility ); + assert( Paul != _UndefinedVisibility ); + + if( Peter == Invisible || Paul == Invisible ) + return Invisible; + else if( Peter == Guru || Paul == Guru ) + return Guru; + else if( Peter == Expert || Paul == Expert ) + return Expert; + else + return Beginner; + } + + + //! \} + +} + +#pragma warning ( pop ) + +#endif // ifndef GENAPI_INODE_H diff --git a/thirdparty/GenICam/include/GenApi/INodeMap.h b/thirdparty/GenICam/include/GenApi/INodeMap.h new file mode 100644 index 0000000..3225df5 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/INodeMap.h @@ -0,0 +1,81 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/INodeMap.h,v 1.13 2007/08/16 13:56:40 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of interface INodeMap +\ingroup GenApi_PublicInterface +*/ + +#ifndef GENAPI_INODEMAP_H +#define GENAPI_INODEMAP_H + +#include +#include "INode.h" +#include "IPort.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY + +namespace GenApi +{ + + //************************************************************* + // INodeMap interface + //************************************************************* + + /** + \brief Interface to access the node map + \ingroup GenApi_PublicInterface + */ + interface INodeMap + { + //! Retrieves all nodes in the node map + virtual void GetNodes(NodeList_t &Nodes) const = 0; + + //! Retrieves the node from the central map by Name + virtual INode* GetNode( const GenICam::gcstring& Name) const = 0; + + //! Invalidates all nodes + virtual void InvalidateNodes() const = 0; + + //! Connects a port to a port node with given name + virtual bool Connect( IPort* pPort, const GenICam::gcstring& PortName) const = 0; + + //! Connects a port to the standard port "Device" + virtual bool Connect( IPort* pPort) const = 0; + + //! Get device name + /*! The device name identifies a device instance, e.g. for debuggin purposes. + The default ist "Device". */ + virtual GenICam::gcstring GetDeviceName() = 0; + + //! Fires nodes which have a polling time + virtual void Poll( int64_t ElapsedTime ) = 0; + }; +} + +#pragma warning ( pop ) + +#endif // ifndef GENAPI_INODEMAP_H diff --git a/thirdparty/GenICam/include/GenApi/INodeMapDyn.h b/thirdparty/GenICam/include/GenApi/INodeMapDyn.h new file mode 100644 index 0000000..f12d2da --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/INodeMapDyn.h @@ -0,0 +1,68 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/INodeMapDyn.h,v 1.11 2007/08/16 13:56:40 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of interface INodeMapDyn +\ingroup GenApi_PublicInterface +*/ + +#ifndef GENAPI_INODEMAPDYN_H +#define GENAPI_INODEMAPDYN_H + +#include +#include "INodeMap.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY + +namespace GenApi +{ + + //************************************************************* + // INodeMap interface + //************************************************************* + + /** + \brief Interface to access the node map + \ingroup GenApi_PublicInterface + */ + interface INodeMapDyn : virtual public INodeMap + { + //! Deletes all Nodes from the map + virtual void ClearAllNodes() = 0; + + //! Loads an XML froma file + virtual void LoadXMLFromFile(const GenICam::gcstring& FileName) = 0; + + //! Loads an XML from a string + virtual void LoadXMLFromString(const GenICam::gcstring& XMLData) = 0; + + }; + +} + +#pragma warning ( pop ) + +#endif // ifndef GENAPI_INODEMAPDYN_H diff --git a/thirdparty/GenICam/include/GenApi/IPort.h b/thirdparty/GenICam/include/GenApi/IPort.h new file mode 100644 index 0000000..1dda32e --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/IPort.h @@ -0,0 +1,109 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/IPort.h,v 1.14 2007/08/16 13:56:41 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of interface IPort +\ingroup GenApi_PublicInterface +*/ + +#ifndef GENAPI_IPORT_H +#define GENAPI_IPORT_H + +#include "GenApiDll.h" +#include "Types.h" +#include "IBase.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY + +namespace GenApi +{ + //************************************************************* + // IPort interface + //************************************************************* + + /** + \brief Interface for ports + \ingroup GenApi_PublicInterface + */ + interface IPort : virtual public IBase + { + //! Reads a chunk of bytes from the port + virtual void Read(void *pBuffer, int64_t Address, int64_t Length) = 0; + + //! Writes a chunk of bytes to the port + virtual void Write(const void *pBuffer, int64_t Address, int64_t Length) = 0; + }; + + //************************************************************* + // CPortRef class + //************************************************************* + + /** + \internal + \brief Reference to an IPort pointer + \ingroup GenApi_PublicImpl + */ + template + class CPortRefT : public CBaseRefT + { + typedef CBaseRefT ref; + + public: + /*--------------------------------------------------------*/ + // IPort + /*--------------------------------------------------------*/ + + //! Reads a chunk of bytes from the port + virtual void Read(void *pBuffer, int64_t Address, int64_t Length) + { + if(ref::m_Ptr) + return ref::m_Ptr->Read(pBuffer, Address, Length); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Writes a chunk of bytes to the port + virtual void Write(const void *pBuffer, int64_t Address, int64_t Length) + { + if(ref::m_Ptr) + return ref::m_Ptr->Write(pBuffer, Address, Length); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + }; + + //! Reference to an IEnumEntry pointer + //! \ingroup GenApi_PublicImpl + typedef CPortRefT CPortRef; + + + +} + +#pragma warning ( pop ) + +#endif // ifndef GENAPI_IPORT_H diff --git a/thirdparty/GenICam/include/GenApi/IPortConstruct.h b/thirdparty/GenICam/include/GenApi/IPortConstruct.h new file mode 100644 index 0000000..a87b0d0 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/IPortConstruct.h @@ -0,0 +1,63 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/IPortConstruct.h,v 1.13 2007/08/16 13:56:41 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of interface IPortConstruct +\ingroup GenApi_PublicImpl +*/ + +#ifndef GENAPI_IPORTCONSTRUCT_H +#define GENAPI_IPORTCONSTRUCT_H + +#include "GenApiDll.h" +#include "Types.h" +#include "IPort.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY + +namespace GenApi +{ + //************************************************************* + // IPortContruct interface + //************************************************************* + + /** + \brief Interface for ports + \ingroup GenApi_PublicImpl + */ + interface IPortConstruct: virtual public IPort + { + //! Sets pointer the real port implementation; this function may called only once + virtual void SetPortImpl(IPort* pPort) = 0; + + //! Determines if the port adapter must perform an endianess swap + virtual EYesNo GetSwapEndianess() = 0; + }; +} + +#pragma warning ( pop ) + +#endif // ifndef GENAPI_IPORTCONSTRUCT_H diff --git a/thirdparty/GenICam/include/GenApi/IRegister.h b/thirdparty/GenICam/include/GenApi/IRegister.h new file mode 100644 index 0000000..930b9f5 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/IRegister.h @@ -0,0 +1,132 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/IRegister.h,v 1.14 2007/08/16 13:56:41 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of RegisterList_t type and the interface IRegister +\ingroup GenApi_PublicInterface +*/ + +#ifndef GENAPI_IREGISTER_H +#define GENAPI_IREGISTER_H + +#include "GenApiDll.h" +#include "Types.h" +#include "IValue.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY + +namespace GenApi +{ + //************************************************************* + // IRegister interface + //************************************************************* + + /** + \brief Interface for registers + \ingroup GenApi_PublicInterface + */ + interface IRegister : virtual public IValue + { + //! Set the register's contents + virtual void Set(const uint8_t *pBuffer, int64_t Length) = 0; + + //! Fills a buffer with the register's contents + virtual void Get(uint8_t *pBuffer, int64_t Length) = 0; + + //! Retrieves the Length of the register [Bytes] + virtual int64_t GetLength() = 0; + + //! Retrieves the Address of the register + virtual int64_t GetAddress() = 0; + }; + + //************************************************************* + // CRegisterRef class + //************************************************************* + + /** + \internal + \brief Reference to an IRegister pointer + \ingroup GenApi_PublicImpl + */ + template + class CRegisterRefT : public CValueRefT + { + typedef CValueRefT ref; + + public: + /*--------------------------------------------------------*/ + // IRegister + /*--------------------------------------------------------*/ + + //! Set the register's contents + virtual void Set(const uint8_t *pBuffer, int64_t Length) + { + if(ref::m_Ptr) + return ref::m_Ptr->Set(pBuffer, Length); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Fills a buffer with the register's contents + virtual void Get(uint8_t *pBuffer, int64_t Length) + { + if(ref::m_Ptr) + return ref::m_Ptr->Get(pBuffer, Length); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Retrieves the Length of the register [Bytes] + virtual int64_t GetLength() + { + if(ref::m_Ptr) + return ref::m_Ptr->GetLength(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Retrieves the Address of the register + virtual int64_t GetAddress() + { + if(ref::m_Ptr) + return ref::m_Ptr->GetAddress(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + }; + + //! Reference to an IRegister pointer + //! \ingroup GenApi_PublicImpl + typedef CRegisterRefT CRegisterRef; + + +} + +#pragma warning ( pop ) + +#endif // ifndef GENAPI_IREGISTER_H diff --git a/thirdparty/GenICam/include/GenApi/ISelector.h b/thirdparty/GenICam/include/GenApi/ISelector.h new file mode 100644 index 0000000..0726bde --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/ISelector.h @@ -0,0 +1,116 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Hartmut Nebelung +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/ISelector.h,v 1.12 2007/08/16 13:56:41 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of ISelector +*/ + +#ifndef GENAPI_ISELECTOR_H +#define GENAPI_ISELECTOR_H + +#if defined (_MSC_VER) && (_MSC_VER > 1200) +#pragma once +#endif // _MSC_VER > 1200 + +#include "GenApiDll.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY + +namespace GenApi +{ + /** + \brief Interface for groups of features selected by a single one + \ingroup GenApi_PublicImpl + */ + interface ISelector : virtual public IBase + { + //! true iff this feature selects a group of features + virtual bool IsSelector() const = 0; + + //! retrieve the group of selected features + virtual void GetSelectedFeatures( FeatureList_t& ) const = 0; + + //! retrieve the group of features selecting this node + virtual void GetSelectingFeatures( FeatureList_t& ) const = 0; + }; + + //************************************************************* + // CSelectorRef class + //************************************************************* + + /** + \internal + \brief Reference to an ISelector pointer + \ingroup GenApi_PublicImpl + */ + template + class CSelectorRefT : public CBaseRefT + { + typedef CBaseRefT ref; + + public: + /*--------------------------------------------------------*/ + // ISelector + /*--------------------------------------------------------*/ + + //! Get all features of the Selector + virtual void GetSelectedFeatures(FeatureList_t &Features) const + { + if(ref::m_Ptr) + return ref::m_Ptr->GetSelectedFeatures( Features ); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! retrieve the group of features selecting this node + virtual void GetSelectingFeatures( FeatureList_t& Features) const + { + if(ref::m_Ptr) + return ref::m_Ptr->GetSelectingFeatures( Features ); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! true iff this feature selects a group of features + virtual bool IsSelector() const + { + if(ref::m_Ptr) + return ref::m_Ptr->IsSelector(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + }; + + //! Reference to an ISelector pointer + //! \ingroup GenApi_PublicImpl + typedef CSelectorRefT CSelectorRef; + +} + +#pragma warning ( pop ) + + +#endif // GENAPI_ISELECTOR_H diff --git a/thirdparty/GenICam/include/GenApi/IString.h b/thirdparty/GenICam/include/GenApi/IString.h new file mode 100644 index 0000000..d80cedf --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/IString.h @@ -0,0 +1,145 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/IString.h,v 1.14 2007/08/16 13:56:41 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of interface IString +\ingroup GenApi_PublicInterface +*/ + +#ifndef GENAPI_ISTRING_H +#define GENAPI_ISTRING_H + +#include +#include "GenApiDll.h" +#include "Types.h" +#include "IValue.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY + +namespace GenApi +{ + //************************************************************* + // IString interface + //************************************************************* + + /** + \brief Interface for string properties + \ingroup GenApi_PublicInterface + */ + interface IString : virtual public IValue + { + //! Set node value + virtual void SetValue(const GenICam::gcstring& Value, bool Verify = true) = 0; + + //! Set node value + virtual IString& operator=(const GenICam::gcstring& Value) = 0; + + //! Get node value + virtual GenICam::gcstring GetValue(bool Verify = false) = 0; + + //! Get node value + virtual GenICam::gcstring operator()() = 0; + + //! Get node value + virtual GenICam::gcstring operator*() = 0; + + }; + //************************************************************* + // CStringRef class + //************************************************************* + + /** + \internal + \brief Reference to an IEnumEntry pointer + \ingroup GenApi_PublicImpl + */ + template + class CStringRefT : public CValueRefT + { + typedef CValueRefT ref; + + public: + /*--------------------------------------------------------*/ + // IString + /*--------------------------------------------------------*/ + + //! Set node value + virtual void SetValue(const GenICam::gcstring& Value, bool Verify = true) + { + if(ref::m_Ptr) + return ref::m_Ptr->SetValue(Value, Verify); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Set node value + virtual IString& operator=(const GenICam::gcstring& Value) + { + if(ref::m_Ptr) + return ref::m_Ptr->operator=(Value); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get node value + virtual GenICam::gcstring GetValue(bool Verify = false) + { + if(ref::m_Ptr) + return ref::m_Ptr->GetValue(Verify); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get node value + virtual GenICam::gcstring operator()() + { + if(ref::m_Ptr) + return ref::m_Ptr->operator()(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get node value + virtual GenICam::gcstring operator*() + { + if(ref::m_Ptr) + return ref::m_Ptr-> operator*(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + }; + + //! Reference to an IString pointer + //! \ingroup GenApi_PublicImpl + typedef CStringRefT CStringRef; + + +} + +#pragma warning ( pop ) + +#endif // ifndef GENAPI_ISTRING_H diff --git a/thirdparty/GenICam/include/GenApi/IValue.h b/thirdparty/GenICam/include/GenApi/IValue.h new file mode 100644 index 0000000..8b2a79a --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/IValue.h @@ -0,0 +1,125 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/IValue.h,v 1.13 2007/08/16 13:56:41 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of the interface IValue. +\ingroup GenApi_PublicInterface +*/ + +#ifndef GENAPI_IVALUE_H +#define GENAPI_IVALUE_H + +#include "GenApiDll.h" +#include "Types.h" +#include "IBase.h" +#include "INode.h" +#include +#include + +#pragma warning ( push ) +#pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY + +namespace GenApi +{ + interface INode; + + //************************************************************* + // IValue interface + //************************************************************* + + /** + \brief Interface for value properties + \ingroup GenApi_PublicInterface + */ + interface IValue : virtual public IBase + { + //! Get the INode interface of the node + virtual INode* GetNode() { return dynamic_cast(this); } + + //! Get content of the node as string + virtual GenICam::gcstring ToString(bool Verify = false) = 0; + + //! Set content of the node as string + virtual void FromString(const GenICam::gcstring& ValueStr, bool Verify = true) = 0; + }; + + + //************************************************************* + // CValueRef class + //************************************************************* + + /** + \internal + \brief Reference to an IValue pointer + \ingroup GenApi_PublicImpl + */ + template + class CValueRefT : public CBaseRefT + { + typedef CBaseRefT ref; + + public: + /*--------------------------------------------------------*/ + // IValue + /*--------------------------------------------------------*/ + + //! Get the INode interface of the node + virtual INode* GetNode() + { + if(ref::m_Ptr) + return ref::m_Ptr->GetNode(); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Get content of the node as string + virtual GenICam::gcstring ToString(bool Verify = false) + { + if(ref::m_Ptr) + return ref::m_Ptr->ToString(Verify); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + //! Set content of the node as string + virtual void FromString(const GenICam::gcstring& ValueStr, bool Verify = true) + { + if(ref::m_Ptr) + return ref::m_Ptr->FromString(ValueStr, Verify); + else + throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); + } + + }; + + //! Reference to an IValue pointer + //! \ingroup GenApi_PublicImpl + typedef CValueRefT CValueRef; + +} + +#pragma warning ( pop ) + +#endif // ifndef GENAPI_IVALUE_H diff --git a/thirdparty/GenICam/include/GenApi/Log.h b/thirdparty/GenICam/include/GenApi/Log.h new file mode 100644 index 0000000..6d37333 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/Log.h @@ -0,0 +1,48 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/Log.h,v 1.7 2007/11/13 19:41:09 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/** +\file +\brief includes all include files from Log module. +\ingroup GenApi_PublicImpl +*/ + +#ifndef GENAPI_DEF_LOG_H_ +#define GENAPI_DEF_LOG_H_ + +// This is the central point for enabling/disabling the logging +// Don't enable LOG4C manually at any other point (just don't, believe me. Fritz :-) +#ifdef _DEBUG + #define LOG4C +#else + // in release mode logging is not enabled +#endif + +#include + +//! Operator required for using hex opeator etc +//! \ingroup GenApi_PublicImpl +log4cpp::CategoryStream& operator <<(log4cpp::CategoryStream &ostr, const GenICam::gcstring &str); + +#endif // GENAPI_DEF_LOG_H_ diff --git a/thirdparty/GenICam/include/GenApi/NodeCallback.h b/thirdparty/GenICam/include/GenApi/NodeCallback.h new file mode 100644 index 0000000..71e065d --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/NodeCallback.h @@ -0,0 +1,57 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Hartmut Nebelung +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/NodeCallback.h,v 1.11.2.1 2008/07/14 08:30:46 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Defines the NodeCallback class +\ingroup GenApi_PublicImpl +*/ + +#ifndef GENAPI_NODECALLBACK_H +#define GENAPI_NODECALLBACK_H + +#include "Callback.h" + +namespace GenApi +{ + + struct INode; + class NodeCallbackBase; + + /** + \brief Callback object for callback taking an INode pointer + \ingroup GenApi_PublicImpl + */ + class GENAPI_DECL NodeCallback : public Callback1 + { + public: + NodeCallback( GenApi::NodeCallbackBase *pb ); + NodeCallback( const NodeCallback& cb ); + NodeCallback& operator=( const NodeCallback& cb ); + + }; + +} + +#endif // GENAPI_NODECALLBACK_H diff --git a/thirdparty/GenICam/include/GenApi/NodeCallbackImpl.h b/thirdparty/GenICam/include/GenApi/NodeCallbackImpl.h new file mode 100644 index 0000000..6c220ce --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/NodeCallbackImpl.h @@ -0,0 +1,190 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Hartmut Nebelung +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/NodeCallbackImpl.h,v 1.14.2.1 2008/07/14 08:30:46 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Implementation helpers for NodeCallback +\ingroup GenApi_PublicImpl + +Defines a bunch of templates for creating callback-functors taking a INode pointer +and returning void. + +\note does not work with all stl containers, i.e. std::map + +*/ + +#ifndef GENAPI_NODECALLBACKIMPL_H +#define GENAPI_NODECALLBACKIMPL_H + +#include "NodeCallback.h" + +namespace GenApi +{ + using GenApi::NodeCallback; + using GenApi::Base_Callback1Body; + + /** + \brief callback body instance for INode pointers + \ingroup GenApi_PublicImpl + */ + // xxx class GENAPI_DECL NodeCallbackBase : public Base_Callback1Body + class NodeCallbackBase : public Base_Callback1Body + { + }; + + /***************************************************************************/ + // C Functions as callbacks + /***************************************************************************/ + + /** + \brief Container for a function pointer + \ingroup GenApi_PublicImpl + */ + template + class Function_NodeCallbackBody : public NodeCallbackBase + { + public: + //! Constructor + Function_NodeCallbackBody( const Function& function ) : + m_pFunction( function ) + {} + + //! execute operation: call the function + void operator()(INode* pNode) const + { + if (m_pFunction) + m_pFunction( pNode ); + } + + //! virtual copy constructor + Function_NodeCallbackBody* clone() const + { + return new Function_NodeCallbackBody(*this); + } + private: + //! the callback function + const Function m_pFunction; + + //! no assignemt operator + Function_NodeCallbackBody& operator=(Function_NodeCallbackBody&); + }; + + /*-----------------------------------------------------------------------------*/ + + /** + \brief make a new callback object for C functions + \ingroup GenApi_PublicImpl + */ + template + NodeCallback make_NodeCallback( Function function ) + { + return NodeCallback(new Function_NodeCallbackBody(function)); + } + + /*-----------------------------------------------------------------------------*/ + + /** + \brief Register a C-function as a callback + \ingroup GenApi_PublicUtilities + */ + template + intptr_t Register( INode* pNode, Function f) + { + NodeCallback cb(make_NodeCallback(f)); + return pNode->RegisterCallback(cb); + } + + /***************************************************************************/ + // C++ Member functions as callbacks + /***************************************************************************/ + + /** + \brief Container for a member function pointer + \ingroup GenApi_PublicImpl + */ + template + class Member_NodeCallbackBody : public NodeCallbackBase + { + public: + //! Member function type + typedef void (Client::*PMEMBERFUNC)(INode*); + + //! Constructor + Member_NodeCallbackBody( Client& client, Member member ) : + m_Client(client), + m_pMemberFunc(member) + {} + + //! execute operation + void operator()( INode* pNode ) const + { + if (m_pMemberFunc) + (m_Client.*m_pMemberFunc)( pNode ); + } + + //! virtual copy constructor + Member_NodeCallbackBody* clone() const + { + return new Member_NodeCallbackBody( m_Client, m_pMemberFunc ); + } + + private: + //! The object the method function belongs to + Client& m_Client; + + //! The method to call + PMEMBERFUNC m_pMemberFunc; + + //! no assognment operator + Member_NodeCallbackBody& operator=(Member_NodeCallbackBody&); + }; + + /*-----------------------------------------------------------------------------*/ + + /** + \brief make a new callback object for member functions + \ingroup GenApi_PublicImpl + */ + template + NodeCallback make_NodeCallback( Client& client, Member member ) + { + return NodeCallback(new Member_NodeCallbackBody(client, member)); + } + + /*-----------------------------------------------------------------------------*/ + + /** + \brief Register a C++-member function a callback + \ingroup GenApi_PublicUtilities + */ + template + intptr_t Register( INode* pNode, Client &c, Member m ) + { + NodeCallback cb(make_NodeCallback(c, m)); + return pNode->RegisterCallback(cb); + } + +} + +#endif // GENAPI_NODECALLBACKIMPL_H diff --git a/thirdparty/GenICam/include/GenApi/NodeMapRef.h b/thirdparty/GenICam/include/GenApi/NodeMapRef.h new file mode 100644 index 0000000..b511632 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/NodeMapRef.h @@ -0,0 +1,137 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/NodeMapRef.h,v 1.11.2.1 2009/02/05 11:29:32 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CNodeMapRef +\ingroup GenApi_PublicInterface +*/ + +#ifndef GENAPI_NODEMAPREF_H +#define GENAPI_NODEMAPREF_H + +#include "Pointer.h" +#include "DLLLoad.h" + +namespace GenApi +{ + /** + \brief Smartpointer for NodeMaps with create function + \ingroup GenApi_PublicInterface + */ + class GENAPI_DECL CNodeMapRef + { + public: + //! Constructor + CNodeMapRef(GenICam::gcstring DeviceName = "Device" ); + + //! Destructor + virtual ~CNodeMapRef(); + + //! Creates the object from a DLL whose name is deduced from vendor anf model name + void _LoadDLL(GenICam::gcstring VendorName, GenICam::gcstring ModelName); + + //! Creates the object from a DLL with given file name + void _LoadDLL(GenICam::gcstring FileName); + + //! Creates the object from a XML file whose name is deduced from vendor anf model name + void _LoadXMLFromFile(GenICam::gcstring VendorName, GenICam::gcstring ModelName); + + //! Creates the object from a XML file with given file name + void _LoadXMLFromFile(GenICam::gcstring FileName); + + //! Creates the object from XML data given in a string + void _LoadXMLFromString(const GenICam::gcstring& XMLData); + + //! Get device name + virtual GenICam::gcstring _GetDeviceName(); + + //! Fires nodes which have a polling time + virtual void _Poll( int64_t ElapsedTime ); + + //! Destroys the node map + void _Destroy(); + + //! Clears the cache of the camera description files + static bool _ClearXMLCache(); + + //---------------------------------------------------------------- + // INodeMap + //---------------------------------------------------------------- + + //! Retrieves all nodes in the node map + virtual void _GetNodes(NodeList_t &Nodes) const; + + + //! Retrieves the node from the central map by name + virtual INode* _GetNode( const GenICam::gcstring& key) const; + + //! Invalidates all nodes + virtual void _InvalidateNodes() const; + + //! Connects a port to a port node with given name + virtual bool _Connect( IPort* pPort, const GenICam::gcstring& PortName) const; + + //! Connects a port to the standard port "Device" + virtual bool _Connect( IPort* pPort) const; + + //! Pointer to the NodeMap + #pragma warning ( push ) + #pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY + CPointer _Ptr; + #pragma warning ( pop ) + + + //! Retrieve all top-level nodes in the node map + protected: + //---------------------------------------------------------------- + // Implementation + //---------------------------------------------------------------- + + //! Creates the DLL filename + GenICam::gcstring _MakeDLLFileName(GenICam::gcstring VendorName, GenICam::gcstring ModelName); + + //! Creates the object from a DLL with given file name without initializing + void _InternalLoadDLL(GenICam::gcstring FileName); + + //! Initializes the references + virtual void _Initialize() + {} + + //! Loads the xmlloader dll + void _GetXmlLoader(); + private: + //! False, when the dll already has been loaded + bool _loaded; + + //! The name of this device + GenICam::gcstring _DeviceName; + + CNodeMapRef(const CNodeMapRef&); + CNodeMapRef& operator=(const CNodeMapRef&); + + }; +} + +#endif // ifndef GENAPI_NODEMAPPTR_H diff --git a/thirdparty/GenICam/include/GenApi/Persistence.h b/thirdparty/GenICam/include/GenApi/Persistence.h new file mode 100644 index 0000000..3a4b45f --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/Persistence.h @@ -0,0 +1,178 @@ +//----------------------------------------------------------------------------- +// (c) 2007 by National Instruments +// Project: GenApi +// Author: Eric Gross +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/Persistence.h,v 1.3.2.2 2009/02/05 11:18:28 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of interface IPersistScript and class CFeatureBag +\ingroup GenApi_PublicUtilities +*/ + +#ifndef _GENICAM_PERSISTENCE_H +#define _GENICAM_PERSISTENCE_H + +#include +#include +#include +#include "../GenICam.h" +#include +#include + +using namespace GenICam; + +namespace GenApi +{ + + //! Basic interface to persist values to + interface IPersistScript + { + //! sets information about the node map + virtual void SetInfo(gcstring &Info) = 0; + + //! Stores a feature + virtual void PersistFeature(IValue& item) = 0; + }; + + //! Bag holding streamable features of a nodetree + class GENAPI_DECL CFeatureBag : public IPersistScript + { + public: + //! sets information about the node map + virtual void SetInfo(gcstring &Info); + + //! Stores a feature + virtual void PersistFeature(IValue& item); + + //! Loads the features from the bag to the node tree + void LoadFromBag(INodeMap *pNodeMap); + + //! Stores the streamable nodes to this fature bag + void StoreToBag(INodeMap *pNodeMap); + + //! fills the bag from a stream + friend std::istream& operator >>(std::istream &is, CFeatureBag &FeatureBag); + + //! puts the bag into a stream + friend std::ostream& operator <<(std::ostream &os, const CFeatureBag &FeatureBag); + + private: + //! The features are stored in a list of string pairs = {Name, Value} + gcstring_vector m_Names; + + //! The features are stored in a list of string pairs = {Name, Value} + gcstring_vector m_Values; + + //! String describing the node map + gcstring m_Info; + }; + + //! Helper fundtion ignoring lines starting with comment character '#' + inline std::istream& EatComments(std::istream &is) + { + if( is.eof() ) + return is; + + char FirstCharacter; + FirstCharacter = (char)is.peek(); + + while( FirstCharacter == '#' ) + { + is.ignore(1024, '\n'); + FirstCharacter = (char)is.peek(); + } + return is; + } + + + //! the magic GUID which indicates that the file is a GenApi stream file Must be the first entry + #define GENAPI_PERSISTENCE_MAGIC "{05D8C294-F295-4dfb-9D01-096BD04049F4}" + + //! reads in presistent data from a stream + inline std::istream& operator >>(std::istream &is, CFeatureBag &FeatureBag) + { + if( is.eof() ) + throw RUNTIME_EXCEPTION("The stream is eof"); + + FeatureBag.m_Names.clear(); + FeatureBag.m_Values.clear(); + + const int BufferSize = 1024; + char Buffer[BufferSize] = {0}; + char Name[BufferSize] = {0}; + gcstring Value(""); + + // Check the magic + is.getline(Buffer, BufferSize, '\n'); + gcstring FirstLine(Buffer); + gcstring MagicGUID(GENAPI_PERSISTENCE_MAGIC); + if( gcstring::npos == FirstLine.find(MagicGUID) ) + throw RUNTIME_EXCEPTION("The stream is not a GenApi feature stream since it is missing the magic GUID in the first line"); + + EatComments( is ); + while( !is.eof() ) + { + is.getline(Name, BufferSize, '\t'); + if (is.fail()) // if reading from stream failed -> stop reading! + break; + + GenICam::getline(is, Value); + if (is.fail()) // if reading from stream failed -> stop reading! + break; + + FeatureBag.m_Names.push_back(Name); + FeatureBag.m_Values.push_back(Value); + + Name[0] = '\0'; + Value = ""; + EatComments( is ); + } + return is; + } + + //! writes out presistent data to a stream + inline std::ostream& operator <<(std::ostream &os, const CFeatureBag &FeatureBag) + { +#pragma warning( push ) +#pragma warning ( disable : 4068 ) // unknown pragma; refers to BullsEyeCoverage + os << "# " GENAPI_PERSISTENCE_MAGIC "\n"; + os << "# GenApi persistence file (version " << GENAPI_VERSION_MAJOR << "." << GENAPI_VERSION_MINOR << "." << GENAPI_VERSION_SUBMINOR << ")\n"; + os << "# " << FeatureBag.m_Info << "\n"; + + gcstring_vector::const_iterator pName = FeatureBag.m_Names.begin(); + gcstring_vector::const_iterator pValue = FeatureBag.m_Values.begin(); + for( /**/ ; pName != FeatureBag.m_Names.end() + #pragma BullseyeCoverage off + && pValue != FeatureBag.m_Values.end(); + #pragma BullseyeCoverage on + pName++, pValue++ ) + { + gcstring Name( *pName ); + gcstring Value( *pValue ); + os << Name << "\t" << Value << "\n"; + } + return os; +#pragma warning (pop ) + } + +} + +#endif //_GENICAM_PERSISTENCE_H diff --git a/thirdparty/GenICam/include/GenApi/Pointer.h b/thirdparty/GenICam/include/GenApi/Pointer.h new file mode 100644 index 0000000..4812c5e --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/Pointer.h @@ -0,0 +1,275 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/Pointer.h,v 1.19.2.1 2009/02/02 13:24:45 hopfner Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of template CPointer +\ingroup GenApi_PublicUtilities +*/ + +#ifndef GENAPI_POINTER_H +#define GENAPI_POINTER_H + + +#include + +#include "IBase.h" +#include "INode.h" +#include "IValue.h" +#include "ICategory.h" +#include "IInteger.h" +#include "IFloat.h" +#include "IRegister.h" +#include "IEnumeration.h" +#include "IEnumEntry.h" +#include "IBoolean.h" +#include "IPort.h" +#include "IPortConstruct.h" +#include "IChunkPort.h" +#include "IString.h" +#include "INodeMap.h" +#include "INodeMapDyn.h" +#include "IDestroy.h" +#include "IDeviceInfo.h" +#include "ISelector.h" +#include "ICommand.h" + +#include + +namespace GenApi +{ + //************************************************************* + // CPointer class + //************************************************************* + + /** + \brief Encapsulates a GenApi pointer dealing with the dynamic_cast automatically + \ingroup GenApi_PublicUtilities + */ + template + class CPointer + { + + public: + //! Default constructor. + CPointer(void) throw() + : m_pT( NULL ) + { + } + + //! Constructor from INode pointer type. + CPointer( B *pB ) + : m_pT( dynamic_cast(pB) ) + { + } + + virtual ~CPointer(void) + { + } + + //! Assign INode Pointer + void operator=( B *pB ) + { + m_pT = dynamic_cast(pB); + } + + //! Dereferencing + operator T*(void) const + { + if (NULL == m_pT) + throw LOGICAL_ERROR_EXCEPTION( "NULL pointer dereferenced" ); + return m_pT; + } + + //! Dereferencing + T& operator*(void) const + { + if (NULL == m_pT) + throw LOGICAL_ERROR_EXCEPTION( "NULL pointer dereferenced" ); + return *m_pT; + } + + //! Dereferencing + T& operator()(void) const + { + if (NULL == m_pT) + throw LOGICAL_ERROR_EXCEPTION( "NULL pointer dereferenced" ); + return *m_pT; + } + + //! Dereferencing + T* operator->(void) const + { + if (NULL == m_pT) + throw LOGICAL_ERROR_EXCEPTION( "NULL pointer dereferenced" ); + return m_pT; + } + + //! true if the pointer is valid + bool IsValid() const throw() + { + return m_pT != NULL; + } + + //! true if the pointer is valid + operator bool(void) const throw() + { + return m_pT != NULL; + } + + //! pointer equal + bool operator==(T* pT) const throw() + { + return m_pT == pT; + } + + //! pointer equal + bool operator==(int nMustBeNull) const + { + if (0 != nMustBeNull) + throw LOGICAL_ERROR_EXCEPTION( "argument must be NULL" ); + return NULL == m_pT; + } + + + protected: + + //! Underlying raw pointer. + T* m_pT; + }; + + //************************************************************* + // Smartpointer for all interface + //************************************************************* + + //! \addtogroup GenApi_PublicUtilities + //! \{ + + //! SmartPointer for IBase interface pointer + typedef CPointer CBasePtr; + + //! SmartPointer for INode interface pointer + typedef CPointer CNodePtr; + + //! SmartPointer for IValue interface pointer + typedef CPointer CValuePtr; + + //! SmartPointer for ICategory interface pointer + typedef CPointer CCategoryPtr; + + //! SmartPointer for IInteger interface pointer + typedef CPointer CIntegerPtr; + + //! SmartPointer for IBoolean interface pointer + typedef CPointer CBooleanPtr; + + //! SmartPointer for IFloat interface pointer + typedef CPointer CFloatPtr; + + //! SmartPointer for IString interface pointer + typedef CPointer CStringPtr; + + //! SmartPointer for IRegister interface pointer + typedef CPointer CRegisterPtr; + + //! SmartPointer for IEnumeration interface pointer + typedef CPointer CEnumerationPtr; + + //! SmartPointer for IEnumEntry interface pointer + typedef CPointer CEnumEntryPtr; + + //! SmartPointer for IPort interface pointer + typedef CPointer CPortPtr; + + //! SmartPointer for IChunkPort interface pointer + typedef CPointer CChunkPortPtr; + + //! SmartPointer for INodeMap interface pointer + typedef CPointer CNodeMapPtr; + + //! SmartPointer for INodeMapDyn interface pointer + typedef CPointer CNodeMapDynPtr; + + //! SmartPointer for IDeviceInfo interface pointer + typedef CPointer CDeviceInfoPtr; + + //! SmartPointer for ISelector interface pointer + typedef CPointer CSelectorPtr; + + //! SmartPointer for ICommand interface pointer + typedef CPointer CCommandPtr; + + //! \} + + //! \addtogroup GenApi_PublicImpl + //! \{ + + //! SmartPointer for IPortConstruct interface pointer + typedef CPointer CPortConstructPtr; + + + //! Returns the name of the main interface as string + inline GenICam::gcstring GetInterfaceName(IBase *pBase) + { +#pragma warning( push ) +#pragma warning ( disable : 4068 ) // unknown pragma; refers to BullsEyeCoverage + + if( dynamic_cast(pBase) ) + return GenICam::gcstring("IInteger"); + else if( dynamic_cast(pBase) ) + return GenICam::gcstring("IFloat"); + else if( dynamic_cast(pBase) ) + return GenICam::gcstring("IString"); + else if( dynamic_cast(pBase) ) + return GenICam::gcstring("IEnumeration"); + else if( dynamic_cast(pBase) ) + return GenICam::gcstring("IBoolean"); + else if( dynamic_cast(pBase) ) + return GenICam::gcstring("ICommand"); + else if( dynamic_cast(pBase) ) + return GenICam::gcstring("IRegister"); + else if( dynamic_cast(pBase) ) + return GenICam::gcstring("IEnumEntry"); + else if( dynamic_cast(pBase) ) + return GenICam::gcstring("IPort"); + // these must be the last + #pragma BullseyeCoverage off + else if( dynamic_cast(pBase) ) + return GenICam::gcstring("INode"); + else if( dynamic_cast(pBase) ) + return GenICam::gcstring("IValue"); + else if( dynamic_cast(pBase) ) + return GenICam::gcstring("IBase"); + else + return GenICam::gcstring("!!! unknown interface type !!!"); + #pragma BullseyeCoverage on +#pragma warning( pop ) + } + + //! \} + + +} + +#endif // ifndef GENAPI_POINTER_H diff --git a/thirdparty/GenICam/include/GenApi/PortImpl.h b/thirdparty/GenICam/include/GenApi/PortImpl.h new file mode 100644 index 0000000..bb20c7c --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/PortImpl.h @@ -0,0 +1,119 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/PortImpl.h,v 1.15.2.1 2008/07/14 08:45:06 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CPortImpl +\ingroup GenApi_PublicUtilities +*/ + +#ifndef GENAPI_PORTIMPL_H +#define GENAPI_PORTIMPL_H + +#include +#include "Types.h" +#include "IPortConstruct.h" +#include "Pointer.h" + +#pragma warning( push ) +#pragma warning( disable: 4251 ) // enApi::CPortImpl::m_ptrPort' : class 'GenApi::CPointer' needs to have dll-interface +#pragma warning ( disable : 4068 ) // unknown pragma; refers to BullsEyeCoverage + +namespace GenApi +{ + //************************************************************* + // CPortImpl class + //************************************************************* + + /** + \brief Standard implementation for a port + //! \ingroup GenApi_PublicUtilities + */ + class GENAPI_DECL CPortImpl : public IPortConstruct + { + public: + //! Constructor + CPortImpl() + { + } + + //! Destructor + virtual ~CPortImpl() + { + } + + /*---------------------------------------------------------------*/ + // IBase ==> You need to override this method + /*---------------------------------------------------------------*/ + + //! Get the access mode of the node + /*! Driver closed => NI, Driver open => RW, analysing a struct, RO */ + virtual EAccessMode GetAccessMode() const = 0; + + + /*---------------------------------------------------------------*/ + // IPort ==> You need to override these methods + /*---------------------------------------------------------------*/ + + //! Reads a chunk of bytes from the port + virtual void Read(void *pBuffer, int64_t Address, int64_t Length) = 0; + + //! Writes a chunk of bytes to the port + virtual void Write(const void *pBuffer, int64_t Address, int64_t Length) = 0; + + /*---------------------------------------------------------------*/ + // IPortConstruct implementation (without IPort & IBase) + /*---------------------------------------------------------------*/ + + //! Sets pointer the real port implementation; this function may called only once + virtual void SetPortImpl(IPort* pPort) + { + m_ptrPort = pPort; + assert(m_ptrPort.IsValid()); + } + + //! Determines if the port adapter must perform an endianess swap + #pragma BullseyeCoverage off + virtual EYesNo GetSwapEndianess() + { + return No; + } + #pragma BullseyeCoverage on + + // Invalidate the node + void InvalidateNode() + { + if(m_ptrPort.IsValid()) + m_ptrPort->InvalidateNode(); + } + + protected: + //! Pointer to the node holding a reference to this implementation + CNodePtr m_ptrPort; + + }; +} + +#pragma warning(pop) +#endif // ifndef GENAPI_PORTIMPL_H diff --git a/thirdparty/GenICam/include/GenApi/Reference.h b/thirdparty/GenICam/include/GenApi/Reference.h new file mode 100644 index 0000000..380491a --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/Reference.h @@ -0,0 +1,106 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/Reference.h,v 1.7 2007/08/16 13:56:42 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of template CReference +\ingroup GenApi_PublicImpl +*/ + +#ifndef GENAPI_REFERENCE_H +#define GENAPI_REFERENCE_H + +#include "Types.h" +#include "GenApiDll.h" + +namespace GenApi +{ + interface IBase; + + //************************************************************* + // IReference interface + //************************************************************* + + /** + \brief Interface to construct a reference + \ingroup GenApi_PublicImpl + */ + interface IReference + { + //! sets the implementation to a reference + virtual void SetReference( GenApi::IBase *pBase ) = 0; + }; + + //************************************************************* + // IEnumReference interface + //************************************************************* + + /** + \brief Interface to construct an enum reference + \ingroup GenApi_PublicImpl + */ + interface IEnumReference + { + //! sets the Enum value corresponding to a value + virtual void SetEnumReference( int Index, GenICam::gcstring Name) = 0; + + //! sets the number of enum vallues + virtual void SetNumEnums( int NumEnums ) = 0; + }; + + //************************************************************* + // CReference class + //************************************************************* + + /** + \brief Reference to an IBase derived pointer + \ingroup GenApi_PublicImpl + */ + template + class CReferenceT : public T, public IReference + { + public: + // Constructor + CReferenceT() : + m_Ptr(NULL) + {} + + /*--------------------------------------------------------*/ + // IReference + /*--------------------------------------------------------*/ + + //! sets the implementation to the reference + virtual void SetReference( IBase *ptr ) + { + m_Ptr = dynamic_cast( ptr ); + } + + protected: + //! Pointer to the implementation the reference references to + T *m_Ptr; + }; + +} + +#endif // ifndef GENAPI_REFERENCE_H diff --git a/thirdparty/GenICam/include/GenApi/RegisterPortImpl.h b/thirdparty/GenICam/include/GenApi/RegisterPortImpl.h new file mode 100644 index 0000000..9041817 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/RegisterPortImpl.h @@ -0,0 +1,132 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/RegisterPortImpl.h,v 1.4 2007/08/16 13:56:42 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CRegisterPortImpl +\ingroup GenApi_PublicUtilities +*/ + +#ifndef GENAPI_REGISTERPORTIMPL_H +#define GENAPI_REGISTERPORTIMPL_H + +#include "PortImpl.h" +#include "Log.h" +#include "impl/Compatibility.h" + +namespace GenApi +{ + //************************************************************* + // CRegisterPortImpl class + //************************************************************* + + /** + \brief Standard implementation for a port using a register based transport layer + //! \ingroup GenApi_PublicUtilities + */ + class GENAPI_DECL CRegisterPortImpl : public CPortImpl + { + public: + //! Constructor + CRegisterPortImpl(int MaxNumQuadlets = 1, bool TransportLayerSwapsEndianess = false); + + //! Destructor + virtual ~CRegisterPortImpl(); + + /*---------------------------------------------------------------*/ + // IBase ==> You need to override this method + /*---------------------------------------------------------------*/ + + //! Get the access mode of the node + /*! Driver closed => NI, Driver open => RW, analysing a struct, RO */ + virtual EAccessMode GetAccessMode() const = 0; + + /*---------------------------------------------------------------*/ + // IRegisterPort ==> You need to override these methods + /*---------------------------------------------------------------*/ + + //! Reads a array of quadlets from the port + virtual void ReadRegister(uint32_t *pRegisters, int64_t Address, int64_t Length) = 0; + + //! Writes an array of quadlets to the port + virtual void WriteRegister(const uint32_t *pRegisters, int64_t Address, int64_t Length) = 0; + + /*---------------------------------------------------------------*/ + // IPort + /*---------------------------------------------------------------*/ + + //! Reads a chunk of bytes from the port + virtual void Read(void *pBuffer, int64_t Address, int64_t Length); + + //! Writes a chunk of bytes to the port + virtual void Write(const void *pBuffer, int64_t Address, int64_t Length); + + /*---------------------------------------------------------------*/ + // IPortConstruct implementation (without IPort & IBase) + /*---------------------------------------------------------------*/ + + //! Sets pointer the real port implementation; this function may called only once + virtual void SetPortImpl(IPort* pPort); + + // Invalidate the node + void InvalidateNode(); + + protected: + //! Reads a array of quadlets from the port + virtual void InternalReadRegister(uint32_t *pRegisters, int64_t Address, int64_t Length); + + //! Writes an array of quadlets to the port + virtual void InternalWriteRegister(const uint32_t *pRegisters, int64_t Address, int64_t Length); + + //! Pointer to the node holding a reference to this implementation + CNodePtr m_ptrPort; + + //! The maximum nuber of quadlets ReadRegister can take + int m_MaxNumQuadlets; + + //! Inidicates if the transport layer driver flips the quadlets coming from thte network + /*! False means that the quadlets are delivered as they are coming via the network + True means that the transport layer driver does a little/big endian swap before delivering the quadlets + */ + bool m_TransportLayerSwapsEndianess; + + //! Buffer holding the quadlets from the network + uint32_t *m_pQuadletBuffer; + + //! Buffer holding the quadlets from the network + uint32_t *m_pQuadletSwapBuffer; + + //! Indicates if an edianess swap must be performed + bool m_EndianessSwap; + +#ifdef LOG4C + //! Logger for messages concerning the port access + log4cpp::Category *m_pPortLog; +#endif + + }; +} + + +#endif // ifndef GENAPI_PORTIMPL_H diff --git a/thirdparty/GenICam/include/GenApi/RegisterSetHelper.h b/thirdparty/GenICam/include/GenApi/RegisterSetHelper.h new file mode 100644 index 0000000..69e2fee --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/RegisterSetHelper.h @@ -0,0 +1,84 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Alexander Happe / Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/RegisterSetHelper.h,v 1.7 2006/07/18 13:31:52 rueder Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! + \file + \brief Definition of CRegisterSetHelper + \ingroup GenApi_PublicUtilities +*/ + + +#ifndef REGISTER_SET_HELPER_H +#define REGISTER_SET_HELPER_H + +namespace GenApi +{ + /** + \brief Copies data from buffer to variables ina type safe manner + \ingroup GenApi_PublicUtilities + */ + class GENAPI_DECL CRegisterSetHelper + { + public: + //! Memcopy fireing exceptions + static size_t CopyData( void *pvDestination, size_t nbyDestSize, const void *pvSource, size_t nbySourceSize ) + { + if (nbyDestSize != nbySourceSize) + { + throw OUT_OF_RANGE_EXCEPTION("CopyData : Destination size (%ld) does not fit source size (%d)", nbyDestSize, nbySourceSize); + } + +#if defined(_WINDOWS_) + if ( IsBadWritePtr(pvDestination, nbyDestSize) || IsBadReadPtr(pvSource, nbySourceSize) ) + { + throw RUNTIME_EXCEPTION("Invalid user buffer"); + } +#endif + + memcpy( pvDestination, pvSource, nbySourceSize ); + return nbySourceSize; + } + + /** + \brief Typesafe copy from variable to buffer + */ + template + static size_t CopyToBuffer( void *pvDestination, size_t nbyDestSize, T *d ) + { + return CopyData( pvDestination, nbyDestSize, d, sizeof( *d ) ); + } + + /** + \brief Typesafe copy from buffer to variable + */ + template + static size_t CopyFromBuffer( T *d, const void *pvDestination, size_t nbyDestSize) + { + return CopyData( d, sizeof( *d ), pvDestination, nbyDestSize); + } + }; + +} // namespace GenApi + +#endif // ifndef REGISTER_SET_HELPER_H diff --git a/thirdparty/GenICam/include/GenApi/Synch.h b/thirdparty/GenICam/include/GenApi/Synch.h new file mode 100644 index 0000000..c493427 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/Synch.h @@ -0,0 +1,252 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Hartmut Nebelung +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/Synch.h,v 1.10 2007/08/16 13:56:42 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of Lock classes +\ingroup GenApi_PublicImpl +*/ + +#ifndef GENAPI_SYNCH_H +#define GENAPI_SYNCH_H + +#include "GenApiDll.h" + +#if defined (_WIN32) && (_WIN32_WINNT < 0x0400) +#error ("Value of _WIN32_WINNT must be at least 0x0400") +#endif + +#if defined (_WIN32) +# include +#elif defined (__unix__) +# include +# include +#else +# error No/unknown platform thread support +#endif + + +#ifndef THREADING_MODEL +/** +* \brief Controls the threading model used for the GenApi. +* +* The default threading model is the MultiThreadingModel, i.e. +* using the classes from multiple threads is safe. +* +* When you are sure that there is no concurrent access of the GenApi +* classes by multiple threads, +* THREADING_MODEL can be defined as SingleThreadingModel. In this case +* the synchronization objects are dummy objects. +* +* When defining THREADING_MODEL yourself, ensure that for *all* translation units +* (this includes the libarary code as well as your application code) are compiled +* with the same value for THREADING_MODEL. Otherwise you will encounter strange +* runtime errors. +*/ +# define THREADING_MODEL MultiThreadingModel +#endif + + + + +namespace GenApi { + + + //----------------------------------------------------------------- + // FakeLock + //----------------------------------------------------------------- + /** + \brief A lock that does nothing + \ingroup GenApi_PublicImpl + */ + class GENAPI_DECL FakeLock + { + public: + bool TryLock() { return true; } + void Lock() { return; } + void Unlock() { return; } + }; + +#if defined (_WIN32) + /** + \brief A lock class + \ingroup GenApi_PublicImpl + */ + class GENAPI_DECL CLock + { + CRITICAL_SECTION m_csObject; + CLock( const CLock& ); + CLock& operator=( const CLock& ); + public: + CLock() { ::InitializeCriticalSection( &m_csObject ); } + ~CLock(){ ::DeleteCriticalSection( &m_csObject ); } + + bool TryLock() { return ::TryEnterCriticalSection( &m_csObject )!= 0; } + void Lock() { ::EnterCriticalSection( &m_csObject ); } + void Unlock() { ::LeaveCriticalSection( &m_csObject ); } + }; +#elif defined (__unix__) + /** + \brief A lock class + \ingroup GenApi_PublicImpl + */ + class CLock + { + pthread_mutex_t m_mtxObject; + CLock( const CLock& ); + CLock& operator=( const CLock& ); + public: + CLock() { + pthread_mutexattr_t attr; + pthread_mutexattr_init( &attr ); + pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_RECURSIVE ); + pthread_mutex_init( &m_mtxObject, &attr ); + pthread_mutexattr_destroy( &attr ); + } + ~CLock(){ + pthread_mutex_destroy( &m_mtxObject ); + } + + bool TryLock() { + const int err = pthread_mutex_trylock( &m_mtxObject ); + if (err == 0) + return true; + if (err == EBUSY) + return false; + else + throw RUNTIME_EXCEPTION( "CLock::TryLock() failed: %d (%s)", err, strerror( err ) ); + } + void Lock() { + const int err = pthread_mutex_lock( &m_mtxObject ); + if ( err != 0 ) + throw RUNTIME_EXCEPTION( "CLock::Lock() failed: %d (%s)", err, strerror( err ) ); + } + void Unlock() { + const int err = pthread_mutex_unlock( &m_mtxObject ); + if ( err != 0 ) + throw RUNTIME_EXCEPTION( "Mutex::unlock() failed: %d (%s)", err, strerror( err ) ); + } + + }; +#else +# error No/unknown platform thread support +#endif + + //----------------------------------------------------------------- + // SingleThreadingModel + //----------------------------------------------------------------- + /** + \brief policy class for single threading + \ingroup GenApi_PublicImpl + */ + class GENAPI_DECL SingleThreadingModel + { + public: + /// The Lock Type + typedef FakeLock LockType; + }; + + //----------------------------------------------------------------- + // MultiThreadingModel + //----------------------------------------------------------------- + /** + \brief policy class for multi threading + \ingroup GenApi_PublicImpl + */ + class GENAPI_DECL MultiThreadingModel + { + public: + /// The Lock Type + typedef CLock LockType; + }; + + //! The threading model used within the library + //! \ingroup GenApi_PublicImpl + typedef THREADING_MODEL ThreadingModel; + + class AutoLock + { + ThreadingModel::LockType& m_Lock; + public: + AutoLock(ThreadingModel::LockType& lock) + : m_Lock(lock) + { + m_Lock.Lock(); + } + + ~AutoLock() + { + m_Lock.Unlock(); + } + + private: + AutoLock& operator=(const AutoLock&); + AutoLock(const AutoLock&); + }; + + //----------------------------------------------------------------- + // template LockableObject + //----------------------------------------------------------------- + + /** + \brief Instance-Lock for an object + \ingroup GenApi_PublicImpl + */ + template< class Object, typename ThreadingModel=ThreadingModel > + class GENAPI_DECL LockableObject { + + + public: + mutable typename ThreadingModel::LockType m_Lock; + + class Lock; + friend class Lock; + + /*! A scopelevel Lock class. + * Automatically aquires the lock when created and releases + * it when destroyed. + */ + class Lock { + /// Reference to outer object + const LockableObject &m_Object; + public: + Lock( const LockableObject& obj) : m_Object(obj) { + m_Object.m_Lock.Lock(); + } + + ~Lock(){ + m_Object.m_Lock.Unlock(); + } + private: + Lock& operator=( const Lock& ); + }; + /// Get a new lock + Lock GetLock() const { + return Lock( *this ); + } + }; + +} // namespace Genapi + +#endif // GENAPI_SYNCH_H diff --git a/thirdparty/GenICam/include/GenApi/Types.h b/thirdparty/GenICam/include/GenApi/Types.h new file mode 100644 index 0000000..3f2f214 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/Types.h @@ -0,0 +1,159 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/Types.h,v 1.15 2007/08/14 13:21:01 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Common types used in the public GenApi interface. +\ingroup GenApi_PublicUtilities +*/ + +#ifndef GENAPI_TYPES_H +#define GENAPI_TYPES_H + +#ifdef _WIN32 +#include // interface +#else +#define interface struct +#endif + +#include +#include + +namespace GenApi +{ + + //! signed or unsigned integers + //! \ingroup GenApi_PublicUtilities + typedef enum + { + Signed, //!< Integer is signed + Unsigned, //!< Integer is unsigned + _UndefinedSign //!< Object is not yetinitialized + } ESign; + + //! access mode of a node + //! \ingroup GenApi_PublicUtilities + typedef enum + { + NI, //!< Not implemented + NA, //!< Not available + WO, //!< Write Only + RO, //!< Read Only + RW, //!< Read and Write + _UndefinedAccesMode //!< Object is not yetinitialized + } EAccessMode; + + //! recommended visibility of a node + //! \ingroup GenApi_PublicUtilities + typedef enum + { + Beginner = 0, //!< Always visible + Expert = 1, //!< Visible for experts or Gurus + Guru = 2, //!< Visible for Gurus + Invisible = 3, //!< Not Visible + _UndefinedVisibility = 99 //!< Object is not yetinitialized + } EVisibility; + + //! caching mode of a register + //! \ingroup GenApi_PublicUtilities + typedef enum + { + NoCache, //!< Do not use cache + WriteThrough, //!< Write to cache and register + WriteAround, //!< Write to register, write to cache on read + _UndefinedCachingMode //!< Not yet initialized + } ECachingMode; + + //! recommended representation of a node value + //! \ingroup GenApi_PublicUtilities + typedef enum + { + Linear, //!< Slider with linear behaviour + Logarithmic, //!< Slider with logarithmic behaviour + Boolean, //!< Checkbox + PureNumber, //!< Decimal number in an edit control + HexNumber, //!< Hex number in an edit control + _UndefindedRepresentation + } ERepresentation; + + //! Endianess of a value in a register + //! \ingroup GenApi_PublicUtilities + typedef enum + { + BigEndian, //!< Register is big endian + LittleEndian, //!< Register is little endian + _UndefinedEndian //!< Object is not yetinitialized + } EEndianess; + + + //! Defines if a node name is standard or custom + //! \ingroup GenApi_PublicUtilities + typedef enum + { + Custom, //!< name resides in custom namespace + Standard, //!< name resides in one of the standard namespaces + _UndefinedNameSpace //!< Object is not yetinitialized + } ENameSpace; + + + //! Defines from which standard namespace a node name comes from + //! \ingroup GenApi_PublicUtilities + typedef enum + { + None, //!< name resides in custom namespace + GEV, //!< name resides in GigE Vision namespace + IIDC, //!< name resides in 1394 IIDC namespace + CL, //!< name resides in camera link namespace + _UndefinedStandardNameSpace //!< Object is not yetinitialized + } EStandardNameSpace; + + + //! Defines the chices of a Yes/No alternaitve + //! \ingroup GenApi_PublicUtilities + typedef enum + { + Yes, //!< yes + No, //!< no + _UndefinedEYesNo //!< Object is not yetinitialized + } EYesNo; + + //! A list of strings + //! \ingroup GenApi_PublicImpl + typedef GenICam::gcstring_vector StringList_t; + + + //! typedef for fomula type + //! \ingroup GenApi_PublicImpl + typedef enum ESlope + { + Increasing, //!> strictly monotonous increasing + Decreasing, //!> strictly monotonous decreasing + Varying, //!> slope changes, e.g. at run-time + Automatic, //!> slope is determined automatically by probing the function + _UndefinedESlope //!< Object is not yetinitialized + }; + +} + +#endif // ifndef GENAPI_TYPES_H diff --git a/thirdparty/GenICam/include/GenApi/impl/BaseT.h b/thirdparty/GenICam/include/GenApi/impl/BaseT.h new file mode 100644 index 0000000..4f12edd --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/BaseT.h @@ -0,0 +1,83 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Alexander Happe +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/BaseT.h,v 1.9 2007/08/16 13:56:23 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of the BaseT class template +*/ + +#ifndef GENAPI_BASET_H +#define GENAPI_BASET_H + +#include "../IBase.h" +#include "../EnumClasses.h" + + +namespace GenApi +{ + /** + \brief Implementaion of the IBase interface + */ + template + class GENAPI_DECL BaseT : public Base + { + public: + //! Implementation of IBase::GetAccessMode() + virtual EAccessMode GetAccessMode() const + { + AutoLock l(Base::GetLock()); + + // Use cache + #if ! defined( DISABLE_ACCESS_MODE_CACHING ) || (DISABLE_ACCESS_MODE_CACHING == 0) + + if ( Base::m_AccessModeCache != _UndefinedAccesMode ) + { + EAccessMode AccessMode = Combine(Base::m_AccessModeCache, Base::m_ImposedAccessMode); + #ifdef LOG4C + Base::m_pAccessLog->info("GetAccessMode = '%s' (from cache)", EAccessModeClass::ToString(AccessMode).c_str() ); + #endif + + return AccessMode; + } + + #endif + + #ifdef LOG4C + Base::m_pAccessLog->info("GetAccessMode..."); + #endif + + EAccessMode NaturalAccessMode = Base::InternalGetAccessMode(); + + EAccessMode AccessMode = Combine(NaturalAccessMode, Base::m_ImposedAccessMode); + + #ifdef LOG4C + Base::m_pAccessLog->info("...GetAccessMode = '%s' ", EAccessModeClass::ToString(AccessMode).c_str() ); + #endif + return AccessMode; + + } + }; +} + +#endif diff --git a/thirdparty/GenICam/include/GenApi/impl/Boolean.h b/thirdparty/GenICam/include/GenApi/impl/Boolean.h new file mode 100644 index 0000000..27b4483 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/Boolean.h @@ -0,0 +1,135 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Hartmut Nebelung +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/Boolean.h,v 1.10 2007/08/16 13:56:23 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CBoolean +*/ + +#ifndef GENAPI_BOOLEAN_H +#define GENAPI_BOOLEAN_H + +#if defined (_MSC_VER) && (_MSC_VER > 1000) +#pragma once +#endif // _MSC_VER > 1000 + +#include "../IBoolean.h" +#include "Node.h" +#include "BooleanT.h" +#include "ValueT.h" +#include "BaseT.h" +#include "NodeT.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4275 ) // non dll-interface XXX used as base for dll-interface class YYY + +namespace GenApi +{ + + //************************************************************* + // CBoolean class + //************************************************************* + + /*! + * \brief IBoolean implementation + * + * May be used as a toggle. The Values for On and Off may be chosen. + * Supposed to work together with a IInteger node, e.g. CMaskedInt, + * for setting the concrete values. + */ + + class GENAPI_DECL CBooleanImpl : public IBoolean, public CNodeImpl + { + public: + //! Constructor + CBooleanImpl(); + + + protected: + // Get the access mode of the node + virtual EAccessMode InternalGetAccessMode() const; + // \} + + //------------------------------------------------------------- + //! \name Implementation of GenApi::IBoolean interface + //\{ + // Set node value + virtual void InternalSetValue(bool Value); + + // Get node value + virtual bool InternalGetValue() const; + // \} + + //! \name Implementation of GenApi::IValue interface + //\{ + // Get value of the node as string + virtual GenICam::gcstring InternalToString(bool Verify = false); + + // Set value of the node as string + virtual void InternalFromString(const GenICam::gcstring& valueString, bool Verify = true); + //\} + + public: + virtual bool IsTerminalNode() const { return m_pValue == NULL; } + + virtual void FinalConstruct(); + + //------------------------------------------------------------- + // Initializing + //------------------------------------------------------------- + BEGIN_CONVERT_MAP + CONVERT_NODE_REFERENCE(pValue, m_pValue, IInteger) + CONVERT_ENTRY(Value, m_Value) + CONVERT_ENTRY(OnValue, m_OnValue) + CONVERT_ENTRY(OffValue, m_OffValue) + CHAIN_CONVERT_MAP(CNodeImpl) + END_CONVERT_MAP + + protected: + + //------------------------------------------------------------- + // Member variables + //------------------------------------------------------------- + + //! placeholder if no register node used + mutable bool m_Value; + + //! Value for On + int64_t m_OnValue; + //! Value for Off + int64_t m_OffValue; + //! Pointer to the associated register + IInteger *m_pValue; + }; + + + class GENAPI_DECL CBoolean : public BaseT< ValueT< BooleanT< NodeT < CBooleanImpl> > > > + { + }; + +} + +#pragma warning ( pop ) + +#endif // GENAPI_BOOLEAN_H diff --git a/thirdparty/GenICam/include/GenApi/impl/BooleanT.h b/thirdparty/GenICam/include/GenApi/impl/BooleanT.h new file mode 100644 index 0000000..35c210b --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/BooleanT.h @@ -0,0 +1,122 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Alexander Happe +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/BooleanT.h,v 1.8 2007/08/16 13:56:23 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of BooleanT class template +*/ + +#ifndef GENAPI_BOOLEANT_H +#define GENAPI_BOOLEANT_H + +#include "../IBoolean.h" + +namespace GenApi +{ + + /** + \brief Implementation of the IBoolean interface + */ + template + class GENAPI_DECL BooleanT : public Base + { + public: + + //! \name GenApi::IBoolean implementation + //{ + //! IBoolean::SetValue() + virtual void SetValue(bool Value, bool Verify = true) + { + AutoLock l(Base::GetLock()); + + if( Verify ) + { + if( !IsWritable( this ) ) + throw OUT_OF_RANGE_EXCEPTION("Node is not writable"); + } + + + #ifdef LOG4C + Counter& c(Base::GetBathometer()); + if( 0 == c ) + Base::m_pValueLog->info(">>>>" ); + + if(Value) + Base::m_pValueLog->info("SetValue( true )" ); + else + Base::m_pValueLog->info("SetValue( false )" ); + #endif + + { + typename Base::PostSetValueFinalizer PostSetValueCaller(this); // dtor calls Base::PostSetValue + + Base::PreSetValue(); // invalidates all nodes if this is the first call in a chain of SetValue calls + Base::InternalSetValue(Value); + + // now Base::PostSetValue is called by ~PostSetValueFinalizer, i.e. updates are fired + // if this is the call on the top of a chain of SetValue calls + } + + #ifdef LOG4C + if( 0 == c ) + Base::m_pValueLog->info("<<<<" ); + #endif + } + + //! IBoolean::operator=() + virtual void operator=(bool Value) + { + SetValue( Value ); + } + + //! IBoolean::GetValue() + virtual bool GetValue() const + { + AutoLock l(Base::GetLock()); + + #ifdef LOG4C + Base::m_pValueLog->info("GetValue..."); + #endif + const bool Value(Base::InternalGetValue()); + #ifdef LOG4C + if(Value) + Base::m_pValueLog->info("...GetValue = true" ); + else + Base::m_pValueLog->info("...SetValue = false" ); + #endif + return Value; + + } + + //! IBoolean::operator()() + virtual bool operator()() const + { + return GetValue(); + } + //} + + }; +} + +#endif // ifndef GENAPI_BOOLEANT_H diff --git a/thirdparty/GenICam/include/GenApi/impl/Category.h b/thirdparty/GenICam/include/GenApi/impl/Category.h new file mode 100644 index 0000000..352fb8e --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/Category.h @@ -0,0 +1,115 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/Category.h,v 1.13 2007/12/19 15:01:33 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CCategory +*/ + +#ifndef GENAPI_CATEGORY_H +#define GENAPI_CATEGORY_H + +#include "../ICategory.h" +#include "Node.h" +#include "NodeMacros.h" +#include "BaseT.h" +#include "ValueT.h" +#include "NodeT.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4275 ) // non dll-interface XXX used as base for dll-interface class YYY + +namespace GenApi +{ + + //************************************************************* + // CCategory class + //************************************************************* + + /** + * \ingroup internal_impl + * + * \brief Holds a list of features and sub-categories + */ + class GENAPI_DECL CCategoryImpl : public CNodeImpl, public ICategory + { + public: + + //! Constructor + CCategoryImpl(); + + //------------------------------------------------------------- + // IValue implementation (partial only) + //------------------------------------------------------------- + + protected: + //! Get the INode interface of the node + virtual INode* InternalGetNode(); + + //! Get display name of the node as string + virtual GenICam::gcstring InternalToString(bool /*Verify = false*/) + { + return InternalGetNode()->GetDisplayName(); + } + + //! Set content of the node as string + #pragma BullseyeCoverage off + virtual void InternalFromString(const GenICam::gcstring& /*ValueStr*/, bool /*Verify*/ ) + { + // Categories are read-only + assert(false); + } + #pragma BullseyeCoverage on + + public: + //------------------------------------------------------------- + // ICategory implementation + //------------------------------------------------------------- + + //! Get all features of the category (including sub-categories) + virtual void GetFeatures(FeatureList_t &Features) const; + + //------------------------------------------------------------- + // Initializing + //------------------------------------------------------------- + + BEGIN_CONVERT_MAP + CHAIN_CONVERT_MAP(CNodeImpl) + END_CONVERT_MAP + + virtual void FinalConstruct(); + + //! Returns the current access mode of the node + virtual EAccessMode InternalGetAccessMode() const; + + }; + + class GENAPI_DECL CCategory : public BaseT< ValueT< NodeT< CCategoryImpl > > > + { + }; + +} +#pragma warning ( pop ) + +#endif // ifndef GENAPI_CATEGORY_H diff --git a/thirdparty/GenICam/include/GenApi/impl/Command.h b/thirdparty/GenICam/include/GenApi/impl/Command.h new file mode 100644 index 0000000..a3ac3d6 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/Command.h @@ -0,0 +1,148 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Hartmut Nebelung +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/Command.h,v 1.10.2.1 2008/07/21 18:25:16 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CCommand +*/ + +#ifndef GENAPI_COMMAND_H +#define GENAPI_COMMAND_H + +#if defined (_MSC_VER) && (_MSC_VER > 1000) +#pragma once +#endif + +#include "../ICommand.h" +#include "Node.h" +#include "BaseT.h" +#include "ValueT.h" +#include "NodeT.h" +#include "CommandT.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4275 ) // non dll-interface XXX used as base for dll-interface class YYY + +namespace GenApi +{ + + //************************************************************* + // CCommand class + //************************************************************* + + /*! + * \brief ICommand implementation + * + * May be used as a toggle, that resets itself + * Supposed to work together with a IInteger node, e.g. CMaskedInt, + * for setting the concrete values. + * + * \ingroup GenApi_PublicImpl + */ + + class GENAPI_DECL CCommandImpl : public ICommand, public CNodeImpl + { + public: + //! Constructor + CCommandImpl(); + + //------------------------------------------------------------- + //! \name IBase implementation + EAccessMode InternalGetAccessMode() const; + + //------------------------------------------------------------- + //! \name INode implementation + + //! Invalidates the node if the polling time has elapsed + virtual void Poll( int64_t ElapsedTime ); + + //------------------------------------------------------------- + //! \name IValue implementation + //\{ + // Get value of the node as string + virtual GenICam::gcstring InternalToString(bool Verify = false); + + // Set value of the node as string + virtual void InternalFromString(const GenICam::gcstring& valueString, bool Verify = true); + + // \} + + protected: + //------------------------------------------------------------- + //! \name ICommand implementation + //\{ + // do it! + virtual void InternalExecute(); + + // done ? + virtual bool InternalIsDone() const; + // \} + + + public: + //! \name INodePrivate implementation + //\{ + virtual bool IsTerminalNode() const { return m_pValue == NULL; } + virtual void FinalConstruct(); + + //\} + + //------------------------------------------------------------- + // Initializing + //------------------------------------------------------------- + BEGIN_CONVERT_MAP + CONVERT_NODE_REFERENCE(pValue, m_pValue, IInteger) + CONVERT_ENTRY(Value, m_Value) + CONVERT_ENTRY(CommandValue, m_CommandValue) + CONVERT_NODE_REFERENCE(pCommandValue, m_pCommandValue, IInteger) + CHAIN_CONVERT_MAP(CNodeImpl) + END_CONVERT_MAP + + protected: + + //------------------------------------------------------------- + // Member variables + //------------------------------------------------------------- + + //! placeholder if no register node used + mutable bool m_Value; + mutable bool m_PendingCallback; + //! Value for On + int64_t m_CommandValue; + + //! Pointer to the the source of the command value + IInteger *m_pCommandValue; + + //! Pointer to the associated register + IInteger *m_pValue; + }; + + + class GENAPI_DECL CCommand : public BaseT< ValueT< NodeT< CommandT< CCommandImpl > > > > + { + }; +} +#pragma warning ( pop ) + +#endif // GENAPI_COMMAND_H diff --git a/thirdparty/GenICam/include/GenApi/impl/CommandT.h b/thirdparty/GenICam/include/GenApi/impl/CommandT.h new file mode 100644 index 0000000..34eec9e --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/CommandT.h @@ -0,0 +1,103 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Alexander Happe +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/CommandT.h,v 1.8.2.1 2008/05/30 15:16:12 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CommandT class template +*/ + +#ifndef GENAPI_COMMANDT_H +#define GENAPI_COMMANDT_H + + +namespace GenApi +{ + + /** + \brief Implementation of the ICommand interface + */ + template + class GENAPI_DECL CommandT : public Base + { + public: + //! Execute the command + virtual void Execute() + { + AutoLock l(Base::GetLock()); + #ifdef LOG4C + Counter& c(Base::GetBathometer()); + if( 0 == c ) + Base::m_pValueLog->info(">>>>" ); + + Base::m_pValueLog->info("Execute()"); + #endif + + if( !IsWritable( this ) ) + throw ACCESS_EXCEPTION("Node is not executable"); + + + { + typename Base::PostSetValueFinalizer PostSetValueCaller(this); // dtor calls Base::PostSetValue + + Base::PreSetValue(); // invalidates all nodes if this is the first call in a chain of SetValue-like calls + Base::InternalExecute(); + + // now Base::PostSetValue is called by ~PostSetValueFinalizer, i.e. updates are fired + // if this is the call on the top of a chain of SetValue calls + } + + #ifdef LOG4C + if( 0 == c ) + Base::m_pValueLog->info("<<<<" ); + #endif + } + + //! Execute the command + virtual void operator()() + { + Execute(); + } + + //! Query whether the command is executed + virtual bool IsDone() const + { + AutoLock l(Base::GetLock()); + + #ifdef LOG4C + Base::m_pValueLog->info("IsDone..."); + #endif + const bool IsDone(Base::InternalIsDone()); + #ifdef LOG4C + if( IsDone ) + Base::m_pValueLog->info("...IsDone = true"); + else + Base::m_pValueLog->info("...IsDone = false"); + #endif + return IsDone; + } + }; + +} + +#endif diff --git a/thirdparty/GenICam/include/GenApi/impl/Compatibility.h b/thirdparty/GenICam/include/GenApi/impl/Compatibility.h new file mode 100644 index 0000000..b191e13 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/Compatibility.h @@ -0,0 +1,106 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/Compatibility.h,v 1.10.2.1 2008/08/18 15:29:38 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! + \file + \brief Definition of macros for cross-platform compatibility +*/ + +#ifndef GENAPI_COMPATIBILITY_H +#define GENAPI_COMPATIBILITY_H + +#if defined (_MSC_VER) && defined (_WIN32) + +#define NOMINMAX + +#pragma comment( lib, "ws2_32.lib") +#include + +#define __LITTLE_ENDIAN 1234 +#define __BIG_ENDIAN 4321 +#if defined( _M_IX86 ) || defined( _M_X64 ) // *JS* +#define __BYTE_ORDER __LITTLE_ENDIAN +#else +#error Unsupported architecture +#endif + +#include + +#pragma intrinsic(_byteswap_ushort) +#pragma intrinsic(_byteswap_ulong) +#pragma intrinsic(_byteswap_uint64) +#define bswap_16(s) _byteswap_ushort(s) +#define bswap_32(s) _byteswap_ulong(s) +#define bswap_64(s) _byteswap_uint64(s) + +#define _DEFINE_GUID(name, l, w0, w1, c0, c1, c2, c3, c4, c5, c6, c7) \ + GUID name = { l, w0, w1, { c0, c1, c2, c3, c4, c5, c6, c7 } }; + +#elif defined (__GNUC__) && defined (__unix__) + +#include +#include +#include +#include + +#define _snprintf snprintf +#define _strtoi64 strtoll +#define _vsnprintf vsnprintf +#define _strdup strdup +#define _isnan isnan + +// these definitions break the stl-base code and should not be used! +//#define min(x, y) (((x) < (y)) ? (x) : (y)) +//#define mAX(x, y) (((x) > (y)) ? (x) : (y)) + +/* + * Watch out! + * In order not to break existing code, we have to duplicate the + * broken MS Windows GUID handling. Never mix with code using the + * rfc4122-compliant uuid framework implemented by libuuid! + */ + +typedef struct _GUID { + uint32_t Data1; + uint16_t Data2; + uint16_t Data3; + unsigned char Data4[ 8 ]; +} __attribute__ ((packed)) GUID; + +#define _DEFINE_GUID(name, l, w0, w1, c0, c1, c2, c3, c4, c5, c6, c7) \ + GUID name = { l, w0, w1, { c0, c1, c2, c3, c4, c5, c6, c7 } } + +#define IsEqualGUID(a, b) (!memcmp(&a, &b, sizeof (GUID))) + +inline bool +operator ==(const GUID &a, const GUID &b) +{ + return IsEqualGUID(a, b); +} + +#else +# error Unsupported platform +#endif + +#endif // ifndef GENAPI_COMPATIBILITY_H diff --git a/thirdparty/GenICam/include/GenApi/impl/Converter.h b/thirdparty/GenICam/include/GenApi/impl/Converter.h new file mode 100644 index 0000000..cc22b4a --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/Converter.h @@ -0,0 +1,209 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Hartmut Nebelung +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/Converter.h,v 1.10 2007/08/16 13:56:23 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of the CConverter class +*/ + +#ifndef GENAPI_CONVERTER_H +#define GENAPI_CONVERTER_H +#include +#include "../IFloat.h" +#include "Node.h" +#include "BaseT.h" +#include "ValueT.h" +#include "NodeT.h" +#include "SwissKnife.h" +#include "FloatT.h" + + +#pragma warning ( push ) +#pragma warning ( disable : 4275 ) // non dll-interface XXX used as base for dll-interface class YYY + +namespace GenApi +{ + //************************************************************* + // CConverter class + //************************************************************* + + //! IFloat implementation with integrated conversion + /*! Works like a Float, but has integrated conversion formulas + by which the values are converted before writing + and after reading. + + The Representation may be defined using one of the values in ERepresentation. + The default is _UndefindedRepresentation. + */ + class GENAPI_DECL CConverterImpl : public IFloat, public CNodeImpl + { + public: + //! Constructor + CConverterImpl(); + protected: + + //------------------------------------------------------------- + // IFloat implementation + //------------------------------------------------------------- + + // Set feature value + virtual void InternalSetValue(double Value, bool Verify = true); + + // Get feature value + virtual double InternalGetValue(bool Verify = false); + + // Get minimum value allowed + virtual double InternalGetMin(); + + // Get maximum value allowed + virtual double InternalGetMax(); + + // Get recommended representation + virtual ERepresentation InternalGetRepresentation() const + { + if (m_Representation == _UndefindedRepresentation) + if (m_pIntValue) + m_Representation = m_pIntValue->GetRepresentation(); + else + m_Representation = m_pFloatValue->GetRepresentation(); + return m_Representation; + } + + // Get the physical unit name + virtual GenICam::gcstring InternalGetUnit() const; + + // Get the access mode of the node + virtual EAccessMode InternalGetAccessMode() const; + + public: + //! Checks if the node is temrina + virtual bool IsTerminalNode() const + { + return m_pValue == NULL; + } + + //! finalises construction + virtual void FinalConstruct(); + + //------------------------------------------------------------- + // Initializing + //------------------------------------------------------------- + public: + BEGIN_CONVERT_MAP + // forwarding the entries to the right swiss knife + else if (Direction == In && PropertyName == "FormulaTo") + return m_pConvertTo->SetProperty("Formula", ValueStr, AttributeStr); + else if (Direction == In && PropertyName == "FormulaFrom") + return m_pConvertFrom->SetProperty("Formula", ValueStr, AttributeStr); + + // forwarding the entry to both swissknife + else if (Direction == In && PropertyName == "pVariable") + { + m_pConvertFrom->SetProperty(PropertyName, ValueStr, AttributeStr); + m_pConvertTo->SetProperty(PropertyName, ValueStr, AttributeStr); + return true; + } + else if (Direction == Out && PropertyName == "pVariable") + { + m_pConvertFrom->GetProperty(PropertyName, ValueStr, AttributeStr); + m_pConvertTo->GetProperty(PropertyName, ValueStr, AttributeStr); + return true; + } + ADD_VARIABLE_ENTRY(pVariable, (&m_VariableDelegate)) + CONVERT_NODE_REFERENCE(pValue, m_pValue, IValue) + CONVERT_STRING_ENTRY(Unit, m_Unit) + CONVERT_ENUM_ENTRY(Representation, m_Representation, ERepresentationClass) + CONVERT_ENUM_ENTRY(Slope, m_Slope, ESlopeClass) + CHAIN_CONVERT_MAP(CNodeImpl) + END_CONVERT_MAP + + + // Registers the node + virtual void Register(GenApi::INodeMapPrivate* const pNodeMap, const char *pNodeType, const char *pName, const char *pNameSpace); + + // determine if the conversion function is increasing or decreasing + void CheckIncreasing(); + + + private: + //! Checks if has ben set + bool IsMinUninititialized() const; + + //! Checks if has ben set + bool IsMaxUninitialized() const; + + //------------------------------------------------------------- + // Member variables + //------------------------------------------------------------- + + //! The SwissKnife formula for Set + GenICam::gcstring m_FormulaTo; + + //! The SwissKnife formula for Get + GenICam::gcstring m_FormulaFrom; + + //! The Name of the external Variable + GenICam::gcstring m_InputName; + + //! The Swiss Knife for Set + CSwissKnife *m_pConvertTo; + + //! The Swiss Knife for Get + CSwissKnife *m_pConvertFrom; + + //! Object holding additional Variables + CVariableDelegate m_VariableDelegate; + + //! The math parser doing all the work + CMathParser m_MathParser; + + //! Pointer to node providing the value + IValue *m_pValue; + + //! m_pValue cated to IInteger + IInteger *m_pIntValue; + + //! m_pValue cated to IFloat + IFloat *m_pFloatValue; + + //! recommended representation of the value + mutable ERepresentation m_Representation; + + //! the physical unit name + GenICam::gcstring m_Unit; + + //! indicates if the formula is strictly monotonous increasing or decreating + ESlope m_Slope; + }; + + //! class implementingthe converter object + class GENAPI_DECL CConverter + : public BaseT< ValueT< NodeT < FloatT < CConverterImpl > > > > + { + }; +} + +#pragma warning ( pop ) + +#endif // GENAPI_CONVERTER_H diff --git a/thirdparty/GenICam/include/GenApi/impl/DcamAccessCtrlReg.h b/thirdparty/GenICam/include/GenApi/impl/DcamAccessCtrlReg.h new file mode 100644 index 0000000..dba4e58 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/DcamAccessCtrlReg.h @@ -0,0 +1,149 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Hartmut Nebelung +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/DcamAccessCtrlReg.h,v 1.9 2007/08/16 13:56:23 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CDcamAccessCtrlReg +*/ + +#ifndef GENAPI_DCAMACCESSCTRLREG_H +#define GENAPI_DCAMACCESSCTRLREG_H +#if MSC_VER>1000 +#pragma once +#endif // MSC_VER>1000 +#include "../IInteger.h" +#include "Register.h" +#include "IntegerT.h" +#include + +#pragma warning ( push ) +#pragma warning ( disable : 4275 ) // non dll-interface XXX used as base for dll-interface class YYY + +namespace GenApi +{ + + // ************************************************************* + // CDcamAccessCtrlReg class + // ************************************************************* + /** + * \ingroup internal_impl + * + * \brief Implements the IIDC DCAM Access Control Register for Advanced Features + * + * The Access Control Register is implemented as read-only Register. It + * is the intention to use its IInteger interface in IsEnabled and + * IsPresent elements. + * Accessing it via IInteger::GetValue method writes the feature identifier + * into the register and then checks whether it is locked or not. + * + * Currently there is no distinction between node locked and and unlocked + * features. + * + * \todo Caching, Polling obeying the Timeout value + */ + class GENAPI_DECL CDcamAccessCtrlRegImpl : public CRegisterImpl, public IInteger + { + public: + CDcamAccessCtrlRegImpl(void); + + protected: + //------------------------------------------------------------- + // Implementation of IInteger + //------------------------------------------------------------- + //!\name GenApi::IInteger implementation + //{ + // Set feature value + virtual void InternalSetValue(int64_t Value, bool Verify = true); + + // Get feature value + virtual int64_t InternalGetValue(bool Verify = false); + + // Get minimum value allowed + virtual int64_t InternalGetMin() const; + + // Get maximum value allowed + virtual int64_t InternalGetMax() const; + + // Get increment + virtual int64_t InternalGetInc() const; + + // Get recommended representation + virtual ERepresentation InternalGetRepresentation() const + { + return _UndefindedRepresentation; + } + //\} + //------------------------------------------------------------- + // Implementation of IRegister + //------------------------------------------------------------- + //! \name IRegister implementation + //\{ + virtual void InternalSet(const uint8_t *pBuffer, int64_t Length) const; + virtual void InternalGet(uint8_t *pBuffer, int64_t Length); + //\} + + //------------------------------------------------------------- + // Implementation of INode + //------------------------------------------------------------- + //! \name INode implementation + // \{ + virtual EAccessMode InternalGetAccessMode() const; + // Get content of the node as string + virtual GenICam::gcstring InternalToString(bool Verify = false); + // Set content of the node as string + virtual void InternalFromString(const GenICam::gcstring& ValueStr, bool Verify = true); + // \} + + + public: + //------------------------------------------------------------- + // Initializing + //------------------------------------------------------------- + BEGIN_CONVERT_MAP + CONVERT_ENTRY(FeatureID, m_FeatureID) + CONVERT_ENTRY(Timeout, m_Timeout_ms) + CHAIN_CONVERT_MAP(CRegisterImpl) + END_CONVERT_MAP + + private: + //! \name Node properties + //\{ + //! The Feature ID consists of Vendor ID and a advanced feature set unique value + uint64_t m_FeatureID; + //! The Timeout value in microseconds. Zero means infinite. + uint16_t m_Timeout_ms; + //\} + }; + + + class GENAPI_DECL CDcamAccessCtrlReg : public BaseT< ValueT< RegisterT< NodeT< IntegerT< CDcamAccessCtrlRegImpl> > > > > + { + }; + + +} + +#pragma warning ( pop ) + +#endif // GENAPI_DCAMACCESSCTRLREG_H diff --git a/thirdparty/GenICam/include/GenApi/impl/DllManager.h b/thirdparty/GenICam/include/GenApi/impl/DllManager.h new file mode 100644 index 0000000..fe26e64 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/DllManager.h @@ -0,0 +1,113 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: AH +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/DllManager.h,v 1.9 2007/08/16 13:56:23 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CDllManager +*/ + +#ifndef GENAPI_DLLMANAGER_H +#define GENAPI_DLLMANAGER_H +#if MSC_VER>1000 +#pragma once +#endif // MSC_VER>1000 + +namespace GenICam +{ + class gcstring; +} + +#include +#include "../Synch.h" +#include + + +namespace GenApi +{ + /** + \brief Platform-independent dynamic library loader + + The DllManager allows to load dynamic libraries and to search for symbols within loaded + libraries. A book-keeping is performed. All libraries which are not unloaded explicitly, + are automatically unloaded when the DllManager is deleted. + + It is not possible to instantiate a DllManager object, instead the DllManager class exposes + static member functions. + */ + class GENAPI_DECL DllManager : public LockableObject + { + public: + + typedef void * Handle; + static const Handle INVALID_HANDLE; + + typedef void * Symbol; + static const Symbol INVALID_SYMBOL; + + //! Load a dynamic library + static Handle LoadLib(const GenICam::gcstring& fileName); + + //! Unload a dynamic library + static bool FreeLib(const Handle handle); + + //! Retrieve a symbol from a dynamic library + static Symbol FindSymbol(const Handle handle, const GenICam::gcstring& symbolName ); + + ~DllManager(void); + + private: + //! Platform specific code to load a library + static Handle InternalLoadLib(const GenICam::gcstring& fileName); + + //! Platform specific code to find a symbol in a library + static Symbol InternalFindSymbol(const Handle handle, const GenICam::gcstring& symbolName); + + //! Platform specfic code to unload a library + static bool InternalFreeLib(const Handle handle); + + //! Returns the one and only DllManager(singleton pattern) + static DllManager& GetInstance(void); + + + //! @name Hide constructors and assignment operator + //@{ + //! (singleton cannot be constructed outside) + DllManager(void) {} + DllManager(const DllManager&); + DllManager& operator=(const DllManager&); + //@} + + + //! Container used to store handles + //typedef std::multiset DllTable; + typedef std::map DllTable; + + //! Container storing the library handles + DllTable m_DllTable; + + }; + + +} +#endif // DLLMANAGER_H diff --git a/thirdparty/GenICam/include/GenApi/impl/EnumDelegate.h b/thirdparty/GenICam/include/GenApi/impl/EnumDelegate.h new file mode 100644 index 0000000..42a704a --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/EnumDelegate.h @@ -0,0 +1,104 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/EnumDelegate.h,v 1.10 2007/08/16 13:56:24 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CEnumDelegate and EnumEntryList_t. +*/ + +#ifndef GENAPI_ENUMDELEGATE_H +#define GENAPI_ENUMDELEGATE_H + +#include +#include "Node.h" + + +namespace GenApi +{ + + + interface IEnumEntry; + + + //! Mapping of Enum Values to symbolic values + //************************************************************* + // EnumDelegate class + //************************************************************* + class GENAPI_DECL CEnumDelegate + : public LockableObject + { + + + //! mapping of enum values to enum entry node + typedef NodeList_t EnumEntryList_t; + + public: + //! DefaultConstructor + CEnumDelegate(); + virtual ~CEnumDelegate(); + //------------------------------------------------------------- + // IValue implementation + //------------------------------------------------------------- + //! Get value of the node as string + virtual GenICam::gcstring ToString(); + + + /** + * Maps a numerical value to it's corresponding symbolic representation. */ + virtual void ToString(GenICam::gcstring &ValueStr, const int64_t &value); + + + /** maps a symbolic value to its corresponding numeric value */ + virtual bool FromString(const GenICam::gcstring &symbolicStr, int64_t &value); + + /** Returns the enum entry that is representing the numerical value. + Returns NULL when there is no entry representing the numerical value. */ + IEnumEntry* IntValueToEntry( const int64_t& value); + + + + /** retrieves the list of symbolic values + * @return the list + */ + virtual void GetSymbolics(GenICam::gcstring_vector& Symbolics); + /** retrieves the list of enumeration entries + * @return the list + */ + virtual void GetEntries(NodeList_t & Entries); + + /** AddEntry inserts an entry into the map + */ + virtual void AddEntry(INode * pEnumEntry); + + + private: + CEnumDelegate(const CEnumDelegate&); + CEnumDelegate& operator=(const CEnumDelegate&); + + EnumEntryList_t m_EnumEntryList; + + }; +}; + +#endif // ifndef GENAPI_ENUMDELEGATE_H diff --git a/thirdparty/GenICam/include/GenApi/impl/EnumEntry.h b/thirdparty/GenICam/include/GenApi/impl/EnumEntry.h new file mode 100644 index 0000000..2e106d1 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/EnumEntry.h @@ -0,0 +1,127 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/EnumEntry.h,v 1.12 2007/08/16 13:56:24 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CEnumEntry +*/ + +#ifndef GENAPI_ENUMENTRY_H +#define GENAPI_ENUMENTRY_H + +#include "../IEnumEntry.h" +#include "Node.h" +#include "NodeT.h" +#include "BaseT.h" +#include "ValueT.h" +#include "EnumEntry.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4275 ) // non dll-interface XXX used as base for dll-interface class YYY + +namespace GenApi +{ + + //! Mapping of Enum Values to symbolic values + //************************************************************* + // EnumEntry class + //************************************************************* + + class GENAPI_DECL CEnumEntryImpl: public CNodeImpl, public IEnumEntry + { + public: + //! DefaultContructor + CEnumEntryImpl() + :m_Value(0){}; + + //------------------------------------------------------------- + // INode implementation + //------------------------------------------------------------- + GenICam::gcstring InternalGetDisplayName() const + { + if (m_DisplayName != "") + return m_DisplayName; + else + return m_Symbolic; + } + + + //------------------------------------------------------------- + // IValue implementation + //------------------------------------------------------------- + //! Get value of the node as string + virtual GenICam::gcstring InternalToString(bool /*Verify = false*/) + { + const Lock l( GetLock() ); + GenICam::gcstring valueString; + Value2String(m_Value, valueString); + return valueString; + } + //! Set content of the node as string + #pragma BullseyeCoverage off + virtual void InternalFromString(const GenICam::gcstring& ValueStr, bool /*Verify*/) + { + assert(false); + throw LOGICAL_ERROR_EXCEPTION("EnumEntry %s can't set value from string : %s. Use derived class!", m_Name.c_str(), ValueStr.c_str() ); + } + #pragma BullseyeCoverage on + + //------------------------------------------------------------- + // IEnum implementation + //------------------------------------------------------------- + + //! Get symbolic enum value + virtual GenICam::gcstring GetSymbolic() const + { + const Lock l( GetLock() ); + return m_Symbolic; + } + + virtual int64_t GetValue() + { + return m_Value; + } + + + //! Convert map + BEGIN_CONVERT_MAP + CONVERT_ENTRY(Value, m_Value) + CONVERT_STRING_ENTRY(Symbolic, m_Symbolic) + CHAIN_CONVERT_MAP(CNodeImpl) + END_CONVERT_MAP + + private: + int64_t m_Value; + GenICam::gcstring m_Symbolic; + + }; + + class GENAPI_DECL CEnumEntry : public BaseT< ValueT< NodeT < CEnumEntryImpl > > > + { + }; +} + +#pragma warning ( pop ) + +#endif // ifndef GENAPI_ENUMENTRY_H diff --git a/thirdparty/GenICam/include/GenApi/impl/Enumeration.h b/thirdparty/GenICam/include/GenApi/impl/Enumeration.h new file mode 100644 index 0000000..9efa01b --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/Enumeration.h @@ -0,0 +1,215 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/Enumeration.h,v 1.16.2.1 2008/07/14 08:45:05 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CEnumeratorBase and CEnumeration_Int +*/ + +#ifndef GENAPI_ENUMERATION_H +#define GENAPI_ENUMERATION_H + +#include +#include "Node.h" +#include "EnumDelegate.h" +#include "../Pointer.h" +#include "BaseT.h" +#include "ValueT.h" +#include "EnumerationT.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4275 ) // non dll-interface XXX used as base for dll-interface class YYY + +namespace GenApi +{ + + //************************************************************* + // CEnumeration class + //************************************************************* + + class GENAPI_DECL CEnumerationImpl : public CNodeImpl, public IEnumeration + { + public: + //! Constructor + CEnumerationImpl() : + m_pInteger(NULL) + {}; +#if 0 + private: + CEnumerationImpl( const CEnumerationImpl& ); + CEnumerationImpl& operator= ( const CEnumerationImpl& ); +#endif + protected: + //! Get the enumeration map + virtual void InternalGetSymbolics(StringList_t& Symbolics) + { + m_EnumDelegate.GetSymbolics(Symbolics); + }; + + //! Get list of entry nodes + virtual void InternalGetEntries(NodeList_t & Entries) + { + m_EnumDelegate.GetEntries(Entries); + }; + + virtual EAccessMode InternalGetAccessMode() const + { + return CNodeImpl::InternalGetAccessMode(m_pInteger); + } + + //! Gets the symbolic value + virtual GenICam::gcstring InternalToString(bool Verify = false) + { + int64_t Value = GetIntValue(Verify); + GenICam::gcstring ValueStr; + m_EnumDelegate.ToString(ValueStr,Value); + + return ValueStr; + } + + //! Sets from symbolic value + virtual void InternalFromString(const GenICam::gcstring& ValueStr, bool Verify = true) + { + int64_t Value; + if (!m_EnumDelegate.FromString(ValueStr,Value)) + throw INVALID_ARGUMENT_EXCEPTION("Feature '%s' : cannot convert value '%s', the value is invalid.", m_Name.c_str(), ValueStr.c_str() ); + + SetIntValue(Value, Verify); + } + + //! Sets the integer value + virtual void InternalSetIntValue(int64_t Value, bool Verify = true) + { + if ( Verify ) + { + IEnumEntry* pEntry = m_EnumDelegate.IntValueToEntry(Value); + if ( ! pEntry ) + throw INVALID_ARGUMENT_EXCEPTION(" invalid enum value '%ld'", Value); + + if ( ! IsWritable(pEntry) ) + throw ACCESS_EXCEPTION("Failed to write enumeration value. Access mode is not RW or WO"); + } + + if (m_pInteger) + { + m_pInteger->SetValue(Value, Verify); + } + else + { + m_Value = Value; + } + } + + //! Gets the integer value + virtual int64_t InternalGetIntValue(bool Verify = false) + { + if (m_pInteger) + { + return m_pInteger->GetValue(Verify); + } + else + { + if (Verify) + { + IEnumEntry* pEntry = m_EnumDelegate.IntValueToEntry(m_Value); + if ( ! pEntry ) + throw OUT_OF_RANGE_EXCEPTION(" invalid enum value '%ld'", m_Value); + } + return m_Value; + } + } + + + //! Get an entry node by name + virtual IEnumEntry *InternalGetEntryByName(const GenICam::gcstring& EntryName) + { + NodeList_t Entries; + GetEntries(Entries); + + NodeList_t::iterator pEntry; + for(pEntry = Entries.begin(); pEntry != Entries.end(); pEntry++ ) + { + CEnumEntryPtr ptrEnumEntry = *pEntry; + assert(ptrEnumEntry.IsValid()); + + if( EntryName == ptrEnumEntry->GetSymbolic() ) + { + return ptrEnumEntry; + } + } + return NULL; + + } + + public: + virtual bool IsTerminalNode() const { return m_pInteger == NULL; } + + virtual void FinalConstruct() + { + CNodeImpl::FinalConstruct(); + if ( m_pInteger ) + m_TerminalCandidates.insert(dynamic_cast(m_pInteger)); + } + + //! Convert map + BEGIN_CONVERT_MAP + ADD_ENUM_ENTRY(pEnumEntry,(&m_EnumDelegate)) + CONVERT_NODE_REFERENCE(pValue, m_pInteger, IInteger) + CONVERT_ENTRY(Value, m_Value) + CHAIN_CONVERT_MAP(CNodeImpl) + END_CONVERT_MAP + + protected: + //------------------------------------------------------------- + // Member variables + //------------------------------------------------------------- + + //! Pointer to node providing access to the integer equivalent of the enum + IInteger *m_pInteger; + + //! the class handling the enum conversion + CEnumDelegate m_EnumDelegate; + + //! Holds the value if no register/IInteger is provided + int64_t m_Value; + }; + + class GENAPI_DECL CEnumeration : public BaseT< ValueT< EnumerationT < NodeT < CEnumerationImpl> > > > + { +#if 1 + public: + CEnumeration() : + BaseT< ValueT< EnumerationT < NodeT < CEnumerationImpl> > > >() + {} + private: + CEnumeration( const CEnumeration& ); + CEnumeration& operator= ( const CEnumeration& ); +#endif + }; + +} + +#pragma warning ( pop ) + +#endif // ifndef GENAPI_ENUMERATION_H diff --git a/thirdparty/GenICam/include/GenApi/impl/EnumerationT.h b/thirdparty/GenICam/include/GenApi/impl/EnumerationT.h new file mode 100644 index 0000000..a608c03 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/EnumerationT.h @@ -0,0 +1,138 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Alexander Happe +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/EnumerationT.h,v 1.9 2007/08/16 13:56:24 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of the EnumerationT class template +*/ + +#ifndef GENAPI_ENUMERATIONT_H +#define GENAPI_ENUMERATIONT_H + +#include + +#ifdef _WIN32 +# define FMT_I64 "%I64d" +#else +# define FMT_I64 "%lld" +#endif + +namespace GenApi +{ + /** + \brief Implementation of the IEnumeration Interface + */ + template + class GENAPI_DECL EnumerationT : public Base + { + public: + //! Implementation of IEnumeration::GetSymbolics() + virtual void GetSymbolics(StringList_t & Symbolics) + { + AutoLock l(Base::GetLock()); + return Base::InternalGetSymbolics(Symbolics); + } + + //! Implementation of IEnumeration::GetEntries() + virtual void GetEntries(NodeList_t & Entries) + { + AutoLock l(Base::GetLock()); + return Base::InternalGetEntries(Entries); + } + + //! Implementation of IEnumeration::operator=() + virtual IEnumeration& operator=(const GenICam::gcstring& ValueStr) + { + static_cast(this)->FromString(ValueStr); + return *this; + } + + //! Implementation of IEnumeration::SetIntValue() + virtual void SetIntValue(int64_t Value, bool Verify = true) + { + AutoLock l(Base::GetLock()); + + #ifdef LOG4C + Counter& c(Base::GetBathometer()); + if( 0 == c ) + Base::m_pValueLog->info(">>>>" ); + + Base::m_pValueLog->info("SetIntValue( " FMT_I64 " )", Value ); + #endif + + if( Verify ) + { + if( !IsWritable( this ) ) + throw OUT_OF_RANGE_EXCEPTION("Node is not writable"); + } + + + { + typename Base::PostSetValueFinalizer PostSetValueCaller(this); // dtor calls Base::PostSetValue + + Base::PreSetValue(); + Base::InternalSetIntValue(Value, Verify); + + // now Base::PostSetValue is called by ~PostSetValueFinalizer, i.e. updates are fired + // if this is the call on the top of a chain of SetValue calls + } + + #ifdef LOG4C + if( 0 == c ) + Base::m_pValueLog->info("<<<<" ); + #endif + } + + //! Implementation of IEnumeration::operator*() + virtual GenICam::gcstring operator*() + { + return static_cast(this)->ToString(); + } + + //! Implementation of IEnumeration::GetIntValue() + virtual int64_t GetIntValue(bool Verify = false) + { + AutoLock l(Base::GetLock()); + #ifdef LOG4C + Base::m_pValueLog->info("GetIntValue..."); + #endif + int64_t IntValue = Base::InternalGetIntValue(Verify); + #ifdef LOG4C + Base::m_pValueLog->info("...GetIntValue = " FMT_I64, IntValue ); + #endif + return IntValue; + + } + + //! Implementation of IEnumeration::GetEntryByName() + virtual IEnumEntry *GetEntryByName(const GenICam::gcstring& EntryName) + { + AutoLock l(Base::GetLock()); + return Base::InternalGetEntryByName(EntryName); + } + + }; + +} +#endif diff --git a/thirdparty/GenICam/include/GenApi/impl/Float.h b/thirdparty/GenICam/include/GenApi/impl/Float.h new file mode 100644 index 0000000..fba53bf --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/Float.h @@ -0,0 +1,173 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Hartmut Nebelung +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/Float.h,v 1.11 2007/08/16 13:56:24 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of the CFloat class +*/ + +#ifndef GENAPI_FLOAT_H +#define GENAPI_FLOAT_H + +#include +#include "../IFloat.h" +#include "Node.h" +#include "BaseT.h" +#include "ValueT.h" +#include "NodeT.h" +#include "FloatT.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4275 ) // non dll-interface XXX used as base for dll-interface class YYY + + +namespace GenApi +{ + //************************************************************* + // CFloat class + //************************************************************* + + //! IFloat implementation + /*! Combines a three float features Value, Min, and Max + to a scalar feature which can be mapped, e.g. to a slider. + The properties may define constant value for Min, Max, Inc and Value. + Or these can be references to nodes giving the values, then the + properties pMin, pMax, pInc and pValue must be configured. Any + combination is allowed. Value defaults to zero, Inc to epsilon + (smallest effective increment from 1.0), Min to minimum of the + specific float implementation + + The Representation may be defined using one of the values in ERepresentation. + The default is _UndefindedRepresentation. + */ + class GENAPI_DECL CFloatImpl : public IFloat, public CNodeImpl + { + public: + //! Constructor + CFloatImpl(); + + protected: + + //------------------------------------------------------------- + // IFloat implementation + //------------------------------------------------------------- + + // Set feature value + virtual void InternalSetValue(double Value, bool Verify = true); + + // Get feature value + virtual double InternalGetValue(bool Verify = false) const; + + // Get minimum value allowed + virtual double InternalGetMin() const; + + // Get maximum value allowed + virtual double InternalGetMax() const; + + // Get recommended representation + virtual ERepresentation InternalGetRepresentation() const + { + if (m_Representation == _UndefindedRepresentation) + if (m_pValue) + m_Representation = m_pValue->GetRepresentation(); + + return m_Representation; + } + + // Get the physical unit name + virtual GenICam::gcstring InternalGetUnit() const; + + // Get the access mode of the node + virtual EAccessMode InternalGetAccessMode() const; + + public: + //! checks if the node is termins + virtual bool IsTerminalNode() const { return m_pValue == NULL; } + + //! finishes the constriction of the node + virtual void FinalConstruct(); + + //------------------------------------------------------------- + // Initializing + //------------------------------------------------------------- + public: + BEGIN_CONVERT_MAP + CONVERT_NODE_REFERENCE(pValue, m_pValue, IFloat) + CONVERT_NODE_REFERENCE(pMin, m_pMin, IFloat) + CONVERT_NODE_REFERENCE(pMax, m_pMax, IFloat) + CONVERT_STRING_ENTRY(Unit, m_Unit) + CONVERT_ENTRY(Value, m_Value) + CONVERT_ENTRY(Min, m_Min) + CONVERT_ENTRY(Max, m_Max) + CONVERT_ENUM_ENTRY(Representation, m_Representation, ERepresentationClass) + CHAIN_CONVERT_MAP(CNodeImpl) + END_CONVERT_MAP + + + private: + //! Checks if was set + bool IsMinConfigured() const; + + //! Checks if was set + bool IsMaxConfigured() const; + + //------------------------------------------------------------- + // Member variables + //------------------------------------------------------------- + + //! The value of the node + mutable double m_Value; + + //! Pointer to node providing the value + IFloat *m_pValue; + + //! Pointer to node providing the minimum value + IFloat *m_pMin; + + //! The minimum value + mutable double m_Min; + + //! Pointer to node providing the maximum value + IFloat *m_pMax; + + //! The maximum value + mutable double m_Max; + + //! recommended representation of the value + mutable ERepresentation m_Representation; + + //! the physical unit name + GenICam::gcstring m_Unit; + }; + + //! class implemetning the Float node + class GENAPI_DECL CFloat + : public BaseT< ValueT< NodeT < FloatT < CFloatImpl > > > > + { + }; +} + +#pragma warning ( pop ) + +#endif // GENAPI_FLOAT_H diff --git a/thirdparty/GenICam/include/GenApi/impl/FloatT.h b/thirdparty/GenICam/include/GenApi/impl/FloatT.h new file mode 100644 index 0000000..190103a --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/FloatT.h @@ -0,0 +1,259 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Alexander Happe +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/FloatT.h,v 1.11.2.1 2008/07/14 08:20:35 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of the FloatT class template +*/ + +#ifndef GENAPI_FLOATT_H +#define GENAPI_FLOATT_H + +#include "INodePrivate.h" +#include "../Synch.h" +#include "../Counter.h" +#include "Value2String.h" + +namespace GenApi +{ + /** + \brief Implementation of the IFloat Interface + */ + template + class GENAPI_DECL FloatT : public Base + { + public: + + //! Implementation of IFloat::SetValue() + virtual void SetValue(double Value, bool Verify = true) + { + AutoLock l(Base::GetLock()); + + #ifdef LOG4C + Counter& c(Base::GetBathometer()); + if( 0 == c ) + Base::m_pValueLog->info(">>>>" ); + + if( Verify ) + Base::m_pValueLog->info("SetValue( %f, true )", Value ); + else + Base::m_pValueLog->info("SetValue( %f, false )", Value ); + #endif + + + if( Verify && !IsWritable( this ) ) + throw ACCESS_EXCEPTION("Node is not writable"); + + { + + typename Base::PostSetValueFinalizer PostSetValueCaller(this); // dtor calls Base::PostSetValue + + + // invalidates all nodes if this is the first call in a chain of SetValue calls + Base::PreSetValue(); + + if( Verify ) + { + CHECK_RANGE_FLT(Value, Base::InternalGetMin(), Base::InternalGetMax()); + } + + // sets the value + Base::InternalSetValue(Value, Verify); + + #if ! defined( DISABLE_VALUE_CACHING ) || (DISABLE_VALUE_CACHING == 0) + // Fill cache + if( WriteThrough == static_cast(this)->GetCachingMode() ) + { + m_ValueCache = Value; + Base::m_ValueCacheValid = true; + } + #endif + + // now Base::PostSetValue is called by ~PostSetValueFinalizer, i.e. updates are fired + // if this is the call on the top of a chain of SetValue calls + } + + #ifdef LOG4C + if( 0 == c ) + Base::m_pValueLog->info("<<<<" ); + #endif + } + + //! Implementation of IFloat::operator=() + virtual IFloat& operator=(double Value) + { + SetValue(Value); + + return *this; + } + + //! Get value of the node as string + virtual GenICam::gcstring InternalToString(bool Verify = false) + { + double value = GetValue(Verify); + GenICam::gcstring valueString; + Value2String(value, valueString); + + return valueString; + } + + //! Implementation of IFloat::GetValue() + virtual double GetValue(bool Verify = false) + { + AutoLock l(Base::GetLock()); + + if( Verify && !IsReadable( this ) ) + throw ACCESS_EXCEPTION("Node is not readable"); + + #if ! defined( DISABLE_VALUE_CACHING ) || (DISABLE_VALUE_CACHING == 0) + // Use cache + if (Base::m_ValueCacheValid && !Verify) + { + #ifdef LOG4C + Base::m_pValueLog->info("GetValue( false ) = %f (from cache)", m_ValueCache ); + #endif + return m_ValueCache; + } + #endif + + #ifdef LOG4C + if( Verify ) + Base::m_pValueLog->info("GetValue( true )..."); + else + Base::m_pValueLog->info("GetValue( false )..."); + #endif + + if( Verify ) + { + SetInvalid(Base::simOnlyMe); + } + + const double Value(Base::InternalGetValue(Verify)); + + #ifdef LOG4C + Base::m_pValueLog->info("...GetValue = %f", Value ); + #endif + + if( Verify ) + { + CHECK_RANGE_FLT(Value, Base::InternalGetMin(), Base::InternalGetMax()); + } + + #if ! defined( DISABLE_VALUE_CACHING ) || (DISABLE_VALUE_CACHING == 0) + // Fill cache + const ECachingMode CachingMode(static_cast(this)->GetCachingMode()); + if( WriteThrough == CachingMode + || WriteAround == CachingMode ) + { + m_ValueCache = Value; + Base::m_ValueCacheValid = true; + } + #endif + + return Value; + + } + + //! Implementation of IFloat::operator()() + virtual double operator()() + { + return GetValue(); + } + + //! Implementation of IFloat::operator*() + virtual double operator*() + { + return GetValue(); + } + + //! Set value of the node as string + virtual void InternalFromString(const GenICam::gcstring& ValueStr, bool Verify = true) + { + double value; + if (!String2Value(ValueStr,&value)) + throw INVALID_ARGUMENT_EXCEPTION("Node '%s' : cannot convert string '%s' to double", Base::m_Name.c_str(), ValueStr.c_str() ); + + SetValue(value, Verify); + } + + + //! Implementation of IFloat::GetMin() + virtual double GetMin() + { + AutoLock l(Base::GetLock()); + + #ifdef LOG4C + Base::m_pRangeLog->info("GetMin..."); + #endif + + double Minimum = Base::InternalGetMin(); + + #ifdef LOG4C + Base::m_pRangeLog->info("...GetMin = %f", Minimum ); + #endif + + return Minimum; + + } + + //! Implementation of IFloat::GetMax() + virtual double GetMax() + { + AutoLock l(Base::GetLock()); + + #ifdef LOG4C + Base::m_pRangeLog->info("GetMax..."); + #endif + + const double Maximum(Base::InternalGetMax()); + + #ifdef LOG4C + Base::m_pRangeLog->info("...GetMax = %f", Maximum ); + #endif + + return Maximum; + + } + + //! Implementation of IFloat::GetRepresentation() + virtual ERepresentation GetRepresentation() + { + AutoLock l(Base::GetLock()); + return Base::InternalGetRepresentation(); + } + + //! Implementation of IFloat::GetUnit() + virtual GenICam::gcstring GetUnit() const + { + AutoLock l(Base::GetLock()); + return Base::InternalGetUnit(); + } + + protected: + //! The cache for the float value + double m_ValueCache; + }; +} + +#endif // GENAPI_FLOATT_H diff --git a/thirdparty/GenICam/include/GenApi/impl/FltReg.h b/thirdparty/GenICam/include/GenApi/impl/FltReg.h new file mode 100644 index 0000000..da92f53 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/FltReg.h @@ -0,0 +1,133 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/FltReg.h,v 1.10.2.1 2008/10/17 11:37:09 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CFltReg +*/ + +#ifndef GENAPI_FLTREG_H +#define GENAPI_FLTREG_H + +#include "../IFloat.h" +#include "FloatT.h" +#include "Register.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4275 ) // non dll-interface XXX used as base for dll-interface class YYY + +namespace GenApi +{ + //************************************************************* + // CFltReg class + //************************************************************* + + //! IFloat implementation for a register + class GENAPI_DECL CFltRegImpl : public IFloat, public CRegisterImpl + { + public: + //! Constructor + CFltRegImpl(); + + protected: + //------------------------------------------------------------- + // IFloat implementation + //------------------------------------------------------------- + + //! Set node value + virtual void InternalSetValue(double dblValue, bool Verify = true); + + //! Get node value + virtual double InternalGetValue(bool Verify = false); + + //! Get minimum value allowed + virtual double InternalGetMin() const; + + //! Get maximum value allowed + virtual double InternalGetMax() const; + + //! Get recommended representation + virtual ERepresentation InternalGetRepresentation() const + { + return m_Representation; + } + + //! Get the unit + virtual GenICam::gcstring InternalGetUnit() const + { + return m_Unit; + } + + //------------------------------------------------------------- + // Initializing + //------------------------------------------------------------- + public: + + //! Initializes the object + virtual void FinalConstruct(); + + BEGIN_CONVERT_MAP + CONVERT_ENUM_ENTRY(Endianess, m_Endianess, EEndianessClass) + CONVERT_STRING_ENTRY(Unit, m_Unit) + CONVERT_ENUM_ENTRY(Representation, m_Representation, ERepresentationClass) + CHAIN_CONVERT_MAP(CRegisterImpl) + END_CONVERT_MAP + + protected: + //! helper to handle the register access incl. swapping + void ReadReg(uint8_t* pBuffer, uint8_t* ValueBytes); + + //! helper to handle the register access incl. swapping + void WriteReg(uint8_t* pBuffer, uint8_t* ValueBytes); + + //------------------------------------------------------------- + // Memeber variables + //------------------------------------------------------------- + + //! minimum value to be stored in the Register + mutable double m_Min; + + //! maximum value to be stored in the Register + mutable double m_Max; + + //! The float's reprsentation + mutable ERepresentation m_Representation; + + //! endianess of the register + mutable EEndianess m_Endianess; + + //! the physical unit name + GenICam::gcstring m_Unit; + }; + + //! the clkass implementing the FltReg node + class GENAPI_DECL CFltReg + : public BaseT< ValueT< FloatT < RegisterT < NodeT< CFltRegImpl > > > > > + { + }; +} + +#pragma warning ( pop ) + +#endif // GENAPI_FLTREG_H diff --git a/thirdparty/GenICam/include/GenApi/impl/GenApiImpl.h b/thirdparty/GenICam/include/GenApi/impl/GenApiImpl.h new file mode 100644 index 0000000..45ffbab --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/GenApiImpl.h @@ -0,0 +1,65 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/GenApiImpl.h,v 1.10 2007/08/16 13:56:24 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Main include file all GenApi implementation headers +*/ + +#ifndef GENAPI_GENAPIIMPL_H +#define GENAPI_GENAPIIMPL_H + +#include "../GenApi.h" + +#include "Node.h" +#include "ValueNode.h" +#include "Category.h" +#include "Integer.h" +#include "IntReg.h" +#include "IntKey.h" +#include "MaskedIntReg.h" +#include "Register.h" +#include "Port.h" +#include "Enumeration.h" +#include "EnumEntry.h" +#include "EnumDelegate.h" +#include "Converter.h" +#include "IntConverter.h" +#include "IntSwissKnife.h" +#include "SwissKnife.h" +#include "Txtkey.h" +#include "IEEE1212Parser.h" +#include "DcamAccessCtrlReg.h" +#include "SmartFeature.h" +#include "SimpleString.h" +#include "NodeMap.h" +#include "FltReg.h" +#include "Float.h" +#include "Boolean.h" +#include "Command.h" +#include "INodePrivate.h" +#include "INodeMapPrivate.h" +#include "PointerImpl.h" + +#endif diff --git a/thirdparty/GenICam/include/GenApi/impl/GenApiUtilities.h b/thirdparty/GenICam/include/GenApi/impl/GenApiUtilities.h new file mode 100644 index 0000000..6b24fd8 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/GenApiUtilities.h @@ -0,0 +1,26 @@ +//----------------------------------------------------------------------------- +// (c) 2005 by Basler Vision Technologies +// Section: Vision Components +// Project: GenICam +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/GenApiUtilities.h,v 1.2 2006/07/18 13:31:53 rueder Exp $ +//----------------------------------------------------------------------------- +/*! +\file GenApiUtilities.h +\brief GenICam common utilities +*/ + +#ifndef GENAPI_GENAPIUTILITIES_DEF_H_ +#define GENAPI_GENAPIUTILITIES_DEF_H_ + +#include +#include + +namespace GenApi +{ + + void ReplaceEnvironmentVariables(GenICam::gcstring &Buffer); + +} + +#endif // GENAPI_GENAPIUTILITIES_DEF_H_ diff --git a/thirdparty/GenICam/include/GenApi/impl/IEEE1212Parser.h b/thirdparty/GenICam/include/GenApi/impl/IEEE1212Parser.h new file mode 100644 index 0000000..03def75 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/IEEE1212Parser.h @@ -0,0 +1,152 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Hartmut Nebelung +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/IEEE1212Parser.h,v 1.11 2007/11/13 19:41:05 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CIEEE1212Parser +*/ + + +#ifndef GENAPI_IEEE1212PARSER_H +#define GENAPI_IEEE1212PARSER_H + +#include +#include "../Types.h" +#include "Register.h" + +#ifdef _MSC_VER // *JS* +#pragma warning(push) +#pragma warning(disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of class 'yyy' +#endif + +namespace GenApi +{ + + /*! + * \ingroup internal_impl + * + * Parser for a IEEE1212 compatible configuration rom. + * Allows readonly access to a single unit. + * + * The Unit property defines which unit is selected in + * the configuration rom. It defaults to the value for + * DCAM. + * + * Values and Textual descriptors are cached in seperate + * maps, allowing a fast retrieval. If a change of the + * connected unit is detected, all caches are invalidated. + * This class is serves the CTxtkey and CIntKey classes as + * information provider. + */ + class GENAPI_DECL CIEEE1212ParserImpl : public CRegisterImpl + { + public: + CIEEE1212ParserImpl(void); + ~CIEEE1212ParserImpl(void); + + void FinalConstruct(); + + protected: + //------------------------------------------------------------- + // IValue implementation + //------------------------------------------------------------- + + //! Get value of the node as string + virtual GenICam::gcstring InternalToString(bool Verify = false); + + //------------------------------------------------------------- + // INodePrivate implementation + //------------------------------------------------------------- + + //! SetInvalid + virtual void SetInvalid(INodePrivate::ESetInvalidMode simMode); + + public: + //------------------------------------------------------------- + // Implementation + //------------------------------------------------------------- + bool GetValue( uint8_t Key, uint64_t& Value ); + bool GetDescriptor( uint8_t Key, GenICam::gcstring& Value ); + + + //------------------------------------------------------------- + // Initializing + //------------------------------------------------------------- + public: + //! Convert map + BEGIN_CONVERT_MAP + CONVERT_ENTRY( Unit, m_UnitId ) + CHAIN_CONVERT_MAP(CRegisterImpl) + END_CONVERT_MAP + + typedef uint8_t Key_t; + private: + // map type for numeric values + typedef std::map< Key_t, uint32_t > ValueMap_t; + /// map type for textual descriptors + typedef std::map< Key_t, GenICam::gcstring > DescriptorMap_t; + + protected: + virtual void InternalGet(uint8_t *, int64_t ); + private: + bool CheckAddressRange( void *pv ) const; + bool CheckIdentity() const; + + bool ParseConfRom( Key_t ); + bool ParseDirectory( uint32_t *p, Key_t searchkey, Key_t mapkey ); + bool ParseDescriptor( uint32_t *p, Key_t key ); + bool ParseRootDirectory( uint32_t *p, Key_t key ); + bool ParseUnitDependentDirectory( uint32_t *p, Key_t key ); + bool ParseUnitDirectory( uint32_t *p, Key_t key ); + static uint64_t UnitIdentifier( const uint32_t BusInfo[] ); + uint32_t* LocateUnitDirectory( uint32_t *pInstance, Key_t key=0xD1); + bool InsertValues( uint32_t *q, bool lookup , Key_t key ); + + uint32_t m_UnitId; ///< Unit Specifier Id, assuming uniqueness + uint32_t m_CharSet; ///< 0 = minimal ascii (default) + uint32_t m_Language; ///< 0 = English (default) + uint64_t m_Identity; ///< Unit Identifier + + /// Pointer to the Unit Directory + uint32_t *m_pUnitDirectory; + + /// Map with numerical values found + ValueMap_t m_ValueMap; + + /// Map with strings found + DescriptorMap_t m_DescMap; + + }; + + class GENAPI_DECL CIEEE1212Parser : public BaseT< ValueT< RegisterT< NodeT< CIEEE1212ParserImpl > > > > + { + }; + +} + +#ifdef _MSC_VER // *JS* +#pragma warning(pop) +#endif + +#endif // GENAPI_IEEE1212PARSER_H diff --git a/thirdparty/GenICam/include/GenApi/impl/INodeMapPrivate.h b/thirdparty/GenICam/include/GenApi/impl/INodeMapPrivate.h new file mode 100644 index 0000000..c7dfffe --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/INodeMapPrivate.h @@ -0,0 +1,80 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/INodeMapPrivate.h,v 1.7 2007/08/16 13:56:24 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of interface INodeMapPrivate +\ingroup GenApi_PublicImpl +*/ + +#ifndef GENAPI_INODEMAPPRIVATE_H +#define GENAPI_INODEMAPPRIVATE_H + +#include +#include "../Synch.h" +#include "../Counter.h" +#include "../INodeMap.h" +#include "INodePrivate.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY + +namespace GenApi +{ + /** + \brief NodeMap functions used for initilaization + \ingroup GenApi_PublicImpl + */ + interface INodeMapPrivate : virtual public INodeMap + { + //! Adds a node to the map + virtual void AddNode( const GenICam::gcstring& key, GenApi::INodePrivate *node) = 0; + + //! Set property by name as string + /*! return value true if the property was handled; false else */ + virtual bool SetProperty(const GenICam::gcstring& pPropertyName, const GenICam::gcstring& pValueStr) = 0; + + //! Set property by name as stringwith attribute + /*! return value true if the property was handled; false else */ + virtual bool SetProperty(const GenICam::gcstring& pPropertyName, const GenICam::gcstring& pValueStr, const GenICam::gcstring& pAttributeStr) = 0; + + //! Returns the lock which guards the node map + virtual ThreadingModel::LockType& GetLock() const = 0; + + //! Returns the object which counts the depth of SetValue() call-chains + virtual Counter& GetBathometer() = 0; + + //! Retrieve all top-level nodes in the node map + virtual void GetTopLevelNodes(NodeList_t &Nodes) const = 0; + + //! finalizes construction of the node map + virtual void FinalConstruct() = 0; + + }; + +} + +#pragma warning ( pop ) + +#endif // ifndef GENAPI_INODEMAPPROVATE_H diff --git a/thirdparty/GenICam/include/GenApi/impl/INodePrivate.h b/thirdparty/GenICam/include/GenApi/impl/INodePrivate.h new file mode 100644 index 0000000..a37c93d --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/INodePrivate.h @@ -0,0 +1,124 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: MargretAlbrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/INodePrivate.h,v 1.8 2007/12/18 17:10:15 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of interface INodePrivate +*/ + + +#ifndef GENAPI_INODEPRIVATE_H +#define GENAPI_INODEPRIVATE_H + +#include "../GenApiDll.h" +#include "../Types.h" +#include "../INode.h" +#include "../INodeMap.h" + +#include +#include + +namespace GenApi +{ + //************************************************************* + // INodePrivate interface + //************************************************************* + + interface INodePrivate; + interface INodeMapPrivate; + + //! a list of node references using the INodePrivate interface + typedef std::vector NodePrivateList_t; + //! Set of pointers to nodes + typedef std::set< INodePrivate* > NodeSet_t; + + + /** + \brief Interface including the methods for node construction common to all nodes + \ingroup GenApi_PublicImpl + */ + interface GENAPI_DECL INodePrivate : virtual public INode + { + //! Three different modes of operation for INodePrivate::SetInvalid() + enum ESetInvalidMode + { + simOnlyMe, //!< Invalidate only the node itself + simAll //!< Invalidate the node and all of its dependents + }; + + //! Registers the node in the node map + virtual void Register(GenApi::INodeMapPrivate* const pNodeMap, const char *pNodeType, const char *pName, const char *pNameSpace) = 0; + + //! Set property by name as string + /*! return value true if the property was handled; false else */ + virtual bool SetProperty(const GenICam::gcstring& pPropertyName, const GenICam::gcstring& pValueStr) = 0; + + //! Set property by name as string with attribute + /*! return value true if the property was handled; false else */ + virtual bool SetProperty(const GenICam::gcstring& pPropertyName, const GenICam::gcstring& pValueStr, const GenICam::gcstring& pAttributeStr) = 0; + + //! Create the set of dependent nodes + virtual bool PropagateDependency( GenApi::NodePrivateList_t &Dependents ) = 0; + + //! Create the set of terminal nodes + virtual void PropagateTerminals( GenApi::NodeSet_t &Terminals, NodePrivateList_t &Visited ) = 0; + + //! Initializes the object + virtual void FinalConstruct() = 0; + + //! Update the registered callbacks + virtual void FireCallBacks(bool allDependents = false) = 0; + + //! Invalidate the node resp. the node and all of its dependents + virtual void SetInvalid(ESetInvalidMode simMode) = 0; + + //! get the dependent nodes + virtual void GetDependencies( GenApi::NodeList_t &Dependents ) const = 0; + + //! Returns the set of parents + virtual void GetParents(GenApi::NodeList_t &) const = 0; + + //! Returns ture, if the node is a terminal node, i.e., a node which has to trigger the on-change callbacks + virtual bool IsTerminalNode() const = 0; + + //! Returns the list of terminal nodes + virtual void GetTerminalNodes(NodeList_t &) const = 0; + + //! Returns true, if the node is a top-level node, i.e, a node having no parents + virtual bool IsTopLevelNode() const = 0; + + //! Invalidates the node if the polling time has elapsed + virtual void Poll( int64_t ElapsedTime ) = 0; + + //! Enforces a virtual destructor on every node class + virtual ~INodePrivate() + { + } + + }; + + +} + +#endif // ifndef GENAPI_INODEPRIVATE_H diff --git a/thirdparty/GenICam/include/GenApi/impl/IntConverter.h b/thirdparty/GenICam/include/GenApi/impl/IntConverter.h new file mode 100644 index 0000000..17703ed --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/IntConverter.h @@ -0,0 +1,202 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Hartmut Nebelung +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/IntConverter.h,v 1.8 2007/08/16 13:56:24 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of the CConverter class +*/ + +#ifndef GENAPI_INTCONVERTER_H +#define GENAPI_INTCONVERTER_H + +#include +#include "../IInteger.h" +#include "Node.h" +#include "BaseT.h" +#include "ValueT.h" +#include "NodeT.h" +#include "IntSwissKnife.h" +#include "IntegerT.h" +#include "MathParser/Int64MathParser.h" + + +#pragma warning ( push ) +#pragma warning ( disable : 4275 ) // non dll-interface XXX used as base for dll-interface class YYY + +namespace GenApi +{ + //************************************************************* + // CIntConverter class + //************************************************************* + + //! IInteger implementation with integrated conversion + /*! Works like a Integer, but has integrated conversion formulas + by which the values are converted before writing + and after reading. + + The Representation may be defined using one of the values in ERepresentation. + The default is _UndefindedRepresentation. + */ + class GENAPI_DECL CIntConverterImpl : public IInteger, public CNodeImpl + { + public: + //! Constructor + CIntConverterImpl(); + protected: + + //------------------------------------------------------------- + // IInteger implementation + //------------------------------------------------------------- + + // Set feature value + virtual void InternalSetValue(int64_t Value, bool Verify = true); + + // Get feature value + virtual int64_t InternalGetValue(bool Verify = false); + + // Get minimum value allowed + virtual int64_t InternalGetMin(); + + // Get maximum value allowed + virtual int64_t InternalGetMax(); + + // Get increment + virtual int64_t InternalGetInc(); + + // Get recommended representation + virtual ERepresentation InternalGetRepresentation() const + { + if (m_Representation == _UndefindedRepresentation) + m_Representation = m_pIntValue->GetRepresentation(); + + return m_Representation; + } + + // Get the access mode of the node + virtual EAccessMode InternalGetAccessMode() const; + + public: + //! Checks if the node is temrina + virtual bool IsTerminalNode() const + { + return m_pValue == NULL; + } + + //! finalises construction + virtual void FinalConstruct(); + + //------------------------------------------------------------- + // Initializing + //------------------------------------------------------------- + public: + BEGIN_CONVERT_MAP + // forwarding the entries to the right swiss knife + else if (Direction == In && PropertyName == "FormulaTo") + return m_pConvertTo->SetProperty("Formula", ValueStr, AttributeStr); + else if (Direction == In && PropertyName == "FormulaFrom") + return m_pConvertFrom->SetProperty("Formula", ValueStr, AttributeStr); + + // forwarding the entry to both swissknife + else if (Direction == In && PropertyName == "pVariable") + { + m_pConvertFrom->SetProperty(PropertyName, ValueStr, AttributeStr); + m_pConvertTo->SetProperty(PropertyName, ValueStr, AttributeStr); + return true; + } + else if (Direction == Out && PropertyName == "pVariable") + { + m_pConvertFrom->GetProperty(PropertyName, ValueStr, AttributeStr); + m_pConvertTo->GetProperty(PropertyName, ValueStr, AttributeStr); + return true; + } + ADD_VARIABLE_ENTRY(pVariable, (&m_VariableDelegate)) + CONVERT_NODE_REFERENCE(pValue, m_pValue, IValue) + CONVERT_ENUM_ENTRY(Representation, m_Representation, ERepresentationClass) + CONVERT_ENUM_ENTRY(Slope, m_Slope, ESlopeClass) + CHAIN_CONVERT_MAP(CNodeImpl) + END_CONVERT_MAP + + + // Registers the node + virtual void Register(GenApi::INodeMapPrivate* const pNodeMap, const char *pNodeType, const char *pName, const char *pNameSpace); + + // determine if the conversion function is increasing or decreasing + void CheckIncreasing(); + + + private: + //! Checks if has ben set + bool IsMinUninititialized() const; + + //! Checks if has ben set + bool IsMaxUninitialized() const; + + //------------------------------------------------------------- + // Member variables + //------------------------------------------------------------- + + //! The SwissKnife formula for Set + GenICam::gcstring m_FormulaTo; + + //! The SwissKnife formula for Get + GenICam::gcstring m_FormulaFrom; + + //! The Name of the external Variable + GenICam::gcstring m_InputName; + + //! The Swiss Knife for Set + CIntSwissKnife *m_pConvertTo; + + //! The Swiss Knife for Get + CIntSwissKnife *m_pConvertFrom; + + //! Object holding additional Variables + CVariableDelegate m_VariableDelegate; + + //! The math parser doing all the work + CInt64MathParser m_MathParser; + + //! Pointer to node providing the value + IValue *m_pValue; + + //! m_pValue cated to IInteger + IInteger *m_pIntValue; + + //! recommended representation of the value + mutable ERepresentation m_Representation; + + //! indicates if the formula is strictly monotonous increasing or decreating + ESlope m_Slope; + }; + + //! class implementingthe converter object + class GENAPI_DECL CIntConverter + : public BaseT< ValueT< NodeT < IntegerT < CIntConverterImpl > > > > + { + }; +} + +#pragma warning ( pop ) + +#endif diff --git a/thirdparty/GenICam/include/GenApi/impl/IntKey.h b/thirdparty/GenICam/include/GenApi/impl/IntKey.h new file mode 100644 index 0000000..f7bffdf --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/IntKey.h @@ -0,0 +1,165 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Hartmut Nebelung +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/IntKey.h,v 1.10 2007/08/16 13:56:25 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CIntKey +*/ + +#ifndef GENAPI_INTKEY_H +#define GENAPI_INTKEY_H + +#include "Node.h" +#include "IEEE1212Parser.h" +#include "BaseT.h" +#include "ValueT.h" +#include "IntegerT.h" +#include "NodeT.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4275 ) // non dll-interface XXX used as base for dll-interface class YYY + +namespace GenApi +{ + //************************************************************* + // CIntKey class + //************************************************************* + class CIEEE1212Parser; + /** + * \ingroup internal_impl + * \brief IInteger implementation for IEEE1212 integer entries + */ + class GENAPI_DECL CIntKeyImpl : public IInteger, public CNodeImpl + { + public: + //! Constructor + CIntKeyImpl(); + + private: + //! not implemented: assignment operator + CIntKeyImpl& operator=( const CIntKeyImpl& rhs ); + + + protected: + //! determins the node's access mode + virtual EAccessMode InternalGetAccessMode() const; + + //------------------------------------------------------------- + // INodePrivate implementation + //------------------------------------------------------------- + + public: + //! Initializes the object + virtual void FinalConstruct(); + + //------------------------------------------------------------- + // IInteger implementation + //------------------------------------------------------------- + + protected: + //! Set feature value + #pragma BullseyeCoverage off + virtual void InternalSetValue(int64_t /*Value*/, bool /* Verify = true*/ ) + { + //assert(false); + throw ACCESS_EXCEPTION("IntKey : %s SetValue failed. IntKey is read only", m_Name.c_str() ); + } + #pragma BullseyeCoverage on + + //! Get feature value + virtual int64_t InternalGetValue(bool Verify = false); + + //! Get minimum value allowed + virtual int64_t InternalGetMin() const + { + return m_Min; + } + + //! Get maximum value allowed + virtual int64_t InternalGetMax() const + { + return m_Max; + } + + //! Get increment + virtual int64_t InternalGetInc() const + { + return 1LL; + } + + //! Get recommended representation + virtual ERepresentation InternalGetRepresentation() const + { + return m_Representation; + } + + public: + //------------------------------------------------------------- + // Initializing + //------------------------------------------------------------- + //! Convert map + BEGIN_CONVERT_MAP + CONVERT_ENTRY(Key, m_Key) + CONVERT_NODE_REFERENCE( p1212Parser, m_pParser, CIEEE1212Parser ) + CHAIN_CONVERT_MAP(CNodeImpl) + END_CONVERT_MAP + + protected: + // inititialize when childs are initialized + //------------------------------------------------------------- + // Memeber variables + //------------------------------------------------------------- + + //! minimum value + const int64_t m_Min; + + //! maximum value + const int64_t m_Max; + + //! Key of IEEE1212 Configuration Rom entry + uint16_t m_Key; + + //! most recent Value + int64_t m_Value; + + //! The config rom reader + CIEEE1212Parser *m_pParser; + + //! representation of value + const ERepresentation m_Representation; + + }; + + class GENAPI_DECL CIntKey : public BaseT< ValueT< NodeT< IntegerT< CIntKeyImpl > > > > + { + private: + //! not implemented: assignment operator + CIntKey& operator=( const CIntKey& rhs ); + }; + +} + +#pragma warning ( pop ) + +#endif // GENAPI_INTKEY_H diff --git a/thirdparty/GenICam/include/GenApi/impl/IntReg.h b/thirdparty/GenICam/include/GenApi/impl/IntReg.h new file mode 100644 index 0000000..73dc50a --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/IntReg.h @@ -0,0 +1,162 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/IntReg.h,v 1.10 2007/08/16 13:56:25 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CIntReg +*/ + +#ifndef GENAPI_INTREG_H +#define GENAPI_INTREG_H + +#include "Register.h" +#include "../IRegister.h" +#include "BaseT.h" +#include "ValueT.h" +#include "NodeT.h" +#include "IntegerT.h" +#include "RegisterT.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4275 ) // non dll-interface XXX used as base for dll-interface class YYY + +namespace GenApi +{ + //************************************************************* + // CIntRegImpl class + //************************************************************* + + /** + * \ingroup internal_impl + * \brief IInteger implementation for a register + * + * Maps an integer (signed or unsigned) to a register + */ + class GENAPI_DECL CIntRegImpl + : public IInteger + , public CRegisterImpl + { + public: + //! Constructor + CIntRegImpl(); + + //------------------------------------------------------------- + // INodePrivate implementation + //------------------------------------------------------------- + + //! Initializes the object + virtual void FinalConstruct(); + + protected: + + //------------------------------------------------------------- + // IInteger implementation + //------------------------------------------------------------- + + //! Set feature value + virtual void InternalSetValue(int64_t Value, bool Verify = true); + + //! Get feature value + virtual int64_t InternalGetValue(bool Verify = false); + + //! Get minimum value allowed + virtual int64_t InternalGetMin() const + { + return m_Min; + } + + //! Get maximum value allowed + virtual int64_t InternalGetMax() const + { + return m_Max; + } + + //! Get increment + virtual int64_t InternalGetInc() const + { + return 1LL; + } + + //! Get recommended representation + virtual ERepresentation InternalGetRepresentation() const + { + return m_Representation; + } + + public: + //------------------------------------------------------------- + // Initializing + //------------------------------------------------------------- + + //! Convert map + BEGIN_CONVERT_MAP + CONVERT_ENUM_ENTRY(Sign, m_Sign, ESignClass) + CONVERT_ENUM_ENTRY(Endianess, m_Endianess, EEndianessClass) + CONVERT_ENUM_ENTRY(Representation, m_Representation, ERepresentationClass) + CHAIN_CONVERT_MAP(CRegisterImpl) + END_CONVERT_MAP + + protected: + //! helpers to handle the register access incl. swapping + void ReadReg(uint8_t* ValueBytes); + + //! helpers to handle the register access incl. swapping + void WriteReg(uint8_t* ValueBytes); + + //------------------------------------------------------------- + // Member variables + //------------------------------------------------------------- + + //! minimum value to be stored in the Register + int64_t m_Min; + + //! maximum value to be stored in the Register + int64_t m_Max; + + //! sign of the integer + ESign m_Sign; + + //! representation of the integer + ERepresentation m_Representation; + + //! endianess of the register + EEndianess m_Endianess; + + //! The bit indicating the sign of the number to be retrievend + uint64_t m_SignBit; + + //! The bit to be set to -1 if the number is negative + uint64_t m_SignMask; + + }; + + //! implements the IntReg node + class GENAPI_DECL CIntReg : public BaseT < ValueT < IntegerT < RegisterT < NodeT < CIntRegImpl > > > > > + { + }; +} + +#pragma warning ( pop ) + +#endif // GENAPI_INTREG_H diff --git a/thirdparty/GenICam/include/GenApi/impl/IntSwissKnife.h b/thirdparty/GenICam/include/GenApi/impl/IntSwissKnife.h new file mode 100644 index 0000000..fe4c1b6 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/IntSwissKnife.h @@ -0,0 +1,196 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/IntSwissKnife.h,v 1.15 2007/12/19 15:01:33 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CIntSwissKnife +*/ + +#ifndef GENAPI_INTSWISSKNIFE_H +#define GENAPI_INTSWISSKNIFE_H + +#include "VariableDelegate.h" +#include "MathParser/Int64MathParser.h" +#include "Node.h" +#include "BaseT.h" +#include "ValueT.h" +#include "IntegerT.h" +#include "NodeT.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4275 ) // non dll-interface XXX used as base for dll-interface class YYY + +namespace GenApi +{ + //************************************************************* + // CIntSwissKnife class + //************************************************************* + + /** + * \ingroup internal_impl + * + * \brief IInteger implementation for a SwissKnife used for formula evaluation + */ + class GENAPI_DECL CIntSwissKnifeImpl : public IInteger, public CNodeImpl + { + public: + //! Constructor + CIntSwissKnifeImpl(); + + //! Destructor + virtual ~CIntSwissKnifeImpl(); + + //------------------------------------------------------------- + // IBase implementation + //------------------------------------------------------------- + + protected: + // Get access mode + virtual EAccessMode InternalGetAccessMode() const + { + const EAccessMode mode = CNodeImpl::InternalGetAccessMode(); + const EAccessMode vmode = m_VariableDelegate.GetAccessMode(); + if (mode == NI + #pragma BullseyeCoverage off + || vmode == NI + #pragma BullseyeCoverage on + ) + return m_AccessModeCache = NI; + if (mode == NA + #pragma BullseyeCoverage off + || vmode == NA + #pragma BullseyeCoverage on + ) + return m_AccessModeCache = NA; + + else + return m_AccessModeCache = RO; + + } + + //------------------------------------------------------------- + // INodePrivate implementation + //------------------------------------------------------------- + + public: + //! Initializes the object + virtual void FinalConstruct(); + + //Propagate node dependency + virtual bool PropagateDependency( NodePrivateList_t& Dependents ); + + //------------------------------------------------------------- + // IInteger implementation + //------------------------------------------------------------- + + //! Get feature value usint m_InputName as hardcoded variable name + /*! This is a helper for the implementation of the converter */ + virtual int64_t _GetValue(int64_t input, bool Verify = false); + + + protected: + //! Set feature value + #pragma BullseyeCoverage off + virtual void InternalSetValue(int64_t /*Value*/, bool /* Verify = true */) + { + throw LOGICAL_ERROR_EXCEPTION("IntSwissKnife : %s SetValue failed. IntSwissKnife is read only", m_Name.c_str() ); + } + #pragma BullseyeCoverage on + + //! Get feature value + virtual int64_t InternalGetValue(bool Verify = false); + + + //! Get minimum value allowed + virtual int64_t InternalGetMin() const + { + return m_Min; + } + + //! Get maximum value allowed + virtual int64_t InternalGetMax() const + { + return m_Max; + } + + //! Get increment + virtual int64_t InternalGetInc() const + { + return 1LL; + } + + //! Get recommended representation + virtual ERepresentation InternalGetRepresentation() const + { + return m_Representation; + } + + + + + public: + //------------------------------------------------------------- + // Initializing + //------------------------------------------------------------- + //! Convert map + BEGIN_CONVERT_MAP + CONVERT_STRING_ENTRY(Formula, m_Formula) + CONVERT_STRING_ENTRY(Input, m_InputName) + ADD_VARIABLE_ENTRY(pVariable, (&m_VariableDelegate)) + CONVERT_ENUM_ENTRY(Representation, m_Representation, ERepresentationClass) + CHAIN_CONVERT_MAP(CNodeImpl) + END_CONVERT_MAP + + protected: + // inititialize when childs are initialized + //------------------------------------------------------------- + // Memeber variables + //------------------------------------------------------------- + //! minimum value to be stored in the Register + int64_t m_Min; + + //! maximum value to be stored in the Register + int64_t m_Max; + + GenICam::gcstring m_Formula; + + CVariableDelegate m_VariableDelegate; + CInt64MathParser m_MathParser; + ERepresentation m_Representation; + + //! A hardcoded variable name + /*! This is a helper for the implementation of the converter */ + GenICam::gcstring m_InputName; + + }; + + class CIntSwissKnife : public BaseT< ValueT< NodeT< IntegerT< CIntSwissKnifeImpl > > > > + { + }; + +}; + +#pragma warning ( pop ) + +#endif // GENAPI_INTSWISSKNIFE_H diff --git a/thirdparty/GenICam/include/GenApi/impl/Integer.h b/thirdparty/GenICam/include/GenApi/impl/Integer.h new file mode 100644 index 0000000..30465f9 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/Integer.h @@ -0,0 +1,176 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/Integer.h,v 1.11 2007/08/16 13:56:24 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CInteger and CIntegerRef +*/ + +#ifndef GENAPI_INTEGER_H +#define GENAPI_INTEGER_H + +#include "../IInteger.h" +#include "Node.h" +#include "BaseT.h" +#include "ValueT.h" +#include "IntegerT.h" +#include "NodeT.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4275 ) // non dll-interface XXX used as base for dll-interface class YYY + +namespace GenApi +{ + + //************************************************************* + // CIntegerImpl class + //************************************************************* + + //! IInteger implementation + /*! Combines three integer features Value, Min, and Max + to a scalar feature which can be mapped, e.g. to a slider + */ + class GENAPI_DECL CIntegerImpl + : public IInteger + , public CNodeImpl + { + public: + //! Constructor + CIntegerImpl(); + + + //------------------------------------------------------------- + // INodePrivate implementation (partially) + //------------------------------------------------------------- + virtual bool IsTerminalNode() const { return m_pValue == NULL; } + + protected: + //------------------------------------------------------------- + // IBase implementation + //------------------------------------------------------------- + + virtual EAccessMode InternalGetAccessMode() const; + + //------------------------------------------------------------- + // IInteger implementation + //------------------------------------------------------------- + + //! Set feature value + virtual void InternalSetValue(int64_t Value, bool Verify = true); + + //! Get feature value + virtual int64_t InternalGetValue(bool Verify = false); + + //! Get minimum value allowed + virtual int64_t InternalGetMin(); + + //! Get maximum value allowed + virtual int64_t InternalGetMax(); + + //! Get increment + virtual int64_t InternalGetInc(); + + //! Get recommended representation + virtual ERepresentation InternalGetRepresentation(); + + + //------------------------------------------------------------- + // Initializing + //------------------------------------------------------------- + + public: + BEGIN_CONVERT_MAP + CONVERT_NODE_REFERENCE(pValue, m_pValue, IInteger) + CONVERT_NODE_REFERENCE(pMin, m_pMin, IInteger) + CONVERT_NODE_REFERENCE(pMax, m_pMax, IInteger) + CONVERT_NODE_REFERENCE(pInc, m_pInc, IInteger) + CONVERT_ENTRY(Value, m_Value) + CONVERT_ENTRY(Min, m_Min) + CONVERT_ENTRY(Max, m_Max) + CONVERT_ENTRY(Inc, m_Inc) + CONVERT_ENUM_ENTRY(Representation, m_Representation, ERepresentationClass) + CHAIN_CONVERT_MAP(CNodeImpl) + END_CONVERT_MAP + + //! Initializes the object + virtual void FinalConstruct(); + + + + private: + + //! returns true if no element was present + bool IsMinConfigured() + { + return m_Min != INT64_MAX; + } + + //! returns true if no element was present + bool IsMaxConfigured() + { + return m_Max != INT64_MIN; + } + + //------------------------------------------------------------- + // Member variables + //------------------------------------------------------------- + + //! Pointer to node providing the value + IInteger *m_pValue; + + //! The value if m_pValue is not given + int64_t m_Value; + + //! Pointer to node providing the minimum value + IInteger *m_pMin; + + //! The minimum if m_pMin is not given + int64_t m_Min; + + //! Pointer to node providing the maximum value + IInteger *m_pMax; + + //! The maximum if m_pMax is not given + int64_t m_Max; + + //! Pointer to node providing the increment value + IInteger *m_pInc; + + //! The increment if m_pInc is not given + int64_t m_Inc; + + //! recommended representation of the value + ERepresentation m_Representation; + }; + + //! implements the Integer node + class GENAPI_DECL CInteger : public BaseT< ValueT< IntegerT< NodeT < CIntegerImpl> > > > + { + }; + +} + +#pragma warning ( pop ) + +#endif // GENAPI_INTEGER_H diff --git a/thirdparty/GenICam/include/GenApi/impl/IntegerT.h b/thirdparty/GenICam/include/GenApi/impl/IntegerT.h new file mode 100644 index 0000000..67e50a1 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/IntegerT.h @@ -0,0 +1,272 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Alexander Happe +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/IntegerT.h,v 1.12.2.1 2008/07/14 08:20:35 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of the IntegerT class template +*/ + +#ifndef GENAPI_INTEGERT_H +#define GENAPI_INTEGERT_H + +#include "../IInteger.h" + +#ifdef _MSC_VER +# define FMT_I64 "%I64d" +#else +# define FMT_I64 "%lld" +#endif + +namespace GenApi +{ + + /** + \brief Implementation of the IInteger Interface + */ + template + class GENAPI_DECL IntegerT + : public Base + { + public: + //! Implementation of IInteger::SetValue + virtual void SetValue(int64_t Value, bool Verify = true) + { + AutoLock l(Base::GetLock()); + + Base::m_ValueCacheValid = false; + + + #ifdef LOG4C + Counter& c(Base::GetBathometer()); + if( 0 == c ) + Base::m_pValueLog->info(">>>>" ); + + Base::m_pValueLog->info("SetValue( " FMT_I64 ", %s )", Value, Verify ? "true" : "false" ); + #endif + + + if( Verify && !IsWritable( this ) ) + throw ACCESS_EXCEPTION("Node is not writable"); + + { + typename Base::PostSetValueFinalizer PostSetValueCaller(this); // dtor calls Base::PostSetValue + + // invalidates all nodes if this is the first call in a chain of SetValue calls + Base::PreSetValue(); + + if( Verify ) + { + assert(0 != Base::InternalGetInc()); + CHECK_RANGE_I64( Value, Base::InternalGetMin(), Base::InternalGetMax(), Base::InternalGetInc() ); + } + + // sets the value + Base::InternalSetValue(Value, Verify); + + #if ! defined( DISABLE_VALUE_CACHING ) || (DISABLE_VALUE_CACHING == 0) + // Fill cache + if( + WriteThrough == + static_cast(this)->GetCachingMode()) + { + m_ValueCache = Value; + Base::m_ValueCacheValid = true; + } + #endif + + // now Base::PostSetValue is called by ~PostSetValueFinalizer, i.e. updates are fired + // if this is the call on the top of a chain of SetValue calls + } + + #ifdef LOG4C + if( 0 == c ) + Base::m_pValueLog->info("<<<<" ); + #endif + } + + //! Implementation of IInteger::operator=() + virtual IInteger& operator=(int64_t Value) + { + SetValue(Value); + return *this; + } + + void InternalFromString(const GenICam::gcstring& ValueStr, bool Verify = true) + { + int64_t Value; + if (!String2Value(ValueStr, &Value)) + throw INVALID_ARGUMENT_EXCEPTION("Node '%s' : cannot convert string '%s' to int", Base::m_Name.c_str(), ValueStr.c_str() ); + + SetValue(Value, Verify); + } + + //! Implementation of IInteger::GetValue() + virtual int64_t GetValue(bool Verify = false) + { + AutoLock l(Base::GetLock()); + + #if ! defined( DISABLE_VALUE_CACHING ) || (DISABLE_VALUE_CACHING == 0) + // Use cache + if ( Base::m_ValueCacheValid && !Verify) + { + #ifdef LOG4C + Base::m_pValueLog->info("GetValue( false ) = " FMT_I64 " (from cache)", m_ValueCache ); + #endif + return m_ValueCache; + } + #endif + + #ifdef LOG4C + if( Verify ) + Base::m_pValueLog->info("GetValue( true )..."); + else + Base::m_pValueLog->info("GetValue( false )..."); + #endif + + if( Verify ) + { + SetInvalid(Base::simOnlyMe); + if( !IsReadable( this ) ) + throw ACCESS_EXCEPTION("Node is not readable"); \ + } + + const int64_t Value(Base::InternalGetValue(Verify)); + + #ifdef LOG4C + Base::m_pValueLog->info("...GetValue = " FMT_I64, Value ); + #endif + + if( Verify ) + { + CHECK_RANGE_I64( Value, Base::InternalGetMin(), Base::InternalGetMax(), Base::InternalGetInc() ); + } + + #if ! defined( DISABLE_VALUE_CACHING ) || (DISABLE_VALUE_CACHING == 0) + // Fill cache + const ECachingMode + CachingMode(static_cast(this)->GetCachingMode()); + if( WriteThrough == CachingMode + || WriteAround == CachingMode ) + { + m_ValueCache = Value; + Base::m_ValueCacheValid = true; + } + #endif + + return Value; + } + + //! Implementation of IInteger::operator()() + virtual int64_t operator()() + { + return GetValue(); + } + + //! Implementation of IInteger::operator*() + virtual int64_t operator*() + { + return GetValue(); + } + + GenICam::gcstring InternalToString(bool Verify = false) + { + int64_t Value = GetValue(Verify); + + GenICam::gcstring ValueStr; + Value2String(Value, ValueStr); + + return ValueStr; + } + + //! Implementation of IInteger::GetMin() + virtual int64_t GetMin() + { + AutoLock l(Base::GetLock()); + + #ifdef LOG4C + Base::m_pRangeLog->info("GetMin..."); + #endif + + int64_t Minimum = Base::InternalGetMin(); + + #ifdef LOG4C + Base::m_pRangeLog->info("...GetMin = " FMT_I64, Minimum ); + #endif + + return Minimum; + + } + + //! Implementation of IInteger::GetMax() + virtual int64_t GetMax() + { + AutoLock l(Base::GetLock()); + + #ifdef LOG4C + Base::m_pRangeLog->info("GetMax..."); + #endif + + int64_t Maximum = Base::InternalGetMax(); + + #ifdef LOG4C + Base::m_pRangeLog->info("...GetMax = " FMT_I64, Maximum ); + #endif + + return Maximum; + } + + //! Implementation of IInteger::GetInc() + virtual int64_t GetInc() + { + AutoLock l(Base::GetLock()); + + #ifdef LOG4C + Base::m_pRangeLog->info("GetInc..."); + #endif + + const int64_t Increment(Base::InternalGetInc()); + + #ifdef LOG4C + Base::m_pRangeLog->info("...GetInc = " FMT_I64, Increment ); + #endif + + return Increment; + } + + //! Implementation of IInteger::GetRepresentation + virtual ERepresentation GetRepresentation() + { + AutoLock l(Base::GetLock()); + + return Base::InternalGetRepresentation(); + } + + protected: + //! The cache for the integer value + int64_t m_ValueCache; + }; + +} // namespace GenApi + +#endif diff --git a/thirdparty/GenICam/include/GenApi/impl/MaskedIntReg.h b/thirdparty/GenICam/include/GenApi/impl/MaskedIntReg.h new file mode 100644 index 0000000..fff79d3 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/MaskedIntReg.h @@ -0,0 +1,108 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/MaskedIntReg.h,v 1.9 2007/08/16 13:56:25 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CMaskedIntReg +*/ + +#ifndef GENAPI_MASKEDINTREG_H +#define GENAPI_MASKEDINTREG_H + +#include "IntReg.h" + + +namespace GenApi +{ + //************************************************************* + // CMaskedIntReg class + //************************************************************* + + //! IInteger implementation for a masked register + /*! Maps an integer (signed or unsigned) to a masked register + */ + class GENAPI_DECL CMaskedIntRegImpl : public CIntRegImpl + { + public: + //! Constructor + CMaskedIntRegImpl(); + + + //------------------------------------------------------------- + // INodePrivate implementation + //------------------------------------------------------------- + + + //! Initializes the object + virtual void FinalConstruct(); + + //------------------------------------------------------------- + // IInteger implementation + //------------------------------------------------------------- + + protected: + //! Set feature value + virtual void InternalSetValue(int64_t Value, bool Verify = true); + + + //! Get feature value + virtual int64_t InternalGetValue(bool Verify = false); + + public: + + + //------------------------------------------------------------- + // Initializing + //------------------------------------------------------------- + //! Convert map + BEGIN_CONVERT_MAP + CONVERT_ENTRY(LSB, m_LSB) + CONVERT_ENTRY(MSB, m_MSB) + CHAIN_CONVERT_MAP(CIntRegImpl) + END_CONVERT_MAP + + protected: + //------------------------------------------------------------- + // Memeber variables + //------------------------------------------------------------- + //! least siginificant bit of the integer with respect to the register + uint32_t m_LSB; + + //! most siginificant bit of the integer with respect to the register + uint32_t m_MSB; + + //! Mask with 1 were the integer is located; 0 otherwise + uint64_t m_Mask; + + + }; + + class GENAPI_DECL CMaskedIntReg + : public BaseT< ValueT< NodeT < IntegerT< RegisterT< CMaskedIntRegImpl> > > > > + { + }; + +} + +#endif // GENAPI_MASKEDINTREG_H diff --git a/thirdparty/GenICam/include/GenApi/impl/MathParser/Int64Lexer.h b/thirdparty/GenICam/include/GenApi/impl/MathParser/Int64Lexer.h new file mode 100644 index 0000000..dc1625b --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/MathParser/Int64Lexer.h @@ -0,0 +1,68 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/MathParser/Int64Lexer.h,v 1.8 2007/08/16 13:56:49 hartmut_nebelung Exp $ +// +// License: Derived from Kirill Zaborski's MathParser library (http://kirya.narod.ru/mathparser.html ). +// This library comes under LGPL license (see http://www.gnu.org/licenses/lgpl.html). +// Kirill's implementation is a C++ port of the CCalc library from Walery Studennikov (http://www.sama.ru/~despair/ccalc/) +// which also comes under the LGPL. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CInt64Lexer +*/ + +#ifndef _INT64LEXER_H_ +#define _INT64LEXER_H_ + +#if defined (_MSC_VER) && (_MSC_VER > 1000) +#pragma once +#endif + +#include + +#include +#include + +#include "SymTable.h" +#include "Lexer.h" // some typdefs + +/** +* \ingroup internal_impl +* +* \brief Lexical analyzer for CIntSwissKnife +*/ +class CInt64Lexer +{ + char *m_pSS; + char *SS; +public: + // input params + int cssn; // Comment Start Symbol Number. -1 if none + char *ComEnd; // End of comment + CSymTable *SymTable; + hqCharType *CharTypeTable; + + // output params + char *Name; + size_t NameLen; + int64_t ExtValue; + int64_t IntValue; + hqTokenType PrevTokenType; + hqCharType CharType; + int NoIntegers; + int SetParseString(const char *str); + hqTokenType GetNextToken(void); + CInt64Lexer(void); + ~CInt64Lexer(void); + char * GetCurrentPos(void) const; +}; + +/* Misc */ + +void InitCharTypeTable( hqCharType *CharTypeTable, int CharTypes ); + +#endif //_INT64LEXER_H_ diff --git a/thirdparty/GenICam/include/GenApi/impl/MathParser/Int64MathParser.h b/thirdparty/GenICam/include/GenApi/impl/MathParser/Int64MathParser.h new file mode 100644 index 0000000..9eaead8 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/MathParser/Int64MathParser.h @@ -0,0 +1,116 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/MathParser/Int64MathParser.h,v 1.8.2.1 2009/03/27 09:59:48 hartmut_nebelung Exp $ +// +// License: Derived from Kirill Zaborski's MathParser library (http://kirya.narod.ru/mathparser.html ). +// This library comes under LGPL license (see http://www.gnu.org/licenses/lgpl.html). +// Kirill's implementation is a C++ port of the CCalc library from Walery Studennikov (http://www.sama.ru/~despair/ccalc/) +// which also comes under the LGPL. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CInt64MathParser + +* CInt64MathParser is derived from Kirill Zaborski's MathParser library (http://kirya.narod.ru/mathparser.html ). +* This library is under LGPL license. Kirill's implementation seems to be a C++ port of the CCalc library +* from Walery Studennikov (http://www.sama.ru/~despair/ccalc/). +*/ + +#ifndef _INT64MATHPARSER_H_ +#define _INT64MATHPARSER_H_ + +#if defined (_MSC_VER) && (_MSC_VER > 1000) +#pragma once +#endif + +#include +#include + +#include "MathParserDll.h" +#include "StrMap.h" +#include "Int64Lexer.h" + +#include + +#ifdef _MSC_VER // *JS* +#pragma warning(push) +#pragma warning(disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of class 'yyy' +#endif + +#define ORIGINAL_STACK_SIZE 64 + +extern const double DblErR; + + +/** +* \ingroup internal_impl +* +* \brief Parser and evaluator for CIntSwissKnife +* +*/ + +class MATHPARSERDLL_API CInt64MathParser{ + typedef int64_t (*OneArgFunc) ( int64_t arg ); + typedef char* (*MultiArgFunc) ( int paramcnt, int64_t *args, + CStrMap *strparams, int64_t *result ); + typedef int (*PrmSrchFunc) ( const char *str, size_t len, int64_t *value, + void *param ); + typedef enum { + // Binary + OP_SHL, OP_SHR, OP_POW, + OP_LOGIC_NEQ, OP_LOGIC_GEQ, OP_LOGIC_LEQ, + OP_LOGIC_AND, OP_LOGIC_OR, // Logical + OP_COMSTART, OP_ASSIGN, // For internal needs + OP_OBR, // Special + OP_ADD, OP_SUB, OP_MUL, OP_DIV, OP_MOD, OP_UNK, // Arithmetic + OP_XOR, OP_NOT, OP_AND, OP_OR, // Bitwise + OP_EQU, OP_GREATER, OP_LESS, + OP_LOGIC, OP_LOGIC_SEP, OP_CBR, OP_COMMA, // Logical + OP_FORMULAEND, // For script + OP_FUNC_ONEARG, OP_FUNC_MULTIARG // Special + } OperType_t; + static const char OpPriorities[OP_FUNC_MULTIARG+1]; + typedef struct { + OperType_t OperType; + const void *Func; + char PrevValTop; + CStrMap *StrParams; + } Operation; + static const Operation BrOp; + static const Operation NegOp; + std::vector OpStack; + std::vector ValStack; + int OpTop, ValTop; + int ObrDist; + CInt64Lexer Lexer; + int script; + CStrMap *VarParams; + static CStrMap IntFunctions; + static CSymTable MathSymTable; + static char errbuf[256]; + static hqCharType MathCharTypeTable[256]; + static int initializations_performed; + const char * ParseScript(int64_t *result); + const char * ParseFormula(int64_t *result); + const char * PrepareFormula(); + const char * Calc(); + const char * CalcToObr(); +public: + CStrMap *Parameters; + CStrMap *ExtFunctions; + PrmSrchFunc MoreParams; + void *ParamFuncParam; + CInt64MathParser( const char *MoreLetters=NULL ); + const char * Parse( const char *Formula, int64_t *result); + ~CInt64MathParser(); +}; + +#ifdef _MSC_VER // *JS* +#pragma warning(pop) +#endif + + +#endif // _INT64MATHPARSER_H_ diff --git a/thirdparty/GenICam/include/GenApi/impl/MathParser/Lexer.h b/thirdparty/GenICam/include/GenApi/impl/MathParser/Lexer.h new file mode 100644 index 0000000..ae62394 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/MathParser/Lexer.h @@ -0,0 +1,75 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/MathParser/Lexer.h,v 1.9 2007/08/16 13:56:49 hartmut_nebelung Exp $ +// +// License: Derived from Kirill Zaborski's MathParser library (http://kirya.narod.ru/mathparser.html ). +// This library comes under LGPL license (see http://www.gnu.org/licenses/lgpl.html). +// Kirill's implementation is a C++ port of the CCalc library from Walery Studennikov (http://www.sama.ru/~despair/ccalc/) +// which also comes under the LGPL. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CLexer +*/ + +#ifndef _LEXER_H_ +#define _LEXER_H_ + +#if defined (_MSC_VER) && (_MSC_VER > 1000) +#pragma once +#endif + +#include + +#include +#include +#include "SymTable.h" + + + +typedef unsigned char uchar; + +typedef enum { + CH_LETTER = 0x01, CH_DIGIT = 0x02, CH_SEPARAT = 0x04, + CH_SYMBOL = 0x08, CH_QUOTE = 0x10, + CH_UNKNOWN= 0x7E, CH_FINAL = 0x7F +} hqCharType; + +typedef enum { + TOK_ERROR, TOK_NONE, TOK_FINAL, TOK_INT, TOK_FLOAT, TOK_SYMBOL, + TOK_NAME, TOK_STRING +} hqTokenType; + +class CLexer{ + char *m_pSS; + char *SS; +public: + // input params + int cssn; // Comment Start Symbol Number. -1 if none + char *ComEnd; // End of comment + CSymTable *SymTable; + hqCharType *CharTypeTable; + + // output params + char *Name; + size_t NameLen; + double ExtValue; + int IntValue; + hqTokenType PrevTokenType; + hqCharType CharType; + int NoIntegers; + int SetParseString(const char *str ); + hqTokenType GetNextToken(); + CLexer(); + ~CLexer(); + char* GetCurrentPos(); +}; + +/* Misc */ + +void InitCharTypeTable( hqCharType *CharTypeTable, int CharTypes ); + +#endif //_LEXER_H_ diff --git a/thirdparty/GenICam/include/GenApi/impl/MathParser/MathParser.h b/thirdparty/GenICam/include/GenApi/impl/MathParser/MathParser.h new file mode 100644 index 0000000..e28ae9e --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/MathParser/MathParser.h @@ -0,0 +1,111 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/MathParser/MathParser.h,v 1.9.2.1 2009/03/27 09:59:48 hartmut_nebelung Exp $ +// +// License: Derived from Kirill Zaborski's MathParser library (http://kirya.narod.ru/mathparser.html ). +// This library comes under LGPL license (see http://www.gnu.org/licenses/lgpl.html). +// Kirill's implementation is a C++ port of the CCalc library from Walery Studennikov (http://www.sama.ru/~despair/ccalc/) +// which also comes under the LGPL. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CMathParser + + +*/ +#ifndef _MATHPARSER_H_ +#define _MATHPARSER_H_ + +#if defined (_MSC_VER) && (_MSC_VER > 1000) +#pragma once +#endif + +#include "MathParserDll.h" +#include +#include +#include "MathParserDll.h" +#include "StrMap.h" +#include "Lexer.h" + +#include + +#ifdef _MSC_VER // *JS* +#pragma warning(push) +#pragma warning(disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of class 'yyy' +#endif + +#define ORIGINAL_STACK_SIZE 64 + +extern const double DblErR; +extern const double DblNiN; + + +typedef double (*OneArgFunc) ( double arg ); +typedef char* (*MultiArgFunc) ( int paramcnt, double *args, + CStrMap *strparams, double *result ); +typedef int (*PrmSrchFunc) ( const char *str, size_t len, double *value, + void *param ); +/** +* \ingroup internal_impl +* +* \brief Expresion parser and evaluator of CSwissKnife +*/ +class MATHPARSERDLL_API CMathParser{ + typedef enum { + // Binary + OP_SHL, OP_SHR, OP_POW, + OP_LOGIC_NEQ, OP_LOGIC_GEQ, OP_LOGIC_LEQ, + OP_LOGIC_AND, OP_LOGIC_OR, // Logical + OP_COMSTART, OP_ASSIGN, // For internal needs + OP_OBR, // Special + OP_ADD, OP_SUB, OP_MUL, OP_DIV, OP_MOD, OP_UNK, // Arithmetic + OP_XOR, OP_NOT, OP_AND, OP_OR, // Bitwise + OP_EQU, OP_GREATER, OP_LESS, + OP_LOGIC, OP_LOGIC_SEP, OP_CBR, OP_COMMA, // Logical + OP_FORMULAEND, // For script + OP_FUNC_ONEARG, OP_FUNC_MULTIARG // Special + } OperType_t; + static const char OpPriorities[OP_FUNC_MULTIARG+1]; + typedef struct { + OperType_t OperType; + const void *Func; + char PrevValTop; + CStrMap *StrParams; + } Operation; + static const Operation BrOp; + static const Operation NegOp; + std::vector OpStack; + std::vector ValStack; + int OpTop, ValTop; + int ObrDist; + CLexer Lexer; + int script; + CStrMap *VarParams; + static CStrMap IntFunctions; + static CSymTable MathSymTable; + static char errbuf[256]; + static hqCharType MathCharTypeTable[256]; + static int initializations_performed; + const char * ParseScript(double *result); + const char * ParseFormula(double *result); + const char * PrepareFormula(); + const char * Calc(); + const char * CalcToObr(); +public: + CStrMap *Parameters; + CStrMap *ExtFunctions; + PrmSrchFunc MoreParams; + void *ParamFuncParam; + CMathParser( const char *MoreLetters=NULL ); + const char * Parse( const char *Formula, double *result); + ~CMathParser(void); +}; + +#ifdef _MSC_VER // *JS* +#pragma warning(pop) +#endif + +#endif //_MATHPARSER_H_ diff --git a/thirdparty/GenICam/include/GenApi/impl/MathParser/MathParserDll.h b/thirdparty/GenICam/include/GenApi/impl/MathParser/MathParserDll.h new file mode 100644 index 0000000..a4513fc --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/MathParser/MathParserDll.h @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/MathParser/MathParserDll.h,v 1.5 2007/08/16 13:56:49 hartmut_nebelung Exp $ +// +// License: Derived from Kirill Zaborski's MathParser library (http://kirya.narod.ru/mathparser.html ). +// This library comes under LGPL license (see http://www.gnu.org/licenses/lgpl.html). +// Kirill's implementation is a C++ port of the CCalc library from Walery Studennikov (http://www.sama.ru/~despair/ccalc/) +// which also comes under the LGPL. +//----------------------------------------------------------------------------- +/*! +\file +\brief Export Macros +*/ + +// The following ifdef block is the standard way of creating macros which make exporting +// from a DLL simpler. All files within this DLL are compiled with the MATHPARSERDLL_EXPORTS +// symbol defined on the command line. this symbol should not be defined on any project +// that uses this DLL. This way any other project whose source files include this file see +// MATHPARSERDLL_API functions as being imported from a DLL, whereas this DLL sees symbols +// defined with this macro as being exported. + +#if defined (_MSC_VER) + +#ifdef MATHPARSERDLL_EXPORTS +# define MATHPARSERDLL_API __declspec(dllexport) +#else +# define MATHPARSERDLL_API __declspec(dllimport) +#endif + +#elif defined (__GNUC__) && defined (__ELF__) + +#ifdef MATHPARSERDLL_EXPORTS +# define MATHPARSERDLL_API __attribute__((visibility("default"))) +#else +# define MATHPARSERDLL_API +#endif + +#else +# define MATHPARSERDLL_API +#endif diff --git a/thirdparty/GenICam/include/GenApi/impl/MathParser/StrMap.h b/thirdparty/GenICam/include/GenApi/impl/MathParser/StrMap.h new file mode 100644 index 0000000..f3877cf --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/MathParser/StrMap.h @@ -0,0 +1,56 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/MathParser/StrMap.h,v 1.7.2.2 2008/12/12 18:23:03 hartmut_nebelung Exp $ +// +// License: Derived from Kirill Zaborski's MathParser library (http://kirya.narod.ru/mathparser.html ). +// This library comes under LGPL license (see http://www.gnu.org/licenses/lgpl.html). +// Kirill's implementation is a C++ port of the CCalc library from Walery Studennikov (http://www.sama.ru/~despair/ccalc/) +// which also comes under the LGPL. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CStrMap +*/ +#ifndef _STRMAP_H_ +#define _STRMAP_H_ + + +#if defined (_MSC_VER) && (_MSC_VER > 1000) +#pragma once +#endif + +#include "MathParserDll.h" + +/** +* \ingroup internal_impl +* +* \brief Map for variables in swissknife expression +*/ +class MATHPARSERDLL_API CStrMap +{ + int FCount, FCapacity; + int FExtraLen, FRecordLen; + int FDoDuplicate; + char *FList; +public: + CStrMap(int extrabytes=sizeof(double), int dup=0); + void CreateFromChain( int extrabytes, const char *strchain, const void *data ); + ~CStrMap(void); + void AddString(const char *str, void *data); + void AddStrLen(const char *str, size_t len, const void *data); + void ShrinkMem(void); + void Trim(int NewCount); + void TrimClear(int NewCount); + void SetCapacity(int NewCapacity); + int IndexOf(const char *str, const void **data); + int LenIndexOf(const char *str, size_t len, const void **data); + int Replace(const char *str,void *data); + int LenReplace(const char *str, size_t len, void *data); + const char * GetString(int index, size_t *len, void **data); + void FillFromChain(const char *strchain, const void *data); +}; + +#endif //_STRMAP_H_ diff --git a/thirdparty/GenICam/include/GenApi/impl/MathParser/SymTable.h b/thirdparty/GenICam/include/GenApi/impl/MathParser/SymTable.h new file mode 100644 index 0000000..80e8731 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/MathParser/SymTable.h @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/MathParser/SymTable.h,v 1.7 2007/08/16 13:56:50 hartmut_nebelung Exp $ +// +// License: Derived from Kirill Zaborski's MathParser library (http://kirya.narod.ru/mathparser.html ). +// This library comes under LGPL license (see http://www.gnu.org/licenses/lgpl.html). +// Kirill's implementation is a C++ port of the CCalc library from Walery Studennikov (http://www.sama.ru/~despair/ccalc/) +// which also comes under the LGPL. +//----------------------------------------------------------------------------- +/*! +\file +\brief Implementation of CSymTable +*/ +#if !defined(AFX_SYMTABLE_H__F8B4AD7F_07F9_4AB2_B206_04549837C7ED__INCLUDED_) +#define AFX_SYMTABLE_H__F8B4AD7F_07F9_4AB2_B206_04549837C7ED__INCLUDED_ + +#if defined (_MSC_VER) && (_MSC_VER > 1000) +#pragma once +#endif + +class CSymTable +{ +public: + typedef struct { + char Sym[4]; + char Len; + char Index; + char More; + } SymbolRec; +private: + SymbolRec* table[256]; +public: + void PrepareSymTable( const char *symbols ); + int FindSymbol( const char *str, int *nchars ); + CSymTable(); + virtual ~CSymTable(); + +}; + +#endif // !defined(AFX_SYMTABLE_H__F8B4AD7F_07F9_4AB2_B206_04549837C7ED__INCLUDED_) diff --git a/thirdparty/GenICam/include/GenApi/impl/Node.h b/thirdparty/GenICam/include/GenApi/impl/Node.h new file mode 100644 index 0000000..f49d188 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/Node.h @@ -0,0 +1,520 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/Node.h,v 1.26 2007/12/18 17:10:15 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CNodeImpl +*/ + +#ifndef GENAPI_NODE_H +#define GENAPI_NODE_H + +#include +#include + +#include +#include "../GenApiDll.h" +#include "../Synch.h" +#include "../Types.h" +#include "../INode.h" +#include "../ICategory.h" +#include "INodePrivate.h" +#include "INodeMapPrivate.h" +#include "../IInteger.h" +#include "../IBoolean.h" +#include "../ISelector.h" +#include "../NodeCallback.h" +#include "NodeMacros.h" +#include "../EnumClasses.h" +#include "../Log.h" +#include "Value2String.h" + +#ifdef _MSC_VER // *JS* +#pragma warning(push) +#pragma warning(disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of class 'yyy' +#endif + +namespace GenApi +{ + struct CallbackController; + struct CallbackType; + class CNodeImpl; + + + //************************************************************* + // CBoolInt class + //************************************************************* + + //! Helper class making IInteger and IBoolean look like IBoolean + class CBoolInt + { + public: + //! Constructor + CBoolInt() : m_pInteger(NULL), m_pBoolean(NULL) + {} + + //! Assignment + void operator=( IBase *pT ) + { + m_pInteger = dynamic_cast(pT); + m_pBoolean = dynamic_cast(pT); + } + + // this method is currently not used + #if 0 + //! Set a value to either bool or int + void SetValue( bool Value ) + { + if(m_pInteger) + m_pInteger->SetValue( Value ? 1 : 0 ); + else if(m_pBoolean) + m_pBoolean->SetValue( Value ); + else + throw LOGICAL_ERROR_EXCEPTION( "Cannot dereference NULL pointer" ); + } + #endif + + //! Get a value from either bool or int + bool GetValue() const + { + if(m_pInteger) + return m_pInteger->GetValue() == 0 ? false : true; + #pragma BullseyeCoverage off + else if(m_pBoolean) + return m_pBoolean->GetValue(); + else + throw LOGICAL_ERROR_EXCEPTION( "Cannot dereference NULL pointer" ); + #pragma BullseyeCoverage on + } + + protected: + //! holds the pointer if it is an IInteger + IInteger *m_pInteger; + + //! holds the pointer if it is an IBoolean + IBoolean *m_pBoolean; + }; + + //************************************************************* + // CNodeImpl class + //************************************************************* + + /** + \brief Standard INode implementation + */ + class GENAPI_DECL CNodeImpl : virtual public INodePrivate, public ISelector + { + public: + //! Constructor + CNodeImpl(); + + //! Destructor + virtual ~CNodeImpl(); + + //------------------------------------------------------------- + // IBase implementation + //------------------------------------------------------------- + protected: + + //! Get the access mode of the node + virtual EAccessMode InternalGetAccessMode() const; + + //------------------------------------------------------------- + // INode implementation + //------------------------------------------------------------- + + // Get node name + virtual GenICam::gcstring InternalGetName(bool FullQualified=false) const; + + //! Get name space + virtual GenApi::ENameSpace InternalGetNameSpace()const; + + //! Get the recommended visibility of the node + virtual EVisibility InternalGetVisibility() const; + + // Invalidate the node + virtual void InternalInvalidateNode(); + + //! Is the node value cachable + virtual bool InternalIsCachable() const; + + //! Get Caching Mode + virtual ECachingMode InternalGetCachingMode() const; + + //! recommended polling time (for not cachable nodes) + virtual int64_t InternalGetPollingTime() const; + + //! Get a short description of the node + virtual GenICam::gcstring InternalGetToolTip() const; + + //! Get a long description of the node + virtual GenICam::gcstring InternalGetDescription() const; + + // Get node display name + virtual GenICam::gcstring InternalGetDisplayName() const; + + //! Get all children of the node + virtual void InternalGetChildren(GenApi::NodeList_t &Children) const; + + //! Register change callback + virtual CallbackHandleType InternalRegisterCallback( GenApi::NodeCallback &cb ); + + //! Deregister change callback + virtual CallbackHandleType InternalDeregisterCallback( CallbackHandleType h ); + + //! Retrieves the node map + virtual INodeMap* InternalGetNodeMap() const; + + //! Get the EventId of the node + virtual GenICam::gcstring GetEventID() const; + + //! True if the node is streamable + virtual bool IsStreamable() const; + + //! Returns a list of the names all properties set during initialization + virtual void GetPropertyNames(GenICam::gcstring_vector &PropertyNames) const; + + //! Retrieves a property plus an additional attribute by name + /*! If a property has multiple values/attribute they come with Tabs as delimiters */ + virtual bool GetProperty(const GenICam::gcstring& PropertyName, GenICam::gcstring& ValueStr, GenICam::gcstring& AttributeStr); + + //! Imposes an access mode to the natural access mode of the node + virtual void ImposeAccessMode(EAccessMode ImposedAccessMode); + + //! Imposes a visibility to the natural visibility of the node + virtual void ImposeVisibility(EVisibility ImposedVisibility); + + //! Retrieves the a node which describes the same feature in a different way + virtual INode* GetAlias() const; + + public: + //------------------------------------------------------------- + // INodePrivate implementation + //------------------------------------------------------------- + + // Fire the on-change callbacks + virtual void FireCallBacks(bool allDependents); + + // Initializes the object + virtual void FinalConstruct(); + + + // Called when node is about to be updated + virtual void SetInvalid(ESetInvalidMode simMode); + + // Registers the node + virtual void Register(GenApi::INodeMapPrivate* const pNodeMap, const char *pNodeType, const char *pName, const char *pNameSpace); + + // Create the set of dependent nodes + virtual bool PropagateDependency( NodePrivateList_t &Dependents ); + + // Create the set of terminal nodes + virtual void PropagateTerminals( GenApi::NodeSet_t &Terminals, NodePrivateList_t &Visited ); + + // Returns the set of parents + virtual void GetParents(GenApi::NodeList_t &) const; + + // Returns true, if the node is a terminal node, i.e., a node which has to trigger the on-change callbacks + virtual bool IsTerminalNode() const; + + // Returns the terminal nodes for this node + void GetTerminalNodes( GenApi::NodeList_t& Terminals ) const; + + //! Returns true, if the node is a top-level node, i.e, having no parents + virtual bool IsTopLevelNode() const; + + //! Convert map (contains SetProperty) + BEGIN_CONVERT_MAP + CONVERT_STRING_ENTRY(NodeType, m_NodeType) + CONVERT_STRING_ENTRY(Name, m_Name) + CONVERT_ENUM_ENTRY(NameSpace, m_NameSpace, ENameSpaceClass) + CONVERT_STRING_ENTRY(DeviceName, m_DeviceName) + CONVERT_STRING_ENTRY(DisplayName, m_DisplayName) + CONVERT_STRING_ENTRY(ToolTip, m_ToolTip) + CONVERT_STRING_ENTRY(Description, m_Description) + CONVERT_ENUM_ENTRY(Visibility, m_Visibility, EVisibilityClass) + CONVERT_NODE_REFERENCE(pIsImplemented, m_pIsImplemented, IValue) + CONVERT_NODE_REFERENCE(pIsAvailable, m_pIsAvailable, IValue) + CONVERT_NODE_REFERENCE(pIsLocked, m_pIsLocked, IValue) + CONVERT_NODE_REFERENCE(pAlias, m_pAlias, INode) + CONVERT_ENUM_ENTRY(Cachable, m_CachingMode, ECachingModeClass) + CONVERT_NODELIST_REFERENCE(pFeature, m_Features, IValue, FeatureList_t) + CONVERT_NODELIST_REFERENCE2(pSelecting, m_Selecting, IValue) + CONVERT_STRING_ENTRY(EventID, m_EventID) + CONVERT_ENUM_ENTRY(Streamable, m_IsStreamable, EYesNoClass) + CONVERT_NODELIST_REFERENCE2(pSelected, m_Selected, IValue) + CONVERT_ENUM_ENTRY(ImposedAccessMode, m_ImposedAccessMode, EAccessModeClass) + CONVERT_ENUM_ENTRY(ImposedVisibility, m_ImposedVisibility, EVisibilityClass) + CONVERT_ENTRY(PollingTime, m_PollingTime) + END_CONVERT_MAP + + protected: + //------------------------------------------------------------- + // Initializing + //------------------------------------------------------------- + + public: + + //! Inserts a reference to the children list + void AddChild( INodePrivate* pNode ); + + //! Inserts a reference to the children list + void AddChild( INode* pNode); + + protected: + //! Inserts a refernece to the parent list + void AddParent( INodePrivate* pNode); + + //! Invalidates all nodes which will become affected by a SetValue call into the node tree + void PreSetValue(); + + //! Fires callback on all nodes which became affected by a SetValue call into the node tree + void PostSetValue(); + + //! The name of the node + GenICam::gcstring m_Name; + + //! The device name of the node tree + GenICam::gcstring m_DeviceName; + + //! The display name string of the node + GenICam::gcstring m_DisplayName; + + //! The type of the node, e.g. MaskedIntReg + GenICam::gcstring m_NodeType; + + //! The namespace of the node + ENameSpace m_NameSpace; + + //! The ToolTip for the node + GenICam::gcstring m_ToolTip; + + //! The Description of the node + GenICam::gcstring m_Description; + + //! Pointer to the object holding the hash map with all nodes + INodeMapPrivate* m_pNodeMap; + + //! Pointer to a Node, which indicates if the node is implemented + IValue *m_pIsImplemented; + + //! Pointer to a Node, which indicates if the node is implemented + CBoolInt m__pIsImplemented; + + //! Pointer to a Node, which indicates if the node is available + IValue *m_pIsAvailable; + + //! Pointer to a Node, which indicates if the node is available + CBoolInt m__pIsAvailable; + + //! Pointer to a Node, which indicats if the node is locked (i.e. not writable) + IValue *m_pIsLocked; + + //! Pointer to a Node, which indicats if the node is locked (i.e. not writable) + CBoolInt m__pIsLocked; + + //! Pointer to a Node, which describes the same feature as this one + INode *m_pAlias; + + //! recommended visibility; + EVisibility m_Visibility; + + //! Access mode imposed on the natural access mode of the node + EAccessMode m_ImposedAccessMode; + + //! Visibility imposed to the natural viibility of the node + EVisibility m_ImposedVisibility; + + //! List of pointers to the children of this node + NodeSet_t m_Children; + + //! List of dependent nodes + NodeSet_t m_Dependents; + + //! List of parents + NodeSet_t m_Parents; + + //! List of terminal nodes + NodeSet_t m_Terminals; + + //! List of childs which could be terminals + NodeSet_t m_TerminalCandidates; + + //! Class handling the callbacks + typedef CallbackController* CallbackControllerType; + + //! Handles the callbacks + CallbackControllerType m_CallbackController; + + //! indicates that the node has changed + mutable ECachingMode m_CachingMode; + + //! indicates that the CachingMode has bee initialized + mutable bool m_IsCachingModeInitialized; + + //! recommended polling time in [ms] + int64_t m_PollingTime; + + //! time elapsed since the last poll + int64_t m_ElapsedTime; + + //! cache access mode + mutable EAccessMode m_AccessModeCache; + + //! Default implementation of GetAccessMode + EAccessMode InternalGetAccessMode(IBase* pValue) const; + + //! Creates the full qualified name + GenICam::gcstring GetQualifiedName(GenICam::gcstring Name, ENameSpace NameSpace) const; + + //! List of node refererences to features + FeatureList_t m_Features; + + //! \name ISelector interface implementation + // \{ + // List of selected features + FeatureList_t m_Selected; + + // List of seleting features + FeatureList_t m_Selecting; + + //! true iff this feature selects a group of features + virtual bool IsSelector() const; + + // Get a list of features selected by this selector + virtual void GetSelectedFeatures( FeatureList_t& list ) const; + + //! retrieve the group of features selecting this node + virtual void GetSelectingFeatures( FeatureList_t& ) const; + + // \} + + //! true if the valeu cache is valid + mutable bool m_ValueCacheValid; + + //! The EventID + GenICam::gcstring m_EventID; + + //! inidcates ifthe node is streamamble + EYesNo m_IsStreamable; + + //! A list with all properties set + GenICam::gcstring_vector m_PropertyNames; + + /*---------------------------------------------------------------*/ + // Loggers + /*---------------------------------------------------------------*/ + + // for safety reasons please keep these member varibles at the + // end of the class' memory layout +#ifdef LOG4C + //! Logger for messages concerning the AccessMode + log4cpp::Category *m_pAccessLog; + + //! Logger for messages concerning the getting and setting values + log4cpp::Category *m_pValueLog; + + //! Logger for messages concerning the range check + log4cpp::Category *m_pRangeLog; + + //! Logger for messages concerning the port access + log4cpp::Category *m_pPortLog; + + //! Logger for messages concerning the caching access + log4cpp::Category *m_pCacheLog; + + //! Logger for messages concerning administrative access, e.g. GetNode() + log4cpp::Category *m_pAdminLog; + + //! Logger for messages concerning miscellaneoud access which does not fit to the other categories + log4cpp::Category *m_pMiscLog; +#endif + + // shortcut for the lock type + typedef AutoLock Lock; + + // Acquire central lock + ThreadingModel::LockType& GetLock() const + { + assert( m_pNodeMap != NULL ); + + return m_pNodeMap->GetLock(); + } + + //! The bathometer is a counter used to measure the depth of SetValue-like call chains + Counter& GetBathometer() + { + assert( m_pNodeMap); + + return m_pNodeMap->GetBathometer(); + } + + // Get the dependent nodes + void GetDependencies( GenApi::NodeList_t &Dependents ) const + { + Lock l(GetLock()); + // increase size first in case of a memory exception + Dependents.reserve( m_Dependents.size() ); + Dependents.clear(); + NodeSet_t::const_iterator it; + for (it=m_Dependents.begin(); it!=m_Dependents.end(); ++it) + { + Dependents.push_back( *it ); + } + } + + //! Invalidates the node if the polling time has elapsed + virtual void Poll( int64_t ElapsedTime ); + + + protected: + //! Used to ensure that PostSetValue() is called in any case + struct PostSetValueFinalizer { + PostSetValueFinalizer(CNodeImpl* pThis) : m_pThis(pThis) {} + ~PostSetValueFinalizer() { + try { m_pThis->PostSetValue(); } + #pragma BullseyeCoverage off + catch ( ... ) + { + // don't throw exceptions here, because the dtor might be + // called when unwinding the stack. + } + #pragma BullseyeCoverage on + } + CNodeImpl* m_pThis; + }; + + + + }; + + + +} + +#ifdef _MSC_VER // *JS* +#pragma warning(pop) +#endif + +#endif // ifndef GENAPI_NODE_H diff --git a/thirdparty/GenICam/include/GenApi/impl/NodeMacros.h b/thirdparty/GenICam/include/GenApi/impl/NodeMacros.h new file mode 100644 index 0000000..b797c06 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/NodeMacros.h @@ -0,0 +1,370 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/NodeMacros.h,v 1.15 2007/11/13 19:41:05 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Defintion of macros for property conversion map +*/ + +#ifndef GENAPI_NODEMACROS_H +#define GENAPI_NODEMACROS_H + +//************************************************************* +// Macros forming the CONVERSION_MAP +//************************************************************* + +typedef enum +{ + In, + Out +} Direction_t; + + +//! Starts a conversion map; BASE +#define BEGIN_CONVERT_MAP \ +virtual bool SetProperty(const GenICam::gcstring& PropertyName, const GenICam::gcstring& ValueStr) \ + { \ + return SetProperty(PropertyName, ValueStr, ""); \ + } \ +virtual bool SetProperty(const GenICam::gcstring& PropertyName, const GenICam::gcstring& ValueStr, const GenICam::gcstring& AttributeStr) \ + { \ + bool PropertyAlreadyPresent=false; \ + GenICam::gcstring_vector::iterator ptr; \ + for(ptr=m_PropertyNames.begin(); ptr!=m_PropertyNames.end(); ptr++) \ + if(*ptr == PropertyName) \ + PropertyAlreadyPresent = true; \ + if(!PropertyAlreadyPresent) \ + m_PropertyNames.push_back(PropertyName); \ + GenICam::gcstring _ValueStr=ValueStr; \ + GenICam::gcstring _AttributeStr = AttributeStr; \ + return AccessProperty( PropertyName, _ValueStr, _AttributeStr, In ); \ + } \ +virtual bool AccessProperty(const GenICam::gcstring& PropertyName, GenICam::gcstring& ValueStr, GenICam::gcstring& AttributeStr, Direction_t Direction) \ + { \ + if( Direction == Out ) \ + { \ + ValueStr = ""; \ + AttributeStr = ""; \ + } \ + bool dummy=false; \ + if(dummy) \ + {return false;} + + +//! Chains the call to another class +#define CHAIN_CONVERT_MAP(TARGET) \ + else if(TARGET::AccessProperty(PropertyName, ValueStr, AttributeStr, Direction)) \ + return true; + +//! Entry in the conversion map for simple values +#define CONVERT_ENTRY(Name, Member) \ + else if (Direction == In && PropertyName == #Name) \ + { \ + if( !String2Value(ValueStr, &Member)) \ + throw PROPERTY_EXCEPTION("%s : property '%s' : cannot convert value '%s'", m_Name.c_str(), PropertyName.c_str(), ValueStr.c_str() ); \ + return true; \ + } \ + else if (Direction == Out && PropertyName == #Name) \ + { \ + Value2String(Member, ValueStr); \ + return true; \ + } + +#define CONVERT_STRING_ENTRY(Name, Member) \ + else if (Direction == In && PropertyName == #Name) \ + { \ + Member = ValueStr; \ + return true; \ + } \ + else if (Direction == Out && PropertyName == #Name) \ + { \ + ValueStr = Member; \ + return true; \ + } + +//! Entry in the conversion map for simple values +#define CONVERT_LIST_ENTRY(Name, Member, _Type) \ + else if (Direction == In && PropertyName == #Name) \ + { \ + _Type listElem;\ + if( !String2Value(ValueStr, &listElem)) \ + throw PROPERTY_EXCEPTION("%s : property '%s' : cannot convert value '%s'", m_Name.c_str(), PropertyName.c_str(), ValueStr.c_str() ); \ + Member.push_back(listElem);\ + return true; \ + } \ + else if (Direction == Out && PropertyName == #Name) \ + { Values2String( Member, ValueStr ); return true; } +#if 0 + std::list<_Type>::iterator ptr; \ + for(ptr=Member.begin(); ptr!=Member.end(); ptr++ ) \ + { \ + GenICam::gcstring Buffer; \ + Value2String(*ptr, Buffer); \ + ValueStr += Buffer + "\t"; \ + } \ + if(ValueStr.size() > 1) \ + ValueStr = ValueStr.substr(0, ValueStr.size()-1); \ + return true; \ + } +#endif + +//! Entry in the conversion map for invalidators +#define CONVERT_INVALIDATOR( _Name ) \ + else if (Direction == In && PropertyName == #_Name) \ + { \ + INode *pNode = m_pNodeMap->GetNode( ValueStr ); \ + if (! pNode) \ + throw PROPERTY_EXCEPTION("%s : property '%s' : node '%s' does not exist", dynamic_cast(this)->GetName().c_str(), PropertyName.c_str(), ValueStr.c_str() ); \ + m_Invalidators.push_back( pNode ); \ + return true; \ + } \ + else if (Direction == Out && PropertyName == #_Name) \ + { \ + node_vector::iterator ptr; \ + for(ptr=m_Invalidators.begin(); ptr!=m_Invalidators.end(); ptr++ ) \ + { \ + ValueStr += (*ptr)->GetName() + "\t"; \ + } \ + if(ValueStr.size() > 1) \ + ValueStr = ValueStr.substr(0, ValueStr.size()-1); \ + return true; \ + } + +/** +\brief Entry in the conversion map for node refs +*/ +#define CONVERT_NODE_REFERENCE(_Name, Member, Interface) \ + else if (Direction == In && PropertyName == #_Name) \ + { \ + INode * const pNode = m_pNodeMap->GetNode(ValueStr); \ + if(!pNode) \ + throw PROPERTY_EXCEPTION("%s : property '%s' : node '%s' does not exist", dynamic_cast(this)->GetName().c_str(), PropertyName.c_str(), ValueStr.c_str() ); \ + Member = dynamic_cast(pNode); \ + if(!Member) \ + throw PROPERTY_EXCEPTION("%s : property '%s' : node '%s' has no interface '" #Interface "'", dynamic_cast(this)->GetName().c_str(), PropertyName.c_str(), ValueStr.c_str() ); \ + if (dynamic_cast(this) == pNode) \ + throw PROPERTY_EXCEPTION("%s : property '%s' : self reference ", dynamic_cast(this)->GetName().c_str(), PropertyName.c_str() ); \ + AddChild(pNode ); \ + return true; \ + } \ + else if (Direction == Out && PropertyName == #_Name) \ + { \ + INode *pNode = dynamic_cast(Member); \ + if(pNode) \ + ValueStr = pNode->GetName(); \ + return true; \ + } + +/** +\brief Entry in the conversion map for node refs +*/ +#define CONVERT_NODELIST_REFERENCE_AUX(_Name, Member, Interface, AuxMember, AuxType ) \ + else if (Direction == In && PropertyName == #_Name) \ + { \ + INode * const pNode = m_pNodeMap->GetNode(ValueStr); \ + if(!pNode) \ + throw PROPERTY_EXCEPTION("%s : property '%s' : node '%s' does not exist", dynamic_cast(this)->GetName().c_str(), PropertyName.c_str(), ValueStr.c_str() ); \ + Interface * const pListElem = dynamic_cast(pNode); \ + if(!pListElem) \ + throw PROPERTY_EXCEPTION("%s : property list element '%s' : node '%s' has no interface '" #Interface "'", dynamic_cast(this)->GetName().c_str(), PropertyName.c_str(), ValueStr.c_str() ); \ + Member.push_back(pListElem);\ + dynamic_cast(this)->AddChild(pNode); \ + AuxType AuxValue; \ + if( !String2Value(AttributeStr, &AuxValue)) \ + throw PROPERTY_EXCEPTION("%s : property '%s' : cannot convert attribute value '%s'", m_Name.c_str(), PropertyName.c_str(), AttributeStr.c_str() ); \ + AuxMember.push_back(AuxValue);\ + return true; \ + } \ + else if (Direction == Out && PropertyName == #_Name) \ + { \ + IntegerList_t::iterator ptrValue; \ + Int64List_t::iterator ptrAttribute; \ + for(ptrValue=Member.begin(), ptrAttribute=AuxMember.begin(); \ + ptrValue!=Member.end(); \ + ptrValue++, ptrAttribute++ ) \ + { \ + ValueStr += (*ptrValue)->GetNode()->GetName() + "\t"; \ + GenICam::gcstring Buffer; \ + Value2String(*ptrAttribute, Buffer); \ + AttributeStr += Buffer + "\t"; \ + } \ + if(ValueStr.size() > 1) \ + { \ + ValueStr = ValueStr.substr(0, ValueStr.size()-1); \ + AttributeStr = AttributeStr.substr(0, AttributeStr.size()-1); \ + } \ + return true; \ + } + + +/** +\brief Entry in the conversion map for node refs +*/ +#define CONVERT_NODELIST_REFERENCE(_Name, Member, Interface, ContainerType ) \ + else if (Direction == In && PropertyName == #_Name) \ + { \ + INode * const pNode = m_pNodeMap->GetNode(ValueStr); \ + if(!pNode) \ + throw PROPERTY_EXCEPTION("%s : property '%s' : node '%s' does not exist", dynamic_cast(this)->GetName().c_str(), PropertyName.c_str(), ValueStr.c_str() ); \ + Interface * const pListElem = dynamic_cast(pNode); \ + if(!pListElem) \ + throw PROPERTY_EXCEPTION("%s : property list element '%s' : node '%s' has no interface '" #Interface "'", dynamic_cast(this)->GetName().c_str(), PropertyName.c_str(), ValueStr.c_str() ); \ + Member.push_back(pListElem);\ + dynamic_cast(this)->AddChild(pNode); \ + return true; \ + } \ + else if (Direction == Out && PropertyName == #_Name) \ + { \ + ContainerType::iterator ptr; \ + for(ptr=Member.begin(); ptr!=Member.end(); ptr++ ) \ + ValueStr += (*ptr)->GetNode()->GetName() + "\t"; \ + if(ValueStr.size() > 1) \ + ValueStr = ValueStr.substr(0, ValueStr.size()-1); \ + return true; \ + } + + +/** +\brief Entry in the conversion map for node refs that are not children +*/ +#define CONVERT_NODELIST_REFERENCE2(_Name, Member, Interface) \ + else if (Direction == In && PropertyName == #_Name) \ + { \ + INode * const pNode = m_pNodeMap->GetNode(ValueStr); \ + if(!pNode) \ + throw PROPERTY_EXCEPTION("%s : property '%s' : node '%s' does not exist", dynamic_cast(this)->GetName().c_str(), PropertyName.c_str(), ValueStr.c_str() ); \ + Interface * const pListElem = dynamic_cast(pNode); \ + if(!pListElem) \ + throw PROPERTY_EXCEPTION("%s : property list element '%s' : node '%s' has no interface '" #Interface "'", dynamic_cast(this)->GetName().c_str(), PropertyName.c_str(), ValueStr.c_str() ); \ + Member.push_back(pListElem);\ + return true; \ + } \ + else if (Direction == Out && PropertyName == #_Name) \ + { \ + FeatureList_t::iterator ptr; \ + for(ptr=Member.begin(); ptr!=Member.end(); ptr++ ) \ + { \ + ValueStr += (*ptr)->GetNode()->GetName() + "\t"; \ + } \ + if(ValueStr.size() > 1) \ + ValueStr = ValueStr.substr(0, ValueStr.size()-1); \ + return true; \ + } + +/** +\brief Entry in the conversion map for refs +*/ +#define CONVERT_REFERENCE(_Name, Member, Interface) \ + else if (Direction == In && PropertyName == #_Name) \ + { \ + INode * const pNode = dynamic_cast(this)->GetNode(ValueStr); \ + if(!pNode) \ + throw PROPERTY_EXCEPTION("%s : property '%s' : node '%s' does not exist", m_Name.c_str(), PropertyName.c_str(), ValueStr.c_str() ); \ + Member = dynamic_cast(pNode); \ + return true; \ + } \ + else if (Direction == Out && PropertyName == #_Name) \ + { \ + INode * const pNode = dynamic_cast(Member); \ + ValueStr = pNode->GetName(); \ + return true; \ + } + +//! Entry in the conversion map for node refs +#define CONVERT_ANONYMOUS_NODE_REFERENCE(_Name) \ + else if (Direction == In && PropertyName == #_Name) \ + { \ + INode * const pNode = m_pNodeMap->GetNode(ValueStr); \ + if(!pNode) \ + throw PROPERTY_EXCEPTION("%s : property '%s' : node '%s' does not exist", m_Name.c_str(), PropertyName.c_str(), ValueStr.c_str() ); \ + dynamic_cast(this)->AddChild(pNode); \ + return true; \ + } \ + else if (Direction == Out && PropertyName == #_Name) \ + { \ + INode * const pNode = dynamic_cast(Member); \ + ValueStr = pNode->GetName(); \ + return true; \ + } + +//! Entry in the conversion map for GenApi defined enumeration types +#define CONVERT_ENUM_ENTRY(_Name, Member, _EnumDelegate) \ + else if (Direction == In && PropertyName == GenICam::gcstring(#_Name)) \ + { \ + if( !_EnumDelegate::FromString(ValueStr, &(Member))) \ + throw PROPERTY_EXCEPTION("%s : property '%s' : cannot convert value '%s'", m_Name.c_str(), PropertyName.c_str(), ValueStr.c_str() ); \ + return true; \ + } \ + else if (Direction == Out && PropertyName == GenICam::gcstring(#_Name)) \ + { \ + ValueStr = _EnumDelegate::ToString(Member); \ + return true; \ + } + +//! Entry in the conversion map for user defined enumeration types +#define ADD_ENUM_ENTRY(_Name, _EnumDelegate) \ + else if (Direction == In && PropertyName == #_Name) \ + { \ + INode * const pNode = m_pNodeMap->GetNode(ValueStr); \ + if(!pNode) \ + throw PROPERTY_EXCEPTION("%s : property '%s' : node '%s' does not exist", dynamic_cast(this)->GetName().c_str(), PropertyName.c_str(), ValueStr.c_str() ); \ + IEnumEntry * const pEntry = dynamic_cast(pNode); \ + if(!pEntry) \ + throw PROPERTY_EXCEPTION("%s : property enum entry '%s' : node '%s' is not of class IEnumEntry ", dynamic_cast(this)->GetName().c_str(), PropertyName.c_str(), ValueStr.c_str() ); \ + _EnumDelegate->AddEntry(pNode); \ + return true; \ + } \ + else if (Direction == Out && PropertyName == #_Name) \ + { \ + NodeList_t Entries; \ + _EnumDelegate->GetEntries(Entries); \ + NodeList_t::iterator ptr; \ + for(ptr=Entries.begin(); ptr!=Entries.end(); ptr++ ) \ + ValueStr += (*ptr)->GetName() + "\t"; \ + if(ValueStr.size() > 1) \ + ValueStr = ValueStr.substr(0, ValueStr.size()-1); \ + return true; \ + } \ + +//! Entry in the conversion map for user defined variables of the swiss knife +#define ADD_VARIABLE_ENTRY(_Name, _VariableDelegate) \ + else if (Direction == In && PropertyName == #_Name) \ + { \ + _VariableDelegate->AddEntry(ValueStr, AttributeStr, m_Name, m_pNodeMap); \ + return true; \ + } \ + else if (Direction == Out && PropertyName == #_Name) \ + { \ + _VariableDelegate->GetVariablesAndAttributes(ValueStr, AttributeStr); \ + return true; \ + } + +//! Terminates the conversion map +#define END_CONVERT_MAP \ + else \ + return false; \ +}; + + +#endif // GENAPI_NODEMACROS_H diff --git a/thirdparty/GenICam/include/GenApi/impl/NodeMap.h b/thirdparty/GenICam/include/GenApi/impl/NodeMap.h new file mode 100644 index 0000000..d3d6cca --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/NodeMap.h @@ -0,0 +1,296 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/NodeMap.h,v 1.15 2007/11/13 19:41:05 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CNodeMap and the type CreateFunc_t +*/ + +#ifndef GENAPI_NODEMAP_H +#define GENAPI_NODEMAP_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef _MSC_VER // *JS* +#pragma warning(push) +#pragma warning(disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of class 'yyy' +#endif + +namespace GenApi +{ + + typedef INodePrivate*(*CreateFunc_t)( const GenICam::gcstring& ); + + class string2node_t; + /** + \brief Hold a map of all nodes + */ + class GENAPI_DECL CNodeMap + : virtual public INodeMapPrivate + , public IDeviceInfo + , public IDestroy + { + public: + //! Constructor + CNodeMap(GenICam::gcstring DeviceName = "Device"); + + //! Destructor + virtual ~CNodeMap(); + + //! creates a nodemap object + static INodeMap* Create(GenICam::gcstring DeviceName); + + //------------------------------------------------------------- + // INodeMap interface + //------------------------------------------------------------- + + //! Retrieves all nodes in the node map + virtual void GetNodes(NodeList_t &Nodes) const; + + //! Retrieves the node from the central map by name + virtual INode* GetNode( const GenICam::gcstring& Name) const; + + // Returns the top-level odes + virtual void GetTopLevelNodes(NodeList_t &Nodes) const; + + //! Invalidates all nodes + virtual void InvalidateNodes() const; + + //! Connects a port to a port node with given name + virtual bool Connect( IPort* pPort, const GenICam::gcstring& PortName) const; + + //! Connects a port to the standard port "Device" + virtual bool Connect( IPort* pPort) const; + + //! Get device name + virtual GenICam::gcstring GetDeviceName(); + + //! Fires nodes which have a polling time + virtual void Poll( int64_t ElapsedTime ); + + //------------------------------------------------------------- + // INodeMapPrivate interface + //------------------------------------------------------------- + + //! Adds a node to the map + virtual void AddNode( const GenICam::gcstring& key, GenApi::INodePrivate *node); + + //! returns the locl object + virtual ThreadingModel::LockType& GetLock() const { return m_Lock; } + + //!returns the call stack depth counter object + virtual Counter& GetBathometer() { return m_Bathometer; } + + //! finalizes construction of the node map + virtual void FinalConstruct(); + + + //! Convert map (contains SetProperty) + BEGIN_CONVERT_MAP + CONVERT_STRING_ENTRY(ModelName,m_ModelName) + CONVERT_STRING_ENTRY(VendorName,m_VendorName) + CONVERT_STRING_ENTRY(ToolTip,m_ToolTip) + CONVERT_STRING_ENTRY(StandardNameSpace,m_StandardNameSpace) + CONVERT_ENTRY(SchemaMajorVersion,m_SchemaVersion.Major) + CONVERT_ENTRY(SchemaMinorVersion,m_SchemaVersion.Minor) + CONVERT_ENTRY(SchemaSubMinorVersion,m_SchemaVersion.SubMinor) + CONVERT_ENTRY(MajorVersion,m_DeviceVersion.Major) + CONVERT_ENTRY(MinorVersion,m_DeviceVersion.Minor) + CONVERT_ENTRY(SubMinorVersion,m_DeviceVersion.SubMinor) + CONVERT_STRING_ENTRY(ProductGuid,m_ProductGuid) + CONVERT_STRING_ENTRY(VersionGuid,m_VersionGuid) + END_CONVERT_MAP + + //---------------------------------------------------------------- + // implements IDeviceInfo + //---------------------------------------------------------------- + + //! Get the model name + virtual GenICam::gcstring GetModelName() + { + return m_ModelName; + } + + //! Get the vendor name + virtual GenICam::gcstring GetVendorName() + { + return m_VendorName; + } + + //! Get tool tip + virtual GenICam::gcstring GetToolTip() + { + return m_ToolTip; + } + + //! Get the standard name space which is used for retrieveing names without qualifier + virtual GenICam::gcstring GetStandardNameSpace() + { + return m_StandardNameSpace; + } + + //! Get the version of the DLL's GenApi implementation + virtual void GetGenApiVersion(Version_t &Version, uint16_t &Build) + { + Version.Major = GENAPI_VERSION_MAJOR; + Version.Minor = GENAPI_VERSION_MINOR; + Version.SubMinor = GENAPI_VERSION_SUBMINOR; + Build = GENAPI_VERSION_BUILD; + } + + //! Get the schema version number + virtual void GetSchemaVersion(Version_t &Version) + { + Version = m_SchemaVersion; + } + + //! Get the version of the device description file + virtual void GetDeviceVersion(Version_t &Version) + { + Version = m_DeviceVersion; + } + + //! Get the Guid describing the product + virtual GenICam::gcstring GetProductGuid() + { + return m_ProductGuid; + } + + //! Get the Guid describing the product version + virtual GenICam::gcstring GetVersionGuid() + { + return m_VersionGuid; + } + + //---------------------------------------------------------------- + // DeviceInfo + //---------------------------------------------------------------- + + //! model name + GenICam::gcstring m_ModelName; + + //! Get the vendor name + GenICam::gcstring m_VendorName; + + //! tool tip + GenICam::gcstring m_ToolTip; + + //! standard name space + GenICam::gcstring m_StandardNameSpace; + + //! schema version number + Version_t m_SchemaVersion; + + //! device description file's version number + Version_t m_DeviceVersion; + + //! Guid describing the product + GenICam::gcstring m_ProductGuid; + + //! Guid describing the product version + GenICam::gcstring m_VersionGuid; + + //! A list with all properties set + GenICam::gcstring_vector m_PropertyNames; + + //------------------------------------------------------------- + // Implementation + //------------------------------------------------------------- + + //! Makes the object to destro itself + virtual void Destroy(); + + /** + \brief Register class + */ + static bool Register( GenICam::gcstring clasname, CreateFunc_t ); + + //! Get the number of nodes in the map + uint64_t GetNumNodes() const; + + protected: + //! operator updating the dependencies because of the selector feature + struct UpdateSelector; + + //! operator creating the selecting lists + struct UpdateSelecting; + + //! propegate dependencies through the node map + void PropagateDependencies(); + + //! map node class names to creator functions + typedef std::map CreatorMap_t; + + //! Get the instance of the node creator map + static CreatorMap_t* GetInstance(); + + //! Map holding pointers to nodes referencey by their names + //typedef std::map string2node_t; + + //! Map holding nodes keyed by their name + string2node_t& Map(); + const string2node_t& Map() const; + void ClearAllNodes(); + string2node_t *m_pMap; + + //! Creates a node of given type on the heap and registers it in the map + INodePrivate *CreateAndRegisterNode(GenICam::gcstring &NodeType, GenICam::gcstring &NodeName, GenICam::gcstring &NodeNameSpace); + + //! The name of the device + GenICam::gcstring m_Name; + + //! indicates if the nodemap is initilizaed + bool m_Initialized; + + //! counts the depth of SetValue call-chains + Counter m_Bathometer; + + //! List of pointers to nodes which need to be polled + NodeSet_t m_PollingNodes; + + + private: + CNodeMap(const CNodeMap&); + CNodeMap& operator=(const CNodeMap&); + + mutable ThreadingModel::LockType m_Lock; + }; +} + +#ifdef _MSC_VER // *JS* +#pragma warning(pop) +#endif + +#endif // GENAPI_NODEMAP_H diff --git a/thirdparty/GenICam/include/GenApi/impl/NodeT.h b/thirdparty/GenICam/include/GenApi/impl/NodeT.h new file mode 100644 index 0000000..fbac9e0 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/NodeT.h @@ -0,0 +1,192 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Alexander Happe +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/NodeT.h,v 1.11 2007/08/16 13:56:25 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of the NodeT class template +*/ + +#ifndef GENAPI_NODET_H +#define GENAPI_NODET_H + +#include "../INode.h" +#include "../Synch.h" + +namespace GenApi +{ + + /** + \brief Implementation of the INode interface + */ + template< class Base > + class GENAPI_DECL NodeT : public Base + { + public: + //! Implementation of INode::GetName() + virtual GenICam::gcstring GetName(bool FullQualified) const + { + AutoLock l(Base::GetLock()); + + return Base::InternalGetName(FullQualified); + } + + //! Implementation of INode::GetNameSpace() + virtual GenApi::ENameSpace GetNameSpace() const + { + AutoLock l(Base::GetLock()); + + return Base::InternalGetNameSpace(); + } + + //! Implementation of INode::GetVisibility() + virtual EVisibility GetVisibility() const + { + AutoLock l(Base::GetLock()); + + EVisibility NaturalVisibility = Base::InternalGetVisibility(); + + EVisibility Visibility = Combine(NaturalVisibility, Base::m_ImposedVisibility); + + return Visibility; + } + + //! Implementation of INode::InvalidateNode() + virtual void InvalidateNode() + { + AutoLock l(Base::GetLock()); + + Base::InternalInvalidateNode(); + } + + //! Implementation of INode::IsCachable() + virtual bool IsCachable()const + { + AutoLock l(Base::GetLock()); + + return Base::InternalIsCachable(); + } + + //! Implementation of INode::GetCachingMode + virtual ECachingMode GetCachingMode() const + { + AutoLock l(Base::GetLock()); + + return Base::InternalGetCachingMode(); + } + + //! Implementation of INode::GetPollingTime() + virtual int64_t GetPollingTime()const + { + AutoLock l(Base::GetLock()); + + return Base::InternalGetPollingTime(); + } + + //! Implementation of INode::GetToolTip() + virtual GenICam::gcstring GetToolTip() const + { + AutoLock l(Base::GetLock()); + + return Base::InternalGetToolTip(); + } + + //! Implementation of INode::GetDescription() + virtual GenICam::gcstring GetDescription() const + { + AutoLock l(Base::GetLock()); + + return Base::InternalGetDescription(); + } + + //! Implementation of INode::GetDisplayName + virtual GenICam::gcstring GetDisplayName() const + { + AutoLock l(Base::GetLock()); + + return Base::InternalGetDisplayName(); + } + + //! Implementation of INode::GetChildren() + virtual void GetChildren(NodeList_t &Children) const + { + AutoLock l(Base::GetLock()); + + return Base::InternalGetChildren( Children ); + } + + //! Implementation of INode::RegisterCallback() + virtual CallbackHandleType RegisterCallback( NodeCallback& ncb ) + { + AutoLock l(Base::GetLock()); + + return Base::InternalRegisterCallback( ncb ); + } + + //! Implementation of INode::DeregisterCallback() + virtual CallbackHandleType DeregisterCallback( CallbackHandleType ch ) + { + AutoLock l(Base::GetLock()); + + return Base::InternalDeregisterCallback( ch ); + } + + //! Implementation of INode::GetNodeMap() + virtual INodeMap* GetNodeMap() const + { + AutoLock l(Base::GetLock()); + + return Base::InternalGetNodeMap(); + } + + //! Implementation of INode::GetNodeMap() + virtual GenICam::gcstring GetEventID() const + { + AutoLock l(Base::GetLock()); + + return Base::GetEventID(); + } + + //! Returns a list of the names all properties set during initialization + virtual void GetPropertyNames(GenICam::gcstring_vector &PropertyNames) const + { + AutoLock l(Base::GetLock()); + + Base::GetPropertyNames(PropertyNames); + } + + //! Retrieves a property plus an additional attribute by name + /*! If a property has multiple values/attribute they come with Tabs as delimiters */ + virtual bool GetProperty(const GenICam::gcstring& PropertyName, GenICam::gcstring& ValueStr, GenICam::gcstring& AttributeStr) + { + AutoLock l(Base::GetLock()); + + return Base::GetProperty(PropertyName, ValueStr, AttributeStr); + } + + }; + + +} + +#endif // GENAPI_NODET_H diff --git a/thirdparty/GenICam/include/GenApi/impl/PersistenceImpl.h b/thirdparty/GenICam/include/GenApi/impl/PersistenceImpl.h new file mode 100644 index 0000000..dabfdf8 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/PersistenceImpl.h @@ -0,0 +1,108 @@ +//----------------------------------------------------------------------------- +// (c) 2007 by National Instruments +// Project: GenApi +// Author: Eric Gross +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/PersistenceImpl.h,v 1.1 2007/11/13 19:57:41 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of template CPointer +\ingroup GenApi_PublicUtilities +*/ + +#ifndef _GENICAM_PERSISTENCEIMPL_H +#define _GENICAM_PERSISTENCEIMPL_H + +#include +#include +#include +#include +#include +#include +#include + +using namespace GenICam; + +namespace GenApi +{ + + //! IIterator interface - a generic way to iterate the values of a node + class IIterator { + //! Resets the interator + virtual void IterateReset() = 0; + + //! Advances the interator to the next element + virtual void IterateIncrement() = 0; + + //! True if no more elements to interate are available + virtual bool IterateIsDone() const = 0; + + //! Computes the maximum number of elements the interator can visit + virtual int64_t IterateGetMaxIteratons() const = 0; + }; + + + //! Iterator which can walk the interfaces which are valid for selectors + class IIteratorWrapper : public IIterator + { + public: + //! Constructor + IIteratorWrapper(IValue* node); + + //! Destructor + ~IIteratorWrapper(); + + //! Resets the interator + virtual void IterateReset(); + + //! Advances the interator to the next element + virtual void IterateIncrement(); + + //! True if no more elements to interate are available + virtual bool IterateIsDone() const; + + //! Computes the maximum number of elements the interator can visit + virtual int64_t IterateGetMaxIteratons() const; + + private: + //! holds a poiinter if the node to interate is an integer + IInteger* interfaceIIntegerPtr; + + //! holds a poiinter if the node to interate is an enumeration + IEnumeration* interfaceIEnumPtr; + + //! holds a poiinter if the node to interate is an boolean + IBoolean* interfaceIBoolPtr; + }; + + + //! Generates a list of nodes that will be persisted + void GetNodeListForPersistence(INodeMap *pNodeMap, FeatureList_t& nodeList, INode* recurseNode = NULL); + + //! Helper function to assist iterating a group of selectors for one or more features + int64_t RecurseSelectors(IPersistScript& persistScript, FeatureList_t& featuresToPersist, FeatureList_t& selectors, FeatureList_t::iterator recursionSelector); + + //! Persists a node map into an IPersistScript that can be played back at some future time + void PersistFeatures(INodeMap *pNodeMap, IPersistScript& persistScript); + +} + +#endif //_GENICAM_PERSISTENCEIMPL_H + diff --git a/thirdparty/GenICam/include/GenApi/impl/PointerImpl.h b/thirdparty/GenICam/include/GenApi/impl/PointerImpl.h new file mode 100644 index 0000000..1aff09f --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/PointerImpl.h @@ -0,0 +1,53 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/PointerImpl.h,v 1.4 2007/08/16 13:56:26 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of private drivates from CPointer +\ingroup GenApi_PublicUtilities +*/ + +#ifndef GENAPI_POINTERPRIVATE_H +#define GENAPI_POINTERPRIVATE_H + +#include "../Pointer.h" +#include "INodePrivate.h" +#include "INodeMapPrivate.h" + +namespace GenApi +{ + + //! \addtogroup GenApi_PublicImpl + //! \{ + + //! SmartPointer for INodePrivate interface pointer + typedef CPointer CNodePrivatePtr; + + //! SmartPointer for INodeMapPrivate interface pointer + typedef CPointer CNodeMapPrivatePtr; + //! \} + +} + +#endif // ifndef GENAPI_POINTERPRIVATE_H diff --git a/thirdparty/GenICam/include/GenApi/impl/Port.h b/thirdparty/GenICam/include/GenApi/impl/Port.h new file mode 100644 index 0000000..84d63f5 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/Port.h @@ -0,0 +1,140 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/Port.h,v 1.9 2007/08/16 13:56:26 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CPort +*/ + +#ifndef GENAPI_PORT_H +#define GENAPI_PORT_H + +#include "../Types.h" +#include "../IPortConstruct.h" +#include "../IChunkPort.h" +#include "../IString.h" +#include "Node.h" +#include "NodeT.h" +#include "BaseT.h" + +namespace GenApi +{ + + class CValueCache; + + //************************************************************* + // CPort class + //************************************************************* + + //! Standard IPort implementation + /*! Proxy forwarding all calls to the real implementation + */ + class GENAPI_DECL CPort_ : public IPortConstruct, public IChunkPort, public CNodeImpl + { + public: + //! Default constructor + //constructor + CPort_(); + + //! Destructor + ~CPort_(); + + //------------------------------------------------------------- + // IBase implementation + //------------------------------------------------------------- + + protected: + //! Get the access mode of the node + virtual EAccessMode InternalGetAccessMode() const; + + //------------------------------------------------------------- + // IPort implementation + //------------------------------------------------------------- + + public: + //! Reads a chunk of bytes from the port + virtual void Read(void *pBuffer, int64_t Address, int64_t Length); + + //! Writes a chunk of bytes to the port + virtual void Write(const void *pBuffer, int64_t Address, int64_t Length); + + //------------------------------------------------------------- + // IPortConstruct implementation + //------------------------------------------------------------- + + //! Sets pointer the real port implementation; this function may called only once + void SetPortImpl(IPort* pPort); + + //------------------------------------------------------------- + // IChunkPort implementation + //------------------------------------------------------------- + + //! Get the Id of the chunk the port should be attached to + virtual GenICam::gcstring GetChunkID() const; + + //! Determines if the port adapter must perform an endianess swap + virtual EYesNo GetSwapEndianess(); + + //------------------------------------------------------------- + // Initializing + //------------------------------------------------------------- + BEGIN_CONVERT_MAP + CONVERT_STRING_ENTRY(ChunkID, m_ChunkID) + CONVERT_NODE_REFERENCE(pChunkID, m_pChunkID, IString) + CONVERT_ENUM_ENTRY(SwapEndianess, m_SwapEndianess, EYesNoClass) + CHAIN_CONVERT_MAP(CNodeImpl) + END_CONVERT_MAP + + //! Returns the value cache + virtual CValueCache* GetValueCache() const; + + + protected: + //------------------------------------------------------------- + // Member variables + //------------------------------------------------------------- + + //! Pointer to node giving access to the real port implementation + IPort *m_pPort; + + //! The ChunkID + GenICam::gcstring m_ChunkID; + + //! Pointer to a Node, which indicates if the node is available + IString *m_pChunkID; + + //! Pointer the value cache + mutable GenApi::CValueCache *m_pValueCache; + + //! Determines if the port adapter must perform an endianess swap + EYesNo m_SwapEndianess; + }; + + class GENAPI_DECL CPort : public BaseT< NodeT< CPort_ > > + { + }; + +} + +#endif // ifndef GENAPI_PORT_H diff --git a/thirdparty/GenICam/include/GenApi/impl/PrivateTypes.h b/thirdparty/GenICam/include/GenApi/impl/PrivateTypes.h new file mode 100644 index 0000000..6d2356d --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/PrivateTypes.h @@ -0,0 +1,49 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Alexander Happe +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/PrivateTypes.h,v 1.7 2007/08/16 13:56:26 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file + +\brief Common types used in the GenApi implementation. +*/ + +#ifndef GENAPI_PRIVATETYPES_H +#define GENAPI_PRIVATETYPES_H + +#include "../IInteger.h" +#include + +namespace GenApi +{ + typedef std::list UInt64List_t; + typedef std::list pUInt64List_t; + typedef std::list Int64List_t; + typedef std::list pInt64List_t; + + //! List of Integer-node references + typedef std::list IntegerList_t; +} + + +#endif // ifndef GENAPI_PRIVATETYPES_H diff --git a/thirdparty/GenICam/include/GenApi/impl/Register.h b/thirdparty/GenICam/include/GenApi/impl/Register.h new file mode 100644 index 0000000..13683a4 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/Register.h @@ -0,0 +1,266 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/Register.h,v 1.16 2007/11/13 19:41:05 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CRegister +*/ + +#ifndef GENAPI_REGISTER_H +#define GENAPI_REGISTER_H + +#include "NodeT.h" +#include "RegisterT.h" +#include "BaseT.h" +#include "ValueT.h" +#include "Port.h" +#include "NodeMacros.h" +#include "PrivateTypes.h" +#include "Node.h" +#include "../IInteger.h" +#include "../IEnumeration.h" + +#ifdef _MSC_VER // *JS* +#pragma warning(push) +#pragma warning(disable: 4275) // non dll-interface XXX used as base for dll-interface class YYY +#pragma warning(disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of class 'yyy' +#endif + +namespace GenApi +{ + + //************************************************************* + // CEnumInt class + //************************************************************* + + //! Helper class making IInteger and IEnumeration look like IInteger + class CEnumInt + { + public: + //! Constructor + CEnumInt() : m_pInteger(NULL), m_pEnumeration(NULL) + {} + + //! Assignment + void operator=( IBase *pT ) + { + m_pInteger = dynamic_cast(pT); + m_pEnumeration = dynamic_cast(pT); + } + + // this method is currently not used + #if 0 + //! Set a value to either bool or int + void SetValue( int64_t Value ) + { + if(m_pInteger) + m_pInteger->SetValue( Value ); + else if(m_pEnumeration) + m_pEnumeration->SetIntValue( Value ); + else + throw LOGICAL_ERROR_EXCEPTION( "Cannot dereference NULL pointer" ); + } + #endif + + //! Get a value from either bool or int + int64_t GetValue() const + { + if(m_pInteger) + return m_pInteger->GetValue(); + #pragma BullseyeCoverage off + else if(m_pEnumeration) + return m_pEnumeration->GetIntValue(); + else + throw LOGICAL_ERROR_EXCEPTION( "Cannot dereference NULL pointer" ); + #pragma BullseyeCoverage on + } + + protected: + //! holds the pointer if it is an IInteger + IInteger *m_pInteger; + + //! holds the pointer if it is an IEnumeration + IEnumeration *m_pEnumeration; + }; + + //! List of EnumInt-node references + typedef std::list ValueList_t; + + //! List of EnumInt-node references + typedef std::list EnumIntList_t; + + + //************************************************************* + // CRegisterImpl class + //************************************************************* + /** + * \ingroup internal_impl register + * \brief Standard IRegister implementation + * Provides a chunk of memory which acts as a proxy to the register + */ + class GENAPI_DECL CRegisterImpl + : public IRegister + , public CNodeImpl + { + public: + //! Default Contructor + CRegisterImpl(); + + //! Destructor + virtual ~CRegisterImpl(); + + protected: + //------------------------------------------------------------- + // IValue implementation + //------------------------------------------------------------- + + //! Get value of the node as string + virtual GenICam::gcstring InternalToString(bool Verify = false); + + //! Set value of the node as string + virtual void InternalFromString(const GenICam::gcstring& valueString, bool Verify = true); + + public: + //------------------------------------------------------------- + // INodePrivate implementation + //------------------------------------------------------------- + + //! Initializes the object + virtual void SetInvalid(INodePrivate::ESetInvalidMode simMode); + + //! finalizes the construction of the node + virtual void FinalConstruct(); + + //! propagates the dependency graphs + virtual bool PropagateDependency( NodePrivateList_t &Dependents ); + + //! checks if this node is terminal + virtual bool IsTerminalNode() const + { + // Registers are terminal nodes per default + return true; + } + + //------------------------------------------------------------- + // IBase implementation + //------------------------------------------------------------- + + protected: + //! Get the access mode of the node + virtual EAccessMode InternalGetAccessMode() const; + + //------------------------------------------------------------- + // IRegister implementation + //------------------------------------------------------------- + + //! Set the register's contents + virtual void InternalSet(const uint8_t *pBuffer, int64_t Length); + + //! Retrieves a pointer to a buffer containing the reigster's contents + virtual void InternalGet(uint8_t *ppBuffer, int64_t pLength) ; + + //! Retrieves the Length of the register [Bytes] + virtual int64_t InternalGetLength(); + + //! Retrieves the Address of the register + virtual int64_t InternalGetAddress(); + public: + //------------------------------------------------------------- + // Initializing + //------------------------------------------------------------- + + BEGIN_CONVERT_MAP + CONVERT_LIST_ENTRY(Address, m_AddressValues, int64_t) + CONVERT_NODE_REFERENCE(pLength, m_pLength, IInteger) + CONVERT_ENTRY(Length, m_Length) + CONVERT_NODE_REFERENCE(pPort, m_pPort, CPort) + CONVERT_ENUM_ENTRY(AccessMode, m_AccessMode, EAccessModeClass) + CONVERT_NODELIST_REFERENCE(pAddress, m_AddressPointers, IValue, ValueList_t) + CONVERT_INVALIDATOR( pInvalidator ) + CONVERT_NODELIST_REFERENCE_AUX(pIndex, m_IndexPointers, IInteger, m_IndexOffset, int64_t) + CHAIN_CONVERT_MAP(CNodeImpl) + END_CONVERT_MAP + + protected: + //! Recomputes the Address + void UpdateAddress(); + + //! Gets the buffer; if required (re-)allocates memory + uint8_t* GetBuffer(); + + //------------------------------------------------------------- + // Member variables + //------------------------------------------------------------- + + //! pointer to Port node providing access to the port + CPort *m_pPort; + + //! Address of the register + int64_t m_Address; + + //! Length of the register + int64_t m_Length; + + //! Pointer to a node providing the length of the register + IInteger *m_pLength; + + //! Buffer the register's content is cached in + uint8_t *m_pBuffer; + + //! List of references to nodes which may invalidate this node + NodeList_t m_Invalidators; + + //! List of addresses/offsets + Int64List_t m_AddressValues; + + //! List of node refererences giving addresses/offsets + ValueList_t m_AddressPointers; + + //! List of node refererences giving addresses/offsets + EnumIntList_t m__AddressPointers; + + //! List of node refererences giving idices/offsets + IntegerList_t m_IndexPointers; + + //! List of node refererences giving offsets for the ideces + Int64List_t m_IndexOffset; + + //! the access mode + EAccessMode m_AccessMode; + }; + + + +class GENAPI_DECL CRegister + : public NodeT< RegisterT < ValueT < BaseT < CRegisterImpl > > > > +{}; + + +} + +#ifdef _MSC_VER // *JS* +#pragma warning ( pop ) +#endif + +#endif // ifndef GENAPI_REGISTER_H diff --git a/thirdparty/GenICam/include/GenApi/impl/RegisterT.h b/thirdparty/GenICam/include/GenApi/impl/RegisterT.h new file mode 100644 index 0000000..4789a9e --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/RegisterT.h @@ -0,0 +1,174 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Alexander Happe +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/RegisterT.h,v 1.9 2007/08/16 13:56:26 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of the RegisterT class template +*/ + +#ifndef GENAPI_REGISTERT_H +#define GENAPI_REGISTERT_H + +#include "../IRegister.h" +namespace GenApi +{ + + /** + \brief Implementation of the IRegister interface + */ + template + class GENAPI_DECL RegisterT + : public Base + { + public: + + //! Implementation of IRegister::Set() + virtual void Set(const uint8_t *pBuffer, int64_t Length) + { + AutoLock l(Base::GetLock()); + + #ifdef LOG4C + Counter& c(Base::GetBathometer()); + if( 0 == c ) + Base::m_pValueLog->info(">>>>" ); + + { + static const char fmt[] = +#ifdef _MSC_VER + "Set( %I64d, 0x"; +#else + "Set( %lld, 0x"; +#endif + static const int BufferLen(256); + char _pBuffer[256]; + int BufferLeft(_snprintf(_pBuffer, BufferLen, fmt, Length)); + + /* MANTIS 0000062 */ + for(int i = 0; i < Length; i++) + { + const int n =_snprintf(_pBuffer + BufferLeft, + BufferLen - BufferLeft, + "%02X", (unsigned int) pBuffer[i]); + +#ifdef _MSC_VER + if (n < 0) +#else + if (BufferLeft + n >= BufferLen) +#endif + break; + + BufferLeft += n; + } + + Base::m_pValueLog->info("%s )", _pBuffer); + } + #endif + + { + typename Base::PostSetValueFinalizer PostSetValueCaller(this); // dtor calls Base::PostSetValue + + Base::PreSetValue(); // invalidates all nodes if this is the first call in a chain of SetValue like calls + Base::InternalSet(pBuffer, Length); + + // now Base::PostSetValue is called by ~PostSetValueFinalizer, i.e. updates are fired + // if this is the call on the top of a chain of SetValue calls + } + + + + + #ifdef LOG4C + if( 0 == c ) + Base::m_pValueLog->info("<<<<" ); + #endif + + } + + + //! Implementation of IRegister::Get() + virtual void Get(uint8_t *pBuffer, int64_t Length) + { + AutoLock l(Base::GetLock()); + + #ifdef LOG4C + Base::m_pValueLog->info("Get..."); + #endif + + Base::InternalGet(pBuffer, Length); + + #ifdef LOG4C + { + static const char fmt[] = +#ifdef _MSC_VER + "...Get( %I64d ) = 0x"; +#else + "...Get( %lld ) = 0x"; +#endif + + + static const int BufferLen(256); + char _pBuffer[256]; + int BufferLeft(_snprintf(_pBuffer, BufferLen, fmt, Length)); + + /* MANTIS 0000062 */ + for(int i = 0; i < Length; i++) + { + const int n = _snprintf(_pBuffer + BufferLeft, + BufferLen - BufferLeft, + "%02X", (unsigned int) pBuffer[i]); +#ifdef _MSC_VER + if (n < 0) +#else + if (BufferLeft + n >= BufferLen) +#endif + break; + + BufferLeft += n; + } + Base::m_pValueLog->info("%s", _pBuffer); + } + #endif + } + + //! Implementation of IRegister::GetLength() + virtual int64_t GetLength() + { + AutoLock l(Base::GetLock()); + + return Base::InternalGetLength(); + } + + //! Retrieves the Address of the register + virtual int64_t GetAddress() + { + AutoLock l(Base::GetLock()); + + return Base::InternalGetAddress(); + } + + }; + +} // namespace GenApi + +#endif // GENAPI_REGISTERT_H diff --git a/thirdparty/GenICam/include/GenApi/impl/SimpleString.h b/thirdparty/GenICam/include/GenApi/impl/SimpleString.h new file mode 100644 index 0000000..ca3872f --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/SimpleString.h @@ -0,0 +1,118 @@ + +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Hartmut Nebelung +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/SimpleString.h,v 1.9 2007/05/08 16:24:12 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Interface to the CStringRegister class. +*/ + +#ifndef GENAPI_STRINGREGISTER_H +#define GENAPI_STRINGREGISTER_H + +#if _MSC_VER>1000 + #pragma once +#endif // _MSC_VER>1000 + +#include +#include +#include +#include +#include +#include +#include + +#pragma warning ( push ) +#pragma warning ( disable : 4275 ) // non dll-interface XXX used as base for dll-interface class YYY + +//! Part of the generic device API +namespace GenApi +{ + // ************************************************************* + // CStringRegister class + // ************************************************************* + //! Implements a simple string register + /** + * + * \todo constants length,... + */ + class GENAPI_DECL CStringRegisterImpl : public CRegisterImpl, public IString + { + public: + CStringRegisterImpl(void); + + + //------------------------------------------------------------- + // Implementation of INodePrivate + //------------------------------------------------------------- + //! \name INodePrivate implementation + //\{ + virtual void FinalConstruct(); + //\} + protected: + //------------------------------------------------------------- + // Implementation of IValue + //------------------------------------------------------------- + //! \name IValue implementation + //\{ + virtual GenICam::gcstring InternalToString(bool Verify = false); + //! Set value of the node as string + virtual void InternalFromString(const GenICam::gcstring& valueString, bool Verify = true); + //\} + + //------------------------------------------------------------- + // Implementation of IString + //------------------------------------------------------------- + //! \name IString implementation + //\{ + + // Set node value + virtual void InternalSetValue(const GenICam::gcstring& Value, bool Verify = true); + + // Get node value + virtual GenICam::gcstring InternalGetValue(bool Verify = false); + //\} + + public: + //------------------------------------------------------------- + // Initializing + //------------------------------------------------------------- + BEGIN_CONVERT_MAP + //CONVERT_NODE_REFERENCE(pLength, m_pLength_by, IInteger) + CHAIN_CONVERT_MAP(CRegisterImpl) + END_CONVERT_MAP + private: + //IInteger* m_pLength_by; + }; + + + class GENAPI_DECL CStringRegister : public BaseT< ValueT< NodeT< StringT< RegisterT< CStringRegisterImpl > > > > > + { + }; + +} + +#pragma warning ( pop ) + +#endif // GENAPI_STRINGREGISTER_H diff --git a/thirdparty/GenICam/include/GenApi/impl/SmartFeature.h b/thirdparty/GenICam/include/GenApi/impl/SmartFeature.h new file mode 100644 index 0000000..1cfd4e3 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/SmartFeature.h @@ -0,0 +1,162 @@ + +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Hartmut Nebelung +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/SmartFeature.h,v 1.9 2007/08/16 13:56:26 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Interface to the CSmartFeature class. +*/ + +#ifndef GENAPI_SMARTFEATURE_H +#define GENAPI_SMARTFEATURE_H +#if _MSC_VER>1000 +#pragma once +#endif // _MSC_VER>1000 + +#include "../Types.h" +#include "../IInteger.h" +#include "Register.h" +#include "BaseT.h" +#include "ValueT.h" +#include "NodeT.h" +#include "IntegerT.h" + + +//! Part of the generic device API +namespace GenApi +{ +#pragma warning( push ) +#pragma warning( disable:4275 ) + // ************************************************************* + // CSmartFeature class + // ************************************************************* + //! Implements the Basler Smart Feature class + /** + * Intention is to use this class in pIsAvailable and pIsImplemented + * elements where the GetValue method is called in a boolean sense. + * But also to use it as an address register. + * + */ + class GENAPI_DECL CSmartFeatureImpl : public CRegisterImpl, public IInteger + { + public: + CSmartFeatureImpl(void); + + protected: + //------------------------------------------------------------- + // Implementation of IRegister + //------------------------------------------------------------- + //!\name GenApi::IRegister implementation + //{ + // Write silently to Register + virtual void InternalSet(const uint8_t *pBuffer, int64_t Length); + + // Read with private caching + virtual void InternalGet(uint8_t *pBuffer, int64_t Length); + //} + //------------------------------------------------------------- + // Implementation of IInteger + //------------------------------------------------------------- + //!\name GenApi::IInteger implementation + //{ + // Set feature value + virtual void InternalSetValue(int64_t /*Value*/, bool /*Verify = true*/) + { + } + + // Get feature value + virtual int64_t InternalGetValue(bool Verify = false); + + // Get minimum value allowed + virtual int64_t InternalGetMin() const; + + // Get maximum value allowed + virtual int64_t InternalGetMax() const; + + // Get increment + virtual int64_t InternalGetInc() const; + + // Get recommended representation + virtual ERepresentation InternalGetRepresentation() const + { + return _UndefindedRepresentation; + } + //\} + //------------------------------------------------------------- + // Implementation of INode + //------------------------------------------------------------- + //! \name INode implementation + // \{ + virtual EAccessMode InternalGetAccessMode() const; + // \} + + //------------------------------------------------------------- + // Implementation of IValue + //------------------------------------------------------------- + //! \name IValue implementation + // \{ + + //Get content of the node as string + virtual GenICam::gcstring InternalToString(bool Verify = false); + //Set content of the node as string + virtual void InternalFromString(const GenICam::gcstring& ValueStr, bool Verify = true) const; + + // \} + + + //------------------------------------------------------------- + // Implementation of INodePrivate + //------------------------------------------------------------- + //! \name INodePrivate implementation + // \{ + virtual bool IsTerminalNode() const; + + + //------------------------------------------------------------- + // Implementatin of CNodeImpl + //------------------------------------------------------------- + //\{ \n CNodeImpl overrides + virtual void SetInvalid(INodePrivate::ESetInvalidMode simMode); + //\} + + public: + //------------------------------------------------------------- + // Initializing + //------------------------------------------------------------- + BEGIN_CONVERT_MAP + CONVERT_ENTRY(FeatureID, m_FeatureID) + CHAIN_CONVERT_MAP(CRegisterImpl) + END_CONVERT_MAP + private: + GUID m_FeatureID; + uint64_t m_SmartFeatureAdr; + bool m_Valid; + }; + + class CSmartFeature : public BaseT< ValueT< NodeT< IntegerT< RegisterT< CSmartFeatureImpl > > > > > + { + }; +#pragma warning( pop ) +} +#endif // GENAPI_SMARTFEATURE_H diff --git a/thirdparty/GenICam/include/GenApi/impl/StringT.h b/thirdparty/GenICam/include/GenApi/impl/StringT.h new file mode 100644 index 0000000..f13b38e --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/StringT.h @@ -0,0 +1,114 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Alexander Happe +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/StringT.h,v 1.9 2007/08/16 13:56:26 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of the NodeT class template +*/ + +#ifndef GENAPI_STRINGT_H +#define GENAPI_STRINGT_H + +#include "../IString.h" + +namespace GenApi +{ + + /** + \brief Implementation of the IString interface + */ + template< class Base > + class GENAPI_DECL StringT : public Base + { + public: + //! Set node value + virtual void SetValue(const GenICam::gcstring& Value, bool Verify = true) + { + AutoLock l(Base::GetLock()); + + #ifdef LOG4C + Counter& c(Base::GetBathometer()); + if( 0 == c ) + Base::m_pValueLog->info(">>>>" ); + + Base::m_pValueLog->info("SetValue = '%s' ", Value.c_str() ); + #endif + + { + typename Base::PostSetValueFinalizer PostSetValueCaller(this); // dtor calls Base::PostSetValue + + Base::PreSetValue(); // invalidates all nodes if this is the first call in a chain of SetValue calls + Base::InternalSetValue(Value, Verify); + + // now Base::PostSetValue is called by ~PostSetValueFinalizer, i.e. updates are fired + // if this is the call on the top of a chain of SetValue calls + } + + #ifdef LOG4C + if( 0 == c ) + Base::m_pValueLog->info("<<<<" ); + #endif + + } + + //! Set node value + virtual IString& operator=(const GenICam::gcstring& Value) + { + SetValue(Value); + return *this; + } + + //! Get node value + virtual GenICam::gcstring GetValue(bool Verify = false) + { + AutoLock l(Base::GetLock()); + + #ifdef LOG4C + Base::m_pValueLog->info("GetValue..."); + #endif + GenICam::gcstring ValueStr(Base::InternalGetValue(Verify)); + #ifdef LOG4C + Base::m_pValueLog->info("...GetValue = %s", ValueStr.c_str() ); + #endif + return ValueStr; + + } + + //! Get node value + virtual GenICam::gcstring operator()() + { + return GetValue(); + } + + //! Get node value + virtual GenICam::gcstring operator*() + { + return GetValue(); + } + + }; + +} + +#endif // GENAPI_STRINGT_H diff --git a/thirdparty/GenICam/include/GenApi/impl/SwissKnife.h b/thirdparty/GenICam/include/GenApi/impl/SwissKnife.h new file mode 100644 index 0000000..5f71481 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/SwissKnife.h @@ -0,0 +1,205 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/SwissKnife.h,v 1.14 2007/12/19 15:00:40 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CSwissKnife +*/ + +#ifndef GENAPI_SWISSKNIFE_H +#define GENAPI_SWISSKNIFE_H + +#include "../IFloat.h" +#include "Node.h" +#include "VariableDelegate.h" +#include "MathParser/MathParser.h" +#include "BaseT.h" +#include "ValueT.h" +#include "NodeT.h" +#include "FloatT.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4275 ) // non dll-interface XXX used as base for dll-interface class YYY + +namespace GenApi +{ + //************************************************************* + // CSwissKnife class + //************************************************************* + + /** + * \ingroup internal_impl + * + * \brief Specialized SwissKnife for float nodes + * + * Used for formula evaluation with ToPhysical + * and FromPhysical childs + */ + class GENAPI_DECL CSwissKnifeImpl : public IFloat, public CNodeImpl + { + public: + //! Constructor + CSwissKnifeImpl(); + + //! Destructor + virtual ~CSwissKnifeImpl(); + + protected: + //------------------------------------------------------------- + // IBase implementation + //------------------------------------------------------------- + + // Get access mode + virtual EAccessMode InternalGetAccessMode() const + { + const EAccessMode mode = CNodeImpl::InternalGetAccessMode(); + const EAccessMode vmode = m_VariableDelegate.GetAccessMode(); + if (mode == NI + #pragma BullseyeCoverage off + || vmode == NI + #pragma BullseyeCoverage on + ) + return m_AccessModeCache = NI; + if (mode == NA + #pragma BullseyeCoverage off + || vmode == NA + #pragma BullseyeCoverage on + ) + return m_AccessModeCache= NA; + else + return m_AccessModeCache = RO; + } + + public: + //------------------------------------------------------------- + // INodePrivate implementation + //------------------------------------------------------------- + + //! finalizes the construction + virtual void FinalConstruct(); + + protected: + //------------------------------------------------------------- + // IFloat implementation + //------------------------------------------------------------- + + // Set feature value + #pragma BullseyeCoverage off + virtual void InternalSetValue(double /*Value*/, bool /*Verify*/ ) + { + throw LOGICAL_ERROR_EXCEPTION("SwissKnife : %s SetValue failed. SwissKnife is read only", m_Name.c_str() ); + } + #pragma BullseyeCoverage on + + // Get feature value + virtual double InternalGetValue(bool Verify = false); + + // Get minimum value allowed + virtual double InternalGetMin() + { + return m_Min; + } + + // Get maximum value allowed + virtual double InternalGetMax() + { + return m_Max; + } + + // Get recommended representation + virtual ERepresentation InternalGetRepresentation() + { + return m_Representation; + } + + // Get unit + virtual GenICam::gcstring InternalGetUnit() const + { + return m_Unit; + } + + public: + //! Get feature value usint m_InputName as hardcoded variable name + /*! This is a helper for the implementation of the converter */ + virtual double _GetValue(double input); + + //! Propagate node dependency + virtual bool PropagateDependency( NodePrivateList_t& Dependents ); + + //------------------------------------------------------------- + // Initializing + //------------------------------------------------------------- + + //! Convert map + BEGIN_CONVERT_MAP + CONVERT_STRING_ENTRY(Formula, m_Formula) + CONVERT_STRING_ENTRY(Input, m_InputName) + ADD_VARIABLE_ENTRY(pVariable, (&m_VariableDelegate)) + CONVERT_ENUM_ENTRY(Representation, m_Representation, ERepresentationClass) + CONVERT_STRING_ENTRY(Unit, m_Unit) + CHAIN_CONVERT_MAP(CNodeImpl) + END_CONVERT_MAP + + protected: + //------------------------------------------------------------- + // Member variables + //------------------------------------------------------------- + + //! minimum value to be stored in the Register + double m_Min; + + //! maximum value to be stored in the Register + double m_Max; + + //! the Swiss Knife formula + GenICam::gcstring m_Formula; + + //! A hardcoded variable name + /*! This is a helper for the implementation of the converter */ + GenICam::gcstring m_InputName; + + //! Object holding the input values + CVariableDelegate m_VariableDelegate; + + //! The math parser doing all the work + CMathParser m_MathParser; + + //! the node's representation + ERepresentation m_Representation; + + //! the physical unit name + GenICam::gcstring m_Unit; + + + }; + + class CSwissKnife : public BaseT< ValueT< NodeT< FloatT< CSwissKnifeImpl > > > > + { + }; + +} + +#pragma warning ( pop ) + +#endif // GENAPI_SWISSKNIFE_H diff --git a/thirdparty/GenICam/include/GenApi/impl/SwissKnifeT.h b/thirdparty/GenICam/include/GenApi/impl/SwissKnifeT.h new file mode 100644 index 0000000..951a833 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/SwissKnifeT.h @@ -0,0 +1,50 @@ +//----------------------------------------------------------------------------- +// (c) 2005 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/SwissKnifeT.h,v 1.3 2006/07/18 13:31:53 rueder Exp $ +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of the SwissknifeT class template +*/ + +#ifndef GENAPI_SWISSKNIFET_H +#define GENAPI_SWISSKNIFET_H + +namespace GenApi +{ + /** + \brief Implementation of the SwissKnife Interface + */ + template + class GENAPI_DECL SwissKnifeT : public Base + { + public: + + + //! Implementation of SwissKnife::GetValue(double value) + virtual double _GetValue(double value) + { + AutoLock l(Base::GetLock()); + + #ifdef LOG4C + m_pValueLog->info("_GetValue(value)..."); + #endif + double Value = Base::_GetValue(value); + #ifdef LOG4C + m_pValueLog->info("...GetValue(value) = %f", Value ); + #endif + return Value; + + } + + + }; + + + +} + +#endif \ No newline at end of file diff --git a/thirdparty/GenICam/include/GenApi/impl/Txtkey.h b/thirdparty/GenICam/include/GenApi/impl/Txtkey.h new file mode 100644 index 0000000..9096a0a --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/Txtkey.h @@ -0,0 +1,139 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Hartmut Nebelung +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/Txtkey.h,v 1.10 2007/08/14 13:21:01 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CTxtKey +*/ + +#ifndef GENAPI_TXTKEY_H +#define GENAPI_TXTKEY_H + +#include "../IString.h" +#include "IEEE1212Parser.h" +#include "Node.h" +#include "BaseT.h" +#include "ValueT.h" +#include "StringT.h" +#include "NodeT.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4275 ) // non dll-interface XXX used as base for dll-interface class YYY + +namespace GenApi +{ + //************************************************************* + // CTxtKey class + //************************************************************* + + /** + * \ingroup internal_impl + * + * \brief IString implementation for IEEE1212 string entries + * + * + */ + class GENAPI_DECL CTxtKeyImpl : public IString, public CNodeImpl + { + public: + //! Constructor + CTxtKeyImpl(); + + + protected: + //------------------------------------------------------------- + // IValue implementation + //------------------------------------------------------------- + //! Set content of the node as string + #pragma BullseyeCoverage off + virtual void InternalFromString(const GenICam::gcstring& ValueStr, bool /*Verify*/) + { + //assert(false); + throw LOGICAL_ERROR_EXCEPTION("NodeImpl %s can't set value from string : %s. Use derived class!", m_Name.c_str(), ValueStr.c_str() ); + } + #pragma BullseyeCoverage on + + //! Get value of the node as string + virtual GenICam::gcstring InternalToString(bool Verify = false); + + virtual EAccessMode InternalGetAccessMode() const; + + + //------------------------------------------------------------- + // INodePrivate implementation + //------------------------------------------------------------- + + public: + //! Initializes the object + virtual void FinalConstruct(); + + //------------------------------------------------------------- + // IString implementation + //------------------------------------------------------------- + protected: + //! Set node value + virtual void InternalSetValue(const GenICam::gcstring& Value, bool /*Verify = true*/){ + // assert(false); + throw ACCESS_EXCEPTION("TxtKey : %s SetValue to %s failed. TxtKey is read only", m_Name.c_str(),Value.c_str() ); + } + + //! Get node value + virtual GenICam::gcstring InternalGetValue(bool Verify = false); + + public: + //------------------------------------------------------------- + // Initializing + //------------------------------------------------------------- + BEGIN_CONVERT_MAP + CONVERT_ENTRY(Key, m_Key) + CONVERT_NODE_REFERENCE( p1212Parser, m_pParser, CIEEE1212Parser ) + CHAIN_CONVERT_MAP(CNodeImpl) + END_CONVERT_MAP + + protected: + // inititialize when childs are initialized + //------------------------------------------------------------- + // Memeber variables + //------------------------------------------------------------- + + + //! Key of IEEE1212 Configuration Rom entry + uint16_t m_Key; + + //! most recent Value + GenICam::gcstring m_Value; + + //! The config rom reader + CIEEE1212Parser *m_pParser; + }; + + class CTxtKey : public BaseT< ValueT< NodeT< StringT< CTxtKeyImpl > > > > + { + }; + +} + +#pragma warning ( pop ) + +#endif // GENAPI_TXTKEY_H diff --git a/thirdparty/GenICam/include/GenApi/impl/Value2String.h b/thirdparty/GenICam/include/GenApi/impl/Value2String.h new file mode 100644 index 0000000..3c73df6 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/Value2String.h @@ -0,0 +1,122 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/Value2String.h,v 1.11 2007/11/13 19:41:06 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of value2string and string2value functions +*/ + +#ifndef GENAPI_VALUE2STRING_H +#define GENAPI_VALUE2STRING_H + +#include +#include +#include + +#include +#include "../GenApiDll.h" +#include "Compatibility.h" + + +namespace GenApi +{ + //! Dump a value container into a string + template< typename T > + void Values2String(const T & Values, GenICam::gcstring &ValueStr) + { + std::ostringstream s; + typename T::const_iterator it(Values.begin()); + if (it != Values.end()) + s << *it++; + while (it != Values.end()) + s << "\t" << *it++ ; + + ValueStr = s.str().c_str(); + } + + //! Converts an T property to a string + template< typename T > + void Value2String(T Value, GenICam::gcstring &ValueStr) + { + static const int precision(36); // For the MS STL, values > 36 ( == _MAX_SIG_DIG ) are leading to trailing zeroes + std::ostringstream s; + s << std::setprecision( precision ) << Value; + ValueStr = s.str().c_str(); + } + + //! Converts a string to an T property + template< typename T > + bool String2Value(const GenICam::gcstring &ValueStr, T* Value) + { + std::istringstream s(ValueStr.c_str()); + if( ValueStr.length() > 2 + && (ValueStr[0] == '0' && (ValueStr[1] == 'x' || ValueStr[1] == 'X') )) + { + s.ignore( 2 ); + s >> std::hex >> *Value; + } + else + s >> *Value; + + bool b = (! s.fail()); + return b; + } + + //! Converts a string to a GUID property + GENAPI_DECL bool String2Value(const GenICam::gcstring &ValueStr, GUID* Value); + + //! Converts a GUID property tp a string + GENAPI_DECL void Value2String(GUID &Value, GenICam::gcstring &ValueStr); + + //! Converts a byte array property to a string + GENAPI_DECL void Value2String(uint8_t *pValue, GenICam::gcstring &ValueStr, int64_t len); + + //! Converts a string to a byte array + GENAPI_DECL bool String2Value(const GenICam::gcstring &ValueStr, uint8_t *pValue, int64_t len); + + //! Convertrs a string to a bool value + GENAPI_DECL bool String2Value( const GenICam::gcstring &ValueStr, bool* pValue ); + + //! Converts an ASCII hex digit to a char value + #pragma BullseyeCoverage off + inline char Hex2Byte(uint8_t Hex) + { + if( 0x30 <= Hex && Hex <= 0x39 ) + return Hex - 0x30; + else if( 0x41 <= Hex && Hex <= 0x46 ) + return Hex - 0x41 + 0x0a; + else if( 0x61 <= Hex && Hex <= 0x66 ) + return Hex - 0x61 + 0x0a; + else + { + assert(false); + return '0'; + } + } + #pragma BullseyeCoverage on + + + +} +#endif // ifndef GENAPI_VALUE2STRING_H diff --git a/thirdparty/GenICam/include/GenApi/impl/ValueCache.h b/thirdparty/GenICam/include/GenApi/impl/ValueCache.h new file mode 100644 index 0000000..e9c43cd --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/ValueCache.h @@ -0,0 +1,84 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Hartmut Nebelung +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/ValueCache.h,v 1.6 2007/08/14 13:21:01 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CValueCache +*/ + +#ifndef GENAPI_VALUECACHE_H +#define GENAPI_VALUECACHE_H + +#include "../Synch.h" +#include "../Types.h" + +namespace GenApi +{ + struct CValueCacheImpl; + + /** + * \ingroup internal_impl + * + * \brief Cache for Registervalues + */ + class CValueCache : public LockableObject< CValueCache, ThreadingModel > + { + public: + CValueCache(); + ~CValueCache(); + + /// Look up a value + void GetValue( int64_t Address, uint32_t Size, void *pValue ) const; + + /// Enter a new value + void SetValue( int64_t Address, uint32_t Size, const void *pValue ); + + /// Invalidate a value + void InvalidateValue( int64_t Address ); + + /// Query whether value is valid + bool IsValueValid( int64_t Address ) const; + + /// Query wheher value is implemented + //bool IsValuePresent( int64_t Address ) const; + + /// Clear all entries + //void ClearAllEntries(); + + private: + /// not implemented: copy constructor + CValueCache( const CValueCache& ); + + /// not implmeneted: assignment operator + CValueCache& operator=( const CValueCache& ); + + private: + + CValueCacheImpl* m_pImpl; + }; +}; + +#endif // GENAPI_VALUECACHE_H + + diff --git a/thirdparty/GenICam/include/GenApi/impl/ValueNode.h b/thirdparty/GenICam/include/GenApi/impl/ValueNode.h new file mode 100644 index 0000000..af0fb44 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/ValueNode.h @@ -0,0 +1,85 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/ValueNode.h,v 1.8 2007/08/14 13:21:01 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CValueNode +*/ + +#ifndef GENAPI_VALUENODE_H +#define GENAPI_VALUENODE_H + +#include "../IValue.h" +#include "Node.h" +#include "ValueT.h" +#include "BaseT.h" +#include "NodeT.h" + +#pragma warning ( push ) +#pragma warning ( disable : 4275 ) // non dll-interface XXX used as base for dll-interface class YYY + +namespace GenApi +{ + + class GENAPI_DECL CValueNodeImpl : public CNodeImpl, virtual public IValue + { + protected: + + //------------------------------------------------------------- + // IValue implementation + //------------------------------------------------------------- + + //! Get content of the node as string + virtual GenICam::gcstring InternalToString(bool Verify = false); + + //! Set content of the node as string + virtual void InternalFromString(const GenICam::gcstring& ValueStr, bool Verify = true); + + //------------------------------------------------------------- + // INodePrivate implementation + //------------------------------------------------------------- + virtual bool IsTerminalNode() const { return true; } + + + + protected: + //! Dummy value + GenICam::gcstring m_Value; + }; + + //************************************************************* + // CValueNode class + //************************************************************* + + //! Generic Node with dummy IValue implementation + /*! This node type is required for testing */ + + class GENAPI_DECL CValueNode : public BaseT< ValueT< NodeT < CValueNodeImpl > > > + { + }; + +} +#pragma warning ( pop ) + +#endif // ifndef GENAPI_VALUENODE_H diff --git a/thirdparty/GenICam/include/GenApi/impl/ValueT.h b/thirdparty/GenICam/include/GenApi/impl/ValueT.h new file mode 100644 index 0000000..9559751 --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/ValueT.h @@ -0,0 +1,108 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Alexander Happe +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/ValueT.h,v 1.11.2.1 2008/07/14 08:18:26 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of the ValueT class template +*/ + +#ifndef GENAPI_VALUET_H +#define GENAPI_VALUET_H + +#include "../IValue.h" +#include + + + +namespace GenApi +{ + + /** + \brief Implementation of the IValue interface + */ + template< class Base> + class GENAPI_DECL ValueT + : public Base + { + public: + + //! Implementation of IValue::ToString() + virtual GenICam::gcstring ToString(bool Verify = false) + { + AutoLock l(Base::GetLock()); + + #ifdef LOG4C + Base::m_pValueLog->info("ToString..."); + #endif + GenICam::gcstring ValueStr = Base::InternalToString(Verify); + #ifdef LOG4C + Base::m_pValueLog->info("...ToString = %s", ValueStr.c_str() ); + #endif + return ValueStr; + } + + //! Implementation of IValue::FromString() + virtual void FromString(const GenICam::gcstring& ValueStr, bool Verify = true) + { + AutoLock l(Base::GetLock()); + + #ifdef LOG4C + Counter& c(Base::GetBathometer()); + #pragma BullseyeCoverage off + if( 0 == c ) + Base::m_pValueLog->info(">>>>" ); + #pragma BullseyeCoverage on + + Base::m_pValueLog->info("FromString = '%s' ", ValueStr.c_str() ); + #endif + + if( Verify ) + { + if( !IsWritable( this ) ) + throw ACCESS_EXCEPTION("Node is not writable"); + } + + + { + typename Base::PostSetValueFinalizer PostSetValueCaller(this); // dtor calls Base::PostSetValue + + Base::PreSetValue(); // invalidates all nodes if this is the first call in a chain of SetValue-like calls + Base::InternalFromString(ValueStr, Verify); + + // now Base::PostSetValue is called by ~PostSetValueFinalizer, i.e. updates are fired + // if this is the call on the top of a chain of SetValue calls + } + + #ifdef LOG4C + if( 0 == c ) + Base::m_pValueLog->info("<<<<" ); + #endif + + } + + }; + +} // namespace GenApi + +#endif // GENAPI_VALUET_H diff --git a/thirdparty/GenICam/include/GenApi/impl/VariableDelegate.h b/thirdparty/GenICam/include/GenApi/impl/VariableDelegate.h new file mode 100644 index 0000000..b1137be --- /dev/null +++ b/thirdparty/GenICam/include/GenApi/impl/VariableDelegate.h @@ -0,0 +1,105 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Margret Albrecht +// $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/impl/VariableDelegate.h,v 1.12 2007/11/13 19:41:06 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief Definition of CVariableDelegate +*/ + +#ifndef GENAPI_VARIABLEDELEGATE_H +#define GENAPI_VARIABLEDELEGATE_H + +#include "../GenApiDll.h" +#include "Node.h" + +#include + +#ifdef _MSC_VER // *JS* +#pragma warning(push) +#pragma warning(disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of class 'yyy' +#endif + +namespace GenApi +{ + + class CNodeMap; + + // + //************************************************************* + // VariableDelegate class + //************************************************************* + /** + * \ingroup internal_impl + * + * \brief Mapping of variable names to values + */ + class GENAPI_DECL CVariableDelegate + { + public: + //! mapping of variable names to values + typedef std::map< GenICam::gcstring, INode* > Name2pValue_t; + + //! Default Constructor + CVariableDelegate(); + + //! Default Destructor + virtual ~CVariableDelegate() {} + + //------------------------------------------------------------- + // IValue implementation + //------------------------------------------------------------- + + //! Get value of all variables as cobined string + virtual GenICam::gcstring ToString(); + + //------------------------------------------------------------- + // IBase implementation + //------------------------------------------------------------- + //! Get the access mode of the node + virtual EAccessMode GetAccessMode() const; + + //! Gets the Value of the Varaible with the given Name + virtual bool GetValue(const GenICam::gcstring &nameStr, int64_t * value, bool Verify = false); + + //! Gets the Value of the Varaible with the given Name + virtual bool GetValue(const GenICam::gcstring &nameStr, double * value, bool Verify = false); + + //! Inserts a variable in the variable map + virtual bool AddEntry(const GenICam::gcstring &Value, const GenICam::gcstring &Symbolic, const GenICam::gcstring &parentName, INodeMapPrivate * pNodeMap); + + //! Gets Variables and attributes added to the map + virtual void GetVariablesAndAttributes(GenICam::gcstring &Variables, GenICam::gcstring &Attributes); + + public: + //! Map holding pointers to Values keyed with the variable name + Name2pValue_t m_Map; + + }; +}; + +#ifdef _MSC_VER // *JS* +#pragma warning(pop) +#endif + +#endif // ifndef GENAPI_VARIABLEDELEGATE_H diff --git a/thirdparty/GenICam/include/GenICam.h b/thirdparty/GenICam/include/GenICam.h new file mode 100644 index 0000000..88d75ca --- /dev/null +++ b/thirdparty/GenICam/include/GenICam.h @@ -0,0 +1,39 @@ +/**************************************************************************** + (c) 2005 by STEMMER IMAGING + + License: This file is published under the license of the EMVA GenICam Standard Group. + A text file describing the legal terms is included in your installation as 'license.txt'. + If for some reason you are missing this file please contact the EMVA or visit the website + (http://www.genicam.org) for a full copy. + + THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +****************************************************************************/ + + /// \file $Source: /cvs/genicam/genicam/library/CPP/include/GenICam.h,v $ + /// \brief Common GenICam include file. + /// \version $Revision: 1.5.2.1 $ + /// \date $Date: 2009/02/02 13:27:34 $ + + +#ifndef GENICAM_OVERALL_H +#define GENICAM_OVERALL_H + +#if defined (_WIN32) || defined (__unix__) +# include "Base/GCBase.h" +# include "GenApi/GenApi.h" +#else +# error Unknown/unsupported platform +#endif + +#endif // GENICAM_OVERALL_H diff --git a/thirdparty/GenICam/include/GenICamVersion.h b/thirdparty/GenICam/include/GenICamVersion.h new file mode 100644 index 0000000..1ed686d --- /dev/null +++ b/thirdparty/GenICam/include/GenICamVersion.h @@ -0,0 +1,49 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenICam +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/GenICamVersion.h,v 1.1 2007/11/14 12:35:43 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief central versioning counters +*/ + +#ifndef GENICAM_VERSION_H +#define GENICAM_VERSION_H + + +// Includes a machine generated file containing the version and build number +// The version numbers come from $(GENICAM_ROOT)/SetGenICamVersion.cmd +#include "_GenICamVersion.h" + +// Don't ask... +#define STRINGIFY(x) #x +#define TOSTRING(x) STRINGIFY(x) + +// String versions of the version numbers +#define GENICAM_VERSION_MAJOR_STR TOSTRING( GENICAM_VERSION_MAJOR ) +#define GENICAM_VERSION_MINOR_STR TOSTRING( GENICAM_VERSION_MINOR ) +#define GENICAM_VERSION_SUBMINOR_STR TOSTRING( GENICAM_VERSION_SUBMINOR ) +#define GENICAM_VERSION_BUILD_STR TOSTRING( GENICAM_VERSION_BUILD ) +#define GENICAM_ROOT_VERSION "GENICAM_ROOT_V" GENICAM_VERSION_MAJOR_STR "_" GENICAM_VERSION_MINOR_STR + +#endif // GENICAM_VERSION_H diff --git a/thirdparty/GenICam/include/Log/CLog.h b/thirdparty/GenICam/include/Log/CLog.h new file mode 100644 index 0000000..ed145ec --- /dev/null +++ b/thirdparty/GenICam/include/Log/CLog.h @@ -0,0 +1,101 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/Log/CLog.h,v 1.7 2007/08/16 13:56:43 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/** +\file +\brief Implementation of CLog. +\ingroup Log_PublicUtilities +*/ + +#ifndef DEF_CLOG_H_ +#define DEF_CLOG_H_ + +#pragma warning (push, 3) + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined (_WIN32) + #include + #include +#elif defined (__GNUC__) && defined (__unix__) + #include +#endif + #include +#pragma warning (pop) + +#include "LogDll.h" +#include +#include + + +namespace GenICam +{ + + /** + \brief Helper class encapsualting log4cpp + \ingroup Log_PublicUtilities + */ + class LOG_DECL CLog + { + public: + //! Retrieves the root category + static log4cpp::Category& GetRootLogger( void ); + + //! REtrieves (and if necessary create) a category by name + static log4cpp::Category& GetLogger( const GenICam::gcstring &LoggerName ); + + //! Push nested diagnostic context + static void PushNDC( const GenICam::gcstring &ContextName ); + + //! Pop nested diagnostic context + static void PopNDC( void ); + + //! initilizes log4cpp + static void Initialize( void ); + + //! de-initializes log4cpp + static void ShutDown( void ); + + //! Configures log4cpp to output messages >=ERROR on the Windows debug console + static void ConfigureDefault(); + + //! Configures log4cpp from a file + static bool ConfigureFromFile( const GenICam::gcstring &FileName ); + + //! Configures log4cpp from a file whose name is given by the environment variable GENICAM_LOG_CONFIG + static bool ConfigureFromEnvironment( void ); + + //! Configures log4cpp from a string + static bool ConfigureFromString( const GenICam::gcstring &ConfigData ); + }; + +} + +#endif // DEF_CLOG_H_ diff --git a/thirdparty/GenICam/include/Log/LogDll.h b/thirdparty/GenICam/include/Log/LogDll.h new file mode 100644 index 0000000..078bc7f --- /dev/null +++ b/thirdparty/GenICam/include/Log/LogDll.h @@ -0,0 +1,51 @@ +//----------------------------------------------------------------------------- +// (c) 2006 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +// $Header: /cvs/genicam/genicam/library/CPP/include/Log/LogDll.h,v 1.6 2007/08/16 13:56:43 hartmut_nebelung Exp $ +// +// License: This file is published under the license of the EMVA GenICam Standard Group. +// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. +// If for some reason you are missing this file please contact the EMVA or visit the website +// (http://www.genicam.org) for a full copy. +// +// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +//----------------------------------------------------------------------------- +/*! +\file +\brief declspec's to be used for Log Windows dll +\ingroup GenApi_PublicImpl +*/ + +#if ! defined (LOGDLL_H) +#define LOGDLL_H + +#if defined(_MSC_VER) +# pragma once +# ifdef LOG_EXPORTS +# define LOG_DECL __declspec(dllexport) +# else +# define LOG_DECL __declspec(dllimport) +# endif +#elif defined (__GNUC__) && defined (__ELF__) +# ifdef LOG_EXPORTS +# define LOG_DECL __attribute__((visibility("default"))) +# else +# define LOG_DECL +# endif +#else +# define LOG_DECL +#endif + +#endif /* ! defined (LOGDLL_H) */ diff --git a/thirdparty/GenICam/include/_GenICamVersion.h b/thirdparty/GenICam/include/_GenICamVersion.h new file mode 100644 index 0000000..8319d0e --- /dev/null +++ b/thirdparty/GenICam/include/_GenICamVersion.h @@ -0,0 +1,7 @@ +// This file is generated automatically. Do not modify! +#define GENICAM_VERSION_MAJOR 1 +#define GENICAM_VERSION_MINOR 1 +#define GENICAM_VERSION_SUBMINOR 2 +#define GENICAM_VERSION_BUILD 0 +#define GENICAM_VERSION_PRERELEASE 1 +#define GENICAM_VERSION_PRIVATEBUILD 0 diff --git a/thirdparty/GenICam/lib64/genapi/generic/xmlloader-1.1.so b/thirdparty/GenICam/lib64/genapi/generic/xmlloader-1.1.so new file mode 100755 index 0000000..9cc80c1 Binary files /dev/null and b/thirdparty/GenICam/lib64/genapi/generic/xmlloader-1.1.so differ diff --git a/thirdparty/GenICam/lib64/genapi/generic/xmlloader.so b/thirdparty/GenICam/lib64/genapi/generic/xmlloader.so new file mode 120000 index 0000000..90a5861 --- /dev/null +++ b/thirdparty/GenICam/lib64/genapi/generic/xmlloader.so @@ -0,0 +1 @@ +xmlloader-1.1.so \ No newline at end of file diff --git a/thirdparty/GenICam/lib64/libgenicam_api-1.1.so b/thirdparty/GenICam/lib64/libgenicam_api-1.1.so new file mode 100755 index 0000000..84eb4e8 Binary files /dev/null and b/thirdparty/GenICam/lib64/libgenicam_api-1.1.so differ diff --git a/thirdparty/GenICam/lib64/libgenicam_api.so b/thirdparty/GenICam/lib64/libgenicam_api.so new file mode 120000 index 0000000..5b58223 --- /dev/null +++ b/thirdparty/GenICam/lib64/libgenicam_api.so @@ -0,0 +1 @@ +libgenicam_api-1.1.so \ No newline at end of file diff --git a/thirdparty/GenICam/lib64/libgenicam_base-1.1.so b/thirdparty/GenICam/lib64/libgenicam_base-1.1.so new file mode 100755 index 0000000..a141393 Binary files /dev/null and b/thirdparty/GenICam/lib64/libgenicam_base-1.1.so differ diff --git a/thirdparty/GenICam/lib64/libgenicam_base.so b/thirdparty/GenICam/lib64/libgenicam_base.so new file mode 120000 index 0000000..2e1f979 --- /dev/null +++ b/thirdparty/GenICam/lib64/libgenicam_base.so @@ -0,0 +1 @@ +libgenicam_base-1.1.so \ No newline at end of file diff --git a/thirdparty/GenICam/lib64/libgenicam_log-1.1.so b/thirdparty/GenICam/lib64/libgenicam_log-1.1.so new file mode 100755 index 0000000..3f498b6 Binary files /dev/null and b/thirdparty/GenICam/lib64/libgenicam_log-1.1.so differ diff --git a/thirdparty/GenICam/lib64/libgenicam_log.so b/thirdparty/GenICam/lib64/libgenicam_log.so new file mode 120000 index 0000000..c9c8f06 --- /dev/null +++ b/thirdparty/GenICam/lib64/libgenicam_log.so @@ -0,0 +1 @@ +libgenicam_log-1.1.so \ No newline at end of file diff --git a/thirdparty/GenICam/lib64/libgenicam_mathparser-1.1.so b/thirdparty/GenICam/lib64/libgenicam_mathparser-1.1.so new file mode 100755 index 0000000..95b5676 Binary files /dev/null and b/thirdparty/GenICam/lib64/libgenicam_mathparser-1.1.so differ diff --git a/thirdparty/GenICam/lib64/libgenicam_mathparser.so b/thirdparty/GenICam/lib64/libgenicam_mathparser.so new file mode 120000 index 0000000..6ce96b5 --- /dev/null +++ b/thirdparty/GenICam/lib64/libgenicam_mathparser.so @@ -0,0 +1 @@ +libgenicam_mathparser-1.1.so \ No newline at end of file diff --git a/thirdparty/GenICam/lib64/liblog4cpp.so b/thirdparty/GenICam/lib64/liblog4cpp.so new file mode 120000 index 0000000..f7c6420 --- /dev/null +++ b/thirdparty/GenICam/lib64/liblog4cpp.so @@ -0,0 +1 @@ +liblog4cpp.so.4.0.5 \ No newline at end of file diff --git a/thirdparty/GenICam/lib64/liblog4cpp.so.4 b/thirdparty/GenICam/lib64/liblog4cpp.so.4 new file mode 120000 index 0000000..f7c6420 --- /dev/null +++ b/thirdparty/GenICam/lib64/liblog4cpp.so.4 @@ -0,0 +1 @@ +liblog4cpp.so.4.0.5 \ No newline at end of file diff --git a/thirdparty/GenICam/lib64/liblog4cpp.so.4.0.5 b/thirdparty/GenICam/lib64/liblog4cpp.so.4.0.5 new file mode 100755 index 0000000..43cec19 Binary files /dev/null and b/thirdparty/GenICam/lib64/liblog4cpp.so.4.0.5 differ diff --git a/thirdparty/GenICam/lib64/libxalan-c.so b/thirdparty/GenICam/lib64/libxalan-c.so new file mode 120000 index 0000000..ca0979f --- /dev/null +++ b/thirdparty/GenICam/lib64/libxalan-c.so @@ -0,0 +1 @@ +libxalan-c.so.110.0 \ No newline at end of file diff --git a/thirdparty/GenICam/lib64/libxalan-c.so.110 b/thirdparty/GenICam/lib64/libxalan-c.so.110 new file mode 120000 index 0000000..ca0979f --- /dev/null +++ b/thirdparty/GenICam/lib64/libxalan-c.so.110 @@ -0,0 +1 @@ +libxalan-c.so.110.0 \ No newline at end of file diff --git a/thirdparty/GenICam/lib64/libxalan-c.so.110.0 b/thirdparty/GenICam/lib64/libxalan-c.so.110.0 new file mode 100755 index 0000000..e23a551 Binary files /dev/null and b/thirdparty/GenICam/lib64/libxalan-c.so.110.0 differ diff --git a/thirdparty/GenICam/lib64/libxalanMsg.so b/thirdparty/GenICam/lib64/libxalanMsg.so new file mode 120000 index 0000000..b28dd02 --- /dev/null +++ b/thirdparty/GenICam/lib64/libxalanMsg.so @@ -0,0 +1 @@ +libxalanMsg.so.110.0 \ No newline at end of file diff --git a/thirdparty/GenICam/lib64/libxalanMsg.so.110 b/thirdparty/GenICam/lib64/libxalanMsg.so.110 new file mode 120000 index 0000000..b28dd02 --- /dev/null +++ b/thirdparty/GenICam/lib64/libxalanMsg.so.110 @@ -0,0 +1 @@ +libxalanMsg.so.110.0 \ No newline at end of file diff --git a/thirdparty/GenICam/lib64/libxalanMsg.so.110.0 b/thirdparty/GenICam/lib64/libxalanMsg.so.110.0 new file mode 100755 index 0000000..06dfc95 Binary files /dev/null and b/thirdparty/GenICam/lib64/libxalanMsg.so.110.0 differ diff --git a/thirdparty/GenICam/lib64/libxerces-c.so b/thirdparty/GenICam/lib64/libxerces-c.so new file mode 120000 index 0000000..848151b --- /dev/null +++ b/thirdparty/GenICam/lib64/libxerces-c.so @@ -0,0 +1 @@ +libxerces-c.so.27.0 \ No newline at end of file diff --git a/thirdparty/GenICam/lib64/libxerces-c.so.27 b/thirdparty/GenICam/lib64/libxerces-c.so.27 new file mode 120000 index 0000000..848151b --- /dev/null +++ b/thirdparty/GenICam/lib64/libxerces-c.so.27 @@ -0,0 +1 @@ +libxerces-c.so.27.0 \ No newline at end of file diff --git a/thirdparty/GenICam/lib64/libxerces-c.so.27.0 b/thirdparty/GenICam/lib64/libxerces-c.so.27.0 new file mode 100755 index 0000000..3851840 Binary files /dev/null and b/thirdparty/GenICam/lib64/libxerces-c.so.27.0 differ diff --git a/thirdparty/GenICam/lib64/libxerces-depdom.so b/thirdparty/GenICam/lib64/libxerces-depdom.so new file mode 120000 index 0000000..ff7bacb --- /dev/null +++ b/thirdparty/GenICam/lib64/libxerces-depdom.so @@ -0,0 +1 @@ +libxerces-depdom.so.27.0 \ No newline at end of file diff --git a/thirdparty/GenICam/lib64/libxerces-depdom.so.27 b/thirdparty/GenICam/lib64/libxerces-depdom.so.27 new file mode 120000 index 0000000..ff7bacb --- /dev/null +++ b/thirdparty/GenICam/lib64/libxerces-depdom.so.27 @@ -0,0 +1 @@ +libxerces-depdom.so.27.0 \ No newline at end of file diff --git a/thirdparty/GenICam/lib64/libxerces-depdom.so.27.0 b/thirdparty/GenICam/lib64/libxerces-depdom.so.27.0 new file mode 100755 index 0000000..5129084 Binary files /dev/null and b/thirdparty/GenICam/lib64/libxerces-depdom.so.27.0 differ diff --git a/thirdparty/GenICam/licenses/Apache.txt b/thirdparty/GenICam/licenses/Apache.txt new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/thirdparty/GenICam/licenses/Apache.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/thirdparty/GenICam/licenses/GenICam_License_20072005.pdf b/thirdparty/GenICam/licenses/GenICam_License_20072005.pdf new file mode 100644 index 0000000..1c8164f Binary files /dev/null and b/thirdparty/GenICam/licenses/GenICam_License_20072005.pdf differ diff --git a/thirdparty/GenICam/licenses/LGPL.txt b/thirdparty/GenICam/licenses/LGPL.txt new file mode 100644 index 0000000..ef77288 --- /dev/null +++ b/thirdparty/GenICam/licenses/LGPL.txt @@ -0,0 +1,503 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus + +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + diff --git a/thirdparty/GenICam/share/genicam/log/config/DebugLogging.properties b/thirdparty/GenICam/share/genicam/log/config/DebugLogging.properties new file mode 100644 index 0000000..09b74c4 --- /dev/null +++ b/thirdparty/GenICam/share/genicam/log/config/DebugLogging.properties @@ -0,0 +1,24 @@ +# Use these settings for debugging + +log4j.rootCategory=ERROR +log4j.category.CppUnit=INFO, Console +#log4j.category.CppUnit=INFO, File + +#log4j.category.CppUnit.Performance=INFO, File +#log4j.category.GenApi.Device.Access=DEBUG, Console +#log4j.category.GenApi.Device.Value=DEBUG, Console +#log4j.category.GenApi.Device.Range=DEBUG, Console +#log4j.category.GenApi.Device.Port=DEBUG, Console +#log4j.category.GenApi.Device.RegisterPort=DEBUG, Console +#log4j.category.GenApi.Device.Cache=DEBUG, Console +#log4j.category.GenApi.Device.Misc=DEBUG, Console + +log4j.appender.Console=org.apache.log4j.ConsoleAppender +log4j.appender.Console.layout=org.apache.log4j.PatternLayout +log4cpp.appender.Console.layout.ConversionPattern==>LOG %x: %c : %m%n + +log4j.appender.File=org.apache.log4j.FileAppender +log4j.appender.File.layout=org.apache.log4j.PatternLayout +log4j.appender.File.layout.ConversionPattern==>LOG %x: %c : %m%n +log4j.appender.File.fileName=$(GENICAM_ROOT)/log/Results/Performance.log +#log4j.appender.File.fileName=$(GENICAM_ROOT)/log/Results/UCCATest.log diff --git a/thirdparty/GenICam/share/genicam/log/config/DefaultLogging.properties b/thirdparty/GenICam/share/genicam/log/config/DefaultLogging.properties new file mode 100644 index 0000000..0452fee --- /dev/null +++ b/thirdparty/GenICam/share/genicam/log/config/DefaultLogging.properties @@ -0,0 +1,6 @@ +# These settings are loaded as default + +log4j.rootCategory=ERROR, Console +log4cpp.appender.Console=org.apache.log4j.ConsoleAppender +log4cpp.appender.Console.layout=org.apache.log4j.PatternLayout +log4cpp.appender.Console.layout.ConversionPattern==>LOG %x: %c : %m%n diff --git a/thirdparty/GenICam/share/genicam/xml/GenApiSchema_Version_1_0.xsd b/thirdparty/GenICam/share/genicam/xml/GenApiSchema_Version_1_0.xsd new file mode 100644 index 0000000..678a64b --- /dev/null +++ b/thirdparty/GenICam/share/genicam/xml/GenApiSchema_Version_1_0.xsd @@ -0,0 +1,732 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Cache on write and write into register + + + + + Write w/o cache, read updates cache + + + + + Do not perform caching + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/thirdparty/GenICam/share/genicam/xml/GenApi_Impl_cpp.xsl b/thirdparty/GenICam/share/genicam/xml/GenApi_Impl_cpp.xsl new file mode 100644 index 0000000..c484929 --- /dev/null +++ b/thirdparty/GenICam/share/genicam/xml/GenApi_Impl_cpp.xsl @@ -0,0 +1,160 @@ + + + + + + +//----------------------------------------------------------------------------- +// (c) 2004, 2005 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +//----------------------------------------------------------------------------- +/*! + \file +*/ +//----------------------------------------------------------------------------- +// This file is generated automatically +// Do not modify! +//----------------------------------------------------------------------------- + +#include "Impl.h" + +namespace _ +{ + + + + //! Constructor + CImpl::CImpl(GenICam::gcstring DeviceName) : + CNodeMap(DeviceName) + { + // Initialize the DeviceInfo members + SetProperty("StandardNameSpace", ""); + SetProperty("ModelName", ""); + SetProperty("VendorName", ""); + SetProperty("ToolTip", ""); + SetProperty("SchemaMajorVersion", ""); + SetProperty("SchemaMinorVersion", ""); + SetProperty("SchemaSubMinorVersion", ""); + SetProperty("MajorVersion", ""); + SetProperty("MinorVersion", ""); + SetProperty("SubMinorVersion", ""); + SetProperty("ProductGuid", ""); + SetProperty("VersionGuid", ""); + + //-------------------------------------------------------------------------------------------------- + // Register each node + //-------------------------------------------------------------------------------------------------- + + + //-------------------------------------------------------------------------------------------------- + // Set properties of each node + //-------------------------------------------------------------------------------------------------- + + + // finalize construction + FinalConstruct(); + + } + + //! Final Construct + void CImpl::FinalConstruct(void) + { + + + CNodeMap::FinalConstruct(); + } + + GenApi::INodeMap* CImpl::Create(GenICam::gcstring DeviceName) + { + return new CImpl(DeviceName); + } + + void CImpl::Destroy(void) + { + delete this; + } + +} + + + + + + + + void CImpl::SetProperties(void) + { + + } + + + + + + + + + + .SetProperty("", "", ""); + + + .SetProperty("", + + + + + ); + + + + + + + + + + .Register(this, "", "", ""); + + + + + + + + SetProperties(); + + + + + + + + .FinalConstruct(); + + + + diff --git a/thirdparty/GenICam/share/genicam/xml/GenApi_Impl_h.xsl b/thirdparty/GenICam/share/genicam/xml/GenApi_Impl_h.xsl new file mode 100644 index 0000000..e5b2b7d --- /dev/null +++ b/thirdparty/GenICam/share/genicam/xml/GenApi_Impl_h.xsl @@ -0,0 +1,141 @@ + + + + + + +//----------------------------------------------------------------------------- +// (c) 2004, 2005 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +//----------------------------------------------------------------------------- +/*! + \file +*/ +//----------------------------------------------------------------------------- +// This file is generated automatically +// Do not modify! +//----------------------------------------------------------------------------- + +#ifndef _Impl_H +#define _Impl_H + +#if defined (_MSC_VER) && defined (_WIN32) +# include <GenApi//.h> +#elif defined (__GNUC__) && defined (__linux__) +# include ".h" +#else +# error Unknown/unsupported platform +#endif + +#if defined(_MSC_VER) +# pragma warning(push) +# pragma warning(disable: 4068) // unknown pragma (generated by bullseye coverage pragmas) +# if defined(NDEBUG) + // You may get a C4702 unreachable code in optimized builds. Thats why we disable it only in release builds# if defined(NDEBUG) +# pragma warning(disable: 4702) // unreachable code +# endif +#endif + +#include <GenApi/impl/GenApiImpl.h> + +#if defined(_MSC_VER) && defined(NDEBUG) +# pragma warning(pop) +#endif + + +//! The namespace containing the device's control interface and related enumeration types +namespace _ +{ + + //! + class CImpl : public GenApi::CNodeMap + { + public: + //! Constructor + CImpl(GenICam::gcstring DeviceName); + + //! creates a nodemap object + static INodeMap* Create(GenICam::gcstring DeviceName); + + //! Makes the object to destroy itself + virtual void Destroy(void); + + //---------------------------------------------------------------------------------------------------------------- + // Features + //---------------------------------------------------------------------------------------------------------------- + + + private: + //! Function doing final initializations + void FinalConstruct(void); + + //---------------------------------------------------------------------------------------------------------------- + // Initialization methods + //---------------------------------------------------------------------------------------------------------------- + + }; +} + +#endif // _Impl_H + + + + + + + + /*! \brief + + + + + + + + */ + GenApi:: + + ; + + + /*! + + + */ + GenApi:: + ; + + + + + + + + void SetProperties(); + + + diff --git a/thirdparty/GenICam/share/genicam/xml/GenApi_Ptr_cpp.xsl b/thirdparty/GenICam/share/genicam/xml/GenApi_Ptr_cpp.xsl new file mode 100644 index 0000000..8eb6ded --- /dev/null +++ b/thirdparty/GenICam/share/genicam/xml/GenApi_Ptr_cpp.xsl @@ -0,0 +1,172 @@ + + + + + + + + + +//----------------------------------------------------------------------------- +// (c) 2004, 2005 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +// Author: Fritz Dierks +//----------------------------------------------------------------------------- +/*! + \file +*/ +//----------------------------------------------------------------------------- +// This file is generated automatically +// Do not modify! +//----------------------------------------------------------------------------- + + +#if defined (_MSC_VER) && defined (_WIN32) +# include <GenApi//.h> +#elif defined (__GNUC__) && defined (__linux__) +# include ".h" +#else +# error Unknown/unsupported platform +#endif + + + +#include + + + +#include <GenApi/DLLLoad.h> + +using namespace GenICam; +using namespace GenApi; + +namespace _ +{ + + C::C(void) : + CNodeMapRef() + { + } + + C::C(GenICam::gcstring DeviceName) : + CNodeMapRef(DeviceName) + { + } + + C::~C(void) + { + + } + + void C::_Initialize() + { + + } + + void C::_LoadDLL(void) + { + CNodeMapRef::_LoadDLL("", ""); + } + +} + + + + + + + + + + + + ( *new GenApi::<Enums>() ), + + + ( *new GenApi::() ), + + + + + + + + + + + + + + delete static_cast < GenApi::<Enums> *> (& ); + + + delete static_cast < GenApi::*> (& ); + + + + + + + + + + + + + dynamic_cast<GenApi::IReference*>(&)->SetReference(_Ptr->GetNode("")); + + + dynamic_cast<GenApi::IEnumReference*>(&)->SetNumEnums(); + + + + + + + + + + + + + + + + + + + + + + + + + dynamic_cast<GenApi::IEnumReference*>(&)->SetEnumReference( _, "" ); + + + + diff --git a/thirdparty/GenICam/share/genicam/xml/GenApi_Ptr_h.xsl b/thirdparty/GenICam/share/genicam/xml/GenApi_Ptr_h.xsl new file mode 100644 index 0000000..e6c5a45 --- /dev/null +++ b/thirdparty/GenICam/share/genicam/xml/GenApi_Ptr_h.xsl @@ -0,0 +1,176 @@ + + + + + + + + +//----------------------------------------------------------------------------- +// (c) 2004, 2005 by Basler Vision Technologies +// Section: Vision Components +// Project: GenApi +//----------------------------------------------------------------------------- +/*! + \file + \brief +*/ +//----------------------------------------------------------------------------- +// This file is generated automatically +// Do not modify! +//----------------------------------------------------------------------------- + +#ifndef __H +#define __H + +#include <GenApi/IEnumerationT.h> +#include <GenApi/NodeMapRef.h> + +//! The namespace containing the device's control interface and related enumeration types +namespace _ +{ + //************************************************************************************************** + // Enumerations + //************************************************************************************************** + + + //************************************************************************************************** + // Access class + //************************************************************************************************** + + //! + class C : public GenApi::CNodeMapRef + { + //---------------------------------------------------------------------------------------------------------------- + // Implementation + //---------------------------------------------------------------------------------------------------------------- + public: + //! Constructor + C(void); + + //! Constructor + C(GenICam::gcstring DeviceName); + + //! Destructor + virtual ~C(void); + + //! Creates the object from the default DLL + void _LoadDLL(void); + + protected: + //! Initializes the references + virtual void _Initialize(void); + + public: + //---------------------------------------------------------------------------------------------------------------- + // References to features + //---------------------------------------------------------------------------------------------------------------- + + + private: + //! not implemented copy constructor + C(C&); + + //! not implemented assignment operator + C& operator=(C&); + + }; + +} + + //---------------------------------------------------------------------------------------------------------------- + // Definition of Category node groups + //---------------------------------------------------------------------------------------------------------------- + + +#endif // __H + + + + + + + + + + + + + + + //! Valid values for + enum Enums + { + + }; + + + + + + + + + + + + _, //!<. + + + + + + + + + + + + + + //! + /*! + + */ + + GenApi:: + T< + Enums > + + + GenApi:: + + + & + ; + + + + diff --git a/thirdparty/GenICam/share/genicam/xml/PreProcess.xsl b/thirdparty/GenICam/share/genicam/xml/PreProcess.xsl new file mode 100644 index 0000000..d5750a8 --- /dev/null +++ b/thirdparty/GenICam/share/genicam/xml/PreProcess.xsl @@ -0,0 +1,249 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Custom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EnumEntry__ + + + + + + + + + + + + + + + EnumEntry__ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +