Solved

C++ database

Posted on 2000-04-20
3
369 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

914 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

15 Experts available now in Live!

Get 1:1 Help Now