summaryrefslogtreecommitdiff
path: root/tubes/inc
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@gmail.com>2012-07-21 18:50:35 +0200
committerMatúš Kukan <matus.kukan@gmail.com>2012-07-21 22:09:12 +0200
commit4d8e800d05683434637ffc9610905a1b89427f1d (patch)
treef669a9e206eef8f391fc659d28286aec709a2e94 /tubes/inc
parent20b8d8957fad3b909151bb9c2aa8fb4b3adcc705 (diff)
tubes: remove TelePacket, it's just simple string
Change-Id: Iabfb50454c573ac9c01aba1b309822c4ef6fcc73
Diffstat (limited to 'tubes/inc')
-rw-r--r--tubes/inc/tubes/conference.hxx19
-rw-r--r--tubes/inc/tubes/manager.hxx1
-rw-r--r--tubes/inc/tubes/packet.hxx83
3 files changed, 7 insertions, 96 deletions
diff --git a/tubes/inc/tubes/conference.hxx b/tubes/inc/tubes/conference.hxx
index 29d4cefa2b04..54638f2bc4e8 100644
--- a/tubes/inc/tubes/conference.hxx
+++ b/tubes/inc/tubes/conference.hxx
@@ -31,15 +31,12 @@
#include <sal/config.h>
#include "tubes/tubesdllapi.h"
-#include "tubes/packet.hxx"
#include "tubes/file-transfer-helper.h"
#include <rtl/ustring.hxx>
#include <telepathy-glib/telepathy-glib.h>
#include <queue>
#include <tubes/warnings_guard_boost_signals2.hpp>
-typedef ::std::queue<TelePacket> TelePacketQueue;
-
class TeleManager;
/** Conference setup by TeleManager */
@@ -58,22 +55,19 @@ public:
TeleManager* getManager() const { return mpManager; }
- /** @param rPacket
- non-const on purpose, see TelePacket::getData()
- */
- TUBES_DLLPUBLIC bool sendPacket( TelePacket& rPacket );
+ TUBES_DLLPUBLIC bool sendPacket( const OString& rPacket );
/** Pop a received packet. */
- bool popPacket( TelePacket& rPacket );
+ bool popPacket( OString& rPacket );
- /** Queue incoming data as TelePacket */
- void queue( const char* pDBusSender, const char* pPacket, int nSize );
- void queue( TelePacket &rPacket );
+ /** Queue incoming data as OString */
+ void queue( const char* pPacket, int nSize );
+ void queue( const OString& rPacket );
TUBES_DLLPUBLIC void invite( TpContact *pContact );
/** Emitted when a packet is received. */
- boost::signals2::signal<void (TelePacket&)> sigPacketReceived;
+ boost::signals2::signal<void (const OString&)> sigPacketReceived;
typedef void (*FileSentCallback)( bool aSuccess, void* pUserData);
TUBES_DLLPUBLIC void sendFile( rtl::OUString &localUri, FileSentCallback pCallback, void* pUserData);
@@ -107,6 +101,7 @@ public:
void* pUserData);
private:
+ typedef ::std::queue<OString> TelePacketQueue;
bool spinUntilTubeEstablished();
bool setTube( GDBusConnection* pTube);
diff --git a/tubes/inc/tubes/manager.hxx b/tubes/inc/tubes/manager.hxx
index f495c247ada3..d51154e54991 100644
--- a/tubes/inc/tubes/manager.hxx
+++ b/tubes/inc/tubes/manager.hxx
@@ -32,7 +32,6 @@
#include <sal/config.h>
#include "tubes/tubesdllapi.h"
#include "tubes/conference.hxx"
-#include "tubes/packet.hxx"
#include "tubes/contact-list.hxx"
#include <rtl/ustring.hxx>
#include <salhelper/thread.hxx>
diff --git a/tubes/inc/tubes/packet.hxx b/tubes/inc/tubes/packet.hxx
deleted file mode 100644
index 21136fba33da..000000000000
--- a/tubes/inc/tubes/packet.hxx
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * Version: MPL 1.1 / GPLv3+ / LGPLv3+
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License or as specified alternatively below. You may obtain a copy of
- * the License at http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * Major Contributor(s):
- * Copyright (C) 2012 Red Hat, Inc., Eike Rathke <erack@redhat.com>
- *
- * All Rights Reserved.
- *
- * For minor contributions see the git repository.
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
- * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
- * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
- * instead of those above.
- */
-
-#ifndef INCLUDED_TUBES_PACKET_HXX
-#define INCLUDED_TUBES_PACKET_HXX
-
-#include <sal/config.h>
-#include <rtl/string.hxx>
-#include <rtl/byteseq.hxx>
-
-
-class TelePacket
-{
-public:
-
- TelePacket( const char* pSender, const char* pData, int nSize )
- :
- maSender( pSender),
- maData( reinterpret_cast<const sal_Int8*>(pData), static_cast<sal_Int32>(nSize) )
- {
- }
-
- explicit TelePacket( const TelePacket& r )
- :
- maSender( r.maSender),
- maData( r.maData)
- {
- }
-
- TelePacket() {}
-
- /** Underlying getArray() ensures reference count is exactly one, hence
- this method is non-const! */
- const char* getData() { return reinterpret_cast<const char*>( maData.getArray()); }
- sal_Int32 getSize() const { return maData.getLength(); }
-
- bool operator==( const TelePacket& r ) const
- { return maSender == r.maSender && maData == r.maData; }
-
- TelePacket& operator=( const TelePacket& r )
- {
- if (this == &r)
- return *this;
- maSender = r.maSender;
- maData = r.maData;
- return *this;
- }
-
-private:
-
- rtl::OString maSender;
- rtl::ByteSequence maData;
-
-};
-
-#endif // INCLUDED_TUBES_PACKET_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */