1 
2 /* Web Polygraph       http://www.web-polygraph.org/
3  * Copyright 2003-2011 The Measurement Factory
4  * Licensed under the Apache License, Version 2.0 */
5 
6 #ifndef POLYGRAPH__PGL_PGLNETADDRRANGESYM_H
7 #define POLYGRAPH__PGL_PGLNETADDRRANGESYM_H
8 
9 #include "pgl/PglContainerSym.h"
10 
11 class PglNetAddrRange;
12 
13 // a compact representation of a range of addresses
14 class NetAddrRangeSym: public ContainerSym {
15 	public:
16 		static const String TheType;
17 
18 	public:
19 		NetAddrRangeSym();
20 		virtual ~NetAddrRangeSym();
21 
22 		virtual bool isA(const String &type) const;
23 
24 		virtual int count() const;
25 		virtual bool probsSet() const;
26 		virtual const SynSym *itemProb(int offset, double &prob) const;
27 
range(PglNetAddrRange * aRange)28 		void range(PglNetAddrRange *aRange) { theRange = aRange; }
29 
30 		virtual void forEach(Visitor &v, RndGen *const rng = 0) const;
31 
32 		virtual ostream &print(ostream &os, const String &pfx) const;
33 
34 	protected:
35 		virtual SynSym *dupe(const String &type) const;
36 
37 	protected:
38 		PglNetAddrRange *theRange;
39 		mutable NetAddrSym *theAddr; // cache for itemProb()
40 };
41 
42 #endif
43