|
|
Go to the documentation of this file.
53 if( mPort<=0) return false;
54 if( mIp== "") return false;
55 if( mIp.find( ':',0)!=std::string::npos) return false;
62 if(! Valid()) return res;
69 FD_DHV( "SimplenetAddress::IpColonPort(): " << ipcolonport << " --> ?");
74 std::size_t cpos = ipcolonport.find( ':',0);
75 if(cpos==std::string::npos) return;
77 if(cpos+1>= ipcolonport.length()) return;
79 mIp=ipcolonport.substr(0,cpos);
83 FD_DHV( "SimplenetAddress::IpColonPort(): " << ipcolonport << " --> " << IpColonPort());
93 if(this-> mIp < rOther. mIp) return true;
94 if(this-> mIp > rOther. mIp) return false;
101#ifdef FAUDES_IODEVICE_SIMPLENET
121 (void) rLabel; (void) pContext;
127 (void) rLabel; (void) pContext;
129 FD_DHV( "AttributeSimplenetOutput(" << this << ")::DoRead(tr)");
161 (void) rLabel; (void) pContext;
167 (void) rLabel; (void) pContext;
169 FD_DHV( "AttributeSimplenetInput(" << this << ")::DoRead(tr)");
203 FD_DHV( "AttributeSimplenetEvent::AttributeSimplenetEvent(" << this << ")");;
204 pOutputPrototype=OutputPrototypep();
205 pInputPrototype=InputPrototypep();
212 FD_DHV( "AttributeSimplenetEvent(" << this << "): form other attr " << &rOtherAttr);
248int syncSend( int dest, const char* data, int len, int flag) {
252 int rc=send(dest, data+from, left, 0);
254 std::stringstream errstr;
255 errstr << "Simplenet fatal network error (cannot send message)";
256 throw Exception( "nDevice::syncSend", errstr.str(), 553, true);
266 FD_DHV( "nDevice(" << this << ")::nDevice()");
272 mName= "SimplenetNode";
277 faudes_mutex_init(& mMutex);
289 FD_DHV( "nDevice(" << this << ")::~nDevice()");
293 faudes_mutex_destroy(& mMutex);
298 FD_DHV( "nDevice(" << this << ")::DoCopy()");
318 FD_DHV( "nDevice(" << this << ")::Clear()");
385 FD_DHV( "nDevice(" << this << ")::Compile()");
393 FD_DHV( "nDevice::DoWrite()");
411 std::map<std::string,std::string>::const_iterator nit;
416 if(defaddress. Valid())
425 FD_DHV( "nDevice::DoReadPreface()");
435 std::stringstream errstr;
436 errstr << "Simplenet address expected at " << rTr. FileLine();
437 throw Exception( "nDevice::DoRead", errstr.str(), 50);
442 while(!rTr. Eos( "Network")) {
454 std::stringstream errstr;
455 errstr << "Simplenet address expected at " << rTr. FileLine();
456 throw Exception( "nDevice::DoRead", errstr.str(), 50);
462 if(token. IsBegin( "BroadcastAddress")) {
466 std::stringstream errstr;
467 errstr << "Simplenet address expected at " << rTr. FileLine();
468 throw Exception( "nDevice::DoRead", errstr.str(), 50);
470 rTr. ReadEnd( "BroadcastAddress");
477 while(!rTr. Eos( "Network")) {
480 std::stringstream errstr;
481 errstr << "Simplenet node name expected at " << rTr. FileLine();
482 throw Exception( "nDevice::DoRead", errstr.str(), 50);
490 if(!defaddress. Valid()) {
491 std::stringstream errstr;
492 errstr << "Simplenet node address expected at " << rTr. FileLine();
493 throw Exception( "nDevice::DoRead", errstr.str(), 50);
504#define LOCK_E {int rc = faudes_mutex_lock(&mMutex); \
505 if(rc) {FD_ERR("nDevice::LOCK_E: lock mutex error\n"); exit(1); }}
506#define UNLOCK_E {int rc = faudes_mutex_unlock(&mMutex); \
507 if(rc) {FD_ERR("nDevice::LOCK_E: unlock mutex error\n"); exit(1); }}
508#define TLOCK_E {int rc = faudes_mutex_lock(&ndevice->mMutex); \
509 if(rc) {FD_ERR("nDevice::TLOCK_E: lock mutex error\n"); exit(1); }}
510#define TUNLOCK_E {int rc = faudes_mutex_unlock(&ndevice->mMutex); \
511 if(rc) {FD_ERR("nDevice::TLOCK_E: unlock mutex error\n"); exit(1); }}
524 std::stringstream errstr;
525 errstr << "Unknown output event " << output;
526 throw Exception( "nDevice::WriteOutput", errstr.str(), 65);
532 std::stringstream errstr;
533 errstr << "Invalid output attribute " << output;
534 throw Exception( "nDevice::WriteOutput", errstr.str(), 65);
539 FD_DHV( "nDevice::WriteOutput(): message: " << message.substr(0,message.length()-1));
547 if(!sit->second.mEvents.Empty())
548 if(!sit->second.mEvents.Exists(output))
550 clientsock=sit->second.mClientSocket;
552 FD_DHV( "nDevice::WriteOutput(): to socket " << clientsock);
553 syncSend(clientsock, message.c_str(), message.length(), 0);
557 FD_DH( "nDevice::WriteOutput(): failed to notify client on socket " << clientsock);
560 FD_DHV( "nDevice::WriteOutput(): done");
574 std::map<std::string,std::string>::iterator nit;
576 if(nit->first == mName) continue;
586 int hostname_len =1023;
587 if(gethostname(hostname,hostname_len)!=0) {
588 std::stringstream errstr;
589 errstr << "Simplenet fatal network error (cannot get hostname)";
590 throw Exception( "nDevice::Start", errstr.str(), 553);
592 hostname[hostname_len]=0;
599 std::stringstream errstr;
600 errstr << "Simplenet fatal network error (cannot open server socket)";
601 throw Exception( "nDevice::Start", errstr.str(), 553);
604 faudes_setsockopt( mListenSocket,SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse));
606 struct sockaddr_in serveraddr;
607 memset(&serveraddr, 0, sizeof(serveraddr));
608 serveraddr.sin_family = AF_INET;
609 serveraddr.sin_addr.s_addr = htonl(INADDR_ANY);
612 if(bind( mListenSocket, ( struct sockaddr *) &serveraddr, sizeof(serveraddr)) <0) {
613 std::stringstream errstr;
614 errstr << "Simplenet fatal network error (cannot bind socket)";
615 throw Exception( "nDevice::Start", errstr.str(), 553);
619 std::stringstream errstr;
620 errstr << "Simplenet fatal network error (cannot listen from socket)";
621 throw Exception( "nDevice::Start", errstr.str(), 553);
626 std::stringstream errstr;
627 errstr << "Simplenet fatal network error (cannot open broadcast socket)";
628 throw Exception( "nDevice::Start", errstr.str(), 553);
631 faudes_setsockopt( mBroadcastSocket,SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse));
632 faudes_setsockopt( mBroadcastSocket,SOL_SOCKET, SO_REUSEPORT, &reuse, sizeof(reuse));
635 if(faudes_setsockopt( mBroadcastSocket, SOL_SOCKET, SO_BROADCAST, &reuse, sizeof(reuse)) ) {
636 std::stringstream errstr;
637 errstr << "Simplenet fatal network error (cannot setopt broadcast socket)";
638 throw Exception( "nDevice::Start", errstr.str(), 553);
641 struct sockaddr_in broadcastaddr;
642 memset(&broadcastaddr, 0, sizeof(broadcastaddr));
643 broadcastaddr.sin_family = AF_INET;
644 broadcastaddr.sin_addr.s_addr = htonl(INADDR_ANY);
647 if(bind( mBroadcastSocket, ( struct sockaddr *) &broadcastaddr, sizeof(broadcastaddr)) <0) {
648 std::stringstream errstr;
649 errstr << "Simplenet fatal network error (cannot bind broadcast socket)";
650 throw Exception( "nDevice::Start", errstr.str(), 553);
657 std::stringstream errstr;
658 errstr << "Simplenet fatal thread error (cannot create thread)";
659 throw Exception( "nDevice::Start", errstr.str(), 554);
667 FD_DH( "nDevice::Stop()");
673 std::string message= "<Stop> " + mNetwork + " " + mName + " </Stop>\n";
674 struct sockaddr_in broadcastaddr;
675 memset(&broadcastaddr, '\0', sizeof(broadcastaddr));
676 broadcastaddr.sin_family=AF_INET;
681 ( struct sockaddr *) & broadcastaddr, sizeof(broadcastaddr));
684 FD_DH( "nDevice::Stop(): waiting for listen thread");
686 FD_DH( "nDevice::Stop(): listen thread finished");
709 std::map<std::string,nDevice::ServerState>::iterator sit;
710 std::map<int,nDevice::ClientState>::iterator cit;
714 FD_DH( "nDevice::Listen(" << ndevice << ")");
716 faudes_systime_t lastbroadcast;
717 lastbroadcast.tv_sec=0;
718 lastbroadcast.tv_nsec=0;
719#ifdef FAUDES_DEBUG_IODEVICE
732 if(!sit->second.mAddress.Valid()) {
733 FD_DH( "nDevice::Listen(): missing server address for node: " << sit->first);
739 if(sit->second.mServerSocket<=0) {
740 FD_DH( "nDevice::Listen(): missing server connection for node: " << sit->first);
749 if(cit->second.mClientSocket<0) continue;
750 if(cit->second.mConnected) ++clientcnt;
752 int clientmis = ndevice-> mNetworkNodes.size() - (clientcnt +1);
753#ifdef FAUDES_DEBUG_IODEVICE
754 if( clientmis !=servermis)
755 FD_DH( "nDevice::Listen(): subscribed clients #"<< clientcnt << "/" << ndevice-> mNetworkNodes.size()-1);
774 faudes_systime_t now;
775 faudes_gettimeofday(&now);
776 faudes_mstime_t diffms;
780 std::string message= "<Request> "
781 + ndevice-> mNetwork + " " + ndevice-> mName + " </Request>\n";
783 struct sockaddr_in broadcastaddr;
784 memset(&broadcastaddr, '\0', sizeof(broadcastaddr));
785 broadcastaddr.sin_family=AF_INET;
790 0,( struct sockaddr *) & broadcastaddr, sizeof(broadcastaddr));
792 FD_DH( "nDevice::Listen(): broadcast request: " << message.substr(0,message.length()-1) << " #" << rc);
794 faudes_gettimeofday(&lastbroadcast);
801 if(sit->second.mServerSocket>0) continue;
803 if(!sit->second.mAddress.Valid()) continue;
805 FD_DH( "nDevice::Listen(): subscribing to " << sit->first <<
806 " at " << sit->second.mAddress.IpColonPort());
808 int serversock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
810 FD_DH( "nDevice::Listen(): subscription failed: no socket");
814 unsigned long int serverinaddr = INADDR_NONE;
815 if(serverinaddr==INADDR_NONE) {
816 FD_DH( "nDevice::Listen(): using address as advertised");
817 serverinaddr = inet_addr(sit->second.mAddress.Ip().c_str());
819 if(serverinaddr==INADDR_NONE) {
820 struct hostent *host;
821 host = gethostbyname(sit->second.mAddress.Ip().c_str());
823 FD_DH( "nDevice::Listen(): using address by name lookup");
824 serverinaddr = *( unsigned long int*) host->h_addr;
827 if(serverinaddr==INADDR_NONE) {
828 FD_DH( "nDevice::Listen(): subscription failed: invalid address " << sit->second.mAddress.Ip());
829 faudes_closesocket(serversock);
833 struct sockaddr_in serveraddress;
834 memset(&serveraddress, 0, sizeof(serveraddress));
835 serveraddress.sin_family = AF_INET;
836 serveraddress.sin_addr.s_addr=serverinaddr;
837 serveraddress.sin_port = htons(sit->second.mAddress.Port());
839 if(connect(serversock, ( struct sockaddr*) &serveraddress, sizeof(serveraddress))<0) {
840 FD_DH( "nDevice::Listen(): subscription failed: connect");
841 faudes_closesocket(serversock);
847 hello= "% Simplenet universal event subscription: "+ndevice-> mName+ " subscribing from "+sit->first+ "\n";
848 syncSend(serversock, hello.c_str(), hello.length(), 0);
849 hello= "% Expecting notifications in format '<Notify> event_name </Notify>'\n";
850 syncSend(serversock, hello.c_str(), hello.length(), 0);
851 hello= "% Trying to subscribe to all required events\n";
852 syncSend(serversock, hello.c_str(), hello.length(), 0);
854 faudes_closesocket(serversock);
858 FD_DH( "nDevice::Listen(): subscription failed: cannot write");
859 faudes_closesocket(serversock);
863 FD_DH( "nDevice::Listen(): subscribing to " << sit->first << " via socket " << serversock);
864 sit->second.mServerSocket=serversock;
867 sevents. Name( "Subscribe");
868 std::string message=sevents. ToString() + "\n";
869 syncSend(serversock,message.c_str(), message.length(),0);
876 FD_DH( "nDevice::Listen(): subscribing to " << sit->first << " via socket " << serversock << ": subscription requested sent");
885 if(mysocks_max<ndevice->mListenSocket) mysocks_max=ndevice-> mListenSocket;
886 if(mysocks_max>= FD_SETSIZE) FD_ERR( "NDeviceListen: fail to select socket " << mysocks_max);
889 if(mysocks_max< ndevice->mBroadcastSocket) mysocks_max=ndevice-> mBroadcastSocket;
890 if(mysocks_max>= FD_SETSIZE) FD_ERR( "NDeviceListen: fail to select socket " << mysocks_max);
894 int serversock=sit->second.mServerSocket;
895 if(serversock<0) continue;
896 if(mysocks_max< serversock) mysocks_max=serversock;
897 if(mysocks_max>= FD_SETSIZE) FD_ERR( "NDeviceListen: fail to select socket " << mysocks_max);
898 FD_SET(serversock, &mysocks);
902 int clientsock=cit->second.mClientSocket;
903 if(clientsock<0) continue;
904 if(mysocks_max< clientsock) mysocks_max=clientsock;
905 if(mysocks_max>= FD_SETSIZE) FD_ERR( "NDeviceListen: fail to select socket " << mysocks_max);
906 FD_SET(clientsock, &mysocks);
913 int avail=select(mysocks_max+1, &mysocks, NULL, NULL, &tv);
922 #ifdef FAUDES_DEBUG_IODEVICE
924 if((debuglisten>10) || (avail>0)) {
925 FD_DH( "nDevice::Listen(): listen as node \"" << ndevice-> mName << "\" on network \"" << ndevice-> mNetwork << "\"" << " #" << avail);
935 struct sockaddr_in clientaddr;
936 socklen_t clientaddr_len = sizeof(clientaddr);
937 clientsock=accept(ndevice-> mListenSocket, ( struct sockaddr *) &clientaddr, &clientaddr_len );
939 FD_DH( "nDevice::Listen(): failed to accept incomming connection");
942 FD_DH( "nDevice::Listen(): accepted connection from client " << inet_ntoa(clientaddr.sin_addr) <<
943 " on socket " << clientsock);
947 hello= "% Simplenet Event Server: "+ndevice-> mName+ " providing events\n";
948 syncSend(clientsock, hello.c_str(), hello.length(), 0);
949 hello= "% Notifications will have format '<Notify> event_name </Notify>'\n";
950 syncSend(clientsock, hello.c_str(), hello.length(), 0);
951 hello= "% Commands are accepted in format '<Cmd> cmd_name </Cmd>'\n";
952 syncSend(clientsock, hello.c_str(), hello.length(), 0);
953 hello= "% Supported commands are Subscribe, Info, Status, and ResetRequest\n";
954 syncSend(clientsock, hello.c_str(), hello.length(), 0);
956 faudes_closesocket(clientsock);
960 FD_DH( "nDevice::Listen(): connection test failed: cannot write");
961 faudes_closesocket(clientsock);
981 struct sockaddr_in fromaddr;
982 socklen_t fromaddr_len = sizeof(fromaddr);
983 data_len=recvfrom(ndevice-> mBroadcastSocket,data,data_len,0, ( struct sockaddr*) &fromaddr,&fromaddr_len);
984 if(data_len<0) data_len=0;
986 if(data_len>=1) if(data[data_len-1]== '\n') data[data_len-1]=0;
987 FD_DH( "nDevice::Listen(): received udp datagram " << data <<
988 " from " << inet_ntoa(fromaddr.sin_addr));
1006 if(sit->second.mServerSocket==-1) {
1007 lastbroadcast.tv_sec=0;
1008 lastbroadcast.tv_nsec=0;
1012 if(snode!=ndevice-> mName) {
1014 std::string message= "<Advert> "
1016 + ndevice-> mName + " " +
1019 struct sockaddr_in replyaddr;
1020 memset(&replyaddr, '\0', sizeof(replyaddr));
1021 replyaddr.sin_family=AF_INET;
1027 int rc = sendto(ndevice-> mBroadcastSocket,message.c_str(),message.length(),0,( struct sockaddr *) & replyaddr, sizeof(replyaddr));
1029 FD_DH( "nDevice::Listen(): reply advert: " << message.substr(0,message.length()-1) << " #" << rc);
1031 FD_DH( "nDevice::Listen(): ingoring request from myself");
1034 FD_DH( "nDevice::Listen(): ingoring request from other network");
1044 addr. Ip(inet_ntoa(fromaddr.sin_addr));
1045 FD_DHV( "nDevice::Listen(): figure actual ip address " << addr. Ip());
1048 FD_DH( "nDevice::Listen(): fallback to explicit ip address " << addr. Ip());
1050 std::map<std::string,nDevice::ServerState>::iterator sit;
1053 FD_DH( "nDevice::Listen(): ignoring irrelevant advert from " << node);
1054 } else if(sit->second.mAddress.Valid()) {
1055 FD_DH( "nDevice::Listen(): ignoring address overwrite (hardwired?) " << node);
1058 if(!sit->second.mAddress.Valid()) {
1059 FD_DH( "nDevice::Listen(): accept advert " << node);
1060 sit->second.mAddress=addr;
1061 if(sit->second.mServerSocket>=0) faudes_closesocket(sit->second.mServerSocket);
1062 sit->second.mServerSocket=-1;
1065 FD_DH( "nDevice::Listen(): ingoring advert from other network");
1069 FD_DH( "nDevice::Listen(): ignore invalid udp message");
1078 int serversock=sit->second.mServerSocket;
1079 if(serversock<0) continue;
1080 if(FD_ISSET(serversock, &mysocks)) {
1082 FD_DH( "nDevice::Listen(): reading sock " << serversock);
1085 int count = recv(serversock, buffer, 1024, 0);
1087 FD_DH( "nDevice::Listen(): reading server sock " << serversock << " : eof");
1088 faudes_closesocket(serversock);
1089 sit->second.mServerSocket=-1;
1092 FD_DH( "nDevice::Listen(): reading server sock " << serversock << ": #" << count);
1094 sit->second.mLineBuffer +=std::string(buffer);
1097 if(buffer[count-1]== '\n')
1098 if(sit->second.mLineBuffer.length()>0)
1100 const std::string& linebuffer = sit->second.mLineBuffer;
1101#ifdef FAUDES_DEBUG_IODEVICE
1102 if(linebuffer.length()>0)
1103 if(linebuffer[0]!= '%')
1104 FD_DH( "nDevice::Listen(): reading server sock " << serversock << ": line: " << linebuffer);
1110 while(tr. Peek(token)) {
1117 FD_DH( "nDevice::Listen(): found event " << event);
1126 FD_DH( "nDevice::Listen(): found device info");
1145 sevents. Read(tr, "Subscribed");
1146 FD_DH( "nDevice::Listen(): subscribed to " << sevents. ToString());
1158 FD_DH( "nDevice::Listen(): error: ignore token");
1162 FD_DH( "nDevice::Listen(): " << serversock << ": invalid notification");
1164 sit->second.mLineBuffer.clear();
1172 int clientsock=cit->second.mClientSocket;
1173 if(clientsock<0) continue;
1174 if(FD_ISSET(clientsock, &mysocks)) {
1176 FD_DH( "nDevice::Listen(): reading client sock " << clientsock);
1179 int count = recv(clientsock, buffer, 1024, 0);
1181 FD_DH( "nDevice::Listen(): reading client sock " << clientsock << " : eof");
1183 faudes_closesocket(clientsock);
1184 cit->second.mClientSocket=-1;
1185 cit->second.mConnected= false;
1189 FD_DH( "nDevice::Listen(): reading client sock " << clientsock << ": #" << count);
1191 cit->second.mLineBuffer +=std::string(buffer);
1194 if(buffer[count-1]== '\n')
1195 if(cit->second.mLineBuffer.length()>0)
1197 const std::string& linebuffer = cit->second.mLineBuffer;
1198#ifdef FAUDES_DEBUG_IODEVICE
1199 if(linebuffer.length()>0)
1200 if(linebuffer[0]!= '%')
1201 FD_DH( "nDevice::Listen(): reading client sock " << clientsock << ": line: " << linebuffer);
1207 while(tr. Peek(token)) {
1215 std::string response= "<NAck> </NAck>\n";
1216 FD_DH( "nDevice::Reply(" << clientsock << "): received cmd " << cmd);
1220 response=ndevice-> ToString() + "\n";
1232 if(cmd== "ResetRequest") {
1233 FD_DH( "nDevice::Reply(" << clientsock << "): reset request");
1241 FD_DHV( "nDevice(" << ndevice << ")::Reply: reading client sock: send response");
1242 syncSend(clientsock, response.c_str(), response.length(), 0);
1245 if(token. IsBegin( "Subscribe")) {
1247 sevents. Read(tr, "Subscribe");
1249 sevents. Name( "Subscribed");
1251 FD_DH( "nDevice::Reply(" << clientsock << "): providing events " << sevents. ToString());
1253 cit->second.mEvents.Clear();
1254 cit->second.mEvents.InsertSet(sevents);
1255 cit->second.mConnected= true;
1256 std::string response=sevents. ToString()+ "\n";
1259 FD_DHV( "nDevice(" << ndevice << ")::Reply(): reading client sock: send response");
1260 syncSend(clientsock, response.c_str(), response.length(), 0);
1264 FD_DH( "nDevice::Reply(" << clientsock << "): invalid xml B");
1269 FD_DH( "nDevice::Reply(" << clientsock << "): invalid xml A");
1271 FD_DHV( "nDevice(" << ndevice << ")::Reply(): reading client sock: done");
1272 cit->second.mLineBuffer.clear();
1279 FD_DH( "nDevice::Listen(): broadcast condition");
1291 FD_DH( "nDevice::Listen(): select error");
1297 FD_DH( "nDevice::Listen(): close client sockets");
1300 int clientsock= cit->second.mClientSocket;
1301 if(clientsock>0) faudes_closesocket(clientsock);
1302 cit->second.mClientSocket=-1;
1303 cit->second.mConnected= false;
1308 FD_DH( "nDevice::Listen(): close server sockets");
1310 int serversock=sit->second.mServerSocket;
1311 if(serversock>0) faudes_closesocket(serversock);
1312 sit->second.mServerSocket=-1;
1314 FD_DH( "nDevice::Listen(): terminating listen thread");
1315 faudes_thread_exit(NULL);
1329 std::string message= "<Cmd> ResetRequest </Cmd>\n";
1334 int serversock=sit->second.mServerSocket;
1335 if(serversock<0) continue;
1336 FD_DH( "nDevice::Reset(): sending reset request to socket " << serversock);
1337 syncSend(serversock, message.c_str(), message.length(), 0);
#define FAUDES_TYPE_IMPLEMENTATION(ftype, ctype, cbase)
const AttributeVoid * pOutputPrototype
const AttributeVoid * pInputPrototype
void DoCopy(const AttributeSimplenetEvent &rSrc)
AttributeSimplenetEvent(void)
static const AttributeSimplenetInput * InputPrototypep(void)
static const AttributeSimplenetOutput * OutputPrototypep(void)
virtual void DoRead(TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
const std::string & Name(void) const
bool Exists(const Idx &rIndex) const
void SymbolicName(Idx index, const std::string &rName)
Idx Index(const std::string &rName) const
void RestrictSet(const NameSet &rOtherSet)
bool operator<(const SimplenetAddress &rOther) const
std::string IpColonPort(void) const
std::string Ip(void) const
std::string FileLine(void) const
bool Eos(const std::string &rLabel)
void ReadEnd(const std::string &rLabel)
std::string ReadString(void)
void ReadBegin(const std::string &rLabel)
void WriteEnd(const std::string &rLabel)
const std::string & StringValue(void) const
@ Begin <label> (begin of section)
bool IsString(void) const
bool ExistsAttributeString(const std::string &name)
void SetEmpty(const std::string &rName)
void SetBegin(const std::string &rName)
void InsAttributeString(const std::string &name, const std::string &value)
const std::string & AttributeStringValue(const std::string &name)
TokenType Type(void) const
void Read(const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
std::string ToString(const std::string &rLabel="", const Type *pContext=0) const
void BroadcastAddress(const std::string &rAddr)
void InsNode(const std::string &rNodeName)
void DoMove(nDevice &rSrcAttr)
void ServerAddress(const std::string &rAddr)
virtual void Compile(void)
virtual void DoReadPreface(TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
void InsNodeAddress(const std::string &rNode, const std::string &rAddress)
void DoCopy(const nDevice &rSrc)
SimplenetAddress mListenAddress
TaNameSet< AttributeSimplenetEvent > * pConfiguration
std::map< std::string, EventSet > mInputSubscriptions
void NetworkName(const std::string &rNetwork)
faudes_thread_t mThreadListen
std::map< std::string, ServerState > mInputServerStates
void InsOutputEvent(const std::string &event)
virtual void DoWritePreface(TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
std::map< int, ClientState > mOutputClientStates
friend void * NDeviceListen(void *)
SimplenetAddress mEffectiveListenAddress
virtual void WriteOutput(Idx output)
SimplenetAddress mBroadcastAddress
std::map< std::string, std::string > mNetworkNodes
void InsInputEvent(const std::string &event)
faudes_mutex_t * pBufferMutex
virtual const EventSet & Inputs(void) const
virtual void Compile(void)
std::string mDefaultLabel
faudes_cond_t * pWaitCondition
virtual void DoReadPreface(TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
EventSet * mpConfiguration
virtual void DoWritePreface(TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
faudes_mutex_t * pWaitMutex
std::deque< Idx > * pInputBuffer
virtual const EventSet & Outputs(void) const
void * NDeviceListen(void *arg)
Idx ToIdx(const std::string &rString)
AutoRegisterType< nDevice > gRtiRegisterSimplenetDevice("SimplenetDevice")
std::string ToStringInteger(Int number)
int syncSend(int dest, const char *data, int len, int flag)
libFAUDES 2.34e
--- 2026.03.16
--- c++ api documentaion by doxygen
|