summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/netlist/plib/ptime.h
diff options
context:
space:
mode:
author couriersud <couriersud@gmx.org>2020-05-03 23:37:44 +0200
committer couriersud <couriersud@gmx.org>2020-05-04 09:22:16 +0200
commitb500f2d24175ff2bd8efdb889a6c5eea12e96314 (patch)
tree5fff1c55603387a2258b830cab01ac21ac6e43b9 /src/lib/netlist/plib/ptime.h
parente59af6d5e89f02a2a626adc95b244924403b98f9 (diff)
netlist: Restructered the save state system. (nw)
This change makes state saving contract based. Objects which need to save state need to have the following template member: template <typename ST> void save_state(ST &st) { /* Example */ st.save_item(m_p, "m_p"); st.save_item(m_buf, "m_buf"); } This member function is called when the object is passed to the state manager save function.
Diffstat (limited to 'src/lib/netlist/plib/ptime.h')
-rw-r--r--src/lib/netlist/plib/ptime.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/netlist/plib/ptime.h b/src/lib/netlist/plib/ptime.h
index 836f832bda8..3cdb9f30d33 100644
--- a/src/lib/netlist/plib/ptime.h
+++ b/src/lib/netlist/plib/ptime.h
@@ -27,13 +27,6 @@ namespace plib
const static bool value = sizeof(T) <= sizeof(U);
};
-#if 0
- template<typename T, typename U>
- struct ptime_res {
- using type = typename std::conditional<sizeof(T) >= sizeof(U), T, U>::type;
- };
-#endif
-
template <typename TYPE, TYPE RES>
struct ptime final
{
@@ -165,7 +158,14 @@ namespace plib
constexpr ptime shr(unsigned shift) const noexcept { return ptime(m_time >> shift); }
// for save states ....
+#if 0
C14CONSTEXPR internal_type *get_internaltype_ptr() noexcept { return &m_time; }
+#endif
+ template <typename ST>
+ void save_state(ST &st)
+ {
+ st.save_item(m_time, "m_time");
+ }
static constexpr ptime from_nsec(internal_type ns) noexcept { return ptime(ns, UINT64_C(1000000000)); }
static constexpr ptime from_usec(internal_type us) noexcept { return ptime(us, UINT64_C( 1000000)); }