"Fossies" - the Fresh Open Source Software Archive

Member "netxms-3.8.166/src/libnxmb/filter.cpp" (23 Feb 2021, 1531 Bytes) of package /linux/misc/netxms-3.8.166.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "filter.cpp" see the Fossies "Dox" file reference documentation.

    1 /* 
    2 ** NetXMS - Network Management System
    3 ** NetXMS Message Bus Library
    4 ** Copyright (C) 2009-2017 Victor Kirhenshtein
    5 **
    6 ** This program is free software; you can redistribute it and/or modify
    7 ** it under the terms of the GNU General Public License as published by
    8 ** the Free Software Foundation; either version 2 of the License, or
    9 ** (at your option) any later version.
   10 **
   11 ** This program is distributed in the hope that it will be useful,
   12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
   13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   14 ** GNU General Public License for more details.
   15 **
   16 ** You should have received a copy of the GNU General Public License
   17 ** along with this program; if not, write to the Free Software
   18 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   19 **
   20 ** File: filter.cpp
   21 **
   22 **/
   23 
   24 #include "libnxmb.h"
   25 
   26 
   27 //
   28 // Basic filter class implementation
   29 //
   30 
   31 NXMBFilter::NXMBFilter()
   32 {
   33 }
   34 
   35 NXMBFilter::~NXMBFilter()
   36 {
   37 }
   38 
   39 bool NXMBFilter::isAllowed(NXMBMessage &msg)
   40 { 
   41     return true;
   42 }
   43 
   44 bool NXMBFilter::isOwnedByDispatcher()
   45 {
   46     return true;
   47 }
   48 
   49 /**
   50  * Filter by message type implementation
   51  */
   52 NXMBTypeFilter::NXMBTypeFilter()
   53                :NXMBFilter()
   54 {
   55 }
   56 
   57 NXMBTypeFilter::~NXMBTypeFilter()
   58 {
   59 }
   60 
   61 bool NXMBTypeFilter::isAllowed(NXMBMessage &msg)
   62 { 
   63     return m_types.get(msg.getType()) != NULL;
   64 }
   65 
   66 void NXMBTypeFilter::addMessageType(const TCHAR *type)
   67 { 
   68     m_types.set(type, _T("*"));
   69 }
   70 
   71 void NXMBTypeFilter::removeMessageType(const TCHAR *type)
   72 { 
   73     m_types.remove(type);
   74 }