2012-11-21 02:40:52 +01:00
|
|
|
/*
|
2013-01-11 03:48:15 +01:00
|
|
|
* Copyright (c) 2012-2013 Stephen Williams (steve@icarus.com)
|
2012-11-21 02:40:52 +01:00
|
|
|
*
|
|
|
|
|
* This source code is free software; you can redistribute it
|
|
|
|
|
* and/or modify it in source code form under the terms of the GNU
|
|
|
|
|
* General Public License as published by the Free Software
|
|
|
|
|
* Foundation; either version 2 of the License, or (at your option)
|
|
|
|
|
* any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
# include "vvp_cobject.h"
|
2012-12-10 02:59:16 +01:00
|
|
|
# include "class_type.h"
|
|
|
|
|
# include <iostream>
|
|
|
|
|
# include <cassert>
|
2012-11-21 02:40:52 +01:00
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
2012-12-10 02:59:16 +01:00
|
|
|
vvp_cobject::vvp_cobject(const class_type*defn)
|
2013-01-07 00:42:23 +01:00
|
|
|
: defn_(defn), properties_(defn->instance_new())
|
2012-11-21 02:40:52 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
vvp_cobject::~vvp_cobject()
|
|
|
|
|
{
|
2013-01-07 00:42:23 +01:00
|
|
|
defn_->instance_delete(properties_);
|
2012-12-10 02:59:16 +01:00
|
|
|
properties_ = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void vvp_cobject::set_vec4(size_t pid, const vvp_vector4_t&val)
|
|
|
|
|
{
|
2013-01-07 00:42:23 +01:00
|
|
|
defn_->set_vec4(properties_, pid, val);
|
2012-12-10 02:59:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void vvp_cobject::get_vec4(size_t pid, vvp_vector4_t&val)
|
|
|
|
|
{
|
2013-01-07 00:42:23 +01:00
|
|
|
defn_->get_vec4(properties_, pid, val);
|
2012-11-21 02:40:52 +01:00
|
|
|
}
|
2013-01-11 03:48:15 +01:00
|
|
|
|
|
|
|
|
void vvp_cobject::set_real(size_t pid, double val)
|
|
|
|
|
{
|
|
|
|
|
defn_->set_real(properties_, pid, val);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double vvp_cobject::get_real(size_t pid)
|
|
|
|
|
{
|
|
|
|
|
return defn_->get_real(properties_, pid);
|
|
|
|
|
}
|
2013-01-14 02:14:40 +01:00
|
|
|
|
|
|
|
|
void vvp_cobject::set_string(size_t pid, const string&val)
|
|
|
|
|
{
|
|
|
|
|
defn_->set_string(properties_, pid, val);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string vvp_cobject::get_string(size_t pid)
|
|
|
|
|
{
|
|
|
|
|
return defn_->get_string(properties_, pid);
|
|
|
|
|
}
|
2013-01-27 21:30:38 +01:00
|
|
|
|
|
|
|
|
void vvp_cobject::set_object(size_t pid, const vvp_object_t&val)
|
|
|
|
|
{
|
|
|
|
|
defn_->set_object(properties_, pid, val);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void vvp_cobject::get_object(size_t pid, vvp_object_t&val)
|
|
|
|
|
{
|
|
|
|
|
return defn_->get_object(properties_, pid, val);
|
|
|
|
|
}
|