Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
struct pointers
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Elizabeth Kellner  
View profile  
 More options Aug 20, 1:28 pm
From: Elizabeth Kellner <ekell...@gmail.com>
Date: Thu, 20 Aug 2009 19:28:20 +0200
Local: Thurs, Aug 20 2009 1:28 pm
Subject: struct pointers

Is there a way to use a pointer to a struct (NuPointer perhaps?) and, if you
know the size of the fields, extract them?
in other words
typedef struct {
  int a;
  double b;

} MyStruct;

to get the value b out of a (MyStruct*)?

I could create a objc class to wrap the struct, but I am resistant to this;
I think it's less clear to have a class and non-class version of the same
data structure.  The original struct is in mapped memory and I would like to
keep it as simple as possible.

Thanks for your input
Elizabeth


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Burks  
View profile  
 More options Aug 21, 12:08 am
From: Tim Burks <timbu...@gmail.com>
Date: Thu, 20 Aug 2009 21:08:57 -0700
Local: Fri, Aug 21 2009 12:08 am
Subject: Re: struct pointers

I haven't built it, but I'd like to solve this problem with a general-
purpose pointer wrapper that uses Objective-C type signatures to  
access and modify elements of structures.

I would imagine that it would take a signature in its constructor and  
use something like key paths to identify elements.

That might be too big a project to write in your current situation,  
but if you start with an ObjC class that wraps your struct, that class  
could probably be evolved into a more general tool over time.

Tim

On Aug 20, 2009, at 10:28 AM, Elizabeth Kellner wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google