Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 17th, 2005, 08:05 AM
Hans Stoessel
Guest
 
Posts: n/a
Default Adobe Indesign SDK: Interface declaration

Hi

In the Adobe Indesign development I have e.g. the following declaration in
the header file of an interface:

virtual int test(int i) = 0;

Whats the "= 0" at the end of the declaration? I mean in a normal header
file in C++ I can't do that.

Thanks for the information.

Regards
Hans


  #2  
Old August 17th, 2005, 08:25 AM
Alf P. Steinbach
Guest
 
Posts: n/a
Default Re: Adobe Indesign SDK: Interface declaration

* Hans Stoessel:[color=blue]
>
> In the Adobe Indesign development I have e.g. the following declaration in
> the header file of an interface:
>
> virtual int test(int i) = 0;
>
> Whats the "= 0" at the end of the declaration?[/color]

It means that an a definition must be / is provided in a derived class.

Also that the class containing the "= 0" can not be instantiated.

A member function designated with "= 0" is called a pure virtual member
function, and a class containing a pure virtual member, an abstract class.

[color=blue]
> I mean in a normal header file in C++ I can't do that.[/color]

You can.

--
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?
  #3  
Old August 17th, 2005, 09:05 AM
Srini
Guest
 
Posts: n/a
Default Re: Adobe Indesign SDK: Interface declaration

> Hi[color=blue]
>
> In the Adobe Indesign development I have e.g. the following declaration in
> the header file of an interface:
>
> virtual int test(int i) = 0;
>
> Whats the "= 0" at the end of the declaration?[/color]

It means that the function is pure virtual and the class that contains
this function is an abstract class. You cannot create instances of
abstract classes. The class inheriting from such a class must provide
an implementation for the pure virtual function.
[color=blue]
> I mean in a normal header file in C++ I can't do that.
>[/color]

Huh?? What do you mean by "normal header file in C++"?? You cannot
declare pure virtual functions outside classes. In other words, a
function cannot be pure virtual unless its a member function of some
class.
[color=blue]
> Thanks for the information.
>
> Regards
> Hans[/color]

Srini

 

Bookmarks

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles