max_stars_count
int64
301
224k
text
stringlengths
6
1.05M
token_count
int64
3
727k
619
from typing import List from pyrep.objects.shape import Shape from pyrep.objects.proximity_sensor import ProximitySensor from rlbench.backend.task import Task from rlbench.backend.conditions import DetectedCondition, NothingGrasped class TakeFrameOffHanger(Task): def init_task(self) -> None: frame = Shape('frame') self.register_graspable_objects([frame]) self.register_success_conditions( [DetectedCondition(frame, ProximitySensor('hanger_detector'), negated=True), DetectedCondition(frame, ProximitySensor('success')), NothingGrasped(self.robot.gripper)]) def init_episode(self, index: int) -> List[str]: return ['take frame off hanger', 'slide the photo off of the hanger and set it down on the ' 'table', 'grab a hold of the frame, remove it from the hanger and put it' ' down', 'grasping the picture frame, take it off the wall and place it' 'on the table top', 'take the picture down', 'remove the photo frame from the wall'] def variation_count(self) -> int: return 1
527
3,073
<gh_stars>1000+ package com.newsblur.widget; import android.appwidget.AppWidgetManager; import android.content.Context; import android.content.Intent; import android.database.Cursor; import android.graphics.Color; import android.os.Bundle; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.loader.content.Loader; import android.text.TextUtils; import android.view.View; import android.widget.RemoteViews; import android.widget.RemoteViewsService; import com.newsblur.R; import com.newsblur.domain.Feed; import com.newsblur.domain.Story; import com.newsblur.network.APIManager; import com.newsblur.network.domain.StoriesResponse; import com.newsblur.util.FeedSet; import com.newsblur.util.FeedUtils; import com.newsblur.util.Log; import com.newsblur.util.PrefsUtils; import com.newsblur.util.ReadFilter; import com.newsblur.util.StoryOrder; import com.newsblur.util.StoryUtils; import com.newsblur.util.ThumbnailStyle; import com.newsblur.util.UIUtils; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Set; public class WidgetRemoteViewsFactory implements RemoteViewsService.RemoteViewsFactory { private static String TAG = "WidgetRemoteViewsFactory"; private Context context; private APIManager apiManager; private List<Story> storyItems = new ArrayList<>(); private FeedSet fs; private int appWidgetId; private boolean dataCompleted; WidgetRemoteViewsFactory(Context context, Intent intent) { com.newsblur.util.Log.d(TAG, "Constructor"); this.context = context; appWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID); } /** * The system calls onCreate() when creating your factory for the first time. * This is where you set up any connections and/or cursors to your data source. * <p> * Heavy lifting, * for example downloading or creating content etc, should be deferred to onDataSetChanged() * or getViewAt(). Taking more than 20 seconds in this call will result in an ANR. */ @Override public void onCreate() { Log.d(TAG, "onCreate"); this.apiManager = new APIManager(context); // widget could be created before app init // wait for the dbHelper to be ready for use while (FeedUtils.dbHelper == null) { try { Thread.sleep(500); } catch (InterruptedException e) { e.printStackTrace(); } if (FeedUtils.dbHelper == null) { FeedUtils.offerInitContext(context); } } WidgetUtils.enableWidgetUpdate(context); } /** * Allowed to run synchronous calls */ @Override public RemoteViews getViewAt(int position) { com.newsblur.util.Log.d(TAG, "getViewAt " + position); Story story = storyItems.get(position); WidgetRemoteViews rv = new WidgetRemoteViews(context.getPackageName(), R.layout.view_widget_story_item); rv.setTextViewText(R.id.story_item_title, story.title); rv.setTextViewText(R.id.story_item_content, story.shortContent); rv.setTextViewText(R.id.story_item_author, story.authors); rv.setTextViewText(R.id.story_item_feedtitle, story.extern_feedTitle); CharSequence time = StoryUtils.formatShortDate(context, story.timestamp); rv.setTextViewText(R.id.story_item_date, time); // image dimensions same as R.layout.view_widget_story_item FeedUtils.iconLoader.displayWidgetImage(story.extern_faviconUrl, R.id.story_item_feedicon, UIUtils.dp2px(context, 19), rv); if (PrefsUtils.getThumbnailStyle(context) != ThumbnailStyle.OFF && !TextUtils.isEmpty(story.thumbnailUrl)) { FeedUtils.thumbnailLoader.displayWidgetImage(story.thumbnailUrl, R.id.story_item_thumbnail, UIUtils.dp2px(context, 64), rv); } else { rv.setViewVisibility(R.id.story_item_thumbnail, View.GONE); } rv.setViewBackgroundColor(R.id.story_item_favicon_borderbar_1, UIUtils.decodeColourValue(story.extern_feedColor, Color.GRAY)); rv.setViewBackgroundColor(R.id.story_item_favicon_borderbar_2, UIUtils.decodeColourValue(story.extern_feedFade, Color.LTGRAY)); // set fill-intent which is used to fill in the pending intent template // set on the collection view in WidgetProvider Bundle extras = new Bundle(); extras.putString(WidgetUtils.EXTRA_ITEM_ID, story.storyHash); Intent fillInIntent = new Intent(); fillInIntent.putExtras(extras); rv.setOnClickFillInIntent(R.id.view_widget_item, fillInIntent); return rv; } /** * This allows for the use of a custom loading view which appears between the time that * {@link #getViewAt(int)} is called and returns. If null is returned, a default loading * view will be used. * * @return The RemoteViews representing the desired loading view. */ @Override public RemoteViews getLoadingView() { return null; } /** * @return The number of types of Views that will be returned by this factory. */ @Override public int getViewTypeCount() { return 1; } /** * @param position The position of the item within the data set whose row id we want. * @return The id of the item at the specified position. */ @Override public long getItemId(int position) { return storyItems.get(position).hashCode(); } /** * @return True if the same id always refers to the same object. */ @Override public boolean hasStableIds() { return true; } @Override public void onDataSetChanged() { com.newsblur.util.Log.d(TAG, "onDataSetChanged"); // if user logged out don't try to update widget if (!WidgetUtils.isLoggedIn(context)) { com.newsblur.util.Log.d(TAG, "onDataSetChanged - not logged in"); return; } if (dataCompleted) { // we have all the stories data, just let the widget redraw com.newsblur.util.Log.d(TAG, "onDataSetChanged - redraw widget"); dataCompleted = false; } else { setFeedSet(); if (fs == null) { com.newsblur.util.Log.d(TAG, "onDataSetChanged - null feed set. Show empty view"); setStories(new Story[]{}, new HashMap<String, Feed>(0)); return; } com.newsblur.util.Log.d(TAG, "onDataSetChanged - fetch stories"); StoriesResponse response = apiManager.getStories(fs, 1, StoryOrder.NEWEST, ReadFilter.ALL); if (response == null || response.stories == null) { com.newsblur.util.Log.d(TAG, "Error fetching widget stories"); } else { com.newsblur.util.Log.d(TAG, "Fetched widget stories"); processStories(response.stories); FeedUtils.dbHelper.insertStories(response, true); } } } /** * Called when the last RemoteViewsAdapter that is associated with this factory is * unbound. */ @Override public void onDestroy() { com.newsblur.util.Log.d(TAG, "onDestroy"); WidgetUtils.disableWidgetUpdate(context); PrefsUtils.removeWidgetData(context); } /** * @return Count of items. */ @Override public int getCount() { return Math.min(storyItems.size(), WidgetUtils.STORIES_LIMIT); } private void processStories(final Story[] stories) { com.newsblur.util.Log.d(TAG, "processStories"); final HashMap<String, Feed> feedMap = new HashMap<>(); Loader<Cursor> loader = FeedUtils.dbHelper.getFeedsLoader(); loader.registerListener(loader.getId(), new Loader.OnLoadCompleteListener<Cursor>() { @Override public void onLoadComplete(@NonNull Loader<Cursor> loader, @Nullable Cursor cursor) { while (cursor != null && cursor.moveToNext()) { Feed feed = Feed.fromCursor(cursor); if (feed.active) { feedMap.put(feed.feedId, feed); } } setStories(stories, feedMap); } }); loader.startLoading(); } private void setStories(Story[] stories, HashMap<String, Feed> feedMap) { com.newsblur.util.Log.d(TAG, "setStories"); for (Story story : stories) { Feed storyFeed = feedMap.get(story.feedId); if (storyFeed != null) { bindStoryValues(story, storyFeed); } } this.storyItems.clear(); this.storyItems.addAll(Arrays.asList(stories)); // we have the data, notify data set changed dataCompleted = true; invalidate(); } private void bindStoryValues(Story story, Feed feed) { story.thumbnailUrl = Story.guessStoryThumbnailURL(story); story.extern_faviconBorderColor = feed.faviconBorder; story.extern_faviconUrl = feed.faviconUrl; story.extern_feedTitle = feed.title; story.extern_feedFade = feed.faviconFade; story.extern_feedColor = feed.faviconColor; } private void invalidate() { com.newsblur.util.Log.d(TAG, "Invalidate app widget with id: " + appWidgetId); AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context); appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetId, R.id.widget_list); } private void setFeedSet() { Set<String> feedIds = PrefsUtils.getWidgetFeedIds(context); if (feedIds == null || !feedIds.isEmpty()) { fs = FeedSet.widgetFeeds(feedIds); } else { // no feeds selected. Widget will show tap to config view fs = null; } } }
4,176
1,283
/* * BaseInfoDriver.h * * Created on: 2012-8-14 * Author: fasiondog */ #pragma once #ifndef BASEINFODRIVER_H_ #define BASEINFODRIVER_H_ #include <unordered_set> #include "../utilities/Parameter.h" #include "../MarketInfo.h" #include "../StockTypeInfo.h" #include "../Stock.h" #include "../utilities/db_connect/SQLStatementBase.h" namespace hku { struct StockInfo { StockInfo() : type(Null<uint32_t>()), valid(0), startDate(0), endDate(0), precision(1), tick(0.0), tickValue(0.0), minTradeNumber(0.0), maxTradeNumber(0.0) {} static const char* getSelectSQL() { return "select c.market, a.code, a.name, a.type, a.valid, a.startDate, a.endDate, b.tick, " "b.tickValue, b.precision, b.minTradeNumber, b.maxTradeNumber from stock a, " "StockTypeInfo b, market c where a.type = b.id and a.marketid = c.marketid"; } void load(const SQLStatementPtr& st) { st->getColumn(0, market, code, name, type, valid, startDate, endDate, tick, tickValue, precision, minTradeNumber, maxTradeNumber); } string market; string code; string name; uint32_t type; uint32_t valid; uint64_t startDate; uint64_t endDate; uint32_t precision; double tick; double tickValue; double minTradeNumber; double maxTradeNumber; }; /** * 基本信息数据获取驱动基类 * @ingroup DataDriver */ class HKU_API BaseInfoDriver { PARAMETER_SUPPORT public: typedef unordered_map<string, MarketInfo> MarketInfoMap; typedef unordered_map<uint32_t, StockTypeInfo> StockTypeInfoMap; /** * 构造函数 * @param name 驱动名称 */ BaseInfoDriver(const string& name); virtual ~BaseInfoDriver() {} /** 获取驱动名称 */ const string& name() const; /** * 驱动初始化 * @param params * @return */ bool init(const Parameter& params); /** * 驱动初始化,具体实现时应注意将之前打开的相关资源关闭。 * @return */ virtual bool _init() = 0; /** * 获取所有股票详情信息 */ virtual vector<StockInfo> getAllStockInfo() = 0; /** * 获取指定的证券信息 * @param market 市场简称 * @param code 证券代码 */ virtual StockInfo getStockInfo(string market, const string& code) = 0; /** * 获取指定日期范围内 [start, end) 的权限列表 * @param market 市场简称 * @param code 证券代码 * @param start 起始日期 * @param end 结束日期 */ virtual StockWeightList getStockWeightList(const string& market, const string& code, Datetime start, Datetime end); /** * 获取当前财务信息 * @param market 市场标识 * @param code 证券代码 */ virtual Parameter getFinanceInfo(const string& market, const string& code); /** * 获取指定的MarketInfo * @param market 市场简称 * @return 如未找到,则返回 Null<MarketInfo>() */ virtual MarketInfo getMarketInfo(const string& market) = 0; /** * 获取全部市场信息 */ virtual vector<MarketInfo> getAllMarketInfo() = 0; /** * 获取全部证券类型信息 */ virtual vector<StockTypeInfo> getAllStockTypeInfo() = 0; /** * 获取相应的证券类型详细信息 * @param type 证券类型 * @return 对应的证券类型信息,如果不存在,则返回Null<StockTypeInf>() */ virtual StockTypeInfo getStockTypeInfo(uint32_t type) = 0; /** * 获取所有节假日日期 */ virtual std::unordered_set<Datetime> getAllHolidays() = 0; private: bool checkType(); protected: string m_name; }; typedef shared_ptr<BaseInfoDriver> BaseInfoDriverPtr; HKU_API std::ostream& operator<<(std::ostream&, const BaseInfoDriver&); HKU_API std::ostream& operator<<(std::ostream&, const BaseInfoDriverPtr&); inline const string& BaseInfoDriver::name() const { return m_name; } } /* namespace hku */ #endif /* BASEINFODRIVER_H_ */
2,006
2,151
/* * Copyright 2017 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkDebugfTracer_DEFINED #define SkDebugfTracer_DEFINED #include "SkEventTracer.h" #include "SkEventTracingPriv.h" #include "SkString.h" /** * A SkEventTracer implementation that logs events using SkDebugf. */ class SkDebugfTracer : public SkEventTracer { public: SkDebugfTracer() {} SkEventTracer::Handle addTraceEvent(char phase, const uint8_t* categoryEnabledFlag, const char* name, uint64_t id, int numArgs, const char** argNames, const uint8_t* argTypes, const uint64_t* argValues, uint8_t flags) override; void updateTraceEventDuration(const uint8_t* categoryEnabledFlag, const char* name, SkEventTracer::Handle handle) override; const uint8_t* getCategoryGroupEnabled(const char* name) override { return fCategories.getCategoryGroupEnabled(name); } const char* getCategoryGroupName(const uint8_t* categoryEnabledFlag) override { return fCategories.getCategoryGroupName(categoryEnabledFlag); } private: SkString fIndent; int fCnt = 0; SkEventTracingCategories fCategories; }; #endif
792
5,133
/* * Copyright MapStruct Authors. * * Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 */ package org.mapstruct.ap.test.mapperconfig; /** * * @author <NAME> */ public class Target { private FooEntity foo; public Target() { } public Target( FooEntity foo ) { this.foo = foo; } public FooEntity getFoo() { return foo; } public void setFoo( FooEntity foo ) { this.foo = foo; } }
197
984
<gh_stars>100-1000 # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Useful trick adapted from https://stackoverflow.com/a/50381071/12254339 # Allows one to define abstract instance attributes import abc class DummyAttribute: pass def abstract_attribute(obj=None): if obj is None: obj = DummyAttribute() obj.__is_abstract_attribute__ = True return obj class ABCMeta(abc.ABCMeta): def __call__(cls, *args, **kwargs): instance = super(ABCMeta, cls).__call__(*args, **kwargs) abstract_attributes = { name for name in dir(instance) if getattr(getattr(instance, name), '__is_abstract_attribute__', False) } if abstract_attributes: raise NotImplementedError( "Can't instantiate abstract class {} with" " abstract attributes: {}".format( cls.__name__, ', '.join(abstract_attributes) ) ) return instance
593
765
# Copyright (c) 2019 Inria # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer; # redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution; # neither the name of the copyright holders nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. from m5.params import * from m5.proxy import * from m5.SimObject import SimObject class BloomFilterBase(SimObject): type = 'BloomFilterBase' abstract = True cxx_header = "base/filters/base.hh" cxx_class = 'gem5::bloom_filter::Base' size = Param.Int(4096, "Number of entries in the filter") # By default assume that bloom filters are used for 64-byte cache lines offset_bits = Param.Unsigned(6, "Number of bits in a cache line offset") # Most of the filters are booleans, and thus saturate on 1 num_bits = Param.Int(1, "Number of bits in a filter entry") threshold = Param.Int(1, "Value at which an entry is considered as set") class BloomFilterBlock(BloomFilterBase): type = 'BloomFilterBlock' cxx_class = 'gem5::bloom_filter::Block' cxx_header = "base/filters/block_bloom_filter.hh" masks_lsbs = VectorParam.Unsigned([Self.offset_bits, 2 * Self.offset_bits], "Position of the LSB of each mask") masks_sizes = VectorParam.Unsigned([Self.offset_bits, Self.offset_bits], "Size, in number of bits, of each mask") class BloomFilterMultiBitSel(BloomFilterBase): type = 'BloomFilterMultiBitSel' cxx_class = 'gem5::bloom_filter::MultiBitSel' cxx_header = "base/filters/multi_bit_sel_bloom_filter.hh" num_hashes = Param.Int(4, "Number of hashes") threshold = Self.num_hashes skip_bits = Param.Int(2, "Offset from block number") is_parallel = Param.Bool(False, "Whether hashing is done in parallel") class BloomFilterBulk(BloomFilterMultiBitSel): type = 'BloomFilterBulk' cxx_class = 'gem5::bloom_filter::Bulk' cxx_header = "base/filters/bulk_bloom_filter.hh" class BloomFilterH3(BloomFilterMultiBitSel): type = 'BloomFilterH3' cxx_class = 'gem5::bloom_filter::H3' cxx_header = "base/filters/h3_bloom_filter.hh" class BloomFilterMulti(BloomFilterBase): type = 'BloomFilterMulti' cxx_class = 'gem5::bloom_filter::Multi' cxx_header = "base/filters/multi_bloom_filter.hh" # The base filter should not be used, since this filter is the combination # of multiple sub-filters, so we use a dummy value size = 1 # By default there are two sub-filters that hash sequential bitfields filters = VectorParam.BloomFilterBase([ BloomFilterBlock(size = 4096, masks_lsbs = [6, 12]), BloomFilterBlock(size = 1024, masks_lsbs = [18, 24])], "Sub-filters to be combined") # By default match this with the number of sub-filters threshold = 2 class BloomFilterPerfect(BloomFilterBase): type = 'BloomFilterPerfect' cxx_class = 'gem5::bloom_filter::Perfect' cxx_header = "base/filters/perfect_bloom_filter.hh" # The base filter is not needed. Use a dummy value. size = 1 # This filter does not use saturating counters - as long as the entry is # set, it is present; thus, it only needs one bit. num_bits = 1 threshold = 1
1,465
510
package com.jpmorgan.cakeshop.test.controller; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; import com.google.gson.JsonParser; import com.jpmorgan.cakeshop.controller.NodeController; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.testng.annotations.Test; public class NodeControllerTest extends BaseControllerTest { @Autowired NodeController nodeController; private static JsonParser jsonParser; public NodeControllerTest() { super(); jsonParser = new JsonParser(); } @Override public Object getController() { return nodeController; } @Test public void testInvalidEndPoint() throws Exception { mockMvc.perform(post("/api/node/testendpoint") .contentType(MediaType.APPLICATION_JSON_VALUE).content("")) .andExpect(status().isNotFound()); } @Test public void testNodeGet() throws Exception { mockMvc.perform(post("/api/node/get") .contentType(MediaType.APPLICATION_JSON_VALUE).content("")) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE)); } }
517
543
<gh_stars>100-1000 /* * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package javax.print.attribute.standard; import java.io.Serial; import javax.print.attribute.Attribute; import javax.print.attribute.DocAttribute; import javax.print.attribute.EnumSyntax; import javax.print.attribute.PrintJobAttribute; import javax.print.attribute.PrintRequestAttribute; /** * Class {@code Media} is a printing attribute class that specifies the medium * on which to print. * <p> * Media may be specified in different ways. * <ul> * <li>it may be specified by paper source - eg paper tray * <li>it may be specified by a standard size - eg "A4" * <li>it may be specified by a name - eg "letterhead" * </ul> * Each of these corresponds to the IPP "media" attribute. The current API does * not support describing media by characteristics (eg colour, opacity). This * may be supported in a later revision of the specification. * <p> * A {@code Media} object is constructed with a value which represents one of * the ways in which the Media attribute can be specified. * <p> * <b>IPP Compatibility:</b> The category name returned by {@code getName()} is * the IPP attribute name. The enumeration's integer value is the IPP enum * value. The {@code toString()} method returns the IPP string representation of * the attribute value. * * @author <NAME> */ public abstract class Media extends EnumSyntax implements DocAttribute, PrintRequestAttribute, PrintJobAttribute { /** * Use serialVersionUID from JDK 1.4 for interoperability. */ @Serial private static final long serialVersionUID = -2823970704630722439L; /** * Constructs a new media attribute specified by name. * * @param value a value */ protected Media(int value) { super (value); } /** * Returns whether this media attribute is equivalent to the passed in * object. To be equivalent, all of the following conditions must be true: * <ol type=1> * <li>{@code object} is not {@code null}. * <li>{@code object} is of the same subclass of {@code Media} as this * object. * <li>The values are equal. * </ol> * * @param object {@code Object} to compare to * @return {@code true} if {@code object} is equivalent to this media * attribute, {@code false} otherwise */ public boolean equals(Object object) { return(object != null && object instanceof Media && object.getClass() == this.getClass() && ((Media)object).getValue() == this.getValue()); } /** * Get the printing attribute class which is to be used as the "category" * for this printing attribute value. * <p> * For class {@code Media} and any vendor-defined subclasses, the category * is class {@code Media} itself. * * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ public final Class<? extends Attribute> getCategory() { return Media.class; } /** * Get the name of the category of which this attribute value is an * instance. * <p> * For class {@code Media} and any vendor-defined subclasses, the category * name is {@code "media"}. * * @return attribute category name */ public final String getName() { return "media"; } }
1,463
5,169
{ "name": "RajuPod", "version": "0.1.0", "summary": "Which is used to make all re-usable code as framework", "description": "Sample description", "homepage": "https://github.com/vegiraju-chandu/RajuFrameWork", "license": { "type": "MIT", "file": "LICENSE" }, "authors": { "vegiraju-chandu": "<EMAIL>" }, "source": { "git": "https://github.com/vegiraju-chandu/RajuFrameWork.git", "tag": "0.1.0" }, "platforms": { "ios": "8.0" }, "source_files": "Source/*" }
231
401
#include "preview_acceptor.h" #include <QImage> #include <QQmlEngine> #include "preview_image_provider.h" PreviewAcceptor::PreviewAcceptor(QQmlEngine *engine, QObject *parent) : QObject(parent), m_previewProvider(new PreviewImageProvider()) { engine->addImageProvider(QLatin1String("preview"), m_previewProvider); } void PreviewAcceptor::setImage(const QImage &preview) { m_previewProvider->setImage(preview); }
146
341
<reponame>realulim/extentreports-java package com.aventstack.extentreports.gherkin; import java.util.List; import java.util.Map; import lombok.Getter; import lombok.ToString; /** * <p> * Modified version of GherkinKeyword.java from cucumber/gherkin. Source url: * https://raw.githubusercontent.com/cucumber/cucumber/master/gherkin/java/src/main/java/gherkin/GherkinDialect.java * * <p> * Gherkin source is licensed under the MIT License * */ @Getter @ToString public class GherkinDialect { private final Map<String, List<String>> keywords; private String language; public GherkinDialect(String language, Map<String, List<String>> keywords) { keywords.remove("name"); keywords.remove("native"); this.language = language; this.keywords = keywords; } }
296
559
/** * Copyright (c) 2016-2017 Netflix, Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef SRC_MSLCONSTANTS_H_ #define SRC_MSLCONSTANTS_H_ #include <Enum.h> #include <stdint.h> #include <set> #include <string> #include <vector> namespace netflix { namespace msl { namespace MslConstants { /** RFC-4627 defines UTF-8 as the default encoding. */ // FIXME //static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8"); /** Maximum long integer value (2^53 limited by JavaScript). */ static const int64_t MAX_LONG_VALUE = 9007199254740992L; /** * The maximum number of MSL messages (requests sent or responses received) * to allow before giving up. Six exchanges, or twelve total messages, * should be sufficient to capture all possible error recovery and * handshake requirements in both trusted network and peer-to-peer modes. */ static const int MAX_MESSAGES = 12; /** Compression algorithm. */ class CompressionAlgorithm : public Enum<CompressionAlgorithm> { public: static const CompressionAlgorithm // In order of most preferred to least preferred. /** GZIP */ GZIP, /** LZW */ LZW, NOCOMPRESSION; /** * Returns the most preferred compression algorithm from the provided * set of algorithms. * * @param algos the set of algorithms to choose from. * @return the most preferred compression algorithm or {@code null} if * the algorithm set is empty. */ static CompressionAlgorithm getPreferredAlgorithm(const std::set<CompressionAlgorithm>& algos); CompressionAlgorithm() : Enum(nocompression, "NOCOMPRESSION") {} enum Value { gzip, lzw, nocompression }; operator Value() const { return static_cast<Value>(value()); } static const std::vector<CompressionAlgorithm>& getValues(); private: CompressionAlgorithm(const Value& value, const std::string& strValue) : Enum(value, strValue) {} }; /** Encryption algorithms. */ class EncryptionAlgo : public Enum<EncryptionAlgo> { public: static const EncryptionAlgo /** AES */ AES, /** INVALID */ INVALID; EncryptionAlgo() : Enum(invalid, "INVALID") {} enum Value { aes, invalid }; operator Value() const { return static_cast<Value>(value()); } static const std::vector<EncryptionAlgo>& getValues(); private: EncryptionAlgo(const Value& value, const std::string& strValue) : Enum(value, strValue) {} }; /** Cipher specifications. */ class CipherSpec : public Enum<CipherSpec> { public: CipherSpec(); static const CipherSpec /** AES/CBC/PKCS5Padding */ AES_CBC_PKCS5Padding, /** AESWrap */ AESWrap, /** RSA/ECB/PKCS1Padding */ RSA_ECB_PKCS1Padding, /** INVALID */ INVALID; enum Value { aes_cbc_pkcs5padding, aeswrap, rsa_ecb_pkcs1padding, invalid }; operator Value() const { return static_cast<Value>(value()); } operator const std::string() const { return stringValue(); } static const std::vector<CipherSpec>& getValues(); private: CipherSpec(const Value& value, const std::string& strValue) : Enum(value, strValue) {} }; /** Signature algorithms. */ class SignatureAlgo : public Enum<SignatureAlgo> { public: static const SignatureAlgo /** HmacSHA256 */ HmacSHA256, /** SHA256withRSA */ SHA256withRSA, /** AESCmac. */ AESCmac, /** INVALID */ INVALID; enum Value { hmacsha256, sha256withrsa, aescmac, invalid }; operator Value() const { return static_cast<Value>(value()); } static const std::vector<SignatureAlgo>& getValues(); SignatureAlgo() : Enum(invalid, "INVALID") {} private: SignatureAlgo(const Value& value, const std::string& strValue) : Enum(value, strValue) {} }; /** Error response codes. */ class ResponseCode : public Enum<ResponseCode> { public: static const ResponseCode /** The message is erroneous and will continue to fail if retried. */ FAIL, /** The message is expected to succeed if retried after a delay. */ TRANSIENT_FAILURE, /** The message is expected to succeed post entity re-authentication. */ ENTITY_REAUTH, /** The message is expected to succeed post user re-authentication. */ USER_REAUTH, /** The message is expected to succeed post key exchange. */ KEYX_REQUIRED, /** The message is expected to succeed with new entity authentication data. */ ENTITYDATA_REAUTH, /** The message is expected to succeed with new user authentication data. */ USERDATA_REAUTH, /** The message is expected to succeed if retried with a renewed master token or renewable message. */ EXPIRED, /** The non-replayable message is expected to succeed if retried with the newest master token. */ REPLAYED, /** The message is expected to succeed with new user authentication data containing a valid single-sign-on token. */ SSOTOKEN_REJECTED, /** Invalid */ INVALID; enum Value { fail = 1, transientFailure = 2, entityReauth = 3, userReauth = 4, keyxRequired = 5, entitydataReauth = 6, userdataReauth = 7, expired = 8, replayed = 9, ssotokenRejected = 10, invalid }; operator Value() const { return static_cast<Value>(value()); } static const std::vector<ResponseCode>& getValues(); ResponseCode() : Enum(invalid, "INVALID") {} ResponseCode(const ResponseCode& other) : Enum(other.value(), other.stringValue()) {} private: ResponseCode(const Value& value, const std::string& strValue) : Enum(value, strValue) {} }; }}} // namespace netflix::msl::MslConstants #endif /* SRC_MSLCONSTANTS_H_ */
2,344
17,037
# This module is automatically generated by autogen.sh. DO NOT EDIT. from . import _OnPrem class _Certificates(_OnPrem): _type = "certificates" _icon_dir = "resources/onprem/certificates" class CertManager(_Certificates): _icon = "cert-manager.png" class LetsEncrypt(_Certificates): _icon = "lets-encrypt.png" # Aliases
122
994
package name.caiyao.microreader.ui.adapter; import android.content.Context; import android.content.Intent; import android.graphics.Color; import android.support.v7.widget.PopupMenu; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.view.animation.DecelerateInterpolator; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import java.util.ArrayList; import butterknife.BindView; import butterknife.ButterKnife; import name.caiyao.microreader.R; import name.caiyao.microreader.bean.zhihu.ZhihuDailyItem; import name.caiyao.microreader.config.Config; import name.caiyao.microreader.ui.activity.ZhihuStoryActivity; import name.caiyao.microreader.utils.DBUtils; import name.caiyao.microreader.utils.ImageLoader; import name.caiyao.microreader.utils.ScreenUtil; /** * Created by 蔡小木 on 2016/4/29 0029. */ public class ZhihuAdapter extends RecyclerView.Adapter<ZhihuAdapter.ZhihuViewHolder> { private ArrayList<ZhihuDailyItem> zhihuStories; private Context mContext; public ZhihuAdapter(Context context, ArrayList<ZhihuDailyItem> zhihuStories) { this.zhihuStories = zhihuStories; this.mContext = context; } @Override public ZhihuViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { return new ZhihuViewHolder(LayoutInflater.from(mContext).inflate(R.layout.zhihu_daily_item, parent, false)); } @Override public void onBindViewHolder(final ZhihuViewHolder holder, int position) { final ZhihuDailyItem zhihuDailyItem = zhihuStories.get(holder.getAdapterPosition()); if (DBUtils.getDB(mContext).isRead(Config.ZHIHU, zhihuDailyItem.getId(), 1)) holder.tvZhihuDaily.setTextColor(Color.GRAY); else holder.tvZhihuDaily.setTextColor(Color.BLACK); holder.tvZhihuDaily.setText(zhihuDailyItem.getTitle()); holder.tvTime.setText(zhihuDailyItem.getDate()); holder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { DBUtils.getDB(mContext).insertHasRead(Config.ZHIHU, zhihuDailyItem.getId(), 1); holder.tvZhihuDaily.setTextColor(Color.GRAY); Intent intent = new Intent(mContext, ZhihuStoryActivity.class); intent.putExtra("type", ZhihuStoryActivity.TYPE_ZHIHU); intent.putExtra("id", zhihuDailyItem.getId()); intent.putExtra("title", zhihuDailyItem.getTitle()); mContext.startActivity(intent); } }); holder.btnZhihu.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { PopupMenu popupMenu = new PopupMenu(mContext, holder.btnZhihu); popupMenu.getMenuInflater().inflate(R.menu.pop_menu, popupMenu.getMenu()); popupMenu.getMenu().removeItem(R.id.pop_share); popupMenu.getMenu().removeItem(R.id.pop_fav); final boolean isRead = DBUtils.getDB(mContext).isRead(Config.ZHIHU, zhihuDailyItem.getId(), 1); if (!isRead) popupMenu.getMenu().findItem(R.id.pop_unread).setTitle(R.string.common_set_read); else popupMenu.getMenu().findItem(R.id.pop_unread).setTitle(R.string.common_set_unread); popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { switch (item.getItemId()) { case R.id.pop_unread: if (isRead) { DBUtils.getDB(mContext).insertHasRead(Config.ZHIHU, zhihuDailyItem.getId(), 0); holder.tvZhihuDaily.setTextColor(Color.BLACK); } else { DBUtils.getDB(mContext).insertHasRead(Config.ZHIHU, zhihuDailyItem.getId(), 1); holder.tvZhihuDaily.setTextColor(Color.GRAY); } break; } return true; } }); popupMenu.show(); } }); runEnterAnimation(holder.itemView); if (zhihuStories.get(position).getImages() != null) ImageLoader.loadImage(mContext, zhihuDailyItem.getImages()[0], holder.ivZhihuDaily); } private void runEnterAnimation(View view) { view.setTranslationX(ScreenUtil.getScreenWidth(mContext)); view.animate() .translationX(0) .setStartDelay(100) .setInterpolator(new DecelerateInterpolator(3.f)) .setDuration(700) .start(); } @Override public int getItemCount() { return zhihuStories.size(); } class ZhihuViewHolder extends RecyclerView.ViewHolder { @BindView(R.id.iv_zhihu_daily) ImageView ivZhihuDaily; @BindView(R.id.tv_zhihu_daily) TextView tvZhihuDaily; @BindView(R.id.tv_time) TextView tvTime; @BindView(R.id.btn_zhihu) Button btnZhihu; ZhihuViewHolder(View itemView) { super(itemView); ButterKnife.bind(this, itemView); } } }
2,706
1,831
/** * Copyright (c) 2017-present, Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include "logdevice/common/Request.h" #include "logdevice/common/WeakRefHolder.h" namespace facebook { namespace logdevice { /** * @file A request to repopulate the record caches from stable storage. * Regardless of success or failure, any persistent cache data is * destroyed so we have a clean slate for persisting record cache data * on the next shutdown. */ class RepopulateRecordCachesRequest : public Request { public: /** * @param callback Will be called with the resulting status for each shard * @param repopulate_record_caches If false, will only remove snapshots (not * repopulate) */ explicit RepopulateRecordCachesRequest( std::function<void(Status, int)> callback, bool repopulate_record_caches); Execution execute() override; // called by each RecordCacheRepopulationTask when it is done executing void onRepopulationTaskDone(Status status, shard_index_t shard_idx); private: // count of remaining RecordCache repopulation tasks int remaining_record_cache_repopulations_; /** * Callback function to notify caller of status from each shard. Possible * outcomes: * - OK if everything went well * - PARTIAL if there were some snapshot blobs that we could not read * - FAILED if we were not able to delete all existing snapshots (in * this case, logdeviced should exit) * - DISABLED if the shard is disabled */ std::function<void(Status, int)> callback_; // for creating weakref to itself for storage tasks created. WeakRefHolder<RepopulateRecordCachesRequest> ref_holder_; // If true: repopulate caches, in either case: drop snapshots column family. const bool repopulate_record_caches_; }; }} // namespace facebook::logdevice
649
1,350
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.synapse.implementation; import com.azure.resourcemanager.synapse.fluent.models.RestorableDroppedSqlPoolInner; import com.azure.resourcemanager.synapse.models.RestorableDroppedSqlPool; import java.time.OffsetDateTime; public final class RestorableDroppedSqlPoolImpl implements RestorableDroppedSqlPool { private RestorableDroppedSqlPoolInner innerObject; private final com.azure.resourcemanager.synapse.SynapseManager serviceManager; RestorableDroppedSqlPoolImpl( RestorableDroppedSqlPoolInner innerObject, com.azure.resourcemanager.synapse.SynapseManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } public String id() { return this.innerModel().id(); } public String name() { return this.innerModel().name(); } public String type() { return this.innerModel().type(); } public String location() { return this.innerModel().location(); } public String databaseName() { return this.innerModel().databaseName(); } public String edition() { return this.innerModel().edition(); } public String maxSizeBytes() { return this.innerModel().maxSizeBytes(); } public String serviceLevelObjective() { return this.innerModel().serviceLevelObjective(); } public String elasticPoolName() { return this.innerModel().elasticPoolName(); } public OffsetDateTime creationDate() { return this.innerModel().creationDate(); } public OffsetDateTime deletionDate() { return this.innerModel().deletionDate(); } public OffsetDateTime earliestRestoreDate() { return this.innerModel().earliestRestoreDate(); } public RestorableDroppedSqlPoolInner innerModel() { return this.innerObject; } private com.azure.resourcemanager.synapse.SynapseManager manager() { return this.serviceManager; } }
743
14,668
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.components.external_intents; import androidx.annotation.Nullable; import org.chromium.url.GURL; import org.chromium.url.Origin; /** * A container object for passing navigation parameters to {@link ExternalNavigationHandler}. */ public class ExternalNavigationParams { /** The URL which we are navigating to. */ private final GURL mUrl; /** Whether we are currently in an incognito context. */ private final boolean mIsIncognito; /** The referrer URL for the current navigation. */ private final GURL mReferrerUrl; /** The page transition type for the current navigation. */ private final int mPageTransition; /** Whether the current navigation is a redirect. */ private final boolean mIsRedirect; /** Whether Chrome has to be in foreground for external navigation to occur. */ private final boolean mApplicationMustBeInForeground; /** A redirect handler. */ private final RedirectHandler mRedirectHandler; /** Whether the intent should force a new tab to open. */ private final boolean mOpenInNewTab; /** Whether this navigation happens in background tab. */ private final boolean mIsBackgroundTabNavigation; /** Whether intent launches are allowed in background tabs. */ private final boolean mIntentLaunchesAllowedInBackgroundTabs; /** Whether this navigation happens in main frame. */ private final boolean mIsMainFrame; /** * The package name of the TWA or WebAPK within which the navigation is happening. * Null if the navigation is not within one of these wrapping APKs. */ private final String mNativeClientPackageName; /** Whether this navigation is launched by user gesture. */ private final boolean mHasUserGesture; /** * Whether the current tab should be closed when an URL load was overridden and an * intent launched. */ private final boolean mShouldCloseContentsOnOverrideUrlLoadingAndLaunchIntent; /** * Whether the navigation is initiated by the renderer. */ private boolean mIsRendererInitiated; /** * The origin that initiates the navigation, could be null. */ private Origin mInitiatorOrigin; private ExternalNavigationParams(GURL url, boolean isIncognito, GURL referrerUrl, int pageTransition, boolean isRedirect, boolean appMustBeInForeground, RedirectHandler redirectHandler, boolean openInNewTab, boolean isBackgroundTabNavigation, boolean intentLaunchesAllowedInBackgroundTabs, boolean isMainFrame, String nativeClientPackageName, boolean hasUserGesture, boolean shouldCloseContentsOnOverrideUrlLoadingAndLaunchIntent, boolean isRendererInitiated, @Nullable Origin initiatorOrigin) { mUrl = url; assert mUrl != null; mIsIncognito = isIncognito; mPageTransition = pageTransition; mReferrerUrl = (referrerUrl == null) ? GURL.emptyGURL() : referrerUrl; mIsRedirect = isRedirect; mApplicationMustBeInForeground = appMustBeInForeground; mRedirectHandler = redirectHandler; mOpenInNewTab = openInNewTab; mIsBackgroundTabNavigation = isBackgroundTabNavigation; mIntentLaunchesAllowedInBackgroundTabs = intentLaunchesAllowedInBackgroundTabs; mIsMainFrame = isMainFrame; mNativeClientPackageName = nativeClientPackageName; mHasUserGesture = hasUserGesture; mShouldCloseContentsOnOverrideUrlLoadingAndLaunchIntent = shouldCloseContentsOnOverrideUrlLoadingAndLaunchIntent; mIsRendererInitiated = isRendererInitiated; mInitiatorOrigin = initiatorOrigin; } /** @return The URL to potentially open externally. */ public GURL getUrl() { return mUrl; } /** @return Whether we are currently in incognito mode. */ public boolean isIncognito() { return mIsIncognito; } /** @return The referrer URL. */ public GURL getReferrerUrl() { return mReferrerUrl; } /** @return The page transition for the current navigation. */ public int getPageTransition() { return mPageTransition; } /** @return Whether the navigation is part of a redirect. */ public boolean isRedirect() { return mIsRedirect; } /** @return Whether the application has to be in foreground to open the URL. */ public boolean isApplicationMustBeInForeground() { return mApplicationMustBeInForeground; } /** @return The redirect handler. */ public RedirectHandler getRedirectHandler() { return mRedirectHandler; } /** * @return Whether the external navigation should be opened in a new tab if handled by Chrome * through the intent picker. */ public boolean isOpenInNewTab() { return mOpenInNewTab; } /** @return Whether this navigation happens in background tab. */ public boolean isBackgroundTabNavigation() { return mIsBackgroundTabNavigation; } /** @return Whether intent launches are allowed in background tabs. */ public boolean areIntentLaunchesAllowedInBackgroundTabs() { return mIntentLaunchesAllowedInBackgroundTabs; } /** @return Whether this navigation happens in main frame. */ public boolean isMainFrame() { return mIsMainFrame; } /** * @return The package name of the TWA or WebAPK within which the navigation is happening. * Null if the navigation is not within one of these wrapping APKs. */ public String nativeClientPackageName() { return mNativeClientPackageName; } /** @return Whether this navigation is launched by user gesture. */ public boolean hasUserGesture() { return mHasUserGesture; } /** * @return Whether the current tab should be closed when an URL load was overridden and an * intent launched. */ public boolean shouldCloseContentsOnOverrideUrlLoadingAndLaunchIntent() { return mShouldCloseContentsOnOverrideUrlLoadingAndLaunchIntent; } /** * @return Whether the navigation is initiated by renderer. */ public boolean isRendererInitiated() { return mIsRendererInitiated; } /** * @return The origin that initiates the navigation. */ @Nullable public Origin getInitiatorOrigin() { return mInitiatorOrigin; } /** The builder for {@link ExternalNavigationParams} objects. */ public static class Builder { /** The URL which we are navigating to. */ private GURL mUrl; /** Whether we are currently in an incognito context. */ private boolean mIsIncognito; /** The referrer URL for the current navigation. */ private GURL mReferrerUrl; /** The page transition type for the current navigation. */ private int mPageTransition; /** Whether the current navigation is a redirect. */ private boolean mIsRedirect; /** Whether Chrome has to be in foreground for external navigation to occur. */ private boolean mApplicationMustBeInForeground; /** A redirect handler. */ private RedirectHandler mRedirectHandler; /** Whether the intent should force a new tab to open. */ private boolean mOpenInNewTab; /** Whether this navigation happens in background tab. */ private boolean mIsBackgroundTabNavigation; /** Whether intent launches are allowed in background tabs. */ private boolean mIntentLaunchesAllowedInBackgroundTabs; /** Whether this navigation happens in main frame. */ private boolean mIsMainFrame; /** * The package name of the TWA or WebAPK within which the navigation is happening. * Null if the navigation is not within one of these wrapping APKs. */ private String mNativeClientPackageName; /** Whether this navigation is launched by user gesture. */ private boolean mHasUserGesture; /** * Whether the current tab should be closed when an URL load was overridden and an * intent launched. */ private boolean mShouldCloseContentsOnOverrideUrlLoadingAndLaunchIntent; /** * Whether the navigation is initiated by the renderer. */ private boolean mIsRendererInitiated; /** * The origin that initiates the navigation, could be null. */ private Origin mInitiatorOrigin; public Builder(GURL url, boolean isIncognito) { mUrl = url; mIsIncognito = isIncognito; } public Builder(GURL url, boolean isIncognito, GURL referrer, int pageTransition, boolean isRedirect) { mUrl = url; mIsIncognito = isIncognito; mReferrerUrl = referrer; mPageTransition = pageTransition; mIsRedirect = isRedirect; } /** Specify whether the application must be in foreground to launch an external intent. */ public Builder setApplicationMustBeInForeground(boolean v) { mApplicationMustBeInForeground = v; return this; } /** Sets a tab redirect handler. */ public Builder setRedirectHandler(RedirectHandler handler) { mRedirectHandler = handler; return this; } /** Sets whether we want to open the intent URL in new tab, if handled by Chrome. */ public Builder setOpenInNewTab(boolean v) { mOpenInNewTab = v; return this; } /** Sets whether this navigation happens in background tab. */ public Builder setIsBackgroundTabNavigation(boolean v) { mIsBackgroundTabNavigation = v; return this; } /** Sets whether intent launches are allowed in background tabs. */ public Builder setIntentLaunchesAllowedInBackgroundTabs(boolean v) { mIntentLaunchesAllowedInBackgroundTabs = v; return this; } /** Sets whether this navigation happens in main frame. */ public Builder setIsMainFrame(boolean v) { mIsMainFrame = v; return this; } /** Sets the package name of the TWA or WebAPK within which the navigation is happening. **/ public Builder setNativeClientPackageName(String v) { mNativeClientPackageName = v; return this; } /** Sets whether this navigation happens in main frame. */ public Builder setHasUserGesture(boolean v) { mHasUserGesture = v; return this; } /** * Sets whether the current tab should be closed when an URL load was overridden and an * intent launched. */ public Builder setShouldCloseContentsOnOverrideUrlLoadingAndLaunchIntent(boolean v) { mShouldCloseContentsOnOverrideUrlLoadingAndLaunchIntent = v; return this; } /** * Sets whether the navigation is initiated by renderer. */ public Builder setIsRendererInitiated(boolean v) { mIsRendererInitiated = v; return this; } /** * Sets the origin that initiates the navigation. */ public Builder setInitiatorOrigin(@Nullable Origin v) { mInitiatorOrigin = v; return this; } /** @return A fully constructed {@link ExternalNavigationParams} object. */ public ExternalNavigationParams build() { return new ExternalNavigationParams(mUrl, mIsIncognito, mReferrerUrl, mPageTransition, mIsRedirect, mApplicationMustBeInForeground, mRedirectHandler, mOpenInNewTab, mIsBackgroundTabNavigation, mIntentLaunchesAllowedInBackgroundTabs, mIsMainFrame, mNativeClientPackageName, mHasUserGesture, mShouldCloseContentsOnOverrideUrlLoadingAndLaunchIntent, mIsRendererInitiated, mInitiatorOrigin); } } }
4,538
10,110
<reponame>mitchchristow/deepmind-research # Copyright 2019 DeepMind Technologies Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Setup for pip package.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from setuptools import find_packages from setuptools import setup REQUIRED_PACKAGES = ['numpy', 'dm-sonnet==1.35', 'tensorflow==1.14', 'tensorflow-probability==0.7.0'] setup( name='hpu_net', version='0.1', description='A library for the Hierarchical Probabilistic U-Net model.', url='https://github.com/deepmind/deepmind-research/hierarchical_probabilistic_unet', author='DeepMind', author_email='<EMAIL>', # Contained modules and scripts. packages=find_packages(), install_requires=REQUIRED_PACKAGES, platforms=['any'], license='Apache 2.0', )
449
776
package act.app; /*- * #%L * ACT Framework * %% * Copyright (C) 2014 - 2018 ActFramework * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ import org.osgl.http.CurrentStateStore; import org.osgl.http.H; class HttpCurrentStateStore implements CurrentStateStore { @Override public H.Request request() { ActionContext ctx = ActionContext.current(); return null == ctx ? null : ctx.req(); } @Override public H.Response response() { ActionContext ctx = ActionContext.current(); return null == ctx ? null : ctx.resp(); } @Override public H.Session session() { ActionContext ctx = ActionContext.current(); return null == ctx ? null : ctx.session(); } @Override public H.Flash flash() { ActionContext ctx = ActionContext.current(); return null == ctx ? null : ctx.flash(); } @Override public void session(H.Session session) { } @Override public void request(H.Request request) { } @Override public void response(H.Response response) { } @Override public void flash(H.Flash flash) { } @Override public void clear() { } }
591
1,062
try: print "Hello!" except: print "Something went wrong."
24
852
#ifndef TRange_H #define TRange_H /** Define a range [aMin,aMax] */ #include <iostream> #include <utility> #include <algorithm> template <class T> class TRange : public std::pair<T, T> { public: TRange() {} TRange(const T& aMin, const T& aMax) : std::pair<T, T>(aMin, aMax) {} TRange(const std::pair<T, T>& apair) : std::pair<T, T>(apair) {} /// lower edge of range const T& min() const { return this->first; } /// upper edge of range const T& max() const { return this->second; } T mean() const { return (this->first + this->second) / 2.; } /// true for empty region. note that region [x,x] is not empty bool empty() const { return (this->second < this->first); } /// check if object is inside region bool inside(const T& value) const { if (value < this->first || this->second < value) return false; else return true; } /* /// check if ranges overlap bool hasIntersection( const TRange<T> & r) const { return rangesIntersect(*this,r); } /// overlaping region TRange<T> intersection( const TRange<T> & r) const { return rangeIntersection(*this,r); } */ /// sum of overlaping regions. the overlapping should be checked before. TRange<T> sum(const TRange<T>& r) const { if (this->empty()) return r; else if (r.empty()) return *this; else return TRange((min() < r.min()) ? min() : r.min(), (max() < r.max()) ? r.max() : max()); } void sort() { if (empty()) std::swap(this->first, this->second); } }; template <class T> std::ostream& operator<<(std::ostream& out, const TRange<T>& r) { return out << "(" << r.min() << "," << r.max() << ")"; } #endif
638
348
{"nom":"Montigny-sur-Aube","circ":"4ème circonscription","dpt":"Côte-d'Or","inscrits":200,"abs":100,"votants":100,"blancs":16,"nuls":9,"exp":75,"res":[{"nuance":"REM","nom":"<NAME>","voix":41},{"nuance":"LR","nom":"<NAME>","voix":34}]}
98
5,250
/* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.flowable.cmmn.api; import org.flowable.batch.api.Batch; import org.flowable.cmmn.api.migration.CaseInstanceBatchMigrationResult; import org.flowable.cmmn.api.migration.CaseInstanceMigrationBuilder; import org.flowable.cmmn.api.migration.CaseInstanceMigrationDocument; import org.flowable.cmmn.api.migration.CaseInstanceMigrationValidationResult; /** * Service to manager case instance migrations. * * @author <NAME> */ public interface CmmnMigrationService { CaseInstanceMigrationBuilder createCaseInstanceMigrationBuilder(); CaseInstanceMigrationBuilder createCaseInstanceMigrationBuilderFromCaseInstanceMigrationDocument(CaseInstanceMigrationDocument document); CaseInstanceMigrationValidationResult validateMigrationForCaseInstance(String caseInstanceId, CaseInstanceMigrationDocument caseInstanceMigrationDocument); CaseInstanceMigrationValidationResult validateMigrationForCaseInstancesOfCaseDefinition(String caseDefinitionId, CaseInstanceMigrationDocument caseInstanceMigrationDocument); CaseInstanceMigrationValidationResult validateMigrationForCaseInstancesOfCaseDefinition(String caseDefinitionKey, int caseDefinitionVersion, String caseDefinitionTenantId, CaseInstanceMigrationDocument caseInstanceMigrationDocument); void migrateCaseInstance(String caseInstanceId, CaseInstanceMigrationDocument caseInstanceMigrationDocument); void migrateCaseInstancesOfCaseDefinition(String caseDefinitionId, CaseInstanceMigrationDocument caseInstanceMigrationDocument); void migrateCaseInstancesOfCaseDefinition(String caseDefinitionKey, int caseDefinitionVersion, String caseDefinitionTenantId, CaseInstanceMigrationDocument caseInstanceMigrationDocument); Batch batchMigrateCaseInstancesOfCaseDefinition(String caseDefinitionId, CaseInstanceMigrationDocument caseInstanceMigrationDocument); Batch batchMigrateCaseInstancesOfCaseDefinition(String caseDefinitionKey, int caseDefinitionVersion, String caseDefinitionTenantId, CaseInstanceMigrationDocument caseInstanceMigrationDocument); CaseInstanceBatchMigrationResult getResultsOfBatchCaseInstanceMigration(String migrationBatchId); }
666
688
<gh_stars>100-1000 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. package com.microsoft.recognizers.datatypes.timex.expression; public class TimexRange { private TimexProperty start; private TimexProperty end; private TimexProperty duration; public TimexProperty getStart() { return start; } public void setStart(TimexProperty withStart) { this.start = withStart; } public TimexProperty getEnd() { return end; } public void setEnd(TimexProperty withEnd) { this.end = withEnd; } public TimexProperty getDuration() { return duration; } public void setDuration(TimexProperty withDuration) { this.duration = withDuration; } }
281
689
/** * Copyright (C) Mellanox Technologies Ltd. 2019. ALL RIGHTS RESERVED. * * See file LICENSE for terms. */ int dummy() { return 0; }
53
765
//===-- ASTDumper.cpp -------------------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "ASTDumper.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Symbol/ClangUtil.h" #include "lldb/Symbol/CompilerType.h" #include "lldb/Utility/Log.h" #include "llvm/Support/raw_ostream.h" using namespace lldb_private; ASTDumper::ASTDumper(clang::Decl *decl) { clang::DeclContext *decl_ctx = llvm::dyn_cast<clang::DeclContext>(decl); bool has_external_lexical_storage; bool has_external_visible_storage; if (decl_ctx) { has_external_lexical_storage = decl_ctx->hasExternalLexicalStorage(); has_external_visible_storage = decl_ctx->hasExternalVisibleStorage(); decl_ctx->setHasExternalLexicalStorage(false); decl_ctx->setHasExternalVisibleStorage(false); } llvm::raw_string_ostream os(m_dump); decl->print(os); os.flush(); if (decl_ctx) { decl_ctx->setHasExternalLexicalStorage(has_external_lexical_storage); decl_ctx->setHasExternalVisibleStorage(has_external_visible_storage); } } ASTDumper::ASTDumper(clang::DeclContext *decl_ctx) { bool has_external_lexical_storage = decl_ctx->hasExternalLexicalStorage(); bool has_external_visible_storage = decl_ctx->hasExternalVisibleStorage(); decl_ctx->setHasExternalLexicalStorage(false); decl_ctx->setHasExternalVisibleStorage(false); if (clang::Decl *decl = llvm::dyn_cast<clang::Decl>(decl_ctx)) { llvm::raw_string_ostream os(m_dump); decl->print(os); os.flush(); } else { m_dump.assign("<DeclContext is not a Decl>"); } decl_ctx->setHasExternalLexicalStorage(has_external_lexical_storage); decl_ctx->setHasExternalVisibleStorage(has_external_visible_storage); } ASTDumper::ASTDumper(const clang::Type *type) { m_dump = clang::QualType(type, 0).getAsString(); } ASTDumper::ASTDumper(clang::QualType type) { m_dump = type.getAsString(); } ASTDumper::ASTDumper(lldb::opaque_compiler_type_t type) { m_dump = clang::QualType::getFromOpaquePtr(type).getAsString(); } ASTDumper::ASTDumper(const CompilerType &compiler_type) { m_dump = ClangUtil::GetQualType(compiler_type).getAsString(); } const char *ASTDumper::GetCString() { return m_dump.c_str(); } void ASTDumper::ToLog(Log *log, const char *prefix) { size_t len = m_dump.length() + 1; char *alloc = (char *)malloc(len); char *str = alloc; memcpy(str, m_dump.c_str(), len); char *end = nullptr; end = strchr(str, '\n'); while (end) { *end = '\0'; LLDB_LOGF(log, "%s%s", prefix, str); *end = '\n'; str = end + 1; end = strchr(str, '\n'); } LLDB_LOGF(log, "%s%s", prefix, str); free(alloc); }
1,079
645
// Copyright 2012 Viewfinder. All rights reserved. // Author: <NAME>. #import <UIKit/UIKit.h> #import "ModalView.h" class UIAppState; @class ConversationSummaryView; @class SummaryToolbar; @protocol ConversationPickerEnv @optional - (void)conversationPickerSelection:(int64_t)viewpoint_id; - (void)conversationPickerExit; @end // ConversationPickerEnv @interface ConversationPickerView : ModalView { @private __weak id<ConversationPickerEnv> env_; bool need_rebuild_; float toolbar_top_; ConversationSummaryView* summary_; SummaryToolbar* toolbar_; } @property (nonatomic, weak) id<ConversationPickerEnv> env; - (id)initWithState:(UIAppState*)state; @end // ConversationPickerView // local variables: // mode: objc // end:
256
9,156
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.pulsar.io.rabbitmq; import org.apache.qpid.server.Broker; import org.apache.qpid.server.BrokerOptions; import java.io.File; import java.io.FileOutputStream; import java.nio.file.Files; import java.nio.file.Path; public class RabbitMQBrokerManager { private final Broker broker = new Broker(); public void startBroker(String port) throws Exception { BrokerOptions brokerOptions = getBrokerOptions(port); broker.startup(brokerOptions); } public void stopBroker() { broker.shutdown(); } BrokerOptions getBrokerOptions(String port) throws Exception { Path tmpFolder = Files.createTempDirectory("qpidWork"); Path homeFolder = Files.createTempDirectory("qpidHome"); File etc = new File(homeFolder.toFile(), "etc"); etc.mkdir(); FileOutputStream fos = new FileOutputStream(new File(etc, "passwd")); fos.write("guest:guest\n".getBytes()); fos.close(); BrokerOptions brokerOptions = new BrokerOptions(); brokerOptions.setConfigProperty("qpid.work_dir", tmpFolder.toAbsolutePath().toString()); brokerOptions.setConfigProperty("qpid.amqp_port", port); brokerOptions.setConfigProperty("qpid.home_dir", homeFolder.toAbsolutePath().toString()); String configPath = getFile("qpid.json").getAbsolutePath(); brokerOptions.setInitialConfigurationLocation(configPath); return brokerOptions; } private File getFile(String name) { ClassLoader classLoader = getClass().getClassLoader(); return new File(classLoader.getResource(name).getFile()); } }
795
1,101
"""Plot to test line with drawstyle steps""" import matplotlib.pyplot as plt import mpld3 def create_plot(): fig, ax = plt.subplots() x = [0, 1] ax.plot(range(5),range(9,4,-1),drawstyle='steps', marker='*') ax.plot(range(5),range(5,0,-1),drawstyle='steps-post', marker='*') ax.plot(range(5),range(7,2,-1),drawstyle='steps-mid', marker='*') ax.set_ylim(0, 10) ax.set_xlim(0, 5) ax.set_title("Line with drawstyle steps", size=20) return fig def test_lines_with_steps(): fig = create_plot() html = mpld3.fig_to_html(fig) plt.close(fig) if __name__ == "__main__": mpld3.show(create_plot())
293
530
<filename>application/org.openjdk.jmc.joverflow/src/main/java/org/openjdk/jmc/joverflow/heap/model/Snapshot.java<gh_stars>100-1000 /* * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * The contents of this file are subject to the terms of either the Universal Permissive License * v 1.0 as shown at http://oss.oracle.com/licenses/upl * * or the following license: * * Redistribution and use in source and binary forms, with or without modification, are permitted * provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this list of conditions * and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials provided with * the distribution. * * 3. Neither the name of the copyright holder nor the names of its contributors may be used to * endorse or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.openjdk.jmc.joverflow.heap.model; import java.io.IOException; import java.lang.ref.SoftReference; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import org.openjdk.jmc.joverflow.heap.parser.ReadBuffer; import org.openjdk.jmc.joverflow.support.Constants; import org.openjdk.jmc.joverflow.util.IntToIntMap; import org.openjdk.jmc.joverflow.util.LongToIntMap; import org.openjdk.jmc.joverflow.util.LongToObjectMap; import org.openjdk.jmc.joverflow.util.MiscUtils; import org.openjdk.jmc.joverflow.util.NumberToIntMap; import org.openjdk.jmc.joverflow.util.VerboseOutputCollector; /** * Represents all of the contents of the heap dump. */ public class Snapshot { public static final long SMALL_ID_MASK = 0x0FFFFFFFFL; public static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; /** * Size of object pointers used in this heap dump. May be different from the actual pointer size * in memory of the JVM that generated this heap dump, because of narrow references in 64-bit * mode. That is, for the 64-bit JVM hprofPointerSize is always 8, but in the real JVM the * pointer size is usually 4, unless the heap is really big (&gt; ~26GB) */ private final int hprofPointerSize; /** Object pointer size in the JVM that generated this heap dump */ private final int pointerSize; /** Object header size in the JVM that generated this heap dump */ private final int objHeaderSize; /** Memory object alignment granularity in the JVM that generated this dump */ private final int objAlignment; /** If true, narrow (32-bit) pointers are used in 64-bit mode */ private final boolean usingNarrowPointers; /** All GC roots in this heap dump */ private final ArrayList<Root> roots; private final JavaObjectTable objectTable; private final NumberToIntMap objIdToPosInObjectTable; private final JavaClass[] classes; /** * Maps a Java class name to the respective JavaClass object. Classes with same name but * different ids (loaders) are chained, thus classes.size() won't return the exact number of * classes in this snapshot */ private final HashMap<String, JavaClass> classNameToJavaClass; /** Maps an object ID to the respective JavaClass object */ private final LongToObjectMap<JavaClass> classIdToJavaClass; /** Maps a classloader object ID to the respective JavaHeapObject */ private final LongToObjectMap<JavaObject> classLoaders; /** * Rough total size of all instances and arrays (but not classes) in the heap dump. The size of * an object is the size of its data in the heap dump, which is not guaranteed to be the same as * in memory, plus header size (which is objHeaderSize above). No adjustment for object * alignment is made. */ private final long roughTotalObjectSize; /** Heap dump memory buffer used for lazy reads of JavaHeapObject contents */ private ReadBuffer readBuf; private HeapStringReader stringReader; /** * If this is true, warnings are not recorded for objects that fail to resolve. It's set to true * when unexpected EOF is detected when reading a HPROF file, and therefore some objects are * expected to be missing and references to them will be unresolved. */ private final boolean unresolvedObjectsOk; /** Soft cache of finalizeable objects - lazily initialized */ private SoftReference<ArrayList<JavaHeapObject>> finalizablesCache; /** java.lang.ref.Reference class */ private JavaClass weakReferenceClass; /** Index of 'referent' field in java.lang.ref.Reference class */ private int referentFieldIndex; /** Several popular classes, used for fast recognition */ private JavaClass javaLangClass, javaLangString, javaLangClassLoader, charArrayClass, byteArrayClass; /** * This is set to true when global object stats is being calculated, to signal that e.g. heap * inspection operations should not be performed, or that some assumptions valid after stats * calculation is done, are not yet true. */ private volatile boolean calculatingStats; private final VerboseOutputCollector vc; private Snapshot(int hprofPointerSize, int pointerSize, int objHeaderSize, int objAlignment, boolean usingNarrowPointers, long roughTotalObjectSize, ArrayList<Root> roots, JavaObjectTable objectTable, NumberToIntMap objIdToPosInObjectTable, JavaClass[] classes, HashMap<String, JavaClass> classNameToJavaClass, LongToObjectMap<JavaClass> classIdToJavaClass, ReadBuffer readBuf, VerboseOutputCollector vc, boolean unresolvedObjectsOk) { this.hprofPointerSize = hprofPointerSize; this.pointerSize = pointerSize; this.objHeaderSize = objHeaderSize; this.objAlignment = objAlignment; this.usingNarrowPointers = usingNarrowPointers; this.roughTotalObjectSize = roughTotalObjectSize; this.roots = roots; this.objectTable = objectTable; this.objIdToPosInObjectTable = objIdToPosInObjectTable; this.classes = classes; this.classNameToJavaClass = classNameToJavaClass; this.classIdToJavaClass = classIdToJavaClass; classLoaders = new LongToObjectMap<>(50, false); this.readBuf = readBuf; this.vc = vc; this.unresolvedObjectsOk = unresolvedObjectsOk; javaLangClass = getClassForName("java.lang.Class"); javaLangString = getClassForName("java.lang.String"); javaLangClassLoader = getClassForName("java.lang.ClassLoader"); charArrayClass = getClassForName("[C"); byteArrayClass = getClassForName("[B"); weakReferenceClass = getClassForName("java.lang.ref.Reference"); // The code below should be called in the very end of constructor. // Note that it exposes this Snapshot instance, which is technically still // partially constructed, to methods of JavaClass. While not a good style, // it works here, and makes things overall a bit simpler than putting code // below into a separate finishInitialization() method. for (JavaClass clazz : classes) { // The call below results in callbacks to dereferenceField() and dereferenceClassLoader() clazz.resolve(this, roots); } this.stringReader = new HeapStringReader(this); JavaField[] fields = weakReferenceClass.getFieldsForInstance(); for (int i = 0; i < fields.length; i++) { if ("referent".equals(fields[i].getName())) { referentFieldIndex = i; break; } } } /** * Returns the heap object with the specified id. If an object with this id does not exist (may * happen with corrupted heap dumps), returns an instance of a fake class for this id. */ public JavaHeapObject getObjectForId(long id) { if (id == 0) { return null; } int objPosInTable = objIdToPosInObjectTable.get(id); if (objPosInTable >= 0) { return objectTable.getObject(objPosInTable); } else { return classIdToJavaClass.get(id); } } /** * Returns the heap object with the specified global index. Each JavaHeapObject in the heap dump * has a unique index, that is returned by {@link JavaHeapObject#getGlobalObjectIndex()}. The * index is not equal to the object id. */ public JavaHeapObject getObjectAtGlobalIndex(int globalIndex) { if (globalIndex > 0) { return objectTable.getObject(globalIndex); } else { return classes[-globalIndex]; } } public JavaClass getClassForName(String name) { return classNameToJavaClass.get(name); } public JavaClass getClassForId(long id) { return classIdToJavaClass.get(id); } public List<Root> getRoots() { return roots; } public Collection<JavaLazyReadObject> getObjects() { return objectTable.getObjects(); } public Collection<JavaLazyReadObject> getUnvisitedObjects() { return objectTable.getUnvisitedObjects(); } /** * Returns an enumeration of all classes in this snapshot, including multiple versions of class * with the same name. */ public JavaClass[] getClasses() { return classes; } public Collection<JavaObject> getClassLoaders() { return classLoaders.values(); } /** * Returns the total number of all objects in the heap dump. This includes instances and arrays, * but not classes. */ public int getNumObjects() { return objIdToPosInObjectTable.size(); } public int getNumClasses() { return classes.length; } public ReadBuffer getReadBuffer() { return readBuf; } /** * Allows the user to replace the ReadBuffer instance used by this Snapshot, for example to * reduce memory usage once no more intensive random-access operations are performed. The * provided factory should use exactly the same heap dump file. */ public void resetReadBuffer(ReadBuffer.Factory bufFactory) { try { readBuf = bufFactory.create(null); } catch (IOException ex) { throw new RuntimeException(ex); } } /** * Should be called by the user before removing references to this Snapshot instance, i.e. * before it gets GCed. Frees any external resources that it may have used internally. */ public void discard() { readBuf.close(); } /** * Called during class resolution, to convert static field ids into objects, and when parsing * instance fields, to obtain JavaHeapObjects for them. Note that if called multiple times for * the same id, it will produce multiple separate JavaHeapObjects. For static fields, we * consider this tolerable; for other fields, the user should be careful not store all these * objects permanently if performance is a concern. */ JavaThing dereferenceField(long objId, JavaField field) { if (field != null && !field.isReference()) { // If this happens, we must be a field that represents an int. // (This only happens with .bod-style files) return new JavaLong(objId); } if (objId == 0) { return null; } JavaThing result = getObjectForId(objId); if (result == null) { if (!unresolvedObjectsOk && vc != null) { vc.addWarning("Failed to resolve object", "id = " + MiscUtils.toHex(objId) + (field != null ? ("for field " + field.getName() + " (signature " + field.getTypeId() + ")") : "")); } result = new UnresolvedObject(objId); } return result; } /** * Called during class resolution, to convert a classloader ID into JavaObject. This is used to * avoid creating multiple JavaObjects for the same classloader ID, and also to add each * classloader to GC roots. The latter, though it's not clear whether it's a theoretically * correct thing to do, definitely helps to reduce the number of objects not reachable from any * known GC root. * <p> * Returns a JavaObject for loader, or an UnresolvedObject instance if there is no object with * the given ID. * * @return a JavaObject for loader, or an UnresolvedObject instance if there is no object with * the given ID. */ JavaThing dereferenceClassLoader(long objId, JavaClass clazz) { if (objId == 0) { return null; } JavaObject loader = classLoaders.get(objId); if (loader != null) { return loader; } loader = (JavaObject) getObjectForId(objId); if (loader == null) { if (!unresolvedObjectsOk && vc != null) { vc.addWarning("Failed to resolve classloader", "id = " + MiscUtils.toHex(objId) + " for class " + clazz.getHumanFriendlyName()); } return new UnresolvedObject(objId); } classLoaders.put(objId, loader); // Make each classloader a GC root. This considerably reduces the number of // objects that would otherwise be found not attached to any GC root. String s = "Classloader of " + clazz.getName(); roots.add(new Root(objId, clazz.readId(), Root.JAVA_STATIC, s)); return loader; } public synchronized Iterator<JavaHeapObject> getFinalizerObjects() { ArrayList<JavaHeapObject> obj; if (finalizablesCache != null && (obj = finalizablesCache.get()) != null) { return obj.iterator(); } JavaClass clazz = getClassForName("java.lang.ref.Finalizer"); JavaObject queue = (JavaObject) clazz.getStaticField("queue"); JavaThing tmp = queue.getField("head"); ArrayList<JavaHeapObject> finalizables = new ArrayList<>(); if (tmp != null) { JavaObject head = (JavaObject) tmp; while (true) { JavaHeapObject referent = (JavaHeapObject) head.getField("referent"); JavaThing next = head.getField("next"); if (next == null || next.equals(head)) { break; } head = (JavaObject) next; finalizables.add(referent); } } finalizablesCache = new SoftReference<>(finalizables); return finalizables.iterator(); } /** * Returns the rough size of all objects (instances and arrays, but not classes), calculated * while reading the heap dump. */ public long getRoughTotalObjectSize() { return roughTotalObjectSize; } public int getHprofPointerSize() { return hprofPointerSize; } /** * Returns the pointer size as it should have been in the JVM that generated this heap dump. */ public int getPointerSize() { return pointerSize; } /** * Returns the object header size as it should have been in the JVM that generated this heap * dump. */ public int getObjectHeaderSize() { return objHeaderSize; } /** * Returns the array header size as it should have been in the JVM that generated this heap * dump. */ public int getArrayHeaderSize() { return objHeaderSize + 4; } /** * Returns the object alignment as it should have been in the JVM that generated this heap dump. */ public int getObjectAlignment() { return objAlignment; } /** Returns true if narrow (32-bit) pointers are used in 64-bit mode */ public boolean usingNarrowPointers() { return usingNarrowPointers; } public HeapStringReader getStringReader() { return stringReader; } public VerboseOutputCollector getVerboseOutputCollector() { return vc; } JavaClass getJavaLangClass() { return javaLangClass; } JavaClass getJavaLangStringClass() { return javaLangString; } JavaClass getJavaLangClassLoaderClass() { return javaLangClassLoader; } JavaClass getCharArrayClass() { return charArrayClass; } JavaClass getByteArrayClass() { return byteArrayClass; } public JavaClass getWeakReferenceClass() { return weakReferenceClass; } public int getReferentFieldIndex() { return referentFieldIndex; } /** Returns true if global stats is currently being calculated. */ public boolean isCalculatingStats() { return calculatingStats; } public void setCalculatingStats(boolean value) { calculatingStats = value; } public static class Builder { /** * From sampling some .hprof files, average approximate object size determined as (file_size * / num_objects) is 70. We use it to set initial size of the main table mapping object IDs * to object info. */ private static final int EXPECTED_OBJ_SIZE_IN_FILE = 70; private int hprofPointerSize; /** Object pointer size in the JVM that generated this heap dump */ private int pointerSize; private int objHeaderSize; private int objAlignment; private boolean usingNarrowPointers; private static ObjTableSizePolicy objTableSizePolicy; private final ArrayList<Root> roots = new ArrayList<>(); private final JavaObjectTable.Builder objTableBuilder; private final NumberToIntMap objIdToPosInObjectTable; /** * List of all JavaClass objects. However, if the given class hasn't been read by the time * its ID is read, it gets temporarily replaced with a Long representing that class's ID. */ private final ArrayList<Object> classList; /** * Maps class ID to JavaClass. However, if the given class hasn't been read by the time its * ID is read, it gets temporarily replaced with an Integer representing that class's index * in classList. */ private final LongToObjectMap<Object> classIdToJavaClass; private final HashMap<String, JavaClass> classNameToJavaClass; private boolean unresolvedObjectsOk; private final VerboseOutputCollector vc; private long roughTotalObjectSize; /** * Constructs a Snapshot.Builder instance with the specified settings. If * explicitPointerSize &gt; 0, it's specified by the user and should be used instead of the * value we half-read/half-guess from the hprof file. */ public Builder(long hprofFileSize, int hprofIdentifierSize, int explicitPointerSize, VerboseOutputCollector vc) { this.vc = vc; this.hprofPointerSize = hprofIdentifierSize; /* * See https://bugs.openjdk.java.net/browse/JDK-7145625. In 64-bit mode, we assume that * if heap size is less than ~26GB, narrow (32-bit) pointers are used, otherwise wide * (full 64-bit) pointers are used. */ if (explicitPointerSize > 0) { pointerSize = explicitPointerSize; } else { if (hprofIdentifierSize == 4) { pointerSize = Constants.POINTER_SIZE_IN_32BIT_MODE; } else { if (hprofFileSize < 26L * 1024 * 1024 * 1024) { pointerSize = Constants.NARROW_POINTER_SIZE_IN_64BIT_MODE; usingNarrowPointers = true; } else { pointerSize = Constants.WIDE_POINTER_SIZE_IN_64BIT_MODE; } } } // Assume HotSpot object header for now. On JRockit, it is always 8. // If HprofReader comes across any JRockit-specific class, it will // request a change by calling updateObjectHeaderSize() below. objHeaderSize = hprofIdentifierSize == 4 ? Constants.STANDARD_32BIT_OBJ_HEADER_SIZE : pointerSize == Constants.NARROW_POINTER_SIZE_IN_64BIT_MODE ? Constants.HOTSPOT_64BIT_NARROW_REF_OBJ_HEADER_SIZE : Constants.HOTSPOT_64BIT_WIDE_REF_OBJ_HEADER_SIZE; // See the comments to the constant below. In principle, its value may vary, // but in practice it's unlikely. objAlignment = Constants.DEFAULT_OBJECT_ALIGNMENT_IN_MEMORY; // Set the approximate size for objIdToPosInObjectTable to avoid excessive rehashing int objTableSize = objTableSizePolicy != null ? objTableSizePolicy.getInitialObjTableSize(hprofFileSize) : (int) (hprofFileSize / EXPECTED_OBJ_SIZE_IN_FILE); if (pointerSize == 4) { objIdToPosInObjectTable = new IntToIntMap(objTableSize); } else { objIdToPosInObjectTable = new LongToIntMap(objTableSize); } classList = new ArrayList<>(objTableSize / 2000); objTableBuilder = new JavaObjectTable.Builder(hprofFileSize); classIdToJavaClass = new LongToObjectMap<>(objTableSize / 2000, false); classNameToJavaClass = new HashMap<>(objTableSize / 2000); } /** * Sets custom ObjTableSizePolicy, that will be used to determine initial object table size. * By default, it's set as file_size / EXPECTED_OBJ_SIZE_IN_FILE. */ public static void setObjTableSizePolicy(ObjTableSizePolicy policy) { objTableSizePolicy = policy; } /** * Perform potentially memory-consuming operations once all objects are read. This should be * called before buildSnapshot(), i.e. before a ReadBuffer, that may take quite some memory, * is allocated. */ public void onFinishReadObjects() { objIdToPosInObjectTable.adjustCapacityIfNeeded(); } @SuppressWarnings("unchecked") public Snapshot buildSnapshot(ReadBuffer readBuf) { checkForMissingJavaClasses(); JavaClass[] classes = classList.toArray(new JavaClass[classList.size()]); JavaObjectTable objectTable = objTableBuilder.buildJavaObjectTable(classes); resolveSuperclasses(classes); recheckPointerSize(objectTable, readBuf); roots.sort(null); // More interesting roots will be scanned first Snapshot snapshot = new Snapshot(hprofPointerSize, pointerSize, objHeaderSize, objAlignment, usingNarrowPointers, roughTotalObjectSize, roots, objectTable, objIdToPosInObjectTable, classes, classNameToJavaClass, (LongToObjectMap<JavaClass>) (LongToObjectMap<?>) classIdToJavaClass, readBuf, vc, unresolvedObjectsOk); return snapshot; } public void addJavaObject(long id, long classID, long objOfsInFile, int objDataSize) { int classIdx = getClassIdxForClassID(classID); int objPosInTable = objTableBuilder.addJavaObject(classIdx, objOfsInFile); objIdToPosInObjectTable.put(id, objPosInTable); roughTotalObjectSize += objDataSize + objHeaderSize; } public void addJavaObjectArray(long id, long classID, long objOfsInFile, int length, int objDataSize) { int classIdx = getClassIdxForClassID(classID); int objPosInTable = objTableBuilder.addJavaArray(classIdx, objOfsInFile, length); objIdToPosInObjectTable.put(id, objPosInTable); roughTotalObjectSize += objDataSize + objHeaderSize + 4; } public void addJavaValueArray( long id, char primitiveSignature, long objOfsInFile, int length, int objDataSize) { JavaClass clazz = getPrimitiveArrayClass(primitiveSignature); int classIdx = clazz.getClassListIdx(); int objPosInTable = objTableBuilder.addJavaArray(classIdx, objOfsInFile, length); objIdToPosInObjectTable.put(id, objPosInTable); roughTotalObjectSize += objDataSize + objHeaderSize + 4; } public void addRoot(Root r) { roots.add(r); } public void addClass(JavaClass clazz) { Object classIdxOrNull = classIdToJavaClass.get(clazz.readId()); if (classIdxOrNull == null) { // Class not seen before int classIdx = classList.size(); clazz.setClassListIdx(classIdx); classList.add(clazz); } else { int classIdx = (Integer) classIdxOrNull; clazz.setClassListIdx(classIdx); classList.set(classIdx, clazz); } addToClassMaps(clazz); recheckObjectHeaderSize(clazz); } public int getPointerSize() { return pointerSize; } public int getNumAllObjects() { return objTableBuilder.getNumObjects(); } public int getNumClasses() { return classList.size(); } public void setUnresolvedObjectsOk(boolean v) { unresolvedObjectsOk = v; } public int getInMemoryInstanceSize(int instanceFieldsSize) { // Add object header size int result = instanceFieldsSize + objHeaderSize; // Take into account object alignment return MiscUtils.getAlignedObjectSize(result, objAlignment); } private int getClassIdxForClassID(long classID) { Object classOrIdx = classIdToJavaClass.get(classID); if (classOrIdx == null) { int classIdx = classList.size(); classList.add(classID); classIdToJavaClass.put(classID, classIdx); return classIdx; } else if (classOrIdx instanceof JavaClass) { return ((JavaClass) classOrIdx).getClassListIdx(); } else { return (Integer) classOrIdx; } } /** * Creates fake JavaClass objects for "orphan" classes (those for which we read class ID but * not the actual class object). */ private void checkForMissingJavaClasses() { for (int i = 0; i < classList.size(); i++) { Object clazzOrId = classList.get(i); if (clazzOrId instanceof Long) { // JavaClass object for this ID hasn't been read from dump. Create a fake class long classId = (Long) clazzOrId; if (!unresolvedObjectsOk) { if (vc != null) { vc.addWarning("Failed to resolve object", "No JavaClass found for class ID = " + classId); } } // TODO: we don't specify the correct instance size for this class. But does it matter? JavaClass clazz = createFakeClass(classId, 0); clazz.setClassListIdx(i); classList.set(i, clazz); addToClassMaps(clazz); } } } private void addToClassMaps(JavaClass clazz) { classIdToJavaClass.put(clazz.readId(), clazz); JavaClass existingClass = classNameToJavaClass.get(clazz.getName()); if (existingClass != null) { existingClass.addNextVersion(clazz); } else { classNameToJavaClass.put(clazz.getName(), clazz); } } /** * Returns a JavaClass representing an array with specified element type, or creates one and * adds to the relevant data structures. */ JavaClass getPrimitiveArrayClass(char elementSignature) { String className = "[" + elementSignature; JavaClass clazz = classNameToJavaClass.get(className); if (clazz == null) { clazz = new JavaClass(className, 0, 0, 0, 0, JavaClass.NO_FIELDS, JavaClass.NO_FIELDS, JavaClass.NO_VALUES, 0, 0); int classIdx = classList.size(); clazz.setClassListIdx(classIdx); classList.add(clazz); classNameToJavaClass.put(className, clazz); } return clazz; } /** * Creates and adds a fake class object with the specified ID and instance size. This is * called when for some JavaObject there is no class object with the specified ID. In that * case, there is nothing we can do but construct an artificial class so that the given * object looks normal. */ private JavaClass createFakeClass(long classID, int instSize) { // Create a fake class name based on ID. String name = "unknown-class<@" + MiscUtils.toHex(classID) + ">"; // Create fake fields convering the given instance size. // Create as many as int type fields and for the left over // size create byte type fields. int numInts = instSize / 4; int numBytes = instSize % 4; JavaField[] fields = new JavaField[numInts + numBytes]; int i; for (i = 0; i < numInts; i++) { fields[i] = JavaField.newInstance("unknown-field-" + i, 'I', pointerSize); } for (i = 0; i < numBytes; i++) { fields[i + numInts] = JavaField.newInstance("unknown-field-" + i + numInts, 'B', pointerSize); } // Create fake instance class return new JavaClass(classID, name, 0, 0, 0, 0, fields, JavaClass.NO_FIELDS, JavaClass.NO_VALUES, instSize, getInMemoryInstanceSize(instSize)); } /** * Set the actual superclass for each class instead of the forward reference. We do this * separately from resolveClass() calls, because we need superclasses for getFields() to * work properly, which in turn is needed by recheckPointerSize() below. */ @SuppressWarnings("unchecked") private void resolveSuperclasses(JavaClass[] classes) { for (JavaClass clazz : classes) { clazz.resolveSuperclass((LongToObjectMap<JavaClass>) (LongToObjectMap<?>) classIdToJavaClass); } } /** * Using various guessing methods, attempt to make a more accurate estimate of the object * header size in the JVM that generated this heap dump. */ private void recheckObjectHeaderSize(JavaClass c) { if (c.getName().startsWith("jrockit.vm.") && objHeaderSize != Constants.JROCKIT_OBJ_HEADER_SIZE) { // On JRockit, object header size is always 8 bytes. Unfortunately, there // is no way to tell that the heap dump is generated by JRockit except by // this kind of guessing. updateObjectHeaderSize(Constants.JROCKIT_OBJ_HEADER_SIZE); } } /** * Since there is no explicit info on object header size in HPROF file, we have to guess, * and later may need to call this method to correct our guess. */ private void updateObjectHeaderSize(int objHeaderSize) { this.objHeaderSize = objHeaderSize; // Update instance size for all classes that have already been registered for (Object clazzOrID : classList) { if (!(clazzOrID instanceof JavaClass)) { continue; } JavaClass clazz = (JavaClass) clazzOrID; clazz.updateInstanceSize(getInMemoryInstanceSize(clazz.getFieldsSizeInFile())); } } /** * Using various guessing methods, attempt to make a more accurate estimate of the pointer * size in the JVM that generated this heap dump. This is only relevant for 64-bit heap * dumps. */ private void recheckPointerSize(JavaObjectTable objectTable, ReadBuffer readBuf) { if (hprofPointerSize == 4) { return; // 32-bit mode, nothing to check } Collection<JavaLazyReadObject> allObjects = objectTable.getObjects(); JavaLazyReadObject prevObj = null; long prevObjId = 0; int nCheckedObjs = 0; for (JavaLazyReadObject obj : allObjects) { if (prevObj == null) { prevObj = obj; prevObjId = prevObj.readId(readBuf, hprofPointerSize); continue; } // "Object id" is actually the object's address in the JVM memory long objId = obj.readId(readBuf, hprofPointerSize); if (prevObj instanceof JavaObject && obj instanceof JavaObject) { if (++nCheckedObjs > 1000000) { break; // Put an upper bound on time of this operation } long prevObjSize = objId - prevObjId; if (prevObjSize > 12 && prevObjSize <= 40) { if (verifyObjSize((JavaObject) prevObj, (int) prevObjSize)) { break; } } } prevObj = obj; prevObjId = objId; } } /** * For the given object and its size calculated from addresses of consecutive objs in the * heap dump, attempts to compare that size with the size calculated based on object's * fields and current pointerSize. Returns true if it is able to confirm the pointer size * one or another way, and false if no definitive conclusions can be made. */ private boolean verifyObjSize(JavaObject obj, int objSize) { JavaClass clazz = obj.getClazz(); JavaField[] fields = clazz.getFieldsForInstance(); int nPointers = 0, nInts = 0; for (JavaField field : fields) { if (field.isReference()) { nPointers++; } else if (field.getTypeId() == 'I') { nInts++; } else { return false; // We don't know exact size of other field types in the JVM } } if (nPointers < 2) { return false; // Not enough information } int expectedObjSize = MiscUtils.getAlignedObjectSize(objHeaderSize + pointerSize * nPointers + 4 * nInts, objAlignment); if (expectedObjSize == objSize) { return true; // Current pointerSize is correct } int altPointerSize = pointerSize == Constants.NARROW_POINTER_SIZE_IN_64BIT_MODE ? Constants.WIDE_POINTER_SIZE_IN_64BIT_MODE : Constants.NARROW_POINTER_SIZE_IN_64BIT_MODE; int altObjHeaderSize = altPointerSize == Constants.NARROW_POINTER_SIZE_IN_64BIT_MODE ? Constants.HOTSPOT_64BIT_NARROW_REF_OBJ_HEADER_SIZE : Constants.HOTSPOT_64BIT_WIDE_REF_OBJ_HEADER_SIZE; int newExpectedObjSize = MiscUtils .getAlignedObjectSize(altObjHeaderSize + altPointerSize * nPointers + 4 * nInts, objAlignment); if (newExpectedObjSize == objSize) { // Looks like the other pointer size is the correct one // System.err.println("!!! For obj of class " + clazz.getName() + " nPointers = " + nPointers // + ", nInts = " + nInts + ", expectedObjSize with current ptr size of " + pointerSize + " is " // + expectedObjSize + ", actual objSize = " + objSize); // System.err.println("!!! Expected size with alternative ptr size of " + altPointerSize + " is " // + newExpectedObjSize); pointerSize = altPointerSize; objHeaderSize = altObjHeaderSize; /* * TODO: Should we recalculate instance size for all classes here? * * The problem is, we don't know for sure the size of byte, char etc. fields in * instances. But it also may be the case that these sizes are equally imprecise in * the original 'fieldsSize' value in the heap dump. */ } return true; } } /** * An instance of this class can be created and passed to * Snapshot.Builder.setObjTableSizePolicy() to customize the way that the initial object table * size is calculated. */ public interface ObjTableSizePolicy { /** * Given the .hprof file size, returns the initial size of object table. */ int getInitialObjTableSize(long hprofFileSize); } }
11,036
335
{ "word": "Lookout", "definitions": [ "A place from which to keep watch or view the landscape.", "A person stationed to keep watch for danger or trouble.", "A view over a landscape.", "Used to indicate whether a likely outcome is good or bad." ], "parts-of-speech": "Noun" }
120
372
/* Editor Settings: expandtabs and use 4 spaces for indentation * ex: set softtabstop=4 tabstop=8 expandtab shiftwidth=4: * * -*- mode: c, c-basic-offset: 4 -*- */ /* * Copyright © BeyondTrust Software 2004 - 2019 * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * BEYONDTRUST MAKES THIS SOFTWARE AVAILABLE UNDER OTHER LICENSING TERMS AS * WELL. IF YOU HAVE ENTERED INTO A SEPARATE LICENSE AGREEMENT WITH * BEYONDTRUST, THEN YOU MAY ELECT TO USE THE SOFTWARE UNDER THE TERMS OF THAT * SOFTWARE LICENSE AGREEMENT INSTEAD OF THE TERMS OF THE APACHE LICENSE, * NOTWITHSTANDING THE ABOVE NOTICE. IF YOU HAVE QUESTIONS, OR WISH TO REQUEST * A COPY OF THE ALTERNATE LICENSING TERMS OFFERED BY BEYONDTRUST, PLEASE CONTACT * BEYONDTRUST AT beyondtrust.com/contact */ #include "includes.h" static DWORD DNSKrb5GetTGTFromKeytab( PCSTR pszUserName, PCSTR pszPassword, PCSTR pszCachePath, PDWORD pdwGoodUntilTime ); static DWORD LsaKrb5SetDefaultCachePath( PCSTR pszCachePath, PSTR* ppszOrigCachePath ); static DWORD DNSKrb5DestroyCache( PCSTR pszCachePath ); DWORD DNSKrb5Init( PCSTR pszAccountName, PCSTR pszDomain ) { DWORD dwError = 0; PSTR pszUsername = NULL; if (!gbKrb5Initialized) { DWORD i = 0; DWORD j = 0; DWORD dwLength = strlen(pszAccountName) + strlen(pszDomain) + 2; dwError = DNSAllocateMemory( dwLength, (PVOID*)&pszUsername); BAIL_ON_LWDNS_ERROR(dwError); for (i = 0; i < strlen(pszAccountName); i++) { pszUsername[i] = toupper((int)pszAccountName[i]); } pszUsername[i++] = '@'; for (; j < strlen(pszDomain); j++) { pszUsername[i++] = toupper((int)pszDomain[j]); } dwError = DNSKrb5GetTGTFromKeytab( pszUsername, NULL, gpszKrb5CachePath, NULL); BAIL_ON_LWDNS_ERROR(dwError); dwError = LsaKrb5SetDefaultCachePath( gpszKrb5CachePath, NULL); BAIL_ON_LWDNS_ERROR(dwError); gbKrb5Initialized = TRUE; } cleanup: LWDNS_SAFE_FREE_STRING(pszUsername); return dwError; error: goto cleanup; } DWORD DNSKrb5Shutdown( VOID ) { DWORD dwError = 0; if (gbKrb5Initialized) { dwError = DNSKrb5DestroyCache(gpszKrb5CachePath); BAIL_ON_LWDNS_ERROR(dwError); gbKrb5Initialized = FALSE; } error: return dwError; } static DWORD DNSKrb5GetTGTFromKeytab( PCSTR pszUserName, PCSTR pszPassword, PCSTR pszCachePath, PDWORD pdwGoodUntilTime ) { DWORD dwError = 0; krb5_error_code ret = 0; krb5_context ctx = NULL; krb5_creds creds = { 0 }; krb5_ccache cc = NULL; krb5_keytab keytab = 0; krb5_principal client_principal = NULL; krb5_get_init_creds_opt opts; ret = krb5_init_context(&ctx); BAIL_ON_LWDNS_KRB_ERROR(ctx, ret); ret = krb5_parse_name(ctx, pszUserName, &client_principal); BAIL_ON_LWDNS_KRB_ERROR(ctx, ret); /* use krb5_cc_resolve to get an alternate cache */ ret = krb5_cc_resolve(ctx, pszCachePath, &cc); BAIL_ON_LWDNS_KRB_ERROR(ctx, ret); ret = krb5_kt_default(ctx, &keytab); BAIL_ON_LWDNS_KRB_ERROR(ctx, ret); krb5_get_init_creds_opt_init(&opts); krb5_get_init_creds_opt_set_forwardable(&opts, TRUE); ret = krb5_get_init_creds_keytab( ctx, &creds, client_principal, keytab, 0, /* start time */ NULL, /* in_tkt_service */ &opts /* options */ ); BAIL_ON_LWDNS_KRB_ERROR(ctx, ret); ret = krb5_cc_initialize(ctx, cc, client_principal); BAIL_ON_LWDNS_KRB_ERROR(ctx, ret); ret = krb5_cc_store_cred(ctx, cc, &creds); BAIL_ON_LWDNS_KRB_ERROR(ctx, ret); if (pdwGoodUntilTime) { *pdwGoodUntilTime = creds.times.endtime; } error: if (creds.client == client_principal) { creds.client = NULL; } if (ctx) { if (client_principal) { krb5_free_principal(ctx, client_principal); } if (keytab) { krb5_kt_close(ctx, keytab); } if (cc) { krb5_cc_close(ctx, cc); } krb5_free_cred_contents(ctx, &creds); krb5_free_context(ctx); } return(dwError); } static DWORD LsaKrb5SetDefaultCachePath( PCSTR pszCachePath, PSTR* ppszOrigCachePath ) { DWORD dwError = 0; DWORD dwMajorStatus = 0; DWORD dwMinorStatus = 0; PSTR pszOrigCachePath = NULL; // Set the default for gss dwMajorStatus = gss_krb5_ccache_name( (OM_uint32 *)&dwMinorStatus, pszCachePath, (ppszOrigCachePath) ? (const char**)&pszOrigCachePath : NULL); BAIL_ON_SEC_ERROR(dwMajorStatus); if (ppszOrigCachePath) { if (!IsNullOrEmptyString(pszOrigCachePath)) { dwError = DNSAllocateString(pszOrigCachePath, ppszOrigCachePath); BAIL_ON_LWDNS_ERROR(dwError); } else { *ppszOrigCachePath = NULL; } } cleanup: return dwError; sec_error: error: if (ppszOrigCachePath) { *ppszOrigCachePath = NULL; } goto cleanup; } static DWORD DNSKrb5DestroyCache( PCSTR pszCachePath ) { DWORD dwError = 0; krb5_error_code ret = 0; krb5_context ctx = NULL; krb5_ccache cc = NULL; ret = krb5_init_context(&ctx); BAIL_ON_LWDNS_KRB_ERROR(ctx, ret); /* use krb5_cc_resolve to get an alternate cache */ ret = krb5_cc_resolve(ctx, pszCachePath, &cc); BAIL_ON_LWDNS_KRB_ERROR(ctx, ret); ret = krb5_cc_destroy(ctx, cc); if (ret != 0) { if (ret != KRB5_FCC_NOFILE) { BAIL_ON_LWDNS_KRB_ERROR(ctx, ret); } else { ret = 0; } } error: if (ctx) { krb5_free_context(ctx); } return(dwError); }
3,382
13,430
<gh_stars>1000+ from gooey.gui.components.widgets.textfield import TextField __ALL__ = ('CommandField',) class CommandField(TextField): pass
62
2,151
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.chrome.browser.widget.displaystyle; import android.support.annotation.IntDef; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * The horizontal dimension groups. */ @Retention(RetentionPolicy.SOURCE) @IntDef({HorizontalDisplayStyle.NARROW, HorizontalDisplayStyle.REGULAR, HorizontalDisplayStyle.WIDE}) public @interface HorizontalDisplayStyle { int NARROW = 0; int REGULAR = 1; int WIDE = 2; }
200
3,428
{"id":"00496","group":"spam-2","checksum":{"type":"MD5","value":"acf53035be6cb4c667fd342551c5d467"},"text":"From <EMAIL> Mon Jun 24 17:07:39 2002\nReturn-Path: <EMAIL>\nDelivery-Date: Tue May 28 22:06:35 2002\nReceived: from mandark.labs.netnoteinc.com ([213.105.180.140]) by\n dogma.slashnull.org (8.11.6/8.11.6) with ESMTP id g4SL6YO27513 for\n <<EMAIL>>; Tue, 28 May 2002 22:06:34 +0100\nReceived: from webmail.co.za (IDENT:[email protected]\n [202.71.228.14]) by mandark.labs.netnoteinc.com (8.11.2/8.11.2) with SMTP\n id g4SL6T731871 for <<EMAIL>>; Tue, 28 May 2002 22:06:31 +0100\nReceived: from smtp013.mail.yahoo.com ([11.61.180.201]) by\n sydint1.microthin.com.au with SMTP; Tue, 28 May 2002 19:01:00 +0200\nReceived: from unknown (192.168.3.11) by rly-xw01.mx.aol.com with SMTP;\n 28 May 2002 15:53:44 +0500\nReceived: from unknown (172.16.17.32) by\n da001d2020.lax-ca.osd.concentric.net with SMTP; Tue, 28 May 2002 22:46:29\n -0200\nReply-To: <<EMAIL>>\nMessage-Id: <026a45c71a1c$4283e2a7$4bb13ac7@sbkvuc>\nFrom: <<EMAIL>>\nTo: <EMAIL>\nSubject: your registration\nDate: Tue, 28 May 2002 21:49:40 -0100\nMIME-Version: 1.0\nContent-Type: text/plain; charset=\"iso-8859-1\"\nX-Priority: 3 (Normal)\nX-Msmail-Priority: Normal\nX-Mailer: The Bat! (v1.52f) Business\nImportance: Normal\nX-Keywords: \nContent-Transfer-Encoding: 8bit\n\nPUBLIC ANNOUNCEMENT:\n\nThe new .NAME domain extension is currently being released to the general public. Unlike the original .COM and .NET domain names, the new .NAME domain was specifically created for individuals such as yourself. The .NAME domain appears in the format: FirstName.LastName.NAME For example, if your name is <NAME>, then you can register a name such as monica.smith.name Technology experts predict that personalized domain names will soon be used as international identifiers much the same was that phone numbers are used today. For a limited time, you can pre-register your unique .NAME domain for only $10 (plus applicable registry fees) at: http://www.namesforeveryone.com \n\n\nTo remove your email address from further promotional mailings from this company, click here:\nhttp://www.centralremovalservice.com/cgi-bin/domain-remove.cgi\n21\n9488ycte7-565FWHF6137iGcL4-997l28\n\n"}
851
4,020
package me.coley.recaf.parse.bytecode.ast; import me.coley.recaf.parse.bytecode.MethodCompilation; import me.coley.recaf.parse.bytecode.exception.AssemblerException; /** * Alias AST. * * @author Matt */ public class AliasAST extends InsnAST { private final NameAST name; private final StringAST value; /** * @param line * Line number this node is written on. * @param start * Offset from line start this node starts at. * @param opcode * Opcode AST. * @param name * Alias name AST. * @param value * Increment value AST. */ public AliasAST(int line, int start, OpcodeAST opcode, NameAST name, StringAST value) { super(line, start, opcode); this.name = name; this.value = value; addChild(name); addChild(value); } /** * @return Alias name AST. */ public NameAST getName() { return name; } /** * @return Increment value AST. */ public StringAST getValue() { return value; } @Override public String print() { return getOpcode().print() + " " + name.print() + " " + value.print(); } @Override public void compile(MethodCompilation compilation) throws AssemblerException { // No-op: this is not compilable. } }
428
997
#ifndef PQCLEAN_SPHINCSHARAKA128FSIMPLE_AESNI_ADDRESS_H #define PQCLEAN_SPHINCSHARAKA128FSIMPLE_AESNI_ADDRESS_H #include <stdint.h> #define PQCLEAN_SPHINCSHARAKA128FSIMPLE_AESNI_ADDR_TYPE_WOTS 0 #define PQCLEAN_SPHINCSHARAKA128FSIMPLE_AESNI_ADDR_TYPE_WOTSPK 1 #define PQCLEAN_SPHINCSHARAKA128FSIMPLE_AESNI_ADDR_TYPE_HASHTREE 2 #define PQCLEAN_SPHINCSHARAKA128FSIMPLE_AESNI_ADDR_TYPE_FORSTREE 3 #define PQCLEAN_SPHINCSHARAKA128FSIMPLE_AESNI_ADDR_TYPE_FORSPK 4 void PQCLEAN_SPHINCSHARAKA128FSIMPLE_AESNI_addr_to_bytes( unsigned char *bytes, const uint32_t addr[8]); void PQCLEAN_SPHINCSHARAKA128FSIMPLE_AESNI_set_layer_addr( uint32_t addr[8], uint32_t layer); void PQCLEAN_SPHINCSHARAKA128FSIMPLE_AESNI_set_tree_addr( uint32_t addr[8], uint64_t tree); void PQCLEAN_SPHINCSHARAKA128FSIMPLE_AESNI_set_type( uint32_t addr[8], uint32_t type); /* Copies the layer and tree part of one address into the other */ void PQCLEAN_SPHINCSHARAKA128FSIMPLE_AESNI_copy_subtree_addr( uint32_t out[8], const uint32_t in[8]); /* These functions are used for WOTS and FORS addresses. */ void PQCLEAN_SPHINCSHARAKA128FSIMPLE_AESNI_set_keypair_addr( uint32_t addr[8], uint32_t keypair); void PQCLEAN_SPHINCSHARAKA128FSIMPLE_AESNI_set_chain_addr( uint32_t addr[8], uint32_t chain); void PQCLEAN_SPHINCSHARAKA128FSIMPLE_AESNI_set_hash_addr( uint32_t addr[8], uint32_t hash); void PQCLEAN_SPHINCSHARAKA128FSIMPLE_AESNI_copy_keypair_addr( uint32_t out[8], const uint32_t in[8]); /* These functions are used for all hash tree addresses (including FORS). */ void PQCLEAN_SPHINCSHARAKA128FSIMPLE_AESNI_set_tree_height( uint32_t addr[8], uint32_t tree_height); void PQCLEAN_SPHINCSHARAKA128FSIMPLE_AESNI_set_tree_index( uint32_t addr[8], uint32_t tree_index); #endif
849
331
<filename>src/main/java/org/fordes/subview/utils/ArchiveUtil.java package org.fordes.subview.utils; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.TimeInterval; import cn.hutool.core.exceptions.ExceptionUtil; import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import lombok.extern.slf4j.Slf4j; import org.fordes.subview.enums.SevenZipEnum; import org.fordes.subview.enums.SubtitlesTypeEnum; import org.fordes.subview.utils.constants.CommonConstants; import java.io.*; import java.util.Set; /** * 文件解压工具类 * 调用7zip解压,仅适用于windows操作系统 */ @Slf4j public class ArchiveUtil { private static final String formatFilter = ArrayUtil.join(SubtitlesTypeEnum.values(), " ", "*.", ""); public static Set<String> formats = CollUtil.newHashSet("rar", "zip", "7z", "gz", "xz"); /** * 解压至文件命名路径并删除文件 * * @param file 压缩文件 * @return 文件路径 */ public static String unArchiveToCurrentPath(File file) { try { if (FileUtil.exist(file)) { File outFile = FileUtil.file(file.getParent()+ StrUtil.BACKSLASH+ FileUtil.getPrefix(file)); //创建目标文件夹 if (!FileUtil.exist(outFile)){ FileUtil.mkdir(outFile); } String suffix = FileUtil.getSuffix(file); if (SubtitlesTypeEnum.isSubtitles(suffix)) { FileUtil.move(file, outFile, true); }else if (formats.contains(suffix)) { unArchiveFile(file, outFile); } FileUtil.del(file); return outFile.getPath(); } }catch (Exception e) { log.error(ExceptionUtil.stacktraceToString(e)); } return StrUtil.EMPTY; } public static String unArchiveToCurrentPath(String path) { return unArchiveToCurrentPath(new File(path)); } public static void unArchiveFile(File zipFile, File outFile) throws IOException, InterruptedException { unArchiveFile(zipFile.getPath(), outFile.getPath()); } public static void unArchiveFile(String filePath, String outPath) throws IOException, InterruptedException { unArchiveFile(filePath, outPath, formatFilter); } /** * 调用7z解压文件,不保留内部结构 * @param filePath 压缩文件路径 * @param outPath 输出路径 * @param filter 指定需要提取的格式 例:*.txt *.exe * @throws IOException * @throws InterruptedException */ public static void unArchiveFile(String filePath, String outPath, String filter) throws IOException, InterruptedException { TimeInterval interval = DateUtil.timer(); String command = StrUtil.format(CommonConstants.UN_ARCHIVE_COMMAND_FORMAT, filePath, outPath, filter); Process process = null; try { process = Runtime.getRuntime().exec(command); process.waitFor(); int exitValue = process.exitValue(); if (exitValue>1) { throw new RuntimeException(); } log.debug("命令:{}, 退出值:{}, 状态:{}", command, process.exitValue(), SevenZipEnum.getStatus(process.exitValue())); }catch (Exception e) { log.error(e.getMessage()); throw e; }finally { if (ObjectUtil.isNotNull(process)) { process.destroy(); } log.debug("解压文件:{} => {},耗时:{} ms", filePath, outPath, interval.intervalMs()); } } }
1,836
964
[ { "queryName": "Schema Discriminator Property Not String (v3)", "severity": "INFO", "line": 53, "filename": "positive1.json" }, { "queryName": "Schema Discriminator Property Not String (v3)", "severity": "INFO", "line": 25, "filename": "positive2.json" }, { "queryName": "Schema Discriminator Property Not String (v3)", "severity": "INFO", "line": 32, "filename": "positive3.yaml" }, { "queryName": "Schema Discriminator Property Not String (v3)", "severity": "INFO", "line": 18, "filename": "positive4.yaml" }, { "queryName": "Schema Discriminator Property Not String (v2)", "severity": "INFO", "line": 28, "filename": "positive5.json" }, { "queryName": "Schema Discriminator Property Not String (v2)", "severity": "INFO", "line": 16, "filename": "positive6.yaml" }, { "queryName": "Schema Discriminator Property Not String (v2)", "severity": "INFO", "line": 22, "filename": "positive7.json" }, { "queryName": "Schema Discriminator Property Not String (v2)", "severity": "INFO", "line": 15, "filename": "positive8.yaml" } ]
488
701
#pragma once #define MEM_PAGE_SIZE (0x1000)
21
445
///////////////////////////////////////////////////////////////////////// // $Id: vga.cc,v 1.152 2008/04/29 22:14:23 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. // // MandrakeSoft S.A. // 43, rue d'Aboukir // 75002 Paris - France // http://www.linux-mandrake.com/ // http://www.mandrakesoft.com/ // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ///////////////////////////////////////////////////////////////////////// // Define BX_PLUGGABLE in files that can be compiled into plugins. For // platforms that require a special tag on exported symbols, BX_PLUGGABLE // is used to know when we are exporting symbols and when we are importing. #define BX_PLUGGABLE #include "iodev.h" #define LOG_THIS theVga-> #define VGA_TRACE_FEATURE // Only reference the array if the tile numbers are within the bounds // of the array. If out of bounds, do nothing. #define SET_TILE_UPDATED(xtile,ytile,value) \ do { \ if (((xtile) < BX_NUM_X_TILES) && ((ytile) < BX_NUM_Y_TILES)) \ BX_VGA_THIS s.vga_tile_updated[(xtile)][(ytile)] = value; \ } while (0) // Only reference the array if the tile numbers are within the bounds // of the array. If out of bounds, return 0. #define GET_TILE_UPDATED(xtile,ytile) \ ((((xtile) < BX_NUM_X_TILES) && ((ytile) < BX_NUM_Y_TILES))? \ BX_VGA_THIS s.vga_tile_updated[(xtile)][(ytile)] \ : 0) static const Bit16u charmap_offset[8] = { 0x0000, 0x4000, 0x8000, 0xc000, 0x2000, 0x6000, 0xa000, 0xe000 }; static const Bit8u ccdat[16][4] = { { 0x00, 0x00, 0x00, 0x00 }, { 0xff, 0x00, 0x00, 0x00 }, { 0x00, 0xff, 0x00, 0x00 }, { 0xff, 0xff, 0x00, 0x00 }, { 0x00, 0x00, 0xff, 0x00 }, { 0xff, 0x00, 0xff, 0x00 }, { 0x00, 0xff, 0xff, 0x00 }, { 0xff, 0xff, 0xff, 0x00 }, { 0x00, 0x00, 0x00, 0xff }, { 0xff, 0x00, 0x00, 0xff }, { 0x00, 0xff, 0x00, 0xff }, { 0xff, 0xff, 0x00, 0xff }, { 0x00, 0x00, 0xff, 0xff }, { 0xff, 0x00, 0xff, 0xff }, { 0x00, 0xff, 0xff, 0xff }, { 0xff, 0xff, 0xff, 0xff }, }; bx_vga_c *theVga = NULL; unsigned old_iHeight = 0, old_iWidth = 0, old_MSL = 0; #if BX_SUPPORT_CLGD54XX void libvga_set_smf_pointer(bx_vga_c *theVga_ptr) { theVga = theVga_ptr; } #else // BX_SUPPORT_CLGD54XX int libvga_LTX_plugin_init(plugin_t *plugin, plugintype_t type, int argc, char *argv[]) { theVga = new bx_vga_c(); bx_devices.pluginVgaDevice = theVga; BX_REGISTER_DEVICE_DEVMODEL(plugin, type, theVga, BX_PLUGIN_VGA); return(0); // Success } void libvga_LTX_plugin_fini(void) { delete theVga; } #endif // BX_SUPPORT_CLGD54XX bx_vga_c::bx_vga_c() { put("VGA"); s.vga_mem_updated = 0; s.x_tilesize = X_TILESIZE; s.y_tilesize = Y_TILESIZE; timer_id = BX_NULL_TIMER_HANDLE; s.memory = NULL; } bx_vga_c::~bx_vga_c() { if (s.memory != NULL) { delete [] s.memory; s.memory = NULL; } SIM->get_param_num(BXPN_VGA_UPDATE_INTERVAL)->set_handler(NULL); BX_DEBUG(("Exit")); } void bx_vga_c::init(void) { unsigned i,string_i; unsigned x,y; #if BX_SUPPORT_VBE Bit16u max_xres, max_yres, max_bpp; #endif int argc; char *argv[16]; char *ptr; char string[512]; char *extname; size_t len; #if BX_SUPPORT_VBE unsigned addr; #endif BX_VGA_THIS extension_init = 0; BX_VGA_THIS extension_checked = 0; #if !BX_SUPPORT_CLGD54XX BX_VGA_THIS init_iohandlers(read_handler,write_handler); #endif DEV_register_memory_handlers(theVga, mem_read_handler, mem_write_handler, 0xa0000, 0xbffff); BX_VGA_THIS s.vga_enabled = 1; BX_VGA_THIS s.misc_output.color_emulation = 1; BX_VGA_THIS s.misc_output.enable_ram = 1; BX_VGA_THIS s.misc_output.clock_select = 0; BX_VGA_THIS s.misc_output.select_high_bank = 0; BX_VGA_THIS s.misc_output.horiz_sync_pol = 1; BX_VGA_THIS s.misc_output.vert_sync_pol = 1; BX_VGA_THIS s.attribute_ctrl.mode_ctrl.graphics_alpha = 0; BX_VGA_THIS s.attribute_ctrl.mode_ctrl.display_type = 0; BX_VGA_THIS s.attribute_ctrl.mode_ctrl.enable_line_graphics = 1; BX_VGA_THIS s.attribute_ctrl.mode_ctrl.blink_intensity = 0; BX_VGA_THIS s.attribute_ctrl.mode_ctrl.pixel_panning_compat = 0; BX_VGA_THIS s.attribute_ctrl.mode_ctrl.pixel_clock_select = 0; BX_VGA_THIS s.attribute_ctrl.mode_ctrl.internal_palette_size = 0; BX_VGA_THIS s.line_offset=80; BX_VGA_THIS s.line_compare=1023; BX_VGA_THIS s.vertical_display_end=399; for (i=0; i<=0x18; i++) BX_VGA_THIS s.CRTC.reg[i] = 0; BX_VGA_THIS s.CRTC.address = 0; BX_VGA_THIS s.CRTC.write_protect = 0; BX_VGA_THIS s.attribute_ctrl.flip_flop = 0; BX_VGA_THIS s.attribute_ctrl.address = 0; BX_VGA_THIS s.attribute_ctrl.video_enabled = 1; for (i=0; i<16; i++) BX_VGA_THIS s.attribute_ctrl.palette_reg[i] = 0; BX_VGA_THIS s.attribute_ctrl.overscan_color = 0; BX_VGA_THIS s.attribute_ctrl.color_plane_enable = 0x0f; BX_VGA_THIS s.attribute_ctrl.horiz_pel_panning = 0; BX_VGA_THIS s.attribute_ctrl.color_select = 0; for (i=0; i<256; i++) { BX_VGA_THIS s.pel.data[i].red = 0; BX_VGA_THIS s.pel.data[i].green = 0; BX_VGA_THIS s.pel.data[i].blue = 0; } BX_VGA_THIS s.pel.write_data_register = 0; BX_VGA_THIS s.pel.write_data_cycle = 0; BX_VGA_THIS s.pel.read_data_register = 0; BX_VGA_THIS s.pel.read_data_cycle = 0; BX_VGA_THIS s.pel.dac_state = 0x01; BX_VGA_THIS s.pel.mask = 0xff; BX_VGA_THIS s.graphics_ctrl.index = 0; BX_VGA_THIS s.graphics_ctrl.set_reset = 0; BX_VGA_THIS s.graphics_ctrl.enable_set_reset = 0; BX_VGA_THIS s.graphics_ctrl.color_compare = 0; BX_VGA_THIS s.graphics_ctrl.data_rotate = 0; BX_VGA_THIS s.graphics_ctrl.raster_op = 0; BX_VGA_THIS s.graphics_ctrl.read_map_select = 0; BX_VGA_THIS s.graphics_ctrl.write_mode = 0; BX_VGA_THIS s.graphics_ctrl.read_mode = 0; BX_VGA_THIS s.graphics_ctrl.odd_even = 0; BX_VGA_THIS s.graphics_ctrl.chain_odd_even = 0; BX_VGA_THIS s.graphics_ctrl.shift_reg = 0; BX_VGA_THIS s.graphics_ctrl.graphics_alpha = 0; BX_VGA_THIS s.graphics_ctrl.memory_mapping = 2; // monochrome text mode BX_VGA_THIS s.graphics_ctrl.color_dont_care = 0; BX_VGA_THIS s.graphics_ctrl.bitmask = 0; for (i=0; i<4; i++) { BX_VGA_THIS s.graphics_ctrl.latch[i] = 0; } BX_VGA_THIS s.sequencer.index = 0; BX_VGA_THIS s.sequencer.map_mask = 0; BX_VGA_THIS s.sequencer.reset1 = 1; BX_VGA_THIS s.sequencer.reset2 = 1; BX_VGA_THIS s.sequencer.reg1 = 0; BX_VGA_THIS s.sequencer.char_map_select = 0; BX_VGA_THIS s.sequencer.extended_mem = 1; // display mem greater than 64K BX_VGA_THIS s.sequencer.odd_even = 1; // use sequential addressing mode BX_VGA_THIS s.sequencer.chain_four = 0; // use map mask & read map select extname = SIM->get_param_string(BXPN_VGA_EXTENSION)->getptr(); if ((strlen(extname) == 0) || (!strcmp(extname, "none"))) { BX_VGA_THIS s.memsize = 0x40000; if (BX_VGA_THIS s.memory == NULL) BX_VGA_THIS s.memory = new Bit8u[BX_VGA_THIS s.memsize]; memset(BX_VGA_THIS s.memory, 0, BX_VGA_THIS s.memsize); } BX_VGA_THIS s.vga_mem_updated = 0; for (y=0; y<480/Y_TILESIZE; y++) for (x=0; x<640/X_TILESIZE; x++) SET_TILE_UPDATED (x, y, 0); memset(argv, 0, sizeof(argv)); argc = 1; argv[0] = (char *)"bochs"; len = strlen(SIM->get_param_string(BXPN_DISPLAYLIB_OPTIONS)->getptr()); if (len > 0) { char *options = new char[len + 1]; strcpy(options, SIM->get_param_string(BXPN_DISPLAYLIB_OPTIONS)->getptr()); ptr = strtok(options, ","); while (ptr) { string_i = 0; for (i=0; i<strlen(ptr); i++) { if (!isspace(ptr[i])) string[string_i++] = ptr[i]; } string[string_i] = '\0'; if (argv[argc] != NULL) { free(argv[argc]); argv[argc] = NULL; } if (argc < 16) { argv[argc++] = strdup(string); } else { BX_PANIC (("too many parameters, max is 16\n")); } ptr = strtok(NULL, ","); } delete [] options; } bx_gui->init(argc, argv, BX_VGA_THIS s.x_tilesize, BX_VGA_THIS s.y_tilesize); for (i = 1; i < (unsigned)argc; i++) { if (argv[i] != NULL) { free(argv[i]); argv[i] = NULL; } } #if !BX_SUPPORT_CLGD54XX BX_VGA_THIS init_systemtimer(timer_handler, vga_param_handler); #endif // !BX_SUPPORT_CLGD54XX /* video card with BIOS ROM */ DEV_cmos_set_reg(0x14, (DEV_cmos_get_reg(0x14) & 0xcf) | 0x00); BX_VGA_THIS s.charmap_address = 0; BX_VGA_THIS s.x_dotclockdiv2 = 0; BX_VGA_THIS s.y_doublescan = 0; BX_VGA_THIS s.last_bpp = 8; #if BX_SUPPORT_VBE // The following is for the vbe display extension BX_VGA_THIS s.vbe_enabled=0; BX_VGA_THIS s.vbe_8bit_dac=0; if (!strcmp(extname, "vbe")) { for (addr=VBE_DISPI_IOPORT_INDEX; addr<=VBE_DISPI_IOPORT_DATA; addr++) { DEV_register_ioread_handler(this, vbe_read_handler, addr, "vga video", 7); DEV_register_iowrite_handler(this, vbe_write_handler, addr, "vga video", 7); } if (!BX_SUPPORT_PCIUSB || !SIM->get_param_bool(BXPN_USB1_ENABLED)->get()) { for (addr=VBE_DISPI_IOPORT_INDEX_OLD; addr<=VBE_DISPI_IOPORT_DATA_OLD; addr++) { DEV_register_ioread_handler(this, vbe_read_handler, addr, "vga video", 7); DEV_register_iowrite_handler(this, vbe_write_handler, addr, "vga video", 7); } } DEV_register_memory_handlers(theVga, mem_read_handler, mem_write_handler, VBE_DISPI_LFB_PHYSICAL_ADDRESS, VBE_DISPI_LFB_PHYSICAL_ADDRESS + VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES - 1); if (BX_VGA_THIS s.memory == NULL) BX_VGA_THIS s.memory = new Bit8u[VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES]; memset(BX_VGA_THIS s.memory, 0, VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES); BX_VGA_THIS s.memsize = VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES; BX_VGA_THIS s.vbe_cur_dispi=VBE_DISPI_ID0; BX_VGA_THIS s.vbe_xres=640; BX_VGA_THIS s.vbe_yres=480; BX_VGA_THIS s.vbe_bpp=8; BX_VGA_THIS s.vbe_bank=0; BX_VGA_THIS s.vbe_curindex=0; BX_VGA_THIS s.vbe_offset_x=0; BX_VGA_THIS s.vbe_offset_y=0; BX_VGA_THIS s.vbe_virtual_xres=640; BX_VGA_THIS s.vbe_virtual_yres=480; BX_VGA_THIS s.vbe_bpp_multiplier=1; BX_VGA_THIS s.vbe_virtual_start=0; BX_VGA_THIS s.vbe_lfb_enabled=0; BX_VGA_THIS s.vbe_get_capabilities=0; bx_gui->get_capabilities(&max_xres, &max_yres, &max_bpp); if (max_xres > VBE_DISPI_MAX_XRES) { BX_VGA_THIS s.vbe_max_xres=VBE_DISPI_MAX_XRES; } else { BX_VGA_THIS s.vbe_max_xres=max_xres; } if (max_yres > VBE_DISPI_MAX_YRES) { BX_VGA_THIS s.vbe_max_yres=VBE_DISPI_MAX_YRES; } else { BX_VGA_THIS s.vbe_max_yres=max_yres; } if (max_bpp > VBE_DISPI_MAX_BPP) { BX_VGA_THIS s.vbe_max_bpp=VBE_DISPI_MAX_BPP; } else { BX_VGA_THIS s.vbe_max_bpp=max_bpp; } BX_VGA_THIS extension_init = 1; BX_INFO(("VBE Bochs Display Extension Enabled")); } #endif } void bx_vga_c::init_iohandlers(bx_read_handler_t f_read, bx_write_handler_t f_write) { unsigned addr, i; Bit8u io_mask[16] = {3, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1}; for (addr=0x03B4; addr<=0x03B5; addr++) { DEV_register_ioread_handler(this, f_read, addr, "vga video", 1); DEV_register_iowrite_handler(this, f_write, addr, "vga video", 3); } for (addr=0x03BA; addr<=0x03BA; addr++) { DEV_register_ioread_handler(this, f_read, addr, "vga video", 1); DEV_register_iowrite_handler(this, f_write, addr, "vga video", 3); } i = 0; for (addr=0x03C0; addr<=0x03CF; addr++) { DEV_register_ioread_handler(this, f_read, addr, "vga video", io_mask[i++]); DEV_register_iowrite_handler(this, f_write, addr, "vga video", 3); } for (addr=0x03D4; addr<=0x03D5; addr++) { DEV_register_ioread_handler(this, f_read, addr, "vga video", 3); DEV_register_iowrite_handler(this, f_write, addr, "vga video", 3); } for (addr=0x03DA; addr<=0x03DA; addr++) { DEV_register_ioread_handler(this, f_read, addr, "vga video", 1); DEV_register_iowrite_handler(this, f_write, addr, "vga video", 3); } } void bx_vga_c::init_systemtimer(bx_timer_handler_t f_timer, param_event_handler f_param) { bx_param_num_c *vga_update_interval = SIM->get_param_num(BXPN_VGA_UPDATE_INTERVAL); Bit64u interval = vga_update_interval->get(); BX_INFO(("interval=" FMT_LL "u", interval)); if (BX_VGA_THIS timer_id == BX_NULL_TIMER_HANDLE) { BX_VGA_THIS timer_id = bx_pc_system.register_timer(this, f_timer, (Bit32u)interval, 1, 1, "vga"); vga_update_interval->set_handler(f_param); vga_update_interval->set_runtime_param(1); } if (interval < 300000) { BX_VGA_THIS s.blink_counter = 300000 / (unsigned)interval; } else { BX_VGA_THIS s.blink_counter = 1; } } void bx_vga_c::reset(unsigned type) { if (!BX_VGA_THIS extension_checked) { char *strptr = SIM->get_param_string(BXPN_VGA_EXTENSION)->getptr(); if (!BX_VGA_THIS extension_init && (strlen(strptr) > 0) && strcmp(strptr, "none")) { BX_PANIC(("unknown display extension: %s", strptr)); } BX_VGA_THIS extension_checked = 1; } } void bx_vga_c::register_state(void) { unsigned i; char name[6]; bx_list_c *parent, *reg; parent = SIM->get_bochs_root(); #if BX_SUPPORT_CLGD54XX if (!strcmp(SIM->get_param_string(BXPN_VGA_EXTENSION)->getptr(), "cirrus")) { parent = (bx_list_c*)SIM->get_param("svga_cirrus", parent);; } #endif bx_list_c *list = new bx_list_c(parent, "vga", "VGA Adapter State", 17); bx_list_c *misc = new bx_list_c(list, "misc_output", 6); new bx_shadow_bool_c(misc, "color_emulation", &BX_VGA_THIS s.misc_output.color_emulation); new bx_shadow_bool_c(misc, "enable_ram", &BX_VGA_THIS s.misc_output.enable_ram); new bx_shadow_num_c(misc, "clock_select", &BX_VGA_THIS s.misc_output.clock_select); new bx_shadow_bool_c(misc, "select_high_bank", &BX_VGA_THIS s.misc_output.select_high_bank); new bx_shadow_bool_c(misc, "horiz_sync_pol", &BX_VGA_THIS s.misc_output.horiz_sync_pol); new bx_shadow_bool_c(misc, "vert_sync_pol", &BX_VGA_THIS s.misc_output.vert_sync_pol); bx_list_c *crtc = new bx_list_c(list, "CRTC", 3); new bx_shadow_num_c(crtc, "address", &BX_VGA_THIS s.CRTC.address, BASE_HEX); reg = new bx_list_c(crtc, "reg", 0x19); for (i=0; i<=0x18; i++) { sprintf(name, "0x%02x", i); new bx_shadow_num_c(reg, name, &BX_VGA_THIS s.CRTC.reg[i], BASE_HEX); } new bx_shadow_bool_c(crtc, "write_protect", &BX_VGA_THIS s.CRTC.write_protect); bx_list_c *actl = new bx_list_c(list, "attribute_ctrl", 9); new bx_shadow_bool_c(actl, "flip_flop", &BX_VGA_THIS s.attribute_ctrl.flip_flop); new bx_shadow_num_c(actl, "address", &BX_VGA_THIS s.attribute_ctrl.address, BASE_HEX); new bx_shadow_bool_c(actl, "video_enabled", &BX_VGA_THIS s.attribute_ctrl.video_enabled); reg = new bx_list_c(actl, "palette_reg", 16); for (i=0; i<16; i++) { sprintf(name, "0x%02x", i); new bx_shadow_num_c(reg, name, &BX_VGA_THIS s.attribute_ctrl.palette_reg[i], BASE_HEX); } new bx_shadow_num_c(actl, "overscan_color", &BX_VGA_THIS s.attribute_ctrl.overscan_color, BASE_HEX); new bx_shadow_num_c(actl, "color_plane_enable", &BX_VGA_THIS s.attribute_ctrl.color_plane_enable, BASE_HEX); new bx_shadow_num_c(actl, "horiz_pel_panning", &BX_VGA_THIS s.attribute_ctrl.horiz_pel_panning, BASE_HEX); new bx_shadow_num_c(actl, "color_select", &BX_VGA_THIS s.attribute_ctrl.color_select, BASE_HEX); bx_list_c *mode = new bx_list_c(actl, "mode_ctrl", 7); new bx_shadow_bool_c(mode, "graphics_alpha", &BX_VGA_THIS s.attribute_ctrl.mode_ctrl.graphics_alpha); new bx_shadow_bool_c(mode, "display_type", &BX_VGA_THIS s.attribute_ctrl.mode_ctrl.display_type); new bx_shadow_bool_c(mode, "enable_line_graphics", &BX_VGA_THIS s.attribute_ctrl.mode_ctrl.enable_line_graphics); new bx_shadow_bool_c(mode, "blink_intensity", &BX_VGA_THIS s.attribute_ctrl.mode_ctrl.blink_intensity); new bx_shadow_bool_c(mode, "pixel_panning_compat", &BX_VGA_THIS s.attribute_ctrl.mode_ctrl.pixel_panning_compat); new bx_shadow_bool_c(mode, "pixel_clock_select", &BX_VGA_THIS s.attribute_ctrl.mode_ctrl.pixel_clock_select); new bx_shadow_bool_c(mode, "internal_palette_size", &BX_VGA_THIS s.attribute_ctrl.mode_ctrl.internal_palette_size); bx_list_c *pel = new bx_list_c(list, "pel", 6); new bx_shadow_num_c(pel, "write_data_register", &BX_VGA_THIS s.pel.write_data_register, BASE_HEX); new bx_shadow_num_c(pel, "write_data_cycle", &BX_VGA_THIS s.pel.write_data_cycle); new bx_shadow_num_c(pel, "read_data_register", &BX_VGA_THIS s.pel.read_data_register, BASE_HEX); new bx_shadow_num_c(pel, "read_data_cycle", &BX_VGA_THIS s.pel.read_data_cycle); new bx_shadow_num_c(pel, "dac_state", &BX_VGA_THIS s.pel.dac_state); new bx_shadow_num_c(pel, "mask", &BX_VGA_THIS s.pel.mask, BASE_HEX); new bx_shadow_data_c(list, "pel_data", &BX_VGA_THIS s.pel.data[0].red, sizeof(BX_VGA_THIS s.pel.data)); bx_list_c *gfxc = new bx_list_c(list, "graphics_ctrl", 20); new bx_shadow_num_c(gfxc, "index", &BX_VGA_THIS s.graphics_ctrl.index); new bx_shadow_num_c(gfxc, "set_reset", &BX_VGA_THIS s.graphics_ctrl.set_reset); new bx_shadow_num_c(gfxc, "enable_set_reset", &BX_VGA_THIS s.graphics_ctrl.enable_set_reset); new bx_shadow_num_c(gfxc, "color_compare", &BX_VGA_THIS s.graphics_ctrl.color_compare); new bx_shadow_num_c(gfxc, "data_rotate", &BX_VGA_THIS s.graphics_ctrl.data_rotate); new bx_shadow_num_c(gfxc, "raster_op", &BX_VGA_THIS s.graphics_ctrl.raster_op); new bx_shadow_num_c(gfxc, "read_map_select", &BX_VGA_THIS s.graphics_ctrl.read_map_select); new bx_shadow_num_c(gfxc, "write_mode", &BX_VGA_THIS s.graphics_ctrl.write_mode); new bx_shadow_num_c(gfxc, "read_mode", &BX_VGA_THIS s.graphics_ctrl.read_mode); new bx_shadow_bool_c(gfxc, "odd_even", &BX_VGA_THIS s.graphics_ctrl.odd_even); new bx_shadow_bool_c(gfxc, "chain_odd_even", &BX_VGA_THIS s.graphics_ctrl.chain_odd_even); new bx_shadow_num_c(gfxc, "shift_reg", &BX_VGA_THIS s.graphics_ctrl.shift_reg); new bx_shadow_bool_c(gfxc, "graphics_alpha", &BX_VGA_THIS s.graphics_ctrl.graphics_alpha); new bx_shadow_num_c(gfxc, "memory_mapping", &BX_VGA_THIS s.graphics_ctrl.memory_mapping); new bx_shadow_num_c(gfxc, "color_dont_care", &BX_VGA_THIS s.graphics_ctrl.color_dont_care, BASE_HEX); new bx_shadow_num_c(gfxc, "bitmask", &BX_VGA_THIS s.graphics_ctrl.bitmask, BASE_HEX); new bx_shadow_num_c(gfxc, "latch0", &BX_VGA_THIS s.graphics_ctrl.latch[0], BASE_HEX); new bx_shadow_num_c(gfxc, "latch1", &BX_VGA_THIS s.graphics_ctrl.latch[1], BASE_HEX); new bx_shadow_num_c(gfxc, "latch2", &BX_VGA_THIS s.graphics_ctrl.latch[2], BASE_HEX); new bx_shadow_num_c(gfxc, "latch3", &BX_VGA_THIS s.graphics_ctrl.latch[3], BASE_HEX); bx_list_c *sequ = new bx_list_c(list, "sequencer", 13); new bx_shadow_num_c(sequ, "index", &BX_VGA_THIS s.sequencer.index); new bx_shadow_num_c(sequ, "map_mask", &BX_VGA_THIS s.sequencer.map_mask); new bx_shadow_bool_c(sequ, "reset1", &BX_VGA_THIS s.sequencer.reset1); new bx_shadow_bool_c(sequ, "reset2", &BX_VGA_THIS s.sequencer.reset2); new bx_shadow_num_c(sequ, "reg1", &BX_VGA_THIS s.sequencer.reg1, BASE_HEX); new bx_shadow_num_c(sequ, "char_map_select", &BX_VGA_THIS s.sequencer.char_map_select); new bx_shadow_bool_c(sequ, "extended_mem", &BX_VGA_THIS s.sequencer.extended_mem); new bx_shadow_bool_c(sequ, "odd_even", &BX_VGA_THIS s.sequencer.odd_even); new bx_shadow_bool_c(sequ, "chain_four", &BX_VGA_THIS s.sequencer.chain_four); new bx_shadow_bool_c(list, "enabled", &BX_VGA_THIS s.vga_enabled); new bx_shadow_num_c(list, "line_offset", &BX_VGA_THIS s.line_offset); new bx_shadow_num_c(list, "line_compare", &BX_VGA_THIS s.line_compare); new bx_shadow_num_c(list, "vertical_display_end", &BX_VGA_THIS s.vertical_display_end); new bx_shadow_num_c(list, "charmap_address", &BX_VGA_THIS s.charmap_address); new bx_shadow_bool_c(list, "x_dotclockdiv2", &BX_VGA_THIS s.x_dotclockdiv2); new bx_shadow_bool_c(list, "y_doublescan", &BX_VGA_THIS s.y_doublescan); new bx_shadow_num_c(list, "last_bpp", &BX_VGA_THIS s.last_bpp); new bx_shadow_data_c(list, "memory", BX_VGA_THIS s.memory, BX_VGA_THIS s.memsize); #if BX_SUPPORT_VBE if (!strcmp(SIM->get_param_string(BXPN_VGA_EXTENSION)->getptr(), "vbe")) { bx_list_c *vbe = new bx_list_c(list, "vbe", 18); new bx_shadow_num_c(vbe, "cur_dispi", &BX_VGA_THIS s.vbe_cur_dispi, BASE_HEX); new bx_shadow_num_c(vbe, "xres", &BX_VGA_THIS s.vbe_xres); new bx_shadow_num_c(vbe, "yres", &BX_VGA_THIS s.vbe_yres); new bx_shadow_num_c(vbe, "bpp", &BX_VGA_THIS s.vbe_bpp); new bx_shadow_num_c(vbe, "bank", &BX_VGA_THIS s.vbe_bank); new bx_shadow_bool_c(vbe, "enabled", &BX_VGA_THIS s.vbe_enabled); new bx_shadow_num_c(vbe, "curindex", &BX_VGA_THIS s.vbe_curindex); new bx_shadow_num_c(vbe, "visible_screen_size", &BX_VGA_THIS s.vbe_visible_screen_size); new bx_shadow_num_c(vbe, "offset_x", &BX_VGA_THIS s.vbe_offset_x); new bx_shadow_num_c(vbe, "offset_y", &BX_VGA_THIS s.vbe_offset_y); new bx_shadow_num_c(vbe, "virtual_xres", &BX_VGA_THIS s.vbe_virtual_xres); new bx_shadow_num_c(vbe, "virtual_yres", &BX_VGA_THIS s.vbe_virtual_yres); new bx_shadow_num_c(vbe, "virtual_start", &BX_VGA_THIS s.vbe_virtual_start); new bx_shadow_num_c(vbe, "bpp_multiplier", &BX_VGA_THIS s.vbe_bpp_multiplier); new bx_shadow_bool_c(vbe, "lfb_enabled", &BX_VGA_THIS s.vbe_lfb_enabled); new bx_shadow_bool_c(vbe, "get_capabilities", &BX_VGA_THIS s.vbe_get_capabilities); new bx_shadow_bool_c(vbe, "8bit_dac", &BX_VGA_THIS s.vbe_8bit_dac); } #endif } void bx_vga_c::after_restore_state(void) { for (unsigned i=0; i<256; i++) { #if BX_SUPPORT_VBE if (BX_VGA_THIS s.vbe_8bit_dac) { bx_gui->palette_change(i, BX_VGA_THIS s.pel.data[i].red, BX_VGA_THIS s.pel.data[i].green, BX_VGA_THIS s.pel.data[i].blue); } else #endif { bx_gui->palette_change(i, BX_VGA_THIS s.pel.data[i].red<<2, BX_VGA_THIS s.pel.data[i].green<<2, BX_VGA_THIS s.pel.data[i].blue<<2); } } bx_gui->set_text_charmap(&BX_VGA_THIS s.memory[0x20000 + BX_VGA_THIS s.charmap_address]); old_iWidth = BX_MAX_XRES; old_iHeight = BX_MAX_YRES; BX_VGA_THIS redraw_area(0, 0, BX_MAX_XRES, BX_MAX_YRES); #if BX_SUPPORT_VBE if (BX_VGA_THIS s.vbe_enabled) { bx_gui->dimension_update(BX_VGA_THIS s.vbe_xres, BX_VGA_THIS s.vbe_yres, 0, 0, BX_VGA_THIS s.vbe_bpp); } #endif BX_VGA_THIS update(); bx_gui->flush(); } void bx_vga_c::determine_screen_dimensions(unsigned *piHeight, unsigned *piWidth) { int ai[0x20]; int i,h,v; for (i = 0 ; i < 0x20 ; i++) ai[i] = BX_VGA_THIS s.CRTC.reg[i]; h = (ai[1] + 1) * 8; v = (ai[18] | ((ai[7] & 0x02) << 7) | ((ai[7] & 0x40) << 3)) + 1; if (BX_VGA_THIS s.graphics_ctrl.shift_reg == 0) { *piWidth = 640; *piHeight = 480; if (BX_VGA_THIS s.CRTC.reg[6] == 0xBF) { if (BX_VGA_THIS s.CRTC.reg[23] == 0xA3 && BX_VGA_THIS s.CRTC.reg[20] == 0x40 && BX_VGA_THIS s.CRTC.reg[9] == 0x41) { *piWidth = 320; *piHeight = 240; } else { if (BX_VGA_THIS s.x_dotclockdiv2) h <<= 1; *piWidth = h; *piHeight = v; } } else if ((h >= 640) && (v >= 480)) { *piWidth = h; *piHeight = v; } } else if (BX_VGA_THIS s.graphics_ctrl.shift_reg == 2) { if (BX_VGA_THIS s.sequencer.chain_four) { *piWidth = h; *piHeight = v; } else { *piWidth = h; *piHeight = v; } } else { if (BX_VGA_THIS s.x_dotclockdiv2) h <<= 1; *piWidth = h; *piHeight = v; } } // static IO port read callback handler // redirects to non-static class handler to avoid virtual functions Bit32u bx_vga_c::read_handler(void *this_ptr, Bit32u address, unsigned io_len) { #if !BX_USE_VGA_SMF bx_vga_c *class_ptr = (bx_vga_c *) this_ptr; return class_ptr->read(address, io_len); } Bit32u bx_vga_c::read(Bit32u address, unsigned io_len) { #else UNUSED(this_ptr); #endif // !BX_USE_VGA_SMF bx_bool horiz_retrace = 0, vert_retrace = 0; Bit64u usec; Bit16u ret16, vertres; Bit8u retval; #if defined(VGA_TRACE_FEATURE) Bit32u ret = 0; #define RETURN(x) do { ret = (x); goto read_return; } while (0) #else #define RETURN return #endif if (io_len == 2) { #if BX_USE_VGA_SMF ret16 = bx_vga_c::read_handler(0, address, 1); ret16 |= (bx_vga_c::read_handler(0, address+1, 1)) << 8; #else ret16 = bx_vga_c::read(address, 1); ret16 |= (bx_vga_c::read(address+1, 1) << 8; #endif RETURN(ret16); } #ifdef __OS2__ if (bx_options.videomode == BX_VIDEO_DIRECT) { return _inp(address); } #endif #if !defined(VGA_TRACE_FEATURE) BX_DEBUG(("io read from 0x%04x", (unsigned) address)); #endif if ((address >= 0x03b0) && (address <= 0x03bf) && (BX_VGA_THIS s.misc_output.color_emulation)) { RETURN(0xff); } if ((address >= 0x03d0) && (address <= 0x03df) && (BX_VGA_THIS s.misc_output.color_emulation==0)) { RETURN(0xff); } switch (address) { case 0x03ba: /* Input Status 1 (monochrome emulation modes) */ case 0x03ca: /* Feature Control ??? */ case 0x03da: /* Input Status 1 (color emulation modes) */ // bit3: Vertical Retrace // 0 = display is in the display mode // 1 = display is in the vertical retrace mode // bit0: Display Enable // 0 = display is in the display mode // 1 = display is not in the display mode; either the // horizontal or vertical retrace period is active // using 72 Hz vertical frequency usec = bx_pc_system.time_usec(); switch ((BX_VGA_THIS s.misc_output.vert_sync_pol << 1) | BX_VGA_THIS s.misc_output.horiz_sync_pol) { case 0: vertres = 200; break; case 1: vertres = 400; break; case 2: vertres = 350; break; default: vertres = 480; break; } if ((usec % 13888) < 70) { vert_retrace = 1; } if ((usec % (13888 / vertres)) == 0) { horiz_retrace = 1; } retval = 0; if (horiz_retrace || vert_retrace) retval = 0x01; if (vert_retrace) retval |= 0x08; /* reading this port resets the flip-flop to address mode */ BX_VGA_THIS s.attribute_ctrl.flip_flop = 0; RETURN(retval); break; case 0x03c0: /* */ if (BX_VGA_THIS s.attribute_ctrl.flip_flop == 0) { //BX_INFO(("io read: 0x3c0: flip_flop = 0")); retval = (BX_VGA_THIS s.attribute_ctrl.video_enabled << 5) | BX_VGA_THIS s.attribute_ctrl.address; RETURN(retval); } else { BX_ERROR(("io read: 0x3c0: flip_flop != 0")); return(0); } break; case 0x03c1: /* */ switch (BX_VGA_THIS s.attribute_ctrl.address) { case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07: case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e: case 0x0f: retval = BX_VGA_THIS s.attribute_ctrl.palette_reg[BX_VGA_THIS s.attribute_ctrl.address]; RETURN(retval); break; case 0x10: /* mode control register */ retval = (BX_VGA_THIS s.attribute_ctrl.mode_ctrl.graphics_alpha << 0) | (BX_VGA_THIS s.attribute_ctrl.mode_ctrl.display_type << 1) | (BX_VGA_THIS s.attribute_ctrl.mode_ctrl.enable_line_graphics << 2) | (BX_VGA_THIS s.attribute_ctrl.mode_ctrl.blink_intensity << 3) | (BX_VGA_THIS s.attribute_ctrl.mode_ctrl.pixel_panning_compat << 5) | (BX_VGA_THIS s.attribute_ctrl.mode_ctrl.pixel_clock_select << 6) | (BX_VGA_THIS s.attribute_ctrl.mode_ctrl.internal_palette_size << 7); RETURN(retval); break; case 0x11: /* overscan color register */ RETURN(BX_VGA_THIS s.attribute_ctrl.overscan_color); break; case 0x12: /* color plane enable */ RETURN(BX_VGA_THIS s.attribute_ctrl.color_plane_enable); break; case 0x13: /* horizontal PEL panning register */ RETURN(BX_VGA_THIS s.attribute_ctrl.horiz_pel_panning); break; case 0x14: /* color select register */ RETURN(BX_VGA_THIS s.attribute_ctrl.color_select); break; default: BX_INFO(("io read: 0x3c1: unknown register 0x%02x", (unsigned) BX_VGA_THIS s.attribute_ctrl.address)); RETURN(0); } break; case 0x03c2: /* Input Status 0 */ BX_DEBUG(("io read 0x3c2: input status #0: ignoring")); RETURN(0); break; case 0x03c3: /* VGA Enable Register */ RETURN(BX_VGA_THIS s.vga_enabled); break; case 0x03c4: /* Sequencer Index Register */ RETURN(BX_VGA_THIS s.sequencer.index); break; case 0x03c5: /* Sequencer Registers 00..04 */ switch (BX_VGA_THIS s.sequencer.index) { case 0: /* sequencer: reset */ BX_DEBUG(("io read 0x3c5: sequencer reset")); RETURN(BX_VGA_THIS s.sequencer.reset1 | (BX_VGA_THIS s.sequencer.reset2<<1)); break; case 1: /* sequencer: clocking mode */ BX_DEBUG(("io read 0x3c5: sequencer clocking mode")); RETURN(BX_VGA_THIS s.sequencer.reg1); break; case 2: /* sequencer: map mask register */ RETURN(BX_VGA_THIS s.sequencer.map_mask); break; case 3: /* sequencer: character map select register */ RETURN(BX_VGA_THIS s.sequencer.char_map_select); break; case 4: /* sequencer: memory mode register */ retval = (BX_VGA_THIS s.sequencer.extended_mem << 1) | (BX_VGA_THIS s.sequencer.odd_even << 2) | (BX_VGA_THIS s.sequencer.chain_four << 3); RETURN(retval); break; default: BX_DEBUG(("io read 0x3c5: index %u unhandled", (unsigned) BX_VGA_THIS s.sequencer.index)); RETURN(0); } break; case 0x03c6: /* PEL mask ??? */ RETURN(BX_VGA_THIS s.pel.mask); break; case 0x03c7: /* DAC state, read = 11b, write = 00b */ RETURN(BX_VGA_THIS s.pel.dac_state); break; case 0x03c8: /* PEL address write mode */ RETURN(BX_VGA_THIS s.pel.write_data_register); break; case 0x03c9: /* PEL Data Register, colors 00..FF */ if (BX_VGA_THIS s.pel.dac_state == 0x03) { switch (BX_VGA_THIS s.pel.read_data_cycle) { case 0: retval = BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.read_data_register].red; break; case 1: retval = BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.read_data_register].green; break; case 2: retval = BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.read_data_register].blue; break; default: retval = 0; // keep compiler happy } BX_VGA_THIS s.pel.read_data_cycle++; if (BX_VGA_THIS s.pel.read_data_cycle >= 3) { BX_VGA_THIS s.pel.read_data_cycle = 0; BX_VGA_THIS s.pel.read_data_register++; } } else { retval = 0x3f; } RETURN(retval); break; case 0x03cc: /* Miscellaneous Output / Graphics 1 Position ??? */ retval = ((BX_VGA_THIS s.misc_output.color_emulation & 0x01) << 0) | ((BX_VGA_THIS s.misc_output.enable_ram & 0x01) << 1) | ((BX_VGA_THIS s.misc_output.clock_select & 0x03) << 2) | ((BX_VGA_THIS s.misc_output.select_high_bank & 0x01) << 5) | ((BX_VGA_THIS s.misc_output.horiz_sync_pol & 0x01) << 6) | ((BX_VGA_THIS s.misc_output.vert_sync_pol & 0x01) << 7); RETURN(retval); break; case 0x03ce: /* Graphics Controller Index Register */ RETURN(BX_VGA_THIS s.graphics_ctrl.index); break; case 0x03cd: /* ??? */ BX_DEBUG(("io read from 03cd")); RETURN(0x00); break; case 0x03cf: /* Graphics Controller Registers 00..08 */ switch (BX_VGA_THIS s.graphics_ctrl.index) { case 0: /* Set/Reset */ RETURN(BX_VGA_THIS s.graphics_ctrl.set_reset); break; case 1: /* Enable Set/Reset */ RETURN(BX_VGA_THIS s.graphics_ctrl.enable_set_reset); break; case 2: /* Color Compare */ RETURN(BX_VGA_THIS s.graphics_ctrl.color_compare); break; case 3: /* Data Rotate */ retval = ((BX_VGA_THIS s.graphics_ctrl.raster_op & 0x03) << 3) | ((BX_VGA_THIS s.graphics_ctrl.data_rotate & 0x07) << 0); RETURN(retval); break; case 4: /* Read Map Select */ RETURN(BX_VGA_THIS s.graphics_ctrl.read_map_select); break; case 5: /* Mode */ retval = ((BX_VGA_THIS s.graphics_ctrl.shift_reg & 0x03) << 5) | ((BX_VGA_THIS s.graphics_ctrl.odd_even & 0x01) << 4) | ((BX_VGA_THIS s.graphics_ctrl.read_mode & 0x01) << 3) | ((BX_VGA_THIS s.graphics_ctrl.write_mode & 0x03) << 0); if (BX_VGA_THIS s.graphics_ctrl.odd_even || BX_VGA_THIS s.graphics_ctrl.shift_reg) BX_DEBUG(("io read 0x3cf: reg 05 = 0x%02x", (unsigned) retval)); RETURN(retval); break; case 6: /* Miscellaneous */ retval = ((BX_VGA_THIS s.graphics_ctrl.memory_mapping & 0x03) << 2) | ((BX_VGA_THIS s.graphics_ctrl.odd_even & 0x01) << 1) | ((BX_VGA_THIS s.graphics_ctrl.graphics_alpha & 0x01) << 0); RETURN(retval); break; case 7: /* Color Don't Care */ RETURN(BX_VGA_THIS s.graphics_ctrl.color_dont_care); break; case 8: /* Bit Mask */ RETURN(BX_VGA_THIS s.graphics_ctrl.bitmask); break; default: /* ??? */ BX_DEBUG(("io read: 0x3cf: index %u unhandled", (unsigned) BX_VGA_THIS s.graphics_ctrl.index)); RETURN(0); } break; case 0x03d4: /* CRTC Index Register (color emulation modes) */ RETURN(BX_VGA_THIS s.CRTC.address); break; case 0x03b5: /* CRTC Registers (monochrome emulation modes) */ case 0x03d5: /* CRTC Registers (color emulation modes) */ if (BX_VGA_THIS s.CRTC.address > 0x18) { BX_DEBUG(("io read: invalid CRTC register 0x%02x", (unsigned) BX_VGA_THIS s.CRTC.address)); RETURN(0); } RETURN(BX_VGA_THIS s.CRTC.reg[BX_VGA_THIS s.CRTC.address]); break; case 0x03b4: /* CRTC Index Register (monochrome emulation modes) */ case 0x03cb: /* not sure but OpenBSD reads it a lot */ default: BX_INFO(("io read from vga port 0x%04x", (unsigned) address)); RETURN(0); /* keep compiler happy */ } #if defined(VGA_TRACE_FEATURE) read_return: if (io_len == 1) { BX_DEBUG(("8-bit read from 0x%04x = 0x%02x", (unsigned) address, ret)); } else { BX_DEBUG(("16-bit read from 0x%04x = 0x%04x", (unsigned) address, ret)); } return ret; #endif } #if defined(VGA_TRACE_FEATURE) #undef RETURN #endif // static IO port write callback handler // redirects to non-static class handler to avoid virtual functions void bx_vga_c::write_handler(void *this_ptr, Bit32u address, Bit32u value, unsigned io_len) { #if !BX_USE_VGA_SMF bx_vga_c *class_ptr = (bx_vga_c *) this_ptr; class_ptr->write(address, value, io_len, 0); #else UNUSED(this_ptr); theVga->write(address, value, io_len, 0); #endif } void bx_vga_c::write_handler_no_log(void *this_ptr, Bit32u address, Bit32u value, unsigned io_len) { #if !BX_USE_VGA_SMF bx_vga_c *class_ptr = (bx_vga_c *) this_ptr; class_ptr->write(address, value, io_len, 1); #else UNUSED(this_ptr); theVga->write(address, value, io_len, 1); #endif } void bx_vga_c::write(Bit32u address, Bit32u value, unsigned io_len, bx_bool no_log) { Bit8u charmap1, charmap2, prev_memory_mapping; bx_bool prev_video_enabled, prev_line_graphics, prev_int_pal_size; bx_bool prev_graphics_alpha, prev_chain_odd_even; bx_bool needs_update = 0; #if defined(VGA_TRACE_FEATURE) if (!no_log) switch (io_len) { case 1: BX_DEBUG(("8-bit write to %04x = %02x", (unsigned)address, (unsigned)value)); break; case 2: BX_DEBUG(("16-bit write to %04x = %04x", (unsigned)address, (unsigned)value)); break; default: BX_PANIC(("Weird VGA write size")); } #else if (io_len == 1) { BX_DEBUG(("io write to 0x%04x = 0x%02x", (unsigned) address, (unsigned) value)); } #endif if (io_len == 2) { #if BX_USE_VGA_SMF bx_vga_c::write_handler_no_log(0, address, value & 0xff, 1); bx_vga_c::write_handler_no_log(0, address+1, (value >> 8) & 0xff, 1); #else bx_vga_c::write(address, value & 0xff, 1, 1); bx_vga_c::write(address+1, (value >> 8) & 0xff, 1, 1); #endif return; } #ifdef __OS2__ if (bx_options.videomode == BX_VIDEO_DIRECT) { _outp(address,value); return; } #endif if ((address >= 0x03b0) && (address <= 0x03bf) && (BX_VGA_THIS s.misc_output.color_emulation)) return; if ((address >= 0x03d0) && (address <= 0x03df) && (BX_VGA_THIS s.misc_output.color_emulation==0)) return; switch (address) { case 0x03ba: /* Feature Control (monochrome emulation modes) */ #if !defined(VGA_TRACE_FEATURE) BX_DEBUG(("io write 3ba: feature control: ignoring")); #endif break; case 0x03c0: /* Attribute Controller */ if (BX_VGA_THIS s.attribute_ctrl.flip_flop == 0) { /* address mode */ prev_video_enabled = BX_VGA_THIS s.attribute_ctrl.video_enabled; BX_VGA_THIS s.attribute_ctrl.video_enabled = (value >> 5) & 0x01; #if !defined(VGA_TRACE_FEATURE) BX_DEBUG(("io write 3c0: video_enabled = %u", (unsigned) BX_VGA_THIS s.attribute_ctrl.video_enabled)); #endif if (BX_VGA_THIS s.attribute_ctrl.video_enabled == 0) bx_gui->clear_screen(); else if (!prev_video_enabled) { #if !defined(VGA_TRACE_FEATURE) BX_DEBUG(("found enable transition")); #endif needs_update = 1; } value &= 0x1f; /* address = bits 0..4 */ BX_VGA_THIS s.attribute_ctrl.address = value; switch (value) { case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07: case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e: case 0x0f: break; default: BX_DEBUG(("io write 0x3c0: address mode reg=0x%02x", (unsigned) value)); } } else { /* data-write mode */ switch (BX_VGA_THIS s.attribute_ctrl.address) { case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07: case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e: case 0x0f: if (value != BX_VGA_THIS s.attribute_ctrl.palette_reg[BX_VGA_THIS s.attribute_ctrl.address]) { BX_VGA_THIS s.attribute_ctrl.palette_reg[BX_VGA_THIS s.attribute_ctrl.address] = value; needs_update = 1; } break; case 0x10: // mode control register prev_line_graphics = BX_VGA_THIS s.attribute_ctrl.mode_ctrl.enable_line_graphics; prev_int_pal_size = BX_VGA_THIS s.attribute_ctrl.mode_ctrl.internal_palette_size; BX_VGA_THIS s.attribute_ctrl.mode_ctrl.graphics_alpha = (value >> 0) & 0x01; BX_VGA_THIS s.attribute_ctrl.mode_ctrl.display_type = (value >> 1) & 0x01; BX_VGA_THIS s.attribute_ctrl.mode_ctrl.enable_line_graphics = (value >> 2) & 0x01; BX_VGA_THIS s.attribute_ctrl.mode_ctrl.blink_intensity = (value >> 3) & 0x01; BX_VGA_THIS s.attribute_ctrl.mode_ctrl.pixel_panning_compat = (value >> 5) & 0x01; BX_VGA_THIS s.attribute_ctrl.mode_ctrl.pixel_clock_select = (value >> 6) & 0x01; BX_VGA_THIS s.attribute_ctrl.mode_ctrl.internal_palette_size = (value >> 7) & 0x01; if (((value >> 2) & 0x01) != prev_line_graphics) { bx_gui->set_text_charmap( & BX_VGA_THIS s.memory[0x20000 + BX_VGA_THIS s.charmap_address]); BX_VGA_THIS s.vga_mem_updated = 1; } if (((value >> 7) & 0x01) != prev_int_pal_size) { needs_update = 1; } #if !defined(VGA_TRACE_FEATURE) BX_DEBUG(("io write 0x3c0: mode control: 0x%02x", (unsigned) value)); #endif break; case 0x11: // Overscan Color Register BX_VGA_THIS s.attribute_ctrl.overscan_color = (value & 0x3f); #if !defined(VGA_TRACE_FEATURE) BX_DEBUG(("io write 0x3c0: overscan color = 0x%02x", (unsigned) value)); #endif break; case 0x12: // Color Plane Enable Register BX_VGA_THIS s.attribute_ctrl.color_plane_enable = (value & 0x0f); needs_update = 1; #if !defined(VGA_TRACE_FEATURE) BX_DEBUG(("io write 0x3c0: color plane enable = 0x%02x", (unsigned) value)); #endif break; case 0x13: // Horizontal Pixel Panning Register BX_VGA_THIS s.attribute_ctrl.horiz_pel_panning = (value & 0x0f); needs_update = 1; #if !defined(VGA_TRACE_FEATURE) BX_DEBUG(("io write 0x3c0: horiz pel panning = 0x%02x", (unsigned) value)); #endif break; case 0x14: // Color Select Register BX_VGA_THIS s.attribute_ctrl.color_select = (value & 0x0f); needs_update = 1; #if !defined(VGA_TRACE_FEATURE) BX_DEBUG(("io write 0x3c0: color select = 0x%02x", (unsigned) BX_VGA_THIS s.attribute_ctrl.color_select)); #endif break; default: BX_DEBUG(("io write 0x3c0: data-write mode 0x%02x", (unsigned) BX_VGA_THIS s.attribute_ctrl.address)); } } BX_VGA_THIS s.attribute_ctrl.flip_flop = !BX_VGA_THIS s.attribute_ctrl.flip_flop; break; case 0x03c2: // Miscellaneous Output Register BX_VGA_THIS s.misc_output.color_emulation = (value >> 0) & 0x01; BX_VGA_THIS s.misc_output.enable_ram = (value >> 1) & 0x01; BX_VGA_THIS s.misc_output.clock_select = (value >> 2) & 0x03; BX_VGA_THIS s.misc_output.select_high_bank = (value >> 5) & 0x01; BX_VGA_THIS s.misc_output.horiz_sync_pol = (value >> 6) & 0x01; BX_VGA_THIS s.misc_output.vert_sync_pol = (value >> 7) & 0x01; #if !defined(VGA_TRACE_FEATURE) BX_DEBUG(("io write 3c2:")); BX_DEBUG((" color_emulation (attempted) = %u", (value >> 0) & 0x01)); BX_DEBUG((" enable_ram = %u", (unsigned) BX_VGA_THIS s.misc_output.enable_ram)); BX_DEBUG((" clock_select = %u", (unsigned) BX_VGA_THIS s.misc_output.clock_select)); BX_DEBUG((" select_high_bank = %u", (unsigned) BX_VGA_THIS s.misc_output.select_high_bank)); BX_DEBUG((" horiz_sync_pol = %u", (unsigned) BX_VGA_THIS s.misc_output.horiz_sync_pol)); BX_DEBUG((" vert_sync_pol = %u", (unsigned) BX_VGA_THIS s.misc_output.vert_sync_pol)); #endif break; case 0x03c3: // VGA enable // bit0: enables VGA display if set BX_VGA_THIS s.vga_enabled = value & 0x01; #if !defined(VGA_TRACE_FEATURE) BX_DEBUG(("io write 0x03c3: VGA enable = %u", BX_VGA_THIS s.vga_enabled)); #endif break; case 0x03c4: /* Sequencer Index Register */ if (value > 4) { BX_DEBUG(("io write 3c4: value > 4")); } BX_VGA_THIS s.sequencer.index = value; break; case 0x03c5: /* Sequencer Registers 00..04 */ switch (BX_VGA_THIS s.sequencer.index) { case 0: /* sequencer: reset */ #if !defined(VGA_TRACE_FEATURE) BX_DEBUG(("write 0x3c5: sequencer reset: value=0x%02x", (unsigned) value)); #endif if (BX_VGA_THIS s.sequencer.reset1 && ((value & 0x01) == 0)) { BX_VGA_THIS s.sequencer.char_map_select = 0; BX_VGA_THIS s.charmap_address = 0; bx_gui->set_text_charmap( & BX_VGA_THIS s.memory[0x20000 + BX_VGA_THIS s.charmap_address]); BX_VGA_THIS s.vga_mem_updated = 1; } BX_VGA_THIS s.sequencer.reset1 = (value >> 0) & 0x01; BX_VGA_THIS s.sequencer.reset2 = (value >> 1) & 0x01; break; case 1: /* sequencer: clocking mode */ #if !defined(VGA_TRACE_FEATURE) BX_DEBUG(("io write 0x3c5=0x%02x: clocking mode reg: ignoring", (unsigned) value)); #endif if ((value & 0x20) > 0) { bx_gui->clear_screen(); } else if ((BX_VGA_THIS s.sequencer.reg1 & 0x20) > 0) { needs_update = 1; } BX_VGA_THIS s.sequencer.reg1 = value & 0x3d; BX_VGA_THIS s.x_dotclockdiv2 = ((value & 0x08) > 0); break; case 2: /* sequencer: map mask register */ BX_VGA_THIS s.sequencer.map_mask = (value & 0x0f); break; case 3: /* sequencer: character map select register */ BX_VGA_THIS s.sequencer.char_map_select = value & 0x3f; charmap1 = value & 0x13; if (charmap1 > 3) charmap1 = (charmap1 & 3) + 4; charmap2 = (value & 0x2C) >> 2; if (charmap2 > 3) charmap2 = (charmap2 & 3) + 4; if (BX_VGA_THIS s.CRTC.reg[0x09] > 0) { BX_VGA_THIS s.charmap_address = charmap_offset[charmap1]; bx_gui->set_text_charmap( & BX_VGA_THIS s.memory[0x20000 + BX_VGA_THIS s.charmap_address]); BX_VGA_THIS s.vga_mem_updated = 1; } if (charmap2 != charmap1) BX_INFO(("char map select: map #2 in block #%d unused", charmap2)); break; case 4: /* sequencer: memory mode register */ BX_VGA_THIS s.sequencer.extended_mem = (value >> 1) & 0x01; BX_VGA_THIS s.sequencer.odd_even = (value >> 2) & 0x01; BX_VGA_THIS s.sequencer.chain_four = (value >> 3) & 0x01; #if !defined(VGA_TRACE_FEATURE) BX_DEBUG(("io write 0x3c5: memory mode:")); BX_DEBUG((" extended_mem = %u", (unsigned) BX_VGA_THIS s.sequencer.extended_mem)); BX_DEBUG((" odd_even = %u", (unsigned) BX_VGA_THIS s.sequencer.odd_even)); BX_DEBUG((" chain_four = %u", (unsigned) BX_VGA_THIS s.sequencer.chain_four)); #endif break; default: BX_DEBUG(("io write 0x3c5: index 0x%02x unhandled", (unsigned) BX_VGA_THIS s.sequencer.index)); } break; case 0x03c6: /* PEL mask */ BX_VGA_THIS s.pel.mask = value; if (BX_VGA_THIS s.pel.mask != 0xff) BX_DEBUG(("io write 0x3c6: PEL mask=0x%02x != 0xFF", value)); // BX_VGA_THIS s.pel.mask should be and'd with final value before // indexing into color register BX_VGA_THIS s.pel.data[] break; case 0x03c7: // PEL address, read mode BX_VGA_THIS s.pel.read_data_register = value; BX_VGA_THIS s.pel.read_data_cycle = 0; BX_VGA_THIS s.pel.dac_state = 0x03; break; case 0x03c8: /* PEL address write mode */ BX_VGA_THIS s.pel.write_data_register = value; BX_VGA_THIS s.pel.write_data_cycle = 0; BX_VGA_THIS s.pel.dac_state = 0x00; break; case 0x03c9: /* PEL Data Register, colors 00..FF */ switch (BX_VGA_THIS s.pel.write_data_cycle) { case 0: BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].red = value; break; case 1: BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].green = value; break; case 2: BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].blue = value; #if BX_SUPPORT_VBE if (BX_VGA_THIS s.vbe_8bit_dac) { needs_update |= bx_gui->palette_change(BX_VGA_THIS s.pel.write_data_register, BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].red, BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].green, BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].blue); } else { #endif needs_update |= bx_gui->palette_change(BX_VGA_THIS s.pel.write_data_register, BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].red<<2, BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].green<<2, BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].blue<<2); #if BX_SUPPORT_VBE } #endif break; } BX_VGA_THIS s.pel.write_data_cycle++; if (BX_VGA_THIS s.pel.write_data_cycle >= 3) { //BX_INFO(("BX_VGA_THIS s.pel.data[%u] {r=%u, g=%u, b=%u}", // (unsigned) BX_VGA_THIS s.pel.write_data_register, // (unsigned) BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].red, // (unsigned) BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].green, // (unsigned) BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].blue); BX_VGA_THIS s.pel.write_data_cycle = 0; BX_VGA_THIS s.pel.write_data_register++; } break; case 0x03ca: /* Graphics 2 Position (EGA) */ // ignore, EGA only??? break; case 0x03cc: /* Graphics 1 Position (EGA) */ // ignore, EGA only??? break; case 0x03cd: /* ??? */ BX_DEBUG(("io write to 0x3cd = 0x%02x", (unsigned) value)); break; case 0x03ce: /* Graphics Controller Index Register */ if (value > 0x08) /* ??? */ BX_DEBUG(("io write: 0x3ce: value > 8")); BX_VGA_THIS s.graphics_ctrl.index = value; break; case 0x03cf: /* Graphics Controller Registers 00..08 */ switch (BX_VGA_THIS s.graphics_ctrl.index) { case 0: /* Set/Reset */ BX_VGA_THIS s.graphics_ctrl.set_reset = value & 0x0f; break; case 1: /* Enable Set/Reset */ BX_VGA_THIS s.graphics_ctrl.enable_set_reset = value & 0x0f; break; case 2: /* Color Compare */ BX_VGA_THIS s.graphics_ctrl.color_compare = value & 0x0f; break; case 3: /* Data Rotate */ BX_VGA_THIS s.graphics_ctrl.data_rotate = value & 0x07; BX_VGA_THIS s.graphics_ctrl.raster_op = (value >> 3) & 0x03; break; case 4: /* Read Map Select */ BX_VGA_THIS s.graphics_ctrl.read_map_select = value & 0x03; #if !defined(VGA_TRACE_FEATURE) BX_DEBUG(("io write to 0x3cf = 0x%02x (RMS)", (unsigned) value)); #endif break; case 5: /* Mode */ BX_VGA_THIS s.graphics_ctrl.write_mode = value & 0x03; BX_VGA_THIS s.graphics_ctrl.read_mode = (value >> 3) & 0x01; BX_VGA_THIS s.graphics_ctrl.odd_even = (value >> 4) & 0x01; BX_VGA_THIS s.graphics_ctrl.shift_reg = (value >> 5) & 0x03; if (BX_VGA_THIS s.graphics_ctrl.odd_even) BX_DEBUG(("io write: 0x3cf: mode reg: value = 0x%02x", (unsigned) value)); if (BX_VGA_THIS s.graphics_ctrl.shift_reg) BX_DEBUG(("io write: 0x3cf: mode reg: value = 0x%02x", (unsigned) value)); break; case 6: /* Miscellaneous */ prev_graphics_alpha = BX_VGA_THIS s.graphics_ctrl.graphics_alpha; prev_chain_odd_even = BX_VGA_THIS s.graphics_ctrl.chain_odd_even; prev_memory_mapping = BX_VGA_THIS s.graphics_ctrl.memory_mapping; BX_VGA_THIS s.graphics_ctrl.graphics_alpha = value & 0x01; BX_VGA_THIS s.graphics_ctrl.chain_odd_even = (value >> 1) & 0x01; BX_VGA_THIS s.graphics_ctrl.memory_mapping = (value >> 2) & 0x03; #if !defined(VGA_TRACE_FEATURE) BX_DEBUG(("memory_mapping set to %u", (unsigned) BX_VGA_THIS s.graphics_ctrl.memory_mapping)); BX_DEBUG(("graphics mode set to %u", (unsigned) BX_VGA_THIS s.graphics_ctrl.graphics_alpha)); BX_DEBUG(("odd_even mode set to %u", (unsigned) BX_VGA_THIS s.graphics_ctrl.odd_even)); BX_DEBUG(("io write: 0x3cf: misc reg: value = 0x%02x", (unsigned) value)); #endif if (prev_memory_mapping != BX_VGA_THIS s.graphics_ctrl.memory_mapping) needs_update = 1; if (prev_graphics_alpha != BX_VGA_THIS s.graphics_ctrl.graphics_alpha) { needs_update = 1; old_iHeight = 0; } break; case 7: /* Color Don't Care */ BX_VGA_THIS s.graphics_ctrl.color_dont_care = value & 0x0f; break; case 8: /* Bit Mask */ BX_VGA_THIS s.graphics_ctrl.bitmask = value; break; default: /* ??? */ BX_DEBUG(("io write: 0x3cf: index %u unhandled", (unsigned) BX_VGA_THIS s.graphics_ctrl.index)); } break; case 0x03b4: /* CRTC Index Register (monochrome emulation modes) */ case 0x03d4: /* CRTC Index Register (color emulation modes) */ BX_VGA_THIS s.CRTC.address = value & 0x7f; if (BX_VGA_THIS s.CRTC.address > 0x18) BX_DEBUG(("write: invalid CRTC register 0x%02x selected", (unsigned) BX_VGA_THIS s.CRTC.address)); break; case 0x03b5: /* CRTC Registers (monochrome emulation modes) */ case 0x03d5: /* CRTC Registers (color emulation modes) */ if (BX_VGA_THIS s.CRTC.address > 0x18) { BX_DEBUG(("write: invalid CRTC register 0x%02x ignored", (unsigned) BX_VGA_THIS s.CRTC.address)); return; } if (BX_VGA_THIS s.CRTC.write_protect && (BX_VGA_THIS s.CRTC.address < 0x08)) { if (BX_VGA_THIS s.CRTC.address == 0x07) { BX_VGA_THIS s.CRTC.reg[BX_VGA_THIS s.CRTC.address] &= ~0x10; BX_VGA_THIS s.CRTC.reg[BX_VGA_THIS s.CRTC.address] |= (value & 0x10); BX_VGA_THIS s.line_compare &= 0x2ff; if (BX_VGA_THIS s.CRTC.reg[0x07] & 0x10) BX_VGA_THIS s.line_compare |= 0x100; needs_update = 1; break; } else { return; } } if (value != BX_VGA_THIS s.CRTC.reg[BX_VGA_THIS s.CRTC.address]) { BX_VGA_THIS s.CRTC.reg[BX_VGA_THIS s.CRTC.address] = value; switch (BX_VGA_THIS s.CRTC.address) { case 0x07: BX_VGA_THIS s.vertical_display_end &= 0xff; if (BX_VGA_THIS s.CRTC.reg[0x07] & 0x02) BX_VGA_THIS s.vertical_display_end |= 0x100; if (BX_VGA_THIS s.CRTC.reg[0x07] & 0x40) BX_VGA_THIS s.vertical_display_end |= 0x200; BX_VGA_THIS s.line_compare &= 0x2ff; if (BX_VGA_THIS s.CRTC.reg[0x07] & 0x10) BX_VGA_THIS s.line_compare |= 0x100; needs_update = 1; break; case 0x08: // Vertical pel panning change needs_update = 1; break; case 0x09: BX_VGA_THIS s.y_doublescan = ((value & 0x9f) > 0); BX_VGA_THIS s.line_compare &= 0x1ff; if (BX_VGA_THIS s.CRTC.reg[0x09] & 0x40) BX_VGA_THIS s.line_compare |= 0x200; needs_update = 1; break; case 0x0A: case 0x0B: case 0x0E: case 0x0F: // Cursor size / location change BX_VGA_THIS s.vga_mem_updated = 1; break; case 0x0C: case 0x0D: // Start address change if (BX_VGA_THIS s.graphics_ctrl.graphics_alpha) { needs_update = 1; } else { BX_VGA_THIS s.vga_mem_updated = 1; } break; case 0x11: BX_VGA_THIS s.CRTC.write_protect = ((BX_VGA_THIS s.CRTC.reg[0x11] & 0x80) > 0); break; case 0x12: BX_VGA_THIS s.vertical_display_end &= 0x300; BX_VGA_THIS s.vertical_display_end |= BX_VGA_THIS s.CRTC.reg[0x12]; break; case 0x13: case 0x14: case 0x17: #if BX_SUPPORT_VBE if (!BX_VGA_THIS s.vbe_enabled || (BX_VGA_THIS s.vbe_bpp == VBE_DISPI_BPP_4)) #endif { // Line offset change BX_VGA_THIS s.line_offset = BX_VGA_THIS s.CRTC.reg[0x13] << 1; if (BX_VGA_THIS s.CRTC.reg[0x14] & 0x40) BX_VGA_THIS s.line_offset <<= 2; else if ((BX_VGA_THIS s.CRTC.reg[0x17] & 0x40) == 0) BX_VGA_THIS s.line_offset <<= 1; needs_update = 1; } break; case 0x18: BX_VGA_THIS s.line_compare &= 0x300; BX_VGA_THIS s.line_compare |= BX_VGA_THIS s.CRTC.reg[0x18]; needs_update = 1; break; } } break; case 0x03da: /* Feature Control (color emulation modes) */ BX_DEBUG(("io write: 3da: ignoring: feature ctrl & vert sync")); break; case 0x03c1: /* */ default: BX_ERROR(("unsupported io write to port 0x%04x, val=0x%02x", (unsigned) address, (unsigned) value)); } if (needs_update) { // Mark all video as updated so the changes will go through BX_VGA_THIS redraw_area(0, 0, old_iWidth, old_iHeight); } } Bit64s bx_vga_c::vga_param_handler(bx_param_c *param, int set, Bit64s val) { // handler for runtime parameter 'vga_update_interval' if (set) { BX_INFO (("Changing timer interval to %d", (Bit32u)val)); BX_VGA_THIS timer_handler (theVga); bx_pc_system.activate_timer (BX_VGA_THIS timer_id, (Bit32u)val, 1); } return val; } void bx_vga_c::trigger_timer(void *this_ptr) { timer_handler(this_ptr); } void bx_vga_c::timer_handler(void *this_ptr) { #if !BX_USE_VGA_SMF bx_vga_c *class_ptr = (bx_vga_c *) this_ptr; class_ptr->timer(); } void bx_vga_c::timer(void) { #else UNUSED(this_ptr); #endif update(); bx_gui->flush(); } void bx_vga_c::update(void) { unsigned iHeight, iWidth; /* no screen update necessary */ if ((BX_VGA_THIS s.vga_mem_updated==0) && BX_VGA_THIS s.graphics_ctrl.graphics_alpha) return; /* skip screen update when vga/video is disabled or the sequencer is in reset mode */ if (!BX_VGA_THIS s.vga_enabled || !BX_VGA_THIS s.attribute_ctrl.video_enabled || !BX_VGA_THIS s.sequencer.reset2 || !BX_VGA_THIS s.sequencer.reset1 || (BX_VGA_THIS s.sequencer.reg1 & 0x20)) return; /* skip screen update if the vertical retrace is in progress (using 72 Hz vertical frequency) */ if ((bx_pc_system.time_usec() % 13888) < 70) return; #if BX_SUPPORT_VBE if ((BX_VGA_THIS s.vbe_enabled) && (BX_VGA_THIS s.vbe_bpp != VBE_DISPI_BPP_4)) { // specific VBE code display update code unsigned pitch; unsigned xc, yc, xti, yti; unsigned r, c, w, h; int i; unsigned long red, green, blue, colour; Bit8u * vid_ptr, * vid_ptr2; Bit8u * tile_ptr, * tile_ptr2; bx_svga_tileinfo_t info; Bit8u dac_size = BX_VGA_THIS s.vbe_8bit_dac ? 8 : 6; iWidth=BX_VGA_THIS s.vbe_xres; iHeight=BX_VGA_THIS s.vbe_yres; pitch = BX_VGA_THIS s.line_offset; Bit8u *disp_ptr = &BX_VGA_THIS s.memory[BX_VGA_THIS s.vbe_virtual_start]; if (bx_gui->graphics_tile_info(&info)) { if (info.is_indexed) { switch (BX_VGA_THIS s.vbe_bpp) { case 4: case 15: case 16: case 24: case 32: BX_ERROR(("current guest pixel format is unsupported on indexed colour host displays")); break; case 8: for (yc=0, yti = 0; yc<iHeight; yc+=Y_TILESIZE, yti++) { for (xc=0, xti = 0; xc<iWidth; xc+=X_TILESIZE, xti++) { if (GET_TILE_UPDATED (xti, yti)) { vid_ptr = disp_ptr + (yc * pitch + xc); tile_ptr = bx_gui->graphics_tile_get(xc, yc, &w, &h); for (r=0; r<h; r++) { vid_ptr2 = vid_ptr; tile_ptr2 = tile_ptr; for (c=0; c<w; c++) { colour = 0; for (i=0; i<(int)BX_VGA_THIS s.vbe_bpp; i+=8) { colour |= *(vid_ptr2++) << i; } if (info.is_little_endian) { for (i=0; i<info.bpp; i+=8) { *(tile_ptr2++) = (Bit8u)(colour >> i); } } else { for (i=info.bpp-8; i>-8; i-=8) { *(tile_ptr2++) = (Bit8u)(colour >> i); } } } vid_ptr += pitch; tile_ptr += info.pitch; } bx_gui->graphics_tile_update_in_place(xc, yc, w, h); SET_TILE_UPDATED (xti, yti, 0); } } } break; } } else { switch (BX_VGA_THIS s.vbe_bpp) { case 4: BX_ERROR(("cannot draw 4bpp SVGA")); break; case 8: for (yc=0, yti = 0; yc<iHeight; yc+=Y_TILESIZE, yti++) { for (xc=0, xti = 0; xc<iWidth; xc+=X_TILESIZE, xti++) { if (GET_TILE_UPDATED (xti, yti)) { vid_ptr = disp_ptr + (yc * pitch + xc); tile_ptr = bx_gui->graphics_tile_get(xc, yc, &w, &h); for (r=0; r<h; r++) { vid_ptr2 = vid_ptr; tile_ptr2 = tile_ptr; for (c=0; c<w; c++) { colour = *(vid_ptr2++); colour = MAKE_COLOUR( BX_VGA_THIS s.pel.data[colour].red, dac_size, info.red_shift, info.red_mask, BX_VGA_THIS s.pel.data[colour].green, dac_size, info.green_shift, info.green_mask, BX_VGA_THIS s.pel.data[colour].blue, dac_size, info.blue_shift, info.blue_mask); if (info.is_little_endian) { for (i=0; i<info.bpp; i+=8) { *(tile_ptr2++) = (Bit8u)(colour >> i); } } else { for (i=info.bpp-8; i>-8; i-=8) { *(tile_ptr2++) = (Bit8u)(colour >> i); } } } vid_ptr += pitch; tile_ptr += info.pitch; } bx_gui->graphics_tile_update_in_place(xc, yc, w, h); SET_TILE_UPDATED (xti, yti, 0); } } } break; case 15: for (yc=0, yti = 0; yc<iHeight; yc+=Y_TILESIZE, yti++) { for (xc=0, xti = 0; xc<iWidth; xc+=X_TILESIZE, xti++) { if (GET_TILE_UPDATED (xti, yti)) { vid_ptr = disp_ptr + (yc * pitch + (xc<<1)); tile_ptr = bx_gui->graphics_tile_get(xc, yc, &w, &h); for (r=0; r<h; r++) { vid_ptr2 = vid_ptr; tile_ptr2 = tile_ptr; for (c=0; c<w; c++) { colour = *(vid_ptr2++); colour |= *(vid_ptr2++) << 8; colour = MAKE_COLOUR( colour & 0x001f, 5, info.blue_shift, info.blue_mask, colour & 0x03e0, 10, info.green_shift, info.green_mask, colour & 0x7c00, 15, info.red_shift, info.red_mask); if (info.is_little_endian) { for (i=0; i<info.bpp; i+=8) { *(tile_ptr2++) = (Bit8u)(colour >> i); } } else { for (i=info.bpp-8; i>-8; i-=8) { *(tile_ptr2++) = (Bit8u)(colour >> i); } } } vid_ptr += pitch; tile_ptr += info.pitch; } bx_gui->graphics_tile_update_in_place(xc, yc, w, h); SET_TILE_UPDATED (xti, yti, 0); } } } break; case 16: for (yc=0, yti = 0; yc<iHeight; yc+=Y_TILESIZE, yti++) { for (xc=0, xti = 0; xc<iWidth; xc+=X_TILESIZE, xti++) { if (GET_TILE_UPDATED (xti, yti)) { vid_ptr = disp_ptr + (yc * pitch + (xc<<1)); tile_ptr = bx_gui->graphics_tile_get(xc, yc, &w, &h); for (r=0; r<h; r++) { vid_ptr2 = vid_ptr; tile_ptr2 = tile_ptr; for (c=0; c<w; c++) { colour = *(vid_ptr2++); colour |= *(vid_ptr2++) << 8; colour = MAKE_COLOUR( colour & 0x001f, 5, info.blue_shift, info.blue_mask, colour & 0x07e0, 11, info.green_shift, info.green_mask, colour & 0xf800, 16, info.red_shift, info.red_mask); if (info.is_little_endian) { for (i=0; i<info.bpp; i+=8) { *(tile_ptr2++) = (Bit8u)(colour >> i); } } else { for (i=info.bpp-8; i>-8; i-=8) { *(tile_ptr2++) = (Bit8u)(colour >> i); } } } vid_ptr += pitch; tile_ptr += info.pitch; } bx_gui->graphics_tile_update_in_place(xc, yc, w, h); SET_TILE_UPDATED (xti, yti, 0); } } } break; case 24: for (yc=0, yti = 0; yc<iHeight; yc+=Y_TILESIZE, yti++) { for (xc=0, xti = 0; xc<iWidth; xc+=X_TILESIZE, xti++) { if (GET_TILE_UPDATED (xti, yti)) { vid_ptr = disp_ptr + (yc * pitch + 3*xc); tile_ptr = bx_gui->graphics_tile_get(xc, yc, &w, &h); for (r=0; r<h; r++) { vid_ptr2 = vid_ptr; tile_ptr2 = tile_ptr; for (c=0; c<w; c++) { blue = *(vid_ptr2++); green = *(vid_ptr2++); red = *(vid_ptr2++); colour = MAKE_COLOUR( red, 8, info.red_shift, info.red_mask, green, 8, info.green_shift, info.green_mask, blue, 8, info.blue_shift, info.blue_mask); if (info.is_little_endian) { for (i=0; i<info.bpp; i+=8) { *(tile_ptr2++) = (Bit8u)(colour >> i); } } else { for (i=info.bpp-8; i>-8; i-=8) { *(tile_ptr2++) = (Bit8u)(colour >> i); } } } vid_ptr += pitch; tile_ptr += info.pitch; } bx_gui->graphics_tile_update_in_place(xc, yc, w, h); SET_TILE_UPDATED (xti, yti, 0); } } } break; case 32: for (yc=0, yti = 0; yc<iHeight; yc+=Y_TILESIZE, yti++) { for (xc=0, xti = 0; xc<iWidth; xc+=X_TILESIZE, xti++) { if (GET_TILE_UPDATED (xti, yti)) { vid_ptr = disp_ptr + (yc * pitch + (xc<<2)); tile_ptr = bx_gui->graphics_tile_get(xc, yc, &w, &h); for (r=0; r<h; r++) { vid_ptr2 = vid_ptr; tile_ptr2 = tile_ptr; for (c=0; c<w; c++) { blue = *(vid_ptr2++); green = *(vid_ptr2++); red = *(vid_ptr2++); vid_ptr2++; colour = MAKE_COLOUR( red, 8, info.red_shift, info.red_mask, green, 8, info.green_shift, info.green_mask, blue, 8, info.blue_shift, info.blue_mask); if (info.is_little_endian) { for (i=0; i<info.bpp; i+=8) { *(tile_ptr2++) = (Bit8u)(colour >> i); } } else { for (i=info.bpp-8; i>-8; i-=8) { *(tile_ptr2++) = (Bit8u)(colour >> i); } } } vid_ptr += pitch; tile_ptr += info.pitch; } bx_gui->graphics_tile_update_in_place(xc, yc, w, h); SET_TILE_UPDATED (xti, yti, 0); } } } break; } } old_iWidth = iWidth; old_iHeight = iHeight; BX_VGA_THIS s.vga_mem_updated = 0; } else { BX_PANIC(("cannot get svga tile info")); } // after a vbe display update, don't try to do any 'normal vga' updates anymore return; } #endif // fields that effect the way video memory is serialized into screen output: // GRAPHICS CONTROLLER: // BX_VGA_THIS s.graphics_ctrl.shift_reg: // 0: output data in standard VGA format or CGA-compatible 640x200 2 color // graphics mode (mode 6) // 1: output data in CGA-compatible 320x200 4 color graphics mode // (modes 4 & 5) // 2: output data 8 bits at a time from the 4 bit planes // (mode 13 and variants like modeX) // if (BX_VGA_THIS s.vga_mem_updated==0 || BX_VGA_THIS s.attribute_ctrl.video_enabled == 0) if (BX_VGA_THIS s.graphics_ctrl.graphics_alpha) { Bit8u color; unsigned bit_no, r, c, x, y; unsigned long byte_offset, start_addr; unsigned xc, yc, xti, yti; start_addr = (BX_VGA_THIS s.CRTC.reg[0x0c] << 8) | BX_VGA_THIS s.CRTC.reg[0x0d]; //BX_DEBUG(("update: shiftreg=%u, chain4=%u, mapping=%u", // (unsigned) BX_VGA_THIS s.graphics_ctrl.shift_reg, // (unsigned) BX_VGA_THIS s.sequencer.chain_four, // (unsigned) BX_VGA_THIS s.graphics_ctrl.memory_mapping); determine_screen_dimensions(&iHeight, &iWidth); if((iWidth != old_iWidth) || (iHeight != old_iHeight) || (BX_VGA_THIS s.last_bpp > 8)) { bx_gui->dimension_update(iWidth, iHeight); old_iWidth = iWidth; old_iHeight = iHeight; BX_VGA_THIS s.last_bpp = 8; } switch (BX_VGA_THIS s.graphics_ctrl.shift_reg) { case 0: Bit8u attribute, palette_reg_val, DAC_regno; unsigned long line_compare; Bit8u *plane0, *plane1, *plane2, *plane3; if (BX_VGA_THIS s.graphics_ctrl.memory_mapping == 3) { // CGA 640x200x2 for (yc=0, yti=0; yc<iHeight; yc+=Y_TILESIZE, yti++) { for (xc=0, xti=0; xc<iWidth; xc+=X_TILESIZE, xti++) { if (GET_TILE_UPDATED (xti, yti)) { for (r=0; r<Y_TILESIZE; r++) { y = yc + r; if (BX_VGA_THIS s.y_doublescan) y >>= 1; for (c=0; c<X_TILESIZE; c++) { x = xc + c; /* 0 or 0x2000 */ byte_offset = start_addr + ((y & 1) << 13); /* to the start of the line */ byte_offset += (320 / 4) * (y / 2); /* to the byte start */ byte_offset += (x / 8); bit_no = 7 - (x % 8); palette_reg_val = (((BX_VGA_THIS s.memory[byte_offset]) >> bit_no) & 1); DAC_regno = BX_VGA_THIS s.attribute_ctrl.palette_reg[palette_reg_val]; BX_VGA_THIS s.tile[r*X_TILESIZE + c] = DAC_regno; } } SET_TILE_UPDATED (xti, yti, 0); bx_gui->graphics_tile_update(BX_VGA_THIS s.tile, xc, yc); } } } } else { // output data in serial fashion with each display plane // output on its associated serial output. Standard EGA/VGA format #if BX_SUPPORT_VBE if (BX_VGA_THIS s.vbe_enabled) { plane0 = &BX_VGA_THIS s.memory[0<<VBE_DISPI_4BPP_PLANE_SHIFT]; plane1 = &BX_VGA_THIS s.memory[1<<VBE_DISPI_4BPP_PLANE_SHIFT]; plane2 = &BX_VGA_THIS s.memory[2<<VBE_DISPI_4BPP_PLANE_SHIFT]; plane3 = &BX_VGA_THIS s.memory[3<<VBE_DISPI_4BPP_PLANE_SHIFT]; start_addr = BX_VGA_THIS s.vbe_virtual_start; line_compare = 0xffff; } else #endif { plane0 = &BX_VGA_THIS s.memory[0<<16]; plane1 = &BX_VGA_THIS s.memory[1<<16]; plane2 = &BX_VGA_THIS s.memory[2<<16]; plane3 = &BX_VGA_THIS s.memory[3<<16]; line_compare = BX_VGA_THIS s.line_compare; if (BX_VGA_THIS s.y_doublescan) line_compare >>= 1; } for (yc=0, yti=0; yc<iHeight; yc+=Y_TILESIZE, yti++) { for (xc=0, xti=0; xc<iWidth; xc+=X_TILESIZE, xti++) { if (GET_TILE_UPDATED (xti, yti)) { for (r=0; r<Y_TILESIZE; r++) { y = yc + r; if (BX_VGA_THIS s.y_doublescan) y >>= 1; for (c=0; c<X_TILESIZE; c++) { x = xc + c; if (BX_VGA_THIS s.x_dotclockdiv2) x >>= 1; bit_no = 7 - (x % 8); if (y > line_compare) { byte_offset = x / 8 + ((y - line_compare - 1) * BX_VGA_THIS s.line_offset); } else { byte_offset = start_addr + x / 8 + (y * BX_VGA_THIS s.line_offset); } attribute = (((plane0[byte_offset] >> bit_no) & 0x01) << 0) | (((plane1[byte_offset] >> bit_no) & 0x01) << 1) | (((plane2[byte_offset] >> bit_no) & 0x01) << 2) | (((plane3[byte_offset] >> bit_no) & 0x01) << 3); attribute &= BX_VGA_THIS s.attribute_ctrl.color_plane_enable; // undocumented feature ???: colors 0..7 high intensity, colors 8..15 blinking // using low/high intensity. Blinking is not implemented yet. if (BX_VGA_THIS s.attribute_ctrl.mode_ctrl.blink_intensity) attribute ^= 0x08; palette_reg_val = BX_VGA_THIS s.attribute_ctrl.palette_reg[attribute]; if (BX_VGA_THIS s.attribute_ctrl.mode_ctrl.internal_palette_size) { // use 4 lower bits from palette register // use 4 higher bits from color select register // 16 banks of 16-color registers DAC_regno = (palette_reg_val & 0x0f) | (BX_VGA_THIS s.attribute_ctrl.color_select << 4); } else { // use 6 lower bits from palette register // use 2 higher bits from color select register // 4 banks of 64-color registers DAC_regno = (palette_reg_val & 0x3f) | ((BX_VGA_THIS s.attribute_ctrl.color_select & 0x0c) << 4); } // DAC_regno &= video DAC mask register ??? BX_VGA_THIS s.tile[r*X_TILESIZE + c] = DAC_regno; } } SET_TILE_UPDATED (xti, yti, 0); bx_gui->graphics_tile_update(BX_VGA_THIS s.tile, xc, yc); } } } } break; // case 0 case 1: // output the data in a CGA-compatible 320x200 4 color graphics // mode. (modes 4 & 5) /* CGA 320x200x4 start */ for (yc=0, yti=0; yc<iHeight; yc+=Y_TILESIZE, yti++) { for (xc=0, xti=0; xc<iWidth; xc+=X_TILESIZE, xti++) { if (GET_TILE_UPDATED (xti, yti)) { for (r=0; r<Y_TILESIZE; r++) { y = yc + r; if (BX_VGA_THIS s.y_doublescan) y >>= 1; for (c=0; c<X_TILESIZE; c++) { x = xc + c; if (BX_VGA_THIS s.x_dotclockdiv2) x >>= 1; /* 0 or 0x2000 */ byte_offset = start_addr + ((y & 1) << 13); /* to the start of the line */ byte_offset += (320 / 4) * (y / 2); /* to the byte start */ byte_offset += (x / 4); attribute = 6 - 2*(x % 4); palette_reg_val = (BX_VGA_THIS s.memory[byte_offset]) >> attribute; palette_reg_val &= 3; DAC_regno = BX_VGA_THIS s.attribute_ctrl.palette_reg[palette_reg_val]; BX_VGA_THIS s.tile[r*X_TILESIZE + c] = DAC_regno; } } SET_TILE_UPDATED (xti, yti, 0); bx_gui->graphics_tile_update(BX_VGA_THIS s.tile, xc, yc); } } } /* CGA 320x200x4 end */ break; // case 1 case 2: // output the data eight bits at a time from the 4 bit plane // (format for VGA mode 13 hex) case 3: // FIXME: is this really the same ??? if (BX_VGA_THIS s.sequencer.chain_four) { unsigned long pixely, pixelx, plane; if (BX_VGA_THIS s.misc_output.select_high_bank != 1) BX_PANIC(("update: select_high_bank != 1")); for (yc=0, yti=0; yc<iHeight; yc+=Y_TILESIZE, yti++) { for (xc=0, xti=0; xc<iWidth; xc+=X_TILESIZE, xti++) { if (GET_TILE_UPDATED (xti, yti)) { for (r=0; r<Y_TILESIZE; r++) { pixely = yc + r; if (BX_VGA_THIS s.y_doublescan) pixely >>= 1; for (c=0; c<X_TILESIZE; c++) { pixelx = (xc + c) >> 1; plane = (pixelx % 4); byte_offset = start_addr + (plane * 65536) + (pixely * BX_VGA_THIS s.line_offset) + (pixelx & ~0x03); color = BX_VGA_THIS s.memory[byte_offset]; BX_VGA_THIS s.tile[r*X_TILESIZE + c] = color; } } SET_TILE_UPDATED (xti, yti, 0); bx_gui->graphics_tile_update(BX_VGA_THIS s.tile, xc, yc); } } } } else { // chain_four == 0, modeX unsigned long pixely, pixelx, plane; for (yc=0, yti=0; yc<iHeight; yc+=Y_TILESIZE, yti++) { for (xc=0, xti=0; xc<iWidth; xc+=X_TILESIZE, xti++) { if (GET_TILE_UPDATED (xti, yti)) { for (r=0; r<Y_TILESIZE; r++) { pixely = yc + r; if (BX_VGA_THIS s.y_doublescan) pixely >>= 1; for (c=0; c<X_TILESIZE; c++) { pixelx = (xc + c) >> 1; plane = (pixelx % 4); byte_offset = (plane * 65536) + (pixely * BX_VGA_THIS s.line_offset) + (pixelx >> 2); color = BX_VGA_THIS s.memory[start_addr + byte_offset]; BX_VGA_THIS s.tile[r*X_TILESIZE + c] = color; } } SET_TILE_UPDATED (xti, yti, 0); bx_gui->graphics_tile_update(BX_VGA_THIS s.tile, xc, yc); } } } } break; // case 2 default: BX_PANIC(("update: shift_reg == %u", (unsigned) BX_VGA_THIS s.graphics_ctrl.shift_reg)); } BX_VGA_THIS s.vga_mem_updated = 0; return; } else { // text mode unsigned long start_address; unsigned long cursor_address, cursor_x, cursor_y; bx_vga_tminfo_t tm_info; unsigned VDE, MSL, cols, rows, cWidth; static unsigned cs_counter = 1; static bx_bool cs_visible = 0; bx_bool cs_toggle = 0; cs_counter--; if ((BX_VGA_THIS s.vga_mem_updated==0) && (cs_counter > 0)) return; tm_info.start_address = 2*((BX_VGA_THIS s.CRTC.reg[12] << 8) + BX_VGA_THIS s.CRTC.reg[13]); tm_info.cs_start = BX_VGA_THIS s.CRTC.reg[0x0a] & 0x3f; if (cs_counter == 0) { cs_toggle = 1; cs_visible = !cs_visible; cs_counter = BX_VGA_THIS s.blink_counter; } if (!cs_visible) { tm_info.cs_start |= 0x20; } tm_info.cs_end = BX_VGA_THIS s.CRTC.reg[0x0b] & 0x1f; tm_info.line_offset = BX_VGA_THIS s.CRTC.reg[0x13] << 2; tm_info.line_compare = BX_VGA_THIS s.line_compare; tm_info.h_panning = BX_VGA_THIS s.attribute_ctrl.horiz_pel_panning & 0x0f; tm_info.v_panning = BX_VGA_THIS s.CRTC.reg[0x08] & 0x1f; tm_info.line_graphics = BX_VGA_THIS s.attribute_ctrl.mode_ctrl.enable_line_graphics; tm_info.split_hpanning = BX_VGA_THIS s.attribute_ctrl.mode_ctrl.pixel_panning_compat; tm_info.blink_flags = 0; if (BX_VGA_THIS s.attribute_ctrl.mode_ctrl.blink_intensity) { tm_info.blink_flags |= BX_TEXT_BLINK_MODE; if (cs_toggle) tm_info.blink_flags |= BX_TEXT_BLINK_TOGGLE; if (cs_visible) tm_info.blink_flags |= BX_TEXT_BLINK_STATE; } if ((BX_VGA_THIS s.sequencer.reg1 & 0x01) == 0) { if (tm_info.h_panning >= 8) tm_info.h_panning = 0; else tm_info.h_panning++; } else { tm_info.h_panning &= 0x07; } // Verticle Display End: find out how many lines are displayed VDE = BX_VGA_THIS s.vertical_display_end; // Maximum Scan Line: height of character cell MSL = BX_VGA_THIS s.CRTC.reg[0x09] & 0x1f; if (MSL == 0) { BX_ERROR(("character height = 1, skipping text update")); return; } cols = BX_VGA_THIS s.CRTC.reg[1] + 1; if ((MSL == 1) && (VDE == 399)) { // emulated CGA graphics mode 160x100x16 colors MSL = 3; } rows = (VDE+1)/(MSL+1); if (rows > BX_MAX_TEXT_LINES) { BX_PANIC(("text rows>%d: %d",BX_MAX_TEXT_LINES,rows)); return; } cWidth = ((BX_VGA_THIS s.sequencer.reg1 & 0x01) == 1) ? 8 : 9; iWidth = cWidth * cols; iHeight = VDE+1; if ((iWidth != old_iWidth) || (iHeight != old_iHeight) || (MSL != old_MSL) || (BX_VGA_THIS s.last_bpp > 8)) { bx_gui->dimension_update(iWidth, iHeight, MSL+1, cWidth); old_iWidth = iWidth; old_iHeight = iHeight; old_MSL = MSL; BX_VGA_THIS s.last_bpp = 8; } // pass old text snapshot & new VGA memory contents start_address = tm_info.start_address; cursor_address = 2*((BX_VGA_THIS s.CRTC.reg[0x0e] << 8) + BX_VGA_THIS s.CRTC.reg[0x0f]); if (cursor_address < start_address) { cursor_x = 0xffff; cursor_y = 0xffff; } else { cursor_x = ((cursor_address - start_address)/2) % (iWidth/cWidth); cursor_y = ((cursor_address - start_address)/2) / (iWidth/cWidth); } bx_gui->text_update(BX_VGA_THIS s.text_snapshot, &BX_VGA_THIS s.memory[start_address], cursor_x, cursor_y, tm_info); if (BX_VGA_THIS s.vga_mem_updated) { // screen updated, copy new VGA memory contents into text snapshot memcpy(BX_VGA_THIS s.text_snapshot, &BX_VGA_THIS s.memory[start_address], tm_info.line_offset*rows); BX_VGA_THIS s.vga_mem_updated = 0; } } } bx_bool bx_vga_c::mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param) { Bit8u *data_ptr; #ifdef BX_LITTLE_ENDIAN data_ptr = (Bit8u *) data; #else // BX_BIG_ENDIAN data_ptr = (Bit8u *) data + (len - 1); #endif for (unsigned i = 0; i < len; i++) { *data_ptr = theVga->mem_read(addr); addr++; #ifdef BX_LITTLE_ENDIAN data_ptr++; #else // BX_BIG_ENDIAN data_ptr--; #endif } return 1; } Bit8u bx_vga_c::mem_read(bx_phy_address addr) { Bit32u offset; Bit8u *plane0, *plane1, *plane2, *plane3; #if BX_SUPPORT_VBE // if in a vbe enabled mode, read from the vbe_memory if ((BX_VGA_THIS s.vbe_enabled) && (BX_VGA_THIS s.vbe_bpp != VBE_DISPI_BPP_4)) { return vbe_mem_read(addr); } else if (addr >= VBE_DISPI_LFB_PHYSICAL_ADDRESS) { return 0xff; } #endif #if defined(VGA_TRACE_FEATURE) // BX_DEBUG(("8-bit memory read from 0x%08x", addr)); #endif #ifdef __OS2__ #if BX_PLUGINS #error Fix the code for plugins #endif if (bx_options.videomode == BX_VIDEO_DIRECT) { char value; value = devices->mem->video[addr-0xA0000]; return value; } #endif switch (BX_VGA_THIS s.graphics_ctrl.memory_mapping) { case 1: // 0xA0000 .. 0xAFFFF if (addr > 0xAFFFF) return 0xff; offset = addr & 0xFFFF; break; case 2: // 0xB0000 .. 0xB7FFF if ((addr < 0xB0000) || (addr > 0xB7FFF)) return 0xff; offset = addr & 0x7FFF; break; case 3: // 0xB8000 .. 0xBFFFF if (addr < 0xB8000) return 0xff; offset = addr & 0x7FFF; break; default: // 0xA0000 .. 0xBFFFF offset = addr & 0x1FFFF; } if (BX_VGA_THIS s.sequencer.chain_four) { // Mode 13h: 320 x 200 256 color mode: chained pixel representation return BX_VGA_THIS s.memory[(offset & ~0x03) + (offset % 4)*65536]; } #if BX_SUPPORT_VBE if (BX_VGA_THIS s.vbe_enabled) { plane0 = &BX_VGA_THIS s.memory[(0<<VBE_DISPI_4BPP_PLANE_SHIFT) + (BX_VGA_THIS s.vbe_bank<<16)]; plane1 = &BX_VGA_THIS s.memory[(1<<VBE_DISPI_4BPP_PLANE_SHIFT) + (BX_VGA_THIS s.vbe_bank<<16)]; plane2 = &BX_VGA_THIS s.memory[(2<<VBE_DISPI_4BPP_PLANE_SHIFT) + (BX_VGA_THIS s.vbe_bank<<16)]; plane3 = &BX_VGA_THIS s.memory[(3<<VBE_DISPI_4BPP_PLANE_SHIFT) + (BX_VGA_THIS s.vbe_bank<<16)]; } else #endif { plane0 = &BX_VGA_THIS s.memory[0<<16]; plane1 = &BX_VGA_THIS s.memory[1<<16]; plane2 = &BX_VGA_THIS s.memory[2<<16]; plane3 = &BX_VGA_THIS s.memory[3<<16]; } /* addr between 0xA0000 and 0xAFFFF */ switch (BX_VGA_THIS s.graphics_ctrl.read_mode) { case 0: /* read mode 0 */ BX_VGA_THIS s.graphics_ctrl.latch[0] = plane0[offset]; BX_VGA_THIS s.graphics_ctrl.latch[1] = plane1[offset]; BX_VGA_THIS s.graphics_ctrl.latch[2] = plane2[offset]; BX_VGA_THIS s.graphics_ctrl.latch[3] = plane3[offset]; return(BX_VGA_THIS s.graphics_ctrl.latch[BX_VGA_THIS s.graphics_ctrl.read_map_select]); break; case 1: /* read mode 1 */ { Bit8u color_compare, color_dont_care; Bit8u latch0, latch1, latch2, latch3, retval; color_compare = BX_VGA_THIS s.graphics_ctrl.color_compare & 0x0f; color_dont_care = BX_VGA_THIS s.graphics_ctrl.color_dont_care & 0x0f; latch0 = BX_VGA_THIS s.graphics_ctrl.latch[0] = plane0[offset]; latch1 = BX_VGA_THIS s.graphics_ctrl.latch[1] = plane1[offset]; latch2 = BX_VGA_THIS s.graphics_ctrl.latch[2] = plane2[offset]; latch3 = BX_VGA_THIS s.graphics_ctrl.latch[3] = plane3[offset]; latch0 ^= ccdat[color_compare][0]; latch1 ^= ccdat[color_compare][1]; latch2 ^= ccdat[color_compare][2]; latch3 ^= ccdat[color_compare][3]; latch0 &= ccdat[color_dont_care][0]; latch1 &= ccdat[color_dont_care][1]; latch2 &= ccdat[color_dont_care][2]; latch3 &= ccdat[color_dont_care][3]; retval = ~(latch0 | latch1 | latch2 | latch3); return retval; } break; default: return 0; } } bx_bool bx_vga_c::mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param) { Bit8u *data_ptr; #ifdef BX_LITTLE_ENDIAN data_ptr = (Bit8u *) data; #else // BX_BIG_ENDIAN data_ptr = (Bit8u *) data + (len - 1); #endif for (unsigned i = 0; i < len; i++) { theVga->mem_write(addr, *data_ptr); addr++; #ifdef BX_LITTLE_ENDIAN data_ptr++; #else // BX_BIG_ENDIAN data_ptr--; #endif } return 1; } void bx_vga_c::mem_write(bx_phy_address addr, Bit8u value) { Bit32u offset; Bit8u new_val[4]; unsigned start_addr; Bit8u *plane0, *plane1, *plane2, *plane3; #if BX_SUPPORT_VBE // if in a vbe enabled mode, write to the vbe_memory if ((BX_VGA_THIS s.vbe_enabled) && (BX_VGA_THIS s.vbe_bpp != VBE_DISPI_BPP_4)) { vbe_mem_write(addr,value); return; } else if (addr >= VBE_DISPI_LFB_PHYSICAL_ADDRESS) { return; } #endif #if defined(VGA_TRACE_FEATURE) //BX_DEBUG(("8-bit memory write to %08x = %02x", addr, value)); #endif #ifdef __OS2__ #if BX_PLUGINS #error Fix the code for plugins #endif if (bx_options.videomode == BX_VIDEO_DIRECT) { devices->mem->video[addr-0xA0000] = value; return; } #endif switch (BX_VGA_THIS s.graphics_ctrl.memory_mapping) { case 1: // 0xA0000 .. 0xAFFFF if (addr > 0xAFFFF) return; offset = addr - 0xA0000; break; case 2: // 0xB0000 .. 0xB7FFF if ((addr < 0xB0000) || (addr > 0xB7FFF)) return; offset = addr - 0xB0000; break; case 3: // 0xB8000 .. 0xBFFFF if (addr < 0xB8000) return; offset = addr - 0xB8000; break; default: // 0xA0000 .. 0xBFFFF offset = addr - 0xA0000; } start_addr = (BX_VGA_THIS s.CRTC.reg[0x0c] << 8) | BX_VGA_THIS s.CRTC.reg[0x0d]; if (BX_VGA_THIS s.graphics_ctrl.graphics_alpha) { if (BX_VGA_THIS s.graphics_ctrl.memory_mapping == 3) { // 0xB8000 .. 0xBFFFF unsigned x_tileno, x_tileno2, y_tileno; /* CGA 320x200x4 / 640x200x2 start */ BX_VGA_THIS s.memory[offset] = value; offset -= start_addr; if (offset>=0x2000) { y_tileno = offset - 0x2000; y_tileno /= (320/4); y_tileno <<= 1; //2 * y_tileno; y_tileno++; x_tileno = (offset - 0x2000) % (320/4); x_tileno <<= 2; //*= 4; } else { y_tileno = offset / (320/4); y_tileno <<= 1; //2 * y_tileno; x_tileno = offset % (320/4); x_tileno <<= 2; //*=4; } x_tileno2=x_tileno; if (BX_VGA_THIS s.graphics_ctrl.shift_reg==0) { x_tileno*=2; x_tileno2+=7; } else { x_tileno2+=3; } if (BX_VGA_THIS s.x_dotclockdiv2) { x_tileno/=(X_TILESIZE/2); x_tileno2/=(X_TILESIZE/2); } else { x_tileno/=X_TILESIZE; x_tileno2/=X_TILESIZE; } if (BX_VGA_THIS s.y_doublescan) { y_tileno/=(Y_TILESIZE/2); } else { y_tileno/=Y_TILESIZE; } BX_VGA_THIS s.vga_mem_updated = 1; SET_TILE_UPDATED (x_tileno, y_tileno, 1); if (x_tileno2!=x_tileno) { SET_TILE_UPDATED (x_tileno2, y_tileno, 1); } return; /* CGA 320x200x4 / 640x200x2 end */ } else if (BX_VGA_THIS s.graphics_ctrl.memory_mapping != 1) { BX_PANIC(("mem_write: graphics: mapping = %u", (unsigned) BX_VGA_THIS s.graphics_ctrl.memory_mapping)); return; } if (BX_VGA_THIS s.sequencer.chain_four) { unsigned x_tileno, y_tileno; // 320 x 200 256 color mode: chained pixel representation BX_VGA_THIS s.memory[(offset & ~0x03) + (offset % 4)*65536] = value; if (BX_VGA_THIS s.line_offset > 0) { offset -= start_addr; x_tileno = (offset % BX_VGA_THIS s.line_offset) / (X_TILESIZE/2); if (BX_VGA_THIS s.y_doublescan) { y_tileno = (offset / BX_VGA_THIS s.line_offset) / (Y_TILESIZE/2); } else { y_tileno = (offset / BX_VGA_THIS s.line_offset) / Y_TILESIZE; } BX_VGA_THIS s.vga_mem_updated = 1; SET_TILE_UPDATED (x_tileno, y_tileno, 1); } return; } } /* addr between 0xA0000 and 0xAFFFF */ #if BX_SUPPORT_VBE if (BX_VGA_THIS s.vbe_enabled) { plane0 = &BX_VGA_THIS s.memory[(0<<VBE_DISPI_4BPP_PLANE_SHIFT) + (BX_VGA_THIS s.vbe_bank<<16)]; plane1 = &BX_VGA_THIS s.memory[(1<<VBE_DISPI_4BPP_PLANE_SHIFT) + (BX_VGA_THIS s.vbe_bank<<16)]; plane2 = &BX_VGA_THIS s.memory[(2<<VBE_DISPI_4BPP_PLANE_SHIFT) + (BX_VGA_THIS s.vbe_bank<<16)]; plane3 = &BX_VGA_THIS s.memory[(3<<VBE_DISPI_4BPP_PLANE_SHIFT) + (BX_VGA_THIS s.vbe_bank<<16)]; } else #endif { plane0 = &BX_VGA_THIS s.memory[0<<16]; plane1 = &BX_VGA_THIS s.memory[1<<16]; plane2 = &BX_VGA_THIS s.memory[2<<16]; plane3 = &BX_VGA_THIS s.memory[3<<16]; } switch (BX_VGA_THIS s.graphics_ctrl.write_mode) { unsigned i; case 0: /* write mode 0 */ { const Bit8u bitmask = BX_VGA_THIS s.graphics_ctrl.bitmask; const Bit8u set_reset = BX_VGA_THIS s.graphics_ctrl.set_reset; const Bit8u enable_set_reset = BX_VGA_THIS s.graphics_ctrl.enable_set_reset; /* perform rotate on CPU data in case its needed */ if (BX_VGA_THIS s.graphics_ctrl.data_rotate) { value = (value >> BX_VGA_THIS s.graphics_ctrl.data_rotate) | (value << (8 - BX_VGA_THIS s.graphics_ctrl.data_rotate)); } new_val[0] = BX_VGA_THIS s.graphics_ctrl.latch[0] & ~bitmask; new_val[1] = BX_VGA_THIS s.graphics_ctrl.latch[1] & ~bitmask; new_val[2] = BX_VGA_THIS s.graphics_ctrl.latch[2] & ~bitmask; new_val[3] = BX_VGA_THIS s.graphics_ctrl.latch[3] & ~bitmask; switch (BX_VGA_THIS s.graphics_ctrl.raster_op) { case 0: // replace new_val[0] |= ((enable_set_reset & 1) ? ((set_reset & 1) ? bitmask : 0) : (value & bitmask)); new_val[1] |= ((enable_set_reset & 2) ? ((set_reset & 2) ? bitmask : 0) : (value & bitmask)); new_val[2] |= ((enable_set_reset & 4) ? ((set_reset & 4) ? bitmask : 0) : (value & bitmask)); new_val[3] |= ((enable_set_reset & 8) ? ((set_reset & 8) ? bitmask : 0) : (value & bitmask)); break; case 1: // AND new_val[0] |= ((enable_set_reset & 1) ? ((set_reset & 1) ? (BX_VGA_THIS s.graphics_ctrl.latch[0] & bitmask) : 0) : (value & BX_VGA_THIS s.graphics_ctrl.latch[0]) & bitmask); new_val[1] |= ((enable_set_reset & 2) ? ((set_reset & 2) ? (BX_VGA_THIS s.graphics_ctrl.latch[1] & bitmask) : 0) : (value & BX_VGA_THIS s.graphics_ctrl.latch[1]) & bitmask); new_val[2] |= ((enable_set_reset & 4) ? ((set_reset & 4) ? (BX_VGA_THIS s.graphics_ctrl.latch[2] & bitmask) : 0) : (value & BX_VGA_THIS s.graphics_ctrl.latch[2]) & bitmask); new_val[3] |= ((enable_set_reset & 8) ? ((set_reset & 8) ? (BX_VGA_THIS s.graphics_ctrl.latch[3] & bitmask) : 0) : (value & BX_VGA_THIS s.graphics_ctrl.latch[3]) & bitmask); break; case 2: // OR new_val[0] |= ((enable_set_reset & 1) ? ((set_reset & 1) ? bitmask : (BX_VGA_THIS s.graphics_ctrl.latch[0] & bitmask)) : ((value | BX_VGA_THIS s.graphics_ctrl.latch[0]) & bitmask)); new_val[1] |= ((enable_set_reset & 2) ? ((set_reset & 2) ? bitmask : (BX_VGA_THIS s.graphics_ctrl.latch[1] & bitmask)) : ((value | BX_VGA_THIS s.graphics_ctrl.latch[1]) & bitmask)); new_val[2] |= ((enable_set_reset & 4) ? ((set_reset & 4) ? bitmask : (BX_VGA_THIS s.graphics_ctrl.latch[2] & bitmask)) : ((value | BX_VGA_THIS s.graphics_ctrl.latch[2]) & bitmask)); new_val[3] |= ((enable_set_reset & 8) ? ((set_reset & 8) ? bitmask : (BX_VGA_THIS s.graphics_ctrl.latch[3] & bitmask)) : ((value | BX_VGA_THIS s.graphics_ctrl.latch[3]) & bitmask)); break; case 3: // XOR new_val[0] |= ((enable_set_reset & 1) ? ((set_reset & 1) ? (~BX_VGA_THIS s.graphics_ctrl.latch[0] & bitmask) : (BX_VGA_THIS s.graphics_ctrl.latch[0] & bitmask)) : (value ^ BX_VGA_THIS s.graphics_ctrl.latch[0]) & bitmask); new_val[1] |= ((enable_set_reset & 2) ? ((set_reset & 2) ? (~BX_VGA_THIS s.graphics_ctrl.latch[1] & bitmask) : (BX_VGA_THIS s.graphics_ctrl.latch[1] & bitmask)) : (value ^ BX_VGA_THIS s.graphics_ctrl.latch[1]) & bitmask); new_val[2] |= ((enable_set_reset & 4) ? ((set_reset & 4) ? (~BX_VGA_THIS s.graphics_ctrl.latch[2] & bitmask) : (BX_VGA_THIS s.graphics_ctrl.latch[2] & bitmask)) : (value ^ BX_VGA_THIS s.graphics_ctrl.latch[2]) & bitmask); new_val[3] |= ((enable_set_reset & 8) ? ((set_reset & 8) ? (~BX_VGA_THIS s.graphics_ctrl.latch[3] & bitmask) : (BX_VGA_THIS s.graphics_ctrl.latch[3] & bitmask)) : (value ^ BX_VGA_THIS s.graphics_ctrl.latch[3]) & bitmask); break; default: BX_PANIC(("vga_mem_write: write mode 0: op = %u", (unsigned) BX_VGA_THIS s.graphics_ctrl.raster_op)); } } break; case 1: /* write mode 1 */ for (i=0; i<4; i++) { new_val[i] = BX_VGA_THIS s.graphics_ctrl.latch[i]; } break; case 2: /* write mode 2 */ { const Bit8u bitmask = BX_VGA_THIS s.graphics_ctrl.bitmask; new_val[0] = BX_VGA_THIS s.graphics_ctrl.latch[0] & ~bitmask; new_val[1] = BX_VGA_THIS s.graphics_ctrl.latch[1] & ~bitmask; new_val[2] = BX_VGA_THIS s.graphics_ctrl.latch[2] & ~bitmask; new_val[3] = BX_VGA_THIS s.graphics_ctrl.latch[3] & ~bitmask; switch (BX_VGA_THIS s.graphics_ctrl.raster_op) { case 0: // write new_val[0] |= (value & 1) ? bitmask : 0; new_val[1] |= (value & 2) ? bitmask : 0; new_val[2] |= (value & 4) ? bitmask : 0; new_val[3] |= (value & 8) ? bitmask : 0; break; case 1: // AND new_val[0] |= (value & 1) ? (BX_VGA_THIS s.graphics_ctrl.latch[0] & bitmask) : 0; new_val[1] |= (value & 2) ? (BX_VGA_THIS s.graphics_ctrl.latch[1] & bitmask) : 0; new_val[2] |= (value & 4) ? (BX_VGA_THIS s.graphics_ctrl.latch[2] & bitmask) : 0; new_val[3] |= (value & 8) ? (BX_VGA_THIS s.graphics_ctrl.latch[3] & bitmask) : 0; break; case 2: // OR new_val[0] |= (value & 1) ? bitmask : (BX_VGA_THIS s.graphics_ctrl.latch[0] & bitmask); new_val[1] |= (value & 2) ? bitmask : (BX_VGA_THIS s.graphics_ctrl.latch[1] & bitmask); new_val[2] |= (value & 4) ? bitmask : (BX_VGA_THIS s.graphics_ctrl.latch[2] & bitmask); new_val[3] |= (value & 8) ? bitmask : (BX_VGA_THIS s.graphics_ctrl.latch[3] & bitmask); break; case 3: // XOR new_val[0] |= (value & 1) ? (~BX_VGA_THIS s.graphics_ctrl.latch[0] & bitmask) : (BX_VGA_THIS s.graphics_ctrl.latch[0] & bitmask); new_val[1] |= (value & 2) ? (~BX_VGA_THIS s.graphics_ctrl.latch[1] & bitmask) : (BX_VGA_THIS s.graphics_ctrl.latch[1] & bitmask); new_val[2] |= (value & 4) ? (~BX_VGA_THIS s.graphics_ctrl.latch[2] & bitmask) : (BX_VGA_THIS s.graphics_ctrl.latch[2] & bitmask); new_val[3] |= (value & 8) ? (~BX_VGA_THIS s.graphics_ctrl.latch[3] & bitmask) : (BX_VGA_THIS s.graphics_ctrl.latch[3] & bitmask); break; } } break; case 3: /* write mode 3 */ { const Bit8u bitmask = BX_VGA_THIS s.graphics_ctrl.bitmask & value; const Bit8u set_reset = BX_VGA_THIS s.graphics_ctrl.set_reset; /* perform rotate on CPU data */ if (BX_VGA_THIS s.graphics_ctrl.data_rotate) { value = (value >> BX_VGA_THIS s.graphics_ctrl.data_rotate) | (value << (8 - BX_VGA_THIS s.graphics_ctrl.data_rotate)); } new_val[0] = BX_VGA_THIS s.graphics_ctrl.latch[0] & ~bitmask; new_val[1] = BX_VGA_THIS s.graphics_ctrl.latch[1] & ~bitmask; new_val[2] = BX_VGA_THIS s.graphics_ctrl.latch[2] & ~bitmask; new_val[3] = BX_VGA_THIS s.graphics_ctrl.latch[3] & ~bitmask; value &= bitmask; switch (BX_VGA_THIS s.graphics_ctrl.raster_op) { case 0: // write new_val[0] |= (set_reset & 1) ? value : 0; new_val[1] |= (set_reset & 2) ? value : 0; new_val[2] |= (set_reset & 4) ? value : 0; new_val[3] |= (set_reset & 8) ? value : 0; break; case 1: // AND new_val[0] |= ((set_reset & 1) ? value : 0) & BX_VGA_THIS s.graphics_ctrl.latch[0]; new_val[1] |= ((set_reset & 2) ? value : 0) & BX_VGA_THIS s.graphics_ctrl.latch[1]; new_val[2] |= ((set_reset & 4) ? value : 0) & BX_VGA_THIS s.graphics_ctrl.latch[2]; new_val[3] |= ((set_reset & 8) ? value : 0) & BX_VGA_THIS s.graphics_ctrl.latch[3]; break; case 2: // OR new_val[0] |= ((set_reset & 1) ? value : 0) | BX_VGA_THIS s.graphics_ctrl.latch[0]; new_val[1] |= ((set_reset & 2) ? value : 0) | BX_VGA_THIS s.graphics_ctrl.latch[1]; new_val[2] |= ((set_reset & 4) ? value : 0) | BX_VGA_THIS s.graphics_ctrl.latch[2]; new_val[3] |= ((set_reset & 8) ? value : 0) | BX_VGA_THIS s.graphics_ctrl.latch[3]; break; case 3: // XOR new_val[0] |= ((set_reset & 1) ? value : 0) ^ BX_VGA_THIS s.graphics_ctrl.latch[0]; new_val[1] |= ((set_reset & 2) ? value : 0) ^ BX_VGA_THIS s.graphics_ctrl.latch[1]; new_val[2] |= ((set_reset & 4) ? value : 0) ^ BX_VGA_THIS s.graphics_ctrl.latch[2]; new_val[3] |= ((set_reset & 8) ? value : 0) ^ BX_VGA_THIS s.graphics_ctrl.latch[3]; break; } } break; default: BX_PANIC(("vga_mem_write: write mode %u ?", (unsigned) BX_VGA_THIS s.graphics_ctrl.write_mode)); } if (BX_VGA_THIS s.sequencer.map_mask & 0x0f) { BX_VGA_THIS s.vga_mem_updated = 1; if (BX_VGA_THIS s.sequencer.map_mask & 0x01) plane0[offset] = new_val[0]; if (BX_VGA_THIS s.sequencer.map_mask & 0x02) plane1[offset] = new_val[1]; if (BX_VGA_THIS s.sequencer.map_mask & 0x04) { if ((offset & 0xe000) == BX_VGA_THIS s.charmap_address) { bx_gui->set_text_charbyte((offset & 0x1fff), new_val[2]); } plane2[offset] = new_val[2]; } if (BX_VGA_THIS s.sequencer.map_mask & 0x08) plane3[offset] = new_val[3]; unsigned x_tileno, y_tileno; if (BX_VGA_THIS s.graphics_ctrl.shift_reg == 2) { offset -= start_addr; x_tileno = (offset % BX_VGA_THIS s.line_offset) * 4 / (X_TILESIZE / 2); if (BX_VGA_THIS s.y_doublescan) { y_tileno = (offset / BX_VGA_THIS s.line_offset) / (Y_TILESIZE / 2); } else { y_tileno = (offset / BX_VGA_THIS s.line_offset) / Y_TILESIZE; } SET_TILE_UPDATED (x_tileno, y_tileno, 1); } else { if (BX_VGA_THIS s.line_compare < BX_VGA_THIS s.vertical_display_end) { if (BX_VGA_THIS s.line_offset > 0) { if (BX_VGA_THIS s.x_dotclockdiv2) { x_tileno = (offset % BX_VGA_THIS s.line_offset) / (X_TILESIZE / 16); } else { x_tileno = (offset % BX_VGA_THIS s.line_offset) / (X_TILESIZE / 8); } if (BX_VGA_THIS s.y_doublescan) { y_tileno = ((offset / BX_VGA_THIS s.line_offset) * 2 + BX_VGA_THIS s.line_compare + 1) / Y_TILESIZE; } else { y_tileno = ((offset / BX_VGA_THIS s.line_offset) + BX_VGA_THIS s.line_compare + 1) / Y_TILESIZE; } SET_TILE_UPDATED (x_tileno, y_tileno, 1); } } if (offset >= start_addr) { offset -= start_addr; if (BX_VGA_THIS s.line_offset > 0) { if (BX_VGA_THIS s.x_dotclockdiv2) { x_tileno = (offset % BX_VGA_THIS s.line_offset) / (X_TILESIZE / 16); } else { x_tileno = (offset % BX_VGA_THIS s.line_offset) / (X_TILESIZE / 8); } if (BX_VGA_THIS s.y_doublescan) { y_tileno = (offset / BX_VGA_THIS s.line_offset) / (Y_TILESIZE / 2); } else { y_tileno = (offset / BX_VGA_THIS s.line_offset) / Y_TILESIZE; } SET_TILE_UPDATED (x_tileno, y_tileno, 1); } } } } } void bx_vga_c::get_text_snapshot(Bit8u **text_snapshot, unsigned *txHeight, unsigned *txWidth) { unsigned VDE, MSL; if (!BX_VGA_THIS s.graphics_ctrl.graphics_alpha) { *text_snapshot = &BX_VGA_THIS s.text_snapshot[0]; VDE = BX_VGA_THIS s.vertical_display_end; MSL = BX_VGA_THIS s.CRTC.reg[0x09] & 0x1f; *txHeight = (VDE+1)/(MSL+1); *txWidth = BX_VGA_THIS s.CRTC.reg[1] + 1; } else { *txHeight = 0; *txWidth = 0; } } Bit8u bx_vga_c::get_actl_palette_idx(Bit8u index) { return BX_VGA_THIS s.attribute_ctrl.palette_reg[index]; } void bx_vga_c::dump_status(void) { #if BX_DEBUGGER dbg_printf("s.misc_output.color_emulation = %u\n", (unsigned) BX_VGA_THIS s.misc_output.color_emulation); dbg_printf("s.misc_output.enable_ram = %u\n", (unsigned) BX_VGA_THIS s.misc_output.enable_ram); dbg_printf("s.misc_output.clock_select = %u ", (unsigned) BX_VGA_THIS s.misc_output.clock_select); if (BX_VGA_THIS s.misc_output.clock_select == 0) dbg_printf("(25Mhz 640 horiz pixel clock)\n"); else dbg_printf("(28Mhz 720 horiz pixel clock)\n"); dbg_printf("s.misc_output.select_high_bank = %u\n", (unsigned) BX_VGA_THIS s.misc_output.select_high_bank); dbg_printf("s.misc_output.horiz_sync_pol = %u\n", (unsigned) BX_VGA_THIS s.misc_output.horiz_sync_pol); dbg_printf("s.misc_output.vert_sync_pol = %u ", (unsigned) BX_VGA_THIS s.misc_output.vert_sync_pol); switch ((BX_VGA_THIS s.misc_output.vert_sync_pol << 1) | BX_VGA_THIS s.misc_output.horiz_sync_pol) { case 1: dbg_printf("(400 lines)\n"); break; case 2: dbg_printf("(350 lines)\n"); break; case 3: dbg_printf("(480 lines)\n"); break; default: dbg_printf("(reserved)\n"); } dbg_printf("s.graphics_ctrl.odd_even = %u\n", (unsigned) BX_VGA_THIS s.graphics_ctrl.odd_even); dbg_printf("s.graphics_ctrl.chain_odd_even = %u\n", (unsigned) BX_VGA_THIS s.graphics_ctrl.chain_odd_even); dbg_printf("s.graphics_ctrl.shift_reg = %u\n", (unsigned) BX_VGA_THIS s.graphics_ctrl.shift_reg); dbg_printf("s.graphics_ctrl.graphics_alpha = %u\n", (unsigned) BX_VGA_THIS s.graphics_ctrl.graphics_alpha); dbg_printf("s.graphics_ctrl.memory_mapping = %u ", (unsigned) BX_VGA_THIS s.graphics_ctrl.memory_mapping); switch (BX_VGA_THIS s.graphics_ctrl.memory_mapping) { case 1: dbg_printf("(A0000-AFFFF)\n"); break; case 2: dbg_printf("(B0000-B7FFF)\n"); break; case 3: dbg_printf("(B8000-BFFFF)\n"); break; default: dbg_printf("(A0000-BFFFF)\n"); break; } dbg_printf("s.sequencer.extended_mem = %u\n", (unsigned) BX_VGA_THIS s.sequencer.extended_mem); dbg_printf("s.sequencer.odd_even = %u (inverted)\n", (unsigned) BX_VGA_THIS s.sequencer.odd_even); dbg_printf("s.sequencer.chain_four = %u\n", (unsigned) BX_VGA_THIS s.sequencer.chain_four); dbg_printf("s.attribute_ctrl.video_enabled = %u\n", (unsigned) BX_VGA_THIS s.attribute_ctrl.video_enabled); dbg_printf("s.attribute_ctrl.mode_ctrl.graphics_alpha = %u\n", (unsigned) BX_VGA_THIS s.attribute_ctrl.mode_ctrl.graphics_alpha); dbg_printf("s.attribute_ctrl.mode_ctrl.display_type = %u\n", (unsigned) BX_VGA_THIS s.attribute_ctrl.mode_ctrl.display_type); dbg_printf("s.attribute_ctrl.mode_ctrl.internal_palette_size = %u\n", (unsigned) BX_VGA_THIS s.attribute_ctrl.mode_ctrl.internal_palette_size); dbg_printf("s.attribute_ctrl.mode_ctrl.pixel_clock_select = %u\n", (unsigned) BX_VGA_THIS s.attribute_ctrl.mode_ctrl.pixel_clock_select); #endif } void bx_vga_c::redraw_area(unsigned x0, unsigned y0, unsigned width, unsigned height) { unsigned xti, yti, xt0, xt1, yt0, yt1, xmax, ymax; if ((width == 0) || (height == 0)) { return; } BX_VGA_THIS s.vga_mem_updated = 1; #if BX_SUPPORT_VBE if (BX_VGA_THIS s.graphics_ctrl.graphics_alpha || BX_VGA_THIS s.vbe_enabled) { #else if (BX_VGA_THIS s.graphics_ctrl.graphics_alpha) { #endif // graphics mode xmax = old_iWidth; ymax = old_iHeight; #if BX_SUPPORT_VBE if (BX_VGA_THIS s.vbe_enabled) { xmax = BX_VGA_THIS s.vbe_xres; ymax = BX_VGA_THIS s.vbe_yres; } #endif xt0 = x0 / X_TILESIZE; yt0 = y0 / Y_TILESIZE; if (x0 < xmax) { xt1 = (x0 + width - 1) / X_TILESIZE; } else { xt1 = (xmax - 1) / X_TILESIZE; } if (y0 < ymax) { yt1 = (y0 + height - 1) / Y_TILESIZE; } else { yt1 = (ymax - 1) / Y_TILESIZE; } for (yti=yt0; yti<=yt1; yti++) { for (xti=xt0; xti<=xt1; xti++) { SET_TILE_UPDATED (xti, yti, 1); } } } else { // text mode memset(BX_VGA_THIS s.text_snapshot, 0, sizeof(BX_VGA_THIS s.text_snapshot)); } } #if BX_SUPPORT_VBE Bit8u BX_CPP_AttrRegparmN(1) bx_vga_c::vbe_mem_read(bx_phy_address addr) { Bit32u offset; if (addr >= VBE_DISPI_LFB_PHYSICAL_ADDRESS) { // LFB read offset = addr - VBE_DISPI_LFB_PHYSICAL_ADDRESS; } else { // banked mode read offset = BX_VGA_THIS s.vbe_bank*65536 + addr - 0xA0000; } // check for out of memory read if (offset > VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES) return 0; return (BX_VGA_THIS s.memory[offset]); } void BX_CPP_AttrRegparmN(2) bx_vga_c::vbe_mem_write(bx_phy_address addr, Bit8u value) { Bit32u offset; unsigned x_tileno, y_tileno; if (BX_VGA_THIS s.vbe_lfb_enabled) { if (addr >= VBE_DISPI_LFB_PHYSICAL_ADDRESS) { // LFB write offset = addr - VBE_DISPI_LFB_PHYSICAL_ADDRESS; } else { // banked mode write while in LFB mode -> ignore return; } } else { if (addr < VBE_DISPI_LFB_PHYSICAL_ADDRESS) { // banked mode write offset = (BX_VGA_THIS s.vbe_bank*65536) + (addr - 0xA0000); } else { // LFB write while in banked mode -> ignore return; } } // check for out of memory write if (offset < VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES) { BX_VGA_THIS s.memory[offset]=value; } else { // make sure we don't flood the logfile static int count=0; if (count<100) { count ++; BX_INFO(("VBE_mem_write out of video memory write at %x",offset)); } } offset-=BX_VGA_THIS s.vbe_virtual_start; // only update the UI when writing 'onscreen' if (offset < BX_VGA_THIS s.vbe_visible_screen_size) { y_tileno = ((offset / BX_VGA_THIS s.vbe_bpp_multiplier) / BX_VGA_THIS s.vbe_virtual_xres) / Y_TILESIZE; x_tileno = ((offset / BX_VGA_THIS s.vbe_bpp_multiplier) % BX_VGA_THIS s.vbe_virtual_xres) / X_TILESIZE; if ((y_tileno < BX_NUM_Y_TILES) && (x_tileno < BX_NUM_X_TILES)) { BX_VGA_THIS s.vga_mem_updated = 1; SET_TILE_UPDATED (x_tileno, y_tileno, 1); } } } Bit32u bx_vga_c::vbe_read_handler(void *this_ptr, Bit32u address, unsigned io_len) { #if !BX_USE_VGA_SMF bx_vga_c *class_ptr = (bx_vga_c *) this_ptr; return class_ptr->vbe_read(address, io_len); } Bit32u bx_vga_c::vbe_read(Bit32u address, unsigned io_len) { #else UNUSED(this_ptr); #endif // !BX_USE_VGA_SMF Bit16u retval; // BX_INFO(("VBE_read %x (len %x)", address, io_len)); if ((address==VBE_DISPI_IOPORT_INDEX) || (address==VBE_DISPI_IOPORT_INDEX_OLD)) { // index register return (Bit32u) BX_VGA_THIS s.vbe_curindex; } else { // data register read switch (BX_VGA_THIS s.vbe_curindex) { case VBE_DISPI_INDEX_ID: // Display Interface ID check return BX_VGA_THIS s.vbe_cur_dispi; case VBE_DISPI_INDEX_XRES: // x resolution if (BX_VGA_THIS s.vbe_get_capabilities) { return BX_VGA_THIS s.vbe_max_xres; } else { return BX_VGA_THIS s.vbe_xres; } case VBE_DISPI_INDEX_YRES: // y resolution if (BX_VGA_THIS s.vbe_get_capabilities) { return BX_VGA_THIS s.vbe_max_yres; } else { return BX_VGA_THIS s.vbe_yres; } case VBE_DISPI_INDEX_BPP: // bpp if (BX_VGA_THIS s.vbe_get_capabilities) { return BX_VGA_THIS s.vbe_max_bpp; } else { return BX_VGA_THIS s.vbe_bpp; } case VBE_DISPI_INDEX_ENABLE: // vbe enabled retval = BX_VGA_THIS s.vbe_enabled; if (BX_VGA_THIS s.vbe_get_capabilities) retval |= VBE_DISPI_GETCAPS; if (BX_VGA_THIS s.vbe_8bit_dac) retval |= VBE_DISPI_8BIT_DAC; return retval; case VBE_DISPI_INDEX_BANK: // current bank return BX_VGA_THIS s.vbe_bank; case VBE_DISPI_INDEX_X_OFFSET: return BX_VGA_THIS s.vbe_offset_x; case VBE_DISPI_INDEX_Y_OFFSET: return BX_VGA_THIS s.vbe_offset_y; case VBE_DISPI_INDEX_VIRT_WIDTH: return BX_VGA_THIS s.vbe_virtual_xres; case VBE_DISPI_INDEX_VIRT_HEIGHT: return BX_VGA_THIS s.vbe_virtual_yres; default: BX_PANIC(("VBE unknown data read index 0x%x",BX_VGA_THIS s.vbe_curindex)); break; } } BX_PANIC(("VBE_read shouldn't reach this")); return 0; /* keep compiler happy */ } void bx_vga_c::vbe_write_handler(void *this_ptr, Bit32u address, Bit32u value, unsigned io_len) { #if !BX_USE_VGA_SMF bx_vga_c *class_ptr = (bx_vga_c *) this_ptr; class_ptr->vbe_write(address, value, io_len); } Bit32u bx_vga_c::vbe_write(Bit32u address, Bit32u value, unsigned io_len) { #else UNUSED(this_ptr); #endif bx_bool new_vbe_8bit_dac; bx_bool needs_update = 0; unsigned i; // BX_INFO(("VBE_write %x = %x (len %x)", address, value, io_len)); switch(address) { // index register case VBE_DISPI_IOPORT_INDEX: // legacy index register case VBE_DISPI_IOPORT_INDEX_OLD: BX_VGA_THIS s.vbe_curindex = (Bit16u) value; break; // data register // FIXME: maybe do some 'sanity' checks on received data? case VBE_DISPI_IOPORT_DATA: // legacy data register case VBE_DISPI_IOPORT_DATA_OLD: switch (BX_VGA_THIS s.vbe_curindex) { case VBE_DISPI_INDEX_ID: // Display Interface ID check { if ((value == VBE_DISPI_ID0) || (value == VBE_DISPI_ID1) || (value == VBE_DISPI_ID2) || (value == VBE_DISPI_ID3) || (value == VBE_DISPI_ID4)) { // allow backwards compatible with previous dispi bioses BX_VGA_THIS s.vbe_cur_dispi=value; } else { BX_PANIC(("VBE unknown Display Interface %x",value)); } // make sure we don't flood the logfile static int count=0; if (count < 100) { count++; BX_INFO(("VBE known Display Interface %x",value)); } } break; case VBE_DISPI_INDEX_XRES: // set xres { // check that we don't set xres during vbe enabled if (!BX_VGA_THIS s.vbe_enabled) { // check for within max xres range if (value <= VBE_DISPI_MAX_XRES) { BX_VGA_THIS s.vbe_xres=(Bit16u) value; BX_INFO(("VBE set xres (%d)",value)); } else { BX_INFO(("VBE set xres more then max xres (%d)",value)); } } else { BX_INFO(("VBE set xres during vbe enabled!")); } } break; case VBE_DISPI_INDEX_YRES: // set yres { // check that we don't set yres during vbe enabled if (!BX_VGA_THIS s.vbe_enabled) { // check for within max yres range if (value <= VBE_DISPI_MAX_YRES) { BX_VGA_THIS s.vbe_yres=(Bit16u) value; BX_INFO(("VBE set yres (%d)",value)); } else { BX_INFO(("VBE set yres more then max yres (%d)",value)); } } else { BX_INFO(("VBE set yres during vbe enabled!")); } } break; case VBE_DISPI_INDEX_BPP: // set bpp { // check that we don't set bpp during vbe enabled if (!BX_VGA_THIS s.vbe_enabled) { // for backward compatiblity if (value == 0) value = VBE_DISPI_BPP_8; // check for correct bpp range if ((value == VBE_DISPI_BPP_4) || (value == VBE_DISPI_BPP_8) || (value == VBE_DISPI_BPP_15) || (value == VBE_DISPI_BPP_16) || (value == VBE_DISPI_BPP_24) || (value == VBE_DISPI_BPP_32)) { BX_VGA_THIS s.vbe_bpp=(Bit16u) value; BX_INFO(("VBE set bpp (%d)",value)); } else { BX_INFO(("VBE set bpp with unknown bpp (%d)",value)); } } else { BX_INFO(("VBE set bpp during vbe enabled!")); } } break; case VBE_DISPI_INDEX_BANK: // set bank { value=value & 0xff ; // FIXME lobyte = vbe bank A? unsigned divider = (BX_VGA_THIS s.vbe_bpp!=VBE_DISPI_BPP_4)?64:256; // check for max bank nr if (value < (VBE_DISPI_TOTAL_VIDEO_MEMORY_KB / divider)) { if (!BX_VGA_THIS s.vbe_lfb_enabled) { BX_DEBUG(("VBE set bank to %d", value)); BX_VGA_THIS s.vbe_bank=value; } else { BX_ERROR(("VBE set bank in LFB mode ignored")); } } else { BX_INFO(("VBE set invalid bank (%d)",value)); } } break; case VBE_DISPI_INDEX_ENABLE: // enable video { if ((value & VBE_DISPI_ENABLED) && !BX_VGA_THIS s.vbe_enabled) { unsigned depth=0; // setup virtual resolution to be the same as current reso BX_VGA_THIS s.vbe_virtual_yres=BX_VGA_THIS s.vbe_yres; BX_VGA_THIS s.vbe_virtual_xres=BX_VGA_THIS s.vbe_xres; // reset offset BX_VGA_THIS s.vbe_offset_x=0; BX_VGA_THIS s.vbe_offset_y=0; BX_VGA_THIS s.vbe_virtual_start=0; switch((BX_VGA_THIS s.vbe_bpp)) { // Default pixel sizes case VBE_DISPI_BPP_8: BX_VGA_THIS s.vbe_bpp_multiplier = 1; BX_VGA_THIS s.line_offset = BX_VGA_THIS s.vbe_virtual_xres; depth=8; break; case VBE_DISPI_BPP_4: BX_VGA_THIS s.vbe_bpp_multiplier = 1; BX_VGA_THIS s.line_offset = (BX_VGA_THIS s.vbe_virtual_xres >> 3); depth=4; break; case VBE_DISPI_BPP_15: BX_VGA_THIS s.vbe_bpp_multiplier = 2; BX_VGA_THIS s.line_offset = BX_VGA_THIS s.vbe_virtual_xres * 2; depth=15; break; case VBE_DISPI_BPP_16: BX_VGA_THIS s.vbe_bpp_multiplier = 2; BX_VGA_THIS s.line_offset = BX_VGA_THIS s.vbe_virtual_xres * 2; depth=16; break; case VBE_DISPI_BPP_24: BX_VGA_THIS s.vbe_bpp_multiplier = 3; BX_VGA_THIS s.line_offset = BX_VGA_THIS s.vbe_virtual_xres * 3; depth=24; break; case VBE_DISPI_BPP_32: BX_VGA_THIS s.vbe_bpp_multiplier = 4; BX_VGA_THIS s.line_offset = BX_VGA_THIS s.vbe_virtual_xres << 2; depth=32; break; } BX_VGA_THIS s.vbe_visible_screen_size = BX_VGA_THIS s.line_offset * BX_VGA_THIS s.vbe_yres; BX_INFO(("VBE enabling x %d, y %d, bpp %d, %u bytes visible", BX_VGA_THIS s.vbe_xres, BX_VGA_THIS s.vbe_yres, BX_VGA_THIS s.vbe_bpp, BX_VGA_THIS s.vbe_visible_screen_size)); if (depth > 4) { BX_VGA_THIS s.vbe_lfb_enabled=(bx_bool)(value & VBE_DISPI_LFB_ENABLED); if ((value & VBE_DISPI_NOCLEARMEM) == 0) { memset(BX_VGA_THIS s.memory, 0, BX_VGA_THIS s.vbe_visible_screen_size); } bx_gui->dimension_update(BX_VGA_THIS s.vbe_xres, BX_VGA_THIS s.vbe_yres, 0, 0, depth); BX_VGA_THIS s.last_bpp = depth; } } else if (((value & VBE_DISPI_ENABLED) == 0) && BX_VGA_THIS s.vbe_enabled) { BX_INFO(("VBE disabling")); BX_VGA_THIS s.vbe_lfb_enabled=0; } BX_VGA_THIS s.vbe_enabled=(bx_bool)(value & VBE_DISPI_ENABLED); BX_VGA_THIS s.vbe_get_capabilities=(bx_bool)((value & VBE_DISPI_GETCAPS) != 0); new_vbe_8bit_dac=(bx_bool)((value & VBE_DISPI_8BIT_DAC) != 0); if (new_vbe_8bit_dac != BX_VGA_THIS s.vbe_8bit_dac) { if (new_vbe_8bit_dac) { for (i=0; i<256; i++) { BX_VGA_THIS s.pel.data[i].red <<= 2; BX_VGA_THIS s.pel.data[i].green <<= 2; BX_VGA_THIS s.pel.data[i].blue <<= 2; } BX_INFO(("DAC in 8 bit mode")); } else { for (i=0; i<256; i++) { BX_VGA_THIS s.pel.data[i].red >>= 2; BX_VGA_THIS s.pel.data[i].green >>= 2; BX_VGA_THIS s.pel.data[i].blue >>= 2; } BX_INFO(("DAC in standard mode")); } BX_VGA_THIS s.vbe_8bit_dac=new_vbe_8bit_dac; needs_update = 1; } } break; case VBE_DISPI_INDEX_X_OFFSET: { BX_DEBUG(("VBE offset x %d",value)); BX_VGA_THIS s.vbe_offset_x=(Bit16u)value; BX_VGA_THIS s.vbe_virtual_start = BX_VGA_THIS s.vbe_offset_y * BX_VGA_THIS s.line_offset; if (BX_VGA_THIS s.vbe_bpp != VBE_DISPI_BPP_4) { BX_VGA_THIS s.vbe_virtual_start += (BX_VGA_THIS s.vbe_offset_x * BX_VGA_THIS s.vbe_bpp_multiplier); } else { BX_VGA_THIS s.vbe_virtual_start += (BX_VGA_THIS s.vbe_offset_x >> 3); } needs_update = 1; } break; case VBE_DISPI_INDEX_Y_OFFSET: { BX_DEBUG(("VBE offset y %d",value)); Bit32u new_screen_start = value * BX_VGA_THIS s.line_offset; if (BX_VGA_THIS s.vbe_bpp != VBE_DISPI_BPP_4) { if ((new_screen_start + BX_VGA_THIS s.vbe_visible_screen_size) > VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES) { BX_PANIC(("VBE offset y %d out of bounds",value)); break; } new_screen_start += (BX_VGA_THIS s.vbe_offset_x * BX_VGA_THIS s.vbe_bpp_multiplier); } else { if ((new_screen_start + BX_VGA_THIS s.vbe_visible_screen_size) > (VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES / 4)) { BX_PANIC(("VBE offset y %d out of bounds",value)); break; } new_screen_start += (BX_VGA_THIS s.vbe_offset_x >> 3); } BX_VGA_THIS s.vbe_virtual_start = new_screen_start; BX_VGA_THIS s.vbe_offset_y = (Bit16u)value; needs_update = 1; } break; case VBE_DISPI_INDEX_VIRT_WIDTH: { BX_INFO(("VBE requested virtual width %d",value)); // calculate virtual width & height dimensions // req: // virt_width > xres // virt_height >=yres // virt_width*virt_height < MAX_VIDEO_MEMORY // basicly 2 situations // situation 1: // MAX_VIDEO_MEMORY / virt_width >= yres // adjust result height // else // adjust result width based upon virt_height=yres Bit16u new_width=value; Bit16u new_height; if (BX_VGA_THIS s.vbe_bpp != VBE_DISPI_BPP_4) { new_height=(VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES / BX_VGA_THIS s.vbe_bpp_multiplier) / new_width; } else { new_height=(VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES * 2) / new_width; } if (new_height >=BX_VGA_THIS s.vbe_yres) { // we have a decent virtual width & new_height BX_INFO(("VBE decent virtual height %d",new_height)); } else { // no decent virtual height: adjust width & height new_height=BX_VGA_THIS s.vbe_yres; if (BX_VGA_THIS s.vbe_bpp != VBE_DISPI_BPP_4) { new_width=(VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES / BX_VGA_THIS s.vbe_bpp_multiplier) / new_height; } else { new_width=(VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES * 2) / new_height; } BX_INFO(("VBE recalc virtual width %d height %d",new_width, new_height)); } BX_VGA_THIS s.vbe_virtual_xres=new_width; BX_VGA_THIS s.vbe_virtual_yres=new_height; if (BX_VGA_THIS s.vbe_bpp != VBE_DISPI_BPP_4) { BX_VGA_THIS s.line_offset = BX_VGA_THIS s.vbe_virtual_xres * BX_VGA_THIS s.vbe_bpp_multiplier; } else { BX_VGA_THIS s.line_offset = BX_VGA_THIS s.vbe_virtual_xres >> 3; } BX_VGA_THIS s.vbe_visible_screen_size = BX_VGA_THIS s.line_offset * BX_VGA_THIS s.vbe_yres; } break; /* case VBE_DISPI_INDEX_VIRT_HEIGHT: { BX_INFO(("VBE virtual height %x",value)); } break; */ default: { BX_PANIC(("VBE unknown data write index 0x%x",BX_VGA_THIS s.vbe_curindex)); } break; } if (needs_update) { BX_VGA_THIS s.vga_mem_updated = 1; for (unsigned xti = 0; xti < BX_NUM_X_TILES; xti++) { for (unsigned yti = 0; yti < BX_NUM_Y_TILES; yti++) { SET_TILE_UPDATED (xti, yti, 1); } } } break; } // end switch address } #endif
71,384
1,444
package mage.cards.p; import java.util.UUID; import mage.MageInt; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.filter.StaticFilters; /** * * @author Loki */ public final class PrimordialSage extends CardImpl { public PrimordialSage(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); this.subtype.add(SubType.SPIRIT); this.power = new MageInt(4); this.toughness = new MageInt(5); // Whenever you cast a creature spell, you may draw a card. this.addAbility(new SpellCastControllerTriggeredAbility(new DrawCardSourceControllerEffect(1), StaticFilters.FILTER_SPELL_A_CREATURE, true)); } private PrimordialSage(final PrimordialSage card) { super(card); } @Override public PrimordialSage copy() { return new PrimordialSage(this); } }
395
3,428
{"id":"00419","group":"easy-ham-2","checksum":{"type":"MD5","value":"ff5dc1a4fb2659c83414ee0a41a2e6f9"},"text":"From <EMAIL> Fri Aug 16 11:50:44 2002\nReturn-Path: <<EMAIL>>\nDelivered-To: y<EMAIL>.netnoteinc.com\nReceived: from localhost (localhost [127.0.0.1])\n\tby phobos.labs.netnoteinc.com (Postfix) with ESMTP id 9B13A43C37\n\tfor <jm@localhost>; Fri, 16 Aug 2002 06:49:26 -0400 (EDT)\nReceived: from phobos [127.0.0.1]\n\tby localhost with IMAP (fetchmail-5.9.0)\n\tfor jm@localhost (single-drop); Fri, 16 Aug 2002 11:49:26 +0100 (IST)\nReceived: from lugh.tuatha.org (<EMAIL> [172.16.58.35]) by\n dogma.slashnull.org (8.11.6/8.11.6) with ESMTP id g7GAnda13605 for\n <<EMAIL>>; Fri, 16 Aug 2002 11:49:39 +0100\nReceived: from lugh (root@localhost [127.0.0.1]) by lugh.tuatha.org\n (8.9.3/8.9.3) with ESMTP id LAA21843; Fri, 16 Aug 2002 11:48:25 +0100\nReceived: from telutil12a.ml.com (telutil12a-v.ml.com [19172.16.31.1096]) by\n lugh.tuatha.org (8.9.3/8.9.3) with ESMTP id LAA21808 for <<EMAIL>>;\n Fri, 16 Aug 2002 11:48:18 +0100\nX-Authentication-Warning: lugh.tuatha.org: Host telutil12a-v.ml.com\n [192.168.127.12] claimed to be telutil12a.ml.com\nReceived: from telutil13a.ml.com (telutil13a [146.125.226.11]) by\n telutil12a.ml.com (8.11.3/8.11.3/telutil12a-1.2) with ESMTP id\n g7GAmHv15754 for <<EMAIL>>; Fri, 16 Aug 2002 06:48:17 -0400 (EDT)\nReceived: from ehudwt03.exchange.ml.com (ehudwt03.exchange.ml.com\n [199.201.37.24]) by telutil13a.ml.com (8.11.3/8.11.3/telutil13a-1.1) with\n SMTP id g7GAmHf13197 for <<EMAIL>>; Fri, 16 Aug 2002 06:48:17 -0400\n (EDT)\nReceived: from 172.16.58.3 by ehudwt03.exchange.ml.com with ESMTP (\n Tumbleweed MMS SMTP Relay (MMS v4.7);); Fri, 16 Aug 2002 06:48:15 -0400\nX-Server-Uuid: 3789b954-9c4e-11d3-af68-0008c73b0911\nReceived: by dubim07742.ie.ml.com with Internet Mail Service (\n 5.5.2654.52) id <3TCXNSD7>; Fri, 16 Aug 2002 11:48:16 +0100\nMessage-Id: <<EMAIL>>\nFrom: \"<NAME> (Dublin)\" <<EMAIL>>\nTo: \"'ILUG'\" <<EMAIL>>\nDate: Fri, 16 Aug 2002 11:48:15 +0100\nMIME-Version: 1.0\nX-Mailer: Internet Mail Service (5.5.2654.52)\nX-WSS-Id: 114207E4172553-01-01\nContent-Type: text/plain; charset=iso-8859-1\nContent-Transfer-Encoding: 7bit\nSubject: [ILUG] FW: Mac (clone) for sale...\nSender: [email protected]\nErrors-To: [email protected]\nX-Mailman-Version: 1.1\nPrecedence: bulk\nList-Id: Irish Linux Users' Group <ilug.linux.ie>\nX-Beenthere: [email protected]\n\nI've been asked to forward this on ... \n\nAnyone interested, give me a shout and I'll put you in touch with Ryan ...\n\nP\n\n> -----Original Message-----\n> Proinnsias, \n> \n> I'd be obliged if you could pass this along to all your Linux buddies....\n> \n> For Sale:\n> \tPower Computing PowerCurve\n> (http://www.powerwatch.com/systems/pcurve.html)\n> \tOriginal 120Mhz PPC-601 daughter card\n> \tSlim Desktop case\n> \t128MB RAM (new)\n> \t2GB Apple (IBM) SCSI-2 HDD (new)\n> \tAti Rage Video card (new)\n> \t4 x Speed Toshiba CdRom (used, not apple but driver hacked -\n> available from web)\n> \tkeyboard & mouse (new)\n> \n> \tCurrently running MacOS9.1 (small partition) and Debian \"Woody\". OK\n> as is (think \n> \tPentium 233ish) or ready for upgrade to G3-500 for some real\n> performance!\n> \n> \tAsking price EUR200, open to negotiation.\n> \n> Regards, \n> Ryan\n> \n\n\n-- \nIrish Linux Users' Group: [email protected]\nhttp://www.linux.ie/mailman/listinfo/ilug for (un)subscription information.\nList maintainer: <EMAIL>\n\n"}
1,526
777
<filename>components/sessions/core/live_tab.h // Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_SESSIONS_CORE_LIVE_TAB_H_ #define COMPONENTS_SESSIONS_CORE_LIVE_TAB_H_ #include "components/sessions/core/serialized_navigation_entry.h" #include "components/sessions/core/sessions_export.h" #include "components/sessions/core/tab_restore_service.h" namespace sessions { // Interface that represents a currently-live tab to the core sessions code, and // in particular, the tab restore service. This interface abstracts the concrete // representation of a live tab on different platforms (e.g., WebContents on // //content-based platforms). class SESSIONS_EXPORT LiveTab { public: virtual ~LiveTab(); // Methods that return information about the navigation state of the tab. virtual bool IsInitialBlankNavigation() = 0; virtual int GetCurrentEntryIndex() = 0; virtual int GetPendingEntryIndex() = 0; virtual SerializedNavigationEntry GetEntryAtIndex(int index) = 0; virtual SerializedNavigationEntry GetPendingEntry() = 0; virtual int GetEntryCount() = 0; // Returns any platform-specific data that should be associated with the // TabRestoreService::Tab corresponding to this instance. The default // implementation returns null. virtual std::unique_ptr<PlatformSpecificTabData> GetPlatformSpecificTabData(); // Loads the current page if necessary (where "necessary" is defined on a // platform-specific basis). virtual void LoadIfNecessary() = 0; // Returns the user agent override, if any. virtual const std::string& GetUserAgentOverride() const = 0; }; } // namespace sessions #endif // COMPONENTS_SESSIONS_CORE_LIVE_TAB_H_
517
348
{"nom":"Ruffec","circ":"1ère circonscription","dpt":"Indre","inscrits":461,"abs":215,"votants":246,"blancs":27,"nuls":5,"exp":214,"res":[{"nuance":"REM","nom":"<NAME>","voix":157},{"nuance":"FN","nom":"<NAME>","voix":57}]}
87
764
<reponame>641589523/token-profile {"symbol": "XFII","address": "0x1fa21b20222076D7465fb901E5f459289c95F66a","overview":{"en": ""},"email": "","website": "https://www.xfiitech.com","state": "NORMAL","links": {"blog": "","twitter": "https://twitter.com/XFII_Tech","telegram": "","github": ""}}
114
432
<filename>src/simulator/tests/test_parallel_simulation.cpp // Copyright (c) Facebook, Inc. and its affiliates. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include <gtest/gtest.h> #include <cstdlib> #include "creator.h" #include "task_utils.h" #include "gen-cpp/scene_types.h" #include "gen-cpp/task_types.h" const int kWidth = 256; const int kHeight = 256; using scene::Body; using scene::Scene; using task::Task; using task::TaskSimulation; int randint(int max) { // Generates integer in {0, 1, ..., max - 1}. return static_cast<int>((static_cast<double>(rand()) / RAND_MAX - 1e-6) * max); } Scene CreateDemoScene(int seed, bool use_balls = false) { srand(seed); std::vector<Body> bodies; bodies.push_back(buildBox(50, 100, 20, 20)); bodies.push_back(buildBox(350, 100, 20, 30, 120)); for (int i = 0; i < 5 + randint(10); ++i) { if (use_balls) { bodies.push_back( buildCircle(20 + 37 * i, 200 + 15 * randint(2), 20 - randint(15))); } else { bodies.push_back(buildBox(20 + 37 * i, 200 + 15 * randint(2), 20 - randint(15), 20 - randint(15), i * 5)); } } // Pendulum bodies.push_back(buildBox(20, 90, 175, 5)); bodies.push_back(buildBox(100, 0, 5, 80, 0, false)); Scene scene; scene.__set_width(kWidth); scene.__set_height(kHeight); scene.__set_bodies(bodies); return scene; } TEST(ParallelSimulationTest, CheckConsistency) { std::vector<Task> tasks; for (int i = 0; i < 10; ++i) { Task task; task.__set_scene(CreateDemoScene(i)); task.__set_bodyId1(0); task.__set_bodyId2(1); task.__set_relationships(std::vector<::task::SpatialRelationship::type>{ ::task::SpatialRelationship::RIGHT_OF}); tasks.push_back(task); } const int maxSteps = 100; // To make the test faster. std::vector<TaskSimulation> groundTruthSimulation; for (const Task& task : tasks) { groundTruthSimulation.push_back(simulateTask(task, maxSteps)); } const std::vector<TaskSimulation> parallelSimulation = simulateTasksInParallel(tasks, /*numWorkers=*/3, maxSteps); for (size_t i = 0; i < tasks.size(); ++i) { ASSERT_EQ(groundTruthSimulation[i], parallelSimulation[i]) << "Discrepancy at task " << i; } } TEST(ParallelSimulationTest, CheckConsistencyWithStride) { const int stride = 3; std::vector<Task> tasks; for (int i = 0; i < 10; ++i) { Task task; task.__set_scene(CreateDemoScene(i)); task.__set_bodyId1(0); task.__set_bodyId2(1); task.__set_relationships(std::vector<::task::SpatialRelationship::type>{ ::task::SpatialRelationship::RIGHT_OF}); tasks.push_back(task); } const int maxSteps = 100; // To make the test faster. std::vector<TaskSimulation> groundTruthSimulation; for (const Task& task : tasks) { groundTruthSimulation.push_back(simulateTask(task, maxSteps, stride)); } const std::vector<TaskSimulation> parallelSimulation = simulateTasksInParallel(tasks, /*numWorkers=*/3, maxSteps, stride); for (size_t i = 0; i < tasks.size(); ++i) { ASSERT_EQ(groundTruthSimulation[i], parallelSimulation[i]) << "Discrepancy at task " << i; } }
1,427
1,444
<reponame>J-VOL/mage package mage.cards.p; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.filter.StaticFilters; import mage.target.common.TargetCardInLibrary; import java.util.UUID; /** * @author Loki */ public final class PilgrimsEye extends CardImpl { public PilgrimsEye(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); this.subtype.add(SubType.THOPTER); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(FlyingAbility.getInstance()); // When Pilgrim's Eye enters the battlefield, you may search your library for a basic land card, reveal it, put it into your hand, then shuffle your library. this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND), true), true)); } public PilgrimsEye(final PilgrimsEye card) { super(card); } @Override public PilgrimsEye copy() { return new PilgrimsEye(this); } }
491
4,054
<filename>zookeeper-server/zookeeper-server-common/src/main/java/com/yahoo/vespa/zookeeper/ExponentialBackoff.java // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.zookeeper; import java.time.Duration; import java.util.Random; /** * Calculate a delay using an exponential backoff algorithm. Based on ExponentialBackOff in google-http-client. * * @author mpolden */ public class ExponentialBackoff { private static final double RANDOMIZATION_FACTOR = 0.5; private final Duration initialDelay; private final Duration maxDelay; private final Random random; public ExponentialBackoff(Duration initialDelay, Duration maxDelay) { this(initialDelay, maxDelay, new Random()); } ExponentialBackoff(Duration initialDelay, Duration maxDelay, Random random) { this.initialDelay = requireNonNegative(initialDelay); this.maxDelay = requireNonNegative(maxDelay); this.random = random; } /** Return the delay of given attempt */ public Duration delay(int attempt) { if (attempt < 1) throw new IllegalArgumentException("Attempt must be positive"); double currentDelay = attempt * initialDelay.toMillis(); double delta = RANDOMIZATION_FACTOR * currentDelay; double lowerDelay = currentDelay - delta; double upperDelay = currentDelay + delta; long millis = (long) Math.min(lowerDelay + (random.nextDouble() * (upperDelay - lowerDelay + 1)), maxDelay.toMillis()); return Duration.ofMillis(millis); } private static Duration requireNonNegative(Duration d) { if (d.isNegative()) throw new IllegalArgumentException("Invalid duration: " + d); return d; } }
642
852
/** * This file defines the executable that will run the tests. * * Author: <NAME> <EMAIL> * * class description: * * */ // In case this does not work anymore uncomment the rest // #include <Utilities/Testing/interface/CppUnit_testdriver.icpp> #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> #include <cppunit/TestResult.h> #include <cppunit/TestCaller.h> #include <cppunit/TestRunner.h> #include <cppunit/ui/text/TestRunner.h> #include <cppunit/TestResultCollector.h> #include <cppunit/TextTestProgressListener.h> #include <cppunit/CompilerOutputter.h> #include <cppunit/extensions/TestFactoryRegistry.h> #include <cppunit/CompilerOutputter.h> // #include <cppunit/TextTestProgressListener.h> #include <cppunit/BriefTestProgressListener.h> /** * Main function used to run all tests. * We are not using the one in #include <Utilities/Testing/interface/CppUnit_testdriver.icpp> * because we use the BriefTestProgressListener to output the name of each test. */ int main( int argc, char* argv[] ) { std::string testPath = (argc > 1) ? std::string(argv[1]) : ""; CppUnit::TextUi::TestRunner runner; CppUnit::TestFactoryRegistry &registry = CppUnit::TestFactoryRegistry::getRegistry(); runner.addTest( registry.makeTest() ); // Outputs the name of each test when it is executed. CppUnit::BriefTestProgressListener progress; runner.eventManager().addListener( &progress ); runner.run(); }
472
350
# Copyright (c) Aptos # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import typing import ed25519 from account_address import AccountAddress from bcs import Deserializer, Serializer class Authenticator: """ Each transaction submitted to the Aptos blockchain contains a `TransactionAuthenticator`. During transaction execution, the executor will check if every `AccountAuthenticator`'s signature on the transaction hash is well-formed and whether the sha3 hash of the `AccountAuthenticator`'s `AuthenticationKeyPreimage` matches the `AuthenticationKey` stored under the participating signer's account address. """ ED25519: int = 0 MULTI_ED25519: int = 1 MULTI_AGENT: int = 2 variant: int authenticator: typing.Any def __init__(self, authenticator: typing.Any): if isinstance(authenticator, Ed25519Authenticator): self.variant = Authenticator.ED25519 elif isinstance(authenticator, MultiEd25519Authenticator): self.variant = Authenticator.MULTI_ED25519 elif isinstance(authenticator, MultiAgentAuthenticator): self.variant = Authenticator.MULTI_AGENT else: raise Exception("Invalid type") self.authenticator = authenticator def __eq__(self, other: Authenticator) -> bool: return ( self.variant == other.variant and self.authenticator == other.authenticator ) def __str__(self) -> str: return self.authenticator.__str__() def verify(self, data: bytes) -> bool: return self.authenticator.verify(data) def deserialize(deserializer: Deserializer) -> Authenticator: variant = deserializer.uleb128() if variant == Authenticator.ED25519: authenticator = Ed25519Authenticator.deserialize(deserializer) elif variant == Authenticator.MULTI_ED25519: authenticator = MultiEd25519Authenticator.deserialize(deserializer) elif variant == Authenticator.MULTI_AGENT: authenticator = MultiAgentAuthenticator.deserialize(deserializer) else: raise Exception("Invalid type") return Authenticator(authenticator) def serialize(self, serializer: Serializer): serializer.uleb128(self.variant) serializer.struct(self.authenticator) class Ed25519Authenticator: public_key: ed25519.PublicKey signature: ed25519.Signature def __init__(self, public_key: ed25519.PublicKey, signature: ed25519.Signature): self.public_key = public_key self.signature = signature def __eq__(self, other: Ed25519Authenticator) -> bool: return self.public_key == other.public_key and self.signature == other.signature def __str__(self) -> str: return f"PublicKey: {self.public_key}, Signature: {self.signature}" def verify(self, data: bytes) -> bool: return self.public_key.verify(data, self.signature) def deserialize(deserializer: Deserializer) -> Ed25519Authenticator: key = deserializer.struct(ed25519.PublicKey) signature = deserializer.struct(ed25519.Signature) return Ed25519Authenticator(key, signature) def serialize(self, serializer: Serializer): serializer.struct(self.public_key) serializer.struct(self.signature) class MultiAgentAuthenticator: sender: Authenticator secondary_signers: List[(AccountAddress, Authenticator)] def __init__( self, sender: Authenticator, secondary_signers: List[(AccountAddress, Authenticator)], ): self.sender = sender self.secondary_signers = secondary_signers def __eq__(self, other: MultiAgentAuthenticator) -> bool: return ( self.sender == other.sender and self.secondary_signers == other.secondary_signers ) def secondary_addresses(self) -> List[AccountAddress]: return [x[0] for x in self.secondary_signers] def verify(self, data: bytes) -> bool: if not self.sender.verify(data): return False return all([x[1].verify(data) for x in self.secondary_signers]) def deserialize(deserializer: Deserializer) -> MultiAgentAuthenticator: sender = deserializer.struct(Authenticator) secondary_addresses = deserializer.sequence(AccountAddress.deserialize) secondary_authenticators = deserializer.sequence(Authenticator.deserialize) return MultiAgentAuthenticator( sender, list(zip(secondary_addresses, secondary_authenticators)) ) def serialize(self, serializer: Serializer): serializer.struct(self.sender) serializer.sequence([x[0] for x in self.secondary_signers], Serializer.struct) serializer.sequence([x[1] for x in self.secondary_signers], Serializer.struct) class MultiEd25519Authenticator: def __init__(self): raise NotImplementedError def verify(self, data: bytes) -> bool: raise NotImplementedError def deserialize(deserializer: Deserializer) -> MultiEd25519Authenticator: raise NotImplementedError def serialize(self, serializer: Serializer): raise NotImplementedError
1,949
583
/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2009-08-29 // Updated : 2009-08-29 // Licence : This source is under MIT License // File : glm/gtx/matrix_operation.hpp /////////////////////////////////////////////////////////////////////////////////////////////////// // Dependency: // - GLM core /////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef glm_gtx_matrix_operation #define glm_gtx_matrix_operation // Dependency: #include "../glm.hpp" #if(defined(GLM_MESSAGES) && !defined(glm_ext)) # pragma message("GLM: GLM_GTX_matrix_operation extension included") #endif namespace glm{ namespace gtx{ namespace matrix_operation ///< GLM_GTX_matrix_operation: Build diagonal matrices { /// \addtogroup gtx_matrix_operation /// @{ //! Build a diagonal matrix. //! From GLM_GTX_matrix_operation extension. template <typename valType> detail::tmat2x2<valType> diagonal2x2( detail::tvec2<valType> const & v); //! Build a diagonal matrix. //! From GLM_GTX_matrix_operation extension. template <typename valType> detail::tmat2x3<valType> diagonal2x3( detail::tvec2<valType> const & v); //! Build a diagonal matrix. //! From GLM_GTX_matrix_operation extension. template <typename valType> detail::tmat2x4<valType> diagonal2x4( detail::tvec2<valType> const & v); //! Build a diagonal matrix. //! From GLM_GTX_matrix_operation extension. template <typename valType> detail::tmat3x2<valType> diagonal3x2( detail::tvec2<valType> const & v); //! Build a diagonal matrix. //! From GLM_GTX_matrix_operation extension. template <typename valType> detail::tmat3x3<valType> diagonal3x3( detail::tvec3<valType> const & v); //! Build a diagonal matrix. //! From GLM_GTX_matrix_operation extension. template <typename valType> detail::tmat3x4<valType> diagonal3x4( detail::tvec3<valType> const & v); //! Build a diagonal matrix. //! From GLM_GTX_matrix_operation extension. template <typename valType> detail::tmat4x2<valType> diagonal4x2( detail::tvec2<valType> const & v); //! Build a diagonal matrix. //! From GLM_GTX_matrix_operation extension. template <typename valType> detail::tmat4x3<valType> diagonal4x3( detail::tvec3<valType> const & v); //! Build a diagonal matrix. //! From GLM_GTX_matrix_operation extension. template <typename valType> detail::tmat4x4<valType> diagonal4x4( detail::tvec4<valType> const & v); /// @} }//namespace matrix_operation }//namespace gtx }//namespace glm #include "matrix_operation.inl" namespace glm{using namespace gtx::matrix_operation;} #endif//glm_gtx_matrix_operation
974
14,668
<filename>chrome/android/java/src/org/chromium/chrome/browser/usage_stats/PageViewObserver.java // Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.chrome.browser.usage_stats; import android.annotation.SuppressLint; import android.app.Activity; import android.app.usage.UsageStatsManager; import android.content.Context; import androidx.annotation.Nullable; import org.chromium.base.Log; import org.chromium.base.supplier.ObservableSupplier; import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; import org.chromium.chrome.browser.tab.CurrentTabObserver; import org.chromium.chrome.browser.tab.EmptyTabObserver; import org.chromium.chrome.browser.tab.SadTab; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabHidingType; import org.chromium.chrome.browser.tab.TabSelectionType; import org.chromium.components.embedder_support.util.UrlUtilities; import org.chromium.url.GURL; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; /** * Class that observes url and tab changes in order to track when browsing stops and starts for each * visited fully-qualified domain name (FQDN). */ @SuppressLint("NewApi") public class PageViewObserver extends EmptyTabObserver { private static final String TAG = "PageViewObserver"; private final Activity mActivity; private final CurrentTabObserver mCurrentTabObserver; private final EventTracker mEventTracker; private final TokenTracker mTokenTracker; private final SuspensionTracker mSuspensionTracker; private final Supplier<TabContentManager> mTabContentManagerSupplier; private Tab mCurrentTab; private String mLastFqdn; PageViewObserver(Activity activity, ObservableSupplier<Tab> tabSupplier, EventTracker eventTracker, TokenTracker tokenTracker, SuspensionTracker suspensionTracker, Supplier<TabContentManager> tabContentManagerSupplier) { mActivity = activity; mEventTracker = eventTracker; mTokenTracker = tokenTracker; mSuspensionTracker = suspensionTracker; mTabContentManagerSupplier = tabContentManagerSupplier; mCurrentTabObserver = new CurrentTabObserver(tabSupplier, this, this::activeTabChanged); mCurrentTabObserver.triggerWithCurrentTab(); } @Override public void onShown(Tab tab, @TabSelectionType int type) { if (!tab.isLoading() && !tab.isBeingRestored()) { updateUrl(tab.getUrl()); } } @Override public void onHidden(Tab tab, @TabHidingType int type) { updateUrl(null); } @Override public void onUpdateUrl(Tab tab, GURL url) { assert tab == mCurrentTab; String newFqdn = getValidFqdnOrEmptyString(url); // We don't call updateUrl() here to avoid reporting start events for domains // that never paint, e.g. link shorteners. We still need to check the SuspendedTab // state because a tab that's suspended can't paint, and the user could be // navigating away from a suspended domain. checkSuspendedTabState(mSuspensionTracker.isWebsiteSuspended(newFqdn), newFqdn); } @Override public void didFirstVisuallyNonEmptyPaint(Tab tab) { assert tab == mCurrentTab; updateUrl(tab.getUrl()); } @Override public void onCrash(Tab tab) { updateUrl(null); } /** Notify PageViewObserver that {@code fqdn} was just suspended or un-suspended. */ public void notifySiteSuspensionChanged(String fqdn, boolean isSuspended) { if (mCurrentTab == null || !mCurrentTab.isInitialized()) return; SuspendedTab suspendedTab = SuspendedTab.from(mCurrentTab, mTabContentManagerSupplier); if (fqdn.equals(mLastFqdn) || fqdn.equals(suspendedTab.getFqdn())) { if (checkSuspendedTabState(isSuspended, fqdn)) { reportStop(); } } } /** * Updates our state from the previous url to {@code newUrl}. This can result in any/all of the * following: * 1. Suspension or un-suspension of mCurrentTab. * 2. Reporting a stop event for mLastFqdn. * 3. Reporting a start event for the fqdn of {@code newUrl}. */ private void updateUrl(@Nullable GURL newUrl) { String newFqdn = getValidFqdnOrEmptyString(newUrl); boolean isSameDomain = newFqdn.equals(mLastFqdn); boolean isValidProtocol = newUrl != null && UrlUtilities.isHttpOrHttps(newUrl); boolean isSuspended = mSuspensionTracker.isWebsiteSuspended(newFqdn); boolean didSuspend = checkSuspendedTabState(isSuspended, newFqdn); if (mLastFqdn != null && (didSuspend || !isSameDomain)) { reportStop(); } if (isValidProtocol && !isSuspended && !isSameDomain) { mLastFqdn = newFqdn; mEventTracker.addWebsiteEvent(new WebsiteEvent( System.currentTimeMillis(), mLastFqdn, WebsiteEvent.EventType.START)); reportToPlatformIfDomainIsTracked("reportUsageStart", mLastFqdn); } } /** * Hides or shows the SuspendedTab for mCurrentTab, based on: * 1. If it is currently shown or hidden * 2. Its current fqdn, if any. * 3. If fqdn is newly suspended or not. * There are really only two important cases; either the SuspendedTab is showing and should be * hidden, or it's hidden and should be shown. */ private boolean checkSuspendedTabState(boolean isNewlySuspended, String fqdn) { if (mCurrentTab == null) return false; SuspendedTab suspendedTab = SuspendedTab.from(mCurrentTab, mTabContentManagerSupplier); // We don't need to do anything in situations where the current state matches the desired; // i.e. either the suspended tab is already showing with the correct fqdn, or the suspended // tab is hidden and should be hidden. if (isNewlySuspended && fqdn.equals(suspendedTab.getFqdn())) return false; if (!isNewlySuspended && !suspendedTab.isShowing()) return false; if (isNewlySuspended) { suspendedTab.show(fqdn); return true; } else { suspendedTab.removeIfPresent(); if (!mCurrentTab.isLoading() && !SadTab.isShowing(mCurrentTab)) { mCurrentTab.reload(); } } return false; } private void reportStop() { mEventTracker.addWebsiteEvent(new WebsiteEvent( System.currentTimeMillis(), mLastFqdn, WebsiteEvent.EventType.STOP)); reportToPlatformIfDomainIsTracked("reportUsageStop", mLastFqdn); mLastFqdn = null; } private void activeTabChanged(Tab tab) { mCurrentTab = tab; if (mCurrentTab == null) { updateUrl(null); } else if (mCurrentTab.isIncognito()) { updateUrl(null); mCurrentTab.removeObserver(this); } else if (!mCurrentTab.isHidden()) { // If the newly active tab is hidden, we don't want to check its URL yet; we'll wait // until the onShown event fires. updateUrl(mCurrentTab.getUrl()); } } private void reportToPlatformIfDomainIsTracked(String reportMethodName, String fqdn) { mTokenTracker.getTokenForFqdn(fqdn).then((token) -> { if (token == null) return; try { UsageStatsManager instance = (UsageStatsManager) mActivity.getSystemService(Context.USAGE_STATS_SERVICE); Method reportMethod = UsageStatsManager.class.getDeclaredMethod( reportMethodName, Activity.class, String.class); reportMethod.invoke(instance, mActivity, token); } catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException e) { Log.e(TAG, "Failed to report to platform API", e); } }); } private static String getValidFqdnOrEmptyString(GURL url) { if (GURL.isEmptyOrInvalid(url)) return ""; return url.getHost(); } }
3,214
627
package com.naturalprogrammer.spring.lemondemo; import com.fasterxml.jackson.core.JsonProcessingException; import com.naturalprogrammer.spring.lemon.commons.util.LecUtils; import com.naturalprogrammer.spring.lemondemo.entities.User; import org.junit.jupiter.api.Test; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import static org.hamcrest.Matchers.hasItems; import static org.hamcrest.Matchers.hasSize; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; class RequestEmailChangeMvcTests extends AbstractMvcTests { private static final String NEW_EMAIL = "<EMAIL>"; private User form() { User user = new User(); user.setPassword(<PASSWORD>); user.setNewEmail(NEW_EMAIL); return user; } @Test void testRequestEmailChange() throws Exception { mvc.perform(post("/api/core/users/{id}/email-change-request", UNVERIFIED_USER_ID) .contentType(MediaType.APPLICATION_JSON) .header(HttpHeaders.AUTHORIZATION, tokens.get(UNVERIFIED_USER_ID)) .content(LecUtils.toJson(form()))) .andExpect(status().is(204)); verify(mailSender).send(any()); User updatedUser = userRepository.findById(UNVERIFIED_USER_ID).get(); assertEquals(NEW_EMAIL, updatedUser.getNewEmail()); assertEquals(UNVERIFIED_USER_EMAIL, updatedUser.getEmail()); } /** * A good admin should be able to request changing email of another user. */ @Test void testGoodAdminRequestEmailChange() throws Exception { mvc.perform(post("/api/core/users/{id}/email-change-request", UNVERIFIED_USER_ID) .contentType(MediaType.APPLICATION_JSON) .header(HttpHeaders.AUTHORIZATION, tokens.get(ADMIN_ID)) .content(LecUtils.toJson(form()))) .andExpect(status().is(204)); User updatedUser = userRepository.findById(UNVERIFIED_USER_ID).get(); assertEquals(NEW_EMAIL, updatedUser.getNewEmail()); } /** * A request changing email of unknown user. */ @Test void testRequestEmailChangeUnknownUser() throws Exception { mvc.perform(post("/api/core/users/99/email-change-request") .contentType(MediaType.APPLICATION_JSON) .header(HttpHeaders.AUTHORIZATION, tokens.get(ADMIN_ID)) .content(LecUtils.toJson(form()))) .andExpect(status().is(404)); verify(mailSender, never()).send(any()); } /** * A non-admin should not be able to request changing * the email id of another user */ @Test void testNonAdminRequestEmailChangeAnotherUser() throws Exception { mvc.perform(post("/api/core/users/{id}/email-change-request", ADMIN_ID) .contentType(MediaType.APPLICATION_JSON) .header(HttpHeaders.AUTHORIZATION, tokens.get(USER_ID)) .content(LecUtils.toJson(form()))) .andExpect(status().is(403)); verify(mailSender, never()).send(any()); User updatedUser = userRepository.findById(UNVERIFIED_USER_ID).get(); assertNull(updatedUser.getNewEmail()); } /** * A bad admin trying to change the email id * of another user */ @Test void testBadAdminRequestEmailChangeAnotherUser() throws Exception { mvc.perform(post("/api/core/users/{id}/email-change-request", ADMIN_ID) .contentType(MediaType.APPLICATION_JSON) .header(HttpHeaders.AUTHORIZATION, tokens.get(UNVERIFIED_ADMIN_ID)) .content(LecUtils.toJson(form()))) .andExpect(status().is(403)); verify(mailSender, never()).send(any()); } /** * Trying with invalid data. */ @Test void tryingWithInvalidData() throws JsonProcessingException, Exception { // try with null newEmail and password mvc.perform(post("/api/core/users/{id}/email-change-request", UNVERIFIED_USER_ID) .contentType(MediaType.APPLICATION_JSON) .header(HttpHeaders.AUTHORIZATION, tokens.get(UNVERIFIED_USER_ID)) .content(LecUtils.toJson(new User()))) .andExpect(status().is(422)) .andExpect(jsonPath("$.errors[*].field").value(hasSize(2))) .andExpect(jsonPath("$.errors[*].field").value(hasItems( "updatedUser.newEmail", "<PASSWORD>"))); User updatedUser = new User(); updatedUser.setPassword(""); updatedUser.setNewEmail(""); // try with blank newEmail and password mvc.perform(post("/api/core/users/{id}/email-change-request", UNVERIFIED_USER_ID) .contentType(MediaType.APPLICATION_JSON) .header(HttpHeaders.AUTHORIZATION, tokens.get(UNVERIFIED_USER_ID)) .content(LecUtils.toJson(updatedUser))) .andExpect(status().is(422)) .andExpect(jsonPath("$.errors[*].field").value(hasSize(4))) .andExpect(jsonPath("$.errors[*].field").value(hasItems( "updatedUser.newEmail", "<PASSWORD>"))); // try with invalid newEmail updatedUser = form(); updatedUser.setNewEmail("an-invalid-email"); mvc.perform(post("/api/core/users/{id}/email-change-request", UNVERIFIED_USER_ID) .contentType(MediaType.APPLICATION_JSON) .header(HttpHeaders.AUTHORIZATION, tokens.get(UNVERIFIED_USER_ID)) .content(LecUtils.toJson(updatedUser))) .andExpect(status().is(422)) .andExpect(jsonPath("$.errors[*].field").value(hasSize(1))) .andExpect(jsonPath("$.errors[*].field").value(hasItems("updatedUser.newEmail"))); // try with wrong password updatedUser = form(); updatedUser.setPassword("<PASSWORD>"); mvc.perform(post("/api/core/users/{id}/email-change-request", UNVERIFIED_USER_ID) .contentType(MediaType.APPLICATION_JSON) .header(HttpHeaders.AUTHORIZATION, tokens.get(UNVERIFIED_USER_ID)) .content(LecUtils.toJson(updatedUser))) .andExpect(status().is(422)) .andExpect(jsonPath("$.errors[*].field").value(hasSize(1))) .andExpect(jsonPath("$.errors[*].field").value(hasItems("updatedUser.password"))); // try with null password updatedUser = form(); updatedUser.setPassword(<PASSWORD>); mvc.perform(post("/api/core/users/{id}/email-change-request", UNVERIFIED_USER_ID) .contentType(MediaType.APPLICATION_JSON) .header(HttpHeaders.AUTHORIZATION, tokens.get(UNVERIFIED_USER_ID)) .content(LecUtils.toJson(updatedUser))) .andExpect(status().is(422)) .andExpect(jsonPath("$.errors[*].field").value(hasSize(1))) .andExpect(jsonPath("$.errors[*].field").value(hasItems("updatedUser.password"))); // try with an existing email updatedUser = form(); updatedUser.setNewEmail(ADMIN_EMAIL);; mvc.perform(post("/api/core/users/{id}/email-change-request", UNVERIFIED_USER_ID) .contentType(MediaType.APPLICATION_JSON) .header(HttpHeaders.AUTHORIZATION, tokens.get(UNVERIFIED_USER_ID)) .content(LecUtils.toJson(updatedUser))) .andExpect(status().is(422)) .andExpect(jsonPath("$.errors[*].field").value(hasSize(1))) .andExpect(jsonPath("$.errors[*].field").value(hasItems("updatedUser.newEmail"))); verify(mailSender, never()).send(any()); } }
3,030
2,542
<reponame>gridgentoo/ServiceFabricAzure /* this ALWAYS GENERATED file contains the definitions for the interfaces */ /* File created by MIDL compiler version 8.00.0613 */ /* @@MIDL_FILE_HEADING( ) */ /* verify that the <rpcndr.h> version is high enough to compile this file*/ #ifndef __REQUIRED_RPCNDR_H_VERSION__ #define __REQUIRED_RPCNDR_H_VERSION__ 500 #endif /* verify that the <rpcsal.h> version is high enough to compile this file*/ #ifndef __REQUIRED_RPCSAL_H_VERSION__ #define __REQUIRED_RPCSAL_H_VERSION__ 100 #endif #include "rpc.h" #include "rpcndr.h" #ifndef __RPCNDR_H_VERSION__ #error this stub requires an updated version of <rpcndr.h> #endif /* __RPCNDR_H_VERSION__ */ #ifndef COM_NO_WINDOWS_H #include "windows.h" #include "ole2.h" #endif /*COM_NO_WINDOWS_H*/ #ifndef __fabricruntime_h__ #define __fabricruntime_h__ #if defined(_MSC_VER) && (_MSC_VER >= 1020) #pragma once #endif /* Forward Declarations */ #ifndef __IFabricRuntime_FWD_DEFINED__ #define __IFabricRuntime_FWD_DEFINED__ typedef interface IFabricRuntime IFabricRuntime; #endif /* __IFabricRuntime_FWD_DEFINED__ */ #ifndef __IFabricProcessExitHandler_FWD_DEFINED__ #define __IFabricProcessExitHandler_FWD_DEFINED__ typedef interface IFabricProcessExitHandler IFabricProcessExitHandler; #endif /* __IFabricProcessExitHandler_FWD_DEFINED__ */ #ifndef __IFabricStatelessServiceFactory_FWD_DEFINED__ #define __IFabricStatelessServiceFactory_FWD_DEFINED__ typedef interface IFabricStatelessServiceFactory IFabricStatelessServiceFactory; #endif /* __IFabricStatelessServiceFactory_FWD_DEFINED__ */ #ifndef __IFabricStatelessServiceInstance_FWD_DEFINED__ #define __IFabricStatelessServiceInstance_FWD_DEFINED__ typedef interface IFabricStatelessServiceInstance IFabricStatelessServiceInstance; #endif /* __IFabricStatelessServiceInstance_FWD_DEFINED__ */ #ifndef __IFabricStatelessServicePartition_FWD_DEFINED__ #define __IFabricStatelessServicePartition_FWD_DEFINED__ typedef interface IFabricStatelessServicePartition IFabricStatelessServicePartition; #endif /* __IFabricStatelessServicePartition_FWD_DEFINED__ */ #ifndef __IFabricStatelessServicePartition1_FWD_DEFINED__ #define __IFabricStatelessServicePartition1_FWD_DEFINED__ typedef interface IFabricStatelessServicePartition1 IFabricStatelessServicePartition1; #endif /* __IFabricStatelessServicePartition1_FWD_DEFINED__ */ #ifndef __IFabricStatelessServicePartition2_FWD_DEFINED__ #define __IFabricStatelessServicePartition2_FWD_DEFINED__ typedef interface IFabricStatelessServicePartition2 IFabricStatelessServicePartition2; #endif /* __IFabricStatelessServicePartition2_FWD_DEFINED__ */ #ifndef __IFabricStatelessServicePartition3_FWD_DEFINED__ #define __IFabricStatelessServicePartition3_FWD_DEFINED__ typedef interface IFabricStatelessServicePartition3 IFabricStatelessServicePartition3; #endif /* __IFabricStatelessServicePartition3_FWD_DEFINED__ */ #ifndef __IFabricStatefulServiceFactory_FWD_DEFINED__ #define __IFabricStatefulServiceFactory_FWD_DEFINED__ typedef interface IFabricStatefulServiceFactory IFabricStatefulServiceFactory; #endif /* __IFabricStatefulServiceFactory_FWD_DEFINED__ */ #ifndef __IFabricStatefulServiceReplica_FWD_DEFINED__ #define __IFabricStatefulServiceReplica_FWD_DEFINED__ typedef interface IFabricStatefulServiceReplica IFabricStatefulServiceReplica; #endif /* __IFabricStatefulServiceReplica_FWD_DEFINED__ */ #ifndef __IFabricStatefulServicePartition_FWD_DEFINED__ #define __IFabricStatefulServicePartition_FWD_DEFINED__ typedef interface IFabricStatefulServicePartition IFabricStatefulServicePartition; #endif /* __IFabricStatefulServicePartition_FWD_DEFINED__ */ #ifndef __IFabricStatefulServicePartition1_FWD_DEFINED__ #define __IFabricStatefulServicePartition1_FWD_DEFINED__ typedef interface IFabricStatefulServicePartition1 IFabricStatefulServicePartition1; #endif /* __IFabricStatefulServicePartition1_FWD_DEFINED__ */ #ifndef __IFabricStatefulServicePartition2_FWD_DEFINED__ #define __IFabricStatefulServicePartition2_FWD_DEFINED__ typedef interface IFabricStatefulServicePartition2 IFabricStatefulServicePartition2; #endif /* __IFabricStatefulServicePartition2_FWD_DEFINED__ */ #ifndef __IFabricStatefulServicePartition3_FWD_DEFINED__ #define __IFabricStatefulServicePartition3_FWD_DEFINED__ typedef interface IFabricStatefulServicePartition3 IFabricStatefulServicePartition3; #endif /* __IFabricStatefulServicePartition3_FWD_DEFINED__ */ #ifndef __IFabricStateProvider_FWD_DEFINED__ #define __IFabricStateProvider_FWD_DEFINED__ typedef interface IFabricStateProvider IFabricStateProvider; #endif /* __IFabricStateProvider_FWD_DEFINED__ */ #ifndef __IFabricStateReplicator_FWD_DEFINED__ #define __IFabricStateReplicator_FWD_DEFINED__ typedef interface IFabricStateReplicator IFabricStateReplicator; #endif /* __IFabricStateReplicator_FWD_DEFINED__ */ #ifndef __IFabricReplicator_FWD_DEFINED__ #define __IFabricReplicator_FWD_DEFINED__ typedef interface IFabricReplicator IFabricReplicator; #endif /* __IFabricReplicator_FWD_DEFINED__ */ #ifndef __IFabricPrimaryReplicator_FWD_DEFINED__ #define __IFabricPrimaryReplicator_FWD_DEFINED__ typedef interface IFabricPrimaryReplicator IFabricPrimaryReplicator; #endif /* __IFabricPrimaryReplicator_FWD_DEFINED__ */ #ifndef __IFabricReplicatorCatchupSpecificQuorum_FWD_DEFINED__ #define __IFabricReplicatorCatchupSpecificQuorum_FWD_DEFINED__ typedef interface IFabricReplicatorCatchupSpecificQuorum IFabricReplicatorCatchupSpecificQuorum; #endif /* __IFabricReplicatorCatchupSpecificQuorum_FWD_DEFINED__ */ #ifndef __IFabricOperation_FWD_DEFINED__ #define __IFabricOperation_FWD_DEFINED__ typedef interface IFabricOperation IFabricOperation; #endif /* __IFabricOperation_FWD_DEFINED__ */ #ifndef __IFabricOperationData_FWD_DEFINED__ #define __IFabricOperationData_FWD_DEFINED__ typedef interface IFabricOperationData IFabricOperationData; #endif /* __IFabricOperationData_FWD_DEFINED__ */ #ifndef __IFabricOperationStream_FWD_DEFINED__ #define __IFabricOperationStream_FWD_DEFINED__ typedef interface IFabricOperationStream IFabricOperationStream; #endif /* __IFabricOperationStream_FWD_DEFINED__ */ #ifndef __IFabricOperationStream2_FWD_DEFINED__ #define __IFabricOperationStream2_FWD_DEFINED__ typedef interface IFabricOperationStream2 IFabricOperationStream2; #endif /* __IFabricOperationStream2_FWD_DEFINED__ */ #ifndef __IFabricOperationDataStream_FWD_DEFINED__ #define __IFabricOperationDataStream_FWD_DEFINED__ typedef interface IFabricOperationDataStream IFabricOperationDataStream; #endif /* __IFabricOperationDataStream_FWD_DEFINED__ */ #ifndef __IFabricAtomicGroupStateProvider_FWD_DEFINED__ #define __IFabricAtomicGroupStateProvider_FWD_DEFINED__ typedef interface IFabricAtomicGroupStateProvider IFabricAtomicGroupStateProvider; #endif /* __IFabricAtomicGroupStateProvider_FWD_DEFINED__ */ #ifndef __IFabricAtomicGroupStateReplicator_FWD_DEFINED__ #define __IFabricAtomicGroupStateReplicator_FWD_DEFINED__ typedef interface IFabricAtomicGroupStateReplicator IFabricAtomicGroupStateReplicator; #endif /* __IFabricAtomicGroupStateReplicator_FWD_DEFINED__ */ #ifndef __IFabricServiceGroupFactory_FWD_DEFINED__ #define __IFabricServiceGroupFactory_FWD_DEFINED__ typedef interface IFabricServiceGroupFactory IFabricServiceGroupFactory; #endif /* __IFabricServiceGroupFactory_FWD_DEFINED__ */ #ifndef __IFabricServiceGroupFactoryBuilder_FWD_DEFINED__ #define __IFabricServiceGroupFactoryBuilder_FWD_DEFINED__ typedef interface IFabricServiceGroupFactoryBuilder IFabricServiceGroupFactoryBuilder; #endif /* __IFabricServiceGroupFactoryBuilder_FWD_DEFINED__ */ #ifndef __IFabricServiceGroupPartition_FWD_DEFINED__ #define __IFabricServiceGroupPartition_FWD_DEFINED__ typedef interface IFabricServiceGroupPartition IFabricServiceGroupPartition; #endif /* __IFabricServiceGroupPartition_FWD_DEFINED__ */ #ifndef __IFabricCodePackageActivationContext_FWD_DEFINED__ #define __IFabricCodePackageActivationContext_FWD_DEFINED__ typedef interface IFabricCodePackageActivationContext IFabricCodePackageActivationContext; #endif /* __IFabricCodePackageActivationContext_FWD_DEFINED__ */ #ifndef __IFabricCodePackageActivationContext2_FWD_DEFINED__ #define __IFabricCodePackageActivationContext2_FWD_DEFINED__ typedef interface IFabricCodePackageActivationContext2 IFabricCodePackageActivationContext2; #endif /* __IFabricCodePackageActivationContext2_FWD_DEFINED__ */ #ifndef __IFabricCodePackageActivationContext3_FWD_DEFINED__ #define __IFabricCodePackageActivationContext3_FWD_DEFINED__ typedef interface IFabricCodePackageActivationContext3 IFabricCodePackageActivationContext3; #endif /* __IFabricCodePackageActivationContext3_FWD_DEFINED__ */ #ifndef __IFabricCodePackageActivationContext4_FWD_DEFINED__ #define __IFabricCodePackageActivationContext4_FWD_DEFINED__ typedef interface IFabricCodePackageActivationContext4 IFabricCodePackageActivationContext4; #endif /* __IFabricCodePackageActivationContext4_FWD_DEFINED__ */ #ifndef __IFabricCodePackageActivationContext5_FWD_DEFINED__ #define __IFabricCodePackageActivationContext5_FWD_DEFINED__ typedef interface IFabricCodePackageActivationContext5 IFabricCodePackageActivationContext5; #endif /* __IFabricCodePackageActivationContext5_FWD_DEFINED__ */ #ifndef __IFabricCodePackageActivationContext6_FWD_DEFINED__ #define __IFabricCodePackageActivationContext6_FWD_DEFINED__ typedef interface IFabricCodePackageActivationContext6 IFabricCodePackageActivationContext6; #endif /* __IFabricCodePackageActivationContext6_FWD_DEFINED__ */ #ifndef __IFabricCodePackage_FWD_DEFINED__ #define __IFabricCodePackage_FWD_DEFINED__ typedef interface IFabricCodePackage IFabricCodePackage; #endif /* __IFabricCodePackage_FWD_DEFINED__ */ #ifndef __IFabricCodePackage2_FWD_DEFINED__ #define __IFabricCodePackage2_FWD_DEFINED__ typedef interface IFabricCodePackage2 IFabricCodePackage2; #endif /* __IFabricCodePackage2_FWD_DEFINED__ */ #ifndef __IFabricConfigurationPackage_FWD_DEFINED__ #define __IFabricConfigurationPackage_FWD_DEFINED__ typedef interface IFabricConfigurationPackage IFabricConfigurationPackage; #endif /* __IFabricConfigurationPackage_FWD_DEFINED__ */ #ifndef __IFabricConfigurationPackage2_FWD_DEFINED__ #define __IFabricConfigurationPackage2_FWD_DEFINED__ typedef interface IFabricConfigurationPackage2 IFabricConfigurationPackage2; #endif /* __IFabricConfigurationPackage2_FWD_DEFINED__ */ #ifndef __IFabricDataPackage_FWD_DEFINED__ #define __IFabricDataPackage_FWD_DEFINED__ typedef interface IFabricDataPackage IFabricDataPackage; #endif /* __IFabricDataPackage_FWD_DEFINED__ */ #ifndef __IFabricConfigurationPackageChangeHandler_FWD_DEFINED__ #define __IFabricConfigurationPackageChangeHandler_FWD_DEFINED__ typedef interface IFabricConfigurationPackageChangeHandler IFabricConfigurationPackageChangeHandler; #endif /* __IFabricConfigurationPackageChangeHandler_FWD_DEFINED__ */ #ifndef __IFabricDataPackageChangeHandler_FWD_DEFINED__ #define __IFabricDataPackageChangeHandler_FWD_DEFINED__ typedef interface IFabricDataPackageChangeHandler IFabricDataPackageChangeHandler; #endif /* __IFabricDataPackageChangeHandler_FWD_DEFINED__ */ #ifndef __IFabricTransactionBase_FWD_DEFINED__ #define __IFabricTransactionBase_FWD_DEFINED__ typedef interface IFabricTransactionBase IFabricTransactionBase; #endif /* __IFabricTransactionBase_FWD_DEFINED__ */ #ifndef __IFabricTransaction_FWD_DEFINED__ #define __IFabricTransaction_FWD_DEFINED__ typedef interface IFabricTransaction IFabricTransaction; #endif /* __IFabricTransaction_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreReplica_FWD_DEFINED__ #define __IFabricKeyValueStoreReplica_FWD_DEFINED__ typedef interface IFabricKeyValueStoreReplica IFabricKeyValueStoreReplica; #endif /* __IFabricKeyValueStoreReplica_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreReplica2_FWD_DEFINED__ #define __IFabricKeyValueStoreReplica2_FWD_DEFINED__ typedef interface IFabricKeyValueStoreReplica2 IFabricKeyValueStoreReplica2; #endif /* __IFabricKeyValueStoreReplica2_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreReplica3_FWD_DEFINED__ #define __IFabricKeyValueStoreReplica3_FWD_DEFINED__ typedef interface IFabricKeyValueStoreReplica3 IFabricKeyValueStoreReplica3; #endif /* __IFabricKeyValueStoreReplica3_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreItemEnumerator_FWD_DEFINED__ #define __IFabricKeyValueStoreItemEnumerator_FWD_DEFINED__ typedef interface IFabricKeyValueStoreItemEnumerator IFabricKeyValueStoreItemEnumerator; #endif /* __IFabricKeyValueStoreItemEnumerator_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreItemMetadataEnumerator_FWD_DEFINED__ #define __IFabricKeyValueStoreItemMetadataEnumerator_FWD_DEFINED__ typedef interface IFabricKeyValueStoreItemMetadataEnumerator IFabricKeyValueStoreItemMetadataEnumerator; #endif /* __IFabricKeyValueStoreItemMetadataEnumerator_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreItemResult_FWD_DEFINED__ #define __IFabricKeyValueStoreItemResult_FWD_DEFINED__ typedef interface IFabricKeyValueStoreItemResult IFabricKeyValueStoreItemResult; #endif /* __IFabricKeyValueStoreItemResult_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreItemMetadataResult_FWD_DEFINED__ #define __IFabricKeyValueStoreItemMetadataResult_FWD_DEFINED__ typedef interface IFabricKeyValueStoreItemMetadataResult IFabricKeyValueStoreItemMetadataResult; #endif /* __IFabricKeyValueStoreItemMetadataResult_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreNotification_FWD_DEFINED__ #define __IFabricKeyValueStoreNotification_FWD_DEFINED__ typedef interface IFabricKeyValueStoreNotification IFabricKeyValueStoreNotification; #endif /* __IFabricKeyValueStoreNotification_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreNotificationEnumerator_FWD_DEFINED__ #define __IFabricKeyValueStoreNotificationEnumerator_FWD_DEFINED__ typedef interface IFabricKeyValueStoreNotificationEnumerator IFabricKeyValueStoreNotificationEnumerator; #endif /* __IFabricKeyValueStoreNotificationEnumerator_FWD_DEFINED__ */ #ifndef __IFabricNodeContextResult_FWD_DEFINED__ #define __IFabricNodeContextResult_FWD_DEFINED__ typedef interface IFabricNodeContextResult IFabricNodeContextResult; #endif /* __IFabricNodeContextResult_FWD_DEFINED__ */ #ifndef __IFabricNodeContextResult2_FWD_DEFINED__ #define __IFabricNodeContextResult2_FWD_DEFINED__ typedef interface IFabricNodeContextResult2 IFabricNodeContextResult2; #endif /* __IFabricNodeContextResult2_FWD_DEFINED__ */ #ifndef __IFabricReplicatorSettingsResult_FWD_DEFINED__ #define __IFabricReplicatorSettingsResult_FWD_DEFINED__ typedef interface IFabricReplicatorSettingsResult IFabricReplicatorSettingsResult; #endif /* __IFabricReplicatorSettingsResult_FWD_DEFINED__ */ #ifndef __IFabricEseLocalStoreSettingsResult_FWD_DEFINED__ #define __IFabricEseLocalStoreSettingsResult_FWD_DEFINED__ typedef interface IFabricEseLocalStoreSettingsResult IFabricEseLocalStoreSettingsResult; #endif /* __IFabricEseLocalStoreSettingsResult_FWD_DEFINED__ */ #ifndef __IFabricSecurityCredentialsResult_FWD_DEFINED__ #define __IFabricSecurityCredentialsResult_FWD_DEFINED__ typedef interface IFabricSecurityCredentialsResult IFabricSecurityCredentialsResult; #endif /* __IFabricSecurityCredentialsResult_FWD_DEFINED__ */ #ifndef __IFabricCodePackageActivator_FWD_DEFINED__ #define __IFabricCodePackageActivator_FWD_DEFINED__ typedef interface IFabricCodePackageActivator IFabricCodePackageActivator; #endif /* __IFabricCodePackageActivator_FWD_DEFINED__ */ #ifndef __IFabricCodePackageEventHandler_FWD_DEFINED__ #define __IFabricCodePackageEventHandler_FWD_DEFINED__ typedef interface IFabricCodePackageEventHandler IFabricCodePackageEventHandler; #endif /* __IFabricCodePackageEventHandler_FWD_DEFINED__ */ #ifndef __FabricRuntime_FWD_DEFINED__ #define __FabricRuntime_FWD_DEFINED__ #ifdef __cplusplus typedef class FabricRuntime FabricRuntime; #else typedef struct FabricRuntime FabricRuntime; #endif /* __cplusplus */ #endif /* __FabricRuntime_FWD_DEFINED__ */ #ifndef __IFabricRuntime_FWD_DEFINED__ #define __IFabricRuntime_FWD_DEFINED__ typedef interface IFabricRuntime IFabricRuntime; #endif /* __IFabricRuntime_FWD_DEFINED__ */ #ifndef __IFabricStatelessServiceFactory_FWD_DEFINED__ #define __IFabricStatelessServiceFactory_FWD_DEFINED__ typedef interface IFabricStatelessServiceFactory IFabricStatelessServiceFactory; #endif /* __IFabricStatelessServiceFactory_FWD_DEFINED__ */ #ifndef __IFabricStatelessServiceInstance_FWD_DEFINED__ #define __IFabricStatelessServiceInstance_FWD_DEFINED__ typedef interface IFabricStatelessServiceInstance IFabricStatelessServiceInstance; #endif /* __IFabricStatelessServiceInstance_FWD_DEFINED__ */ #ifndef __IFabricStatelessServicePartition_FWD_DEFINED__ #define __IFabricStatelessServicePartition_FWD_DEFINED__ typedef interface IFabricStatelessServicePartition IFabricStatelessServicePartition; #endif /* __IFabricStatelessServicePartition_FWD_DEFINED__ */ #ifndef __IFabricStatelessServicePartition1_FWD_DEFINED__ #define __IFabricStatelessServicePartition1_FWD_DEFINED__ typedef interface IFabricStatelessServicePartition1 IFabricStatelessServicePartition1; #endif /* __IFabricStatelessServicePartition1_FWD_DEFINED__ */ #ifndef __IFabricStatelessServicePartition2_FWD_DEFINED__ #define __IFabricStatelessServicePartition2_FWD_DEFINED__ typedef interface IFabricStatelessServicePartition2 IFabricStatelessServicePartition2; #endif /* __IFabricStatelessServicePartition2_FWD_DEFINED__ */ #ifndef __IFabricStatelessServicePartition3_FWD_DEFINED__ #define __IFabricStatelessServicePartition3_FWD_DEFINED__ typedef interface IFabricStatelessServicePartition3 IFabricStatelessServicePartition3; #endif /* __IFabricStatelessServicePartition3_FWD_DEFINED__ */ #ifndef __IFabricStatefulServiceFactory_FWD_DEFINED__ #define __IFabricStatefulServiceFactory_FWD_DEFINED__ typedef interface IFabricStatefulServiceFactory IFabricStatefulServiceFactory; #endif /* __IFabricStatefulServiceFactory_FWD_DEFINED__ */ #ifndef __IFabricStatefulServiceReplica_FWD_DEFINED__ #define __IFabricStatefulServiceReplica_FWD_DEFINED__ typedef interface IFabricStatefulServiceReplica IFabricStatefulServiceReplica; #endif /* __IFabricStatefulServiceReplica_FWD_DEFINED__ */ #ifndef __IFabricStatefulServicePartition_FWD_DEFINED__ #define __IFabricStatefulServicePartition_FWD_DEFINED__ typedef interface IFabricStatefulServicePartition IFabricStatefulServicePartition; #endif /* __IFabricStatefulServicePartition_FWD_DEFINED__ */ #ifndef __IFabricStatefulServicePartition1_FWD_DEFINED__ #define __IFabricStatefulServicePartition1_FWD_DEFINED__ typedef interface IFabricStatefulServicePartition1 IFabricStatefulServicePartition1; #endif /* __IFabricStatefulServicePartition1_FWD_DEFINED__ */ #ifndef __IFabricStatefulServicePartition2_FWD_DEFINED__ #define __IFabricStatefulServicePartition2_FWD_DEFINED__ typedef interface IFabricStatefulServicePartition2 IFabricStatefulServicePartition2; #endif /* __IFabricStatefulServicePartition2_FWD_DEFINED__ */ #ifndef __IFabricStatefulServicePartition3_FWD_DEFINED__ #define __IFabricStatefulServicePartition3_FWD_DEFINED__ typedef interface IFabricStatefulServicePartition3 IFabricStatefulServicePartition3; #endif /* __IFabricStatefulServicePartition3_FWD_DEFINED__ */ #ifndef __IFabricStateReplicator_FWD_DEFINED__ #define __IFabricStateReplicator_FWD_DEFINED__ typedef interface IFabricStateReplicator IFabricStateReplicator; #endif /* __IFabricStateReplicator_FWD_DEFINED__ */ #ifndef __IFabricStateReplicator2_FWD_DEFINED__ #define __IFabricStateReplicator2_FWD_DEFINED__ typedef interface IFabricStateReplicator2 IFabricStateReplicator2; #endif /* __IFabricStateReplicator2_FWD_DEFINED__ */ #ifndef __IFabricStateProvider_FWD_DEFINED__ #define __IFabricStateProvider_FWD_DEFINED__ typedef interface IFabricStateProvider IFabricStateProvider; #endif /* __IFabricStateProvider_FWD_DEFINED__ */ #ifndef __IFabricOperation_FWD_DEFINED__ #define __IFabricOperation_FWD_DEFINED__ typedef interface IFabricOperation IFabricOperation; #endif /* __IFabricOperation_FWD_DEFINED__ */ #ifndef __IFabricOperationData_FWD_DEFINED__ #define __IFabricOperationData_FWD_DEFINED__ typedef interface IFabricOperationData IFabricOperationData; #endif /* __IFabricOperationData_FWD_DEFINED__ */ #ifndef __IFabricOperationStream_FWD_DEFINED__ #define __IFabricOperationStream_FWD_DEFINED__ typedef interface IFabricOperationStream IFabricOperationStream; #endif /* __IFabricOperationStream_FWD_DEFINED__ */ #ifndef __IFabricOperationStream2_FWD_DEFINED__ #define __IFabricOperationStream2_FWD_DEFINED__ typedef interface IFabricOperationStream2 IFabricOperationStream2; #endif /* __IFabricOperationStream2_FWD_DEFINED__ */ #ifndef __IFabricOperationDataStream_FWD_DEFINED__ #define __IFabricOperationDataStream_FWD_DEFINED__ typedef interface IFabricOperationDataStream IFabricOperationDataStream; #endif /* __IFabricOperationDataStream_FWD_DEFINED__ */ #ifndef __IFabricReplicator_FWD_DEFINED__ #define __IFabricReplicator_FWD_DEFINED__ typedef interface IFabricReplicator IFabricReplicator; #endif /* __IFabricReplicator_FWD_DEFINED__ */ #ifndef __IFabricPrimaryReplicator_FWD_DEFINED__ #define __IFabricPrimaryReplicator_FWD_DEFINED__ typedef interface IFabricPrimaryReplicator IFabricPrimaryReplicator; #endif /* __IFabricPrimaryReplicator_FWD_DEFINED__ */ #ifndef __IFabricReplicatorCatchupSpecificQuorum_FWD_DEFINED__ #define __IFabricReplicatorCatchupSpecificQuorum_FWD_DEFINED__ typedef interface IFabricReplicatorCatchupSpecificQuorum IFabricReplicatorCatchupSpecificQuorum; #endif /* __IFabricReplicatorCatchupSpecificQuorum_FWD_DEFINED__ */ #ifndef __IFabricAtomicGroupStateReplicator_FWD_DEFINED__ #define __IFabricAtomicGroupStateReplicator_FWD_DEFINED__ typedef interface IFabricAtomicGroupStateReplicator IFabricAtomicGroupStateReplicator; #endif /* __IFabricAtomicGroupStateReplicator_FWD_DEFINED__ */ #ifndef __IFabricAtomicGroupStateProvider_FWD_DEFINED__ #define __IFabricAtomicGroupStateProvider_FWD_DEFINED__ typedef interface IFabricAtomicGroupStateProvider IFabricAtomicGroupStateProvider; #endif /* __IFabricAtomicGroupStateProvider_FWD_DEFINED__ */ #ifndef __IFabricServiceGroupFactory_FWD_DEFINED__ #define __IFabricServiceGroupFactory_FWD_DEFINED__ typedef interface IFabricServiceGroupFactory IFabricServiceGroupFactory; #endif /* __IFabricServiceGroupFactory_FWD_DEFINED__ */ #ifndef __IFabricServiceGroupFactoryBuilder_FWD_DEFINED__ #define __IFabricServiceGroupFactoryBuilder_FWD_DEFINED__ typedef interface IFabricServiceGroupFactoryBuilder IFabricServiceGroupFactoryBuilder; #endif /* __IFabricServiceGroupFactoryBuilder_FWD_DEFINED__ */ #ifndef __IFabricServiceGroupPartition_FWD_DEFINED__ #define __IFabricServiceGroupPartition_FWD_DEFINED__ typedef interface IFabricServiceGroupPartition IFabricServiceGroupPartition; #endif /* __IFabricServiceGroupPartition_FWD_DEFINED__ */ #ifndef __IFabricCodePackageActivationContext_FWD_DEFINED__ #define __IFabricCodePackageActivationContext_FWD_DEFINED__ typedef interface IFabricCodePackageActivationContext IFabricCodePackageActivationContext; #endif /* __IFabricCodePackageActivationContext_FWD_DEFINED__ */ #ifndef __IFabricCodePackageActivationContext2_FWD_DEFINED__ #define __IFabricCodePackageActivationContext2_FWD_DEFINED__ typedef interface IFabricCodePackageActivationContext2 IFabricCodePackageActivationContext2; #endif /* __IFabricCodePackageActivationContext2_FWD_DEFINED__ */ #ifndef __IFabricCodePackageActivationContext3_FWD_DEFINED__ #define __IFabricCodePackageActivationContext3_FWD_DEFINED__ typedef interface IFabricCodePackageActivationContext3 IFabricCodePackageActivationContext3; #endif /* __IFabricCodePackageActivationContext3_FWD_DEFINED__ */ #ifndef __IFabricCodePackageActivationContext4_FWD_DEFINED__ #define __IFabricCodePackageActivationContext4_FWD_DEFINED__ typedef interface IFabricCodePackageActivationContext4 IFabricCodePackageActivationContext4; #endif /* __IFabricCodePackageActivationContext4_FWD_DEFINED__ */ #ifndef __IFabricCodePackageActivationContext5_FWD_DEFINED__ #define __IFabricCodePackageActivationContext5_FWD_DEFINED__ typedef interface IFabricCodePackageActivationContext5 IFabricCodePackageActivationContext5; #endif /* __IFabricCodePackageActivationContext5_FWD_DEFINED__ */ #ifndef __IFabricCodePackageActivationContext6_FWD_DEFINED__ #define __IFabricCodePackageActivationContext6_FWD_DEFINED__ typedef interface IFabricCodePackageActivationContext6 IFabricCodePackageActivationContext6; #endif /* __IFabricCodePackageActivationContext6_FWD_DEFINED__ */ #ifndef __IFabricCodePackage_FWD_DEFINED__ #define __IFabricCodePackage_FWD_DEFINED__ typedef interface IFabricCodePackage IFabricCodePackage; #endif /* __IFabricCodePackage_FWD_DEFINED__ */ #ifndef __IFabricCodePackage2_FWD_DEFINED__ #define __IFabricCodePackage2_FWD_DEFINED__ typedef interface IFabricCodePackage2 IFabricCodePackage2; #endif /* __IFabricCodePackage2_FWD_DEFINED__ */ #ifndef __IFabricConfigurationPackage_FWD_DEFINED__ #define __IFabricConfigurationPackage_FWD_DEFINED__ typedef interface IFabricConfigurationPackage IFabricConfigurationPackage; #endif /* __IFabricConfigurationPackage_FWD_DEFINED__ */ #ifndef __IFabricConfigurationPackage2_FWD_DEFINED__ #define __IFabricConfigurationPackage2_FWD_DEFINED__ typedef interface IFabricConfigurationPackage2 IFabricConfigurationPackage2; #endif /* __IFabricConfigurationPackage2_FWD_DEFINED__ */ #ifndef __IFabricDataPackage_FWD_DEFINED__ #define __IFabricDataPackage_FWD_DEFINED__ typedef interface IFabricDataPackage IFabricDataPackage; #endif /* __IFabricDataPackage_FWD_DEFINED__ */ #ifndef __IFabricCodePackageChangeHandler_FWD_DEFINED__ #define __IFabricCodePackageChangeHandler_FWD_DEFINED__ typedef interface IFabricCodePackageChangeHandler IFabricCodePackageChangeHandler; #endif /* __IFabricCodePackageChangeHandler_FWD_DEFINED__ */ #ifndef __IFabricConfigurationPackageChangeHandler_FWD_DEFINED__ #define __IFabricConfigurationPackageChangeHandler_FWD_DEFINED__ typedef interface IFabricConfigurationPackageChangeHandler IFabricConfigurationPackageChangeHandler; #endif /* __IFabricConfigurationPackageChangeHandler_FWD_DEFINED__ */ #ifndef __IFabricDataPackageChangeHandler_FWD_DEFINED__ #define __IFabricDataPackageChangeHandler_FWD_DEFINED__ typedef interface IFabricDataPackageChangeHandler IFabricDataPackageChangeHandler; #endif /* __IFabricDataPackageChangeHandler_FWD_DEFINED__ */ #ifndef __IFabricProcessExitHandler_FWD_DEFINED__ #define __IFabricProcessExitHandler_FWD_DEFINED__ typedef interface IFabricProcessExitHandler IFabricProcessExitHandler; #endif /* __IFabricProcessExitHandler_FWD_DEFINED__ */ #ifndef __IFabricTransactionBase_FWD_DEFINED__ #define __IFabricTransactionBase_FWD_DEFINED__ typedef interface IFabricTransactionBase IFabricTransactionBase; #endif /* __IFabricTransactionBase_FWD_DEFINED__ */ #ifndef __IFabricTransaction_FWD_DEFINED__ #define __IFabricTransaction_FWD_DEFINED__ typedef interface IFabricTransaction IFabricTransaction; #endif /* __IFabricTransaction_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreReplica_FWD_DEFINED__ #define __IFabricKeyValueStoreReplica_FWD_DEFINED__ typedef interface IFabricKeyValueStoreReplica IFabricKeyValueStoreReplica; #endif /* __IFabricKeyValueStoreReplica_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreReplica2_FWD_DEFINED__ #define __IFabricKeyValueStoreReplica2_FWD_DEFINED__ typedef interface IFabricKeyValueStoreReplica2 IFabricKeyValueStoreReplica2; #endif /* __IFabricKeyValueStoreReplica2_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreReplica3_FWD_DEFINED__ #define __IFabricKeyValueStoreReplica3_FWD_DEFINED__ typedef interface IFabricKeyValueStoreReplica3 IFabricKeyValueStoreReplica3; #endif /* __IFabricKeyValueStoreReplica3_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreReplica4_FWD_DEFINED__ #define __IFabricKeyValueStoreReplica4_FWD_DEFINED__ typedef interface IFabricKeyValueStoreReplica4 IFabricKeyValueStoreReplica4; #endif /* __IFabricKeyValueStoreReplica4_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreReplica5_FWD_DEFINED__ #define __IFabricKeyValueStoreReplica5_FWD_DEFINED__ typedef interface IFabricKeyValueStoreReplica5 IFabricKeyValueStoreReplica5; #endif /* __IFabricKeyValueStoreReplica5_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreReplica6_FWD_DEFINED__ #define __IFabricKeyValueStoreReplica6_FWD_DEFINED__ typedef interface IFabricKeyValueStoreReplica6 IFabricKeyValueStoreReplica6; #endif /* __IFabricKeyValueStoreReplica6_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreEnumerator_FWD_DEFINED__ #define __IFabricKeyValueStoreEnumerator_FWD_DEFINED__ typedef interface IFabricKeyValueStoreEnumerator IFabricKeyValueStoreEnumerator; #endif /* __IFabricKeyValueStoreEnumerator_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreEnumerator2_FWD_DEFINED__ #define __IFabricKeyValueStoreEnumerator2_FWD_DEFINED__ typedef interface IFabricKeyValueStoreEnumerator2 IFabricKeyValueStoreEnumerator2; #endif /* __IFabricKeyValueStoreEnumerator2_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreItemEnumerator_FWD_DEFINED__ #define __IFabricKeyValueStoreItemEnumerator_FWD_DEFINED__ typedef interface IFabricKeyValueStoreItemEnumerator IFabricKeyValueStoreItemEnumerator; #endif /* __IFabricKeyValueStoreItemEnumerator_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreItemMetadataEnumerator_FWD_DEFINED__ #define __IFabricKeyValueStoreItemMetadataEnumerator_FWD_DEFINED__ typedef interface IFabricKeyValueStoreItemMetadataEnumerator IFabricKeyValueStoreItemMetadataEnumerator; #endif /* __IFabricKeyValueStoreItemMetadataEnumerator_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreNotificationEnumerator_FWD_DEFINED__ #define __IFabricKeyValueStoreNotificationEnumerator_FWD_DEFINED__ typedef interface IFabricKeyValueStoreNotificationEnumerator IFabricKeyValueStoreNotificationEnumerator; #endif /* __IFabricKeyValueStoreNotificationEnumerator_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreItemEnumerator2_FWD_DEFINED__ #define __IFabricKeyValueStoreItemEnumerator2_FWD_DEFINED__ typedef interface IFabricKeyValueStoreItemEnumerator2 IFabricKeyValueStoreItemEnumerator2; #endif /* __IFabricKeyValueStoreItemEnumerator2_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreItemMetadataEnumerator2_FWD_DEFINED__ #define __IFabricKeyValueStoreItemMetadataEnumerator2_FWD_DEFINED__ typedef interface IFabricKeyValueStoreItemMetadataEnumerator2 IFabricKeyValueStoreItemMetadataEnumerator2; #endif /* __IFabricKeyValueStoreItemMetadataEnumerator2_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreNotificationEnumerator2_FWD_DEFINED__ #define __IFabricKeyValueStoreNotificationEnumerator2_FWD_DEFINED__ typedef interface IFabricKeyValueStoreNotificationEnumerator2 IFabricKeyValueStoreNotificationEnumerator2; #endif /* __IFabricKeyValueStoreNotificationEnumerator2_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreItemResult_FWD_DEFINED__ #define __IFabricKeyValueStoreItemResult_FWD_DEFINED__ typedef interface IFabricKeyValueStoreItemResult IFabricKeyValueStoreItemResult; #endif /* __IFabricKeyValueStoreItemResult_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreItemMetadataResult_FWD_DEFINED__ #define __IFabricKeyValueStoreItemMetadataResult_FWD_DEFINED__ typedef interface IFabricKeyValueStoreItemMetadataResult IFabricKeyValueStoreItemMetadataResult; #endif /* __IFabricKeyValueStoreItemMetadataResult_FWD_DEFINED__ */ #ifndef __IFabricKeyValueStoreNotification_FWD_DEFINED__ #define __IFabricKeyValueStoreNotification_FWD_DEFINED__ typedef interface IFabricKeyValueStoreNotification IFabricKeyValueStoreNotification; #endif /* __IFabricKeyValueStoreNotification_FWD_DEFINED__ */ #ifndef __IFabricStoreEventHandler_FWD_DEFINED__ #define __IFabricStoreEventHandler_FWD_DEFINED__ typedef interface IFabricStoreEventHandler IFabricStoreEventHandler; #endif /* __IFabricStoreEventHandler_FWD_DEFINED__ */ #ifndef __IFabricStoreEventHandler2_FWD_DEFINED__ #define __IFabricStoreEventHandler2_FWD_DEFINED__ typedef interface IFabricStoreEventHandler2 IFabricStoreEventHandler2; #endif /* __IFabricStoreEventHandler2_FWD_DEFINED__ */ #ifndef __IFabricStorePostBackupHandler_FWD_DEFINED__ #define __IFabricStorePostBackupHandler_FWD_DEFINED__ typedef interface IFabricStorePostBackupHandler IFabricStorePostBackupHandler; #endif /* __IFabricStorePostBackupHandler_FWD_DEFINED__ */ #ifndef __IFabricSecondaryEventHandler_FWD_DEFINED__ #define __IFabricSecondaryEventHandler_FWD_DEFINED__ typedef interface IFabricSecondaryEventHandler IFabricSecondaryEventHandler; #endif /* __IFabricSecondaryEventHandler_FWD_DEFINED__ */ #ifndef __IFabricNodeContextResult_FWD_DEFINED__ #define __IFabricNodeContextResult_FWD_DEFINED__ typedef interface IFabricNodeContextResult IFabricNodeContextResult; #endif /* __IFabricNodeContextResult_FWD_DEFINED__ */ #ifndef __IFabricNodeContextResult2_FWD_DEFINED__ #define __IFabricNodeContextResult2_FWD_DEFINED__ typedef interface IFabricNodeContextResult2 IFabricNodeContextResult2; #endif /* __IFabricNodeContextResult2_FWD_DEFINED__ */ #ifndef __IFabricReplicatorSettingsResult_FWD_DEFINED__ #define __IFabricReplicatorSettingsResult_FWD_DEFINED__ typedef interface IFabricReplicatorSettingsResult IFabricReplicatorSettingsResult; #endif /* __IFabricReplicatorSettingsResult_FWD_DEFINED__ */ #ifndef __IFabricEseLocalStoreSettingsResult_FWD_DEFINED__ #define __IFabricEseLocalStoreSettingsResult_FWD_DEFINED__ typedef interface IFabricEseLocalStoreSettingsResult IFabricEseLocalStoreSettingsResult; #endif /* __IFabricEseLocalStoreSettingsResult_FWD_DEFINED__ */ #ifndef __IFabricSecurityCredentialsResult_FWD_DEFINED__ #define __IFabricSecurityCredentialsResult_FWD_DEFINED__ typedef interface IFabricSecurityCredentialsResult IFabricSecurityCredentialsResult; #endif /* __IFabricSecurityCredentialsResult_FWD_DEFINED__ */ #ifndef __IFabricCodePackageActivator_FWD_DEFINED__ #define __IFabricCodePackageActivator_FWD_DEFINED__ typedef interface IFabricCodePackageActivator IFabricCodePackageActivator; #endif /* __IFabricCodePackageActivator_FWD_DEFINED__ */ #ifndef __IFabricCodePackageEventHandler_FWD_DEFINED__ #define __IFabricCodePackageEventHandler_FWD_DEFINED__ typedef interface IFabricCodePackageEventHandler IFabricCodePackageEventHandler; #endif /* __IFabricCodePackageEventHandler_FWD_DEFINED__ */ /* header files for imported files */ #include "Unknwn.h" #include "FabricTypes.h" #include "FabricCommon.h" #ifdef __cplusplus extern "C"{ #endif /* interface __MIDL_itf_fabricruntime_0000_0000 */ /* [local] */ // ------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License (MIT). See License.txt in the repo root for license information. // ------------------------------------------------------------ #if ( _MSC_VER >= 1020 ) #pragma once #endif extern RPC_IF_HANDLE __MIDL_itf_fabricruntime_0000_0000_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_fabricruntime_0000_0000_v0_0_s_ifspec; #ifndef __FabricRuntimeLib_LIBRARY_DEFINED__ #define __FabricRuntimeLib_LIBRARY_DEFINED__ /* library FabricRuntimeLib */ /* [version][helpstring][uuid] */ #pragma pack(push, 8) #pragma pack(pop) EXTERN_C const IID LIBID_FabricRuntimeLib; #ifndef __IFabricRuntime_INTERFACE_DEFINED__ #define __IFabricRuntime_INTERFACE_DEFINED__ /* interface IFabricRuntime */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricRuntime; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("cc53af8e-74cd-11df-ac3e-0024811e3892") IFabricRuntime : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE BeginRegisterStatelessServiceFactory( /* [in] */ LPCWSTR serviceTypeName, /* [in] */ IFabricStatelessServiceFactory *factory, /* [in] */ DWORD timeoutMilliseconds, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndRegisterStatelessServiceFactory( /* [in] */ IFabricAsyncOperationContext *context) = 0; virtual HRESULT STDMETHODCALLTYPE RegisterStatelessServiceFactory( /* [in] */ LPCWSTR serviceTypeName, /* [in] */ IFabricStatelessServiceFactory *factory) = 0; virtual HRESULT STDMETHODCALLTYPE BeginRegisterStatefulServiceFactory( /* [in] */ LPCWSTR serviceTypeName, /* [in] */ IFabricStatefulServiceFactory *factory, /* [in] */ DWORD timeoutMilliseconds, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndRegisterStatefulServiceFactory( /* [in] */ IFabricAsyncOperationContext *context) = 0; virtual HRESULT STDMETHODCALLTYPE RegisterStatefulServiceFactory( /* [in] */ LPCWSTR serviceTypeName, /* [in] */ IFabricStatefulServiceFactory *factory) = 0; virtual HRESULT STDMETHODCALLTYPE CreateServiceGroupFactoryBuilder( /* [retval][out] */ IFabricServiceGroupFactoryBuilder **builder) = 0; virtual HRESULT STDMETHODCALLTYPE BeginRegisterServiceGroupFactory( /* [in] */ LPCWSTR groupServiceType, /* [in] */ IFabricServiceGroupFactory *factory, /* [in] */ DWORD timeoutMilliseconds, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndRegisterServiceGroupFactory( /* [in] */ IFabricAsyncOperationContext *context) = 0; virtual HRESULT STDMETHODCALLTYPE RegisterServiceGroupFactory( /* [in] */ LPCWSTR groupServiceType, /* [in] */ IFabricServiceGroupFactory *factory) = 0; }; #else /* C style interface */ typedef struct IFabricRuntimeVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricRuntime * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricRuntime * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricRuntime * This); HRESULT ( STDMETHODCALLTYPE *BeginRegisterStatelessServiceFactory )( IFabricRuntime * This, /* [in] */ LPCWSTR serviceTypeName, /* [in] */ IFabricStatelessServiceFactory *factory, /* [in] */ DWORD timeoutMilliseconds, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndRegisterStatelessServiceFactory )( IFabricRuntime * This, /* [in] */ IFabricAsyncOperationContext *context); HRESULT ( STDMETHODCALLTYPE *RegisterStatelessServiceFactory )( IFabricRuntime * This, /* [in] */ LPCWSTR serviceTypeName, /* [in] */ IFabricStatelessServiceFactory *factory); HRESULT ( STDMETHODCALLTYPE *BeginRegisterStatefulServiceFactory )( IFabricRuntime * This, /* [in] */ LPCWSTR serviceTypeName, /* [in] */ IFabricStatefulServiceFactory *factory, /* [in] */ DWORD timeoutMilliseconds, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndRegisterStatefulServiceFactory )( IFabricRuntime * This, /* [in] */ IFabricAsyncOperationContext *context); HRESULT ( STDMETHODCALLTYPE *RegisterStatefulServiceFactory )( IFabricRuntime * This, /* [in] */ LPCWSTR serviceTypeName, /* [in] */ IFabricStatefulServiceFactory *factory); HRESULT ( STDMETHODCALLTYPE *CreateServiceGroupFactoryBuilder )( IFabricRuntime * This, /* [retval][out] */ IFabricServiceGroupFactoryBuilder **builder); HRESULT ( STDMETHODCALLTYPE *BeginRegisterServiceGroupFactory )( IFabricRuntime * This, /* [in] */ LPCWSTR groupServiceType, /* [in] */ IFabricServiceGroupFactory *factory, /* [in] */ DWORD timeoutMilliseconds, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndRegisterServiceGroupFactory )( IFabricRuntime * This, /* [in] */ IFabricAsyncOperationContext *context); HRESULT ( STDMETHODCALLTYPE *RegisterServiceGroupFactory )( IFabricRuntime * This, /* [in] */ LPCWSTR groupServiceType, /* [in] */ IFabricServiceGroupFactory *factory); END_INTERFACE } IFabricRuntimeVtbl; interface IFabricRuntime { CONST_VTBL struct IFabricRuntimeVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricRuntime_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricRuntime_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricRuntime_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricRuntime_BeginRegisterStatelessServiceFactory(This,serviceTypeName,factory,timeoutMilliseconds,callback,context) \ ( (This)->lpVtbl -> BeginRegisterStatelessServiceFactory(This,serviceTypeName,factory,timeoutMilliseconds,callback,context) ) #define IFabricRuntime_EndRegisterStatelessServiceFactory(This,context) \ ( (This)->lpVtbl -> EndRegisterStatelessServiceFactory(This,context) ) #define IFabricRuntime_RegisterStatelessServiceFactory(This,serviceTypeName,factory) \ ( (This)->lpVtbl -> RegisterStatelessServiceFactory(This,serviceTypeName,factory) ) #define IFabricRuntime_BeginRegisterStatefulServiceFactory(This,serviceTypeName,factory,timeoutMilliseconds,callback,context) \ ( (This)->lpVtbl -> BeginRegisterStatefulServiceFactory(This,serviceTypeName,factory,timeoutMilliseconds,callback,context) ) #define IFabricRuntime_EndRegisterStatefulServiceFactory(This,context) \ ( (This)->lpVtbl -> EndRegisterStatefulServiceFactory(This,context) ) #define IFabricRuntime_RegisterStatefulServiceFactory(This,serviceTypeName,factory) \ ( (This)->lpVtbl -> RegisterStatefulServiceFactory(This,serviceTypeName,factory) ) #define IFabricRuntime_CreateServiceGroupFactoryBuilder(This,builder) \ ( (This)->lpVtbl -> CreateServiceGroupFactoryBuilder(This,builder) ) #define IFabricRuntime_BeginRegisterServiceGroupFactory(This,groupServiceType,factory,timeoutMilliseconds,callback,context) \ ( (This)->lpVtbl -> BeginRegisterServiceGroupFactory(This,groupServiceType,factory,timeoutMilliseconds,callback,context) ) #define IFabricRuntime_EndRegisterServiceGroupFactory(This,context) \ ( (This)->lpVtbl -> EndRegisterServiceGroupFactory(This,context) ) #define IFabricRuntime_RegisterServiceGroupFactory(This,groupServiceType,factory) \ ( (This)->lpVtbl -> RegisterServiceGroupFactory(This,groupServiceType,factory) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricRuntime_INTERFACE_DEFINED__ */ #ifndef __IFabricProcessExitHandler_INTERFACE_DEFINED__ #define __IFabricProcessExitHandler_INTERFACE_DEFINED__ /* interface IFabricProcessExitHandler */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricProcessExitHandler; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("c58d50a2-01f0-4267-bbe7-223b565c1346") IFabricProcessExitHandler : public IUnknown { public: virtual void STDMETHODCALLTYPE FabricProcessExited( void) = 0; }; #else /* C style interface */ typedef struct IFabricProcessExitHandlerVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricProcessExitHandler * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricProcessExitHandler * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricProcessExitHandler * This); void ( STDMETHODCALLTYPE *FabricProcessExited )( IFabricProcessExitHandler * This); END_INTERFACE } IFabricProcessExitHandlerVtbl; interface IFabricProcessExitHandler { CONST_VTBL struct IFabricProcessExitHandlerVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricProcessExitHandler_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricProcessExitHandler_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricProcessExitHandler_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricProcessExitHandler_FabricProcessExited(This) \ ( (This)->lpVtbl -> FabricProcessExited(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricProcessExitHandler_INTERFACE_DEFINED__ */ #ifndef __IFabricStatelessServiceFactory_INTERFACE_DEFINED__ #define __IFabricStatelessServiceFactory_INTERFACE_DEFINED__ /* interface IFabricStatelessServiceFactory */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricStatelessServiceFactory; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("cc53af8f-74cd-11df-ac3e-0024811e3892") IFabricStatelessServiceFactory : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE CreateInstance( /* [in] */ LPCWSTR serviceTypeName, /* [in] */ FABRIC_URI serviceName, /* [in] */ ULONG initializationDataLength, /* [size_is][in] */ const byte *initializationData, /* [in] */ FABRIC_PARTITION_ID partitionId, /* [in] */ FABRIC_INSTANCE_ID instanceId, /* [retval][out] */ IFabricStatelessServiceInstance **serviceInstance) = 0; }; #else /* C style interface */ typedef struct IFabricStatelessServiceFactoryVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricStatelessServiceFactory * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricStatelessServiceFactory * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricStatelessServiceFactory * This); HRESULT ( STDMETHODCALLTYPE *CreateInstance )( IFabricStatelessServiceFactory * This, /* [in] */ LPCWSTR serviceTypeName, /* [in] */ FABRIC_URI serviceName, /* [in] */ ULONG initializationDataLength, /* [size_is][in] */ const byte *initializationData, /* [in] */ FABRIC_PARTITION_ID partitionId, /* [in] */ FABRIC_INSTANCE_ID instanceId, /* [retval][out] */ IFabricStatelessServiceInstance **serviceInstance); END_INTERFACE } IFabricStatelessServiceFactoryVtbl; interface IFabricStatelessServiceFactory { CONST_VTBL struct IFabricStatelessServiceFactoryVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricStatelessServiceFactory_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricStatelessServiceFactory_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricStatelessServiceFactory_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricStatelessServiceFactory_CreateInstance(This,serviceTypeName,serviceName,initializationDataLength,initializationData,partitionId,instanceId,serviceInstance) \ ( (This)->lpVtbl -> CreateInstance(This,serviceTypeName,serviceName,initializationDataLength,initializationData,partitionId,instanceId,serviceInstance) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricStatelessServiceFactory_INTERFACE_DEFINED__ */ #ifndef __IFabricStatelessServiceInstance_INTERFACE_DEFINED__ #define __IFabricStatelessServiceInstance_INTERFACE_DEFINED__ /* interface IFabricStatelessServiceInstance */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricStatelessServiceInstance; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("cc53af90-74cd-11df-ac3e-0024811e3892") IFabricStatelessServiceInstance : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE BeginOpen( /* [in] */ IFabricStatelessServicePartition *partition, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndOpen( /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricStringResult **serviceAddress) = 0; virtual HRESULT STDMETHODCALLTYPE BeginClose( /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndClose( /* [in] */ IFabricAsyncOperationContext *context) = 0; virtual void STDMETHODCALLTYPE Abort( void) = 0; }; #else /* C style interface */ typedef struct IFabricStatelessServiceInstanceVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricStatelessServiceInstance * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricStatelessServiceInstance * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricStatelessServiceInstance * This); HRESULT ( STDMETHODCALLTYPE *BeginOpen )( IFabricStatelessServiceInstance * This, /* [in] */ IFabricStatelessServicePartition *partition, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndOpen )( IFabricStatelessServiceInstance * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricStringResult **serviceAddress); HRESULT ( STDMETHODCALLTYPE *BeginClose )( IFabricStatelessServiceInstance * This, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndClose )( IFabricStatelessServiceInstance * This, /* [in] */ IFabricAsyncOperationContext *context); void ( STDMETHODCALLTYPE *Abort )( IFabricStatelessServiceInstance * This); END_INTERFACE } IFabricStatelessServiceInstanceVtbl; interface IFabricStatelessServiceInstance { CONST_VTBL struct IFabricStatelessServiceInstanceVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricStatelessServiceInstance_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricStatelessServiceInstance_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricStatelessServiceInstance_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricStatelessServiceInstance_BeginOpen(This,partition,callback,context) \ ( (This)->lpVtbl -> BeginOpen(This,partition,callback,context) ) #define IFabricStatelessServiceInstance_EndOpen(This,context,serviceAddress) \ ( (This)->lpVtbl -> EndOpen(This,context,serviceAddress) ) #define IFabricStatelessServiceInstance_BeginClose(This,callback,context) \ ( (This)->lpVtbl -> BeginClose(This,callback,context) ) #define IFabricStatelessServiceInstance_EndClose(This,context) \ ( (This)->lpVtbl -> EndClose(This,context) ) #define IFabricStatelessServiceInstance_Abort(This) \ ( (This)->lpVtbl -> Abort(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricStatelessServiceInstance_INTERFACE_DEFINED__ */ #ifndef __IFabricStatelessServicePartition_INTERFACE_DEFINED__ #define __IFabricStatelessServicePartition_INTERFACE_DEFINED__ /* interface IFabricStatelessServicePartition */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricStatelessServicePartition; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("cc53af91-74cd-11df-ac3e-0024811e3892") IFabricStatelessServicePartition : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE GetPartitionInfo( /* [retval][out] */ const FABRIC_SERVICE_PARTITION_INFORMATION **bufferedValue) = 0; virtual HRESULT STDMETHODCALLTYPE ReportLoad( /* [in] */ ULONG metricCount, /* [size_is][in] */ const FABRIC_LOAD_METRIC *metrics) = 0; virtual HRESULT STDMETHODCALLTYPE ReportFault( /* [in] */ FABRIC_FAULT_TYPE faultType) = 0; }; #else /* C style interface */ typedef struct IFabricStatelessServicePartitionVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricStatelessServicePartition * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricStatelessServicePartition * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricStatelessServicePartition * This); HRESULT ( STDMETHODCALLTYPE *GetPartitionInfo )( IFabricStatelessServicePartition * This, /* [retval][out] */ const FABRIC_SERVICE_PARTITION_INFORMATION **bufferedValue); HRESULT ( STDMETHODCALLTYPE *ReportLoad )( IFabricStatelessServicePartition * This, /* [in] */ ULONG metricCount, /* [size_is][in] */ const FABRIC_LOAD_METRIC *metrics); HRESULT ( STDMETHODCALLTYPE *ReportFault )( IFabricStatelessServicePartition * This, /* [in] */ FABRIC_FAULT_TYPE faultType); END_INTERFACE } IFabricStatelessServicePartitionVtbl; interface IFabricStatelessServicePartition { CONST_VTBL struct IFabricStatelessServicePartitionVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricStatelessServicePartition_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricStatelessServicePartition_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricStatelessServicePartition_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricStatelessServicePartition_GetPartitionInfo(This,bufferedValue) \ ( (This)->lpVtbl -> GetPartitionInfo(This,bufferedValue) ) #define IFabricStatelessServicePartition_ReportLoad(This,metricCount,metrics) \ ( (This)->lpVtbl -> ReportLoad(This,metricCount,metrics) ) #define IFabricStatelessServicePartition_ReportFault(This,faultType) \ ( (This)->lpVtbl -> ReportFault(This,faultType) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricStatelessServicePartition_INTERFACE_DEFINED__ */ #ifndef __IFabricStatelessServicePartition1_INTERFACE_DEFINED__ #define __IFabricStatelessServicePartition1_INTERFACE_DEFINED__ /* interface IFabricStatelessServicePartition1 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricStatelessServicePartition1; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("bf6bb505-7bd0-4371-b6c0-cba319a5e50b") IFabricStatelessServicePartition1 : public IFabricStatelessServicePartition { public: virtual HRESULT STDMETHODCALLTYPE ReportMoveCost( /* [in] */ FABRIC_MOVE_COST moveCost) = 0; }; #else /* C style interface */ typedef struct IFabricStatelessServicePartition1Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricStatelessServicePartition1 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricStatelessServicePartition1 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricStatelessServicePartition1 * This); HRESULT ( STDMETHODCALLTYPE *GetPartitionInfo )( IFabricStatelessServicePartition1 * This, /* [retval][out] */ const FABRIC_SERVICE_PARTITION_INFORMATION **bufferedValue); HRESULT ( STDMETHODCALLTYPE *ReportLoad )( IFabricStatelessServicePartition1 * This, /* [in] */ ULONG metricCount, /* [size_is][in] */ const FABRIC_LOAD_METRIC *metrics); HRESULT ( STDMETHODCALLTYPE *ReportFault )( IFabricStatelessServicePartition1 * This, /* [in] */ FABRIC_FAULT_TYPE faultType); HRESULT ( STDMETHODCALLTYPE *ReportMoveCost )( IFabricStatelessServicePartition1 * This, /* [in] */ FABRIC_MOVE_COST moveCost); END_INTERFACE } IFabricStatelessServicePartition1Vtbl; interface IFabricStatelessServicePartition1 { CONST_VTBL struct IFabricStatelessServicePartition1Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricStatelessServicePartition1_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricStatelessServicePartition1_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricStatelessServicePartition1_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricStatelessServicePartition1_GetPartitionInfo(This,bufferedValue) \ ( (This)->lpVtbl -> GetPartitionInfo(This,bufferedValue) ) #define IFabricStatelessServicePartition1_ReportLoad(This,metricCount,metrics) \ ( (This)->lpVtbl -> ReportLoad(This,metricCount,metrics) ) #define IFabricStatelessServicePartition1_ReportFault(This,faultType) \ ( (This)->lpVtbl -> ReportFault(This,faultType) ) #define IFabricStatelessServicePartition1_ReportMoveCost(This,moveCost) \ ( (This)->lpVtbl -> ReportMoveCost(This,moveCost) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricStatelessServicePartition1_INTERFACE_DEFINED__ */ #ifndef __IFabricStatelessServicePartition2_INTERFACE_DEFINED__ #define __IFabricStatelessServicePartition2_INTERFACE_DEFINED__ /* interface IFabricStatelessServicePartition2 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricStatelessServicePartition2; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("9ff35b6c-9d97-4312-93ad-7f34cbdb4ca4") IFabricStatelessServicePartition2 : public IFabricStatelessServicePartition1 { public: virtual HRESULT STDMETHODCALLTYPE ReportInstanceHealth( /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo) = 0; virtual HRESULT STDMETHODCALLTYPE ReportPartitionHealth( /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo) = 0; }; #else /* C style interface */ typedef struct IFabricStatelessServicePartition2Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricStatelessServicePartition2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricStatelessServicePartition2 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricStatelessServicePartition2 * This); HRESULT ( STDMETHODCALLTYPE *GetPartitionInfo )( IFabricStatelessServicePartition2 * This, /* [retval][out] */ const FABRIC_SERVICE_PARTITION_INFORMATION **bufferedValue); HRESULT ( STDMETHODCALLTYPE *ReportLoad )( IFabricStatelessServicePartition2 * This, /* [in] */ ULONG metricCount, /* [size_is][in] */ const FABRIC_LOAD_METRIC *metrics); HRESULT ( STDMETHODCALLTYPE *ReportFault )( IFabricStatelessServicePartition2 * This, /* [in] */ FABRIC_FAULT_TYPE faultType); HRESULT ( STDMETHODCALLTYPE *ReportMoveCost )( IFabricStatelessServicePartition2 * This, /* [in] */ FABRIC_MOVE_COST moveCost); HRESULT ( STDMETHODCALLTYPE *ReportInstanceHealth )( IFabricStatelessServicePartition2 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo); HRESULT ( STDMETHODCALLTYPE *ReportPartitionHealth )( IFabricStatelessServicePartition2 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo); END_INTERFACE } IFabricStatelessServicePartition2Vtbl; interface IFabricStatelessServicePartition2 { CONST_VTBL struct IFabricStatelessServicePartition2Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricStatelessServicePartition2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricStatelessServicePartition2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricStatelessServicePartition2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricStatelessServicePartition2_GetPartitionInfo(This,bufferedValue) \ ( (This)->lpVtbl -> GetPartitionInfo(This,bufferedValue) ) #define IFabricStatelessServicePartition2_ReportLoad(This,metricCount,metrics) \ ( (This)->lpVtbl -> ReportLoad(This,metricCount,metrics) ) #define IFabricStatelessServicePartition2_ReportFault(This,faultType) \ ( (This)->lpVtbl -> ReportFault(This,faultType) ) #define IFabricStatelessServicePartition2_ReportMoveCost(This,moveCost) \ ( (This)->lpVtbl -> ReportMoveCost(This,moveCost) ) #define IFabricStatelessServicePartition2_ReportInstanceHealth(This,healthInfo) \ ( (This)->lpVtbl -> ReportInstanceHealth(This,healthInfo) ) #define IFabricStatelessServicePartition2_ReportPartitionHealth(This,healthInfo) \ ( (This)->lpVtbl -> ReportPartitionHealth(This,healthInfo) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricStatelessServicePartition2_INTERFACE_DEFINED__ */ #ifndef __IFabricStatelessServicePartition3_INTERFACE_DEFINED__ #define __IFabricStatelessServicePartition3_INTERFACE_DEFINED__ /* interface IFabricStatelessServicePartition3 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricStatelessServicePartition3; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f2fa2000-70a7-4ed5-9d3e-0b7deca2433f") IFabricStatelessServicePartition3 : public IFabricStatelessServicePartition2 { public: virtual HRESULT STDMETHODCALLTYPE ReportInstanceHealth2( /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo, /* [in] */ const FABRIC_HEALTH_REPORT_SEND_OPTIONS *sendOptions) = 0; virtual HRESULT STDMETHODCALLTYPE ReportPartitionHealth2( /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo, /* [in] */ const FABRIC_HEALTH_REPORT_SEND_OPTIONS *sendOptions) = 0; }; #else /* C style interface */ typedef struct IFabricStatelessServicePartition3Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricStatelessServicePartition3 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricStatelessServicePartition3 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricStatelessServicePartition3 * This); HRESULT ( STDMETHODCALLTYPE *GetPartitionInfo )( IFabricStatelessServicePartition3 * This, /* [retval][out] */ const FABRIC_SERVICE_PARTITION_INFORMATION **bufferedValue); HRESULT ( STDMETHODCALLTYPE *ReportLoad )( IFabricStatelessServicePartition3 * This, /* [in] */ ULONG metricCount, /* [size_is][in] */ const FABRIC_LOAD_METRIC *metrics); HRESULT ( STDMETHODCALLTYPE *ReportFault )( IFabricStatelessServicePartition3 * This, /* [in] */ FABRIC_FAULT_TYPE faultType); HRESULT ( STDMETHODCALLTYPE *ReportMoveCost )( IFabricStatelessServicePartition3 * This, /* [in] */ FABRIC_MOVE_COST moveCost); HRESULT ( STDMETHODCALLTYPE *ReportInstanceHealth )( IFabricStatelessServicePartition3 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo); HRESULT ( STDMETHODCALLTYPE *ReportPartitionHealth )( IFabricStatelessServicePartition3 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo); HRESULT ( STDMETHODCALLTYPE *ReportInstanceHealth2 )( IFabricStatelessServicePartition3 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo, /* [in] */ const FABRIC_HEALTH_REPORT_SEND_OPTIONS *sendOptions); HRESULT ( STDMETHODCALLTYPE *ReportPartitionHealth2 )( IFabricStatelessServicePartition3 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo, /* [in] */ const FABRIC_HEALTH_REPORT_SEND_OPTIONS *sendOptions); END_INTERFACE } IFabricStatelessServicePartition3Vtbl; interface IFabricStatelessServicePartition3 { CONST_VTBL struct IFabricStatelessServicePartition3Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricStatelessServicePartition3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricStatelessServicePartition3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricStatelessServicePartition3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricStatelessServicePartition3_GetPartitionInfo(This,bufferedValue) \ ( (This)->lpVtbl -> GetPartitionInfo(This,bufferedValue) ) #define IFabricStatelessServicePartition3_ReportLoad(This,metricCount,metrics) \ ( (This)->lpVtbl -> ReportLoad(This,metricCount,metrics) ) #define IFabricStatelessServicePartition3_ReportFault(This,faultType) \ ( (This)->lpVtbl -> ReportFault(This,faultType) ) #define IFabricStatelessServicePartition3_ReportMoveCost(This,moveCost) \ ( (This)->lpVtbl -> ReportMoveCost(This,moveCost) ) #define IFabricStatelessServicePartition3_ReportInstanceHealth(This,healthInfo) \ ( (This)->lpVtbl -> ReportInstanceHealth(This,healthInfo) ) #define IFabricStatelessServicePartition3_ReportPartitionHealth(This,healthInfo) \ ( (This)->lpVtbl -> ReportPartitionHealth(This,healthInfo) ) #define IFabricStatelessServicePartition3_ReportInstanceHealth2(This,healthInfo,sendOptions) \ ( (This)->lpVtbl -> ReportInstanceHealth2(This,healthInfo,sendOptions) ) #define IFabricStatelessServicePartition3_ReportPartitionHealth2(This,healthInfo,sendOptions) \ ( (This)->lpVtbl -> ReportPartitionHealth2(This,healthInfo,sendOptions) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricStatelessServicePartition3_INTERFACE_DEFINED__ */ #ifndef __IFabricStatefulServiceFactory_INTERFACE_DEFINED__ #define __IFabricStatefulServiceFactory_INTERFACE_DEFINED__ /* interface IFabricStatefulServiceFactory */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricStatefulServiceFactory; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("77ff0c6b-6780-48ec-b4b0-61989327b0f2") IFabricStatefulServiceFactory : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE CreateReplica( /* [in] */ LPCWSTR serviceTypeName, /* [in] */ FABRIC_URI serviceName, /* [in] */ ULONG initializationDataLength, /* [size_is][in] */ const byte *initializationData, /* [in] */ FABRIC_PARTITION_ID partitionId, /* [in] */ FABRIC_REPLICA_ID replicaId, /* [retval][out] */ IFabricStatefulServiceReplica **serviceReplica) = 0; }; #else /* C style interface */ typedef struct IFabricStatefulServiceFactoryVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricStatefulServiceFactory * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricStatefulServiceFactory * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricStatefulServiceFactory * This); HRESULT ( STDMETHODCALLTYPE *CreateReplica )( IFabricStatefulServiceFactory * This, /* [in] */ LPCWSTR serviceTypeName, /* [in] */ FABRIC_URI serviceName, /* [in] */ ULONG initializationDataLength, /* [size_is][in] */ const byte *initializationData, /* [in] */ FABRIC_PARTITION_ID partitionId, /* [in] */ FABRIC_REPLICA_ID replicaId, /* [retval][out] */ IFabricStatefulServiceReplica **serviceReplica); END_INTERFACE } IFabricStatefulServiceFactoryVtbl; interface IFabricStatefulServiceFactory { CONST_VTBL struct IFabricStatefulServiceFactoryVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricStatefulServiceFactory_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricStatefulServiceFactory_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricStatefulServiceFactory_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricStatefulServiceFactory_CreateReplica(This,serviceTypeName,serviceName,initializationDataLength,initializationData,partitionId,replicaId,serviceReplica) \ ( (This)->lpVtbl -> CreateReplica(This,serviceTypeName,serviceName,initializationDataLength,initializationData,partitionId,replicaId,serviceReplica) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricStatefulServiceFactory_INTERFACE_DEFINED__ */ #ifndef __IFabricStatefulServiceReplica_INTERFACE_DEFINED__ #define __IFabricStatefulServiceReplica_INTERFACE_DEFINED__ /* interface IFabricStatefulServiceReplica */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricStatefulServiceReplica; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("8ae3be0e-505d-4dc1-ad8f-0cb0f9576b8a") IFabricStatefulServiceReplica : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE BeginOpen( /* [in] */ FABRIC_REPLICA_OPEN_MODE openMode, /* [in] */ IFabricStatefulServicePartition *partition, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndOpen( /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricReplicator **replicator) = 0; virtual HRESULT STDMETHODCALLTYPE BeginChangeRole( /* [in] */ FABRIC_REPLICA_ROLE newRole, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndChangeRole( /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricStringResult **serviceAddress) = 0; virtual HRESULT STDMETHODCALLTYPE BeginClose( /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndClose( /* [in] */ IFabricAsyncOperationContext *context) = 0; virtual void STDMETHODCALLTYPE Abort( void) = 0; }; #else /* C style interface */ typedef struct IFabricStatefulServiceReplicaVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricStatefulServiceReplica * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricStatefulServiceReplica * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricStatefulServiceReplica * This); HRESULT ( STDMETHODCALLTYPE *BeginOpen )( IFabricStatefulServiceReplica * This, /* [in] */ FABRIC_REPLICA_OPEN_MODE openMode, /* [in] */ IFabricStatefulServicePartition *partition, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndOpen )( IFabricStatefulServiceReplica * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricReplicator **replicator); HRESULT ( STDMETHODCALLTYPE *BeginChangeRole )( IFabricStatefulServiceReplica * This, /* [in] */ FABRIC_REPLICA_ROLE newRole, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndChangeRole )( IFabricStatefulServiceReplica * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricStringResult **serviceAddress); HRESULT ( STDMETHODCALLTYPE *BeginClose )( IFabricStatefulServiceReplica * This, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndClose )( IFabricStatefulServiceReplica * This, /* [in] */ IFabricAsyncOperationContext *context); void ( STDMETHODCALLTYPE *Abort )( IFabricStatefulServiceReplica * This); END_INTERFACE } IFabricStatefulServiceReplicaVtbl; interface IFabricStatefulServiceReplica { CONST_VTBL struct IFabricStatefulServiceReplicaVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricStatefulServiceReplica_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricStatefulServiceReplica_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricStatefulServiceReplica_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricStatefulServiceReplica_BeginOpen(This,openMode,partition,callback,context) \ ( (This)->lpVtbl -> BeginOpen(This,openMode,partition,callback,context) ) #define IFabricStatefulServiceReplica_EndOpen(This,context,replicator) \ ( (This)->lpVtbl -> EndOpen(This,context,replicator) ) #define IFabricStatefulServiceReplica_BeginChangeRole(This,newRole,callback,context) \ ( (This)->lpVtbl -> BeginChangeRole(This,newRole,callback,context) ) #define IFabricStatefulServiceReplica_EndChangeRole(This,context,serviceAddress) \ ( (This)->lpVtbl -> EndChangeRole(This,context,serviceAddress) ) #define IFabricStatefulServiceReplica_BeginClose(This,callback,context) \ ( (This)->lpVtbl -> BeginClose(This,callback,context) ) #define IFabricStatefulServiceReplica_EndClose(This,context) \ ( (This)->lpVtbl -> EndClose(This,context) ) #define IFabricStatefulServiceReplica_Abort(This) \ ( (This)->lpVtbl -> Abort(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricStatefulServiceReplica_INTERFACE_DEFINED__ */ #ifndef __IFabricStatefulServicePartition_INTERFACE_DEFINED__ #define __IFabricStatefulServicePartition_INTERFACE_DEFINED__ /* interface IFabricStatefulServicePartition */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricStatefulServicePartition; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("5beccc37-8655-4f20-bd43-f50691d7cd16") IFabricStatefulServicePartition : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE GetPartitionInfo( /* [retval][out] */ const FABRIC_SERVICE_PARTITION_INFORMATION **bufferedValue) = 0; virtual HRESULT STDMETHODCALLTYPE GetReadStatus( /* [retval][out] */ FABRIC_SERVICE_PARTITION_ACCESS_STATUS *readStatus) = 0; virtual HRESULT STDMETHODCALLTYPE GetWriteStatus( /* [retval][out] */ FABRIC_SERVICE_PARTITION_ACCESS_STATUS *writeStatus) = 0; virtual HRESULT STDMETHODCALLTYPE CreateReplicator( /* [in] */ IFabricStateProvider *stateProvider, /* [in] */ const FABRIC_REPLICATOR_SETTINGS *replicatorSettings, /* [out] */ IFabricReplicator **replicator, /* [retval][out] */ IFabricStateReplicator **stateReplicator) = 0; virtual HRESULT STDMETHODCALLTYPE ReportLoad( /* [in] */ ULONG metricCount, /* [size_is][in] */ const FABRIC_LOAD_METRIC *metrics) = 0; virtual HRESULT STDMETHODCALLTYPE ReportFault( /* [in] */ FABRIC_FAULT_TYPE faultType) = 0; }; #else /* C style interface */ typedef struct IFabricStatefulServicePartitionVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricStatefulServicePartition * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricStatefulServicePartition * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricStatefulServicePartition * This); HRESULT ( STDMETHODCALLTYPE *GetPartitionInfo )( IFabricStatefulServicePartition * This, /* [retval][out] */ const FABRIC_SERVICE_PARTITION_INFORMATION **bufferedValue); HRESULT ( STDMETHODCALLTYPE *GetReadStatus )( IFabricStatefulServicePartition * This, /* [retval][out] */ FABRIC_SERVICE_PARTITION_ACCESS_STATUS *readStatus); HRESULT ( STDMETHODCALLTYPE *GetWriteStatus )( IFabricStatefulServicePartition * This, /* [retval][out] */ FABRIC_SERVICE_PARTITION_ACCESS_STATUS *writeStatus); HRESULT ( STDMETHODCALLTYPE *CreateReplicator )( IFabricStatefulServicePartition * This, /* [in] */ IFabricStateProvider *stateProvider, /* [in] */ const FABRIC_REPLICATOR_SETTINGS *replicatorSettings, /* [out] */ IFabricReplicator **replicator, /* [retval][out] */ IFabricStateReplicator **stateReplicator); HRESULT ( STDMETHODCALLTYPE *ReportLoad )( IFabricStatefulServicePartition * This, /* [in] */ ULONG metricCount, /* [size_is][in] */ const FABRIC_LOAD_METRIC *metrics); HRESULT ( STDMETHODCALLTYPE *ReportFault )( IFabricStatefulServicePartition * This, /* [in] */ FABRIC_FAULT_TYPE faultType); END_INTERFACE } IFabricStatefulServicePartitionVtbl; interface IFabricStatefulServicePartition { CONST_VTBL struct IFabricStatefulServicePartitionVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricStatefulServicePartition_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricStatefulServicePartition_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricStatefulServicePartition_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricStatefulServicePartition_GetPartitionInfo(This,bufferedValue) \ ( (This)->lpVtbl -> GetPartitionInfo(This,bufferedValue) ) #define IFabricStatefulServicePartition_GetReadStatus(This,readStatus) \ ( (This)->lpVtbl -> GetReadStatus(This,readStatus) ) #define IFabricStatefulServicePartition_GetWriteStatus(This,writeStatus) \ ( (This)->lpVtbl -> GetWriteStatus(This,writeStatus) ) #define IFabricStatefulServicePartition_CreateReplicator(This,stateProvider,replicatorSettings,replicator,stateReplicator) \ ( (This)->lpVtbl -> CreateReplicator(This,stateProvider,replicatorSettings,replicator,stateReplicator) ) #define IFabricStatefulServicePartition_ReportLoad(This,metricCount,metrics) \ ( (This)->lpVtbl -> ReportLoad(This,metricCount,metrics) ) #define IFabricStatefulServicePartition_ReportFault(This,faultType) \ ( (This)->lpVtbl -> ReportFault(This,faultType) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricStatefulServicePartition_INTERFACE_DEFINED__ */ #ifndef __IFabricStatefulServicePartition1_INTERFACE_DEFINED__ #define __IFabricStatefulServicePartition1_INTERFACE_DEFINED__ /* interface IFabricStatefulServicePartition1 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricStatefulServicePartition1; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("c9c66f2f-9dff-4c87-bbe4-a08b4c4074cf") IFabricStatefulServicePartition1 : public IFabricStatefulServicePartition { public: virtual HRESULT STDMETHODCALLTYPE ReportMoveCost( /* [in] */ FABRIC_MOVE_COST moveCost) = 0; }; #else /* C style interface */ typedef struct IFabricStatefulServicePartition1Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricStatefulServicePartition1 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricStatefulServicePartition1 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricStatefulServicePartition1 * This); HRESULT ( STDMETHODCALLTYPE *GetPartitionInfo )( IFabricStatefulServicePartition1 * This, /* [retval][out] */ const FABRIC_SERVICE_PARTITION_INFORMATION **bufferedValue); HRESULT ( STDMETHODCALLTYPE *GetReadStatus )( IFabricStatefulServicePartition1 * This, /* [retval][out] */ FABRIC_SERVICE_PARTITION_ACCESS_STATUS *readStatus); HRESULT ( STDMETHODCALLTYPE *GetWriteStatus )( IFabricStatefulServicePartition1 * This, /* [retval][out] */ FABRIC_SERVICE_PARTITION_ACCESS_STATUS *writeStatus); HRESULT ( STDMETHODCALLTYPE *CreateReplicator )( IFabricStatefulServicePartition1 * This, /* [in] */ IFabricStateProvider *stateProvider, /* [in] */ const FABRIC_REPLICATOR_SETTINGS *replicatorSettings, /* [out] */ IFabricReplicator **replicator, /* [retval][out] */ IFabricStateReplicator **stateReplicator); HRESULT ( STDMETHODCALLTYPE *ReportLoad )( IFabricStatefulServicePartition1 * This, /* [in] */ ULONG metricCount, /* [size_is][in] */ const FABRIC_LOAD_METRIC *metrics); HRESULT ( STDMETHODCALLTYPE *ReportFault )( IFabricStatefulServicePartition1 * This, /* [in] */ FABRIC_FAULT_TYPE faultType); HRESULT ( STDMETHODCALLTYPE *ReportMoveCost )( IFabricStatefulServicePartition1 * This, /* [in] */ FABRIC_MOVE_COST moveCost); END_INTERFACE } IFabricStatefulServicePartition1Vtbl; interface IFabricStatefulServicePartition1 { CONST_VTBL struct IFabricStatefulServicePartition1Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricStatefulServicePartition1_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricStatefulServicePartition1_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricStatefulServicePartition1_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricStatefulServicePartition1_GetPartitionInfo(This,bufferedValue) \ ( (This)->lpVtbl -> GetPartitionInfo(This,bufferedValue) ) #define IFabricStatefulServicePartition1_GetReadStatus(This,readStatus) \ ( (This)->lpVtbl -> GetReadStatus(This,readStatus) ) #define IFabricStatefulServicePartition1_GetWriteStatus(This,writeStatus) \ ( (This)->lpVtbl -> GetWriteStatus(This,writeStatus) ) #define IFabricStatefulServicePartition1_CreateReplicator(This,stateProvider,replicatorSettings,replicator,stateReplicator) \ ( (This)->lpVtbl -> CreateReplicator(This,stateProvider,replicatorSettings,replicator,stateReplicator) ) #define IFabricStatefulServicePartition1_ReportLoad(This,metricCount,metrics) \ ( (This)->lpVtbl -> ReportLoad(This,metricCount,metrics) ) #define IFabricStatefulServicePartition1_ReportFault(This,faultType) \ ( (This)->lpVtbl -> ReportFault(This,faultType) ) #define IFabricStatefulServicePartition1_ReportMoveCost(This,moveCost) \ ( (This)->lpVtbl -> ReportMoveCost(This,moveCost) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricStatefulServicePartition1_INTERFACE_DEFINED__ */ #ifndef __IFabricStatefulServicePartition2_INTERFACE_DEFINED__ #define __IFabricStatefulServicePartition2_INTERFACE_DEFINED__ /* interface IFabricStatefulServicePartition2 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricStatefulServicePartition2; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("df27b476-fa25-459f-a7d3-87d3eec9c73c") IFabricStatefulServicePartition2 : public IFabricStatefulServicePartition1 { public: virtual HRESULT STDMETHODCALLTYPE ReportReplicaHealth( /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo) = 0; virtual HRESULT STDMETHODCALLTYPE ReportPartitionHealth( /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo) = 0; }; #else /* C style interface */ typedef struct IFabricStatefulServicePartition2Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricStatefulServicePartition2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricStatefulServicePartition2 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricStatefulServicePartition2 * This); HRESULT ( STDMETHODCALLTYPE *GetPartitionInfo )( IFabricStatefulServicePartition2 * This, /* [retval][out] */ const FABRIC_SERVICE_PARTITION_INFORMATION **bufferedValue); HRESULT ( STDMETHODCALLTYPE *GetReadStatus )( IFabricStatefulServicePartition2 * This, /* [retval][out] */ FABRIC_SERVICE_PARTITION_ACCESS_STATUS *readStatus); HRESULT ( STDMETHODCALLTYPE *GetWriteStatus )( IFabricStatefulServicePartition2 * This, /* [retval][out] */ FABRIC_SERVICE_PARTITION_ACCESS_STATUS *writeStatus); HRESULT ( STDMETHODCALLTYPE *CreateReplicator )( IFabricStatefulServicePartition2 * This, /* [in] */ IFabricStateProvider *stateProvider, /* [in] */ const FABRIC_REPLICATOR_SETTINGS *replicatorSettings, /* [out] */ IFabricReplicator **replicator, /* [retval][out] */ IFabricStateReplicator **stateReplicator); HRESULT ( STDMETHODCALLTYPE *ReportLoad )( IFabricStatefulServicePartition2 * This, /* [in] */ ULONG metricCount, /* [size_is][in] */ const FABRIC_LOAD_METRIC *metrics); HRESULT ( STDMETHODCALLTYPE *ReportFault )( IFabricStatefulServicePartition2 * This, /* [in] */ FABRIC_FAULT_TYPE faultType); HRESULT ( STDMETHODCALLTYPE *ReportMoveCost )( IFabricStatefulServicePartition2 * This, /* [in] */ FABRIC_MOVE_COST moveCost); HRESULT ( STDMETHODCALLTYPE *ReportReplicaHealth )( IFabricStatefulServicePartition2 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo); HRESULT ( STDMETHODCALLTYPE *ReportPartitionHealth )( IFabricStatefulServicePartition2 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo); END_INTERFACE } IFabricStatefulServicePartition2Vtbl; interface IFabricStatefulServicePartition2 { CONST_VTBL struct IFabricStatefulServicePartition2Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricStatefulServicePartition2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricStatefulServicePartition2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricStatefulServicePartition2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricStatefulServicePartition2_GetPartitionInfo(This,bufferedValue) \ ( (This)->lpVtbl -> GetPartitionInfo(This,bufferedValue) ) #define IFabricStatefulServicePartition2_GetReadStatus(This,readStatus) \ ( (This)->lpVtbl -> GetReadStatus(This,readStatus) ) #define IFabricStatefulServicePartition2_GetWriteStatus(This,writeStatus) \ ( (This)->lpVtbl -> GetWriteStatus(This,writeStatus) ) #define IFabricStatefulServicePartition2_CreateReplicator(This,stateProvider,replicatorSettings,replicator,stateReplicator) \ ( (This)->lpVtbl -> CreateReplicator(This,stateProvider,replicatorSettings,replicator,stateReplicator) ) #define IFabricStatefulServicePartition2_ReportLoad(This,metricCount,metrics) \ ( (This)->lpVtbl -> ReportLoad(This,metricCount,metrics) ) #define IFabricStatefulServicePartition2_ReportFault(This,faultType) \ ( (This)->lpVtbl -> ReportFault(This,faultType) ) #define IFabricStatefulServicePartition2_ReportMoveCost(This,moveCost) \ ( (This)->lpVtbl -> ReportMoveCost(This,moveCost) ) #define IFabricStatefulServicePartition2_ReportReplicaHealth(This,healthInfo) \ ( (This)->lpVtbl -> ReportReplicaHealth(This,healthInfo) ) #define IFabricStatefulServicePartition2_ReportPartitionHealth(This,healthInfo) \ ( (This)->lpVtbl -> ReportPartitionHealth(This,healthInfo) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricStatefulServicePartition2_INTERFACE_DEFINED__ */ #ifndef __IFabricStatefulServicePartition3_INTERFACE_DEFINED__ #define __IFabricStatefulServicePartition3_INTERFACE_DEFINED__ /* interface IFabricStatefulServicePartition3 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricStatefulServicePartition3; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("51f1269d-b061-4c1c-96cf-6508cece813b") IFabricStatefulServicePartition3 : public IFabricStatefulServicePartition2 { public: virtual HRESULT STDMETHODCALLTYPE ReportReplicaHealth2( /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo, /* [in] */ const FABRIC_HEALTH_REPORT_SEND_OPTIONS *sendOptions) = 0; virtual HRESULT STDMETHODCALLTYPE ReportPartitionHealth2( /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo, /* [in] */ const FABRIC_HEALTH_REPORT_SEND_OPTIONS *sendOptions) = 0; }; #else /* C style interface */ typedef struct IFabricStatefulServicePartition3Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricStatefulServicePartition3 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricStatefulServicePartition3 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricStatefulServicePartition3 * This); HRESULT ( STDMETHODCALLTYPE *GetPartitionInfo )( IFabricStatefulServicePartition3 * This, /* [retval][out] */ const FABRIC_SERVICE_PARTITION_INFORMATION **bufferedValue); HRESULT ( STDMETHODCALLTYPE *GetReadStatus )( IFabricStatefulServicePartition3 * This, /* [retval][out] */ FABRIC_SERVICE_PARTITION_ACCESS_STATUS *readStatus); HRESULT ( STDMETHODCALLTYPE *GetWriteStatus )( IFabricStatefulServicePartition3 * This, /* [retval][out] */ FABRIC_SERVICE_PARTITION_ACCESS_STATUS *writeStatus); HRESULT ( STDMETHODCALLTYPE *CreateReplicator )( IFabricStatefulServicePartition3 * This, /* [in] */ IFabricStateProvider *stateProvider, /* [in] */ const FABRIC_REPLICATOR_SETTINGS *replicatorSettings, /* [out] */ IFabricReplicator **replicator, /* [retval][out] */ IFabricStateReplicator **stateReplicator); HRESULT ( STDMETHODCALLTYPE *ReportLoad )( IFabricStatefulServicePartition3 * This, /* [in] */ ULONG metricCount, /* [size_is][in] */ const FABRIC_LOAD_METRIC *metrics); HRESULT ( STDMETHODCALLTYPE *ReportFault )( IFabricStatefulServicePartition3 * This, /* [in] */ FABRIC_FAULT_TYPE faultType); HRESULT ( STDMETHODCALLTYPE *ReportMoveCost )( IFabricStatefulServicePartition3 * This, /* [in] */ FABRIC_MOVE_COST moveCost); HRESULT ( STDMETHODCALLTYPE *ReportReplicaHealth )( IFabricStatefulServicePartition3 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo); HRESULT ( STDMETHODCALLTYPE *ReportPartitionHealth )( IFabricStatefulServicePartition3 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo); HRESULT ( STDMETHODCALLTYPE *ReportReplicaHealth2 )( IFabricStatefulServicePartition3 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo, /* [in] */ const FABRIC_HEALTH_REPORT_SEND_OPTIONS *sendOptions); HRESULT ( STDMETHODCALLTYPE *ReportPartitionHealth2 )( IFabricStatefulServicePartition3 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo, /* [in] */ const FABRIC_HEALTH_REPORT_SEND_OPTIONS *sendOptions); END_INTERFACE } IFabricStatefulServicePartition3Vtbl; interface IFabricStatefulServicePartition3 { CONST_VTBL struct IFabricStatefulServicePartition3Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricStatefulServicePartition3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricStatefulServicePartition3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricStatefulServicePartition3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricStatefulServicePartition3_GetPartitionInfo(This,bufferedValue) \ ( (This)->lpVtbl -> GetPartitionInfo(This,bufferedValue) ) #define IFabricStatefulServicePartition3_GetReadStatus(This,readStatus) \ ( (This)->lpVtbl -> GetReadStatus(This,readStatus) ) #define IFabricStatefulServicePartition3_GetWriteStatus(This,writeStatus) \ ( (This)->lpVtbl -> GetWriteStatus(This,writeStatus) ) #define IFabricStatefulServicePartition3_CreateReplicator(This,stateProvider,replicatorSettings,replicator,stateReplicator) \ ( (This)->lpVtbl -> CreateReplicator(This,stateProvider,replicatorSettings,replicator,stateReplicator) ) #define IFabricStatefulServicePartition3_ReportLoad(This,metricCount,metrics) \ ( (This)->lpVtbl -> ReportLoad(This,metricCount,metrics) ) #define IFabricStatefulServicePartition3_ReportFault(This,faultType) \ ( (This)->lpVtbl -> ReportFault(This,faultType) ) #define IFabricStatefulServicePartition3_ReportMoveCost(This,moveCost) \ ( (This)->lpVtbl -> ReportMoveCost(This,moveCost) ) #define IFabricStatefulServicePartition3_ReportReplicaHealth(This,healthInfo) \ ( (This)->lpVtbl -> ReportReplicaHealth(This,healthInfo) ) #define IFabricStatefulServicePartition3_ReportPartitionHealth(This,healthInfo) \ ( (This)->lpVtbl -> ReportPartitionHealth(This,healthInfo) ) #define IFabricStatefulServicePartition3_ReportReplicaHealth2(This,healthInfo,sendOptions) \ ( (This)->lpVtbl -> ReportReplicaHealth2(This,healthInfo,sendOptions) ) #define IFabricStatefulServicePartition3_ReportPartitionHealth2(This,healthInfo,sendOptions) \ ( (This)->lpVtbl -> ReportPartitionHealth2(This,healthInfo,sendOptions) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricStatefulServicePartition3_INTERFACE_DEFINED__ */ #ifndef __IFabricStateProvider_INTERFACE_DEFINED__ #define __IFabricStateProvider_INTERFACE_DEFINED__ /* interface IFabricStateProvider */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricStateProvider; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("3ebfec79-bd27-43f3-8be8-da38ee723951") IFabricStateProvider : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE BeginUpdateEpoch( /* [in] */ const FABRIC_EPOCH *epoch, /* [in] */ FABRIC_SEQUENCE_NUMBER previousEpochLastSequenceNumber, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndUpdateEpoch( /* [in] */ IFabricAsyncOperationContext *context) = 0; virtual HRESULT STDMETHODCALLTYPE GetLastCommittedSequenceNumber( /* [retval][out] */ FABRIC_SEQUENCE_NUMBER *sequenceNumber) = 0; virtual HRESULT STDMETHODCALLTYPE BeginOnDataLoss( /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndOnDataLoss( /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ BOOLEAN *isStateChanged) = 0; virtual HRESULT STDMETHODCALLTYPE GetCopyContext( /* [retval][out] */ IFabricOperationDataStream **copyContextStream) = 0; virtual HRESULT STDMETHODCALLTYPE GetCopyState( /* [in] */ FABRIC_SEQUENCE_NUMBER uptoSequenceNumber, /* [in] */ IFabricOperationDataStream *copyContextStream, /* [retval][out] */ IFabricOperationDataStream **copyStateStream) = 0; }; #else /* C style interface */ typedef struct IFabricStateProviderVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricStateProvider * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricStateProvider * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricStateProvider * This); HRESULT ( STDMETHODCALLTYPE *BeginUpdateEpoch )( IFabricStateProvider * This, /* [in] */ const FABRIC_EPOCH *epoch, /* [in] */ FABRIC_SEQUENCE_NUMBER previousEpochLastSequenceNumber, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndUpdateEpoch )( IFabricStateProvider * This, /* [in] */ IFabricAsyncOperationContext *context); HRESULT ( STDMETHODCALLTYPE *GetLastCommittedSequenceNumber )( IFabricStateProvider * This, /* [retval][out] */ FABRIC_SEQUENCE_NUMBER *sequenceNumber); HRESULT ( STDMETHODCALLTYPE *BeginOnDataLoss )( IFabricStateProvider * This, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndOnDataLoss )( IFabricStateProvider * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ BOOLEAN *isStateChanged); HRESULT ( STDMETHODCALLTYPE *GetCopyContext )( IFabricStateProvider * This, /* [retval][out] */ IFabricOperationDataStream **copyContextStream); HRESULT ( STDMETHODCALLTYPE *GetCopyState )( IFabricStateProvider * This, /* [in] */ FABRIC_SEQUENCE_NUMBER uptoSequenceNumber, /* [in] */ IFabricOperationDataStream *copyContextStream, /* [retval][out] */ IFabricOperationDataStream **copyStateStream); END_INTERFACE } IFabricStateProviderVtbl; interface IFabricStateProvider { CONST_VTBL struct IFabricStateProviderVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricStateProvider_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricStateProvider_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricStateProvider_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricStateProvider_BeginUpdateEpoch(This,epoch,previousEpochLastSequenceNumber,callback,context) \ ( (This)->lpVtbl -> BeginUpdateEpoch(This,epoch,previousEpochLastSequenceNumber,callback,context) ) #define IFabricStateProvider_EndUpdateEpoch(This,context) \ ( (This)->lpVtbl -> EndUpdateEpoch(This,context) ) #define IFabricStateProvider_GetLastCommittedSequenceNumber(This,sequenceNumber) \ ( (This)->lpVtbl -> GetLastCommittedSequenceNumber(This,sequenceNumber) ) #define IFabricStateProvider_BeginOnDataLoss(This,callback,context) \ ( (This)->lpVtbl -> BeginOnDataLoss(This,callback,context) ) #define IFabricStateProvider_EndOnDataLoss(This,context,isStateChanged) \ ( (This)->lpVtbl -> EndOnDataLoss(This,context,isStateChanged) ) #define IFabricStateProvider_GetCopyContext(This,copyContextStream) \ ( (This)->lpVtbl -> GetCopyContext(This,copyContextStream) ) #define IFabricStateProvider_GetCopyState(This,uptoSequenceNumber,copyContextStream,copyStateStream) \ ( (This)->lpVtbl -> GetCopyState(This,uptoSequenceNumber,copyContextStream,copyStateStream) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricStateProvider_INTERFACE_DEFINED__ */ #ifndef __IFabricStateReplicator_INTERFACE_DEFINED__ #define __IFabricStateReplicator_INTERFACE_DEFINED__ /* interface IFabricStateReplicator */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricStateReplicator; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("89e9a978-c771-44f2-92e8-3bf271cabe9c") IFabricStateReplicator : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE BeginReplicate( /* [in] */ IFabricOperationData *operationData, /* [in] */ IFabricAsyncOperationCallback *callback, /* [out] */ FABRIC_SEQUENCE_NUMBER *sequenceNumber, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndReplicate( /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ FABRIC_SEQUENCE_NUMBER *sequenceNumber) = 0; virtual HRESULT STDMETHODCALLTYPE GetReplicationStream( /* [retval][out] */ IFabricOperationStream **stream) = 0; virtual HRESULT STDMETHODCALLTYPE GetCopyStream( /* [retval][out] */ IFabricOperationStream **stream) = 0; virtual HRESULT STDMETHODCALLTYPE UpdateReplicatorSettings( /* [in] */ const FABRIC_REPLICATOR_SETTINGS *replicatorSettings) = 0; }; #else /* C style interface */ typedef struct IFabricStateReplicatorVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricStateReplicator * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricStateReplicator * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricStateReplicator * This); HRESULT ( STDMETHODCALLTYPE *BeginReplicate )( IFabricStateReplicator * This, /* [in] */ IFabricOperationData *operationData, /* [in] */ IFabricAsyncOperationCallback *callback, /* [out] */ FABRIC_SEQUENCE_NUMBER *sequenceNumber, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndReplicate )( IFabricStateReplicator * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ FABRIC_SEQUENCE_NUMBER *sequenceNumber); HRESULT ( STDMETHODCALLTYPE *GetReplicationStream )( IFabricStateReplicator * This, /* [retval][out] */ IFabricOperationStream **stream); HRESULT ( STDMETHODCALLTYPE *GetCopyStream )( IFabricStateReplicator * This, /* [retval][out] */ IFabricOperationStream **stream); HRESULT ( STDMETHODCALLTYPE *UpdateReplicatorSettings )( IFabricStateReplicator * This, /* [in] */ const FABRIC_REPLICATOR_SETTINGS *replicatorSettings); END_INTERFACE } IFabricStateReplicatorVtbl; interface IFabricStateReplicator { CONST_VTBL struct IFabricStateReplicatorVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricStateReplicator_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricStateReplicator_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricStateReplicator_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricStateReplicator_BeginReplicate(This,operationData,callback,sequenceNumber,context) \ ( (This)->lpVtbl -> BeginReplicate(This,operationData,callback,sequenceNumber,context) ) #define IFabricStateReplicator_EndReplicate(This,context,sequenceNumber) \ ( (This)->lpVtbl -> EndReplicate(This,context,sequenceNumber) ) #define IFabricStateReplicator_GetReplicationStream(This,stream) \ ( (This)->lpVtbl -> GetReplicationStream(This,stream) ) #define IFabricStateReplicator_GetCopyStream(This,stream) \ ( (This)->lpVtbl -> GetCopyStream(This,stream) ) #define IFabricStateReplicator_UpdateReplicatorSettings(This,replicatorSettings) \ ( (This)->lpVtbl -> UpdateReplicatorSettings(This,replicatorSettings) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricStateReplicator_INTERFACE_DEFINED__ */ #ifndef __IFabricReplicator_INTERFACE_DEFINED__ #define __IFabricReplicator_INTERFACE_DEFINED__ /* interface IFabricReplicator */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricReplicator; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("067f144a-e5be-4f5e-a181-8b5593e20242") IFabricReplicator : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE BeginOpen( /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndOpen( /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricStringResult **replicationAddress) = 0; virtual HRESULT STDMETHODCALLTYPE BeginChangeRole( /* [in] */ const FABRIC_EPOCH *epoch, /* [in] */ FABRIC_REPLICA_ROLE role, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndChangeRole( /* [in] */ IFabricAsyncOperationContext *context) = 0; virtual HRESULT STDMETHODCALLTYPE BeginUpdateEpoch( /* [in] */ const FABRIC_EPOCH *epoch, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndUpdateEpoch( /* [in] */ IFabricAsyncOperationContext *context) = 0; virtual HRESULT STDMETHODCALLTYPE BeginClose( /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndClose( /* [in] */ IFabricAsyncOperationContext *context) = 0; virtual void STDMETHODCALLTYPE Abort( void) = 0; virtual HRESULT STDMETHODCALLTYPE GetCurrentProgress( /* [out] */ FABRIC_SEQUENCE_NUMBER *lastSequenceNumber) = 0; virtual HRESULT STDMETHODCALLTYPE GetCatchUpCapability( /* [out] */ FABRIC_SEQUENCE_NUMBER *fromSequenceNumber) = 0; }; #else /* C style interface */ typedef struct IFabricReplicatorVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricReplicator * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricReplicator * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricReplicator * This); HRESULT ( STDMETHODCALLTYPE *BeginOpen )( IFabricReplicator * This, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndOpen )( IFabricReplicator * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricStringResult **replicationAddress); HRESULT ( STDMETHODCALLTYPE *BeginChangeRole )( IFabricReplicator * This, /* [in] */ const FABRIC_EPOCH *epoch, /* [in] */ FABRIC_REPLICA_ROLE role, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndChangeRole )( IFabricReplicator * This, /* [in] */ IFabricAsyncOperationContext *context); HRESULT ( STDMETHODCALLTYPE *BeginUpdateEpoch )( IFabricReplicator * This, /* [in] */ const FABRIC_EPOCH *epoch, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndUpdateEpoch )( IFabricReplicator * This, /* [in] */ IFabricAsyncOperationContext *context); HRESULT ( STDMETHODCALLTYPE *BeginClose )( IFabricReplicator * This, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndClose )( IFabricReplicator * This, /* [in] */ IFabricAsyncOperationContext *context); void ( STDMETHODCALLTYPE *Abort )( IFabricReplicator * This); HRESULT ( STDMETHODCALLTYPE *GetCurrentProgress )( IFabricReplicator * This, /* [out] */ FABRIC_SEQUENCE_NUMBER *lastSequenceNumber); HRESULT ( STDMETHODCALLTYPE *GetCatchUpCapability )( IFabricReplicator * This, /* [out] */ FABRIC_SEQUENCE_NUMBER *fromSequenceNumber); END_INTERFACE } IFabricReplicatorVtbl; interface IFabricReplicator { CONST_VTBL struct IFabricReplicatorVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricReplicator_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricReplicator_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricReplicator_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricReplicator_BeginOpen(This,callback,context) \ ( (This)->lpVtbl -> BeginOpen(This,callback,context) ) #define IFabricReplicator_EndOpen(This,context,replicationAddress) \ ( (This)->lpVtbl -> EndOpen(This,context,replicationAddress) ) #define IFabricReplicator_BeginChangeRole(This,epoch,role,callback,context) \ ( (This)->lpVtbl -> BeginChangeRole(This,epoch,role,callback,context) ) #define IFabricReplicator_EndChangeRole(This,context) \ ( (This)->lpVtbl -> EndChangeRole(This,context) ) #define IFabricReplicator_BeginUpdateEpoch(This,epoch,callback,context) \ ( (This)->lpVtbl -> BeginUpdateEpoch(This,epoch,callback,context) ) #define IFabricReplicator_EndUpdateEpoch(This,context) \ ( (This)->lpVtbl -> EndUpdateEpoch(This,context) ) #define IFabricReplicator_BeginClose(This,callback,context) \ ( (This)->lpVtbl -> BeginClose(This,callback,context) ) #define IFabricReplicator_EndClose(This,context) \ ( (This)->lpVtbl -> EndClose(This,context) ) #define IFabricReplicator_Abort(This) \ ( (This)->lpVtbl -> Abort(This) ) #define IFabricReplicator_GetCurrentProgress(This,lastSequenceNumber) \ ( (This)->lpVtbl -> GetCurrentProgress(This,lastSequenceNumber) ) #define IFabricReplicator_GetCatchUpCapability(This,fromSequenceNumber) \ ( (This)->lpVtbl -> GetCatchUpCapability(This,fromSequenceNumber) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricReplicator_INTERFACE_DEFINED__ */ #ifndef __IFabricPrimaryReplicator_INTERFACE_DEFINED__ #define __IFabricPrimaryReplicator_INTERFACE_DEFINED__ /* interface IFabricPrimaryReplicator */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricPrimaryReplicator; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("564e50dd-c3a4-4600-a60e-6658874307ae") IFabricPrimaryReplicator : public IFabricReplicator { public: virtual HRESULT STDMETHODCALLTYPE BeginOnDataLoss( /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndOnDataLoss( /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ BOOLEAN *isStateChanged) = 0; virtual HRESULT STDMETHODCALLTYPE UpdateCatchUpReplicaSetConfiguration( /* [in] */ const FABRIC_REPLICA_SET_CONFIGURATION *currentConfiguration, /* [in] */ const FABRIC_REPLICA_SET_CONFIGURATION *previousConfiguration) = 0; virtual HRESULT STDMETHODCALLTYPE BeginWaitForCatchUpQuorum( /* [in] */ FABRIC_REPLICA_SET_QUORUM_MODE catchUpMode, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndWaitForCatchUpQuorum( /* [in] */ IFabricAsyncOperationContext *context) = 0; virtual HRESULT STDMETHODCALLTYPE UpdateCurrentReplicaSetConfiguration( /* [in] */ const FABRIC_REPLICA_SET_CONFIGURATION *currentConfiguration) = 0; virtual HRESULT STDMETHODCALLTYPE BeginBuildReplica( /* [in] */ const FABRIC_REPLICA_INFORMATION *replica, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndBuildReplica( /* [in] */ IFabricAsyncOperationContext *context) = 0; virtual HRESULT STDMETHODCALLTYPE RemoveReplica( /* [in] */ FABRIC_REPLICA_ID replicaId) = 0; }; #else /* C style interface */ typedef struct IFabricPrimaryReplicatorVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricPrimaryReplicator * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricPrimaryReplicator * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricPrimaryReplicator * This); HRESULT ( STDMETHODCALLTYPE *BeginOpen )( IFabricPrimaryReplicator * This, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndOpen )( IFabricPrimaryReplicator * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricStringResult **replicationAddress); HRESULT ( STDMETHODCALLTYPE *BeginChangeRole )( IFabricPrimaryReplicator * This, /* [in] */ const FABRIC_EPOCH *epoch, /* [in] */ FABRIC_REPLICA_ROLE role, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndChangeRole )( IFabricPrimaryReplicator * This, /* [in] */ IFabricAsyncOperationContext *context); HRESULT ( STDMETHODCALLTYPE *BeginUpdateEpoch )( IFabricPrimaryReplicator * This, /* [in] */ const FABRIC_EPOCH *epoch, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndUpdateEpoch )( IFabricPrimaryReplicator * This, /* [in] */ IFabricAsyncOperationContext *context); HRESULT ( STDMETHODCALLTYPE *BeginClose )( IFabricPrimaryReplicator * This, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndClose )( IFabricPrimaryReplicator * This, /* [in] */ IFabricAsyncOperationContext *context); void ( STDMETHODCALLTYPE *Abort )( IFabricPrimaryReplicator * This); HRESULT ( STDMETHODCALLTYPE *GetCurrentProgress )( IFabricPrimaryReplicator * This, /* [out] */ FABRIC_SEQUENCE_NUMBER *lastSequenceNumber); HRESULT ( STDMETHODCALLTYPE *GetCatchUpCapability )( IFabricPrimaryReplicator * This, /* [out] */ FABRIC_SEQUENCE_NUMBER *fromSequenceNumber); HRESULT ( STDMETHODCALLTYPE *BeginOnDataLoss )( IFabricPrimaryReplicator * This, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndOnDataLoss )( IFabricPrimaryReplicator * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ BOOLEAN *isStateChanged); HRESULT ( STDMETHODCALLTYPE *UpdateCatchUpReplicaSetConfiguration )( IFabricPrimaryReplicator * This, /* [in] */ const FABRIC_REPLICA_SET_CONFIGURATION *currentConfiguration, /* [in] */ const FABRIC_REPLICA_SET_CONFIGURATION *previousConfiguration); HRESULT ( STDMETHODCALLTYPE *BeginWaitForCatchUpQuorum )( IFabricPrimaryReplicator * This, /* [in] */ FABRIC_REPLICA_SET_QUORUM_MODE catchUpMode, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndWaitForCatchUpQuorum )( IFabricPrimaryReplicator * This, /* [in] */ IFabricAsyncOperationContext *context); HRESULT ( STDMETHODCALLTYPE *UpdateCurrentReplicaSetConfiguration )( IFabricPrimaryReplicator * This, /* [in] */ const FABRIC_REPLICA_SET_CONFIGURATION *currentConfiguration); HRESULT ( STDMETHODCALLTYPE *BeginBuildReplica )( IFabricPrimaryReplicator * This, /* [in] */ const FABRIC_REPLICA_INFORMATION *replica, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndBuildReplica )( IFabricPrimaryReplicator * This, /* [in] */ IFabricAsyncOperationContext *context); HRESULT ( STDMETHODCALLTYPE *RemoveReplica )( IFabricPrimaryReplicator * This, /* [in] */ FABRIC_REPLICA_ID replicaId); END_INTERFACE } IFabricPrimaryReplicatorVtbl; interface IFabricPrimaryReplicator { CONST_VTBL struct IFabricPrimaryReplicatorVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricPrimaryReplicator_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricPrimaryReplicator_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricPrimaryReplicator_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricPrimaryReplicator_BeginOpen(This,callback,context) \ ( (This)->lpVtbl -> BeginOpen(This,callback,context) ) #define IFabricPrimaryReplicator_EndOpen(This,context,replicationAddress) \ ( (This)->lpVtbl -> EndOpen(This,context,replicationAddress) ) #define IFabricPrimaryReplicator_BeginChangeRole(This,epoch,role,callback,context) \ ( (This)->lpVtbl -> BeginChangeRole(This,epoch,role,callback,context) ) #define IFabricPrimaryReplicator_EndChangeRole(This,context) \ ( (This)->lpVtbl -> EndChangeRole(This,context) ) #define IFabricPrimaryReplicator_BeginUpdateEpoch(This,epoch,callback,context) \ ( (This)->lpVtbl -> BeginUpdateEpoch(This,epoch,callback,context) ) #define IFabricPrimaryReplicator_EndUpdateEpoch(This,context) \ ( (This)->lpVtbl -> EndUpdateEpoch(This,context) ) #define IFabricPrimaryReplicator_BeginClose(This,callback,context) \ ( (This)->lpVtbl -> BeginClose(This,callback,context) ) #define IFabricPrimaryReplicator_EndClose(This,context) \ ( (This)->lpVtbl -> EndClose(This,context) ) #define IFabricPrimaryReplicator_Abort(This) \ ( (This)->lpVtbl -> Abort(This) ) #define IFabricPrimaryReplicator_GetCurrentProgress(This,lastSequenceNumber) \ ( (This)->lpVtbl -> GetCurrentProgress(This,lastSequenceNumber) ) #define IFabricPrimaryReplicator_GetCatchUpCapability(This,fromSequenceNumber) \ ( (This)->lpVtbl -> GetCatchUpCapability(This,fromSequenceNumber) ) #define IFabricPrimaryReplicator_BeginOnDataLoss(This,callback,context) \ ( (This)->lpVtbl -> BeginOnDataLoss(This,callback,context) ) #define IFabricPrimaryReplicator_EndOnDataLoss(This,context,isStateChanged) \ ( (This)->lpVtbl -> EndOnDataLoss(This,context,isStateChanged) ) #define IFabricPrimaryReplicator_UpdateCatchUpReplicaSetConfiguration(This,currentConfiguration,previousConfiguration) \ ( (This)->lpVtbl -> UpdateCatchUpReplicaSetConfiguration(This,currentConfiguration,previousConfiguration) ) #define IFabricPrimaryReplicator_BeginWaitForCatchUpQuorum(This,catchUpMode,callback,context) \ ( (This)->lpVtbl -> BeginWaitForCatchUpQuorum(This,catchUpMode,callback,context) ) #define IFabricPrimaryReplicator_EndWaitForCatchUpQuorum(This,context) \ ( (This)->lpVtbl -> EndWaitForCatchUpQuorum(This,context) ) #define IFabricPrimaryReplicator_UpdateCurrentReplicaSetConfiguration(This,currentConfiguration) \ ( (This)->lpVtbl -> UpdateCurrentReplicaSetConfiguration(This,currentConfiguration) ) #define IFabricPrimaryReplicator_BeginBuildReplica(This,replica,callback,context) \ ( (This)->lpVtbl -> BeginBuildReplica(This,replica,callback,context) ) #define IFabricPrimaryReplicator_EndBuildReplica(This,context) \ ( (This)->lpVtbl -> EndBuildReplica(This,context) ) #define IFabricPrimaryReplicator_RemoveReplica(This,replicaId) \ ( (This)->lpVtbl -> RemoveReplica(This,replicaId) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricPrimaryReplicator_INTERFACE_DEFINED__ */ #ifndef __IFabricReplicatorCatchupSpecificQuorum_INTERFACE_DEFINED__ #define __IFabricReplicatorCatchupSpecificQuorum_INTERFACE_DEFINED__ /* interface IFabricReplicatorCatchupSpecificQuorum */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricReplicatorCatchupSpecificQuorum; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("aa3116fe-277d-482d-bd16-5366fa405757") IFabricReplicatorCatchupSpecificQuorum : public IUnknown { public: }; #else /* C style interface */ typedef struct IFabricReplicatorCatchupSpecificQuorumVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricReplicatorCatchupSpecificQuorum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricReplicatorCatchupSpecificQuorum * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricReplicatorCatchupSpecificQuorum * This); END_INTERFACE } IFabricReplicatorCatchupSpecificQuorumVtbl; interface IFabricReplicatorCatchupSpecificQuorum { CONST_VTBL struct IFabricReplicatorCatchupSpecificQuorumVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricReplicatorCatchupSpecificQuorum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricReplicatorCatchupSpecificQuorum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricReplicatorCatchupSpecificQuorum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricReplicatorCatchupSpecificQuorum_INTERFACE_DEFINED__ */ #ifndef __IFabricOperation_INTERFACE_DEFINED__ #define __IFabricOperation_INTERFACE_DEFINED__ /* interface IFabricOperation */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricOperation; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("f4ad6bfa-e23c-4a48-9617-c099cd59a23a") IFabricOperation : public IUnknown { public: virtual const FABRIC_OPERATION_METADATA *STDMETHODCALLTYPE get_Metadata( void) = 0; virtual HRESULT STDMETHODCALLTYPE GetData( /* [out] */ ULONG *count, /* [retval][out] */ const FABRIC_OPERATION_DATA_BUFFER **buffers) = 0; virtual HRESULT STDMETHODCALLTYPE Acknowledge( void) = 0; }; #else /* C style interface */ typedef struct IFabricOperationVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricOperation * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricOperation * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricOperation * This); const FABRIC_OPERATION_METADATA *( STDMETHODCALLTYPE *get_Metadata )( IFabricOperation * This); HRESULT ( STDMETHODCALLTYPE *GetData )( IFabricOperation * This, /* [out] */ ULONG *count, /* [retval][out] */ const FABRIC_OPERATION_DATA_BUFFER **buffers); HRESULT ( STDMETHODCALLTYPE *Acknowledge )( IFabricOperation * This); END_INTERFACE } IFabricOperationVtbl; interface IFabricOperation { CONST_VTBL struct IFabricOperationVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricOperation_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricOperation_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricOperation_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricOperation_get_Metadata(This) \ ( (This)->lpVtbl -> get_Metadata(This) ) #define IFabricOperation_GetData(This,count,buffers) \ ( (This)->lpVtbl -> GetData(This,count,buffers) ) #define IFabricOperation_Acknowledge(This) \ ( (This)->lpVtbl -> Acknowledge(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricOperation_INTERFACE_DEFINED__ */ #ifndef __IFabricOperationData_INTERFACE_DEFINED__ #define __IFabricOperationData_INTERFACE_DEFINED__ /* interface IFabricOperationData */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricOperationData; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("bab8ad87-37b7-482a-985d-baf38a785dcd") IFabricOperationData : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE GetData( /* [out] */ ULONG *count, /* [retval][out] */ const FABRIC_OPERATION_DATA_BUFFER **buffers) = 0; }; #else /* C style interface */ typedef struct IFabricOperationDataVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricOperationData * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricOperationData * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricOperationData * This); HRESULT ( STDMETHODCALLTYPE *GetData )( IFabricOperationData * This, /* [out] */ ULONG *count, /* [retval][out] */ const FABRIC_OPERATION_DATA_BUFFER **buffers); END_INTERFACE } IFabricOperationDataVtbl; interface IFabricOperationData { CONST_VTBL struct IFabricOperationDataVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricOperationData_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricOperationData_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricOperationData_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricOperationData_GetData(This,count,buffers) \ ( (This)->lpVtbl -> GetData(This,count,buffers) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricOperationData_INTERFACE_DEFINED__ */ #ifndef __IFabricOperationStream_INTERFACE_DEFINED__ #define __IFabricOperationStream_INTERFACE_DEFINED__ /* interface IFabricOperationStream */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricOperationStream; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("A98FB97A-D6B0-408A-A878-A9EDB09C2587") IFabricOperationStream : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE BeginGetOperation( /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndGetOperation( /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricOperation **operation) = 0; }; #else /* C style interface */ typedef struct IFabricOperationStreamVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricOperationStream * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricOperationStream * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricOperationStream * This); HRESULT ( STDMETHODCALLTYPE *BeginGetOperation )( IFabricOperationStream * This, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndGetOperation )( IFabricOperationStream * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricOperation **operation); END_INTERFACE } IFabricOperationStreamVtbl; interface IFabricOperationStream { CONST_VTBL struct IFabricOperationStreamVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricOperationStream_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricOperationStream_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricOperationStream_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricOperationStream_BeginGetOperation(This,callback,context) \ ( (This)->lpVtbl -> BeginGetOperation(This,callback,context) ) #define IFabricOperationStream_EndGetOperation(This,context,operation) \ ( (This)->lpVtbl -> EndGetOperation(This,context,operation) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricOperationStream_INTERFACE_DEFINED__ */ #ifndef __IFabricOperationStream2_INTERFACE_DEFINED__ #define __IFabricOperationStream2_INTERFACE_DEFINED__ /* interface IFabricOperationStream2 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricOperationStream2; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("0930199B-590A-4065-BEC9-5F93B6AAE086") IFabricOperationStream2 : public IFabricOperationStream { public: virtual HRESULT STDMETHODCALLTYPE ReportFault( /* [in] */ FABRIC_FAULT_TYPE faultType) = 0; }; #else /* C style interface */ typedef struct IFabricOperationStream2Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricOperationStream2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricOperationStream2 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricOperationStream2 * This); HRESULT ( STDMETHODCALLTYPE *BeginGetOperation )( IFabricOperationStream2 * This, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndGetOperation )( IFabricOperationStream2 * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricOperation **operation); HRESULT ( STDMETHODCALLTYPE *ReportFault )( IFabricOperationStream2 * This, /* [in] */ FABRIC_FAULT_TYPE faultType); END_INTERFACE } IFabricOperationStream2Vtbl; interface IFabricOperationStream2 { CONST_VTBL struct IFabricOperationStream2Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricOperationStream2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricOperationStream2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricOperationStream2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricOperationStream2_BeginGetOperation(This,callback,context) \ ( (This)->lpVtbl -> BeginGetOperation(This,callback,context) ) #define IFabricOperationStream2_EndGetOperation(This,context,operation) \ ( (This)->lpVtbl -> EndGetOperation(This,context,operation) ) #define IFabricOperationStream2_ReportFault(This,faultType) \ ( (This)->lpVtbl -> ReportFault(This,faultType) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricOperationStream2_INTERFACE_DEFINED__ */ #ifndef __IFabricOperationDataStream_INTERFACE_DEFINED__ #define __IFabricOperationDataStream_INTERFACE_DEFINED__ /* interface IFabricOperationDataStream */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricOperationDataStream; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("c4e9084c-be92-49c9-8c18-d44d088c2e32") IFabricOperationDataStream : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE BeginGetNext( /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndGetNext( /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricOperationData **operationData) = 0; }; #else /* C style interface */ typedef struct IFabricOperationDataStreamVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricOperationDataStream * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricOperationDataStream * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricOperationDataStream * This); HRESULT ( STDMETHODCALLTYPE *BeginGetNext )( IFabricOperationDataStream * This, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndGetNext )( IFabricOperationDataStream * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricOperationData **operationData); END_INTERFACE } IFabricOperationDataStreamVtbl; interface IFabricOperationDataStream { CONST_VTBL struct IFabricOperationDataStreamVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricOperationDataStream_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricOperationDataStream_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricOperationDataStream_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricOperationDataStream_BeginGetNext(This,callback,context) \ ( (This)->lpVtbl -> BeginGetNext(This,callback,context) ) #define IFabricOperationDataStream_EndGetNext(This,context,operationData) \ ( (This)->lpVtbl -> EndGetNext(This,context,operationData) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricOperationDataStream_INTERFACE_DEFINED__ */ #ifndef __IFabricAtomicGroupStateProvider_INTERFACE_DEFINED__ #define __IFabricAtomicGroupStateProvider_INTERFACE_DEFINED__ /* interface IFabricAtomicGroupStateProvider */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricAtomicGroupStateProvider; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("2b670953-6148-4f7d-a920-b390de43d913") IFabricAtomicGroupStateProvider : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE BeginAtomicGroupCommit( /* [in] */ FABRIC_ATOMIC_GROUP_ID atomicGroupId, /* [in] */ FABRIC_SEQUENCE_NUMBER commitSequenceNumber, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndAtomicGroupCommit( /* [in] */ IFabricAsyncOperationContext *context) = 0; virtual HRESULT STDMETHODCALLTYPE BeginAtomicGroupRollback( /* [in] */ FABRIC_ATOMIC_GROUP_ID atomicGroupId, /* [in] */ FABRIC_SEQUENCE_NUMBER rollbackequenceNumber, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndAtomicGroupRollback( /* [in] */ IFabricAsyncOperationContext *context) = 0; virtual HRESULT STDMETHODCALLTYPE BeginUndoProgress( /* [in] */ FABRIC_SEQUENCE_NUMBER fromCommitSequenceNumber, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndUndoProgress( /* [in] */ IFabricAsyncOperationContext *context) = 0; }; #else /* C style interface */ typedef struct IFabricAtomicGroupStateProviderVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricAtomicGroupStateProvider * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricAtomicGroupStateProvider * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricAtomicGroupStateProvider * This); HRESULT ( STDMETHODCALLTYPE *BeginAtomicGroupCommit )( IFabricAtomicGroupStateProvider * This, /* [in] */ FABRIC_ATOMIC_GROUP_ID atomicGroupId, /* [in] */ FABRIC_SEQUENCE_NUMBER commitSequenceNumber, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndAtomicGroupCommit )( IFabricAtomicGroupStateProvider * This, /* [in] */ IFabricAsyncOperationContext *context); HRESULT ( STDMETHODCALLTYPE *BeginAtomicGroupRollback )( IFabricAtomicGroupStateProvider * This, /* [in] */ FABRIC_ATOMIC_GROUP_ID atomicGroupId, /* [in] */ FABRIC_SEQUENCE_NUMBER rollbackequenceNumber, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndAtomicGroupRollback )( IFabricAtomicGroupStateProvider * This, /* [in] */ IFabricAsyncOperationContext *context); HRESULT ( STDMETHODCALLTYPE *BeginUndoProgress )( IFabricAtomicGroupStateProvider * This, /* [in] */ FABRIC_SEQUENCE_NUMBER fromCommitSequenceNumber, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndUndoProgress )( IFabricAtomicGroupStateProvider * This, /* [in] */ IFabricAsyncOperationContext *context); END_INTERFACE } IFabricAtomicGroupStateProviderVtbl; interface IFabricAtomicGroupStateProvider { CONST_VTBL struct IFabricAtomicGroupStateProviderVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricAtomicGroupStateProvider_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricAtomicGroupStateProvider_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricAtomicGroupStateProvider_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricAtomicGroupStateProvider_BeginAtomicGroupCommit(This,atomicGroupId,commitSequenceNumber,callback,context) \ ( (This)->lpVtbl -> BeginAtomicGroupCommit(This,atomicGroupId,commitSequenceNumber,callback,context) ) #define IFabricAtomicGroupStateProvider_EndAtomicGroupCommit(This,context) \ ( (This)->lpVtbl -> EndAtomicGroupCommit(This,context) ) #define IFabricAtomicGroupStateProvider_BeginAtomicGroupRollback(This,atomicGroupId,rollbackequenceNumber,callback,context) \ ( (This)->lpVtbl -> BeginAtomicGroupRollback(This,atomicGroupId,rollbackequenceNumber,callback,context) ) #define IFabricAtomicGroupStateProvider_EndAtomicGroupRollback(This,context) \ ( (This)->lpVtbl -> EndAtomicGroupRollback(This,context) ) #define IFabricAtomicGroupStateProvider_BeginUndoProgress(This,fromCommitSequenceNumber,callback,context) \ ( (This)->lpVtbl -> BeginUndoProgress(This,fromCommitSequenceNumber,callback,context) ) #define IFabricAtomicGroupStateProvider_EndUndoProgress(This,context) \ ( (This)->lpVtbl -> EndUndoProgress(This,context) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricAtomicGroupStateProvider_INTERFACE_DEFINED__ */ #ifndef __IFabricAtomicGroupStateReplicator_INTERFACE_DEFINED__ #define __IFabricAtomicGroupStateReplicator_INTERFACE_DEFINED__ /* interface IFabricAtomicGroupStateReplicator */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricAtomicGroupStateReplicator; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("80d2155c-4fc2-4fde-9696-c2f39b471c3d") IFabricAtomicGroupStateReplicator : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE CreateAtomicGroup( /* [retval][out] */ FABRIC_ATOMIC_GROUP_ID *AtomicGroupId) = 0; virtual HRESULT STDMETHODCALLTYPE BeginReplicateAtomicGroupOperation( /* [in] */ FABRIC_ATOMIC_GROUP_ID atomicGroupId, /* [in] */ IFabricOperationData *operationData, /* [in] */ IFabricAsyncOperationCallback *callback, /* [out] */ FABRIC_SEQUENCE_NUMBER *operationSequenceNumber, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndReplicateAtomicGroupOperation( /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ FABRIC_SEQUENCE_NUMBER *operationSequenceNumber) = 0; virtual HRESULT STDMETHODCALLTYPE BeginReplicateAtomicGroupCommit( /* [in] */ FABRIC_ATOMIC_GROUP_ID atomicGroupId, /* [in] */ IFabricAsyncOperationCallback *callback, /* [out] */ FABRIC_SEQUENCE_NUMBER *commitSequenceNumber, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndReplicateAtomicGroupCommit( /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ FABRIC_SEQUENCE_NUMBER *commitSequenceNumber) = 0; virtual HRESULT STDMETHODCALLTYPE BeginReplicateAtomicGroupRollback( /* [in] */ FABRIC_ATOMIC_GROUP_ID atomicGroupId, /* [in] */ IFabricAsyncOperationCallback *callback, /* [out] */ FABRIC_SEQUENCE_NUMBER *rollbackSequenceNumber, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndReplicateAtomicGroupRollback( /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ FABRIC_SEQUENCE_NUMBER *rollbackSequenceNumber) = 0; }; #else /* C style interface */ typedef struct IFabricAtomicGroupStateReplicatorVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricAtomicGroupStateReplicator * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricAtomicGroupStateReplicator * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricAtomicGroupStateReplicator * This); HRESULT ( STDMETHODCALLTYPE *CreateAtomicGroup )( IFabricAtomicGroupStateReplicator * This, /* [retval][out] */ FABRIC_ATOMIC_GROUP_ID *AtomicGroupId); HRESULT ( STDMETHODCALLTYPE *BeginReplicateAtomicGroupOperation )( IFabricAtomicGroupStateReplicator * This, /* [in] */ FABRIC_ATOMIC_GROUP_ID atomicGroupId, /* [in] */ IFabricOperationData *operationData, /* [in] */ IFabricAsyncOperationCallback *callback, /* [out] */ FABRIC_SEQUENCE_NUMBER *operationSequenceNumber, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndReplicateAtomicGroupOperation )( IFabricAtomicGroupStateReplicator * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ FABRIC_SEQUENCE_NUMBER *operationSequenceNumber); HRESULT ( STDMETHODCALLTYPE *BeginReplicateAtomicGroupCommit )( IFabricAtomicGroupStateReplicator * This, /* [in] */ FABRIC_ATOMIC_GROUP_ID atomicGroupId, /* [in] */ IFabricAsyncOperationCallback *callback, /* [out] */ FABRIC_SEQUENCE_NUMBER *commitSequenceNumber, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndReplicateAtomicGroupCommit )( IFabricAtomicGroupStateReplicator * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ FABRIC_SEQUENCE_NUMBER *commitSequenceNumber); HRESULT ( STDMETHODCALLTYPE *BeginReplicateAtomicGroupRollback )( IFabricAtomicGroupStateReplicator * This, /* [in] */ FABRIC_ATOMIC_GROUP_ID atomicGroupId, /* [in] */ IFabricAsyncOperationCallback *callback, /* [out] */ FABRIC_SEQUENCE_NUMBER *rollbackSequenceNumber, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndReplicateAtomicGroupRollback )( IFabricAtomicGroupStateReplicator * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ FABRIC_SEQUENCE_NUMBER *rollbackSequenceNumber); END_INTERFACE } IFabricAtomicGroupStateReplicatorVtbl; interface IFabricAtomicGroupStateReplicator { CONST_VTBL struct IFabricAtomicGroupStateReplicatorVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricAtomicGroupStateReplicator_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricAtomicGroupStateReplicator_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricAtomicGroupStateReplicator_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricAtomicGroupStateReplicator_CreateAtomicGroup(This,AtomicGroupId) \ ( (This)->lpVtbl -> CreateAtomicGroup(This,AtomicGroupId) ) #define IFabricAtomicGroupStateReplicator_BeginReplicateAtomicGroupOperation(This,atomicGroupId,operationData,callback,operationSequenceNumber,context) \ ( (This)->lpVtbl -> BeginReplicateAtomicGroupOperation(This,atomicGroupId,operationData,callback,operationSequenceNumber,context) ) #define IFabricAtomicGroupStateReplicator_EndReplicateAtomicGroupOperation(This,context,operationSequenceNumber) \ ( (This)->lpVtbl -> EndReplicateAtomicGroupOperation(This,context,operationSequenceNumber) ) #define IFabricAtomicGroupStateReplicator_BeginReplicateAtomicGroupCommit(This,atomicGroupId,callback,commitSequenceNumber,context) \ ( (This)->lpVtbl -> BeginReplicateAtomicGroupCommit(This,atomicGroupId,callback,commitSequenceNumber,context) ) #define IFabricAtomicGroupStateReplicator_EndReplicateAtomicGroupCommit(This,context,commitSequenceNumber) \ ( (This)->lpVtbl -> EndReplicateAtomicGroupCommit(This,context,commitSequenceNumber) ) #define IFabricAtomicGroupStateReplicator_BeginReplicateAtomicGroupRollback(This,atomicGroupId,callback,rollbackSequenceNumber,context) \ ( (This)->lpVtbl -> BeginReplicateAtomicGroupRollback(This,atomicGroupId,callback,rollbackSequenceNumber,context) ) #define IFabricAtomicGroupStateReplicator_EndReplicateAtomicGroupRollback(This,context,rollbackSequenceNumber) \ ( (This)->lpVtbl -> EndReplicateAtomicGroupRollback(This,context,rollbackSequenceNumber) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricAtomicGroupStateReplicator_INTERFACE_DEFINED__ */ #ifndef __IFabricServiceGroupFactory_INTERFACE_DEFINED__ #define __IFabricServiceGroupFactory_INTERFACE_DEFINED__ /* interface IFabricServiceGroupFactory */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricServiceGroupFactory; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("3860d61d-1e51-4a65-b109-d93c11311657") IFabricServiceGroupFactory : public IUnknown { public: }; #else /* C style interface */ typedef struct IFabricServiceGroupFactoryVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricServiceGroupFactory * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricServiceGroupFactory * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricServiceGroupFactory * This); END_INTERFACE } IFabricServiceGroupFactoryVtbl; interface IFabricServiceGroupFactory { CONST_VTBL struct IFabricServiceGroupFactoryVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricServiceGroupFactory_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricServiceGroupFactory_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricServiceGroupFactory_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricServiceGroupFactory_INTERFACE_DEFINED__ */ #ifndef __IFabricServiceGroupFactoryBuilder_INTERFACE_DEFINED__ #define __IFabricServiceGroupFactoryBuilder_INTERFACE_DEFINED__ /* interface IFabricServiceGroupFactoryBuilder */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricServiceGroupFactoryBuilder; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("a9fe8b06-19b1-49e6-8911-41d9d9219e1c") IFabricServiceGroupFactoryBuilder : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE AddStatelessServiceFactory( /* [in] */ LPCWSTR memberServiceType, /* [in] */ IFabricStatelessServiceFactory *factory) = 0; virtual HRESULT STDMETHODCALLTYPE AddStatefulServiceFactory( /* [in] */ LPCWSTR memberServiceType, /* [in] */ IFabricStatefulServiceFactory *factory) = 0; virtual HRESULT STDMETHODCALLTYPE RemoveServiceFactory( /* [in] */ LPCWSTR memberServiceType) = 0; virtual HRESULT STDMETHODCALLTYPE ToServiceGroupFactory( /* [retval][out] */ IFabricServiceGroupFactory **factory) = 0; }; #else /* C style interface */ typedef struct IFabricServiceGroupFactoryBuilderVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricServiceGroupFactoryBuilder * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricServiceGroupFactoryBuilder * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricServiceGroupFactoryBuilder * This); HRESULT ( STDMETHODCALLTYPE *AddStatelessServiceFactory )( IFabricServiceGroupFactoryBuilder * This, /* [in] */ LPCWSTR memberServiceType, /* [in] */ IFabricStatelessServiceFactory *factory); HRESULT ( STDMETHODCALLTYPE *AddStatefulServiceFactory )( IFabricServiceGroupFactoryBuilder * This, /* [in] */ LPCWSTR memberServiceType, /* [in] */ IFabricStatefulServiceFactory *factory); HRESULT ( STDMETHODCALLTYPE *RemoveServiceFactory )( IFabricServiceGroupFactoryBuilder * This, /* [in] */ LPCWSTR memberServiceType); HRESULT ( STDMETHODCALLTYPE *ToServiceGroupFactory )( IFabricServiceGroupFactoryBuilder * This, /* [retval][out] */ IFabricServiceGroupFactory **factory); END_INTERFACE } IFabricServiceGroupFactoryBuilderVtbl; interface IFabricServiceGroupFactoryBuilder { CONST_VTBL struct IFabricServiceGroupFactoryBuilderVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricServiceGroupFactoryBuilder_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricServiceGroupFactoryBuilder_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricServiceGroupFactoryBuilder_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricServiceGroupFactoryBuilder_AddStatelessServiceFactory(This,memberServiceType,factory) \ ( (This)->lpVtbl -> AddStatelessServiceFactory(This,memberServiceType,factory) ) #define IFabricServiceGroupFactoryBuilder_AddStatefulServiceFactory(This,memberServiceType,factory) \ ( (This)->lpVtbl -> AddStatefulServiceFactory(This,memberServiceType,factory) ) #define IFabricServiceGroupFactoryBuilder_RemoveServiceFactory(This,memberServiceType) \ ( (This)->lpVtbl -> RemoveServiceFactory(This,memberServiceType) ) #define IFabricServiceGroupFactoryBuilder_ToServiceGroupFactory(This,factory) \ ( (This)->lpVtbl -> ToServiceGroupFactory(This,factory) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricServiceGroupFactoryBuilder_INTERFACE_DEFINED__ */ #ifndef __IFabricServiceGroupPartition_INTERFACE_DEFINED__ #define __IFabricServiceGroupPartition_INTERFACE_DEFINED__ /* interface IFabricServiceGroupPartition */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricServiceGroupPartition; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("2b24299a-7489-467f-8e7f-4507bff73b86") IFabricServiceGroupPartition : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE ResolveMember( /* [in] */ FABRIC_URI name, /* [in] */ REFIID riid, /* [retval][out] */ void **member) = 0; }; #else /* C style interface */ typedef struct IFabricServiceGroupPartitionVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricServiceGroupPartition * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricServiceGroupPartition * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricServiceGroupPartition * This); HRESULT ( STDMETHODCALLTYPE *ResolveMember )( IFabricServiceGroupPartition * This, /* [in] */ FABRIC_URI name, /* [in] */ REFIID riid, /* [retval][out] */ void **member); END_INTERFACE } IFabricServiceGroupPartitionVtbl; interface IFabricServiceGroupPartition { CONST_VTBL struct IFabricServiceGroupPartitionVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricServiceGroupPartition_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricServiceGroupPartition_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricServiceGroupPartition_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricServiceGroupPartition_ResolveMember(This,name,riid,member) \ ( (This)->lpVtbl -> ResolveMember(This,name,riid,member) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricServiceGroupPartition_INTERFACE_DEFINED__ */ #ifndef __IFabricCodePackageActivationContext_INTERFACE_DEFINED__ #define __IFabricCodePackageActivationContext_INTERFACE_DEFINED__ /* interface IFabricCodePackageActivationContext */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricCodePackageActivationContext; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("68a971e2-f15f-4d95-a79c-8a257909659e") IFabricCodePackageActivationContext : public IUnknown { public: virtual LPCWSTR STDMETHODCALLTYPE get_ContextId( void) = 0; virtual LPCWSTR STDMETHODCALLTYPE get_CodePackageName( void) = 0; virtual LPCWSTR STDMETHODCALLTYPE get_CodePackageVersion( void) = 0; virtual LPCWSTR STDMETHODCALLTYPE get_WorkDirectory( void) = 0; virtual LPCWSTR STDMETHODCALLTYPE get_LogDirectory( void) = 0; virtual LPCWSTR STDMETHODCALLTYPE get_TempDirectory( void) = 0; virtual const FABRIC_SERVICE_TYPE_DESCRIPTION_LIST *STDMETHODCALLTYPE get_ServiceTypes( void) = 0; virtual const FABRIC_SERVICE_GROUP_TYPE_DESCRIPTION_LIST *STDMETHODCALLTYPE get_ServiceGroupTypes( void) = 0; virtual const FABRIC_APPLICATION_PRINCIPALS_DESCRIPTION *STDMETHODCALLTYPE get_ApplicationPrincipals( void) = 0; virtual const FABRIC_ENDPOINT_RESOURCE_DESCRIPTION_LIST *STDMETHODCALLTYPE get_ServiceEndpointResources( void) = 0; virtual HRESULT STDMETHODCALLTYPE GetServiceEndpointResource( /* [in] */ LPCWSTR serviceEndpointResourceName, /* [retval][out] */ const FABRIC_ENDPOINT_RESOURCE_DESCRIPTION **bufferedValue) = 0; virtual HRESULT STDMETHODCALLTYPE GetCodePackageNames( /* [retval][out] */ IFabricStringListResult **names) = 0; virtual HRESULT STDMETHODCALLTYPE GetConfigurationPackageNames( /* [retval][out] */ IFabricStringListResult **names) = 0; virtual HRESULT STDMETHODCALLTYPE GetDataPackageNames( /* [retval][out] */ IFabricStringListResult **names) = 0; virtual HRESULT STDMETHODCALLTYPE GetCodePackage( /* [in] */ LPCWSTR codePackageName, /* [retval][out] */ IFabricCodePackage **codePackage) = 0; virtual HRESULT STDMETHODCALLTYPE GetConfigurationPackage( /* [in] */ LPCWSTR configPackageName, /* [retval][out] */ IFabricConfigurationPackage **configPackage) = 0; virtual HRESULT STDMETHODCALLTYPE GetDataPackage( /* [in] */ LPCWSTR dataPackageName, /* [retval][out] */ IFabricDataPackage **dataPackage) = 0; virtual HRESULT STDMETHODCALLTYPE RegisterCodePackageChangeHandler( /* [in] */ IFabricCodePackageChangeHandler *callback, /* [retval][out] */ LONGLONG *callbackHandle) = 0; virtual HRESULT STDMETHODCALLTYPE UnregisterCodePackageChangeHandler( /* [in] */ LONGLONG callbackHandle) = 0; virtual HRESULT STDMETHODCALLTYPE RegisterConfigurationPackageChangeHandler( /* [in] */ IFabricConfigurationPackageChangeHandler *callback, /* [retval][out] */ LONGLONG *callbackHandle) = 0; virtual HRESULT STDMETHODCALLTYPE UnregisterConfigurationPackageChangeHandler( /* [in] */ LONGLONG callbackHandle) = 0; virtual HRESULT STDMETHODCALLTYPE RegisterDataPackageChangeHandler( /* [in] */ IFabricDataPackageChangeHandler *callback, /* [retval][out] */ LONGLONG *callbackHandle) = 0; virtual HRESULT STDMETHODCALLTYPE UnregisterDataPackageChangeHandler( /* [in] */ LONGLONG callbackHandle) = 0; }; #else /* C style interface */ typedef struct IFabricCodePackageActivationContextVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricCodePackageActivationContext * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricCodePackageActivationContext * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricCodePackageActivationContext * This); LPCWSTR ( STDMETHODCALLTYPE *get_ContextId )( IFabricCodePackageActivationContext * This); LPCWSTR ( STDMETHODCALLTYPE *get_CodePackageName )( IFabricCodePackageActivationContext * This); LPCWSTR ( STDMETHODCALLTYPE *get_CodePackageVersion )( IFabricCodePackageActivationContext * This); LPCWSTR ( STDMETHODCALLTYPE *get_WorkDirectory )( IFabricCodePackageActivationContext * This); LPCWSTR ( STDMETHODCALLTYPE *get_LogDirectory )( IFabricCodePackageActivationContext * This); LPCWSTR ( STDMETHODCALLTYPE *get_TempDirectory )( IFabricCodePackageActivationContext * This); const FABRIC_SERVICE_TYPE_DESCRIPTION_LIST *( STDMETHODCALLTYPE *get_ServiceTypes )( IFabricCodePackageActivationContext * This); const FABRIC_SERVICE_GROUP_TYPE_DESCRIPTION_LIST *( STDMETHODCALLTYPE *get_ServiceGroupTypes )( IFabricCodePackageActivationContext * This); const FABRIC_APPLICATION_PRINCIPALS_DESCRIPTION *( STDMETHODCALLTYPE *get_ApplicationPrincipals )( IFabricCodePackageActivationContext * This); const FABRIC_ENDPOINT_RESOURCE_DESCRIPTION_LIST *( STDMETHODCALLTYPE *get_ServiceEndpointResources )( IFabricCodePackageActivationContext * This); HRESULT ( STDMETHODCALLTYPE *GetServiceEndpointResource )( IFabricCodePackageActivationContext * This, /* [in] */ LPCWSTR serviceEndpointResourceName, /* [retval][out] */ const FABRIC_ENDPOINT_RESOURCE_DESCRIPTION **bufferedValue); HRESULT ( STDMETHODCALLTYPE *GetCodePackageNames )( IFabricCodePackageActivationContext * This, /* [retval][out] */ IFabricStringListResult **names); HRESULT ( STDMETHODCALLTYPE *GetConfigurationPackageNames )( IFabricCodePackageActivationContext * This, /* [retval][out] */ IFabricStringListResult **names); HRESULT ( STDMETHODCALLTYPE *GetDataPackageNames )( IFabricCodePackageActivationContext * This, /* [retval][out] */ IFabricStringListResult **names); HRESULT ( STDMETHODCALLTYPE *GetCodePackage )( IFabricCodePackageActivationContext * This, /* [in] */ LPCWSTR codePackageName, /* [retval][out] */ IFabricCodePackage **codePackage); HRESULT ( STDMETHODCALLTYPE *GetConfigurationPackage )( IFabricCodePackageActivationContext * This, /* [in] */ LPCWSTR configPackageName, /* [retval][out] */ IFabricConfigurationPackage **configPackage); HRESULT ( STDMETHODCALLTYPE *GetDataPackage )( IFabricCodePackageActivationContext * This, /* [in] */ LPCWSTR dataPackageName, /* [retval][out] */ IFabricDataPackage **dataPackage); HRESULT ( STDMETHODCALLTYPE *RegisterCodePackageChangeHandler )( IFabricCodePackageActivationContext * This, /* [in] */ IFabricCodePackageChangeHandler *callback, /* [retval][out] */ LONGLONG *callbackHandle); HRESULT ( STDMETHODCALLTYPE *UnregisterCodePackageChangeHandler )( IFabricCodePackageActivationContext * This, /* [in] */ LONGLONG callbackHandle); HRESULT ( STDMETHODCALLTYPE *RegisterConfigurationPackageChangeHandler )( IFabricCodePackageActivationContext * This, /* [in] */ IFabricConfigurationPackageChangeHandler *callback, /* [retval][out] */ LONGLONG *callbackHandle); HRESULT ( STDMETHODCALLTYPE *UnregisterConfigurationPackageChangeHandler )( IFabricCodePackageActivationContext * This, /* [in] */ LONGLONG callbackHandle); HRESULT ( STDMETHODCALLTYPE *RegisterDataPackageChangeHandler )( IFabricCodePackageActivationContext * This, /* [in] */ IFabricDataPackageChangeHandler *callback, /* [retval][out] */ LONGLONG *callbackHandle); HRESULT ( STDMETHODCALLTYPE *UnregisterDataPackageChangeHandler )( IFabricCodePackageActivationContext * This, /* [in] */ LONGLONG callbackHandle); END_INTERFACE } IFabricCodePackageActivationContextVtbl; interface IFabricCodePackageActivationContext { CONST_VTBL struct IFabricCodePackageActivationContextVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricCodePackageActivationContext_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricCodePackageActivationContext_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricCodePackageActivationContext_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricCodePackageActivationContext_get_ContextId(This) \ ( (This)->lpVtbl -> get_ContextId(This) ) #define IFabricCodePackageActivationContext_get_CodePackageName(This) \ ( (This)->lpVtbl -> get_CodePackageName(This) ) #define IFabricCodePackageActivationContext_get_CodePackageVersion(This) \ ( (This)->lpVtbl -> get_CodePackageVersion(This) ) #define IFabricCodePackageActivationContext_get_WorkDirectory(This) \ ( (This)->lpVtbl -> get_WorkDirectory(This) ) #define IFabricCodePackageActivationContext_get_LogDirectory(This) \ ( (This)->lpVtbl -> get_LogDirectory(This) ) #define IFabricCodePackageActivationContext_get_TempDirectory(This) \ ( (This)->lpVtbl -> get_TempDirectory(This) ) #define IFabricCodePackageActivationContext_get_ServiceTypes(This) \ ( (This)->lpVtbl -> get_ServiceTypes(This) ) #define IFabricCodePackageActivationContext_get_ServiceGroupTypes(This) \ ( (This)->lpVtbl -> get_ServiceGroupTypes(This) ) #define IFabricCodePackageActivationContext_get_ApplicationPrincipals(This) \ ( (This)->lpVtbl -> get_ApplicationPrincipals(This) ) #define IFabricCodePackageActivationContext_get_ServiceEndpointResources(This) \ ( (This)->lpVtbl -> get_ServiceEndpointResources(This) ) #define IFabricCodePackageActivationContext_GetServiceEndpointResource(This,serviceEndpointResourceName,bufferedValue) \ ( (This)->lpVtbl -> GetServiceEndpointResource(This,serviceEndpointResourceName,bufferedValue) ) #define IFabricCodePackageActivationContext_GetCodePackageNames(This,names) \ ( (This)->lpVtbl -> GetCodePackageNames(This,names) ) #define IFabricCodePackageActivationContext_GetConfigurationPackageNames(This,names) \ ( (This)->lpVtbl -> GetConfigurationPackageNames(This,names) ) #define IFabricCodePackageActivationContext_GetDataPackageNames(This,names) \ ( (This)->lpVtbl -> GetDataPackageNames(This,names) ) #define IFabricCodePackageActivationContext_GetCodePackage(This,codePackageName,codePackage) \ ( (This)->lpVtbl -> GetCodePackage(This,codePackageName,codePackage) ) #define IFabricCodePackageActivationContext_GetConfigurationPackage(This,configPackageName,configPackage) \ ( (This)->lpVtbl -> GetConfigurationPackage(This,configPackageName,configPackage) ) #define IFabricCodePackageActivationContext_GetDataPackage(This,dataPackageName,dataPackage) \ ( (This)->lpVtbl -> GetDataPackage(This,dataPackageName,dataPackage) ) #define IFabricCodePackageActivationContext_RegisterCodePackageChangeHandler(This,callback,callbackHandle) \ ( (This)->lpVtbl -> RegisterCodePackageChangeHandler(This,callback,callbackHandle) ) #define IFabricCodePackageActivationContext_UnregisterCodePackageChangeHandler(This,callbackHandle) \ ( (This)->lpVtbl -> UnregisterCodePackageChangeHandler(This,callbackHandle) ) #define IFabricCodePackageActivationContext_RegisterConfigurationPackageChangeHandler(This,callback,callbackHandle) \ ( (This)->lpVtbl -> RegisterConfigurationPackageChangeHandler(This,callback,callbackHandle) ) #define IFabricCodePackageActivationContext_UnregisterConfigurationPackageChangeHandler(This,callbackHandle) \ ( (This)->lpVtbl -> UnregisterConfigurationPackageChangeHandler(This,callbackHandle) ) #define IFabricCodePackageActivationContext_RegisterDataPackageChangeHandler(This,callback,callbackHandle) \ ( (This)->lpVtbl -> RegisterDataPackageChangeHandler(This,callback,callbackHandle) ) #define IFabricCodePackageActivationContext_UnregisterDataPackageChangeHandler(This,callbackHandle) \ ( (This)->lpVtbl -> UnregisterDataPackageChangeHandler(This,callbackHandle) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricCodePackageActivationContext_INTERFACE_DEFINED__ */ #ifndef __IFabricCodePackageActivationContext2_INTERFACE_DEFINED__ #define __IFabricCodePackageActivationContext2_INTERFACE_DEFINED__ /* interface IFabricCodePackageActivationContext2 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricCodePackageActivationContext2; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("6c83d5c1-1954-4b80-9175-0d0e7c8715c9") IFabricCodePackageActivationContext2 : public IFabricCodePackageActivationContext { public: virtual FABRIC_URI STDMETHODCALLTYPE get_ApplicationName( void) = 0; virtual LPCWSTR STDMETHODCALLTYPE get_ApplicationTypeName( void) = 0; virtual HRESULT STDMETHODCALLTYPE GetServiceManifestName( /* [retval][out] */ IFabricStringResult **serviceManifestName) = 0; virtual HRESULT STDMETHODCALLTYPE GetServiceManifestVersion( /* [retval][out] */ IFabricStringResult **serviceManifestVersion) = 0; }; #else /* C style interface */ typedef struct IFabricCodePackageActivationContext2Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricCodePackageActivationContext2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricCodePackageActivationContext2 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricCodePackageActivationContext2 * This); LPCWSTR ( STDMETHODCALLTYPE *get_ContextId )( IFabricCodePackageActivationContext2 * This); LPCWSTR ( STDMETHODCALLTYPE *get_CodePackageName )( IFabricCodePackageActivationContext2 * This); LPCWSTR ( STDMETHODCALLTYPE *get_CodePackageVersion )( IFabricCodePackageActivationContext2 * This); LPCWSTR ( STDMETHODCALLTYPE *get_WorkDirectory )( IFabricCodePackageActivationContext2 * This); LPCWSTR ( STDMETHODCALLTYPE *get_LogDirectory )( IFabricCodePackageActivationContext2 * This); LPCWSTR ( STDMETHODCALLTYPE *get_TempDirectory )( IFabricCodePackageActivationContext2 * This); const FABRIC_SERVICE_TYPE_DESCRIPTION_LIST *( STDMETHODCALLTYPE *get_ServiceTypes )( IFabricCodePackageActivationContext2 * This); const FABRIC_SERVICE_GROUP_TYPE_DESCRIPTION_LIST *( STDMETHODCALLTYPE *get_ServiceGroupTypes )( IFabricCodePackageActivationContext2 * This); const FABRIC_APPLICATION_PRINCIPALS_DESCRIPTION *( STDMETHODCALLTYPE *get_ApplicationPrincipals )( IFabricCodePackageActivationContext2 * This); const FABRIC_ENDPOINT_RESOURCE_DESCRIPTION_LIST *( STDMETHODCALLTYPE *get_ServiceEndpointResources )( IFabricCodePackageActivationContext2 * This); HRESULT ( STDMETHODCALLTYPE *GetServiceEndpointResource )( IFabricCodePackageActivationContext2 * This, /* [in] */ LPCWSTR serviceEndpointResourceName, /* [retval][out] */ const FABRIC_ENDPOINT_RESOURCE_DESCRIPTION **bufferedValue); HRESULT ( STDMETHODCALLTYPE *GetCodePackageNames )( IFabricCodePackageActivationContext2 * This, /* [retval][out] */ IFabricStringListResult **names); HRESULT ( STDMETHODCALLTYPE *GetConfigurationPackageNames )( IFabricCodePackageActivationContext2 * This, /* [retval][out] */ IFabricStringListResult **names); HRESULT ( STDMETHODCALLTYPE *GetDataPackageNames )( IFabricCodePackageActivationContext2 * This, /* [retval][out] */ IFabricStringListResult **names); HRESULT ( STDMETHODCALLTYPE *GetCodePackage )( IFabricCodePackageActivationContext2 * This, /* [in] */ LPCWSTR codePackageName, /* [retval][out] */ IFabricCodePackage **codePackage); HRESULT ( STDMETHODCALLTYPE *GetConfigurationPackage )( IFabricCodePackageActivationContext2 * This, /* [in] */ LPCWSTR configPackageName, /* [retval][out] */ IFabricConfigurationPackage **configPackage); HRESULT ( STDMETHODCALLTYPE *GetDataPackage )( IFabricCodePackageActivationContext2 * This, /* [in] */ LPCWSTR dataPackageName, /* [retval][out] */ IFabricDataPackage **dataPackage); HRESULT ( STDMETHODCALLTYPE *RegisterCodePackageChangeHandler )( IFabricCodePackageActivationContext2 * This, /* [in] */ IFabricCodePackageChangeHandler *callback, /* [retval][out] */ LONGLONG *callbackHandle); HRESULT ( STDMETHODCALLTYPE *UnregisterCodePackageChangeHandler )( IFabricCodePackageActivationContext2 * This, /* [in] */ LONGLONG callbackHandle); HRESULT ( STDMETHODCALLTYPE *RegisterConfigurationPackageChangeHandler )( IFabricCodePackageActivationContext2 * This, /* [in] */ IFabricConfigurationPackageChangeHandler *callback, /* [retval][out] */ LONGLONG *callbackHandle); HRESULT ( STDMETHODCALLTYPE *UnregisterConfigurationPackageChangeHandler )( IFabricCodePackageActivationContext2 * This, /* [in] */ LONGLONG callbackHandle); HRESULT ( STDMETHODCALLTYPE *RegisterDataPackageChangeHandler )( IFabricCodePackageActivationContext2 * This, /* [in] */ IFabricDataPackageChangeHandler *callback, /* [retval][out] */ LONGLONG *callbackHandle); HRESULT ( STDMETHODCALLTYPE *UnregisterDataPackageChangeHandler )( IFabricCodePackageActivationContext2 * This, /* [in] */ LONGLONG callbackHandle); FABRIC_URI ( STDMETHODCALLTYPE *get_ApplicationName )( IFabricCodePackageActivationContext2 * This); LPCWSTR ( STDMETHODCALLTYPE *get_ApplicationTypeName )( IFabricCodePackageActivationContext2 * This); HRESULT ( STDMETHODCALLTYPE *GetServiceManifestName )( IFabricCodePackageActivationContext2 * This, /* [retval][out] */ IFabricStringResult **serviceManifestName); HRESULT ( STDMETHODCALLTYPE *GetServiceManifestVersion )( IFabricCodePackageActivationContext2 * This, /* [retval][out] */ IFabricStringResult **serviceManifestVersion); END_INTERFACE } IFabricCodePackageActivationContext2Vtbl; interface IFabricCodePackageActivationContext2 { CONST_VTBL struct IFabricCodePackageActivationContext2Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricCodePackageActivationContext2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricCodePackageActivationContext2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricCodePackageActivationContext2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricCodePackageActivationContext2_get_ContextId(This) \ ( (This)->lpVtbl -> get_ContextId(This) ) #define IFabricCodePackageActivationContext2_get_CodePackageName(This) \ ( (This)->lpVtbl -> get_CodePackageName(This) ) #define IFabricCodePackageActivationContext2_get_CodePackageVersion(This) \ ( (This)->lpVtbl -> get_CodePackageVersion(This) ) #define IFabricCodePackageActivationContext2_get_WorkDirectory(This) \ ( (This)->lpVtbl -> get_WorkDirectory(This) ) #define IFabricCodePackageActivationContext2_get_LogDirectory(This) \ ( (This)->lpVtbl -> get_LogDirectory(This) ) #define IFabricCodePackageActivationContext2_get_TempDirectory(This) \ ( (This)->lpVtbl -> get_TempDirectory(This) ) #define IFabricCodePackageActivationContext2_get_ServiceTypes(This) \ ( (This)->lpVtbl -> get_ServiceTypes(This) ) #define IFabricCodePackageActivationContext2_get_ServiceGroupTypes(This) \ ( (This)->lpVtbl -> get_ServiceGroupTypes(This) ) #define IFabricCodePackageActivationContext2_get_ApplicationPrincipals(This) \ ( (This)->lpVtbl -> get_ApplicationPrincipals(This) ) #define IFabricCodePackageActivationContext2_get_ServiceEndpointResources(This) \ ( (This)->lpVtbl -> get_ServiceEndpointResources(This) ) #define IFabricCodePackageActivationContext2_GetServiceEndpointResource(This,serviceEndpointResourceName,bufferedValue) \ ( (This)->lpVtbl -> GetServiceEndpointResource(This,serviceEndpointResourceName,bufferedValue) ) #define IFabricCodePackageActivationContext2_GetCodePackageNames(This,names) \ ( (This)->lpVtbl -> GetCodePackageNames(This,names) ) #define IFabricCodePackageActivationContext2_GetConfigurationPackageNames(This,names) \ ( (This)->lpVtbl -> GetConfigurationPackageNames(This,names) ) #define IFabricCodePackageActivationContext2_GetDataPackageNames(This,names) \ ( (This)->lpVtbl -> GetDataPackageNames(This,names) ) #define IFabricCodePackageActivationContext2_GetCodePackage(This,codePackageName,codePackage) \ ( (This)->lpVtbl -> GetCodePackage(This,codePackageName,codePackage) ) #define IFabricCodePackageActivationContext2_GetConfigurationPackage(This,configPackageName,configPackage) \ ( (This)->lpVtbl -> GetConfigurationPackage(This,configPackageName,configPackage) ) #define IFabricCodePackageActivationContext2_GetDataPackage(This,dataPackageName,dataPackage) \ ( (This)->lpVtbl -> GetDataPackage(This,dataPackageName,dataPackage) ) #define IFabricCodePackageActivationContext2_RegisterCodePackageChangeHandler(This,callback,callbackHandle) \ ( (This)->lpVtbl -> RegisterCodePackageChangeHandler(This,callback,callbackHandle) ) #define IFabricCodePackageActivationContext2_UnregisterCodePackageChangeHandler(This,callbackHandle) \ ( (This)->lpVtbl -> UnregisterCodePackageChangeHandler(This,callbackHandle) ) #define IFabricCodePackageActivationContext2_RegisterConfigurationPackageChangeHandler(This,callback,callbackHandle) \ ( (This)->lpVtbl -> RegisterConfigurationPackageChangeHandler(This,callback,callbackHandle) ) #define IFabricCodePackageActivationContext2_UnregisterConfigurationPackageChangeHandler(This,callbackHandle) \ ( (This)->lpVtbl -> UnregisterConfigurationPackageChangeHandler(This,callbackHandle) ) #define IFabricCodePackageActivationContext2_RegisterDataPackageChangeHandler(This,callback,callbackHandle) \ ( (This)->lpVtbl -> RegisterDataPackageChangeHandler(This,callback,callbackHandle) ) #define IFabricCodePackageActivationContext2_UnregisterDataPackageChangeHandler(This,callbackHandle) \ ( (This)->lpVtbl -> UnregisterDataPackageChangeHandler(This,callbackHandle) ) #define IFabricCodePackageActivationContext2_get_ApplicationName(This) \ ( (This)->lpVtbl -> get_ApplicationName(This) ) #define IFabricCodePackageActivationContext2_get_ApplicationTypeName(This) \ ( (This)->lpVtbl -> get_ApplicationTypeName(This) ) #define IFabricCodePackageActivationContext2_GetServiceManifestName(This,serviceManifestName) \ ( (This)->lpVtbl -> GetServiceManifestName(This,serviceManifestName) ) #define IFabricCodePackageActivationContext2_GetServiceManifestVersion(This,serviceManifestVersion) \ ( (This)->lpVtbl -> GetServiceManifestVersion(This,serviceManifestVersion) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricCodePackageActivationContext2_INTERFACE_DEFINED__ */ #ifndef __IFabricCodePackageActivationContext3_INTERFACE_DEFINED__ #define __IFabricCodePackageActivationContext3_INTERFACE_DEFINED__ /* interface IFabricCodePackageActivationContext3 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricCodePackageActivationContext3; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("6efee900-f491-4b03-bc5b-3a70de103593") IFabricCodePackageActivationContext3 : public IFabricCodePackageActivationContext2 { public: virtual HRESULT STDMETHODCALLTYPE ReportApplicationHealth( /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo) = 0; virtual HRESULT STDMETHODCALLTYPE ReportDeployedApplicationHealth( /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo) = 0; virtual HRESULT STDMETHODCALLTYPE ReportDeployedServicePackageHealth( /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo) = 0; }; #else /* C style interface */ typedef struct IFabricCodePackageActivationContext3Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricCodePackageActivationContext3 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricCodePackageActivationContext3 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricCodePackageActivationContext3 * This); LPCWSTR ( STDMETHODCALLTYPE *get_ContextId )( IFabricCodePackageActivationContext3 * This); LPCWSTR ( STDMETHODCALLTYPE *get_CodePackageName )( IFabricCodePackageActivationContext3 * This); LPCWSTR ( STDMETHODCALLTYPE *get_CodePackageVersion )( IFabricCodePackageActivationContext3 * This); LPCWSTR ( STDMETHODCALLTYPE *get_WorkDirectory )( IFabricCodePackageActivationContext3 * This); LPCWSTR ( STDMETHODCALLTYPE *get_LogDirectory )( IFabricCodePackageActivationContext3 * This); LPCWSTR ( STDMETHODCALLTYPE *get_TempDirectory )( IFabricCodePackageActivationContext3 * This); const FABRIC_SERVICE_TYPE_DESCRIPTION_LIST *( STDMETHODCALLTYPE *get_ServiceTypes )( IFabricCodePackageActivationContext3 * This); const FABRIC_SERVICE_GROUP_TYPE_DESCRIPTION_LIST *( STDMETHODCALLTYPE *get_ServiceGroupTypes )( IFabricCodePackageActivationContext3 * This); const FABRIC_APPLICATION_PRINCIPALS_DESCRIPTION *( STDMETHODCALLTYPE *get_ApplicationPrincipals )( IFabricCodePackageActivationContext3 * This); const FABRIC_ENDPOINT_RESOURCE_DESCRIPTION_LIST *( STDMETHODCALLTYPE *get_ServiceEndpointResources )( IFabricCodePackageActivationContext3 * This); HRESULT ( STDMETHODCALLTYPE *GetServiceEndpointResource )( IFabricCodePackageActivationContext3 * This, /* [in] */ LPCWSTR serviceEndpointResourceName, /* [retval][out] */ const FABRIC_ENDPOINT_RESOURCE_DESCRIPTION **bufferedValue); HRESULT ( STDMETHODCALLTYPE *GetCodePackageNames )( IFabricCodePackageActivationContext3 * This, /* [retval][out] */ IFabricStringListResult **names); HRESULT ( STDMETHODCALLTYPE *GetConfigurationPackageNames )( IFabricCodePackageActivationContext3 * This, /* [retval][out] */ IFabricStringListResult **names); HRESULT ( STDMETHODCALLTYPE *GetDataPackageNames )( IFabricCodePackageActivationContext3 * This, /* [retval][out] */ IFabricStringListResult **names); HRESULT ( STDMETHODCALLTYPE *GetCodePackage )( IFabricCodePackageActivationContext3 * This, /* [in] */ LPCWSTR codePackageName, /* [retval][out] */ IFabricCodePackage **codePackage); HRESULT ( STDMETHODCALLTYPE *GetConfigurationPackage )( IFabricCodePackageActivationContext3 * This, /* [in] */ LPCWSTR configPackageName, /* [retval][out] */ IFabricConfigurationPackage **configPackage); HRESULT ( STDMETHODCALLTYPE *GetDataPackage )( IFabricCodePackageActivationContext3 * This, /* [in] */ LPCWSTR dataPackageName, /* [retval][out] */ IFabricDataPackage **dataPackage); HRESULT ( STDMETHODCALLTYPE *RegisterCodePackageChangeHandler )( IFabricCodePackageActivationContext3 * This, /* [in] */ IFabricCodePackageChangeHandler *callback, /* [retval][out] */ LONGLONG *callbackHandle); HRESULT ( STDMETHODCALLTYPE *UnregisterCodePackageChangeHandler )( IFabricCodePackageActivationContext3 * This, /* [in] */ LONGLONG callbackHandle); HRESULT ( STDMETHODCALLTYPE *RegisterConfigurationPackageChangeHandler )( IFabricCodePackageActivationContext3 * This, /* [in] */ IFabricConfigurationPackageChangeHandler *callback, /* [retval][out] */ LONGLONG *callbackHandle); HRESULT ( STDMETHODCALLTYPE *UnregisterConfigurationPackageChangeHandler )( IFabricCodePackageActivationContext3 * This, /* [in] */ LONGLONG callbackHandle); HRESULT ( STDMETHODCALLTYPE *RegisterDataPackageChangeHandler )( IFabricCodePackageActivationContext3 * This, /* [in] */ IFabricDataPackageChangeHandler *callback, /* [retval][out] */ LONGLONG *callbackHandle); HRESULT ( STDMETHODCALLTYPE *UnregisterDataPackageChangeHandler )( IFabricCodePackageActivationContext3 * This, /* [in] */ LONGLONG callbackHandle); FABRIC_URI ( STDMETHODCALLTYPE *get_ApplicationName )( IFabricCodePackageActivationContext3 * This); LPCWSTR ( STDMETHODCALLTYPE *get_ApplicationTypeName )( IFabricCodePackageActivationContext3 * This); HRESULT ( STDMETHODCALLTYPE *GetServiceManifestName )( IFabricCodePackageActivationContext3 * This, /* [retval][out] */ IFabricStringResult **serviceManifestName); HRESULT ( STDMETHODCALLTYPE *GetServiceManifestVersion )( IFabricCodePackageActivationContext3 * This, /* [retval][out] */ IFabricStringResult **serviceManifestVersion); HRESULT ( STDMETHODCALLTYPE *ReportApplicationHealth )( IFabricCodePackageActivationContext3 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo); HRESULT ( STDMETHODCALLTYPE *ReportDeployedApplicationHealth )( IFabricCodePackageActivationContext3 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo); HRESULT ( STDMETHODCALLTYPE *ReportDeployedServicePackageHealth )( IFabricCodePackageActivationContext3 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo); END_INTERFACE } IFabricCodePackageActivationContext3Vtbl; interface IFabricCodePackageActivationContext3 { CONST_VTBL struct IFabricCodePackageActivationContext3Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricCodePackageActivationContext3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricCodePackageActivationContext3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricCodePackageActivationContext3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricCodePackageActivationContext3_get_ContextId(This) \ ( (This)->lpVtbl -> get_ContextId(This) ) #define IFabricCodePackageActivationContext3_get_CodePackageName(This) \ ( (This)->lpVtbl -> get_CodePackageName(This) ) #define IFabricCodePackageActivationContext3_get_CodePackageVersion(This) \ ( (This)->lpVtbl -> get_CodePackageVersion(This) ) #define IFabricCodePackageActivationContext3_get_WorkDirectory(This) \ ( (This)->lpVtbl -> get_WorkDirectory(This) ) #define IFabricCodePackageActivationContext3_get_LogDirectory(This) \ ( (This)->lpVtbl -> get_LogDirectory(This) ) #define IFabricCodePackageActivationContext3_get_TempDirectory(This) \ ( (This)->lpVtbl -> get_TempDirectory(This) ) #define IFabricCodePackageActivationContext3_get_ServiceTypes(This) \ ( (This)->lpVtbl -> get_ServiceTypes(This) ) #define IFabricCodePackageActivationContext3_get_ServiceGroupTypes(This) \ ( (This)->lpVtbl -> get_ServiceGroupTypes(This) ) #define IFabricCodePackageActivationContext3_get_ApplicationPrincipals(This) \ ( (This)->lpVtbl -> get_ApplicationPrincipals(This) ) #define IFabricCodePackageActivationContext3_get_ServiceEndpointResources(This) \ ( (This)->lpVtbl -> get_ServiceEndpointResources(This) ) #define IFabricCodePackageActivationContext3_GetServiceEndpointResource(This,serviceEndpointResourceName,bufferedValue) \ ( (This)->lpVtbl -> GetServiceEndpointResource(This,serviceEndpointResourceName,bufferedValue) ) #define IFabricCodePackageActivationContext3_GetCodePackageNames(This,names) \ ( (This)->lpVtbl -> GetCodePackageNames(This,names) ) #define IFabricCodePackageActivationContext3_GetConfigurationPackageNames(This,names) \ ( (This)->lpVtbl -> GetConfigurationPackageNames(This,names) ) #define IFabricCodePackageActivationContext3_GetDataPackageNames(This,names) \ ( (This)->lpVtbl -> GetDataPackageNames(This,names) ) #define IFabricCodePackageActivationContext3_GetCodePackage(This,codePackageName,codePackage) \ ( (This)->lpVtbl -> GetCodePackage(This,codePackageName,codePackage) ) #define IFabricCodePackageActivationContext3_GetConfigurationPackage(This,configPackageName,configPackage) \ ( (This)->lpVtbl -> GetConfigurationPackage(This,configPackageName,configPackage) ) #define IFabricCodePackageActivationContext3_GetDataPackage(This,dataPackageName,dataPackage) \ ( (This)->lpVtbl -> GetDataPackage(This,dataPackageName,dataPackage) ) #define IFabricCodePackageActivationContext3_RegisterCodePackageChangeHandler(This,callback,callbackHandle) \ ( (This)->lpVtbl -> RegisterCodePackageChangeHandler(This,callback,callbackHandle) ) #define IFabricCodePackageActivationContext3_UnregisterCodePackageChangeHandler(This,callbackHandle) \ ( (This)->lpVtbl -> UnregisterCodePackageChangeHandler(This,callbackHandle) ) #define IFabricCodePackageActivationContext3_RegisterConfigurationPackageChangeHandler(This,callback,callbackHandle) \ ( (This)->lpVtbl -> RegisterConfigurationPackageChangeHandler(This,callback,callbackHandle) ) #define IFabricCodePackageActivationContext3_UnregisterConfigurationPackageChangeHandler(This,callbackHandle) \ ( (This)->lpVtbl -> UnregisterConfigurationPackageChangeHandler(This,callbackHandle) ) #define IFabricCodePackageActivationContext3_RegisterDataPackageChangeHandler(This,callback,callbackHandle) \ ( (This)->lpVtbl -> RegisterDataPackageChangeHandler(This,callback,callbackHandle) ) #define IFabricCodePackageActivationContext3_UnregisterDataPackageChangeHandler(This,callbackHandle) \ ( (This)->lpVtbl -> UnregisterDataPackageChangeHandler(This,callbackHandle) ) #define IFabricCodePackageActivationContext3_get_ApplicationName(This) \ ( (This)->lpVtbl -> get_ApplicationName(This) ) #define IFabricCodePackageActivationContext3_get_ApplicationTypeName(This) \ ( (This)->lpVtbl -> get_ApplicationTypeName(This) ) #define IFabricCodePackageActivationContext3_GetServiceManifestName(This,serviceManifestName) \ ( (This)->lpVtbl -> GetServiceManifestName(This,serviceManifestName) ) #define IFabricCodePackageActivationContext3_GetServiceManifestVersion(This,serviceManifestVersion) \ ( (This)->lpVtbl -> GetServiceManifestVersion(This,serviceManifestVersion) ) #define IFabricCodePackageActivationContext3_ReportApplicationHealth(This,healthInfo) \ ( (This)->lpVtbl -> ReportApplicationHealth(This,healthInfo) ) #define IFabricCodePackageActivationContext3_ReportDeployedApplicationHealth(This,healthInfo) \ ( (This)->lpVtbl -> ReportDeployedApplicationHealth(This,healthInfo) ) #define IFabricCodePackageActivationContext3_ReportDeployedServicePackageHealth(This,healthInfo) \ ( (This)->lpVtbl -> ReportDeployedServicePackageHealth(This,healthInfo) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricCodePackageActivationContext3_INTERFACE_DEFINED__ */ #ifndef __IFabricCodePackageActivationContext4_INTERFACE_DEFINED__ #define __IFabricCodePackageActivationContext4_INTERFACE_DEFINED__ /* interface IFabricCodePackageActivationContext4 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricCodePackageActivationContext4; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("99efebb6-a7b4-4d45-b45e-f191a66eef03") IFabricCodePackageActivationContext4 : public IFabricCodePackageActivationContext3 { public: virtual HRESULT STDMETHODCALLTYPE ReportApplicationHealth2( /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo, /* [in] */ const FABRIC_HEALTH_REPORT_SEND_OPTIONS *sendOptions) = 0; virtual HRESULT STDMETHODCALLTYPE ReportDeployedApplicationHealth2( /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo, /* [in] */ const FABRIC_HEALTH_REPORT_SEND_OPTIONS *sendOptions) = 0; virtual HRESULT STDMETHODCALLTYPE ReportDeployedServicePackageHealth2( /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo, /* [in] */ const FABRIC_HEALTH_REPORT_SEND_OPTIONS *sendOptions) = 0; }; #else /* C style interface */ typedef struct IFabricCodePackageActivationContext4Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricCodePackageActivationContext4 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricCodePackageActivationContext4 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricCodePackageActivationContext4 * This); LPCWSTR ( STDMETHODCALLTYPE *get_ContextId )( IFabricCodePackageActivationContext4 * This); LPCWSTR ( STDMETHODCALLTYPE *get_CodePackageName )( IFabricCodePackageActivationContext4 * This); LPCWSTR ( STDMETHODCALLTYPE *get_CodePackageVersion )( IFabricCodePackageActivationContext4 * This); LPCWSTR ( STDMETHODCALLTYPE *get_WorkDirectory )( IFabricCodePackageActivationContext4 * This); LPCWSTR ( STDMETHODCALLTYPE *get_LogDirectory )( IFabricCodePackageActivationContext4 * This); LPCWSTR ( STDMETHODCALLTYPE *get_TempDirectory )( IFabricCodePackageActivationContext4 * This); const FABRIC_SERVICE_TYPE_DESCRIPTION_LIST *( STDMETHODCALLTYPE *get_ServiceTypes )( IFabricCodePackageActivationContext4 * This); const FABRIC_SERVICE_GROUP_TYPE_DESCRIPTION_LIST *( STDMETHODCALLTYPE *get_ServiceGroupTypes )( IFabricCodePackageActivationContext4 * This); const FABRIC_APPLICATION_PRINCIPALS_DESCRIPTION *( STDMETHODCALLTYPE *get_ApplicationPrincipals )( IFabricCodePackageActivationContext4 * This); const FABRIC_ENDPOINT_RESOURCE_DESCRIPTION_LIST *( STDMETHODCALLTYPE *get_ServiceEndpointResources )( IFabricCodePackageActivationContext4 * This); HRESULT ( STDMETHODCALLTYPE *GetServiceEndpointResource )( IFabricCodePackageActivationContext4 * This, /* [in] */ LPCWSTR serviceEndpointResourceName, /* [retval][out] */ const FABRIC_ENDPOINT_RESOURCE_DESCRIPTION **bufferedValue); HRESULT ( STDMETHODCALLTYPE *GetCodePackageNames )( IFabricCodePackageActivationContext4 * This, /* [retval][out] */ IFabricStringListResult **names); HRESULT ( STDMETHODCALLTYPE *GetConfigurationPackageNames )( IFabricCodePackageActivationContext4 * This, /* [retval][out] */ IFabricStringListResult **names); HRESULT ( STDMETHODCALLTYPE *GetDataPackageNames )( IFabricCodePackageActivationContext4 * This, /* [retval][out] */ IFabricStringListResult **names); HRESULT ( STDMETHODCALLTYPE *GetCodePackage )( IFabricCodePackageActivationContext4 * This, /* [in] */ LPCWSTR codePackageName, /* [retval][out] */ IFabricCodePackage **codePackage); HRESULT ( STDMETHODCALLTYPE *GetConfigurationPackage )( IFabricCodePackageActivationContext4 * This, /* [in] */ LPCWSTR configPackageName, /* [retval][out] */ IFabricConfigurationPackage **configPackage); HRESULT ( STDMETHODCALLTYPE *GetDataPackage )( IFabricCodePackageActivationContext4 * This, /* [in] */ LPCWSTR dataPackageName, /* [retval][out] */ IFabricDataPackage **dataPackage); HRESULT ( STDMETHODCALLTYPE *RegisterCodePackageChangeHandler )( IFabricCodePackageActivationContext4 * This, /* [in] */ IFabricCodePackageChangeHandler *callback, /* [retval][out] */ LONGLONG *callbackHandle); HRESULT ( STDMETHODCALLTYPE *UnregisterCodePackageChangeHandler )( IFabricCodePackageActivationContext4 * This, /* [in] */ LONGLONG callbackHandle); HRESULT ( STDMETHODCALLTYPE *RegisterConfigurationPackageChangeHandler )( IFabricCodePackageActivationContext4 * This, /* [in] */ IFabricConfigurationPackageChangeHandler *callback, /* [retval][out] */ LONGLONG *callbackHandle); HRESULT ( STDMETHODCALLTYPE *UnregisterConfigurationPackageChangeHandler )( IFabricCodePackageActivationContext4 * This, /* [in] */ LONGLONG callbackHandle); HRESULT ( STDMETHODCALLTYPE *RegisterDataPackageChangeHandler )( IFabricCodePackageActivationContext4 * This, /* [in] */ IFabricDataPackageChangeHandler *callback, /* [retval][out] */ LONGLONG *callbackHandle); HRESULT ( STDMETHODCALLTYPE *UnregisterDataPackageChangeHandler )( IFabricCodePackageActivationContext4 * This, /* [in] */ LONGLONG callbackHandle); FABRIC_URI ( STDMETHODCALLTYPE *get_ApplicationName )( IFabricCodePackageActivationContext4 * This); LPCWSTR ( STDMETHODCALLTYPE *get_ApplicationTypeName )( IFabricCodePackageActivationContext4 * This); HRESULT ( STDMETHODCALLTYPE *GetServiceManifestName )( IFabricCodePackageActivationContext4 * This, /* [retval][out] */ IFabricStringResult **serviceManifestName); HRESULT ( STDMETHODCALLTYPE *GetServiceManifestVersion )( IFabricCodePackageActivationContext4 * This, /* [retval][out] */ IFabricStringResult **serviceManifestVersion); HRESULT ( STDMETHODCALLTYPE *ReportApplicationHealth )( IFabricCodePackageActivationContext4 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo); HRESULT ( STDMETHODCALLTYPE *ReportDeployedApplicationHealth )( IFabricCodePackageActivationContext4 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo); HRESULT ( STDMETHODCALLTYPE *ReportDeployedServicePackageHealth )( IFabricCodePackageActivationContext4 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo); HRESULT ( STDMETHODCALLTYPE *ReportApplicationHealth2 )( IFabricCodePackageActivationContext4 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo, /* [in] */ const FABRIC_HEALTH_REPORT_SEND_OPTIONS *sendOptions); HRESULT ( STDMETHODCALLTYPE *ReportDeployedApplicationHealth2 )( IFabricCodePackageActivationContext4 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo, /* [in] */ const FABRIC_HEALTH_REPORT_SEND_OPTIONS *sendOptions); HRESULT ( STDMETHODCALLTYPE *ReportDeployedServicePackageHealth2 )( IFabricCodePackageActivationContext4 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo, /* [in] */ const FABRIC_HEALTH_REPORT_SEND_OPTIONS *sendOptions); END_INTERFACE } IFabricCodePackageActivationContext4Vtbl; interface IFabricCodePackageActivationContext4 { CONST_VTBL struct IFabricCodePackageActivationContext4Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricCodePackageActivationContext4_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricCodePackageActivationContext4_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricCodePackageActivationContext4_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricCodePackageActivationContext4_get_ContextId(This) \ ( (This)->lpVtbl -> get_ContextId(This) ) #define IFabricCodePackageActivationContext4_get_CodePackageName(This) \ ( (This)->lpVtbl -> get_CodePackageName(This) ) #define IFabricCodePackageActivationContext4_get_CodePackageVersion(This) \ ( (This)->lpVtbl -> get_CodePackageVersion(This) ) #define IFabricCodePackageActivationContext4_get_WorkDirectory(This) \ ( (This)->lpVtbl -> get_WorkDirectory(This) ) #define IFabricCodePackageActivationContext4_get_LogDirectory(This) \ ( (This)->lpVtbl -> get_LogDirectory(This) ) #define IFabricCodePackageActivationContext4_get_TempDirectory(This) \ ( (This)->lpVtbl -> get_TempDirectory(This) ) #define IFabricCodePackageActivationContext4_get_ServiceTypes(This) \ ( (This)->lpVtbl -> get_ServiceTypes(This) ) #define IFabricCodePackageActivationContext4_get_ServiceGroupTypes(This) \ ( (This)->lpVtbl -> get_ServiceGroupTypes(This) ) #define IFabricCodePackageActivationContext4_get_ApplicationPrincipals(This) \ ( (This)->lpVtbl -> get_ApplicationPrincipals(This) ) #define IFabricCodePackageActivationContext4_get_ServiceEndpointResources(This) \ ( (This)->lpVtbl -> get_ServiceEndpointResources(This) ) #define IFabricCodePackageActivationContext4_GetServiceEndpointResource(This,serviceEndpointResourceName,bufferedValue) \ ( (This)->lpVtbl -> GetServiceEndpointResource(This,serviceEndpointResourceName,bufferedValue) ) #define IFabricCodePackageActivationContext4_GetCodePackageNames(This,names) \ ( (This)->lpVtbl -> GetCodePackageNames(This,names) ) #define IFabricCodePackageActivationContext4_GetConfigurationPackageNames(This,names) \ ( (This)->lpVtbl -> GetConfigurationPackageNames(This,names) ) #define IFabricCodePackageActivationContext4_GetDataPackageNames(This,names) \ ( (This)->lpVtbl -> GetDataPackageNames(This,names) ) #define IFabricCodePackageActivationContext4_GetCodePackage(This,codePackageName,codePackage) \ ( (This)->lpVtbl -> GetCodePackage(This,codePackageName,codePackage) ) #define IFabricCodePackageActivationContext4_GetConfigurationPackage(This,configPackageName,configPackage) \ ( (This)->lpVtbl -> GetConfigurationPackage(This,configPackageName,configPackage) ) #define IFabricCodePackageActivationContext4_GetDataPackage(This,dataPackageName,dataPackage) \ ( (This)->lpVtbl -> GetDataPackage(This,dataPackageName,dataPackage) ) #define IFabricCodePackageActivationContext4_RegisterCodePackageChangeHandler(This,callback,callbackHandle) \ ( (This)->lpVtbl -> RegisterCodePackageChangeHandler(This,callback,callbackHandle) ) #define IFabricCodePackageActivationContext4_UnregisterCodePackageChangeHandler(This,callbackHandle) \ ( (This)->lpVtbl -> UnregisterCodePackageChangeHandler(This,callbackHandle) ) #define IFabricCodePackageActivationContext4_RegisterConfigurationPackageChangeHandler(This,callback,callbackHandle) \ ( (This)->lpVtbl -> RegisterConfigurationPackageChangeHandler(This,callback,callbackHandle) ) #define IFabricCodePackageActivationContext4_UnregisterConfigurationPackageChangeHandler(This,callbackHandle) \ ( (This)->lpVtbl -> UnregisterConfigurationPackageChangeHandler(This,callbackHandle) ) #define IFabricCodePackageActivationContext4_RegisterDataPackageChangeHandler(This,callback,callbackHandle) \ ( (This)->lpVtbl -> RegisterDataPackageChangeHandler(This,callback,callbackHandle) ) #define IFabricCodePackageActivationContext4_UnregisterDataPackageChangeHandler(This,callbackHandle) \ ( (This)->lpVtbl -> UnregisterDataPackageChangeHandler(This,callbackHandle) ) #define IFabricCodePackageActivationContext4_get_ApplicationName(This) \ ( (This)->lpVtbl -> get_ApplicationName(This) ) #define IFabricCodePackageActivationContext4_get_ApplicationTypeName(This) \ ( (This)->lpVtbl -> get_ApplicationTypeName(This) ) #define IFabricCodePackageActivationContext4_GetServiceManifestName(This,serviceManifestName) \ ( (This)->lpVtbl -> GetServiceManifestName(This,serviceManifestName) ) #define IFabricCodePackageActivationContext4_GetServiceManifestVersion(This,serviceManifestVersion) \ ( (This)->lpVtbl -> GetServiceManifestVersion(This,serviceManifestVersion) ) #define IFabricCodePackageActivationContext4_ReportApplicationHealth(This,healthInfo) \ ( (This)->lpVtbl -> ReportApplicationHealth(This,healthInfo) ) #define IFabricCodePackageActivationContext4_ReportDeployedApplicationHealth(This,healthInfo) \ ( (This)->lpVtbl -> ReportDeployedApplicationHealth(This,healthInfo) ) #define IFabricCodePackageActivationContext4_ReportDeployedServicePackageHealth(This,healthInfo) \ ( (This)->lpVtbl -> ReportDeployedServicePackageHealth(This,healthInfo) ) #define IFabricCodePackageActivationContext4_ReportApplicationHealth2(This,healthInfo,sendOptions) \ ( (This)->lpVtbl -> ReportApplicationHealth2(This,healthInfo,sendOptions) ) #define IFabricCodePackageActivationContext4_ReportDeployedApplicationHealth2(This,healthInfo,sendOptions) \ ( (This)->lpVtbl -> ReportDeployedApplicationHealth2(This,healthInfo,sendOptions) ) #define IFabricCodePackageActivationContext4_ReportDeployedServicePackageHealth2(This,healthInfo,sendOptions) \ ( (This)->lpVtbl -> ReportDeployedServicePackageHealth2(This,healthInfo,sendOptions) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricCodePackageActivationContext4_INTERFACE_DEFINED__ */ #ifndef __IFabricCodePackageActivationContext5_INTERFACE_DEFINED__ #define __IFabricCodePackageActivationContext5_INTERFACE_DEFINED__ /* interface IFabricCodePackageActivationContext5 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricCodePackageActivationContext5; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("fe45387e-8711-4949-ac36-31dc95035513") IFabricCodePackageActivationContext5 : public IFabricCodePackageActivationContext4 { public: virtual LPCWSTR STDMETHODCALLTYPE get_ServiceListenAddress( void) = 0; virtual LPCWSTR STDMETHODCALLTYPE get_ServicePublishAddress( void) = 0; }; #else /* C style interface */ typedef struct IFabricCodePackageActivationContext5Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricCodePackageActivationContext5 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricCodePackageActivationContext5 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricCodePackageActivationContext5 * This); LPCWSTR ( STDMETHODCALLTYPE *get_ContextId )( IFabricCodePackageActivationContext5 * This); LPCWSTR ( STDMETHODCALLTYPE *get_CodePackageName )( IFabricCodePackageActivationContext5 * This); LPCWSTR ( STDMETHODCALLTYPE *get_CodePackageVersion )( IFabricCodePackageActivationContext5 * This); LPCWSTR ( STDMETHODCALLTYPE *get_WorkDirectory )( IFabricCodePackageActivationContext5 * This); LPCWSTR ( STDMETHODCALLTYPE *get_LogDirectory )( IFabricCodePackageActivationContext5 * This); LPCWSTR ( STDMETHODCALLTYPE *get_TempDirectory )( IFabricCodePackageActivationContext5 * This); const FABRIC_SERVICE_TYPE_DESCRIPTION_LIST *( STDMETHODCALLTYPE *get_ServiceTypes )( IFabricCodePackageActivationContext5 * This); const FABRIC_SERVICE_GROUP_TYPE_DESCRIPTION_LIST *( STDMETHODCALLTYPE *get_ServiceGroupTypes )( IFabricCodePackageActivationContext5 * This); const FABRIC_APPLICATION_PRINCIPALS_DESCRIPTION *( STDMETHODCALLTYPE *get_ApplicationPrincipals )( IFabricCodePackageActivationContext5 * This); const FABRIC_ENDPOINT_RESOURCE_DESCRIPTION_LIST *( STDMETHODCALLTYPE *get_ServiceEndpointResources )( IFabricCodePackageActivationContext5 * This); HRESULT ( STDMETHODCALLTYPE *GetServiceEndpointResource )( IFabricCodePackageActivationContext5 * This, /* [in] */ LPCWSTR serviceEndpointResourceName, /* [retval][out] */ const FABRIC_ENDPOINT_RESOURCE_DESCRIPTION **bufferedValue); HRESULT ( STDMETHODCALLTYPE *GetCodePackageNames )( IFabricCodePackageActivationContext5 * This, /* [retval][out] */ IFabricStringListResult **names); HRESULT ( STDMETHODCALLTYPE *GetConfigurationPackageNames )( IFabricCodePackageActivationContext5 * This, /* [retval][out] */ IFabricStringListResult **names); HRESULT ( STDMETHODCALLTYPE *GetDataPackageNames )( IFabricCodePackageActivationContext5 * This, /* [retval][out] */ IFabricStringListResult **names); HRESULT ( STDMETHODCALLTYPE *GetCodePackage )( IFabricCodePackageActivationContext5 * This, /* [in] */ LPCWSTR codePackageName, /* [retval][out] */ IFabricCodePackage **codePackage); HRESULT ( STDMETHODCALLTYPE *GetConfigurationPackage )( IFabricCodePackageActivationContext5 * This, /* [in] */ LPCWSTR configPackageName, /* [retval][out] */ IFabricConfigurationPackage **configPackage); HRESULT ( STDMETHODCALLTYPE *GetDataPackage )( IFabricCodePackageActivationContext5 * This, /* [in] */ LPCWSTR dataPackageName, /* [retval][out] */ IFabricDataPackage **dataPackage); HRESULT ( STDMETHODCALLTYPE *RegisterCodePackageChangeHandler )( IFabricCodePackageActivationContext5 * This, /* [in] */ IFabricCodePackageChangeHandler *callback, /* [retval][out] */ LONGLONG *callbackHandle); HRESULT ( STDMETHODCALLTYPE *UnregisterCodePackageChangeHandler )( IFabricCodePackageActivationContext5 * This, /* [in] */ LONGLONG callbackHandle); HRESULT ( STDMETHODCALLTYPE *RegisterConfigurationPackageChangeHandler )( IFabricCodePackageActivationContext5 * This, /* [in] */ IFabricConfigurationPackageChangeHandler *callback, /* [retval][out] */ LONGLONG *callbackHandle); HRESULT ( STDMETHODCALLTYPE *UnregisterConfigurationPackageChangeHandler )( IFabricCodePackageActivationContext5 * This, /* [in] */ LONGLONG callbackHandle); HRESULT ( STDMETHODCALLTYPE *RegisterDataPackageChangeHandler )( IFabricCodePackageActivationContext5 * This, /* [in] */ IFabricDataPackageChangeHandler *callback, /* [retval][out] */ LONGLONG *callbackHandle); HRESULT ( STDMETHODCALLTYPE *UnregisterDataPackageChangeHandler )( IFabricCodePackageActivationContext5 * This, /* [in] */ LONGLONG callbackHandle); FABRIC_URI ( STDMETHODCALLTYPE *get_ApplicationName )( IFabricCodePackageActivationContext5 * This); LPCWSTR ( STDMETHODCALLTYPE *get_ApplicationTypeName )( IFabricCodePackageActivationContext5 * This); HRESULT ( STDMETHODCALLTYPE *GetServiceManifestName )( IFabricCodePackageActivationContext5 * This, /* [retval][out] */ IFabricStringResult **serviceManifestName); HRESULT ( STDMETHODCALLTYPE *GetServiceManifestVersion )( IFabricCodePackageActivationContext5 * This, /* [retval][out] */ IFabricStringResult **serviceManifestVersion); HRESULT ( STDMETHODCALLTYPE *ReportApplicationHealth )( IFabricCodePackageActivationContext5 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo); HRESULT ( STDMETHODCALLTYPE *ReportDeployedApplicationHealth )( IFabricCodePackageActivationContext5 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo); HRESULT ( STDMETHODCALLTYPE *ReportDeployedServicePackageHealth )( IFabricCodePackageActivationContext5 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo); HRESULT ( STDMETHODCALLTYPE *ReportApplicationHealth2 )( IFabricCodePackageActivationContext5 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo, /* [in] */ const FABRIC_HEALTH_REPORT_SEND_OPTIONS *sendOptions); HRESULT ( STDMETHODCALLTYPE *ReportDeployedApplicationHealth2 )( IFabricCodePackageActivationContext5 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo, /* [in] */ const FABRIC_HEALTH_REPORT_SEND_OPTIONS *sendOptions); HRESULT ( STDMETHODCALLTYPE *ReportDeployedServicePackageHealth2 )( IFabricCodePackageActivationContext5 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo, /* [in] */ const FABRIC_HEALTH_REPORT_SEND_OPTIONS *sendOptions); LPCWSTR ( STDMETHODCALLTYPE *get_ServiceListenAddress )( IFabricCodePackageActivationContext5 * This); LPCWSTR ( STDMETHODCALLTYPE *get_ServicePublishAddress )( IFabricCodePackageActivationContext5 * This); END_INTERFACE } IFabricCodePackageActivationContext5Vtbl; interface IFabricCodePackageActivationContext5 { CONST_VTBL struct IFabricCodePackageActivationContext5Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricCodePackageActivationContext5_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricCodePackageActivationContext5_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricCodePackageActivationContext5_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricCodePackageActivationContext5_get_ContextId(This) \ ( (This)->lpVtbl -> get_ContextId(This) ) #define IFabricCodePackageActivationContext5_get_CodePackageName(This) \ ( (This)->lpVtbl -> get_CodePackageName(This) ) #define IFabricCodePackageActivationContext5_get_CodePackageVersion(This) \ ( (This)->lpVtbl -> get_CodePackageVersion(This) ) #define IFabricCodePackageActivationContext5_get_WorkDirectory(This) \ ( (This)->lpVtbl -> get_WorkDirectory(This) ) #define IFabricCodePackageActivationContext5_get_LogDirectory(This) \ ( (This)->lpVtbl -> get_LogDirectory(This) ) #define IFabricCodePackageActivationContext5_get_TempDirectory(This) \ ( (This)->lpVtbl -> get_TempDirectory(This) ) #define IFabricCodePackageActivationContext5_get_ServiceTypes(This) \ ( (This)->lpVtbl -> get_ServiceTypes(This) ) #define IFabricCodePackageActivationContext5_get_ServiceGroupTypes(This) \ ( (This)->lpVtbl -> get_ServiceGroupTypes(This) ) #define IFabricCodePackageActivationContext5_get_ApplicationPrincipals(This) \ ( (This)->lpVtbl -> get_ApplicationPrincipals(This) ) #define IFabricCodePackageActivationContext5_get_ServiceEndpointResources(This) \ ( (This)->lpVtbl -> get_ServiceEndpointResources(This) ) #define IFabricCodePackageActivationContext5_GetServiceEndpointResource(This,serviceEndpointResourceName,bufferedValue) \ ( (This)->lpVtbl -> GetServiceEndpointResource(This,serviceEndpointResourceName,bufferedValue) ) #define IFabricCodePackageActivationContext5_GetCodePackageNames(This,names) \ ( (This)->lpVtbl -> GetCodePackageNames(This,names) ) #define IFabricCodePackageActivationContext5_GetConfigurationPackageNames(This,names) \ ( (This)->lpVtbl -> GetConfigurationPackageNames(This,names) ) #define IFabricCodePackageActivationContext5_GetDataPackageNames(This,names) \ ( (This)->lpVtbl -> GetDataPackageNames(This,names) ) #define IFabricCodePackageActivationContext5_GetCodePackage(This,codePackageName,codePackage) \ ( (This)->lpVtbl -> GetCodePackage(This,codePackageName,codePackage) ) #define IFabricCodePackageActivationContext5_GetConfigurationPackage(This,configPackageName,configPackage) \ ( (This)->lpVtbl -> GetConfigurationPackage(This,configPackageName,configPackage) ) #define IFabricCodePackageActivationContext5_GetDataPackage(This,dataPackageName,dataPackage) \ ( (This)->lpVtbl -> GetDataPackage(This,dataPackageName,dataPackage) ) #define IFabricCodePackageActivationContext5_RegisterCodePackageChangeHandler(This,callback,callbackHandle) \ ( (This)->lpVtbl -> RegisterCodePackageChangeHandler(This,callback,callbackHandle) ) #define IFabricCodePackageActivationContext5_UnregisterCodePackageChangeHandler(This,callbackHandle) \ ( (This)->lpVtbl -> UnregisterCodePackageChangeHandler(This,callbackHandle) ) #define IFabricCodePackageActivationContext5_RegisterConfigurationPackageChangeHandler(This,callback,callbackHandle) \ ( (This)->lpVtbl -> RegisterConfigurationPackageChangeHandler(This,callback,callbackHandle) ) #define IFabricCodePackageActivationContext5_UnregisterConfigurationPackageChangeHandler(This,callbackHandle) \ ( (This)->lpVtbl -> UnregisterConfigurationPackageChangeHandler(This,callbackHandle) ) #define IFabricCodePackageActivationContext5_RegisterDataPackageChangeHandler(This,callback,callbackHandle) \ ( (This)->lpVtbl -> RegisterDataPackageChangeHandler(This,callback,callbackHandle) ) #define IFabricCodePackageActivationContext5_UnregisterDataPackageChangeHandler(This,callbackHandle) \ ( (This)->lpVtbl -> UnregisterDataPackageChangeHandler(This,callbackHandle) ) #define IFabricCodePackageActivationContext5_get_ApplicationName(This) \ ( (This)->lpVtbl -> get_ApplicationName(This) ) #define IFabricCodePackageActivationContext5_get_ApplicationTypeName(This) \ ( (This)->lpVtbl -> get_ApplicationTypeName(This) ) #define IFabricCodePackageActivationContext5_GetServiceManifestName(This,serviceManifestName) \ ( (This)->lpVtbl -> GetServiceManifestName(This,serviceManifestName) ) #define IFabricCodePackageActivationContext5_GetServiceManifestVersion(This,serviceManifestVersion) \ ( (This)->lpVtbl -> GetServiceManifestVersion(This,serviceManifestVersion) ) #define IFabricCodePackageActivationContext5_ReportApplicationHealth(This,healthInfo) \ ( (This)->lpVtbl -> ReportApplicationHealth(This,healthInfo) ) #define IFabricCodePackageActivationContext5_ReportDeployedApplicationHealth(This,healthInfo) \ ( (This)->lpVtbl -> ReportDeployedApplicationHealth(This,healthInfo) ) #define IFabricCodePackageActivationContext5_ReportDeployedServicePackageHealth(This,healthInfo) \ ( (This)->lpVtbl -> ReportDeployedServicePackageHealth(This,healthInfo) ) #define IFabricCodePackageActivationContext5_ReportApplicationHealth2(This,healthInfo,sendOptions) \ ( (This)->lpVtbl -> ReportApplicationHealth2(This,healthInfo,sendOptions) ) #define IFabricCodePackageActivationContext5_ReportDeployedApplicationHealth2(This,healthInfo,sendOptions) \ ( (This)->lpVtbl -> ReportDeployedApplicationHealth2(This,healthInfo,sendOptions) ) #define IFabricCodePackageActivationContext5_ReportDeployedServicePackageHealth2(This,healthInfo,sendOptions) \ ( (This)->lpVtbl -> ReportDeployedServicePackageHealth2(This,healthInfo,sendOptions) ) #define IFabricCodePackageActivationContext5_get_ServiceListenAddress(This) \ ( (This)->lpVtbl -> get_ServiceListenAddress(This) ) #define IFabricCodePackageActivationContext5_get_ServicePublishAddress(This) \ ( (This)->lpVtbl -> get_ServicePublishAddress(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricCodePackageActivationContext5_INTERFACE_DEFINED__ */ #ifndef __IFabricCodePackageActivationContext6_INTERFACE_DEFINED__ #define __IFabricCodePackageActivationContext6_INTERFACE_DEFINED__ /* interface IFabricCodePackageActivationContext6 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricCodePackageActivationContext6; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("fa5fda9b-472c-45a0-9b60-a374691227a4") IFabricCodePackageActivationContext6 : public IFabricCodePackageActivationContext5 { public: virtual HRESULT STDMETHODCALLTYPE GetDirectory( /* [in] */ LPCWSTR logicalDirectoryName, /* [retval][out] */ IFabricStringResult **directoryPath) = 0; }; #else /* C style interface */ typedef struct IFabricCodePackageActivationContext6Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricCodePackageActivationContext6 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricCodePackageActivationContext6 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricCodePackageActivationContext6 * This); LPCWSTR ( STDMETHODCALLTYPE *get_ContextId )( IFabricCodePackageActivationContext6 * This); LPCWSTR ( STDMETHODCALLTYPE *get_CodePackageName )( IFabricCodePackageActivationContext6 * This); LPCWSTR ( STDMETHODCALLTYPE *get_CodePackageVersion )( IFabricCodePackageActivationContext6 * This); LPCWSTR ( STDMETHODCALLTYPE *get_WorkDirectory )( IFabricCodePackageActivationContext6 * This); LPCWSTR ( STDMETHODCALLTYPE *get_LogDirectory )( IFabricCodePackageActivationContext6 * This); LPCWSTR ( STDMETHODCALLTYPE *get_TempDirectory )( IFabricCodePackageActivationContext6 * This); const FABRIC_SERVICE_TYPE_DESCRIPTION_LIST *( STDMETHODCALLTYPE *get_ServiceTypes )( IFabricCodePackageActivationContext6 * This); const FABRIC_SERVICE_GROUP_TYPE_DESCRIPTION_LIST *( STDMETHODCALLTYPE *get_ServiceGroupTypes )( IFabricCodePackageActivationContext6 * This); const FABRIC_APPLICATION_PRINCIPALS_DESCRIPTION *( STDMETHODCALLTYPE *get_ApplicationPrincipals )( IFabricCodePackageActivationContext6 * This); const FABRIC_ENDPOINT_RESOURCE_DESCRIPTION_LIST *( STDMETHODCALLTYPE *get_ServiceEndpointResources )( IFabricCodePackageActivationContext6 * This); HRESULT ( STDMETHODCALLTYPE *GetServiceEndpointResource )( IFabricCodePackageActivationContext6 * This, /* [in] */ LPCWSTR serviceEndpointResourceName, /* [retval][out] */ const FABRIC_ENDPOINT_RESOURCE_DESCRIPTION **bufferedValue); HRESULT ( STDMETHODCALLTYPE *GetCodePackageNames )( IFabricCodePackageActivationContext6 * This, /* [retval][out] */ IFabricStringListResult **names); HRESULT ( STDMETHODCALLTYPE *GetConfigurationPackageNames )( IFabricCodePackageActivationContext6 * This, /* [retval][out] */ IFabricStringListResult **names); HRESULT ( STDMETHODCALLTYPE *GetDataPackageNames )( IFabricCodePackageActivationContext6 * This, /* [retval][out] */ IFabricStringListResult **names); HRESULT ( STDMETHODCALLTYPE *GetCodePackage )( IFabricCodePackageActivationContext6 * This, /* [in] */ LPCWSTR codePackageName, /* [retval][out] */ IFabricCodePackage **codePackage); HRESULT ( STDMETHODCALLTYPE *GetConfigurationPackage )( IFabricCodePackageActivationContext6 * This, /* [in] */ LPCWSTR configPackageName, /* [retval][out] */ IFabricConfigurationPackage **configPackage); HRESULT ( STDMETHODCALLTYPE *GetDataPackage )( IFabricCodePackageActivationContext6 * This, /* [in] */ LPCWSTR dataPackageName, /* [retval][out] */ IFabricDataPackage **dataPackage); HRESULT ( STDMETHODCALLTYPE *RegisterCodePackageChangeHandler )( IFabricCodePackageActivationContext6 * This, /* [in] */ IFabricCodePackageChangeHandler *callback, /* [retval][out] */ LONGLONG *callbackHandle); HRESULT ( STDMETHODCALLTYPE *UnregisterCodePackageChangeHandler )( IFabricCodePackageActivationContext6 * This, /* [in] */ LONGLONG callbackHandle); HRESULT ( STDMETHODCALLTYPE *RegisterConfigurationPackageChangeHandler )( IFabricCodePackageActivationContext6 * This, /* [in] */ IFabricConfigurationPackageChangeHandler *callback, /* [retval][out] */ LONGLONG *callbackHandle); HRESULT ( STDMETHODCALLTYPE *UnregisterConfigurationPackageChangeHandler )( IFabricCodePackageActivationContext6 * This, /* [in] */ LONGLONG callbackHandle); HRESULT ( STDMETHODCALLTYPE *RegisterDataPackageChangeHandler )( IFabricCodePackageActivationContext6 * This, /* [in] */ IFabricDataPackageChangeHandler *callback, /* [retval][out] */ LONGLONG *callbackHandle); HRESULT ( STDMETHODCALLTYPE *UnregisterDataPackageChangeHandler )( IFabricCodePackageActivationContext6 * This, /* [in] */ LONGLONG callbackHandle); FABRIC_URI ( STDMETHODCALLTYPE *get_ApplicationName )( IFabricCodePackageActivationContext6 * This); LPCWSTR ( STDMETHODCALLTYPE *get_ApplicationTypeName )( IFabricCodePackageActivationContext6 * This); HRESULT ( STDMETHODCALLTYPE *GetServiceManifestName )( IFabricCodePackageActivationContext6 * This, /* [retval][out] */ IFabricStringResult **serviceManifestName); HRESULT ( STDMETHODCALLTYPE *GetServiceManifestVersion )( IFabricCodePackageActivationContext6 * This, /* [retval][out] */ IFabricStringResult **serviceManifestVersion); HRESULT ( STDMETHODCALLTYPE *ReportApplicationHealth )( IFabricCodePackageActivationContext6 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo); HRESULT ( STDMETHODCALLTYPE *ReportDeployedApplicationHealth )( IFabricCodePackageActivationContext6 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo); HRESULT ( STDMETHODCALLTYPE *ReportDeployedServicePackageHealth )( IFabricCodePackageActivationContext6 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo); HRESULT ( STDMETHODCALLTYPE *ReportApplicationHealth2 )( IFabricCodePackageActivationContext6 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo, /* [in] */ const FABRIC_HEALTH_REPORT_SEND_OPTIONS *sendOptions); HRESULT ( STDMETHODCALLTYPE *ReportDeployedApplicationHealth2 )( IFabricCodePackageActivationContext6 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo, /* [in] */ const FABRIC_HEALTH_REPORT_SEND_OPTIONS *sendOptions); HRESULT ( STDMETHODCALLTYPE *ReportDeployedServicePackageHealth2 )( IFabricCodePackageActivationContext6 * This, /* [in] */ const FABRIC_HEALTH_INFORMATION *healthInfo, /* [in] */ const FABRIC_HEALTH_REPORT_SEND_OPTIONS *sendOptions); LPCWSTR ( STDMETHODCALLTYPE *get_ServiceListenAddress )( IFabricCodePackageActivationContext6 * This); LPCWSTR ( STDMETHODCALLTYPE *get_ServicePublishAddress )( IFabricCodePackageActivationContext6 * This); HRESULT ( STDMETHODCALLTYPE *GetDirectory )( IFabricCodePackageActivationContext6 * This, /* [in] */ LPCWSTR logicalDirectoryName, /* [retval][out] */ IFabricStringResult **directoryPath); END_INTERFACE } IFabricCodePackageActivationContext6Vtbl; interface IFabricCodePackageActivationContext6 { CONST_VTBL struct IFabricCodePackageActivationContext6Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricCodePackageActivationContext6_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricCodePackageActivationContext6_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricCodePackageActivationContext6_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricCodePackageActivationContext6_get_ContextId(This) \ ( (This)->lpVtbl -> get_ContextId(This) ) #define IFabricCodePackageActivationContext6_get_CodePackageName(This) \ ( (This)->lpVtbl -> get_CodePackageName(This) ) #define IFabricCodePackageActivationContext6_get_CodePackageVersion(This) \ ( (This)->lpVtbl -> get_CodePackageVersion(This) ) #define IFabricCodePackageActivationContext6_get_WorkDirectory(This) \ ( (This)->lpVtbl -> get_WorkDirectory(This) ) #define IFabricCodePackageActivationContext6_get_LogDirectory(This) \ ( (This)->lpVtbl -> get_LogDirectory(This) ) #define IFabricCodePackageActivationContext6_get_TempDirectory(This) \ ( (This)->lpVtbl -> get_TempDirectory(This) ) #define IFabricCodePackageActivationContext6_get_ServiceTypes(This) \ ( (This)->lpVtbl -> get_ServiceTypes(This) ) #define IFabricCodePackageActivationContext6_get_ServiceGroupTypes(This) \ ( (This)->lpVtbl -> get_ServiceGroupTypes(This) ) #define IFabricCodePackageActivationContext6_get_ApplicationPrincipals(This) \ ( (This)->lpVtbl -> get_ApplicationPrincipals(This) ) #define IFabricCodePackageActivationContext6_get_ServiceEndpointResources(This) \ ( (This)->lpVtbl -> get_ServiceEndpointResources(This) ) #define IFabricCodePackageActivationContext6_GetServiceEndpointResource(This,serviceEndpointResourceName,bufferedValue) \ ( (This)->lpVtbl -> GetServiceEndpointResource(This,serviceEndpointResourceName,bufferedValue) ) #define IFabricCodePackageActivationContext6_GetCodePackageNames(This,names) \ ( (This)->lpVtbl -> GetCodePackageNames(This,names) ) #define IFabricCodePackageActivationContext6_GetConfigurationPackageNames(This,names) \ ( (This)->lpVtbl -> GetConfigurationPackageNames(This,names) ) #define IFabricCodePackageActivationContext6_GetDataPackageNames(This,names) \ ( (This)->lpVtbl -> GetDataPackageNames(This,names) ) #define IFabricCodePackageActivationContext6_GetCodePackage(This,codePackageName,codePackage) \ ( (This)->lpVtbl -> GetCodePackage(This,codePackageName,codePackage) ) #define IFabricCodePackageActivationContext6_GetConfigurationPackage(This,configPackageName,configPackage) \ ( (This)->lpVtbl -> GetConfigurationPackage(This,configPackageName,configPackage) ) #define IFabricCodePackageActivationContext6_GetDataPackage(This,dataPackageName,dataPackage) \ ( (This)->lpVtbl -> GetDataPackage(This,dataPackageName,dataPackage) ) #define IFabricCodePackageActivationContext6_RegisterCodePackageChangeHandler(This,callback,callbackHandle) \ ( (This)->lpVtbl -> RegisterCodePackageChangeHandler(This,callback,callbackHandle) ) #define IFabricCodePackageActivationContext6_UnregisterCodePackageChangeHandler(This,callbackHandle) \ ( (This)->lpVtbl -> UnregisterCodePackageChangeHandler(This,callbackHandle) ) #define IFabricCodePackageActivationContext6_RegisterConfigurationPackageChangeHandler(This,callback,callbackHandle) \ ( (This)->lpVtbl -> RegisterConfigurationPackageChangeHandler(This,callback,callbackHandle) ) #define IFabricCodePackageActivationContext6_UnregisterConfigurationPackageChangeHandler(This,callbackHandle) \ ( (This)->lpVtbl -> UnregisterConfigurationPackageChangeHandler(This,callbackHandle) ) #define IFabricCodePackageActivationContext6_RegisterDataPackageChangeHandler(This,callback,callbackHandle) \ ( (This)->lpVtbl -> RegisterDataPackageChangeHandler(This,callback,callbackHandle) ) #define IFabricCodePackageActivationContext6_UnregisterDataPackageChangeHandler(This,callbackHandle) \ ( (This)->lpVtbl -> UnregisterDataPackageChangeHandler(This,callbackHandle) ) #define IFabricCodePackageActivationContext6_get_ApplicationName(This) \ ( (This)->lpVtbl -> get_ApplicationName(This) ) #define IFabricCodePackageActivationContext6_get_ApplicationTypeName(This) \ ( (This)->lpVtbl -> get_ApplicationTypeName(This) ) #define IFabricCodePackageActivationContext6_GetServiceManifestName(This,serviceManifestName) \ ( (This)->lpVtbl -> GetServiceManifestName(This,serviceManifestName) ) #define IFabricCodePackageActivationContext6_GetServiceManifestVersion(This,serviceManifestVersion) \ ( (This)->lpVtbl -> GetServiceManifestVersion(This,serviceManifestVersion) ) #define IFabricCodePackageActivationContext6_ReportApplicationHealth(This,healthInfo) \ ( (This)->lpVtbl -> ReportApplicationHealth(This,healthInfo) ) #define IFabricCodePackageActivationContext6_ReportDeployedApplicationHealth(This,healthInfo) \ ( (This)->lpVtbl -> ReportDeployedApplicationHealth(This,healthInfo) ) #define IFabricCodePackageActivationContext6_ReportDeployedServicePackageHealth(This,healthInfo) \ ( (This)->lpVtbl -> ReportDeployedServicePackageHealth(This,healthInfo) ) #define IFabricCodePackageActivationContext6_ReportApplicationHealth2(This,healthInfo,sendOptions) \ ( (This)->lpVtbl -> ReportApplicationHealth2(This,healthInfo,sendOptions) ) #define IFabricCodePackageActivationContext6_ReportDeployedApplicationHealth2(This,healthInfo,sendOptions) \ ( (This)->lpVtbl -> ReportDeployedApplicationHealth2(This,healthInfo,sendOptions) ) #define IFabricCodePackageActivationContext6_ReportDeployedServicePackageHealth2(This,healthInfo,sendOptions) \ ( (This)->lpVtbl -> ReportDeployedServicePackageHealth2(This,healthInfo,sendOptions) ) #define IFabricCodePackageActivationContext6_get_ServiceListenAddress(This) \ ( (This)->lpVtbl -> get_ServiceListenAddress(This) ) #define IFabricCodePackageActivationContext6_get_ServicePublishAddress(This) \ ( (This)->lpVtbl -> get_ServicePublishAddress(This) ) #define IFabricCodePackageActivationContext6_GetDirectory(This,logicalDirectoryName,directoryPath) \ ( (This)->lpVtbl -> GetDirectory(This,logicalDirectoryName,directoryPath) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricCodePackageActivationContext6_INTERFACE_DEFINED__ */ #ifndef __IFabricCodePackage_INTERFACE_DEFINED__ #define __IFabricCodePackage_INTERFACE_DEFINED__ /* interface IFabricCodePackage */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricCodePackage; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("20792b45-4d13-41a4-af13-346e529f00c5") IFabricCodePackage : public IUnknown { public: virtual const FABRIC_CODE_PACKAGE_DESCRIPTION *STDMETHODCALLTYPE get_Description( void) = 0; virtual LPCWSTR STDMETHODCALLTYPE get_Path( void) = 0; }; #else /* C style interface */ typedef struct IFabricCodePackageVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricCodePackage * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricCodePackage * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricCodePackage * This); const FABRIC_CODE_PACKAGE_DESCRIPTION *( STDMETHODCALLTYPE *get_Description )( IFabricCodePackage * This); LPCWSTR ( STDMETHODCALLTYPE *get_Path )( IFabricCodePackage * This); END_INTERFACE } IFabricCodePackageVtbl; interface IFabricCodePackage { CONST_VTBL struct IFabricCodePackageVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricCodePackage_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricCodePackage_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricCodePackage_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricCodePackage_get_Description(This) \ ( (This)->lpVtbl -> get_Description(This) ) #define IFabricCodePackage_get_Path(This) \ ( (This)->lpVtbl -> get_Path(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricCodePackage_INTERFACE_DEFINED__ */ #ifndef __IFabricCodePackage2_INTERFACE_DEFINED__ #define __IFabricCodePackage2_INTERFACE_DEFINED__ /* interface IFabricCodePackage2 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricCodePackage2; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("cdf0a4e6-ad80-4cd6-b67e-e4c002428600") IFabricCodePackage2 : public IFabricCodePackage { public: virtual const FABRIC_RUNAS_POLICY_DESCRIPTION *STDMETHODCALLTYPE get_SetupEntryPointRunAsPolicy( void) = 0; virtual const FABRIC_RUNAS_POLICY_DESCRIPTION *STDMETHODCALLTYPE get_EntryPointRunAsPolicy( void) = 0; }; #else /* C style interface */ typedef struct IFabricCodePackage2Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricCodePackage2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricCodePackage2 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricCodePackage2 * This); const FABRIC_CODE_PACKAGE_DESCRIPTION *( STDMETHODCALLTYPE *get_Description )( IFabricCodePackage2 * This); LPCWSTR ( STDMETHODCALLTYPE *get_Path )( IFabricCodePackage2 * This); const FABRIC_RUNAS_POLICY_DESCRIPTION *( STDMETHODCALLTYPE *get_SetupEntryPointRunAsPolicy )( IFabricCodePackage2 * This); const FABRIC_RUNAS_POLICY_DESCRIPTION *( STDMETHODCALLTYPE *get_EntryPointRunAsPolicy )( IFabricCodePackage2 * This); END_INTERFACE } IFabricCodePackage2Vtbl; interface IFabricCodePackage2 { CONST_VTBL struct IFabricCodePackage2Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricCodePackage2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricCodePackage2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricCodePackage2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricCodePackage2_get_Description(This) \ ( (This)->lpVtbl -> get_Description(This) ) #define IFabricCodePackage2_get_Path(This) \ ( (This)->lpVtbl -> get_Path(This) ) #define IFabricCodePackage2_get_SetupEntryPointRunAsPolicy(This) \ ( (This)->lpVtbl -> get_SetupEntryPointRunAsPolicy(This) ) #define IFabricCodePackage2_get_EntryPointRunAsPolicy(This) \ ( (This)->lpVtbl -> get_EntryPointRunAsPolicy(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricCodePackage2_INTERFACE_DEFINED__ */ #ifndef __IFabricConfigurationPackage_INTERFACE_DEFINED__ #define __IFabricConfigurationPackage_INTERFACE_DEFINED__ /* interface IFabricConfigurationPackage */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricConfigurationPackage; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("ac4c3bfa-2563-46b7-a71d-2dca7b0a8f4d") IFabricConfigurationPackage : public IUnknown { public: virtual const FABRIC_CONFIGURATION_PACKAGE_DESCRIPTION *STDMETHODCALLTYPE get_Description( void) = 0; virtual LPCWSTR STDMETHODCALLTYPE get_Path( void) = 0; virtual const FABRIC_CONFIGURATION_SETTINGS *STDMETHODCALLTYPE get_Settings( void) = 0; virtual HRESULT STDMETHODCALLTYPE GetSection( /* [in] */ LPCWSTR sectionName, /* [retval][out] */ const FABRIC_CONFIGURATION_SECTION **bufferedValue) = 0; virtual HRESULT STDMETHODCALLTYPE GetValue( /* [in] */ LPCWSTR sectionName, /* [in] */ LPCWSTR parameterName, /* [out] */ BOOLEAN *isEncrypted, /* [retval][out] */ LPCWSTR *bufferedValue) = 0; virtual HRESULT STDMETHODCALLTYPE DecryptValue( /* [in] */ LPCWSTR encryptedValue, /* [retval][out] */ IFabricStringResult **decryptedValue) = 0; }; #else /* C style interface */ typedef struct IFabricConfigurationPackageVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricConfigurationPackage * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricConfigurationPackage * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricConfigurationPackage * This); const FABRIC_CONFIGURATION_PACKAGE_DESCRIPTION *( STDMETHODCALLTYPE *get_Description )( IFabricConfigurationPackage * This); LPCWSTR ( STDMETHODCALLTYPE *get_Path )( IFabricConfigurationPackage * This); const FABRIC_CONFIGURATION_SETTINGS *( STDMETHODCALLTYPE *get_Settings )( IFabricConfigurationPackage * This); HRESULT ( STDMETHODCALLTYPE *GetSection )( IFabricConfigurationPackage * This, /* [in] */ LPCWSTR sectionName, /* [retval][out] */ const FABRIC_CONFIGURATION_SECTION **bufferedValue); HRESULT ( STDMETHODCALLTYPE *GetValue )( IFabricConfigurationPackage * This, /* [in] */ LPCWSTR sectionName, /* [in] */ LPCWSTR parameterName, /* [out] */ BOOLEAN *isEncrypted, /* [retval][out] */ LPCWSTR *bufferedValue); HRESULT ( STDMETHODCALLTYPE *DecryptValue )( IFabricConfigurationPackage * This, /* [in] */ LPCWSTR encryptedValue, /* [retval][out] */ IFabricStringResult **decryptedValue); END_INTERFACE } IFabricConfigurationPackageVtbl; interface IFabricConfigurationPackage { CONST_VTBL struct IFabricConfigurationPackageVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricConfigurationPackage_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricConfigurationPackage_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricConfigurationPackage_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricConfigurationPackage_get_Description(This) \ ( (This)->lpVtbl -> get_Description(This) ) #define IFabricConfigurationPackage_get_Path(This) \ ( (This)->lpVtbl -> get_Path(This) ) #define IFabricConfigurationPackage_get_Settings(This) \ ( (This)->lpVtbl -> get_Settings(This) ) #define IFabricConfigurationPackage_GetSection(This,sectionName,bufferedValue) \ ( (This)->lpVtbl -> GetSection(This,sectionName,bufferedValue) ) #define IFabricConfigurationPackage_GetValue(This,sectionName,parameterName,isEncrypted,bufferedValue) \ ( (This)->lpVtbl -> GetValue(This,sectionName,parameterName,isEncrypted,bufferedValue) ) #define IFabricConfigurationPackage_DecryptValue(This,encryptedValue,decryptedValue) \ ( (This)->lpVtbl -> DecryptValue(This,encryptedValue,decryptedValue) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricConfigurationPackage_INTERFACE_DEFINED__ */ #ifndef __IFabricConfigurationPackage2_INTERFACE_DEFINED__ #define __IFabricConfigurationPackage2_INTERFACE_DEFINED__ /* interface IFabricConfigurationPackage2 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricConfigurationPackage2; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("d3161f31-708a-4f83-91ff-f2af15f74a2f") IFabricConfigurationPackage2 : public IFabricConfigurationPackage { public: virtual HRESULT STDMETHODCALLTYPE GetValues( /* [in] */ LPCWSTR sectionName, /* [in] */ LPCWSTR parameterPrefix, /* [retval][out] */ FABRIC_CONFIGURATION_PARAMETER_LIST **bufferedValue) = 0; }; #else /* C style interface */ typedef struct IFabricConfigurationPackage2Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricConfigurationPackage2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricConfigurationPackage2 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricConfigurationPackage2 * This); const FABRIC_CONFIGURATION_PACKAGE_DESCRIPTION *( STDMETHODCALLTYPE *get_Description )( IFabricConfigurationPackage2 * This); LPCWSTR ( STDMETHODCALLTYPE *get_Path )( IFabricConfigurationPackage2 * This); const FABRIC_CONFIGURATION_SETTINGS *( STDMETHODCALLTYPE *get_Settings )( IFabricConfigurationPackage2 * This); HRESULT ( STDMETHODCALLTYPE *GetSection )( IFabricConfigurationPackage2 * This, /* [in] */ LPCWSTR sectionName, /* [retval][out] */ const FABRIC_CONFIGURATION_SECTION **bufferedValue); HRESULT ( STDMETHODCALLTYPE *GetValue )( IFabricConfigurationPackage2 * This, /* [in] */ LPCWSTR sectionName, /* [in] */ LPCWSTR parameterName, /* [out] */ BOOLEAN *isEncrypted, /* [retval][out] */ LPCWSTR *bufferedValue); HRESULT ( STDMETHODCALLTYPE *DecryptValue )( IFabricConfigurationPackage2 * This, /* [in] */ LPCWSTR encryptedValue, /* [retval][out] */ IFabricStringResult **decryptedValue); HRESULT ( STDMETHODCALLTYPE *GetValues )( IFabricConfigurationPackage2 * This, /* [in] */ LPCWSTR sectionName, /* [in] */ LPCWSTR parameterPrefix, /* [retval][out] */ FABRIC_CONFIGURATION_PARAMETER_LIST **bufferedValue); END_INTERFACE } IFabricConfigurationPackage2Vtbl; interface IFabricConfigurationPackage2 { CONST_VTBL struct IFabricConfigurationPackage2Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricConfigurationPackage2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricConfigurationPackage2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricConfigurationPackage2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricConfigurationPackage2_get_Description(This) \ ( (This)->lpVtbl -> get_Description(This) ) #define IFabricConfigurationPackage2_get_Path(This) \ ( (This)->lpVtbl -> get_Path(This) ) #define IFabricConfigurationPackage2_get_Settings(This) \ ( (This)->lpVtbl -> get_Settings(This) ) #define IFabricConfigurationPackage2_GetSection(This,sectionName,bufferedValue) \ ( (This)->lpVtbl -> GetSection(This,sectionName,bufferedValue) ) #define IFabricConfigurationPackage2_GetValue(This,sectionName,parameterName,isEncrypted,bufferedValue) \ ( (This)->lpVtbl -> GetValue(This,sectionName,parameterName,isEncrypted,bufferedValue) ) #define IFabricConfigurationPackage2_DecryptValue(This,encryptedValue,decryptedValue) \ ( (This)->lpVtbl -> DecryptValue(This,encryptedValue,decryptedValue) ) #define IFabricConfigurationPackage2_GetValues(This,sectionName,parameterPrefix,bufferedValue) \ ( (This)->lpVtbl -> GetValues(This,sectionName,parameterPrefix,bufferedValue) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricConfigurationPackage2_INTERFACE_DEFINED__ */ #ifndef __IFabricDataPackage_INTERFACE_DEFINED__ #define __IFabricDataPackage_INTERFACE_DEFINED__ /* interface IFabricDataPackage */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricDataPackage; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("aa67de09-3657-435f-a2f6-b3a17a0a4371") IFabricDataPackage : public IUnknown { public: virtual const FABRIC_DATA_PACKAGE_DESCRIPTION *STDMETHODCALLTYPE get_Description( void) = 0; virtual LPCWSTR STDMETHODCALLTYPE get_Path( void) = 0; }; #else /* C style interface */ typedef struct IFabricDataPackageVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricDataPackage * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricDataPackage * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricDataPackage * This); const FABRIC_DATA_PACKAGE_DESCRIPTION *( STDMETHODCALLTYPE *get_Description )( IFabricDataPackage * This); LPCWSTR ( STDMETHODCALLTYPE *get_Path )( IFabricDataPackage * This); END_INTERFACE } IFabricDataPackageVtbl; interface IFabricDataPackage { CONST_VTBL struct IFabricDataPackageVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricDataPackage_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricDataPackage_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricDataPackage_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricDataPackage_get_Description(This) \ ( (This)->lpVtbl -> get_Description(This) ) #define IFabricDataPackage_get_Path(This) \ ( (This)->lpVtbl -> get_Path(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricDataPackage_INTERFACE_DEFINED__ */ #ifndef __IFabricConfigurationPackageChangeHandler_INTERFACE_DEFINED__ #define __IFabricConfigurationPackageChangeHandler_INTERFACE_DEFINED__ /* interface IFabricConfigurationPackageChangeHandler */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricConfigurationPackageChangeHandler; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("c3954d48-b5ee-4ff4-9bc0-c30f6d0d3a85") IFabricConfigurationPackageChangeHandler : public IUnknown { public: virtual void STDMETHODCALLTYPE OnPackageAdded( /* [in] */ IFabricCodePackageActivationContext *source, /* [in] */ IFabricConfigurationPackage *configPackage) = 0; virtual void STDMETHODCALLTYPE OnPackageRemoved( /* [in] */ IFabricCodePackageActivationContext *source, /* [in] */ IFabricConfigurationPackage *configPackage) = 0; virtual void STDMETHODCALLTYPE OnPackageModified( /* [in] */ IFabricCodePackageActivationContext *source, /* [in] */ IFabricConfigurationPackage *previousConfigPackage, /* [in] */ IFabricConfigurationPackage *configPackage) = 0; }; #else /* C style interface */ typedef struct IFabricConfigurationPackageChangeHandlerVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricConfigurationPackageChangeHandler * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricConfigurationPackageChangeHandler * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricConfigurationPackageChangeHandler * This); void ( STDMETHODCALLTYPE *OnPackageAdded )( IFabricConfigurationPackageChangeHandler * This, /* [in] */ IFabricCodePackageActivationContext *source, /* [in] */ IFabricConfigurationPackage *configPackage); void ( STDMETHODCALLTYPE *OnPackageRemoved )( IFabricConfigurationPackageChangeHandler * This, /* [in] */ IFabricCodePackageActivationContext *source, /* [in] */ IFabricConfigurationPackage *configPackage); void ( STDMETHODCALLTYPE *OnPackageModified )( IFabricConfigurationPackageChangeHandler * This, /* [in] */ IFabricCodePackageActivationContext *source, /* [in] */ IFabricConfigurationPackage *previousConfigPackage, /* [in] */ IFabricConfigurationPackage *configPackage); END_INTERFACE } IFabricConfigurationPackageChangeHandlerVtbl; interface IFabricConfigurationPackageChangeHandler { CONST_VTBL struct IFabricConfigurationPackageChangeHandlerVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricConfigurationPackageChangeHandler_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricConfigurationPackageChangeHandler_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricConfigurationPackageChangeHandler_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricConfigurationPackageChangeHandler_OnPackageAdded(This,source,configPackage) \ ( (This)->lpVtbl -> OnPackageAdded(This,source,configPackage) ) #define IFabricConfigurationPackageChangeHandler_OnPackageRemoved(This,source,configPackage) \ ( (This)->lpVtbl -> OnPackageRemoved(This,source,configPackage) ) #define IFabricConfigurationPackageChangeHandler_OnPackageModified(This,source,previousConfigPackage,configPackage) \ ( (This)->lpVtbl -> OnPackageModified(This,source,previousConfigPackage,configPackage) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricConfigurationPackageChangeHandler_INTERFACE_DEFINED__ */ #ifndef __IFabricDataPackageChangeHandler_INTERFACE_DEFINED__ #define __IFabricDataPackageChangeHandler_INTERFACE_DEFINED__ /* interface IFabricDataPackageChangeHandler */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricDataPackageChangeHandler; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("8d0a726f-bd17-4b32-807b-be2a8024b2e0") IFabricDataPackageChangeHandler : public IUnknown { public: virtual void STDMETHODCALLTYPE OnPackageAdded( /* [in] */ IFabricCodePackageActivationContext *source, /* [in] */ IFabricDataPackage *dataPackage) = 0; virtual void STDMETHODCALLTYPE OnPackageRemoved( /* [in] */ IFabricCodePackageActivationContext *source, /* [in] */ IFabricDataPackage *dataPackage) = 0; virtual void STDMETHODCALLTYPE OnPackageModified( /* [in] */ IFabricCodePackageActivationContext *source, /* [in] */ IFabricDataPackage *previousDataPackage, /* [in] */ IFabricDataPackage *dataPackage) = 0; }; #else /* C style interface */ typedef struct IFabricDataPackageChangeHandlerVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricDataPackageChangeHandler * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricDataPackageChangeHandler * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricDataPackageChangeHandler * This); void ( STDMETHODCALLTYPE *OnPackageAdded )( IFabricDataPackageChangeHandler * This, /* [in] */ IFabricCodePackageActivationContext *source, /* [in] */ IFabricDataPackage *dataPackage); void ( STDMETHODCALLTYPE *OnPackageRemoved )( IFabricDataPackageChangeHandler * This, /* [in] */ IFabricCodePackageActivationContext *source, /* [in] */ IFabricDataPackage *dataPackage); void ( STDMETHODCALLTYPE *OnPackageModified )( IFabricDataPackageChangeHandler * This, /* [in] */ IFabricCodePackageActivationContext *source, /* [in] */ IFabricDataPackage *previousDataPackage, /* [in] */ IFabricDataPackage *dataPackage); END_INTERFACE } IFabricDataPackageChangeHandlerVtbl; interface IFabricDataPackageChangeHandler { CONST_VTBL struct IFabricDataPackageChangeHandlerVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricDataPackageChangeHandler_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricDataPackageChangeHandler_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricDataPackageChangeHandler_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricDataPackageChangeHandler_OnPackageAdded(This,source,dataPackage) \ ( (This)->lpVtbl -> OnPackageAdded(This,source,dataPackage) ) #define IFabricDataPackageChangeHandler_OnPackageRemoved(This,source,dataPackage) \ ( (This)->lpVtbl -> OnPackageRemoved(This,source,dataPackage) ) #define IFabricDataPackageChangeHandler_OnPackageModified(This,source,previousDataPackage,dataPackage) \ ( (This)->lpVtbl -> OnPackageModified(This,source,previousDataPackage,dataPackage) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricDataPackageChangeHandler_INTERFACE_DEFINED__ */ #ifndef __IFabricTransactionBase_INTERFACE_DEFINED__ #define __IFabricTransactionBase_INTERFACE_DEFINED__ /* interface IFabricTransactionBase */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricTransactionBase; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("32d656a1-7ad5-47b8-bd66-a2e302626b7e") IFabricTransactionBase : public IUnknown { public: virtual const FABRIC_TRANSACTION_ID *STDMETHODCALLTYPE get_Id( void) = 0; virtual FABRIC_TRANSACTION_ISOLATION_LEVEL STDMETHODCALLTYPE get_IsolationLevel( void) = 0; }; #else /* C style interface */ typedef struct IFabricTransactionBaseVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricTransactionBase * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricTransactionBase * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricTransactionBase * This); const FABRIC_TRANSACTION_ID *( STDMETHODCALLTYPE *get_Id )( IFabricTransactionBase * This); FABRIC_TRANSACTION_ISOLATION_LEVEL ( STDMETHODCALLTYPE *get_IsolationLevel )( IFabricTransactionBase * This); END_INTERFACE } IFabricTransactionBaseVtbl; interface IFabricTransactionBase { CONST_VTBL struct IFabricTransactionBaseVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricTransactionBase_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricTransactionBase_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricTransactionBase_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricTransactionBase_get_Id(This) \ ( (This)->lpVtbl -> get_Id(This) ) #define IFabricTransactionBase_get_IsolationLevel(This) \ ( (This)->lpVtbl -> get_IsolationLevel(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricTransactionBase_INTERFACE_DEFINED__ */ #ifndef __IFabricTransaction_INTERFACE_DEFINED__ #define __IFabricTransaction_INTERFACE_DEFINED__ /* interface IFabricTransaction */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricTransaction; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("19ee48b4-6d4d-470b-ac1e-2d3996a173c8") IFabricTransaction : public IFabricTransactionBase { public: virtual HRESULT STDMETHODCALLTYPE BeginCommit( /* [in] */ DWORD timeoutMilliseconds, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndCommit( /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ FABRIC_SEQUENCE_NUMBER *commitSequenceNumber) = 0; virtual void STDMETHODCALLTYPE Rollback( void) = 0; }; #else /* C style interface */ typedef struct IFabricTransactionVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricTransaction * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricTransaction * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricTransaction * This); const FABRIC_TRANSACTION_ID *( STDMETHODCALLTYPE *get_Id )( IFabricTransaction * This); FABRIC_TRANSACTION_ISOLATION_LEVEL ( STDMETHODCALLTYPE *get_IsolationLevel )( IFabricTransaction * This); HRESULT ( STDMETHODCALLTYPE *BeginCommit )( IFabricTransaction * This, /* [in] */ DWORD timeoutMilliseconds, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndCommit )( IFabricTransaction * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ FABRIC_SEQUENCE_NUMBER *commitSequenceNumber); void ( STDMETHODCALLTYPE *Rollback )( IFabricTransaction * This); END_INTERFACE } IFabricTransactionVtbl; interface IFabricTransaction { CONST_VTBL struct IFabricTransactionVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricTransaction_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricTransaction_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricTransaction_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricTransaction_get_Id(This) \ ( (This)->lpVtbl -> get_Id(This) ) #define IFabricTransaction_get_IsolationLevel(This) \ ( (This)->lpVtbl -> get_IsolationLevel(This) ) #define IFabricTransaction_BeginCommit(This,timeoutMilliseconds,callback,context) \ ( (This)->lpVtbl -> BeginCommit(This,timeoutMilliseconds,callback,context) ) #define IFabricTransaction_EndCommit(This,context,commitSequenceNumber) \ ( (This)->lpVtbl -> EndCommit(This,context,commitSequenceNumber) ) #define IFabricTransaction_Rollback(This) \ ( (This)->lpVtbl -> Rollback(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricTransaction_INTERFACE_DEFINED__ */ #ifndef __IFabricKeyValueStoreReplica_INTERFACE_DEFINED__ #define __IFabricKeyValueStoreReplica_INTERFACE_DEFINED__ /* interface IFabricKeyValueStoreReplica */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricKeyValueStoreReplica; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("97da35c4-38ed-4a2a-8f37-fbeb56382235") IFabricKeyValueStoreReplica : public IFabricStatefulServiceReplica { public: virtual HRESULT STDMETHODCALLTYPE GetCurrentEpoch( /* [out] */ FABRIC_EPOCH *currentEpoch) = 0; virtual HRESULT STDMETHODCALLTYPE UpdateReplicatorSettings( /* [in] */ const FABRIC_REPLICATOR_SETTINGS *replicatorSettings) = 0; virtual HRESULT STDMETHODCALLTYPE CreateTransaction( /* [retval][out] */ IFabricTransaction **transaction) = 0; virtual HRESULT STDMETHODCALLTYPE Add( /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ LONG valueSizeInBytes, /* [size_is][in] */ const BYTE *value) = 0; virtual HRESULT STDMETHODCALLTYPE Remove( /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ FABRIC_SEQUENCE_NUMBER checkSequenceNumber) = 0; virtual HRESULT STDMETHODCALLTYPE Update( /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ LONG valueSizeInBytes, /* [size_is][in] */ const BYTE *value, /* [in] */ FABRIC_SEQUENCE_NUMBER checkSequenceNumber) = 0; virtual HRESULT STDMETHODCALLTYPE Get( /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ IFabricKeyValueStoreItemResult **result) = 0; virtual HRESULT STDMETHODCALLTYPE GetMetadata( /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ IFabricKeyValueStoreItemMetadataResult **result) = 0; virtual HRESULT STDMETHODCALLTYPE Contains( /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ BOOLEAN *result) = 0; virtual HRESULT STDMETHODCALLTYPE Enumerate( /* [in] */ IFabricTransactionBase *transaction, /* [retval][out] */ IFabricKeyValueStoreItemEnumerator **result) = 0; virtual HRESULT STDMETHODCALLTYPE EnumerateByKey( /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR keyPrefix, /* [retval][out] */ IFabricKeyValueStoreItemEnumerator **result) = 0; virtual HRESULT STDMETHODCALLTYPE EnumerateMetadata( /* [in] */ IFabricTransactionBase *transaction, /* [retval][out] */ IFabricKeyValueStoreItemMetadataEnumerator **result) = 0; virtual HRESULT STDMETHODCALLTYPE EnumerateMetadataByKey( /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR keyPrefix, /* [retval][out] */ IFabricKeyValueStoreItemMetadataEnumerator **result) = 0; }; #else /* C style interface */ typedef struct IFabricKeyValueStoreReplicaVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricKeyValueStoreReplica * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricKeyValueStoreReplica * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricKeyValueStoreReplica * This); HRESULT ( STDMETHODCALLTYPE *BeginOpen )( IFabricKeyValueStoreReplica * This, /* [in] */ FABRIC_REPLICA_OPEN_MODE openMode, /* [in] */ IFabricStatefulServicePartition *partition, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndOpen )( IFabricKeyValueStoreReplica * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricReplicator **replicator); HRESULT ( STDMETHODCALLTYPE *BeginChangeRole )( IFabricKeyValueStoreReplica * This, /* [in] */ FABRIC_REPLICA_ROLE newRole, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndChangeRole )( IFabricKeyValueStoreReplica * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricStringResult **serviceAddress); HRESULT ( STDMETHODCALLTYPE *BeginClose )( IFabricKeyValueStoreReplica * This, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndClose )( IFabricKeyValueStoreReplica * This, /* [in] */ IFabricAsyncOperationContext *context); void ( STDMETHODCALLTYPE *Abort )( IFabricKeyValueStoreReplica * This); HRESULT ( STDMETHODCALLTYPE *GetCurrentEpoch )( IFabricKeyValueStoreReplica * This, /* [out] */ FABRIC_EPOCH *currentEpoch); HRESULT ( STDMETHODCALLTYPE *UpdateReplicatorSettings )( IFabricKeyValueStoreReplica * This, /* [in] */ const FABRIC_REPLICATOR_SETTINGS *replicatorSettings); HRESULT ( STDMETHODCALLTYPE *CreateTransaction )( IFabricKeyValueStoreReplica * This, /* [retval][out] */ IFabricTransaction **transaction); HRESULT ( STDMETHODCALLTYPE *Add )( IFabricKeyValueStoreReplica * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ LONG valueSizeInBytes, /* [size_is][in] */ const BYTE *value); HRESULT ( STDMETHODCALLTYPE *Remove )( IFabricKeyValueStoreReplica * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ FABRIC_SEQUENCE_NUMBER checkSequenceNumber); HRESULT ( STDMETHODCALLTYPE *Update )( IFabricKeyValueStoreReplica * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ LONG valueSizeInBytes, /* [size_is][in] */ const BYTE *value, /* [in] */ FABRIC_SEQUENCE_NUMBER checkSequenceNumber); HRESULT ( STDMETHODCALLTYPE *Get )( IFabricKeyValueStoreReplica * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ IFabricKeyValueStoreItemResult **result); HRESULT ( STDMETHODCALLTYPE *GetMetadata )( IFabricKeyValueStoreReplica * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ IFabricKeyValueStoreItemMetadataResult **result); HRESULT ( STDMETHODCALLTYPE *Contains )( IFabricKeyValueStoreReplica * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ BOOLEAN *result); HRESULT ( STDMETHODCALLTYPE *Enumerate )( IFabricKeyValueStoreReplica * This, /* [in] */ IFabricTransactionBase *transaction, /* [retval][out] */ IFabricKeyValueStoreItemEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateByKey )( IFabricKeyValueStoreReplica * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR keyPrefix, /* [retval][out] */ IFabricKeyValueStoreItemEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateMetadata )( IFabricKeyValueStoreReplica * This, /* [in] */ IFabricTransactionBase *transaction, /* [retval][out] */ IFabricKeyValueStoreItemMetadataEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateMetadataByKey )( IFabricKeyValueStoreReplica * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR keyPrefix, /* [retval][out] */ IFabricKeyValueStoreItemMetadataEnumerator **result); END_INTERFACE } IFabricKeyValueStoreReplicaVtbl; interface IFabricKeyValueStoreReplica { CONST_VTBL struct IFabricKeyValueStoreReplicaVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricKeyValueStoreReplica_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricKeyValueStoreReplica_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricKeyValueStoreReplica_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricKeyValueStoreReplica_BeginOpen(This,openMode,partition,callback,context) \ ( (This)->lpVtbl -> BeginOpen(This,openMode,partition,callback,context) ) #define IFabricKeyValueStoreReplica_EndOpen(This,context,replicator) \ ( (This)->lpVtbl -> EndOpen(This,context,replicator) ) #define IFabricKeyValueStoreReplica_BeginChangeRole(This,newRole,callback,context) \ ( (This)->lpVtbl -> BeginChangeRole(This,newRole,callback,context) ) #define IFabricKeyValueStoreReplica_EndChangeRole(This,context,serviceAddress) \ ( (This)->lpVtbl -> EndChangeRole(This,context,serviceAddress) ) #define IFabricKeyValueStoreReplica_BeginClose(This,callback,context) \ ( (This)->lpVtbl -> BeginClose(This,callback,context) ) #define IFabricKeyValueStoreReplica_EndClose(This,context) \ ( (This)->lpVtbl -> EndClose(This,context) ) #define IFabricKeyValueStoreReplica_Abort(This) \ ( (This)->lpVtbl -> Abort(This) ) #define IFabricKeyValueStoreReplica_GetCurrentEpoch(This,currentEpoch) \ ( (This)->lpVtbl -> GetCurrentEpoch(This,currentEpoch) ) #define IFabricKeyValueStoreReplica_UpdateReplicatorSettings(This,replicatorSettings) \ ( (This)->lpVtbl -> UpdateReplicatorSettings(This,replicatorSettings) ) #define IFabricKeyValueStoreReplica_CreateTransaction(This,transaction) \ ( (This)->lpVtbl -> CreateTransaction(This,transaction) ) #define IFabricKeyValueStoreReplica_Add(This,transaction,key,valueSizeInBytes,value) \ ( (This)->lpVtbl -> Add(This,transaction,key,valueSizeInBytes,value) ) #define IFabricKeyValueStoreReplica_Remove(This,transaction,key,checkSequenceNumber) \ ( (This)->lpVtbl -> Remove(This,transaction,key,checkSequenceNumber) ) #define IFabricKeyValueStoreReplica_Update(This,transaction,key,valueSizeInBytes,value,checkSequenceNumber) \ ( (This)->lpVtbl -> Update(This,transaction,key,valueSizeInBytes,value,checkSequenceNumber) ) #define IFabricKeyValueStoreReplica_Get(This,transaction,key,result) \ ( (This)->lpVtbl -> Get(This,transaction,key,result) ) #define IFabricKeyValueStoreReplica_GetMetadata(This,transaction,key,result) \ ( (This)->lpVtbl -> GetMetadata(This,transaction,key,result) ) #define IFabricKeyValueStoreReplica_Contains(This,transaction,key,result) \ ( (This)->lpVtbl -> Contains(This,transaction,key,result) ) #define IFabricKeyValueStoreReplica_Enumerate(This,transaction,result) \ ( (This)->lpVtbl -> Enumerate(This,transaction,result) ) #define IFabricKeyValueStoreReplica_EnumerateByKey(This,transaction,keyPrefix,result) \ ( (This)->lpVtbl -> EnumerateByKey(This,transaction,keyPrefix,result) ) #define IFabricKeyValueStoreReplica_EnumerateMetadata(This,transaction,result) \ ( (This)->lpVtbl -> EnumerateMetadata(This,transaction,result) ) #define IFabricKeyValueStoreReplica_EnumerateMetadataByKey(This,transaction,keyPrefix,result) \ ( (This)->lpVtbl -> EnumerateMetadataByKey(This,transaction,keyPrefix,result) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricKeyValueStoreReplica_INTERFACE_DEFINED__ */ #ifndef __IFabricKeyValueStoreReplica2_INTERFACE_DEFINED__ #define __IFabricKeyValueStoreReplica2_INTERFACE_DEFINED__ /* interface IFabricKeyValueStoreReplica2 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricKeyValueStoreReplica2; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("fef805b2-5aca-4caa-9c51-fb3bd577a792") IFabricKeyValueStoreReplica2 : public IFabricKeyValueStoreReplica { public: virtual HRESULT STDMETHODCALLTYPE Backup( /* [in] */ LPCWSTR backupDirectory) = 0; virtual HRESULT STDMETHODCALLTYPE Restore( /* [in] */ LPCWSTR backupDirectory) = 0; virtual HRESULT STDMETHODCALLTYPE CreateTransaction2( /* [in] */ const FABRIC_KEY_VALUE_STORE_TRANSACTION_SETTINGS *settings, /* [retval][out] */ IFabricTransaction **transaction) = 0; }; #else /* C style interface */ typedef struct IFabricKeyValueStoreReplica2Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricKeyValueStoreReplica2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricKeyValueStoreReplica2 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricKeyValueStoreReplica2 * This); HRESULT ( STDMETHODCALLTYPE *BeginOpen )( IFabricKeyValueStoreReplica2 * This, /* [in] */ FABRIC_REPLICA_OPEN_MODE openMode, /* [in] */ IFabricStatefulServicePartition *partition, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndOpen )( IFabricKeyValueStoreReplica2 * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricReplicator **replicator); HRESULT ( STDMETHODCALLTYPE *BeginChangeRole )( IFabricKeyValueStoreReplica2 * This, /* [in] */ FABRIC_REPLICA_ROLE newRole, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndChangeRole )( IFabricKeyValueStoreReplica2 * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricStringResult **serviceAddress); HRESULT ( STDMETHODCALLTYPE *BeginClose )( IFabricKeyValueStoreReplica2 * This, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndClose )( IFabricKeyValueStoreReplica2 * This, /* [in] */ IFabricAsyncOperationContext *context); void ( STDMETHODCALLTYPE *Abort )( IFabricKeyValueStoreReplica2 * This); HRESULT ( STDMETHODCALLTYPE *GetCurrentEpoch )( IFabricKeyValueStoreReplica2 * This, /* [out] */ FABRIC_EPOCH *currentEpoch); HRESULT ( STDMETHODCALLTYPE *UpdateReplicatorSettings )( IFabricKeyValueStoreReplica2 * This, /* [in] */ const FABRIC_REPLICATOR_SETTINGS *replicatorSettings); HRESULT ( STDMETHODCALLTYPE *CreateTransaction )( IFabricKeyValueStoreReplica2 * This, /* [retval][out] */ IFabricTransaction **transaction); HRESULT ( STDMETHODCALLTYPE *Add )( IFabricKeyValueStoreReplica2 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ LONG valueSizeInBytes, /* [size_is][in] */ const BYTE *value); HRESULT ( STDMETHODCALLTYPE *Remove )( IFabricKeyValueStoreReplica2 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ FABRIC_SEQUENCE_NUMBER checkSequenceNumber); HRESULT ( STDMETHODCALLTYPE *Update )( IFabricKeyValueStoreReplica2 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ LONG valueSizeInBytes, /* [size_is][in] */ const BYTE *value, /* [in] */ FABRIC_SEQUENCE_NUMBER checkSequenceNumber); HRESULT ( STDMETHODCALLTYPE *Get )( IFabricKeyValueStoreReplica2 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ IFabricKeyValueStoreItemResult **result); HRESULT ( STDMETHODCALLTYPE *GetMetadata )( IFabricKeyValueStoreReplica2 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ IFabricKeyValueStoreItemMetadataResult **result); HRESULT ( STDMETHODCALLTYPE *Contains )( IFabricKeyValueStoreReplica2 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ BOOLEAN *result); HRESULT ( STDMETHODCALLTYPE *Enumerate )( IFabricKeyValueStoreReplica2 * This, /* [in] */ IFabricTransactionBase *transaction, /* [retval][out] */ IFabricKeyValueStoreItemEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateByKey )( IFabricKeyValueStoreReplica2 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR keyPrefix, /* [retval][out] */ IFabricKeyValueStoreItemEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateMetadata )( IFabricKeyValueStoreReplica2 * This, /* [in] */ IFabricTransactionBase *transaction, /* [retval][out] */ IFabricKeyValueStoreItemMetadataEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateMetadataByKey )( IFabricKeyValueStoreReplica2 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR keyPrefix, /* [retval][out] */ IFabricKeyValueStoreItemMetadataEnumerator **result); HRESULT ( STDMETHODCALLTYPE *Backup )( IFabricKeyValueStoreReplica2 * This, /* [in] */ LPCWSTR backupDirectory); HRESULT ( STDMETHODCALLTYPE *Restore )( IFabricKeyValueStoreReplica2 * This, /* [in] */ LPCWSTR backupDirectory); HRESULT ( STDMETHODCALLTYPE *CreateTransaction2 )( IFabricKeyValueStoreReplica2 * This, /* [in] */ const FABRIC_KEY_VALUE_STORE_TRANSACTION_SETTINGS *settings, /* [retval][out] */ IFabricTransaction **transaction); END_INTERFACE } IFabricKeyValueStoreReplica2Vtbl; interface IFabricKeyValueStoreReplica2 { CONST_VTBL struct IFabricKeyValueStoreReplica2Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricKeyValueStoreReplica2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricKeyValueStoreReplica2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricKeyValueStoreReplica2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricKeyValueStoreReplica2_BeginOpen(This,openMode,partition,callback,context) \ ( (This)->lpVtbl -> BeginOpen(This,openMode,partition,callback,context) ) #define IFabricKeyValueStoreReplica2_EndOpen(This,context,replicator) \ ( (This)->lpVtbl -> EndOpen(This,context,replicator) ) #define IFabricKeyValueStoreReplica2_BeginChangeRole(This,newRole,callback,context) \ ( (This)->lpVtbl -> BeginChangeRole(This,newRole,callback,context) ) #define IFabricKeyValueStoreReplica2_EndChangeRole(This,context,serviceAddress) \ ( (This)->lpVtbl -> EndChangeRole(This,context,serviceAddress) ) #define IFabricKeyValueStoreReplica2_BeginClose(This,callback,context) \ ( (This)->lpVtbl -> BeginClose(This,callback,context) ) #define IFabricKeyValueStoreReplica2_EndClose(This,context) \ ( (This)->lpVtbl -> EndClose(This,context) ) #define IFabricKeyValueStoreReplica2_Abort(This) \ ( (This)->lpVtbl -> Abort(This) ) #define IFabricKeyValueStoreReplica2_GetCurrentEpoch(This,currentEpoch) \ ( (This)->lpVtbl -> GetCurrentEpoch(This,currentEpoch) ) #define IFabricKeyValueStoreReplica2_UpdateReplicatorSettings(This,replicatorSettings) \ ( (This)->lpVtbl -> UpdateReplicatorSettings(This,replicatorSettings) ) #define IFabricKeyValueStoreReplica2_CreateTransaction(This,transaction) \ ( (This)->lpVtbl -> CreateTransaction(This,transaction) ) #define IFabricKeyValueStoreReplica2_Add(This,transaction,key,valueSizeInBytes,value) \ ( (This)->lpVtbl -> Add(This,transaction,key,valueSizeInBytes,value) ) #define IFabricKeyValueStoreReplica2_Remove(This,transaction,key,checkSequenceNumber) \ ( (This)->lpVtbl -> Remove(This,transaction,key,checkSequenceNumber) ) #define IFabricKeyValueStoreReplica2_Update(This,transaction,key,valueSizeInBytes,value,checkSequenceNumber) \ ( (This)->lpVtbl -> Update(This,transaction,key,valueSizeInBytes,value,checkSequenceNumber) ) #define IFabricKeyValueStoreReplica2_Get(This,transaction,key,result) \ ( (This)->lpVtbl -> Get(This,transaction,key,result) ) #define IFabricKeyValueStoreReplica2_GetMetadata(This,transaction,key,result) \ ( (This)->lpVtbl -> GetMetadata(This,transaction,key,result) ) #define IFabricKeyValueStoreReplica2_Contains(This,transaction,key,result) \ ( (This)->lpVtbl -> Contains(This,transaction,key,result) ) #define IFabricKeyValueStoreReplica2_Enumerate(This,transaction,result) \ ( (This)->lpVtbl -> Enumerate(This,transaction,result) ) #define IFabricKeyValueStoreReplica2_EnumerateByKey(This,transaction,keyPrefix,result) \ ( (This)->lpVtbl -> EnumerateByKey(This,transaction,keyPrefix,result) ) #define IFabricKeyValueStoreReplica2_EnumerateMetadata(This,transaction,result) \ ( (This)->lpVtbl -> EnumerateMetadata(This,transaction,result) ) #define IFabricKeyValueStoreReplica2_EnumerateMetadataByKey(This,transaction,keyPrefix,result) \ ( (This)->lpVtbl -> EnumerateMetadataByKey(This,transaction,keyPrefix,result) ) #define IFabricKeyValueStoreReplica2_Backup(This,backupDirectory) \ ( (This)->lpVtbl -> Backup(This,backupDirectory) ) #define IFabricKeyValueStoreReplica2_Restore(This,backupDirectory) \ ( (This)->lpVtbl -> Restore(This,backupDirectory) ) #define IFabricKeyValueStoreReplica2_CreateTransaction2(This,settings,transaction) \ ( (This)->lpVtbl -> CreateTransaction2(This,settings,transaction) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricKeyValueStoreReplica2_INTERFACE_DEFINED__ */ #ifndef __IFabricKeyValueStoreReplica3_INTERFACE_DEFINED__ #define __IFabricKeyValueStoreReplica3_INTERFACE_DEFINED__ /* interface IFabricKeyValueStoreReplica3 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricKeyValueStoreReplica3; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("c1297172-a8aa-4096-bdcc-1ece0c5d8c8f") IFabricKeyValueStoreReplica3 : public IFabricKeyValueStoreReplica2 { public: virtual HRESULT STDMETHODCALLTYPE BeginBackup( /* [in] */ LPCWSTR backupDirectory, /* [in] */ FABRIC_STORE_BACKUP_OPTION backupOption, /* [in] */ IFabricStorePostBackupHandler *postBackupHandler, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndBackup( /* [in] */ IFabricAsyncOperationContext *context) = 0; }; #else /* C style interface */ typedef struct IFabricKeyValueStoreReplica3Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricKeyValueStoreReplica3 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricKeyValueStoreReplica3 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricKeyValueStoreReplica3 * This); HRESULT ( STDMETHODCALLTYPE *BeginOpen )( IFabricKeyValueStoreReplica3 * This, /* [in] */ FABRIC_REPLICA_OPEN_MODE openMode, /* [in] */ IFabricStatefulServicePartition *partition, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndOpen )( IFabricKeyValueStoreReplica3 * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricReplicator **replicator); HRESULT ( STDMETHODCALLTYPE *BeginChangeRole )( IFabricKeyValueStoreReplica3 * This, /* [in] */ FABRIC_REPLICA_ROLE newRole, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndChangeRole )( IFabricKeyValueStoreReplica3 * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricStringResult **serviceAddress); HRESULT ( STDMETHODCALLTYPE *BeginClose )( IFabricKeyValueStoreReplica3 * This, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndClose )( IFabricKeyValueStoreReplica3 * This, /* [in] */ IFabricAsyncOperationContext *context); void ( STDMETHODCALLTYPE *Abort )( IFabricKeyValueStoreReplica3 * This); HRESULT ( STDMETHODCALLTYPE *GetCurrentEpoch )( IFabricKeyValueStoreReplica3 * This, /* [out] */ FABRIC_EPOCH *currentEpoch); HRESULT ( STDMETHODCALLTYPE *UpdateReplicatorSettings )( IFabricKeyValueStoreReplica3 * This, /* [in] */ const FABRIC_REPLICATOR_SETTINGS *replicatorSettings); HRESULT ( STDMETHODCALLTYPE *CreateTransaction )( IFabricKeyValueStoreReplica3 * This, /* [retval][out] */ IFabricTransaction **transaction); HRESULT ( STDMETHODCALLTYPE *Add )( IFabricKeyValueStoreReplica3 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ LONG valueSizeInBytes, /* [size_is][in] */ const BYTE *value); HRESULT ( STDMETHODCALLTYPE *Remove )( IFabricKeyValueStoreReplica3 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ FABRIC_SEQUENCE_NUMBER checkSequenceNumber); HRESULT ( STDMETHODCALLTYPE *Update )( IFabricKeyValueStoreReplica3 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ LONG valueSizeInBytes, /* [size_is][in] */ const BYTE *value, /* [in] */ FABRIC_SEQUENCE_NUMBER checkSequenceNumber); HRESULT ( STDMETHODCALLTYPE *Get )( IFabricKeyValueStoreReplica3 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ IFabricKeyValueStoreItemResult **result); HRESULT ( STDMETHODCALLTYPE *GetMetadata )( IFabricKeyValueStoreReplica3 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ IFabricKeyValueStoreItemMetadataResult **result); HRESULT ( STDMETHODCALLTYPE *Contains )( IFabricKeyValueStoreReplica3 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ BOOLEAN *result); HRESULT ( STDMETHODCALLTYPE *Enumerate )( IFabricKeyValueStoreReplica3 * This, /* [in] */ IFabricTransactionBase *transaction, /* [retval][out] */ IFabricKeyValueStoreItemEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateByKey )( IFabricKeyValueStoreReplica3 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR keyPrefix, /* [retval][out] */ IFabricKeyValueStoreItemEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateMetadata )( IFabricKeyValueStoreReplica3 * This, /* [in] */ IFabricTransactionBase *transaction, /* [retval][out] */ IFabricKeyValueStoreItemMetadataEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateMetadataByKey )( IFabricKeyValueStoreReplica3 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR keyPrefix, /* [retval][out] */ IFabricKeyValueStoreItemMetadataEnumerator **result); HRESULT ( STDMETHODCALLTYPE *Backup )( IFabricKeyValueStoreReplica3 * This, /* [in] */ LPCWSTR backupDirectory); HRESULT ( STDMETHODCALLTYPE *Restore )( IFabricKeyValueStoreReplica3 * This, /* [in] */ LPCWSTR backupDirectory); HRESULT ( STDMETHODCALLTYPE *CreateTransaction2 )( IFabricKeyValueStoreReplica3 * This, /* [in] */ const FABRIC_KEY_VALUE_STORE_TRANSACTION_SETTINGS *settings, /* [retval][out] */ IFabricTransaction **transaction); HRESULT ( STDMETHODCALLTYPE *BeginBackup )( IFabricKeyValueStoreReplica3 * This, /* [in] */ LPCWSTR backupDirectory, /* [in] */ FABRIC_STORE_BACKUP_OPTION backupOption, /* [in] */ IFabricStorePostBackupHandler *postBackupHandler, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndBackup )( IFabricKeyValueStoreReplica3 * This, /* [in] */ IFabricAsyncOperationContext *context); END_INTERFACE } IFabricKeyValueStoreReplica3Vtbl; interface IFabricKeyValueStoreReplica3 { CONST_VTBL struct IFabricKeyValueStoreReplica3Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricKeyValueStoreReplica3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricKeyValueStoreReplica3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricKeyValueStoreReplica3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricKeyValueStoreReplica3_BeginOpen(This,openMode,partition,callback,context) \ ( (This)->lpVtbl -> BeginOpen(This,openMode,partition,callback,context) ) #define IFabricKeyValueStoreReplica3_EndOpen(This,context,replicator) \ ( (This)->lpVtbl -> EndOpen(This,context,replicator) ) #define IFabricKeyValueStoreReplica3_BeginChangeRole(This,newRole,callback,context) \ ( (This)->lpVtbl -> BeginChangeRole(This,newRole,callback,context) ) #define IFabricKeyValueStoreReplica3_EndChangeRole(This,context,serviceAddress) \ ( (This)->lpVtbl -> EndChangeRole(This,context,serviceAddress) ) #define IFabricKeyValueStoreReplica3_BeginClose(This,callback,context) \ ( (This)->lpVtbl -> BeginClose(This,callback,context) ) #define IFabricKeyValueStoreReplica3_EndClose(This,context) \ ( (This)->lpVtbl -> EndClose(This,context) ) #define IFabricKeyValueStoreReplica3_Abort(This) \ ( (This)->lpVtbl -> Abort(This) ) #define IFabricKeyValueStoreReplica3_GetCurrentEpoch(This,currentEpoch) \ ( (This)->lpVtbl -> GetCurrentEpoch(This,currentEpoch) ) #define IFabricKeyValueStoreReplica3_UpdateReplicatorSettings(This,replicatorSettings) \ ( (This)->lpVtbl -> UpdateReplicatorSettings(This,replicatorSettings) ) #define IFabricKeyValueStoreReplica3_CreateTransaction(This,transaction) \ ( (This)->lpVtbl -> CreateTransaction(This,transaction) ) #define IFabricKeyValueStoreReplica3_Add(This,transaction,key,valueSizeInBytes,value) \ ( (This)->lpVtbl -> Add(This,transaction,key,valueSizeInBytes,value) ) #define IFabricKeyValueStoreReplica3_Remove(This,transaction,key,checkSequenceNumber) \ ( (This)->lpVtbl -> Remove(This,transaction,key,checkSequenceNumber) ) #define IFabricKeyValueStoreReplica3_Update(This,transaction,key,valueSizeInBytes,value,checkSequenceNumber) \ ( (This)->lpVtbl -> Update(This,transaction,key,valueSizeInBytes,value,checkSequenceNumber) ) #define IFabricKeyValueStoreReplica3_Get(This,transaction,key,result) \ ( (This)->lpVtbl -> Get(This,transaction,key,result) ) #define IFabricKeyValueStoreReplica3_GetMetadata(This,transaction,key,result) \ ( (This)->lpVtbl -> GetMetadata(This,transaction,key,result) ) #define IFabricKeyValueStoreReplica3_Contains(This,transaction,key,result) \ ( (This)->lpVtbl -> Contains(This,transaction,key,result) ) #define IFabricKeyValueStoreReplica3_Enumerate(This,transaction,result) \ ( (This)->lpVtbl -> Enumerate(This,transaction,result) ) #define IFabricKeyValueStoreReplica3_EnumerateByKey(This,transaction,keyPrefix,result) \ ( (This)->lpVtbl -> EnumerateByKey(This,transaction,keyPrefix,result) ) #define IFabricKeyValueStoreReplica3_EnumerateMetadata(This,transaction,result) \ ( (This)->lpVtbl -> EnumerateMetadata(This,transaction,result) ) #define IFabricKeyValueStoreReplica3_EnumerateMetadataByKey(This,transaction,keyPrefix,result) \ ( (This)->lpVtbl -> EnumerateMetadataByKey(This,transaction,keyPrefix,result) ) #define IFabricKeyValueStoreReplica3_Backup(This,backupDirectory) \ ( (This)->lpVtbl -> Backup(This,backupDirectory) ) #define IFabricKeyValueStoreReplica3_Restore(This,backupDirectory) \ ( (This)->lpVtbl -> Restore(This,backupDirectory) ) #define IFabricKeyValueStoreReplica3_CreateTransaction2(This,settings,transaction) \ ( (This)->lpVtbl -> CreateTransaction2(This,settings,transaction) ) #define IFabricKeyValueStoreReplica3_BeginBackup(This,backupDirectory,backupOption,postBackupHandler,callback,context) \ ( (This)->lpVtbl -> BeginBackup(This,backupDirectory,backupOption,postBackupHandler,callback,context) ) #define IFabricKeyValueStoreReplica3_EndBackup(This,context) \ ( (This)->lpVtbl -> EndBackup(This,context) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricKeyValueStoreReplica3_INTERFACE_DEFINED__ */ #ifndef __IFabricKeyValueStoreItemEnumerator_INTERFACE_DEFINED__ #define __IFabricKeyValueStoreItemEnumerator_INTERFACE_DEFINED__ /* interface IFabricKeyValueStoreItemEnumerator */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricKeyValueStoreItemEnumerator; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("c202788f-54d3-44a6-8f3c-b4bbfcdb95d2") IFabricKeyValueStoreItemEnumerator : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE MoveNext( void) = 0; virtual IFabricKeyValueStoreItemResult *STDMETHODCALLTYPE get_Current( void) = 0; }; #else /* C style interface */ typedef struct IFabricKeyValueStoreItemEnumeratorVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricKeyValueStoreItemEnumerator * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricKeyValueStoreItemEnumerator * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricKeyValueStoreItemEnumerator * This); HRESULT ( STDMETHODCALLTYPE *MoveNext )( IFabricKeyValueStoreItemEnumerator * This); IFabricKeyValueStoreItemResult *( STDMETHODCALLTYPE *get_Current )( IFabricKeyValueStoreItemEnumerator * This); END_INTERFACE } IFabricKeyValueStoreItemEnumeratorVtbl; interface IFabricKeyValueStoreItemEnumerator { CONST_VTBL struct IFabricKeyValueStoreItemEnumeratorVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricKeyValueStoreItemEnumerator_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricKeyValueStoreItemEnumerator_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricKeyValueStoreItemEnumerator_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricKeyValueStoreItemEnumerator_MoveNext(This) \ ( (This)->lpVtbl -> MoveNext(This) ) #define IFabricKeyValueStoreItemEnumerator_get_Current(This) \ ( (This)->lpVtbl -> get_Current(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricKeyValueStoreItemEnumerator_INTERFACE_DEFINED__ */ #ifndef __IFabricKeyValueStoreItemMetadataEnumerator_INTERFACE_DEFINED__ #define __IFabricKeyValueStoreItemMetadataEnumerator_INTERFACE_DEFINED__ /* interface IFabricKeyValueStoreItemMetadataEnumerator */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricKeyValueStoreItemMetadataEnumerator; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("0bc06aee-fffa-4450-9099-116a5f0e0b53") IFabricKeyValueStoreItemMetadataEnumerator : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE MoveNext( void) = 0; virtual IFabricKeyValueStoreItemMetadataResult *STDMETHODCALLTYPE get_Current( void) = 0; }; #else /* C style interface */ typedef struct IFabricKeyValueStoreItemMetadataEnumeratorVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricKeyValueStoreItemMetadataEnumerator * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricKeyValueStoreItemMetadataEnumerator * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricKeyValueStoreItemMetadataEnumerator * This); HRESULT ( STDMETHODCALLTYPE *MoveNext )( IFabricKeyValueStoreItemMetadataEnumerator * This); IFabricKeyValueStoreItemMetadataResult *( STDMETHODCALLTYPE *get_Current )( IFabricKeyValueStoreItemMetadataEnumerator * This); END_INTERFACE } IFabricKeyValueStoreItemMetadataEnumeratorVtbl; interface IFabricKeyValueStoreItemMetadataEnumerator { CONST_VTBL struct IFabricKeyValueStoreItemMetadataEnumeratorVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricKeyValueStoreItemMetadataEnumerator_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricKeyValueStoreItemMetadataEnumerator_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricKeyValueStoreItemMetadataEnumerator_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricKeyValueStoreItemMetadataEnumerator_MoveNext(This) \ ( (This)->lpVtbl -> MoveNext(This) ) #define IFabricKeyValueStoreItemMetadataEnumerator_get_Current(This) \ ( (This)->lpVtbl -> get_Current(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricKeyValueStoreItemMetadataEnumerator_INTERFACE_DEFINED__ */ #ifndef __IFabricKeyValueStoreItemResult_INTERFACE_DEFINED__ #define __IFabricKeyValueStoreItemResult_INTERFACE_DEFINED__ /* interface IFabricKeyValueStoreItemResult */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricKeyValueStoreItemResult; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("c1f1c89d-b0b8-44dc-bc97-6c074c1a805e") IFabricKeyValueStoreItemResult : public IUnknown { public: virtual const FABRIC_KEY_VALUE_STORE_ITEM *STDMETHODCALLTYPE get_Item( void) = 0; }; #else /* C style interface */ typedef struct IFabricKeyValueStoreItemResultVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricKeyValueStoreItemResult * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricKeyValueStoreItemResult * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricKeyValueStoreItemResult * This); const FABRIC_KEY_VALUE_STORE_ITEM *( STDMETHODCALLTYPE *get_Item )( IFabricKeyValueStoreItemResult * This); END_INTERFACE } IFabricKeyValueStoreItemResultVtbl; interface IFabricKeyValueStoreItemResult { CONST_VTBL struct IFabricKeyValueStoreItemResultVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricKeyValueStoreItemResult_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricKeyValueStoreItemResult_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricKeyValueStoreItemResult_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricKeyValueStoreItemResult_get_Item(This) \ ( (This)->lpVtbl -> get_Item(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricKeyValueStoreItemResult_INTERFACE_DEFINED__ */ #ifndef __IFabricKeyValueStoreItemMetadataResult_INTERFACE_DEFINED__ #define __IFabricKeyValueStoreItemMetadataResult_INTERFACE_DEFINED__ /* interface IFabricKeyValueStoreItemMetadataResult */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricKeyValueStoreItemMetadataResult; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("17c483a1-69e6-4bdc-a058-54fd4a1839fd") IFabricKeyValueStoreItemMetadataResult : public IUnknown { public: virtual const FABRIC_KEY_VALUE_STORE_ITEM_METADATA *STDMETHODCALLTYPE get_Metadata( void) = 0; }; #else /* C style interface */ typedef struct IFabricKeyValueStoreItemMetadataResultVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricKeyValueStoreItemMetadataResult * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricKeyValueStoreItemMetadataResult * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricKeyValueStoreItemMetadataResult * This); const FABRIC_KEY_VALUE_STORE_ITEM_METADATA *( STDMETHODCALLTYPE *get_Metadata )( IFabricKeyValueStoreItemMetadataResult * This); END_INTERFACE } IFabricKeyValueStoreItemMetadataResultVtbl; interface IFabricKeyValueStoreItemMetadataResult { CONST_VTBL struct IFabricKeyValueStoreItemMetadataResultVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricKeyValueStoreItemMetadataResult_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricKeyValueStoreItemMetadataResult_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricKeyValueStoreItemMetadataResult_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricKeyValueStoreItemMetadataResult_get_Metadata(This) \ ( (This)->lpVtbl -> get_Metadata(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricKeyValueStoreItemMetadataResult_INTERFACE_DEFINED__ */ #ifndef __IFabricKeyValueStoreNotification_INTERFACE_DEFINED__ #define __IFabricKeyValueStoreNotification_INTERFACE_DEFINED__ /* interface IFabricKeyValueStoreNotification */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricKeyValueStoreNotification; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("cb660aa6-c51e-4f05-9526-93982b550e8f") IFabricKeyValueStoreNotification : public IFabricKeyValueStoreItemResult { public: virtual BOOLEAN STDMETHODCALLTYPE IsDelete( void) = 0; }; #else /* C style interface */ typedef struct IFabricKeyValueStoreNotificationVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricKeyValueStoreNotification * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricKeyValueStoreNotification * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricKeyValueStoreNotification * This); const FABRIC_KEY_VALUE_STORE_ITEM *( STDMETHODCALLTYPE *get_Item )( IFabricKeyValueStoreNotification * This); BOOLEAN ( STDMETHODCALLTYPE *IsDelete )( IFabricKeyValueStoreNotification * This); END_INTERFACE } IFabricKeyValueStoreNotificationVtbl; interface IFabricKeyValueStoreNotification { CONST_VTBL struct IFabricKeyValueStoreNotificationVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricKeyValueStoreNotification_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricKeyValueStoreNotification_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricKeyValueStoreNotification_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricKeyValueStoreNotification_get_Item(This) \ ( (This)->lpVtbl -> get_Item(This) ) #define IFabricKeyValueStoreNotification_IsDelete(This) \ ( (This)->lpVtbl -> IsDelete(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricKeyValueStoreNotification_INTERFACE_DEFINED__ */ #ifndef __IFabricKeyValueStoreNotificationEnumerator_INTERFACE_DEFINED__ #define __IFabricKeyValueStoreNotificationEnumerator_INTERFACE_DEFINED__ /* interface IFabricKeyValueStoreNotificationEnumerator */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricKeyValueStoreNotificationEnumerator; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("ef25bc08-be76-43c7-adad-20f01fba3399") IFabricKeyValueStoreNotificationEnumerator : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE MoveNext( void) = 0; virtual IFabricKeyValueStoreNotification *STDMETHODCALLTYPE get_Current( void) = 0; virtual void STDMETHODCALLTYPE Reset( void) = 0; }; #else /* C style interface */ typedef struct IFabricKeyValueStoreNotificationEnumeratorVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricKeyValueStoreNotificationEnumerator * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricKeyValueStoreNotificationEnumerator * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricKeyValueStoreNotificationEnumerator * This); HRESULT ( STDMETHODCALLTYPE *MoveNext )( IFabricKeyValueStoreNotificationEnumerator * This); IFabricKeyValueStoreNotification *( STDMETHODCALLTYPE *get_Current )( IFabricKeyValueStoreNotificationEnumerator * This); void ( STDMETHODCALLTYPE *Reset )( IFabricKeyValueStoreNotificationEnumerator * This); END_INTERFACE } IFabricKeyValueStoreNotificationEnumeratorVtbl; interface IFabricKeyValueStoreNotificationEnumerator { CONST_VTBL struct IFabricKeyValueStoreNotificationEnumeratorVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricKeyValueStoreNotificationEnumerator_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricKeyValueStoreNotificationEnumerator_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricKeyValueStoreNotificationEnumerator_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricKeyValueStoreNotificationEnumerator_MoveNext(This) \ ( (This)->lpVtbl -> MoveNext(This) ) #define IFabricKeyValueStoreNotificationEnumerator_get_Current(This) \ ( (This)->lpVtbl -> get_Current(This) ) #define IFabricKeyValueStoreNotificationEnumerator_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricKeyValueStoreNotificationEnumerator_INTERFACE_DEFINED__ */ #ifndef __IFabricNodeContextResult_INTERFACE_DEFINED__ #define __IFabricNodeContextResult_INTERFACE_DEFINED__ /* interface IFabricNodeContextResult */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricNodeContextResult; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("0952f885-6f5a-4ed3-abe4-90c403d1e3ce") IFabricNodeContextResult : public IUnknown { public: virtual const FABRIC_NODE_CONTEXT *STDMETHODCALLTYPE get_NodeContext( void) = 0; }; #else /* C style interface */ typedef struct IFabricNodeContextResultVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricNodeContextResult * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricNodeContextResult * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricNodeContextResult * This); const FABRIC_NODE_CONTEXT *( STDMETHODCALLTYPE *get_NodeContext )( IFabricNodeContextResult * This); END_INTERFACE } IFabricNodeContextResultVtbl; interface IFabricNodeContextResult { CONST_VTBL struct IFabricNodeContextResultVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricNodeContextResult_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricNodeContextResult_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricNodeContextResult_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricNodeContextResult_get_NodeContext(This) \ ( (This)->lpVtbl -> get_NodeContext(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricNodeContextResult_INTERFACE_DEFINED__ */ #ifndef __IFabricNodeContextResult2_INTERFACE_DEFINED__ #define __IFabricNodeContextResult2_INTERFACE_DEFINED__ /* interface IFabricNodeContextResult2 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricNodeContextResult2; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("472bf2e1-d617-4b5c-a91d-fabed9ff3550") IFabricNodeContextResult2 : public IFabricNodeContextResult { public: virtual HRESULT STDMETHODCALLTYPE GetDirectory( /* [in] */ LPCWSTR logicalDirectoryName, /* [retval][out] */ IFabricStringResult **directoryPath) = 0; }; #else /* C style interface */ typedef struct IFabricNodeContextResult2Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricNodeContextResult2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricNodeContextResult2 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricNodeContextResult2 * This); const FABRIC_NODE_CONTEXT *( STDMETHODCALLTYPE *get_NodeContext )( IFabricNodeContextResult2 * This); HRESULT ( STDMETHODCALLTYPE *GetDirectory )( IFabricNodeContextResult2 * This, /* [in] */ LPCWSTR logicalDirectoryName, /* [retval][out] */ IFabricStringResult **directoryPath); END_INTERFACE } IFabricNodeContextResult2Vtbl; interface IFabricNodeContextResult2 { CONST_VTBL struct IFabricNodeContextResult2Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricNodeContextResult2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricNodeContextResult2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricNodeContextResult2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricNodeContextResult2_get_NodeContext(This) \ ( (This)->lpVtbl -> get_NodeContext(This) ) #define IFabricNodeContextResult2_GetDirectory(This,logicalDirectoryName,directoryPath) \ ( (This)->lpVtbl -> GetDirectory(This,logicalDirectoryName,directoryPath) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricNodeContextResult2_INTERFACE_DEFINED__ */ #ifndef __IFabricReplicatorSettingsResult_INTERFACE_DEFINED__ #define __IFabricReplicatorSettingsResult_INTERFACE_DEFINED__ /* interface IFabricReplicatorSettingsResult */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricReplicatorSettingsResult; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("718954F3-DC1E-4060-9806-0CBF36F71051") IFabricReplicatorSettingsResult : public IUnknown { public: virtual const FABRIC_REPLICATOR_SETTINGS *STDMETHODCALLTYPE get_ReplicatorSettings( void) = 0; }; #else /* C style interface */ typedef struct IFabricReplicatorSettingsResultVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricReplicatorSettingsResult * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricReplicatorSettingsResult * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricReplicatorSettingsResult * This); const FABRIC_REPLICATOR_SETTINGS *( STDMETHODCALLTYPE *get_ReplicatorSettings )( IFabricReplicatorSettingsResult * This); END_INTERFACE } IFabricReplicatorSettingsResultVtbl; interface IFabricReplicatorSettingsResult { CONST_VTBL struct IFabricReplicatorSettingsResultVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricReplicatorSettingsResult_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricReplicatorSettingsResult_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricReplicatorSettingsResult_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricReplicatorSettingsResult_get_ReplicatorSettings(This) \ ( (This)->lpVtbl -> get_ReplicatorSettings(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricReplicatorSettingsResult_INTERFACE_DEFINED__ */ #ifndef __IFabricEseLocalStoreSettingsResult_INTERFACE_DEFINED__ #define __IFabricEseLocalStoreSettingsResult_INTERFACE_DEFINED__ /* interface IFabricEseLocalStoreSettingsResult */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricEseLocalStoreSettingsResult; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("AACE77AE-D8E1-4144-B1EE-5AC74FD54F65") IFabricEseLocalStoreSettingsResult : public IUnknown { public: virtual const FABRIC_ESE_LOCAL_STORE_SETTINGS *STDMETHODCALLTYPE get_Settings( void) = 0; }; #else /* C style interface */ typedef struct IFabricEseLocalStoreSettingsResultVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricEseLocalStoreSettingsResult * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricEseLocalStoreSettingsResult * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricEseLocalStoreSettingsResult * This); const FABRIC_ESE_LOCAL_STORE_SETTINGS *( STDMETHODCALLTYPE *get_Settings )( IFabricEseLocalStoreSettingsResult * This); END_INTERFACE } IFabricEseLocalStoreSettingsResultVtbl; interface IFabricEseLocalStoreSettingsResult { CONST_VTBL struct IFabricEseLocalStoreSettingsResultVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricEseLocalStoreSettingsResult_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricEseLocalStoreSettingsResult_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricEseLocalStoreSettingsResult_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricEseLocalStoreSettingsResult_get_Settings(This) \ ( (This)->lpVtbl -> get_Settings(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricEseLocalStoreSettingsResult_INTERFACE_DEFINED__ */ #ifndef __IFabricSecurityCredentialsResult_INTERFACE_DEFINED__ #define __IFabricSecurityCredentialsResult_INTERFACE_DEFINED__ /* interface IFabricSecurityCredentialsResult */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricSecurityCredentialsResult; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("049A111D-6A30-48E9-8F69-470760D3EFB9") IFabricSecurityCredentialsResult : public IUnknown { public: virtual const FABRIC_SECURITY_CREDENTIALS *STDMETHODCALLTYPE get_SecurityCredentials( void) = 0; }; #else /* C style interface */ typedef struct IFabricSecurityCredentialsResultVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricSecurityCredentialsResult * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricSecurityCredentialsResult * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricSecurityCredentialsResult * This); const FABRIC_SECURITY_CREDENTIALS *( STDMETHODCALLTYPE *get_SecurityCredentials )( IFabricSecurityCredentialsResult * This); END_INTERFACE } IFabricSecurityCredentialsResultVtbl; interface IFabricSecurityCredentialsResult { CONST_VTBL struct IFabricSecurityCredentialsResultVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricSecurityCredentialsResult_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricSecurityCredentialsResult_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricSecurityCredentialsResult_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricSecurityCredentialsResult_get_SecurityCredentials(This) \ ( (This)->lpVtbl -> get_SecurityCredentials(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricSecurityCredentialsResult_INTERFACE_DEFINED__ */ #ifndef __IFabricCodePackageActivator_INTERFACE_DEFINED__ #define __IFabricCodePackageActivator_INTERFACE_DEFINED__ /* interface IFabricCodePackageActivator */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricCodePackageActivator; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("70BE1B10-B259-46FC-B813-0B75720E7183") IFabricCodePackageActivator : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE BeginActivateCodePackage( /* [in] */ FABRIC_STRING_LIST *codePackageNames, /* [in] */ FABRIC_STRING_MAP *environment, /* [in] */ DWORD timeoutMilliseconds, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndActivateCodePackage( /* [in] */ IFabricAsyncOperationContext *context) = 0; virtual HRESULT STDMETHODCALLTYPE BeginDeactivateCodePackage( /* [in] */ FABRIC_STRING_LIST *codePackageNames, /* [in] */ DWORD timeoutMilliseconds, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndDeactivateCodePackage( /* [in] */ IFabricAsyncOperationContext *context) = 0; virtual HRESULT STDMETHODCALLTYPE AbortCodePackage( /* [in] */ FABRIC_STRING_LIST *codePackageNames) = 0; virtual HRESULT STDMETHODCALLTYPE RegisterCodePackageEventHandler( /* [in] */ IFabricCodePackageEventHandler *eventHandler, /* [retval][out] */ ULONGLONG *callbackHandle) = 0; virtual HRESULT STDMETHODCALLTYPE UnregisterCodePackageEventHandler( /* [in] */ ULONGLONG callbackHandle) = 0; }; #else /* C style interface */ typedef struct IFabricCodePackageActivatorVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricCodePackageActivator * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricCodePackageActivator * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricCodePackageActivator * This); HRESULT ( STDMETHODCALLTYPE *BeginActivateCodePackage )( IFabricCodePackageActivator * This, /* [in] */ FABRIC_STRING_LIST *codePackageNames, /* [in] */ FABRIC_STRING_MAP *environment, /* [in] */ DWORD timeoutMilliseconds, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndActivateCodePackage )( IFabricCodePackageActivator * This, /* [in] */ IFabricAsyncOperationContext *context); HRESULT ( STDMETHODCALLTYPE *BeginDeactivateCodePackage )( IFabricCodePackageActivator * This, /* [in] */ FABRIC_STRING_LIST *codePackageNames, /* [in] */ DWORD timeoutMilliseconds, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndDeactivateCodePackage )( IFabricCodePackageActivator * This, /* [in] */ IFabricAsyncOperationContext *context); HRESULT ( STDMETHODCALLTYPE *AbortCodePackage )( IFabricCodePackageActivator * This, /* [in] */ FABRIC_STRING_LIST *codePackageNames); HRESULT ( STDMETHODCALLTYPE *RegisterCodePackageEventHandler )( IFabricCodePackageActivator * This, /* [in] */ IFabricCodePackageEventHandler *eventHandler, /* [retval][out] */ ULONGLONG *callbackHandle); HRESULT ( STDMETHODCALLTYPE *UnregisterCodePackageEventHandler )( IFabricCodePackageActivator * This, /* [in] */ ULONGLONG callbackHandle); END_INTERFACE } IFabricCodePackageActivatorVtbl; interface IFabricCodePackageActivator { CONST_VTBL struct IFabricCodePackageActivatorVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricCodePackageActivator_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricCodePackageActivator_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricCodePackageActivator_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricCodePackageActivator_BeginActivateCodePackage(This,codePackageNames,environment,timeoutMilliseconds,callback,context) \ ( (This)->lpVtbl -> BeginActivateCodePackage(This,codePackageNames,environment,timeoutMilliseconds,callback,context) ) #define IFabricCodePackageActivator_EndActivateCodePackage(This,context) \ ( (This)->lpVtbl -> EndActivateCodePackage(This,context) ) #define IFabricCodePackageActivator_BeginDeactivateCodePackage(This,codePackageNames,timeoutMilliseconds,callback,context) \ ( (This)->lpVtbl -> BeginDeactivateCodePackage(This,codePackageNames,timeoutMilliseconds,callback,context) ) #define IFabricCodePackageActivator_EndDeactivateCodePackage(This,context) \ ( (This)->lpVtbl -> EndDeactivateCodePackage(This,context) ) #define IFabricCodePackageActivator_AbortCodePackage(This,codePackageNames) \ ( (This)->lpVtbl -> AbortCodePackage(This,codePackageNames) ) #define IFabricCodePackageActivator_RegisterCodePackageEventHandler(This,eventHandler,callbackHandle) \ ( (This)->lpVtbl -> RegisterCodePackageEventHandler(This,eventHandler,callbackHandle) ) #define IFabricCodePackageActivator_UnregisterCodePackageEventHandler(This,callbackHandle) \ ( (This)->lpVtbl -> UnregisterCodePackageEventHandler(This,callbackHandle) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricCodePackageActivator_INTERFACE_DEFINED__ */ #ifndef __IFabricCodePackageEventHandler_INTERFACE_DEFINED__ #define __IFabricCodePackageEventHandler_INTERFACE_DEFINED__ /* interface IFabricCodePackageEventHandler */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricCodePackageEventHandler; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("899E0CA8-16DF-458E-8915-D0307B4AB101") IFabricCodePackageEventHandler : public IUnknown { public: virtual void STDMETHODCALLTYPE OnCodePackageEvent( /* [in] */ IFabricCodePackageActivator *source, /* [in] */ const FABRIC_CODE_PACKAGE_EVENT_DESCRIPTION *eventDesc) = 0; }; #else /* C style interface */ typedef struct IFabricCodePackageEventHandlerVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricCodePackageEventHandler * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricCodePackageEventHandler * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricCodePackageEventHandler * This); void ( STDMETHODCALLTYPE *OnCodePackageEvent )( IFabricCodePackageEventHandler * This, /* [in] */ IFabricCodePackageActivator *source, /* [in] */ const FABRIC_CODE_PACKAGE_EVENT_DESCRIPTION *eventDesc); END_INTERFACE } IFabricCodePackageEventHandlerVtbl; interface IFabricCodePackageEventHandler { CONST_VTBL struct IFabricCodePackageEventHandlerVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricCodePackageEventHandler_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricCodePackageEventHandler_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricCodePackageEventHandler_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricCodePackageEventHandler_OnCodePackageEvent(This,source,eventDesc) \ ( (This)->lpVtbl -> OnCodePackageEvent(This,source,eventDesc) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricCodePackageEventHandler_INTERFACE_DEFINED__ */ EXTERN_C const CLSID CLSID_FabricRuntime; #ifdef __cplusplus class DECLSPEC_UUID("cc53af8c-74cd-11df-ac3e-0024811e3892") FabricRuntime; #endif #ifndef __FabricRuntimeModule_MODULE_DEFINED__ #define __FabricRuntimeModule_MODULE_DEFINED__ /* module FabricRuntimeModule */ /* [dllname][uuid] */ /* [entry] */ HRESULT FabricBeginCreateRuntime( /* [in] */ __RPC__in REFIID riid, /* [in] */ __RPC__in_opt IFabricProcessExitHandler *exitHandler, /* [in] */ DWORD timeoutMilliseconds, /* [in] */ __RPC__in_opt IFabricAsyncOperationCallback *callback, /* [retval][out] */ __RPC__deref_out_opt IFabricAsyncOperationContext **context); /* [entry] */ HRESULT FabricEndCreateRuntime( /* [in] */ __RPC__in_opt IFabricAsyncOperationContext *context, /* [retval][out] */ __RPC__deref_out_opt void **fabricRuntime); /* [entry] */ HRESULT FabricCreateRuntime( /* [in] */ __RPC__in REFIID riid, /* [retval][out] */ __RPC__deref_out_opt void **fabricRuntime); /* [entry] */ HRESULT FabricBeginGetActivationContext( /* [in] */ __RPC__in REFIID riid, /* [in] */ DWORD timeoutMilliseconds, /* [in] */ __RPC__in_opt IFabricAsyncOperationCallback *callback, /* [retval][out] */ __RPC__deref_out_opt IFabricAsyncOperationContext **context); /* [entry] */ HRESULT FabricEndGetActivationContext( /* [in] */ __RPC__in_opt IFabricAsyncOperationContext *context, /* [retval][out] */ __RPC__deref_out_opt void **activationContext); /* [entry] */ HRESULT FabricGetActivationContext( /* [in] */ __RPC__in REFIID riid, /* [retval][out] */ __RPC__deref_out_opt void **activationContext); /* [entry] */ HRESULT FabricCreateKeyValueStoreReplica( /* [in] */ __RPC__in REFIID riid, /* [in] */ __RPC__in LPCWSTR storeName, /* [in] */ FABRIC_PARTITION_ID partitionId, /* [in] */ FABRIC_REPLICA_ID replicaId, /* [in] */ __RPC__in const FABRIC_REPLICATOR_SETTINGS *replicatorSettings, /* [in] */ FABRIC_LOCAL_STORE_KIND localStoreKind, /* [in] */ __RPC__in void *localStoreSettings, /* [in] */ __RPC__in_opt IFabricStoreEventHandler *storeEventHandler, /* [retval][out] */ __RPC__deref_out_opt void **keyValueStore); /* [entry] */ HRESULT FabricCreateKeyValueStoreReplica2( /* [in] */ __RPC__in REFIID riid, /* [in] */ __RPC__in LPCWSTR storeName, /* [in] */ FABRIC_PARTITION_ID partitionId, /* [in] */ FABRIC_REPLICA_ID replicaId, /* [in] */ __RPC__in const FABRIC_REPLICATOR_SETTINGS *replicatorSettings, /* [in] */ FABRIC_LOCAL_STORE_KIND localStoreKind, /* [in] */ __RPC__in void *localStoreSettings, /* [in] */ __RPC__in_opt IFabricStoreEventHandler *storeEventHandler, /* [in] */ __RPC__in_opt IFabricSecondaryEventHandler *secondaryEventHandler, /* [in] */ FABRIC_KEY_VALUE_STORE_NOTIFICATION_MODE notificationMode, /* [retval][out] */ __RPC__deref_out_opt void **keyValueStore); /* [entry] */ HRESULT FabricCreateKeyValueStoreReplica3( /* [in] */ __RPC__in REFIID riid, /* [in] */ __RPC__in LPCWSTR storeName, /* [in] */ FABRIC_PARTITION_ID partitionId, /* [in] */ FABRIC_REPLICA_ID replicaId, /* [in] */ __RPC__in const FABRIC_REPLICATOR_SETTINGS *replicatorSettings, /* [in] */ FABRIC_LOCAL_STORE_KIND localStoreKind, /* [in] */ __RPC__in void *localStoreSettings, /* [in] */ __RPC__in_opt IFabricStoreEventHandler *storeEventHandler, /* [in] */ __RPC__in_opt IFabricSecondaryEventHandler *secondaryEventHandler, /* [in] */ FABRIC_KEY_VALUE_STORE_NOTIFICATION_MODE notificationMode, /* [retval][out] */ __RPC__deref_out_opt void **keyValueStore); /* [entry] */ HRESULT FabricCreateKeyValueStoreReplica4( /* [in] */ __RPC__in REFIID riid, /* [in] */ __RPC__in LPCWSTR storeName, /* [in] */ FABRIC_PARTITION_ID partitionId, /* [in] */ FABRIC_REPLICA_ID replicaId, /* [in] */ __RPC__in FABRIC_URI serviceName, /* [in] */ __RPC__in const FABRIC_REPLICATOR_SETTINGS *replicatorSettings, /* [in] */ FABRIC_LOCAL_STORE_KIND localStoreKind, /* [in] */ __RPC__in void *localStoreSettings, /* [in] */ __RPC__in_opt IFabricStoreEventHandler *storeEventHandler, /* [in] */ __RPC__in_opt IFabricSecondaryEventHandler *secondaryEventHandler, /* [in] */ FABRIC_KEY_VALUE_STORE_NOTIFICATION_MODE notificationMode, /* [retval][out] */ __RPC__deref_out_opt void **keyValueStore); /* [entry] */ HRESULT FabricCreateKeyValueStoreReplica5( /* [in] */ __RPC__in REFIID riid, /* [in] */ __RPC__in LPCWSTR storeName, /* [in] */ FABRIC_PARTITION_ID partitionId, /* [in] */ FABRIC_REPLICA_ID replicaId, /* [in] */ __RPC__in FABRIC_URI serviceName, /* [in] */ __RPC__in const FABRIC_REPLICATOR_SETTINGS *replicatorSettings, /* [in] */ __RPC__in const FABRIC_KEY_VALUE_STORE_REPLICA_SETTINGS *kvsSettings, /* [in] */ FABRIC_LOCAL_STORE_KIND localStoreKind, /* [in] */ __RPC__in void *localStoreSettings, /* [in] */ __RPC__in_opt IFabricStoreEventHandler *storeEventHandler, /* [in] */ __RPC__in_opt IFabricSecondaryEventHandler *secondaryEventHandler, /* [retval][out] */ __RPC__deref_out_opt void **keyValueStore); /* [entry] */ HRESULT FabricBeginGetNodeContext( /* [in] */ DWORD timeoutMilliseconds, /* [in] */ __RPC__in_opt IFabricAsyncOperationCallback *callback, /* [retval][out] */ __RPC__deref_out_opt IFabricAsyncOperationContext **context); /* [entry] */ HRESULT FabricEndGetNodeContext( /* [in] */ __RPC__in_opt IFabricAsyncOperationContext *context, /* [retval][out] */ __RPC__deref_out_opt void **nodeContext); /* [entry] */ HRESULT FabricGetNodeContext( /* [retval][out] */ __RPC__deref_out_opt void **nodeContext); /* [entry] */ HRESULT FabricLoadReplicatorSettings( /* [in] */ __RPC__in_opt const IFabricCodePackageActivationContext *codePackageActivationContext, /* [in] */ __RPC__in LPCWSTR configurationPackageName, /* [in] */ __RPC__in LPCWSTR sectionName, /* [retval][out] */ __RPC__deref_out_opt IFabricReplicatorSettingsResult **replicatorSettings); /* [entry] */ HRESULT FabricLoadSecurityCredentials( /* [in] */ __RPC__in_opt const IFabricCodePackageActivationContext *codePackageActivationContext, /* [in] */ __RPC__in LPCWSTR configurationPackageName, /* [in] */ __RPC__in LPCWSTR sectionName, /* [retval][out] */ __RPC__deref_out_opt IFabricSecurityCredentialsResult **securityCredentials); /* [entry] */ HRESULT FabricLoadEseLocalStoreSettings( /* [in] */ __RPC__in_opt const IFabricCodePackageActivationContext *codePackageActivationContext, /* [in] */ __RPC__in LPCWSTR configurationPackageName, /* [in] */ __RPC__in LPCWSTR sectionName, /* [retval][out] */ __RPC__deref_out_opt IFabricEseLocalStoreSettingsResult **settings); /* [entry] */ HRESULT FabricBeginGetCodePackageActivator( /* [in] */ __RPC__in REFIID riid, /* [in] */ DWORD timeoutMilliseconds, /* [in] */ __RPC__in_opt IFabricAsyncOperationCallback *callback, /* [retval][out] */ __RPC__deref_out_opt IFabricAsyncOperationContext **context); /* [entry] */ HRESULT FabricEndGetCodePackageActivator( /* [in] */ __RPC__in_opt IFabricAsyncOperationContext *context, /* [retval][out] */ __RPC__deref_out_opt void **activator); /* [entry] */ HRESULT FabricGetCodePackageActivator( /* [in] */ __RPC__in REFIID riid, /* [retval][out] */ __RPC__deref_out_opt void **activator); #endif /* __FabricRuntimeModule_MODULE_DEFINED__ */ #endif /* __FabricRuntimeLib_LIBRARY_DEFINED__ */ #ifndef __IFabricStateReplicator2_INTERFACE_DEFINED__ #define __IFabricStateReplicator2_INTERFACE_DEFINED__ /* interface IFabricStateReplicator2 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricStateReplicator2; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("4A28D542-658F-46F9-9BF4-79B7CAE25C5D") IFabricStateReplicator2 : public IFabricStateReplicator { public: virtual HRESULT STDMETHODCALLTYPE GetReplicatorSettings( /* [retval][out] */ IFabricReplicatorSettingsResult **replicatorSettings) = 0; }; #else /* C style interface */ typedef struct IFabricStateReplicator2Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricStateReplicator2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricStateReplicator2 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricStateReplicator2 * This); HRESULT ( STDMETHODCALLTYPE *BeginReplicate )( IFabricStateReplicator2 * This, /* [in] */ IFabricOperationData *operationData, /* [in] */ IFabricAsyncOperationCallback *callback, /* [out] */ FABRIC_SEQUENCE_NUMBER *sequenceNumber, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndReplicate )( IFabricStateReplicator2 * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ FABRIC_SEQUENCE_NUMBER *sequenceNumber); HRESULT ( STDMETHODCALLTYPE *GetReplicationStream )( IFabricStateReplicator2 * This, /* [retval][out] */ IFabricOperationStream **stream); HRESULT ( STDMETHODCALLTYPE *GetCopyStream )( IFabricStateReplicator2 * This, /* [retval][out] */ IFabricOperationStream **stream); HRESULT ( STDMETHODCALLTYPE *UpdateReplicatorSettings )( IFabricStateReplicator2 * This, /* [in] */ const FABRIC_REPLICATOR_SETTINGS *replicatorSettings); HRESULT ( STDMETHODCALLTYPE *GetReplicatorSettings )( IFabricStateReplicator2 * This, /* [retval][out] */ IFabricReplicatorSettingsResult **replicatorSettings); END_INTERFACE } IFabricStateReplicator2Vtbl; interface IFabricStateReplicator2 { CONST_VTBL struct IFabricStateReplicator2Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricStateReplicator2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricStateReplicator2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricStateReplicator2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricStateReplicator2_BeginReplicate(This,operationData,callback,sequenceNumber,context) \ ( (This)->lpVtbl -> BeginReplicate(This,operationData,callback,sequenceNumber,context) ) #define IFabricStateReplicator2_EndReplicate(This,context,sequenceNumber) \ ( (This)->lpVtbl -> EndReplicate(This,context,sequenceNumber) ) #define IFabricStateReplicator2_GetReplicationStream(This,stream) \ ( (This)->lpVtbl -> GetReplicationStream(This,stream) ) #define IFabricStateReplicator2_GetCopyStream(This,stream) \ ( (This)->lpVtbl -> GetCopyStream(This,stream) ) #define IFabricStateReplicator2_UpdateReplicatorSettings(This,replicatorSettings) \ ( (This)->lpVtbl -> UpdateReplicatorSettings(This,replicatorSettings) ) #define IFabricStateReplicator2_GetReplicatorSettings(This,replicatorSettings) \ ( (This)->lpVtbl -> GetReplicatorSettings(This,replicatorSettings) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricStateReplicator2_INTERFACE_DEFINED__ */ #ifndef __IFabricCodePackageChangeHandler_INTERFACE_DEFINED__ #define __IFabricCodePackageChangeHandler_INTERFACE_DEFINED__ /* interface IFabricCodePackageChangeHandler */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricCodePackageChangeHandler; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("b90d36cd-acb5-427a-b318-3b045981d0cc") IFabricCodePackageChangeHandler : public IUnknown { public: virtual void STDMETHODCALLTYPE OnPackageAdded( /* [in] */ IFabricCodePackageActivationContext *source, /* [in] */ IFabricCodePackage *codePackage) = 0; virtual void STDMETHODCALLTYPE OnPackageRemoved( /* [in] */ IFabricCodePackageActivationContext *source, /* [in] */ IFabricCodePackage *codePackage) = 0; virtual void STDMETHODCALLTYPE OnPackageModified( /* [in] */ IFabricCodePackageActivationContext *source, /* [in] */ IFabricCodePackage *previousCodePackage, /* [in] */ IFabricCodePackage *codePackage) = 0; }; #else /* C style interface */ typedef struct IFabricCodePackageChangeHandlerVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricCodePackageChangeHandler * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricCodePackageChangeHandler * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricCodePackageChangeHandler * This); void ( STDMETHODCALLTYPE *OnPackageAdded )( IFabricCodePackageChangeHandler * This, /* [in] */ IFabricCodePackageActivationContext *source, /* [in] */ IFabricCodePackage *codePackage); void ( STDMETHODCALLTYPE *OnPackageRemoved )( IFabricCodePackageChangeHandler * This, /* [in] */ IFabricCodePackageActivationContext *source, /* [in] */ IFabricCodePackage *codePackage); void ( STDMETHODCALLTYPE *OnPackageModified )( IFabricCodePackageChangeHandler * This, /* [in] */ IFabricCodePackageActivationContext *source, /* [in] */ IFabricCodePackage *previousCodePackage, /* [in] */ IFabricCodePackage *codePackage); END_INTERFACE } IFabricCodePackageChangeHandlerVtbl; interface IFabricCodePackageChangeHandler { CONST_VTBL struct IFabricCodePackageChangeHandlerVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricCodePackageChangeHandler_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricCodePackageChangeHandler_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricCodePackageChangeHandler_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricCodePackageChangeHandler_OnPackageAdded(This,source,codePackage) \ ( (This)->lpVtbl -> OnPackageAdded(This,source,codePackage) ) #define IFabricCodePackageChangeHandler_OnPackageRemoved(This,source,codePackage) \ ( (This)->lpVtbl -> OnPackageRemoved(This,source,codePackage) ) #define IFabricCodePackageChangeHandler_OnPackageModified(This,source,previousCodePackage,codePackage) \ ( (This)->lpVtbl -> OnPackageModified(This,source,previousCodePackage,codePackage) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricCodePackageChangeHandler_INTERFACE_DEFINED__ */ #ifndef __IFabricKeyValueStoreReplica4_INTERFACE_DEFINED__ #define __IFabricKeyValueStoreReplica4_INTERFACE_DEFINED__ /* interface IFabricKeyValueStoreReplica4 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricKeyValueStoreReplica4; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("ff16d2f1-41a9-4c64-804a-a20bf28c04f3") IFabricKeyValueStoreReplica4 : public IFabricKeyValueStoreReplica3 { public: virtual HRESULT STDMETHODCALLTYPE BeginRestore( /* [in] */ LPCWSTR backupDirectory, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndRestore( /* [in] */ IFabricAsyncOperationContext *context) = 0; }; #else /* C style interface */ typedef struct IFabricKeyValueStoreReplica4Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricKeyValueStoreReplica4 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricKeyValueStoreReplica4 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricKeyValueStoreReplica4 * This); HRESULT ( STDMETHODCALLTYPE *BeginOpen )( IFabricKeyValueStoreReplica4 * This, /* [in] */ FABRIC_REPLICA_OPEN_MODE openMode, /* [in] */ IFabricStatefulServicePartition *partition, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndOpen )( IFabricKeyValueStoreReplica4 * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricReplicator **replicator); HRESULT ( STDMETHODCALLTYPE *BeginChangeRole )( IFabricKeyValueStoreReplica4 * This, /* [in] */ FABRIC_REPLICA_ROLE newRole, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndChangeRole )( IFabricKeyValueStoreReplica4 * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricStringResult **serviceAddress); HRESULT ( STDMETHODCALLTYPE *BeginClose )( IFabricKeyValueStoreReplica4 * This, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndClose )( IFabricKeyValueStoreReplica4 * This, /* [in] */ IFabricAsyncOperationContext *context); void ( STDMETHODCALLTYPE *Abort )( IFabricKeyValueStoreReplica4 * This); HRESULT ( STDMETHODCALLTYPE *GetCurrentEpoch )( IFabricKeyValueStoreReplica4 * This, /* [out] */ FABRIC_EPOCH *currentEpoch); HRESULT ( STDMETHODCALLTYPE *UpdateReplicatorSettings )( IFabricKeyValueStoreReplica4 * This, /* [in] */ const FABRIC_REPLICATOR_SETTINGS *replicatorSettings); HRESULT ( STDMETHODCALLTYPE *CreateTransaction )( IFabricKeyValueStoreReplica4 * This, /* [retval][out] */ IFabricTransaction **transaction); HRESULT ( STDMETHODCALLTYPE *Add )( IFabricKeyValueStoreReplica4 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ LONG valueSizeInBytes, /* [size_is][in] */ const BYTE *value); HRESULT ( STDMETHODCALLTYPE *Remove )( IFabricKeyValueStoreReplica4 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ FABRIC_SEQUENCE_NUMBER checkSequenceNumber); HRESULT ( STDMETHODCALLTYPE *Update )( IFabricKeyValueStoreReplica4 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ LONG valueSizeInBytes, /* [size_is][in] */ const BYTE *value, /* [in] */ FABRIC_SEQUENCE_NUMBER checkSequenceNumber); HRESULT ( STDMETHODCALLTYPE *Get )( IFabricKeyValueStoreReplica4 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ IFabricKeyValueStoreItemResult **result); HRESULT ( STDMETHODCALLTYPE *GetMetadata )( IFabricKeyValueStoreReplica4 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ IFabricKeyValueStoreItemMetadataResult **result); HRESULT ( STDMETHODCALLTYPE *Contains )( IFabricKeyValueStoreReplica4 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ BOOLEAN *result); HRESULT ( STDMETHODCALLTYPE *Enumerate )( IFabricKeyValueStoreReplica4 * This, /* [in] */ IFabricTransactionBase *transaction, /* [retval][out] */ IFabricKeyValueStoreItemEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateByKey )( IFabricKeyValueStoreReplica4 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR keyPrefix, /* [retval][out] */ IFabricKeyValueStoreItemEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateMetadata )( IFabricKeyValueStoreReplica4 * This, /* [in] */ IFabricTransactionBase *transaction, /* [retval][out] */ IFabricKeyValueStoreItemMetadataEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateMetadataByKey )( IFabricKeyValueStoreReplica4 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR keyPrefix, /* [retval][out] */ IFabricKeyValueStoreItemMetadataEnumerator **result); HRESULT ( STDMETHODCALLTYPE *Backup )( IFabricKeyValueStoreReplica4 * This, /* [in] */ LPCWSTR backupDirectory); HRESULT ( STDMETHODCALLTYPE *Restore )( IFabricKeyValueStoreReplica4 * This, /* [in] */ LPCWSTR backupDirectory); HRESULT ( STDMETHODCALLTYPE *CreateTransaction2 )( IFabricKeyValueStoreReplica4 * This, /* [in] */ const FABRIC_KEY_VALUE_STORE_TRANSACTION_SETTINGS *settings, /* [retval][out] */ IFabricTransaction **transaction); HRESULT ( STDMETHODCALLTYPE *BeginBackup )( IFabricKeyValueStoreReplica4 * This, /* [in] */ LPCWSTR backupDirectory, /* [in] */ FABRIC_STORE_BACKUP_OPTION backupOption, /* [in] */ IFabricStorePostBackupHandler *postBackupHandler, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndBackup )( IFabricKeyValueStoreReplica4 * This, /* [in] */ IFabricAsyncOperationContext *context); HRESULT ( STDMETHODCALLTYPE *BeginRestore )( IFabricKeyValueStoreReplica4 * This, /* [in] */ LPCWSTR backupDirectory, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndRestore )( IFabricKeyValueStoreReplica4 * This, /* [in] */ IFabricAsyncOperationContext *context); END_INTERFACE } IFabricKeyValueStoreReplica4Vtbl; interface IFabricKeyValueStoreReplica4 { CONST_VTBL struct IFabricKeyValueStoreReplica4Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricKeyValueStoreReplica4_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricKeyValueStoreReplica4_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricKeyValueStoreReplica4_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricKeyValueStoreReplica4_BeginOpen(This,openMode,partition,callback,context) \ ( (This)->lpVtbl -> BeginOpen(This,openMode,partition,callback,context) ) #define IFabricKeyValueStoreReplica4_EndOpen(This,context,replicator) \ ( (This)->lpVtbl -> EndOpen(This,context,replicator) ) #define IFabricKeyValueStoreReplica4_BeginChangeRole(This,newRole,callback,context) \ ( (This)->lpVtbl -> BeginChangeRole(This,newRole,callback,context) ) #define IFabricKeyValueStoreReplica4_EndChangeRole(This,context,serviceAddress) \ ( (This)->lpVtbl -> EndChangeRole(This,context,serviceAddress) ) #define IFabricKeyValueStoreReplica4_BeginClose(This,callback,context) \ ( (This)->lpVtbl -> BeginClose(This,callback,context) ) #define IFabricKeyValueStoreReplica4_EndClose(This,context) \ ( (This)->lpVtbl -> EndClose(This,context) ) #define IFabricKeyValueStoreReplica4_Abort(This) \ ( (This)->lpVtbl -> Abort(This) ) #define IFabricKeyValueStoreReplica4_GetCurrentEpoch(This,currentEpoch) \ ( (This)->lpVtbl -> GetCurrentEpoch(This,currentEpoch) ) #define IFabricKeyValueStoreReplica4_UpdateReplicatorSettings(This,replicatorSettings) \ ( (This)->lpVtbl -> UpdateReplicatorSettings(This,replicatorSettings) ) #define IFabricKeyValueStoreReplica4_CreateTransaction(This,transaction) \ ( (This)->lpVtbl -> CreateTransaction(This,transaction) ) #define IFabricKeyValueStoreReplica4_Add(This,transaction,key,valueSizeInBytes,value) \ ( (This)->lpVtbl -> Add(This,transaction,key,valueSizeInBytes,value) ) #define IFabricKeyValueStoreReplica4_Remove(This,transaction,key,checkSequenceNumber) \ ( (This)->lpVtbl -> Remove(This,transaction,key,checkSequenceNumber) ) #define IFabricKeyValueStoreReplica4_Update(This,transaction,key,valueSizeInBytes,value,checkSequenceNumber) \ ( (This)->lpVtbl -> Update(This,transaction,key,valueSizeInBytes,value,checkSequenceNumber) ) #define IFabricKeyValueStoreReplica4_Get(This,transaction,key,result) \ ( (This)->lpVtbl -> Get(This,transaction,key,result) ) #define IFabricKeyValueStoreReplica4_GetMetadata(This,transaction,key,result) \ ( (This)->lpVtbl -> GetMetadata(This,transaction,key,result) ) #define IFabricKeyValueStoreReplica4_Contains(This,transaction,key,result) \ ( (This)->lpVtbl -> Contains(This,transaction,key,result) ) #define IFabricKeyValueStoreReplica4_Enumerate(This,transaction,result) \ ( (This)->lpVtbl -> Enumerate(This,transaction,result) ) #define IFabricKeyValueStoreReplica4_EnumerateByKey(This,transaction,keyPrefix,result) \ ( (This)->lpVtbl -> EnumerateByKey(This,transaction,keyPrefix,result) ) #define IFabricKeyValueStoreReplica4_EnumerateMetadata(This,transaction,result) \ ( (This)->lpVtbl -> EnumerateMetadata(This,transaction,result) ) #define IFabricKeyValueStoreReplica4_EnumerateMetadataByKey(This,transaction,keyPrefix,result) \ ( (This)->lpVtbl -> EnumerateMetadataByKey(This,transaction,keyPrefix,result) ) #define IFabricKeyValueStoreReplica4_Backup(This,backupDirectory) \ ( (This)->lpVtbl -> Backup(This,backupDirectory) ) #define IFabricKeyValueStoreReplica4_Restore(This,backupDirectory) \ ( (This)->lpVtbl -> Restore(This,backupDirectory) ) #define IFabricKeyValueStoreReplica4_CreateTransaction2(This,settings,transaction) \ ( (This)->lpVtbl -> CreateTransaction2(This,settings,transaction) ) #define IFabricKeyValueStoreReplica4_BeginBackup(This,backupDirectory,backupOption,postBackupHandler,callback,context) \ ( (This)->lpVtbl -> BeginBackup(This,backupDirectory,backupOption,postBackupHandler,callback,context) ) #define IFabricKeyValueStoreReplica4_EndBackup(This,context) \ ( (This)->lpVtbl -> EndBackup(This,context) ) #define IFabricKeyValueStoreReplica4_BeginRestore(This,backupDirectory,callback,context) \ ( (This)->lpVtbl -> BeginRestore(This,backupDirectory,callback,context) ) #define IFabricKeyValueStoreReplica4_EndRestore(This,context) \ ( (This)->lpVtbl -> EndRestore(This,context) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricKeyValueStoreReplica4_INTERFACE_DEFINED__ */ #ifndef __IFabricKeyValueStoreReplica5_INTERFACE_DEFINED__ #define __IFabricKeyValueStoreReplica5_INTERFACE_DEFINED__ /* interface IFabricKeyValueStoreReplica5 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricKeyValueStoreReplica5; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("34f2da40-6227-448a-be72-c517b0d69432") IFabricKeyValueStoreReplica5 : public IFabricKeyValueStoreReplica4 { public: virtual HRESULT STDMETHODCALLTYPE TryAdd( /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ LONG valueSizeInBytes, /* [size_is][in] */ const BYTE *value, /* [retval][out] */ BOOLEAN *added) = 0; virtual HRESULT STDMETHODCALLTYPE TryRemove( /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ FABRIC_SEQUENCE_NUMBER checkSequenceNumber, /* [retval][out] */ BOOLEAN *exists) = 0; virtual HRESULT STDMETHODCALLTYPE TryUpdate( /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ LONG valueSizeInBytes, /* [size_is][in] */ const BYTE *value, /* [in] */ FABRIC_SEQUENCE_NUMBER checkSequenceNumber, /* [retval][out] */ BOOLEAN *exists) = 0; virtual HRESULT STDMETHODCALLTYPE TryGet( /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ IFabricKeyValueStoreItemResult **result) = 0; virtual HRESULT STDMETHODCALLTYPE TryGetMetadata( /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ IFabricKeyValueStoreItemMetadataResult **result) = 0; virtual HRESULT STDMETHODCALLTYPE EnumerateByKey2( /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR keyPrefix, /* [in] */ BOOLEAN strictPrefix, /* [retval][out] */ IFabricKeyValueStoreItemEnumerator **result) = 0; virtual HRESULT STDMETHODCALLTYPE EnumerateMetadataByKey2( /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR keyPrefix, /* [in] */ BOOLEAN strictPrefix, /* [retval][out] */ IFabricKeyValueStoreItemMetadataEnumerator **result) = 0; }; #else /* C style interface */ typedef struct IFabricKeyValueStoreReplica5Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricKeyValueStoreReplica5 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricKeyValueStoreReplica5 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricKeyValueStoreReplica5 * This); HRESULT ( STDMETHODCALLTYPE *BeginOpen )( IFabricKeyValueStoreReplica5 * This, /* [in] */ FABRIC_REPLICA_OPEN_MODE openMode, /* [in] */ IFabricStatefulServicePartition *partition, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndOpen )( IFabricKeyValueStoreReplica5 * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricReplicator **replicator); HRESULT ( STDMETHODCALLTYPE *BeginChangeRole )( IFabricKeyValueStoreReplica5 * This, /* [in] */ FABRIC_REPLICA_ROLE newRole, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndChangeRole )( IFabricKeyValueStoreReplica5 * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricStringResult **serviceAddress); HRESULT ( STDMETHODCALLTYPE *BeginClose )( IFabricKeyValueStoreReplica5 * This, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndClose )( IFabricKeyValueStoreReplica5 * This, /* [in] */ IFabricAsyncOperationContext *context); void ( STDMETHODCALLTYPE *Abort )( IFabricKeyValueStoreReplica5 * This); HRESULT ( STDMETHODCALLTYPE *GetCurrentEpoch )( IFabricKeyValueStoreReplica5 * This, /* [out] */ FABRIC_EPOCH *currentEpoch); HRESULT ( STDMETHODCALLTYPE *UpdateReplicatorSettings )( IFabricKeyValueStoreReplica5 * This, /* [in] */ const FABRIC_REPLICATOR_SETTINGS *replicatorSettings); HRESULT ( STDMETHODCALLTYPE *CreateTransaction )( IFabricKeyValueStoreReplica5 * This, /* [retval][out] */ IFabricTransaction **transaction); HRESULT ( STDMETHODCALLTYPE *Add )( IFabricKeyValueStoreReplica5 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ LONG valueSizeInBytes, /* [size_is][in] */ const BYTE *value); HRESULT ( STDMETHODCALLTYPE *Remove )( IFabricKeyValueStoreReplica5 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ FABRIC_SEQUENCE_NUMBER checkSequenceNumber); HRESULT ( STDMETHODCALLTYPE *Update )( IFabricKeyValueStoreReplica5 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ LONG valueSizeInBytes, /* [size_is][in] */ const BYTE *value, /* [in] */ FABRIC_SEQUENCE_NUMBER checkSequenceNumber); HRESULT ( STDMETHODCALLTYPE *Get )( IFabricKeyValueStoreReplica5 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ IFabricKeyValueStoreItemResult **result); HRESULT ( STDMETHODCALLTYPE *GetMetadata )( IFabricKeyValueStoreReplica5 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ IFabricKeyValueStoreItemMetadataResult **result); HRESULT ( STDMETHODCALLTYPE *Contains )( IFabricKeyValueStoreReplica5 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ BOOLEAN *result); HRESULT ( STDMETHODCALLTYPE *Enumerate )( IFabricKeyValueStoreReplica5 * This, /* [in] */ IFabricTransactionBase *transaction, /* [retval][out] */ IFabricKeyValueStoreItemEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateByKey )( IFabricKeyValueStoreReplica5 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR keyPrefix, /* [retval][out] */ IFabricKeyValueStoreItemEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateMetadata )( IFabricKeyValueStoreReplica5 * This, /* [in] */ IFabricTransactionBase *transaction, /* [retval][out] */ IFabricKeyValueStoreItemMetadataEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateMetadataByKey )( IFabricKeyValueStoreReplica5 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR keyPrefix, /* [retval][out] */ IFabricKeyValueStoreItemMetadataEnumerator **result); HRESULT ( STDMETHODCALLTYPE *Backup )( IFabricKeyValueStoreReplica5 * This, /* [in] */ LPCWSTR backupDirectory); HRESULT ( STDMETHODCALLTYPE *Restore )( IFabricKeyValueStoreReplica5 * This, /* [in] */ LPCWSTR backupDirectory); HRESULT ( STDMETHODCALLTYPE *CreateTransaction2 )( IFabricKeyValueStoreReplica5 * This, /* [in] */ const FABRIC_KEY_VALUE_STORE_TRANSACTION_SETTINGS *settings, /* [retval][out] */ IFabricTransaction **transaction); HRESULT ( STDMETHODCALLTYPE *BeginBackup )( IFabricKeyValueStoreReplica5 * This, /* [in] */ LPCWSTR backupDirectory, /* [in] */ FABRIC_STORE_BACKUP_OPTION backupOption, /* [in] */ IFabricStorePostBackupHandler *postBackupHandler, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndBackup )( IFabricKeyValueStoreReplica5 * This, /* [in] */ IFabricAsyncOperationContext *context); HRESULT ( STDMETHODCALLTYPE *BeginRestore )( IFabricKeyValueStoreReplica5 * This, /* [in] */ LPCWSTR backupDirectory, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndRestore )( IFabricKeyValueStoreReplica5 * This, /* [in] */ IFabricAsyncOperationContext *context); HRESULT ( STDMETHODCALLTYPE *TryAdd )( IFabricKeyValueStoreReplica5 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ LONG valueSizeInBytes, /* [size_is][in] */ const BYTE *value, /* [retval][out] */ BOOLEAN *added); HRESULT ( STDMETHODCALLTYPE *TryRemove )( IFabricKeyValueStoreReplica5 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ FABRIC_SEQUENCE_NUMBER checkSequenceNumber, /* [retval][out] */ BOOLEAN *exists); HRESULT ( STDMETHODCALLTYPE *TryUpdate )( IFabricKeyValueStoreReplica5 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ LONG valueSizeInBytes, /* [size_is][in] */ const BYTE *value, /* [in] */ FABRIC_SEQUENCE_NUMBER checkSequenceNumber, /* [retval][out] */ BOOLEAN *exists); HRESULT ( STDMETHODCALLTYPE *TryGet )( IFabricKeyValueStoreReplica5 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ IFabricKeyValueStoreItemResult **result); HRESULT ( STDMETHODCALLTYPE *TryGetMetadata )( IFabricKeyValueStoreReplica5 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ IFabricKeyValueStoreItemMetadataResult **result); HRESULT ( STDMETHODCALLTYPE *EnumerateByKey2 )( IFabricKeyValueStoreReplica5 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR keyPrefix, /* [in] */ BOOLEAN strictPrefix, /* [retval][out] */ IFabricKeyValueStoreItemEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateMetadataByKey2 )( IFabricKeyValueStoreReplica5 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR keyPrefix, /* [in] */ BOOLEAN strictPrefix, /* [retval][out] */ IFabricKeyValueStoreItemMetadataEnumerator **result); END_INTERFACE } IFabricKeyValueStoreReplica5Vtbl; interface IFabricKeyValueStoreReplica5 { CONST_VTBL struct IFabricKeyValueStoreReplica5Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricKeyValueStoreReplica5_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricKeyValueStoreReplica5_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricKeyValueStoreReplica5_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricKeyValueStoreReplica5_BeginOpen(This,openMode,partition,callback,context) \ ( (This)->lpVtbl -> BeginOpen(This,openMode,partition,callback,context) ) #define IFabricKeyValueStoreReplica5_EndOpen(This,context,replicator) \ ( (This)->lpVtbl -> EndOpen(This,context,replicator) ) #define IFabricKeyValueStoreReplica5_BeginChangeRole(This,newRole,callback,context) \ ( (This)->lpVtbl -> BeginChangeRole(This,newRole,callback,context) ) #define IFabricKeyValueStoreReplica5_EndChangeRole(This,context,serviceAddress) \ ( (This)->lpVtbl -> EndChangeRole(This,context,serviceAddress) ) #define IFabricKeyValueStoreReplica5_BeginClose(This,callback,context) \ ( (This)->lpVtbl -> BeginClose(This,callback,context) ) #define IFabricKeyValueStoreReplica5_EndClose(This,context) \ ( (This)->lpVtbl -> EndClose(This,context) ) #define IFabricKeyValueStoreReplica5_Abort(This) \ ( (This)->lpVtbl -> Abort(This) ) #define IFabricKeyValueStoreReplica5_GetCurrentEpoch(This,currentEpoch) \ ( (This)->lpVtbl -> GetCurrentEpoch(This,currentEpoch) ) #define IFabricKeyValueStoreReplica5_UpdateReplicatorSettings(This,replicatorSettings) \ ( (This)->lpVtbl -> UpdateReplicatorSettings(This,replicatorSettings) ) #define IFabricKeyValueStoreReplica5_CreateTransaction(This,transaction) \ ( (This)->lpVtbl -> CreateTransaction(This,transaction) ) #define IFabricKeyValueStoreReplica5_Add(This,transaction,key,valueSizeInBytes,value) \ ( (This)->lpVtbl -> Add(This,transaction,key,valueSizeInBytes,value) ) #define IFabricKeyValueStoreReplica5_Remove(This,transaction,key,checkSequenceNumber) \ ( (This)->lpVtbl -> Remove(This,transaction,key,checkSequenceNumber) ) #define IFabricKeyValueStoreReplica5_Update(This,transaction,key,valueSizeInBytes,value,checkSequenceNumber) \ ( (This)->lpVtbl -> Update(This,transaction,key,valueSizeInBytes,value,checkSequenceNumber) ) #define IFabricKeyValueStoreReplica5_Get(This,transaction,key,result) \ ( (This)->lpVtbl -> Get(This,transaction,key,result) ) #define IFabricKeyValueStoreReplica5_GetMetadata(This,transaction,key,result) \ ( (This)->lpVtbl -> GetMetadata(This,transaction,key,result) ) #define IFabricKeyValueStoreReplica5_Contains(This,transaction,key,result) \ ( (This)->lpVtbl -> Contains(This,transaction,key,result) ) #define IFabricKeyValueStoreReplica5_Enumerate(This,transaction,result) \ ( (This)->lpVtbl -> Enumerate(This,transaction,result) ) #define IFabricKeyValueStoreReplica5_EnumerateByKey(This,transaction,keyPrefix,result) \ ( (This)->lpVtbl -> EnumerateByKey(This,transaction,keyPrefix,result) ) #define IFabricKeyValueStoreReplica5_EnumerateMetadata(This,transaction,result) \ ( (This)->lpVtbl -> EnumerateMetadata(This,transaction,result) ) #define IFabricKeyValueStoreReplica5_EnumerateMetadataByKey(This,transaction,keyPrefix,result) \ ( (This)->lpVtbl -> EnumerateMetadataByKey(This,transaction,keyPrefix,result) ) #define IFabricKeyValueStoreReplica5_Backup(This,backupDirectory) \ ( (This)->lpVtbl -> Backup(This,backupDirectory) ) #define IFabricKeyValueStoreReplica5_Restore(This,backupDirectory) \ ( (This)->lpVtbl -> Restore(This,backupDirectory) ) #define IFabricKeyValueStoreReplica5_CreateTransaction2(This,settings,transaction) \ ( (This)->lpVtbl -> CreateTransaction2(This,settings,transaction) ) #define IFabricKeyValueStoreReplica5_BeginBackup(This,backupDirectory,backupOption,postBackupHandler,callback,context) \ ( (This)->lpVtbl -> BeginBackup(This,backupDirectory,backupOption,postBackupHandler,callback,context) ) #define IFabricKeyValueStoreReplica5_EndBackup(This,context) \ ( (This)->lpVtbl -> EndBackup(This,context) ) #define IFabricKeyValueStoreReplica5_BeginRestore(This,backupDirectory,callback,context) \ ( (This)->lpVtbl -> BeginRestore(This,backupDirectory,callback,context) ) #define IFabricKeyValueStoreReplica5_EndRestore(This,context) \ ( (This)->lpVtbl -> EndRestore(This,context) ) #define IFabricKeyValueStoreReplica5_TryAdd(This,transaction,key,valueSizeInBytes,value,added) \ ( (This)->lpVtbl -> TryAdd(This,transaction,key,valueSizeInBytes,value,added) ) #define IFabricKeyValueStoreReplica5_TryRemove(This,transaction,key,checkSequenceNumber,exists) \ ( (This)->lpVtbl -> TryRemove(This,transaction,key,checkSequenceNumber,exists) ) #define IFabricKeyValueStoreReplica5_TryUpdate(This,transaction,key,valueSizeInBytes,value,checkSequenceNumber,exists) \ ( (This)->lpVtbl -> TryUpdate(This,transaction,key,valueSizeInBytes,value,checkSequenceNumber,exists) ) #define IFabricKeyValueStoreReplica5_TryGet(This,transaction,key,result) \ ( (This)->lpVtbl -> TryGet(This,transaction,key,result) ) #define IFabricKeyValueStoreReplica5_TryGetMetadata(This,transaction,key,result) \ ( (This)->lpVtbl -> TryGetMetadata(This,transaction,key,result) ) #define IFabricKeyValueStoreReplica5_EnumerateByKey2(This,transaction,keyPrefix,strictPrefix,result) \ ( (This)->lpVtbl -> EnumerateByKey2(This,transaction,keyPrefix,strictPrefix,result) ) #define IFabricKeyValueStoreReplica5_EnumerateMetadataByKey2(This,transaction,keyPrefix,strictPrefix,result) \ ( (This)->lpVtbl -> EnumerateMetadataByKey2(This,transaction,keyPrefix,strictPrefix,result) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricKeyValueStoreReplica5_INTERFACE_DEFINED__ */ #ifndef __IFabricKeyValueStoreReplica6_INTERFACE_DEFINED__ #define __IFabricKeyValueStoreReplica6_INTERFACE_DEFINED__ /* interface IFabricKeyValueStoreReplica6 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricKeyValueStoreReplica6; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("56e77be1-e81f-4e42-8522-162c2d608184") IFabricKeyValueStoreReplica6 : public IFabricKeyValueStoreReplica5 { public: virtual HRESULT STDMETHODCALLTYPE BeginRestore2( /* [in] */ LPCWSTR backupDirectory, /* [in] */ FABRIC_KEY_VALUE_STORE_RESTORE_SETTINGS *settings, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; }; #else /* C style interface */ typedef struct IFabricKeyValueStoreReplica6Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricKeyValueStoreReplica6 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricKeyValueStoreReplica6 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricKeyValueStoreReplica6 * This); HRESULT ( STDMETHODCALLTYPE *BeginOpen )( IFabricKeyValueStoreReplica6 * This, /* [in] */ FABRIC_REPLICA_OPEN_MODE openMode, /* [in] */ IFabricStatefulServicePartition *partition, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndOpen )( IFabricKeyValueStoreReplica6 * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricReplicator **replicator); HRESULT ( STDMETHODCALLTYPE *BeginChangeRole )( IFabricKeyValueStoreReplica6 * This, /* [in] */ FABRIC_REPLICA_ROLE newRole, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndChangeRole )( IFabricKeyValueStoreReplica6 * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ IFabricStringResult **serviceAddress); HRESULT ( STDMETHODCALLTYPE *BeginClose )( IFabricKeyValueStoreReplica6 * This, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndClose )( IFabricKeyValueStoreReplica6 * This, /* [in] */ IFabricAsyncOperationContext *context); void ( STDMETHODCALLTYPE *Abort )( IFabricKeyValueStoreReplica6 * This); HRESULT ( STDMETHODCALLTYPE *GetCurrentEpoch )( IFabricKeyValueStoreReplica6 * This, /* [out] */ FABRIC_EPOCH *currentEpoch); HRESULT ( STDMETHODCALLTYPE *UpdateReplicatorSettings )( IFabricKeyValueStoreReplica6 * This, /* [in] */ const FABRIC_REPLICATOR_SETTINGS *replicatorSettings); HRESULT ( STDMETHODCALLTYPE *CreateTransaction )( IFabricKeyValueStoreReplica6 * This, /* [retval][out] */ IFabricTransaction **transaction); HRESULT ( STDMETHODCALLTYPE *Add )( IFabricKeyValueStoreReplica6 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ LONG valueSizeInBytes, /* [size_is][in] */ const BYTE *value); HRESULT ( STDMETHODCALLTYPE *Remove )( IFabricKeyValueStoreReplica6 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ FABRIC_SEQUENCE_NUMBER checkSequenceNumber); HRESULT ( STDMETHODCALLTYPE *Update )( IFabricKeyValueStoreReplica6 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ LONG valueSizeInBytes, /* [size_is][in] */ const BYTE *value, /* [in] */ FABRIC_SEQUENCE_NUMBER checkSequenceNumber); HRESULT ( STDMETHODCALLTYPE *Get )( IFabricKeyValueStoreReplica6 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ IFabricKeyValueStoreItemResult **result); HRESULT ( STDMETHODCALLTYPE *GetMetadata )( IFabricKeyValueStoreReplica6 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ IFabricKeyValueStoreItemMetadataResult **result); HRESULT ( STDMETHODCALLTYPE *Contains )( IFabricKeyValueStoreReplica6 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ BOOLEAN *result); HRESULT ( STDMETHODCALLTYPE *Enumerate )( IFabricKeyValueStoreReplica6 * This, /* [in] */ IFabricTransactionBase *transaction, /* [retval][out] */ IFabricKeyValueStoreItemEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateByKey )( IFabricKeyValueStoreReplica6 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR keyPrefix, /* [retval][out] */ IFabricKeyValueStoreItemEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateMetadata )( IFabricKeyValueStoreReplica6 * This, /* [in] */ IFabricTransactionBase *transaction, /* [retval][out] */ IFabricKeyValueStoreItemMetadataEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateMetadataByKey )( IFabricKeyValueStoreReplica6 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR keyPrefix, /* [retval][out] */ IFabricKeyValueStoreItemMetadataEnumerator **result); HRESULT ( STDMETHODCALLTYPE *Backup )( IFabricKeyValueStoreReplica6 * This, /* [in] */ LPCWSTR backupDirectory); HRESULT ( STDMETHODCALLTYPE *Restore )( IFabricKeyValueStoreReplica6 * This, /* [in] */ LPCWSTR backupDirectory); HRESULT ( STDMETHODCALLTYPE *CreateTransaction2 )( IFabricKeyValueStoreReplica6 * This, /* [in] */ const FABRIC_KEY_VALUE_STORE_TRANSACTION_SETTINGS *settings, /* [retval][out] */ IFabricTransaction **transaction); HRESULT ( STDMETHODCALLTYPE *BeginBackup )( IFabricKeyValueStoreReplica6 * This, /* [in] */ LPCWSTR backupDirectory, /* [in] */ FABRIC_STORE_BACKUP_OPTION backupOption, /* [in] */ IFabricStorePostBackupHandler *postBackupHandler, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndBackup )( IFabricKeyValueStoreReplica6 * This, /* [in] */ IFabricAsyncOperationContext *context); HRESULT ( STDMETHODCALLTYPE *BeginRestore )( IFabricKeyValueStoreReplica6 * This, /* [in] */ LPCWSTR backupDirectory, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndRestore )( IFabricKeyValueStoreReplica6 * This, /* [in] */ IFabricAsyncOperationContext *context); HRESULT ( STDMETHODCALLTYPE *TryAdd )( IFabricKeyValueStoreReplica6 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ LONG valueSizeInBytes, /* [size_is][in] */ const BYTE *value, /* [retval][out] */ BOOLEAN *added); HRESULT ( STDMETHODCALLTYPE *TryRemove )( IFabricKeyValueStoreReplica6 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ FABRIC_SEQUENCE_NUMBER checkSequenceNumber, /* [retval][out] */ BOOLEAN *exists); HRESULT ( STDMETHODCALLTYPE *TryUpdate )( IFabricKeyValueStoreReplica6 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [in] */ LONG valueSizeInBytes, /* [size_is][in] */ const BYTE *value, /* [in] */ FABRIC_SEQUENCE_NUMBER checkSequenceNumber, /* [retval][out] */ BOOLEAN *exists); HRESULT ( STDMETHODCALLTYPE *TryGet )( IFabricKeyValueStoreReplica6 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ IFabricKeyValueStoreItemResult **result); HRESULT ( STDMETHODCALLTYPE *TryGetMetadata )( IFabricKeyValueStoreReplica6 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR key, /* [retval][out] */ IFabricKeyValueStoreItemMetadataResult **result); HRESULT ( STDMETHODCALLTYPE *EnumerateByKey2 )( IFabricKeyValueStoreReplica6 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR keyPrefix, /* [in] */ BOOLEAN strictPrefix, /* [retval][out] */ IFabricKeyValueStoreItemEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateMetadataByKey2 )( IFabricKeyValueStoreReplica6 * This, /* [in] */ IFabricTransactionBase *transaction, /* [in] */ LPCWSTR keyPrefix, /* [in] */ BOOLEAN strictPrefix, /* [retval][out] */ IFabricKeyValueStoreItemMetadataEnumerator **result); HRESULT ( STDMETHODCALLTYPE *BeginRestore2 )( IFabricKeyValueStoreReplica6 * This, /* [in] */ LPCWSTR backupDirectory, /* [in] */ FABRIC_KEY_VALUE_STORE_RESTORE_SETTINGS *settings, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); END_INTERFACE } IFabricKeyValueStoreReplica6Vtbl; interface IFabricKeyValueStoreReplica6 { CONST_VTBL struct IFabricKeyValueStoreReplica6Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricKeyValueStoreReplica6_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricKeyValueStoreReplica6_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricKeyValueStoreReplica6_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricKeyValueStoreReplica6_BeginOpen(This,openMode,partition,callback,context) \ ( (This)->lpVtbl -> BeginOpen(This,openMode,partition,callback,context) ) #define IFabricKeyValueStoreReplica6_EndOpen(This,context,replicator) \ ( (This)->lpVtbl -> EndOpen(This,context,replicator) ) #define IFabricKeyValueStoreReplica6_BeginChangeRole(This,newRole,callback,context) \ ( (This)->lpVtbl -> BeginChangeRole(This,newRole,callback,context) ) #define IFabricKeyValueStoreReplica6_EndChangeRole(This,context,serviceAddress) \ ( (This)->lpVtbl -> EndChangeRole(This,context,serviceAddress) ) #define IFabricKeyValueStoreReplica6_BeginClose(This,callback,context) \ ( (This)->lpVtbl -> BeginClose(This,callback,context) ) #define IFabricKeyValueStoreReplica6_EndClose(This,context) \ ( (This)->lpVtbl -> EndClose(This,context) ) #define IFabricKeyValueStoreReplica6_Abort(This) \ ( (This)->lpVtbl -> Abort(This) ) #define IFabricKeyValueStoreReplica6_GetCurrentEpoch(This,currentEpoch) \ ( (This)->lpVtbl -> GetCurrentEpoch(This,currentEpoch) ) #define IFabricKeyValueStoreReplica6_UpdateReplicatorSettings(This,replicatorSettings) \ ( (This)->lpVtbl -> UpdateReplicatorSettings(This,replicatorSettings) ) #define IFabricKeyValueStoreReplica6_CreateTransaction(This,transaction) \ ( (This)->lpVtbl -> CreateTransaction(This,transaction) ) #define IFabricKeyValueStoreReplica6_Add(This,transaction,key,valueSizeInBytes,value) \ ( (This)->lpVtbl -> Add(This,transaction,key,valueSizeInBytes,value) ) #define IFabricKeyValueStoreReplica6_Remove(This,transaction,key,checkSequenceNumber) \ ( (This)->lpVtbl -> Remove(This,transaction,key,checkSequenceNumber) ) #define IFabricKeyValueStoreReplica6_Update(This,transaction,key,valueSizeInBytes,value,checkSequenceNumber) \ ( (This)->lpVtbl -> Update(This,transaction,key,valueSizeInBytes,value,checkSequenceNumber) ) #define IFabricKeyValueStoreReplica6_Get(This,transaction,key,result) \ ( (This)->lpVtbl -> Get(This,transaction,key,result) ) #define IFabricKeyValueStoreReplica6_GetMetadata(This,transaction,key,result) \ ( (This)->lpVtbl -> GetMetadata(This,transaction,key,result) ) #define IFabricKeyValueStoreReplica6_Contains(This,transaction,key,result) \ ( (This)->lpVtbl -> Contains(This,transaction,key,result) ) #define IFabricKeyValueStoreReplica6_Enumerate(This,transaction,result) \ ( (This)->lpVtbl -> Enumerate(This,transaction,result) ) #define IFabricKeyValueStoreReplica6_EnumerateByKey(This,transaction,keyPrefix,result) \ ( (This)->lpVtbl -> EnumerateByKey(This,transaction,keyPrefix,result) ) #define IFabricKeyValueStoreReplica6_EnumerateMetadata(This,transaction,result) \ ( (This)->lpVtbl -> EnumerateMetadata(This,transaction,result) ) #define IFabricKeyValueStoreReplica6_EnumerateMetadataByKey(This,transaction,keyPrefix,result) \ ( (This)->lpVtbl -> EnumerateMetadataByKey(This,transaction,keyPrefix,result) ) #define IFabricKeyValueStoreReplica6_Backup(This,backupDirectory) \ ( (This)->lpVtbl -> Backup(This,backupDirectory) ) #define IFabricKeyValueStoreReplica6_Restore(This,backupDirectory) \ ( (This)->lpVtbl -> Restore(This,backupDirectory) ) #define IFabricKeyValueStoreReplica6_CreateTransaction2(This,settings,transaction) \ ( (This)->lpVtbl -> CreateTransaction2(This,settings,transaction) ) #define IFabricKeyValueStoreReplica6_BeginBackup(This,backupDirectory,backupOption,postBackupHandler,callback,context) \ ( (This)->lpVtbl -> BeginBackup(This,backupDirectory,backupOption,postBackupHandler,callback,context) ) #define IFabricKeyValueStoreReplica6_EndBackup(This,context) \ ( (This)->lpVtbl -> EndBackup(This,context) ) #define IFabricKeyValueStoreReplica6_BeginRestore(This,backupDirectory,callback,context) \ ( (This)->lpVtbl -> BeginRestore(This,backupDirectory,callback,context) ) #define IFabricKeyValueStoreReplica6_EndRestore(This,context) \ ( (This)->lpVtbl -> EndRestore(This,context) ) #define IFabricKeyValueStoreReplica6_TryAdd(This,transaction,key,valueSizeInBytes,value,added) \ ( (This)->lpVtbl -> TryAdd(This,transaction,key,valueSizeInBytes,value,added) ) #define IFabricKeyValueStoreReplica6_TryRemove(This,transaction,key,checkSequenceNumber,exists) \ ( (This)->lpVtbl -> TryRemove(This,transaction,key,checkSequenceNumber,exists) ) #define IFabricKeyValueStoreReplica6_TryUpdate(This,transaction,key,valueSizeInBytes,value,checkSequenceNumber,exists) \ ( (This)->lpVtbl -> TryUpdate(This,transaction,key,valueSizeInBytes,value,checkSequenceNumber,exists) ) #define IFabricKeyValueStoreReplica6_TryGet(This,transaction,key,result) \ ( (This)->lpVtbl -> TryGet(This,transaction,key,result) ) #define IFabricKeyValueStoreReplica6_TryGetMetadata(This,transaction,key,result) \ ( (This)->lpVtbl -> TryGetMetadata(This,transaction,key,result) ) #define IFabricKeyValueStoreReplica6_EnumerateByKey2(This,transaction,keyPrefix,strictPrefix,result) \ ( (This)->lpVtbl -> EnumerateByKey2(This,transaction,keyPrefix,strictPrefix,result) ) #define IFabricKeyValueStoreReplica6_EnumerateMetadataByKey2(This,transaction,keyPrefix,strictPrefix,result) \ ( (This)->lpVtbl -> EnumerateMetadataByKey2(This,transaction,keyPrefix,strictPrefix,result) ) #define IFabricKeyValueStoreReplica6_BeginRestore2(This,backupDirectory,settings,callback,context) \ ( (This)->lpVtbl -> BeginRestore2(This,backupDirectory,settings,callback,context) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricKeyValueStoreReplica6_INTERFACE_DEFINED__ */ #ifndef __IFabricKeyValueStoreEnumerator_INTERFACE_DEFINED__ #define __IFabricKeyValueStoreEnumerator_INTERFACE_DEFINED__ /* interface IFabricKeyValueStoreEnumerator */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricKeyValueStoreEnumerator; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("6722b848-15bb-4528-bf54-c7bbe27b6f9a") IFabricKeyValueStoreEnumerator : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE EnumerateByKey( /* [in] */ LPCWSTR keyPrefix, /* [retval][out] */ IFabricKeyValueStoreItemEnumerator **result) = 0; virtual HRESULT STDMETHODCALLTYPE EnumerateMetadataByKey( /* [in] */ LPCWSTR keyPrefix, /* [retval][out] */ IFabricKeyValueStoreItemMetadataEnumerator **result) = 0; }; #else /* C style interface */ typedef struct IFabricKeyValueStoreEnumeratorVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricKeyValueStoreEnumerator * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricKeyValueStoreEnumerator * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricKeyValueStoreEnumerator * This); HRESULT ( STDMETHODCALLTYPE *EnumerateByKey )( IFabricKeyValueStoreEnumerator * This, /* [in] */ LPCWSTR keyPrefix, /* [retval][out] */ IFabricKeyValueStoreItemEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateMetadataByKey )( IFabricKeyValueStoreEnumerator * This, /* [in] */ LPCWSTR keyPrefix, /* [retval][out] */ IFabricKeyValueStoreItemMetadataEnumerator **result); END_INTERFACE } IFabricKeyValueStoreEnumeratorVtbl; interface IFabricKeyValueStoreEnumerator { CONST_VTBL struct IFabricKeyValueStoreEnumeratorVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricKeyValueStoreEnumerator_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricKeyValueStoreEnumerator_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricKeyValueStoreEnumerator_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricKeyValueStoreEnumerator_EnumerateByKey(This,keyPrefix,result) \ ( (This)->lpVtbl -> EnumerateByKey(This,keyPrefix,result) ) #define IFabricKeyValueStoreEnumerator_EnumerateMetadataByKey(This,keyPrefix,result) \ ( (This)->lpVtbl -> EnumerateMetadataByKey(This,keyPrefix,result) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricKeyValueStoreEnumerator_INTERFACE_DEFINED__ */ #ifndef __IFabricKeyValueStoreEnumerator2_INTERFACE_DEFINED__ #define __IFabricKeyValueStoreEnumerator2_INTERFACE_DEFINED__ /* interface IFabricKeyValueStoreEnumerator2 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricKeyValueStoreEnumerator2; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("6<PASSWORD>64-4<PASSWORD>-<PASSWORD>-<PASSWORD>-<PASSWORD>") IFabricKeyValueStoreEnumerator2 : public IFabricKeyValueStoreEnumerator { public: virtual HRESULT STDMETHODCALLTYPE EnumerateByKey2( /* [in] */ LPCWSTR keyPrefix, /* [in] */ BOOLEAN strictPrefix, /* [retval][out] */ IFabricKeyValueStoreItemEnumerator **result) = 0; virtual HRESULT STDMETHODCALLTYPE EnumerateMetadataByKey2( /* [in] */ LPCWSTR keyPrefix, /* [in] */ BOOLEAN strictPrefix, /* [retval][out] */ IFabricKeyValueStoreItemMetadataEnumerator **result) = 0; }; #else /* C style interface */ typedef struct IFabricKeyValueStoreEnumerator2Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricKeyValueStoreEnumerator2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricKeyValueStoreEnumerator2 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricKeyValueStoreEnumerator2 * This); HRESULT ( STDMETHODCALLTYPE *EnumerateByKey )( IFabricKeyValueStoreEnumerator2 * This, /* [in] */ LPCWSTR keyPrefix, /* [retval][out] */ IFabricKeyValueStoreItemEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateMetadataByKey )( IFabricKeyValueStoreEnumerator2 * This, /* [in] */ LPCWSTR keyPrefix, /* [retval][out] */ IFabricKeyValueStoreItemMetadataEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateByKey2 )( IFabricKeyValueStoreEnumerator2 * This, /* [in] */ LPCWSTR keyPrefix, /* [in] */ BOOLEAN strictPrefix, /* [retval][out] */ IFabricKeyValueStoreItemEnumerator **result); HRESULT ( STDMETHODCALLTYPE *EnumerateMetadataByKey2 )( IFabricKeyValueStoreEnumerator2 * This, /* [in] */ LPCWSTR keyPrefix, /* [in] */ BOOLEAN strictPrefix, /* [retval][out] */ IFabricKeyValueStoreItemMetadataEnumerator **result); END_INTERFACE } IFabricKeyValueStoreEnumerator2Vtbl; interface IFabricKeyValueStoreEnumerator2 { CONST_VTBL struct IFabricKeyValueStoreEnumerator2Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricKeyValueStoreEnumerator2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricKeyValueStoreEnumerator2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricKeyValueStoreEnumerator2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricKeyValueStoreEnumerator2_EnumerateByKey(This,keyPrefix,result) \ ( (This)->lpVtbl -> EnumerateByKey(This,keyPrefix,result) ) #define IFabricKeyValueStoreEnumerator2_EnumerateMetadataByKey(This,keyPrefix,result) \ ( (This)->lpVtbl -> EnumerateMetadataByKey(This,keyPrefix,result) ) #define IFabricKeyValueStoreEnumerator2_EnumerateByKey2(This,keyPrefix,strictPrefix,result) \ ( (This)->lpVtbl -> EnumerateByKey2(This,keyPrefix,strictPrefix,result) ) #define IFabricKeyValueStoreEnumerator2_EnumerateMetadataByKey2(This,keyPrefix,strictPrefix,result) \ ( (This)->lpVtbl -> EnumerateMetadataByKey2(This,keyPrefix,strictPrefix,result) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricKeyValueStoreEnumerator2_INTERFACE_DEFINED__ */ #ifndef __IFabricKeyValueStoreItemEnumerator2_INTERFACE_DEFINED__ #define __IFabricKeyValueStoreItemEnumerator2_INTERFACE_DEFINED__ /* interface IFabricKeyValueStoreItemEnumerator2 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricKeyValueStoreItemEnumerator2; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("da143bbc-81e1-48cd-afd7-b642bc5b9bfd") IFabricKeyValueStoreItemEnumerator2 : public IFabricKeyValueStoreItemEnumerator { public: virtual HRESULT STDMETHODCALLTYPE TryMoveNext( /* [retval][out] */ BOOLEAN *success) = 0; }; #else /* C style interface */ typedef struct IFabricKeyValueStoreItemEnumerator2Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricKeyValueStoreItemEnumerator2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricKeyValueStoreItemEnumerator2 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricKeyValueStoreItemEnumerator2 * This); HRESULT ( STDMETHODCALLTYPE *MoveNext )( IFabricKeyValueStoreItemEnumerator2 * This); IFabricKeyValueStoreItemResult *( STDMETHODCALLTYPE *get_Current )( IFabricKeyValueStoreItemEnumerator2 * This); HRESULT ( STDMETHODCALLTYPE *TryMoveNext )( IFabricKeyValueStoreItemEnumerator2 * This, /* [retval][out] */ BOOLEAN *success); END_INTERFACE } IFabricKeyValueStoreItemEnumerator2Vtbl; interface IFabricKeyValueStoreItemEnumerator2 { CONST_VTBL struct IFabricKeyValueStoreItemEnumerator2Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricKeyValueStoreItemEnumerator2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricKeyValueStoreItemEnumerator2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricKeyValueStoreItemEnumerator2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricKeyValueStoreItemEnumerator2_MoveNext(This) \ ( (This)->lpVtbl -> MoveNext(This) ) #define IFabricKeyValueStoreItemEnumerator2_get_Current(This) \ ( (This)->lpVtbl -> get_Current(This) ) #define IFabricKeyValueStoreItemEnumerator2_TryMoveNext(This,success) \ ( (This)->lpVtbl -> TryMoveNext(This,success) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricKeyValueStoreItemEnumerator2_INTERFACE_DEFINED__ */ #ifndef __IFabricKeyValueStoreItemMetadataEnumerator2_INTERFACE_DEFINED__ #define __IFabricKeyValueStoreItemMetadataEnumerator2_INTERFACE_DEFINED__ /* interface IFabricKeyValueStoreItemMetadataEnumerator2 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricKeyValueStoreItemMetadataEnumerator2; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("8803d53e-dd73-40fc-a662-1bfe999419ea") IFabricKeyValueStoreItemMetadataEnumerator2 : public IFabricKeyValueStoreItemMetadataEnumerator { public: virtual HRESULT STDMETHODCALLTYPE TryMoveNext( /* [retval][out] */ BOOLEAN *success) = 0; }; #else /* C style interface */ typedef struct IFabricKeyValueStoreItemMetadataEnumerator2Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricKeyValueStoreItemMetadataEnumerator2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricKeyValueStoreItemMetadataEnumerator2 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricKeyValueStoreItemMetadataEnumerator2 * This); HRESULT ( STDMETHODCALLTYPE *MoveNext )( IFabricKeyValueStoreItemMetadataEnumerator2 * This); IFabricKeyValueStoreItemMetadataResult *( STDMETHODCALLTYPE *get_Current )( IFabricKeyValueStoreItemMetadataEnumerator2 * This); HRESULT ( STDMETHODCALLTYPE *TryMoveNext )( IFabricKeyValueStoreItemMetadataEnumerator2 * This, /* [retval][out] */ BOOLEAN *success); END_INTERFACE } IFabricKeyValueStoreItemMetadataEnumerator2Vtbl; interface IFabricKeyValueStoreItemMetadataEnumerator2 { CONST_VTBL struct IFabricKeyValueStoreItemMetadataEnumerator2Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricKeyValueStoreItemMetadataEnumerator2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricKeyValueStoreItemMetadataEnumerator2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricKeyValueStoreItemMetadataEnumerator2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricKeyValueStoreItemMetadataEnumerator2_MoveNext(This) \ ( (This)->lpVtbl -> MoveNext(This) ) #define IFabricKeyValueStoreItemMetadataEnumerator2_get_Current(This) \ ( (This)->lpVtbl -> get_Current(This) ) #define IFabricKeyValueStoreItemMetadataEnumerator2_TryMoveNext(This,success) \ ( (This)->lpVtbl -> TryMoveNext(This,success) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricKeyValueStoreItemMetadataEnumerator2_INTERFACE_DEFINED__ */ #ifndef __IFabricKeyValueStoreNotificationEnumerator2_INTERFACE_DEFINED__ #define __IFabricKeyValueStoreNotificationEnumerator2_INTERFACE_DEFINED__ /* interface IFabricKeyValueStoreNotificationEnumerator2 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricKeyValueStoreNotificationEnumerator2; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("55eec7c6-ae81-407a-b84c-22771d314ac7") IFabricKeyValueStoreNotificationEnumerator2 : public IFabricKeyValueStoreNotificationEnumerator { public: virtual HRESULT STDMETHODCALLTYPE TryMoveNext( /* [retval][out] */ BOOLEAN *success) = 0; }; #else /* C style interface */ typedef struct IFabricKeyValueStoreNotificationEnumerator2Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricKeyValueStoreNotificationEnumerator2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricKeyValueStoreNotificationEnumerator2 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricKeyValueStoreNotificationEnumerator2 * This); HRESULT ( STDMETHODCALLTYPE *MoveNext )( IFabricKeyValueStoreNotificationEnumerator2 * This); IFabricKeyValueStoreNotification *( STDMETHODCALLTYPE *get_Current )( IFabricKeyValueStoreNotificationEnumerator2 * This); void ( STDMETHODCALLTYPE *Reset )( IFabricKeyValueStoreNotificationEnumerator2 * This); HRESULT ( STDMETHODCALLTYPE *TryMoveNext )( IFabricKeyValueStoreNotificationEnumerator2 * This, /* [retval][out] */ BOOLEAN *success); END_INTERFACE } IFabricKeyValueStoreNotificationEnumerator2Vtbl; interface IFabricKeyValueStoreNotificationEnumerator2 { CONST_VTBL struct IFabricKeyValueStoreNotificationEnumerator2Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricKeyValueStoreNotificationEnumerator2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricKeyValueStoreNotificationEnumerator2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricKeyValueStoreNotificationEnumerator2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricKeyValueStoreNotificationEnumerator2_MoveNext(This) \ ( (This)->lpVtbl -> MoveNext(This) ) #define IFabricKeyValueStoreNotificationEnumerator2_get_Current(This) \ ( (This)->lpVtbl -> get_Current(This) ) #define IFabricKeyValueStoreNotificationEnumerator2_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) #define IFabricKeyValueStoreNotificationEnumerator2_TryMoveNext(This,success) \ ( (This)->lpVtbl -> TryMoveNext(This,success) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricKeyValueStoreNotificationEnumerator2_INTERFACE_DEFINED__ */ #ifndef __IFabricStoreEventHandler_INTERFACE_DEFINED__ #define __IFabricStoreEventHandler_INTERFACE_DEFINED__ /* interface IFabricStoreEventHandler */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricStoreEventHandler; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("220e6da4-985b-4dee-8fe9-77521b838795") IFabricStoreEventHandler : public IUnknown { public: virtual void STDMETHODCALLTYPE OnDataLoss( void) = 0; }; #else /* C style interface */ typedef struct IFabricStoreEventHandlerVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricStoreEventHandler * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricStoreEventHandler * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricStoreEventHandler * This); void ( STDMETHODCALLTYPE *OnDataLoss )( IFabricStoreEventHandler * This); END_INTERFACE } IFabricStoreEventHandlerVtbl; interface IFabricStoreEventHandler { CONST_VTBL struct IFabricStoreEventHandlerVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricStoreEventHandler_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricStoreEventHandler_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricStoreEventHandler_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricStoreEventHandler_OnDataLoss(This) \ ( (This)->lpVtbl -> OnDataLoss(This) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricStoreEventHandler_INTERFACE_DEFINED__ */ #ifndef __IFabricStoreEventHandler2_INTERFACE_DEFINED__ #define __IFabricStoreEventHandler2_INTERFACE_DEFINED__ /* interface IFabricStoreEventHandler2 */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricStoreEventHandler2; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("CCE4523F-614B-4D6A-98A3-1E197C0213EA") IFabricStoreEventHandler2 : public IFabricStoreEventHandler { public: virtual HRESULT STDMETHODCALLTYPE BeginOnDataLoss( /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndOnDataLoss( /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ BOOLEAN *isStateChanged) = 0; }; #else /* C style interface */ typedef struct IFabricStoreEventHandler2Vtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricStoreEventHandler2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricStoreEventHandler2 * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricStoreEventHandler2 * This); void ( STDMETHODCALLTYPE *OnDataLoss )( IFabricStoreEventHandler2 * This); HRESULT ( STDMETHODCALLTYPE *BeginOnDataLoss )( IFabricStoreEventHandler2 * This, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndOnDataLoss )( IFabricStoreEventHandler2 * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ BOOLEAN *isStateChanged); END_INTERFACE } IFabricStoreEventHandler2Vtbl; interface IFabricStoreEventHandler2 { CONST_VTBL struct IFabricStoreEventHandler2Vtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricStoreEventHandler2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricStoreEventHandler2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricStoreEventHandler2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricStoreEventHandler2_OnDataLoss(This) \ ( (This)->lpVtbl -> OnDataLoss(This) ) #define IFabricStoreEventHandler2_BeginOnDataLoss(This,callback,context) \ ( (This)->lpVtbl -> BeginOnDataLoss(This,callback,context) ) #define IFabricStoreEventHandler2_EndOnDataLoss(This,context,isStateChanged) \ ( (This)->lpVtbl -> EndOnDataLoss(This,context,isStateChanged) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricStoreEventHandler2_INTERFACE_DEFINED__ */ #ifndef __IFabricStorePostBackupHandler_INTERFACE_DEFINED__ #define __IFabricStorePostBackupHandler_INTERFACE_DEFINED__ /* interface IFabricStorePostBackupHandler */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricStorePostBackupHandler; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("2af2e8a6-41df-4e32-9d2a-d73a711e652a") IFabricStorePostBackupHandler : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE BeginPostBackup( /* [in] */ FABRIC_STORE_BACKUP_INFO *info, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context) = 0; virtual HRESULT STDMETHODCALLTYPE EndPostBackup( /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ BOOLEAN *status) = 0; }; #else /* C style interface */ typedef struct IFabricStorePostBackupHandlerVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricStorePostBackupHandler * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricStorePostBackupHandler * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricStorePostBackupHandler * This); HRESULT ( STDMETHODCALLTYPE *BeginPostBackup )( IFabricStorePostBackupHandler * This, /* [in] */ FABRIC_STORE_BACKUP_INFO *info, /* [in] */ IFabricAsyncOperationCallback *callback, /* [retval][out] */ IFabricAsyncOperationContext **context); HRESULT ( STDMETHODCALLTYPE *EndPostBackup )( IFabricStorePostBackupHandler * This, /* [in] */ IFabricAsyncOperationContext *context, /* [retval][out] */ BOOLEAN *status); END_INTERFACE } IFabricStorePostBackupHandlerVtbl; interface IFabricStorePostBackupHandler { CONST_VTBL struct IFabricStorePostBackupHandlerVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricStorePostBackupHandler_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricStorePostBackupHandler_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricStorePostBackupHandler_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricStorePostBackupHandler_BeginPostBackup(This,info,callback,context) \ ( (This)->lpVtbl -> BeginPostBackup(This,info,callback,context) ) #define IFabricStorePostBackupHandler_EndPostBackup(This,context,status) \ ( (This)->lpVtbl -> EndPostBackup(This,context,status) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricStorePostBackupHandler_INTERFACE_DEFINED__ */ #ifndef __IFabricSecondaryEventHandler_INTERFACE_DEFINED__ #define __IFabricSecondaryEventHandler_INTERFACE_DEFINED__ /* interface IFabricSecondaryEventHandler */ /* [uuid][local][object] */ EXTERN_C const IID IID_IFabricSecondaryEventHandler; #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFACE("7d124a7d-258e-49f2-a9b0-e800406103fb") IFabricSecondaryEventHandler : public IUnknown { public: virtual HRESULT STDMETHODCALLTYPE OnCopyComplete( /* [in] */ IFabricKeyValueStoreEnumerator *enumerator) = 0; virtual HRESULT STDMETHODCALLTYPE OnReplicationOperation( /* [in] */ IFabricKeyValueStoreNotificationEnumerator *enumerator) = 0; }; #else /* C style interface */ typedef struct IFabricSecondaryEventHandlerVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IFabricSecondaryEventHandler * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )( IFabricSecondaryEventHandler * This); ULONG ( STDMETHODCALLTYPE *Release )( IFabricSecondaryEventHandler * This); HRESULT ( STDMETHODCALLTYPE *OnCopyComplete )( IFabricSecondaryEventHandler * This, /* [in] */ IFabricKeyValueStoreEnumerator *enumerator); HRESULT ( STDMETHODCALLTYPE *OnReplicationOperation )( IFabricSecondaryEventHandler * This, /* [in] */ IFabricKeyValueStoreNotificationEnumerator *enumerator); END_INTERFACE } IFabricSecondaryEventHandlerVtbl; interface IFabricSecondaryEventHandler { CONST_VTBL struct IFabricSecondaryEventHandlerVtbl *lpVtbl; }; #ifdef COBJMACROS #define IFabricSecondaryEventHandler_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) #define IFabricSecondaryEventHandler_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) #define IFabricSecondaryEventHandler_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #define IFabricSecondaryEventHandler_OnCopyComplete(This,enumerator) \ ( (This)->lpVtbl -> OnCopyComplete(This,enumerator) ) #define IFabricSecondaryEventHandler_OnReplicationOperation(This,enumerator) \ ( (This)->lpVtbl -> OnReplicationOperation(This,enumerator) ) #endif /* COBJMACROS */ #endif /* C style interface */ #endif /* __IFabricSecondaryEventHandler_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_fabricruntime_0000_0075 */ /* [local] */ typedef HRESULT (*FnFabricMain)(IFabricRuntime * runtime, IFabricCodePackageActivationContext * activationContext); extern RPC_IF_HANDLE __MIDL_itf_fabricruntime_0000_0075_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_fabricruntime_0000_0075_v0_0_s_ifspec; /* Additional Prototypes for ALL interfaces */ /* end of Additional Prototypes */ #ifdef __cplusplus } #endif #endif
198,856
427
<gh_stars>100-1000 //===-- esan.h --------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file is a part of EfficiencySanitizer, a family of performance tuners. // // Main internal esan header file. // // Ground rules: // - C++ run-time should not be used (static CTORs, RTTI, exceptions, static // function-scope locals) // - All functions/classes/etc reside in namespace __esan, except for those // declared in esan_interface_internal.h. // - Platform-specific files should be used instead of ifdefs (*). // - No system headers included in header files (*). // - Platform specific headers included only into platform-specific files (*). // // (*) Except when inlining is critical for performance. //===----------------------------------------------------------------------===// #ifndef ESAN_H #define ESAN_H #include "interception/interception.h" #include "sanitizer_common/sanitizer_common.h" #include "esan_interface_internal.h" namespace __esan { extern bool EsanIsInitialized; extern bool EsanDuringInit; extern uptr VmaSize; void initializeLibrary(ToolType Tool); int finalizeLibrary(); void reportResults(); unsigned int getSampleCount(); // Esan creates the variable per tool per compilation unit at compile time // and passes its pointer Ptr to the runtime library. void processCompilationUnitInit(void *Ptr); void processCompilationUnitExit(void *Ptr); void processRangeAccess(uptr PC, uptr Addr, int Size, bool IsWrite); void initializeInterceptors(); // Platform-dependent routines. void verifyAddressSpace(); bool fixMmapAddr(void **Addr, SIZE_T Size, int Flags); uptr checkMmapResult(uptr Addr, SIZE_T Size); // The return value indicates whether to call the real version or not. bool processSignal(int SigNum, void (*Handler)(int), void (**Result)(int)); bool processSigaction(int SigNum, const void *Act, void *OldAct); bool processSigprocmask(int How, void *Set, void *OldSet); } // namespace __esan #endif // ESAN_H
638
6,989
<filename>catboost/private/libs/algo/approx_dimension.h #pragma once #include <util/system/types.h> class TLabelConverter; namespace NCatboostOptions { class TCatBoostOptions; } namespace NCB { ui32 GetApproxDimension( const NCatboostOptions::TCatBoostOptions& catBoostOptions, const TLabelConverter& labelConverter, ui32 targetDimension ); }
155
510
from __future__ import absolute_import from sfepy.discrete.fem import Mesh, FEDomain import scipy.sparse as sps import numpy as nm from sfepy.base.compat import factorial from sfepy.base.base import output from six.moves import range def elems_q2t(el): nel, nnd = el.shape if nnd > 4: q2t = nm.array([[0, 2, 3, 6], [0, 3, 7, 6], [0, 7, 4, 6], [0, 5, 6, 4], [1, 5, 6, 0], [1, 6, 2, 0]]) else: q2t = nm.array([[0, 1, 2], [0, 2, 3]]) ns, nn = q2t.shape nel *= ns out = nm.zeros((nel, nn), dtype=nm.int32); for ii in range(ns): idxs = nm.arange(ii, nel, ns) out[idxs,:] = el[:, q2t[ii,:]] return nm.ascontiguousarray(out) def triangulate(mesh, verbose=False): """ Triangulate a 2D or 3D tensor product mesh: quadrilaterals->triangles, hexahedrons->tetrahedrons. Parameters ---------- mesh : Mesh The input mesh. Returns ------- mesh : Mesh The triangulated mesh. """ conns = None for k, new_desc in [('3_8', '3_4'), ('2_4', '2_3')]: if k in mesh.descs: conns = mesh.get_conn(k) break if conns is not None: nelo = conns.shape[0] output('initial mesh: %d elements' % nelo, verbose=verbose) new_conns = elems_q2t(conns) nn = new_conns.shape[0] // nelo new_cgroups = nm.repeat(mesh.cmesh.cell_groups, nn) output('new mesh: %d elements' % new_conns.shape[0], verbose=verbose) mesh = Mesh.from_data(mesh.name, mesh.coors, mesh.cmesh.vertex_groups, [new_conns], [new_cgroups], [new_desc]) return mesh def smooth_mesh(mesh, n_iter=4, lam=0.6307, mu=-0.6347, weights=None, bconstr=True, volume_corr=False): """ FE mesh smoothing. Based on: [1] <NAME>, <NAME>, Smooth surface meshing for automated finite element model generation from 3D image data, Journal of Biomechanics, Volume 39, Issue 7, 2006, Pages 1287-1295, ISSN 0021-9290, 10.1016/j.jbiomech.2005.03.006. (http://www.sciencedirect.com/science/article/pii/S0021929005001442) Parameters ---------- mesh : mesh FE mesh. n_iter : integer, optional Number of iteration steps. lam : float, optional Smoothing factor, see [1]. mu : float, optional Unshrinking factor, see [1]. weights : array, optional Edge weights, see [1]. bconstr: logical, optional Boundary constraints, if True only surface smoothing performed. volume_corr: logical, optional Correct volume after smoothing process. Returns ------- coors : array Coordinates of mesh nodes. """ def laplacian(coors, weights): n_nod = coors.shape[0] displ = (weights - sps.identity(n_nod)) * coors return displ def taubin(coors0, weights, lam, mu, n_iter): coors = coors0.copy() for ii in range(n_iter): displ = laplacian(coors, weights) if nm.mod(ii, 2) == 0: coors += lam * displ else: coors += mu * displ return coors def get_volume(el, nd): from sfepy.linalg.utils import dets_fast dim = nd.shape[1] nnd = el.shape[1] etype = '%d_%d' % (dim, nnd) if etype == '2_4' or etype == '3_8': el = elems_q2t(el) nel = el.shape[0] #bc = nm.zeros((dim, ), dtype=nm.double) mul = 1.0 / factorial(dim) if dim == 3: mul *= -1.0 mtx = nm.ones((nel, dim + 1, dim + 1), dtype=nm.double) mtx[:,:,:-1] = nd[el,:] vols = mul * dets_fast(mtx) vol = vols.sum() bc = nm.dot(vols, mtx.sum(1)[:,:-1] / nnd) bc /= vol return vol, bc from sfepy.base.timing import Timer output('smoothing...') timer = Timer(start=True) if weights is None: n_nod = mesh.n_nod domain = FEDomain('mesh', mesh) cmesh = domain.cmesh # initiate all vertices as inner - hierarchy = 2 node_group = nm.ones((n_nod,), dtype=nm.int16) * 2 # boundary vertices - set hierarchy = 4 if bconstr: # get "vertices of surface" facets = cmesh.get_surface_facets() f_verts = cmesh.get_incident(0, facets, cmesh.dim - 1) node_group[f_verts] = 4 # generate costs matrix e_verts = cmesh.get_conn(1, 0).indices fc1, fc2 = e_verts[0::2], e_verts[1::2] idxs = nm.where(node_group[fc2] >= node_group[fc1]) rows1 = fc1[idxs] cols1 = fc2[idxs] idxs = nm.where(node_group[fc1] >= node_group[fc2]) rows2 = fc2[idxs] cols2 = fc1[idxs] crows = nm.concatenate((rows1, rows2)) ccols = nm.concatenate((cols1, cols2)) costs = sps.coo_matrix((nm.ones_like(crows), (crows, ccols)), shape=(n_nod, n_nod), dtype=nm.double) # generate weights matrix idxs = list(range(n_nod)) aux = sps.coo_matrix((1.0 / nm.asarray(costs.sum(1)).squeeze(), (idxs, idxs)), shape=(n_nod, n_nod), dtype=nm.double) #aux.setdiag(1.0 / costs.sum(1)) weights = (aux.tocsc() * costs.tocsc()).tocsr() coors = taubin(mesh.coors, weights, lam, mu, n_iter) output('...done in %.2f s' % timer.stop()) if volume_corr: output('rescaling...') timer.start() volume0, bc = get_volume(mesh.conns[0], mesh.coors) volume, _ = get_volume(mesh.conns[0], coors) scale = volume0 / volume output('scale factor: %.2f' % scale) coors = (coors - bc) * scale + bc output('...done in %.2f s' % timer.stop()) return coors def expand2d(mesh2d, dist, rep): """ Expand 2D planar mesh into 3D volume, convert triangular/quad mesh to tetrahedrons/hexahedrons. Parameters ---------- mesh2d : Mesh The 2D mesh. dist : float The elements size in the 3rd direction. rep : int The number of elements in the 3rd direction. Returns ------- mesh3d : Mesh The 3D mesh. """ if len(mesh2d.descs) > 1: raise ValueError('More than one cell type (%s). Not supported!' % ', '.join(mesh2d.descs)) nel = mesh2d.n_el nnd = mesh2d.n_nod et = mesh2d.descs[0] coors = mesh2d.coors conn = mesh2d.get_conn(et) zcoor = nm.arange(rep + 1) * dist coors3d = nm.hstack([nm.tile(coors, (rep + 1, 1)), nm.tile(zcoor, (nnd,1)).T.flatten()[:,nm.newaxis]]) ngroups = nm.tile(mesh2d.cmesh.vertex_groups, (rep + 1,)) if et == '2_4': descs3d = '3_8' conn3d = nm.zeros((nel * rep, 8), dtype=nm.int32) mats3d = nm.tile(mesh2d.cmesh.cell_groups, (1, rep)).squeeze() elif et == '2_3': descs3d = '3_4' conn3d = nm.zeros((3 * nel * rep, 4), dtype=nm.int32) mats3d = nm.tile(mesh2d.cmesh.cell_groups, (1, 3 * rep)).squeeze() for ii in range(rep): bgn0 = nnd * ii bgn1 = bgn0 + nnd if et == '2_4': bge0 = nel * ii bge1 = bge0 + nel conn3d[bge0:bge1,:4] = conn + bgn0 conn3d[bge0:bge1,4:] = conn + bgn1 elif et == '2_3': # 0 1 2 5 bge0 = 3 * nel * ii bge1 = bge0 + nel conn3d[bge0:bge1,:] = nm.array([conn[:,0] + bgn0, conn[:,1] + bgn0, conn[:,2] + bgn0, conn[:,2] + bgn1]).T # 0 1 5 4 bge0 += nel bge1 += nel conn3d[bge0:bge1,:] = nm.array([conn[:,0] + bgn0, conn[:,1] + bgn0, conn[:,2] + bgn1, conn[:,1] + bgn1]).T # 0 4 5 3 bge0 += nel bge1 += nel conn3d[bge0:bge1,:] = nm.array([conn[:,0] + bgn0, conn[:,1] + bgn1, conn[:,2] + bgn1, conn[:,0] + bgn1]).T mesh3d = Mesh.from_data('mesh', coors3d, ngroups, [conn3d], [mats3d], [descs3d]) return mesh3d
4,886
784
<reponame>apaz4/jforgame-master<filename>jforgame-server/src/test/java/jforgame/server/redis/RedisTest.java package jforgame.server.redis; import static org.junit.Assert.assertTrue; import org.junit.Before; import org.junit.Test; import redis.clients.jedis.Jedis; public class RedisTest { Jedis jedis ; @Before public void init() { //连接本地的 Redis 服务 jedis = new Jedis("localhost"); } @Test public void testConnection() { System.out.println("connected succ"); System.out.println("服务正在运行: "+jedis.ping()); } @Test public void testSortedSet() { String key = "rank"; jedis.zremrangeByRank(key, 0, 100); jedis.zadd("rank", 0, "a"); jedis.zadd("rank", 0, "b"); jedis.zadd("rank", 0, "c"); jedis.zadd("rank", 5, "d"); jedis.zadd("rank", 2, "e"); assertTrue(jedis.zcount(key, 0, 100) == 5); } }
381
639
<reponame>sarojjethva/Learning-Resources package com.retrofitdemo.app; import com.retrofitdemo.api.response.StackOverflowUser; import java.util.List; /** * @author Rathod on 04-Feb-17. */ public interface MainActivityView { String getOrder(); void showEmptyOrderError(int error_empty_order); String getSortBy(); void showEmptySortByError(int error_empty_sortby); String getSite(); void showEmptySiteError(int error_empty_site); void getSOUserData(String order, String sortBy, String site); void setUserData(List<StackOverflowUser.Item> items); void showUserDataError(int error_no_response); void showEmptyUserList(int error_empty_user_list); }
283
543
/* * Copyright 2017 <NAME> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package de.mirkosertic.bytecoder.core; import java.util.Arrays; import java.util.stream.Collectors; public class BytecodeAttributes { private final BytecodeAttributeInfo[] attributes; private final BytecodeAnnotationAttributeInfo[] annotations; public BytecodeAttributes( BytecodeAttributeInfo[] aAttributes) { this.attributes = aAttributes; this.annotations = Arrays.stream(aAttributes).filter(t -> t instanceof BytecodeAnnotationAttributeInfo) .map(t -> (BytecodeAnnotationAttributeInfo) t).collect(Collectors.toList()).toArray(new BytecodeAnnotationAttributeInfo[0]); } public BytecodeAnnotation getAnnotationByType(String aTypeName) { for (BytecodeAnnotationAttributeInfo theAnnotationInfo : annotations) { BytecodeAnnotation theFound = theAnnotationInfo.getAnnotationByType(aTypeName); if (theFound != null) { return theFound; } } return null; } public <T extends BytecodeAttributeInfo> T getByType(Class<T> aType) { for (BytecodeAttributeInfo theInfo : attributes) { if (theInfo.getClass() == aType) { return (T) theInfo; } } return null; } }
658
356
package com.indeed.proctor.webapp.util; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import com.google.common.math.DoubleMath; import com.indeed.proctor.common.model.Allocation; import com.indeed.proctor.common.model.Range; import com.indeed.proctor.common.model.TestDefinition; import org.apache.commons.lang3.StringUtils; import org.apache.log4j.Logger; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; /** * @author xiaoyun */ public class AllocationIdUtil { private static final Logger LOGGER = Logger.getLogger(AllocationIdUtil.class); private static final Pattern ALLOCATION_ID_PATTERN = Pattern.compile("^#([A-Z]+)(\\d+)$"); public static String getAllocationName(final String allocId) { final Matcher matcher = ALLOCATION_ID_PATTERN.matcher(allocId); if (matcher.matches()) { return matcher.group(1); } else { throw new IllegalStateException("Allocation id format is incorrect " + allocId); } } // Allocation id comparator. Compare allocation ids with format like "#A1" public static final Comparator<String> ALLOCATION_ID_COMPARATOR = new Comparator<String>() { @Override public int compare(String o1, String o2) { // Remove prefix and version from allocation id Preconditions.checkArgument((o1.length() > 2 && o2.length() > 2), "Invalid allocation id, id1: %s, id2: %s", o1, o2); final String id1Str = getAllocationName(o1); final String id2Str = getAllocationName(o2); final int id1Int = convertBase26ToDecimal(id1Str.toCharArray()); final int id2Int = convertBase26ToDecimal(id2Str.toCharArray()); return id1Int - id2Int; } }; private static int getSegmentationChangeStartIndex(final TestDefinition previous, final TestDefinition current) { // Currently we can't change the order of allocations, we can only add or delete or update allocations, the following logic is based on this. // Test rule change if (!Objects.equals(previous.getRule(), current.getRule())) { // Update all allocation ids return 0; } // Test salt change if (!Objects.equals(previous.getSalt(), current.getSalt())) { // Update all allocation ids return 0; } // Allocation rule changed, or added / deleted allocations final List<Allocation> previousAllocations = previous.getAllocations(); final List<Allocation> currentAllocations = current.getAllocations(); for (int i = 0; i < Math.min(previousAllocations.size(), currentAllocations.size()); i++) { if (!currentAllocations.get(i).getId().equals(previousAllocations.get(i).getId()) || // Added / deleted allocations !Objects.equals(currentAllocations.get(i).getRule(), previousAllocations.get(i).getRule())) { // Allocation rule changed return i; } } // No change return -1; } public static Set<Allocation> getOutdatedAllocations(final TestDefinition previous, final TestDefinition current) { final boolean hasAllocId = current.getAllocations().stream().anyMatch( x -> !StringUtils.isEmpty(x.getId()) ); final Set<Allocation> outdatedAllocations = new HashSet<>(); // No existing allocation id, return if (!hasAllocId) { return outdatedAllocations; } // Check segmentation change final int updateFrom = getSegmentationChangeStartIndex(previous, current); if (updateFrom > -1) { for (int i = updateFrom; i < current.getAllocations().size(); i++) { if (!StringUtils.isEmpty(current.getAllocations().get(i).getId())) { outdatedAllocations.add(current.getAllocations().get(i)); } } } // Check unbalanced ratio change final int ratioCheckTo = updateFrom > -1 ? updateFrom : Math.min(previous.getAllocations().size(), current.getAllocations().size()); for (int i = 0; i < ratioCheckTo; i++) { if (isUnbalancedRatioChange(previous.getAllocations().get(i), current.getAllocations().get(i))) { outdatedAllocations.add(current.getAllocations().get(i)); } } return outdatedAllocations; } private static boolean isUnbalancedRatioChange(final Allocation previous, final Allocation current) { Map<Integer, Double> previousRatios = getBucketRatios(previous.getRanges()); Map<Integer, Double> currentRatios = getBucketRatios(current.getRanges()); final Map<Integer, Double> before = filterEmptyRatios(previousRatios); final Map<Integer, Double> after = filterEmptyRatios(currentRatios); if (!before.keySet().equals(after.keySet())) { return true; } if (before.isEmpty()) { return false; } final int firstBucket = before.keySet().iterator().next(); final double firstRatio = after.get(firstBucket) / before.get(firstBucket); for (final int bucket : before.keySet()) { final double ratio = after.get(bucket) / before.get(bucket); if (!DoubleMath.fuzzyEquals(ratio, firstRatio, 1e-6)) { return true; } } return false; } private static Map<Integer, Double> getBucketRatios(final List<Range> ranges) { final Map<Integer, Double> result = new HashMap<>(); for (final Range range : ranges) { final int bucket = range.getBucketValue(); final double length = range.getLength(); if ((bucket != -1) && !DoubleMath.fuzzyEquals(length, 0.0, 1e-6)) { final double total = result.getOrDefault(bucket, 0.0) + length; result.put(bucket, total); } } return ImmutableMap.copyOf(result); } private static Map<Integer, Double> filterEmptyRatios(final Map<Integer, Double> ratios) { return ratios.entrySet().stream() .filter(e -> e.getValue() > 0) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); } /** * @param allocId allocation id e.g. "#A1" * @return next version of allocId e.g "#A1" to "#A2" */ public static String getNextVersionOfAllocationId(final String allocId) { final Matcher matcher = ALLOCATION_ID_PATTERN.matcher(allocId); if (matcher.matches()) { final String formerPart = matcher.group(1); final int version = Integer.parseInt(matcher.group(2)); final int newVersion = version + 1; return "#" + formerPart + newVersion; } else { throw new IllegalStateException("Could not get the next version of allocation id for " + allocId); } } /** * @param index a base 10 integer * @param version version of the allocation id * @return the full allocaiton id. e.g. (26, 2) returns #BA2 */ public static String generateAllocationId(final int index, final int version) { return "#" + convertDecimalToBase26(index) + version; } private static String convertDecimalToBase26(final int n) { final StringBuilder res = new StringBuilder(); int number = n; for (; number >= 26; number /= 26) { final int current = number % 26; res.append(convertDigitToLetter(current)); } return res.append(convertDigitToLetter(number)).reverse().toString(); } public static int convertBase26ToDecimal(final char[] chars) { int sum = 0; for (int i = 0; i < chars.length; i++) { // 26 alphabetic sum = sum * 26 + convertLetterToDigit(chars[i]); } return sum; } private static char convertDigitToLetter(final int n) { Preconditions.checkArgument(n < 26, "Invalid number: %s, you can only convert number between 0 and 26 to letter", n); return (char) ('A' + n); } private static int convertLetterToDigit(final char c) { final int n = c - 'A'; Preconditions.checkArgument((n < 26 && n >= 0), "Invalid letter: %s, the letter should be upper case A -> Z", c); return n; } }
3,506
1,350
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. package com.microsoft.azure.servicebus.primitives; /** * This exception is thrown when a client attempts to create a sender or receiver or client to a non existent entity. * @since 1.0 * */ public class MessagingEntityNotFoundException extends ServiceBusException { private static final long serialVersionUID = -4624769494653591824L; public MessagingEntityNotFoundException() { super(false); } public MessagingEntityNotFoundException(String message) { super(false, message); } public MessagingEntityNotFoundException(Throwable cause) { super(false, cause); } public MessagingEntityNotFoundException(String message, Throwable cause) { super(false, message, cause); } }
257
589
package rocks.inspectit.server.diagnosis.engine.rule; import static com.google.common.base.Preconditions.checkNotNull; import java.lang.reflect.Array; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.Collection; import java.util.Collections; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import rocks.inspectit.server.diagnosis.engine.rule.annotation.Action; import rocks.inspectit.server.diagnosis.engine.rule.exception.RuleDefinitionException; import rocks.inspectit.server.diagnosis.engine.rule.exception.RuleExecutionException; import rocks.inspectit.server.diagnosis.engine.tag.Tag; import rocks.inspectit.server.diagnosis.engine.tag.Tags; import rocks.inspectit.server.diagnosis.engine.util.ReflectionUtils; /** * Represents the action method of a rule. An <code>ActionMethod</code> reflects the {@link Action} * annotation. * * @author <NAME>, <NAME> * @see Action */ public class ActionMethod { /** * The {@link Method} to be invoked. */ private final Method method; /** * The tag type this action produces. * * @see Action#resultTag() */ private final String resultTag; /** * The output Quantity. * * @see Action#resultQuantity() */ private final Action.Quantity resultQuantity; /** * Default Constructor. * * @param method * The method to be invoked * @param resultTag * The type of tags this action produces * @param resultQuantity * The result Quantity * @throws RuleDefinitionException * If the {@link ActionMethod} is invalid. The action method must be public, with * zero arguments and void return type. */ public ActionMethod(Method method, String resultTag, Action.Quantity resultQuantity) throws RuleDefinitionException { this.method = checkNotNull(method, "The method must not be null."); this.resultTag = checkNotNull(resultTag, "The result tag must not be null."); this.resultQuantity = checkNotNull(resultQuantity, "The output quantity must not be null."); validate(); } // ------------------------------------------------------------- // Methods: RuleExecution // ------------------------------------------------------------- /** * Executes the action. Throws: RuleExecutionException in case of any error * * @param context * The current executing {@link ExecutionContext} * @return A collection of {@link Tags}s * @throws RuleExecutionException * If rule execution fails with an exception. * @see ExecutionContext * @see Tag */ public Collection<Tag> execute(ExecutionContext context) throws RuleExecutionException { try { Object result = ReflectionUtils.invokeMethod(getMethod(), context.getInstance()); return transform(result, context); } catch (Exception e) { throw new RuleExecutionException("Failed to invoke action method (" + getMethod().getName() + ")", context, e); } } /** * Validates the properties of the {@link ActionMethod}. * * @throws RuleDefinitionException * If the {@link ActionMethod} is invalid. The action method must be public, with * zero arguments and void return type. */ private void validate() throws RuleDefinitionException { boolean valid = Modifier.isPublic(method.getModifiers()); Class<?> returnType = method.getReturnType(); valid = valid && !returnType.equals(Void.class); valid = valid && (method.getParameterTypes().length == 0); if (!valid) { String msg = method.getDeclaringClass().getName() + " defines an invalid action method with name: " + method.getName(); msg += "\nValid action methods are public with a non void return type and zero arguments (e.g. public" + " String action())"; throw new RuleDefinitionException(msg); } // ensure proper return type in case of MULTIPLE outputQuantity if (Action.Quantity.MULTIPLE.equals(resultQuantity)) { if (!returnType.isArray() && !Iterable.class.isAssignableFrom(returnType)) { throw new RuleDefinitionException(method.getDeclaringClass().getName() + " defines an MULTIPLE outputQuantity, but return type is neither Array nor Collection."); } } } /** * Transforms the result of a rule to a collection of {@link Tag}s. How the result is * transformed is controlled by the #resultQuantity property. * * @param result * The result to be transformed * @param context * The {@link ExecutionContext} enclosing this execution * @return A collection of {@link Tag}s * @throws RuleExecutionException * If rule return type does not match. * @see Tag * @see ExecutionContext */ private Collection<Tag> transform(Object result, ExecutionContext context) throws RuleExecutionException { if (result == null) { return Collections.emptyList(); } else { Collection<Tag> transformed = Lists.newArrayList(); switch (getResultQuantity()) { case MULTIPLE: Object[] values; if (result.getClass().isArray()) { values = getObjectArray(result); } else if (result instanceof Iterable<?>) { values = Iterables.toArray((Iterable<?>) result, Object.class); } else { throw new RuleExecutionException("If resultQuantity is MULTIPLE ensure that either an Array or a Collection is defined as return value", context); } transformed.addAll(Tags.tags(getResultTag(), context.getRuleInput().getRoot(), values)); break; case SINGLE: default: transformed.add(Tags.tag(getResultTag(), result, context.getRuleInput().getRoot())); } return transformed; } } /** * Converts the result to an Object array depending on the component type of the array. * * @param result * Object representing the result array. * @return Object array */ private Object[] getObjectArray(Object result) { if (result.getClass().getComponentType().isPrimitive()) { int length = Array.getLength(result); Object[] array = new Object[length]; for (int i = 0; i < length; ++i) { array[i] = Array.get(result, i); } return array; } else { return (Object[]) result; } } // -------------------------------------------------------------u // Methods: Accessors // ------------------------------------------------------------- /** * Gets {@link #method}. * * @return {@link #method} */ public Method getMethod() { return method; } /** * Gets {@link #resultTag}. * * @return {@link #resultTag} */ public String getResultTag() { return resultTag; } /** * Gets {@link #resultQuantity}. * * @return {@link #resultQuantity} */ public Action.Quantity getResultQuantity() { return resultQuantity; } // ------------------------------------------------------------- // Methods: Generated // ------------------------------------------------------------- /** * {@inheritDoc} */ @Override public String toString() { return "ActionMethod{" + "method=" + method + ", resultTag='" + resultTag + '\'' + ", resultQuantity=" + resultQuantity + '}'; } /** * {@inheritDoc} */ @Override public int hashCode() { final int prime = 31; int result = 1; result = (prime * result) + ((this.method == null) ? 0 : this.method.hashCode()); result = (prime * result) + ((this.resultQuantity == null) ? 0 : this.resultQuantity.hashCode()); result = (prime * result) + ((this.resultTag == null) ? 0 : this.resultTag.hashCode()); return result; } /** * {@inheritDoc} */ @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ActionMethod other = (ActionMethod) obj; if (this.method == null) { if (other.method != null) { return false; } } else if (!this.method.equals(other.method)) { return false; } if (this.resultQuantity != other.resultQuantity) { return false; } if (this.resultTag == null) { if (other.resultTag != null) { return false; } } else if (!this.resultTag.equals(other.resultTag)) { return false; } return true; } }
2,662
416
<reponame>ljz663/tencentcloud-sdk-java /* * Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tencentcloudapi.oceanus.v20190422.models; import com.tencentcloudapi.common.AbstractModel; import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.Expose; import java.util.HashMap; public class ResourceConfigItem extends AbstractModel{ /** * 资源ID */ @SerializedName("ResourceId") @Expose private String ResourceId; /** * 资源类型 */ @SerializedName("ResourceType") @Expose private Long ResourceType; /** * 资源所属地域 */ @SerializedName("Region") @Expose private String Region; /** * 资源所属AppId */ @SerializedName("AppId") @Expose private Long AppId; /** * 主账号Uin */ @SerializedName("OwnerUin") @Expose private String OwnerUin; /** * 子账号Uin */ @SerializedName("CreatorUin") @Expose private String CreatorUin; /** * 资源位置描述 */ @SerializedName("ResourceLoc") @Expose private ResourceLoc ResourceLoc; /** * 资源创建时间 */ @SerializedName("CreateTime") @Expose private String CreateTime; /** * 资源版本 */ @SerializedName("Version") @Expose private Long Version; /** * 资源描述 */ @SerializedName("Remark") @Expose private String Remark; /** * 资源状态:0: 资源同步中,1:资源已就绪 注意:此字段可能返回 null,表示取不到有效值。 */ @SerializedName("Status") @Expose private Long Status; /** * 关联作业个数 注意:此字段可能返回 null,表示取不到有效值。 */ @SerializedName("RefJobCount") @Expose private Long RefJobCount; /** * Get 资源ID * @return ResourceId 资源ID */ public String getResourceId() { return this.ResourceId; } /** * Set 资源ID * @param ResourceId 资源ID */ public void setResourceId(String ResourceId) { this.ResourceId = ResourceId; } /** * Get 资源类型 * @return ResourceType 资源类型 */ public Long getResourceType() { return this.ResourceType; } /** * Set 资源类型 * @param ResourceType 资源类型 */ public void setResourceType(Long ResourceType) { this.ResourceType = ResourceType; } /** * Get 资源所属地域 * @return Region 资源所属地域 */ public String getRegion() { return this.Region; } /** * Set 资源所属地域 * @param Region 资源所属地域 */ public void setRegion(String Region) { this.Region = Region; } /** * Get 资源所属AppId * @return AppId 资源所属AppId */ public Long getAppId() { return this.AppId; } /** * Set 资源所属AppId * @param AppId 资源所属AppId */ public void setAppId(Long AppId) { this.AppId = AppId; } /** * Get 主账号Uin * @return OwnerUin 主账号Uin */ public String getOwnerUin() { return this.OwnerUin; } /** * Set 主账号Uin * @param OwnerUin 主账号Uin */ public void setOwnerUin(String OwnerUin) { this.OwnerUin = OwnerUin; } /** * Get 子账号Uin * @return CreatorUin 子账号Uin */ public String getCreatorUin() { return this.CreatorUin; } /** * Set 子账号Uin * @param CreatorUin 子账号Uin */ public void setCreatorUin(String CreatorUin) { this.CreatorUin = CreatorUin; } /** * Get 资源位置描述 * @return ResourceLoc 资源位置描述 */ public ResourceLoc getResourceLoc() { return this.ResourceLoc; } /** * Set 资源位置描述 * @param ResourceLoc 资源位置描述 */ public void setResourceLoc(ResourceLoc ResourceLoc) { this.ResourceLoc = ResourceLoc; } /** * Get 资源创建时间 * @return CreateTime 资源创建时间 */ public String getCreateTime() { return this.CreateTime; } /** * Set 资源创建时间 * @param CreateTime 资源创建时间 */ public void setCreateTime(String CreateTime) { this.CreateTime = CreateTime; } /** * Get 资源版本 * @return Version 资源版本 */ public Long getVersion() { return this.Version; } /** * Set 资源版本 * @param Version 资源版本 */ public void setVersion(Long Version) { this.Version = Version; } /** * Get 资源描述 * @return Remark 资源描述 */ public String getRemark() { return this.Remark; } /** * Set 资源描述 * @param Remark 资源描述 */ public void setRemark(String Remark) { this.Remark = Remark; } /** * Get 资源状态:0: 资源同步中,1:资源已就绪 注意:此字段可能返回 null,表示取不到有效值。 * @return Status 资源状态:0: 资源同步中,1:资源已就绪 注意:此字段可能返回 null,表示取不到有效值。 */ public Long getStatus() { return this.Status; } /** * Set 资源状态:0: 资源同步中,1:资源已就绪 注意:此字段可能返回 null,表示取不到有效值。 * @param Status 资源状态:0: 资源同步中,1:资源已就绪 注意:此字段可能返回 null,表示取不到有效值。 */ public void setStatus(Long Status) { this.Status = Status; } /** * Get 关联作业个数 注意:此字段可能返回 null,表示取不到有效值。 * @return RefJobCount 关联作业个数 注意:此字段可能返回 null,表示取不到有效值。 */ public Long getRefJobCount() { return this.RefJobCount; } /** * Set 关联作业个数 注意:此字段可能返回 null,表示取不到有效值。 * @param RefJobCount 关联作业个数 注意:此字段可能返回 null,表示取不到有效值。 */ public void setRefJobCount(Long RefJobCount) { this.RefJobCount = RefJobCount; } public ResourceConfigItem() { } /** * NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy, * and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy. */ public ResourceConfigItem(ResourceConfigItem source) { if (source.ResourceId != null) { this.ResourceId = new String(source.ResourceId); } if (source.ResourceType != null) { this.ResourceType = new Long(source.ResourceType); } if (source.Region != null) { this.Region = new String(source.Region); } if (source.AppId != null) { this.AppId = new Long(source.AppId); } if (source.OwnerUin != null) { this.OwnerUin = new String(source.OwnerUin); } if (source.CreatorUin != null) { this.CreatorUin = new String(source.CreatorUin); } if (source.ResourceLoc != null) { this.ResourceLoc = new ResourceLoc(source.ResourceLoc); } if (source.CreateTime != null) { this.CreateTime = new String(source.CreateTime); } if (source.Version != null) { this.Version = new Long(source.Version); } if (source.Remark != null) { this.Remark = new String(source.Remark); } if (source.Status != null) { this.Status = new Long(source.Status); } if (source.RefJobCount != null) { this.RefJobCount = new Long(source.RefJobCount); } } /** * Internal implementation, normal users should not use it. */ public void toMap(HashMap<String, String> map, String prefix) { this.setParamSimple(map, prefix + "ResourceId", this.ResourceId); this.setParamSimple(map, prefix + "ResourceType", this.ResourceType); this.setParamSimple(map, prefix + "Region", this.Region); this.setParamSimple(map, prefix + "AppId", this.AppId); this.setParamSimple(map, prefix + "OwnerUin", this.OwnerUin); this.setParamSimple(map, prefix + "CreatorUin", this.CreatorUin); this.setParamObj(map, prefix + "ResourceLoc.", this.ResourceLoc); this.setParamSimple(map, prefix + "CreateTime", this.CreateTime); this.setParamSimple(map, prefix + "Version", this.Version); this.setParamSimple(map, prefix + "Remark", this.Remark); this.setParamSimple(map, prefix + "Status", this.Status); this.setParamSimple(map, prefix + "RefJobCount", this.RefJobCount); } }
4,731
423
''' Functions and classes to observe or add ground statements. Examples -------- The following example shows how to add a fact to a program via the backend and observe the corresponding rule passed to the backend: >>> from clingo.symbol import Function >>> from clingo.control import Control >>> >>> class Observer: ... def rule(self, choice, head, body): ... print("rule:", choice, head, body) ... >>> ctl = Control() >>> ctl.register_observer(Observer()) >>> >>> sym_a = Function("a") >>> with ctl.backend() as backend: ... atm_a = backend.add_atom(sym_a) ... backend.add_rule([atm_a]) ... rule: False [1] [] >>> ctl.symbolic_atoms[sym_a].is_fact True >>> >>> print(ctl.solve(on_model=print)) a SAT ''' from typing import ContextManager, Sequence, Optional, Tuple from enum import Enum from abc import ABCMeta from ._internal import _c_call, _cb_error_handler, _ffi, _handle_error, _lib, _to_str from .core import TruthValue from .symbol import Symbol __all__ = [ 'Backend', 'HeuristicType', 'Observer' ] class HeuristicType(Enum): ''' Enumeration of the different heuristic types. ''' Factor = _lib.clingo_heuristic_type_factor ''' Heuristic modification to set the decaying factor of an atom. ''' False_ = _lib.clingo_heuristic_type_false ''' Heuristic modification to make an atom false. ''' Init = _lib.clingo_heuristic_type_init ''' Heuristic modification to set the inital score of an atom. ''' Level = _lib.clingo_heuristic_type_level ''' Heuristic modification to set the level of an atom. ''' Sign = _lib.clingo_heuristic_type_sign ''' Heuristic modification to set the sign of an atom. ''' True_ = _lib.clingo_heuristic_type_true ''' Heuristic modification to make an atom true. ''' class Observer(metaclass=ABCMeta): ''' Interface that has to be implemented to inspect rules produced during grounding. See Also -------- clingo.control.Control.register_observer Notes ----- Not all functions the `Observer` interface have to be implemented and can be omitted if not needed. ''' def init_program(self, incremental: bool) -> None: ''' Called once in the beginning. Parameters ---------- incremental Whether the program is incremental. If the incremental flag is true, there can be multiple calls to `clingo.control.Control.solve`. ''' def begin_step(self) -> None: ''' Marks the beginning of a block of directives passed to the solver. ''' def rule(self, choice: bool, head: Sequence[int], body: Sequence[int]) -> None: ''' Observe rules passed to the solver. Parameters ---------- choice Determines if the head is a choice or a disjunction. head List of program atoms forming the rule head. body List of program literals forming the rule body. ''' def weight_rule(self, choice: bool, head: Sequence[int], lower_bound: int, body: Sequence[Tuple[int,int]]) -> None: ''' Observe rules with one weight constraint in the body passed to the solver. Parameters ---------- choice Determines if the head is a choice or a disjunction. head List of program atoms forming the head of the rule. lower_bound The lower bound of the weight constraint in the rule body. body List of weighted literals (pairs of literal and weight) forming the elements of the weight constraint. ''' def minimize(self, priority: int, literals: Sequence[Tuple[int,int]]) -> None: ''' Observe minimize directives (or weak constraints) passed to the solver. Parameters ---------- priority The priority of the directive. literals List of weighted literals whose sum to minimize (pairs of literal and weight). ''' def project(self, atoms: Sequence[int]) -> None: ''' Observe projection directives passed to the solver. Parameters ---------- atoms The program atoms to project on. ''' def output_atom(self, symbol: Symbol, atom: int) -> None: ''' Observe shown atoms passed to the solver. Facts do not have an associated program atom. The value of the atom is set to zero. Parameters ---------- symbol The symbolic representation of the atom. atom The associated program atom (`0` for facts). ''' def output_term(self, symbol: Symbol, condition: Sequence[int]) -> None: ''' Observe shown terms passed to the solver. Parameters ---------- symbol The symbolic representation of the term. condition List of program literals forming the condition when to show the term. ''' def output_csp(self, symbol: Symbol, value: int, condition: Sequence[int]) -> None: ''' Observe shown csp variables passed to the solver. Parameters ---------- symbol The symbolic representation of the variable. value The integer value of the variable. condition List of program literals forming the condition when to show the variable with its value. ''' def external(self, atom: int, value: TruthValue) -> None: ''' Observe external statements passed to the solver. Parameters ---------- atom The external atom in form of a program literal. value The truth value of the external statement. ''' def assume(self, literals: Sequence[int]) -> None: ''' Observe assumption directives passed to the solver. Parameters ---------- literals The program literals to assume (positive literals are true and negative literals false for the next solve call). ''' def heuristic(self, atom: int, type_: HeuristicType, bias: int, priority: int, condition: Sequence[int]) -> None: ''' Observe heuristic directives passed to the solver. Parameters ---------- atom The program atom heuristically modified. type_ The type of the modification. bias A signed integer. priority An unsigned integer. condition List of program literals. ''' def acyc_edge(self, node_u: int, node_v: int, condition: Sequence[int]) -> None: ''' Observe edge directives passed to the solver. Parameters ---------- node_u The start vertex of the edge (in form of an integer). node_v Тhe end vertex of the edge (in form of an integer). condition The list of program literals forming th condition under which to add the edge. ''' def theory_term_number(self, term_id: int, number: int) -> None: ''' Observe numeric theory terms. Parameters ---------- term_id The id of the term. number The value of the term. ''' def theory_term_string(self, term_id : int, name : str) -> None: ''' Observe string theory terms. Parameters ---------- term_id The id of the term. name The string value of the term. ''' def theory_term_compound(self, term_id: int, name_id_or_type: int, arguments: Sequence[int]) -> None: ''' Observe compound theory terms. Parameters ---------- term_id The id of the term. name_id_or_type The name id or type of the term where the value `-1` stands for tuples, `-2` for sets, `-3` for lists, or otherwise for the id of the name (in form of a string term). arguments The arguments of the term in form of a list of term ids. ''' def theory_element(self, element_id: int, terms: Sequence[int], condition: Sequence[int]) -> None: ''' Observe theory elements. Parameters ---------- element_id The id of the element. terms The term tuple of the element in form of a list of term ids. condition The list of program literals forming the condition. ''' def theory_atom(self, atom_id_or_zero: int, term_id: int, elements: Sequence[int]) -> None: ''' Observe theory atoms without guard. Parameters ---------- atom_id_or_zero The id of the atom or zero for directives. term_id The term associated with the atom. elements The elements of the atom in form of a list of element ids. ''' def theory_atom_with_guard(self, atom_id_or_zero: int, term_id: int, elements: Sequence[int], operator_id: int, right_hand_side_id: int) -> None: ''' Observe theory atoms with guard. Parameters ---------- atom_id_or_zero The id of the atom or zero for directives. term_id : int The term associated with the atom. elements The elements of the atom in form of a list of element ids. operator_id The id of the operator (a string term). right_hand_side_id The id of the term on the right hand side of the atom. ''' def end_step(self) -> None: ''' Marks the end of a block of directives passed to the solver. This function is called right before solving starts. ''' @_ffi.def_extern(onerror=_cb_error_handler('data'), name='pyclingo_observer_init_program') def _pyclingo_observer_init_program(incremental, data): observer: Observer = _ffi.from_handle(data).data observer.init_program(incremental) return True @_ffi.def_extern(onerror=_cb_error_handler('data'), name='pyclingo_observer_begin_step') def _pyclingo_observer_begin_step(data): observer: Observer = _ffi.from_handle(data).data observer.begin_step() return True @_ffi.def_extern(onerror=_cb_error_handler('data'), name='pyclingo_observer_end_step') def _pyclingo_observer_end_step(data): observer: Observer = _ffi.from_handle(data).data observer.end_step() return True @_ffi.def_extern(onerror=_cb_error_handler('data'), name='pyclingo_observer_rule') def _pyclingo_observer_rule(choice, head, head_size, body, body_size, data): observer: Observer = _ffi.from_handle(data).data observer.rule( choice, [ head[i] for i in range(head_size) ], [ body[i] for i in range(body_size) ]) return True @_ffi.def_extern(onerror=_cb_error_handler('data'), name='pyclingo_observer_weight_rule') def _pyclingo_observer_weight_rule(choice, head, head_size, lower_bound, body, body_size, data): observer: Observer = _ffi.from_handle(data).data observer.weight_rule( choice, [ head[i] for i in range(head_size) ], lower_bound, [ (body[i].literal, body[i].weight) for i in range(body_size) ]) return True @_ffi.def_extern(onerror=_cb_error_handler('data'), name='pyclingo_observer_minimize') def _pyclingo_observer_minimize(priority, literals, size, data): observer: Observer = _ffi.from_handle(data).data observer.minimize(priority, [ (literals[i].literal, literals[i].weight) for i in range(size) ]) return True @_ffi.def_extern(onerror=_cb_error_handler('data'), name='pyclingo_observer_project') def _pyclingo_observer_project(atoms, size, data): observer: Observer = _ffi.from_handle(data).data observer.project([ atoms[i] for i in range(size) ]) return True @_ffi.def_extern(onerror=_cb_error_handler('data'), name='pyclingo_observer_output_atom') def _pyclingo_observer_output_atom(symbol, atom, data): observer: Observer = _ffi.from_handle(data).data observer.output_atom(Symbol(symbol), atom) return True @_ffi.def_extern(onerror=_cb_error_handler('data'), name='pyclingo_observer_output_term') def _pyclingo_observer_output_term(symbol, condition, size, data): observer: Observer = _ffi.from_handle(data).data observer.output_term(Symbol(symbol), [ condition[i] for i in range(size) ]) return True @_ffi.def_extern(onerror=_cb_error_handler('data'), name='pyclingo_observer_output_csp') def _pyclingo_observer_output_csp(symbol, value, condition, size, data): observer: Observer = _ffi.from_handle(data).data observer.output_csp(Symbol(symbol), value, [ condition[i] for i in range(size) ]) return True @_ffi.def_extern(onerror=_cb_error_handler('data'), name='pyclingo_observer_external') def _pyclingo_observer_external(atom, type_, data): observer: Observer = _ffi.from_handle(data).data observer.external(atom, TruthValue(type_)) return True @_ffi.def_extern(onerror=_cb_error_handler('data'), name='pyclingo_observer_assume') def _pyclingo_observer_assume(literals, size, data): observer: Observer = _ffi.from_handle(data).data observer.assume([ literals[i] for i in range(size) ]) return True @_ffi.def_extern(onerror=_cb_error_handler('data'), name='pyclingo_observer_heuristic') def _pyclingo_observer_heuristic(atom, type_, bias, priority, condition, size, data): observer: Observer = _ffi.from_handle(data).data observer.heuristic(atom, HeuristicType(type_), bias, priority, [ condition[i] for i in range(size) ]) return True @_ffi.def_extern(onerror=_cb_error_handler('data'), name='pyclingo_observer_acyc_edge') def _pyclingo_observer_acyc_edge(node_u, node_v, condition, size, data): observer: Observer = _ffi.from_handle(data).data observer.acyc_edge(node_u, node_v, [ condition[i] for i in range(size) ]) return True @_ffi.def_extern(onerror=_cb_error_handler('data'), name='pyclingo_observer_theory_term_number') def _pyclingo_observer_theory_term_number(term_id, number, data): observer: Observer = _ffi.from_handle(data).data observer.theory_term_number(term_id, number) return True @_ffi.def_extern(onerror=_cb_error_handler('data'), name='pyclingo_observer_theory_term_string') def _pyclingo_observer_theory_term_string(term_id, name, data): observer: Observer = _ffi.from_handle(data).data observer.theory_term_string(term_id, _to_str(name)) return True @_ffi.def_extern(onerror=_cb_error_handler('data'), name='pyclingo_observer_theory_term_compound') def _pyclingo_observer_theory_term_compound(term_id, name_id_or_type, arguments, size, data): observer: Observer = _ffi.from_handle(data).data observer.theory_term_compound(term_id, name_id_or_type, [ arguments[i] for i in range(size) ]) return True @_ffi.def_extern(onerror=_cb_error_handler('data'), name='pyclingo_observer_theory_element') def _pyclingo_observer_theory_element(element_id, terms, terms_size, condition, condition_size, data): observer: Observer = _ffi.from_handle(data).data observer.theory_element( element_id, [ terms[i] for i in range(terms_size) ], [ condition[i] for i in range(condition_size) ]) return True @_ffi.def_extern(onerror=_cb_error_handler('data'), name='pyclingo_observer_theory_atom') def _pyclingo_observer_theory_atom(atom_id_or_zero, term_id, elements, size, data): observer: Observer = _ffi.from_handle(data).data observer.theory_atom(atom_id_or_zero, term_id, [ elements[i] for i in range(size) ]) return True @_ffi.def_extern(onerror=_cb_error_handler('data'), name='pyclingo_observer_theory_atom_with_guard') def _pyclingo_observer_theory_atom_with_guard(atom_id_or_zero, term_id, elements, size, operator_id, right_hand_side_id, data): observer: Observer = _ffi.from_handle(data).data observer.theory_atom_with_guard( atom_id_or_zero, term_id, [ elements[i] for i in range(size) ], operator_id, right_hand_side_id) return True class Backend(ContextManager['Backend']): ''' Backend object providing a low level interface to extend a logic program. This class allows for adding statements in ASPIF format. See Also -------- clingo.control.Control.backend Notes ----- The `Backend` is a context manager and must be used with Python's `with` statement. ''' def __init__(self, rep, error): self._rep = rep self._error = error def __enter__(self): self._error.clear() _handle_error(_lib.clingo_backend_begin(self._rep), handler=self._error) return self def __exit__(self, exc_type, exc_val, exc_tb): self._error.clear() _handle_error(_lib.clingo_backend_end(self._rep), handler=self._error) return False def add_acyc_edge(self, node_u: int, node_v: int, condition: Sequence[int]) -> None: ''' Add an edge directive to the program. Parameters ---------- node_u The start node represented as an unsigned integer. node_v The end node represented as an unsigned integer. condition List of program literals. ''' _handle_error(_lib.clingo_backend_acyc_edge(self._rep, node_u, node_v, condition, len(condition))) def add_assume(self, literals: Sequence[int]) -> None: ''' Add assumptions to the program. Parameters ---------- literals The list of literals to assume true. ''' _handle_error(_lib.clingo_backend_assume(self._rep, literals, len(literals))) def add_atom(self, symbol: Optional[Symbol]=None) -> int: ''' Return a fresh program atom or the atom associated with the given symbol. If the given symbol does not exist in the atom base, it is added first. Such atoms will be used in subequents calls to ground for instantiation. Parameters ---------- symbol The symbol associated with the atom. Returns ------- The program atom representing the atom. ''' # pylint: disable=protected-access if symbol is None: p_sym = _ffi.NULL else: p_sym = _ffi.new('clingo_symbol_t*', symbol._rep) self._error.clear() return _c_call('clingo_atom_t', _lib.clingo_backend_add_atom, self._rep, p_sym, handler=self._error) def add_external(self, atom : int, value : TruthValue=TruthValue.False_) -> None: ''' Mark a program atom as external optionally fixing its truth value. Parameters ---------- atom The program atom to mark as external. value Optional truth value. Notes ----- Can also be used to release an external atom using `TruthValue.Release`. ''' _handle_error(_lib.clingo_backend_external(self._rep, atom, value.value)) def add_heuristic(self, atom: int, type_: HeuristicType, bias: int, priority: int, condition: Sequence[int]) -> None: ''' Add a heuristic directive to the program. Parameters ---------- atom Program atom to heuristically modify. type_ The type of modification. bias A signed integer. priority An unsigned integer. condition List of program literals. ''' _handle_error(_lib.clingo_backend_heuristic(self._rep, atom, type_.value, bias, priority, condition, len(condition))) def add_minimize(self, priority: int, literals: Sequence[Tuple[int,int]]) -> None: ''' Add a minimize constraint to the program. Parameters ---------- priority Integer for the priority. literals List of pairs of program literals and weights. ''' _handle_error(_lib.clingo_backend_minimize(self._rep, priority, literals, len(literals))) def add_project(self, atoms: Sequence[int]) -> None: ''' Add a project statement to the program. Parameters ---------- atoms List of program atoms to project on. ''' _handle_error(_lib.clingo_backend_project(self._rep, atoms, len(atoms))) def add_rule(self, head: Sequence[int], body: Sequence[int]=[], choice: bool=False) -> None: ''' Add a disjuntive or choice rule to the program. Parameters ---------- head The program atoms forming the rule head. body The program literals forming the rule body. choice Whether to add a disjunctive or choice rule. Notes ----- Integrity constraints and normal rules can be added by using an empty or singleton head list, respectively. ''' # pylint: disable=dangerous-default-value _handle_error(_lib.clingo_backend_rule(self._rep, choice, head, len(head), body, len(body))) def add_weight_rule(self, head: Sequence[int], lower: int, body: Sequence[Tuple[int,int]], choice: bool=False) -> None: ''' Add a disjuntive or choice rule with one weight constraint with a lower bound in the body to the program. Parameters ---------- head The program atoms forming the rule head. lower The lower bound. body The pairs of program literals and weights forming the elements of the weight constraint. choice Whether to add a disjunctive or choice rule. ''' _handle_error(_lib.clingo_backend_weight_rule(self._rep, choice, head, len(head), lower, body, len(body)))
9,475
3,372
/* * Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.simplesystemsmanagement.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateMaintenanceWindowTarget" target="_top">AWS * API Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class UpdateMaintenanceWindowTargetRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** * <p> * The maintenance window ID with which to modify the target. * </p> */ private String windowId; /** * <p> * The target ID to modify. * </p> */ private String windowTargetId; /** * <p> * The targets to add or replace. * </p> */ private com.amazonaws.internal.SdkInternalList<Target> targets; /** * <p> * User-provided value that will be included in any Amazon CloudWatch Events events raised while running tasks for * these targets in this maintenance window. * </p> */ private String ownerInformation; /** * <p> * A name for the update. * </p> */ private String name; /** * <p> * An optional description for the update. * </p> */ private String description; /** * <p> * If <code>True</code>, then all fields that are required by the <a>RegisterTargetWithMaintenanceWindow</a> * operation are also required for this API request. Optional fields that aren't specified are set to null. * </p> */ private Boolean replace; /** * <p> * The maintenance window ID with which to modify the target. * </p> * * @param windowId * The maintenance window ID with which to modify the target. */ public void setWindowId(String windowId) { this.windowId = windowId; } /** * <p> * The maintenance window ID with which to modify the target. * </p> * * @return The maintenance window ID with which to modify the target. */ public String getWindowId() { return this.windowId; } /** * <p> * The maintenance window ID with which to modify the target. * </p> * * @param windowId * The maintenance window ID with which to modify the target. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateMaintenanceWindowTargetRequest withWindowId(String windowId) { setWindowId(windowId); return this; } /** * <p> * The target ID to modify. * </p> * * @param windowTargetId * The target ID to modify. */ public void setWindowTargetId(String windowTargetId) { this.windowTargetId = windowTargetId; } /** * <p> * The target ID to modify. * </p> * * @return The target ID to modify. */ public String getWindowTargetId() { return this.windowTargetId; } /** * <p> * The target ID to modify. * </p> * * @param windowTargetId * The target ID to modify. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateMaintenanceWindowTargetRequest withWindowTargetId(String windowTargetId) { setWindowTargetId(windowTargetId); return this; } /** * <p> * The targets to add or replace. * </p> * * @return The targets to add or replace. */ public java.util.List<Target> getTargets() { if (targets == null) { targets = new com.amazonaws.internal.SdkInternalList<Target>(); } return targets; } /** * <p> * The targets to add or replace. * </p> * * @param targets * The targets to add or replace. */ public void setTargets(java.util.Collection<Target> targets) { if (targets == null) { this.targets = null; return; } this.targets = new com.amazonaws.internal.SdkInternalList<Target>(targets); } /** * <p> * The targets to add or replace. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setTargets(java.util.Collection)} or {@link #withTargets(java.util.Collection)} if you want to override * the existing values. * </p> * * @param targets * The targets to add or replace. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateMaintenanceWindowTargetRequest withTargets(Target... targets) { if (this.targets == null) { setTargets(new com.amazonaws.internal.SdkInternalList<Target>(targets.length)); } for (Target ele : targets) { this.targets.add(ele); } return this; } /** * <p> * The targets to add or replace. * </p> * * @param targets * The targets to add or replace. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateMaintenanceWindowTargetRequest withTargets(java.util.Collection<Target> targets) { setTargets(targets); return this; } /** * <p> * User-provided value that will be included in any Amazon CloudWatch Events events raised while running tasks for * these targets in this maintenance window. * </p> * * @param ownerInformation * User-provided value that will be included in any Amazon CloudWatch Events events raised while running * tasks for these targets in this maintenance window. */ public void setOwnerInformation(String ownerInformation) { this.ownerInformation = ownerInformation; } /** * <p> * User-provided value that will be included in any Amazon CloudWatch Events events raised while running tasks for * these targets in this maintenance window. * </p> * * @return User-provided value that will be included in any Amazon CloudWatch Events events raised while running * tasks for these targets in this maintenance window. */ public String getOwnerInformation() { return this.ownerInformation; } /** * <p> * User-provided value that will be included in any Amazon CloudWatch Events events raised while running tasks for * these targets in this maintenance window. * </p> * * @param ownerInformation * User-provided value that will be included in any Amazon CloudWatch Events events raised while running * tasks for these targets in this maintenance window. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateMaintenanceWindowTargetRequest withOwnerInformation(String ownerInformation) { setOwnerInformation(ownerInformation); return this; } /** * <p> * A name for the update. * </p> * * @param name * A name for the update. */ public void setName(String name) { this.name = name; } /** * <p> * A name for the update. * </p> * * @return A name for the update. */ public String getName() { return this.name; } /** * <p> * A name for the update. * </p> * * @param name * A name for the update. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateMaintenanceWindowTargetRequest withName(String name) { setName(name); return this; } /** * <p> * An optional description for the update. * </p> * * @param description * An optional description for the update. */ public void setDescription(String description) { this.description = description; } /** * <p> * An optional description for the update. * </p> * * @return An optional description for the update. */ public String getDescription() { return this.description; } /** * <p> * An optional description for the update. * </p> * * @param description * An optional description for the update. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateMaintenanceWindowTargetRequest withDescription(String description) { setDescription(description); return this; } /** * <p> * If <code>True</code>, then all fields that are required by the <a>RegisterTargetWithMaintenanceWindow</a> * operation are also required for this API request. Optional fields that aren't specified are set to null. * </p> * * @param replace * If <code>True</code>, then all fields that are required by the <a>RegisterTargetWithMaintenanceWindow</a> * operation are also required for this API request. Optional fields that aren't specified are set to null. */ public void setReplace(Boolean replace) { this.replace = replace; } /** * <p> * If <code>True</code>, then all fields that are required by the <a>RegisterTargetWithMaintenanceWindow</a> * operation are also required for this API request. Optional fields that aren't specified are set to null. * </p> * * @return If <code>True</code>, then all fields that are required by the <a>RegisterTargetWithMaintenanceWindow</a> * operation are also required for this API request. Optional fields that aren't specified are set to null. */ public Boolean getReplace() { return this.replace; } /** * <p> * If <code>True</code>, then all fields that are required by the <a>RegisterTargetWithMaintenanceWindow</a> * operation are also required for this API request. Optional fields that aren't specified are set to null. * </p> * * @param replace * If <code>True</code>, then all fields that are required by the <a>RegisterTargetWithMaintenanceWindow</a> * operation are also required for this API request. Optional fields that aren't specified are set to null. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateMaintenanceWindowTargetRequest withReplace(Boolean replace) { setReplace(replace); return this; } /** * <p> * If <code>True</code>, then all fields that are required by the <a>RegisterTargetWithMaintenanceWindow</a> * operation are also required for this API request. Optional fields that aren't specified are set to null. * </p> * * @return If <code>True</code>, then all fields that are required by the <a>RegisterTargetWithMaintenanceWindow</a> * operation are also required for this API request. Optional fields that aren't specified are set to null. */ public Boolean isReplace() { return this.replace; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getWindowId() != null) sb.append("WindowId: ").append(getWindowId()).append(","); if (getWindowTargetId() != null) sb.append("WindowTargetId: ").append(getWindowTargetId()).append(","); if (getTargets() != null) sb.append("Targets: ").append(getTargets()).append(","); if (getOwnerInformation() != null) sb.append("OwnerInformation: ").append("***Sensitive Data Redacted***").append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getDescription() != null) sb.append("Description: ").append("***Sensitive Data Redacted***").append(","); if (getReplace() != null) sb.append("Replace: ").append(getReplace()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateMaintenanceWindowTargetRequest == false) return false; UpdateMaintenanceWindowTargetRequest other = (UpdateMaintenanceWindowTargetRequest) obj; if (other.getWindowId() == null ^ this.getWindowId() == null) return false; if (other.getWindowId() != null && other.getWindowId().equals(this.getWindowId()) == false) return false; if (other.getWindowTargetId() == null ^ this.getWindowTargetId() == null) return false; if (other.getWindowTargetId() != null && other.getWindowTargetId().equals(this.getWindowTargetId()) == false) return false; if (other.getTargets() == null ^ this.getTargets() == null) return false; if (other.getTargets() != null && other.getTargets().equals(this.getTargets()) == false) return false; if (other.getOwnerInformation() == null ^ this.getOwnerInformation() == null) return false; if (other.getOwnerInformation() != null && other.getOwnerInformation().equals(this.getOwnerInformation()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getReplace() == null ^ this.getReplace() == null) return false; if (other.getReplace() != null && other.getReplace().equals(this.getReplace()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getWindowId() == null) ? 0 : getWindowId().hashCode()); hashCode = prime * hashCode + ((getWindowTargetId() == null) ? 0 : getWindowTargetId().hashCode()); hashCode = prime * hashCode + ((getTargets() == null) ? 0 : getTargets().hashCode()); hashCode = prime * hashCode + ((getOwnerInformation() == null) ? 0 : getOwnerInformation().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getReplace() == null) ? 0 : getReplace().hashCode()); return hashCode; } @Override public UpdateMaintenanceWindowTargetRequest clone() { return (UpdateMaintenanceWindowTargetRequest) super.clone(); } }
6,165
892
{ "schema_version": "1.2.0", "id": "GHSA-7cgg-8926-325v", "modified": "2022-02-23T00:01:15Z", "published": "2022-02-15T00:02:47Z", "aliases": [ "CVE-2022-0214" ], "details": "The Popup | Custom Popup Builder WordPress plugin before 1.3.1 autoload data from its popup on every pages, as such data can be sent by unauthenticated user, and is not validated in length, this could cause a denial of service on the blog", "severity": [ ], "affected": [ ], "references": [ { "type": "ADVISORY", "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-0214" }, { "type": "WEB", "url": "https://wpscan.com/vulnerability/ca2e8feb-15d6-4965-ad9c-8da1bc01e0f4" } ], "database_specific": { "cwe_ids": [ "CWE-400" ], "severity": "HIGH", "github_reviewed": false } }
383
1,716
# -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ riko.currencies ~~~~~~~~~~~~~~~ Provides currency lookup dictionaries Attributes: CURRENCY_SYMBOLS (dict): Currency symbol to code mapping CURRENCY_CODES (dict): Currency symbol to info mapping """ CURRENCY_SYMBOLS = { "$": "USD", "£": "GBP", "€": "EUR", "₹": "INR", "\xa3": "GBP", "\u20ac": "EUR", "\u20b9": "INR", } CURRENCY_CODES = { "AED": { "code": "AED", "decimal_digits": 2, "location": "United Arab Emirates", "name": "United Arab Emirates Dirham", "name_plural": "UAE dirhams", "rounding": 0, "symbol": "AED", "symbol_native": "د.إ.", }, "AFN": { "code": "AFN", "decimal_digits": 0, "location": "Afghanistan", "name": "Afghan Afghani", "name_plural": "Afghan Afghanis", "rounding": 0, "symbol": "Af", "symbol_native": "؋", }, "ALL": { "code": "ALL", "decimal_digits": 0, "location": "Albania", "name": "Albanian Lek", "name_plural": "Albanian lekë", "rounding": 0, "symbol": "ALL", "symbol_native": "Lek", }, "AMD": { "code": "AMD", "decimal_digits": 0, "location": "Armenia", "name": "Armenian Dram", "name_plural": "Armenian drams", "rounding": 0, "symbol": "AMD", "symbol_native": "դր.", }, "ARS": { "code": "ARS", "decimal_digits": 2, "location": "Argentina", "name": "Argentine Peso", "name_plural": "Argentine pesos", "rounding": 0, "symbol": "AR$", "symbol_native": "$", }, "AUD": { "code": "AUD", "decimal_digits": 2, "location": "Australia", "name": "Australian Dollar", "name_plural": "Australian dollars", "rounding": 0, "symbol": "AU$", "symbol_native": "$", }, "AZN": { "code": "AZN", "decimal_digits": 2, "location": "Azerbaijan", "name": "Azerbaijani Manat", "name_plural": "Azerbaijani manats", "rounding": 0, "symbol": "man.", "symbol_native": "ман.", }, "BAM": { "code": "BAM", "decimal_digits": 2, "location": "Bosnia and Herzegovina", "name": "Bosnia-Herzegovina Convertible Mark", "name_plural": "Bosnia-Herzegovina convertible marks", "rounding": 0, "symbol": "KM", "symbol_native": "KM", }, "BDT": { "code": "BDT", "decimal_digits": 2, "location": "Bangladesh", "name": "Bangladeshi Taka", "name_plural": "Bangladeshi takas", "rounding": 0, "symbol": "Tk", "symbol_native": "৳", }, "BGN": { "code": "BGN", "decimal_digits": 2, "location": "Bulgaria", "name": "Bulgarian Lev", "name_plural": "Bulgarian leva", "rounding": 0, "symbol": "BGN", "symbol_native": "лв.", }, "BHD": { "code": "BHD", "decimal_digits": 3, "location": "Bahrain", "name": "<NAME>", "name_plural": "Bahraini dinars", "rounding": 0, "symbol": "BD", "symbol_native": "د.ب.", }, "BIF": { "code": "BIF", "decimal_digits": 0, "location": "Burundi", "name": "<NAME>", "name_plural": "Burundian francs", "rounding": 0, "symbol": "FBu", "symbol_native": "FBu", }, "BND": { "code": "BND", "decimal_digits": 2, "location": "Brunei", "name": "<NAME>", "name_plural": "Brunei dollars", "rounding": 0, "symbol": "BN$", "symbol_native": "$", }, "BOB": { "code": "BOB", "decimal_digits": 2, "location": "Bolivia", "name": "<NAME>", "name_plural": "Bolivian bolivianos", "rounding": 0, "symbol": "Bs", "symbol_native": "Bs", }, "BRL": { "code": "BRL", "decimal_digits": 2, "location": "Brazil", "name": "Brazilian Real", "name_plural": "Brazilian reals", "rounding": 0, "symbol": "R$", "symbol_native": "R$", }, "BWP": { "code": "BWP", "decimal_digits": 2, "location": "Botswana", "name": "<NAME>", "name_plural": "Botswanan pulas", "rounding": 0, "symbol": "BWP", "symbol_native": "P", }, "BYR": { "code": "BYR", "decimal_digits": 0, "location": "Belarus", "name": "Belarusian Ruble", "name_plural": "Belarusian rubles", "rounding": 0, "symbol": "BYR", "symbol_native": "BYR", }, "BZD": { "code": "BZD", "decimal_digits": 2, "location": "Belize", "name": "Belize Dollar", "name_plural": "Belize dollars", "rounding": 0, "symbol": "BZ$", "symbol_native": "$", }, "CAD": { "code": "CAD", "decimal_digits": 2, "location": "Canada", "name": "Canadian Dollar", "name_plural": "Canadian dollars", "rounding": 0, "symbol": "CA$", "symbol_native": "$", }, "CDF": { "code": "CDF", "decimal_digits": 2, "location": "Democratic Republic of the Congo", "name": "<NAME>", "name_plural": "Congolese francs", "rounding": 0, "symbol": "CDF", "symbol_native": "FrCD", }, "CHF": { "code": "CHF", "decimal_digits": 2, "location": "Switzerland", "name": "<NAME>", "name_plural": "Swiss francs", "rounding": 0.05, "symbol": "CHF", "symbol_native": "CHF", }, "CLP": { "code": "CLP", "decimal_digits": 0, "location": "Chile", "name": "<NAME>", "name_plural": "Chilean pesos", "rounding": 0, "symbol": "CL$", "symbol_native": "$", }, "CNY": { "code": "CNY", "decimal_digits": 2, "location": "China", "name": "Chinese Yuan", "name_plural": "Chinese yuan", "rounding": 0, "symbol": "CN¥", "symbol_native": "CN¥", }, "COP": { "code": "COP", "decimal_digits": 0, "location": "Colombia", "name": "Colombian Peso", "name_plural": "Colombian pesos", "rounding": 0, "symbol": "CO$", "symbol_native": "$", }, "CRC": { "code": "CRC", "decimal_digits": 0, "location": "Costa Rica", "name": "<NAME>", "name_plural": "Costa Rican colóns", "rounding": 0, "symbol": "₡", "symbol_native": "₡", }, "CVE": { "code": "CVE", "decimal_digits": 2, "location": "Cape Verde", "name": "<NAME>", "name_plural": "Cape Verdean escudos", "rounding": 0, "symbol": "CV$", "symbol_native": "CV$", }, "CZK": { "code": "CZK", "decimal_digits": 2, "location": "Czech Republic", "name": "Czech Republic Koruna", "name_plural": "Czech Republic korunas", "rounding": 0, "symbol": "Kč", "symbol_native": "Kč", }, "DJF": { "code": "DJF", "decimal_digits": 0, "location": "Djibouti", "name": "<NAME>", "name_plural": "Djiboutian francs", "rounding": 0, "symbol": "Fdj", "symbol_native": "Fdj", }, "DKK": { "code": "DKK", "decimal_digits": 2, "location": "Denmark", "name": "<NAME>", "name_plural": "<NAME>", "rounding": 0, "symbol": "Dkr", "symbol_native": "kr", }, "DOP": { "code": "DOP", "decimal_digits": 2, "location": "Dominican Republic", "name": "Dominican Peso", "name_plural": "Dominican pesos", "rounding": 0, "symbol": "RD$", "symbol_native": "RD$", }, "DZD": { "code": "DZD", "decimal_digits": 2, "location": "Algeria", "name": "Algerian Dinar", "name_plural": "Algerian dinars", "rounding": 0, "symbol": "DA", "symbol_native": "د.ج.", }, "EEK": { "code": "EEK", "decimal_digits": 2, "location": "Estonia", "name": "Estonian Kroon", "name_plural": "Estonian kroons", "rounding": 0, "symbol": "Ekr", "symbol_native": "kr", }, "EGP": { "code": "EGP", "decimal_digits": 2, "location": "Egypt", "name": "Egyptian Pound", "name_plural": "Egyptian pounds", "rounding": 0, "symbol": "EGP", "symbol_native": "ج.م.", }, "ERN": { "code": "ERN", "decimal_digits": 2, "location": "Eritrea", "name": "E<NAME>", "name_plural": "Eritrean nakfas", "rounding": 0, "symbol": "Nfk", "symbol_native": "Nfk", }, "ETB": { "code": "ETB", "decimal_digits": 2, "location": "Ethiopia", "name": "Ethiopian Birr", "name_plural": "Ethiopian birrs", "rounding": 0, "symbol": "Br", "symbol_native": "Br", }, "EUR": { "code": "EUR", "decimal_digits": 2, "location": "European Union", "name": "Euro", "name_plural": "euros", "rounding": 0, "symbol": "€", "symbol_native": "€", }, "GBP": { "code": "GBP", "decimal_digits": 2, "location": "United Kingdom", "name": "British Pound Sterling", "name_plural": "British pounds sterling", "rounding": 0, "symbol": "£", "symbol_native": "£", }, "GEL": { "code": "GEL", "decimal_digits": 2, "location": "Georgia", "name": "<NAME>", "name_plural": "Georgian laris", "rounding": 0, "symbol": "GEL", "symbol_native": "GEL", }, "GHS": { "code": "GHS", "decimal_digits": 2, "location": "Ghana", "name": "<NAME>", "name_plural": "Ghanaian cedis", "rounding": 0, "symbol": "GH₵", "symbol_native": "GH₵", }, "GNF": { "code": "GNF", "decimal_digits": 0, "location": "Guinea", "name": "<NAME>", "name_plural": "Guinean francs", "rounding": 0, "symbol": "FG", "symbol_native": "FG", }, "GTQ": { "code": "GTQ", "decimal_digits": 2, "location": "Guatemala", "name": "Guatemalan Quetzal", "name_plural": "Guatemalan quetzals", "rounding": 0, "symbol": "GTQ", "symbol_native": "Q", }, "HKD": { "code": "HKD", "decimal_digits": 2, "location": "Hong Kong", "name": "Hong Kong Dollar", "name_plural": "Hong Kong dollars", "rounding": 0, "symbol": "HK$", "symbol_native": "$", }, "HNL": { "code": "HNL", "decimal_digits": 2, "location": "Honduras", "name": "<NAME>", "name_plural": "Honduran lempiras", "rounding": 0, "symbol": "HNL", "symbol_native": "L", }, "HRK": { "code": "HRK", "decimal_digits": 2, "location": "Croatia", "name": "<NAME>", "name_plural": "Croatian kunas", "rounding": 0, "symbol": "kn", "symbol_native": "kn", }, "HUF": { "code": "HUF", "decimal_digits": 0, "location": "Hungary", "name": "<NAME>", "name_plural": "Hungarian forints", "rounding": 0, "symbol": "Ft", "symbol_native": "Ft", }, "IDR": { "code": "IDR", "decimal_digits": 0, "location": "Indonesia", "name": "Indonesian Rupiah", "name_plural": "Indonesian rupiahs", "rounding": 0, "symbol": "Rp", "symbol_native": "Rp", }, "ILS": { "code": "ILS", "decimal_digits": 2, "location": "Israel", "name": "Israeli New Sheqel", "name_plural": "Israeli new sheqels", "rounding": 0, "symbol": "₪", "symbol_native": "₪", }, "INR": { "code": "INR", "decimal_digits": 2, "location": "India", "name": "Indian Rupee", "name_plural": "Indian rupees", "rounding": 0, "symbol": "Rs", "symbol_native": "₹", }, "IQD": { "code": "IQD", "decimal_digits": 0, "location": "Iraq", "name": "<NAME>", "name_plural": "Iraqi dinars", "rounding": 0, "symbol": "IQD", "symbol_native": "د.ع.", }, "IRR": { "code": "IRR", "decimal_digits": 0, "location": "Iran", "name": "<NAME>", "name_plural": "Iranian rials", "rounding": 0, "symbol": "IRR", "symbol_native": "﷼", }, "ISK": { "code": "ISK", "decimal_digits": 0, "location": "Iceland", "name": "<NAME>", "name_plural": "Icelandic krónur", "rounding": 0, "symbol": "Ikr", "symbol_native": "kr", }, "JMD": { "code": "JMD", "decimal_digits": 2, "location": "Jamaica", "name": "<NAME>", "name_plural": "Jamaican dollars", "rounding": 0, "symbol": "J$", "symbol_native": "$", }, "JOD": { "code": "JOD", "decimal_digits": 3, "location": "Jordan", "name": "<NAME>", "name_plural": "Jordanian dinars", "rounding": 0, "symbol": "JD", "symbol_native": "د.أ.", }, "JPY": { "code": "JPY", "decimal_digits": 0, "location": "Japan", "name": "Japanese Yen", "name_plural": "Japanese yen", "rounding": 0, "symbol": "¥", "symbol_native": "¥", }, "KES": { "code": "KES", "decimal_digits": 2, "location": "Kenya", "name": "<NAME>", "name_plural": "Kenyan shillings", "rounding": 0, "symbol": "Ksh", "symbol_native": "/–", }, "KHR": { "code": "KHR", "decimal_digits": 2, "location": "Cambodia", "name": "<NAME>", "name_plural": "Cambodian riels", "rounding": 0, "symbol": "KHR", "symbol_native": "៛", }, "KMF": { "code": "KMF", "decimal_digits": 0, "location": "Comoros", "name": "<NAME>", "name_plural": "Com<NAME>ancs", "rounding": 0, "symbol": "CF", "symbol_native": "FC", }, "KRW": { "code": "KRW", "decimal_digits": 0, "location": "South Korea", "name": "<NAME>", "name_plural": "South Korean won", "rounding": 0, "symbol": "₩", "symbol_native": "₩", }, "KWD": { "code": "KWD", "decimal_digits": 3, "location": "Kuwait", "name": "<NAME>", "name_plural": "Kuwaiti dinars", "rounding": 0, "symbol": "KD", "symbol_native": "د.ك.", }, "KZT": { "code": "KZT", "decimal_digits": 2, "location": "Kazakhstan", "name": "<NAME>", "name_plural": "Kazakhstani tenges", "rounding": 0, "symbol": "KZT", "symbol_native": "тңг.", }, "LBP": { "code": "LBP", "decimal_digits": 0, "location": "Lebanon", "name": "<NAME>", "name_plural": "Lebanese pounds", "rounding": 0, "symbol": "LB£", "symbol_native": "ل.ل.", }, "LKR": { "code": "LKR", "decimal_digits": 2, "location": "Sri Lanka", "name": "<NAME>", "name_plural": "Sri Lankan rupees", "rounding": 0, "symbol": "SLRs", "symbol_native": "SL Re", }, "LTL": { "code": "LTL", "decimal_digits": 2, "location": "Lithuania", "name": "<NAME>", "name_plural": "Lithuanian litai", "rounding": 0, "symbol": "Lt", "symbol_native": "Lt", }, "LVL": { "code": "LVL", "decimal_digits": 2, "location": "Latvia", "name": "<NAME>", "name_plural": "Latvian lati", "rounding": 0, "symbol": "Ls", "symbol_native": "Ls", }, "LYD": { "code": "LYD", "decimal_digits": 3, "location": "Libya", "name": "<NAME>", "name_plural": "<NAME>", "rounding": 0, "symbol": "LD", "symbol_native": "د.ل.", }, "MAD": { "code": "MAD", "decimal_digits": 2, "location": "Morocco", "name": "<NAME>", "name_plural": "<NAME>", "rounding": 0, "symbol": "MAD", "symbol_native": "د.م.", }, "MDL": { "code": "MDL", "decimal_digits": 2, "location": "Moldova", "name": "<NAME>", "name_plural": "<NAME>", "rounding": 0, "symbol": "MDL", "symbol_native": "MDL", }, "MGA": { "code": "MGA", "decimal_digits": 0, "location": "Madagascar", "name": "<NAME>", "name_plural": "<NAME>", "rounding": 0, "symbol": "MGA", "symbol_native": "MGA", }, "MKD": { "code": "MKD", "decimal_digits": 2, "location": "Macedonia", "name": "<NAME>", "name_plural": "<NAME>", "rounding": 0, "symbol": "MKD", "symbol_native": "MKD", }, "MMK": { "code": "MMK", "decimal_digits": 0, "location": "Myanmar", "name": "<NAME>", "name_plural": "<NAME>", "rounding": 0, "symbol": "MMK", "symbol_native": "K", }, "MOP": { "code": "MOP", "decimal_digits": 2, "location": "Macao", "name": "<NAME>", "name_plural": "<NAME>", "rounding": 0, "symbol": "MOP$", "symbol_native": "MOP$", }, "MUR": { "code": "MUR", "decimal_digits": 0, "location": "Mauritius", "name": "<NAME>", "name_plural": "<NAME>", "rounding": 0, "symbol": "MURs", "symbol_native": "MURs", }, "MXN": { "code": "MXN", "decimal_digits": 2, "location": "Mexico", "name": "Mexican Peso", "name_plural": "Mexican pesos", "rounding": 0, "symbol": "MX$", "symbol_native": "$", }, "MYR": { "code": "MYR", "decimal_digits": 2, "location": "Malaysia", "name": "Malaysian Ringgit", "name_plural": "Malaysian ringgits", "rounding": 0, "symbol": "RM", "symbol_native": "RM", }, "MZN": { "code": "MZN", "decimal_digits": 2, "location": "Mozambique", "name": "Mozambican Metical", "name_plural": "Mozambican meticals", "rounding": 0, "symbol": "MTn", "symbol_native": "MTn", }, "NAD": { "code": "NAD", "decimal_digits": 2, "location": "Namibia", "name": "Namibian Dollar", "name_plural": "Namibian dollars", "rounding": 0, "symbol": "N$", "symbol_native": "N$", }, "NGN": { "code": "NGN", "decimal_digits": 2, "location": "Nigeria", "name": "Nigerian Naira", "name_plural": "Nigerian nairas", "rounding": 0, "symbol": "₦", "symbol_native": "₦", }, "NIO": { "code": "NIO", "decimal_digits": 2, "location": "Nicaragua", "name": "Nicaraguan Córdoba", "name_plural": "Nicaraguan córdobas", "rounding": 0, "symbol": "C$", "symbol_native": "C$", }, "NOK": { "code": "NOK", "decimal_digits": 2, "location": "Norway", "name": "Norwe<NAME>", "name_plural": "Norwegian kroner", "rounding": 0, "symbol": "Nkr", "symbol_native": "kr", }, "NPR": { "code": "NPR", "decimal_digits": 2, "location": "Nepal", "name": "Nepalese Rupee", "name_plural": "Nepalese rupees", "rounding": 0, "symbol": "NPRs", "symbol_native": "नेरू", }, "NZD": { "code": "NZD", "decimal_digits": 2, "location": "New Zealand", "name": "New Zealand Dollar", "name_plural": "New Zealand dollars", "rounding": 0, "symbol": "NZ$", "symbol_native": "$", }, "OMR": { "code": "OMR", "decimal_digits": 3, "location": "Oman", "name": "<NAME>", "name_plural": "Omani rials", "rounding": 0, "symbol": "OMR", "symbol_native": "ر.ع.", }, "PAB": { "code": "PAB", "decimal_digits": 2, "location": "Panama", "name": "Panamanian Balboa", "name_plural": "Panamanian balboas", "rounding": 0, "symbol": "B/.", "symbol_native": "B/.", }, "PEN": { "code": "PEN", "decimal_digits": 2, "location": "Peru", "name": "<NAME>", "name_plural": "Peruvian nuevos soles", "rounding": 0, "symbol": "S/.", "symbol_native": "S/.", }, "PHP": { "code": "PHP", "decimal_digits": 2, "location": "Philippines", "name": "<NAME>", "name_plural": "Philippine pesos", "rounding": 0, "symbol": "₱", "symbol_native": "₱", }, "PKR": { "code": "PKR", "decimal_digits": 0, "location": "Pakistan", "name": "Pak<NAME>", "name_plural": "Pakistani rupees", "rounding": 0, "symbol": "PKRs", "symbol_native": "₨", }, "PLN": { "code": "PLN", "decimal_digits": 2, "location": "Poland", "name": "Polish Zloty", "name_plural": "Polish zlotys", "rounding": 0, "symbol": "zł", "symbol_native": "zł", }, "PYG": { "code": "PYG", "decimal_digits": 0, "location": "Paraguay", "name": "<NAME>", "name_plural": "Paraguayan guaranis", "rounding": 0, "symbol": "₲", "symbol_native": "₲", }, "QAR": { "code": "QAR", "decimal_digits": 2, "location": "Qatar", "name": "<NAME>", "name_plural": "Qatari rials", "rounding": 0, "symbol": "QR", "symbol_native": "ر.ق.", }, "RON": { "code": "RON", "decimal_digits": 2, "location": "Romania", "name": "<NAME>", "name_plural": "Romanian lei", "rounding": 0, "symbol": "RON", "symbol_native": "RON", }, "RSD": { "code": "RSD", "decimal_digits": 0, "location": "Serbia", "name": "<NAME>", "name_plural": "Serbian dinars", "rounding": 0, "symbol": "din.", "symbol_native": "дин.", }, "RUB": { "code": "RUB", "decimal_digits": 2, "location": "Russia", "name": "Russian Ruble", "name_plural": "Russian rubles", "rounding": 0, "symbol": "RUB", "symbol_native": "руб.", }, "RWF": { "code": "RWF", "decimal_digits": 0, "location": "Rwanda", "name": "<NAME>", "name_plural": "Rwandan francs", "rounding": 0, "symbol": "RWF", "symbol_native": "FR", }, "SAR": { "code": "SAR", "decimal_digits": 2, "location": "Saudi Arabia", "name": "<NAME>", "name_plural": "Saudi riyals", "rounding": 0, "symbol": "SR", "symbol_native": "ر.س.", }, "SDG": { "code": "SDG", "decimal_digits": 2, "location": "Sudan", "name": "<NAME>", "name_plural": "Sudanese pounds", "rounding": 0, "symbol": "SDG", "symbol_native": "SDG", }, "SEK": { "code": "SEK", "decimal_digits": 2, "location": "Sweden", "name": "Swedish Krona", "name_plural": "Swedish kronor", "rounding": 0, "symbol": "Skr", "symbol_native": "kr", }, "SGD": { "code": "SGD", "decimal_digits": 2, "location": "Singapore", "name": "Singapore Dollar", "name_plural": "Singapore dollars", "rounding": 0, "symbol": "S$", "symbol_native": "$", }, "SOS": { "code": "SOS", "decimal_digits": 0, "location": "Somalia", "name": "<NAME>", "name_plural": "Somali shillings", "rounding": 0, "symbol": "Ssh", "symbol_native": "Ssh", }, "SYP": { "code": "SYP", "decimal_digits": 0, "location": "Syria", "name": "<NAME>", "name_plural": "Sy<NAME>ounds", "rounding": 0, "symbol": "SY£", "symbol_native": "ل.س.", }, "THB": { "code": "THB", "decimal_digits": 2, "location": "Thailand", "name": "<NAME>", "name_plural": "Thai baht", "rounding": 0, "symbol": "฿", "symbol_native": "฿", }, "TND": { "code": "TND", "decimal_digits": 3, "location": "Tunisia", "name": "<NAME>", "name_plural": "Tunisian dinars", "rounding": 0, "symbol": "DT", "symbol_native": "د.ت.", }, "TOP": { "code": "TOP", "decimal_digits": 2, "location": "Tonga", "name": "<NAME>ʻanga", "name_plural": "Tongan paʻanga", "rounding": 0, "symbol": "T$", "symbol_native": "T$", }, "TRY": { "code": "TRY", "decimal_digits": 2, "location": "Turkey", "name": "Turkish Lira", "name_plural": "Turkish Lira", "rounding": 0, "symbol": "TL", "symbol_native": "₤", }, "TTD": { "code": "TTD", "decimal_digits": 2, "location": "Trinidad and Tobago", "name": "Trinidad and Tobago Dollar", "name_plural": "Trinidad and Tobago dollars", "rounding": 0, "symbol": "TT$", "symbol_native": "$", }, "TWD": { "code": "TWD", "decimal_digits": 2, "location": "Taiwan", "name": "New Taiwan Dollar", "name_plural": "New Taiwan dollars", "rounding": 0, "symbol": "NT$", "symbol_native": "NT$", }, "TZS": { "code": "TZS", "decimal_digits": 0, "location": "Tanzania", "name": "Tanzanian Shilling", "name_plural": "Tanzanian shillings", "rounding": 0, "symbol": "TSh", "symbol_native": "/–", }, "UAH": { "code": "UAH", "decimal_digits": 2, "location": "Ukraine", "name": "Ukrainian Hryvnia", "name_plural": "Ukrainian hryvnias", "rounding": 0, "symbol": "₴", "symbol_native": "₴", }, "UGX": { "code": "UGX", "decimal_digits": 0, "location": "Uganda", "name": "Ugandan Shilling", "name_plural": "Ugandan shillings", "rounding": 0, "symbol": "USh", "symbol_native": "USh", }, "USD": { "code": "USD", "decimal_digits": 2, "location": "United States", "name": "US Dollar", "name_plural": "US dollars", "rounding": 0, "symbol": "$", "symbol_native": "$", }, "UYU": { "code": "UYU", "decimal_digits": 2, "location": "Uruguay", "name": "Uruguayan Peso", "name_plural": "Uruguayan pesos", "rounding": 0, "symbol": "$U", "symbol_native": "$", }, "UZS": { "code": "UZS", "decimal_digits": 0, "location": "Uzbekistan", "name": "Uzbekistan Som", "name_plural": "Uzbekistan som", "rounding": 0, "symbol": "UZS", "symbol_native": "UZS", }, "VEF": { "code": "VEF", "decimal_digits": 2, "location": "Venezuela", "name": "<NAME>", "name_plural": "Venezuelan bolívars", "rounding": 0, "symbol": "Bs.F.", "symbol_native": "Bs.F.", }, "VND": { "code": "VND", "decimal_digits": 0, "location": "Vietnam", "name": "<NAME>", "name_plural": "Vietnamese dong", "rounding": 0, "symbol": "₫", "symbol_native": "₫", }, "XAF": { "code": "XAF", "decimal_digits": 0, "location": "Cameroon", "name": "<NAME>", "name_plural": "CFA francs BEAC", "rounding": 0, "symbol": "FCFA", "symbol_native": "FCFA", }, "XOF": { "code": "XOF", "decimal_digits": 0, "location": "Benin", "name": "<NAME>", "name_plural": "CFA francs BCEAO", "rounding": 0, "symbol": "CFA", "symbol_native": "CFA", }, "YER": { "code": "YER", "decimal_digits": 0, "location": "Yemen", "name": "<NAME>", "name_plural": "Y<NAME>", "rounding": 0, "symbol": "YR", "symbol_native": "ر.ي.", }, "ZAR": { "code": "ZAR", "decimal_digits": 2, "location": "South Africa", "name": "South African Rand", "name_plural": "South African rand", "rounding": 0, "symbol": "R", "symbol_native": "R", }, "ZMK": { "code": "ZMK", "decimal_digits": 0, "name": "<NAME>", "location": "Zambia", "name_plural": "Zambian kwachas", "rounding": 0, "symbol": "ZK", "symbol_native": "ZK", }, "ZWL": {"code": "ZWL", "location": "Zimbabwe"}, }
17,516
1,359
<filename>src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/security/EncryptionInitializationVectorRandomnessInspector.java<gh_stars>1000+ package com.kalessil.phpStorm.phpInspectionsEA.inspectors.security; import com.intellij.codeInspection.ProblemHighlightType; import com.intellij.codeInspection.ProblemsHolder; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.PsiReference; import com.intellij.psi.util.PsiTreeUtil; import com.jetbrains.php.lang.psi.elements.Function; import com.jetbrains.php.lang.psi.elements.FunctionReference; import com.jetbrains.php.lang.psi.elements.GroupStatement; import com.kalessil.phpStorm.phpInspectionsEA.openApi.BasePhpElementVisitor; import com.kalessil.phpStorm.phpInspectionsEA.openApi.BasePhpInspection; import com.kalessil.phpStorm.phpInspectionsEA.utils.*; import org.jetbrains.annotations.NotNull; import java.util.*; /* * This file is part of the Php Inspections (EA Extended) package. * * (c) <NAME> <<EMAIL>> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ public class EncryptionInitializationVectorRandomnessInspector extends BasePhpInspection { private static final String messagePattern = "%s() should be used for IV, but found: %s."; @NotNull private static final HashSet<String> secureFunctions = new HashSet<>(); static { secureFunctions.add("random_bytes"); secureFunctions.add("openssl_random_pseudo_bytes"); secureFunctions.add("mcrypt_create_iv"); } @NotNull @Override public String getShortName() { return "EncryptionInitializationVectorRandomnessInspection"; } @NotNull @Override public String getDisplayName() { return "Encryption initialization vector randomness"; } @Override @NotNull public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, boolean isOnTheFly) { return new BasePhpElementVisitor() { @Override public void visitPhpFunctionCall(@NotNull FunctionReference reference) { final String functionName = reference.getName(); /* variable functions are not supported, as we are checking 2 different extensions functions */ if (functionName != null && (functionName.equals("openssl_encrypt") || functionName.equals("mcrypt_encrypt"))) { final PsiElement[] arguments = reference.getParameters(); if (arguments.length != 5 || arguments[4] == null || arguments[4].getText().isEmpty()) { return; } /* discover and inspect possible values */ final Set<PsiElement> values = PossibleValuesDiscoveryUtil.discover(arguments[4]); if (! values.isEmpty()) { /* check all possible values */ final List<String> reporting = new ArrayList<>(); for (final PsiElement source : values) { if (OpenapiTypesUtil.isFunctionReference(source)) { final String sourceName = ((FunctionReference) source).getName(); if (sourceName != null && secureFunctions.contains(sourceName)) { continue; } } reporting.add(source.getText()); } if (!reporting.isEmpty() && !this.isAggregatedGeneration(values)) { /* sort reporting list to produce testable results */ Collections.sort(reporting); final String ivFunction = functionName.startsWith("openssl_") ? "openssl_random_pseudo_bytes" : "mcrypt_create_iv"; holder.registerProblem( arguments[4], MessagesPresentationUtil.prefixWithEa(String.format(messagePattern, ivFunction, String.join(", ", reporting))), ProblemHighlightType.GENERIC_ERROR ); } reporting.clear(); } values.clear(); } } private boolean isAggregatedGeneration(@NotNull Set<PsiElement> candidates) { if (candidates.size() == 1) { final PsiElement candidate = candidates.iterator().next(); if (candidate instanceof FunctionReference) { final PsiElement resolved = OpenapiResolveUtil.resolveReference((PsiReference) candidate); if (resolved instanceof Function) { final GroupStatement body = ExpressionSemanticUtil.getGroupStatement(resolved); if (body != null) { return PsiTreeUtil.findChildrenOfType(body, FunctionReference.class) .stream().anyMatch(c -> secureFunctions.contains(c.getName())); } } } } return false; } }; } }
2,558
6,717
<gh_stars>1000+ #ifndef __LIBOBJC_BLOCKS_PRIVATE_H_INCLUDED__ #define __LIBOBJC_BLOCKS_PRIVATE_H_INCLUDED__ #if defined(__clang__) && !defined(__OBJC_RUNTIME_INTERNAL__) #pragma clang system_header #endif /* * This header file exposes some implementation details of the blocks runtime * that are needed, e.g., by libdispatch. */ /** * Block descriptor that contains copy and dispose operations. */ struct Block_descriptor { /** * Reserved for future use. Currently always 0. */ unsigned long int reserved; /** Size of the block. */ unsigned long int size; /** * Copy function, generated by the compiler to help copy the block if it * contains nontrivial copy operations. */ void (*copy_helper)(void *dst, void *src); /** * Dispose function, generated by the compiler to help copy the block if it * contains nontrivial destructors. */ void (*dispose_helper)(void *src); /** * Objective-C type encoding of the block. */ const char *encoding; }; // Helper structure struct Block_layout { /** * Class pointer. Always initialised to &_NSConcreteStackBlock for blocks * that are created on the stack or &_NSConcreteGlobalBlock for blocks that * are created in global storage. */ void *isa; /** * Flags. See the block_flags enumerated type for possible values. */ int flags; /** * Reserved - always initialised to 0 by the compiler. Used for the * reference count in this implementation. */ int reserved; /** * The function that implements the block. The first argument is this * structure, the subsequent arguments are the block's explicit parameters. * If the BLOCK_USE_SRET flag is set, there is an additional hidden * argument, which is a pointer to the space on the stack allocated to hold * the return value. */ void (*invoke)(void *, ...); /** * The block's descriptor. This is either Block_descriptor_basic or * Block_descriptor, depending on whether the * BLOCK_HAS_COPY_DISPOSE flag is set. */ struct Block_descriptor *descriptor; /** * Block variables are appended to this structure. */ }; #ifndef __OBJC_RUNTIME_INTERNAL__ /* * Deprecated Block_basic datastructure needed by libdispatch */ struct Block_basic { void *isa; int Block_flags; int Block_size; void (*Block_invoke)(void *); void (*Block_copy)(void *dst, void *src); void (*Block_dispose)(void *); }; #endif // __OBJC_RUNTIME_INTERNAL__ #endif //__LIBOBJC_BLOCKS_PRIVATE_H_INCLUDED__
796
432
/* * Copyright (C) 2020 ActiveJ LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.activej.ot; import io.activej.async.function.AsyncSupplier; import io.activej.common.initializer.WithInitializer; import io.activej.promise.Promise; import io.activej.promise.Promises; import org.jetbrains.annotations.Nullable; import java.time.Duration; import java.util.Objects; import static io.activej.promise.RetryPolicy.exponentialBackoff; public final class PollSanitizer<T> implements AsyncSupplier<T>, WithInitializer<PollSanitizer<T>> { public static final Duration DEFAULT_YIELD_INTERVAL = Duration.ofSeconds(1); private Duration yieldInterval = DEFAULT_YIELD_INTERVAL; private final AsyncSupplier<T> poll; private @Nullable T lastValue; private PollSanitizer(AsyncSupplier<T> poll) { this.poll = poll; } public static <T> PollSanitizer<T> create(AsyncSupplier<T> poll) { return new PollSanitizer<>(poll); } public PollSanitizer<T> withYieldInterval(Duration yieldInterval) { this.yieldInterval = yieldInterval; return this; } @Override public Promise<T> get() { return Promises.retry(poll, (value, e) -> { if (e != null) return true; if (Objects.equals(value, lastValue)) { return false; } else { this.lastValue = value; return true; } }, exponentialBackoff(Duration.ofMillis(1), yieldInterval)); } }
641
678
/** * This header is generated by class-dump-z 0.2b. * * Source: /System/Library/PrivateFrameworks/VoiceServices.framework/VoiceServices */ #import <VoiceServices/XXUnknownSuperclass.h> #import <VoiceServices/VoiceServices-Structs.h> @class VSSpeechSynthesizer, NSString, NSArray, VSRecognitionAction; @protocol VSRecognitionSessionDelegate; @interface VSRecognitionSession : XXUnknownSuperclass { NSString *_modelIdentifier; // 4 = 0x4 void *_keepAlive; // 8 = 0x8 id<VSRecognitionSessionDelegate> _delegate; // 12 = 0xc VSRecognitionAction *_currentAction; // 16 = 0x10 NSArray *_topLevelKeywords; // 20 = 0x14 id _handlingThread; // 24 = 0x18 VSSpeechSynthesizer *_synthesizer; // 28 = 0x1c NSString *_languageID; // 32 = 0x20 NSString *_debugDumpPath; // 36 = 0x24 NSString *_audioInputPath; // 40 = 0x28 double _levelInterval; // 44 = 0x2c unsigned _keywordPhase; // 52 = 0x34 struct { unsigned delegateWillBegin : 1; unsigned delegateBegin : 1; unsigned delegateOpenURL : 1; unsigned delegateFinishedSpeaking : 1; unsigned delegateComplete : 1; unsigned debugDumpEnabled : 1; unsigned preferredEngine : 2; unsigned performHandlerActions : 1; unsigned allowSensitiveActions : 1; unsigned bluetoothAllowed : 1; unsigned resetNextAction : 1; unsigned isSpeaking : 1; unsigned actionBegan : 1; unsigned actionBeginning : 1; unsigned actionBeginDeferred : 1; unsigned invalid : 1; unsigned observeKeywordChange : 1; } _sessionFlags; // 56 = 0x38 } @property(assign) BOOL sensitiveActionsEnabled; // G=0x6185; S=0x6165; converted property @property(readonly, retain) NSString *debugDumpPath; // G=0x619d; converted property - (void)_init; // 0x701d - (id)init; // 0x7071 - (id)initWithModelIdentifier:(id)modelIdentifier; // 0x7c41 - (void)dealloc; // 0x7af5 - (void)setDelegate:(id)delegate; // 0x61cd - (id)beginNextAction; // 0x78b5 - (id)reset; // 0x77dd - (BOOL)isRecognizing; // 0x62f1 - (BOOL)isActivelyRecognizing; // 0x6329 - (BOOL)isFinished; // 0x60e9 - (BOOL)isValid; // 0x6101 - (BOOL)hasDeferredAction; // 0x611d - (BOOL)isBusy; // 0x6131 - (BOOL)nextActionWillTerminateSession; // 0x6361 - (BOOL)nextActionWillRecognize; // 0x6391 // converted property setter: - (void)setSensitiveActionsEnabled:(BOOL)enabled; // 0x6165 // converted property getter: - (BOOL)sensitiveActionsEnabled; // 0x6185 - (BOOL)setBluetoothInputAllowed:(BOOL)allowed; // 0x63cd - (id)cancelMaintainingKeepAlive:(BOOL)alive; // 0x76c5 - (id)cancel; // 0x6435 - (void)_actionCompleted:(id)completed nextAction:(id)action error:(id)error; // 0x6449 - (BOOL)_actionStarted:(id)started; // 0x6675 - (void)_notifyDelegateActionStarted; // 0x670d - (id)_notifyDelegateOpenURL:(id)url; // 0x6749 - (void)_setAction:(id)action; // 0x678d - (id)_currentRecognizeAction; // 0x6995 - (id)_recognitionResultHandlingThread; // 0x69f5 - (void)recognitionResultHandlingThread:(id)thread didHandleResults:(id)results nextAction:(id)action; // 0x6a55 - (id)spokenFeedbackString; // 0x6a85 - (id)spokenFeedbackAttributedString; // 0x6aa5 - (id)displayResultString; // 0x6ac5 - (id)displayStatusString; // 0x6ae5 - (void)setInputLevelUpdateInterval:(double)interval; // 0x6b05 - (float)inputLevel; // 0x6b5d - (void)setKeywordPhase:(unsigned)phase; // 0x6b99 - (id)keywordAtIndex:(int)index; // 0x6bdd - (int)keywordCount; // 0x6c09 - (CFDictionaryRef)_createKeywordIndex; // 0x7601 - (id)_createPhaseSortedKeywordsFromArray:(id)array; // 0x73b5 - (id)_topLevelKeywords; // 0x72fd - (id)_keywordsForModelIdentifier:(id)modelIdentifier; // 0x726d - (void)_keywordIndexChanged; // 0x6c45 - (id)beginSpeakingFeedbackString; // 0x71a9 - (id)beginSpeakingString:(id)string; // 0x6cdd - (id)_beginSpeakingAttributedString:(id)string; // 0x6d29 - (id)_beginSpeakingString:(id)string attributedString:(id)string2; // 0x70b9 - (void)_notifyDelegateFinishedSpeakingWithError:(id)error; // 0x6d75 - (void)speechSynthesizer:(id)synthesizer didFinishSpeaking:(BOOL)speaking withError:(id)error; // 0x6db5 - (BOOL)setDebugDumpEnabled:(BOOL)enabled; // 0x6e05 // converted property getter: - (id)debugDumpPath; // 0x619d - (BOOL)setNextRecognitionAudioInputPath:(id)path; // 0x6ed9 - (BOOL)setNextRecognitionRequiresReset:(BOOL)reset; // 0x6f4d - (BOOL)setPreferredEngine:(int)engine; // 0x6fb9 - (void)setPerformRecognitionHandlerActions:(BOOL)actions; // 0x61ad @end
1,728
677
#ifndef LYNX_LEPUS_BUILTIN_H_ #define LYNX_LEPUS_BUILTIN_H_ #include "lepus/context.h" #include "lepus/table.h" namespace lepus { void RegisterBuiltin(Context* context); void RegisterCFunction(Context* context, const char* name, CFunction function); void RegisterFunctionTable(Context* context, const char* name, void* function); void RegisterTableFunction(Context* context, Dictonary* table, const char* name, CFunction function); } #endif
164
892
{ "schema_version": "1.2.0", "id": "GHSA-pq4c-xvv6-cr96", "modified": "2022-04-29T01:26:46Z", "published": "2022-04-29T01:26:45Z", "aliases": [ "CVE-2003-0646" ], "details": "Multiple buffer overflows in ActiveX controls used by Trend Micro HouseCall 5.5 and 5.7, and Damage Cleanup Server 1.0, allow remote attackers to execute arbitrary code via long parameter strings.", "severity": [ ], "affected": [ ], "references": [ { "type": "ADVISORY", "url": "https://nvd.nist.gov/vuln/detail/CVE-2003-0646" }, { "type": "WEB", "url": "http://kb.trendmicro.com/solutions/solutionDetail.asp?solutionID=15274" }, { "type": "WEB", "url": "http://lists.grok.org.uk/pipermail/full-disclosure/2003-July/006488.html" } ], "database_specific": { "cwe_ids": [ ], "severity": "HIGH", "github_reviewed": false } }
408
468
/* * Copyright © 2021 Embedded Artistry LLC. * See LICENSE file for licensing information. */ #ifndef CIRCULAR_BUFFER_TESTS_H_ #define CIRCULAR_BUFFER_TESTS_H_ int circular_buffer_test_suite(void); #endif // CIRCULAR_BUFFER_TESTS_H_
92
322
<reponame>qtwre/Open-Vehicle-Monitoring-System-3 // // Warning: don't edit - generated by generate_ecu_code.pl processing ../dev/eps_i1.json: EPS 30: Power steering // This generated code makes it easier to process CANBUS messages from the EPS ecu in a BMW i3 // #define I3_ECU_EPS_TX 0x06F130 #define I3_ECU_EPS_RX 0x0630F1 #define I3_PID_EPS_STEUERN_EPS_PULLDRIFT_OFFSET_RESET 0xA2BB // Reset EPS pull-drift long-term offset / Reset EPS Pull-Drift Langzeit-Offset // Skipping EPS_PENDELN on 0xAB56 which takes arguments #define I3_PID_EPS_EPS_LENKWINKELSENSOR_KALIBRIERUNG_RESET 0xAB69 // Start reset steering angle offset / Start Reset Lenkwinkel Offset #define I3_PID_EPS_EPS_INITIALISIERUNG_SERVICE 0xAB6C // Start, stop and status initialization routine / Starten, Stoppen und Status Initialisierungsroutine #define I3_RES_EPS_STAT_ROUTINE_STATUS (RXBUF_UCHAR(0)) #define I3_RES_EPS_STAT_ROUTINE_STATUS_UNIT '0-n' #define I3_RES_EPS_STAT_ROUTINE_STATUS_TYPE unsigned char // Execution status / Ausführungsstatus #define I3_RES_EPS_STAT_LENKRADWINKEL_WERT (RXBUF_SINT(1)) #define I3_RES_EPS_STAT_LENKRADWINKEL_WERT_UNIT '°' #define I3_RES_EPS_STAT_LENKRADWINKEL_WERT_TYPE short // Steering wheel angle / Lenkradwinkel #define I3_RES_EPS_STAT_SENSOR_ZUSTAND_NR (RXBUF_SCHAR(3)) #define I3_RES_EPS_STAT_SENSOR_ZUSTAND_NR_UNIT '0-n' #define I3_RES_EPS_STAT_SENSOR_ZUSTAND_NR_TYPE char // Condition sensor pinion angle sensor / Zustand Sensor Ritzelwinkelsensor // Skipping EPS_VERFAHREN on 0xAB71 which takes arguments // Skipping EPS_INITIALISIERUNG_WERK on 0xAB72 which takes arguments #define I3_PID_EPS_STEUERN_EPS_MULTITURNWERT_RESET 0xAB7D // Reset EPS multiturn value / Reset EPS Multiturnwert #define I3_PID_EPS_EPS_RITZELWINKELSENSOR 0xDB57 // Read out data EPS pinion angle / Auslesen Daten EPS Ritzelwinkel #define I3_RES_EPS_STAT_RITZELWINKEL_WERT (RXBUF_SINT32(0)/100.0f) #define I3_RES_EPS_STAT_RITZELWINKEL_WERT_UNIT '°' #define I3_RES_EPS_STAT_RITZELWINKEL_WERT_TYPE float // Pinion angle / Ritzelwinkel #define I3_RES_EPS_STAT_RITZELWINKELGESCHWINDIGKEIT_WERT (RXBUF_SINT(4)) #define I3_RES_EPS_STAT_RITZELWINKELGESCHWINDIGKEIT_WERT_UNIT '°/s' #define I3_RES_EPS_STAT_RITZELWINKELGESCHWINDIGKEIT_WERT_TYPE short // Pinion angle angular speed / Ritzelwinkel Winkelgeschwindigkeit #define I3_RES_EPS_STAT_SENSOR_ZUSTAND_NR_0XDB57 (RXBUF_SCHAR(6)) #define I3_RES_EPS_STAT_SENSOR_ZUSTAND_NR_0XDB57_UNIT '0-n' #define I3_RES_EPS_STAT_SENSOR_ZUSTAND_NR_0XDB57_TYPE char // Condition sensor pinion angle sensor / Zustand Sensor Ritzelwinkelsensor // Skipping EPS_LENKWINKELSENSOR_KALIBRIERUNG on 0xDB5A which takes arguments #define I3_PID_EPS_EPS_MOMENTENSENSOR 0xDB99 // Reading out data from the steering torque sensor / Auslesen Daten Sensor Lenkmoment #define I3_RES_EPS_STAT_MOMENT_WERT (RXBUF_SINT(0)/128.0f) #define I3_RES_EPS_STAT_MOMENT_WERT_UNIT 'Nm' #define I3_RES_EPS_STAT_MOMENT_WERT_TYPE float // Current moment / Aktuelles Moment #define I3_RES_EPS_STAT_SENSOR_ZUSTAND_NR_0XDB99 (RXBUF_SCHAR(2)) #define I3_RES_EPS_STAT_SENSOR_ZUSTAND_NR_0XDB99_UNIT '0-n' #define I3_RES_EPS_STAT_SENSOR_ZUSTAND_NR_0XDB99_TYPE char // State of the steering torque sensor / Zustand Sensor Lenkmoment #define I3_PID_EPS_EPS_ZAHNSTANGENMITTE 0xDC77 // State of rack center learned / Zustand Zahnstangenmitte gelernt #define I3_RES_EPS_STAT_ZAHNSTANGENMITTE_ZUSTAND_NR (RXBUF_UCHAR(0)) #define I3_RES_EPS_STAT_ZAHNSTANGENMITTE_ZUSTAND_NR_UNIT '0-n' #define I3_RES_EPS_STAT_ZAHNSTANGENMITTE_ZUSTAND_NR_TYPE unsigned char // State of rack center learned / Zustand Zahnstangenmitte gelernt #define I3_PID_EPS_GELERNTER_ZAHNSTANGENWEG 0xDFDD // GELERNTER_ZAHNSTANGENWEG / GELERNTER_ZAHNSTANGENWEG // Can't process STAT_LENKRADWINKEL_LIEFERANT_WERT - don't know type motorola float (*** this will mean all the following offsets are wrong!!! ****) // Can't process STAT_LENKRADWINKEL_AUTOMATISCH_GELERNT_WERT - don't know type motorola float (*** this will mean all the following offsets are wrong!!! ****) #define I3_PID_EPS_READHWMODIFICATIONINDEX 0xF152 // This service is only used if there has been a slight hardware change on the control unit that did not result // in a change in the part number or the hardware SGBM IDs. Such a change cannot be diagnosed from the outside, // which is why this service was introduced for it. / Dieser Service kommt nur zum Einsatz, wenn es eine // geringfügige Hardwareänderung an dem Steuergerät gegeben hat, die nicht zu einer Änderung der Sachnummer bzw. // der Hardware SGBM-IDs geführt hat. Eine solche Änderung ist von außen nicht diagnostizierbar, daher wurde // dieser Dienst dafür eingeführt. #define I3_RES_EPS_STAT_HW_MODIFICATION_INDEX_WERT (RXBUF_UCHAR(0)) #define I3_RES_EPS_STAT_HW_MODIFICATION_INDEX_WERT_UNIT 'HEX' #define I3_RES_EPS_STAT_HW_MODIFICATION_INDEX_WERT_TYPE unsigned char // Index of hardware modification: FF: Not supported index / Index of hardware modification: FF: Not supported // index // BF_22_F152_SUPPLIERINFO is a BITFIELD of size unsigned char. We don't yet generate definitions for each bit, we treat as the host data type // Supplier info tab / Tab Supplierinfo // STAT_HWMODEL: Mask: 0xC0 - hardware model // STAT_SUPPLIERINFOFIELD: Mask: 0x3F - supplierInfo #define I3_RES_EPS_BF_22_F152_SUPPLIERINFO (RXBUF_UCHAR(1)) #define I3_RES_EPS_BF_22_F152_SUPPLIERINFO_UNIT 'Bit' #define I3_RES_EPS_BF_22_F152_SUPPLIERINFO_TYPE unsigned char // Supplier info tab / Tab Supplierinfo #define I3_PID_EPS_FLASH_UPDATE_MULTITURNZAEHLER 0x1234 // Flash update of the multiturn counter / Flash Update des Multiturnzählers #define I3_RES_EPS_STAT_SERVICE (RXBUF_UCHAR(0)) #define I3_RES_EPS_STAT_SERVICE_UNIT '0-n' #define I3_RES_EPS_STAT_SERVICE_TYPE unsigned char // Status of the service / Status des Service #define I3_RES_EPS_STAT_PIC (RXBUF_UCHAR(1)) #define I3_RES_EPS_STAT_PIC_UNIT '0-n' #define I3_RES_EPS_STAT_PIC_TYPE unsigned char // Status of the processor to be flashed / Status des zu flashenden Prozessors
3,864
347
<gh_stars>100-1000 package com.ruoyi.activiti.mapper; import java.util.List; import com.ruoyi.activiti.vo.HiProcInsVo; public interface HistoryMapper { List<HiProcInsVo> getHiProcInsListDone(HiProcInsVo hiProcInsVo); }
93
363
<reponame>buddwm/hubble<filename>tests/unittests/modules/test_win_pkg.py from unittest import TestCase import pytest from unittest.mock import patch import mock from hubblestack.audit import win_pkg from hubblestack.exceptions import HubbleCheckValidationError class TestWinPkg(TestCase): @patch('hubblestack.module_runner.runner_utils.get_param_for_module') def test_get_filtered_params_to_log(self, get_param_for_module_mock): """ Check filtered logs output """ pkg_name = "Local Administrator Password Solution" block_id = "test_get_filtered_params_to_log" block_dict = { "args" : { "name": pkg_name } } get_param_for_module_mock.return_value = pkg_name result = win_pkg.get_filtered_params_to_log(block_id, block_dict, extra_args=None) self.assertEqual(result.get("name"), pkg_name) @patch('hubblestack.module_runner.runner_utils.get_param_for_module') def test_validate_params_positive(self, get_param_for_module_mock): """ test validate params for positive result """ pkg_name = "Local Administrator Password Solution" block_id = "test_validate_params_positive" block_dict = { "args" : { "name" : pkg_name } } win_pkg.runner_utils.get_chained_param = mock.Mock(return_value=None) get_param_for_module_mock.return_value = pkg_name win_pkg.validate_params(block_id, block_dict) @patch('hubblestack.module_runner.runner_utils.get_param_for_module') def test_validate_params_negative(self, get_param_for_module_mock): """ Test whether invalid input params will raise an exception or not. """ pkg_name = None block_id = "test_validate_params_negative" block_dict = { "args": { "name": pkg_name } } win_pkg.runner_utils.get_chained_param = mock.Mock(return_value=None) get_param_for_module_mock.return_value = pkg_name with pytest.raises(HubbleCheckValidationError) as exception: win_pkg.validate_params(block_id, block_dict) pytest.fail('Should not have passed') self.assertTrue('Mandatory parameter: name not found' in str(exception.value)) @patch('hubblestack.module_runner.runner_utils.get_param_for_module') def test_execute_positive(self, get_param_for_module_mock): """ test the execute function with positive result """ __mods__ = {} pkg_list = {"Local Administrator Password Solution": "6.2.0.0"} pkg_name = "Local Administrator Password Solution" block_id = "test_validate_params_negative" block_dict = { "args": { "name": pkg_name } } def list_pkgs(): return pkg_list __mods__['pkg.list_pkgs'] = list_pkgs win_pkg.__mods__ = __mods__ win_pkg.runner_utils.get_chained_param = mock.Mock(return_value=None) get_param_for_module_mock.return_value = pkg_name result = win_pkg.execute(block_id, block_dict) self.assertTrue(result[0]) self.assertTrue(isinstance(result[1], dict)) self.assertEqual(pkg_list.get("Local Administrator Password Solution"), result[1].get("result").get("package_version"))
1,749
432
<gh_stars>100-1000 /* * Copyright (c) 2010 by The DragonFly Project and <NAME>. * All rights reserved. * * This code is derived from software contributed to The DragonFly Project * by <NAME> <<EMAIL>> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name of The DragonFly Project nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific, prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include <sys/types.h> #include <sys/kernel.h> #include <sys/objcache.h> #include <sys/systm.h> #include <vm/vm.h> #include <vm/pmap.h> #include <vm/vm_extern.h> #include <vm/vm_kern.h> #include <vm/vm_page.h> #include <cpu/lwbuf.h> #include <machine/param.h> #if 0 /* * NO LONGER USED - See inlines */ static void lwbuf_init(void *); SYSINIT(sock_lwb, SI_BOOT2_MACHDEP, SI_ORDER_ANY, lwbuf_init, NULL); static struct objcache *lwbuf_cache; MALLOC_DEFINE(M_LWBUF, "lwbuf", "Lightweight buffers"); struct objcache_malloc_args lwbuf_malloc_args = { sizeof(struct lwbuf), M_LWBUF }; static boolean_t lwbuf_cache_ctor(void *obj, void *pdata, int ocflags) { struct lwbuf *lwb = (struct lwbuf *)obj; lwb->m = NULL; lwb->kva = 0; return (TRUE); } static void lwbuf_init(void *arg) { lwbuf_cache = objcache_create("lwbuf", 0, 0, lwbuf_cache_ctor, NULL, NULL, objcache_malloc_alloc, objcache_malloc_free, &lwbuf_malloc_args); } #endif #if 0 /* * NO LONGER USED - See inlines */ struct lwbuf * lwbuf_alloc(vm_page_t m, struct lwbuf *lwb_cache) { struct lwbuf *lwb = lwb_cache; lwb->m = m; lwb->kva = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(lwb->m)); return (lwb); } void lwbuf_free(struct lwbuf *lwb) { lwb->m = NULL; /* safety */ } #endif
1,094
348
<gh_stars>100-1000 {"nom":"Saint-Agnant-près-Crocq","circ":"1ère circonscription","dpt":"Creuse","inscrits":178,"abs":88,"votants":90,"blancs":4,"nuls":1,"exp":85,"res":[{"nuance":"LR","nom":"<NAME>","voix":50},{"nuance":"REM","nom":"<NAME>","voix":35}]}
106
302
<reponame>krish-dx/machina """ Test script for algorithms. """ import unittest import os import os import pickle import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import gym import machina as mc from machina.pols import GaussianPol, CategoricalPol, MultiCategoricalPol from machina.pols import DeterministicActionNoisePol, ArgmaxQfPol, MPCPol, RandomPol from machina.noise import OUActionNoise from machina.algos import ppo_clip, ppo_kl, trpo, ddpg, sac, svg, qtopt, on_pol_teacher_distill, behavior_clone, gail, airl, mpc, r2d2_sac, diayn, diayn_sac from machina.vfuncs import DeterministicSVfunc, DeterministicSAVfunc, CEMDeterministicSAVfunc from machina.models import DeterministicSModel from machina.envs import GymEnv, C2DEnv, SkillEnv from machina.traj import Traj from machina.traj import epi_functional as ef from machina.samplers import EpiSampler from machina import logger from machina.utils import measure, set_device from simple_net import PolNet, VNet, ModelNet, PolNetLSTM, VNetLSTM, ModelNetLSTM, QNet, QNetLSTM, DiscrimNet, DiaynDiscrimNet class TestPPOContinuous(unittest.TestCase): def setUp(self): self.env = GymEnv('Pendulum-v0') def test_learning(self): pol_net = PolNet(self.env.observation_space, self.env.action_space, h1=32, h2=32) pol = GaussianPol(self.env.observation_space, self.env.action_space, pol_net) vf_net = VNet(self.env.observation_space, h1=32, h2=32) vf = DeterministicSVfunc(self.env.observation_space, vf_net) sampler = EpiSampler(self.env, pol, num_parallel=1) optim_pol = torch.optim.Adam(pol_net.parameters(), 3e-4) optim_vf = torch.optim.Adam(vf_net.parameters(), 3e-4) epis = sampler.sample(pol, max_steps=32) traj = Traj() traj.add_epis(epis) traj = ef.compute_vs(traj, vf) traj = ef.compute_rets(traj, 0.99) traj = ef.compute_advs(traj, 0.99, 0.95) traj = ef.centerize_advs(traj) traj = ef.compute_h_masks(traj) traj.register_epis() result_dict = ppo_clip.train(traj=traj, pol=pol, vf=vf, clip_param=0.2, optim_pol=optim_pol, optim_vf=optim_vf, epoch=1, batch_size=32) result_dict = ppo_kl.train(traj=traj, pol=pol, vf=vf, kl_beta=0.1, kl_targ=0.2, optim_pol=optim_pol, optim_vf=optim_vf, epoch=1, batch_size=32, max_grad_norm=10) del sampler def test_learning_rnn(self): pol_net = PolNetLSTM( self.env.observation_space, self.env.action_space, h_size=32, cell_size=32) pol = GaussianPol(self.env.observation_space, self.env.action_space, pol_net, rnn=True) vf_net = VNetLSTM(self.env.observation_space, h_size=32, cell_size=32) vf = DeterministicSVfunc(self.env.observation_space, vf_net, rnn=True) sampler = EpiSampler(self.env, pol, num_parallel=1) optim_pol = torch.optim.Adam(pol_net.parameters(), 3e-4) optim_vf = torch.optim.Adam(vf_net.parameters(), 3e-4) epis = sampler.sample(pol, max_steps=400) traj = Traj() traj.add_epis(epis) traj = ef.compute_vs(traj, vf) traj = ef.compute_rets(traj, 0.99) traj = ef.compute_advs(traj, 0.99, 0.95) traj = ef.centerize_advs(traj) traj = ef.compute_h_masks(traj) traj.register_epis() result_dict = ppo_clip.train(traj=traj, pol=pol, vf=vf, clip_param=0.2, optim_pol=optim_pol, optim_vf=optim_vf, epoch=1, batch_size=2) result_dict = ppo_kl.train(traj=traj, pol=pol, vf=vf, kl_beta=0.1, kl_targ=0.2, optim_pol=optim_pol, optim_vf=optim_vf, epoch=1, batch_size=2, max_grad_norm=20) del sampler class TestPPODiscrete(unittest.TestCase): def setUp(self): self.env = GymEnv('CartPole-v0') def test_learning(self): pol_net = PolNet(self.env.observation_space, self.env.action_space, h1=32, h2=32) pol = CategoricalPol(self.env.observation_space, self.env.action_space, pol_net) vf_net = VNet(self.env.observation_space, h1=32, h2=32) vf = DeterministicSVfunc(self.env.observation_space, vf_net) sampler = EpiSampler(self.env, pol, num_parallel=1) optim_pol = torch.optim.Adam(pol_net.parameters(), 3e-4) optim_vf = torch.optim.Adam(vf_net.parameters(), 3e-4) epis = sampler.sample(pol, max_steps=32) traj = Traj() traj.add_epis(epis) traj = ef.compute_vs(traj, vf) traj = ef.compute_rets(traj, 0.99) traj = ef.compute_advs(traj, 0.99, 0.95) traj = ef.centerize_advs(traj) traj = ef.compute_h_masks(traj) traj.register_epis() result_dict = ppo_clip.train(traj=traj, pol=pol, vf=vf, clip_param=0.2, optim_pol=optim_pol, optim_vf=optim_vf, epoch=1, batch_size=32) result_dict = ppo_kl.train(traj=traj, pol=pol, vf=vf, kl_beta=0.1, kl_targ=0.2, optim_pol=optim_pol, optim_vf=optim_vf, epoch=1, batch_size=32, max_grad_norm=10) del sampler # def test_learning_rnn(self): # pol_net = PolNetLSTM(self.env.observation_space, self.env.action_space, h_size=32, cell_size=32) # pol = CategoricalPol(self.env.observation_space, self.env.action_space, pol_net, rnn=True) # vf_net = VNetLSTM(self.env.observation_space, h_size=32, cell_size=32) # vf = DeterministicSVfunc(self.env.observation_space, vf_net, rnn=True) # sampler = EpiSampler(self.env, pol, num_parallel=1) # optim_pol = torch.optim.Adam(pol_net.parameters(), 3e-4) # optim_vf = torch.optim.Adam(vf_net.parameters(), 3e-4) # epis = sampler.sample(pol, max_steps=400) # traj = Traj() # traj.add_epis(epis) # traj = ef.compute_vs(traj, vf) # traj = ef.compute_rets(traj, 0.99) # traj = ef.compute_advs(traj, 0.99, 0.95) # traj = ef.centerize_advs(traj) # traj = ef.compute_h_masks(traj) # traj.register_epis() # result_dict = ppo_clip.train(traj=traj, pol=pol, vf=vf, clip_param=0.2, # optim_pol=optim_pol, optim_vf=optim_vf, epoch=1, batch_size=2) # result_dict = ppo_kl.train(traj=traj, pol=pol, vf=vf, kl_beta=0.1, kl_targ=0.2, # optim_pol=optim_pol, optim_vf=optim_vf, epoch=1, batch_size=2, max_grad_norm=20) # del sampler class TestTRPOContinuous(unittest.TestCase): def setUp(self): self.env = GymEnv('Pendulum-v0') def test_learning(self): pol_net = PolNet(self.env.observation_space, self.env.action_space, h1=32, h2=32) pol = GaussianPol(self.env.observation_space, self.env.action_space, pol_net) vf_net = VNet(self.env.observation_space, h1=32, h2=32) vf = DeterministicSVfunc(self.env.observation_space, vf_net) sampler = EpiSampler(self.env, pol, num_parallel=1) optim_vf = torch.optim.Adam(vf_net.parameters(), 3e-4) epis = sampler.sample(pol, max_steps=32) traj = Traj() traj.add_epis(epis) traj = ef.compute_vs(traj, vf) traj = ef.compute_rets(traj, 0.99) traj = ef.compute_advs(traj, 0.99, 0.95) traj = ef.centerize_advs(traj) traj = ef.compute_h_masks(traj) traj.register_epis() result_dict = trpo.train(traj, pol, vf, optim_vf, 1, 24) del sampler def test_learning_rnn(self): pol_net = PolNetLSTM( self.env.observation_space, self.env.action_space, h_size=32, cell_size=32) pol = GaussianPol(self.env.observation_space, self.env.action_space, pol_net, rnn=True) vf_net = VNetLSTM(self.env.observation_space, h_size=32, cell_size=32) vf = DeterministicSVfunc(self.env.observation_space, vf_net, rnn=True) sampler = EpiSampler(self.env, pol, num_parallel=1) optim_pol = torch.optim.Adam(pol_net.parameters(), 3e-4) optim_vf = torch.optim.Adam(vf_net.parameters(), 3e-4) epis = sampler.sample(pol, max_steps=400) traj = Traj() traj.add_epis(epis) traj = ef.compute_vs(traj, vf) traj = ef.compute_rets(traj, 0.99) traj = ef.compute_advs(traj, 0.99, 0.95) traj = ef.centerize_advs(traj) traj = ef.compute_h_masks(traj) traj.register_epis() result_dict = trpo.train(traj, pol, vf, optim_vf, 1, 2) del sampler class TestTRPODiscrete(unittest.TestCase): def setUp(self): self.env = GymEnv('CartPole-v0') def test_learning(self): pol_net = PolNet(self.env.observation_space, self.env.action_space, h1=32, h2=32) pol = CategoricalPol(self.env.observation_space, self.env.action_space, pol_net) vf_net = VNet(self.env.observation_space, h1=32, h2=32) vf = DeterministicSVfunc(self.env.observation_space, vf_net) sampler = EpiSampler(self.env, pol, num_parallel=1) optim_vf = torch.optim.Adam(vf_net.parameters(), 3e-4) epis = sampler.sample(pol, max_steps=32) traj = Traj() traj.add_epis(epis) traj = ef.compute_vs(traj, vf) traj = ef.compute_rets(traj, 0.99) traj = ef.compute_advs(traj, 0.99, 0.95) traj = ef.centerize_advs(traj) traj = ef.compute_h_masks(traj) traj.register_epis() result_dict = trpo.train(traj, pol, vf, optim_vf, 1, 24) del sampler def test_learning_rnn(self): pol_net = PolNetLSTM( self.env.observation_space, self.env.action_space, h_size=32, cell_size=32) pol = CategoricalPol( self.env.observation_space, self.env.action_space, pol_net, rnn=True) vf_net = VNetLSTM(self.env.observation_space, h_size=32, cell_size=32) vf = DeterministicSVfunc(self.env.observation_space, vf_net, rnn=True) sampler = EpiSampler(self.env, pol, num_parallel=1) optim_vf = torch.optim.Adam(vf_net.parameters(), 3e-4) epis = sampler.sample(pol, max_steps=400) traj = Traj() traj.add_epis(epis) traj = ef.compute_vs(traj, vf) traj = ef.compute_rets(traj, 0.99) traj = ef.compute_advs(traj, 0.99, 0.95) traj = ef.centerize_advs(traj) traj = ef.compute_h_masks(traj) traj.register_epis() result_dict = trpo.train(traj, pol, vf, optim_vf, 1, 2) del sampler class TestDDPG(unittest.TestCase): def setUp(self): self.env = GymEnv('Pendulum-v0') def test_learning(self): pol_net = PolNet(self.env.observation_space, self.env.action_space, h1=32, h2=32, deterministic=True) noise = OUActionNoise(self.env.action_space) pol = DeterministicActionNoisePol( self.env.observation_space, self.env.action_space, pol_net, noise) targ_pol_net = PolNet( self.env.observation_space, self.env.action_space, 32, 32, deterministic=True) targ_pol_net.load_state_dict(pol_net.state_dict()) targ_noise = OUActionNoise(self.env.action_space) targ_pol = DeterministicActionNoisePol( self.env.observation_space, self.env.action_space, targ_pol_net, targ_noise) qf_net = QNet(self.env.observation_space, self.env.action_space, h1=32, h2=32) qf = DeterministicSAVfunc( self.env.observation_space, self.env.action_space, qf_net) targ_qf_net = QNet(self.env.observation_space, self.env.action_space, 32, 32) targ_qf_net.load_state_dict(targ_qf_net.state_dict()) targ_qf = DeterministicSAVfunc( self.env.observation_space, self.env.action_space, targ_qf_net) sampler = EpiSampler(self.env, pol, num_parallel=1) optim_pol = torch.optim.Adam(pol_net.parameters(), 3e-4) optim_qf = torch.optim.Adam(qf_net.parameters(), 3e-4) epis = sampler.sample(pol, max_steps=32) traj = Traj() traj.add_epis(epis) traj = ef.add_next_obs(traj) traj.register_epis() result_dict = ddpg.train( traj, pol, targ_pol, qf, targ_qf, optim_pol, optim_qf, 1, 32, 0.01, 0.9) del sampler class TestSVG(unittest.TestCase): def setUp(self): self.env = GymEnv('Pendulum-v0') def test_learning(self): pol_net = PolNet(self.env.observation_space, self.env.action_space, h1=32, h2=32) pol = GaussianPol(self.env.observation_space, self.env.action_space, pol_net) targ_pol_net = PolNet(self.env.observation_space, self.env.action_space, 32, 32) targ_pol_net.load_state_dict(pol_net.state_dict()) targ_pol = GaussianPol( self.env.observation_space, self.env.action_space, targ_pol_net) qf_net = QNet(self.env.observation_space, self.env.action_space, h1=32, h2=32) qf = DeterministicSAVfunc( self.env.observation_space, self.env.action_space, qf_net) targ_qf_net = QNet(self.env.observation_space, self.env.action_space, 32, 32) targ_qf_net.load_state_dict(targ_qf_net.state_dict()) targ_qf = DeterministicSAVfunc( self.env.observation_space, self.env.action_space, targ_qf_net) sampler = EpiSampler(self.env, pol, num_parallel=1) optim_pol = torch.optim.Adam(pol_net.parameters(), 3e-4) optim_qf = torch.optim.Adam(qf_net.parameters(), 3e-4) epis = sampler.sample(pol, max_steps=32) traj = Traj() traj.add_epis(epis) traj = ef.add_next_obs(traj) traj.register_epis() result_dict = svg.train( traj, pol, targ_pol, qf, targ_qf, optim_pol, optim_qf, 1, 32, 0.01, 0.9, 1) del sampler class TestSAC(unittest.TestCase): def setUp(self): self.env = GymEnv('Pendulum-v0') def test_learning(self): pol_net = PolNet(self.env.observation_space, self.env.action_space, h1=32, h2=32) pol = GaussianPol(self.env.observation_space, self.env.action_space, pol_net) qf_net1 = QNet(self.env.observation_space, self.env.action_space) qf1 = DeterministicSAVfunc( self.env.observation_space, self.env.action_space, qf_net1) targ_qf_net1 = QNet(self.env.observation_space, self.env.action_space) targ_qf_net1.load_state_dict(qf_net1.state_dict()) targ_qf1 = DeterministicSAVfunc( self.env.observation_space, self.env.action_space, targ_qf_net1) qf_net2 = QNet(self.env.observation_space, self.env.action_space) qf2 = DeterministicSAVfunc( self.env.observation_space, self.env.action_space, qf_net2) targ_qf_net2 = QNet(self.env.observation_space, self.env.action_space) targ_qf_net2.load_state_dict(qf_net2.state_dict()) targ_qf2 = DeterministicSAVfunc( self.env.observation_space, self.env.action_space, targ_qf_net2) qfs = [qf1, qf2] targ_qfs = [targ_qf1, targ_qf2] log_alpha = nn.Parameter(torch.zeros(())) sampler = EpiSampler(self.env, pol, num_parallel=1) optim_pol = torch.optim.Adam(pol_net.parameters(), 3e-4) optim_qf1 = torch.optim.Adam(qf_net1.parameters(), 3e-4) optim_qf2 = torch.optim.Adam(qf_net2.parameters(), 3e-4) optim_qfs = [optim_qf1, optim_qf2] optim_alpha = torch.optim.Adam([log_alpha], 3e-4) epis = sampler.sample(pol, max_steps=32) traj = Traj() traj.add_epis(epis) traj = ef.add_next_obs(traj) traj.register_epis() result_dict = sac.train( traj, pol, qfs, targ_qfs, log_alpha, optim_pol, optim_qfs, optim_alpha, 2, 32, 0.01, 0.99, 2, ) del sampler class TestQTOPT(unittest.TestCase): def setUp(self): self.env = GymEnv('Pendulum-v0') def test_learning(self): qf_net = QNet(self.env.observation_space, self.env.action_space, 32, 32) lagged_qf_net = QNet(self.env.observation_space, self.env.action_space, 32, 32) lagged_qf_net.load_state_dict(qf_net.state_dict()) targ_qf1_net = QNet(self.env.observation_space, self.env.action_space, 32, 32) targ_qf1_net.load_state_dict(qf_net.state_dict()) targ_qf2_net = QNet(self.env.observation_space, self.env.action_space, 32, 32) targ_qf2_net.load_state_dict(lagged_qf_net.state_dict()) qf = DeterministicSAVfunc( self.env.observation_space, self.env.action_space, qf_net) lagged_qf = DeterministicSAVfunc( self.env.observation_space, self.env.action_space, lagged_qf_net) targ_qf1 = CEMDeterministicSAVfunc(self.env.observation_space, self.env.action_space, targ_qf1_net, num_sampling=60, num_best_sampling=6, num_iter=2, multivari=False) targ_qf2 = DeterministicSAVfunc( self.env.observation_space, self.env.action_space, targ_qf2_net) pol = ArgmaxQfPol(self.env.observation_space, self.env.action_space, targ_qf1, eps=0.2) sampler = EpiSampler(self.env, pol, num_parallel=1) optim_qf = torch.optim.Adam(qf_net.parameters(), 3e-4) epis = sampler.sample(pol, max_steps=32) traj = Traj() traj.add_epis(epis) traj = ef.add_next_obs(traj) traj.register_epis() result_dict = qtopt.train( traj, qf, lagged_qf, targ_qf1, targ_qf2, optim_qf, 1000, 32, 0.9999, 0.995, 'mse' ) del sampler class TestOnpolicyDistillation(unittest.TestCase): def setUp(self): self.env = GymEnv('Pendulum-v0') def test_learning(self): t_pol_net = PolNet(self.env.observation_space, self.env.action_space, h1=200, h2=100) s_pol_net = PolNet(self.env.observation_space, self.env.action_space, h1=190, h2=90) t_pol = GaussianPol( self.env.observation_space, self.env.action_space, t_pol_net) s_pol = GaussianPol( self.env.observation_space, self.env.action_space, s_pol_net) student_sampler = EpiSampler(self.env, s_pol, num_parallel=1) optim_pol = torch.optim.Adam(s_pol.parameters(), 3e-4) epis = student_sampler.sample(s_pol, max_steps=32) traj = Traj() traj.add_epis(epis) traj = ef.compute_h_masks(traj) traj.register_epis() result_dict = on_pol_teacher_distill.train( traj=traj, student_pol=s_pol, teacher_pol=t_pol, student_optim=optim_pol, epoch=1, batchsize=32) del student_sampler class TestBehaviorClone(unittest.TestCase): def setUp(self): self.env = GymEnv('Pendulum-v0') def test_learning(self): pol_net = PolNet(self.env.observation_space, self.env.action_space, h1=32, h2=32) pol = GaussianPol(self.env.observation_space, self.env.action_space, pol_net) sampler = EpiSampler(self.env, pol, num_parallel=1) optim_pol = torch.optim.Adam(pol_net.parameters(), 3e-4) with open(os.path.join('data/expert_epis', 'Pendulum-v0_2epis.pkl'), 'rb') as f: expert_epis = pickle.load(f) train_epis, test_epis = ef.train_test_split( expert_epis, train_size=0.7) train_traj = Traj() train_traj.add_epis(train_epis) train_traj.register_epis() test_traj = Traj() test_traj.add_epis(test_epis) test_traj.register_epis() result_dict = behavior_clone.train( train_traj, pol, optim_pol, 256 ) del sampler class TestGAIL(unittest.TestCase): def setUp(self): self.env = GymEnv('Pendulum-v0') def test_learning(self): pol_net = PolNet(self.env.observation_space, self.env.action_space, h1=32, h2=32) pol = GaussianPol(self.env.observation_space, self.env.action_space, pol_net) vf_net = VNet(self.env.observation_space) vf = DeterministicSVfunc(self.env.observation_space, vf_net) discrim_net = DiscrimNet( self.env.observation_space, self.env.action_space, h1=32, h2=32) discrim = DeterministicSAVfunc( self.env.observation_space, self.env.action_space, discrim_net) sampler = EpiSampler(self.env, pol, num_parallel=1) optim_vf = torch.optim.Adam(vf_net.parameters(), 3e-4) optim_discrim = torch.optim.Adam(discrim_net.parameters(), 3e-4) with open(os.path.join('data/expert_epis', 'Pendulum-v0_2epis.pkl'), 'rb') as f: expert_epis = pickle.load(f) expert_traj = Traj() expert_traj.add_epis(expert_epis) expert_traj.register_epis() epis = sampler.sample(pol, max_steps=32) agent_traj = Traj() agent_traj.add_epis(epis) agent_traj = ef.compute_pseudo_rews(agent_traj, discrim) agent_traj = ef.compute_vs(agent_traj, vf) agent_traj = ef.compute_rets(agent_traj, 0.99) agent_traj = ef.compute_advs(agent_traj, 0.99, 0.95) agent_traj = ef.centerize_advs(agent_traj) agent_traj = ef.compute_h_masks(agent_traj) agent_traj.register_epis() result_dict = gail.train(agent_traj, expert_traj, pol, vf, discrim, optim_vf, optim_discrim, rl_type='trpo', epoch=1, batch_size=32, discrim_batch_size=32, discrim_step=1, pol_ent_beta=1e-3, discrim_ent_beta=1e-5) del sampler class TestAIRL(unittest.TestCase): def setUp(self): self.env = GymEnv('Pendulum-v0') def test_learning(self): pol_net = PolNet(self.env.observation_space, self.env.action_space, h1=32, h2=32) pol = GaussianPol(self.env.observation_space, self.env.action_space, pol_net) vf_net = VNet(self.env.observation_space) vf = DeterministicSVfunc(self.env.observation_space, vf_net) rewf_net = VNet(self.env.observation_space, h1=32, h2=32) rewf = DeterministicSVfunc(self.env.observation_space, rewf_net) shaping_vf_net = VNet(self.env.observation_space, h1=32, h2=32) shaping_vf = DeterministicSVfunc( self.env.observation_space, shaping_vf_net) sampler = EpiSampler(self.env, pol, num_parallel=1) optim_vf = torch.optim.Adam(vf_net.parameters(), 3e-4) optim_discrim = torch.optim.Adam( list(rewf_net.parameters()) + list(shaping_vf_net.parameters()), 3e-4) with open(os.path.join('data/expert_epis', 'Pendulum-v0_2epis.pkl'), 'rb') as f: expert_epis = pickle.load(f) expert_traj = Traj() expert_traj.add_epis(expert_epis) expert_traj = ef.add_next_obs(expert_traj) expert_traj.register_epis() epis = sampler.sample(pol, max_steps=32) agent_traj = Traj() agent_traj.add_epis(epis) agent_traj = ef.add_next_obs(agent_traj) agent_traj = ef.compute_pseudo_rews( agent_traj, rew_giver=rewf, state_only=True) agent_traj = ef.compute_vs(agent_traj, vf) agent_traj = ef.compute_rets(agent_traj, 0.99) agent_traj = ef.compute_advs(agent_traj, 0.99, 0.95) agent_traj = ef.centerize_advs(agent_traj) agent_traj = ef.compute_h_masks(agent_traj) agent_traj.register_epis() result_dict = airl.train(agent_traj, expert_traj, pol, vf, optim_vf, optim_discrim, rewf=rewf, shaping_vf=shaping_vf, rl_type='trpo', epoch=1, batch_size=32, discrim_batch_size=32, discrim_step=1, pol_ent_beta=1e-3, gamma=0.99) del sampler class TestMPC(unittest.TestCase): def setUp(self): self.env = GymEnv('Pendulum-v0') def add_noise_to_init_obs(self, epis, std): with torch.no_grad(): for epi in epis: epi['obs'][0] += np.random.normal(0, std, epi['obs'][0].shape) return epis def test_learning(self): def rew_func(next_obs, acs, mean_obs=0., std_obs=1., mean_acs=0., std_acs=1.): next_obs = next_obs * std_obs + mean_obs acs = acs * std_acs + mean_acs # Pendulum rews = -(torch.acos(next_obs[:, 0].clamp(min=-1, max=1))**2 + 0.1 * (next_obs[:, 2].clamp(min=-8, max=8)**2) + 0.001 * acs.squeeze(-1)**2) rews = rews.squeeze(0) return rews # init models dm_net = ModelNet(self.env.observation_space, self.env.action_space) dm = DeterministicSModel( self.env.observation_space, self.env.action_space, dm_net, rnn=False) mpc_pol = MPCPol(self.env.observation_space, self.env.action_space, dm_net, rew_func, 1, 1) optim_dm = torch.optim.Adam(dm_net.parameters(), 1e-3) # sample with mpc policy sampler = EpiSampler( self.env, mpc_pol, num_parallel=1) epis = sampler.sample( mpc_pol, max_epis=1) traj = Traj() traj.add_epis(epis) traj = ef.add_next_obs(traj) traj = ef.compute_h_masks(traj) traj.register_epis() # train result_dict = mpc.train_dm( traj, dm, optim_dm, epoch=1, batch_size=1) del sampler def test_learning_rnn(self): def rew_func(next_obs, acs, mean_obs=0., std_obs=1., mean_acs=0., std_acs=1.): next_obs = next_obs * std_obs + mean_obs acs = acs * std_acs + mean_acs # Pendulum rews = -(torch.acos(next_obs[:, 0].clamp(min=-1, max=1))**2 + 0.1 * (next_obs[:, 2].clamp(min=-8, max=8)**2) + 0.001 * acs.squeeze(-1)**2) rews = rews.squeeze(0) return rews # init models dm_net = ModelNetLSTM(self.env.observation_space, self.env.action_space) dm = DeterministicSModel( self.env.observation_space, self.env.action_space, dm_net, rnn=True) mpc_pol = MPCPol(self.env.observation_space, self.env.action_space, dm_net, rew_func, 1, 1, mean_obs=0., std_obs=1., mean_acs=0., std_acs=1., rnn=True) optim_dm = torch.optim.Adam(dm_net.parameters(), 1e-3) # sample with mpc policy sampler = EpiSampler( self.env, mpc_pol, num_parallel=1) epis = sampler.sample( mpc_pol, max_epis=1) traj = Traj() traj.add_epis(epis) traj = ef.add_next_obs(traj) traj = ef.compute_h_masks(traj) traj.register_epis() traj.add_traj(traj) # train result_dict = mpc.train_dm( traj, dm, optim_dm, epoch=1, batch_size=1) del sampler class TestR2D2SAC(unittest.TestCase): def setUp(self): self.env = GymEnv('Pendulum-v0') def test_learning(self): pol_net = PolNetLSTM( self.env.observation_space, self.env.action_space, h_size=32, cell_size=32) pol = GaussianPol(self.env.observation_space, self.env.action_space, pol_net, rnn=True) qf_net1 = QNetLSTM(self.env.observation_space, self.env.action_space, h_size=32, cell_size=32) qf1 = DeterministicSAVfunc( self.env.observation_space, self.env.action_space, qf_net1, rnn=True) targ_qf_net1 = QNetLSTM( self.env.observation_space, self.env.action_space, h_size=32, cell_size=32) targ_qf_net1.load_state_dict(qf_net1.state_dict()) targ_qf1 = DeterministicSAVfunc( self.env.observation_space, self.env.action_space, targ_qf_net1, rnn=True) qf_net2 = QNetLSTM(self.env.observation_space, self.env.action_space, h_size=32, cell_size=32) qf2 = DeterministicSAVfunc( self.env.observation_space, self.env.action_space, qf_net2, rnn=True) targ_qf_net2 = QNetLSTM( self.env.observation_space, self.env.action_space, h_size=32, cell_size=32) targ_qf_net2.load_state_dict(qf_net2.state_dict()) targ_qf2 = DeterministicSAVfunc( self.env.observation_space, self.env.action_space, targ_qf_net2, rnn=True) qfs = [qf1, qf2] targ_qfs = [targ_qf1, targ_qf2] log_alpha = nn.Parameter(torch.zeros(())) sampler = EpiSampler(self.env, pol, num_parallel=1) optim_pol = torch.optim.Adam(pol_net.parameters(), 3e-4) optim_qf1 = torch.optim.Adam(qf_net1.parameters(), 3e-4) optim_qf2 = torch.optim.Adam(qf_net2.parameters(), 3e-4) optim_qfs = [optim_qf1, optim_qf2] optim_alpha = torch.optim.Adam([log_alpha], 3e-4) epis = sampler.sample(pol, max_steps=32) traj = Traj() traj.add_epis(epis) traj = ef.add_next_obs(traj) max_pri = traj.get_max_pri() traj = ef.set_all_pris(traj, max_pri) traj = ef.compute_seq_pris(traj, 4) traj = ef.compute_h_masks(traj) for i in range(len(qfs)): traj = ef.compute_hs( traj, qfs[i], hs_name='q_hs' + str(i), input_acs=True) traj = ef.compute_hs( traj, targ_qfs[i], hs_name='targ_q_hs' + str(i), input_acs=True) traj.register_epis() result_dict = r2d2_sac.train( traj, pol, qfs, targ_qfs, log_alpha, optim_pol, optim_qfs, optim_alpha, 2, 32, 4, 2, 0.01, 0.99, 2, ) del sampler class TestDIAYN(unittest.TestCase): def setUp(self): self.env = GymEnv('Pendulum-v0') self.env = SkillEnv(self.env, num_skill=4) def test_learning(self): observation_space = self.env.real_observation_space skill_space = self.env.skill_space ob_skill_space = self.env.observation_space action_space = self.env.action_space ob_dim = ob_skill_space.shape[0] - 4 f_dim = ob_dim def discrim_f(x): return x pol_net = PolNet(ob_skill_space, action_space) pol = GaussianPol(ob_skill_space, action_space, pol_net) qf_net1 = QNet(ob_skill_space, action_space) qf1 = DeterministicSAVfunc(ob_skill_space, action_space, qf_net1) targ_qf_net1 = QNet(ob_skill_space, action_space) targ_qf_net1.load_state_dict(qf_net1.state_dict()) targ_qf1 = DeterministicSAVfunc( ob_skill_space, action_space, targ_qf_net1) qf_net2 = QNet(ob_skill_space, action_space) qf2 = DeterministicSAVfunc(ob_skill_space, action_space, qf_net2) targ_qf_net2 = QNet(ob_skill_space, action_space) targ_qf_net2.load_state_dict(qf_net2.state_dict()) targ_qf2 = DeterministicSAVfunc( ob_skill_space, action_space, targ_qf_net2) qfs = [qf1, qf2] targ_qfs = [targ_qf1, targ_qf2] log_alpha = nn.Parameter(torch.ones(())) high = np.array([np.finfo(np.float32).max] * f_dim) f_space = gym.spaces.Box(-high, high, dtype=np.float32) discrim_net = DiaynDiscrimNet( f_space, skill_space, h_size=100, discrim_f=discrim_f) discrim = DeterministicSVfunc(f_space, discrim_net) optim_pol = torch.optim.Adam(pol_net.parameters(), 1e-4) optim_qf1 = torch.optim.Adam(qf_net1.parameters(), 3e-4) optim_qf2 = torch.optim.Adam(qf_net2.parameters(), 3e-4) optim_qfs = [optim_qf1, optim_qf2] optim_alpha = torch.optim.Adam([log_alpha], 1e-4) optim_discrim = torch.optim.SGD(discrim.parameters(), lr=0.001, momentum=0.9) off_traj = Traj() sampler = EpiSampler(self.env, pol, num_parallel=1) epis = sampler.sample(pol, max_steps=200) on_traj = Traj() on_traj.add_epis(epis) on_traj = ef.add_next_obs(on_traj) on_traj = ef.compute_diayn_rews( on_traj, lambda x: diayn_sac.calc_rewards(x, 4, discrim)) on_traj.register_epis() off_traj.add_traj(on_traj) step = on_traj.num_step log_alpha = nn.Parameter(np.log(0.1) * torch.ones(())) # fix alpha result_dict = diayn_sac.train( off_traj, pol, qfs, targ_qfs, log_alpha, optim_pol, optim_qfs, optim_alpha, step, 128, 5e-3, 0.99, 1, discrim, 4, True) discrim_losses = diayn.train( discrim, optim_discrim, on_traj, 32, 100, 4) del sampler if __name__ == '__main__': t = TestDDPG() t.setUp() t.test_learning() t.tearDown()
18,083
381
<gh_stars>100-1000 package chen.testchat.base; import android.content.Context; import android.net.Uri; import android.widget.ImageView; import com.bumptech.glide.Glide; import com.bumptech.glide.load.engine.DiskCacheStrategy; import java.io.File; import chen.testchat.R; /** * 项目名称: TestChat * 创建人: 陈锦军 * 创建时间: 2016/11/29 13:14 * QQ: 1981367757 */ class GlideImageLoader implements ImageLoader { @Override public void displayImage(Context context, String path, ImageView imageView, int width, int height) { Glide.with(context).load(Uri.fromFile(new File(path))).error(R.mipmap.default_image).placeholder(R.drawable.location_default).diskCacheStrategy(DiskCacheStrategy.ALL).into(imageView); } }
340
4,320
/* * Copyright (c) 2020, Jordan <<EMAIL>> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package net.runelite.client.plugins.timers; import java.time.Instant; import static org.junit.Assert.assertEquals; import org.junit.Test; public class ElapsedTimerTest { @Test public void testGetText() { final Instant now = Instant.now(); final Instant fiveSecondsAgo = now.minusSeconds(5); final Instant fiveMinutesAgo = now.minusSeconds(5 * 60); final Instant oneHourAgo = now.minusSeconds(60 * 60); final Instant fiveHoursAgo = now.minusSeconds(5 * 60 * 60); assertEquals("00:00", timerText(now, now)); assertEquals("00:00", timerText(now, null)); assertEquals("00:05", timerText(fiveSecondsAgo, now)); assertEquals("00:05", timerText(fiveSecondsAgo, null)); assertEquals("04:55", timerText(fiveMinutesAgo, fiveSecondsAgo)); assertEquals("05:00", timerText(fiveMinutesAgo, now)); assertEquals("05:00", timerText(fiveMinutesAgo, null)); assertEquals("55:00", timerText(oneHourAgo, fiveMinutesAgo)); assertEquals("59:55", timerText(oneHourAgo, fiveSecondsAgo)); assertEquals("60:00", timerText(oneHourAgo, now)); assertEquals("60:00", timerText(oneHourAgo, null)); assertEquals("240:00", timerText(fiveHoursAgo, oneHourAgo)); assertEquals("295:00", timerText(fiveHoursAgo, fiveMinutesAgo)); assertEquals("299:55", timerText(fiveHoursAgo, fiveSecondsAgo)); assertEquals("300:00", timerText(fiveHoursAgo, now)); assertEquals("300:00", timerText(fiveHoursAgo, null)); } private static String timerText(final Instant startTime, final Instant lastTime) { return new ElapsedTimer(null, null, startTime, lastTime).getText(); } }
964
7,091
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import os import argparse import numpy as np from scipy.special import softmax import paddle from paddle import inference from paddlenlp.data import Stack, Tuple, Pad from paddlenlp.transformers import BertTokenizer def parse_args(): parser = argparse.ArgumentParser() parser.add_argument( "--model_path", default=None, type=str, required=True, help="The path prefix of inference model to be used.", ) parser.add_argument( "--device", default="gpu", type=str, choices=["cpu", "gpu", "xpu"], help="The device to select to train the model, is must be cpu/gpu/xpu.") parser.add_argument( "--max_seq_length", default=128, type=int, help="The maximum total input sequence length after tokenization. Sequences longer " "than this will be truncated, sequences shorter will be padded.", ) args = parser.parse_args() return args def convert_example(example, tokenizer, label_list, max_seq_length=128): text = example encoded_inputs = tokenizer(text=text, max_seq_len=max_seq_length) input_ids = encoded_inputs["input_ids"] segment_ids = encoded_inputs["token_type_ids"] return input_ids, segment_ids class Predictor(object): def __init__(self, predictor, input_handles, output_handle, tokenizer, max_seq_length): self.predictor = predictor self.input_handles = input_handles self.output_handle = output_handle self.tokenizer = tokenizer self.max_seq_length = max_seq_length @classmethod def create_predictor(cls, args): max_seq_length = args.max_seq_length config = paddle.inference.Config(args.model_path + ".pdmodel", args.model_path + ".pdiparams") if args.device == "gpu": # Set GPU configs accordingly config.enable_use_gpu(100, 0) elif args.device == "cpu": # Set CPU configs accordingly, # such as enable_mkldnn, set_cpu_math_library_num_threads config.disable_gpu() elif args.device == "xpu": # Set XPU configs accordingly config.enable_xpu(100) config.switch_use_feed_fetch_ops(False) predictor = paddle.inference.create_predictor(config) input_handles = [ predictor.get_input_handle(name) for name in predictor.get_input_names() ] output_handle = predictor.get_output_handle(predictor.get_output_names() [0]) tokenizer = BertTokenizer.from_pretrained( os.path.dirname(args.model_path)) return cls(predictor, input_handles, output_handle, tokenizer, max_seq_length) def predict(self, data, label_map, batch_size=1): examples = [] for text in data: input_ids, segment_ids = convert_example( text, self.tokenizer, label_list=label_map.values(), max_seq_length=self.max_seq_length) examples.append((input_ids, segment_ids)) batchify_fn = lambda samples, fn=Tuple( Pad(axis=0, pad_val=self.tokenizer.pad_token_id, dtype="int64"), # input Pad(axis=0, pad_val=self.tokenizer.pad_token_id, dtype="int64"), # segment ): fn(samples) # Seperates data into some batches. batches = [ examples[idx:idx + batch_size] for idx in range(0, len(examples), batch_size) ] outputs = [] results = [] for batch in batches: input_ids, segment_ids = batchify_fn(batch) self.input_handles[0].copy_from_cpu(input_ids) self.input_handles[1].copy_from_cpu(segment_ids) self.predictor.run() logits = self.output_handle.copy_to_cpu() probs = softmax(logits, axis=1) idx = np.argmax(probs, axis=1) idx = idx.tolist() labels = [label_map[i] for i in idx] outputs.extend(probs) results.extend(labels) return outputs, results def main(): args = parse_args() predictor = Predictor.create_predictor(args) data = [ 'against shimmering cinematography that lends the setting the ethereal beauty of an asian landscape painting', 'the situation in a well-balanced fashion', 'at achieving the modest , crowd-pleasing goals it sets for itself', 'so pat it makes your teeth hurt', 'this new jangle of noise , mayhem and stupidity must be a serious contender for the title .' ] label_map = {0: 'negative', 1: 'positive'} outputs, results = predictor.predict(data, label_map) for idx, text in enumerate(data): print( 'Data: {} \n Label: {} \n Negative prob: {} \n Positive prob: {} \n '. format(text, results[idx], outputs[idx][0], outputs[idx][1])) if __name__ == "__main__": main()
2,440
575
<filename>chromeos/services/machine_learning/public/cpp/service_connection_unittest.cc // Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chromeos/services/machine_learning/public/cpp/service_connection.h" #include <utility> #include <vector> #include "base/bind.h" #include "base/macros.h" #include "base/message_loop/message_pump_type.h" #include "base/run_loop.h" #include "base/test/bind.h" #include "base/test/task_environment.h" #include "base/threading/thread.h" #include "chromeos/dbus/machine_learning/machine_learning_client.h" #include "chromeos/services/machine_learning/public/cpp/fake_service_connection.h" #include "chromeos/services/machine_learning/public/mojom/graph_executor.mojom.h" #include "chromeos/services/machine_learning/public/mojom/handwriting_recognizer.mojom.h" #include "chromeos/services/machine_learning/public/mojom/machine_learning_service.mojom.h" #include "chromeos/services/machine_learning/public/mojom/model.mojom.h" #include "chromeos/services/machine_learning/public/mojom/tensor.mojom.h" #include "mojo/core/embedder/embedder.h" #include "mojo/core/embedder/scoped_ipc_support.h" #include "mojo/public/cpp/bindings/remote.h" #include "testing/gtest/include/gtest/gtest.h" namespace chromeos { namespace machine_learning { namespace { class ServiceConnectionTest : public testing::Test { public: ServiceConnectionTest() = default; void SetUp() override { MachineLearningClient::InitializeFake(); } void TearDown() override { MachineLearningClient::Shutdown(); } protected: static void SetUpTestCase() { task_environment_ = new base::test::TaskEnvironment(); static base::Thread ipc_thread("ipc"); ipc_thread.StartWithOptions( base::Thread::Options(base::MessagePumpType::IO, 0)); static mojo::core::ScopedIPCSupport ipc_support( ipc_thread.task_runner(), mojo::core::ScopedIPCSupport::ShutdownPolicy::CLEAN); ServiceConnection::GetInstance()->Initialize(); } static void TearDownTestCase() { if (task_environment_) { delete task_environment_; task_environment_ = nullptr; } } private: static base::test::TaskEnvironment* task_environment_; DISALLOW_COPY_AND_ASSIGN(ServiceConnectionTest); }; base::test::TaskEnvironment* ServiceConnectionTest::task_environment_; // Tests that LoadBuiltinModel runs OK (no crash) in a basic Mojo // environment. TEST_F(ServiceConnectionTest, LoadBuiltinModel) { mojo::Remote<mojom::Model> model; mojo::Remote<mojom::MachineLearningService> ml_service; ServiceConnection::GetInstance()->BindMachineLearningService( ml_service.BindNewPipeAndPassReceiver()); ml_service->LoadBuiltinModel( mojom::BuiltinModelSpec::New(mojom::BuiltinModelId::TEST_MODEL), model.BindNewPipeAndPassReceiver(), base::BindOnce([](mojom::LoadModelResult result) {})); // Also tests GetMachineLearningService runs OK. model.reset(); ServiceConnection::GetInstance() ->GetMachineLearningService() .LoadBuiltinModel( mojom::BuiltinModelSpec::New(mojom::BuiltinModelId::TEST_MODEL), model.BindNewPipeAndPassReceiver(), base::BindOnce([](mojom::LoadModelResult result) {})); } // Tests that LoadFlatBufferModel runs OK (no crash) in a basic Mojo // environment. TEST_F(ServiceConnectionTest, LoadFlatBufferModel) { mojo::Remote<mojom::MachineLearningService> ml_service; ServiceConnection::GetInstance()->BindMachineLearningService( ml_service.BindNewPipeAndPassReceiver()); mojo::Remote<mojom::Model> model; ml_service->LoadFlatBufferModel( mojom::FlatBufferModelSpec::New(), model.BindNewPipeAndPassReceiver(), base::BindOnce([](mojom::LoadModelResult result) {})); model.reset(); ServiceConnection::GetInstance() ->GetMachineLearningService() .LoadFlatBufferModel( mojom::FlatBufferModelSpec::New(), model.BindNewPipeAndPassReceiver(), base::BindOnce([](mojom::LoadModelResult result) {})); } // Tests that LoadTextClassifier runs OK (no crash) in a basic Mojo // environment. TEST_F(ServiceConnectionTest, LoadTextClassifier) { mojo::Remote<mojom::MachineLearningService> ml_service; ServiceConnection::GetInstance()->BindMachineLearningService( ml_service.BindNewPipeAndPassReceiver()); mojo::Remote<mojom::TextClassifier> text_classifier; ml_service->LoadTextClassifier( text_classifier.BindNewPipeAndPassReceiver(), base::BindOnce([](mojom::LoadModelResult result) {})); text_classifier.reset(); ServiceConnection::GetInstance() ->GetMachineLearningService() .LoadTextClassifier(text_classifier.BindNewPipeAndPassReceiver(), base::BindOnce([](mojom::LoadModelResult result) {})); } // Tests that LoadHandwritingModelWithSpec runs OK (no crash) in a basic Mojo // environment. TEST_F(ServiceConnectionTest, LoadHandwritingModelWithSpec) { mojo::Remote<mojom::MachineLearningService> ml_service; ServiceConnection::GetInstance()->BindMachineLearningService( ml_service.BindNewPipeAndPassReceiver()); mojo::Remote<mojom::HandwritingRecognizer> handwriting_recognizer; ml_service->LoadHandwritingModelWithSpec( mojom::HandwritingRecognizerSpec::New("en"), handwriting_recognizer.BindNewPipeAndPassReceiver(), base::BindOnce([](mojom::LoadModelResult result) {})); handwriting_recognizer.reset(); ServiceConnection::GetInstance() ->GetMachineLearningService() .LoadHandwritingModelWithSpec( mojom::HandwritingRecognizerSpec::New("en"), handwriting_recognizer.BindNewPipeAndPassReceiver(), base::BindOnce([](mojom::LoadModelResult result) {})); } // Tests that LoadGrammarChecker runs OK (no crash) in a basic Mojo environment. TEST_F(ServiceConnectionTest, LoadGrammarModel) { mojo::Remote<mojom::MachineLearningService> ml_service; ServiceConnection::GetInstance()->BindMachineLearningService( ml_service.BindNewPipeAndPassReceiver()); mojo::Remote<mojom::GrammarChecker> grammar_checker; ml_service->LoadGrammarChecker( grammar_checker.BindNewPipeAndPassReceiver(), base::BindOnce([](mojom::LoadModelResult result) {})); grammar_checker.reset(); ServiceConnection::GetInstance() ->GetMachineLearningService() .LoadGrammarChecker(grammar_checker.BindNewPipeAndPassReceiver(), base::BindOnce([](mojom::LoadModelResult result) {})); } // Tests the fake ML service for binding ml_service receiver. TEST_F(ServiceConnectionTest, BindMachineLearningService) { FakeServiceConnectionImpl fake_service_connection; ServiceConnection::UseFakeServiceConnectionForTesting( &fake_service_connection); ServiceConnection::GetInstance()->Initialize(); mojo::Remote<mojom::MachineLearningService> ml_service; ServiceConnection::GetInstance()->BindMachineLearningService( ml_service.BindNewPipeAndPassReceiver()); base::RunLoop().RunUntilIdle(); ASSERT_TRUE(ml_service.is_bound()); // Check the bound ml_service remote can be used to call // MachineLearningService methods. mojo::Remote<mojom::Model> model; bool callback_done = false; ml_service->LoadBuiltinModel( mojom::BuiltinModelSpec::New(mojom::BuiltinModelId::TEST_MODEL), model.BindNewPipeAndPassReceiver(), base::BindOnce( [](bool* callback_done, mojom::LoadModelResult result) { EXPECT_EQ(result, mojom::LoadModelResult::OK); *callback_done = true; }, &callback_done)); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(callback_done); EXPECT_TRUE(model.is_bound()); } class TestSodaClient : public mojom::SodaClient { void OnStop() override {} void OnStart() override {} void OnSpeechRecognizerEvent(mojom::SpeechRecognizerEventPtr event) override { } }; // Tests that LoadSpeechRecognizer runs OK without a crash in a basic Mojo // Environment. TEST_F(ServiceConnectionTest, LoadSpeechRecognizerAndCallback) { mojo::Remote<mojom::SodaRecognizer> soda_recognizer; TestSodaClient test_client; FakeServiceConnectionImpl fake_service_connection; ServiceConnection::UseFakeServiceConnectionForTesting( &fake_service_connection); ServiceConnection::GetInstance()->Initialize(); mojo::Receiver<mojom::SodaClient> soda_client{&test_client}; bool callback_done = false; auto config = mojom::SodaConfig::New(); base::RunLoop run_loop; ServiceConnection::GetInstance() ->GetMachineLearningService() .LoadSpeechRecognizer( std::move(config), soda_client.BindNewPipeAndPassRemote(), soda_recognizer.BindNewPipeAndPassReceiver(), base::BindLambdaForTesting([&](mojom::LoadModelResult result) { callback_done = true; EXPECT_EQ(result, mojom::LoadModelResult::OK); run_loop.Quit(); })); run_loop.Run(); ASSERT_TRUE(callback_done); } // Tests the fake ML service for builtin model. TEST_F(ServiceConnectionTest, FakeServiceConnectionForBuiltinModel) { mojo::Remote<mojom::Model> model; bool callback_done = false; FakeServiceConnectionImpl fake_service_connection; ServiceConnection::UseFakeServiceConnectionForTesting( &fake_service_connection); ServiceConnection::GetInstance()->Initialize(); const double expected_value = 200.002; fake_service_connection.SetOutputValue(std::vector<int64_t>{1L}, std::vector<double>{expected_value}); ServiceConnection::GetInstance() ->GetMachineLearningService() .LoadBuiltinModel( mojom::BuiltinModelSpec::New(mojom::BuiltinModelId::TEST_MODEL), model.BindNewPipeAndPassReceiver(), base::BindOnce( [](bool* callback_done, mojom::LoadModelResult result) { EXPECT_EQ(result, mojom::LoadModelResult::OK); *callback_done = true; }, &callback_done)); base::RunLoop().RunUntilIdle(); ASSERT_TRUE(callback_done); ASSERT_TRUE(model.is_bound()); callback_done = false; mojo::Remote<mojom::GraphExecutor> graph; model->CreateGraphExecutor( graph.BindNewPipeAndPassReceiver(), base::BindOnce( [](bool* callback_done, mojom::CreateGraphExecutorResult result) { EXPECT_EQ(result, mojom::CreateGraphExecutorResult::OK); *callback_done = true; }, &callback_done)); base::RunLoop().RunUntilIdle(); ASSERT_TRUE(callback_done); ASSERT_TRUE(graph.is_bound()); callback_done = false; base::flat_map<std::string, mojom::TensorPtr> inputs; std::vector<std::string> outputs; graph->Execute(std::move(inputs), std::move(outputs), base::BindOnce( [](bool* callback_done, double expected_value, const mojom::ExecuteResult result, base::Optional<std::vector<mojom::TensorPtr>> outputs) { EXPECT_EQ(result, mojom::ExecuteResult::OK); ASSERT_TRUE(outputs.has_value()); ASSERT_EQ(outputs->size(), 1LU); mojom::TensorPtr& tensor = (*outputs)[0]; EXPECT_EQ(tensor->data->get_float_list()->value[0], expected_value); *callback_done = true; }, &callback_done, expected_value)); base::RunLoop().RunUntilIdle(); ASSERT_TRUE(callback_done); } // Tests the fake ML service for flatbuffer model. TEST_F(ServiceConnectionTest, FakeServiceConnectionForFlatBufferModel) { mojo::Remote<mojom::Model> model; bool callback_done = false; FakeServiceConnectionImpl fake_service_connection; ServiceConnection::UseFakeServiceConnectionForTesting( &fake_service_connection); ServiceConnection::GetInstance()->Initialize(); const double expected_value = 200.002; fake_service_connection.SetOutputValue(std::vector<int64_t>{1L}, std::vector<double>{expected_value}); ServiceConnection::GetInstance() ->GetMachineLearningService() .LoadFlatBufferModel( mojom::FlatBufferModelSpec::New(), model.BindNewPipeAndPassReceiver(), base::BindOnce( [](bool* callback_done, mojom::LoadModelResult result) { EXPECT_EQ(result, mojom::LoadModelResult::OK); *callback_done = true; }, &callback_done)); base::RunLoop().RunUntilIdle(); ASSERT_TRUE(callback_done); ASSERT_TRUE(model.is_bound()); callback_done = false; mojo::Remote<mojom::GraphExecutor> graph; model->CreateGraphExecutor( graph.BindNewPipeAndPassReceiver(), base::BindOnce( [](bool* callback_done, mojom::CreateGraphExecutorResult result) { EXPECT_EQ(result, mojom::CreateGraphExecutorResult::OK); *callback_done = true; }, &callback_done)); base::RunLoop().RunUntilIdle(); ASSERT_TRUE(callback_done); ASSERT_TRUE(graph.is_bound()); callback_done = false; base::flat_map<std::string, mojom::TensorPtr> inputs; std::vector<std::string> outputs; graph->Execute(std::move(inputs), std::move(outputs), base::BindOnce( [](bool* callback_done, double expected_value, const mojom::ExecuteResult result, base::Optional<std::vector<mojom::TensorPtr>> outputs) { EXPECT_EQ(result, mojom::ExecuteResult::OK); ASSERT_TRUE(outputs.has_value()); ASSERT_EQ(outputs->size(), 1LU); mojom::TensorPtr& tensor = (*outputs)[0]; EXPECT_EQ(tensor->data->get_float_list()->value[0], expected_value); *callback_done = true; }, &callback_done, expected_value)); base::RunLoop().RunUntilIdle(); ASSERT_TRUE(callback_done); } // Tests the fake ML service for text classifier annotation. TEST_F(ServiceConnectionTest, FakeServiceConnectionForTextClassifierAnnotation) { mojo::Remote<mojom::TextClassifier> text_classifier; bool callback_done = false; FakeServiceConnectionImpl fake_service_connection; ServiceConnection::UseFakeServiceConnectionForTesting( &fake_service_connection); ServiceConnection::GetInstance()->Initialize(); auto dummy_data = mojom::TextEntityData::New(); dummy_data->set_numeric_value(123456789.); std::vector<mojom::TextEntityPtr> entities; entities.emplace_back( mojom::TextEntity::New("dummy", // Entity name. 1.0, // Confidence score. std::move(dummy_data))); // Data extracted. auto dummy_annotation = mojom::TextAnnotation::New(123, // Start offset. 321, // End offset. std::move(entities)); std::vector<mojom::TextAnnotationPtr> annotations; annotations.emplace_back(std::move(dummy_annotation)); fake_service_connection.SetOutputAnnotation(annotations); ServiceConnection::GetInstance() ->GetMachineLearningService() .LoadTextClassifier( text_classifier.BindNewPipeAndPassReceiver(), base::BindOnce( [](bool* callback_done, mojom::LoadModelResult result) { EXPECT_EQ(result, mojom::LoadModelResult::OK); *callback_done = true; }, &callback_done)); base::RunLoop().RunUntilIdle(); ASSERT_TRUE(callback_done); ASSERT_TRUE(text_classifier.is_bound()); auto request = mojom::TextAnnotationRequest::New(); bool infer_callback_done = false; text_classifier->Annotate( std::move(request), base::BindOnce( [](bool* infer_callback_done, std::vector<mojom::TextAnnotationPtr> annotations) { *infer_callback_done = true; // Check if the annotation is correct. EXPECT_EQ(annotations[0]->start_offset, 123u); EXPECT_EQ(annotations[0]->end_offset, 321u); EXPECT_EQ(annotations[0]->entities[0]->name, "dummy"); EXPECT_EQ(annotations[0]->entities[0]->confidence_score, 1.0); EXPECT_EQ(annotations[0]->entities[0]->data->get_numeric_value(), 123456789.); }, &infer_callback_done)); base::RunLoop().RunUntilIdle(); ASSERT_TRUE(infer_callback_done); } // Tests the fake ML service for text classifier suggest selection. TEST_F(ServiceConnectionTest, FakeServiceConnectionForTextClassifierSuggestSelection) { mojo::Remote<mojom::TextClassifier> text_classifier; bool callback_done = false; FakeServiceConnectionImpl fake_service_connection; ServiceConnection::UseFakeServiceConnectionForTesting( &fake_service_connection); ServiceConnection::GetInstance()->Initialize(); auto span = mojom::CodepointSpan::New(); span->start_offset = 1; span->end_offset = 2; fake_service_connection.SetOutputSelection(span); ServiceConnection::GetInstance() ->GetMachineLearningService() .LoadTextClassifier( text_classifier.BindNewPipeAndPassReceiver(), base::BindOnce( [](bool* callback_done, mojom::LoadModelResult result) { EXPECT_EQ(result, mojom::LoadModelResult::OK); *callback_done = true; }, &callback_done)); base::RunLoop().RunUntilIdle(); ASSERT_TRUE(callback_done); ASSERT_TRUE(text_classifier.is_bound()); auto request = mojom::TextSuggestSelectionRequest::New(); request->user_selection = mojom::CodepointSpan::New(); bool infer_callback_done = false; text_classifier->SuggestSelection( std::move(request), base::BindOnce( [](bool* infer_callback_done, mojom::CodepointSpanPtr suggested_span) { *infer_callback_done = true; // Check if the suggestion is correct. EXPECT_EQ(suggested_span->start_offset, 1u); EXPECT_EQ(suggested_span->end_offset, 2u); }, &infer_callback_done)); base::RunLoop().RunUntilIdle(); ASSERT_TRUE(infer_callback_done); } // Tests the fake ML service for text classifier language identification. TEST_F(ServiceConnectionTest, FakeServiceConnectionForTextClassifierFindLanguages) { mojo::Remote<mojom::TextClassifier> text_classifier; bool callback_done = false; FakeServiceConnectionImpl fake_service_connection; ServiceConnection::UseFakeServiceConnectionForTesting( &fake_service_connection); ServiceConnection::GetInstance()->Initialize(); std::vector<mojom::TextLanguagePtr> languages; languages.emplace_back(mojom::TextLanguage::New("en", 0.9)); languages.emplace_back(mojom::TextLanguage::New("fr", 0.1)); fake_service_connection.SetOutputLanguages(languages); ServiceConnection::GetInstance() ->GetMachineLearningService() .LoadTextClassifier( text_classifier.BindNewPipeAndPassReceiver(), base::BindOnce( [](bool* callback_done, mojom::LoadModelResult result) { EXPECT_EQ(result, mojom::LoadModelResult::OK); *callback_done = true; }, &callback_done)); base::RunLoop().RunUntilIdle(); ASSERT_TRUE(callback_done); ASSERT_TRUE(text_classifier.is_bound()); std::string input_text = "dummy input text"; bool infer_callback_done = false; text_classifier->FindLanguages( input_text, base::BindOnce( [](bool* infer_callback_done, std::vector<mojom::TextLanguagePtr> languages) { *infer_callback_done = true; // Check if the suggestion is correct. ASSERT_EQ(languages.size(), 2ul); EXPECT_EQ(languages[0]->locale, "en"); EXPECT_EQ(languages[0]->confidence, 0.9f); EXPECT_EQ(languages[1]->locale, "fr"); EXPECT_EQ(languages[1]->confidence, 0.1f); }, &infer_callback_done)); base::RunLoop().RunUntilIdle(); ASSERT_TRUE(infer_callback_done); } // Tests the fake ML service for handwriting. TEST_F(ServiceConnectionTest, FakeHandWritingRecognizer) { mojo::Remote<mojom::HandwritingRecognizer> recognizer; bool callback_done = false; FakeServiceConnectionImpl fake_service_connection; ServiceConnection::UseFakeServiceConnectionForTesting( &fake_service_connection); ServiceConnection::GetInstance()->Initialize(); ServiceConnection::GetInstance() ->GetMachineLearningService() .LoadHandwritingModel( mojom::HandwritingRecognizerSpec::New("en"), recognizer.BindNewPipeAndPassReceiver(), base::BindOnce( [](bool* callback_done, mojom::LoadHandwritingModelResult result) { EXPECT_EQ(result, mojom::LoadHandwritingModelResult::OK); *callback_done = true; }, &callback_done)); base::RunLoop().RunUntilIdle(); ASSERT_TRUE(callback_done); ASSERT_TRUE(recognizer.is_bound()); // Construct fake output. mojom::HandwritingRecognizerResultPtr result = mojom::HandwritingRecognizerResult::New(); result->status = mojom::HandwritingRecognizerResult::Status::OK; mojom::HandwritingRecognizerCandidatePtr candidate = mojom::HandwritingRecognizerCandidate::New(); candidate->text = "cat"; candidate->score = 0.5f; result->candidates.emplace_back(std::move(candidate)); fake_service_connection.SetOutputHandwritingRecognizerResult(result); auto query = mojom::HandwritingRecognitionQuery::New(); bool infer_callback_done = false; recognizer->Recognize( std::move(query), base::BindOnce( [](bool* infer_callback_done, mojom::HandwritingRecognizerResultPtr result) { *infer_callback_done = true; // Check if the annotation is correct. ASSERT_EQ(result->status, mojom::HandwritingRecognizerResult::Status::OK); EXPECT_EQ(result->candidates.at(0)->text, "cat"); EXPECT_EQ(result->candidates.at(0)->score, 0.5f); }, &infer_callback_done)); base::RunLoop().RunUntilIdle(); ASSERT_TRUE(infer_callback_done); } // Tests the deprecated fake ML service for handwriting. // Deprecated API. TEST_F(ServiceConnectionTest, FakeHandWritingRecognizerWithSpec) { mojo::Remote<mojom::HandwritingRecognizer> recognizer; bool callback_done = false; FakeServiceConnectionImpl fake_service_connection; ServiceConnection::UseFakeServiceConnectionForTesting( &fake_service_connection); ServiceConnection::GetInstance()->Initialize(); ServiceConnection::GetInstance() ->GetMachineLearningService() .LoadHandwritingModelWithSpec( mojom::HandwritingRecognizerSpec::New("en"), recognizer.BindNewPipeAndPassReceiver(), base::BindOnce( [](bool* callback_done, mojom::LoadModelResult result) { EXPECT_EQ(result, mojom::LoadModelResult::OK); *callback_done = true; }, &callback_done)); base::RunLoop().RunUntilIdle(); ASSERT_TRUE(callback_done); ASSERT_TRUE(recognizer.is_bound()); // Construct fake output. mojom::HandwritingRecognizerResultPtr result = mojom::HandwritingRecognizerResult::New(); result->status = mojom::HandwritingRecognizerResult::Status::OK; mojom::HandwritingRecognizerCandidatePtr candidate = mojom::HandwritingRecognizerCandidate::New(); candidate->text = "cat"; candidate->score = 0.5f; result->candidates.emplace_back(std::move(candidate)); fake_service_connection.SetOutputHandwritingRecognizerResult(result); auto query = mojom::HandwritingRecognitionQuery::New(); bool infer_callback_done = false; recognizer->Recognize( std::move(query), base::BindOnce( [](bool* infer_callback_done, mojom::HandwritingRecognizerResultPtr result) { *infer_callback_done = true; // Check if the annotation is correct. ASSERT_EQ(result->status, mojom::HandwritingRecognizerResult::Status::OK); EXPECT_EQ(result->candidates.at(0)->text, "cat"); EXPECT_EQ(result->candidates.at(0)->score, 0.5f); }, &infer_callback_done)); base::RunLoop().RunUntilIdle(); ASSERT_TRUE(infer_callback_done); } // Tests the fake ML service for web platform handwriting recognizer. TEST_F(ServiceConnectionTest, FakeWebPlatformHandWritingRecognizer) { mojo::Remote<web_platform::mojom::HandwritingRecognizer> recognizer; bool callback_done = false; FakeServiceConnectionImpl fake_service_connection; ServiceConnection::UseFakeServiceConnectionForTesting( &fake_service_connection); ServiceConnection::GetInstance()->Initialize(); auto constraint = web_platform::mojom::HandwritingModelConstraint::New(); constraint->languages.emplace_back("en"); ServiceConnection::GetInstance() ->GetMachineLearningService() .LoadWebPlatformHandwritingModel( std::move(constraint), recognizer.BindNewPipeAndPassReceiver(), base::BindOnce( [](bool* callback_done, mojom::LoadHandwritingModelResult result) { EXPECT_EQ(result, mojom::LoadHandwritingModelResult::OK); *callback_done = true; }, &callback_done)); base::RunLoop().RunUntilIdle(); ASSERT_TRUE(callback_done); ASSERT_TRUE(recognizer.is_bound()); // Construct fake output. std::vector<web_platform::mojom::HandwritingPredictionPtr> predictions; auto prediction1 = web_platform::mojom::HandwritingPrediction::New(); prediction1->text = "recognition1"; predictions.emplace_back(std::move(prediction1)); fake_service_connection.SetOutputWebPlatformHandwritingRecognizerResult( predictions); std::vector<web_platform::mojom::HandwritingStrokePtr> strokes; auto hints = web_platform::mojom::HandwritingHints::New(); bool infer_callback_done = false; recognizer->GetPrediction( std::move(strokes), std::move(hints), base::BindOnce( [](bool* infer_callback_done, base::Optional<std::vector< web_platform::mojom::HandwritingPredictionPtr>> predictions) { *infer_callback_done = true; ASSERT_TRUE(predictions.has_value()); ASSERT_EQ(predictions.value().size(), 1u); }, &infer_callback_done)); base::RunLoop().RunUntilIdle(); ASSERT_TRUE(infer_callback_done); } TEST_F(ServiceConnectionTest, FakeGrammarChecker) { mojo::Remote<mojom::GrammarChecker> checker; bool callback_done = false; FakeServiceConnectionImpl fake_service_connection; ServiceConnection::UseFakeServiceConnectionForTesting( &fake_service_connection); ServiceConnection::GetInstance()->Initialize(); ServiceConnection::GetInstance() ->GetMachineLearningService() .LoadGrammarChecker( checker.BindNewPipeAndPassReceiver(), base::BindOnce( [](bool* callback_done, mojom::LoadModelResult result) { EXPECT_EQ(result, mojom::LoadModelResult::OK); *callback_done = true; }, &callback_done)); base::RunLoop().RunUntilIdle(); ASSERT_TRUE(callback_done); ASSERT_TRUE(checker.is_bound()); // Construct fake output mojom::GrammarCheckerResultPtr result = mojom::GrammarCheckerResult::New(); result->status = mojom::GrammarCheckerResult::Status::OK; mojom::GrammarCheckerCandidatePtr candidate = mojom::GrammarCheckerCandidate::New(); candidate->text = "cat"; candidate->score = 0.5f; mojom::GrammarCorrectionFragmentPtr fragment = mojom::GrammarCorrectionFragment::New(); fragment->offset = 3; fragment->length = 5; fragment->replacement = "dog"; candidate->fragments.emplace_back(std::move(fragment)); result->candidates.emplace_back(std::move(candidate)); fake_service_connection.SetOutputGrammarCheckerResult(result); auto query = mojom::GrammarCheckerQuery::New(); bool infer_callback_done = false; checker->Check( std::move(query), base::BindOnce( [](bool* infer_callback_done, mojom::GrammarCheckerResultPtr result) { *infer_callback_done = true; // Check if the annotation is correct. ASSERT_EQ(result->status, mojom::GrammarCheckerResult::Status::OK); ASSERT_EQ(result->candidates.size(), 1UL); EXPECT_EQ(result->candidates.at(0)->text, "cat"); EXPECT_EQ(result->candidates.at(0)->score, 0.5f); ASSERT_EQ(result->candidates.at(0)->fragments.size(), 1UL); EXPECT_EQ(result->candidates.at(0)->fragments.at(0)->offset, 3U); EXPECT_EQ(result->candidates.at(0)->fragments.at(0)->length, 5U); EXPECT_EQ(result->candidates.at(0)->fragments.at(0)->replacement, "dog"); }, &infer_callback_done)); base::RunLoop().RunUntilIdle(); ASSERT_TRUE(infer_callback_done); } } // namespace } // namespace machine_learning } // namespace chromeos
12,161
2,205
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <memory> #include <gtest/gtest.h> #include <folly/Range.h> #include <folly/json.h> #include "mcrouter/CarbonRouterInstance.h" #include "mcrouter/lib/network/gen/MemcacheRouterInfo.h" #include "mcrouter/options.h" #include "mcrouter/routes/ShadowSettings.h" using namespace facebook::memcache; using namespace facebook::memcache::mcrouter; class ShadowSettingsTest : public ::testing::Test { public: template <class RouterInfo> CarbonRouterInstance<RouterInfo>& getRouter() const { constexpr folly::StringPiece kRouterInfoName(RouterInfo::name); const std::string kInstanceName = folly::to<std::string>("TestRouter:", kRouterInfoName); auto router = CarbonRouterInstance<RouterInfo>::init(kInstanceName, getOpts()); CHECK(router != nullptr) << "router shouldn't be nullptr"; return *router; } void expectApproximatelyEqual(size_t expected, size_t actual, size_t margin) { EXPECT_TRUE(actual >= (expected - margin)); EXPECT_TRUE(actual <= (expected + margin)); } std::mt19937& randomGenerator() { return randomGenerator_; } private: static McrouterOptions getOpts() { // Dummy config, used just to spin up mcrouter. constexpr folly::StringPiece kDummyConfig = R"( { "route": "NullRoute" } )"; McrouterOptions opts; opts.num_proxies = 1; opts.stats_logging_interval = 0; opts.config = kDummyConfig.str(); return opts; } std::mt19937 randomGenerator_; }; TEST_F(ShadowSettingsTest, create) { constexpr folly::StringPiece kConfig = R"( { "key_fraction_range": [0.5, 1.0], "index_range": [0, 1] } )"; const auto json = folly::parseJson(kConfig); auto& router = getRouter<MemcacheRouterInfo>(); auto shadowSettings = ShadowSettings::create(json, router); EXPECT_TRUE(shadowSettings != nullptr); } TEST_F(ShadowSettingsTest, shouldRoute) { constexpr folly::StringPiece kConfig = R"( { "key_fraction_range": [0.0, 0.5] } )"; const auto json = folly::parseJson(kConfig); auto& router = getRouter<MemcacheRouterInfo>(); auto shadowSettings = ShadowSettings::create(json, router); ASSERT_TRUE(shadowSettings != nullptr); McGetRequest req1("good_key"); bool res1 = shadowSettings->shouldShadow(req1, randomGenerator()); EXPECT_TRUE(res1); McGetRequest req2("out_of_range_key_test"); bool res2 = shadowSettings->shouldShadow(req2, randomGenerator()); EXPECT_FALSE(res2); constexpr size_t kNumRuns = 10000; constexpr size_t kExpected = kNumRuns / 2; constexpr size_t kMargin = 10000 * 0.01; size_t yes = 0; size_t no = 0; for (size_t i = 0; i < kNumRuns; ++i) { McGetRequest req(folly::to<std::string>(i)); if (shadowSettings->shouldShadow(req, randomGenerator())) { ++yes; } else { ++no; } } expectApproximatelyEqual(kExpected, yes, kMargin); expectApproximatelyEqual(kExpected, no, kMargin); } TEST_F(ShadowSettingsTest, shouldRoute_random) { constexpr folly::StringPiece kConfig = R"( { "key_fraction_range": [0.0, 1.0], "requests_fraction": 0.5 } )"; const auto json = folly::parseJson(kConfig); auto& router = getRouter<MemcacheRouterInfo>(); auto shadowSettings = ShadowSettings::create(json, router); ASSERT_TRUE(shadowSettings != nullptr); constexpr size_t kNumRuns = 10000; constexpr size_t kExpected = kNumRuns / 2; constexpr size_t kMargin = 10000 * 0.01; size_t yes = 0; size_t no = 0; for (size_t i = 0; i < kNumRuns; ++i) { McGetRequest req(folly::to<std::string>(i)); if (shadowSettings->shouldShadow(req, randomGenerator())) { ++yes; } else { ++no; } } expectApproximatelyEqual(kExpected, yes, kMargin); expectApproximatelyEqual(kExpected, no, kMargin); }
1,499
937
<reponame>zmyer/cyclops-react<filename>cyclops-anym/src/test/java/cyclops/monads/data/BankersQueueTest.java package cyclops.monads.data; import com.oath.cyclops.anym.AnyMSeq; import cyclops.reactive.collections.mutable.ListX; import cyclops.data.BankersQueue; import cyclops.monads.AnyM; import cyclops.monads.Witness.bankersQueue; import cyclops.monads.collections.AbstractAnyMSeqOrderedDependentTest; import org.junit.Ignore; import org.junit.Test; import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertThat; public class BankersQueueTest extends AbstractAnyMSeqOrderedDependentTest<bankersQueue> { @Override public <T> AnyMSeq<bankersQueue,T> of(T... values) { return AnyM.fromBankersQueue(BankersQueue.of(values)); } @Override public <T> AnyMSeq<bankersQueue,T> empty() { return AnyM.fromBankersQueue(BankersQueue.empty()); } @Test @Ignore //only works for lazy data types public void testRecover1(){ } @Test @Ignore //only works for lazy data types public void testRecover2(){ } }
385
1,209
<filename>packages/schematics/angular/application/schema.json<gh_stars>1000+ { "$schema": "http://json-schema.org/draft-07/schema", "$id": "SchematicsAngularApp", "title": "Angular Application Options Schema", "type": "object", "description": "Generates a new basic app definition in the \"projects\" subfolder of the workspace.", "additionalProperties": false, "properties": { "projectRoot": { "description": "The root directory of the new app.", "type": "string", "visible": false }, "name": { "description": "The name of the new app.", "type": "string", "$default": { "$source": "argv", "index": 0 }, "x-prompt": "What name would you like to use for the application?" }, "inlineStyle": { "description": "Include styles inline in the root component.ts file. Only CSS styles can be included inline. Default is false, meaning that an external styles file is created and referenced in the root component.ts file.", "type": "boolean", "alias": "s", "x-user-analytics": 9 }, "inlineTemplate": { "description": "Include template inline in the root component.ts file. Default is false, meaning that an external template file is created and referenced in the root component.ts file. ", "type": "boolean", "alias": "t", "x-user-analytics": 10 }, "viewEncapsulation": { "description": "The view encapsulation strategy to use in the new application.", "enum": ["Emulated", "None", "ShadowDom"], "type": "string", "x-user-analytics": 11 }, "routing": { "type": "boolean", "description": "Create a routing NgModule.", "default": false, "x-prompt": "Would you like to add Angular routing?", "x-user-analytics": 17 }, "prefix": { "type": "string", "format": "html-selector", "description": "A prefix to apply to generated selectors.", "default": "app", "alias": "p" }, "style": { "description": "The file extension or preprocessor to use for style files.", "type": "string", "default": "css", "enum": ["css", "scss", "sass", "less"], "x-prompt": { "message": "Which stylesheet format would you like to use?", "type": "list", "items": [ { "value": "css", "label": "CSS" }, { "value": "scss", "label": "SCSS [ https://sass-lang.com/documentation/syntax#scss ]" }, { "value": "sass", "label": "Sass [ https://sass-lang.com/documentation/syntax#the-indented-syntax ]" }, { "value": "less", "label": "Less [ http://lesscss.org ]" } ] }, "x-user-analytics": 5 }, "skipTests": { "description": "Do not create \"spec.ts\" test files for the application.", "type": "boolean", "default": false, "alias": "S", "x-user-analytics": 12 }, "skipPackageJson": { "type": "boolean", "default": false, "description": "Do not add dependencies to the \"package.json\" file." }, "minimal": { "description": "Create a bare-bones project without any testing frameworks. (Use for learning purposes only.)", "type": "boolean", "default": false, "x-user-analytics": 14 }, "skipInstall": { "description": "Skip installing dependency packages.", "type": "boolean", "default": false }, "strict": { "description": "Creates an application with stricter bundle budgets settings.", "type": "boolean", "default": true, "x-user-analytics": 7 } }, "required": ["name"] }
1,616
2,381
<filename>test-harness/src/main/java/io/jenkins/plugins/casc/misc/ConfiguredWithReadme.java package io.jenkins.plugins.casc.misc; import java.lang.annotation.Retention; import java.lang.annotation.Target; import org.junit.Test; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.RetentionPolicy.RUNTIME; /** * To load specified config with plugin from a README file */ @Target({METHOD,FIELD}) @Retention(RUNTIME) public @interface ConfiguredWithReadme { /** * Resource path in classpath * @return resources to configure the test case with */ String[] value(); Class<? extends Throwable> expected() default Test.None.class; String message() default ""; }
251
4,772
package example.service; import example.repo.Customer1115Repository; import org.springframework.stereotype.Service; @Service public class Customer1115Service { public Customer1115Service(Customer1115Repository repo) {} }
64
3,428
{"id":"01331","group":"easy-ham-2","checksum":{"type":"MD5","value":"b40a16937c61ddfa8d0057b15eada675"},"text":"Return-Path: [email protected]\nDelivery-Date: Thu Aug 15 03:00:42 2002\nReturn-Path: <<EMAIL>>\nReceived: from cpu59.osdn.com (slashdot.org [64.28.67.73] (may be forged))\n\tby dogma.slashnull.org (8.11.6/8.11.6) with ESMTP id g7F20f414803\n\tfor <<EMAIL>>; Thu, 15 Aug 2002 03:00:42 +0100\nReceived: from [10.2.181.14] (helo=perl.org)\n\tby cpu59.osdn.com with smtp (Exim 3.35 #1 (Debian))\n\tid 17f9vK-0005QS-01\n\tfor <<EMAIL>>; Wed, 14 Aug 2002 21:59:42 -0400\nDate: Thu, 15 Aug 2002 02:00:29 +0000\nFrom: [email protected]\nSubject: [use Perl] Stories for 2002-08-15\nTo: <EMAIL>\nPrecedence: list\nX-Bulkmail: 2.051\nMessage-Id: <<EMAIL>>\n\nuse Perl Daily Newsletter\n\nIn this issue:\n * Spouses afternoon at YAPC::Europe\n\n+--------------------------------------------------------------------+\n| Spouses afternoon at YAPC::Europe |\n| posted by ziggy on Wednesday August 14, @19:44 (news) |\n| http://use.perl.org/article.pl?sid=02/08/14/2351255 |\n+--------------------------------------------------------------------+\n\n[0]<NAME> writes \"On Thursday, September 19th, we are running an\neasy walking tour around the city of Munich, for all those long-suffering\npartners coming to YAPC::Europe, as a sort of treat for putting up with\nthe other half going to this very interesting event. Just to be clear:\nwe're not after any conference participant/attendees on this, only those\nwho are waiting until all the perl talk has finished (perl-widows and the\nlike). We'd like to have an idea of numbers, please, ahead of time, so:\n[1]RSVP. Thanks!\"\n\nDiscuss this story at:\n http://use.perl.org/comments.pl?sid=02/08/14/2351255\n\nLinks:\n 0. http://www.yapc.org/Europe/\n 1. mailto:<EMAIL>\n\n\n\nCopyright 1997-2002 pudge. All rights reserved.\n\n\n======================================================================\n\nYou have received this message because you subscribed to it\non use Perl. To stop receiving this and other\nmessages from use Perl, or to add more messages\nor change your preferences, please go to your user page.\n\n\thttp://use.perl.org/my/messages/\n\nYou can log in and change your preferences from there.\n"}
848
1,027
{ "name": "Full Page Screen Capture", "version": "1.0.1", "manifest_version": 2, "description": "Screen capture your current page in entirety and reliably!", "browser_action": { "default_icon": "icon-999.png", "default_popup": "popup.html" }, "commands": { "_execute_browser_action": { "suggested_key": { "default": "Alt+Shift+P" } } }, "permissions": [ "activeTab", "storage", "unlimitedStorage" ], "icons": { "16": "icon16-999.png", "48": "icon48-999.png", "128": "icon128-999.png" } }
235
5,169
{ "name": "SheeKit", "version": "0.0.1", "license": "MIT License", "summary": "A bridge between SwiftUI and UIKit which enriches the modal presentations in SwiftUI with the features available in UIKit.", "homepage": "https://github.com/edudnyk/SheeKit", "authors": { "<NAME>": "<EMAIL>" }, "source": { "git": "https://github.com/edudnyk/SheeKit.git", "tag": "0.0.1" }, "platforms": { "ios": "15.0" }, "source_files": "Sources/**/*.swift", "swift_versions": "5.5", "swift_version": "5.5" }
222
763
package org.batfish.representation.juniper; import java.util.List; import org.batfish.common.Warnings; import org.batfish.datamodel.Configuration; import org.batfish.datamodel.routing_policy.expr.BgpPeerAddressNextHop; import org.batfish.datamodel.routing_policy.statement.SetNextHop; import org.batfish.datamodel.routing_policy.statement.Statement; /** A {@link Statement} that sets the next hop to the peer's address. */ public final class PsThenNextHopPeerAddress extends PsThen { public static final PsThenNextHopPeerAddress INSTANCE = new PsThenNextHopPeerAddress(); private PsThenNextHopPeerAddress() {} @Override public void applyTo( List<Statement> statements, JuniperConfiguration juniperVendorConfiguration, Configuration c, Warnings w) { statements.add(new SetNextHop(BgpPeerAddressNextHop.getInstance())); } }
280
15,577
<gh_stars>1000+ import pytest from helpers.cluster import ClickHouseCluster cluster = ClickHouseCluster(__file__) node1 = cluster.add_instance( "node1", main_configs=["configs/remote_servers.xml"], with_zookeeper=True ) node2 = cluster.add_instance( "node2", main_configs=["configs/remote_servers.xml"], with_zookeeper=True ) @pytest.fixture(scope="module") def start_cluster(): try: cluster.start() yield cluster finally: cluster.shutdown() def test_remote(start_cluster): assert ( node1.query( """select hostName() h, tcpPort() p, count() from clusterAllReplicas("two_shards", system.one) group by h, p order by h, p""" ) == "node1\t9000\t1\nnode2\t9000\t1\n" )
322
7,713
<reponame>olsonbrandon/react-native // Copyright 2004-present Facebook. All Rights Reserved. package com.facebook.react.uimanager; /** * ViewGroup that supports z-index. */ public interface ReactZIndexedViewGroup { /** * Determine the index of a child view at {@param index} considering z-index. * @param index The child view index * @return The child view index considering z-index */ int getZIndexMappedChildIndex(int index); /** * Redraw the view based on updated child z-index. This should be called after updating one of its child * z-index. */ void updateDrawingOrder(); }
183
892
{ "schema_version": "1.2.0", "id": "GHSA-238g-h6pm-rw9x", "modified": "2022-04-30T18:19:04Z", "published": "2022-04-30T18:19:04Z", "aliases": [ "CVE-2002-0354" ], "details": "The XMLHttpRequest object (XMLHTTP) in Netscape 6.1 and Mozilla 0.9.7 allows remote attackers to read arbitrary files and list directories on a client system by opening a URL that redirects the browser to the file on the client, then reading the result using the responseText property.", "severity": [ ], "affected": [ ], "references": [ { "type": "ADVISORY", "url": "https://nvd.nist.gov/vuln/detail/CVE-2002-0354" }, { "type": "WEB", "url": "http://marc.info/?l=bugtraq&m=102017952204097&w=2" }, { "type": "WEB", "url": "http://marc.info/?l=ntbugtraq&m=102020343728766&w=2" } ], "database_specific": { "cwe_ids": [ ], "severity": "MODERATE", "github_reviewed": false } }
425
526
/* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.openmetadata.repositoryservices.auditlog; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import org.odpi.openmetadata.frameworks.auditlog.messagesets.AuditLogRecordSeverity; import java.io.Serializable; import java.util.Objects; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; /** * AuditLogReportSeverity provides information about the different types of severities defined for the audit log. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) public class OMRSAuditLogReportSeverity implements AuditLogRecordSeverity, Serializable { private static final long serialVersionUID = 1L; private int ordinal; private String name; private String description; /** * Default constructor */ public OMRSAuditLogReportSeverity() { } /** * Copy/clone constructor. * * @param template object to copy. */ public OMRSAuditLogReportSeverity(AuditLogRecordSeverity template) { if (template != null) { this.ordinal = template.getOrdinal(); this.name = template.getName(); this.description = template.getDescription(); } } /** * Return the numerical code for this enum. * * @return int componentId */ public int getOrdinal() { return ordinal; } /** * Set up he numerical code for this enum. * * @param ordinal identifier */ public void setOrdinal(int ordinal) { this.ordinal = ordinal; } /** * Return the name of the component. This is the name used in the audit log records. * * @return String component name */ public String getName() { return name; } /** * Set up the name of the component. This is the name used in the audit log records. * * @param name String component name */ public void setName(String name) { this.name = name; } /** * Return the short description of the component. This is an English description. Natural language support for * these values can be added to UIs using a resource bundle indexed with the component Id. This value is * provided as a default if the resource bundle is not available. * * @return String description */ public String getDescription() { return description; } /** * Set up the short description of the component. This is an English description. Natural language support for * these values can be added to UIs using a resource bundle indexed with the component Id. This value is * provided as a default if the resource bundle is not available. * * @param description String description */ public void setDescription(String description) { this.description = description; } /** * toString, JSON-style * * @return string description */ @Override public String toString() { return "OMRSAuditLogReportSeverity{" + "ordinal=" + ordinal + ", name='" + name + '\'' + ", description='" + description + '\'' + '}'; } /** * Compare the values of the supplied object with those stored in the current object. * * @param objectToCompare supplied object * @return boolean result of comparison */ @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (objectToCompare == null || getClass() != objectToCompare.getClass()) { return false; } OMRSAuditLogReportSeverity that = (OMRSAuditLogReportSeverity) objectToCompare; return ordinal == that.ordinal && Objects.equals(name, that.name) && Objects.equals(description, that.description); } /** * Create a hash code for this element type. * * @return int hash code */ @Override public int hashCode() { return Objects.hash(ordinal, name, description); } }
1,805