Wolframe, 0.0.3

output.hpp
Go to the documentation of this file.
1 /************************************************************************
2 Copyright (C) 2011 - 2014 Project Wolframe.
3 All rights reserved.
4 
5 This file is part of Project Wolframe.
6 
7 Commercial Usage
8 Licensees holding valid Project Wolframe Commercial licenses may
9 use this file in accordance with the Project Wolframe
10 Commercial License Agreement provided with the Software or,
11 alternatively, in accordance with the terms contained
12 in a written agreement between the licensee and Project Wolframe.
13 
14 GNU General Public License Usage
15 Alternatively, you can redistribute this file and/or modify it
16 under the terms of the GNU General Public License as published by
17 the Free Software Foundation, either version 3 of the License, or
18 (at your option) any later version.
19 
20 Wolframe is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 GNU General Public License for more details.
24 
25 You should have received a copy of the GNU General Public License
26 along with Wolframe. If not, see <http://www.gnu.org/licenses/>.
27 
28 If you have questions regarding the use of this file, please contact
29 Project Wolframe.
30 
31 ************************************************************************/
34 #ifndef _Wolframe_langbind_OUTPUT_HPP_INCLUDED
35 #define _Wolframe_langbind_OUTPUT_HPP_INCLUDED
36 #include "filter/filter.hpp"
37 
38 namespace _Wolframe {
39 namespace langbind {
40 
43 class Output
44 {
45 public:
49  ,m_state(0)
50  ,m_called(false){}
53  Output( const Output& o)
56  ,m_state(o.m_state)
57  ,m_called(o.m_called){}
60  Output( const OutputFilterR& flt)
61  :m_outputfilter(flt)
63  ,m_state(0)
64  ,m_called(false){}
66  ~Output(){}
67 
74  bool print( const char* e1, unsigned int e1size, const char* e2, unsigned int e2size);
75 
76  const OutputFilterR& outputfilter() const {return m_outputfilter;}
78  void setOutputFilter( const OutputFilterR& filter);
79 
80  bool called() const {return m_called;}
81  void called( bool yes) {m_called=yes;}
82 
83  void setOutputChunkSize( unsigned int outputChunkSize_)
84  {
85  m_outputChunkSize = outputChunkSize_;
86  }
87 
88  unsigned int outputChunkSize() const
89  {
90  return m_outputChunkSize;
91  }
92 
93 private:
95  std::size_t m_outputChunkSize;
96  unsigned int m_state;
97  bool m_called;
98 };
99 
100 }}//namespace
101 #endif
OutputFilterR & outputfilter()
Definition: output.hpp:77
bool called() const
Definition: output.hpp:80
Output()
Constructor.
Definition: output.hpp:47
~Output()
Destructor.
Definition: output.hpp:66
OutputFilterR m_outputfilter
output filter reference
Definition: output.hpp:94
Output as seen from scripting language binding.
Definition: output.hpp:43
unsigned int outputChunkSize() const
Definition: output.hpp:88
void setOutputFilter(const OutputFilterR &filter)
Output(const Output &o)
Copy constructor.
Definition: output.hpp:53
bool print(const char *e1, unsigned int e1size, const char *e2, unsigned int e2size)
Print the next element.
std::size_t m_outputChunkSize
chunk size for output
Definition: output.hpp:95
void setOutputChunkSize(unsigned int outputChunkSize_)
Definition: output.hpp:83
bool m_called
has already been called
Definition: output.hpp:97
Output(const OutputFilterR &flt)
Constructor by output filter.
Definition: output.hpp:60
void called(bool yes)
Definition: output.hpp:81
unsigned int m_state
current state for outputs with more than one elements
Definition: output.hpp:96
const OutputFilterR & outputfilter() const
Definition: output.hpp:76
Interface for filter class.