Skip to content

Commit

Permalink
Merge pull request #63 from leapmotion/ref-autonetimpl
Browse files Browse the repository at this point in the history
Reducing Autowiring dependencies in order to clean up definitions
  • Loading branch information
gtremper committed Aug 19, 2014
2 parents 60680d6 + f5ea416 commit 2e17be8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
8 changes: 7 additions & 1 deletion autowiring/AutoNetServer.h
Expand Up @@ -2,6 +2,10 @@
#pragma once
#include "CoreThread.h"

class AutoNetServer;

extern AutoNetServer* NewAutoNetServerImpl(void);

class AutoNetServer:
public CoreThread
{
Expand All @@ -10,7 +14,9 @@ class AutoNetServer:

public:
virtual ~AutoNetServer();
static AutoNetServer* New(void);
static AutoNetServer* New(void) {
return NewAutoNetServerImpl();
}

/// <summary>
/// Waits until resume message is sent from the visualizer
Expand Down
5 changes: 0 additions & 5 deletions src/autonet/AutoNetServer.cpp
@@ -1,15 +1,10 @@
// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved.
#include "stdafx.h"
#include "AutoNetServer.h"
#include "AutoNetServerImpl.hpp"

AutoNetServer::AutoNetServer():
CoreThread("AutoNetServer")
{
}

AutoNetServer::~AutoNetServer(){}

AutoNetServer* AutoNetServer::New(void) {
return new AutoNetServerImpl;
}
6 changes: 5 additions & 1 deletion src/autonet/AutoNetServerImpl.cpp
@@ -1,7 +1,7 @@
#include "stdafx.h"
#include "AutoNetServerImpl.hpp"
#include "autowiring.h"
#include "at_exit.h"
#include "autowiring.h"
#include "EventRegistry.h"
#include "TypeRegistry.h"
#include <iostream>
Expand Down Expand Up @@ -58,6 +58,10 @@ AutoNetServerImpl::~AutoNetServerImpl()
{
}

AutoNetServer* NewAutoNetServerImpl(void) {
return new AutoNetServerImpl;
}

// CoreThread overrides
void AutoNetServerImpl::Run(void){
std::cout << "Starting Autonet server..." << std::endl;
Expand Down
4 changes: 4 additions & 0 deletions src/autonet/AutoNetServerImpl.hpp
Expand Up @@ -172,3 +172,7 @@ class AutoNetServerImpl:
const int m_Port; // Port to listen on
};

/// <summary>
/// Equivalent to new AutoNetServerImpl
/// </summary>
AutoNetServer* NewAutoNetServerImpl(void);

0 comments on commit 2e17be8

Please sign in to comment.