![]() |
Declaring the AxisCamera as a module level variable.
What would be the proper way to declare the AxisCamera class as a module level so that autonomous and teleop can use the same connection and we don't have to wait for a connection twice?
AxisCamera &camera = AxisCamera::GetInstance("10.12.51.11"); |
Re: Declaring the AxisCamera as a module level variable.
As a member variable to your SimpleRobot class, define AxisCamera& camera; Then in the initializers, initialize it there. For instance...
Code:
#define CAMERA_IP "10.19.67.11" |
Re: Declaring the AxisCamera as a module level variable.
awesome, thanks
|
Re: Declaring the AxisCamera as a module level variable.
Since AxisCamera is a singleton, you can just call AxisCamera::GetInstance(NULL). It doesn't reconnect. Use the SOURCE :D
See? Code:
AxisCamera &AxisCamera::GetInstance(const char *cameraIP)Another way is to just have an inline function: Code:
static inline AxisCamera& camera() { |
| All times are GMT -5. The time now is 17:36. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi