C++/CLI Sample
Demonstrates how to create a C++/CLI library using the VideoXpert SDK
CPPCli::Device Class Reference

The Device class represents a particular physical device in the system. More...

#include <Device.h>

Public Types

enum  DeviceStatus {
  DeviceStatus::Unknown,
  DeviceStatus::Initializing,
  DeviceStatus::Unauthenticated
}
 Values that represent the operational state of a device. More...
 
enum  Types {
  Types::Camera,
  Types::Core,
  Types::CoreMg,
  Types::Decoder,
  Types::Encoder,
  Types::External,
  Types::Manager,
  Types::Mg,
  Types::Monitor,
  Types::Recorder,
  Types::Udi,
  Types::Ui,
  Types::Unknown,
  Types::Vcd
}
 Values that represent device types. More...
 

Public Member Functions

 Device (VxSdk::IVxDevice *vxDevice)
 Constructor. More...
 
virtual ~Device ()
 Destructor. More...
 
 !Device ()
 Finaliser. More...
 
Results::Value Refresh ()
 Refreshes this instances properties. More...
 

Package Functions

System::Collections::Generic::List< AlarmInput^ >^ _GetAlarmInputs ()
 
System::Collections::Generic::List< DataSource^ >^ _GetDataSources ()
 
System::Collections::Generic::List< DeviceAssignment^ >^ _GetDeviceAssignments ()
 
System::Collections::Generic::List< RelayOutput^ >^ _GetRelayOutputs ()
 

Package Attributes

VxSdk::IVxDevice_device
 

Properties

System::Collections::Generic::List< AlarmInput^ >^ AlarmInputs [get]
 Gets the alarm inputs hosted by this device. More...
 
System::Collections::Generic::List< DataSource^ >^ DataSources [get]
 Gets the data sources hosted by this device. More...
 
System::Collections::Generic::List< DeviceAssignment^ >^ DeviceAssignments [get]
 Gets the assignments to a data storage for this device. More...
 
System::String^  DriverDeviceId [get]
 Gets the driver device identifier. More...
 
System::String^  Id [get]
 Gets the unique identifier of the device. More...
 
System::String^  Ip [get]
 Gets the IP of the device. More...
 
bool IsCommissioned [get]
 Gets a value indicating whether the device is commissioned. More...
 
bool IsLicenseRequired [get]
 Gets a value indicating whether a license is required for commissioning the device. More...
 
bool IsPelcoHardware [get]
 Gets a value indicating whether the device is running on Pelco hardware. More...
 
System::String^  Model [get]
 Gets the device model. More...
 
System::String^  Name [get, set]
 Gets or sets the friendly name of the device. More...
 
System::String^  Password [set]
 Sets the account password used to communicate with the device, if any. More...
 
System::Collections::Generic::List< RelayOutput^ >^ RelayOutputs [get]
 Gets the relay outputs hosted by this device. More...
 
System::String^  Serial [get]
 Gets the serial number. More...
 
DataSource::States State [get]
 Gets the current operational state of the device. More...
 
System::Collections::Generic::List< DeviceStatus >^ Status [get]
 Gets the current device status. More...
 
Types Type [get]
 Gets the type of device. More...
 
System::String^  Username [get, set]
 Gets or sets the account username used to communicate with the device, if any. More...
 
System::String^  Vendor [get]
 Gets the device vendor, if any. More...
 
System::String^  Version [get]
 Gets the current version of software running on the device. More...
 
System::String^  VirtualIp [get]
 Gets the virtual IP of the device, if any. More...
 

Detailed Description

The Device class represents a particular physical device in the system.

Definition at line 15 of file Device.h.

Member Enumeration Documentation

Values that represent the operational state of a device.

Enumerator
Unknown 

An error or unknown value was returned.

Initializing 

Being prepared for use.

Unauthenticated 

Invalid/missing credentials.

Definition at line 21 of file Device.h.

21  {
23  Unknown,
24 
26  Initializing,
27 
29  Unauthenticated
30  };
enum CPPCli::Device::Types
strong

Values that represent device types.

Enumerator
Camera 

A camera device.

Core 

A VideoXpert Core device.

CoreMg 

