class RoutingTreeItem;
#define DYNAMIC_ID_BOUNDARY 100 //!< the value below is reserved for staticIDs, the value above will be assigned to dynamically registered items
-//todo: we do not have to create MainSoundProperty tables if visible = false.
//todo: check the enum values before entering & changing in the database.
//todo: change asserts for dynamic boundary checks into failure answers.#
//todo: check autoincrement boundary and set to 16bit limits
am_Error_e peekDomain(const std::string& name, am_domainID_t& domainID);
am_Error_e peekSink(const std::string& name, am_sinkID_t& sinkID);
am_Error_e peekSource(const std::string& name, am_sourceID_t& sourceID);
+ am_Error_e peekSinkClassID(const std::string& name, am_sinkClass_t& sinkClassID);
+ am_Error_e peekSourceClassID(const std::string& name, am_sourceClass_t& sourceClassID);
/**
* checks for a certain mainConnection
* @param mainConnectionID to be checked for
am_Error_e deregisterSource(const am_sourceID_t sourceID);
am_Error_e registerCrossfader(const am_Crossfader_s& crossfaderData, am_crossfaderID_t& crossfaderID);
am_Error_e deregisterCrossfader(const am_crossfaderID_t crossfaderID);
- am_Error_e peekSinkClassID(const std::string& name, const am_sinkClass_t& sinkClassID);
- am_Error_e peekSourceClassID(const std::string& name, const am_sourceClass_t& sourceClassID);
+ am_Error_e peekSinkClassID(const std::string& name, am_sinkClass_t& sinkClassID);
+ am_Error_e peekSourceClassID(const std::string& name, am_sourceClass_t& sourceClassID);
void hookInterruptStatusChange(const am_sourceID_t sourceID, const am_InterruptState_e interruptState);
void hookDomainRegistrationComplete(const am_domainID_t domainID);
void hookSinkAvailablityStatusChange(const am_sinkID_t sinkID, const am_Availability_s& availability);
void hookSourceAvailablityStatusChange(const am_sourceID_t sourceID, const am_Availability_s& availability);
void hookDomainStateChange(const am_domainID_t domainID, const am_DomainState_e domainState);
void hookTimingInformationChanged(const am_connectionID_t connectionID, const am_timeSync_t delay);
- am_Error_e sendChangedData(const std::vector<am_EarlyData_s>& earlyData);
+ void sendChangedData(const std::vector<am_EarlyData_s>& earlyData);
am_Error_e getDBusConnectionWrapper(DBusWrapper*& dbusConnectionWrapper) const;
am_Error_e getSocketHandler(SocketHandler*& socketHandler) const;
uint16_t getInterfaceVersion() const;
#include "DLTWrapper.h"
#include <SocketHandler.h>
#include <config.h>
-#include <assert.h>
+#include <cassert>
using namespace am;
#include "ControlSender.h"
#include "PluginTemplate.h"
#include "DLTWrapper.h"
-#include <assert.h>
+#include <cassert>
#include <fstream>
using namespace am;
#include <fstream>
#include <sstream>
#include <string>
-#include <assert.h>
-#include <stdlib.h>
+#include <cassert>
+#include <cstdlib>
#include "DLTWrapper.h"
using namespace am;
#include "DatabaseHandler.h"
#include "DatabaseObserver.h"
-#include <assert.h>
+#include <cassert>
#include <vector>
#include <fstream>
#include <sstream>
using namespace am;
const std::string databaseTables[] =
-{ //
- " Domains (domainID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name VARCHAR(50), busname VARCHAR(50), nodename VARCHAR(50), early BOOL, complete BOOL, state INTEGER, reserved BOOL);", " SourceClasses (sourceClassID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name VARCHAR(50));", " SinkClasses (sinkClassID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name VARCHAR(50));",
- " Sources (sourceID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, domainID INTEGER, name VARCHAR(50), sourceClassID INTEGER, sourceState INTEGER, volume INTEGER, visible BOOL, availability INTEGER, availabilityReason INTEGER, interruptState INTEGER, reserved BOOL);", //
- " Sinks (sinkID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name VARCHAR(50), domainID INTEGER, sinkClassID INTEGER, volume INTEGER, visible BOOL, availability INTEGER, availabilityReason INTEGER, muteState INTEGER, mainVolume INTEGER, reserved BOOL);", " Gateways (gatewayID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name VARCHAR(50), sinkID INTEGER, sourceID INTEGER, domainSinkID INTEGER, domainSourceID INTEGER, controlDomainID INTEGER, inUse BOOL);", " Crossfaders (crossfaderID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name VARCHAR(50), sinkID_A INTEGER, sinkID_B INTEGER, sourceID INTEGER, hotSink INTEGER);",
- " Connections (connectionID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, sourceID INTEGER, sinkID INTEGER, delay INTEGER, connectionFormat INTEGER, reserved BOOL);", //
- " MainConnections (mainConnectionID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, sourceID INTEGER, sinkID INTEGER, connectionState INTEGER, delay INTEGER);", " SystemProperties (type INTEGER PRIMARY KEY, value INTEGER);" };
+{ " Domains (domainID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name VARCHAR(50), busname VARCHAR(50), nodename VARCHAR(50), early BOOL, complete BOOL, state INTEGER, reserved BOOL);", //
+ " SourceClasses (sourceClassID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name VARCHAR(50));", //
+ " SinkClasses (sinkClassID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name VARCHAR(50));", //
+ " Sources (sourceID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, domainID INTEGER, name VARCHAR(50), sourceClassID INTEGER, sourceState INTEGER, volume INTEGER, visible BOOL, availability INTEGER, availabilityReason INTEGER, interruptState INTEGER, reserved BOOL);", //
+ " Sinks (sinkID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name VARCHAR(50), domainID INTEGER, sinkClassID INTEGER, volume INTEGER, visible BOOL, availability INTEGER, availabilityReason INTEGER, muteState INTEGER, mainVolume INTEGER, reserved BOOL);", //
+ " Gateways (gatewayID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name VARCHAR(50), sinkID INTEGER, sourceID INTEGER, domainSinkID INTEGER, domainSourceID INTEGER, controlDomainID INTEGER);", //
+ " Crossfaders (crossfaderID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name VARCHAR(50), sinkID_A INTEGER, sinkID_B INTEGER, sourceID INTEGER, hotSink INTEGER);", //
+ " Connections (connectionID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, sourceID INTEGER, sinkID INTEGER, delay INTEGER, connectionFormat INTEGER, reserved BOOL);", //
+ " MainConnections (mainConnectionID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, sourceID INTEGER, sinkID INTEGER, connectionState INTEGER, delay INTEGER);", //
+ " SystemProperties (type INTEGER PRIMARY KEY, value INTEGER);" };
/**
* template to converts T to std::string
mListConnectionFormat()
{
- /**
- *\todo: this erases the database. just for testing!
- */
std::ifstream infile(mPath.c_str());
if (infile)
assert(domainData.domainID==0);
assert(!domainData.name.empty());
assert(!domainData.busname.empty());
- assert(domainData.state>=DS_CONTROLLED && domainData.state<=DS_INDEPENDENT_RUNDOWN);
+ assert(domainData.state>=DS_MIN && domainData.state<=DS_MAX);
//first check for a reserved domain
sqlite3_stmt* query = NULL, *queryFinal;
am_Error_e DatabaseHandler::enterMainConnectionDB(const am_MainConnection_s & mainConnectionData, am_mainConnectionID_t & connectionID)
{
assert(mainConnectionData.connectionID==0);
- assert(mainConnectionData.connectionState>=CS_CONNECTING && mainConnectionData.connectionState<=CS_SUSPENDED);
+ assert(mainConnectionData.connectionState>=CS_MIN && mainConnectionData.connectionState<=CS_MAX);
assert(mainConnectionData.route.sinkID!=0);
assert(mainConnectionData.route.sourceID!=0);
assert(sinkData.sinkClassID!=0);
// \todo: need to check if class exists?
assert(!sinkData.listConnectionFormats.empty());
- assert(sinkData.muteState>=MS_MUTED && sinkData.muteState<=MS_UNMUTED);
+ assert(sinkData.muteState>=MS_MIN && sinkData.muteState<=MS_MAX);
sqlite3_stmt *query = NULL, *queryFinal = NULL;
int eCode = 0;
//now we need to create the additional tables:
command = "CREATE TABLE SinkConnectionFormat" + i2s(sinkID) + std::string("(soundFormat INTEGER)");
assert(this->sqQuery(command));
- command = "CREATE TABLE SinkMainSoundProperty" + i2s(sinkID) + std::string("(soundPropertyType INTEGER, value INTEGER)");
- assert(this->sqQuery(command));
command = "CREATE TABLE SinkSoundProperty" + i2s(sinkID) + std::string("(soundPropertyType INTEGER, value INTEGER)");
assert(this->sqQuery(command));
sqlite3_reset(query);
}
- //Fill MainSinkSoundProperties
- command = "INSERT INTO SinkMainSoundProperty" + i2s(sinkID) + std::string("(soundPropertyType,value) VALUES (?,?)");
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
- std::vector<am_MainSoundProperty_s>::const_iterator mainSoundPropertyIterator = sinkData.listMainSoundProperties.begin();
- for (; mainSoundPropertyIterator < sinkData.listMainSoundProperties.end(); ++mainSoundPropertyIterator)
- {
- sqlite3_bind_int(query, 1, mainSoundPropertyIterator->type);
- sqlite3_bind_int(query, 2, mainSoundPropertyIterator->value);
- if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
- {
- logError("DatabaseHandler::enterSinkDB SQLITE Step error code:", eCode);
- sqlite3_finalize(query);
- return E_DATABASE_ERROR;
- }
- sqlite3_reset(query);
- }
-
//Fill SinkSoundProperties
command = "INSERT INTO SinkSoundProperty" + i2s(sinkID) + std::string("(soundPropertyType,value) VALUES (?,?)");
sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
sqlite3_reset(query);
}
+ if (sinkData.visible == true)
+ {
+ command = "CREATE TABLE SinkMainSoundProperty" + i2s(sinkID) + std::string("(soundPropertyType INTEGER, value INTEGER)");
+ assert(this->sqQuery(command));
+
+ //Fill MainSinkSoundProperties
+ command = "INSERT INTO SinkMainSoundProperty" + i2s(sinkID) + std::string("(soundPropertyType,value) VALUES (?,?)");
+ sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ std::vector<am_MainSoundProperty_s>::const_iterator mainSoundPropertyIterator = sinkData.listMainSoundProperties.begin();
+ for (; mainSoundPropertyIterator < sinkData.listMainSoundProperties.end(); ++mainSoundPropertyIterator)
+ {
+ sqlite3_bind_int(query, 1, mainSoundPropertyIterator->type);
+ sqlite3_bind_int(query, 2, mainSoundPropertyIterator->value);
+ if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
+ {
+ logError("DatabaseHandler::enterSinkDB SQLITE Step error code:", eCode);
+ sqlite3_finalize(query);
+ return E_DATABASE_ERROR;
+ }
+ sqlite3_reset(query);
+ }
+ }
+
logInfo("DatabaseHandler::enterSinkDB entered new sink with name", sinkData.name, "domainID:", sinkData.domainID, "classID:", sinkData.sinkClassID, "volume:", sinkData.volume, "assigned ID:", sinkID);
am_Sink_s sink = sinkData;
sink.sinkID = sinkID;
//if sinkID is zero and the first Static Sink was already entered, the ID is created
if (gatewayData.gatewayID == 0 && !mFirstStaticGateway)
{
- command = "INSERT INTO " + std::string(GATEWAY_TABLE) + "(name, sinkID, sourceID, domainSinkID, domainSourceID, controlDomainID, inUse) VALUES (?,?,?,?,?,?,0)";
+ command = "INSERT INTO " + std::string(GATEWAY_TABLE) + "(name, sinkID, sourceID, domainSinkID, domainSourceID, controlDomainID) VALUES (?,?,?,?,?,?)";
}
else
{
//check if the ID already exists
if (existGateway(gatewayData.gatewayID))
return E_ALREADY_EXISTS;
- command = "INSERT INTO " + std::string(GATEWAY_TABLE) + "(name, sinkID, sourceID, domainSinkID, domainSourceID, controlDomainID, gatewayID, inUse) VALUES (?,?,?,?,?,?,?,0)";
+ command = "INSERT INTO " + std::string(GATEWAY_TABLE) + "(name, sinkID, sourceID, domainSinkID, domainSourceID, controlDomainID, gatewayID) VALUES (?,?,?,?,?,?,?)";
}
sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
assert(sourceData.sourceClassID!=0);
// \todo: need to check if class exists?
assert(!sourceData.listConnectionFormats.empty());
- assert(sourceData.sourceState>=SS_ON && sourceData.sourceState<=SS_PAUSED);
+ assert(sourceData.sourceState>=SS_MIN && sourceData.sourceState<=SS_MAX);
sqlite3_stmt* query = NULL, *queryFinal = NULL;
;
//now we need to create the additional tables:
command = "CREATE TABLE SourceConnectionFormat" + i2s(sourceID) + std::string("(soundFormat INTEGER)");
assert(this->sqQuery(command));
- command = "CREATE TABLE SourceMainSoundProperty" + i2s(sourceID) + std::string("(soundPropertyType INTEGER, value INTEGER)");
- assert(this->sqQuery(command));
command = "CREATE TABLE SourceSoundProperty" + i2s(sourceID) + std::string("(soundPropertyType INTEGER, value INTEGER)");
assert(this->sqQuery(command));
sqlite3_reset(query);
}
- //Fill MainSinkSoundProperties
- command = "INSERT INTO SourceMainSoundProperty" + i2s(sourceID) + std::string("(soundPropertyType,value) VALUES (?,?)");
- sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
- std::vector<am_MainSoundProperty_s>::const_iterator mainSoundPropertyIterator = sourceData.listMainSoundProperties.begin();
- for (; mainSoundPropertyIterator < sourceData.listMainSoundProperties.end(); ++mainSoundPropertyIterator)
- {
- sqlite3_bind_int(query, 1, mainSoundPropertyIterator->type);
- sqlite3_bind_int(query, 2, mainSoundPropertyIterator->value);
- if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
- {
- logError("DatabaseHandler::enterSourceDB SQLITE Step error code:", eCode);
- sqlite3_finalize(query);
- return E_DATABASE_ERROR;
- }
- sqlite3_reset(query);
- }
-
//Fill SinkSoundProperties
command = "INSERT INTO SourceSoundProperty" + i2s(sourceID) + std::string("(soundPropertyType,value) VALUES (?,?)");
sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
sqlite3_reset(query);
}
+ if (sourceData.visible == true)
+ {
+ command = "CREATE TABLE SourceMainSoundProperty" + i2s(sourceID) + std::string("(soundPropertyType INTEGER, value INTEGER)");
+ assert(this->sqQuery(command));
+
+ //Fill MainSinkSoundProperties
+ command = "INSERT INTO SourceMainSoundProperty" + i2s(sourceID) + std::string("(soundPropertyType,value) VALUES (?,?)");
+ sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ std::vector<am_MainSoundProperty_s>::const_iterator mainSoundPropertyIterator = sourceData.listMainSoundProperties.begin();
+ for (; mainSoundPropertyIterator < sourceData.listMainSoundProperties.end(); ++mainSoundPropertyIterator)
+ {
+ sqlite3_bind_int(query, 1, mainSoundPropertyIterator->type);
+ sqlite3_bind_int(query, 2, mainSoundPropertyIterator->value);
+ if ((eCode = sqlite3_step(query)) != SQLITE_DONE)
+ {
+ logError("DatabaseHandler::enterSourceDB SQLITE Step error code:", eCode);
+ sqlite3_finalize(query);
+ return E_DATABASE_ERROR;
+ }
+ sqlite3_reset(query);
+ }
+ }
+
logInfo("DatabaseHandler::enterSinkDB entered new source with name", sourceData.name, "domainID:", sourceData.domainID, "classID:", sourceData.sourceClassID, "visible:", sourceData.visible, "assigned ID:", sourceID);
am_Source_s source = sourceData;
am_Error_e DatabaseHandler::changeMainConnectionStateDB(const am_mainConnectionID_t mainconnectionID, const am_ConnectionState_e connectionState)
{
assert(mainconnectionID!=0);
+ assert(connectionState>=CS_MIN && connectionState<=CS_MAX);
sqlite3_stmt* query = NULL;
int eCode = 0;
am_Error_e DatabaseHandler::changeSinkAvailabilityDB(const am_Availability_s & availability, const am_sinkID_t sinkID)
{
assert(sinkID!=0);
+ assert(availability.availability>=A_MIN && availability.availability<=A_MAX);
+ assert(availability.availabilityReason>=AR_MIN && availability.availabilityReason<=AR_MAX);
sqlite3_stmt* query = NULL;
int eCode = 0;
am_Error_e DatabaseHandler::changDomainStateDB(const am_DomainState_e domainState, const am_domainID_t domainID)
{
assert(domainID!=0);
+ assert(domainState>=DS_MIN && domainState<=DS_MAX);
sqlite3_stmt* query = NULL;
int eCode = 0;
am_Error_e DatabaseHandler::changeSinkMuteStateDB(const am_MuteState_e muteState, const am_sinkID_t sinkID)
{
assert(sinkID!=0);
+ assert(muteState>=MS_MIN && muteState<=MS_MAX);
sqlite3_stmt* query = NULL;
int eCode = 0;
am_Error_e DatabaseHandler::changeMainSinkSoundPropertyDB(const am_MainSoundProperty_s & soundProperty, const am_sinkID_t sinkID)
{
- //todo: add checks if soundproperty exists!
+ assert(soundProperty.type>=MSP_MIN && soundProperty.type<=MSP_MAX);
assert(sinkID!=0);
sqlite3_stmt* query = NULL;
am_Error_e DatabaseHandler::changeMainSourceSoundPropertyDB(const am_MainSoundProperty_s & soundProperty, const am_sourceID_t sourceID)
{
- //todo: add checks if soundproperty exists!
+ assert(soundProperty.type>=MSP_MIN && soundProperty.type<=MSP_MAX);
assert(sourceID!=0);
sqlite3_stmt* query = NULL;
am_Error_e DatabaseHandler::changeSourceAvailabilityDB(const am_Availability_s & availability, const am_sourceID_t sourceID)
{
assert(sourceID!=0);
+ assert(availability.availability>=A_MIN && availability.availability<=A_MAX);
+ assert(availability.availabilityReason>=AR_MIN && availability.availabilityReason<=AR_MAX);
sqlite3_stmt* query = NULL;
int eCode = 0;
am_Error_e DatabaseHandler::changeSystemPropertyDB(const am_SystemProperty_s & property)
{
+ assert(property.type>=SYP_MIN && property.type<=SYP_MAX);
sqlite3_stmt* query = NULL;
int eCode = 0;
std::string command = "UPDATE " + std::string(SYSTEM_TABLE) + " set value=? WHERE type=?";
temp.delay = sqlite3_column_int(query, 4);
std::string statement = command1 + i2s(temp.connectionID);
sqlite3_prepare_v2(mDatabase, statement.c_str(), -1, &query1, NULL);
- while ((eCode = sqlite3_step(query1)) == SQLITE_ROW) //todo: check results of eCode1, eCode2
+ while ((eCode = sqlite3_step(query1)) == SQLITE_ROW)
{
int k = sqlite3_column_int(query1, 0);
sqlite3_bind_int(query2, 1, k);
am_Error_e DatabaseHandler::enterSystemProperties(const std::vector<am_SystemProperty_s> & listSystemProperties)
{
+ assert(!listSystemProperties.empty());
sqlite3_stmt* query = NULL;
int eCode = 0;
std::vector<am_SystemProperty_s>::const_iterator listIterator = listSystemProperties.begin();
am_Error_e DatabaseHandler::changeSourceState(const am_sourceID_t sourceID, const am_SourceState_e sourceState)
{
assert(sourceID!=0);
+ assert(sourceState>=SS_MIN && sourceState<=SS_MAX);
sqlite3_stmt* query = NULL;
std::string command = "UPDATE " + std::string(SOURCE_TABLE) + " SET sourceState=? WHERE sourceID=" + i2s(sourceID);
int eCode = 0;
am_Error_e DatabaseHandler::changeSourceSoundPropertyDB(const am_SoundProperty_s & soundProperty, const am_sourceID_t sourceID)
{
- //todo: add checks if soundproperty exists!
+ assert(soundProperty.type>=SP_MIN && soundProperty.type<=SP_MAX);
assert(sourceID!=0);
sqlite3_stmt* query = NULL;
am_Error_e DatabaseHandler::changeSinkSoundPropertyDB(const am_SoundProperty_s & soundProperty, const am_sinkID_t sinkID)
{
- //todo: add checks if soundproperty exists!
+ assert(soundProperty.type>=SP_MIN && soundProperty.type<=SP_MAX);
assert(sinkID!=0);
sqlite3_stmt* query = NULL;
am_Error_e DatabaseHandler::changeCrossFaderHotSink(const am_crossfaderID_t crossfaderID, const am_HotSink_e hotsink)
{
assert(crossfaderID!=0);
+ assert(hotsink>=HS_MIN && hotsink>=HS_MAX);
sqlite3_stmt* query = NULL;
int eCode = 0;
am_domainID_t rootID = tree.returnRootDomainID();
RoutingTreeItem *parent = tree.returnRootItem();
- command = "SELECT domainSourceID,gatewayID FROM " + std::string(GATEWAY_TABLE) + " WHERE domainSinkID=? AND inUse=?";
+ if (onlyfree)
+ {
+ command = "SELECT g.domainSourceID,g.gatewayID FROM " + std::string(GATEWAY_TABLE) + " g WHERE domainSinkID=? AND NOT EXISTS (SELECT NULL FROM " + std::string(CONNECTION_TABLE) + " c WHERE c.sinkID = g.sinkID OR c.sourceID = g.sourceID )";
+ }
+ else
+ {
+ command = "SELECT domainSourceID,gatewayID FROM " + std::string(GATEWAY_TABLE) + " WHERE domainSinkID=?";
+ }
do
{
}
sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
sqlite3_bind_int(query, 1, rootID);
- sqlite3_bind_int(query, 2, onlyfree);
while ((eCode = sqlite3_step(query)) == SQLITE_ROW)
{
return (E_OK);
}
+am_Error_e am::DatabaseHandler::peekSinkClassID(const std::string & name, am_sinkClass_t & sinkClassID)
+{
+ if (name.empty())
+ return E_NON_EXISTENT;
+
+ am_Error_e returnVal = E_NON_EXISTENT;
+ sqlite3_stmt* query = NULL;
+ int eCode = 0;
+ std::string command = "SELECT sinkClassID FROM " + std::string(SINK_CLASS_TABLE) + " WHERE name=?";
+ sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_bind_text(query, 1, name.c_str(), name.size(), SQLITE_STATIC);
+
+ if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
+ {
+ sinkClassID = sqlite3_column_int(query, 0);
+ returnVal = E_OK;
+ }
+ else if (eCode != SQLITE_DONE)
+ {
+ sinkClassID = 0;
+ logError("DatabaseHandler::peekSinkClassID SQLITE error code:", eCode);
+ returnVal = E_DATABASE_ERROR;
+ }
+
+ if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
+ {
+ logError("DatabaseHandler::peekSinkClassID SQLITE Finalize error code:", eCode);
+ returnVal = E_DATABASE_ERROR;
+ }
+ return returnVal;
+}
+
+am_Error_e am::DatabaseHandler::peekSourceClassID(const std::string & name, am_sourceClass_t & sourceClassID)
+{
+ if (name.empty())
+ return E_NON_EXISTENT;
+
+ am_Error_e returnVal = E_NON_EXISTENT;
+ sqlite3_stmt* query = NULL;
+ int eCode = 0;
+ std::string command = "SELECT sourceClassID FROM " + std::string(SOURCE_CLASS_TABLE) + " WHERE name=?";
+ sqlite3_prepare_v2(mDatabase, command.c_str(), -1, &query, NULL);
+ sqlite3_bind_text(query, 1, name.c_str(), name.size(), SQLITE_STATIC);
+
+ if ((eCode = sqlite3_step(query)) == SQLITE_ROW)
+ {
+ sourceClassID = sqlite3_column_int(query, 0);
+ returnVal = E_OK;
+ }
+ else if (eCode != SQLITE_DONE)
+ {
+ sourceClassID = 0;
+ logError("DatabaseHandler::peekSourceClassID SQLITE error code:", eCode);
+ returnVal = E_DATABASE_ERROR;
+ }
+
+ if ((eCode = sqlite3_finalize(query)) != SQLITE_OK)
+ {
+ logError("DatabaseHandler::peekSourceClassID SQLITE Finalize error code:", eCode);
+ returnVal = E_DATABASE_ERROR;
+ }
+ return returnVal;
+}
+
void DatabaseHandler::createTables()
{
for (uint16_t i = 0; i < sizeof(databaseTables) / sizeof(databaseTables[0]); i++)
#include "CommandSender.h"
#include "RoutingSender.h"
#include "TelnetServer.h"
-#include <assert.h>
+#include <cassert>
using namespace am;
DatabaseObserver::~DatabaseObserver()
{
- // TODO Auto-generated destructor stub
}
void DatabaseObserver::newSink(am_Sink_s sink)
#include "Router.h"
#include "DatabaseHandler.h"
#include "ControlSender.h"
-#include <assert.h>
+#include <cassert>
#include <algorithm>
#include <vector>
#include <iterator>
#include "DatabaseHandler.h"
#include "RoutingSender.h"
#include "ControlSender.h"
-#include <assert.h>
+#include <cassert>
using namespace am;
mDatabaseHandler->changeConnectionTimingInformation(connectionID, delay);
}
-am_Error_e RoutingReceiver::sendChangedData(const std::vector<am_EarlyData_s> & earlyData)
+void RoutingReceiver::sendChangedData(const std::vector<am_EarlyData_s> & earlyData)
{
mControlSender->hookSystemReceiveEarlyData(earlyData);
- return E_OK;
-//todo: change return type to void in EA model
}
-am_Error_e RoutingReceiver::peekSinkClassID(const std::string& name, const am_sinkClass_t& sinkClassID)
+am_Error_e RoutingReceiver::peekSinkClassID(const std::string& name, am_sinkClass_t& sinkClassID)
{
- (void) name;
- (void) sinkClassID;
-//todo: implement
- return E_NOT_USED;
+ return mDatabaseHandler->peekSinkClassID(name,sinkClassID);
}
-am_Error_e RoutingReceiver::peekSourceClassID(const std::string& name, const am_sourceClass_t& sourceClassID)
+am_Error_e RoutingReceiver::peekSourceClassID(const std::string& name, am_sourceClass_t& sourceClassID)
{
- (void) name;
- (void) sourceClassID;
-//todo: implement
- return E_NOT_USED;
+ return mDatabaseHandler->peekSourceClassID(name,sourceClassID);
}
am_Error_e RoutingReceiver::getDBusConnectionWrapper(DBusWrapper *& dbusConnectionWrapper) const
#include <utility>
#include <dirent.h>
#include <dlfcn.h>
-#include <assert.h>
+#include <cassert>
#include "PluginTemplate.h"
#include "DLTWrapper.h"
#include "SocketHandler.h"
#include <config.h>
-#include <assert.h>
+#include <cassert>
#include <sys/fcntl.h>
#include <sys/errno.h>
#include <sys/poll.h>
#include <algorithm>
#include <time.h>
#include <features.h>
-#include <signal.h>
+#include <csignal>
#include "DLTWrapper.h"
//todo: implement time correction if timer was interrupted by call
{
//todo: here could be a timer that makes sure naughty plugins return!
+ //freeze mListPoll by copying it - otherwise we get problems when we want to manipulate it during the next lines
+ mListPoll_t listPoll(mListPoll);
+
//get all indexes of the fired events and save them int hitList
hitList.clear();
std::vector<pollfd>::iterator it = mfdPollingArray.begin();
for (; hListIt != hitList.end(); ++hListIt)
{
shPollFired* fire = NULL;
- if ((fire = mListPoll.at(*hListIt).firedCB) != NULL) fire->Call(mfdPollingArray.at(*hListIt), mListPoll.at(*hListIt).handle, mListPoll.at(*hListIt).userData);
+ if ((fire = listPoll.at(*hListIt).firedCB) != NULL) fire->Call(mfdPollingArray.at(*hListIt), listPoll.at(*hListIt).handle, listPoll.at(*hListIt).userData);
}
//stage 2, lets ask around if some dispatching is necessary, if not, they are taken from the hitlist
for (; hListIt != hitList.end(); ++hListIt)
{
shPollCheck* check = NULL;
- if ((check = mListPoll.at(*hListIt).checkCB) != NULL)
+ if ((check = listPoll.at(*hListIt).checkCB) != NULL)
{
- if (!check->Call(mListPoll.at(*hListIt).handle, mListPoll.at(*hListIt).userData))
+ if (!check->Call(listPoll.at(*hListIt).handle, listPoll.at(*hListIt).userData))
{
hListIt = hitList.erase(hListIt);
}
for (; hListIt != hitList.end(); ++hListIt)
{
shPollDispatch *dispatch = NULL;
- if ((dispatch = mListPoll.at(*hListIt).dispatchCB) != NULL)
+ if ((dispatch = listPoll.at(*hListIt).dispatchCB) != NULL)
{
- if (!dispatch->Call(mListPoll.at(*hListIt).handle, mListPoll.at(*hListIt).userData))
+ if (!dispatch->Call(listPoll.at(*hListIt).handle, listPoll.at(*hListIt).userData))
{
hListIt = hitList.erase(hListIt);
}
*/
#include "TelnetServer.h"
-#include <assert.h>
+#include <cassert>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <sys/ioctl.h>
* Please make sure to have read the documentation on genivi.org!
*/
-//todo: make real daemon out of it- systemd conform
-//todo: versioning of PluginInterfaces on linux level (.symver stuff)
+//todo: create systemd compatibility
//todo: all communication like all plugins loaded etc...
//todo: seperate documentation of test from normal project
//todo: check the startup sequence. Dbus shall be activated last...
//todo: there is a bug in the visible flags of sinks and sources. fix it.
-//todo: make sure that iterators have a fixed end to prevent crashed while adding vectors while iterating on critical vectors
//todo: make sure all configurations are tested
//todo: clean up startup sequences controller, command and routing interfaces----
#include <config.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <unistd.h>
-#include <stdlib.h>
#include <cstdlib>
-#include <assert.h>
+#include <cstdlib>
+#include <cassert>
#include <fcntl.h>
-#include <signal.h>
-#include <string.h>
-#include <stdio.h>
+#include <csignal>
+#include <cstring>
+#include <cstdio>
DLT_DECLARE_CONTEXT(AudioManager)
#include "CommandInterfaceBackdoor.h"
#include "RoutingInterfaceBackdoor.h"
#include "ControlInterfaceBackdoor.h"
-#include <assert.h>
+#include <cassert>
#include <sstream>
using namespace am;
assert(CommandSender != NULL);
assert(CommandSendInterface != NULL);
CommandSender->mListInterfaces.push_back(CommandSendInterface);
- return true; //todo: check if it worked
+ return true;
}
RoutingInterfaceBackdoor::RoutingInterfaceBackdoor()
newInterfacePair.routingInterface = newInterface;
newInterfacePair.busName = busname;
RoutingSender->mListInterfaces.push_back(newInterfacePair);
- return true; //todo: check if it worked
+ return true;
}
ControlInterfaceBackdoor::ControlInterfaceBackdoor()
void routingTest::SetUp()
{
- logInfo("Database Test started ");
}
void routingTest::TearDown()
{
}
+TEST_F(routingTest, peekSourceID)
+{
+ EXPECT_CALL(pMockInterface,cbNumberOfSourceClassesChanged()).Times(1);
+ std::string sourceName("myClassID");
+ am_sourceClass_t sourceClassID, peekID;
+ am_SourceClass_s sourceClass;
+ am_ClassProperty_s classProperty;
+ classProperty.classProperty = CP_SOURCE_TYPE;
+ classProperty.value = 13;
+ sourceClass.name = sourceName;
+ sourceClass.sourceClassID = 0;
+ sourceClass.listClassProperties.push_back(classProperty);
+
+ //first we peek without an existing class
+ ASSERT_EQ(E_NON_EXISTENT, pDatabaseHandler.peekSourceClassID(sourceName,sourceClassID));
+
+ //now we enter the class into the database
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceClassDB(sourceClassID,sourceClass));
+
+ //first we peek without an existing class
+ ASSERT_EQ(E_OK, pDatabaseHandler.peekSourceClassID(sourceName,peekID));
+ ASSERT_EQ(sourceClassID, peekID);
+}
+
+TEST_F(routingTest, peekSinkID)
+{
+ EXPECT_CALL(pMockInterface,cbNumberOfSinkClassesChanged()).Times(1);
+ std::string sinkName("myClassID");
+ am_sinkClass_t sinkClassID, peekID;
+ am_SinkClass_s sinkClass;
+ am_ClassProperty_s classProperty;
+ classProperty.classProperty = CP_SOURCE_TYPE;
+ classProperty.value = 13;
+ sinkClass.name = sinkName;
+ sinkClass.sinkClassID = 0;
+ sinkClass.listClassProperties.push_back(classProperty);
+
+ //first we peek without an existing class
+ ASSERT_EQ(E_NON_EXISTENT, pDatabaseHandler.peekSinkClassID(sinkName,sinkClassID));
+
+ //now we enter the class into the database
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkClassDB(sinkClass,sinkClassID));
+
+ //first we peek without an existing class
+ ASSERT_EQ(E_OK, pDatabaseHandler.peekSinkClassID(sinkName,peekID));
+ ASSERT_EQ(sinkClassID, peekID);
+}
+
TEST_F(routingTest,crossfaders)
{
//todo:implement crossfader tests
int main(int argc, char **argv)
{
+ DLTWrapper::instance()->registerApp("databse", "databasetest");
+ logInfo("Database Test started ");
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
arg3=arg2;
}
+//test that checks just 2 domains, one sink one source with only one connection format each
+TEST_F(routingTest,simpleRoute2DomainsOnlyFree)
+{
+ EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(2);
+ EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(2);
+ EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK)));
+
+ //initialize 2 domains
+ am_Domain_s domain1, domain2;
+ am_domainID_t domainID1, domainID2;
+
+ domain1.domainID = 0;
+ domain1.name = "domain1";
+ domain1.busname = "domain1bus";
+ domain1.state = DS_CONTROLLED;
+ domain2.domainID = 0;
+ domain2.name = "domain2";
+ domain2.busname = "domain2bus";
+ domain2.state = DS_CONTROLLED;
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain1,domainID1));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain2,domainID2));
+
+ am_Source_s source, gwSource;
+ am_sourceID_t sourceID, gwSourceID;
+
+ source.domainID = domainID1;
+ source.name = "source1";
+ source.sourceState = SS_ON;
+ source.sourceID = 0;
+ source.sourceClassID = 5;
+ source.listConnectionFormats.push_back(CF_ANALOG);
+
+ gwSource.domainID = domainID2;
+ gwSource.name = "gwsource1";
+ gwSource.sourceState = SS_ON;
+ gwSource.sourceID = 0;
+ gwSource.sourceClassID = 5;
+ gwSource.listConnectionFormats.push_back(CF_MONO);
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource,gwSourceID));
+
+ am_Sink_s sink, gwSink;
+ am_sinkID_t sinkID, gwSinkID;
+
+ sink.domainID = domainID2;
+ sink.name = "sink1";
+ sink.sinkID = 0;
+ sink.sinkClassID = 5;
+ sink.muteState = MS_MUTED;
+ sink.listConnectionFormats.push_back(CF_MONO);
+
+ gwSink.domainID = domainID1;
+ gwSink.name = "gwSink";
+ gwSink.sinkID = 0;
+ gwSink.sinkClassID = 5;
+ gwSink.muteState = MS_MUTED;
+ gwSink.listConnectionFormats.push_back(CF_ANALOG);
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink,gwSinkID));
+
+ am_Gateway_s gateway;
+ am_gatewayID_t gatewayID;
+
+ gateway.controlDomainID = domainID1;
+ gateway.gatewayID = 0;
+ gateway.sinkID = gwSinkID;
+ gateway.sourceID = gwSourceID;
+ gateway.domainSourceID = domainID2;
+ gateway.domainSinkID = domainID1;
+ gateway.listSinkFormats = gwSink.listConnectionFormats;
+ gateway.listSourceFormats = gwSource.listConnectionFormats;
+ gateway.convertionMatrix.push_back(true);
+ gateway.name = "gateway";
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterGatewayDB(gateway,gatewayID));
+
+ std::vector<am_Route_s> listRoutes;
+ std::vector<am_RoutingElement_s> listRoutingElements;
+ am_RoutingElement_s hopp1;
+ am_RoutingElement_s hopp2;
+
+ hopp1.sinkID = gwSinkID;
+ hopp1.sourceID = sourceID;
+ hopp1.domainID = domainID1;
+ hopp1.connectionFormat = source.listConnectionFormats[0];
+
+ hopp2.sinkID = sinkID;
+ hopp2.sourceID = gwSourceID;
+ hopp2.domainID = domainID2;
+ hopp2.connectionFormat = sink.listConnectionFormats[0];
+
+ listRoutingElements.push_back(hopp1);
+ listRoutingElements.push_back(hopp2);
+
+ am_Route_s compareRoute;
+ compareRoute.route = listRoutingElements;
+ compareRoute.sinkID = sinkID;
+ compareRoute.sourceID = sourceID;
+
+ ASSERT_EQ(E_OK, pRouter.getRoute(true,sourceID,sinkID,listRoutes));
+ ASSERT_EQ(1, listRoutes.size());
+ ASSERT_TRUE(pCF.compareRoute(compareRoute,listRoutes[0]));
+
+}
+
+//test that checks just 2 domains, one sink one source with only one connection format each
+TEST_F(routingTest,simpleRoute2DomainsOnlyFreeNotFree)
+{
+ EXPECT_CALL(pMockInterface,cbNumberOfSourcesChanged()).Times(2);
+ EXPECT_CALL(pMockInterface,cbNumberOfSinksChanged()).Times(2);
+ EXPECT_CALL(pMockControlInterface,getConnectionFormatChoice(_,_,_,_)).WillRepeatedly(DoAll(returnConnectionFormat(), Return(E_OK)));
+
+ //initialize 2 domains
+ am_Domain_s domain1, domain2;
+ am_domainID_t domainID1, domainID2;
+
+ domain1.domainID = 0;
+ domain1.name = "domain1";
+ domain1.busname = "domain1bus";
+ domain1.state = DS_CONTROLLED;
+ domain2.domainID = 0;
+ domain2.name = "domain2";
+ domain2.busname = "domain2bus";
+ domain2.state = DS_CONTROLLED;
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain1,domainID1));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterDomainDB(domain2,domainID2));
+
+ am_Source_s source, gwSource;
+ am_sourceID_t sourceID, gwSourceID;
+
+ source.domainID = domainID1;
+ source.name = "source1";
+ source.sourceState = SS_ON;
+ source.sourceID = 0;
+ source.sourceClassID = 5;
+ source.listConnectionFormats.push_back(CF_ANALOG);
+
+ gwSource.domainID = domainID2;
+ gwSource.name = "gwsource1";
+ gwSource.sourceState = SS_ON;
+ gwSource.sourceID = 0;
+ gwSource.sourceClassID = 5;
+ gwSource.listConnectionFormats.push_back(CF_MONO);
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(source,sourceID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSourceDB(gwSource,gwSourceID));
+
+ am_Sink_s sink, gwSink;
+ am_sinkID_t sinkID, gwSinkID;
+
+ sink.domainID = domainID2;
+ sink.name = "sink1";
+ sink.sinkID = 0;
+ sink.sinkClassID = 5;
+ sink.muteState = MS_MUTED;
+ sink.listConnectionFormats.push_back(CF_MONO);
+
+ gwSink.domainID = domainID1;
+ gwSink.name = "gwSink";
+ gwSink.sinkID = 0;
+ gwSink.sinkClassID = 5;
+ gwSink.muteState = MS_MUTED;
+ gwSink.listConnectionFormats.push_back(CF_ANALOG);
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(sink,sinkID));
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterSinkDB(gwSink,gwSinkID));
+
+ am_Gateway_s gateway;
+ am_gatewayID_t gatewayID;
+
+ gateway.controlDomainID = domainID1;
+ gateway.gatewayID = 0;
+ gateway.sinkID = gwSinkID;
+ gateway.sourceID = gwSourceID;
+ gateway.domainSourceID = domainID2;
+ gateway.domainSinkID = domainID1;
+ gateway.listSinkFormats = gwSink.listConnectionFormats;
+ gateway.listSourceFormats = gwSource.listConnectionFormats;
+ gateway.convertionMatrix.push_back(true);
+ gateway.name = "gateway";
+
+ ASSERT_EQ(E_OK, pDatabaseHandler.enterGatewayDB(gateway,gatewayID));
+
+ std::vector<am_Route_s> listRoutes;
+ std::vector<am_RoutingElement_s> listRoutingElements;
+ am_RoutingElement_s hopp1;
+ am_RoutingElement_s hopp2;
+
+ hopp1.sinkID = gwSinkID;
+ hopp1.sourceID = sourceID;
+ hopp1.domainID = domainID1;
+ hopp1.connectionFormat = source.listConnectionFormats[0];
+
+ hopp2.sinkID = sinkID;
+ hopp2.sourceID = gwSourceID;
+ hopp2.domainID = domainID2;
+ hopp2.connectionFormat = sink.listConnectionFormats[0];
+
+ listRoutingElements.push_back(hopp1);
+ listRoutingElements.push_back(hopp2);
+
+ am_Route_s compareRoute;
+ compareRoute.route = listRoutingElements;
+ compareRoute.sinkID = sinkID;
+ compareRoute.sourceID = sourceID;
+
+ am_Connection_s connection,connection1;
+ am_connectionID_t id1,id2;
+ connection.sourceID=sourceID;
+ connection.sinkID=gwSinkID;
+ connection.connectionFormat=CF_ANALOG;
+ connection.connectionID=0;
+ connection1.sourceID=gwSourceID;
+ connection1.sinkID=sinkID;
+ connection1.connectionFormat=CF_ANALOG;
+ connection1.connectionID=0;
+
+ ASSERT_EQ(E_OK,pDatabaseHandler.enterConnectionDB(connection,id1));
+ ASSERT_EQ(E_OK,pDatabaseHandler.enterConnectionDB(connection1,id2));
+
+ ASSERT_EQ(E_OK, pRouter.getRoute(true,sourceID,sinkID,listRoutes));
+ ASSERT_EQ(0, listRoutes.size());
+
+ ASSERT_EQ(E_OK, pRouter.getRoute(false,sourceID,sinkID,listRoutes));
+ ASSERT_EQ(1, listRoutes.size());
+ ASSERT_TRUE(pCF.compareRoute(compareRoute,listRoutes[0]));
+}
+
//test that checks 3 domains, one sink one source, longer lists of connectionformats.
TEST_F(routingTest,simpleRoute3DomainsListConnectionFormats_2)
{
int main(int argc, char **argv)
{
+ DLTWrapper::instance()->registerApp("routing", "routingtest");
+ logInfo("Routing Test started ");
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
#include <fcntl.h>
#include <sys/un.h>
+//todo: expand test, implement more usecases
+//todo: test removeFD
+
#define SOCK_PATH "/tmp/mysock"
using namespace testing;
#include <audiomanagertypes.h>
#include <string>
#include <fstream>
-#include <assert.h>
+#include <cassert>
#include "CommandReceiverShadow.h"
#include "DBusCommandSender.h"
#include "DLTWrapper.h"
#include <algorithm>
#include <string>
#include <vector>
-#include <assert.h>
+#include <cassert>
#include <set>
DLT_DECLARE_CONTEXT(commandDbus)
#include "DBusCommandSender.h"
#include "DLTWrapper.h"
#include <stdlib.h>
-#include <assert.h>
+#include <cassert>
#include <vector>
DLT_IMPORT_CONTEXT(commandDbus)
*/
#include "RoutingReceiverAsyncShadow.h"
-#include <assert.h>
+#include <cassert>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <string.h>
#include <poll.h>
#include <errno.h>
#include <time.h>
-#include <assert.h>
+#include <cassert>
#include <sstream>
#include <string>
#include <dbus/dbus.h>
MOCK_METHOD1(deregisterCrossfader,
am_Error_e(const am_crossfaderID_t crossfaderID));
MOCK_METHOD2(peekSourceClassID,
- am_Error_e(const std::string& name, const am_sourceClass_t& sourceClassID));
+ am_Error_e(const std::string& name, am_sourceClass_t& sourceClassID));
MOCK_METHOD2(peekSinkClassID,
- am_Error_e(const std::string& name, const am_sinkClass_t& sinkClassID));
+ am_Error_e(const std::string& name, am_sinkClass_t& sinkClassID));
MOCK_METHOD2(hookInterruptStatusChange,
void(const am_sourceID_t sourceID, const am_InterruptState_e interruptState));
MOCK_METHOD1(hookDomainRegistrationComplete,
MOCK_METHOD2(hookTimingInformationChanged,
void(const am_connectionID_t connectionID, const am_timeSync_t delay));
MOCK_METHOD1(sendChangedData,
- am_Error_e(const std::vector<am_EarlyData_s>& earlyData));
+ void(const std::vector<am_EarlyData_s>& earlyData));
MOCK_CONST_METHOD1(getDBusConnectionWrapper,
am_Error_e(DBusWrapper*& dbusConnectionWrapper));
MOCK_CONST_METHOD1(getSocketHandler,
*\r
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN\r
*/\r
-#if !defined(EA_6B5234F4_E3F3_46f3_9B2A_892FD2A0236E__INCLUDED_)\r
-#define EA_6B5234F4_E3F3_46f3_9B2A_892FD2A0236E__INCLUDED_\r
+#if !defined(EA_21C9D5F3_73BF_4121_9A14_1D76799A05A0__INCLUDED_)\r
+#define EA_21C9D5F3_73BF_4121_9A14_1D76799A05A0__INCLUDED_\r
\r
#include <vector>\r
#include <string>\r
* Routing Receive sendInterface description. This class implements everything from RoutingAdapter -> Audiomanager
* @author christian
* @version 1.0
- * @created 30-Jan-2012 6:29:29 PM
+ * @created 01-Feb-2012 9:42:02 AM
*/
class RoutingReceiveInterface
{
virtual am_Error_e deregisterCrossfader(const am_crossfaderID_t crossfaderID) =0;
/**
* this function peeks a sourceclassID. It is used by the RoutingPlugins to determine the SinkClassIDs of a sinkClass.\r
- * @return E_OK on succes, E_DATABASE_ERROR on error
+ * @return E_OK on succes, E_DATABASE_ERROR on error, E_NON_EXISTENT if no sourceclass with name is registered
*
* @param name
* @param sourceClassID
*/
- virtual am_Error_e peekSourceClassID(const std::string& name, const am_sourceClass_t& sourceClassID) =0;
+ virtual am_Error_e peekSourceClassID(const std::string& name, am_sourceClass_t& sourceClassID) =0;
/**
* this function peeks a sourceclassID. It is used by the RoutingPlugins to determine the SinkClassIDs of a sinkClass.\r
- * @return E_OK on succes, E_DATABASE_ERROR on error
+ * @return E_OK on succes, E_DATABASE_ERROR on error, E_NON_EXISTENT if no sourceclass with name is registered
*
* @param name
* @param sinkClassID
*/
- virtual am_Error_e peekSinkClassID(const std::string& name, const am_sinkClass_t& sinkClassID) =0;
+ virtual am_Error_e peekSinkClassID(const std::string& name, am_sinkClass_t& sinkClassID) =0;
/**
* is called when a low level interrupt changes it status.
*
*/
virtual void hookTimingInformationChanged(const am_connectionID_t connectionID, const am_timeSync_t delay) =0;
/**
- * this function is used to send out all data that has been changed in an early state.\r
- * @return E_OK on success, E_UNKNOWN on error
+ * this function is used to send out all data that has been changed in an early state.
*
* @param earlyData
*/
- virtual am_Error_e sendChangedData(const std::vector<am_EarlyData_s>& earlyData) =0;
+ virtual void sendChangedData(const std::vector<am_EarlyData_s>& earlyData) =0;
/**
* this function is used to retrieve a pointer to the dBusConnectionWrapper\r
* @return E_OK if pointer is valid, E_UKNOWN if AudioManager was compiled without DBus Support
};
}
-#endif // !defined(EA_6B5234F4_E3F3_46f3_9B2A_892FD2A0236E__INCLUDED_)
+#endif // !defined(EA_21C9D5F3_73BF_4121_9A14_1D76799A05A0__INCLUDED_)
*\r
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN\r
*/\r
-#if !defined(EA_E9CE2BB6_7523_49e4_9B57_31E776765683__INCLUDED_)\r
-#define EA_E9CE2BB6_7523_49e4_9B57_31E776765683__INCLUDED_\r
+#if !defined(EA_A00AD21A_AC6F_456e_B4DC_9C6AF4F44C3D__INCLUDED_)\r
+#define EA_A00AD21A_AC6F_456e_B4DC_9C6AF4F44C3D__INCLUDED_\r
\r
#include <vector>\r
#include <string>\r
* This class implements everything from Audiomanager -> RoutingAdapter
* @author christian
* @version 1.0
- * @created 26-Jan-2012 6:00:54 PM
+ * @created 01-Feb-2012 9:42:02 AM
*/
class RoutingSendInterface
{
};
}
-#endif // !defined(EA_E9CE2BB6_7523_49e4_9B57_31E776765683__INCLUDED_)
+#endif // !defined(EA_A00AD21A_AC6F_456e_B4DC_9C6AF4F44C3D__INCLUDED_)