Added some boieler plate code for the MME (contruct, singleton, destruct).

master
Pedro Alvarez 7 years ago
parent b0aaa316c4
commit 136e3a2697

@ -38,7 +38,7 @@ MME Design
The srsMME must maintain three EPC interfaces, the S1-MME, the S11 and the S6a interfaces. The S1-MME will use an SCTP (many-to-one) socket and the S11 will use the GTP-Cv2 protocol over UDP. The S6a will be implmented as a Diameter application over UDP. The srsMME must maintain three EPC interfaces, the S1-MME, the S11 and the S6a interfaces. The S1-MME will use an SCTP (many-to-one) socket and the S11 will use the GTP-Cv2 protocol over UDP. The S6a will be implmented as a Diameter application over UDP.
The main loop of the MME will The main loop of the MME will
HSS Design HSS Design
********** **********

@ -33,10 +33,17 @@
#ifndef MME_H #ifndef MME_H
#define MME_H #define MME_H
#include <cstddef>
namespace srsepc{ namespace srsepc{
class mme class mme
{ {
public:
mme* get_instance(void);
void cleanup(void);
private: private:
static mme *instance; static mme *instance;

@ -24,13 +24,38 @@
* *
*/ */
#include <boost/thread/mutex.hpp>
#include "mme/mme.h" #include "mme/mme.h"
namespace srsepc{ namespace srsepc{
mme* mme::instance = NULL;
boost::mutex mme_instance_mutex;
mme*
mme::get_instance(void)
{
boost::mutex::scoped_lock lock(mme_instance_mutex);
if(NULL == instance) {
instance = new mme();
}
return(instance);
}
mme::mme() mme::mme()
{ {
} }
void
mme::cleanup(void)
{
boost::mutex::scoped_lock lock(mme_instance_mutex);
if(NULL != instance) {
delete instance;
instance = NULL;
}
}
} //namespace srsepc } //namespace srsepc

Loading…
Cancel
Save