Files
pcas/src/libCom/cxxTemplates
Michael Davidsaver f7fc564556 Fold antelope/flex and asHost into libCom
Build lexer and parser from libCom/Makefile.
Since libCom now includes asLib.c and asLib_lex.c we must build
antelope and flex without linking them to Com.  This works because
they only need epicsTempFile anyway.  However make doesn't like a
subdirectory with the same name as a target object, so the antelope
source directory is now called yacc.  The two main.c files were also
renamed to avoid other build problems.

Merge asHost into Com and remove mentions in CONFIG_BASE

Lots of noise since SRCS must be renamed to Com_SRCS
2011-02-25 15:39:44 -06:00
..
2010-10-05 14:27:37 -05:00
2010-10-05 14:27:37 -05:00
2010-10-05 14:27:37 -05:00
doc
2000-09-11 16:15:29 +00:00
2010-10-05 14:27:37 -05:00
2010-10-05 14:27:37 -05:00
2006-09-13 21:54:13 +00:00
2010-10-05 14:27:37 -05:00
2010-10-05 14:27:37 -05:00
2003-01-23 22:53:31 +00:00
2010-10-05 14:27:37 -05:00

C++ templates:
tsSLList.h - type safe single linked list template
tsDLList.h - type safe double linked list template
resourceLib.h - hash table template
tsFreeeList.h - free list allocator / deallocator

the test subdir contains examples

Since I am using templates the linked lists are type safe
(no casting of pointers ala ellList and dllList). 
Also, the node class in embedded in the item on the
list (more efficient use of pool).

The file resourceLib.h provides a core hashing library 
"resTable <itemClass, idClass>" where "itemClass" objects
are stored in the hash table and "idClass" is the data type
of the key for the hash table. The identifier class provides
the hash alg. I have provided simple string "stringId" and 
unsigned integer "uintId" key types in resourceLib.h. It
is easy to implement a new key class.

There are examples under cxxTemplate/test. The list/hashing
templates all depend on a particular inheritance hierarchy.
If the inheritance hierarchy is wrong nothing will compile.
For instance, in tsDLList.h the template data type "T"
must derive from tsDLNode<T>. Likewise, in tsSLList.h
"T" must derive from tsSLNode<T>. Likewise, in resourceLib.h
class "T" (the type stored in the hash table) must derive 
from class "ID" (the hash table key type) and also derive from
tsSLNode<T>.

So far, the only confusion I have run into with templates has been:

1) strange compiler messages - unrelated to cause of course -
when I get the class declaration order wrong (so that the 
compiler has trouble instantiating the template).

2) sun pro/dec/att compilers use a template database and 
gnu/msvc++ compilers use explicit template instantiation.
Therefore blocks of code of this sort are required:

#include "resourceLib.h" // template def
#include "resourceLib.cc" // template functions (that are not inline)
#if defined (EXPL_TEMPL)
        //
        // From Stroustrups's "The C++ Programming Language"
        // Appendix A: r.14.9
        //
        // This explicitly instantiates the template class's member
        // functions into "templInst.o"
        //
        template class resTable<fred,uintId>;
        template class resTable<jane,stringId>;
#endif