Hi Canh,

Ack from me. A minor comment, I think we need to update the commit
message and the title, so that it would tell the main content of this
patch since majority of code changes are for refactoring, only a minor
code fix is for the defect reported in ticket.

Thanks,

Minh


On 18/09/18 21:59, Canh Van Truong wrote:
> NtfReader filter  with searchcriteria then create the cached list 
> notification.
> But the filter is not correct. The patch update the the filter of search 
> criteria
> and the read next of notification.
> ---
>  src/ntf/apitest/ntf_search_criteria_test.sh |  26 +-
>  src/ntf/ntfd/NtfReader.cc                   | 371 
> +++++-----------------------
>  src/ntf/ntfd/NtfReader.h                    | 117 +++------
>  3 files changed, 106 insertions(+), 408 deletions(-)
>  mode change 100755 => 100644 src/ntf/apitest/ntf_search_criteria_test.sh
>
> diff --git a/src/ntf/apitest/ntf_search_criteria_test.sh 
> b/src/ntf/apitest/ntf_search_criteria_test.sh
> old mode 100755
> new mode 100644
> index 1ece4ffed..c183d3f2e
> --- a/src/ntf/apitest/ntf_search_criteria_test.sh
> +++ b/src/ntf/apitest/ntf_search_criteria_test.sh
> @@ -52,28 +52,28 @@ read_marked()
>      ver  "expected_sequence:  \"$expected_sequence\""
>      ver  "searchCriteria  : \"$sc\""
>      ver  "search direction: \"$sd\""
> -     if expr "$expected_sequence" '!=' "$res" >/dev/null; then
> -     echo "FAILED"
> -     exit $sc
> -     fi
> -     ver  "PASSED"
> +    if expr "$expected_sequence" '!=' "$res" >/dev/null; then
> +        echo "FAILED: expected($expected_sequence) - result($res)"
> +        exit $sc
> +    fi
> +    ver  "PASSED"
>      return 0
>  }
>  
>  ver  "SA_NTF_SEARCH_BEFORE_OR_AT_TIME = 1"
> -read_marked "4 " "1" ""
> +read_marked "1 2 3 4 4 4 3 2 " "1" ""
>  
>  ver  "SA_NTF_SEARCH_AT_TIME = 2"
>  read_marked "4 4 4 " "2" ""
>  
>  ver  "SA_NTF_SEARCH_AT_OR_AFTER_TIME = 3"
> -read_marked "4 5 6 7 4 8 9 4 10 3 11 2 12 " "3" ""
> +read_marked "4 5 6 7 4 8 9 4 10 11 12 " "3" ""
>  
>  ver  "SA_NTF_SEARCH_BEFORE_TIME = 4"
> -read_marked "3 " "4" ""
> +read_marked "1 2 3 3 2 " "4" ""
>  
>  ver  "SA_NTF_SEARCH_AFTER_TIME = 5"
> -read_marked "10 3 11 2 12 " "5" ""
> +read_marked "5 6 7 8 9 10 11 12 " "5" ""
>  
>  ver  "SA_NTF_SEARCH_NOTIFICATION_ID = 6"
>  read_marked "12 " "6" "-i $nid"
> @@ -85,19 +85,19 @@ ver  "--------------------------------------"
>  ver  "      Read OLDER"
>  ver  "--------------------------------------"
>  ver  "SA_NTF_SEARCH_BEFORE_OR_AT_TIME = 1"
> -read_marked "4 9 8 4 7 6 5 4 3 2 1 " "1" "-o"
> +read_marked "2 3 4 4 4 3 2 1 " "1" "-o"
>  
>  ver "SA_NTF_SEARCH_AT_TIME = 2"
>  read_marked "4 4 4 " "2" "-o"
>  
>  ver "SA_NTF_SEARCH_AT_OR_AFTER_TIME = 3"
> -read_marked "4 " "3" "-o"
> +read_marked "12 11 10 4 9 8 4 7 6 5 4 " "3" "-o"
>  
>  ver "SA_NTF_SEARCH_BEFORE_TIME = 4"
> -read_marked "3 2 1 " "4" "-o"
> +read_marked "2 3 3 2 1 " "4" "-o"
>  
>  ver "SA_NTF_SEARCH_AFTER_TIME = 5"
> -read_marked "10 " "5" "-o"
> +read_marked "12 11 10 9 8 7 6 5 " "5" "-o"
>  
>  ver "SA_NTF_SEARCH_NOTIFICATION_ID = 6"
>  read_marked "12 " "6" "-i $nid"
> diff --git a/src/ntf/ntfd/NtfReader.cc b/src/ntf/ntfd/NtfReader.cc
> index c2c6b003d..af6e85b91 100644
> --- a/src/ntf/ntfd/NtfReader.cc
> +++ b/src/ntf/ntfd/NtfReader.cc
> @@ -45,20 +45,12 @@
>   * ========================================================================
>   */
>  
> -/**
> - *   NtfReader object creates a copy of the current cashed
> - *   notifications. The private forward iterator ffIter is set
> - *   to first element.
> - *   @param ntfLogger
> - *   @param readerId
> - *
> - */
>  NtfReader::NtfReader(NtfLogger& ntfLogger, unsigned int readerId,
>      ntfsv_reader_init_req_t *req)
>      : coll_(ntfLogger.coll_),
>        ffIter(coll_.begin()),
>        readerId_(readerId),
> -      c_filter_(0),
> +      hasFilter_(false),
>        firstRead_(true),
>        read_init_req_(*req){
>    searchCriteria_.eventTime = 0;
> @@ -67,28 +59,15 @@ NtfReader::NtfReader(NtfLogger& ntfLogger, unsigned int 
> readerId,
>    TRACE_3("ntfLogger.coll_.size: %u", (unsigned int)ntfLogger.coll_.size());
>  }
>  
> -/**
> - *   NtfReader object creates a copy of the current cashed
> - *   notifications that matches the filter and the search
> - *   criteria. The private forward iterator ffIter is set
> - *   according to the searchCriteria. This constructor is used
> - *   when filter is provided.
> - *
> - *   @param ntfLogger
> - *   @param readerId
> - *   @param searchCriteria
> - *   @param f_rec - filter record
> - *   @param firstRead
> - */
>  NtfReader::NtfReader(NtfLogger& ntfLogger, unsigned int readerId,
>      ntfsv_reader_init_req_2_t *req)
>      : readerId_(readerId),
> +      hasFilter_(true),
>        firstRead_(true),
>        read_init_2_req_(*req){
>    TRACE_3("New NtfReader with filter, ntfLogger.coll_.size: %u",
>            (unsigned int)ntfLogger.coll_.size());
>    searchCriteria_ = req->head.searchCriteria;
> -  c_filter_ = NtfCriteriaFilter::getCriteriaFilter(searchCriteria_, this);
>    if (req->f_rec.alarm_filter) {
>      NtfFilter* filter = new NtfAlarmFilter(req->f_rec.alarm_filter);
>      filterMap[filter->type()] = filter;
> @@ -108,25 +87,11 @@ NtfReader::~NtfReader() {
>      delete filter;
>      filterMap.erase(posN++);
>    }
> -  delete c_filter_;
>  }
>  
> -/**
> - * This method is called to check which notifications that
> - * matches the filtering criterias.
> - *
> - * For those notifications that matches the different
> - * notification type filter criterias (only alarms and security
> - * alarms notification types is possible) a help object derived
> - * from NtfCriteriaFilter class will save notifcations in the
> - * NtfReader collection that matches the saNtfSearchCriteria
> - * that has been set.
> - *
> - *   @param ntfLogger
> - */
>  void NtfReader::filterCacheList(NtfLogger& ntfLogger) {
>    TRACE_ENTER();
> -  if (c_filter_ != nullptr) {
> +  if (hasFilter_ == true) {
>      readerNotificationListT::iterator rpos;
>      for (rpos = ntfLogger.coll_.begin(); rpos != ntfLogger.coll_.end(); 
> rpos++) {
>        NtfSmartPtr n(*rpos);
> @@ -138,27 +103,63 @@ void NtfReader::filterCacheList(NtfLogger& ntfLogger) {
>          rv = filter->checkFilter(n);
>        }
>        if (rv) {
> -        if (!c_filter_->filter(n)) break;
> +        if (filterSearchCriteria(n)) break;
>        }
>      }
> -    c_filter_->finalize();
>    } else {
>      coll_ = ntfLogger.coll_;
>    }
> +
> +  ffIter = coll_.begin();
>    TRACE_LEAVE();
>  }
>  
> -/**
> - *   This method returns the notification at the current
> - *   position of the iterator ffIter if search direction is
> - *   SA_NTF_SEARCH_YOUNGER. The first search will give the same
> - *   result for both search directions.
> - *
> - *   @param searchDirection
> - *   @param error - outparam tells if the operation succeded
> - *   @return NtfNotification - an empty non initialized
> - *           notification will be returned if error != SA_AIS_OK
> - */
> +bool NtfReader::filterSearchCriteria(NtfSmartPtr& notification) {
> +  bool filter_done = false;
> +  switch (searchCriteria_.searchMode) {
> +    case SA_NTF_SEARCH_BEFORE_OR_AT_TIME:
> +      if (*notification->header()->eventTime <= searchCriteria_.eventTime)
> +        coll_.push_back(notification);
> +      break;
> +
> +    case SA_NTF_SEARCH_AT_TIME:
> +      if (*notification->header()->eventTime == searchCriteria_.eventTime)
> +        coll_.push_back(notification);
> +      break;
> +
> +    case SA_NTF_SEARCH_AT_OR_AFTER_TIME:
> +      if (*notification->header()->eventTime >= searchCriteria_.eventTime)
> +        coll_.push_back(notification);
> +      break;
> +
> +    case SA_NTF_SEARCH_BEFORE_TIME:
> +      if (*notification->header()->eventTime < searchCriteria_.eventTime)
> +        coll_.push_back(notification);
> +      break;
> +
> +    case SA_NTF_SEARCH_AFTER_TIME:
> +      if (*notification->header()->eventTime > searchCriteria_.eventTime)
> +        coll_.push_back(notification);
> +      break;
> +
> +    case SA_NTF_SEARCH_NOTIFICATION_ID:
> +      if (*notification->header()->notificationId ==
> +                                searchCriteria_.notificationId) {
> +        coll_.push_back(notification);
> +        filter_done = true;
> +      }
> +      break;
> +
> +    case SA_NTF_SEARCH_ONLY_FILTER:
> +    default:
> +      unsigned int nId = notification->getNotificationId();
> +      TRACE_3("nId: %u added to readerList", nId);
> +      coll_.push_back(notification);
> +      break;
> +  }
> +  return filter_done;
> +}
> +
>  NtfSmartPtr NtfReader::next(SaNtfSearchDirectionT direction,
>                              SaAisErrorT* error) {
>    TRACE_ENTER();
> @@ -180,13 +181,12 @@ NtfSmartPtr NtfReader::next(SaNtfSearchDirectionT 
> direction,
>      TRACE_LEAVE();
>      firstRead_ = false;
>      return notif;
> -  } else  // SA_NTF_SEARCH_OLDER
> -  {
> +  } else {  // SA_NTF_SEARCH_OLDER
>      readerNotReverseIterT rIter(ffIter);
>      if (firstRead_)
> -      rIter--;
> +      rIter = coll_.rbegin();
>      else
> -      rIter++;
> +      ++rIter;
>  
>      if (rIter >= coll_.rend() || rIter < coll_.rbegin()) {
>        *error = SA_AIS_ERR_NOT_EXIST;
> @@ -204,17 +204,13 @@ NtfSmartPtr NtfReader::next(SaNtfSearchDirectionT 
> direction,
>      return notif;
>    }
>  }
> -/*
> - * This method is to sync the reader information stored in this
> - * class to the standby NTFD
> - * param: uba, encoder pointer
> - */
> +
>  void NtfReader::syncRequest(NCS_UBAID* uba) {
>    TRACE_ENTER();
> -  syncReaderInfo(readerId_, c_filter_ != nullptr ? 1 : 0,
> +  syncReaderInfo(readerId_, uint8_t(hasFilter_),
>        (uint32_t)std::distance(coll_.begin(), ffIter),
>        uint8_t(firstRead_), uba);
> -  if (c_filter_) {
> +  if (hasFilter_ == true) {
>      syncReaderWithFilter(&read_init_2_req_, uba);
>    } else {
>      syncReaderWithoutFilter(&read_init_req_, uba);
> @@ -223,254 +219,3 @@ void NtfReader::syncRequest(NCS_UBAID* uba) {
>  }
>  
>  unsigned int NtfReader::getId() { return readerId_; }
> -
> -/**
> - *   NtfCriteriaFilter is a base class for all searchCriteria
> - *   filters. NtfCriteriaFilter and its derived classes are help
> - *   classes to the NtfReader class. The derived classes must
> - *   implementer the filter() method.
> - *
> - *   @param searchCriteria
> - *   @param reader
> - */
> -NtfCriteriaFilter::NtfCriteriaFilter(SaNtfSearchCriteriaT& searchCriteria,
> -                                     NtfReader* reader)
> -    : searchCriteria_(searchCriteria), reader_(reader), i_(-1), startIdx_(0) 
> {}
> -
> -NtfCriteriaFilter::~NtfCriteriaFilter() {}
> -
> -void NtfCriteriaFilter::add(NtfSmartPtr& n) {
> -  reader_->coll_.push_back(n);
> -  i_++;
> -}
> -
> -void NtfCriteriaFilter::setIndexCurrent() {
> -  if (reader_->coll_.size()) {
> -    startIdx_ = i_;
> -  }
> -}
> -
> -void NtfCriteriaFilter::removeTail() {
> -  if (reader_->coll_.size()) {
> -    reader_->coll_.erase(reader_->coll_.begin() + startIdx_ + 1,
> -                         reader_->coll_.end());
> -    i_ = startIdx_;
> -  };
> -}
> -
> -void NtfCriteriaFilter::removeHead() {
> -  if (reader_->coll_.size()) {
> -    reader_->coll_.erase(reader_->coll_.begin(),
> -                         reader_->coll_.begin() + startIdx_);
> -    i_ -= startIdx_;
> -    startIdx_ = 0;
> -  }
> -}
> -
> -void NtfCriteriaFilter::finalize() {
> -  startIdx_ = 0;
> -  convertToIter();
> -}
> -
> -void NtfCriteriaFilter::convertToIter() {
> -  reader_->ffIter = reader_->coll_.begin() + startIdx_;
> -}
> -
> -NtfBeforeAtTime::NtfBeforeAtTime(SaNtfSearchCriteriaT& searchCriteria,
> -                                 NtfReader* reader)
> -    : NtfCriteriaFilter(searchCriteria, reader), eTimeFound_(false) {
> -  TRACE_3("NtfBeforeAtTime constructor");
> -}
> -
> -bool NtfBeforeAtTime::filter(NtfSmartPtr& n) {
> -  add(n);
> -  if (*n->header()->eventTime == searchCriteria_.eventTime) {
> -    setIndexCurrent();
> -    eTimeFound_ = true;
> -  }
> -  return true;
> -}
> -
> -void NtfBeforeAtTime::finalize() {
> -  TRACE_3("NtfBeforeAtTime finalize");
> -  if (eTimeFound_) {
> -    removeTail();
> -  }
> -  setIndexCurrent();
> -  convertToIter();
> -}
> -
> -AtTime::AtTime(SaNtfSearchCriteriaT& searchCriteria, NtfReader* reader)
> -    : NtfCriteriaFilter(searchCriteria, reader) {
> -  TRACE_3("AtTime constructor");
> -}
> -
> -bool AtTime::filter(NtfSmartPtr& n) {
> -  if (*n->header()->eventTime == searchCriteria_.eventTime) {
> -    add(n);
> -  }
> -  return true;
> -}
> -
> -NtfAtOrAfterTime::NtfAtOrAfterTime(SaNtfSearchCriteriaT& searchCriteria,
> -                                   NtfReader* reader)
> -    : NtfCriteriaFilter(searchCriteria, reader),
> -      indexSaved_(false),
> -      eTimeFound_(false) {
> -  TRACE_3("NtfAtOrAfterTime constructor");
> -}
> -
> -bool NtfAtOrAfterTime::filter(NtfSmartPtr& n) {
> -  add(n);
> -  if (*n->header()->eventTime == searchCriteria_.eventTime) {
> -    if (!eTimeFound_) {
> -      setIndexCurrent();
> -      indexSaved_ = true;
> -      eTimeFound_ = true;
> -    }
> -  } else if (!eTimeFound_ &&
> -             (*n->header()->eventTime > searchCriteria_.eventTime)) {
> -    if (!indexSaved_) {
> -      setIndexCurrent();
> -      indexSaved_ = true;
> -    }
> -  }
> -  return true;
> -}
> -
> -void NtfAtOrAfterTime::finalize() {
> -  if (indexSaved_) {
> -    removeHead();
> -  }
> -  convertToIter();
> -}
> -
> -NtfBeforeTime::NtfBeforeTime(SaNtfSearchCriteriaT& searchCriteria,
> -                             NtfReader* reader)
> -    : NtfCriteriaFilter(searchCriteria, reader),
> -      indexSaved_(false),
> -      eTimeFound_(false) {
> -  TRACE_3("NtfBeforeTime constructor");
> -}
> -
> -bool NtfBeforeTime::filter(NtfSmartPtr& n) {
> -  if (*n->header()->eventTime == searchCriteria_.eventTime) {
> -    if (!indexSaved_) {
> -      setIndexCurrent();
> -      indexSaved_ = true;
> -      eTimeFound_ = true;
> -    }
> -    return false;
> -  } else if (!eTimeFound_ &&
> -             (*n->header()->eventTime > searchCriteria_.eventTime)) {
> -    if (!indexSaved_) {
> -      setIndexCurrent();
> -      indexSaved_ = true;
> -    }
> -  }
> -  add(n);
> -  return true;
> -}
> -
> -void NtfBeforeTime::finalize() {
> -  if (!indexSaved_) {
> -    setIndexCurrent();
> -  } else {
> -    if (eTimeFound_) {
> -      removeTail();
> -    }
> -    setIndexCurrent();
> -  }
> -  convertToIter();
> -}
> -
> -NtfAfterTime::NtfAfterTime(SaNtfSearchCriteriaT& searchCriteria,
> -                           NtfReader* reader)
> -    : NtfCriteriaFilter(searchCriteria, reader),
> -      indexSaved_(false),
> -      eTimeFound_(false) {
> -  TRACE_3("NtfAfterTime constructor");
> -}
> -
> -bool NtfAfterTime::filter(NtfSmartPtr& n) {
> -  add(n);
> -  if (*n->header()->eventTime == searchCriteria_.eventTime) {
> -    if (!eTimeFound_) {
> -      indexSaved_ = true;
> -      eTimeFound_ = true;
> -    }
> -    setIndexCurrent();
> -  } else if (eTimeFound_ &&
> -             (*n->header()->eventTime > searchCriteria_.eventTime)) {
> -    if (!indexSaved_) {
> -      setIndexCurrent();
> -      indexSaved_ = true;
> -    }
> -  }
> -  return true;
> -}
> -
> -void NtfAfterTime::finalize() {
> -  if (indexSaved_) {
> -    startIdx_++;
> -    removeHead();
> -  }
> -  convertToIter();
> -}
> -
> -NtfOnlyFilter::NtfOnlyFilter(SaNtfSearchCriteriaT& searchCriteria,
> -                             NtfReader* reader)
> -    : NtfCriteriaFilter(searchCriteria, reader) {
> -  TRACE_3("NtfOnlyFilter constructor");
> -}
> -
> -bool NtfOnlyFilter::filter(NtfSmartPtr& n) {
> -  unsigned int nId = n->getNotificationId();
> -  TRACE_3("nId: %u added to readerList", nId);
> -  add(n);
> -  return true;
> -}
> -
> -NtfIdSearch::NtfIdSearch(SaNtfSearchCriteriaT& searchCriteria,
> -                         NtfReader* reader)
> -    : NtfCriteriaFilter(searchCriteria, reader) {
> -  TRACE_3("NtfIdSearch constructor");
> -}
> -
> -bool NtfIdSearch::filter(NtfSmartPtr& n) {
> -  if (*n->header()->notificationId == searchCriteria_.notificationId) {
> -    add(n);
> -    return false;
> -  }
> -  return true;
> -}
> -
> -NtfCriteriaFilter* NtfCriteriaFilter::getCriteriaFilter(
> -    SaNtfSearchCriteriaT& sc, NtfReader* r) {
> -  NtfCriteriaFilter* f;
> -  switch (sc.searchMode) {
> -    case SA_NTF_SEARCH_BEFORE_OR_AT_TIME:
> -      f = (NtfCriteriaFilter*)new NtfBeforeAtTime(sc, r);
> -      break;
> -    case SA_NTF_SEARCH_AT_TIME:
> -      f = (NtfCriteriaFilter*)new AtTime(sc, r);
> -      break;
> -    case SA_NTF_SEARCH_AT_OR_AFTER_TIME:
> -      f = (NtfCriteriaFilter*)new NtfAtOrAfterTime(sc, r);
> -      break;
> -    case SA_NTF_SEARCH_BEFORE_TIME:
> -      f = (NtfCriteriaFilter*)new NtfBeforeTime(sc, r);
> -      break;
> -    case SA_NTF_SEARCH_AFTER_TIME:
> -      f = (NtfCriteriaFilter*)new NtfAfterTime(sc, r);
> -      break;
> -    case SA_NTF_SEARCH_NOTIFICATION_ID:
> -      f = (NtfCriteriaFilter*)new NtfIdSearch(sc, r);
> -      break;
> -    case SA_NTF_SEARCH_ONLY_FILTER:
> -    default:
> -      f = (NtfCriteriaFilter*)new NtfOnlyFilter(sc, r);
> -      break;
> -  }
> -  return f;
> -}
> diff --git a/src/ntf/ntfd/NtfReader.h b/src/ntf/ntfd/NtfReader.h
> index 8be8985d3..a8eefe545 100644
> --- a/src/ntf/ntfd/NtfReader.h
> +++ b/src/ntf/ntfd/NtfReader.h
> @@ -48,109 +48,62 @@ class NtfReader {
>    friend class NtfCriteriaFilter;
>  
>   public:
> +  // NtfReader object creates a copy of the current cashed
> +  // notifications. The private forward iterator ffIter is set
> +  // to first element.
>    NtfReader(NtfLogger& ntfLogger, unsigned int readerId,
>        ntfsv_reader_init_req_t *req);
> +
> +  // NtfReader object creates a copy of the current cashed
> +  // notifications that matches the filter and the search
> +  // criteria. The private forward iterator ffIter is set
> +  // according to the searchCriteria. This constructor is used
> +  // when filter is provided.
>    NtfReader(NtfLogger& ntfLogger, unsigned int readerId,
>        ntfsv_reader_init_req_2_t *req);
> +
>    ~NtfReader();
> +
> +  // This method is called to check which notifications that
> +  // matches with the referenced filter and the filtering criteria
> +  // and copy these notications to the read list
>    void filterCacheList(NtfLogger& ntfLogger);
> +
> +  // This method returns the notification at the current
> +  // position of the iterator @ffIter if search direction is
> +  // SA_NTF_SEARCH_YOUNGER.
>    NtfSmartPtr next(SaNtfSearchDirectionT direction, SaAisErrorT* error);
> +
> +  // Get reader-id
>    unsigned int getId();
> +
> +  // This method is to sync the reader information to the standby NTFD
>    void syncRequest(NCS_UBAID* uba);
> +
> +  // Set Reader-id
>    void setReaderId(unsigned int readerId) { readerId_ = readerId; }
> -  void setReaderIteration(unsigned int iterPos) {ffIter = coll_.begin() + 
> iterPos;}
> +
> +  // Set current pointer of reader in the reader notification list
> +  void setReaderIteration(unsigned int iterPos) {
> +    ffIter = coll_.begin() + iterPos;}
> +
> +  // Set the flag if the reading is first time
>    void setFirstRead(bool firstRead) {firstRead_ = firstRead; }
>  
> +  // Filter the notification with the search criteria
> +  // Return true if it doesn't need other notification to check search 
> criteria
> +  bool filterSearchCriteria(NtfSmartPtr& notification);
> +
>   private:
>    readerNotificationListT coll_;
>    readerNotificationListTIter ffIter;
>    FilterMap filterMap;
>    unsigned int readerId_;
>    SaNtfSearchCriteriaT searchCriteria_;
> -  NtfCriteriaFilter* c_filter_;
> +  bool hasFilter_;
>    bool firstRead_;
>    ntfsv_reader_init_req_t read_init_req_;
>    ntfsv_reader_init_req_2_t read_init_2_req_;
>  };
>  
> -class NtfCriteriaFilter {
> - public:
> -  NtfCriteriaFilter(SaNtfSearchCriteriaT& searchCriteria, NtfReader* reader);
> -  virtual ~NtfCriteriaFilter();
> -  static NtfCriteriaFilter* getCriteriaFilter(SaNtfSearchCriteriaT& sc,
> -                                              NtfReader* r);
> -  virtual bool filter(NtfSmartPtr& n) = 0;
> -  void add(NtfSmartPtr& n);
> -  void setIndexCurrent();
> -  virtual void finalize();
> -  void removeTail();
> -  void removeHead();
> -  void convertToIter();
> -
> - protected:
> -  SaNtfSearchCriteriaT searchCriteria_;
> -  NtfReader* reader_;
> -  int i_;
> -  int startIdx_;
> -};
> -
> -class NtfBeforeAtTime : public NtfCriteriaFilter {
> - public:
> -  NtfBeforeAtTime(SaNtfSearchCriteriaT& searchCriteria, NtfReader* reader);
> -  bool filter(NtfSmartPtr& n);
> -  void finalize();
> -  bool eTimeFound_;
> -};
> -
> -class AtTime : public NtfCriteriaFilter {
> - public:
> -  AtTime(SaNtfSearchCriteriaT& searchCriteria, NtfReader* reader);
> -  bool filter(NtfSmartPtr& n);
> -};
> -
> -class NtfAtOrAfterTime : public NtfCriteriaFilter {
> - public:
> -  NtfAtOrAfterTime(SaNtfSearchCriteriaT& searchCriteria, NtfReader* reader);
> -  bool filter(NtfSmartPtr& n);
> -  void finalize();
> -
> - private:
> -  bool indexSaved_;
> -  bool eTimeFound_;
> -};
> -
> -class NtfBeforeTime : public NtfCriteriaFilter {
> - public:
> -  NtfBeforeTime(SaNtfSearchCriteriaT& searchCriteria, NtfReader* reader);
> -  bool filter(NtfSmartPtr& n);
> -  void finalize();
> -
> - private:
> -  bool indexSaved_;
> -  bool eTimeFound_;
> -};
> -
> -class NtfAfterTime : public NtfCriteriaFilter {
> - public:
> -  NtfAfterTime(SaNtfSearchCriteriaT& searchCriteria, NtfReader* reader);
> -  bool filter(NtfSmartPtr& n);
> -  void finalize();
> -
> - private:
> -  bool indexSaved_;
> -  bool eTimeFound_;
> -};
> -
> -class NtfOnlyFilter : public NtfCriteriaFilter {
> - public:
> -  NtfOnlyFilter(SaNtfSearchCriteriaT& searchCriteria, NtfReader* reader);
> -  bool filter(NtfSmartPtr& n);
> -};
> -
> -class NtfIdSearch : public NtfCriteriaFilter {
> - public:
> -  NtfIdSearch(SaNtfSearchCriteriaT& searchCriteria, NtfReader* reader);
> -  bool filter(NtfSmartPtr& n);
> -};
> -
>  #endif  // NTF_NTFD_NTFREADER_H_




_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to