All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 
90  static bool setSystemsPath(const char *path, const char *ignore);
91 
92 
102  static std::vector<std::shared_ptr<System> > getSystems();
103 
109  static void clearSystems();
110 
117  const std::string &getFilename() const;
118 
125  void open();
126 
132  void close();
133 
142  std::vector<std::shared_ptr<Interface> > getInterfaces();
143 
150  std::string getID();
151 
158  std::string getVendor();
159 
166  std::string getModel();
167 
174  std::string getVersion();
175 
182  std::string getTLType();
183 
190  std::string getName();
191 
198  std::string getPathname();
199 
206  std::string getDisplayName();
207 
214  bool isCharEncodingASCII();
215 
222  int getMajorVersion();
223 
230  int getMinorVersion();
231 
241  std::shared_ptr<GenApi::CNodeMapRef> getNodeMap();
242 
249  void *getHandle() const;
250 
251  private:
252 
253  void clearInterfaces(); // Needed for ENUM-WORKAROUND
254 
255  System(const std::string &_filename);
256  System(class System &); // forbidden
257  System &operator=(const System &); // forbidden
258 
259  std::string filename;
260  std::shared_ptr<const GenTLWrapper> gentl;
261 
262  std::recursive_mutex mtx;
263 
264  int n_open;
265  void *tl;
266 
267  std::shared_ptr<CPort> cport;
268  std::shared_ptr<GenApi::CNodeMapRef> nodemap;
269 
270  // Changed from weak_ptr to shared_ptr as part of ENUM-WORKAROUND
271  std::vector<std::shared_ptr<Interface> > ilist;
272 };
273 
274 }
275 
276 #endif
GenApi.h
Main include file for using GenApi with smart pointers.
rcg::System::getNodeMap
std::shared_ptr< GenApi::CNodeMapRef > getNodeMap()
Returns the node map of this object.
Definition: system.cc:587
rcg::System::getMinorVersion
int getMinorVersion()
Returns the minor version number.
Definition: system.cc:567
rcg::System::System
System(const std::string &_filename)
Definition: system.cc:615
rcg::System::close
void close()
Closes the system.
Definition: system.cc:315
rcg::System::nodemap
std::shared_ptr< GenApi::CNodeMapRef > nodemap
Definition: system.h:268
rcg::System::getVendor
std::string getVendor()
Returns the vendor name of the GenTL provider.
Definition: system.cc:477
rcg::System::getVersion
std::string getVersion()
Returns the version of the GenTL provider.
Definition: system.cc:489
rcg::System
The system class encapsulates a Genicam transport layer.
Definition: system.h:58
rcg::System::getHandle
void * getHandle() const
Get internal handle of open transport layer.
Definition: system.cc:599
rcg::System::getInterfaces
std::vector< std::shared_ptr< Interface > > getInterfaces()
Returns the currently available interfaces.
Definition: system.cc:352
rcg::System::tl
void * tl
Definition: system.h:265
rcg::System::~System
~System()
Definition: system.cc:55
rcg
Definition: buffer.cc:47
rcg::System::getModel
std::string getModel()
Returns the model of the GenTL provider.
Definition: system.cc:483
rcg::System::open
void open()
Opens the system for working with it.
Definition: system.cc:300
rcg::System::cport
std::shared_ptr< CPort > cport
Definition: system.h:267
rcg::System::mtx
std::recursive_mutex mtx
Definition: system.h:262
rcg::System::getFilename
const std::string & getFilename() const
Get file name from which this system was created.
Definition: system.cc:295
rcg::System::getName
std::string getName()
Returns the file name of the GenTL provider.
Definition: system.cc:501
rcg::System::clearSystems
static void clearSystems()
Clears the internal list of systems.
Definition: system.cc:282
rcg::System::filename
std::string filename
Definition: system.h:259
rcg::System::getTLType
std::string getTLType()
Returns the transport layer type of the GenTL provider.
Definition: system.cc:495
rcg::System::getMajorVersion
int getMajorVersion()
Returns the major version number.
Definition: system.cc:547
rcg::System::n_open
int n_open
Definition: system.h:264
rcg::System::getPathname
std::string getPathname()
Returns the full path name of the GenTL provider.
Definition: system.cc:507
rcg::System::gentl
std::shared_ptr< const GenTLWrapper > gentl
Definition: system.h:260
rcg::System::clearInterfaces
void clearInterfaces()
Definition: system.cc:604
rcg::System::setSystemsPath
static bool setSystemsPath(const char *path, const char *ignore)
Set the path for finding GenTL producers on the file system and the name of a producer that should be...
Definition: system.cc:118
rcg::System::getID
std::string getID()
Returns the ID of the GenTL provider.
Definition: system.cc:471
rcg::System::getDisplayName
std::string getDisplayName()
Returns the display name of the GenTL provider.
Definition: system.cc:513
rcg::System::ilist
std::vector< std::shared_ptr< Interface > > ilist
Definition: system.h:271
rcg::System::operator=
System & operator=(const System &)
rcg::System::getSystems
static std::vector< std::shared_ptr< System > > getSystems()
This function creates systems for all producers that can be found.
Definition: system.cc:201
rcg::System::isCharEncodingASCII
bool isCharEncodingASCII()
Returns the character encoding.
Definition: system.cc:519


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Dec 4 2024 03:10:12