nl:: Weave:: System:: Object
#include <src/system/SystemObject.h>
这表示从 ObjectPool<t, n=""> 对象中包含的空间分配的引用计数对象。</t,>
摘要
注意:此类的实例只能使用相关的 ObjectPool 类模板构建。复制构造函数和赋值运算符会被删除。引用计数系统用于跟踪此类实例的保留。当一个对象最初被保留时,其引用计数为 1。额外保留期可能会增加参考文件计数。当对象被释放时,引用计数减少。当引用计数为零时,对象将回收回对象池中重新分配。没有可用的析构函数。必须将子类设计为确保在最终保留期限被释放和对象被回收时,所有封装资源会被释放。虽然此类定义为具体类,但符合 Nest C++ 样式,应将其视为抽象类。
继承
已知直接子类:nl::Inet::InetLayerBasis
nl::Weave::System::Timer
受保护的类型 |
|
---|---|
ReleaseDeferralErrorTactic{
|
枚举 < 当 DeferredRelease 无法发布 kEvent_ReleaseObj 时该怎么办。 |
公共属性 |
|
---|---|
AppState
|
void *
指向与对象关联的应用专属数据的通用指针。
|
公共函数 |
|
---|---|
IsRetained(const Layer & aLayer) const
|
bool
测试
aLayer 是否会保留此对象。 |
Release(void)
|
void
Decrements the reference count for the Weave System Layer object. |
Retain(void)
|
void
Increments the reference count for the Weave System Layer object. |
SystemLayer(void) const
|
Layer &
Returns a reference to the Weave System Layer object provided when the object was initially retained from its corresponding object pool instance. |
受保护的函数 |
|
---|---|
DeferredRelease(ReleaseDeferralErrorTactic aTactic)
|
void
|
受保护的类型
ReleaseDeferralErrorTactic
ReleaseDeferralErrorTactic
< 当 DeferredRelease 无法发布 kEvent_ReleaseObj 时该怎么办。
公共属性
AppState
void * AppState
指向与对象关联的应用专属数据的通用指针。
公共函数
IsRetained
bool IsRetained( const Layer & aLayer ) const
测试 aLayer
是否会保留此对象。
Tests whether this object is retained by \c aLayer.
并发安全。
版本
void Release( void )
Decrements the reference count for the Weave System Layer object.
如果引用计数减零,则将对象回收回对象中。不会调用析构函数。
保留
void Retain( void )
Increments the reference count for the Weave System Layer object.
系统会假定该对象为活跃对象。
SystemLayer
Layer & SystemLayer( void ) const
Returns a reference to the Weave System Layer object provided when the object was initially retained from its corresponding object pool instance.
系统会假定该对象为活跃对象。