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

The PtzLock class represents a lock for a ptz controller. More...

#include <PtzLock.h>

Public Member Functions

 PtzLock (VxSdk::IVxPtzLock *vxPtzLock)
 Constructor. More...
 
virtual ~PtzLock ()
 Destructor. More...
 
 !PtzLock ()
 Finaliser. More...
 
Results::Value Lock (int expireTime)
 Lock the ptz control. More...
 
Results::Value Refresh ()
 Update this instances properties. More...
 
Results::Value Unlock ()
 Unlock the ptz control. More...
 

Package Functions

int _GetExpireTime ()
 
bool _GetLockState ()
 
System::String^ _GetOwner ()
 

Package Attributes

VxSdk::IVxPtzLock_ptzLock
 

Properties

int ExpireTime [get]
 Gets the amount of time (in seconds) that the ptz lock will be held. More...
 
System::String^  Id [get]
 Gets the unique identifier of the ptz lock. More...
 
bool IsLocked [get]
 Gets a value indicating whether the lock is active. More...
 
System::String^  Owner [get]
 Gets the name of the user that has locked the ptz controller, if any. More...
 

Detailed Description

The PtzLock class represents a lock for a ptz controller.

Definition at line 13 of file PtzLock.h.

Constructor & Destructor Documentation

CPPCli::PtzLock::PtzLock ( VxSdk::IVxPtzLock vxPtzLock)

Constructor.

Implements the ptz lock class.

Parameters
vxPtzLockThe ptz lock.

Definition at line 6 of file PtzLock.cpp.

6  {
7  _ptzLock = vxPtzLock;
8 }
VxSdk::IVxPtzLock * _ptzLock
Definition: PtzLock.h:91
virtual CPPCli::PtzLock::~PtzLock ( )
inlinevirtual

Destructor.

Definition at line 25 of file PtzLock.h.

25  {
26  this->!PtzLock();
27  }
PtzLock(VxSdk::IVxPtzLock *vxPtzLock)
Constructor.
Definition: PtzLock.cpp:6
CPPCli::PtzLock::!PtzLock ( )

Finaliser.

Definition at line 10 of file PtzLock.cpp.

10  {
11  _ptzLock->Delete();
12  _ptzLock = nullptr;
13 }
virtual VxResult::Value Delete() const =0
VxSdk::IVxPtzLock * _ptzLock
Definition: PtzLock.h:91

Member Function Documentation

int CPPCli::PtzLock::_GetExpireTime ( )
package

Definition at line 31 of file PtzLock.cpp.

31  {
32  // Get and return the expire time
33  int expireTime;
34  _ptzLock->GetExpireTime(expireTime);
35  return expireTime;
36 }
virtual VxResult::Value GetExpireTime(int &expireTime) const =0
VxSdk::IVxPtzLock * _ptzLock
Definition: PtzLock.h:91
bool CPPCli::PtzLock::_GetLockState ( )
package

Definition at line 38 of file PtzLock.cpp.

38  {
39  // Get and return the current lock state
40  bool lockStatus;
41  _ptzLock->GetLockState(lockStatus);
42  return lockStatus;
43 }
virtual VxResult::Value GetLockState(bool &isLocked) const =0
VxSdk::IVxPtzLock * _ptzLock
Definition: PtzLock.h:91
System::String CPPCli::PtzLock::_GetOwner ( )
package

Definition at line 45 of file PtzLock.cpp.

45  {
46  char* owner = nullptr;
47  int size = 0;
48 
49  // The owner can be empty if the ptz controller is not currently locked. If that is the case then the result
50  // returned will be VxSdk::VxResult::kOk and owner will remain a nullptr. Otherwise the return is
51  // VxSdk::VxResult::kInsufficientSize
52  VxSdk::VxResult::Value result = _ptzLock->GetOwner(owner, size);
53  if (result == VxSdk::VxResult::kInsufficientSize) {
54  // Allocate enough space for owner
55  owner = new char[size];
56  // The result should now be kOK since we have allocated enough space
57  _ptzLock->GetOwner(owner, size);
58  }
59  return gcnew System::String(owner);
60 }
virtual VxResult::Value GetOwner(char *owner, int &size) const =0
VxSdk::IVxPtzLock * _ptzLock
Definition: PtzLock.h:91
CPPCli::Results::Value CPPCli::PtzLock::Lock ( int  expireTime)

Lock the ptz control.

Parameters
expireTimeThe amount of time (in seconds) that the ptz lock will be held. The lock will not expire until it is explicitly unlocked if set to 0.
Returns
The Result of the request.

Definition at line 15 of file PtzLock.cpp.

15  {
16  // Call Lock and return the result
17  VxSdk::VxResult::Value result = _ptzLock->Lock(expireTime);
18  return CPPCli::Results::Value(result);
19 }
Value
Values that represent the result of calls to the VideoXpert system.
Definition: Utils.h:21
VxSdk::IVxPtzLock * _ptzLock
Definition: PtzLock.h:91
virtual VxResult::Value Lock(int expireTime) const =0
CPPCli::Results::Value CPPCli::PtzLock::Refresh ( )

Update this instances properties.

Returns
The Result of updating the properties.

Definition at line 21 of file PtzLock.cpp.

21  {
23 }
Value
Values that represent the result of calls to the VideoXpert system.
Definition: Utils.h:21
VxSdk::IVxPtzLock * _ptzLock
Definition: PtzLock.h:91
virtual VxResult::Value Refresh()=0
CPPCli::Results::Value CPPCli::PtzLock::Unlock ( )

Unlock the ptz control.

Returns
The Result of the request.

Definition at line 25 of file PtzLock.cpp.

25  {
26  // Call Unlock and return the result
28  return CPPCli::Results::Value(result);
29 }
Value
Values that represent the result of calls to the VideoXpert system.
Definition: Utils.h:21
virtual VxResult::Value Unlock() const =0
VxSdk::IVxPtzLock * _ptzLock
Definition: PtzLock.h:91

Member Data Documentation

VxSdk::IVxPtzLock* CPPCli::PtzLock::_ptzLock
package

Definition at line 91 of file PtzLock.h.

Property Documentation

int CPPCli::PtzLock::ExpireTime
get

Gets the amount of time (in seconds) that the ptz lock will be held.

The lock expire time in seconds.

Definition at line 58 of file PtzLock.h.

System:: String^ CPPCli::PtzLock::Id
get

Gets the unique identifier of the ptz lock.

The unique identifier.

Definition at line 67 of file PtzLock.h.

bool CPPCli::PtzLock::IsLocked
get

Gets a value indicating whether the lock is active.

true if locked, false if not.

Definition at line 76 of file PtzLock.h.

System:: String^ CPPCli::PtzLock::Owner
get

Gets the name of the user that has locked the ptz controller, if any.

The owner if it is set, else nullptr.

Definition at line 85 of file PtzLock.h.


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