Thursday 15 May 2014

c# - c++/cli expose internal members to managed classes only -


Assume that I have a C + + unmanaged class that looks like this

  #include "note h" class wire (private: note * _root; // or, as in my actual class: std :: shared_ptr  _root; _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _- To give a string std :: shared_ptr  Root () const; // Return to PTR root std :: string name () const; // name of this string}  < / Pre> 

Now, I know that these sections But the question is how can I pass a personal indicator to the constructor to the original class?

As it stands, note inside the * _src note-wrapper Indigenous wire () is required by a native note object. Therefore, to go to Castor, unable to use Notroper _src, the codroffer is disabled, despite not opening the internal members. This How do?

EDIT **

  // Assume Notepad is already defined, with notes * _src as private public ref class class wapers (private: string * _ SRC; Public: chordwerapper (notedraphor ^ N1, notedriper ^ N2, note-wrapper ^ N3) {_src = new strings (* n1- & gt; _src, * n2- & gt; _src, * n2- & gt; _src ); // _src is useless}}   

The above is not possible because the cord-wrapper does not have access to that internal member since the friend is also not supported, I do not know the internal What else can I do to hide the guys from the nets, and I can expose them in the cli classes.

What is the proper way to handle it?

Internal members are in the same area, then there are private members in C ++ / CLI. It is similar to the C # internal correctional IHHO I think. Internal intrinsically defined classes / structures without visibility modifiers Ega?

  Public Ref Class Notifier {Note * _src; }   

is in the same scope

  public ref class note wapper {private: note * _src; }   

but

  public ref class notifier {internal: note * _src; }   

is a private member, which is further shared with the Clear Library

No comments:

Post a Comment