etherdevice.hh (11263:8dcc6b40f164) etherdevice.hh (11990:5fad911cc326)
1/*
2 * Copyright (c) 2007 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 114 unchanged lines hidden (view full) ---

123
124/**
125 * Dummy class to keep the Python class hierarchy in sync with the C++
126 * object hierarchy.
127 *
128 * The Python object hierarchy includes the EtherDevBase class which
129 * is used by some ethernet devices as a way to share common
130 * configuration information in the generated param structs. Since the
1/*
2 * Copyright (c) 2007 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 114 unchanged lines hidden (view full) ---

123
124/**
125 * Dummy class to keep the Python class hierarchy in sync with the C++
126 * object hierarchy.
127 *
128 * The Python object hierarchy includes the EtherDevBase class which
129 * is used by some ethernet devices as a way to share common
130 * configuration information in the generated param structs. Since the
131 * Python hierarchy is used to generate a SWIG interface for all C++
132 * SimObjects, we need to reflect this in the C++ object hierarchy. If
133 * we don't, SWIG might end up doing 'bad things' when it down casts
134 * ethernet objects to their base class(es).
131 * Python hierarchy is used to generate a Python interfaces for all C++
132 * SimObjects, we need to reflect this in the C++ object hierarchy.
135 */
136class EtherDevBase : public EtherDevice
137{
138 public:
139 EtherDevBase(const EtherDevBaseParams *params)
140 : EtherDevice(params)
141 {}
142
143 const EtherDevBaseParams *
144 params() const
145 {
146 return dynamic_cast<const EtherDevBaseParams *>(_params);
147 }
148
149};
150
151#endif // __DEV_NET_ETHERDEVICE_HH__
152
133 */
134class EtherDevBase : public EtherDevice
135{
136 public:
137 EtherDevBase(const EtherDevBaseParams *params)
138 : EtherDevice(params)
139 {}
140
141 const EtherDevBaseParams *
142 params() const
143 {
144 return dynamic_cast<const EtherDevBaseParams *>(_params);
145 }
146
147};
148
149#endif // __DEV_NET_ETHERDEVICE_HH__
150