Actions
Useful macros¶
- CM_PROPERTY(xxx): define setter/getter for class member, require the member ends with "_"
- NAMED_TUPLE(cls, (type, name, value)) : define a tuple like class, will automatically generate constructor/operator<</to_string/getter/setter
- CM_SERIALIZE() : declare boost serialization function
- CM_BASE_SERIALIZE : used if the serialized class was derived from another class example:
if Base class have member:
CM_SFRIALIZE() {
ar& CM_BASE_SFRIALIZF(Base)& new—class—member;
}
if Base class do not have member:
CM_SFRIALIZE() {
}
-
BITSET_SOLO(flag, (bit1)(bit2)) : use one bit per one state, will automatically generate is_xxx/set_xxx/reset_xxx
-
ENUMCLASS : declare an enum class, will automatically generate operator<<
-
DBG: output debug messages only if you set debug level > LVL
-
cm::join(x, y, z) : works like python "".join()
-
cm::format("{}xxxxx", xxx) , works like python format string, plz do not use sprintf and cout !!
Updated by jun chen 3 months ago · 1 revisions