Skip to content

Commit

Permalink
[core] Moved CCache inside the srt namespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko committed May 2, 2022
1 parent 3fbb917 commit 909c8fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 5 additions & 5 deletions srtcore/cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ written by

using namespace std;

CInfoBlock& CInfoBlock::copyFrom(const CInfoBlock& obj)
srt::CInfoBlock& srt::CInfoBlock::copyFrom(const CInfoBlock& obj)
{
std::copy(obj.m_piIP, obj.m_piIP + 4, m_piIP);
m_iIPversion = obj.m_iIPversion;
Expand All @@ -62,7 +62,7 @@ CInfoBlock& CInfoBlock::copyFrom(const CInfoBlock& obj)
return *this;
}

bool CInfoBlock::operator==(const CInfoBlock& obj)
bool srt::CInfoBlock::operator==(const CInfoBlock& obj)
{
if (m_iIPversion != obj.m_iIPversion)
return false;
Expand All @@ -79,7 +79,7 @@ bool CInfoBlock::operator==(const CInfoBlock& obj)
return true;
}

CInfoBlock* CInfoBlock::clone()
srt::CInfoBlock* srt::CInfoBlock::clone()
{
CInfoBlock* obj = new CInfoBlock;

Expand All @@ -96,15 +96,15 @@ CInfoBlock* CInfoBlock::clone()
return obj;
}

int CInfoBlock::getKey()
int srt::CInfoBlock::getKey()
{
if (m_iIPversion == AF_INET)
return m_piIP[0];

return m_piIP[0] + m_piIP[1] + m_piIP[2] + m_piIP[3];
}

void CInfoBlock::convert(const sockaddr_any& addr, uint32_t aw_ip[4])
void srt::CInfoBlock::convert(const sockaddr_any& addr, uint32_t aw_ip[4])
{
if (addr.family() == AF_INET)
{
Expand Down
4 changes: 4 additions & 0 deletions srtcore/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ written by
#include "netinet_any.h"
#include "udt.h"

namespace srt
{

class CCacheItem
{
public:
Expand Down Expand Up @@ -265,5 +268,6 @@ class CInfoBlock
static void convert(const sockaddr_any& addr, uint32_t ip[4]);
};

} // namespace srt

#endif

0 comments on commit 909c8fb

Please sign in to comment.