-
首页
-
C4D R23.110 C++ SDK
Registry< T, R > Class Template Reference
系统
#include <registrybase.h>
详细描述
template<typename T, typename R>
class maxon::Registry< T, R >
A
Registry
manages a set of entries of the same type. E.g., all classes are registered at the registry
Classes
, while all data types are registered at DataTypes.
Registries are declared by the macro MAXON_REGISTRY as derived classes of
Registry
with the template parameter R being the derived class. For the entries all types are supported which are supported by
数据
.
Each registry is identified by a unique identifier.
-
Template Parameters
-
T
|
Type of the values which are stored at the registry. Has to be supported by
数据
.
|
R
|
Registry
class (created by the macro MAXON_REGISTRY).
|
Member Typedef Documentation
◆
依赖
◆
EntryType
The type of entries stored at this registry.
◆
Iterator
◆
IdIterator
成员函数文档编制
◆
GetEntries()
Returns an iterator over all entries registered at this registry. Because the iterator supports the foreach-protocol, you can write
for
(
const
Class<ExecutionRef>& execCls : ExecutionJobs::GetEntries())
{
...
}
If you are also interested in the
Id
of the entry, you have to use the iterator returned by
GetEntriesWithId()
.
-
返回
-
Iterator over all entries.
◆
GetEntriesWithId()
Returns an iterator over all entries registered at this registry. Each entry is returned as a pair of the
Id
and the entry itself. Because the iterator supports the foreach-protocol, you can write
for
(
const
auto
& entry : ExecutionJobs::GetEntriesWithId())
{
const
Id& eid = entry.GetKey();
const
Class<ExecutionRef>& execCls = entry.GetValue();
...
}
-
返回
-
Iterator over all registry entries (i.e., id-entry-pairs).
◆
Find()
static const T* Find
|
(
|
const
Id
&
|
eid
|
)
|
|
|
static
|
Returns a pointer to the registry entry registered at this registry under the given identifier. If no entry exists for the given identifier, nullptr is returned.
-
参数
-
[in]
|
eid
|
Identifier within this registry.
|
-
返回
-
Registered entry, or nullptr.
◆
Get()
static const T& Get
|
(
|
const
Id
&
|
eid
|
)
|
|
|
static
|
Returns the entry registered at this registry under the given identifier. If no entry exists for the given identifier, a null-value reference is returned.
-
参数
-
[in]
|
eid
|
Identifier within this registry.
|
-
返回
-
Registered entry, or a null-value reference.
◆
Insert()
[1/2]
static
Result
<void> Insert
|
(
|
const
Id
&
|
eid
,
|
|
|
const T &
|
object
,
|
|
|
const ModuleInfo *
|
module
|
|
)
|
|
|
|
static
|
Registers an entry at this registry under the given identifier. If an entry already exists for the identifier, nothing happens, and an IllegalStateError is returned.
-
参数
-
[in]
|
eid
|
Identifier within this registry.
|
[in]
|
object
|
Value to register.
|
[in]
|
module
|
The module which initiates the call. When the module is freed, the entry will be freed too.
|
-
返回
-
Success of operation.
◆
Insert()
[2/2]
static
Result
<void> Insert
|
(
|
const
Id
&
|
eid
,
|
|
|
T &&
|
object
,
|
|
|
const ModuleInfo *
|
module
|
|
)
|
|
|
|
static
|
Registers an entry at this registry under the given identifier. If an entry already exists for the identifier, nothing happens, and an IllegalStateError is returned.
-
参数
-
[in]
|
eid
|
Identifier within this registry.
|
[in]
|
object
|
Value to register.
|
[in]
|
module
|
The module which initiates the call. When the module is freed, the entry will be freed too.
|
-
返回
-
Success of operation.
◆
PrivateInsert()
static
Result
<void> PrivateInsert
|
(
|
const
Id
&
|
eid
,
|
|
|
T &
|
object
,
|
|
|
const ModuleInfo *
|
module
|
|
)
|
|
|
|
static
|
◆
Register()
[1/2]
Registers an entry at this registry under the given identifier. If an entry already exists for the identifier, nothing happens, and an IllegalStateError is returned. The entry will be removed when the lifetime of the object wrapped in the return value ends.
-
参数
-
[in]
|
eid
|
Identifier within this registry.
|
[in]
|
object
|
Value to register.
|
-
返回
-
An object to which the lifetime of the added entry is bound. You have to keep this alive as long as the entry shall remain in the registry.
◆
Register()
[2/2]
Registers an entry at this registry under the given identifier. If an entry already exists for the identifier, nothing happens, and an IllegalStateError is returned. The entry will be removed when the lifetime of the object wrapped in the return value ends.
-
参数
-
[in]
|
eid
|
Identifier within this registry.
|
[in]
|
object
|
Value to register.
|
-
返回
-
An object to which the lifetime of the added entry is bound. You have to keep this alive as long as the entry shall remain in the registry.
◆
PrivateRegister()
◆
Erase()
Removes the entry identified by eid from this registry. If no such entry exists, nothing happens.
-
参数
-
[in]
|
eid
|
Identifier of the entry to be removed.
|