Commit d18d303c authored by jpbl's avatar jpbl
Browse files

cleaned the misuse of using namespace in headers

parent d5cc4f09
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -25,8 +25,6 @@
#include <ccrtp/rtp.h>
#include <cc++/numbers.h>
using namespace ost;
#define RTP_FRAMES2SEND 160
#define SIZEDATA SAMPLES_SIZE(RTP_FRAMES2SEND)
......@@ -37,21 +35,21 @@ class SipCall;
///////////////////////////////////////////////////////////////////////////////
// Two pair of sockets
///////////////////////////////////////////////////////////////////////////////
class AudioRtpRTX : public Thread, public TimerPort {
class AudioRtpRTX : public ost::Thread, public ost::TimerPort {
public:
AudioRtpRTX (SipCall *, AudioLayer*, bool);
~AudioRtpRTX();
Time *time; // For incoming call notification
ost::Time *time; // For incoming call notification
virtual void run ();
private:
SipCall* _ca;
AudioLayer* _audioDevice;
RTPSession* _sessionSend;
RTPSession* _sessionRecv;
SymmetricRTPSession* _session;
bool _sym;
SipCall* _ca;
AudioLayer* _audioDevice;
ost::RTPSession *_sessionSend;
ost::RTPSession *_sessionRecv;
ost::SymmetricRTPSession *_session;
bool _sym;
void initAudioRtpSession (void);
void sendSessionFromMic (unsigned char*, int16*, int16*, int, int);
......
......@@ -26,7 +26,6 @@
#include "../global.h"
using namespace ost;
typedef unsigned char* samplePtr;
......@@ -60,7 +59,7 @@ class RingBuffer {
void lock (void);
void unlock (void);
Mutex mMutex;
ost::Mutex mMutex;
int mStart;
int mEnd;
int mBufferSize;
......
......@@ -25,10 +25,6 @@
#include "../global.h"
#include "../manager.h"
using namespace std;
using namespace ost;
#define ZT_TONE_DIALTONE 0
#define ZT_TONE_BUSY 1
#define ZT_TONE_RINGTONE 2
......@@ -49,7 +45,7 @@ using namespace ost;
///////////////////////////////////////////////////////////////////////////////
// ToneThread
///////////////////////////////////////////////////////////////////////////////
class ToneThread : public Thread {
class ToneThread : public ost::Thread {
public:
ToneThread (int16 *, int);
virtual ~ToneThread (void);
......@@ -72,7 +68,7 @@ public:
/**
* Returns id selected zone for tone choice
*/
int idZoneName (const string &);
int idZoneName (const std::string &);
/**
* Calculate sinus with superposition of 2 frequencies
......@@ -112,18 +108,18 @@ private:
void initTone (void);
/*
* Count all the occurences of a character in a string
* Count all the occurences of a character in a std::string
*
* @param c character to locate
* @param str string to work on
* @param str std::string to work on
* @return return the number of time 'c' is found in 'str'
*/
int contains(const string& str, char c);
int contains(const std::string& str, char c);
//////////////////////////
// Private member variable
//////////////////////////
string toneZone[NB_ZONES_MAX][NB_TONES_MAX];
std::string toneZone[NB_ZONES_MAX][NB_TONES_MAX];
ToneThread* tonethread;
};
......
......@@ -21,9 +21,6 @@
#define __CALL_H__
#include <string>
#include <vector>
using namespace std;
enum CallState {
NotExist = 0,
......@@ -67,14 +64,14 @@ public:
void setVoIPLink (VoIPLink* voIPLink);
// Accessor and modifior of status
string getStatus (void);
void setStatus (const string& status);
std::string getStatus (void);
void setStatus (const std::string& status);
// Handle id name and id number
string getCallerIdName (void);
void setCallerIdName (const string& callerId_name);
string getCallerIdNumber (void);
void setCallerIdNumber (const string& callerId_number);
std::string getCallerIdName (void);
void setCallerIdName (const std::string& callerId_name);
std::string getCallerIdNumber (void);
void setCallerIdNumber (const std::string& callerId_number);
// Handle state
enum CallState getState (void);
......@@ -99,13 +96,13 @@ public:
bool isOutgoingType (void);
bool isIncomingType (void);
int outgoingCall (short id, const string& to);
int outgoingCall (short id, const std::string& to);
int hangup (void);
int cancel (void);
int answer (void);
int onHold (void);
int offHold (void);
int transfer (const string& to);
int transfer (const std::string& to);
int refuse (void);
private:
......@@ -115,9 +112,9 @@ private:
short _id;
enum CallState _state;
enum CallType _type;
string _callerIdName;
string _callerIdNumber;
string _status;
std::string _callerIdName;
std::string _callerIdNumber;
std::string _status;
};
#endif // __CALL_H__
......@@ -22,10 +22,9 @@
#include <cc++/thread.h>
using namespace ost;
class SipVoIPLink;
class EventThread : public Thread {
class EventThread : public ost::Thread {
public:
EventThread (SipVoIPLink*);
~EventThread (void);
......
/**
* Copyright (C) 2004-2005 Savoir-Faire Linux inc.
* Author: Jean-Philippe Barrette-LaPierre
* <jean-philippe.barrette-lapierre@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef SFLPHONEGUI_ACCOUNT_H
#define SFLPHONEGUI_ACCOUNT_H
class Account {
public:
void register(){};
void unregister(){};
};
#endif
/**
* Copyright (C) 2004-2005 Savoir-Faire Linux inc.
* Author: Jean-Philippe Barrette-LaPierre
* <jean-philippe.barrette-lapierre@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef SFLPHONEGUI_SFLPHONECLIENT_H
#define SFLPHONEGUI_SFLPHONECLIENT_H
#include <list>
#include <string>
#include <vector>
class Account;
class SFLPhoneClient
{
public:
/**
* This function just return the dotted formated
* version. like: "0.5.6"
*/
std::string version();
/**
* This function will connect the client to the
* sflphone server.
*/
void connect();
/**
* This function will disconnect the client from
* the sflphone server.
*/
void disconnect();
/**
* This function returns the current list of config
* entries of sflphone's server.
*/
std::list< ConfigEntry > listConfig();
/**
* This function will save the current config. Then,
* next time sflphone will start, it will have the
* same configuration has it is right now.
*/
void saveConfig();
/**
* This function will set the specified option
* to the value given in argument. You need to
* call the saveConfig() function if you want
* sflphone's server to keep this option for
* the next restart.
*
* Note: Be carefull because when you want
* to set the audio device, or the audio codec, you
* need to set the value of the position
* in the vector, not the description of the device,
* or the codec.
*/
void setOption(const std::string &name, const std::string &value);
/**
* This function will return the value of
* the specified option.
*/
std::string getOption(const std::string &name);
/**
* This function returns a vector containing the
* audio devices. See setOption's description note
* if you want to set the audio device.
*/
std::vector< std::string > listAudioDevices();
/**
* This function returns a vector containing the
* audio codecs. See setOption's description note
* if you want to set the audio codec.
*/
std::vector< std::string > listAudioCodecs();
/**
* This function returns a list of accounts available
* on the system.
*/
std::list< std::string > listAccounts();
/**
* This function returns the Account structure identified
* by the string given in argument. Use listAccounts() function
* if you want to know which ones are availables.
*/
Account *getAccount(const std::string &name);
}
#endif
......@@ -46,7 +46,7 @@
#include "configuration.h"
#include "configurationtree.h"
#include "error.h"
#include "skin.h"
#include "sipvoiplink.h"
#include "user_cfg.h"
#include "voIPLink.h"
#include "gui/guiframework.h"
......
......@@ -21,7 +21,6 @@
#define __MANAGER_H__
#include <cc++/thread.h>
#include <string>
#include <vector>
......@@ -29,9 +28,6 @@
#include "call.h"
#include "audio/audiodevice.h"
using namespace std;
using namespace ost;
class AudioLayer;
class CodecDescriptor;
class Error;
......@@ -57,17 +53,17 @@ class DNSService;
/*
* Define a type for a list of call
*/
typedef vector<Call*, allocator<Call*> > CallVector;
typedef std::vector< Call* > CallVector;
/*
* Define a type for a list of VoIPLink
*/
typedef vector<VoIPLink*, allocator<VoIPLink*> > VoIPLinkVector;
typedef std::vector< VoIPLink* > VoIPLinkVector;
/*
* Define a type for a list of CodecDescriptor
*/
typedef vector<CodecDescriptor*, allocator<CodecDescriptor*> > CodecDescriptorVector;
typedef std::vector< CodecDescriptor* > CodecDescriptorVector;
/*
* Structure for audio device
......@@ -146,13 +142,13 @@ public:
/*
* Functions which occur with a user's action
*/
int outgoingCall (const string& to);
int outgoingCall (const std::string& to);
int hangupCall (short id);
int cancelCall (short id);
int answerCall (short id);
int onHoldCall (short id);
int offHoldCall (short id);
int transferCall (short id, const string& to);
int transferCall (short id, const std::string& to);
void muteOn (short id);
void muteOff (short id);
int refuseCall (short id);
......@@ -161,7 +157,7 @@ public:
int registerVoIPLink (void);
int unregisterVoIPLink (void);
int quitApplication (void);
int sendTextMessage (short id, const string& message);
int sendTextMessage (short id, const std::string& message);
int accessToDirectory (void);
/**
......@@ -177,10 +173,10 @@ public:
void peerAnsweredCall (short id);
int peerRingingCall (short id);
int peerHungupCall (short id);
void displayTextMessage (short id, const string& message);
void displayErrorText (short id, const string& message);
void displayError (const string& error);
void displayStatus (const string& status);
void displayTextMessage (short id, const std::string& message);
void displayErrorText (short id, const std::string& message);
void displayError (const std::string& error);
void displayStatus (const std::string& status);
int selectedCall (void);
bool isCurrentId (short id);
void startVoiceMessageNotification (void);
......@@ -231,7 +227,7 @@ public:
*/
inline int getFirewallPort (void) { return _firewallPort; }
inline void setFirewallPort (int port) { _firewallPort = port; }
inline string getFirewallAddress (void) { return _firewallAddr; }
inline std::string getFirewallAddress (void) { return _firewallAddr; }
/*
* Manage information about audio driver
......@@ -315,7 +311,7 @@ private:
/*
* Mutex to protect access to code section
*/
Mutex _mutex;
ost::Mutex _mutex;
unsigned int _nCalls;
short _currentCallId;
......@@ -328,7 +324,7 @@ private:
/* Path of the ConfigFile
*/
string _path;
std::string _path;
int _exist;
unsigned int _nCodecs;
......@@ -343,7 +339,7 @@ private:
// To handle firewall
int _firewallPort;
string _firewallAddr;
std::string _firewallAddr;
// Variables used in exception
bool _loaded;
......
......@@ -68,8 +68,8 @@ typedef vector< CodecDescriptor* > CodecDescriptorVector;
class SipVoIPLink : public VoIPLink {
public:
SipVoIPLink (short id);
virtual ~SipVoIPLink (void);
SipVoIPLink (short id);
virtual ~SipVoIPLink();
virtual int init (void);
virtual bool checkNetwork (void);
......
#include "ThreadingSingle.hpp"
#include "singleton/SingletonHolder.hpp"
#include "singleton/LifetimeLibrary.hpp"
Supports Markdown
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