Editing
Classdesc: Bringing Reflection to C++
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
Title: Classdesc: Bringing Reflection to C++ Abstract: Classdesc is a system that brings reflection to C++, a programming language that does not inherently support it. Reflection allows for easy serialization, binding of scripting languages or GUI objects to 'worker' objects, and remote method invocation. It also enables machine-independent serialization. However, C++ does not provide this capability as type information is thrown away at compile time. Classdesc generates object descriptors, which are function declarations that know about the structure of the objects inside. This is done by parsing the class, struct, and union definitions in the program. The generated function declarations recursively descend the compound structure of the class type until they reach primitive data types. This allows for easy and efficient serialization and deserialization of objects. The Classdesc system has been implemented in the EcoLab simulation system and has been used successfully in machine-independent checkpoint files and client-server mode simulations. It has also been used to generate TCL_obj class descriptors, which are used to bind scripting languages or GUI objects to 'worker' objects. Main Research Question: The main research question addressed in this paper is how to bring reflection capabilities to C++, a programming language that does not inherently support it. Methodology: The Classdesc system uses a separate program that parses the input program and emits function declarations that know about the structure of the objects inside. This is done by handling class, struct, and union definitions, as well as anonymous structs used in typedefs. The generated function declarations recursively descend the compound structure of the class type until they reach primitive data types. Results: The Classdesc system has been successfully implemented and used in the EcoLab simulation system. It has been used for machine-independent serialization and deserialization of objects and has also been used to generate TCL_obj class descriptors. Implications: The Classdesc system brings many benefits to C++, including easy serialization, binding of scripting languages or GUI objects to 'worker' objects, and remote method invocation. It also enables machine-independent serialization, which is particularly useful in simulations and distributed systems. Limitations: While the Classdesc system brings reflection capabilities to C++, it does so by using a separate program that parses the input program and emits function declarations. This adds an extra layer of complexity and potential performance overhead. Additionally, the system is specifically designed for C++ and may not be easily adaptable to other programming languages. Conclusion: The Classdesc system successfully brings reflection capabilities to C++, enabling easy serialization, binding of scripting languages or GUI objects to 'worker' objects, and remote method invocation. It also enables machine-independent serialization, making it particularly useful in simulations and distributed systems. However, the system adds an extra layer of complexity and potential performance overhead, and it is specifically designed for C++, which may limit its adaptability to other programming languages. Link to Article: https://arxiv.org/abs/0401024v1 Authors: arXiv ID: 0401024v1 [[Category:Computer Science]] [[Category:Objects]] [[Category:System]] [[Category:It]] [[Category:Classdesc]] [[Category:C]]
Summary:
Please note that all contributions to Simple Sci Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Simple Sci Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information