ACE  6.3.3
Public Member Functions | Private Member Functions | List of all members
ACE_Copy_Disabled Class Reference

Helper class to disable copy construction and assignment. More...

#include <Copy_Disabled.h>

Inheritance diagram for ACE_Copy_Disabled:
Inheritance graph
[legend]

Public Member Functions

 ACE_Copy_Disabled (void)
 Default constructor. More...
 

Private Member Functions

 ACE_Copy_Disabled (const ACE_Copy_Disabled &)
 
ACE_Copy_Disabledoperator= (const ACE_Copy_Disabled &)
 

Detailed Description

Helper class to disable copy construction and assignment.

Classes used to control OS and other resources are not "canonical", i.e. they have their copy constructor and assignment operators disabled. This is often done by making the copy constructor and assignment operators private, effectively disallowing copying by clients of the class (including derived classes). If the copy constructor and assingment operators are left unimplemented then the class itself cannot make any copies of its instances, because it would result in link errors.

To use this class simply use private inheritance:

class Foo : private ACE_Copy_Disabled { // code here };

Constructor & Destructor Documentation

ACE_Copy_Disabled::ACE_Copy_Disabled ( void  )

Default constructor.

ACE_Copy_Disabled::ACE_Copy_Disabled ( const ACE_Copy_Disabled )
private

Member Function Documentation

ACE_Copy_Disabled& ACE_Copy_Disabled::operator= ( const ACE_Copy_Disabled )
private

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