Apache Qpid C++ API
Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET Apache Qpid Documentation

qpid/client/PrivateImplRef.h File Reference

Helper class to implement a class with a private, reference counted implementation and reference semantics. More...

#include "qpid/client/ClientImportExport.h"
#include <boost/intrusive_ptr.hpp>
#include "qpid/RefCounted.h"

Go to the source code of this file.


Classes

class  qpid::client::PrivateImplRef< T >

Namespaces

namespace  qpid
 This file was automatically generated from the AMQP specification.
namespace  qpid::client


Detailed Description

Helper class to implement a class with a private, reference counted implementation and reference semantics.

Such classes are used in the public API to hide implementation, they should. Example of use:

=== Foo.h

template <class t>=""> PrivateImplRef; class FooImpl;

Foo : public Handle<FooImpl> { public: Foo(FooImpl* = 0); Foo(const Foo&); ~Foo(); Foo& operator=(const Foo&);

int fooDo(); // and other Foo functions...

private: typedef FooImpl Impl; Impl* impl; friend class PrivateImplRef<Foo>;

=== Foo.cpp

typedef PrivateImplRef<Foo> PI; Foo::Foo(FooImpl* p) { PI::ctor(*this, p); } Foo::Foo(const Foo& c) : Handle<FooImpl>() { PI::copy(*this, c); } Foo::~Foo() { PI::dtor(*this); } Foo& Foo::operator=(const Foo& c) { return PI::assign(*this, c); }

int foo::fooDo() { return impl->fooDo(); }

Definition in file PrivateImplRef.h.


Qpid C++ API Reference
Generated on Thu Jul 2 13:32:12 2009 for Qpid C++ Client API by doxygen 1.5.8