Skip to content

Commit

Permalink
Reducing Autowiring dependencies in order to clean up definitions
Browse files Browse the repository at this point in the history
Shoud allow the Autonet source file compile a tad bit faster, because it doesn't really have much to bring in.  Also allows us to avoid including the mangled websocketpp header in more than one spot--our mangling is really something we don't want to propagate too far from its origination point.
  • Loading branch information
codemercenary committed Aug 19, 2014
1 parent 60680d6 commit f5ea416
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 f5ea416

Please sign in to comment.