Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Help me find a good typedef name for the following type

Reply
Thread Tools

Help me find a good typedef name for the following type

 
 
Eric Lilja
Guest
Posts: n/a
 
      03-06-2005
Hello, got an odd question. I need a good typedef name for the type:
std::vector<std::vector<std:air<std::string, std::string> > >

Even with using-statements to get rid of std:: it's simply too long and
makes for keeping lines within a length of 80 columns cumbersome.

I am using an object of that type to store matching rows (with a varying
number of non-NULL columns) from an SQL database. The first string in the
pair holds the field name and the second the field value.

/ Eric


 
Reply With Quote
 
 
 
 
Martijn Mulder
Guest
Posts: n/a
 
      03-06-2005
Eric Lilja wrote:
> Hello, got an odd question. I need a good typedef name
> for the type:
> std::vector<std::vector<std:air<std::string,
> std::string> > >
>
> Even with using-statements to get rid of std:: it's
> simply too long and makes for keeping lines within a
> length of 80 columns cumbersome.
>
> I am using an object of that type to store matching rows
> (with a varying number of non-NULL columns) from an SQL
> database. The first string in the pair holds the field
> name and the second the field value.
>
> / Eric


How about vvpss


 
Reply With Quote
 
 
 
 
Mikhail Polatov
Guest
Posts: n/a
 
      03-06-2005
"Eric Lilja" <(E-Mail Removed)> writes:

> Hello, got an odd question. I need a good typedef name for the type:
> std::vector<std::vector<std:air<std::string, std::string> > >
>
> Even with using-statements to get rid of std:: it's simply too long and
> makes for keeping lines within a length of 80 columns cumbersome.
>
> I am using an object of that type to store matching rows (with a varying
> number of non-NULL columns) from an SQL database. The first string in the
> pair holds the field name and the second the field value.
>
> / Eric
>


typedef std:air<std::string, std::string> column_value_t;
typedef std::vector<column_value_t> record_t;
typedef std::vector<record_t> table_t;

--
Mikhail Polatov
MetaCommunications Engineering
 
Reply With Quote
 
Alf P. Steinbach
Guest
Posts: n/a
 
      03-06-2005
* Eric Lilja:
> Hello, got an odd question. I need a good typedef name for the type:
> std::vector<std::vector<std:air<std::string, std::string> > >
>
> Even with using-statements to get rid of std:: it's simply too long and
> makes for keeping lines within a length of 80 columns cumbersome.
>
> I am using an object of that type to store matching rows (with a varying
> number of non-NULL columns) from an SQL database. The first string in the
> pair holds the field name and the second the field value.


Possibly you'd be better off by representing the NULL columns explicitly,
and store the field names just once, in a separate vector.

However,

typedef std:air<std::string, std::string> NameValuePair;
typedef std::vector<NameValuePair> DbResultRow;
typedef std::vector<DbResultRow> DbResultTable;
typedef DbResultTable DbView;


--
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?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Web server reported the following error when attempting to create or open the Web project located at the following URL: 'http://localhost/822319ev1'. 'HTTP/1.1 500 Internal Server Error'. chanmm ASP .Net 2 09-07-2010 07:37 AM
CRTP-problem: How can the base class typedef a derived class' typedef? oor C++ 0 05-20-2008 12:39 PM
Compile error : Type name expected in typedef declaration on aCC HPUX11.0 wong_powah@yahoo.ca C++ 1 02-01-2008 07:17 PM
Print name of typedef:ed type Eric Lilja C++ 8 11-23-2007 08:36 AM
typedef type name; error with swig wrapper and VC++ 6 M. Faust Python 0 10-18-2004 05:40 PM



Advertisments