1#include "header_type.hpp"
3#include <boost/variant/apply_visitor.hpp>
4#include <boost/variant/static_visitor.hpp>
11struct gbc_header_type_visitor :
public boost::static_visitor<HeaderType>
13 HeaderType operator()(
const Circle&)
const
15 return HeaderType::GeoBroadcast_Circle;
18 HeaderType operator()(
const Rectangle&)
const
20 return HeaderType::GeoBroadcast_Rect;
23 HeaderType operator()(
const Ellipse&)
const
25 return HeaderType::GeoBroadcast_Elip;
29HeaderType gbc_header_type(
const Area& area)
31 return boost::apply_visitor(gbc_header_type_visitor(), area.shape);
34struct gac_header_type_visitor :
public boost::static_visitor<HeaderType>
36 HeaderType operator()(
const Circle&)
const
38 return HeaderType::GeoAnycast_Circle;
41 HeaderType operator()(
const Rectangle&)
const
43 return HeaderType::GeoAnycast_Rect;
46 HeaderType operator()(
const Ellipse&)
const
48 return HeaderType::GeoAnycast_Elip;
52HeaderType gac_header_type(
const Area& area)
54 return boost::apply_visitor(gac_header_type_visitor(), area.shape);