RINASim  October 2016
Documentation of framework for OMNeT++
AEMgmtBase.cc
Go to the documentation of this file.
1 // The MIT License (MIT)
2 //
3 // Copyright (c) 2014-2016 Brno University of Technology, PRISTINE project
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to deal
7 // in the Software without restriction, including without limitation the rights
8 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 // copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 //
12 // The above copyright notice and this permission notice shall be included in
13 // all copies or substantial portions of the Software.
14 //
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 // THE SOFTWARE.
22 
23 #include <AEMgmtBase.h>
24 
26 }
27 
29 }
30 
31 void AEMgmtBase::setMyAddress(const Address& addr) {
32  MyAddress = addr;
33 }
34 
36  return MyAddress;
37 }
38 
40  //Setup MyAddress
41  cModule* ipc = this->getParentModule()->getParentModule();
42  MyAddress = Address(ipc->par(PAR_IPCADDR), ipc->par(PAR_DIFNAME));
43  EV << "SrcAddress that this RIBd will use is " << MyAddress << endl;
44 }
45 
47  long newinvoke = getParentModule()->getSubmodule(MOD_CDAP)->par(PAR_CURINVOKEID).longValue() + 1;
48  getParentModule()->getSubmodule(MOD_CDAP)->par(PAR_CURINVOKEID) = newinvoke;
49  return newinvoke;
50 }
51 
53  //Source info
54  srcApName = this->getModuleByPath("^.^.^")->par("apName").stdstringValue();
55  srcApInstance = this->getModuleByPath("^.^.^")->par("apInstance").stdstringValue();
56  srcAeName = this->par("aeName").stdstringValue();
57  srcAeInstance = this->par("aeInstance").stdstringValue();
58 
59  dstApName = this->par("dstApName").stdstringValue();
60  dstApInstance = this->par("dstApName").stdstringValue();
61  dstAeName = this->par("dstAeName").stdstringValue();
62  dstAeInstance = this->par("dstAeInstance").stdstringValue();
63 
65  this->srcAeName, this->srcAeInstance);
66 
68  this->dstAeName, this->dstAeInstance);
69 }
70 
72  return srcApni;
73 }
74 
76  return dstApni;
77 }
std::string srcAeName
Definition: AEMgmtBase.h:55
std::string dstAeInstance
Definition: AEMgmtBase.h:61
Application Process Name class.
Definition: APN.h:36
std::string dstAeName
Definition: AEMgmtBase.h:60
std::string srcApInstance
Definition: AEMgmtBase.h:54
const APNamingInfo & getDstNamingInfo() const
Definition: AEMgmtBase.cc:75
const char * PAR_IPCADDR
Definition: ExternConsts.cc:93
const APNamingInfo & getSrcNamingInfo() const
Definition: AEMgmtBase.cc:71
APNamingInfo dstApni
Definition: AEMgmtBase.h:64
Address MyAddress
Definition: AEMgmtBase.h:51
const Address & getMyAddress() const
Definition: AEMgmtBase.cc:35
APNamingInfo holds complete naming info for particular application process.
Definition: APNamingInfo.h:43
std::string dstApInstance
Definition: AEMgmtBase.h:59
const char * MOD_CDAP
Definition: ExternConsts.cc:26
std::string dstApName
Definition: AEMgmtBase.h:58
long getNewInvokeId()
Definition: AEMgmtBase.cc:46
void initMyAddress()
Definition: AEMgmtBase.cc:39
std::string srcApName
Definition: AEMgmtBase.h:53
std::string srcAeInstance
Definition: AEMgmtBase.h:56
void setMyAddress(const Address &addr)
Definition: AEMgmtBase.cc:31
const char * PAR_DIFNAME
Definition: ExternConsts.cc:94
void initNamingInfo()
Definition: AEMgmtBase.cc:52
virtual ~AEMgmtBase()
Definition: AEMgmtBase.cc:28
APNamingInfo srcApni
Definition: AEMgmtBase.h:63
const char * PAR_CURINVOKEID
Address class holds IPC Process identification.
Definition: Address.h:42