By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,227 Members | 1,376 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,227 IT Pros & Developers. It's quick & easy.

Data Storage, Interface and Design

P: n/a
(if this is the wrong place to ask this, please let me know where the right
place is)

I've been attempting to come up with a sane, and relatively simple design
for a set of objects that separate the storage, and interface/access to
that data. So far I've had no luck coming up with something I'm happy with.

The data being stored will typically be groups of double floating point
numbers, and integers, groups will tend to have 2 to 4 items per.

Access to the groups and to the individual items in each group is required,
and should be relatively "fast" (ah, love that premature optimization, but
I _know_ it will become a bottleneck at some point)

Also the amount of data being stored will vary depending on the number
of "objects" that access the interface, and the number of data points each
object has.

As an extension, each object will need several types of "data", each with
varying numbers of items and groups.

A simple example would be like a 3D object:

Object {
Vertex {
Point -> double[3]
Normal -> double[3]
Color -> uint8_t[4]
}[N]
}

* where N is the number of vertexes an object has.

Now why don't I just store them in a form like I just laid out? Because Its
SLOW, and can't take advantage of certain acceleration that 3d APIs
provide.

Basically I need to store each of the data types in a separate contiguous
chunk of memory (technically they could be concatenated and stored in the
same chunk, but that won't allow for decent times when appending to each
data type).

So far I haven't been able to come up with a simple, yet extendable/flexible
interface.

--
Thomas Fjellstrom
Jul 1 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
* Thomas Fjellstrom:
(if this is the wrong place to ask this, please let me know where the right
place is)


Don't know, because you're not concrete enough that I can infer what the
problem is, much less whether it has anything to do with C++.

However, since the answer to /any/ programming problem is indirection,
note that C++ has pointers and references.

If that doesn't make you happy, try the Mentos+Diet Coke experiment?

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 1 '06 #2

P: n/a
Alf P. Steinbach wrote:
* Thomas Fjellstrom:
(if this is the wrong place to ask this, please let me know where the
right place is)
Don't know, because you're not concrete enough that I can infer what the
problem is, much less whether it has anything to do with C++.


The problem is that I want to separate the data storage from the interface,
and provide several storage implementations as well as several interface
implementations, and mix them up a bit if needed.
However, since the answer to /any/ programming problem is indirection,
note that C++ has pointers and references.
Yup, I'm not _that_ simple ;)
If that doesn't make you happy, try the Mentos+Diet Coke experiment?


Don't have any mentos :(

--
Thomas Fjellstrom
Jul 1 '06 #3

P: n/a
how about use BerkeleyDB for your storage, fast access
sleepycat.com

Jul 1 '06 #4

P: n/a
happyvalley wrote:
how about use BerkeleyDB for your storage, fast access
sleepycat.com
that could be one option, or sqlite.. but the immediate types of storage
I'll be using is a vector like object with OpenGL VertexBufferObject
replication.

--
Thomas Fjellstrom
Jul 2 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.