?? nixvec.h
字號:
// Support for NixVector routing// George F. Riley, Georgia Tech, Winter 2000#ifndef __NIXVEC_H__#define __NIXVEC_H__#include <pair.h>// Define a type for the neighbor indextypedef unsigned long Nix_t;typedef unsigned long Nixl_t; // Length of a NVconst Nix_t NIX_NONE = 0xffffffff; // If not a neighborconst Nixl_t NIX_BPW = 32; // Bits per long wordtypedef pair<Nix_t, Nixl_t> NixPair_t; // Index, bits neededtypedef pair<Nix_t*, Nixl_t> NixpPair_t;// NV Pointer, length// The variable length neighbor index routing vectorclass NixVec { public : NixVec () : m_pNV(0), m_used(0), m_alth(0) { }; NixVec(NixVec*); // Construct from existing ~NixVec(); // Destructor void Add(NixPair_t); // Add bits to the nix vector Nix_t Extract(Nixl_t); // Extract the specified number of bits Nix_t Extract(Nixl_t, Nixl_t*); // Extract using external "used" NixpPair_t Get(void); // Get the entire nv void Reset(); // Reset used to 0 Nixl_t Lth(); // Get length in bits of allocated void DBDump(); // Debug..print it out Nixl_t ALth() { return m_alth;} // Debug...how many bits actually used static Nixl_t GetBitl(Nix_t); // Find out how many bits needed private : Nix_t* m_pNV; // Points to variable lth nixvector (or actual if l == 32) // Nixl_t m_lth; // Length of this nixvector (computed from m_alth) Nixl_t m_used; // Used portion of this nixvector Nixl_t m_alth; // Actual length (largest used)};#endif
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -