Solved

C++ database

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

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…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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 goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

856 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