Go to the documentation of this file.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
00027
00028
00029
00030 #include "class_loader/meta_object.h"
00031 #include "class_loader/class_loader.h"
00032
00033 namespace class_loader
00034 {
00035 namespace class_loader_private
00036 {
00037
00038 AbstractMetaObjectBase::AbstractMetaObjectBase(const std::string& class_name, const std::string& base_class_name) :
00039 associated_library_path_("Unknown"),
00040 base_class_name_(base_class_name),
00041 class_name_(class_name),
00042 typeid_base_class_name_("UNSET")
00043
00044 {
00045 CONSOLE_BRIDGE_logDebug("class_loader.class_loader_private.AbstractMetaObjectBase: Creating MetaObject %p (base = %s, derived = %s, library path = %s)", this, baseClassName().c_str(), className().c_str(), getAssociatedLibraryPath().c_str());
00046 }
00047
00048 AbstractMetaObjectBase::~AbstractMetaObjectBase()
00049
00050 {
00051 CONSOLE_BRIDGE_logDebug("class_loader.class_loader_private.AbstractMetaObjectBase: Destroying MetaObject %p (base = %s, derived = %s, library path = %s)", this, baseClassName().c_str(), className().c_str(), getAssociatedLibraryPath().c_str());
00052 }
00053
00054 std::string AbstractMetaObjectBase::className() const
00055
00056 {
00057 return class_name_;
00058 }
00059
00060 std::string AbstractMetaObjectBase::baseClassName() const
00061
00062 {
00063 return base_class_name_;
00064 }
00065
00066 std::string AbstractMetaObjectBase::typeidBaseClassName() const
00067
00068 {
00069 return typeid_base_class_name_;
00070 }
00071
00072 std::string AbstractMetaObjectBase::getAssociatedLibraryPath()
00073
00074 {
00075 return(associated_library_path_);
00076 }
00077
00078 void AbstractMetaObjectBase::setAssociatedLibraryPath(std::string library_path)
00079
00080 {
00081 associated_library_path_ = library_path;
00082 }
00083
00084 void AbstractMetaObjectBase::addOwningClassLoader(ClassLoader* loader)
00085
00086 {
00087 ClassLoaderVector& v = associated_class_loaders_;
00088 if(std::find(v.begin(), v.end(), loader) == v.end())
00089 v.push_back(loader);
00090 }
00091
00092 void AbstractMetaObjectBase::removeOwningClassLoader(const ClassLoader* loader)
00093
00094 {
00095 ClassLoaderVector& v = associated_class_loaders_;
00096 ClassLoaderVector::iterator itr = std::find(v.begin(), v.end(), loader);
00097 if(itr != v.end())
00098 v.erase(itr);
00099 }
00100
00101 bool AbstractMetaObjectBase::isOwnedBy(const ClassLoader* loader)
00102
00103 {
00104 ClassLoaderVector& v = associated_class_loaders_;
00105 ClassLoaderVector::iterator itr = std::find(v.begin(), v.end(), loader);
00106 return(itr != v.end());
00107 }
00108
00109 bool AbstractMetaObjectBase::isOwnedByAnybody()
00110
00111 {
00112 return(associated_class_loaders_.size() > 0);
00113 }
00114
00115 ClassLoaderVector AbstractMetaObjectBase::getAssociatedClassLoaders()
00116
00117 {
00118 return(associated_class_loaders_);
00119 }
00120
00121 }
00122
00123
00124 }