473,396 Members | 1,998 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,396 software developers and data experts.

Class Pooling

Hi,

I've got an issue I cannot seem to find an appropriate solution for.
I've build a scanner and a parser for parsing some kind of custom
language.
Though, I can have a kind of expression like:

1 + 2.1 = 3

I am parsing expressions as terms of single statements inheriting from
a lex_unit class:

class lex_unit
{
enum lex_type_e { t_integer, t_double, t_plus, t_equal }

virtual int getIntValue() = 0;
virtual double getDoubleValue() = 0;

lex_unit* prev, next;
};

class lex_unit_int : public lex_unit
{
int getIntValue() { ...}
}

class lex_unit_double ..
... yadayada

In the above sample, my classes after parsing would look like this:
lex_unit_int (1), lex_unit(t_plus), lex_unit_double(2.1),
lex_unit(t_equal), lex_unit_int(3)

Sorry for the mass of pseudo code, I'd just like to make things
clear :)

Now, my concern is simply the overhead of classes, constructors and
destructors. This stuff gets called so often that it's a real
bottleneck (yes, I have checked it!). My usual approach is to
implement some pooling but in my case that'd only work with POD types,
not with classes inheriting each other.

So my question is basically, is there a better way to do it and/or can
I do some pooling or anything else?
Btw -- I need some kind of connected lex_units so that I can jump
through each one with prev/next and check them..

thanks!
Alex
Jan 19 '08 #1
1 1118
Hi,

On another thing -- is there anyway to do some POD Type Pooling when
the POD type is not really a POD but includes an std::string that can
change?
I'd guess no though there have to be possibilities..

Thanks & regards!
Alex
Jan 19 '08 #2

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

Similar topics

5
by: John | last post by:
Does COM.ibm.db2.jdbc.DB2DataSource, (which supports connection pooling) need to be run within a J2EE container environment before the connection pooling facility is actually available to a user? ...
3
by: Brad Navarro | last post by:
OK, I may be asking for the impossible, but I'll give it a shot: For a case like this: using System.Data.SqlClient; abstract class Base { private SqlConnection DBConnect; Base(string...
18
by: Rob Nicholson | last post by:
We're getting an occasional occurrence of the following error when two users try and open the same record in our ASP.NET app: "There is already an open DataReader associated with this Connection...
1
by: Lenny Shprekher | last post by:
Hi, I am getting issues that Oracle collecting opened sessions (connections) from my webservice using regular System.Data.OleDb.OleDbConnection object. I am guessing that this is connection...
4
by: Susan Baker | last post by:
PHP Newbie here - I apologize if any of my questions appear daft or obvious ... Does PHP (or maybe the web server - Apache in my case), support (database) connection pooling?. It seems terribly...
4
by: perspolis | last post by:
Hi all I use 'Pooling=true;' in my connection string; how can I disable 'pooling' in my application and close all connections??? thanks in advance
3
by: =?Utf-8?B?c3JpZGhhcg==?= | last post by:
would like to know is it recommended to use techniques like object pooling or the using static instances of the proxy class of a web serivice highly appreciate your opinions and recommendations...
3
by: fniles | last post by:
In the Windows application (using VB.NET 2005) I use connection pooling like the following: In the main form load I open a connection using a connection string that I stored in a global variable...
0
viswarajan
by: viswarajan | last post by:
Introduction This article is to go in deep in dome key features in the ADO.NET 2 which was shipped with VS 2005. In this article I will go trough one of the key features which is the Connection...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.