QuantLib
A free/open-source library for quantitative finance
Reference manual - version 1.20
Protected Types | Protected Member Functions | Protected Attributes | List of all members
Composite< T > Class Template Reference

Composite pattern. More...

#include <ql/patterns/composite.hpp>

Inherits T.

Protected Types

typedef std::list< ext::shared_ptr< T > >::iterator iterator
 
typedef std::list< ext::shared_ptr< T > >::const_iterator const_iterator
 

Protected Member Functions

void add (const ext::shared_ptr< T > &c)
 

Protected Attributes

std::list< ext::shared_ptr< T > > components_
 

Detailed Description

template<class T>
class QuantLib::Composite< T >

Composite pattern.

The typical use of this class is:

class CompositeFoo : public Composite<Foo> {
...
};

which causes CompositeFoo to inherit from Foo and provides it with methods for adding components. Of course, any abstract Foo interface must still be implemented.