Skip to content

Latest commit

 

History

History
42 lines (38 loc) · 1.02 KB

README.md

File metadata and controls

42 lines (38 loc) · 1.02 KB

vstd

c++ utility libraries

vstring

string utilities

vany

generic object type any utilities over boost:any

vfunctional

functional programming utilities

vlazy

lazy initialization template

vlogger

simple logger for c++

vmeta

meta object and reflection system for c++

class CMetaExample {
V_META(CMetaExample,
       vstd::meta::empty,
       V_PROPERTY(CMetaExample, std::string, text, getText, setText))
public:
    CMetaExample() = default;

    std::string getText() {
        return text;
    }

    void setText(std::string text) {
        CMetaExample::text = text;
    }

private:
    std::string text;
};

void vmeta_example() {
    auto example = std::make_shared();
    CMetaExample::static_meta()->set_property("text", example, "exampleText");
    vstd::logger::info("Direct access:", example->getText());
    vstd::logger::info("Meta access:",
                       CMetaExample::static_meta()->get_property("text", example));
}