Last active
July 18, 2016 10:44
-
-
Save OXPHOS/521fba4f635590f8e7782b634874dc66 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<class Archive> | |
void CSGObject::cereal_save(Archive& ar) const | |
{ | |
int y = 0; | |
for (auto it = self->map.begin(); it != self->map.end(); ++it, ++y) | |
{ | |
std::cerr << "num. " << y << std::endl; | |
ar(it->second); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ RUN ] Cereal.Json_SGObject_save_load_pair | |
enum 1 | |
enum 2 | |
enum 4 | |
enum 1 | |
enum 2 | |
enum 4 | |
num. 0 | |
[ERROR] In file /Users/zora/Github/shogun/src/shogun/lib/any.h line 279: Type error: undefined data type | |
unknown file: Failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef HAVE_CXX11 | |
typedef std::unordered_map<BaseTag, Any> ParametersMap; | |
#else | |
typedef std::map<BaseTag, Any> ParametersMap; | |
#endif | |
class CSGObject::Self | |
{ | |
public: | |
void set(const BaseTag& tag, const Any& any) | |
{ | |
map[tag] = any; | |
} | |
Any get(const BaseTag& tag) const | |
{ | |
if(!has(tag)) | |
return Any(); | |
return map.at(tag); | |
} | |
bool has(const BaseTag& tag) const | |
{ | |
return map.find(tag) != map.end(); | |
} | |
ParametersMap map; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment