#include <objmgr.h>
Inherited by BazisLib::ObjectManager::ParentServiceReference< _ServiceType >.
Public Member Functions | |
operator bool () | |
operator bool () const | |
_ServiceType * | RetainAndGet () const |
Retains the object and returns an unmanaged pointer. | |
_ServiceType * | operator-> () const |
Private Member Functions | |
ConstManagedPointer () | |
ConstManagedPointer (const ConstManagedPointer &ptr) | |
~ConstManagedPointer () | |
Private Attributes | |
_ServiceType * | m_pTarget |
Friends | |
class | ManagedPointer< _ServiceType > |
class | ParentServiceReference< _ServiceType > |
This class represents a read-only managed pointer and serves as a base for the ParentServiceReference and ManagedPointer template classes. The typical usage scheme for this class is the following:
void SomeFunctionOrMethod(const ConstManagedPointer &pObj) { ... }You can also use ManagedPointer class references as function parameters, however in case of passing a ParentServiceReference to such a function, a temporary ManagedPointer instance will be created, that will result in an extra Retain()/Release() call pair. That way, it is highly recommended to use this class in function/method parameters, as it is the common base for both ManagedPointer and ParentServiceReference. However, it does not provide any other logic except for querying operators.
BazisLib::ObjectManager::ConstManagedPointer< _ServiceType >::ConstManagedPointer | ( | ) | [inline, private] |
BazisLib::ObjectManager::ConstManagedPointer< _ServiceType >::ConstManagedPointer | ( | const ConstManagedPointer< _ServiceType > & | ptr | ) | [inline, private] |
BazisLib::ObjectManager::ConstManagedPointer< _ServiceType >::~ConstManagedPointer | ( | ) | [inline, private] |
BazisLib::ObjectManager::ConstManagedPointer< _ServiceType >::operator bool | ( | ) | const [inline] |
Reimplemented in BazisLib::ObjectManager::ParentServiceReference< _ServiceType >, BazisLib::ObjectManager::ManagedPointer< _ManagedType >, BazisLib::ObjectManager::ManagedPointer< BazisLib::AIFile >, BazisLib::ObjectManager::ManagedPointer< BazisLib::_Core::_TextFile >, and BazisLib::ObjectManager::ManagedPointer< BazisLib::Network::HTTP::ACHTTPRequest >.
BazisLib::ObjectManager::ConstManagedPointer< _ServiceType >::operator bool | ( | ) | [inline] |
Reimplemented in BazisLib::ObjectManager::ParentServiceReference< _ServiceType >, BazisLib::ObjectManager::ManagedPointer< _ManagedType >, BazisLib::ObjectManager::ManagedPointer< BazisLib::AIFile >, BazisLib::ObjectManager::ManagedPointer< BazisLib::_Core::_TextFile >, and BazisLib::ObjectManager::ManagedPointer< BazisLib::Network::HTTP::ACHTTPRequest >.
_ServiceType* BazisLib::ObjectManager::ConstManagedPointer< _ServiceType >::operator-> | ( | ) | const [inline] |
Reimplemented in BazisLib::ObjectManager::ParentServiceReference< _ServiceType >, BazisLib::ObjectManager::ManagedPointer< _ManagedType >, BazisLib::ObjectManager::ManagedPointer< BazisLib::AIFile >, BazisLib::ObjectManager::ManagedPointer< BazisLib::_Core::_TextFile >, and BazisLib::ObjectManager::ManagedPointer< BazisLib::Network::HTTP::ACHTTPRequest >.
_ServiceType* BazisLib::ObjectManager::ConstManagedPointer< _ServiceType >::RetainAndGet | ( | ) | const [inline] |
Retains the object and returns an unmanaged pointer.
As we have declared restrictions for unmanaged pointers (if a function received an unmanaged pointer, it should release it after usage, or, actually, initialize a managed one and forget the unmanaged), we do not allow direct casting from managed to unmanaged pointer. However, if an unmanaged pointer is required, it can be obtaied by this method.
friend class ManagedPointer< _ServiceType > [friend] |
friend class ParentServiceReference< _ServiceType > [friend] |
_ServiceType* BazisLib::ObjectManager::ConstManagedPointer< _ServiceType >::m_pTarget [private] |