11 #ifndef _LIBALMEMORYFASTACCESS_ALMEMORYFASTACCESS_ALMEMORYFASTACCESS_H_
12 #define _LIBALMEMORYFASTACCESS_ALMEMORYFASTACCESS_ALMEMORYFASTACCESS_H_
14 #include <alvalue/alvalue.h>
15 #include <alproxies/almemoryproxy.h>
17 #include <boost/shared_ptr.hpp>
57 const ALValue &pBuff);
68 const std::vector<std::string> &pListVariables,
69 bool bAllowNonExistantVariable =
false);
79 const std::vector<std::string> &pListVariables);
87 static void *
getDataPtr(boost::shared_ptr<AL::ALBroker> pBroker,
88 const std::string &pStrValue,
89 bool bAllowUnexistantVariable);
99 const std::string &pStrValue,
102 bool insertData =
false;
106 insertData = !pMemoryProxy->getData(pStrValue).isValid();
108 catch(
const std::exception &)
117 pMemoryProxy->insertData(pStrValue, pValue);
120 return static_cast<T*
>(pMemoryProxy->getDataPtr(pStrValue));
127 void GetValues(std::vector<float> &pListValue)
const;
133 void SetValues(
const std::vector<float> &pListValue);
139 void GetValues(std::vector<int> &pListValue)
const;
145 void SetValues(
const std::vector<int> &pListValue);
152 static bool InnerTest(
const boost::shared_ptr<AL::ALBroker> pBroker);
159 static ALValue* getBuffer(
const std::string &pName);
162 boost::shared_ptr<AL::ALProxy> fMemoryProxy;
165 std::vector<float *> fFloatPtrs;
167 std::vector<int *> fIntPtrs;
174 #endif // _LIBALMEMORYFASTACCESS_ALMEMORYFASTACCESS_ALMEMORYFASTACCESS_H_
void insertBuffer(const std::string &pName, const ALValue &pBuff)
Insert a binary ALValue in ALMemory.
void StopAllAccess(void)
Remove all pointer.
void GetValues(std::vector< float > &pListValue) const
Get previous "connected" variables.
ALMemoryFastAccess is a fast access in Read/Write to some variables of ALMemory.
void ConnectToVariables(const boost::shared_ptr< AL::ALBroker > pBroker, const std::vector< std::string > &pListVariables, bool bAllowNonExistantVariable=false)
First time, you must "connect" to variables to access later, many times.
static void * getDataPtr(boost::shared_ptr< AL::ALBroker > pBroker, const std::string &pStrValue, bool bAllowUnexistantVariable)
Get pointer on 32bit data.
static T * getSafeDataPtr(boost::shared_ptr< ALMemoryProxy > pMemoryProxy, const std::string &pStrValue, T pValue)
Get pointer on 32bit data.
void SetValues(const std::vector< float > &pListValue)
Set previous "connected" variables.
void ConnectToIntVariables(const boost::shared_ptr< AL::ALBroker > pBroker, const std::vector< std::string > &pListVariables)
First time, you must "connect" to int variables to access later, many times.
static bool InnerTest(const boost::shared_ptr< AL::ALBroker > pBroker)
Test function.