A VideoXpert Core/MediaGateway device.

Decoder 

A decoder device.

Encoder 

An encoder device.

External 

An external device.

Manager 

A system manager device.

Mg 

A VideoXpert MediaGateway device.

Monitor 

A monitor device.

Recorder 

A network storage device.

Udi 

A UDI device.

Ui 

A UI device.

Unknown 

An error or unknown value was returned.

Vcd 

A VCD device.

Definition at line 35 of file Device.h.

35  {
37  Camera,
38 
40  Core,
41 
43  CoreMg,
44 
46  Decoder,
47 
49  Encoder,
50 
52  External,
53 
55  Manager,
56 
58  Mg,
59 
61  Monitor,
62 
64  Recorder,
65 
67  Udi,
68 
70  Ui,
71 
73  Unknown,
74 
76  Vcd
77  };

Constructor & Destructor Documentation

CPPCli::Device::Device ( VxSdk::IVxDevice vxDevice)

Constructor.

Parameters
vxDeviceThe vx device.

Definition at line 8 of file Device.cpp.

8  {
9  _device = vxDevice;
10 }
VxSdk::IVxDevice * _device
Definition: Device.h:313
virtual CPPCli::Device::~Device ( )
inlinevirtual

Destructor.

Definition at line 88 of file Device.h.

88  {
89  this->!Device();
90  }
Device(VxSdk::IVxDevice *vxDevice)
Constructor.
Definition: Device.cpp:8
CPPCli::Device::!Device ( )

Finaliser.

Definition at line 12 of file Device.cpp.

12  {
13  _device->Delete();
14  _device = nullptr;
15 }
virtual VxResult::Value Delete() const =0
VxSdk::IVxDevice * _device
Definition: Device.h:313

Member Function Documentation

List< CPPCli::AlarmInput^ > CPPCli::Device::_GetAlarmInputs ( )
package

Definition at line 21 of file Device.cpp.

21  {
22  // Create a list of managed alarm input objects
23  List<AlarmInput^>^ mlist = gcnew List<AlarmInput^>();
24  // Create a collection of unmanaged alarm input objects
26 
27  // Make the GetAlarmInputs call, which will return with the total count of alarm inputs, this allows the client to allocate memory.
28  VxSdk::VxResult::Value result = _device->GetAlarmInputs(alarmInputs);
29  // Unless there are no alarm inputs hosted on the device, this should return VxSdk::VxResult::kInsufficientSize
30  if (result == VxSdk::VxResult::kInsufficientSize) {
31  // An array of pointers is allocated using the size returned by the previous GetAlarmInputs call
32  alarmInputs.collection = new VxSdk::IVxAlarmInput*[alarmInputs.collectionSize];
33  result = _device->GetAlarmInputs(alarmInputs);
34  // The result should now be kOK since we have allocated enough space
35  if (result == VxSdk::VxResult::kOK) {
36  for (int i = 0; i < alarmInputs.collectionSize; i++)
37  mlist->Add(gcnew CPPCli::AlarmInput(alarmInputs.collection[i]));
38  }
39  // Remove the memory we previously allocated to the collection
40  delete[] alarmInputs.collection;
41  }
42  return mlist;
43 }
virtual VxResult::Value GetAlarmInputs(VxCollection< IVxAlarmInput ** > &alarmInputCollection) const =0
The AlarmInput class represents a physical alarm input.
Definition: AlarmInput.h:14
VxSdk::IVxDevice * _device
Definition: Device.h:313
List< CPPCli::DataSource^ > CPPCli::Device::_GetDataSources ( )
package

Definition at line 45 of file Device.cpp.

