CoreLinux++
0.4.32
|
When an abstraction can have one of several possible implementations, the usual way to accommodate them is to use inheritance. More...
#include <Bridge.hpp>
Public Member Functions | |
Bridge (Implementation aImplementation) | |
Default Constructor requires a Implementation. More... | |
virtual | ~Bridge (void) |
Virtual Destructor. | |
Bridge & | operator= (const Bridge &aRef) throw (Exception) |
Assignment operator overload. More... | |
bool | operator== (const Bridge &) const |
Equality operator overload. More... | |
bool | operator!= (const Bridge &) const |
Non-equality operator overload. More... | |
![]() | |
CoreLinuxObject (void) | |
Default Constructor. | |
CoreLinuxObject (CoreLinuxObjectCref) | |
Copy Constructor. More... | |
virtual | ~CoreLinuxObject (void) |
Virtual Destructor. | |
CoreLinuxObjectRef | operator= (CoreLinuxObjectCref) |
Assignment operator overload. More... | |
bool | operator== (CoreLinuxObjectCref) const |
Equality operator overload. More... | |
bool | operator!= (CoreLinuxObjectCref) const |
Non-equality operator overload. More... | |
Protected Member Functions | |
Bridge (void) throw (Assertion) | |
Default Constructor Because a Bridge requires a implementation to work, you can not construct one without it. More... | |
Bridge (const Bridge &) throw (Assertion) | |
Copy Constructor Because theImplementation is owned by the Bridge, only the assignment operator insures that the derivation is constructed and can be invoked for object management. More... | |
Implementation | getImplementation (void) const |
Gets current theImplementation. More... | |
void | setImplementation (Implementation aImpl) throw (Exception) |
Set theImplementation. More... | |
virtual Implementation | cloneImplementation (Implementation)=0 throw (Exception) |
Pure virtual method to have the derivation contain theImplementation.by ownership. More... | |
When an abstraction can have one of several possible implementations, the usual way to accommodate them is to use inheritance.
An abstract class defines the interface to the abstraction, and concrete subclasses implement it in different ways. But this approach isn't always flexible enough. Inheritance binds an implementation to the abstraction permanently, which makes it difficult to modify, extend, and reuse abstractions and implementations independently. A Bridge decouples an abstraction from its implementation so that the two can vary independently.
|
inline |
Default Constructor requires a Implementation.
Implementation | instance |
|
inlineprotected |
Default Constructor
Because a Bridge requires a implementation to work, you can not construct one without it.
void |
NEVER_GET_HERE |
|
inlineprotected |
|
protectedpure virtual |
Pure virtual method to have the derivation contain theImplementation.by ownership.
Implementation | instance |
Exception | - implementation defined |
Referenced by corelinux::Bridge< Implementation >::setImplementation().
|
inlineprotected |
Gets current theImplementation.
|
inline |
Non-equality operator overload.
Bridge | const reference |
|
inline |
Assignment operator overload.
This may throw Exception if there is a problem cloning theImplementation.
Bridge | const reference |
Exception | - implementation defined |
References corelinux::Bridge< Implementation >::setImplementation().
|
inline |
|
inlineprotected |
Set theImplementation.
This in turn calls the pure-virtual method cloneImplementation so that a pointer unique to this object, or one which is referencable can be managed
Implementation | instance |
Exception | - implementation defined |
References corelinux::Bridge< Implementation >::cloneImplementation().
Referenced by corelinux::Bridge< Implementation >::operator=().