Jpp  18.2.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JSTDObjectOutput.hh
Go to the documentation of this file.
1 #ifndef __JLANG__JSTDOBJECTOUTPUT__
2 #define __JLANG__JSTDOBJECTOUTPUT__
3 
4 #include <iterator>
5 
6 #include "JLang/JObjectOutput.hh"
7 #include "JLang/JObject.hh"
8 #include "JLang/JSTDTypes.hh"
9 
10 
11 /**
12  * \author mdejong
13  */
14 
15 namespace JLANG {}
16 namespace JPP { using namespace JLANG; }
17 
18 namespace 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>
74  {
76  }
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>
88  {
90  }
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>
102  {
104  }
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>
116  {
118  }
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>
130  {
132  }
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>
144  {
146  }
147 }
148 
149 #endif
virtual bool put(const value_type &object) override
Object output.
Auxiliary base class for inline creation of a static value or clone from a temporary object...
Definition: JObject.hh:18
Implementation of object output for STD compatible output iterator.
JSTDObjectOutput(const JOutputIterator_t &out)
Constructor.
JOutputIterator_t::container_type::value_type value_type
Forward declarations of STD containers.
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.
Template interface of object output for single data type.