nixvec.h

来自「it is very important」· C头文件 代码 · 共 41 行

H
41
字号
// 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

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?