source/big_main.cpp
source/tiny_main.cpp
)
+
+set(Optional.sources
+ source/big_main.cpp
+ source/tiny_main.cpp
+)
+
+set(Test.sources
+ source/test/base.cpp
+)
+
+set(Test.headers
+ googletest/include/gtest/gtest.h
+)
+
load_parameters(cxx-flags)
-set_source_files_properties(${Compile.sources} ${Optional.sources} PROPERTIES COMPILE_FLAGS "-std=c++11")
+set_source_files_properties(${Compile.sources} ${Optional.sources} ${Test.sources} PROPERTIES COMPILE_FLAGS "-std=c++11")
+set_source_files_properties(${Compile.sources} ${Optional.sources} ${Test.sources} PROPERTIES COMPILE_FLAGS "-std=c++11")
add_executable(freedv-server ${Compile.sources} source/big_main.cpp)
# Googletest unit testing.
add_subdirectory(googletest)
-add_executable(freedv-gtest ${Compile.sources})
+include_directories(googletest/include)
+include_directories(source)
+add_executable(freedv-gtest ${Compile.sources} ${Test.sources} ${Test.headers})
set_target_properties(freedv-gtest PROPERTIES LINK_FLAGS "-L googletest")
target_link_libraries(freedv-gtest gtest_main.a libgtest.a pthread)
add_dependencies(freedv-gtest gtest gtest_main)
/// \param _parameters Driver-specific configuration parameters.
Base(const char * _name, const char * _parameters);
+ public:
/// Destroy the base class.
- virtual ~Base();
+ virtual ~Base() = 0;
- public:
/// Return true if the object is owned by a UserInterface object and
/// should not be destroyed separately.
/// The return value is invariant for a particular object (or possibly
/// \param parameters Driver-specific configuration parameters.
AudioInput(const char * name, const char * parameters);
+ public:
/// Destroy an AudioInput device instance.
virtual ~AudioInput() = 0;
- public:
/// Get the current audio level.
/// \return The current audio level.
/// The value is normalized to the range of 0.0 to 1.0.
/// \param parameters Driver-specific configuration parameters.
AudioOutput(const char * name, const char * parameters);
+ public:
/// Destroy an AudioOutput device instance.
virtual ~AudioOutput() = 0;
- public:
/// Get the current audio level.
/// The value is normalized to the range of 0.0 to 1.0.
virtual float level() = 0;
/// \param parameters Driver-specific configuration parameters.
Codec(const char * name, const char * parameters);
+ public:
/// Destroy a codec instance.
virtual ~Codec() = 0;
- public:
/// Encode from an array of the signed 16-bit integer type to an
/// array of the unsigned 8-bit integer type (this is usually
/// implemented as unsigned char).
: Base(name, parameters), do_exit(false)
{
}
- virtual ~EventHandler() = 0;
/// If set_exit() has been called, return true once.
/// \return True if set_exit has been called. The next and subsequent
/// Cause get_exit() to return true the next time it is called.
inline void set_exit() { do_exit = true; }
public:
+ virtual ~EventHandler() = 0;
+
/// Run the event loop.
/// The default implementation iterates checking get_exit(), returning
/// if its value is true and otherwise and calling iterate().
/// \param parameters Driver-specific configuration parameters.
Keying(const char * name, const char * parameters);
+ public:
/// Destroy the radio keying device instance.
virtual ~Keying() = 0;
- public:
/// Key or un-key the transmitter.
/// \param value If true, key the transmitter. If false, un-key.
virtual void key(bool value) = 0;
/// \param parameters Driver-specific configuration parameters.
Modem(const char * name, const char * parameters);
+ public:
virtual ~Modem() = 0;
};
/// \param parameters Driver-specific configuration parameters.
PTTInput(const char * name, const char * parameters);
- virtual ~PTTInput() = 0;
public:
+ virtual ~PTTInput() = 0;
+
/// Set the function that will be called when the push-to-talk input
/// changes its value.
void set_callback(void (*value)(bool));
/// \param parameters Driver-specific configuration parameters.
TextInput(const char * name, const char * parameters);
+ public:
virtual ~TextInput() = 0;
};
/// device driver parameters.
UserInterface(const char * name, const char * parameters, Interfaces * _interfaces);
+ public:
virtual ~UserInterface() = 0;
};