45  {
46  // Create a list of managed data source objects
47  List<DataSource^>^ mlist = gcnew List<DataSource^>();
48  // Create a collection of unmanaged data source objects
50 
51  // Make the GetDataSources call, which will return with the total count of data sources, this allows the client to allocate memory.
52  VxSdk::VxResult::Value result = _device->GetDataSources(dataSources);
53  // Unless there are no data sources hosted on the device, this should return VxSdk::VxResult::kInsufficientSize
54  if (result == VxSdk::VxResult::kInsufficientSize) {
55  // An array of pointers is allocated using the size returned by the previous GetDataSources call
56  dataSources.collection = new VxSdk::IVxDataSource*[dataSources.collectionSize];
57  result = _device->GetDataSources(dataSources);
58  // The result should now be kOK since we have allocated enough space
59  if (result == VxSdk::VxResult::kOK) {
60  for (int i = 0; i < dataSources.collectionSize; i++)
61  mlist->Add(gcnew CPPCli::DataSource(dataSources.collection[i]));
62  }
63  // Remove the memory we previously allocated to the collection
64  delete[] dataSources.collection;
65  }
66  return mlist;
67 }
The DataSource class represents a data producer in the system hosted by a device. Each DataSource pro...
Definition: DataSource.h:20
VxSdk::IVxDevice * _device
Definition: Device.h:313
virtual VxResult::Value GetDataSources(VxCollection< IVxDataSource ** > &dataSourceCollection) const =0
List< CPPCli::DeviceAssignment^ > CPPCli::Device::_GetDeviceAssignments ( )
package

Definition at line 69 of file Device.cpp.

69  {
70  // Create a list of managed device assignment objects
71  List<DeviceAssignment^>^ mlist = gcnew List<DeviceAssignment^>();
72  // Create a collection of unmanaged device assignment objects
74 
75  // Make the GetDeviceAssignments call, which will return with the total count of device assignments, this allows the client to allocate memory.
76  VxSdk::VxResult::Value result = _device->GetDeviceAssignments(deviceAssignments);
77  // Unless there are no device assignments hosted on the device, this should return VxSdk::VxResult::kInsufficientSize
78  if (result == VxSdk::VxResult::kInsufficientSize) {
79  // An array of pointers is allocated using the size returned by the previous GetDeviceAssignments call
80  deviceAssignments.collection = new VxSdk::IVxDeviceAssignment*[deviceAssignments.collectionSize];
81  result = _device->GetDeviceAssignments(deviceAssignments);
82  // The result should now be kOK since we have allocated enough space
83  if (result == VxSdk::VxResult::kOK) {
84  for (int i = 0; i < deviceAssignments.collectionSize; i++)
85  mlist->Add(gcnew CPPCli::DeviceAssignment(deviceAssignments.collection[i]));
86  }
87  // Remove the memory we previously allocated to the collection
88  delete[] deviceAssignments.collection;
89  }
90  return mlist;
91 }
virtual VxResult::Value GetDeviceAssignments(VxCollection< IVxDeviceAssignment ** > &deviceAssignmentCollection) const =0
The DeviceAssignment class represents a device assignment.
VxSdk::IVxDevice * _device
Definition: Device.h:313
List< CPPCli::RelayOutput^ > CPPCli::Device::_GetRelayOutputs ( )
package

Definition at line 93 of file Device.cpp.

93  {
94  // Create a list of managed relay output objects
95  List<RelayOutput^>^ mlist = gcnew List<RelayOutput^>();
96  // Create a collection of unmanaged relay output objects
98 
99  // Make the GetRelayOutputs call, which will return with the total count of relay outputs, this allows the client to allocate memory.
100  VxSdk::VxResult::Value result = _device->GetRelayOutputs(relayOutputs);
101  // Unless there are no relay outputs hosted on the device, this should return VxSdk::VxResult::kInsufficientSize
102  if (result == VxSdk::VxResult::kInsufficientSize) {
103  // An array of pointers is allocated using the size returned by the previous GetRelayOutputs call
104  relayOutputs.collection = new VxSdk::IVxRelayOutput*[relayOutputs.collectionSize];
105  result = _device->GetRelayOutputs(relayOutputs);
106  // The result should now be kOK since we have allocated enough space
107  if (result == VxSdk::VxResult::kOK) {
108  for (int i = 0; i < relayOutputs.collectionSize; i++)
109  mlist->Add(gcnew CPPCli::RelayOutput(relayOutputs.collection[i]));
110  }
111  // Remove the memory we previously allocated to the collection
112  delete[] relayOutputs.collection;
113  }
114  return mlist;
115 }
virtual VxResult::Value GetRelayOutputs(VxCollection< IVxRelayOutput ** > &relayOutputCollection) const =0
The RelayOutput class represents a physical relay output.
Definition: RelayOutput.h:14
VxSdk::IVxDevice * _device
Definition: Device.h:313
CPPCli::Results::Value CPPCli::Device::Refresh ( )

