#include <RunTimeTyped.h>

Classes | |
| struct | TypeDescription |
Public Types | |
| typedef RefCounted | BaseClass |
| A typedef for the class this class derives from. All RunTimeTyped classes define this typedef. | |
Public Member Functions | |
| IE_CORE_DECLAREMEMBERPTR (RunTimeTyped) | |
| RunTimeTyped () | |
| virtual | ~RunTimeTyped () |
Protected Types | |
| typedef std::map< TypeId, TypeId > | BaseTypeRegistryMap |
| typedef std::map< TypeId, std::vector< TypeId > > | BaseTypesRegistryMap |
| typedef std::map< TypeId, std::set< TypeId > > | DerivedTypesRegistryMap |
| typedef std::map< TypeId, std::string > | TypeIdsToTypeNamesMap |
| typedef std::map< std::string, TypeId > | TypeNamesToTypeIdsMap |
Static Protected Member Functions | |
| static BaseTypeRegistryMap & | baseTypeRegistry () |
| static DerivedTypesRegistryMap & | derivedTypesRegistry () |
| static BaseTypesRegistryMap & | completeBaseTypesRegistry () |
| static DerivedTypesRegistryMap & | completeDerivedTypesRegistry () |
| static void | derivedTypeIdsWalk (TypeId typeId, std::set< TypeId > &) |
| static TypeIdsToTypeNamesMap & | typeIdsToTypeNames () |
| static TypeNamesToTypeIdsMap & | typeNamesToTypeIds () |
Type identification functions. | |
| These functions provide useful queries about the typing of both classes and instances. They must be reimplemented appropriately in all derived classes. This is achieved through the use of the IE_CORE_DECLARERUNTIMETYPED macro. | |
| virtual TypeId | typeId () const |
| virtual const char * | typeName () const |
| virtual bool | isInstanceOf (TypeId typeId) const |
| virtual bool | isInstanceOf (const char *typeName) const |
| static TypeId | staticTypeId () |
| Returns the TypeId for this class, without needing an instance. | |
| static const char * | staticTypeName () |
| Returns the type name for this class, without needing an instance. | |
| static TypeId | baseTypeId () |
| static const char * | baseTypeName () |
| static bool | inheritsFrom (TypeId typeId) |
| Returns true if this class inherits from the specified type. | |
| static bool | inheritsFrom (const char *typeName) |
| Returns true if this class inherits from the specified type. | |
| static TypeId | baseTypeId (TypeId typeId) |
| Returns the base type of the given type, or InvalidTypeId if no such base exists. | |
| static const std::vector < TypeId > & | baseTypeIds (TypeId typeId) |
| static const std::set< TypeId > & | derivedTypeIds (TypeId typeId) |
| static TypeId | typeIdFromTypeName (const char *typeName) |
| static const char * | typeNameFromTypeId (TypeId typeId) |
| static void | registerType (TypeId derivedTypeId, const char *derivedTypeName, TypeId baseTypeId) |
| Allows external modules to register their own type ids. | |
1) The GCC implentation of the C++ system breaks down with templated types across module boundaries.
2) We wish to use the type system to identify the type of serialised objects in files (see the serialisation interface defined in Object), but the C++ type_info object provides us with no information we can usefully use for that.
A typedef for the class this class derives from. All RunTimeTyped classes define this typedef.
Reimplemented in IECoreGL::TypedStateComponent< T, TId >.
typedef std::map< TypeId, TypeId > IECore::RunTimeTyped::BaseTypeRegistryMap [protected] |
typedef std::map< TypeId, std::vector<TypeId> > IECore::RunTimeTyped::BaseTypesRegistryMap [protected] |
typedef std::map< TypeId, std::set< TypeId > > IECore::RunTimeTyped::DerivedTypesRegistryMap [protected] |
typedef std::map<TypeId, std::string> IECore::RunTimeTyped::TypeIdsToTypeNamesMap [protected] |
typedef std::map<std::string, TypeId> IECore::RunTimeTyped::TypeNamesToTypeIdsMap [protected] |
| RunTimeTyped::RunTimeTyped | ( | ) |
| RunTimeTyped::~RunTimeTyped | ( | ) | [virtual] |
Returns the base type of the given type, or InvalidTypeId if no such base exists.
References baseTypeRegistry(), and IECore::InvalidTypeId.
| TypeId RunTimeTyped::baseTypeId | ( | ) | [static] |
Returns the TypeId of the base of this class, without needing an instance. The base type of RunTimeTyped itself is defined to be InvalidTypeId;
Reimplemented in IECoreGL::TypedStateComponent< T, TId >.
References IECore::InvalidTypeId.
Referenced by baseTypeIds(), and IECoreMaya::ParameterHandler::create().
Returns all bases of the given type, or an empty vector if no such bases exist. The elements are ordered by "distance" from the given TypeId. That is to say, the first element will be the immediate base class, and the last elemenet will be RunTimeTyped. Should not be called during static initialization as it's likely that not all types will have been registered at that point, so to do so would yield an incomplete list.
References baseTypeId(), completeBaseTypesRegistry(), and IECore::InvalidTypeId.
| const char * RunTimeTyped::baseTypeName | ( | ) | [static] |
Returns the type name of the base of this class, without needing an instance. The base type name of RunTimeTyped itself is defined to be "InvalidType";
Reimplemented in IECoreGL::TypedStateComponent< T, TId >.
| RunTimeTyped::BaseTypeRegistryMap & RunTimeTyped::baseTypeRegistry | ( | ) | [static, protected] |
Referenced by baseTypeId(), and registerType().
| RunTimeTyped::BaseTypesRegistryMap & RunTimeTyped::completeBaseTypesRegistry | ( | ) | [static, protected] |
Referenced by baseTypeIds().
| RunTimeTyped::DerivedTypesRegistryMap & RunTimeTyped::completeDerivedTypesRegistry | ( | ) | [static, protected] |
Referenced by derivedTypeIds().
Returns all derived types of the given type, or an empty set if no such derived types exist. Should not be called during static initialization as it's likely that not all types will have been registered at that point, so to do so would yield an incomplete list.
References completeDerivedTypesRegistry(), and derivedTypeIdsWalk().
Referenced by IECoreHoudini::FromHoudiniGeometryConverter::create(), IECore::Writer::supportedExtensions(), and IECore::Reader::supportedExtensions().
| void RunTimeTyped::derivedTypeIdsWalk | ( | TypeId | typeId, | |
| std::set< TypeId > & | typeIds | |||
| ) | [static, protected] |
Termination condition: No derived types
References derivedTypesRegistry().
Referenced by derivedTypeIds().
| RunTimeTyped::DerivedTypesRegistryMap & RunTimeTyped::derivedTypesRegistry | ( | ) | [static, protected] |
Referenced by derivedTypeIdsWalk(), and registerType().
| IECore::RunTimeTyped::IE_CORE_DECLAREMEMBERPTR | ( | RunTimeTyped | ) |
| bool RunTimeTyped::inheritsFrom | ( | const char * | typeName | ) | [static] |
Returns true if this class inherits from the specified type.
Reimplemented in IECoreGL::TypedStateComponent< T, TId >.
| bool RunTimeTyped::inheritsFrom | ( | TypeId | typeId | ) | [static] |
Returns true if this class inherits from the specified type.
Reimplemented in IECoreGL::TypedStateComponent< T, TId >.
| bool RunTimeTyped::isInstanceOf | ( | const char * | typeName | ) | const [virtual] |
Returns true if this object is an instance of the specified type, or of a class inherited from the specified type.
Reimplemented in IECoreGL::TypedStateComponent< T, TId >.
References staticTypeName().
| bool RunTimeTyped::isInstanceOf | ( | TypeId | typeId | ) | const [virtual] |
Returns true if this object is an instance of the specified type, or of a class inherited from the specified type.
Reimplemented in IECoreGL::TypedStateComponent< T, TId >.
References staticTypeId().
Referenced by IECore::Object::copyFrom(), and IECore::ObjectParameter::valueValid().
| void RunTimeTyped::registerType | ( | TypeId | derivedTypeId, | |
| const char * | derivedTypeName, | |||
| TypeId | baseTypeId | |||
| ) | [static] |
Allows external modules to register their own type ids.
Use the lower-bound as a hint for the position, yielding constant insert time
Inserted derived type id into set of base classes derived type ids
Put in id->name map
Use the lower-bound as a hint for the position, yielding constant insert time
Put in name->id map
Use the lower-bound as a hint for the position, yielding constant insert time
References baseTypeRegistry(), derivedTypesRegistry(), IECore::msg(), typeIdFromTypeName(), typeIdsToTypeNames(), typeNameFromTypeId(), typeNamesToTypeIds(), and IECore::MessageHandler::Warning.
| TypeId RunTimeTyped::staticTypeId | ( | ) | [static] |
Returns the TypeId for this class, without needing an instance.
Reimplemented in IECoreGL::TypedStateComponent< T, TId >.
References IECore::RunTimeTypedTypeId.
Referenced by IECore::Group::addState(), IECoreGL::ShaderStateComponent::bind(), IECoreRI::RIBWriter::canWrite(), IECoreGL::PointsPrimitive::dataAndStride(), IECoreGL::CameraController::dolly(), IECoreHoudini::FromHoudiniGroupConverter::doPrimitiveConversion(), IECoreMaya::MeshParameterHandler::doSetValue(), IECore::ObjectWriter::doWrite(), IECore::EnvMapSHProjector::EnvMapSHProjector(), IECoreGL::CameraController::frame(), isInstanceOf(), IECore::PointsPrimitiveEvaluator::PointsPrimitiveEvaluator(), IECore::CameraController::setCamera(), IECoreGL::Shader::setUniformParameter(), IECoreGL::CameraController::track(), typeId(), IECoreGL::Shader::uniformParameterType(), IECoreGL::Shader::uniformValueValid(), IECore::Parameter::valueValid(), and IECore::VectorDataFilterOp::VectorDataFilterOp().
| const char * RunTimeTyped::staticTypeName | ( | ) | [static] |
Returns the type name for this class, without needing an instance.
Reimplemented in IECoreGL::TypedStateComponent< T, TId >.
Referenced by IECore::NumericParameter< T >::getNumericValue(), isInstanceOf(), IECore::TypedData< T >::load(), typeName(), and IECore::NumericParameter< T >::valueValid().
| TypeId RunTimeTyped::typeId | ( | ) | const [virtual] |
Returns a unique numeric identifier for the type of this instance. For classes defined in the core library this should be a member of the TypeId enum defined in IECore/TypeIds.h
Reimplemented in IECoreGL::TypedStateComponent< T, TId >.
References staticTypeId().
Referenced by IECore::Object::copyFrom(), IECoreHoudini::ToHoudiniGeometryConverter::create(), IECoreHoudini::ToHoudiniAttribConverter::create(), IECoreGL::PointsPrimitive::dataAndStride(), IECore::RandomRotationOp::doOperation(), IECore::PointNormalsOp::doOperation(), IECore::PointMeshOp::doOperation(), IECore::PointDensitiesOp::doOperation(), IECore::PointBoundsOp::doOperation(), IECore::DataCastOp::doOperation(), IECore::Object::isEqualTo(), IECore::FrameList::isEqualTo(), IECore::MeshDistortionsOp::modifyTypedPrimitive(), IECoreGL::Shader::setUniformParameter(), IECoreGL::Shader::setVertexParameter(), IECoreGL::Shader::uniformValueValid(), IECore::Parameter::valueValid(), and IECoreGL::Shader::vertexValueValid().
| TypeId RunTimeTyped::typeIdFromTypeName | ( | const char * | typeName | ) | [static] |
Returns the corresponding TypeId for the specified typeName, or InvalidTypeId if typeName is not a registered type.
References IECore::InvalidTypeId, and typeNamesToTypeIds().
Referenced by registerType().
| RunTimeTyped::TypeIdsToTypeNamesMap & RunTimeTyped::typeIdsToTypeNames | ( | ) | [static, protected] |
Referenced by registerType(), and typeNameFromTypeId().
| const char * RunTimeTyped::typeName | ( | ) | const [virtual] |
Returns a unique name for the type of this instance. This should be implemented to return the class name.
Reimplemented in IECoreGL::TypedStateComponent< T, TId >.
References staticTypeName().
Referenced by IECore::Object::copyFrom(), IECore::DataCastOp::doOperation(), IECore::ObjectWriter::doWrite(), IECore::Object::Object::SaveContext::save(), IECoreGL::Shader::setVertexParameter(), and IECore::CompoundParameter::valueValid().
| const char * RunTimeTyped::typeNameFromTypeId | ( | TypeId | typeId | ) | [static] |
Returns the corresponding typeName for the specified TypeId, or InvalidTypeId if typeId is not a registered type.
References typeIdsToTypeNames().
Referenced by IECore::DataCastOp::doOperation(), IECore::YUVImageWriter::YUVImageWriter::ChannelConverter::YUVImageWriter::ChannelConverter::ErrorHandler::operator()(), IECore::UniformRandomPointDistributionOp::UniformRandomPointDistributionOp::DistributeFn::UniformRandomPointDistributionOp::DistributeFn::ErrorHandler::operator()(), IECore::TriangulateOp::TriangulateOp::TriangulateFn::TriangulateOp::TriangulateFn::ErrorHandler::operator()(), IECore::TIFFImageWriter::TIFFImageWriter::ChannelConverter< ChannelData >::TIFFImageWriter::ChannelConverter::ErrorHandler::operator()(), IECore::TGAImageWriter::TGAImageWriter::ChannelConverter::TGAImageWriter::ChannelConverter::ErrorHandler::operator()(), IECore::MeshPrimitiveShrinkWrapOp::MeshPrimitiveShrinkWrapOp::ShrinkWrapFn::MeshPrimitiveShrinkWrapOp::ShrinkWrapFn::ErrorHandler::operator()(), IECore::JPEGImageWriter::JPEGImageWriter::ChannelConverter::JPEGImageWriter::ChannelConverter::ErrorHandler::operator()(), IECore::ImageCompositeOp::ImageCompositeOp::ChannelConverter::ImageCompositeOp::ChannelConverter::ErrorHandler::operator()(), IECore::DPXImageWriter::DPXImageWriter::ChannelConverter::DPXImageWriter::ChannelConverter::ErrorHandler::operator()(), IECore::DataPromoteOp::DataPromoteOp::Promote1Fn::DataPromoteOp::Promote1Fn::Func< F, typename boost::enable_if< TypeTraits::IsNumericSimpleTypedData< F > >::type >::operator()(), IECore::DataPromoteOp::DataPromoteOp::Promote1Fn::DataPromoteOp::Promote1Fn::Func< F, typename boost::enable_if< TypeTraits::IsNumericVectorTypedData< F > >::type >::operator()(), IECore::CurveExtrudeOp::CurveExtrudeOp::UniformFn::CurveExtrudeOp::UniformFn::ErrorHandler::operator()(), IECore::CurveExtrudeOp::CurveExtrudeOp::VertexFn::CurveExtrudeOp::VertexFn::ErrorHandler::operator()(), IECore::CurveExtrudeOp::CurveExtrudeOp::VaryingFn::CurveExtrudeOp::VaryingFn::ErrorHandler::operator()(), IECore::CINImageWriter::CINImageWriter::ChannelConverter::CINImageWriter::ChannelConverter::ErrorHandler::operator()(), registerType(), and IECore::ObjectParameter::valueValid().
| RunTimeTyped::TypeNamesToTypeIdsMap & RunTimeTyped::typeNamesToTypeIds | ( | ) | [static, protected] |
Referenced by registerType(), and typeIdFromTypeName().
1.5.8