convenience_socket_bases.h revision 13513
113511Sgabeblack@google.com/***************************************************************************** 213511Sgabeblack@google.com 313511Sgabeblack@google.com Licensed to Accellera Systems Initiative Inc. (Accellera) under one or 413511Sgabeblack@google.com more contributor license agreements. See the NOTICE file distributed 513511Sgabeblack@google.com with this work for additional information regarding copyright ownership. 613511Sgabeblack@google.com Accellera licenses this file to you under the Apache License, Version 2.0 713511Sgabeblack@google.com (the "License"); you may not use this file except in compliance with the 813511Sgabeblack@google.com License. You may obtain a copy of the License at 913511Sgabeblack@google.com 1013511Sgabeblack@google.com http://www.apache.org/licenses/LICENSE-2.0 1113511Sgabeblack@google.com 1213511Sgabeblack@google.com Unless required by applicable law or agreed to in writing, software 1313511Sgabeblack@google.com distributed under the License is distributed on an "AS IS" BASIS, 1413511Sgabeblack@google.com WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 1513511Sgabeblack@google.com implied. See the License for the specific language governing 1613511Sgabeblack@google.com permissions and limitations under the License. 1713511Sgabeblack@google.com 1813511Sgabeblack@google.com *****************************************************************************/ 1913513Sgabeblack@google.com#ifndef __SYSTEMC_EXT_TLM_UTILS_CONVENIENCE_SOCKET_BASES_H__ 2013513Sgabeblack@google.com#define __SYSTEMC_EXT_TLM_UTILS_CONVENIENCE_SOCKET_BASES_H__ 2113511Sgabeblack@google.com 2213513Sgabeblack@google.com#include <systemc> 2313511Sgabeblack@google.com 2413513Sgabeblack@google.comnamespace sc_core 2513513Sgabeblack@google.com{ 2613511Sgabeblack@google.com 2713513Sgabeblack@google.comclass sc_object; 2813511Sgabeblack@google.com 2913513Sgabeblack@google.com} // namespace sc_core 3013513Sgabeblack@google.com 3113513Sgabeblack@google.comnamespace tlm_utils 3213511Sgabeblack@google.com{ 3313513Sgabeblack@google.com 3413513Sgabeblack@google.com// Implementation-defined base class helper for convenience sockets. 3513513Sgabeblack@google.comclass convenience_socket_base 3613513Sgabeblack@google.com{ 3713513Sgabeblack@google.com public: 3813513Sgabeblack@google.com void display_warning(const char *msg) const; 3913513Sgabeblack@google.com void display_error(const char *msg) const; 4013513Sgabeblack@google.com 4113513Sgabeblack@google.com protected: 4213513Sgabeblack@google.com virtual ~convenience_socket_base() {} 4313513Sgabeblack@google.com 4413513Sgabeblack@google.com private: 4513513Sgabeblack@google.com virtual const char *get_report_type() const = 0; 4613513Sgabeblack@google.com virtual const sc_core::sc_object *get_socket() const = 0; 4713511Sgabeblack@google.com}; 4813511Sgabeblack@google.com 4913513Sgabeblack@google.com// Implementation-defined base class helper for simple sockets. 5013513Sgabeblack@google.comclass simple_socket_base : public convenience_socket_base 5113511Sgabeblack@google.com{ 5213513Sgabeblack@google.com virtual const char *get_report_type() const; 5313513Sgabeblack@google.com 5413513Sgabeblack@google.com protected: 5513513Sgabeblack@google.com void elaboration_check(const char *action) const; 5613511Sgabeblack@google.com}; 5713511Sgabeblack@google.com 5813513Sgabeblack@google.com// Implementation-defined base class helper for passthrough sockets. 5913513Sgabeblack@google.comclass passthrough_socket_base : public convenience_socket_base 6013511Sgabeblack@google.com{ 6113513Sgabeblack@google.com virtual const char *get_report_type() const; 6213511Sgabeblack@google.com}; 6313511Sgabeblack@google.com 6413513Sgabeblack@google.com// Implementation-defined base class helper for multi sockets. 6513513Sgabeblack@google.comclass multi_socket_base : public convenience_socket_base 6613511Sgabeblack@google.com{ 6713513Sgabeblack@google.com virtual const char *get_report_type() const; 6813511Sgabeblack@google.com}; 6913511Sgabeblack@google.com 7013513Sgabeblack@google.com// Implementation-defined base class for callback helpers. 7113513Sgabeblack@google.comclass convenience_socket_cb_holder 7213511Sgabeblack@google.com{ 7313513Sgabeblack@google.com public: 7413513Sgabeblack@google.com void display_warning(const char *msg) const; 7513513Sgabeblack@google.com void display_error(const char *msg) const; 7613511Sgabeblack@google.com 7713513Sgabeblack@google.com protected: 7813513Sgabeblack@google.com explicit convenience_socket_cb_holder(convenience_socket_base *owner) : 7913513Sgabeblack@google.com m_owner(owner) 8013513Sgabeblack@google.com {} 8113511Sgabeblack@google.com 8213513Sgabeblack@google.com private: 8313513Sgabeblack@google.com convenience_socket_base *m_owner; 8413511Sgabeblack@google.com}; 8513511Sgabeblack@google.com 8613511Sgabeblack@google.com} // namespace tlm_utils 8713513Sgabeblack@google.com 8813513Sgabeblack@google.com#endif /* __SYSTEMC_EXT_TLM_UTILS_CONVENIENCE_SOCKET_BASES_H__ */ 89