Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > what does this mean: virtual result

Reply
Thread Tools

what does this mean: virtual result

 
 
David
Guest
Posts: n/a
 
      06-24-2004
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);
.........
}
 
Reply With Quote
 
 
 
 
Allan Bruce
Guest
Posts: n/a
 
      06-24-2004

"David" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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


 
Reply With Quote
 
 
 
 
JKop
Guest
Posts: n/a
 
      06-24-2004
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

 
Reply With Quote
 
Victor Bazarov
Guest
Posts: n/a
 
      06-24-2004
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
 
Reply With Quote
 
Prateek R Karandikar
Guest
Posts: n/a
 
      06-24-2004
http://www.velocityreviews.com/forums/(E-Mail Removed) (David) wrote in message news:<(E-Mail Removed). 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
-- --
 
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
i = 10; result = ++i - --i; How result become ZERO Lakshmi Sreekanth C Programming 52 09-23-2010 07:41 AM
Re: i = 10; result = ++i - --i; How result become ZERO Mr. Buffoon C Programming 4 09-23-2010 03:01 AM
Is the result of valid dynamic cast always equal to the result ofcorrespondent static cast? Pavel C++ 7 09-18-2010 11:35 PM
simulation result is correct but synthesis result is not correct J.Ram VHDL 7 12-03-2008 01:26 PM
1. Ruby result: 101 seconds , 2. Java result:9.8 seconds, 3. Perl result:62 seconds Michael Tan Ruby 32 07-21-2005 03:23 PM



Advertisments