G
Goran
Hi all,
I'm asking me how to save a std::vector or std::set in my object?
Should I put it in private or public? And if in private... how looks
like the public methods to access the elements in the container?
My first attempt was to put them in private and build some public
methods...
[...]
public:
void AddObj(const Obj_t * aObj);
void EraseObj(unsigned int aPosition);
public:
unsigned int GetObjQuantum() const;
Obj_t GetObj(unsigned int aPosition) const;
private:
std::set<Obj_t *> * itsObjs;
I don't feel happy with solution above but I still don't know a better
way.
Thanks
Goran
I'm asking me how to save a std::vector or std::set in my object?
Should I put it in private or public? And if in private... how looks
like the public methods to access the elements in the container?
My first attempt was to put them in private and build some public
methods...
[...]
public:
void AddObj(const Obj_t * aObj);
void EraseObj(unsigned int aPosition);
public:
unsigned int GetObjQuantum() const;
Obj_t GetObj(unsigned int aPosition) const;
private:
std::set<Obj_t *> * itsObjs;
I don't feel happy with solution above but I still don't know a better
way.
Thanks
Goran