|
I just compiled the source code posted on the page in VS.NET 1.1,but found
error C2039: “Base” : is not member of “Base::__method_processLength__”
which refers to "METHOD(public, bool, processLength, (int l));"
who could help me? thanks in advance!
|
|
|
|
|
I'm getting the same errors... any clues anyone?
|
|
|
|
|
|
i just wanna use this in bcb.But there is something wronge with it.how can i?thanks!
|
|
|
|
|
Very interesting library. We are working on a reflection library for a few months (includes more than one rewrite ). We've given your library a try and added quite a few things. We'd like to contact you in order to talk with you about possible uses, modifications, addons etc if you're interested. We sent you e-mails to at least two different e-mail adresses but they probably didn't reach you.
How can we contact you?
Cheers!
|
|
|
|
|
Can instance of the class be Created dynamicly?
Like the the CreateObject() function of CRuntimeClass in MFC Or the Activator.CreateInstance Method in .NET
|
|
|
|
|
|
Nice job - I came up with a similar approach to your, check it out here: http://vcf.sourceforge.net[^].
VCF::Class[^] will give you taste of what it does.
Any success with other compilers? GCC, Borland, or DigitalMars?
Again, congrats on the nice work!
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
You did a nice job too. Generally, our thinking is on the same line, but we have differences in the implementation.
I've solved an issue with some macros and now my code works for GCC also. But I haven't finished yet, there are lots of features still pending.
Watch this space for further developements!
|
|
|
|
|
mmm, If you have ported it to gcc, why don't you post it... I spend the last few hours doing that and were just done.
|
|
|
|
|
If you plan on writing C++ that looks like this, you seriously need to discover C++/CLR, C#, and Java, and stick with them.
|
|
|
|
|
Ehm...why do you say that?
|
|
|
|
|
Unfortunately, there are lots of reasons for NOT using the CLR, be it with Managed C++ or C# (and also for not using Java) - but in those cases Reflection can still be very useful.
Some of the reasons why I haven't been able to use Managed C++ or C# (despite incentive to try) include:
1) Immature libraries. Because the languages haven't been around very long, the libraries have a huge number of weaknesses - the last time I tried to use C# I found that I couldn't create a directory browser from the file dialog since the file dialog didn't include that feature and it was a final class. In C++ I would simply inherit off CFileDialog.
2) The syntax is impenetrable. Managed C++ has improved slightly with the newer work Microsoft has done, but it is still nowhere near as clear as well written C++.
3) The syntax is non-standard. Except in the rare cases where the CLR exists for other platforms and compilers, you are stuck with VC++ and Windows.
4) The CLR is incredibly slow compared to raw C++. Because you are working through an intermediate language, and you have the overhead of garbage collection and smart pointers, for time critical applications Managed C++ just doesn't hold up. I write CAD applications for a living and Managed C++ just wouldn't cut it.
5) It is very difficult to use Managed and Unmanaged code side by side. Again, last time I checked, ALL your code had to be recompiled with the compiler switch for CLR included. That scares me because calls from unmanaged code into managed code are going to have loads on non-deterministic wrappers around them.
I'll get off my soapbox now - but suffice it to say that I haven't been impressed with the CLR - and it certainly doesn't remove the need to provide decent reflection libraries under certain circumstances in C++.
Good work on AGM::LibReflection.
Dave
|
|
|
|
|
Dave Handley wrote:
1) Immature libraries. Because the languages haven't been around very long, the libraries have a huge number of weaknesses - the last time I tried to use C# I found that I couldn't create a directory browser from the file dialog since the file dialog didn't include that feature and it was a final class. In C++ I would simply inherit off CFileDialog.
CFileDialog isn't really standard C++, it is a MFC class, and thus will only work in Microsoft Windows. But should't you use the Win32 function SHBrowseForFolder, and not derive from CFileDialog anyway?
Dave Handley wrote:
2) The syntax is impenetrable. Managed C++ has improved slightly with the newer work Microsoft has done, but it is still nowhere near as clear as well written C++.
True, Managed C++ wasn't very neat to use, and that is why C++/CLI[^] was developed. C++/CLI is as penetrable as standard C++, atleast when you are doing the same thing. I wouldn't state that standard C++ is clear, either.
Dave Handley wrote:
3) The syntax is non-standard. Except in the rare cases where the CLR exists for other platforms and compilers, you are stuck with VC++ and Windows.
The CLR, CLI, C# and C++/CLI are standards, but you're stuck in .NET, that is true. But .NET is ported to other systems than Windows. See DotGnu[^] and Mono[^].
Dave Handley wrote:
4) The CLR is incredibly slow compared to raw C++. Because you are working through an intermediate language, and you have the overhead of garbage collection and smart pointers, for time critical applications Managed C++ just doesn't hold up. I write CAD applications for a living and Managed C++ just wouldn't cut it.
You are not working through an intermediate language, the JIT-compiler will create machine code. In C++/CLI you don't have to use garbage collection, you can use deterministic destruction instead.
Vertigo Software ported Quake 2[^] to .NET with a performance decrease of only 15%. And that was done in 5 days: 4 days for porting from C to C++ and one day to port to Managed C++.
|
|
|
|
|
"CFileDialog isn't really standard C++, it is a MFC class, and thus will only work in Microsoft Windows. But should't you use the Win32 function SHBrowseForFolder, and not derive from CFileDialog anyway?"
Unfortunately, even using SHBrowseForFolder isn't trivial in the .Net Framework - see http://www.netomatix.com/FolderBrowser.aspx
"I wouldn't state that standard C++ is clear, either."
ANSI Standard C++ is very clear in my opinion - much more so than many other languages. Especially given the amount of explicit control you have over data management.
"The CLR, CLI, C# and C++/CLI are standards, but you're stuck in .NET, that is true. But .NET is ported to other systems than Windows. See DotGnu and Mono."
C++/CLI is a standard but it still is NOT ANSI Standard C++ which makes it much less portable. .Net may be ported to a few other platforms, but it still isn't properly cross-platform.
"You are not working through an intermediate language, the JIT-compiler will create machine code. In C++/CLI you don't have to use garbage collection, you can use deterministic destruction instead."
As far as I know the only way to do deterministic destruction is with the IDisposable interface, and even then the Garbage Collector does some of the work so it isn't strictly fully deterministic. Also any form of Just in Time Compiler directly implies the existence of intermediate code - of course the IL is converted to machine code before it is used, but it is still converted and that takes time.
"Vertigo Software ported Quake 2 to .NET with a performance decrease of only 15%. And that was done in 5 days: 4 days for porting from C to C++ and one day to port to Managed C++."
Unfortunately, something like Quake 2 isn't really a good example of a performance intensive application. From what I remember Quake 2 was written to run on a Pentium 133, and as with many games most of the really performance intensive stuff is done inside the OpenGL library down on the Graphics Card. That will still be the same in a managed port. When someone gets a ray-tracer working in managed code with similar performance to native C++ I'll be impressed, but I can't see it happening. Given that most of the really intensive stuff in Quake 2 is happening down on the graphics card, a 15% performance drop is huge.
Dave
|
|
|
|
|
"many games most of the really performance intensive stuff is done inside the OpenGL library down on the Graphics Card"
Actully,90% of PC Games is CPU limited.
Say hello to my little friend.
|
|
|
|
|
I agree that that may be true now - but don't forget we were talking about Quake 2 which runs on a P200 quite happily. That means that on a modern 2-3GHz processor it needs to use less than 10% of the processor power available.
Having said that, on my cutting edge PC, I find the graphics performance on PC games to be the first thing to roll-off. For example, I can't run Half-Life 2 or Doom 3 at maximum resolution (1600x1200) - but can run them alongside other tasks at lower resolutions!
Dave
|
|
|
|
|
Yes if we talk about today's games where ai and maybe physic simulation plays a big part. Quake2 is an opengl application and is Graphics limited. It seems really to me that you don't have any experience in C++/CLR programming.
|
|
|
|
|
And the quake series happens to be part of the other 10%, if you take a look at what happens with most of carmacks code when it is run on an SLI platform (2 graphics cards instead of one) performance increases by +80% on games like Doom 3, showing how little the processor matters in carmacks highly optimized games. Both carmacks skills as an optimizer and the fact that the type of games he makes can be fun with relatively little CPU computation are the root cause of this fact.
|
|
|
|
|
Do you have a link or a better description of what reflection is? I have no idea what it is, why I should use it and what it will cost in terms of performance and size.
John
|
|
|
|
|
Do you mean more documentation about reflection generally or about this specific implementation?
For reflection generally, I think google is your friend.
For this implementation, I have already written a few things about performance and size, but I could always write more. There is a link above with more detailed documentation.
|
|
|
|
|
More documentation about reflection generally is what I mean.
John
|
|
|
|
|
More documentation about reflection generally is what I mean.
See Java:
http://java.sun.com/docs/books/tutorial/reflect/
|
|
|
|
|
Reflection is generally the same as RTTI in the sense that it is information retrieved dynamically at runtime as opposed to compile time. Basically it allows the program to query a class instance dynamically at runtime for information about itself, such as it's class name (we already have this from typeid().name()) or it's super class, or even it's methods, fields and properties.
The most obvious usage is in development IDE's for UI form builders, as the form builder can be made quite generic, and you can manipulate the form and it's child controls all dynamically at runtime. RTTI/Reflection all help do this. Languages like Smalltalk, ObjectiveC, ObjectPascal (or at least Borland variant of it), and Java have all had this kind of support from the get go. C++ hasn't.
For toolkit's that want any sort of extensible, sophisticated UI, RTTI is a must. To my knowledge only the VCF[^] and Qt[^] really go the whole nine yards to provide support comparable to what you get in .Net, Java, or Delphi (ObjectPascal).
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
|