ostinato/common/cache.h
Srivats P d827e43a11 Cache protocol frame value when possible
Caching reduces packet build aka "apply" time.

This is a first in a series of optimization experiments

These optimizations are potentially dangerous and may cause incorrect
packets to be generated unintentionally and therefore need rigorous
testing
2019-07-02 19:03:26 +05:30

32 lines
822 B
C++

/*
Copyright (C) 2019 Srivats P.
This file is part of "Ostinato"
This is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
*/
#ifndef _CACHE_H
#define _CACHE_H
template <class T>
struct Cache
{
bool isEnabled{false};
bool isValid{false};
T value;
};
#endif