# HG changeset patch # User mas01cr # Date 1230116099 0 # Node ID 166312a124bc1ae2437f0a9989d2d04f246f9ea6 # Parent 580f696c817c27c1161212ac1f4e95baccee764f Code spaghettification continues. Include accumulator.h in audioDB.h. This means we also need audioDB_API.h in there, to get the definition of adb_result_t. Use preprocessor defines to prevent audioDB_API.h from being included multiple times. Include an accumulator field in class audioDB. diff -r 580f696c817c -r 166312a124bc accumulator_test.cpp --- a/accumulator_test.cpp Wed Dec 24 10:54:55 2008 +0000 +++ b/accumulator_test.cpp Wed Dec 24 10:54:59 2008 +0000 @@ -1,3 +1,9 @@ +#include "audioDB.h" +extern "C" { +#include "audioDB_API.h" +} +#include "audioDB-internals.h" + #include "accumulators.h" static NearestAccumulator *foo = new NearestAccumulator(); diff -r 580f696c817c -r 166312a124bc accumulators.h --- a/accumulators.h Wed Dec 24 10:54:55 2008 +0000 +++ b/accumulators.h Wed Dec 24 10:54:59 2008 +0000 @@ -7,12 +7,6 @@ #include #include -#include "audioDB.h" -extern "C" { -#include "audioDB_API.h" -} -#include "audioDB-internals.h" - #include "accumulator.h" #include "dbaccumulator.h" #include "pertrackaccumulator.h" diff -r 580f696c817c -r 166312a124bc audioDB.h --- a/audioDB.h Wed Dec 24 10:54:55 2008 +0000 +++ b/audioDB.h Wed Dec 24 10:54:59 2008 +0000 @@ -20,7 +20,11 @@ #include // includes for LSH indexing +extern "C" { +#include "audioDB_API.h" +} #include "ReporterBase.h" +#include "accumulator.h" #include "lshlib.h" // includes for web services @@ -300,6 +304,7 @@ double relative_threshold; ReporterBase* reporter; // track/point reporter + Accumulator *accumulator; priority_queue, std::less >* exact_evaluation_queue; // Timers @@ -490,6 +495,7 @@ use_relative_threshold(false), \ relative_threshold(0.0), \ reporter(0), \ + accumulator(0), \ exact_evaluation_queue(0), \ lisztOffset(0), \ lisztLength(0), \ diff -r 580f696c817c -r 166312a124bc audioDB_API.h --- a/audioDB_API.h Wed Dec 24 10:54:55 2008 +0000 +++ b/audioDB_API.h Wed Dec 24 10:54:59 2008 +0000 @@ -1,3 +1,6 @@ +#ifndef AUDIODB_API_H +#define AUDIODB_API_H + #include #include @@ -182,3 +185,5 @@ /* varoius dump formats */ int audiodb_dump(adb_ptr mydb, const char *outputdir); + +#endif