fix motif loader under release build
authorDiane Trout <diane@caltech.edu>
Thu, 19 Oct 2006 23:27:07 +0000 (23:27 +0000)
committerDiane Trout <diane@caltech.edu>
Thu, 19 Oct 2006 23:27:07 +0000 (23:27 +0000)
commit0c5b1334caa6f095204ff7aa8ed7ac18111f1512
tree994519dc7a1f1141441bc0559045761a59edde10
parentf2459784ce26346876ba2ec76475a579051bbd5c
fix motif loader under release build
tciet:163
It turns out that allocating a static class under a release build with a
static char might not be so reliable. This showed up as two problems
first was the test_algorithm unit test would fail.

The second was that the motif parser wouldn't work. In my efforts to
diagnose this I ended up moving the motif file parser to its own file
and splitting the spirit semantic actions up into multiple functors.
(functors remind me of anonmyous classes in java, useful but so annoying
synatacticaly).

Eventually I solved the problem by making the const char *alphabets
just available directly from the Alphabet class, as I couldn't figure out
a way to get the static function returning a reference to a static local
variable (which according to the C++ faq should've been allocated when called
and not before).
alg/CMakeLists.txt
alg/alphabet.cpp
alg/alphabet.hpp
alg/motif_parser.cpp [new file with mode: 0644]
alg/motif_parser.hpp [new file with mode: 0644]
alg/mussa.cpp
alg/sequence.cpp
alg/test/test_alphabet.cpp