Re: Listing objects



Following on from Lüpher Cypher's message. . .
Hi,

Suppose we have a hierarchical class structure that looks something like
this:
Sorry, I lost the plot half way through.

Your objects can be
1 - nesting : object has a 'what are my children' and 'who is my parent' functionality.


2 - pointing : eg object has a 'these are my siblings' or 'previous/next' functionality

3 - dictionary entries : object in some container is discoverable by name

Variations and combinations of course apply. BUT every object exists in some context. I /think/ you might be trying to get A's to point-to/own B's where more than one A could be the parent of a B. Eg
"Sally is daughter of Jean"
"Geoffrey is son of Teddy"
"Sally is daughter of Teddy" // Only one Sally! J+T are married.


In this case[1] create an array of children and point to elements in that array from your parent objects.

eg $child['Sally'] = new ChildObj(.....);
then $Jean->AddChild('Sally') // just a key name or index
or $Jean->AddChild($child['Sally']) // inside the routine do $myKids[] = & $NewChild
where $NewChild is the function argument.


[1] If in this example children can be parents then you should be looking at a single universal 'person' class with the necessary links.






-- PETER FOX Not the same since the adhesive company came unstuck peterfox@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2 Tees Close, Witham, Essex. Gravity beer in Essex <http://www.eminent.demon.co.uk> .



Relevant Pages

  • Re: Subclass a CRichEditCtrl, having trouble overriding OnNotify()
    ... The ON_NOTIFY_REFLECT_EX is useful if you want to extend the functionality transparently ... But I don't want to preclude the parent seeing this, ... or want total control. ... If you want to be transparent, or conditionally transparent, use ...
    (microsoft.public.vc.mfc)
  • Re: Cut, Copy and Paste?
    ... functionality no longer works. ... The Paste operation is something you want to make universal to all forms and ... Determining the active form and object can be done from the parent using ... The Clipboard.GetText will retrieve the contents of the Clipboard. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Owner vs Parent vs ParentForm
    ... owner provides functionality that ties forms togther when minimizing and maximizing. ... But you can reference Parent and ParentForm from a form class. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Submission of modal dialogs
    ... "Dale" wrote in message ... > pass variables from the parent to the dialog, ... wasn't a more efficient ".NET" way of achieving the same functionality... ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Listing objects
    ... Suppose we have a hierarchical class structure that looks something like ... parent' functionality. ... I also do have children array ... One of the things I am trying to do is to have global references to all ...
    (comp.lang.php)