* HI
@ 2001-11-17 14:31 prasad inchal
2001-11-19 0:14 ` C++ objects at runtime (was: HI) Rupert Wood
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: prasad inchal @ 2001-11-17 14:31 UTC (permalink / raw)
To: gcc-help
Hi ,
I wanted to know the binding concept of C++
language.
I have two issues regarding this,
1: I want to have C++ to create class objects
dynamically, at runtime.
2: I want to have an interpreter where in I can call
C++ member functions directly
with the respective obj and parameters.
Thanks ,
Prasad
__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: C++ objects at runtime (was: HI)
2001-11-17 14:31 HI prasad inchal
@ 2001-11-19 0:14 ` Rupert Wood
2001-11-19 0:25 ` Rupert Wood
2001-11-26 4:36 ` Rupert Wood
2001-11-19 16:45 ` HI Andrea 'Fyre Wyzard' Bocci
` (2 subsequent siblings)
3 siblings, 2 replies; 9+ messages in thread
From: Rupert Wood @ 2001-11-19 0:14 UTC (permalink / raw)
To: 'prasad inchal'; +Cc: gcc-help
prasad inchal wrote:
One general principle of C++ is to perform as many checks as possible at
compile-time - I don't think it qualifies as 'late-binding' (if you
could even apply that to a language - sounds more like linking to me).
> 1: I want to have C++ to create class objects dynamically, at
> runtime.
If you mean create new instances of object types that you defined at
compile time, then yes - use the 'new' operator.
If you mean define new object types at run time, then no. I'm not sure
why you'd want to do this anyway. You could, I suppose, hack together a
run-time derivative and overload the virtual functions in a new vtable
but I don't know why you'd want to do this and I don't believe that
there's any support for this in the compiler - what you'd end up with
would be a nasty hack.
> 2: I want to have an interpreter where in I can call C++ member
> functions directly with the respective obj and parameters.
No, not easily possible. Again, you need intimiate knowledge of the C++
ABI and mangling scheme; you'd need symbol information persisted beyond
the link stage and you'd need assembler chunks to construct the right
call state and make the call.
Hope that helps,
Rup.
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: C++ objects at runtime (was: HI)
2001-11-19 0:14 ` C++ objects at runtime (was: HI) Rupert Wood
@ 2001-11-19 0:25 ` Rupert Wood
2001-11-26 4:36 ` Rupert Wood
1 sibling, 0 replies; 9+ messages in thread
From: Rupert Wood @ 2001-11-19 0:25 UTC (permalink / raw)
To: 'prasad inchal'; +Cc: gcc-help
prasad inchal wrote:
One general principle of C++ is to perform as many checks as possible at
compile-time - I don't think it qualifies as 'late-binding' (if you
could even apply that to a language - sounds more like linking to me).
> 1: I want to have C++ to create class objects dynamically, at
> runtime.
If you mean create new instances of object types that you defined at
compile time, then yes - use the 'new' operator.
If you mean define new object types at run time, then no. I'm not sure
why you'd want to do this anyway. You could, I suppose, hack together a
run-time derivative and overload the virtual functions in a new vtable
but I don't know why you'd want to do this and I don't believe that
there's any support for this in the compiler - what you'd end up with
would be a nasty hack.
> 2: I want to have an interpreter where in I can call C++ member
> functions directly with the respective obj and parameters.
No, not easily possible. Again, you need intimiate knowledge of the C++
ABI and mangling scheme; you'd need symbol information persisted beyond
the link stage and you'd need assembler chunks to construct the right
call state and make the call.
Hope that helps,
Rup.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: HI
2001-11-17 14:31 HI prasad inchal
2001-11-19 0:14 ` C++ objects at runtime (was: HI) Rupert Wood
@ 2001-11-19 16:45 ` Andrea 'Fyre Wyzard' Bocci
2001-11-26 14:03 ` HI Andrea 'Fyre Wyzard' Bocci
2001-11-19 16:56 ` HI Frank Schafer
2001-11-25 23:42 ` HI prasad inchal
3 siblings, 1 reply; 9+ messages in thread
From: Andrea 'Fyre Wyzard' Bocci @ 2001-11-19 16:45 UTC (permalink / raw)
To: prasad inchal, gcc-help
At 23.42 25/11/01 (GMT -0800), prasad inchal wrote:
>Hi ,
>
> I wanted to know the binding concept of C++
>language.
>
> I have two issues regarding this,
>
> 1: I want to have C++ to create class objects
>dynamically, at runtime.
> 2: I want to have an interpreter where in I can call
>C++ member functions directly
> with the respective obj and parameters.
> Thanks ,
> Prasad
I don't think this is a GCC related question...
Anyway:
What is that you EXACTLY want to do ?
1)
Dynamically reate new CLASSES or just OBJECTS of a specifc class ?
I don't think yuo can't do the former in c++, while for the second just
define a class with
class my_class {
...
class definition
...
};
and create objects with
my_class* my_object = new my_class(class parameters);
For more C++ programming info, have a look at
<http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html>.
2)
That is, you need a c++ interpreter, not a compiler.
Have a look at <http://root.cern.ch/root/Cint.html>
HTH
fwyzard
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: HI
2001-11-17 14:31 HI prasad inchal
2001-11-19 0:14 ` C++ objects at runtime (was: HI) Rupert Wood
2001-11-19 16:45 ` HI Andrea 'Fyre Wyzard' Bocci
@ 2001-11-19 16:56 ` Frank Schafer
2001-11-26 21:10 ` HI Frank Schafer
2001-11-25 23:42 ` HI prasad inchal
3 siblings, 1 reply; 9+ messages in thread
From: Frank Schafer @ 2001-11-19 16:56 UTC (permalink / raw)
To: prasad inchal; +Cc: gcc-help
[-- Attachment #1: Type: text/plain, Size: 662 bytes --]
prasad inchal wrote:
> Hi ,
>
> I wanted to know the binding concept of C++
> language.
>
> I have two issues regarding this,
>
> 1: I want to have C++ to create class objects
> dynamically, at runtime.
> 2: I want to have an interpreter where in I can call
> C++ member functions directly
> with the respective obj and parameters.
> Thanks ,
> Prasad
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
> http://geocities.yahoo.com/ps/info1
Hi,
1: Every object IS generated dynamically.
2. See the PERL or Puthon bindings for C++.
Hope this helps
Frank
[-- Attachment #2: Card for Frank Schafer --]
[-- Type: text/x-vcard, Size: 218 bytes --]
begin:vcard
n:Schafer;Frank
x-mozilla-html:FALSE
org:SETUZA a.s.;IT
adr:;;;;;;
version:2.1
email;internet:frank.schafer@setuza.cz
title:Dipl. Ing.
note:System administrator
x-mozilla-cpt:;0
fn:Frank Schafer
end:vcard
^ permalink raw reply [flat|nested] 9+ messages in thread
* HI
2001-11-17 14:31 HI prasad inchal
` (2 preceding siblings ...)
2001-11-19 16:56 ` HI Frank Schafer
@ 2001-11-25 23:42 ` prasad inchal
3 siblings, 0 replies; 9+ messages in thread
From: prasad inchal @ 2001-11-25 23:42 UTC (permalink / raw)
To: gcc-help
Hi ,
I wanted to know the binding concept of C++
language.
I have two issues regarding this,
1: I want to have C++ to create class objects
dynamically, at runtime.
2: I want to have an interpreter where in I can call
C++ member functions directly
with the respective obj and parameters.
Thanks ,
Prasad
__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: C++ objects at runtime (was: HI)
2001-11-19 0:14 ` C++ objects at runtime (was: HI) Rupert Wood
2001-11-19 0:25 ` Rupert Wood
@ 2001-11-26 4:36 ` Rupert Wood
1 sibling, 0 replies; 9+ messages in thread
From: Rupert Wood @ 2001-11-26 4:36 UTC (permalink / raw)
To: 'prasad inchal'; +Cc: gcc-help
prasad inchal wrote:
One general principle of C++ is to perform as many checks as possible at
compile-time - I don't think it qualifies as 'late-binding' (if you
could even apply that to a language - sounds more like linking to me).
> 1: I want to have C++ to create class objects dynamically, at
> runtime.
If you mean create new instances of object types that you defined at
compile time, then yes - use the 'new' operator.
If you mean define new object types at run time, then no. I'm not sure
why you'd want to do this anyway. You could, I suppose, hack together a
run-time derivative and overload the virtual functions in a new vtable
but I don't know why you'd want to do this and I don't believe that
there's any support for this in the compiler - what you'd end up with
would be a nasty hack.
> 2: I want to have an interpreter where in I can call C++ member
> functions directly with the respective obj and parameters.
No, not easily possible. Again, you need intimiate knowledge of the C++
ABI and mangling scheme; you'd need symbol information persisted beyond
the link stage and you'd need assembler chunks to construct the right
call state and make the call.
Hope that helps,
Rup.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: HI
2001-11-19 16:45 ` HI Andrea 'Fyre Wyzard' Bocci
@ 2001-11-26 14:03 ` Andrea 'Fyre Wyzard' Bocci
0 siblings, 0 replies; 9+ messages in thread
From: Andrea 'Fyre Wyzard' Bocci @ 2001-11-26 14:03 UTC (permalink / raw)
To: prasad inchal, gcc-help
At 23.42 25/11/01 (GMT -0800), prasad inchal wrote:
>Hi ,
>
> I wanted to know the binding concept of C++
>language.
>
> I have two issues regarding this,
>
> 1: I want to have C++ to create class objects
>dynamically, at runtime.
> 2: I want to have an interpreter where in I can call
>C++ member functions directly
> with the respective obj and parameters.
> Thanks ,
> Prasad
I don't think this is a GCC related question...
Anyway:
What is that you EXACTLY want to do ?
1)
Dynamically reate new CLASSES or just OBJECTS of a specifc class ?
I don't think yuo can't do the former in c++, while for the second just
define a class with
class my_class {
...
class definition
...
};
and create objects with
my_class* my_object = new my_class(class parameters);
For more C++ programming info, have a look at
< http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html >.
2)
That is, you need a c++ interpreter, not a compiler.
Have a look at < http://root.cern.ch/root/Cint.html >
HTH
fwyzard
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: HI
2001-11-19 16:56 ` HI Frank Schafer
@ 2001-11-26 21:10 ` Frank Schafer
0 siblings, 0 replies; 9+ messages in thread
From: Frank Schafer @ 2001-11-26 21:10 UTC (permalink / raw)
To: prasad inchal; +Cc: gcc-help
prasad inchal wrote:
> Hi ,
>
> I wanted to know the binding concept of C++
> language.
>
> I have two issues regarding this,
>
> 1: I want to have C++ to create class objects
> dynamically, at runtime.
> 2: I want to have an interpreter where in I can call
> C++ member functions directly
> with the respective obj and parameters.
> Thanks ,
> Prasad
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
> http://geocities.yahoo.com/ps/info1
Hi,
1: Every object IS generated dynamically.
2. See the PERL or Puthon bindings for C++.
Hope this helps
Frank
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2001-11-27 5:10 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-17 14:31 HI prasad inchal
2001-11-19 0:14 ` C++ objects at runtime (was: HI) Rupert Wood
2001-11-19 0:25 ` Rupert Wood
2001-11-26 4:36 ` Rupert Wood
2001-11-19 16:45 ` HI Andrea 'Fyre Wyzard' Bocci
2001-11-26 14:03 ` HI Andrea 'Fyre Wyzard' Bocci
2001-11-19 16:56 ` HI Frank Schafer
2001-11-26 21:10 ` HI Frank Schafer
2001-11-25 23:42 ` HI prasad inchal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).