Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 10-06-2004
code code is offline
Registered User
 
 
Join Date: Sep 2004
Location: P.R.China
Posts: 26
why struct inherit class

struct EvictorEntry : public Ice::LocalObject {
Ice::ObjectPtr servant;
Ice::LocalObjectPtr userCookie;
EvictorQueue::iterator pos;
int useCount; };

struct EvictorEntry inherit Ice::LocalObject why?
Reply With Quote
  #2 (permalink)  
Old 10-06-2004
code code is offline
Registered User
 
 
Join Date: Sep 2004
Location: P.R.China
Posts: 26
Can struct inherit class ?
Reply With Quote
  #3 (permalink)  
Old 10-06-2004
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
Re: why struct inherit class

Quote:
Originally 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.
Reply With Quote
  #4 (permalink)  
Old 10-06-2004
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
Quote:
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.
Reply With Quote
  #5 (permalink)  
Old 10-06-2004
code code is offline
Registered User
 
 
Join Date: Sep 2004
Location: P.R.China
Posts: 26
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();
};
Reply With Quote
  #6 (permalink)  
Old 10-06-2004
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
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.
Reply With Quote
  #7 (permalink)  
Old 10-06-2004
code code is offline
Registered User
 
 
Join Date: Sep 2004
Location: P.R.China
Posts: 26
Thanks
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
About return struct billwillman Help Center 7 10-16-2006 03:39 AM
Problem with classes in struct kovacm Help Center 9 10-06-2005 02:49 AM
is there any way to use my own struct in slice? pi1ot Help Center 1 02-21-2005 12:35 AM
csc compiler error amd inherit accross namespaces DeepDiver Bug Reports 2 12-01-2004 10:42 PM
May slice struct contain class? minifat Help Center 1 08-09-2004 10:16 PM


All times are GMT -4. The time now is 05:25 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.