00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include <archon/x3d/server/custom_field.H>
00027
00028 namespace Archon
00029 {
00030 namespace X3D
00031 {
00038 bool CustomFieldNode::addCustomField(Ref<CustomFieldBase> f)
00039 throw(RealizedException)
00040 {
00041 if(lookupField(f->getName())) return false;
00042 Mutex::Lock l(mutex);
00043 if(isRealizedNoLock()) ARCHON_THROW(RealizedException);
00044 customFields.push_back(f);
00045 return true;
00046 }
00047
00048 const FieldBase *CustomFieldNode::lookupField(string name) const
00049 {
00050 {
00051 Mutex::Lock l(mutex);
00052 for(unsigned i=0; i<customFields.size(); ++i)
00053 {
00054 const FieldBase *f = customFields[i].get();
00055 if(f->getName() == name) return f;
00056 }
00057 }
00058 return getType()->lookupField(name);
00059 }
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070 }
00071 }