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.comnamespace sc_core 2313513Sgabeblack@google.com{ 2413511Sgabeblack@google.com 2513513Sgabeblack@google.comclass sc_object; 2613511Sgabeblack@google.com 2713513Sgabeblack@google.com} // namespace sc_core 2813513Sgabeblack@google.com 2913513Sgabeblack@google.comnamespace tlm_utils 3013511Sgabeblack@google.com{ 3113513Sgabeblack@google.com 3213513Sgabeblack@google.com// Implementation-defined base class helper for convenience sockets. 3313513Sgabeblack@google.comclass convenience_socket_base 3413513Sgabeblack@google.com{ 3513513Sgabeblack@google.com public: 3613513Sgabeblack@google.com void display_warning(const char *msg) const; 3713513Sgabeblack@google.com void display_error(const char *msg) const; 3813513Sgabeblack@google.com 3913513Sgabeblack@google.com protected: 4013513Sgabeblack@google.com virtual ~convenience_socket_base() {} 4113513Sgabeblack@google.com 4213513Sgabeblack@google.com private: 4313513Sgabeblack@google.com virtual const char *get_report_type() const = 0; 4413513Sgabeblack@google.com virtual const sc_core::sc_object *get_socket() const = 0; 4513511Sgabeblack@google.com}; 4613511Sgabeblack@google.com 4713513Sgabeblack@google.com// Implementation-defined base class helper for simple sockets. 4813513Sgabeblack@google.comclass simple_socket_base : public convenience_socket_base 4913511Sgabeblack@google.com{ 5013513Sgabeblack@google.com virtual const char *get_report_type() const; 5113513Sgabeblack@google.com 5213513Sgabeblack@google.com protected: 5313513Sgabeblack@google.com void elaboration_check(const char *action) const; 5413511Sgabeblack@google.com}; 5513511Sgabeblack@google.com 5613513Sgabeblack@google.com// Implementation-defined base class helper for passthrough sockets. 5713513Sgabeblack@google.comclass passthrough_socket_base : public convenience_socket_base 5813511Sgabeblack@google.com{ 5913513Sgabeblack@google.com virtual const char *get_report_type() const; 6013511Sgabeblack@google.com}; 6113511Sgabeblack@google.com 6213513Sgabeblack@google.com// Implementation-defined base class helper for multi sockets. 6313513Sgabeblack@google.comclass multi_socket_base : public convenience_socket_base 6413511Sgabeblack@google.com{ 6513513Sgabeblack@google.com virtual const char *get_report_type() const; 6613511Sgabeblack@google.com}; 6713511Sgabeblack@google.com 6813513Sgabeblack@google.com// Implementation-defined base class for callback helpers. 6913513Sgabeblack@google.comclass convenience_socket_cb_holder 7013511Sgabeblack@google.com{ 7113513Sgabeblack@google.com public: 7213513Sgabeblack@google.com void display_warning(const char *msg) const; 7313513Sgabeblack@google.com void display_error(const char *msg) const; 7413511Sgabeblack@google.com 7513513Sgabeblack@google.com protected: 7613513Sgabeblack@google.com explicit convenience_socket_cb_holder(convenience_socket_base *owner) : 7713513Sgabeblack@google.com m_owner(owner) 7813513Sgabeblack@google.com {} 7913511Sgabeblack@google.com 8013513Sgabeblack@google.com private: 8113513Sgabeblack@google.com convenience_socket_base *m_owner; 8213511Sgabeblack@google.com}; 8313511Sgabeblack@google.com 8413511Sgabeblack@google.com} // namespace tlm_utils 8513513Sgabeblack@google.com 8613513Sgabeblack@google.com#endif /* __SYSTEMC_EXT_TLM_UTILS_CONVENIENCE_SOCKET_BASES_H__ */ 87