By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,714 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

Generic class syntax help needed

P: n/a
Hello all,

Given this C# generic class definition:

class Command<Key, Data>
{
BerkeleyParameter<Key> key;
BerkeleyParameter<Data> data;

public void AddParameters(BerkeleyParameter<Key> key,
BerkeleyParameter<Data> data)
{
this.key = key;
this.data = data;
}
}

Can someone please show me the C++/CL definition? The BerkeleyParameter
field is also a generic class which I've already got as the following:

generic <class T>
public ref class BerkeleyParameter
{
private:
T _value;

public:
array<unsigned char>^ Serialize();
void Deserialize(array<unsigned char>^ buffer);

public:
BerkeleyParameter(T t);

property T Value{ T get(); void set(T value); }
};

Any help is appreciated,
Ron
Mar 16 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Our Instant C++ (C# Edition) C# to C++ converter produces:

generic<typename Key, typename Data>
private ref class Command
{
private:
BerkeleyParameter<Key> ^key;
BerkeleyParameter<Data> ^data;

public:
void AddParameters(BerkeleyParameter<Key> ^key, BerkeleyParameter<Data>
^data)
{
this->key = key;
this->data = data;
}
};
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter & VB to C++ converter
Instant J#: VB to J# converter

"RYoung" wrote:
Hello all,

Given this C# generic class definition:

class Command<Key, Data>
{
BerkeleyParameter<Key> key;
BerkeleyParameter<Data> data;

public void AddParameters(BerkeleyParameter<Key> key,
BerkeleyParameter<Data> data)
{
this.key = key;
this.data = data;
}
}

Can someone please show me the C++/CL definition? The BerkeleyParameter
field is also a generic class which I've already got as the following:

generic <class T>
public ref class BerkeleyParameter
{
private:
T _value;

public:
array<unsigned char>^ Serialize();
void Deserialize(array<unsigned char>^ buffer);

public:
BerkeleyParameter(T t);

property T Value{ T get(); void set(T value); }
};

Any help is appreciated,
Ron

Mar 17 '06 #2

P: n/a
Pretty sweet, I"m gonna have a look at that tool. Thanks for the help.

Ron

"David Anton" <Da********@discussions.microsoft.com> wrote in message
news:C8**********************************@microsof t.com...
Our Instant C++ (C# Edition) C# to C++ converter produces:

generic<typename Key, typename Data>
private ref class Command
{
private:
BerkeleyParameter<Key> ^key;
BerkeleyParameter<Data> ^data;

public:
void AddParameters(BerkeleyParameter<Key> ^key, BerkeleyParameter<Data>
^data)
{
this->key = key;
this->data = data;
}
};
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter & VB to C++ converter
Instant J#: VB to J# converter

"RYoung" wrote:
Hello all,

Given this C# generic class definition:

class Command<Key, Data>
{
BerkeleyParameter<Key> key;
BerkeleyParameter<Data> data;

public void AddParameters(BerkeleyParameter<Key> key,
BerkeleyParameter<Data> data)
{
this.key = key;
this.data = data;
}
}

Can someone please show me the C++/CL definition? The BerkeleyParameter
field is also a generic class which I've already got as the following:

generic <class T>
public ref class BerkeleyParameter
{
private:
T _value;

public:
array<unsigned char>^ Serialize();
void Deserialize(array<unsigned char>^ buffer);

public:
BerkeleyParameter(T t);

property T Value{ T get(); void set(T value); }
};

Any help is appreciated,
Ron

Mar 17 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.