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>
46 typedef std::vector<float *> TVariablePtrArray;
51 typedef std::vector<float *> TFloatPtrArray;
56 typedef std::vector<int *> TIntPtrArray;
61 typedef TVariablePtrArray::iterator ITVariablePtrArray;
66 typedef TVariablePtrArray::const_iterator CITVariablePtrArray;
91 const ALValue &pBuff);
102 const std::vector<std::string> &pListVariables,
103 bool bAllowNonExistantVariable =
false);
113 const std::vector<std::string> &pListVariables);
121 static void *
getDataPtr(boost::shared_ptr<AL::ALBroker> pBroker,
122 const std::string &pStrValue,
123 bool bAllowUnexistantVariable);
133 const std::string &pStrValue,
136 bool insertData =
false;
140 insertData = !pMemoryProxy->getData(pStrValue).isValid();
142 catch(
const std::exception &)
151 pMemoryProxy->insertData(pStrValue, pValue);
154 return static_cast<T*
>(pMemoryProxy->getDataPtr(pStrValue));
165 const std::vector<std::string> &pListVariables,
166 bool bAllowUnexistantVariable =
false);
172 void GetValues(std::vector<float> &pListValue)
const;
178 void SetValues(
const std::vector<float> &pListValue);
184 void GetValues(std::vector<int> &pListValue)
const;
190 void SetValues(
const std::vector<int> &pListValue);
197 inline void DisableCheckOnNotExistingValueOrThings_Debug(
void) { fbDisableCheking_Debug =
true; };
205 static bool InnerTest(
const boost::shared_ptr<AL::ALBroker> pBroker);
212 static ALValue* getBuffer(
const std::string &pName);
215 boost::shared_ptr<AL::ALProxy> fMemoryProxy;
220 TVariablePtrArray fListVariablePtr;
222 TFloatPtrArray fListFloatPtr;
224 TIntPtrArray fListIntPtr;
228 ALValue fCommandToGetData;
230 ALValue fCommandToSetData;
237 bool fbDisableCheking_Debug;
242 #endif // _LIBALMEMORYFASTACCESS_ALMEMORYFASTACCESS_ALMEMORYFASTACCESS_H_
ALMemoryFastAccess is a fast access in Read/Write to some variables of ALMemory.
ALMemoryFastAccess()
Default constructor.
void StopAllAccess(void)
Remove all pointer.
void GetValues(std::vector< float > &pListValue) const
Get previous "connected" variables.
~ALMemoryFastAccess()
Default destructor.
void directConnectToVariables(const boost::shared_ptr< AL::ALBroker > pBroker, const std::vector< std::string > &pListVariables, bool bAllowUnexistantVariable=false)
FIXME: No implementation.
static bool InnerTest(const boost::shared_ptr< AL::ALBroker > pBroker)
Test function.
void SetValues(const std::vector< float > &pListValue)
Set previous "connected" variables.
static T * getSafeDataPtr(boost::shared_ptr< ALMemoryProxy > pMemoryProxy, const std::string &pStrValue, T pValue)
Get pointer on 32bit data.
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.
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.
void insertBuffer(const std::string &pName, const ALValue &pBuff)
Insert a binary ALValue in ALMemory.