中间件底层,websocket

SerializeParent.hpp 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //******************************************************************************
  2. // RCF - Remote Call Framework
  3. //
  4. // Copyright (c) 2005 - 2020, Delta V Software. All rights reserved.
  5. // http://www.deltavsoft.com
  6. //
  7. // RCF is distributed under dual licenses - closed source or GPL.
  8. // Consult your particular license for conditions of use.
  9. //
  10. // If you have not purchased a commercial license, you are using RCF
  11. // under GPL terms.
  12. //
  13. // Version: 3.2
  14. // Contact: support <at> deltavsoft.com
  15. //
  16. //******************************************************************************
  17. /// @file
  18. #ifndef INCLUDE_SF_SERIALIZEPARENT_HPP
  19. #define INCLUDE_SF_SERIALIZEPARENT_HPP
  20. #include <SF/Archive.hpp>
  21. #include <SF/SerializePolymorphic.hpp>
  22. namespace SF {
  23. /// Serializes a base class of a derived class. Call this from
  24. /// the serialization function of the derived class, to invoke serialization
  25. /// code for the base class.
  26. template<typename Base, typename Derived>
  27. void serializeParent(Archive & ar, Derived & derived)
  28. {
  29. ar & SF::Archive::PARENT & static_cast<Base &>(derived);
  30. }
  31. } // namespace SF
  32. #endif // ! INCLUDE_SF_SERIALIZEPARENT_HPP