• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Wrapping C functions in Objective C proxy objects: naming convention?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wrapping C functions in Objective C proxy objects: naming convention?


  • Subject: Re: Wrapping C functions in Objective C proxy objects: naming convention?
  • From: "Austin Ziegler" <email@hidden>
  • Date: Thu, 20 Nov 2008 13:55:54 -0500

On Thu, Nov 20, 2008 at 12:15 PM, Michael Ash <email@hidden> wrote:
> Please excuse a foolish question, but.... Why wrap this in Objective-C
> at all? Looks like the resulting ObjC code is essentially the same,
> except uglier, slower, and harder to use. Why not just keep the C and
> use it directly?

This isn't a foolish question. The function declaration that I've shown
you is something of a fiction; it's a definition in an input file to a
code generator (gSOAP). It doesn't actually exist in the resulting C
code. This definition:

>>  int ns__add(double a, double b, double *result);

will actually become:

  int soap_call_ns__add(struct soap *soap, const char *endpoint,
                        const char *action, double a, double b,
                        double result*);

gSOAP knows how to generate C and C++ and with C++ will generate a proxy
for this C function and the SOAP object, so that it looks more like:

  class calcProxy
  {
  public:
    int add(double a, double b, double *result)
    {
      return soap_call_ns__add(soap, endpoint, "", a, b, result);
    }

    struct soap *soap;
    char *endpoint;
  }

What I want to do is to create an ObjC proxy similar to the C++ proxy.

Yes, I know I could use ObjC++, but there are reasons I want to use ObjC
instead of ObjC++ including not having to deal with two different object
models in my ObjC programs.

Generating the proxy isn't going to be that hard; I'm just trying to
figure out what the best naming conventions for these generated methods
and classes will be.

-austin
--
Austin Ziegler * email@hidden * http://www.halostatue.ca/
               * email@hidden * http://www.halostatue.ca/feed/
               * email@hidden
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Wrapping C functions in Objective C proxy objects: naming convention? (From: "Austin Ziegler" <email@hidden>)
 >Re: Wrapping C functions in Objective C proxy objects: naming convention? (From: "Michael Ash" <email@hidden>)

  • Prev by Date: Crash in Attributed String (x64)
  • Next by Date: Re: Forcing toolbar validation...
  • Previous by thread: Re: Wrapping C functions in Objective C proxy objects: naming convention?
  • Next by thread: Re: Wrapping C functions in Objective C proxy objects: naming convention?
  • Index(es):
    • Date
    • Thread