AddComment::AddComment(QObject *parent) : API::Method(parent) { requires("post_id"); requires("comment"); }
BOOL LLFloaterNewIM::postBuild() { requires("start_btn", WIDGET_TYPE_BUTTON); requires("close_btn", WIDGET_TYPE_BUTTON); requires("user_list", WIDGET_TYPE_NAME_LIST); requires("online_descriptor", WIDGET_TYPE_TEXT_BOX); requires("name_format", WIDGET_TYPE_TEXT_BOX); if (checkRequirements()) { childSetAction("start_btn", &LLFloaterNewIM::onStart, this); childSetAction("close_btn", &LLFloaterNewIM::onClickClose, this); mSelectionList = LLViewerUICtrlFactory::getNameListByName(this, "user_list"); if (mSelectionList) { mSelectionList->setDoubleClickCallback(&LLFloaterNewIM::onStart); mSelectionList->setCallbackUserData(this); } else { llwarns << "LLViewerUICtrlFactory::getNameListByName() returned NULL for 'user_list'" << llendl; } sOnlineDescriptor = childGetValue("online_descriptor").asString(); sNameFormat = childGetValue("name_format").asString(); setDefaultBtn("start_btn"); return TRUE; } return FALSE; }
/** * This function is for the configuration code. * Return false to abort configuration. */ bool configureHook() { if (!(requires("ObcInterface")->connectTo(getPeer("Obc")->provides("ObcInterface")))){ log(Info) << "connection problem to service" << endlog(); } if (!(requires("CameraInterface")->connectTo(getPeer("Camera")->provides("CameraInterface")))){ log(Info) << "connection problem to service" << endlog(); } // ... return true; }
BOOL LLPrefsIMImpl::postBuild() { requires("online_visibility"); requires("send_im_to_email"); if (!checkRequirements()) { return FALSE; } childSetLabelArg("send_im_to_email", "[EMAIL]", getString("log_in_to_change")); // Don't enable this until we get personal data childDisable("include_im_in_chat_console"); childDisable("include_im_in_chat_history"); childDisable("show_timestamps_check"); childDisable("friends_online_notify_checkbox"); childDisable("online_visibility"); childDisable("send_im_to_email"); childDisable("log_instant_messages"); childDisable("log_chat"); childDisable("log_show_history"); childDisable("log_path_button"); childDisable("busy_response"); childDisable("log_instant_messages_timestamp"); childDisable("log_chat_timestamp"); childDisable("log_chat_IM"); childDisable("log_date_timestamp"); childDisable("logfile_name_datestamp"); childSetText("busy_response", getString("log_in_to_change")); childSetValue("include_im_in_chat_console", gSavedSettings.getBOOL("IMInChatConsole")); childSetValue("include_im_in_chat_history", gSavedSettings.getBOOL("IMInChatHistory")); childSetValue("show_timestamps_check", gSavedSettings.getBOOL("IMShowTimestamps")); childSetValue("friends_online_notify_checkbox", gSavedSettings.getBOOL("ChatOnlineNotification")); childSetText("chat_logs_location", gSavedPerAccountSettings.getString("InstantMessageLogPath")); childSetValue("log_instant_messages", gSavedPerAccountSettings.getBOOL("LogInstantMessages")); childSetValue("log_chat", gSavedPerAccountSettings.getBOOL("LogChat")); childSetValue("log_show_history", gSavedPerAccountSettings.getBOOL("LogShowHistory")); childSetValue("log_instant_messages_timestamp", gSavedPerAccountSettings.getBOOL("IMLogTimestamp")); childSetValue("log_chat_timestamp", gSavedPerAccountSettings.getBOOL("LogChatTimestamp")); childSetValue("log_chat_IM", gSavedPerAccountSettings.getBOOL("LogChatIM")); childSetValue("log_date_timestamp", gSavedPerAccountSettings.getBOOL("LogTimestampDate")); childSetValue("logfile_name_datestamp", gSavedPerAccountSettings.getBOOL("LogFileNamewithDate")); childSetCommitCallback("log_chat",onCommitLogging,this); childSetCommitCallback("log_instant_messages",onCommitLogging,this); return TRUE; }
template<typename T> inline void circular_buffer<T>::shift_right(size_type &index, size_type offset) const { requires(index < this->_capacity); requires(offset <= this->_capacity); index += offset; if (index >= this->_capacity) { index -= this->_capacity; } ensures(index < this->_capacity); }
rational(const T &numerator = 0, const T &denominator = 1) : _denominator(denominator), _numerator(numerator) { requires(denominator != T(0)); this->_normalize(); }
template<typename T> inline typename circular_buffer<T>::const_reference circular_buffer<T>::operator[](size_type index) const { requires(index < this->_size); return this->_buffer[this->real_index(index)]; }
BOOL LLPrefsIMImpl::postBuild() { requires("online_visibility"); requires("send_im_to_email"); if (!checkRequirements()) { return FALSE; } mGotPersonalInfo = false; mOriginalIMViaEmail = false; mOriginalHideOnlineStatus = true; childSetLabelArg("send_im_to_email", "[EMAIL]", childGetText("log_in_to_change")); // Don't enable this until we get personal data childDisable("online_visibility"); childDisable("send_im_to_email"); childDisable("log_instant_messages"); childDisable("log_chat"); childDisable("log_show_history"); childDisable("log_path_button"); childDisable("busy_response"); childDisable("log_instant_messages_timestamp"); childDisable("log_chat_timestamp"); childDisable("log_chat_IM"); childDisable("log_date_timestamp"); childSetText("busy_response", childGetText("log_in_to_change")); refresh(); childSetText("log_path_string", mLogPath); childSetValue("log_instant_messages", mLogInstantMessages); childSetValue("log_chat", mLogChat); childSetValue("log_show_history", mLogShowHistory); childSetValue("log_instant_messages_timestamp", mIMLogTimestamp); childSetValue("log_chat_timestamp", mLogChatTimestamp); childSetValue("log_chat_IM", mLogIMChat); childSetValue("log_date_timestamp",mLogTimestampDate); childSetAction("log_path_button", onClickLogPath, this); childSetCommitCallback("log_chat",onCommitLogging,this); childSetCommitCallback("log_instant_messages",onCommitLogging,this); return TRUE; }
circular_buffer<T>::circular_buffer(size_type capacity) : _capacity(capacity), _size(0), _start(0) { requires(capacity > 0); this->_buffer = new T[_capacity]; validate(*this); }
template<typename T> inline void circular_buffer<T>::shift_left(size_type &index, size_type offset) const { requires(index < this->_capacity); requires(offset <= this->_capacity); if (index >= offset) { ensures((index - offset) < this->_capacity); index -= offset; } else { ensures((index + this->_capacity - offset) < this->_capacity); index += (this->_capacity - offset); } }
template<typename T> inline typename circular_buffer<T>::size_type circular_buffer<T>::real_index(size_type index) const { requires(index < this->_capacity); this->shift_right(index, this->_start); return index; }
template<typename T> inline void circular_buffer<T>::pop_back() { requires(!this->empty()); this->_size--; validate(*this); }
void circular_buffer<T>::pop_front() { requires(!this->empty()); this->_size--; this->_start++; if (this->_start == this->_capacity) { this->_start = 0; } validate(*this); }
BOOL LLPanelInput::postBuild() { requires("Mouse Sensitivity", WIDGET_TYPE_SLIDER_BAR); requires("invert mouse", WIDGET_TYPE_CHECKBOX); requires("automatic fly", WIDGET_TYPE_CHECKBOX); requires("dynamic camera", WIDGET_TYPE_SLIDER); requires("edit camera movement", WIDGET_TYPE_CHECKBOX); requires("appearance camera movement", WIDGET_TYPE_CHECKBOX); if (!checkRequirements()) { return FALSE; } refresh(); return TRUE; }
concept bool Concept() { return requires () { typename T::member_type1; typename T::member_type2; };
double MySqrt(double v) { requires(v > 0); return v; }
PositiveNumber(T k) { requires(k > 0); value = k; ensures(value > 0); }
namespace view { struct remove_fn { private: friend view_access; template<typename Value> static auto bind(remove_fn remove, Value value) { return make_pipeable( std::bind(remove, std::placeholders::_1, std::move(value))); } template<typename Value, typename Proj> static auto CPP_fun(bind)(remove_fn remove, Value value, Proj proj)( // requires(!Range<Value>)) { return make_pipeable(std::bind(remove, std::placeholders::_1, std::move(value), protect(std::move(proj)))); } template<typename Value> struct pred { Value value_; template<typename T> auto operator()(T && other) const -> CPP_ret(bool)( // requires EqualityComparableWith<T, Value const &>) {
concept bool C1() { return requires() { typename T::type1; };
{ #if RANGES_CXX_ALIGNED_NEW < RANGES_CXX_ALIGNED_NEW_17 static_assert(alignof(T) <= alignof(std::max_align_t), "Sorry: over-aligned types are supported only with C++17."); #else // RANGES_CXX_ALIGNED_NEW if(RANGES_CONSTEXPR_IF(alignof(T) > __STDCPP_DEFAULT_NEW_ALIGNMENT__)) ::operator delete(p, std::align_val_t{alignof(T)}); else #endif // RANGES_CXX_ALIGNED_NEW ::operator delete(p); } }; template<typename T, typename... Args> auto make_unique(Args &&... args) -> CPP_ret(std::unique_ptr<T>)( // requires(!std::is_array<T>::value)) { return std::unique_ptr<T>{new T(static_cast<Args &&>(args)...)}; } } // namespace detail /// \endcond /// \addtogroup group-utility /// @{ template<typename O, typename Val> struct raw_storage_iterator { private: CPP_assert(OutputIterator<O, Val>); CPP_assert(std::is_lvalue_reference<iter_reference_t<O>>()); O out_;
CombAttachment::CombAttachment(Model& model) : Model::Attachment(model) { ExprAttachment::Factory f; requires(Key::EXPR, &f); }
concept bool C() { return requires() { typename Alias1<T1, T2>; };
bool manager::conflicts(const elem& elem1, const elem& elem2, bool directonly) const { if (elem1 == elem2) { return false; } // We ignore inexistent elements at this point, they will generate // errors in change_era()/change_scenario() anyways. if (!exists(elem1) || !exists(elem2)) { return false; } config data1 = depinfo_.find_child(elem1.type, "id", elem1.id); config data2 = depinfo_.find_child(elem2.type, "id", elem2.id); // Whether we should skip the check entirely if (data1.has_attribute("ignore_incompatible_" + elem2.type)) { std::vector<std::string> ignored = utils::split(data1["ignore_incompatible_" + elem2.type]); if ( util::contains(ignored, elem2.id) ) { return false; } } if (data2.has_attribute("ignore_incompatible_" + elem1.type)) { std::vector<std::string> ignored = utils::split(data2["ignore_incompatible_" + elem1.type]); if ( util::contains(ignored, elem1.id) ) { return false; } } bool result = false; // Checking for direct conflicts between elem1 and elem2 if (data1.has_attribute("allow_" + elem2.type)) { std::vector<std::string> allowed = utils::split(data1["allow_" + elem2.type]); result = !util::contains(allowed, elem2.id) && !requires(elem1, elem2); } else if (data1.has_attribute("disallow_" + elem2.type)) { std::vector<std::string> disallowed = utils::split(data1["disallow_" + elem2.type]); result = util::contains(disallowed, elem2.id); } if (data2.has_attribute("allow_" + elem1.type)) { std::vector<std::string> allowed = utils::split(data2["allow_" + elem1.type]); result = result || (!util::contains(allowed, elem1.id) && !requires(elem2, elem1)); } else if (data2.has_attribute("disallow_" + elem1.type)) { std::vector<std::string> disallowed = utils::split(data2["disallow_" + elem1.type]); result = result || util::contains(disallowed, elem1.id); } if (result) { return true; } // Checking for indirect conflicts (i.e. conflicts between dependencies) if (!directonly) { std::vector<std::string> req1 = get_required(elem1), req2 = get_required(elem2); BOOST_FOREACH (const std::string& s, req1) { elem m(s, "modification"); if (conflicts(elem2, m, true)) { return true; } }
RNAforesterOptions::RNAforesterOptions(int argc, const char **argv) : m_argv(argv) { nrArgs = argc; m_options=new OptionsInfo[NumberOfOptions]; setOption(Help, "--help",""," ","shows this help info",false); setOption(Version, "--version",""," ","shows version information",false); setOption(OutputAlignmentDotFormat, "-dot","=file"," ","show alignment forest in dot format",true); setOption(CalculateDistance, "-d",""," ","calculate distance instead of similarity",false); setOption(RelativeScore, "-r",""," ","calculate relative score",false); setOption(LocalSimilarity, "-l",""," ","local similarity",false); setOption(LocalSubopts, "-so","=int"," ","local suboptimal alignments within int%",false); setOption(SmallInLarge, "-s",""," ","small-in-large similarity",false); setOption(Multiple, "-m",""," ","multiple alignment mode",false); setOption(ClusterThreshold, "-mt","=double"," ","clustering threshold",false); setOption(ClusterJoinCutoff, "-mc","=double"," ","clustering cutoff",false); #ifdef HAVE_LIBRNA // This features require the ViennaRNA library setOption(PredictProfile, "-p",""," ","predict structures from sequences",false); setOption(PredictMinPairProb, "-pmin","=double"," ","minimum basepair frequency for prediction",false); #endif setOption(SaveProfile, "-sp","=file"," ","save profile",false); setOption(ProfileSearch, "-ps","=file"," ","profile search",false); setOption(TreeEdit, "-e",""," ","use tree edit model to calculate distance and similarity",true); setOption(GlobalAlignment, "-g",""," ","calculate global alignment in its original version",true); setOption(BpRepScore, "-pm","=int"," ","basepair(bond) match score",false); setOption(BpDelScore, "-pd","=int"," ","basepair bond indel score",false); setOption(BMatchScore, "-bm","=int"," ","base match score",false); setOption(BRepScore, "-br","=int"," ","base mismatch score",false); setOption(BDelScore, "-bd","=int"," ","base indel score",false); setOption(RIBOSUMScore, "--RIBOSUM",""," ","RIBOSUM85-60 scoring matrix (base-pair substitutions)",false); setOption(ConsensusMinPairProb, "-cmin","=double"," ","minimum basepair frequency for consensus structure",false); #ifdef HAVE_LIBG2 // This features require the g2 library setOption(MakeSquigglePlot, "-2d",""," ","generate alignment 2D plots in postscript format",false); setOption(SquiggleHideBaseNumbers, "--2d_hidebasenum",""," ","hide base numbers in 2D plot",false); setOption(SquiggleBaseNumberInterval,"--2d_basenuminterval","=n"," ","show every n-th base number",false); setOption(SquiggleGreyColors, "--2d_grey",""," ","use only grey colors in 2D plots",false); setOption(SquiggleScaleFactor, "--2d_scale","=double"," ","scale factor for the 2d plots",false); setOption(SquiggleGenerateFIG, "--2d_fig",""," ","generate additional fig file of 2d plot",false); #ifdef HAVE_LIBGD // This features require the gd library setOption(SquiggleGeneratePNG, "--2d_png",""," ","generate additional png file of 2d plot",false); setOption(SquiggleGenerateJPG, "--2d_jpg",""," ","generate additional jpg file of 2d plot",false); #endif #endif setOption(ReadFromFile, "-f","=file"," ","read input from file",false); // setOption(SaveMultipleAliFile, "-sm","=file"," ","save multiple alignment as binary file",true); setOption(NoScale, "--noscale",""," ","suppress output of scale",false); setOption(MakeDotForInputTrees, "-idot",""," ","make dot files for the input trees",true); #ifdef HAVE_LIBRNA // This features require the ViennaRNA library and the libxml++ library #ifdef HAVE_LIBXMLPLUSPLUS #ifdef HAVE_LIBXML2 setOption(GenerateXML, "--xml",""," ","generate xml file in RNAStructAlignmentML format",false); setOption(XmlOutputFile, "--xml_output",""," ","name of xml output file",false); #endif #endif #endif setOption(SecretHelp, "--shelp",""," ","shows this help info",true); setOption(ShowOnlyScore, "--score",""," ","compute only scores, no alignment",false); setOption(FastaOutput, "--fasta",""," ","generate fasta output of alignments",false); setOption(SpaceTimeInfo, "--spacetime",""," ","space and time measurements",true); // set the arguments that can be seperated by spaces stringstream ss; for(int i=0;i<NumberOfOptions;i++) { if(!m_options[i].parameter.empty()) ss << m_options[i].tag << "|"; } Arguments::setArgumentsWithSpaces(ss.str()); m_args = new Arguments(argc,argv); // check options for compatibility //exclude(LocalSimilarity,Multiple); exclude(LocalSimilarity,SmallInLarge); //exclude(SmallInLarge,Multiple); #ifdef HAVE_LIBG2 // This features require the g2 library exclude(SquiggleHideBaseNumbers,Multiple); exclude(SquiggleBaseNumberInterval,Multiple); #endif exclude(CalculateDistance,LocalSimilarity); exclude(CalculateDistance,RIBOSUMScore); exclude(CalculateDistance,RelativeScore); exclude(CalculateDistance,Multiple); exclude(CalculateDistance,SmallInLarge); exclude(Multiple,RIBOSUMScore); exclude(RIBOSUMScore,BpRepScore); exclude(RIBOSUMScore,BMatchScore); exclude(RIBOSUMScore,BDelScore); requires(LocalSubopts,LocalSimilarity); requires(ClusterThreshold,Multiple); requires(ClusterJoinCutoff,Multiple); #ifdef HAVE_LIBRNA // This features require the ViennaRNA library requires(PredictProfile,Multiple); requires(PredictMinPairProb,PredictProfile); #endif // exclude(TreeEdit,Multiple); // exclude(TreeEdit,LocalSimilarity); // exclude(TreeEdit,RIBOSUMScore); // exclude(GlobalAlignment,Multiple); // exclude(GlobalAlignment,LocalSimilarity); // exclude(GlobalAlignment,RIBOSUMScore); // exclude(GlobalAlignment,TreeEdit); }
QVariant TestItem::data(int role) const { switch(role) { case DurationRole: return duration(); case ChecksumRole: return checksum(); case DependsRole: return depends(); case TestNameRole: return testname(); case RequiresRole: return requires(); case DescriptionRole: return description(); case CommandRole: return command(); case EnvironRole: return environ(); case PluginRole: return plugin(); case TypeRole: return type(); case UserRole: return user(); case ViaRole: return via(); case GroupRole: return group(); case CheckRole: return check(); case ObjectPathRole: return objectpath(); case RunstatusRole: return runstatus(); case ElapsedtimeRole: return elapsedtime(); case GroupstatusRole: return groupstatus(); case ParentNameRole: break; case ParentIdRole: break; case DepthRole: return depth(); case BranchRole: return branch(); case RerunRole: return rerun(); default: return QVariant(); } // Prevents non-void return warning from the compiler return QVariant(); }
concept bool Has_member_type() { return requires() { typename T::type; };
void p() { requires(true); }
#include <range/v3/range/traits.hpp> #include <range/v3/utility/static_const.hpp> namespace ranges { /// \addtogroup group-actions /// @{ namespace action { struct unique_fn { private: friend action_access; template<typename C, typename P = identity> static auto CPP_fun(bind)(unique_fn unique, C pred, P proj = P{})( // requires(!Range<C>)) { return std::bind(unique, std::placeholders::_1, protect(std::move(pred)), protect(std::move(proj))); } public: template<typename Rng, typename C = equal_to, typename P = identity> auto operator()(Rng && rng, C pred = C{}, P proj = P{}) const -> CPP_ret(Rng)( // requires ForwardRange<Rng> && ErasableRange<Rng &, iterator_t<Rng>, sentinel_t<Rng>> && Sortable<iterator_t<Rng>, C, P>) {