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

The Notification class represents a particular notification configuration for a situation. More...

#include <Notification.h>

Public Member Functions

 Notification (VxSdk::IVxNotification *vxNotification)
 Constructor. More...
 
virtual ~Notification ()
 Destructor. More...
 
 !Notification ()
 Finaliser. More...
 
CPPCli::Results::Value AddRole (Role^ role)
 Add a role to the list of roles that this notification serves. More...
 
Results::Value Refresh ()
 Refreshes this instances properties. More...
 
CPPCli::Results::Value RemoveRole (Role^ role)
 Remove a role from the list of roles that this notification serves. More...
 

Package Functions

System::Collections::Generic::List< Role^ >^ _GetRoles ()
 

Package Attributes

VxSdk::IVxNotification_notification
 

Properties

System::String^  Id [get]
 Gets the unique notification identifier. More...
 
System::Collections::Generic::List< Role^ >^ Roles [get]
 Gets the roles that this notification serves. More...
 

Detailed Description

The Notification class represents a particular notification configuration for a situation.

Definition at line 14 of file Notification.h.

Constructor & Destructor Documentation

CPPCli::Notification::Notification ( VxSdk::IVxNotification vxNotification)

Constructor.

Parameters
vxNotificationThe vx notification.

Definition at line 8 of file Notification.cpp.

8  {
9  _notification = vxNotification;
10 }
VxSdk::IVxNotification * _notification
Definition: Notification.h:74
virtual CPPCli::Notification::~Notification ( )
inlinevirtual

Destructor.

Definition at line 26 of file Notification.h.

26  {
27  this->!Notification();
28  }
Notification(VxSdk::IVxNotification *vxNotification)
Constructor.
Definition: Notification.cpp:8
CPPCli::Notification::!Notification ( )

Finaliser.

Definition at line 12 of file Notification.cpp.

12  {
14  _notification = nullptr;
15 }
virtual VxResult::Value Delete() const =0
VxSdk::IVxNotification * _notification
Definition: Notification.h:74

Member Function Documentation

System::Collections::Generic::List< CPPCli::Role^ > CPPCli::Notification::_GetRoles ( )
package

Definition at line 35 of file Notification.cpp.

35  {
36  // Create a list of managed roles
37  List<Role^>^ mlist = gcnew List<Role^>();
38  // Create a collection of unmanaged roles
40 
41  // Make the GetRoles call, which will return with the total role count, this
42  // allows the client to allocate memory.
44  // As long as there are roles linked the result should be VxSdk::VxResult::kInsufficientSize
45  if (result == VxSdk::VxResult::kInsufficientSize) {
46  // Allocate enough space for the IVxRole collection
47  roles.collection = new VxSdk::IVxRole*[roles.collectionSize];
48  result = _notification->GetRoles(roles);
49  // The result should now be kOK since we have allocated enough space
50  if (result == VxSdk::VxResult::kOK) {
51  for (int i = 0; i < roles.collectionSize; i++)
52  mlist->Add(gcnew Role(roles.collection[i]));
53  }
54  // Remove the memory we previously allocated to the collection
55  delete[] roles.collection;
56  }
57  return mlist;
58 }
virtual VxResult::Value GetRoles(VxCollection< IVxRole ** > &roleCollection) const =0
VxSdk::IVxNotification * _notification
Definition: Notification.h:74
CPPCli::Results::Value CPPCli::Notification::AddRole ( CPPCli::Role role)

Add a role to the list of roles that this notification serves.

Parameters
roleThe role to add to this notification.
Returns
The Result of adding the role.

Definition at line 17 of file Notification.cpp.

17  {
18  // Make the call to add the role to the notification
19  VxSdk::VxResult::Value result = _notification->AddRole(*role->_role);
20  // Unless there was an issue adding the role the result should be VxSdk::VxResult::kOK
21  return CPPCli::Results::Value(result);
22 }
Value
Values that represent the result of calls to the VideoXpert system.
Definition: Utils.h:21
VxSdk::IVxNotification * _notification
Definition: Notification.h:74
virtual VxResult::Value AddRole(IVxRole &role) const =0
CPPCli::Results::Value CPPCli::Notification::Refresh ( )

Refreshes this instances properties.

Returns
The Result of updating the properties.

Definition at line 24 of file Notification.cpp.

24  {
26 }
Value
Values that represent the result of calls to the VideoXpert system.
Definition: Utils.h:21
VxSdk::IVxNotification * _notification
Definition: Notification.h:74
virtual VxResult::Value Refresh()=0
CPPCli::Results::Value CPPCli::Notification::RemoveRole ( CPPCli::Role role)

Remove a role from the list of roles that this notification serves.

Parameters
roleThe role to remove from this notification.
Returns
The Result of removing the role.

Definition at line 28 of file Notification.cpp.

28  {
29  // Make the call to remove the role from the notification
30  VxSdk::VxResult::Value result = _notification->RemoveRole(*role->_role);
31  // Unless there was an issue removing the role the result should be VxSdk::VxResult::kOK
32  return CPPCli::Results::Value(result);
33 }
Value
Values that represent the result of calls to the VideoXpert system.
Definition: Utils.h:21
virtual VxResult::Value RemoveRole(IVxRole &role)=0
VxSdk::IVxNotification * _notification
Definition: Notification.h:74

Member Data Documentation

VxSdk::IVxNotification* CPPCli::Notification::_notification
package

Definition at line 74 of file Notification.h.

Property Documentation

System:: String^ CPPCli::Notification::Id
get

Gets the unique notification identifier.

The unique identifier.

Definition at line 59 of file Notification.h.

System:: Collections:: Generic:: List< Role^>^ CPPCli::Notification::Roles
get

Gets the roles that this notification serves.

A list of roles.

Definition at line 68 of file Notification.h.


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