[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

eget c++ bibliotek med minimalt interface



Jeg vil gerne kode et bibliotek, som skal stille en klasse
'Myclass' til rådighed.

Kan det virkelig passe at bibliotekets headerfil 'myclass.h'
skal indeholde den fulde klassedefinition, f.eks. inklusive private variable, selvom disse egentlig ikke vedkommer bibliotekets interface?


Eller kan jeg lave en særlig headerfil, der blot angiver 'interfacet'?
Det ville jeg kunne finde ud af i C, men med klasse definitioner og klasse metoder, hvordan gør jeg da?


Mit spørgsmål kunne f.eks. illustreres ved følgende klasse, hvordan kan
jeg have denne klasse definition men kun angive contructors og public metoder i bibliotekets headerfil?


class MyClass {
  public:
    MyClass::MyClass(int id);
    int getid();
  private:
    int privateid;
}


/ Kristian


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2006-06-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *