From f9a30ca08ef8e330736d95e371ba8920a1b59904 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Tue, 4 Jul 2017 15:08:01 +0200 Subject: [PATCH] update doc --- documentation/Doxyfile | 55 ++++++-------------------------------- documentation/Makefile | 13 +++++++++ documentation/commit-gh.sh | 45 +++++++++++++++++++++++++++++++ documentation/mainpage.h | 46 ++++++++++++++++++++++++++++++- src/pv/pvType.h | 5 +++- 5 files changed, 115 insertions(+), 49 deletions(-) create mode 100644 documentation/Makefile create mode 100755 documentation/commit-gh.sh diff --git a/documentation/Doxyfile b/documentation/Doxyfile index 4c4242f..1547248 100644 --- a/documentation/Doxyfile +++ b/documentation/Doxyfile @@ -419,7 +419,7 @@ LOOKUP_CACHE_SIZE = 0 # normally produced when WARNINGS is set to YES. # The default value is: NO. -EXTRACT_ALL = YES +EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES all private members of a class will # be included in the documentation. @@ -445,7 +445,7 @@ EXTRACT_STATIC = NO # for Java sources. # The default value is: YES. -EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_CLASSES = NO # This flag is only useful for Objective-C code. When set to YES local methods, # which are defined in the implementation section but not in the interface are @@ -763,8 +763,10 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = ../src \ - ./mainpage.h +INPUT = ../src/pv \ + ./mainpage.h \ + ../src/copy/pv \ + ../src/misc/pv # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -784,54 +786,13 @@ INPUT_ENCODING = UTF-8 # *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, # *.qsf, *.as and *.js. -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.idl \ - *.ddl \ - *.odl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.cs \ - *.d \ - *.php \ - *.php4 \ - *.php5 \ - *.phtml \ - *.inc \ - *.m \ - *.markdown \ - *.md \ - *.mm \ - *.dox \ - *.py \ - *.f90 \ - *.f \ - *.for \ - *.tcl \ - *.vhd \ - *.vhdl \ - *.ucf \ - *.qsf \ - *.as \ - *.js +FILE_PATTERNS = # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. # The default value is: NO. -RECURSIVE = YES +RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a diff --git a/documentation/Makefile b/documentation/Makefile new file mode 100644 index 0000000..1992edf --- /dev/null +++ b/documentation/Makefile @@ -0,0 +1,13 @@ +all: gen + +clean: + rm -rf doxygen_sqlite3.db html + +gen: + doxygen + +commit: gen + touch html/.nojekyll + ./commit-gh.sh documentation/html/ html/.nojekyll html/*.* html/search/*.* + +.PHONY: all clean gen commit diff --git a/documentation/commit-gh.sh b/documentation/commit-gh.sh new file mode 100755 index 0000000..d630165 --- /dev/null +++ b/documentation/commit-gh.sh @@ -0,0 +1,45 @@ +#!/bin/sh +set -e -x +# Usage: commit-gh +# +# Creates a commit containing only the files in the sub-directory provided as an argument +# +# Does not disturb the working copy or index + +prefix="$1" +shift + +# Commit to this branch +BRANCH=refs/heads/gh-pages + +# Use the main branch description as the gh-pages commit message +MSG=`git describe --tags --always` + +# Scratch space +TDIR=`mktemp -d -p $PWD` + +# Automatic cleanup of scratch space +trap 'rm -rf $TDIR' INT TERM QUIT EXIT + +export GIT_INDEX_FILE="$TDIR/index" + +# Add listed files to a new (empty) index +git update-index --add "$@" + +# Write the index into the repo, get tree hash +TREE=`git write-tree --prefix="$prefix"` + +echo "TREE $TREE" +git cat-file -p $TREE + +# Create a commit with our new tree +# Reference current branch head as parent (if any) +CMT=`git commit-tree -m "$MSG" $TREE` + +echo "COMMIT $CMT" +git cat-file -p $CMT + +# Update the branch with the new commit tree hash +git update-ref $BRANCH $CMT + +echo "Done" diff --git a/documentation/mainpage.h b/documentation/mainpage.h index 4042f2a..128e8a9 100644 --- a/documentation/mainpage.h +++ b/documentation/mainpage.h @@ -1,8 +1,52 @@ #ifndef MAINPAGE_H #define MAINPAGE_H /** -@mainpage PVDATA C++ +@mainpage pvDataCPP documentation +The epics::pvData namespace. +See pv/pvData.h header. + +@code +#include +#include +@endcode + +- Type description epics::pvData::Field and sub-classes +- Value container epics::pvData::PVField and sub-classes +- POD array handling epics::pvData::shared_vector +- pvRequest parsing epics::pvData::createRequest() + +Define a structure type and create a container with default values. + +@code +epics::pvData::StructureConstPtr stype; // aka std::tr1::shared_ptr +stype = epics::pvData::getFieldCreate()->createFieldBuilder() + ->add("fld1", epics::pvData::pvInt) + ->addNestedStructure("sub") + ->add("fld2", epics::pvData::pvString) + ->endNested() + ->createStructure(); + +epics::pvData::PVStructuretPtr value; // aka std::tr1::shared_ptr +value = epics::pvData::getPVDataCreate()->createPVStructure(stype); + +value->getSubField("fld1")->put(4); // store integer 4 +value->getSubField("sub.fld2")->putFrom(4.2); // convert and store string "4.2" +@endcode + +is equivalent to the following pseudo-code. + +@code +struct stype { + epics::pvData::int32 fld1; + struct { + std::string fld2; + } sub; +}; +stype value; +value.fld1 = 4; +value.fld2 = epics::pvData::castUnsafe(4.2); +@endcode */ diff --git a/src/pv/pvType.h b/src/pv/pvType.h index 4202228..d1131ba 100644 --- a/src/pv/pvType.h +++ b/src/pv/pvType.h @@ -41,7 +41,10 @@ typedef unsigned int uintptr_t; #include #include -namespace epics { namespace pvData { +//! epics +namespace epics { +//! pvData +namespace pvData { namespace detail { // Pick either type If or type Else to not be Cond