//Print method void BookRecord::print()const { string tempTitle, tempAuthor, tempPublisher; if(getTitle().length() > 22) tempTitle = getTitle().substr(0,22); else tempTitle = getTitle(); if(getAuthor().length() > 22) tempAuthor = getAuthor().substr(0,22); else tempAuthor = getAuthor(); if(getPublisher().length() > 22) tempPublisher = getPublisher().substr(0,22); else tempPublisher = getPublisher(); //Re-initialize our output settings cout.setf(ios::left, ios::adjustfield); cout << setfill(' '); //Print the title, author, and publisher cout << setw(22) << tempTitle << " "; cout << setw(22) << tempAuthor << " "; cout << setw(22) << tempPublisher << " "; //Prints the ISBN number cout.setf(ios::right, ios::adjustfield); cout << setw(10) << setfill('0') << getISBN(); cout << setfill(' ') << " "; }
void FileEventSubscriber::configure() { // Clear all monitors from INotify. // There may be a better way to find the set intersection/difference. auto pub = getPublisher(); pub->removeSubscriptions(); auto parser = Config::getParser("file_paths"); auto& accesses = parser->getData().get_child("file_accesses"); Config::getInstance().files([this, &accesses]( const std::string& category, const std::vector<std::string>& files) { for (const auto& file : files) { VLOG(1) << "Added file event listener to: " << file; auto sc = createSubscriptionContext(); // Use the filesystem globbing pattern to determine recursiveness. sc->recursive = 0; sc->path = file; sc->mask = kFileDefaultMasks; if (accesses.count(category) > 0) { sc->mask |= kFileAccessMasks; } sc->category = category; subscribe(&FileEventSubscriber::Callback, sc); } }); }
//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ void ReplicationPropertyGroup::notifyAdd(pPropertiesListener_type _pListener) { _pListener->onAddProperty(getPublisher(), *this); m_replicationType.notifyAdd(_pListener); m_replicationDirection.notifyAdd(_pListener); m_scopator.notifyAdd(_pListener); }
//Displas Book`s detail void book::display(){ cout<<"\nBook`s Detail:-"; cout<<"\nItem ID:"<<getID(); cout<<"\nTitle:"<<getTitle(); cout<<"\nPrice:RM"<<getPrice(); cout<<"\nQuantity:"<<getQuantity(); cout<<"\nAuthor:"<<getAuthor(); cout<<"\nPublisher:"<<getPublisher(); cout<<"\nISBN:"<<getISBN(); cout<<endl; }
void FileEventSubscriber::configure() { // Clear all paths from FSEvents. // There may be a better way to find the set intersection/difference. auto pub = getPublisher(); pub->removeSubscriptions(); Config::getInstance().files([this](const std::string& category, const std::vector<std::string>& files) { for (const auto& file : files) { VLOG(1) << "Added file event listener to: " << file; auto sc = createSubscriptionContext(); sc->path = file; sc->category = category; subscribe(&FileEventSubscriber::Callback, sc); } }); }
void EventSubscriberPlugin::removeSubscriptions() { subscription_count_ = 0; getPublisher()->removeSubscriptions(getName()); }
bool publish( const servus::URI& uri, const zeq::Event& event ) { return getPublisher( uri )->publish( event ); }