By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,813 Members | 1,253 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,813 IT Pros & Developers. It's quick & easy.

what does this mean: virtual result

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a

"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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.