Skip to content

Commit

Permalink
adding some small help functions to get port host and name
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Newman authored and Paul Newman committed Jul 25, 2017
1 parent a48e277 commit 291e083
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Core/libMOOS/Comms/ActiveMailQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ bool ActiveMailQueue::Push(const CMOOSMsg & M)
bool ActiveMailQueue::DoWork()
{
while(!thread_.IsQuitRequested())
{
{
CMOOSMsg M;
while(queue_.IsEmpty())
{
Expand All @@ -108,16 +108,16 @@ bool ActiveMailQueue::DoWork()
//another class!
if(pClassMemberFunctionCallback_)
{
if(!(*pClassMemberFunctionCallback_)(M))
if(!(*pClassMemberFunctionCallback_)(M))
{
std::cerr<<"ActiveMailQueue::DoWork() user callback returns false\n";
}
}

//or you can have an old style cfunction
if(pfn_)
{
if(!(*pfn_)(M,caller_param_))
{
if(!(*pfn_)(M,caller_param_))
{
std::cerr<<"ActiveMailQueue::DoWork() user callback returns false\n";
}
Expand Down
9 changes: 9 additions & 0 deletions Core/libMOOS/Comms/MOOSCommClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,17 @@ unsigned int CMOOSCommClient::GetNumberOfUnsentMessages()

}

std::string CMOOSCommClient::GetDBHostname(){
return m_sDBHost;
}

int CMOOSCommClient::GetDBHostPort(){
return m_lPort;
}

std::string CMOOSCommClient::GetClientName(){
return m_sMyName;
}

uint64_t CMOOSCommClient::GetNumBytesSent()
{
Expand Down
10 changes: 10 additions & 0 deletions Core/libMOOS/Comms/include/MOOS/libMOOS/Comms/MOOSCommClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,16 @@ class CMOOSCommClient :public CMOOSCommObject
/** get total number of messages sent*/
uint64_t GetNumMsgsSent();

/** get db host name*/
std::string GetDBHostname();

/** get port of DB */
int GetDBHostPort();

/** get client name */
std::string GetClientName();



/** set / get scale factor which determines how to encourgage message bunching
* at high timewarps
Expand Down

0 comments on commit 291e083

Please sign in to comment.