#include <factory.hpp>
Collaboration diagram for yaSSL::Factory< AbstractProduct, IdentifierType, ProductCreator >:

Public Member Functions | |
| Factory (void(*init)(Factory< AbstractProduct, IdentifierType, ProductCreator > &)) | |
| void | Reserve (size_t sz) |
| void | Register (const IdentifierType &id, ProductCreator pc) |
| AbstractProduct * | CreateObject (const IdentifierType &id) const |
Private Types | |
| typedef mySTL::pair< IdentifierType, ProductCreator > | CallBack |
| typedef mySTL::vector< CallBack > | CallBackVector |
Private Member Functions | |
| Factory (const Factory &) | |
| Factory & | operator= (const Factory &) |
Private Attributes | |
| CallBackVector | callbacks_ |
Definition at line 60 of file factory.hpp.
typedef mySTL::pair<IdentifierType, ProductCreator> yaSSL::Factory< AbstractProduct, IdentifierType, ProductCreator >::CallBack [private] |
Definition at line 61 of file factory.hpp.
typedef mySTL::vector<CallBack> yaSSL::Factory< AbstractProduct, IdentifierType, ProductCreator >::CallBackVector [private] |
Definition at line 62 of file factory.hpp.
| yaSSL::Factory< AbstractProduct, IdentifierType, ProductCreator >::Factory | ( | void(*)(Factory< AbstractProduct, IdentifierType, ProductCreator > &) | init | ) | [inline, explicit] |
| yaSSL::Factory< AbstractProduct, IdentifierType, ProductCreator >::Factory | ( | const Factory< AbstractProduct, IdentifierType, ProductCreator > & | ) | [private] |
| AbstractProduct* yaSSL::Factory< AbstractProduct, IdentifierType, ProductCreator >::CreateObject | ( | const IdentifierType & | id | ) | const [inline] |
Definition at line 86 of file factory.hpp.
References mySTL::vector< T >::begin(), mySTL::vector< T >::end(), mySTL::pair< T1, T2 >::first, and mySTL::pair< T1, T2 >::second.
Referenced by yaSSL::ServerKeyExchange::createKey(), yaSSL::ClientKeyExchange::createKey(), yaSSL::DoProcessReply(), and yaSSL::HandShakeHeader::Process().
00087 { 00088 const CallBack* first = callbacks_.begin(); 00089 const CallBack* last = callbacks_.end(); 00090 00091 while (first != last) { 00092 if (first->first == id) 00093 break; 00094 ++first; 00095 } 00096 00097 if (first == callbacks_.end()) 00098 return 0; 00099 return (first->second)(); 00100 }
Here is the call graph for this function:

Here is the caller graph for this function:

| Factory& yaSSL::Factory< AbstractProduct, IdentifierType, ProductCreator >::operator= | ( | const Factory< AbstractProduct, IdentifierType, ProductCreator > & | ) | [private] |
| void yaSSL::Factory< AbstractProduct, IdentifierType, ProductCreator >::Register | ( | const IdentifierType & | id, | |
| ProductCreator | pc | |||
| ) | [inline] |
Definition at line 80 of file factory.hpp.
References mySTL::make_pair(), and mySTL::vector< T >::push_back().
Referenced by yaSSL::InitClientKeyFactory(), yaSSL::InitHandShakeFactory(), yaSSL::InitMessageFactory(), and yaSSL::InitServerKeyFactory().
00081 { 00082 callbacks_.push_back(mySTL::make_pair(id, pc)); 00083 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::Factory< AbstractProduct, IdentifierType, ProductCreator >::Reserve | ( | size_t | sz | ) | [inline] |
Definition at line 74 of file factory.hpp.
References mySTL::vector< T >::reserve().
Referenced by yaSSL::InitClientKeyFactory(), yaSSL::InitHandShakeFactory(), yaSSL::InitMessageFactory(), and yaSSL::InitServerKeyFactory().
00075 { 00076 callbacks_.reserve(sz); 00077 }
Here is the call graph for this function:

Here is the caller graph for this function:

CallBackVector yaSSL::Factory< AbstractProduct, IdentifierType, ProductCreator >::callbacks_ [private] |
Definition at line 64 of file factory.hpp.
1.4.7

