Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Examples

vos/metaobjects/property/propertylistener.cc

Go to the documentation of this file.
00001 /*
00002     This file is part of the Virtual Object System of
00003     the Interreality project (http://interreality.org).
00004 
00005     Copyright (C) 2001, 2002 Peter Amstutz
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Lesser General Public
00009     License as published by the Free Software Foundation; either
00010     version 2 of the License, or (at your option) any later version.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Lesser General Public License for more details.
00016 
00017     You should have received a copy of the GNU Lesser General Public
00018     License along with this library; if not, write to the Free Software
00019     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00020 
00021     Peter Amstutz <tetron@interreality.org>
00022 */
00023 #include <stdio.h>
00024 #include <iostream>
00025 #include <fstream>
00026 
00027 #include <vos/corelibs/vos/vos.hh>
00028 #include "property.hh"
00029 #include <typechain/typechain.hh>
00030 
00031 #include <assert.h>
00032 
00033 
00034 PropertyEvent::PropertyEvent(EventType et, Vobject& init, Property& prop,
00035                              const string& value, 
00036                              const string& datatype,
00037                              bool AC)
00038     : event(et), initiator(&init), property(&prop), isACcheck(AC)
00039 {
00040     initiator->acquire();
00041     property->acquire();
00042     if(isACcheck) {
00043         oldvalue = value;
00044         olddatatype = datatype;
00045     } else {
00046         newvalue = value;
00047         newdatatype = datatype;
00048     }
00049     offset = 0;
00050     length = value.size();
00051 }
00052 
00053 PropertyEvent::PropertyEvent(EventType et, Vobject& init, Property& prop,
00054                              const string& value, 
00055                              const string& datatype, 
00056                              const string& oldval,
00057                              const string& olddt, 
00058                              bool AC)
00059     : event(et), 
00060       oldvalue(oldval), newvalue(value),
00061       olddatatype(olddt), newdatatype(datatype),
00062       initiator(&init), property(&prop), 
00063       isACcheck(AC)
00064 {
00065     initiator->acquire();
00066     property->acquire();
00067     offset = 0;
00068     length = newvalue.size();
00069 }
00070 
00071 PropertyEvent::PropertyEvent(EventType et, Vobject& init, Property& prop, 
00072                              int off, 
00073                              int len, 
00074                              const string& value,
00075                              const string& datatype,
00076                              bool AC)
00077     : event(et), initiator(&init), property(&prop), 
00078        offset(off), length(len), isACcheck(AC)
00079 {
00080     initiator->acquire();
00081     property->acquire();
00082     if(isACcheck) {
00083         oldvalue = value;
00084         olddatatype = datatype;
00085     } else {
00086         newvalue = value;
00087         newdatatype = datatype;
00088     }
00089 }
00090 
00091 PropertyEvent::PropertyEvent(EventType et, Vobject& init, Property& prop, 
00092                              int off, 
00093                              int len, 
00094                              const string& value,
00095                              const string& datatype,
00096                              const string& oldval,
00097                              const string& olddt,
00098                              bool AC)
00099     : event(et), 
00100       oldvalue(oldval), newvalue(value), 
00101       olddatatype(olddt), newdatatype(datatype), 
00102       initiator(&init), property(&prop), 
00103       offset(off), length(len), isACcheck(AC)
00104 {
00105     initiator->acquire();
00106     property->acquire();
00107 }
00108 
00109 
00110 PropertyEvent::~PropertyEvent() 
00111 {
00112     initiator->release();
00113     property->release();
00114 }

Generated on Tue Aug 12 03:55:46 2003 for Interreality Project - VOS by doxygen 1.3.2