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

The Privilege class represents a specific permission that is given to a role. More...

#include <Privilege.h>

Public Types

enum  PermissionIds {
  PermissionIds::Unknown,
  PermissionIds::ViewVideoSources,
  PermissionIds::UsePtzMode,
  PermissionIds::LockPtzMode,
  PermissionIds::CreateSystemBookmarks,
  PermissionIds::DeleteSystemBookmarks,
  PermissionIds::LaunchSavedViewsRemotely,
  PermissionIds::ViewRecordedVideo,
  PermissionIds::ExportMediaClips,
  PermissionIds::DeleteExports,
  PermissionIds::UseMap,
  PermissionIds::ViewMaps,
  PermissionIds::PlaceCamerasOnMap,
  PermissionIds::ManageMapFiles,
  PermissionIds::AccessUserViews,
  PermissionIds::ManageSystemViews,
  PermissionIds::AuditUserActivity,
  PermissionIds::ViewEventHistory,
  PermissionIds::HandleEvents,
  PermissionIds::ConfigureEvents,
  PermissionIds::ManageUserAccounts,
  PermissionIds::ManageAggregatorAccount,
  PermissionIds::AssignRolesToUsers,
  PermissionIds::ManageRoles,
  PermissionIds::ManageSystemTags,
  PermissionIds::SetupEdgeDevices,
  PermissionIds::ConfigureMonitorWallDecoders,
  PermissionIds::ConfigureRecording
}
 
enum  ResourceTypes {
  ResourceTypes::Unknown,
  ResourceTypes::DataSource,
  ResourceTypes::Device,
  ResourceTypes::User
}
 Values that represent a type of resource. More...
 

Public Member Functions

 Privilege (VxSdk::IVxPrivilege *vxPrivilege)
 Constructor. More...
 
virtual ~Privilege ()
 Destructor. More...
 
 !Privilege ()
 Finaliser. More...
 
CPPCli::Results::Value Link (System::Collections::Generic::List< DataSource^ >^dataSources)
 Associate data sources with this privilege. More...
 
CPPCli::Results::Value Link (System::Collections::Generic::List< Device^ >^devices)
 Associate devices with this privilege. More...
 
CPPCli::Results::Value Link (System::Collections::Generic::List< User^ >^users)
 Associate users with this privilege. More...
 
Results::Value Refresh ()
 Refreshes this instances properties. More...
 
CPPCli::Results::Value Unlink (System::Collections::Generic::List< DataSource^ >^dataSources)
 Remove data source associations from this privilege. More...
 
CPPCli::Results::Value Unlink (System::Collections::Generic::List< Device^ >^devices)
 Remove device associations from this privilege. More...
 
CPPCli::Results::Value Unlink (System::Collections::Generic::List< User^ >^users)
 Remove user associations from this privilege. More...
 

Package Functions

System::Collections::Generic::List< DataSource^ >^ _GetLinkedDataSources ()
 
System::Collections::Generic::List< Device^ >^ _GetLinkedDevices ()
 
System::Collections::Generic::List< User^ >^ _GetLinkedUsers ()
 
int _GetPriority ()
 
bool _GetRestricted ()
 
System::Collections::Generic::List< DataSource^ >^ _GetUnLinkedDataSources ()
 
System::Collections::Generic::List< Device^ >^ _GetUnLinkedDevices ()
 
System::Collections::Generic::List< User^ >^ _GetUnLinkedUsers ()
 

Package Attributes

VxSdk::IVxPrivilege_privilege
 

Properties

bool ExcludeRestricted [get, set]
 Gets or sets whether the privilege is excluded from the associated resources. More...
 
System::String^  Id [get]
 Gets the unique identifier for this privilege. More...
 
bool IsRestricted [get, set]
 Gets or sets whether the privilege is restricted to the associated resources. More...
 
System::Collections::Generic::List< DataSource^ >^ LinkedDataSources [get]
 Gets the data sources associated with this privilege. More...
 
System::Collections::Generic::List< Device^ >^ LinkedDevices [get]
 Gets the devices associated with this privilege. More...
 
System::Collections::Generic::List< User^ >^ LinkedUsers [get]
 Gets the users associated with this privilege. More...
 
PermissionIds PermissionId [get]
 Gets the identifier of the permission being granted by this privilege. More...
 
int Priority [get, set]
 Gets or sets the relative priority for the privilege, from 1 to 250. Smaller numbers have higher priority than larger numbers (e.g. 1 is the highest priority). More...
 
ResourceTypes ResourceType [get]
 Gets the resource type, if any, that can be linked to this privilege. More...
 
System::Collections::Generic::List< DataSource^ >^ UnLinkedDataSources [get]
 Gets the data sources not associated with this privilege. More...
 
System::Collections::Generic::List< Device^ >^ UnLinkedDevices [get]
 Gets the devices not associated with this privilege. More...
 
System::Collections::Generic::List< User^ >^ UnLinkedUsers [get]
 Gets the users not associated with this privilege. More...
 

Detailed Description

The Privilege class represents a specific permission that is given to a role.

Definition at line 15 of file Privilege.h.

Member Enumeration Documentation

Enumerator
Unknown 

An error or unknown value was returned.

ViewVideoSources 

View video sources.

UsePtzMode 

Use PTZ mode.

LockPtzMode 

Lock PTZ mode.

CreateSystemBookmarks 

Create system bookmarks.

DeleteSystemBookmarks 

Delete system bookmarks.

LaunchSavedViewsRemotely 

Launch saved views remotely.

ViewRecordedVideo 

View recorded video.

ExportMediaClips 

Export media clips.

DeleteExports 

Delete exports.

UseMap 

Use map.

ViewMaps 

View maps.

PlaceCamerasOnMap 

Place cameras on map.

ManageMapFiles 

Manage map files.

AccessUserViews 

Access user views.

ManageSystemViews 

Manage system views.

AuditUserActivity 

Audit user activity.

ViewEventHistory 

View event history.

HandleEvents 

Handle events.

ConfigureEvents 

Configure events.

ManageUserAccounts 

Manage user accounts.

ManageAggregatorAccount 

Manage aggregator account.

AssignRolesToUsers 

Assign roles to users.

ManageRoles 

Manage roles.

ManageSystemTags 

Manage system tags.

SetupEdgeDevices 

Setup edge devices.

ConfigureMonitorWallDecoders 

Configure monitor wall decoders.

ConfigureRecording 

Configure recording.

Definition at line 17 of file Privilege.h.

17  {
19  Unknown,
20 
22  ViewVideoSources,
23 
25  UsePtzMode,
26 
28  LockPtzMode,
29 
31  CreateSystemBookmarks,
32 
34  DeleteSystemBookmarks,
35 
37  LaunchSavedViewsRemotely,
38 
40  ViewRecordedVideo,
41 
43  ExportMediaClips,
44 
46  DeleteExports,
47 
49  UseMap,
50 
52  ViewMaps,
53 
55  PlaceCamerasOnMap,
56 
58  ManageMapFiles,
59 
61  AccessUserViews,
62 
64  ManageSystemViews,
65 
67  AuditUserActivity,
68 
70  ViewEventHistory,
71 
73  HandleEvents,
74 
76  ConfigureEvents,
77 
79  ManageUserAccounts,
80 
82  ManageAggregatorAccount,
83 
85  AssignRolesToUsers,
86 
88  ManageRoles,
89 
91  ManageSystemTags,
92 
94  SetupEdgeDevices,
95 
97  ConfigureMonitorWallDecoders,
98 
100  ConfigureRecording
101  };

Values that represent a type of resource.

Enumerator
Unknown 

An error or unknown value was returned.

DataSource 

A data source.

Device 

A device.

User 

A user.

Definition at line 106 of file Privilege.h.

106  {
108  Unknown,
110  DataSource,
112  Device,
114  User
115  };

Constructor & Destructor Documentation

CPPCli::Privilege::Privilege ( VxSdk::IVxPrivilege vxPrivilege)

Constructor.

Parameters
vxPrivilegeThe vx privilege.

Definition at line 10 of file Privilege.cpp.

10  {
11  _privilege = vxPrivilege;
12 }
VxSdk::IVxPrivilege * _privilege
Definition: Privilege.h:296
virtual CPPCli::Privilege::~Privilege ( )
inlinevirtual

Destructor.

Definition at line 126 of file Privilege.h.

126  {
127  this->!Privilege();
128  }
Privilege(VxSdk::IVxPrivilege *vxPrivilege)
Constructor.
Definition: Privilege.cpp:10
CPPCli::Privilege::!Privilege ( )

Finaliser.

Definition at line 14 of file Privilege.cpp.

14  {
15  _privilege->Delete();
16  _privilege = nullptr;
17 }
VxSdk::IVxPrivilege * _privilege
Definition: Privilege.h:296
virtual VxResult::Value Delete() const =0

Member Function Documentation

System::Collections::Generic::List< CPPCli::DataSource^ > CPPCli::Privilege::_GetLinkedDataSources ( )
package

Definition at line 101 of file Privilege.cpp.

101  {
102  // Create a list of managed data sources
103  List<CPPCli::DataSource^>^ mlist = gcnew List<CPPCli::DataSource^>();
104  // Create a collection of unmanaged data sources
106 
107  // Make the GetLinks call, which will return with the total data source count, this
108  // allows the client to allocate memory.
109  VxSdk::VxResult::Value result = _privilege->GetLinks(dataSources);
110  // As long as there are data sources linked the result should be VxSdk::VxResult::kInsufficientSize
111  if (result == VxSdk::VxResult::kInsufficientSize) {
112  // Allocate enough space for the IVxDataSource collection
113  dataSources.collection = new VxSdk::IVxDataSource*[dataSources.collectionSize];
114  result = _privilege->GetLinks(dataSources);
115  // The result should now be kOK since we have allocated enough space
116  if (result == VxSdk::VxResult::kOK) {
117  for (int i = 0; i < dataSources.collectionSize; i++)
118  mlist->Add(gcnew CPPCli::DataSource(dataSources.collection[i]));
119  }
120  // Remove the memory we previously allocated to the collection
121  delete[] dataSources.collection;
122  }
123  return mlist;
124 }
The DataSource class represents a data producer in the system hosted by a device. Each DataSource pro...
Definition: DataSource.h:20
virtual VxResult::Value GetLinks(VxCollection< IVxDataSource ** > &dataSourceCollection) const =0
VxSdk::IVxPrivilege * _privilege
Definition: Privilege.h:296
System::Collections::Generic::List< CPPCli::Device^ > CPPCli::Privilege::_GetLinkedDevices ( )
package

Definition at line 126 of file Privilege.cpp.

126  {
127  // Create a list of managed devices
128  List<CPPCli::Device^>^ mlist = gcnew List<CPPCli::Device^>();
129  // Create a collection of unmanaged devices
131 
132  // Make the GetLinks call, which will return with the total device count, this allows the
133  // client to allocate memory.
134  VxSdk::VxResult::Value result = _privilege->GetLinks(devices);
135  // As long as there are devices linked the result should be VxSdk::VxResult::kInsufficientSize
136  if (result == VxSdk::VxResult::kInsufficientSize) {
137  // Allocate enough space for the IVxDevice collection
138  devices.collection = new VxSdk::IVxDevice*[devices.collectionSize];
139  result = _privilege->GetLinks(devices);
140  // The result should now be kOK since we have allocated enough space
141  if (result == VxSdk::VxResult::kOK) {
142  for (int i = 0; i < devices.collectionSize; i++)
143  mlist->Add(gcnew CPPCli::Device(devices.collection[i]));
144  }
145  // Remove the memory we previously allocated to the collection
146  delete[] devices.collection;
147  }
148  return mlist;
149 }
virtual VxResult::Value GetLinks(VxCollection< IVxDataSource ** > &dataSourceCollection) const =0
VxSdk::IVxPrivilege * _privilege
Definition: Privilege.h:296
The Device class represents a particular physical device in the system.
Definition: Device.h:15
System::Collections::Generic::List< CPPCli::User^ > CPPCli::Privilege::_GetLinkedUsers ( )
package

Definition at line 151 of file Privilege.cpp.

151  {
152  // Create a list of managed users
153  List<CPPCli::User^>^ mlist = gcnew List<CPPCli::User^>();
154  // Create a collection of unmanaged users
156 
157  // Make the GetLinks call, which will return with the total user count, this
158  // allows the client to allocate memory.
159  VxSdk::VxResult::Value result = _privilege->GetLinks(users);
160  // As long as there are users linked the result should be VxSdk::VxResult::kInsufficientSize
161  if (result == VxSdk::VxResult::kInsufficientSize) {
162  // Allocate enough space for the IVxUser collection
163  users.collection = new VxSdk::IVxUser*[users.collectionSize];
164  result = _privilege->GetLinks(users);
165  // The result should now be kOK since we have allocated enough space
166  if (result == VxSdk::VxResult::kOK) {
167  for (int i = 0; i < users.collectionSize; i++)
168  mlist->Add(gcnew CPPCli::User(users.collection[i]));
169  }
170  // Remove the memory we previously allocated to the collection
171  delete[] users.collection;
172  }
173  return mlist;
174 }
virtual VxResult::Value GetLinks(VxCollection< IVxDataSource ** > &dataSourceCollection) const =0
The User class represents information about a system user.
Definition: User.h:16
VxSdk::IVxPrivilege * _privilege
Definition: Privilege.h:296
int CPPCli::Privilege::_GetPriority ( )
package

Definition at line 176 of file Privilege.cpp.

176  {
177  // Get and return the priority
178  int priority;
179  _privilege->GetPriority(priority);
180  return priority;
181 }
virtual VxResult::Value GetPriority(int &priority) const =0
VxSdk::IVxPrivilege * _privilege
Definition: Privilege.h:296
bool CPPCli::Privilege::_GetRestricted ( )
package

Definition at line 183 of file Privilege.cpp.

183  {
184  // Get and return the restriction state
185  bool isRestricted;
186  _privilege->GetRestricted(isRestricted);
187  return isRestricted;
188 }
virtual VxResult::Value GetRestricted(bool &isRestricted) const =0
VxSdk::IVxPrivilege * _privilege
Definition: Privilege.h:296
System::Collections::Generic::List< CPPCli::DataSource^ > CPPCli::Privilege::_GetUnLinkedDataSources ( )
package

Definition at line 190 of file Privilege.cpp.

190  {
191  // Create a list of managed data sources
192  List<CPPCli::DataSource^>^ mlist = gcnew List<CPPCli::DataSource^>();
193  // Create a collection of unmanaged data sources
195 
196  // Make the GetUnLinked call, which will return with the total data source count, this
197  // allows the client to allocate memory.
198  VxSdk::VxResult::Value result = _privilege->GetUnLinked(dataSources);
199  // As long as there are data sources linked the result should be VxSdk::VxResult::kInsufficientSize
200  if (result == VxSdk::VxResult::kInsufficientSize) {
201  // Allocate enough space for the IVxDataSource collection
202  dataSources.collection = new VxSdk::IVxDataSource*[dataSources.collectionSize];
203  result = _privilege->GetUnLinked(dataSources);
204  // The result should now be kOK since we have allocated enough space
205  if (result == VxSdk::VxResult::kOK) {
206  for (int i = 0; i < dataSources.collectionSize; i++)
207  mlist->Add(gcnew CPPCli::DataSource(dataSources.collection[i]));
208  }
209  // Remove the memory we previously allocated to the collection
210  delete[] dataSources.collection;
211  }
212  return mlist;
213 }
virtual VxResult::Value GetUnLinked(VxCollection< IVxDataSource ** > &dataSourceCollection) const =0
The DataSource class represents a data producer in the system hosted by a device. Each DataSource pro...
Definition: DataSource.h:20
VxSdk::IVxPrivilege * _privilege
Definition: Privilege.h:296
System::Collections::Generic::List< CPPCli::Device^ > CPPCli::Privilege::_GetUnLinkedDevices ( )
package

Definition at line 215 of file Privilege.cpp.

215  {
216  // Create a list of managed devices
217  List<CPPCli::Device^>^ mlist = gcnew List<CPPCli::Device^>();
218  // Create a collection of unmanaged devices
220 
221  // Make the GetUnLinked call, which will return with the total device count, this allows the
222  // client to allocate memory.
223  VxSdk::VxResult::Value result = _privilege->GetUnLinked(devices);
224  // As long as there are devices linked the result should be VxSdk::VxResult::kInsufficientSize
225  if (result == VxSdk::VxResult::kInsufficientSize) {
226  // Allocate enough space for the IVxDevice collection
227  devices.collection = new VxSdk::IVxDevice*[devices.collectionSize];
228  result = _privilege->GetUnLinked(devices);
229  // The result should now be kOK since we have allocated enough space
230  if (result == VxSdk::VxResult::kOK) {
231  for (int i = 0; i < devices.collectionSize; i++)
232  mlist->Add(gcnew CPPCli::Device(devices.collection[i]));
233  }
234  // Remove the memory we previously allocated to the collection
235  delete[] devices.collection;
236  }
237  return mlist;
238 }
virtual VxResult::Value GetUnLinked(VxCollection< IVxDataSource ** > &dataSourceCollection) const =0
VxSdk::IVxPrivilege * _privilege
Definition: Privilege.h:296
The Device class represents a particular physical device in the system.
Definition: Device.h:15
System::Collections::Generic::List< CPPCli::User^ > CPPCli::Privilege::_GetUnLinkedUsers ( )
package

Definition at line 240 of file Privilege.cpp.

240  {
241  // Create a list of managed users
242  List<CPPCli::User^>^ mlist = gcnew List<CPPCli::User^>();
243  // Create a collection of unmanaged users
245 
246  // Make the GetUnLinked call, which will return with the total user count, this
247  // allows the client to allocate memory.
249  // As long as there are users linked the result should be VxSdk::VxResult::kInsufficientSize
250  if (result == VxSdk::VxResult::kInsufficientSize) {
251  // Allocate enough space for the IVxUser collection
252  users.collection = new VxSdk::IVxUser*[users.collectionSize];
253  result = _privilege->GetUnLinked(users);
254  // The result should now be kOK since we have allocated enough space
255  if (result == VxSdk::VxResult::kOK) {
256  for (int i = 0; i < users.collectionSize; i++)
257  mlist->Add(gcnew CPPCli::User(users.collection[i]));
258  }
259  // Remove the memory we previously allocated to the collection
260  delete[] users.collection;
261  }
262  return mlist;
263 }
virtual VxResult::Value GetUnLinked(VxCollection< IVxDataSource ** > &dataSourceCollection) const =0
The User class represents information about a system user.
Definition: User.h:16
VxSdk::IVxPrivilege * _privilege
Definition: Privilege.h:296
CPPCli::Results::Value CPPCli::Privilege::Link ( System::Collections::Generic::List< DataSource^ >^  dataSources)

Associate data sources with this privilege.

Parameters
dataSourcesA List containing the data sources to be added.
Returns
The Result of adding the data sources.
CPPCli::Results::Value CPPCli::Privilege::Link ( System::Collections::Generic::List< Device^ >^  devices)

Associate devices with this privilege.

Parameters
devicesA List containing the devices to be added.
Returns
The Result of adding the devices.
CPPCli::Results::Value CPPCli::Privilege::Link ( System::Collections::Generic::List< User^ >^  users)

