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

what does this mean: virtual result

Hi, Buddy,

a newbie's question for you guys,

In C++, some functions have a return value type "result", what does
this mean, I searched on web, but no hint.
thanks a lot

David

***************************************
class MyClass
{
//database's own file descriptor
int db_fd;
//database header
DbHeader *db_hdr;
//memory pointer to the current opened Data Set
St_Layer *cdlayer;
//mmeory pointer to the data file of current Data Set
St_DataFile *cdfile;

public:
char *db_name;

public:

St_Db(const char *dname, Result& res, bool is_new = 0);
virtual ~St_Db();

//===
//=== Data layer related operations
//===

int getNLayers (void);
virtual Result openLayer (const char *name, St_Layer*& layer);
virtual Result closeLayer (LID lid);
virtual Result closeLayer (const char *name);
virtual St_DataFile* getDFile(const OID& oid);
virtual St_HeapFile* getHeap (LID lid);
virtual St_Layer* getLayer(LID lid);
.........
}
Jul 22 '05 #1
4 2145

"David" <go**********@yahoo.com> wrote in message
news:4f**************************@posting.google.c om...
Hi, Buddy,

a newbie's question for you guys,

In C++, some functions have a return value type "result", what does
this mean, I searched on web, but no hint.
thanks a lot

David

***************************************
class MyClass
{
//database's own file descriptor
int db_fd;
//database header
DbHeader *db_hdr;
//memory pointer to the current opened Data Set
St_Layer *cdlayer;
//mmeory pointer to the data file of current Data Set
St_DataFile *cdfile;

public:
char *db_name;

public:

St_Db(const char *dname, Result& res, bool is_new = 0);
virtual ~St_Db();

//===
//=== Data layer related operations
//===

int getNLayers (void);
virtual Result openLayer (const char *name, St_Layer*& layer);
virtual Result closeLayer (LID lid);
virtual Result closeLayer (const char *name);
virtual St_DataFile* getDFile(const OID& oid);
virtual St_HeapFile* getHeap (LID lid);
virtual St_Layer* getLayer(LID lid);
........
}


virtual methods are used for dynamic binding or polymorphism, have a look at
google or you favourite C++ book for more information. As for the "Result"
part, as far as I can tell, this must be a typedef or define somewhere else
in the code.
Allan
Jul 22 '05 #2
David posted:
Hi, Buddy,

a newbie's question for you guys,

In C++, some functions have a return value type "result", what does
this mean, I searched on web, but no hint.
thanks a lot

That's not all of your code. At the beginning of that file you must have
something like:
#include <someheader.hpp>
And inside that header file there must be something like:
class Result ...

or

enum Result ...

or

union Result ...

or

struct Result ...

or

typedef ... Result
Or maybe even:

#define Result

For a list of the keywords in C++, go to msdn.microsoft.com and search for
"C++ keywords union enum struct static_cast return if for virtual". There,
you'll see that Result isn't a keyword!
-JKop

Jul 22 '05 #3
David wrote:
Hi, Buddy,

a newbie's question for you guys,

In C++, some functions have a return value type "result", what does
this mean, I searched on web, but no hint.
It seems that somewhere outside the code fragment that you posted,
the 'Result' is defined as a type. It could be done using a typedef
or a #define or 'class' or 'struct'. Search in other modules that
complete the codebase you have. It can be a header file that came
with the library you're using.

thanks a lot

David

***************************************
class MyClass
{
//database's own file descriptor
int db_fd;
//database header
DbHeader *db_hdr;
//memory pointer to the current opened Data Set
St_Layer *cdlayer;
//mmeory pointer to the data file of current Data Set
St_DataFile *cdfile;

public:
char *db_name;

public:

St_Db(const char *dname, Result& res, bool is_new = 0);
virtual ~St_Db();

//===
//=== Data layer related operations
//===

int getNLayers (void);
virtual Result openLayer (const char *name, St_Layer*& layer);
virtual Result closeLayer (LID lid);
virtual Result closeLayer (const char *name);
virtual St_DataFile* getDFile(const OID& oid);
virtual St_HeapFile* getHeap (LID lid);
virtual St_Layer* getLayer(LID lid);
........
}


Victor
Jul 22 '05 #4
go**********@yahoo.com (David) wrote in message news:<4f**************************@posting.google. com>...
Hi, Buddy,

a newbie's question for you guys,

In C++, some functions have a return value type "result", what does
this mean, I searched on web, but no hint.
It just means what is obvious: that the name of the return type is
"result". Nothing special about the name "result". Compilers don't
understand English, so it makes no difference whether you use a
meaningful name like "result" or a name like "foo_bar_nonsense_stuff".
thanks a lot


Welcome.

-- --
Abstraction is selective ignorance.
-Andrew Koenig
-- --
Jul 22 '05 #5

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

Similar topics

2
by: pembed2003 | last post by:
Hi all, I recently saw a piece of code that looks like: class one{public: one(){} }; class two : public virtual one{public: two(){} }; class three : virtual public one{public: three(){} }; ...
3
by: Steven T. Hatton | last post by:
I stumbled upon this blog while googling for something. I have to say, I really don't understand what Lippman is trying to tell me here. I included the first paragraph for context, but the second...
24
by: David Mathog | last post by:
If this: int i,sum; int *array; for(sum=0, i=0; i<len; i++){ sum += array; } is converted to this (never mind why for the moment):
11
by: grocery_stocker | last post by:
How come you can subtract pointers, but you cannot add them?
43
by: Mountain Bikn' Guy | last post by:
I have a situation where an app writes data of various types (primitives and objects) into a single dimensional array of objects. (This array eventually becomes a row in a data table, but that's...
16
by: Bob Hairgrove | last post by:
Consider the classic clone() function: class A { public: virtual ~A() {} virtual A* clone() const = 0; }; class B : public A { public:
2
by: tony | last post by:
Hello!! I know what an abstract class is which mean that the one of the derived class must define the abstract methods in the abstract class. So all the abstract methods in the abstarct class...
6
by: marcwentink | last post by:
Say I have class A that inherits from class B, and I call class A his constructor. Then somehow class B his constructor is called also. How does this work? Is a constructor under the hood a sort of...
167
by: darren | last post by:
Hi I have to write a multi-threaded program. I decided to take an OO approach to it. I had the idea to wrap up all of the thread functions in a mix-in class called Threadable. Then when an...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.