43 |
|
#define TYPES_BENDSTAMP_HPP |
44 |
|
|
45 |
|
#include "types/DataHolder.hpp" |
46 |
+ |
#include "utils/Tuple.hpp" |
47 |
|
namespace oopse { |
48 |
|
|
49 |
|
class BendStamp : public DataHolder { |
56 |
|
int getMemberAt( int index ) {return members_.at(index);} |
57 |
|
int getNMembers() {return members_.size();} |
58 |
|
std::vector<int> getMembers() {return members_;} |
59 |
< |
bool setMembers(const std::vector<int>& members) { |
59 |
> |
void setMembers(const std::vector<int>& members) { |
60 |
|
members_ = members; |
61 |
< |
bool ret = false; |
62 |
< |
if (members_.size() == 3 || members_.size() == 2) { |
63 |
< |
ret = true; |
61 |
> |
if (members_.size() < 2 || members_.size() >3) { |
62 |
> |
std::ostringstream oss; |
63 |
> |
oss << "members" << containerToString(members) << " is an invalid" << std::endl; |
64 |
> |
throw OOPSEException(oss.str()); |
65 |
|
} |
64 |
– |
return ret; |
66 |
|
} |
67 |
< |
|
67 |
> |
void setMembers(IntTuple3 tuple) { |
68 |
> |
members_.push_back(tuple.first); |
69 |
> |
members_.push_back(tuple.second); |
70 |
> |
members_.push_back(tuple.third); |
71 |
> |
} |
72 |
|
virtual void validate(); |
73 |
|
|
74 |
|
private: |