//====================================================================================================== // Copyright 2016, NaturalPoint Inc. //====================================================================================================== #pragma once #include "AnalogSystemBuildConfig.h" #include "PluginDeviceBase.h" namespace AnalogSystem { template class AnalogFrame; /// /// cPluginDevice is a type-specific implementation of a Plugin Device. /// It provides type specific frame allocation and frame buffer access. /// See Plugin Device SDK for example implementation /// template class cPluginDevice : public cPluginDeviceBase { public: cPluginDevice() : cPluginDeviceBase() { mDataSize = sizeof( T ); } /// Gets a pointer to next slot in the device's data buffer to write data into /// The device frame ID the device will associate with this slot AnalogFrame* BeginFrameUpdate( long frameID, bool wait = true ) override { return dynamic_cast*>( __super::BeginFrameUpdate( frameID, wait ) ); } /// Gets the frame by device frame identifier. /// The device frame ID const AnalogFrame* GetFrameByDeviceFrameID( long frameID ) const override { return dynamic_cast*>( __super::GetFrameByDeviceFrameID( frameID ) ); } protected: /// Allocates a frame in the plugin's memory context /// The channel count virtual AnalogFrame* AllocateFrame( int channelCount ) override { return new AnalogFrame( channelCount ); } }; }