UserSharedPointerDefines.h
Go to the documentation of this file.
1 /*=============================================================================
2  Copyright (C) 2012 Allied Vision Technologies. All Rights Reserved.
3 
4  Redistribution of this file, in original or modified form, without
5  prior written consent of Allied Vision Technologies is prohibited.
6 
7 -------------------------------------------------------------------------------
8 
9  File: UserSharedPointerDefines.h
10 
11  Description: Definition of macros for using different shared pointer
12  implementations.
13 
14 -------------------------------------------------------------------------------
15 
16  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
17  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE,
18  NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
20  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
24  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 
27 =============================================================================*/
28 
29 #ifndef AVT_VMBAPI_USERSHAREDPOINTERDEFINES_H
30 #define AVT_VMBAPI_USERSHAREDPOINTERDEFINES_H
31 
32 //
33 // Vimba C++ API does not necessarily rely on AVT::VmbAPI::shared_ptr. You might want to use your own shared pointer type or the one that ships with your
34 // implementation of the C++ standard.
35 // To use a custom shared pointer implementation simply add the define USER_SHARED_POINTER to your project / compiler settings and complete this header file.
36 //
37 
38 
39 // Add all your required shared pointer implementation headers here.
40 // HINT: #include <memory> is used for std::shared_ptr
41 
42 
43 namespace AVT {
44 namespace VmbAPI {
45 
46 // Set the calls for your implementation of the shared pointer functions
47 // a) Declaration
48 // b) Reset with argument
49 // c) Reset without argument
50 // d) == operator
51 // e) NULL test
52 // f) Access to underlying raw pointer
53 // g) Dynamic cast of shared pointer
54 
55 // a) This is the define for a declaration.
56 #define SP_DECL( T ) std::shared_ptr<T>
57 // b) This is the define for setting an existing shared pointer.
58 #define SP_SET( sp, rawPtr ) (sp).reset( rawPtr )
59 // c) This is the define for resetting without an argument to decrease the ref count.
60 #define SP_RESET( sp ) (sp).reset()
61 // d) This is the define for the equal operator. Shared pointers are usually considered equal when the raw pointers point to the same address.
62 #define SP_ISEQUAL( sp1, sp2 ) ( (sp1) == (sp2) )
63 // e) This is the define for the NULL check.
64 #define SP_ISNULL( sp ) ( NULL == (sp) )
65 // f) This is the define for the raw pointer access. This is usually accomplished through the dereferencing operator (->).
66 #define SP_ACCESS( sp ) (sp).get()
67 // g) This is the define for the dynamic cast of the pointer.
68 #define SP_DYN_CAST( sp, T ) std::dynamic_pointer_cast<T>(sp)
69 
70 // These are all uses of a SP_DECL shared_ptr declaration
71 class Interface;
72 typedef SP_DECL( Interface ) InterfacePtr;
73 
74 class Camera;
75 typedef SP_DECL( Camera ) CameraPtr;
76 
77 class Feature;
78 typedef SP_DECL( Feature ) FeaturePtr;
79 
80 class FeatureContainer;
81 typedef SP_DECL( FeatureContainer ) FeatureContainerPtr;
82 
83 class IFeatureObserver;
84 typedef SP_DECL( IFeatureObserver ) IFeatureObserverPtr;
85 
86 class Frame;
87 typedef SP_DECL( Frame ) FramePtr;
88 
89 class FrameHandler;
90 typedef SP_DECL( FrameHandler ) FrameHandlerPtr;
91 
92 class IFrameObserver;
93 typedef SP_DECL( IFrameObserver ) IFrameObserverPtr;
94 
95 class AncillaryData;
96 typedef SP_DECL( AncillaryData ) AncillaryDataPtr;
97 
98 class ConstAncillaryData;
99 typedef SP_DECL( const AncillaryData ) ConstAncillaryDataPtr;
100 
101 class ICameraFactory;
102 typedef SP_DECL( ICameraFactory ) ICameraFactoryPtr;
103 
104 class ICameraListObserver;
105 typedef SP_DECL( ICameraListObserver ) ICameraListObserverPtr;
106 
107 class IInterfaceListObserver;
108 typedef SP_DECL( IInterfaceListObserver ) IInterfaceListObserverPtr;
109 
110 class Mutex;
111 typedef SP_DECL( Mutex ) MutexPtr;
112 
113 class BasicLockable;
114 typedef SP_DECL( BasicLockable ) BasicLockablePtr;
115 
116 }} // Namespace AVT::VmbAPI
117 
118 
119 #endif //AVT_VMBAPI_USERSHAREDPOINTERDEFINES_H
typedef SP_DECL(Interface) InterfacePtr


avt_vimba_camera
Author(s): Allied Vision Technologies, Miquel Massot
autogenerated on Fri Jun 2 2023 02:21:10