home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 32,447 of 33,346   
   Kaba to All   
   Re: C++ Library design: public header fi   
   02 Jul 12 18:05:06   
   
   From: kaba@nowhere.com   
      
   2.7.2012 21:07, fmatthew5876 kirjoitti:   
   > However, in some C libraries, the idiom is to #include a single header file   
   > to get the entire library or there may be a couple of header files for each   
   > subsystem. If the user is expected to use a set of classes together most of   
   > the time this may make more sense. Consider a math library with vec2, vec3,   
   > vec4, mat2, mat3, mat4, etc.. One header per type can quickly get unwieldy.   
   >   
   > So what approach do you all typically prefer? Per class? Per subsystem?   
   > Some combination?   
      
   The best approach is to provide 'aggregation header files' at "every"   
   level of detail. The user can then choose his/her detail level freely.   
   The "every" here refers to logical groups of functionality. This logical   
   grouping comes quite naturally, and corresponds to the way you group the   
   documentation for the library. An example from my library:   
      
   http://kaba.hilvi.org/pastel/techniques_aggregation.htm   
      
   An example of an aggregate header file can be seen here:   
      
   http://kaba.hilvi.org/pastel/pastel/sys/random.htm   
      
   If you click further to continuous random variables, you will find   
   another aggregate file for them. And so on.   
      
   --   
   http://kaba.hilvi.org   
      
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca