system.h
Go to the documentation of this file.
1 /*
2  * This file is part of the rc_genicam_api package.
3  *
4  * Copyright (c) 2017 Roboception GmbH
5  * All rights reserved
6  *
7  * Author: Heiko Hirschmueller
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  *
15  * 2. Redistributions in binary form must reproduce the above copyright notice,
16  * this list of conditions and the following disclaimer in the documentation
17  * and/or other materials provided with the distribution.
18  *
19  * 3. Neither the name of the copyright holder nor the names of its contributors
20  * may be used to endorse or promote products derived from this software without
21  * specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  */
35 
36 #ifndef RC_GENICAM_API_SYSTEM
37 #define RC_GENICAM_API_SYSTEM
38 
39 #include <GenApi/GenApi.h>
40 
41 #include <memory>
42 #include <vector>
43 #include <mutex>
44 
45 namespace rcg
46 {
47 
48 class GenTLWrapper;
49 class Interface;
50 class CPort;
51 
58 class System : public std::enable_shared_from_this<System>
59 {
60  public:
61 
62  ~System();
63 
77  static std::vector<std::shared_ptr<System> > getSystems();
78 
84  static void clearSystems();
85 
92  const std::string &getFilename() const;
93 
100  void open();
101 
107  void close();
108 
117  std::vector<std::shared_ptr<Interface> > getInterfaces();
118 
125  std::string getID();
126 
133  std::string getVendor();
134 
141  std::string getModel();
142 
149  std::string getVersion();
150 
157  std::string getTLType();
158 
165  std::string getName();
166 
173  std::string getPathname();
174 
181  std::string getDisplayName();
182 
189  bool isCharEncodingASCII();
190 
197  int getMajorVersion();
198 
205  int getMinorVersion();
206 
216  std::shared_ptr<GenApi::CNodeMapRef> getNodeMap();
217 
224  void *getHandle() const;
225 
226  private:
227 
228  void clearInterfaces(); // Needed for ENUM-WORKAROUND
229 
230  System(const std::string &_filename);
231  System(class System &); // forbidden
232  System &operator=(const System &); // forbidden
233 
234  std::string filename;
235  std::shared_ptr<const GenTLWrapper> gentl;
236 
237  std::recursive_mutex mtx;
238 
239  int n_open;
240  void *tl;
241 
242  std::shared_ptr<CPort> cport;
243  std::shared_ptr<GenApi::CNodeMapRef> nodemap;
244 
245  // Changed from weak_ptr to shared_ptr as part of ENUM-WORKAROUND
246  std::vector<std::shared_ptr<Interface> > ilist;
247 };
248 
249 }
250 
251 #endif
System(const std::string &_filename)
Definition: system.cc:546
std::string getDisplayName()
Returns the display name of the GenTL provider.
Definition: system.cc:444
System & operator=(const System &)
std::shared_ptr< GenApi::CNodeMapRef > nodemap
Definition: system.h:243
const std::string & getFilename() const
Get file name from which this system was created.
Definition: system.cc:226
void * tl
Definition: system.h:240
static std::vector< std::shared_ptr< System > > getSystems()
Returns a list of systems (i.e.
Definition: system.cc:116
void * getHandle() const
Get internal handle of open transport layer.
Definition: system.cc:530
std::shared_ptr< CPort > cport
Definition: system.h:242
std::vector< std::shared_ptr< Interface > > getInterfaces()
Returns the currently available interfaces.
Definition: system.cc:283
void close()
Closes the system.
Definition: system.cc:246
The system class encapsulates a Genicam transport layer.
Definition: system.h:58
std::shared_ptr< const GenTLWrapper > gentl
Definition: system.h:235
static void clearSystems()
Clears the internal list of systems.
Definition: system.cc:213
int n_open
Definition: system.h:239
std::string getVendor()
Returns the vendor name of the GenTL provider.
Definition: system.cc:408
int getMinorVersion()
Returns the minor version number.
Definition: system.cc:498
Main include file for using GenApi with smart pointers.
void clearInterfaces()
Definition: system.cc:535
std::recursive_mutex mtx
Definition: system.h:237
void open()
Opens the system for working with it.
Definition: system.cc:231
std::shared_ptr< GenApi::CNodeMapRef > getNodeMap()
Returns the node map of this object.
Definition: system.cc:518
std::string getName()
Returns the file name of the GenTL provider.
Definition: system.cc:432
bool isCharEncodingASCII()
Returns the character encoding.
Definition: system.cc:450
Definition: buffer.cc:47
std::string getVersion()
Returns the version of the GenTL provider.
Definition: system.cc:420
std::string getModel()
Returns the model of the GenTL provider.
Definition: system.cc:414
std::string getPathname()
Returns the full path name of the GenTL provider.
Definition: system.cc:438
std::string filename
Definition: system.h:234
std::string getTLType()
Returns the transport layer type of the GenTL provider.
Definition: system.cc:426
int getMajorVersion()
Returns the major version number.
Definition: system.cc:478
std::vector< std::shared_ptr< Interface > > ilist
Definition: system.h:246
std::string getID()
Returns the ID of the GenTL provider.
Definition: system.cc:402


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