Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions camerad/camera_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ namespace Camera {
/***** Camera::Server::Server ***********************************************/
/**
* @brief Server constructor
* @param[in] interface the interface this Server holds, created by the caller
*
*/
Server::Server() :
Server::Server(std::unique_ptr<Interface> interface) :
interface(std::move(interface)),
blkport(-1),
id_pool(N_THREADS),
cmd_num(0)
{
interface=Camera::Interface::create(); // factory funcion creates the appropriate interface type
interface->set_server(this); // pointer back to this Server instance
this->interface->set_server(this); // pointer back to this Server instance
}
/***** Camera::Server::Server ***********************************************/

Expand Down
2 changes: 1 addition & 1 deletion camerad/camera_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace Camera {

class Server {
public:
Server();
explicit Server(std::unique_ptr<Interface> interface);
~Server();

std::unique_ptr<Interface> interface;
Expand Down
4 changes: 2 additions & 2 deletions camerad/camerad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ int main( int argc, char** argv ) {
}
else logwrite(function, "starting");

// the child process instantiates a Server object
// the child process obtains the interface and gives it to a Server object
//
Camera::Server camerad;
Camera::Server camerad( Camera::Interface::create() );
camerad.foreground = foreground;

// read the config file and configure the various components
Expand Down
Loading