-
首页
-
C4D R23.110 C++ SDK
ObjectInterface Class Reference
系统
#include <objectbase.h>
详细描述
ObjectInterface
is the root of the interface hierarchy of the MAXON API. As a C++ class, each virtual interface is directly derived from
ObjectInterface
, but as an interface a virtual interface may have an arbitrary number of base interfaces, all of which have
ObjectInterface
as direct or indirect base interface. The interface hierarchy is reflected by the Ptr, ConstPtr and reference classes of the interfaces: They have conversion operators to all base interfaces, and they contain functions for all methods of the interface and its base interfaces.
ObjectInterface
provides some general inheritance-related functions such as
GetClass()
and
IsInstanceOf()
, data-related functions such as
Clone()
and
CopyFrom()
, and virtual methods such as
ToString()
which are required for each object.
所有
ObjectInterface
instances are reference-counted. Within the declaration of an interface you may choose the reference behaviour on invocation of a non-const method (normal, const, copy-on-write).
公共成员函数
|
Ptr
|
GetPtr
()
|
ConstPtr
|
GetPtr
() const
|
template<typename INTERFACE = ObjectInterface>
|
const
MAXON_FUNCTION
maxon::Class
< typename INTERFACE::Hxx1::ReferenceClass > &
|
GetClass
() const
|
const
MAXON_FUNCTION
ClassInfo *
|
GetClassInfo
() const
|
template<typename REF >
|
const ComponentInfo &
|
GetComponentInfoOfSuper
(const REF *sptr,
OverloadRank0
) const
MAXON_IF_TARGET_DEBUG
(
|
template<typename REF , typename = typename REF::Component::ComponentClass>
|
const ComponentInfo &
|
GetComponentInfoOfSuper
(const REF *sptr,
OverloadRank1
) const
|
MAXON_FUNCTION
Bool
|
HasSameClass
(const
ObjectInterface
*obj) const
|
Result
< void >
|
CopyFrom
(const
ObjectInterface
*
src
)
|
Result
<
ObjectInterface
* >
|
Clone
() const
|
template<typename REFCLASS >
|
MAXON_FUNCTION
Result
< REFCLASS >
|
Clone
() const
|
template<typename I >
|
MAXON_FUNCTION
Bool
|
IsInstanceOf
() const
|
MAXON_FUNCTION
Bool
|
IsInstanceOf
(const
DataType
&type) const
|
MAXON_METHOD
String
|
ToString
(const
FormatStatement
*formatStatement=nullptr) const
|
MAXON_METHOD
Result
< void >
|
InitObject
(const void *argument)
|
MAXON_METHOD
Result
< void >
|
HandleMessage
(const
InternedId
&message, const void *argument)
|
MAXON_METHOD
Bool
|
IsEqual
(const
maxon::ObjectInterface
*other) const
|
MAXON_METHOD
COMPARERESULT
|
比较
(const
maxon::ObjectInterface
*other) const
|
MAXON_FUNCTION
HashInt
|
GetHashCode
() const
|
MAXON_METHOD
HashInt
|
GetHashCodeImpl
() const
|
MAXON_METHOD
HashValue
|
GetHashValueImpl
() const
|
|
MAXON_ADD_TO_CONST_REFERENCE_CLASS
(
Bool
operator==(std::nullptr_t) const { return
RefCompare
<
MAXON_IS_COW_KIND
(S::Handler::KIND), true >::template
IsEqual
< const
ObjectInterface
*, const
ObjectInterface
* >(this->GetPointer(), nullptr);})
|
|
MAXON_ADD_TO_CONST_REFERENCE_CLASS
(
Bool
operator!=(std::nullptr_t) const { return !
RefCompare
<
MAXON_IS_COW_KIND
(S::Handler::KIND), true >::template
IsEqual
< const
ObjectInterface
*, const
ObjectInterface
* >(this->GetPointer(), nullptr);})
|
|
MAXON_ADD_TO_CONST_REFERENCE_CLASS
(
Bool
operator==(const
ObjectInterface
*ref) const { return
RefCompare
<
MAXON_IS_COW_KIND
(S::Handler::KIND), true >::template
IsEqual
< const
ObjectInterface
*, const
ObjectInterface
* >(this->GetPointer(), ref);})
|
|
MAXON_ADD_TO_CONST_REFERENCE_CLASS
(
Bool
operator!=(const
ObjectInterface
*ref) const { return !
RefCompare
<
MAXON_IS_COW_KIND
(S::Handler::KIND), true >::template
IsEqual
< const
ObjectInterface
*, const
ObjectInterface
* >(this->GetPointer(), ref);})
|
|
MAXON_ADD_TO_CONST_REFERENCE_CLASS
(
Bool
operator==(
ObjectInterface
*ref) const { return
RefCompare
<
MAXON_IS_COW_KIND
(S::Handler::KIND), true >::template
IsEqual
< const
ObjectInterface
*, const
ObjectInterface
* >(this->GetPointer(), ref);})
|
|
MAXON_ADD_TO_CONST_REFERENCE_CLASS
(
Bool
operator!=(
ObjectInterface
*ref) const { return !
RefCompare
<
MAXON_IS_COW_KIND
(S::Handler::KIND), true >::template
IsEqual
< const
ObjectInterface
*, const
ObjectInterface
* >(this->GetPointer(), ref);})
|
|
MAXON_ADD_TO_CONST_REFERENCE_CLASS
(template< typename T >
Bool
operator==(T *ref) const { return
RefCompare
<
MAXON_IS_COW_KIND
(S::Handler::KIND), true >::template
IsEqual
< const
ObjectInterface
*, const
ObjectInterface
* >(this->GetPointer(), ref);})
|
|
MAXON_ADD_TO_CONST_REFERENCE_CLASS
(template< typename T >
Bool
operator!=(T *ref) const { return !
RefCompare
<
MAXON_IS_COW_KIND
(S::Handler::KIND), true >::template
IsEqual
< const
ObjectInterface
*, const
ObjectInterface
* >(this->GetPointer(), ref);})
|
Bool
|
PrivateIsInstanceOf
(const
DataType
&type) const
|
Member Typedef Documentation
◆
接口
◆
IsAllocType
◆
Ptr
◆
ConstPtr
◆
BaseInterface
构造函数 & 析构函数文档编制
◆
~ ObjectInterface()
◆
ObjectInterface()
[1/3]
◆
ObjectInterface()
[2/3]
◆
ObjectInterface()
[3/3]
成员函数文档编制
◆
GetInterfaceId()
◆
Alloc()
[1/2]
◆
GetPtr()
[1/2]
◆
GetPtr()
[2/2]
◆
PrivateInstantiateNullValueHelper()
static
maxon::Int
PrivateInstantiateNullValueHelper
|
(
|
|
)
|
|
|
static
|
◆
PrivateGetInterface()
static maxon::InterfaceReference* PrivateGetInterface
|
(
|
|
)
|
|
|
static
|
◆
Alloc()
[2/2]
◆
GetInfoOffset()
◆
operator=()
◆
PrivateCheckClass()
void PrivateCheckClass
|
(
|
|
)
|
|
|
private
|
◆
NullValuePtr()
static std::nullptr_t NullValuePtr
|
(
|
|
)
|
|
|
static
|
◆
GetClass()
Returns the class of this object. Each object holds a strong reference on its class.
-
返回
-
Class
of this object. @MAXON_ANNOTATION{interfaceParameter=INTERFACE}
◆
GetClassInfo()
Returns the class information of this object.
-
返回
-
Class
information of this object.
◆
GetComponentInfoOfSuper()
[1/2]
const ComponentInfo& GetComponentInfoOfSuper
|
(
|
const REF *
|
sptr
,
|
|
|
OverloadRank0
|
|
|
)
|
|
const
|
◆
GetComponentInfoOfSuper()
[2/2]
const ComponentInfo& GetComponentInfoOfSuper
|
(
|
const REF *
|
sptr
,
|
|
|
OverloadRank1
|
|
|
)
|
|
const
|
◆
HasSameClass()
Tests if this object has the same class as another object obj.
-
参数
-
-
返回
-
True if both objects have the same class.
◆
CopyFrom()
Copies the data from a source object to this object. This object needs to have a matching component for each component of the source (there may be additional components). Copying is done per component by the CopyFrom function of components.
-
参数
-
-
返回
-
OK on success (for each component of
src
there is a matching component in this object, and copying the component data succeeded).
◆
Clone()
[1/2]
Clones this object. The result is a new object of the same class where each component is a copy of the corresponding component of this object (as implemented by the CopyFrom function of components).
-
返回
-
Clone of this object.
◆
Clone()
[2/2]
Clones this object. The result is a reference to a new object of the same class where each component is a copy of the corresponding component of this object (as implemented by the CopyFrom function of components).
-
返回
-
Clone of this object. @MAXON_ANNOTATION{refclassParameter=REFCLASS}
◆
IsInstanceOf()
[1/2]
Checks if this object is an instance of the given interface
I
. This is the case if the class of this object has a component which implements
I
.
-
Template Parameters
-
I
|
The interface to check.
|
-
返回
-
True if this object is an instance of #I, false otherwise.
◆
IsInstanceOf()
[2/2]
Checks if this object is an instance of the given data type. This is the case if the
type
is an object type and if the class of this object implements each interface of the object type.
-
参数
-
[in]
|
type
|
The data type to check.
|
-
返回
-
True if this object is an instance of #type, false otherwise.
◆
ToString()
Returns a readable string of the content.
-
参数
-
[in]
|
formatStatement
|
Nullptr or additional formatting instruction. Currently no additional formatting instructions are supported.
|
-
返回
-
The converted result. By default, this is the name of the class, followed by @, followed by the hexadecimal memory address of this object.
◆
InitObject()
Initializes the object. This method is invoked implicitly when a new object is created (after
InitComponent
has been invoked for each component). When the initialization fails, the new object is deleted immediately.
-
参数
-
[in]
|
argument
|
Unused for now.
|
-
返回
-
Success of initialization.
◆
HandleMessage()
Handles a generic message. The supported messages are defined by the class of the object. The default implementation returns UnsupportedOperationError.
-
参数
-
[in]
|
message
|
The message identifier.
|
[in]
|
argument
|
A message-specific argument.
|
-
返回
-
Success of message handling.
◆
IsEqual()
Compares this and #other for equality. If you implement this method in a component, make sure to incorporate the result of the super implementation in the result.
-
参数
-
[in]
|
other
|
Another object.
|
-
返回
-
True if both object are equal, false otherwise.
◆
Compare()
Compares this and #other. If you implement this method in a component, make sure to incorporate the result of the super implementation in the result.
-
参数
-
[in]
|
other
|
Another object.
|
-
返回
-
Result
of the comparison.
◆
GetHashCode()
Returns a hash code for this object.
-
返回
-
Hash code for this object. @MAXON_ANNOTATION{refclass=false}
◆
GetHashCodeImpl()
Returns a hash code for this object. If you implement this method in a component, make sure to incorporate the result of the super implementation in the result.
-
返回
-
Hash code for this object.
◆
GetHashValueImpl()
◆
MAXON_ADD_TO_CONST_REFERENCE_CLASS()
[1/8]
◆
MAXON_ADD_TO_CONST_REFERENCE_CLASS()
[2/8]
◆
MAXON_ADD_TO_CONST_REFERENCE_CLASS()
[3/8]
◆
MAXON_ADD_TO_CONST_REFERENCE_CLASS()
[4/8]
◆
MAXON_ADD_TO_CONST_REFERENCE_CLASS()
[5/8]
◆
MAXON_ADD_TO_CONST_REFERENCE_CLASS()
[6/8]
◆
MAXON_ADD_TO_CONST_REFERENCE_CLASS()
[7/8]
◆
MAXON_ADD_TO_CONST_REFERENCE_CLASS()
[8/8]
◆
PrivateIsInstanceOf()
◆
PrivateFreeInstance()
◆
RemoveReference()
void RemoveReference
|
(
|
|
)
|
const
|
|
protected
|
◆
PrivateDestructInstance()
Friends And Related Function Documentation
◆
maxon::ClassInterface
◆
maxon::ComponentDescriptor
◆
maxon::StrongCOWRefHandler
◆
ComponentWrapper
friend class ComponentWrapper
|
friend
|
◆
StrongRefHandler
◆
ClassImpl
friend class ClassImpl
|
friend
|
Member Data Documentation
◆
_interface
maxon::InterfaceReference _interface
|
static
|
◆
_staticInterface
maxon::NonvirtualInterfaceReference _staticInterface
|
static
|
◆
MAXON_ENUM_LIST_CLASS
◆
REFERENCE_KIND
const maxon::EntityBase::FLAGS REFERENCE_KIND
|
static
|
◆
INTERFACE_FLAGS
const EntityBase::FLAGS INTERFACE_FLAGS
|
static
|