make getLocalPrefix a static GetLocalPrefix function

This commit is contained in:
Zhenkai Zhu committed 2012-10-15 13:51:42 -07:00
1 parent d5aec4ba14
commit e761767944
2 files changed
+12 -2

No files matched your search

+8
View File
@@ -42,6 +42,14 @@ SyncAppSocket::~SyncAppSocket()
CcnxWrapper::Destroy ();
}
std::string
SyncAppSocket::GetLocalPrefix()
{
// this handle is supposed to be short lived
CcnxWrapperPtr handle = CcnxWrapper::Create();
return handle->getLocalPrefix();
}
bool
SyncAppSocket::publishString (const string &prefix, uint32_t session, const string &dataBuffer, int freshness)
{
+4 -2
View File
@@ -90,8 +90,10 @@ public:
SyncLogic &
getLogic () { return m_syncLogic; }
std::string
getLocalPrefix () { return m_ccnxHandle->getLocalPrefix (); }
// make this a static function so we don't have to create socket instance without
// knowing the local prefix. it's a wrong place for this function anyway
static std::string
GetLocalPrefix ();
private:
void