Skip to content

Commit

Permalink
flesh out api for dlls on windows
Browse files Browse the repository at this point in the history
svn path=/tags/yarp-2.3.3/; revision=8499
  • Loading branch information
paulfitz committed Mar 1, 2011
1 parent 6ab9b99 commit b1bf726
Show file tree
Hide file tree
Showing 44 changed files with 105 additions and 77 deletions.
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/BinPortable.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace yarp {
* languages, operating systems, or processor architectures.
*/
template <class T>
class YARP_OS_API yarp::os::BinPortable : public Portable {
class yarp::os::BinPortable : public Portable {
private:
T t;

Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/BufferedPort.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace yarp {
* (see BufferedPort::read and BufferedPort::write).
*/
template <class T>
class YARP_OS_API yarp::os::BufferedPort : public Contactable,
class yarp::os::BufferedPort : public Contactable,
public TypedReader<T>, public TypedReaderCallback<T>
{
public:
Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/LocalReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace yarp {
*
*/
template <class T>
class YARP_OS_API yarp::os::LocalReader {
class yarp::os::LocalReader {
public:

virtual ~LocalReader() {}
Expand Down
2 changes: 2 additions & 0 deletions src/libYARP_OS/include/yarp/os/ManagedBytes.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ class YARP_OS_API yarp::os::ManagedBytes {
use = -1;
}

bool allocateOnNeed(int neededLen, int allocateLen);

/**
* Makes sure data block is owned, making a copy if necessary.
*/
Expand Down
8 changes: 4 additions & 4 deletions src/libYARP_OS/include/yarp/os/PortReaderBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ YARP_OS_API void typedReaderMissingCallback();
*
*/
template <class T>
class YARP_OS_API yarp::os::TypedReaderCallback {
class yarp::os::TypedReaderCallback {
public:
/**
* Destructor.
Expand Down Expand Up @@ -79,7 +79,7 @@ class YARP_OS_API yarp::os::TypedReaderCallback {
* BufferedPort or a PortReaderBuffer.
*/
template <class T>
class YARP_OS_API yarp::os::TypedReader {
class yarp::os::TypedReader {
public:
/**
* Call this to strictly keep all messages, or allow old ones
Expand Down Expand Up @@ -290,7 +290,7 @@ class YARP_OS_API yarp::os::impl::PortReaderBufferBase : public yarp::os::PortRe


template <class T>
class YARP_OS_API yarp::os::TypedReaderThread : public Thread {
class yarp::os::TypedReaderThread : public Thread {
public:
TypedReader<T> *reader;
TypedReaderCallback<T> *callback;
Expand Down Expand Up @@ -335,7 +335,7 @@ class YARP_OS_API yarp::os::TypedReaderThread : public Thread {
* class, such as Bottle.
*/
template <class T>
class YARP_OS_API yarp::os::PortReaderBuffer :
class yarp::os::PortReaderBuffer :
public yarp::os::TypedReader<T>,
public yarp::os::LocalReader<T>,
public yarp::os::impl::PortReaderBufferBaseCreator {
Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/PortWriterBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class YARP_OS_API yarp::os::PortWriterBufferBase {
* attach(). "T" should be a PortWriter class, such as Bottle.
*/
template <class T>
class YARP_OS_API yarp::os::PortWriterBuffer : public PortWriterBufferBase {
class yarp::os::PortWriterBuffer : public PortWriterBufferBase {
public:

//typedef T Type;
Expand Down
72 changes: 38 additions & 34 deletions src/libYARP_OS/include/yarp/os/PortablePair.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,13 @@

namespace yarp {
namespace os {
class PortablePairBase;
template <class HEAD, class BODY> class PortablePair;
}
}

/**
* Group a pair of objects to be sent and received together.
* Handy for adding general-purpose headers, for example.
*/
template <class HEAD, class BODY>
class YARP_OS_API yarp::os::PortablePair : public Portable {
class YARP_OS_API yarp::os::PortablePairBase : public Portable {
public:
/**
* An object of the first type (HEAD).
*/
HEAD head;

/**
* An object of the second type (BODY).
*/
BODY body;

/**
* Reads this object pair from a network connection.
* @param connection an interface to the network connection for reading
* @return true iff the object pair was successfully read
*/
virtual bool read(ConnectionReader& connection) {
return readPair(connection,head,body);
}

/**
* Reads an object pair from a network connection.
* @param connection an interface to the network connection for reading
Expand All @@ -70,15 +47,6 @@ class YARP_OS_API yarp::os::PortablePair : public Portable {
return ok;
}

/**
* Writes this object pair to a network connection.
* @param connection an interface to the network connection for writing
* @return true iff the object pair was successfully written
*/
virtual bool write(ConnectionWriter& connection) {
return writePair(connection,head,body);
}

/**
* Writes an object pair to a network connection.
* @param connection an interface to the network connection for writing
Expand All @@ -104,6 +72,42 @@ class YARP_OS_API yarp::os::PortablePair : public Portable {

return ok;
}
};

/**
* Group a pair of objects to be sent and received together.
* Handy for adding general-purpose headers, for example.
*/
template <class HEAD, class BODY>
class yarp::os::PortablePair : public PortablePairBase {
public:
/**
* An object of the first type (HEAD).
*/
HEAD head;

/**
* An object of the second type (BODY).
*/
BODY body;

/**
* Reads this object pair from a network connection.
* @param connection an interface to the network connection for reading
* @return true iff the object pair was successfully read
*/
virtual bool read(ConnectionReader& connection) {
return readPair(connection,head,body);
}

/**
* Writes this object pair to a network connection.
* @param connection an interface to the network connection for writing
* @return true iff the object pair was successfully written
*/
virtual bool write(ConnectionWriter& connection) {
return writePair(connection,head,body);
}

/**
* This is called when the port has finished all writing operations.
Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/Run.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace yarp {
#undef main
#endif

class YarpRunInfoVector;
class YARP_OS_API YarpRunInfoVector;

/*
* Typical Yarp applications consist of several intercommunicating modules distributed on different machines.
Expand Down
4 changes: 4 additions & 0 deletions src/libYARP_OS/include/yarp/os/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@
# endif
#endif

#ifndef YARP_OS_impl_API
#define YARP_OS_impl_API YARP_OS_API
#endif

#endif
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/impl/AbstractCarrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace yarp {
* A starter class for implementing simple carriers.
* It implements reasonable default behavior.
*/
class yarp::os::impl::AbstractCarrier : public Carrier {
class YARP_OS_impl_API yarp::os::impl::AbstractCarrier : public Carrier {
public:

virtual Carrier *create() = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/impl/Address.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace yarp {
* This may need to be extended for other systems, e.g. QNX.
*
*/
class yarp::os::impl::Address {
class YARP_OS_impl_API yarp::os::impl::Address {
private:
String name, carrier, regName;
int port;
Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/impl/BottleImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ class yarp::os::impl::StoreList : public Storable {
* Handy to use until you work out how to make your own more
* efficient formats for transmission.
*/
class yarp::os::impl::BottleImpl : public yarp::os::Portable {
class YARP_OS_impl_API yarp::os::impl::BottleImpl : public yarp::os::Portable {
public:

BottleImpl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace yarp {
/**
* A helper for creating cached object descriptions.
*/
class yarp::os::impl::BufferedConnectionWriter : public ConnectionWriter, public SizedWriter {
class YARP_OS_impl_API yarp::os::impl::BufferedConnectionWriter : public ConnectionWriter, public SizedWriter {
public:

BufferedConnectionWriter(bool textMode = false) : textMode(textMode) {
Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/impl/Carrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace yarp {
*
*
*/
class yarp::os::impl::Carrier {
class YARP_OS_impl_API yarp::os::impl::Carrier {
public:


Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/impl/Carriers.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace yarp {
* This is the starting point for creating connections
* between ports.
*/
class yarp::os::impl::Carriers {
class YARP_OS_impl_API yarp::os::impl::Carriers {
public:

/**
Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/impl/Companion.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace yarp {
/**
* Implementation of a standard set of YARP utilities.
*/
class yarp::os::impl::Companion {
class YARP_OS_impl_API yarp::os::impl::Companion {
public:

static String version();
Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/impl/DgramTwoWayStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace yarp {
* A stream abstraction for datagram communication. It supports UDP and
* MCAST. This class is not concerned with making the stream reliable.
*/
class yarp::os::impl::DgramTwoWayStream : public TwoWayStream, public InputStream, public OutputStream {
class YARP_OS_impl_API yarp::os::impl::DgramTwoWayStream : public TwoWayStream, public InputStream, public OutputStream {

public:
DgramTwoWayStream() : mutex(1) {
Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/impl/Election.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace yarp {
* where a manager is required for some resource used by several
* peers, but it doesn't matter which peer plays that role.
*/
class yarp::os::impl::Election {
class YARP_OS_impl_API yarp::os::impl::Election {
private:
typedef void *voidPtr;

Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/impl/FallbackNameClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace yarp {
* A client for the FallbackNameServer class. Provides a last-resort
* means of searching for the name server.
*/
class yarp::os::impl::FallbackNameClient : public ThreadImpl {
class YARP_OS_impl_API yarp::os::impl::FallbackNameClient : public ThreadImpl {
public:
FallbackNameClient() {
closed = false;
Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/impl/FallbackNameServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace yarp {
* Multi-cast server, for last resort information sharing about
* name information -- when config files are missing or wrong
*/
class yarp::os::impl::FallbackNameServer : public ThreadImpl {
class YARP_OS_impl_API yarp::os::impl::FallbackNameServer : public ThreadImpl {
public:
FallbackNameServer(NameServerStub& owner) : owner(owner) {
closed = false;
Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/impl/InputProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace yarp {
/**
* The input side of an active connection between two ports.
*/
class yarp::os::impl::InputProtocol {
class YARP_OS_impl_API yarp::os::impl::InputProtocol {
public:
virtual ~InputProtocol() {}

Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/impl/InputStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace yarp {
* Simple specification of the minimum functions needed from input streams.
* The streams could be TCP, UDP, MCAST, ...
*/
class yarp::os::impl::InputStream {
class YARP_OS_impl_API yarp::os::impl::InputStream {
public:
/**
*
Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/impl/Logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace yarp {
* and ACE.
*
*/
class yarp::os::impl::Logger : public ACE_Log_Msg_Callback {
class YARP_OS_impl_API yarp::os::impl::Logger : public ACE_Log_Msg_Callback {
public:
enum Level {
DEBUG = LM_DEBUG,
Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/impl/Name.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace yarp {
/**
* Simple abstraction for a YARP port name.
*/
class yarp::os::impl::Name {
class YARP_OS_impl_API yarp::os::impl::Name {
public:

/**
Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/impl/NameClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace yarp {
* name server these days - it is now a regular port, that can read
* and respond to messages in the bottle format.
*/
class yarp::os::impl::NameClient {
class YARP_OS_impl_API yarp::os::impl::NameClient {
public:

/**
Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/impl/NameConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace yarp {
* Small helper class to help deal with legacy YARP configuration files.
*
*/
class yarp::os::impl::NameConfig {
class YARP_OS_impl_API yarp::os::impl::NameConfig {
public:

String getConfigFileName(const char *stem = NULL);
Expand Down
4 changes: 2 additions & 2 deletions src/libYARP_OS/include/yarp/os/impl/NameServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace yarp {
/**
* Stub for a YARP2-conforming name server.
*/
class yarp::os::impl::NameServerStub {
class YARP_OS_impl_API yarp::os::impl::NameServerStub {
public:
virtual ~NameServerStub() {}
virtual String apply(const String& txt, const Address& remote) = 0;
Expand All @@ -51,7 +51,7 @@ class yarp::os::impl::NameServerStub {
/**
* Implementation of a YARP2-conforming name server.
*/
class yarp::os::impl::NameServer : public NameServerStub {
class YARP_OS_impl_API yarp::os::impl::NameServer : public NameServerStub {
public:

NameServer() : nameMap(17), hostMap(17), mutex(1) {
Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/impl/NetType.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace yarp {
/**
* Various utilities related to types and formats.
*/
class yarp::os::impl::NetType {
class YARP_OS_impl_API yarp::os::impl::NetType {
public:

static int netInt(const yarp::os::Bytes& code) {
Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/impl/OutputProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace yarp {
/**
* The output side of an active connection between two ports.
*/
class yarp::os::impl::OutputProtocol {
class YARP_OS_impl_API yarp::os::impl::OutputProtocol {
public:
// all can throw IOException

Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_OS/include/yarp/os/impl/OutputStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace yarp {
* Simple specification of the minimum functions needed from output streams.
* The streams could be TCP, UDP, MCAST, ...
*/
class yarp::os::impl::OutputStream {
class YARP_OS_impl_API yarp::os::impl::OutputStream {
public:

/**
Expand Down
Loading

0 comments on commit b1bf726

Please sign in to comment.