LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-02-2006, 09:31 AM   #31
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Original Poster
Rep: Reputation: Disabled

Quote:
Originally Posted by tuxdev
Deleting a node seems like it is removing a function in a C source file, or removing a case in a switch statement, or even the switch statement itself.
That's pretty much how it would be for that particular application. It's got a lot more uses than that, however, and a lot more possibilities for editing structure (not in current release, though.)
Quote:
Originally Posted by tuxdev
I'd argue that a class that can't be used with the STL is borderline useless, and is probably reinventing the wheel again (of course, there isn't anything wrong with reinventing the wheel if that's what you aiming for).
The main reason it can't be used with a container is that allocation MUST be per-element and not by something that can go out of scope (except for the base element.) The reason for this is that the pseudo-tree elements can be removed, replaced, deleted, etc. arbitrarily, meaning that what was once on one "tree" can be placed on an entirely different "tree" in a different scope.

Back to something that was mentioned about having one node simultaneously on 2 trees; the nodes are the structure, and NOT the data. If the data portions of two nodes want to share a pointer to a single data location then they can do that if the user so implements.

The reason I've gone for the "linked list" style over the "random access container" style is that I intend very linear processing (much like a source code parser.) Basically how the user uses the structure is by parsing, editing the structure as necessary (they can use a parallel structure based on their implementation to figure out where they should edit), then exporting the data in a different format. The lib exports data by polling elements from beginning to end. There isn't really a need for other than "forward" (and "down") access.
ta0kira
 
Old 09-06-2006, 12:49 AM   #32
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Original Poster
Rep: Reputation: Disabled
Here's the tutorial I wrote this weekend. It explains it a lot better than I can here.
http://www.geocities.com/ta0kira/hparser-tutorial.html

ta0kira
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bad file problem--can't delete (or anything else) David the H. Linux - General 2 05-12-2006 06:28 AM
remove bad sector form fat? nitin403 Mandriva 1 05-27-2005 03:20 AM
how do I copy a whoel folder form one directory to another form the command line? zwyrbla Linux - Newbie 8 08-24-2004 06:40 PM
delete content form a file bru Programming 1 04-30-2004 07:41 AM
Event driven object-to-object: C++ template class mecanism ( NOT STL or STDC++) bretzeltux Programming 2 12-23-2003 02:45 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration