473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Generic class syntax help needed

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
2 1267
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Steven Bethard | last post by:
So I thought I'd try to summarize a few things here and maybe we can move toward filing a PEP. I'm not really sure I'm the right person to champion it because, as I've mentioned, I usually...
6
by: Urs Eichmann | last post by:
While experimenting with the Feb CTP Edition of VB 2005, I came across "generic procedures". You can write: Public Class Foo Public Sub MySub(Of tDisp As IDisposable)(ByVal vMyParm As Integer)...
4
by: Jethro Guo | last post by:
C++ template use constraint by signature,It's very flexible to programmer but complex for complier, and at most time programmer can not get clear error message from complier if error occur. C#...
2
by: Greg Buchholz | last post by:
/* I've been experimenting with some generic/polytypic programs, and I've stumbled on to a problem that I can't quite figure out. In the program below, I'm trying to define a generic version of...
25
by: Lars | last post by:
Hi, I have a base class holding a generic list that needs to be accessed by both the base class and its subclasses. What is the best solution to this? I am fairly new to generics, but I am...
9
by: mps | last post by:
I want to define a class that has a generic parameter that is itself a generic class. For example, if I have a generic IQueue<Tinterface, and class A wants to make use of a generic class that...
2
by: Edward Diener | last post by:
Following the example in the help for the generic List class, which shows the Serializable attribute being used on the generic class, like so: generic<typename T> public ref class List :...
3
by: cowznofsky | last post by:
I'm getting data in a generic list class, which I'm not going to change. I would like to use it as a datasource for a datagrid or a gridview, but it doesn't implement IEnumerable. I'm...
4
by: Bill McCormick | last post by:
Hello, I have a list of struct's that have generic fields: public struct Item<T1, T2: IComparable<Item<T1, T2>{ private T1 _t1; private T2 _t2; public T1 t1 { get { return _t1; }
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.