Refactor RemoteHost to be copyable with shared storage

* This allows RemoteHost handles to still be valid and usable (if returning
  empty data) when they are deleted/removed if the device is disconnected, as
  well as providing better multi-thread access (they lock internally)
This commit is contained in:
baldurk
2019-07-31 17:51:12 +01:00
parent da289fdbcc
commit 06f2e61b8f
15 changed files with 626 additions and 355 deletions
@@ -125,20 +125,24 @@ void PersistantConfig::Close()
{
}
int PersistantConfig::RemoteHostCount()
rdcarray<RemoteHost> PersistantConfig::GetRemoteHosts()
{
return 0;
return {};
}
RemoteHost *PersistantConfig::GetRemoteHost(int index)
RemoteHost PersistantConfig::GetRemoteHost(const rdcstr &)
{
return NULL;
return RemoteHost();
}
void PersistantConfig::AddRemoteHost(RemoteHost host)
{
}
void PersistantConfig::RemoveRemoteHost(RemoteHost host)
{
}
void PersistantConfig::AddAndroidHosts()
{
}
@@ -166,7 +170,23 @@ rdcstr PersistantConfig::GetConfigSetting(const rdcstr &name)
RemoteHost::RemoteHost()
{
serverRunning = connected = busy = versionMismatch = false;
}
RemoteHost::RemoteHost(const rdcstr &host)
{
}
RemoteHost::RemoteHost(const RemoteHost &o)
{
}
RemoteHost &RemoteHost::operator=(const RemoteHost &o)
{
return *this;
}
RemoteHost::~RemoteHost()
{
}
void RemoteHost::CheckStatus()
@@ -177,3 +197,58 @@ ReplayStatus RemoteHost::Launch()
{
return ReplayStatus::Succeeded;
}
bool RemoteHost::IsServerRunning() const
{
return false;
}
bool RemoteHost::IsConnected() const
{
return false;
}
bool RemoteHost::IsBusy() const
{
return false;
}
bool RemoteHost::IsVersionMismatch() const
{
return false;
}
rdcstr RemoteHost::FriendlyName() const
{
return rdcstr();
}
void RemoteHost::SetFriendlyName(const rdcstr &name)
{
}
rdcstr RemoteHost::RunCommand() const
{
return rdcstr();
}
void RemoteHost::SetRunCommand(const rdcstr &cmd)
{
}
rdcstr RemoteHost::LastCapturePath() const
{
return rdcstr();
}
void RemoteHost::SetLastCapturePath(const rdcstr &path)
{
}
void RemoteHost::SetConnected(bool connected)
{
}
void RemoteHost::SetShutdown()
{
}