ConcatenatedWrite.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // (c) 2017 by Teledyne DALSA
3 // Section: Digital Imaging
4 // Project: GenAPI
5 // Author: Eric Bourbonnais
6 //
7 // License: This file is published under the license of the EMVA GenICam Standard Group.
8 // A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'.
9 // If for some reason you are missing this file please contact the EMVA or visit the website
10 // (http://www.genicam.org) for a full copy.
11 //
12 // THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
13 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
14 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP
16 // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
17 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
18 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
19 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
20 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22 // POSSIBILITY OF SUCH DAMAGE.
23 //-----------------------------------------------------------------------------
24 //
31 #ifndef GENAPI_NODE_WRITE_CONCATENATOR_H
32 #define GENAPI_NODE_WRITE_CONCATENATOR_H
33 
34 namespace GENAPI_NAMESPACE
35 {
36 
38  {
39  protected:
41  virtual ~CNodeWriteConcatenator(void) = 0;
42  public:
44  virtual void Add(const GENICAM_NAMESPACE::gcstring &nodeName, const GENICAM_NAMESPACE::gcstring &nodeValue) = 0;
46  virtual void Add(const GENICAM_NAMESPACE::gcstring &nodeName, const char *) = 0;
48  virtual void Add(const GENICAM_NAMESPACE::gcstring &nodeName, const int64_t nodeValue) = 0;
50  virtual void Add(const GENICAM_NAMESPACE::gcstring &nodeName, const double nodeValue) = 0;
52  virtual void Add(const GENICAM_NAMESPACE::gcstring &nodeName, const bool nodeValue) = 0;
54  virtual void Clear() = 0;
56  virtual void Destroy() = 0;
57  };
58 
64  {
65  public:
67  CNodeWriteConcatenatorRef() : m_pConcatenator(NULL)
68  {
69  };
71  CNodeWriteConcatenatorRef(CNodeWriteConcatenator *pConcatenator) : m_pConcatenator(pConcatenator)
72  {
73  };
76  {
77  if (m_pConcatenator)
78  m_pConcatenator->Destroy();
79  m_pConcatenator = NULL;
80 
81  }
82 
84  void _Add(const GENICAM_NAMESPACE::gcstring &nodeName, const GENICAM_NAMESPACE::gcstring &nodeValue)
85  {
86  if (m_pConcatenator)
87  m_pConcatenator->Add(nodeName, nodeValue);
88  else
89  throw ACCESS_EXCEPTION("Concatenator not present (reference not valid)");
90  }
92  void _Add(const GENICAM_NAMESPACE::gcstring &nodeName, const char *nodeValue)
93  {
94  if (m_pConcatenator)
95  m_pConcatenator->Add(nodeName, nodeValue);
96  else
97  throw ACCESS_EXCEPTION("Concatenator not present (reference not valid)");
98  }
100  void _Add(const GENICAM_NAMESPACE::gcstring &nodeName, const int64_t nodeValue)
101  {
102  if (m_pConcatenator)
103  m_pConcatenator->Add(nodeName, nodeValue);
104  else
105  throw ACCESS_EXCEPTION("Concatenator not present (reference not valid)");
106  }
108  void _Add(const GENICAM_NAMESPACE::gcstring &nodeName, const double nodeValue)
109  {
110  if (m_pConcatenator)
111  m_pConcatenator->Add(nodeName, nodeValue);
112  else
113  throw ACCESS_EXCEPTION("Concatenator not present (reference not valid)");
114  }
116  void _Add(const GENICAM_NAMESPACE::gcstring &nodeName, const bool nodeValue)
117  {
118  if (m_pConcatenator)
119  m_pConcatenator->Add(nodeName, nodeValue);
120  else
121  throw ACCESS_EXCEPTION("Concatenator not present (reference not valid)");
122  }
124  void _Clear()
125  {
126  if (m_pConcatenator)
127  m_pConcatenator->Clear();
128  else
129  throw ACCESS_EXCEPTION("Concatenator not present (reference not valid)");
130  }
133  {
134  CNodeWriteConcatenator *tmp = m_pConcatenator;
135  m_pConcatenator = NULL;
136  return tmp;
137  }
139  operator CNodeWriteConcatenator * () const
140  {
141  if (m_pConcatenator)
142  return m_pConcatenator;
143  else
144  throw ACCESS_EXCEPTION("Concatenator not present (reference not valid)");
145  }
148  {
149  return m_pConcatenator;
150  }
151 
154  {
155 
156  if (m_pConcatenator)
157  m_pConcatenator->Destroy();
158  // Take ownership of the object
159  m_pConcatenator = pConcatenator;
160  return *this;
161  }
162 
163  private:
165  };
166 
167 }
168 
169 #endif // GENAPI_NODE_WRITE_CONCATENATOR_H
CNodeWriteConcatenator * Release()
Release owenership of the write concatenator object.
void _Add(const GENICAM_NAMESPACE::gcstring &nodeName, const bool nodeValue)
Add a write with value of type bool.
virtual void operator=(bool Value)
Set node value.
Definition: IBoolean.h:64
__int64 int64_t
Definition: config-win32.h:21
CNodeWriteConcatenatorRef(CNodeWriteConcatenator *pConcatenator)
Constructor.
#define GENAPI_DECL
Definition: GenApiDll.h:55
Reference object for CNodeWriteConcatenator create with NewNodeWriteConcatenator function of nodemap ...
#define ACCESS_EXCEPTION
Fires a access exception, e.g. throw ACCESS_EXCEPTION("Not everybody")
Definition: GCException.h:253
void _Clear()
Remove all write from the container.
void _Add(const GENICAM_NAMESPACE::gcstring &nodeName, const char *nodeValue)
Add a write with value of type char *.
A string class which is a clone of std::string.
Definition: GCString.h:52
void _Add(const GENICAM_NAMESPACE::gcstring &nodeName, const int64_t nodeValue)
Add a write with value of type int64_t.
void _Add(const GENICAM_NAMESPACE::gcstring &nodeName, const double nodeValue)
Add a write with value of type double.
void _Add(const GENICAM_NAMESPACE::gcstring &nodeName, const GENICAM_NAMESPACE::gcstring &nodeValue)
Add a write with value of type gcstring.
Lexical analyzer for CIntSwissKnife.
Definition: Autovector.h:48


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Mar 17 2021 02:48:40