473,405 Members | 2,310 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,405 software developers and data experts.

Best way to gather metrics on STL string's

Greetings,

Anyone have a string class which will allow me to keep track of:
* average string length
* total memory allocated for strings
* # of strings of each given length?

Thanks,
Bill
Jul 22 '05 #1
1 1155
"William Deegan" <bd******@hotmail.com> wrote in message
news:HE*******************@newssvr25.news.prodigy. com...
Greetings,

Anyone have a string class which will allow me to keep track of:
* average string length
* total memory allocated for strings
* # of strings of each given length?


You can wrap a std::string in a custom type which
implements static members to do this.

static std::string::size_type avg_len;
static std::size_t tot_capacity;
static std::map<std::string::size_type, std::size_t> histo;

Then you'll need to keep all these in sync when implementing
constructors, destructor, and all the desired operators
(these could delegate to those of std::string)

-Mike
Jul 22 '05 #2

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

Similar topics

2
by: Edward Berard | last post by:
I am looking for tools that will analyze Java source code: -> I am primarily looking for metrics tools, e.g., tools that will tell me things like - Total lines of code - Total blank lines...
9
by: Markus Minichmayr | last post by:
Hello! Does anyone know a free tool to collect source code metrics like lines of code, no. of classes, etc.? Thanks Markus
7
by: Michael Deathya | last post by:
Hi, I am pulling over 400 different metrics from an Excel spreadsheet into Access (97). Conceptually, each row represents a single set of these 400 metrics. However, because of the 255 column...
4
by: Grant Ord | last post by:
You gather I'm new to C#... I'm used to declaring global variables and application constants in a common script file in ASP apps but now in I'm sure things are done differently. The sort of...
1
by: khammond | last post by:
I'm an Enterprise Architect at a large insurance company. My background is Java, and I have brought in the CodePro metrics & code audit tool that runs automated metrics and code audits within...
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
0
by: neelagain | last post by:
Hi, I have seen in COM+ that we can use ComSpy.dll to get the metrics of COM+ application using IComMethodEvents, IComTransactionEvents, IComInstanceEvents and so on.. Is there a way to get the...
2
by: Ing. Davide Piras | last post by:
Hi there, we are rewriting our .NET 1.1 web application with VS. 2005 and .NET 2.0, it takes big work but we believe there is a point to do that... at least we hope! we believe that: 1) the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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.