*not part of the build*

fixes for 78866 and 78865
This commit is contained in:
idk%eng.sun.com 2001-05-04 08:45:12 +00:00
parent 9a6566397d
commit 386b829e9b
3 changed files with 30 additions and 4 deletions

View File

@ -30,6 +30,7 @@
class bcIORB {
public:
virtual bcOID RegisterStub(bcIStub *stub) = 0;
virtual void RegisterStubWithOID(bcIStub *stub, bcOID *oid) = 0;
virtual bcICall * CreateCall(bcIID *, bcOID *, bcMID) = 0;
virtual int SendReceive(bcICall *) = 0;
//virtual IThread * GetThread(TID) = 0;

View File

@ -24,7 +24,6 @@
#include "Call.h"
#include "nsHashtable.h"
class bcOIDKey : public nsHashKey {
protected:
bcOID key;
@ -57,8 +56,14 @@ ORB::~ORB() {
}
bcOID ORB::RegisterStub(bcIStub *stub) {
stubs->Put(new bcOIDKey(currentID),stub);
return currentID++;
bcOID oid = GenerateOID();
stubs->Put(new bcOIDKey(oid),stub);
return oid;
}
void ORB:: RegisterStubWithOID(bcIStub *stub, bcOID *oid) {
stubs->Put(new bcOIDKey(*oid),stub);
return;
}
bcICall * ORB::CreateCall(bcIID *iid, bcOID *oid, bcMID mid) {
@ -88,3 +93,21 @@ bcIStub * ORB::GetStub(bcOID *oid) {
struct bcOIDstruct {
PRUint16 high;
PRUint16 low;
};
bcOID ORB::GenerateOID() {
bcOID oid;
bcOIDstruct oidStruct;
oidStruct.low = currentID++;
oidStruct.high = ((PRUint32)this);
oid = *(bcOID*)&oidStruct;
return oid;
}

View File

@ -30,11 +30,13 @@ public:
ORB();
virtual ~ORB();
virtual bcOID RegisterStub(bcIStub *stub);
virtual void RegisterStubWithOID(bcIStub *stub, bcOID *oid);
virtual bcICall * CreateCall(bcIID *, bcOID *, bcMID);
virtual int SendReceive(bcICall *);
private:
bcIStub * GetStub(bcOID *);
bcOID GenerateOID();
nsHashtable *stubs;
int currentID;
unsigned int currentID;
};
#endif