Итак, я пытаюсь создать простой график, соединяющий один класс с другим ...
#include "IGraphElement.h"
#include <boost/bind.hpp>
class simpleRendererGraphElement : public IGraphElementBase, public simpleRendererLibAPI
{
public:
IGraphElement<ExtendedCharPtr>* charGenerator;
// we owerrite init
void Init(IGraphElement<ExtendedCharPtr>* CharGenerator, int sleepTime)
{
charGenerator = CharGenerator;
charGenerator->Add(boost::bind(&simpleRendererGraphElement::renderCastedData, this, std::placeholders::_1)); // line (**)
SetSleepTime(sleepTime);
}
void renderCastedData(ExtendedCharPtr data) // our event system receives functions declared like void FuncCharPtr(char*, int) ;
{
DWCTU();
renderChar(data.data);
}
};
Но он дает мне C3083 и C2039 в строке (**) ... Я использую против 2008Я не могу SED связать ... как решить такую проблему?
BTW #include "IGraphElement.h"
выглядит как
#include "IGraphElementBase.h"
// parts of c++0x std
#include <boost/bind.hpp>
#include <boost/function.hpp>
#ifndef _IGraphElement_h_
#define _IGraphElement_h_
using namespace std ;
template <typename DataType >
class IGraphElement : public IGraphElementBase{
typedef boost::function<void(DataType)> Function;
typedef std::vector<Function> FunctionSequence;
typedef typename FunctionSequence::iterator FunctionIterator;
private:
DataType dataElement;
FunctionSequence funcs;
public:
void InitGet(DataType DataElement)
{
dataElement = DataElement;
}
// Function for adding subscribers functions
// use something like std::bind(¤tClassName::FunctionToAdd, this, std::placeholders::_1) to add function to vector
void Add(Function f)
{
funcs.push_back(f);
}
};
#endif // _IGraphElement_h_