-------- Original Message --------
Subject: Standard String
Date: Fri, 15 Jul 2005 08:53:23 -0500
From: Marty Kraimer <[email protected]>
To: Jeff Hill <[email protected]>, Andrew Johnson <[email protected]>
Hi,
This is an attempt to see if we can have a standard string implemention.
Jeff said that he wanted it to be an interface class.
I have taken epicsString and attempted to redefine it as an interface.
In the following:
1) For now lets not discuss naming convention. That is Epics may not be
the name we use.
2) Lets postone discussion of primitive types.
3) I dont know if what I did for == and != is legal C++
Here is initial proposal
class EpicsString {
public:
virtual EpicsString& operator=(const EpicsString &rhs) = 0;
virtual void createBuffer(const char *bufferType,
epicsInt32 capacity = 0) = 0;
virtual void createBuffer(EpicsBufferCreator *creator,
epicsInt32 capacity = 0) = 0;
virtual EpicsBufferCreator *bufferCreator() const = 0;
virtual void destroyBuffer();
virtual epicsInt32 get(epicsInt32 offset, epicsInt32 len,
epicsOctet *pto) const = 0;
virtual epicsInt32 put(epicsInt32 offset, epicsInt32 len,
const epicsOctet *pfrom) = 0;
virtual epicsInt32 hash(epicsInt16 nBitsHashIndex) const = 0;
// These routines are as described for EpicsBuffer
virtual void reserve(epicsInt32 capacity) = 0;
virtual epicsInt32 capacity() const = 0;
virtual void resize(epicsInt32 newsize) = 0;
virtual epicsInt32 size() const = 0;
virtual epicsInt32 maxSize() const = 0;
virtual bool mutable() const = 0;
virtual bool isEqual(const EpicsBuffer &cmp) const;
virtual bool isEqual(epicsInt32 offset, epicsInt32 len,
const epicsOctet *pdata) const = 0;
virtual bool expose(epicsInt32 offset, epicsInt32 &len,
epicsOctet *&pdata) = 0;
virtual bool expose(epicsInt32 offset, epicsInt32 &len,
const epicsOctet *&pdata) const = 0;
};
virtual epicsBoolean operator==(const EpicsString &lhs, const
EpicsString &rhs);
virtual epicsBoolean operator!=(const EpicsString &lhs, const
EpicsString &rhs);
class epicsStringFactory {
public:
static EpicsString * create();
static EpicsString * create(const char *literal);
static EpicsString * create(const char *bufferType, epicsInt32
capacity);
static void destroy(EpicsString &);
};
- Navigate by Date:
- Prev:
Re: Network Accessable Types Marty Kraimer
- Next:
[Fwd: RE: Standard String] Marty Kraimer
- Index:
2002
2003
2004
<2005>
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: Network Accessable Types Ralph Lange
- Next:
[Fwd: RE: Standard String] Marty Kraimer
- Index:
2002
2003
2004
<2005>
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|