A
Andrew Nefiodovas
I have an unmanaged C++ class representing a 2D matrix. It holds a
pointer to a block with the actual data, and fields indicating the
number, size and type of the matrix elements. Like this:
public class UnmanagedMatrix {
public:
void * block;
long rows;
long cols;
int type; //refers to an enum of possible types - char, long, double,
etc.
long sizeOfBlockType;
....
}
I am writing a managed wrapper to use this class from within .Net with
a member pointer to the unmanaged class in the usual way:
public __gc class ManagedMatrix {
private:
UnmanagedMatrix __nogc* pM;
....
}
I need the wrapper class to get and set the unmanaged block of matrix
data using System.Arrays. i.e I need methods like this:
public:
System.Array getData() {}
void setData(System.Array data) {} // maybe pass in the type as well?
Any help with these two methods would be appreciated.
I am not at liberty to modify the unmanaged class.
I am a C++ novice.
pointer to a block with the actual data, and fields indicating the
number, size and type of the matrix elements. Like this:
public class UnmanagedMatrix {
public:
void * block;
long rows;
long cols;
int type; //refers to an enum of possible types - char, long, double,
etc.
long sizeOfBlockType;
....
}
I am writing a managed wrapper to use this class from within .Net with
a member pointer to the unmanaged class in the usual way:
public __gc class ManagedMatrix {
private:
UnmanagedMatrix __nogc* pM;
....
}
I need the wrapper class to get and set the unmanaged block of matrix
data using System.Arrays. i.e I need methods like this:
public:
System.Array getData() {}
void setData(System.Array data) {} // maybe pass in the type as well?
Any help with these two methods would be appreciated.
I am not at liberty to modify the unmanaged class.
I am a C++ novice.