#include <algorithm.hxx>

Static Public Member Functions

static OstreamBuild (Ostream &os, Options opts)
 
static WriterBuild (Writer &writer, Options opts)
 

Private Member Functions

 Algo_Traits (Ostream &os)
 
Algo_Traits operator= (Algo_Traits &)
 
bool Write (Options opts)
 

Static Private Member Functions

static bool Write (Writer &writer, Options opts)
 
static const String GetType ()
 

Private Attributes

std::unique_ptr< Streamstream
 
std::unique_ptr< Writerwriter
 

Detailed Description

template<typename Algo>
class SHA_Logger::Algo_Traits< Algo >

Definition at line 31 of file algorithm.hxx.

Constructor & Destructor Documentation

template<typename Algo >
SHA_Logger::Algo_Traits< Algo >::Algo_Traits ( Ostream os)
inlineprivate

Definition at line 59 of file algorithm.hxx.

59  : stream(std::unique_ptr<Stream>(new Stream(os))),
60  writer(std::unique_ptr<Writer>(new Writer(*this->stream))) {}
std::unique_ptr< Stream > stream
Definition: algorithm.hxx:86
rapidjson::OStreamWrapper Stream
Definition: typedef.hxx:32
std::unique_ptr< Writer > writer
Definition: algorithm.hxx:87
rapidjson::PrettyWriter< Stream > Writer
Definition: typedef.hxx:33

Member Function Documentation

template<typename Algo >
static Ostream& SHA_Logger::Algo_Traits< Algo >::Build ( Ostream os,
Options  opts 
)
inlinestatic

Instantiate a new json writer using the stream passed as argument and write algorithm information.

Returns
stream reference filled up with Algo object information, error information in case of failure.

Definition at line 39 of file algorithm.hxx.

40  {
41  std::unique_ptr<Algo_Traits> algo = std::unique_ptr<Algo_Traits>(new Algo_Traits(os));
42  algo->Write(opts);
43 
44  return os;
45  }
Algo_Traits(Ostream &os)
Definition: algorithm.hxx:59
template<typename Algo >
static Writer& SHA_Logger::Algo_Traits< Algo >::Build ( Writer writer,
Options  opts 
)
inlinestatic

Use json writer passed as parameter to write Algo information.

Returns
stream reference filled up with Algo object information, error information in case of failure.

Definition at line 51 of file algorithm.hxx.

52  {
53  Write(writer, opts);
54 
55  return writer;
56  }
bool Write(Options opts)
Definition: algorithm.hxx:63
std::unique_ptr< Writer > writer
Definition: algorithm.hxx:87
template<typename Algo >
static const String SHA_Logger::Algo_Traits< Algo >::GetType ( )
inlinestaticprivate

Definition at line 84 of file algorithm.hxx.

84 { return "algorithm"; }
template<typename Algo >
Algo_Traits SHA_Logger::Algo_Traits< Algo >::operator= ( Algo_Traits< Algo > &  )
inlineprivate

Definition at line 61 of file algorithm.hxx.

61 {} // Not Implemented
template<typename Algo >
bool SHA_Logger::Algo_Traits< Algo >::Write ( Options  opts)
inlineprivate

Definition at line 63 of file algorithm.hxx.

63 { return Write(*this->writer, opts); }
bool Write(Options opts)
Definition: algorithm.hxx:63
std::unique_ptr< Writer > writer
Definition: algorithm.hxx:87
template<typename Algo >
static bool SHA_Logger::Algo_Traits< Algo >::Write ( Writer writer,
Options  opts 
)
inlinestaticprivate

Definition at line 65 of file algorithm.hxx.

66  {
67  writer.Key("type");
68  writer.String(GetType());
69  if (opts & OpGetName || opts & OpIsSub)
70  {
71  writer.Key("name");
72  writer.String(Algo::GetName());
73  }
74  if (opts & OpGetDoc)
75  Algo::WriteDoc(writer);
76  if (opts & OpGetInfo)
77  Algo::WriteInfo(writer);
78  if (opts & OpGetSrc)
79  Algo::WriteSrc(writer);
80 
81  return true;
82  }
static const String GetType()
Definition: algorithm.hxx:84
std::unique_ptr< Writer > writer
Definition: algorithm.hxx:87

Member Data Documentation

template<typename Algo >
std::unique_ptr<Stream> SHA_Logger::Algo_Traits< Algo >::stream
private

Definition at line 86 of file algorithm.hxx.

template<typename Algo >
std::unique_ptr<Writer> SHA_Logger::Algo_Traits< Algo >::writer
private

Definition at line 87 of file algorithm.hxx.


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