Solved

C++ database

Posted on 2000-04-20
3
395 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Move constructor only called if marked noexcept? 6 121
How to gracefully close the c++ 11 thread? 3 155
How do i run a c++ file? 15 57
Indy 10 not Receiving UDP broadcast 3 54
When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

739 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