Skip to content


Maps GenICam/GenApi types to pylon namespace.


Contains definitions of pylon types.


class Pylon::GenericException
pylon exception class
class Pylon::BadAllocException
Exception thrown if memory could not be allocated.
class Pylon::InvalidArgumentException
Exception thrown if an argument passed is invalid.
class Pylon::OutOfRangeException
Exception thrown if an argument is out of range.
class Pylon::PropertyException
Exception thrown if a property access fails.
class Pylon::RuntimeException
Exception thrown if a runtime error occurs.
class Pylon::LogicalErrorException
Exception thrown to indicate logical errors in program flow.
class Pylon::AccessException
Exception thrown to indicate an access error. (i.E. A when trying to set a read-only value)
class Pylon::TimeoutException
Exception thrown when a timeout has elapsed.
class Pylon::DynamicCastException
Exception thrown to indicate a dynamic cast has failed. Usually this means a value is not of expected type.
class Pylon::CLock
A simple recursive lock class.
class Pylon::AutoLock
A scoped lock class to acquire and release a CLock upon creation and destruction.

Source code#

//  Basler pylon SDK
//  Copyright (c) 2008-2022 Basler AG
//  Author:  JS
#pragma once

#include <Base/GCNamespace.h>
#include <Base/GCTypes.h>
#include <Base/GCString.h>
#include <Base/GCStringVector.h>
#include <Base/GCException.h>

#include <GenICamFwd.h>
#include <GenApi/GenApiNamespace.h>
#include <GenApi/Synch.h>

#include <pylon/Platform.h> // for PYLON_PACKING

#ifdef _MSC_VER
#   pragma pack(push, PYLON_PACKING)
#endif /* _MSC_VER */

namespace Pylon
    typedef GenICam::gcstring String_t;

    typedef GenICam::gcstring_vector StringList_t;

    // pull genicam exceptions into the pylon namespace
    // we provide mappings so the user can use the Pylon namespace and don't have to think about
    // whether to use GenApi or GenICam namespace

    using GenICam::GenericException;
    using GenICam::BadAllocException;
    using GenICam::InvalidArgumentException;
    using GenICam::OutOfRangeException;
    using GenICam::PropertyException;
    using GenICam::RuntimeException;
    using GenICam::LogicalErrorException;
    using GenICam::AccessException;
    using GenICam::TimeoutException;
    using GenICam::DynamicCastException;

    // locks
    using GenApi::CLock;
    using GenApi::AutoLock;

    // INodeMap, INode etc. are not mapped

// this is only used for documentation purpose

    class GenericException
        GenericException( const char* pDescription, const char* pSourceFileName, unsigned int SourceLine );
        virtual const char* GetDescription() const throw();
        virtual const char* GetSourceFileName() const throw();
        virtual unsigned int GetSourceLine() const throw();
        virtual const char* what() const throw();

    DECLARE_PYLON_EXCEPTION( BadAllocException );

    DECLARE_PYLON_EXCEPTION( InvalidArgumentException );

    DECLARE_PYLON_EXCEPTION( OutOfRangeException );

    DECLARE_PYLON_EXCEPTION( PropertyException );

    DECLARE_PYLON_EXCEPTION( RuntimeException );

    DECLARE_PYLON_EXCEPTION( LogicalErrorException );

    DECLARE_PYLON_EXCEPTION( AccessException );

    DECLARE_PYLON_EXCEPTION( TimeoutException );

    DECLARE_PYLON_EXCEPTION( DynamicCastException );

    class CLock

        bool TryLock();

        void Lock();

        void Unlock();

    class AutoLock
        AutoLock( CLock& lock );



#ifdef _MSC_VER
#   pragma pack(pop)
#endif /* _MSC_VER */

Updated on 5 July 2022 at 15:30:01