diff options
author | cathook <b01902109@csie.ntu.edu.tw> | 2014-05-02 04:10:56 +0800 |
---|---|---|
committer | cathook <b01902109@csie.ntu.edu.tw> | 2014-05-02 04:10:56 +0800 |
commit | 33d419e4d54d969798af80f05e05f0c447a99594 (patch) | |
tree | c78355a2d334e34df865aca865dbb4864a85820c /meowpp/oo/ObjSelector.h | |
parent | d2d7a49563a8f04bd07264a4a989d5656313d375 (diff) | |
download | meow-33d419e4d54d969798af80f05e05f0c447a99594.tar meow-33d419e4d54d969798af80f05e05f0c447a99594.tar.gz meow-33d419e4d54d969798af80f05e05f0c447a99594.tar.bz2 meow-33d419e4d54d969798af80f05e05f0c447a99594.tar.lz meow-33d419e4d54d969798af80f05e05f0c447a99594.tar.xz meow-33d419e4d54d969798af80f05e05f0c447a99594.tar.zst meow-33d419e4d54d969798af80f05e05f0c447a99594.zip |
big change about dir structure
Diffstat (limited to 'meowpp/oo/ObjSelector.h')
-rw-r--r-- | meowpp/oo/ObjSelector.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/meowpp/oo/ObjSelector.h b/meowpp/oo/ObjSelector.h index e70c496..58debcb 100644 --- a/meowpp/oo/ObjSelector.h +++ b/meowpp/oo/ObjSelector.h @@ -34,11 +34,22 @@ namespace meow{ funcs().erase(s); } } + static ObjBase const* access(std::string s){ + if(funcs().find(s) == funcs().end()) return NULL; + return funcs()[s]; + } static ObjBase* get(std::string s){ if(funcs().find(s) == funcs().end() || funcs()[s] == NULL) return NULL; return funcs()[s]->create(); } + static std::string find(ObjBase* o){ + for(Funcs::iterator it = funcs().begin(); it != funcs().end(); it++) + if(it->second != NULL && it->second->type() == o->type()){ + return it->first; + } + return std::string(); + } static Types lst(){ Types ret; for(Funcs::iterator it = funcs().begin(); it != funcs().end(); it++) |