Refreshes this instances properties.

Returns
The Result of updating the properties.

Definition at line 17 of file Device.cpp.

17  {
19 }
Value
Values that represent the result of calls to the VideoXpert system.
Definition: Utils.h:21
VxSdk::IVxDevice * _device
Definition: Device.h:313
virtual VxResult::Value Refresh()=0

Member Data Documentation

VxSdk::IVxDevice* CPPCli::Device::_device
package

Definition at line 313 of file Device.h.

Property Documentation

System:: Collections:: Generic:: List< AlarmInput^>^ CPPCli::Device::AlarmInputs
get

Gets the alarm inputs hosted by this device.

A List of alarm inputs.

Definition at line 107 of file Device.h.

System:: Collections:: Generic:: List< DataSource^>^ CPPCli::Device::DataSources
get

Gets the data sources hosted by this device.

A List of data sources.

Definition at line 116 of file Device.h.

System:: Collections:: Generic:: List< DeviceAssignment^>^ CPPCli::Device::DeviceAssignments
get

Gets the assignments to a data storage for this device.

A List of device assignments.

Definition at line 125 of file Device.h.

System:: String^ CPPCli::Device::DriverDeviceId
get

Gets the driver device identifier.

The driver device identifier.

Definition at line 134 of file Device.h.

System:: String^ CPPCli::Device::Id
get

Gets the unique identifier of the device.

The unique identifier.

Definition at line 143 of file Device.h.

System:: String^ CPPCli::Device::Ip
get

Gets the IP of the device.

The IP.

Definition at line 152 of file Device.h.

bool CPPCli::Device::IsCommissioned
get

Gets a value indicating whether the device is commissioned.

true if commissioned, false if not.

Definition at line 161 of file Device.h.

bool CPPCli::Device::IsLicenseRequired
get

Gets a value indicating whether a license is required for commissioning the device.

true if license required, false if not.

Definition at line 170 of file Device.h.

bool CPPCli::Device::IsPelcoHardware
get

Gets a value indicating whether the device is running on Pelco hardware.

true if a Pelco device, false if not.

Definition at line 179 of file Device.h.

System:: String^ CPPCli::Device::Model
get

Gets the device model.

The model name.

Definition at line 188 of file Device.h.

System:: String^ CPPCli::Device::Name
getset

Gets or sets the friendly name of the device.

The friendly name.

Definition at line 197 of file Device.h.

System:: String^ CPPCli::Device::Password
set

Sets the account password used to communicate with the device, if any.

The password.

Definition at line 211 of file Device.h.

System:: Collections:: Generic:: List< RelayOutput^>^ CPPCli::Device::RelayOutputs
get

Gets the relay outputs hosted by this device.

A List of relay outputs.

Definition at line 224 of file Device.h.

System:: String^ CPPCli::Device::Serial
get

Gets the serial number.

The serial number.

Definition at line 233 of file Device.h.

DataSource:: States CPPCli::Device::State
get

Gets the current operational state of the device.

The current state of the device.

Definition at line 242 of file Device.h.

System:: Collections:: Generic:: List< DeviceStatus>^ CPPCli::Device::Status
get

Gets the current device status.

A device status List.

Definition at line 251 of file Device.h.

Types CPPCli::Device::Type
get

Gets the type of device.

The device Type.

Definition at line 266 of file Device.h.

System:: String^ CPPCli::Device::Username
getset

Gets or sets the account username used to communicate with the device, if any.

The username.

Definition at line 275 of file Device.h.

System:: String^ CPPCli::Device::Vendor
get

Gets the device vendor, if any.

The name of the devices vendor.

Definition at line 289 of file Device.h.

System:: String^ CPPCli::Device::Version
get

Gets the current version of software running on the device.

The software version.

Definition at line 298 of file Device.h.

System:: String^ CPPCli::Device::VirtualIp
get

Gets the virtual IP of the device, if any.

The virtual IP.

Definition at line 307 of file Device.h.


The documentation for this class was generated from the following files: