Solved

C++ database

Posted on 2000-04-20
3
359 Views
Last Modified: 2010-04-02
I need to be able to create a database in memory.  This database will be updated quite frequently(add, delete, update).  This database also needs to be queried.  The database must do all this as quickly as possible.  What is the best datastructure to use.  I have thought about using and MFC CMap.
0
Comment
Question by:joegood
  • 2
3 Comments
 

Expert Comment

by:Ik_Khan
ID: 2737255
I think that the Using of Double link list is a better option
0
 
LVL 3

Accepted Solution

by:
Try earned 300 total points
ID: 2737426
Go with STL!!  It has all sort of containers.  (Containers are components that stores data, each with their own set of algorithms and adaptors.)

Some containers are 'deque' (i.e. double-ended queue, meaning you can work at it in a bidirectional manner; from either end).  Some other containers are, list (as in linked list), map, multimap, set, multiset, stack and vector.  There are more, but like their generic name states, they are 'containers' because they hold a variety of data.

Algorithms are functions that work and manipulate the data stored in containers (e.g. sort, search, rearranging elements, assigning values to them, etc.).

Adaptors are interesting components!  They transform one thing into another (sort of like magic)!  They can take one container and provide a different interface to it, allowing one data structure to be turned into another, requiring the same capabilities, but whose interface require a different set of operations.  They connect onto an existing object on one side and make it appears differently on the other side.  They do not really change the object to which they are applied; they simply alter its appearance.  They are really interesting to work with!!

MFC is good, but compared to STL, it is slow (very slow) and clunky.  What's more, STL is part of the C++ language, while MFC is something additional you'd have to work with.  MFC is not part of C++, it is extra baggage you'd have to carry around.
0
 
LVL 3

Expert Comment

by:Try
ID: 2737428
I forgot to mention that STL will do ALL the things you stated you need.  It can add, modify, delete and can be queried.  In addition, it allows both random and sequential access, as well as forward or backward sequencing.  And it is FAST, ... VERY FAST!!!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now