- Aldebaran documentation |
- C++ Libraries |
- index

libqi-api 2.8.7.4

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
qi::Object< T > Class Template Reference

`#include <object.hxx>`

## Public Types
using | MaybeAnyObject = typename boost::mpl::if_< typename boost::is_same< T, Empty >::type, None, Object< Empty >>::type

## Public Member Functions
| Object ()
template<typename U >
| Object (const Object< U > &o)
template<typename U >
Object< T > & | operator= (const Object< U > &o)
| Object (const Object &o)
Object< T > & | operator= (const Object &o)
| Object (const qi::Future< MaybeAnyObject > &fobj)
| Object (const qi::FutureSync< MaybeAnyObject > &fobj)
template<typename U >
| Object (GenericObject *go, boost::shared_ptr< U > other)
| Shares ref counter with other, which must handle the destruction of go. More...
template<typename U >
| Object (boost::shared_ptr< U > other)
bool | isValid () const
| operator bool () const
| operator Object< Empty > () const
friend | KA_GENERATE_REGULAR_OP_GREATER (Object) friend KA_GENERATE_REGULAR_OP_LESS_OR_EQUAL(Object) friend KA_GENERATE_REGULAR_OP_GREATER_OR_EQUAL(Object) ObjectUid uid() const
PtrUid | ptrUid () const
boost::shared_ptr< T > | asSharedPtr ()
T & | asT () const
T * | operator-> () const
T & | operator* () const
bool | unique () const
GenericObject * | asGenericObject () const
void | reset ()
unsigned | use_count () const
void | checkT ()
| Check tha value actually has the T interface. More...
detail::ManagedObjectPtr | managedObjectPtr ()
| Object (GenericObject *go)
| Object (T *ptr)
| Object (GenericObject *go, boost::function< void(GenericObject *)> deleter)
| Object (T *ptr, boost::function< void(T *)> deleter)
Public Member Functions inherited from qi::detail::GenericObjectBounce< Object< T > >
const MetaObject & | metaObject () const
qi::Future< AnyReference > | metaCall (unsigned int method, const GenericFunctionParameters &params, MetaCallType callType=MetaCallType_Auto, Signature returnSignature=Signature()) const
qi::Future< AnyReference > | metaCall (const std::string &nameWithOptionalSignature, const GenericFunctionParameters &params, MetaCallType callType=MetaCallType_Auto, Signature returnSignature=Signature()) const
int | findMethod (const std::string &name, const GenericFunctionParameters &parameters) const
void | metaPost (unsigned int event, const GenericFunctionParameters &params) const
void | metaPost (const std::string &nameWithOptionalSignature, const GenericFunctionParameters &in) const
void | post (const std::string &eventName, Args &&...args) const
qi::FutureSync< SignalLink > | connect (const std::string &eventName, FUNCTOR_TYPE callback, MetaCallType threadingModel=MetaCallType_Auto) const
qi::FutureSync< SignalLink > | connect (const std::string &name, const SignalSubscriber &functor) const
qi::FutureSync< SignalLink > | connect (unsigned int signal, const SignalSubscriber &subscriber) const
qi::FutureSync< SignalLink > | connect (unsigned int signal, AnyObject target, unsigned int slot) const
qi::FutureSync< void > | disconnect (SignalLink linkId) const
qi::FutureSync< T > | property (const std::string &name) const
qi::FutureSync< AnyValue > | property (unsigned int id) const
qi::FutureSync< void > | setProperty (const std::string &name, const T &val) const
qi::FutureSync< void > | setProperty (unsigned int id, const AnyValue &val) const
ExecutionContext * | executionContext () const
bool | isStatsEnabled () const
void | enableStats (bool enable) const
ObjectStatistics | stats () const
void | clearStats () const
bool | isTraceEnabled () const
void | enableTrace (bool enable)
void | forceExecutionContext (boost::shared_ptr< qi::ExecutionContext > ec)
qi::Future< R > | async (const std::string &methodName, Args &&...args) const
R | call (const std::string &methodName, Args &&...args) const

## Static Public Member Functions
static ObjectTypeInterface * | interface ()
static void | keepManagedObjectPtr (detail::ManagedObjectPtr)
static void | noDeleteT (T *)
static void | noDelete (GenericObject *)
static void | deleteGenericObjectOnly (GenericObject *obj)
static void | deleteCustomDeleter (GenericObject *obj, boost::function< void(T *)> deleter)

## Friends
class | GenericObject
template<typename >
class | Object
template<typename >
class | WeakObject

## Detailed Description

### template<typename T>
class qi::Object< T >

Type erased object that has a known interface T.

In case T is unknown, you can use qi::AnyObject which aliases to Object<qi::Empty>.

You can then use the object with type-erasure or call the object directly using the operator ->.

Definition at line 243 of file object.hxx.

## Member Typedef Documentation

template<typename T>

using qi::Object< T >::MaybeAnyObject = typename boost::mpl::if_<typename boost::is_same<T, Empty>::type, None, Object<Empty>>::type

Definition at line 262 of file object.hxx.

## Constructor & Destructor Documentation

template<typename T >

qi::Object< T >::Object | ( |  | ) |
| inline

Definition at line 377 of file object.hxx.

template<typename T >
template<typename U >

qi::Object< T >::Object | ( | const Object< U > & | o | ) |
| inline

Definition at line 381 of file object.hxx.

template<typename T >

qi::Object< T >::Object | ( | const Object< T > & | o | ) |
| inline

Definition at line 411 of file object.hxx.

template<typename T >

qi::Object< T >::Object | ( | const qi::Future< MaybeAnyObject< T > > & | fobj | ) |
| inline

Definition at line 536 of file object.hxx.

template<typename T >

qi::Object< T >::Object | ( | const qi::FutureSync< MaybeAnyObject< T > > & | fobj | ) |
| inline

Definition at line 543 of file object.hxx.

template<typename T >

qi::Object< T >::Object | ( | GenericObject< T > * | go | ) |
| inline

These constructors take ownership of the underlying pointers. If a callback is given, it will be called instead of the default behavior of deleting the stored GenericObject and the underlying T object.

Definition at line 426 of file object.hxx.

template<typename T>

qi::Object< T >::Object | ( | T * | ptr | ) |
| inline

Definition at line 522 of file object.hxx.

template<typename T>

qi::Object< T >::Object | ( | GenericObject< T > * | go,
|  | boost::function< void(GenericObject< T > *)> | deleter
| ) |  |
| inline

Definition at line 430 of file object.hxx.

template<typename T>

qi::Object< T >::Object | ( | T * | ptr,
|  | boost::function< void(T *)> | deleter
| ) |  |
| inline

Definition at line 527 of file object.hxx.

template<typename T >
template<typename U >

qi::Object< T >::Object | ( | GenericObject< T > * | go,
|  | boost::shared_ptr< U > | other
| ) |  |

Shares ref counter with other, which must handle the destruction of go.

Definition at line 434 of file object.hxx.

template<typename T >
template<typename U >

qi::Object< T >::Object | ( | boost::shared_ptr< U > | other | ) |

Definition at line 516 of file object.hxx.

## Member Function Documentation

template<typename T >

GenericObject * qi::Object< T >::asGenericObject | ( |  | ) | const

Definition at line 652 of file object.hxx.

template<typename T >

boost::shared_ptr< T > qi::Object< T >::asSharedPtr | ( |  | ) |
| inline

Definition at line 551 of file object.hxx.

template<typename T >

T & qi::Object< T >::asT | ( |  | ) | const

Definition at line 635 of file object.hxx.

template<typename T >

void qi::Object< T >::checkT | ( |  | ) |

Check tha value actually has the T interface.

Definition at line 604 of file object.hxx.

template<typename T>

static void qi::Object< T >::deleteCustomDeleter | ( | GenericObject< T > * | obj,
|  | boost::function< void(T *)> | deleter
| ) |  |
| inline static

Definition at line 318 of file object.hxx.

template<typename T>

static void qi::Object< T >::deleteGenericObjectOnly | ( | GenericObject< T > * | obj | ) |
| inline static

Definition at line 316 of file object.hxx.

template<typename T >

ObjectTypeInterface * qi::Object< T >::interface | ( |  | ) |
| inline static

Definition at line 363 of file object.hxx.

template<typename T >

bool qi::Object< T >::isValid | ( |  | ) | const

Definition at line 591 of file object.hxx.

template<typename T>

qi::Object< T >::KA_GENERATE_REGULAR_OP_GREATER | ( | Object< T > |  | ) | const

The unique identifier of the object qi::Object's instance is refering to. Won't change if that instance travels through the network.

template<typename T>

static void qi::Object< T >::keepManagedObjectPtr | ( | detail::ManagedObjectPtr |  | ) |
| inline static

Definition at line 312 of file object.hxx.

template<typename T>

detail::ManagedObjectPtr qi::Object< T >::managedObjectPtr | ( |  | ) |
| inline

Definition at line 324 of file object.hxx.

template<typename T>

static void qi::Object< T >::noDelete | ( | GenericObject< T > * |  | ) |
| inline static

Definition at line 314 of file object.hxx.

template<typename T>

static void qi::Object< T >::noDeleteT | ( | T * |  | ) |
| inline static

Definition at line 313 of file object.hxx.

template<typename T >

qi::Object< T >::operator bool | ( |  | ) | const
| explicit

Definition at line 597 of file object.hxx.

template<typename T >

qi::Object< T >::operator Object< Empty > | ( |  | ) | const

Definition at line 602 of file object.hxx.

template<typename T >

T & qi::Object< T >::operator* | ( |  | ) | const

Definition at line 644 of file object.hxx.

template<typename T >

T * qi::Object< T >::operator-> | ( |  | ) | const

Definition at line 640 of file object.hxx.

template<typename T >
template<typename U >

Object< T > & qi::Object< T >::operator= | ( | const Object< U > & | o | ) |
| inline

Definition at line 401 of file object.hxx.

template<typename T >

Object< T > & qi::Object< T >::operator= | ( | const Object< T > & | o | ) |
| inline

Definition at line 416 of file object.hxx.

template<typename T>

PtrUid qi::Object< T >::ptrUid | ( |  | ) | const
| inline

Definition at line 296 of file object.hxx.

template<typename T >

void qi::Object< T >::reset | ( |  | ) |

Definition at line 656 of file object.hxx.

template<typename T >

bool qi::Object< T >::unique | ( |  | ) | const

Definition at line 648 of file object.hxx.

template<typename T>

unsigned qi::Object< T >::use_count | ( |  | ) | const
| inline

Definition at line 306 of file object.hxx.

## Friends And Related Function Documentation

template<typename T>
template<typename >

friend class Object
| friend

Definition at line 328 of file object.hxx.

template<typename T>

friend class GenericObject
| friend

Definition at line 326 of file object.hxx.

template<typename T>
template<typename >

friend class WeakObject
| friend

Definition at line 329 of file object.hxx.

The documentation for this class was generated from the following file:

- /home/opennao/work/release-2.8/sdk/libqi/qi/type/detail/object.hxx