Announcement

Collapse

Forum Guidelines

This forum is for finished source code that is working properly. If you have questions about this or any other source code, please post it in one of the Discussion Forums, not here.
See more
See less

OLib SLL: Object-based Standard Data Structures Library

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • PBWin/PBCC OLib SLL: Object-based Standard Data Structures Library

    public domain - use at own risk
    Downlaod SLL Library and/or Source

    Comments

    Update: added utility to support storing objects as handles - in "Object" folder

    Note: OLib array containers are zero-based index (HLib was one-based)

    Most containers support most PB data types, including Objects and UDTs.
    Trees and Hashes support a limited number of types; only what's practical.

    Array Containers:
    - zero-based index
    - ReDim automatic for all opperations; Add, Insert, Remove ... automatic
    - extremely fast non-recursive Sort, Reverse
    - supports Binary Search
    - stack and queue and deque functions
    - store/restore to/from String or File

    List Containers: Doubly Linked List
    - more efficient at Add, Insert, Remove than arrays
    - handle millions if items - really large arrays are out ot the question if you need to do a lot of inserts and removes
    - stack and queue and deque functions - a List is way better container for stack, queue and deque
    - store/restore to/from String or File

    Stack Containers:
    - deadly fast - uses buffering to cut down on memory allocations
    - an array is a poor stack for more than a few thousand items
    - the List container has excellent stack support
    - the dedicated stack container is fastest because of buffering
    - the stack container doesn't support Clone and Store/Restore

    Queue Containers:
    - deadly fast - uses buffering to cut down on memory allocations
    - an array is a really poor queue because you're removing the first value in the array every Pop
    - the List container has excellent queue support
    - the dedicated queue container is fastest because of buffering
    - the queue container doesn't support Clone and Store/Restore

    Tree Containers: AVL Balanced Binary Trees
    - one-to-one Key/Value relationship
    - Key must be unique
    - Value stored/retrieved/removed using lookup Key
    - Tree is always in Key order
    - traverse Tree in Key order
    - Long Key Trees are extremely fast, about as fast as a Long Hash
    - String and WString Trees are slower than a Hash Table
    - String and WString Trees may be set to compare case ignored, UCase
    - store/restore to/from String or File

    Hash Table Containers:
    - one-to-one Key/Value relationship
    - Key must be unique
    - nulls not allowed in a String Key - OK in String Value
    - Value stored/retrieved/removed using lookup Key
    - Hash Table is in unpredictable order
    - store/restore to/from String or File
    Last edited by Stanley Durham; 18 Apr 2013, 07:12 AM.
    stanthemanstan~gmail
    Dead Theory Walking
    Range Trie Tree
    HLib ~ Free Data Container Lib ~ Arrays, Lists, Stacks, Queues, Deques, Trees, Hashes

  • #2
    bump for update - added utility to supporting storing objects as handles
    stanthemanstan~gmail
    Dead Theory Walking
    Range Trie Tree
    HLib ~ Free Data Container Lib ~ Arrays, Lists, Stacks, Queues, Deques, Trees, Hashes

    Comment


    • #3
      Thanks Stan, again a great contribution!
      --Theo Gottwald
      ------------------------------------------------
      76706 Dettenheim * Germany * info@it-berater.org
      ------------------------------------------------
      Joses Forum * Theo's Link Site * IT-Berater.org

      Comment


      • #4
        I overlooked your object/handle update. Thanks Stanley!

        Comment


        • #5
          Where can I download OLib? The link does not work.

          Comment


          • #6
            I do not believe you can.

            The download link in post 1 goes to www.deadtheorywalking.com not PB storage. It seems that the domain name has a new owner because the subject matter is different,
            Dale

            Comment


            • #7
              From the Internet Archive the closest you can get is this: http://web.archive.org/web/201611132...code/olib.html

              It just doesn't contain the ZIP files though, sorry

              And the subject matter IS the same. The website owner always had that opinion piece there in addition to PowerBASIC code.
              <b>George W. Bleck</b>
              <img src='http://www.blecktech.com/myemail.gif'>

              Comment


              • #8
                And the subject matter IS the same.
                Wow!

                Anyway, there were no useful (to PB code) links on that site's home page that I could find. Too bad the zip file weren't put here as well (or instead of).
                Dale

                Comment


                • #9

                  These are the object class downloads (including full source):

                  olib_source101.zip
                  olib101.zip

                  Stanley Durham also wrote a non-classed version called hLib. It worked well and had additional support for 'trie' containers.

                  Comment


                  • #10
                    I wish I was a smart enough programmer to figure out what this code does.
                    Real programmers use a magnetized needle and a steady hand

                    Comment


                    • #11
                      Originally posted by Bud Durland View Post
                      I wish I was a smart enough programmer to figure out what this code does.
                      Hash tables, linked lists, bTrees, and other data structures with all needed associated functions.
                      Each data structure can be handled with a single pointer so it can be easily stored anywhere.
                      Very useful to quickly store/retrieve in memory big amount of data at run time.
                      thinBasic programming language
                      Win10 64bit - 8GB Ram - i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

                      Comment


                      • #12
                        Thanks for the links, Ross.
                        Rod
                        "To every unsung hero in the universe
                        To those who roam the skies and those who roam the earth
                        To all good men of reason may they never thirst " - from "Heaven Help the Devil" by G. Lightfoot

                        Comment


                        • #14
                          These Datatypes should be hardcoded into PB.
                          --Theo Gottwald
                          ------------------------------------------------
                          76706 Dettenheim * Germany * info@it-berater.org
                          ------------------------------------------------
                          Joses Forum * Theo's Link Site * IT-Berater.org

                          Comment


                          • #15
                            Originally posted by Theo Gottwald View Post
                            These Datatypes should be hardcoded into PB.
                            Well said!
                            thinBasic programming language
                            Win10 64bit - 8GB Ram - i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

                            Comment

                            Working...
                            X