public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Lawrence Crowl" <crowl@google.com>
To: "Bruno Moreira Guedes" <thbmatrix@gmail.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Dynamic Libraryes, C++ and Objective-C
Date: Sat, 05 Jan 2008 20:02:00 -0000	[thread overview]
Message-ID: <29bd08b70801041541u67808021i734790a9211eee7@mail.gmail.com> (raw)
In-Reply-To: <3fdd6ce00801011903x1b1b63egcd479de40c0c5e08@mail.gmail.com>

On 1/1/08, Bruno Moreira Guedes <thbmatrix@gmail.com> wrote:
> Hello People,
>
> I'm highly interested in developing a "very-pluggable API", to offer a
> "Java API-like"(just LIKE hehehe) for C++. So, I asked myself "how
> could I dynamic load classes?". During my research about how to
> construct that, I break into that step, and it's getting too hard to
> pass...
>
> After a little research, I heard about a 'ugly' method which consists
> of creating a virtual/pure-virtual and class using a helper function
> to make the new/delete operations.
>
> But I want to "split" the API into a base library, statically linked
> with the base libraries, and the "pluggable parts", where each part
> consists of a set of many classes. So, creating a virtual class for
> each class don't make sense...
>
> Researching anymor I heard about a Objective-C ability of creating and
> modifying classes during the runtime. But I don't know Objective-C
> very-well and I don't know how to 'mix' it with C++ code... As an
> alternative, if someone could help-me about using GCC to mix that, I'm
> grateful...
>
> But returning to the main problem, I want to use the headers which I
> have of the API parts, of course... And the I get the idea of letting
> the symbols to be resolved during the library loading stage, and not
> during the compile time...
> There's anyway to don't resolve the symbols during the compile-time???

Your best bet is probably to define a simple function that is a factory
for implementation classes derived from the interface's abstract base
classes.  Each plug-in would define the factory.

-- 
Lawrence Crowl

      reply	other threads:[~2008-01-04 23:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-02  3:03 Bruno Moreira Guedes
2008-01-05 20:02 ` Lawrence Crowl [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=29bd08b70801041541u67808021i734790a9211eee7@mail.gmail.com \
    --to=crowl@google.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=thbmatrix@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).