DLLLoad.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //-----------------------------------------------------------------------------
  2. // (c) 2006 by Basler Vision Technologies
  3. // Section: Vision Components
  4. // Project: GenApi
  5. // Author: Fritz Dierks
  6. // $Header$
  7. //
  8. // License: This file is published under the license of the EMVA GenICam Standard Group.
  9. // A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'.
  10. // If for some reason you are missing this file please contact the EMVA or visit the website
  11. // (http://www.genicam.org) for a full copy.
  12. //
  13. // THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
  14. // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  15. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  16. // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP
  17. // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  18. // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  19. // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  20. // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  21. // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  22. // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  23. // POSSIBILITY OF SUCH DAMAGE.
  24. //-----------------------------------------------------------------------------
  25. /*!
  26. \file
  27. \brief Definition of function for laoding a DLL dynamically
  28. \ingroup GenApi_PublicImpl
  29. */
  30. #ifndef GENAPI_DLLLOAD_H
  31. #define GENAPI_DLLLOAD_H
  32. #include <GenApi/INodeMap.h>
  33. #include <GenApi/GenApiVersion.h>
  34. #if defined (_MSC_VER)
  35. // nothing
  36. #elif defined (__GNUC__)
  37. # if !defined(__x86_64) && !defined(__arm__) && !defined(VXWORKS)
  38. # define __cdecl __attribute__((cdecl))
  39. # else
  40. # define __cdecl /* use default calling convention */
  41. # endif
  42. #else
  43. # error Unsupported compiler
  44. #endif
  45. namespace GENAPI_NAMESPACE
  46. {
  47. //! Function prototype for the create function implemented by GenApi DLLs
  48. //! \ingroup GenApi_PublicImpl
  49. typedef INodeMap* (__cdecl * Create_f)(const char* pDeviceName);
  50. //! Function prototype for checking the DLL's GenApi version
  51. //! \ingroup GenApi_PublicImpl
  52. typedef void (__cdecl * GetGenApiVersion_f)(Version_t &Version);
  53. //! Frees static resources hold by GenApi
  54. /*! Frees all dynamically loaded DLLs held by the DLLManager
  55. */
  56. GENAPI_DECL void GenApiTerminate();
  57. }
  58. #endif // ifndef GENAPI_DLLLOAD_H