Changeset 1473


Ignore:
Timestamp:
09/05/10 14:28:15 (21 months ago)
Author:
Freddie Akeroyd
Message:

Improve comments and reference test programs. Refs #231.

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/bindings/cpp/NeXusFile.cpp

    r1470 r1473  
    1515 
    1616/** 
    17  * \mainpage NeXus C++ API documentation 
     17 * \mainpage NeXus C++ API 
     18 * @author Peter Peterson 
     19 * @author Freddie Akeroyd 
    1820 * \section sec_purpose Purpose of API 
    1921 *  This provides a C++ like interface to the NeXus C API. It adds: 
     
    3032 * #include "NeXusFile.hpp" 
    3133 * \endcode 
     34 * 
     35 * \example napi_test_cpp.cxx 
     36 * Test program for NeXus C++ Interface 
     37 * 
    3238 * For details of the C API see http://download.nexusformat.org/doxygen/html-c/ 
    3339 */ 
  • trunk/bindings/cpp/NeXusFile.hpp

    r1468 r1473  
    257257     * Create a 1D data field, insert the data, and close the data. 
    258258     * 
     259     * \tparam NumT numeric data type of \a value 
    259260     * \param name The name of the field to create. 
    260261     * \param value The vector to put into the file. 
     
    266267     * Create a 1D data field, insert the data, and close the data. 
    267268     * 
     269     * \tparam NumT numeric data type of \a value 
    268270     * \param name The name of the field to create. 
    269271     * \param value The value to put into the file. 
     
    278280     * \param value The data to put into the file. 
    279281     * \param dims The dimensions of the data. 
     282     * \tparam NumT numeric data type of \a value 
    280283     */ 
    281284    template <typename NumT> 
     
    305308     * \param comp The compression algorithm to use. 
    306309     * \param bufsize The size of the compression buffer to use. 
     310     * \tparam NumT numeric data type of \a value 
    307311     */ 
    308312    template <typename NumT> 
     
    329333    /** 
    330334     * \param data The data to put in the file. 
     335     * \tparam NumT numeric data type of \a data 
    331336     */ 
    332337    template <typename NumT> 
     
    346351     * \param name Name of the attribute to add. 
    347352     * \param value The attribute value. 
     353     * \tparam NumT numeric data type of \a value 
    348354     */ 
    349355    template <typename NumT> 
     
    382388     * \param start The starting index to insert the data. 
    383389     * \param size The size of the array to put in the file. 
     390     * \tparam NumT numeric data type of \a data 
    384391     */ 
    385392    template <typename NumT> 
     
    393400     * \param start The starting index to insert the data. 
    394401     * \param size The size of the array to put in the file. 
     402     * \tparam NumT numeric data type of \a data 
    395403     */ 
    396404    template <typename NumT> 
     
    434442     * does call "new vector<NumT>" the caller is responsible for 
    435443     * calling "delete". 
     444     * \tparam NumT numeric data type of result 
    436445     * 
    437446     * \return The data as a vector. 
     
    446455     * 
    447456     * \param data Where to put the data. 
     457     * \tparam NumT numeric data type of \a data 
    448458     */ 
    449459    template <typename NumT> 
     
    496506     * 
    497507     * \param info Designation of which attribute to read. 
     508     * \tparam NumT numeric data type of result 
    498509     * 
    499510     * \return The attribute value. 
     
    507518     * 
    508519     * \param[in] name Name of attribute to read 
    509      * 
    510520     * \param[out] value The read attribute value. 
     521     * \tparam NumT numeric data type of \a value 
    511522     */ 
    512523    template <typename NumT> 
     
    594605  /** 
    595606   * This function returns the NXnumtype given a concrete number. 
     607   * \tparam NumT numeric data type of \a number to check 
    596608   */ 
    597609   template <typename NumT> 
  • trunk/bindings/java/org/nexusformat/NexusFile.java

    r1465 r1473  
    11/** 
    22  * 
    3   * The NeXus-API for Java. NeXus is an attempt to define a common data  
     3  * @mainpage The NeXus-API for Java.  
     4  * NeXus is an attempt to define a common data  
    45  * format for org and x-ray diffraction. NeXus is built on top of the 
    56  * Hierarchical Data Format from NCSA. There exist already API's to 
     
    1011  * different calling standards between C and Java.  
    1112  * 
     13  * @example TestJapi.java 
     14  * Test program for Java API 
    1215  * 
    1316  * @author Mark Koennecke, October 2000 
  • trunk/bindings/python/nxs/napi.py

    r1461 r1473  
    1414looks in the following places in order:: 
    1515 
    16     os.environ['NEXUSLIB']                  - All 
    17     directory containing nxs.py             - All 
    18     os.environ['NEXUSDIR']\bin              - Windows 
    19     os.environ['LD_LIBRARY_PATH']           - Unix 
    20     os.environ['DYLD_LIBRARY_PATH']         - Darwin 
    21     PREFIX/lib                              - Unix and Darwin 
    22     /usr/local/lib                          - Unix and Darwin 
    23     /usr/lib                                - Unix and Darwin 
    24  
    25 On Windows it looks for one of libNeXus.dll or libNeXus-0.dll. 
    26 On OS X it looks for libNeXus.dylib 
    27 On Unix it looks for libNeXus.so 
    28 NEXUSDIR defaults to r'C:\Program Files\NeXus Data Format'. 
    29 PREFIX defaults to /usr/local, but is replaced by the value of 
    30 --prefix during configure. 
     16@verbatim 
     17   os.environ['NEXUSLIB']                  - All 
     18   directory containing nxs.py             - All 
     19   os.environ['NEXUSDIR']\bin              - Windows 
     20   os.environ['LD_LIBRARY_PATH']           - Unix 
     21   os.environ['DYLD_LIBRARY_PATH']         - Darwin 
     22   PREFIX/lib                              - Unix and Darwin 
     23   /usr/local/lib                          - Unix and Darwin 
     24   /usr/lib                                - Unix and Darwin 
     25@endverbatim 
     26 
     27- On Windows it looks for one of libNeXus.dll or libNeXus-0.dll. 
     28- On OS X it looks for libNeXus.dylib 
     29- On Unix it looks for libNeXus.so 
     30- NEXUSDIR defaults to 'C:\\Program Files\\NeXus Data Format'. 
     31- PREFIX defaults to /usr/local, but is replaced by the value of --prefix during configure. 
    3132 
    3233The import will raise an OSError exception if the library wasn't found 
     
    4041Example 
    4142======= 
    42  
     43@code 
    4344  import nxs 
    4445  file = nxs.open('filename.nxs','rw') 
     
    4748  print file.getdata() 
    4849  file.close() 
    49  
    50   See nxstest.py for a more complete example. 
     50@endcode 
     51 
     52  See @example nxstest.py for a more complete example. 
    5153 
    5254Interface 
     
    7173File open modes can be constants or strings:: 
    7274 
    73   nxs.ACC_READ      'r' 
    74   nxs.ACC_RDWR      'rw' 
    75   nxs.ACC_CREATE    'w' 
    76   nxs.ACC_CREATE4   'w4' 
    77   nxs.ACC_CREATE5   'w5' 
    78   nxs.ACC_CREATEXML 'wx' 
     75@verbatim 
     76 nxs.ACC_READ      'r' 
     77 nxs.ACC_RDWR      'rw' 
     78 nxs.ACC_CREATE    'w' 
     79 nxs.ACC_CREATE4   'w4' 
     80 nxs.ACC_CREATE5   'w5' 
     81 nxs.ACC_CREATEXML 'wx' 
     82@endverbatim 
    7983 
    8084Dimension constants:: 
    8185 
    82   nxs.UNLIMITED  - for the extensible data dimension 
    83   nxs.MAXRANK    - for the number of possible dimensions 
     86  - nxs.UNLIMITED  - for the extensible data dimension 
     87  - nxs.MAXRANK    - for the number of possible dimensions 
    8488 
    8589Data types are strings corresponding to the numpy data types:: 
     
    104108Miscellaneous constants:: 
    105109 
    106   nxs.MAXNAMELEN  - names must be shorter than this 
    107   nxs.MAXPATHLEN  - total path length must be shorter than this 
    108   nxs.H4SKIP - class names that may appear in HDF4 files but can be ignored 
     110  - nxs.MAXNAMELEN  - names must be shorter than this 
     111  - nxs.MAXPATHLEN  - total path length must be shorter than this 
     112  - nxs.H4SKIP - class names that may appear in HDF4 files but can be ignored 
    109113 
    110114Caveats 
    111115======= 
    112116 
    113 TODO: NOSTRIP constant is probably not handled properly, 
    114 TODO: Embedded nulls in strings is not supported 
    115  
    116 WARNING:  We have a memory leak.  Calling open/close costs about 90k a pair. 
     117@todo NOSTRIP constant is probably not handled properly, 
     118@todo Embedded nulls in strings is not supported 
     119 
     120@warning  We have a memory leak.  Calling open/close costs about 90k a pair. 
    117121This is an eigenbug: 
    118    - if I test ctypes on a simple library it does not leak 
    119    - if I use the leak_test1 code in the nexus distribution it doesn't leak 
    120    - if I remove the open/close call in the wrapper it doesn't leak. 
    121  
    122 .. _NAPI:  http://www.nexusformat.org/Application_Program_Interface 
     122 - if I test ctypes on a simple library it does not leak 
     123 - if I use the leak_test1 code in the nexus distribution it doesn't leak 
     124 - if I remove the open/close call in the wrapper it doesn't leak. 
     125 
    123126""" 
     127 
    124128__all__ = ['UNLIMITED', 'MAXRANK', 'MAXNAMELEN','MAXPATHLEN','H4SKIP', 
    125129           'NeXus','NeXusError','open'] 
  • trunk/doc/doxygen/Doxyfile_c

    r1426 r1473  
    13111311# a tag file that is based on the input files it reads. 
    13121312 
    1313 GENERATE_TAGFILE       = 
     1313GENERATE_TAGFILE       = c-api.tag 
    13141314 
    13151315# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
  • trunk/doc/doxygen/Doxyfile_cpp

    r1426 r1473  
    635635# the \include command). 
    636636 
    637 EXAMPLE_PATH           = 
     637EXAMPLE_PATH           = $(TOPSRC)/test 
    638638 
    639639# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
     
    642642# blank all files are included. 
    643643 
    644 EXAMPLE_PATTERNS       = 
     644EXAMPLE_PATTERNS       = *.cpp *.cxx 
    645645 
    646646# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
     
    13131313# is run, you must also specify the path to the tagfile here. 
    13141314 
    1315 TAGFILES               = 
     1315TAGFILES               = c-api.tag=../html-c 
    13161316 
    13171317# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
  • trunk/doc/doxygen/Doxyfile_java

    r1426 r1473  
    636636# the \include command). 
    637637 
    638 EXAMPLE_PATH           = 
     638EXAMPLE_PATH           = $(TOPSRC)/bindings/java/test 
    639639 
    640640# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
     
    643643# blank all files are included. 
    644644 
    645 EXAMPLE_PATTERNS       = 
     645EXAMPLE_PATTERNS       = *.java 
    646646 
    647647# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
  • trunk/doc/doxygen/Doxyfile_python

    r1464 r1473  
    626626# the \include command). 
    627627 
    628 EXAMPLE_PATH           = 
     628EXAMPLE_PATH           = $(TOPSRC)/bindings/python 
    629629 
    630630# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
     
    633633# blank all files are included. 
    634634 
    635 EXAMPLE_PATTERNS       = 
     635EXAMPLE_PATTERNS       = *.py 
    636636 
    637637# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
  • trunk/doc/doxygen/Makefile.am

    r1445 r1473  
    77# documenttion subdirectories 
    88nxdoxydir       = $(NXDOCDIR)/doxygen 
    9 CLEANFILES =  doxy.remove_me_to_remake 
     9CLEANFILES =  doxy.remove_me_to_remake c-api.tag 
    1010 
    1111all : doxy.remove_me_to_remake 
  • trunk/include/napi.h

    r1460 r1473  
    119119 
    120120 
    121 /** \var NeXus data types 
     121/** 
    122122 * \ingroup c_types 
    123  * \li NX_FLOAT32     32 bit float 
    124  * \li NX_FLOAT64     64 nit float == double 
    125  * \li NX_INT8        8 bit integer == byte 
    126  * \li NX_UINT8       8 bit unsigned integer 
    127  * \li NX_INT16       16 bit integer 
    128  * \li NX_UINT16      16 bit unsigned integer 
    129  * \li NX_INT32       32 bit integer 
    130  * \li NX_UINT32      32 bit unsigned integer 
    131  * \li NX_CHAR        8 bit character 
    132  * \li NX_BINARY      lump of binary data == NX_UINT8 
     123 * \def NX_FLOAT32      
     124 * 32 bit float 
     125 * \def NX_FLOAT64      
     126 * 64 bit float == double 
     127 * \def NX_INT8         
     128 * 8 bit integer == byte 
     129 * \def NX_UINT8        
     130 * 8 bit unsigned integer 
     131 * \def NX_INT16        
     132 * 16 bit integer 
     133 * \def NX_UINT16       
     134 * 16 bit unsigned integer 
     135 * \def NX_INT32        
     136 * 32 bit integer 
     137 * \def NX_UINT32       
     138 * 32 bit unsigned integer 
     139 * \def NX_CHAR         
     140 * 8 bit character 
     141 * \def NX_BINARY       
     142 * lump of binary data == NX_UINT8 
    133143*/ 
    134144/*--------------------------------------------------------------------------*/  
Note: See TracChangeset for help on using the changeset viewer.