matlab::data::EnumArray
C++ class to access MATLAB enumeration arrays
Description
Use EnumArray
objects to access enumeration arrays. To create an
EnumArray
, call createEnumArray
in the
ArrayFactory
class.
Class Details
Namespace: | matlab::data |
Base class: | TypedArray<Enumeration> |
Include: | EnumArray.hpp |
Constructors
Copy Constructors
EnumArray(const EnumArray& rhs)
EnumArray(const Array& rhs)
Creates a shared data copy of an EnumArray
object.
|
Value to copy. |
|
Value specified as |
|
Type of input |
Copy Assignment Operators
EnumArray& operator=(const EnumArray& rhs)
EnumArray& operator=(const Array& rhs)
Assigns a shared data copy to an EnumArray
object.
|
Value to copy. |
|
Value specified as
|
|
Updated instance. |
|
Type of input |
Move Constructors
EnumArray(EnumArray&& rhs)
EnumArray(Array&& rhs)
Moves contents of an EnumArray
object to a new
instance.
|
Value to move. |
|
Value specified as
|
|
Type of input |
Move Assignment Operators
EnumArray& operator=(EnumArray&& rhs)
EnumArray& operator=(Array&& rhs)
Assigns the input to this EnumArray
object.
|
Value to move. |
|
Value specified as
|
|
Updated instance. |
|
Type of input |
Member Functions
getClassName
std::string getClassName() const
Return class name for this EnumArray
.
|
Class name. |
None
Examples
Display enum
Value
Define an enumeration class:
classdef MyClass enumeration A B C end end
Define a matlab::data::EnumArray
object for the
MyClass.C
enumeration argument and
display the value.
#include "MatlabDataArray.hpp" #include "MatlabEngine.hpp" #include <iostream> int main() { using namespace matlab::data; ArrayFactory f; auto e = f.createEnumArray({ 1,1 }, "MyClass", { "C" }); // Display enum value std::cout << "Property value: " << std::string(e[0]) << std::endl; return 0; }
Version History
Introduced in R2017b