LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2005,2006 INRIA | 3 * Copyright (c) 2005,2006 INRIA |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 1901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1912 * | 1912 * |
1913 * \param [in] value Source string | 1913 * \param [in] value Source string |
1914 * \param [in] checker Checker to validate with | 1914 * \param [in] checker Checker to validate with |
1915 * \return \c true if successful | 1915 * \return \c true if successful |
1916 */ | 1916 */ |
1917 virtual bool DeserializeFromString (std::string value, Ptr<const AttributeChec
ker> checker); | 1917 virtual bool DeserializeFromString (std::string value, Ptr<const AttributeChec
ker> checker); |
1918 private: | 1918 private: |
1919 CallbackBase m_value; //!< the CallbackBase | 1919 CallbackBase m_value; //!< the CallbackBase |
1920 }; | 1920 }; |
1921 | 1921 |
1922 #ifdef _WIN32 | 1922 ATTRIBUTE_ACCESSOR_DEFINE_LIB (Callback, NS3CORELIB); |
1923 ATTRIBUTE_ACCESSOR_DEFINE_LIB (Callback,NS3CORELIB); | 1923 ATTRIBUTE_CHECKER_DEFINE_LIB (Callback, NS3CORELIB); |
1924 ATTRIBUTE_CHECKER_DEFINE_LIB (Callback,NS3CORELIB); | |
1925 #else | |
1926 ATTRIBUTE_ACCESSOR_DEFINE (Callback); | |
1927 ATTRIBUTE_CHECKER_DEFINE (Callback); | |
1928 #endif | |
1929 | 1924 |
1930 } // namespace ns3 | 1925 } // namespace ns3 |
1931 | 1926 |
1932 namespace ns3 { | 1927 namespace ns3 { |
1933 | 1928 |
1934 template <typename T> | 1929 template <typename T> |
1935 bool CallbackValue::GetAccessor (T &value) const | 1930 bool CallbackValue::GetAccessor (T &value) const |
1936 { | 1931 { |
1937 if (value.CheckType (m_value)) | 1932 if (value.CheckType (m_value)) |
1938 { | 1933 { |
1939 if (!value.Assign (m_value)) | 1934 if (!value.Assign (m_value)) |
1940 NS_FATAL_ERROR_NO_MSG (); | 1935 NS_FATAL_ERROR_NO_MSG (); |
1941 return true; | 1936 return true; |
1942 } | 1937 } |
1943 return false; | 1938 return false; |
1944 } | 1939 } |
1945 | 1940 |
1946 } // namespace ns3 | 1941 } // namespace ns3 |
1947 | 1942 |
1948 | 1943 |
1949 #endif /* CALLBACK_H */ | 1944 #endif /* CALLBACK_H */ |
LEFT | RIGHT |