Commit c19311ab authored by claes's avatar claes

Functions for cashe

parent f227d32b
/* /*
* Proview $Id: wb_vrepext.cpp,v 1.5 2005-09-20 13:14:28 claes Exp $ * Proview $Id: wb_vrepext.cpp,v 1.6 2005-11-22 12:28:18 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -129,7 +129,7 @@ wb_orep *wb_vrepext::object(pwr_tStatus *sts, pwr_tOid oid) ...@@ -129,7 +129,7 @@ wb_orep *wb_vrepext::object(pwr_tStatus *sts, pwr_tOid oid)
wb_cdef cdef = wb_cdef( cdrep); wb_cdef cdef = wb_cdef( cdrep);
ext_object exto( &amsg.Object, m_vid, cdef); ext_object exto( &amsg.Object, m_vid, cdef);
m_cashe = exto; cashe_insert( exto);
wb_orepext *orep = new wb_orepext( this, exto); wb_orepext *orep = new wb_orepext( this, exto);
return orep; return orep;
} }
...@@ -411,7 +411,7 @@ wb_orep *wb_vrepext::createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination ...@@ -411,7 +411,7 @@ wb_orep *wb_vrepext::createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination
if ( ODD( amsg.Object.Status)) { if ( ODD( amsg.Object.Status)) {
*sts = LDH__SUCCESS; *sts = LDH__SUCCESS;
ext_object exto( &amsg.Object, m_vid, cdef); ext_object exto( &amsg.Object, m_vid, cdef);
m_cashe = exto; cashe_insert( exto);
wb_orepext *orep = new wb_orepext( this, exto); wb_orepext *orep = new wb_orepext( this, exto);
return orep; return orep;
} }
...@@ -485,7 +485,7 @@ wb_orep *wb_vrepext::copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destin ...@@ -485,7 +485,7 @@ wb_orep *wb_vrepext::copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destin
wb_cdef cdef = wb_cdef( cdrep); wb_cdef cdef = wb_cdef( cdrep);
ext_object exto( &amsg.Object, m_vid, cdef); ext_object exto( &amsg.Object, m_vid, cdef);
m_cashe = exto; cashe_insert( exto);
wb_orepext *orep = new wb_orepext( this, exto); wb_orepext *orep = new wb_orepext( this, exto);
return orep; return orep;
} }
...@@ -612,9 +612,22 @@ bool wb_vrepext::renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name &name) ...@@ -612,9 +612,22 @@ bool wb_vrepext::renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name &name)
*sts = amsg.Any.Status; *sts = amsg.Any.Status;
return false; return false;
} }
// Remove from cashe
cashe_remove( orep->oid().oix);
return true; return true;
} }
void wb_vrepext::cashe_insert( ext_object& eo)
{
m_cashe = eo;
}
void wb_vrepext::cashe_remove( pwr_tOix oix)
{
if ( m_cashe.m_oid.oix == oix)
m_cashe.m_oid = pwr_cNObjid;
}
bool wb_vrepext::commit(pwr_tStatus *sts) bool wb_vrepext::commit(pwr_tStatus *sts)
{ {
vext_sQMsg qmsg; vext_sQMsg qmsg;
......
/* /*
* Proview $Id: wb_vrepext.h,v 1.6 2005-10-25 12:04:25 claes Exp $ * Proview $Id: wb_vrepext.h,v 1.7 2005-11-22 12:28:18 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -299,6 +299,8 @@ public: ...@@ -299,6 +299,8 @@ public:
private: private:
void put( vext_sQMsg *msg, int size, pwr_tStatus *sts); void put( vext_sQMsg *msg, int size, pwr_tStatus *sts);
void receive( vext_sAMsg *msg, int size, pwr_tStatus *sts); void receive( vext_sAMsg *msg, int size, pwr_tStatus *sts);
void cashe_insert( ext_object& eo);
void cashe_remove( pwr_tOix oix);
}; };
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment