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

The DataObject class represents an object that contains a custom serialized data object submitted by a client and stored on the server. The data is completely opaque to the server and other types of clients. More...

#include <DataObject.h>

Public Member Functions

 DataObject (VxSdk::IVxDataObject *vxDataObject)
 Constructor. More...
 
virtual ~DataObject ()
 Destructor. More...
 
 !DataObject ()
 Finaliser. More...
 
Results::Value Refresh ()
 Refreshes this instances properties. More...
 

Package Functions

System::String^ _GetData ()
 
CPPCli::User_GetOwner ()
 
void _SetData (System::String^ )
 

Package Attributes

VxSdk::IVxDataObject_dataObject
 

Properties

System::String^  Data [get, set]
 Gets or sets the serialized data. More...
 
System::String^  ClientType [get]
 Gets the client identifier. More...
 
System::String^  Id [get]
 Gets the unique identifier for this data object. More...
 
CPPCli::User^  Owner [get]
 Gets the User that owns this data object. More...
 
System::String^  OwnerName [get]
 Gets the name of the user that owns this data object. More...
 

Detailed Description

The DataObject class represents an object that contains a custom serialized data object submitted by a client and stored on the server. The data is completely opaque to the server and other types of clients.

Definition at line 16 of file DataObject.h.

Constructor & Destructor Documentation

CPPCli::DataObject::DataObject ( VxSdk::IVxDataObject vxDataObject)

Constructor.

Parameters
vxDataObjectThe vx data object.

Definition at line 10 of file DataObject.cpp.

10  {
11  _dataObject = vxDataObject;
12 }
VxSdk::IVxDataObject * _dataObject
Definition: DataObject.h:90
virtual CPPCli::DataObject::~DataObject ( )
inlinevirtual

Destructor.

Definition at line 28 of file DataObject.h.

28  {
29  this->!DataObject();
30  }
DataObject(VxSdk::IVxDataObject *vxDataObject)
Constructor.
Definition: DataObject.cpp:10
CPPCli::DataObject::!DataObject ( )

Finaliser.

Definition at line 14 of file DataObject.cpp.

14  {
16  _dataObject = nullptr;
17 }
virtual VxResult::Value Delete() const =0
VxSdk::IVxDataObject * _dataObject
Definition: DataObject.h:90

Member Function Documentation

System::String CPPCli::DataObject::_GetData ( )
package

Definition at line 23 of file DataObject.cpp.

23  {
24  char* data = nullptr;
25  int size = 0;
26 
27  // If the data is not available on the data object the result will return VxSdk::VxResult::kActionUnavailable,
28  // otherwise VxSdk::VxResult::kInsufficientSize
29  VxSdk::VxResult::Value result = _dataObject->GetData(data, size);
30  if (result == VxSdk::VxResult::kInsufficientSize) {
31  // Allocate enough space for the data
32  data = new char[size];
33  // The result should now be kOK since we have allocated enough space
34  _dataObject->GetData(data, size);
35  }
36  return gcnew System::String(data);
37 }
virtual VxResult::Value GetData(char *data, int &size) const =0
VxSdk::IVxDataObject * _dataObject
Definition: DataObject.h:90
CPPCli::User CPPCli::DataObject::_GetOwner ( )
package

Definition at line 39 of file DataObject.cpp.

39  {
40  // Get the user object
41  VxSdk::IVxUser* user = nullptr;
43 
44  // Return the user if GetOwner was successful
45  if (result == VxSdk::VxResult::kOK)
46  return gcnew CPPCli::User(user);
47 
48  // Return nullptr if GetOwner is unsuccessful
49  return nullptr;
50 }
virtual VxResult::Value GetOwner(IVxUser *&user) const =0
The User class represents information about a system user.
Definition: User.h:16
VxSdk::IVxDataObject * _dataObject
Definition: DataObject.h:90
void CPPCli::DataObject::_SetData ( System::String^  data)
package

Definition at line 52 of file DataObject.cpp.

52  {
53  // Copy the data string to a new char
54  int dataSize = data->Length + 1;
55  char* newData = new char[dataSize];
57 
58  // Set the data value for the data object
59  _dataObject->SetData(newData);
60 }
static void StrCopySafe(char(&dst)[dstSize], const char *src)
virtual VxResult::Value SetData(char *data)=0
VxSdk::IVxDataObject * _dataObject
Definition: DataObject.h:90
static const char * ConvertSysString(System::String^ sysString)
Convert a system string to a char.
Definition: Utils.h:233
CPPCli::Results::Value CPPCli::DataObject::Refresh ( )

Refreshes this instances properties.

Returns
The Result of updating the properties.

Definition at line 19 of file DataObject.cpp.

19  {
21 }
Value
Values that represent the result of calls to the VideoXpert system.
Definition: Utils.h:21
virtual VxResult::Value Refresh()=0
VxSdk::IVxDataObject * _dataObject
Definition: DataObject.h:90

Member Data Documentation

VxSdk::IVxDataObject* CPPCli::DataObject::_dataObject
package

Definition at line 90 of file DataObject.h.

Property Documentation

System:: String^ CPPCli::DataObject::ClientType
get

Gets the client identifier.

The client identifier.

Definition at line 57 of file DataObject.h.

System:: String^ CPPCli::DataObject::Data
getset

Gets or sets the serialized data.

The serialized data.

Definition at line 47 of file DataObject.h.

System:: String^ CPPCli::DataObject::Id
get

Gets the unique identifier for this data object.

The unique identifier.

Definition at line 66 of file DataObject.h.

CPPCli:: User^ CPPCli::DataObject::Owner
get

Gets the User that owns this data object.

The owner of this data object.

Definition at line 75 of file DataObject.h.

System:: String^ CPPCli::DataObject::OwnerName
get

Gets the name of the user that owns this data object.

The name of the owner.

Definition at line 84 of file DataObject.h.


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