Kea  1.5.0
cache_host_data_source.h
Go to the documentation of this file.
1 // Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
2 //
3 // This Source Code Form is subject to the terms of the End User License
4 // Agreement. See COPYING file in the premium/ directory.
5 
6 #ifndef CACHE_HOST_DATA_SOURCE_H
7 #define CACHE_HOST_DATA_SOURCE_H
8 
10 
11 namespace isc {
12 namespace dhcp {
13 
17 class CacheHostDataSource : public virtual BaseHostDataSource {
18 public:
19 
21  virtual ~CacheHostDataSource() { }
22 
32  virtual size_t insert(const ConstHostPtr& host, bool overwrite) = 0;
33 
43  virtual bool remove(const HostPtr& host) = 0;
44 
48  virtual void flush(size_t count) = 0;
49 
53  virtual size_t size() const = 0;
54 
58  virtual size_t capacity() const = 0;
59 };
60 
62 typedef boost::shared_ptr<CacheHostDataSource> CacheHostDataSourcePtr;
63 
64 } // end of namespace isc::dhcp
65 } // end of namespace isc
66 
67 #endif // CACHE_HOST_DATA_SOURCE_H
virtual size_t size() const =0
Return the number of entries.
boost::shared_ptr< Host > HostPtr
Pointer to the Host object.
Definition: host.h:725
virtual bool remove(const HostPtr &host)=0
Remove a host from the cache.
boost::shared_ptr< CacheHostDataSource > CacheHostDataSourcePtr
CacheHostDataSource pointer.
virtual ~CacheHostDataSource()
Default destructor implementation.
boost::shared_ptr< const Host > ConstHostPtr
Const pointer to the Host object.
Definition: host.h:728
virtual void flush(size_t count)=0
Flush entries.
Defines the logger used by the top-level component of kea-dhcp-ddns.
Base interface for the classes implementing simple data source for host reservations.
virtual size_t capacity() const =0
Return the maximum number of entries.
Abstract interface extending base simple data source for host reservations to host cache.
virtual size_t insert(const ConstHostPtr &host, bool overwrite)=0
Insert a host into the cache.