Update of /cvsroot/pclasses/pclasses2/src/s11n/proxy
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13244
Added Files:
createRegSerTraits.sh Makefile.toc
Log Message:
egg
--- NEW FILE: Makefile.toc ---
#!/usr/bin/make -f
include toc.make
DIST_FILES += createProxyStubHeader.sh
all:
--- NEW FILE: createRegSerTraits.sh ---
#!/bin/bash
function show_help()
{
cat <<EOF
$0:
Creates s11n Serializable class registration code for s11n using a
traits registration supermacro.
Parameters: (* = required)
* -c SerializableClass
-b BaseInterfaceClass [${o_base}]
The base Serializable type. i.e., that used in calls
to de/serialize<Base>() and friends. Default is
the -c class.
-a
The SerializableClass is Abstract (or otherwise
cannot or shoult not be instantiated by the
classloader). Default is false.
-n SerializableClassName [${o_clname}]
Default is that from -c.
-r <inc/registration_header.h> [${o_reg_h}]
-p SerializableProxyClass [${o_proxy}]
Sets the s11n proxy class. SerializableClass
must conform to the s11n interface supported
by this proxy. The default proxy requires
that SerializableClass implement two
operator()(NodeType) overloads, as described
in the libs11n manual.
-ns namespace_of_s11n [${o_sns}]
An obscure option to help me port code between
pclasses.com::s11n and s11n.net::s11n.
e.g.: -ns P::s11n
EOF
} # show_help()
############################## args parsing...
while test x != "x$1"; do
a=$1
shift
case $a in
-a)
o_abstract=1
continue
;;
-b)
o_base=$1
shift
continue
;;
-c)
o_class=$1
shift
continue
;;
-ns)
o_sns=$1
shift
;;
-n)
o_clname=$1
shift
continue
;;
-r)
o_reg_h=$1
shift
continue
;;
-p)
o_proxy=$1
shift
continue
;;
-?|--help|-h)
o_show_help=1
cotinue
;;
*)
echo "Unknown argument: $a"
exit 2
esac
done
: ${o_abstract=0}
: ${o_sns="::P::s11n"}
: ${o_proxy="${o_sns}::default_serialize_functor"}
: ${o_clname="${o_class}"}
: ${o_base=${o_class}}
: ${o_reg_h="<pclasses/s11n/reg_serializable_traits.h>"}
test x1 = "x${o_show_help}" && {
show_help
exit 0
}
test x = "x${o_class}" && {
show_help
exit 1
} # end usage text
# getopt "c:" "$@"
test x != "x${o_class}" && {
# Note the use of HARD TABS in the <<-EOF!!!
cat <<-EOF
#define PS11N_TYPE ${o_class}
#define PS11N_TYPE_NAME "${o_clname}"
#define PS11N_SERIALIZE_FUNCTOR ${o_proxy}
EOF
test "${o_class}" != "${o_base}" && \
echo "#define PS11N_TYPE_INTERFACE ${o_base}"
test x1 = "x${o_abstract}" && \
echo "#define PS11N_TYPE_NAME \"${o_clname}\""
echo "#include ${o_reg_h}"
}
########################################################################
|