473,387 Members | 3,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

embeddable early-binded database

hi all,
I was wondering whenever it is possible to write an embeddable
early-binding database in c++ (mainly for performance reasons).
the point is that often the programmer knows at compile time the
structure of the tables he uses, so why not trying to take advantage of
this to gain something in speed (and maybe size) (e.g. by allowing the
compiler to inline the right comparison operator)?
conceptually it isn't very different from one of the STL containers like
map, except that instead of a single key-value pair, it can hold
multiple pairs (in the example below i called them indexes) and even
just values (fields).

for example:

// myLog is the user-defined struct
struct myLogStruct {
table::index <time_t> Timestamp;
table::index <unsigned> Resource;
table::field <unsigned> IP;
};

typedef table<myLogStruct> myLogTable;

[...]

// suppose we need to insert a new row
myLogTableInstance.Insert( myTimestamp, myResource, myIP );

// or, similarly,
myLogStructInstance.Timestamp = myTimestamp;
myLogStructInstance.Resource = myResource;
myLogStructInstance.IP = myIP;
myLogTableInstance.Insert( myLogStructInstance );

// then we may need to select all rows with Timestamp greater than some
// value
myLogTableInstance2 = myLogTableInstance.Select(myLogStruct::Timestamp)
myTimestamp;


// finally, we may need to walk the table
for (myLogTableIterator = myLogTableInstance2.First();
myLogTableIterator != myLogTableInstance2.Last(); myLogTableIterator++)
doSomething();
has anyone ever seen something like this? do you think is it technically
possible (and/or worth)?

bye, CAFxX.

Mar 18 '06 #1
1 1634
CAFxX ha scritto:
// then we may need to select all rows with Timestamp greater than some
// value
myLogTableInstance2 = myLogTableInstance.Select(myLogStruct::Timestamp)
> myTimestamp;


sorry, the line above should be

myLogTableInstance2 = myLogTableInstance.Timestamp > myTimestamp;
Mar 18 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Guido van Rossum | last post by:
Info ---- This is a reminder that the deadline for early bird registration for PyCon DC 2004 is February 1, 2004. Early bird registration is $175; after that, it will be $250 through March 17,...
4
by: Olaf Meding | last post by:
Is there a way to find out if I am using early or late binding given the reference ("excel" in the example below) returned by Dispatch()? >>> import win32com.client >>> excel =...
0
by: C Williams | last post by:
I have a question about something I looked into a little while ago, then abandoned, and now would like to come back to. I would like to create an object that can be embedded in Word, Excel...
4
by: Richard | last post by:
Office Addins are easy in .NET. Try this from Visual Studio's main menu: File New Project "Other Projects" Extensibility Projects Shared Addin Run the wizard and you're off...
2
by: Mystery Man | last post by:
We are developing a C# application that has many interfaces to the Microsoft suite (eg Word, Excel, Outlook, Powerpoint, etc). We need to support Office 97, 2000, 2002 and any future versions. ...
19
by: Heidi Hundåla | last post by:
Hi ! I have a Wep App in C#. Page_Unload fires after Page_Load, and it seems totally unreasonable when you want to use this event when you _leave_ the page. In my project we wanted to use...
0
by: Brian Quinlan | last post by:
What's New? =========== The deadline for early-bird registration for the Vancouver Python Workshop is this Friday, June 30th. Early-bird registration is significantly discounted over normal...
2
by: Limin Fu | last post by:
Hi, I am looking for an open source, embeddable C compiler that supports compiling and running C codes in memory. I know TCC is one such compiler, but I'd like to know if there is any other C...
3
ADezii
by: ADezii | last post by:
The process of verifying that an Object exists and that a specified Property or Method is valid is called Binding. There are two times when this verification process can take place: during compile...
0
by: djminus1 | last post by:
I have a need for an embeddable flash box for a website that I am developing. The client is having a coffee cup design contest. They would like to have a flash box that does the following. 1) ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.