Archived
This forum has been archived. Please start a new discussion on GitHub.
why struct inherit class
in Help Center
struct EvictorEntry : public Ice::LocalObject {
Ice::ObjectPtr servant;
Ice::LocalObjectPtr userCookie;
EvictorQueue::iterator pos;
int useCount; };
struct EvictorEntry inherit Ice::LocalObject why?
Ice::ObjectPtr servant;
Ice::LocalObjectPtr userCookie;
EvictorQueue::iterator pos;
int useCount; };
struct EvictorEntry inherit Ice::LocalObject why?
0
Comments
-
Can struct inherit class ?0
-
Re: why struct inherit classOriginally posted by code
struct EvictorEntry : public Ice::LocalObject {
Ice::ObjectPtr servant;
Ice::LocalObjectPtr userCookie;
EvictorQueue::iterator pos;
int useCount; };
struct EvictorEntry inherit Ice::LocalObject why?
Where is this from? Ice structs mapped to C++ do not inherit from anything.0 -
Originally posted by code
Can struct inherit class ?
No, Ice structs do not support inheritance. They are simple light-weight data containers. Please see the Ice manual for details.0 -
on ICE-1.5.1.pdf page 496
class EvictorBase : public Ice::ServantLocator {
public: // ...
private: struct EvictorEntry;
typedef IceUtil::Handle<EvictorEntry> EvictorEntryPtr;
typedef std::map<Ice::Identity, EvictorEntryPtr> EvictorMap;
typedef std::list<EvictorMap::iterator> EvictorQueue;
struct EvictorEntry : public Ice::LocalObject {
Ice::ObjectPtr servant;
Ice::LocalObjectPtr userCookie;
EvictorQueue::iterator pos; int useCount;
};
struct EvictorCookie : public Ice::LocalObject {
EvictorEntryPtr entry;
};
typedef IceUtil::Handle<EvictorCookie> EvictorCookiePtr;
EvictorMap _map;
EvictorQueue _queue;
Ice::Int _size; IceUtil::Mutex _mutex;
void evictServants();
};0 -
This is C++ code, not Slice code or code generated from Slice code. In C++, structs can inherit from classes. Please see your C++ documentation for details.0
-
Thanks0