Associate users with this privilege.

Parameters
usersA List containing the data sources to be added.
Returns
The Result of adding the data sources.
CPPCli::Results::Value CPPCli::Privilege::Refresh ( )

Refreshes this instances properties.

Returns
The Result of updating the properties.

Definition at line 58 of file Privilege.cpp.

58  {
60 }
Value
Values that represent the result of calls to the VideoXpert system.
Definition: Utils.h:21
virtual VxResult::Value Refresh()=0
VxSdk::IVxPrivilege * _privilege
Definition: Privilege.h:296
CPPCli::Results::Value CPPCli::Privilege::Unlink ( System::Collections::Generic::List< DataSource^ >^  dataSources)

Remove data source associations from this privilege.

Parameters
dataSourcesA List containing the data sources to be removed.
Returns
The Result of removing the data sources.
CPPCli::Results::Value CPPCli::Privilege::Unlink ( System::Collections::Generic::List< Device^ >^  devices)

Remove device associations from this privilege.

Parameters
devicesA List containing the devices to be removed.
Returns
The Result of removing the devices.
CPPCli::Results::Value CPPCli::Privilege::Unlink ( System::Collections::Generic::List< User^ >^  users)

Remove user associations from this privilege.

Parameters
usersA List containing the users to be removed.
Returns
The Result of removing the users.

Member Data Documentation

VxSdk::IVxPrivilege* CPPCli::Privilege::_privilege
package

Definition at line 296 of file Privilege.h.

Property Documentation

bool CPPCli::Privilege::ExcludeRestricted
getset

Gets or sets whether the privilege is excluded from the associated resources.

true if the privilege is excluded, false if not.

Definition at line 187 of file Privilege.h.

System:: String^ CPPCli::Privilege::Id
get

Gets the unique identifier for this privilege.

The unique identifier.

Definition at line 197 of file Privilege.h.

bool CPPCli::Privilege::IsRestricted
getset

Gets or sets whether the privilege is restricted to the associated resources.

true if restricted, false if not.

Definition at line 206 of file Privilege.h.

System:: Collections:: Generic:: List< DataSource^>^ CPPCli::Privilege::LinkedDataSources
get

Gets the data sources associated with this privilege.

A list of data sources.

Definition at line 216 of file Privilege.h.

System:: Collections:: Generic:: List< Device^>^ CPPCli::Privilege::LinkedDevices
get

Gets the devices associated with this privilege.

A list of devices.

Definition at line 225 of file Privilege.h.

System:: Collections:: Generic:: List< User^>^ CPPCli::Privilege::LinkedUsers
get

Gets the users associated with this privilege.

A list of users.

Definition at line 234 of file Privilege.h.

PermissionIds CPPCli::Privilege::PermissionId
get

Gets the identifier of the permission being granted by this privilege.

The permission identifier.

Definition at line 243 of file Privilege.h.

int CPPCli::Privilege::Priority
getset

Gets or sets the relative priority for the privilege, from 1 to 250. Smaller numbers have higher priority than larger numbers (e.g. 1 is the highest priority).

The priority.

Definition at line 253 of file Privilege.h.

ResourceTypes CPPCli::Privilege::ResourceType
get

Gets the resource type, if any, that can be linked to this privilege.

The resource type.

Definition at line 263 of file Privilege.h.

System:: Collections:: Generic:: List< DataSource^>^ CPPCli::Privilege::UnLinkedDataSources
get

Gets the data sources not associated with this privilege.

A list of data sources.

Definition at line 272 of file Privilege.h.

System:: Collections:: Generic:: List< Device^>^ CPPCli::Privilege::UnLinkedDevices
get

Gets the devices not associated with this privilege.

A list of devices.

Definition at line 281 of file Privilege.h.

System:: Collections:: Generic:: List< User^>^ CPPCli::Privilege::UnLinkedUsers
get

Gets the users not associated with this privilege.

A list of users.

Definition at line 290 of file Privilege.h.


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