Factored out multicast propagation algorithm from Switch and Topology, also cleaned up and clarified it a bit.
This commit is contained in:
parent
47f611e7b8
commit
9e28bbfbb2
10 changed files with 365 additions and 209 deletions
|
@ -240,6 +240,22 @@ public:
|
|||
_l += sizeof(T);
|
||||
}
|
||||
|
||||
/**
|
||||
* Append a run of bytes
|
||||
*
|
||||
* @param c Character value to append
|
||||
* @param n Number of times to append
|
||||
* @throws std::out_of_range Attempt to append beyond capacity
|
||||
*/
|
||||
inline void append(unsigned char c,unsigned int n)
|
||||
throw(std::out_of_range)
|
||||
{
|
||||
if ((_l + n) > C)
|
||||
throw std::out_of_range("Buffer: append beyond capacity");
|
||||
for(unsigned int i=0;i<n;++i)
|
||||
_b[_l++] = (char)c;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append a C-array of bytes
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue