You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Person
{
public:
// constructor
Person(const std::string& name)
: m_name(name)
{}
// accessors for private members
std::string name() const { return m_name; }
void setName(const std::string& name) { m_name = name; }
// public members
float height;
unsigned int shoeSize;
// member function
bool hasBigFeet() const { return shoeSize > 10; } // U.K.!
private:
std::string m_name;
};
PONDER_TYPE(Person) // declare the type to Ponder
static void declare() // declare the class members to Ponder
{
ponder::Class::declare<Person>("Person")
.constructor<std::string>()
.property("name", &Person::name, &Person::setName)
.property("height", &Person::height)
.property("shoeSize", &Person::shoeSize)
.function("hasBigFeet", &Person::hasBigFeet)
;
}
int main(){
declare();
const ponder::Class& metaclass = ponder::classByType<Person>();
ponder::UserObject data = ponder::runtime::create(metaclass, "Tom");
//auto value = data.get("m_value");
//std::cout << value << std::endl;
//data.set("m_value", 1000);
return 0;
}
I compiled the demo code but got the following error:
undefined reference to `ponder::runtime::ObjectFactory::construct(ponder::Args const&, void*) const'
The text was updated successfully, but these errors were encountered:
I compiled the demo code but got the following error:
undefined reference to `ponder::runtime::ObjectFactory::construct(ponder::Args const&, void*) const'
The text was updated successfully, but these errors were encountered: