Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JSTDObjectOutput.hh
Go to the documentation of this file.
1#ifndef __JLANG__JSTDOBJECTOUTPUT__
2#define __JLANG__JSTDOBJECTOUTPUT__
3
4#include <iterator>
5
7#include "JLang/JObject.hh"
8#include "JLang/JSTDTypes.hh"
9
10
11/**
12 * \author mdejong
13 */
14
15namespace JLANG {}
16namespace JPP { using namespace JLANG; }
17
18namespace JLANG {
19
20 /**
21 * Implementation of object output for STD compatible output iterator.
22 *
23 * This class implements the JLANG::JObjectOutput interface for the corresponding data type.
24 */
25 template<class JOutputIterator_t>
27 public JObjectOutput<typename JOutputIterator_t::container_type::value_type>,
28 public JObject< JSTDObjectOutput<JOutputIterator_t> >
29
30 {
31 public:
32
33 typedef typename JOutputIterator_t::container_type::value_type value_type;
34
35
36 /**
37 * Constructor.
38 *
39 * \param out output iterator
40 */
41 JSTDObjectOutput(const JOutputIterator_t& out) :
42 out(out)
43 {}
44
45
46 /**
47 * Object output.
48 *
49 * \param object object
50 * \return true
51 */
52 virtual bool put(const value_type& object) override
53 {
54 *out = object;
55 ++out;
56
57 return true;
58 }
59
60 protected:
61 JOutputIterator_t out;
62 };
63
64
65 /**
66 * Helper method to create STD compatible object output.
67 *
68 * \param buffer output buffer
69 * \return object output
70 */
71 template<class JElement_t, class JAllocator_t>
77
78
79 /**
80 * Helper method to create STD compatible object output.
81 *
82 * \param buffer output buffer
83 * \return object output
84 */
85 template<class JElement_t, class JAllocator_t>
91
92
93 /**
94 * Helper method to create STD compatible object output.
95 *
96 * \param buffer output buffer
97 * \return object output
98 */
99 template<class JElement_t, class JComparator_t, class JAllocator_t>
105
106
107 /**
108 * Helper method to create STD compatible object output.
109 *
110 * \param buffer output buffer
111 * \return object output
112 */
113 template<class JElement_t, class JComparator_t, class JAllocator_t>
119
120
121 /**
122 * Helper method to create STD compatible object output.
123 *
124 * \param buffer output buffer
125 * \return object output
126 */
127 template<class JKey_t, class JValue_t, class JComparator_t, class JAllocator_t>
133
134
135 /**
136 * Helper method to create STD compatible object output.
137 *
138 * \param buffer output buffer
139 * \return object output
140 */
141 template<class JKey_t, class JValue_t, class JComparator_t, class JAllocator_t>
147}
148
149#endif
Forward declarations of STD containers.
Template interface of object output for single data type.
Implementation of object output for STD compatible output iterator.
JOutputIterator_t::container_type::value_type value_type
virtual bool put(const value_type &object) override
Object output.
JSTDObjectOutput(const JOutputIterator_t &out)
Constructor.
Auxiliary classes and methods for language specific functionality.
JSTDObjectOutput< std::back_insert_iterator< std::vector< JElement_t, JAllocator_t > > > getObjectOutput(std::vector< JElement_t, JAllocator_t > &buffer)
Helper method to create STD compatible object output.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary base class for inline creation of a static value or clone from a temporary object.
Definition JObject.hh:18