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

vos/metaobjects/misc/metadata.cc

Go to the documentation of this file.
00001 /* $Id: metadata.cc,v 1.14 2003/07/23 00:17:27 reed Exp $ */
00002 
00003 
00004 
00005 /* This file was generated by otd2cpp.pl, a script for ADR by Reed Hedges <reed@zerohour.net>.
00006    Search for TODO for stuff that needs editing. You will want to especially fill in constructors,
00007    destructors, message handlers, non-property subobjects...
00008 
00009    I can make no garuntee that this code will work, or even that it even is safe to run.
00010    Use it at your own risk.
00011 */
00012 
00013 /** @file metadata.cc Code: a MetaObject for Metadata object types. */
00014 
00015 #include <vos/corelibs/vos/vos.hh>
00016 #include <vos/metaobjects/property/property.hh>
00017 #include "metadata.hh"
00018 
00019 /* Constructors */
00020 
00021 Metadata::Metadata(MetaObject* s) : MetaObject(s) {
00022     defaultPropertyAC = &NoPropertyAccessControl::static_;
00023 }
00024 
00025 LocalMetadata::LocalMetadata(MetaObject* s) : Metadata(s), MetaObject(s) {
00026 }
00027 
00028 
00029 RemoteMetadata::RemoteMetadata(MetaObject* s) : Metadata(s), MetaObject(s) {
00030 }
00031 
00032 void Metadata::initialize(PropertyAccessControl* ac) {
00033     defaultPropertyAC = ac;
00034 }
00035 
00036 
00037 
00038 /* Return type string ("metadata") */
00039 
00040 const string Metadata::getType() {
00041     return string("misc:metadata");
00042 }
00043 
00044 /* Register extenders with libvos MetaFactory */
00045 void Metadata::registerExtenders() {
00046     static bool done = false;
00047     if(! done) {
00048     LocalSite::addLocalObjectExtension(typeid(LocalMetadata).name(), &LocalMetadata::new_LocalMetadata);
00049     LocalSite::addLocalObjectExtension(typeid(Metadata).name(), &LocalMetadata::new_LocalMetadata);
00050     LocalSite::addLocalObjectExtension("misc:metadata", &LocalMetadata::new_LocalMetadata);
00051     RemoteSite::addRemoteObjectExtension(typeid(RemoteMetadata).name(), &RemoteMetadata::new_RemoteMetadata);
00052     RemoteSite::addRemoteObjectExtension(typeid(Metadata).name(), &RemoteMetadata::new_RemoteMetadata);
00053     RemoteSite::addRemoteObjectExtension("misc:metadata", &RemoteMetadata::new_RemoteMetadata);
00054     done = true;
00055     }
00056 
00057 }
00058 
00059 
00060 /* Get and set Subproperties and other Subobjects */
00061 
00062 string Metadata::get_title() {
00063     string s;
00064     rREF(Vobject&, v, findObject("misc:title"), s = meta_cast<Property&>(v).read(); );
00065     return s;
00066 }
00067 
00068 string Metadata::get_title_datatype() {
00069     string s;
00070     rREF(Vobject&, v, findObject("misc:title"), s = meta_cast<Property&>(v).getDataType(); );
00071     return s;
00072 }
00073 
00074 void Metadata::set_title(const string& value, const string& datatype) {
00075     Property::setProperty(*this, "misc:title", value, datatype, defaultPropertyAC);
00076 }
00077 
00078 string Metadata::get_description() {
00079     string s;
00080     rREF(Vobject&, v, findObject("misc:description"), s = meta_cast<Property&>(v).read(); );
00081     return s;
00082 }
00083 
00084 string Metadata::get_description_datatype() {
00085     string s;
00086     rREF(Vobject&, v, findObject("misc:description"), s = meta_cast<Property&>(v).getDataType(); );
00087     return s;
00088 }
00089 
00090 void Metadata::set_description(const string& value, const string& datatype) {
00091     Property::setProperty(*this, "misc:description", value, datatype, defaultPropertyAC);
00092 }
00093 
00094 string Metadata::get_author() {
00095     string s;
00096     rREF(Vobject&, v, findObject("misc:author"), s = meta_cast<Property&>(v).read(); );
00097     return s;
00098 }
00099 
00100 string Metadata::get_author_datatype() {
00101     string s;
00102     rREF(Vobject&, v, findObject("misc:author"), s = meta_cast<Property&>(v).getDataType(); );
00103     return s;
00104 }
00105 
00106 void Metadata::set_author(const string& value, const string& datatype) {
00107     Property::setProperty(*this, "misc:author", value, datatype, defaultPropertyAC);
00108 }
00109 
00110 string Metadata::get_author_url() {
00111     string s;
00112     rREF(Vobject&, v, findObject("misc:author_url"), s = meta_cast<Property&>(v).read(); );
00113     return s;
00114 }
00115 
00116 string Metadata::get_author_url_datatype() {
00117     string s;
00118     rREF(Vobject&, v, findObject("misc:author_url"), s = meta_cast<Property&>(v).getDataType(); );
00119     return s;
00120 }
00121 
00122 void Metadata::set_author_url(const string& value, const string& datatype) {
00123     Property::setProperty(*this, "misc:author_url", value, datatype, defaultPropertyAC);
00124 }
00125 
00126 string Metadata::get_creation_time() {
00127     string s;
00128     rREF(Vobject&, v, findObject("misc:creation_time"), s = meta_cast<Property&>(v).read(); );
00129     return s;
00130 }
00131 
00132 string Metadata::get_creation_time_datatype() {
00133     string s;
00134     rREF(Vobject&, v, findObject("misc:creation_time"), s = meta_cast<Property&>(v).getDataType(); );
00135     return s;
00136 }
00137 
00138 void Metadata::set_creation_time(const string& value, const string& datatype) {
00139     Property::setProperty(*this, "misc:creation_time", value, datatype, defaultPropertyAC);
00140 }
00141 
00142 string Metadata::get_modification_time() {
00143     string s;
00144     rREF(Vobject&, v, findObject("misc:modification_time"), s = meta_cast<Property&>(v).read(); );
00145     return s;
00146 }
00147 
00148 string Metadata::get_modification_time_datatype() {
00149     string s;
00150     rREF(Vobject&, v, findObject("misc:modification_time"), s = meta_cast<Property&>(v).getDataType(); );
00151     return s;
00152 }
00153 
00154 void Metadata::set_modification_time(const string& value, const string& datatype) {
00155     Property::setProperty(*this, "misc:modification_time", value, datatype, defaultPropertyAC);
00156 }
00157 
00158 string Metadata::get_copyright() {
00159     string s;
00160     rREF(Vobject&, v, findObject("misc:copyright"), s = meta_cast<Property&>(v).read(); );
00161     return s;
00162 }
00163 
00164 string Metadata::get_copyright_datatype() {
00165     string s;
00166     rREF(Vobject&, v, findObject("misc:copyright"), s = meta_cast<Property&>(v).getDataType(); );
00167     return s;
00168 }
00169 
00170 void Metadata::set_copyright(const string& value, const string& datatype) {
00171     Property::setProperty(*this, "misc:copyright", value, datatype, defaultPropertyAC);
00172 }
00173 
00174 string Metadata::get_version() {
00175     string s;
00176     rREF(Vobject&, v, findObject("misc:version"), s = meta_cast<Property&>(v).read(); );
00177     return s;
00178 }
00179 
00180 string Metadata::get_version_datatype() {
00181     string s;
00182     rREF(Vobject&, v, findObject("misc:version"), s = meta_cast<Property&>(v).getDataType(); );
00183     return s;
00184 }
00185 
00186 void Metadata::set_version(const string& value, const string& datatype) {
00187     Property::setProperty(*this, "misc:version", value, datatype, defaultPropertyAC);
00188 }
00189 
00190 string Metadata::get_language() {
00191     string s;
00192     rREF(Vobject&, v, findObject("misc:language"), s = meta_cast<Property&>(v).read(); );
00193     return s;
00194 }
00195 
00196 string Metadata::get_language_datatype() {
00197     string s;
00198     rREF(Vobject&, v, findObject("misc:language"), s = meta_cast<Property&>(v).getDataType(); );
00199     return s;
00200 }
00201 
00202 void Metadata::set_language(const string& value, const string& datatype) {
00203     Property::setProperty(*this, "misc:language", value, datatype, defaultPropertyAC);
00204 }
00205 
00206 string Metadata::get_comment() {
00207     string s;
00208     rREF(Vobject&, v, findObject("misc:comment"), s = meta_cast<Property&>(v).read(); );
00209     return s;
00210 }
00211 
00212 string Metadata::get_comment_datatype() {
00213     string s;
00214     rREF(Vobject&, v, findObject("misc:comment"), s = meta_cast<Property&>(v).getDataType(); );
00215     return s;
00216 }
00217 
00218 void Metadata::set_comment(const string& value, const string& datatype) {
00219     Property::setProperty(*this, "misc:comment", value, datatype, defaultPropertyAC);
00220 }
00221 
00222 
00223 /* Process local object messages */
00224 void LocalMetadata::sendMessage(Message* m) {
00225 
00226 
00227     /* Let superclass have message */
00228     Metadata::sendMessage(m);
00229 }
00230 
00231 
00232 
00233 
00234 
00235 /* Process remote update messages */
00236 void RemoteMetadata::sendUpdateMessage(Message* m) {
00237 
00238 
00239     /* branch to update message handlers specific to RemoteMetadata */
00240 
00241     /* let superclass have message... */
00242     Metadata::sendUpdateMessage(m);
00243 }
00244 
00245 /* Local Actuators: */
00246 
00247 /* Message Handlers:  */
00248 
00249     /* TODO you might wantto override some of these methods in LocalMetadata  and RemoteMetadata */
00250 
00251 /* Remote Actuators: */
00252 
00253 
00254 /* Generators for factory */
00255 
00256 
00257 MetaObject* LocalMetadata::new_LocalMetadata(MetaObject* s, const string& type) {
00258     LocalMetadata* o = new LocalMetadata(s);
00259     o->initialize();
00260     return o;
00261 }
00262 
00263 MetaObject* RemoteMetadata::new_RemoteMetadata(MetaObject* s, const string& type) {
00264     return new RemoteMetadata(s);
00265 }
00266 

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