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  System(const std::string &_filename);
229  System(class System &); // forbidden
230  System &operator=(const System &); // forbidden
231 
232  std::string filename;
233  std::shared_ptr<const GenTLWrapper> gentl;
234 
235  std::mutex mtx;
236 
237  int n_open;
238  void *tl;
239 
240  std::shared_ptr<CPort> cport;
241  std::shared_ptr<GenApi::CNodeMapRef> nodemap;
242 
243  std::vector<std::weak_ptr<Interface> > ilist;
244 };
245 
246 }
247 
248 #endif
System(const std::string &_filename)
Definition: system.cc:514
std::string getDisplayName()
Returns the display name of the GenTL provider.
Definition: system.cc:423
System & operator=(const System &)
std::shared_ptr< GenApi::CNodeMapRef > nodemap
Definition: system.h:241
const std::string & getFilename() const
Get file name from which this system was created.
Definition: system.cc:219
void * tl
Definition: system.h:238
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:509
std::shared_ptr< CPort > cport
Definition: system.h:240
std::vector< std::shared_ptr< Interface > > getInterfaces()
Returns the currently available interfaces.
Definition: system.cc:276
void close()
Closes the system.
Definition: system.cc:239
The system class encapsulates a Genicam transport layer.
Definition: system.h:58
std::mutex mtx
Definition: system.h:235
std::shared_ptr< const GenTLWrapper > gentl
Definition: system.h:233
static void clearSystems()
Clears the internal list of systems.
Definition: system.cc:213
int n_open
Definition: system.h:237
std::string getVendor()
Returns the vendor name of the GenTL provider.
Definition: system.cc:387
int getMinorVersion()
Returns the minor version number.
Definition: system.cc:477
Main include file for using GenApi with smart pointers.
void open()
Opens the system for working with it.
Definition: system.cc:224
std::shared_ptr< GenApi::CNodeMapRef > getNodeMap()
Returns the node map of this object.
Definition: system.cc:497
std::string getName()
Returns the file name of the GenTL provider.
Definition: system.cc:411
bool isCharEncodingASCII()
Returns the character encoding.
Definition: system.cc:429
Definition: buffer.cc:42
std::string getVersion()
Returns the version of the GenTL provider.
Definition: system.cc:399
std::string getModel()
Returns the model of the GenTL provider.
Definition: system.cc:393
std::vector< std::weak_ptr< Interface > > ilist
Definition: system.h:243
std::string getPathname()
Returns the full path name of the GenTL provider.
Definition: system.cc:417
std::string filename
Definition: system.h:232
std::string getTLType()
Returns the transport layer type of the GenTL provider.
Definition: system.cc:405
int getMajorVersion()
Returns the major version number.
Definition: system.cc:457
std::string getID()
Returns the ID of the GenTL provider.
Definition: system.cc:381


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Thu Jun 6 2019 19:10:54