Skip to content

pylon/BufferFactory.h#

Contains an interface for a buffer factory.

Namespaces#

Name
Pylon
Contains definitions of pylon types.

Classes#

Name
class Pylon::IBufferFactory
Usable to create a custom buffer factory when needed.

Source code#

//------------------------------------------------------------------------------
//  Basler pylon SDK
//  Copyright (c) 2010-2022 Basler AG
//  http://www.baslerweb.com
//  Author:  Andreas Gau
//------------------------------------------------------------------------------
#ifndef INCLUDED_BUFFERFACTORY_H_264599
#define INCLUDED_BUFFERFACTORY_H_264599

#include <pylon/stdinclude.h>

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


namespace Pylon
{
    interface IBufferFactory
    {
    public:
        virtual ~IBufferFactory() = 0;

        virtual void AllocateBuffer( size_t bufferSize, void** pCreatedBuffer, intptr_t& bufferContext ) = 0;


        virtual void FreeBuffer( void* pCreatedBuffer, intptr_t bufferContext ) = 0;


        virtual void DestroyBufferFactory() = 0;
    };

    // Implementation required for Windows only.
    // Note: the C++ standards >= C11 prohibit pure virtual destructors with a function body
    // in the declaration. Consequently GCC 4.0 and newer GCC versions reject an inline implementation
    // in the class.
    inline IBufferFactory::~IBufferFactory()
    {
    }
}

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

#endif /* INCLUDED_BUFFERFACTORY_H_264599 */

Updated on 5 July 2022 at 15:30:01