473,397 Members | 1,969 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,397 software developers and data experts.

Constructing a Class Given a String

I was just about to make the proclamation that the standard C++'s rtti
can't quite do all the stuff that .NET reflection can do, but I
thought I would check. Perhaps my C++ knowledge is not quite up to
date!

Does the latest go around of C++ envision richer run time type
information similar to that offered by Delphi or .NET?

I know that rtti lets me get a typeinfo with the string name of the
class in it, but I can't see a way to get a class given a string name?
Am I still stuck in switch land and factory patterns for this?

Similarly, I would like to go back and forth between enumerations and
strings.

Also, does anyone know if GNU offers "language extensions" to do this
exact thing?

Thanks!
Jul 22 '05 #1
1 1460
Todd Bandrowsky wrote:
I was just about to make the proclamation that the standard C++'s rtti
can't quite do all the stuff that .NET reflection can do, but I
thought I would check. Perhaps my C++ knowledge is not quite up to
date!
I can say the same about my knowledge of .NET reflection.
Does the latest go around of C++ envision richer run time type
information similar to that offered by Delphi or .NET?
I've not heard of anythink like that, besides, I've not seen the need.
I know that rtti lets me get a typeinfo with the string name of the
class in it, but I can't see a way to get a class given a string name?
RTTI-returned string is (a) implementation-specific and (b) not guaranteed
to have any meaningful content. And, no, there is no mechanism in the
language to identify types by name during run-time. Generally, one can
say that there are no types during run-time.
Am I still stuck in switch land and factory patterns for this?
Yes, you probably are. If you really need that thing, that is.
Similarly, I would like to go back and forth between enumerations and
strings.
Similarly, there is no language mechanism to do that. You need to provide
one if you need it.
Also, does anyone know if GNU offers "language extensions" to do this
exact thing?


Ask in a GNU newsgroup.

Victor
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Benjamin Scott | last post by:
Hello. I attempted to build a compound dictionary: len(Lst)=1000 len(nuerLst)=250 len(nuestLst)=500 Dict={}
6
by: Baris | last post by:
Given the C# code below, can anyone think of a better class design? What really gets my goat is that the code within derived classes D1 and D2 is identical and in my mind should be refactored into...
10
by: Matthew | last post by:
I found an excellent tutorial on XML Serialization: http://addressof.com/blog/articles/ExploringXMLSerialization.aspx When he creates a class property, it looks like this: Public Class Drivers...
11
by: bgreen | last post by:
I am hoping for some assistance with formatting a large text file which consists of a series of individual records. Each record includes specific labels/field names (a sample of 1 record (one of...
6
by: Big George | last post by:
Hello, I develop in ASP.NET with VB.NET code. I need some help constructing a class: Worker. I'm designing the properties of this class. The class is filled reading tables in database. ...
26
by: drako | last post by:
Hi, I'm a bit stumped as I am getting a "Notice: Array to String Conversion" error when trying to do something that on the surface should be a very simple task - create an array, and write a set...
0
by: elainenguyen | last post by:
I am writting an address book which store name and address. I've written a Node class with Get and Set method of String key and String value I've also written a Main class for the menu to promt...
20
by: tshad | last post by:
Using VS 2003, I am trying to take a class that I created to create new variable types to handle nulls and track changes to standard variable types. This is for use with database variables. This...
4
by: rameshch45 | last post by:
In a javascript method, I have a form name. Given that form name, I want to be able to read all its paramter names and their values. and construct in the form of "name="+encodeURI("value")+"&" and...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.