prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>disconnected.controller.ts<|end_file_name|><|fim▁begin|>import { Body, Controller, InternalServerErrorException,<|fim▁hole|> Post, RequestTimeoutException, } from '@nestjs/common'; import { ClientProxyFactory } from '@nestjs/microservices'; import { Observable, throwError } from 'rxjs'; import { catchError } from 'rxjs/operators'; @Controller() export class DisconnectedClientController { @Post() call(@Body() options): Observable<number> { const client = ClientProxyFactory.create(options); return client .send<number, number[]>({ cmd: 'none' }, [1, 2, 3]) .pipe( /*tap( console.log.bind(console, 'data'), console.error.bind(console, 'error'), ),*/ catchError(error => { const { code } = error || { code: 'CONN_ERR' }; return throwError( code === 'ECONNREFUSED' || code === 'CONN_ERR' ? new RequestTimeoutException('ECONNREFUSED') : new InternalServerErrorException(), ); }), ); } }<|fim▁end|>
<|file_name|>old-closure-fn-coerce.rs<|end_file_name|><|fim▁begin|>// run-pass<|fim▁hole|> fn force<F>(f: F) -> isize where F: FnOnce() -> isize { return f(); } pub fn main() { fn f() -> isize { return 7; } assert_eq!(force(f), 7); let g = {||force(f)}; assert_eq!(g(), 7); }<|fim▁end|>
#![allow(unused_braces)]
<|file_name|>retention.rs<|end_file_name|><|fim▁begin|>use crate::{Error, FsStats}; use iml_command_utils::wait_for_cmds_success; use iml_influx::{Client as InfluxClient, InfluxClientExt as _}; use iml_manager_client::{graphql, Client}; use iml_postgres::{sqlx, PgPool}; use iml_tracing::tracing; use iml_wire_types::{snapshot, Command}; use std::collections::HashMap; async fn get_stats_from_influx( fs_name: &str, client: &InfluxClient, ) -> Result<Option<(u64, u64, u64)>, Error> { let nodes: Option<Vec<FsStats>> = client .query_into( format!( r#" SELECT SUM(bytes_total) as bytes_total, SUM(bytes_free) as bytes_free, SUM("bytes_avail") as bytes_avail FROM ( SELECT LAST("bytes_total") AS bytes_total, LAST("bytes_free") as bytes_free, LAST("bytes_avail") as bytes_avail FROM "target" WHERE "kind" = 'OST' AND "fs" = '{}' GROUP BY target ) "#, fs_name, ) .as_str(), None, ) .await?; if let Some(nodes) = nodes { if nodes.is_empty() { return Ok(None); } else { let bytes_avail = nodes[0].bytes_avail; let bytes_total = nodes[0].bytes_total; let bytes_free = nodes[0].bytes_free; let bytes_used = bytes_total - bytes_free; return Ok(Some((bytes_avail, bytes_free, bytes_used))); } } Ok(None) } async fn get_snapshots( pool: &sqlx::PgPool, fs_name: &str, ) -> Result<Vec<snapshot::SnapshotRecord>, Error> { let xs = sqlx::query_as!( snapshot::SnapshotRecord, "SELECT * FROM snapshot WHERE filesystem_name = $1 ORDER BY create_time ASC", fs_name ) .fetch_all(pool) .await?; Ok(xs) } async fn get_retentions(pool: &sqlx::PgPool) -> Result<Vec<snapshot::SnapshotRetention>, Error> { let xs = sqlx::query_as!( snapshot::SnapshotRetention, r#" SELECT id, filesystem_name, reserve_value, reserve_unit as "reserve_unit:snapshot::ReserveUnit", last_run, keep_num FROM snapshot_retention "# ) .fetch_all(pool) .await?; Ok(xs) } async fn get_retention_policy( pool: &PgPool, fs_name: &str, ) -> Result<Option<snapshot::SnapshotRetention>, Error> { let xs = get_retentions(pool).await?; Ok(xs.into_iter().find(|x| x.filesystem_name == fs_name)) } async fn destroy_snapshot( client: Client, fs_name: &str, snapshot_name: &str, ) -> Result<Command, Error> { let resp: iml_graphql_queries::Response<iml_graphql_queries::snapshot::destroy::Resp> = graphql( client, iml_graphql_queries::snapshot::destroy::build(fs_name, snapshot_name, true), ) .await?; let cmd = Result::from(resp)?.data.destroy_snapshot; Ok(cmd) } async fn get_retention_filesystems(pool: &PgPool) -> Result<Vec<String>, Error> { let xs = get_retentions(pool).await?; let fs_names = xs.into_iter().map(|x| x.filesystem_name).collect(); Ok(fs_names) } pub async fn process_retention( client: &Client, influx_client: &InfluxClient, pool: &PgPool, mut stats_record: HashMap<String, u64>, ) -> Result<HashMap<String, u64>, Error> { let filesystems = get_retention_filesystems(pool).await?; tracing::debug!("Filesystems with retentions: {:?}", filesystems); for fs_name in filesystems { let stats = get_stats_from_influx(&fs_name, &influx_client).await?; if let Some((bytes_avail, bytes_free, bytes_used)) = stats { tracing::debug!( "stats values: {}, {}, {}", bytes_avail, bytes_free, bytes_used ); let percent_used = (bytes_used as f64 / (bytes_used as f64 + bytes_avail as f64)) as f64 * 100.0f64; let percent_free = 100.0f64 - percent_used; tracing::debug!( "stats record: {:?} - bytes free: {}", stats_record.get(&fs_name), bytes_free ); let retention = get_retention_policy(pool, &fs_name).await?; if let Some(retention) = retention { let snapshots = get_snapshots(pool, &fs_name).await?; tracing::debug!( "percent_left: {}, reserve value: {}", percent_free, retention.reserve_value ); let should_delete_snapshot = match retention.reserve_unit { snapshot::ReserveUnit::Percent => percent_free < retention.reserve_value as f64, snapshot::ReserveUnit::Gibibytes => { let gib_free: f64 = bytes_free as f64 / 1_073_741_824_f64; gib_free < retention.reserve_value as f64 } snapshot::ReserveUnit::Tebibytes => { let teb_free: f64 = bytes_free as f64 / 1_099_511_627_776_f64; teb_free < retention.reserve_value as f64 } }; tracing::debug!("Should delete snapshot?: {}", should_delete_snapshot); if should_delete_snapshot && snapshots.len() > retention.keep_num as usize && stats_record.get(&fs_name) != Some(&bytes_used) { stats_record.insert(fs_name.to_string(), bytes_used); tracing::debug!("About to delete earliest snapshot."); let snapshot_name = snapshots[0].snapshot_name.to_string(); tracing::debug!("Deleting {}", snapshot_name); let cmd = destroy_snapshot(client.clone(), &fs_name, snapshot_name.as_ref()).await?; wait_for_cmds_success(&vec![cmd], None).await?; } } } } Ok(stats_record) } pub async fn handle_retention_rules( client: Client, influx_client: InfluxClient, pool: PgPool, ) -> Result<(), Error> { let mut prev_stats: HashMap<String, u64> = vec![].into_iter().collect::<HashMap<String, u64>>(); loop { prev_stats = match process_retention(&client, &influx_client, &pool, prev_stats.clone()).await { Ok(x) => x,<|fim▁hole|> }; tokio::time::delay_for(tokio::time::Duration::from_secs(60)).await; } }<|fim▁end|>
Err(e) => { tracing::error!("Retention Rule processing error: {:?}", e); prev_stats }
<|file_name|>cli.py<|end_file_name|><|fim▁begin|>""" Lua pattern matcher based on a NFA inspired by http://swtch.com/~rsc/regexp/regexp1.html """ from rpyre.interface.lua import compile_re from rpyre.matching import find def main(args): n = 20 s = args[1] #s = "(a|b)*a%sa(a|b)*$" % ("(a|b)" * n, ) print s evilregex = compile_re(s) import os chunks = [] # use os.read to be RPython compatible while True: s = os.read(0, 4096) if not s: break chunks.append(s) s = "".join(chunks) print len(s) print find(evilregex, s, 0) """ for x in find2(evilregex, s, 0): print x """ return 0 # needed for the PyPy translation toolchain def target(*args): return main, None <|fim▁hole|> return JitPolicy() if __name__ == '__main__': import sys sys.exit(main(sys.argv))<|fim▁end|>
def jitpolicy(*args): from rpython.jit.codewriter.policy import JitPolicy
<|file_name|>netconsole.py<|end_file_name|><|fim▁begin|>from argparse import ArgumentParser import socket import struct import sys import threading import time from ._fakeds import FakeDS<|fim▁hole|>__all__ = ["Netconsole", "main", "run"] def _output_fn(s): sys.stdout.write( s.encode(sys.stdout.encoding, errors="replace").decode(sys.stdout.encoding) ) sys.stdout.write("\n") class StreamEOF(IOError): pass class Netconsole: """ Implements the 2018+ netconsole protocol """ TAG_ERROR = 11 TAG_INFO = 12 def __init__(self, printfn=_output_fn): self.frames = {self.TAG_ERROR: self._onError, self.TAG_INFO: self._onInfo} self.cond = threading.Condition() self.sock = None self.sockrfp = None self.sockwfp = None self.sockaddr = None self.running = False self.printfn = printfn def start(self, address, port=1741, connect_event=None, block=True): with self.cond: if self.running: raise ValueError("Cannot start without stopping first") self.sockaddr = (address, port) self.connect_event = connect_event self.running = True self._rt = threading.Thread( target=self._readThread, name="nc-read-thread", daemon=True ) self._rt.start() if block: self._keepAlive() else: self._kt = threading.Thread( target=self._keepAlive, name="nc-keepalive-thread", daemon=True ) self._kt.start() @property def connected(self): return self.sockrfp is not None def stop(self): with self.cond: self.running = False self.cond.notify_all() self.sock.close() def _connectionDropped(self): print(".. connection dropped", file=sys.stderr) self.sock.close() with self.cond: self.sockrfp = None self.cond.notify_all() def _keepAliveReady(self): if not self.running: return -1 elif not self.connected: return -2 def _keepAlive(self): while self.running: with self.cond: ret = self.cond.wait_for(self._keepAliveReady, timeout=2.0) if ret == -1: return elif ret == -2: self._reconnect() else: try: self.sockwfp.write(b"\x00\x00") self.sockwfp.flush() except IOError: self._connectionDropped() def _readThreadReady(self): if not self.running: return -1 return self.sockrfp def _readThread(self): while True: with self.cond: sockrfp = self.cond.wait_for(self._readThreadReady) if sockrfp == -1: return try: data = sockrfp.read(self._headerSz) except IOError: data = "" if len(data) != self._headerSz: self._connectionDropped() continue blen, tag = self._header.unpack(data) blen -= 1 try: buf = sockrfp.read(blen) except IOError: buf = "" if len(buf) != blen: self._connectionDropped() continue # process the frame fn = self.frames.get(tag) if fn: fn(buf) else: print("ERROR: Unknown tag %s; Ignoring..." % tag, file=sys.stderr) def _reconnect(self): # returns once the socket is connected or an exit is requested while self.running: sys.stderr.write("Connecting to %s:%s..." % self.sockaddr) try: sock = socket.create_connection(self.sockaddr, timeout=3.0) except IOError: sys.stderr.write(" :(\n") # don't busywait, just in case time.sleep(1.0) continue else: sys.stderr.write("OK\n") sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) sock.settimeout(None) sockrfp = sock.makefile("rb") sockwfp = sock.makefile("wb") if self.connect_event: self.connect_event.set() with self.cond: self.sock = sock self.sockrfp = sockrfp self.sockwfp = sockwfp self.cond.notify_all() break # # Message # _header = struct.Struct(">Hb") _headerSz = _header.size _errorFrame = struct.Struct(">fHHiB") _errorFrameSz = _errorFrame.size _infoFrame = struct.Struct(">fH") _infoFrameSz = _infoFrame.size _slen = struct.Struct(">H") _slenSz = _slen.size def _onError(self, b): ts, _seq, _numOcc, errorCode, flags = self._errorFrame.unpack_from(b, 0) details, nidx = self._getStr(b, self._errorFrameSz) location, nidx = self._getStr(b, nidx) callStack, _ = self._getStr(b, nidx) self.printfn( "[%0.2f] %d %s %s %s" % (ts, errorCode, details, location, callStack) ) def _getStr(self, b, idx): sidx = idx + self._slenSz (blen,) = self._slen.unpack_from(b, idx) nextidx = sidx + blen return b[sidx:nextidx].decode("utf-8", errors="replace"), nextidx def _onInfo(self, b): ts, _seq = self._infoFrame.unpack_from(b, 0) msg = b[self._infoFrameSz :].decode("utf-8", errors="replace") self.printfn("[%0.2f] %s" % (ts, msg)) def run(address, connect_event=None, fakeds=False): """ Starts the netconsole loop. Note that netconsole will only send output if the DS is connected. If you don't have a DS available, the 'fakeds' flag can be specified to fake a DS connection. :param address: Address of the netconsole server :param connect_event: a threading.event object, upon which the 'set' function will be called when the connection has succeeded. :param fakeds: Fake a driver station connection """ if fakeds: ds = FakeDS() ds.start(address) nc = Netconsole() nc.start(address, connect_event=connect_event) def main(): parser = ArgumentParser() parser.add_argument("address", help="Address of Robot") parser.add_argument( "-f", "--fakeds", action="store_true", default=False, help="Fake a driver station connection to the robot", ) args = parser.parse_args() run(args.address, fakeds=args.fakeds)<|fim▁end|>
<|file_name|>blackbody.py<|end_file_name|><|fim▁begin|># Licensed under a 3-clause BSD style license - see LICENSE.rst """Functions related to blackbody radiation.""" from __future__ import (absolute_import, division, print_function, unicode_literals) # LOCAL from ..modeling import blackbody as _bb from ..utils.decorators import deprecated __all__ = ['blackbody_nu', 'blackbody_lambda'] # Units FNU = _bb.FNU FLAM = _bb.FLAM @deprecated('2.0', alternative='astropy.modeling.blackbody.blackbody_nu') def blackbody_nu(in_x, temperature): """Calculate blackbody flux per steradian, :math:`B_{\\nu}(T)`. .. note:: Use `numpy.errstate` to suppress Numpy warnings, if desired. .. warning::<|fim▁hole|> Output values might contain ``nan`` and ``inf``. Parameters ---------- in_x : number, array-like, or `~astropy.units.Quantity` Frequency, wavelength, or wave number. If not a Quantity, it is assumed to be in Hz. temperature : number, array-like, or `~astropy.units.Quantity` Blackbody temperature. If not a Quantity, it is assumed to be in Kelvin. Returns ------- flux : `~astropy.units.Quantity` Blackbody monochromatic flux in :math:`erg \\; cm^{-2} s^{-1} Hz^{-1} sr^{-1}`. Raises ------ ValueError Invalid temperature. ZeroDivisionError Wavelength is zero (when converting to frequency). """ return _bb.blackbody_nu(in_x, temperature) @deprecated('2.0', alternative='astropy.modeling.blackbody.blackbody_lambda') def blackbody_lambda(in_x, temperature): """Like :func:`blackbody_nu` but for :math:`B_{\\lambda}(T)`. Parameters ---------- in_x : number, array-like, or `~astropy.units.Quantity` Frequency, wavelength, or wave number. If not a Quantity, it is assumed to be in Angstrom. temperature : number, array-like, or `~astropy.units.Quantity` Blackbody temperature. If not a Quantity, it is assumed to be in Kelvin. Returns ------- flux : `~astropy.units.Quantity` Blackbody monochromatic flux in :math:`erg \\; cm^{-2} s^{-1} \\mathring{A}^{-1} sr^{-1}`. """ return _bb.blackbody_lambda(in_x, temperature)<|fim▁end|>
<|file_name|>Nikon_DX.py<|end_file_name|><|fim▁begin|>import bpy camera = bpy.context.edit_movieclip.tracking.camera<|fim▁hole|>camera.units = 'MILLIMETERS' camera.pixel_aspect = 1 camera.k1 = 0.0 camera.k2 = 0.0 camera.k3 = 0.0<|fim▁end|>
camera.sensor_width = 23.6
<|file_name|>terms_of_service.py<|end_file_name|><|fim▁begin|>import json from typing import TYPE_CHECKING, Optional from boxsdk.util.text_enum import TextEnum from boxsdk.exception import BoxAPIException from .base_object import BaseObject if TYPE_CHECKING: from boxsdk.object.user import User from boxsdk.object.terms_of_service_user_status import TermsOfServiceUserStatus class TermsOfServiceType(TextEnum): """An enum of possible terms of service types""" MANAGED = 'managed' EXTERNAL = 'external' class TermsOfServiceStatus(TextEnum): """An enum of possible terms of service status""" ENABLED = 'enabled' DISABLED = 'disabled' class TermsOfService(BaseObject): """Represents a Box terms of service.""" _item_type = 'terms_of_service' <|fim▁hole|> Get the terms of service user status. :param user: This is the user to get the status of the terms of service for. This defaults to current user. :returns: A :class:`TermsOfServiceUserStatus` object """ url = self._session.get_url('terms_of_service_user_statuses') additional_params = { 'tos_id': self.object_id, } if user is not None: additional_params['user_id'] = user.object_id box_response = self._session.get(url, params=additional_params) response_object = box_response.json() response = response_object['entries'][0] return self.translator.translate( session=self._session, response_object=response, ) def accept(self, user: Optional['User'] = None) -> 'TermsOfServiceUserStatus': """ Accept a terms of service. :param user: The :class:`User` to assign the terms of service to. :returns: A newly created :class:`TermsOfServiceUserStatus` object """ return self.set_user_status(is_accepted=True, user=user) def reject(self, user: Optional['User'] = None) -> 'TermsOfServiceUserStatus': """ Reject a terms of service. :param user: The :class:`User` to assign the terms of service to. :returns: A newly created :class:`TermsOfServiceUserStatus` object """ return self.set_user_status(is_accepted=False, user=user) def set_user_status(self, is_accepted: bool, user: Optional['User'] = None) -> 'TermsOfServiceUserStatus': """ Create a terms of service user status. :param is_accepted: Indicates whether a use has accepted or rejected a terms of service. :param user: The :class:`User` to assign the terms of service to. :returns: A newly created :class:`TermsOfServiceUserStatus` object """ url = self._session.get_url('terms_of_service_user_statuses') body = { 'tos': { 'type': self.object_type, 'id': self.object_id, }, 'is_accepted': is_accepted, } if user is not None: body['user'] = { 'type': user.object_type, 'id': user.object_id, } translated_response = None try: box_response = self._session.post(url, data=json.dumps(body)) response = box_response.json() translated_response = self.translator.translate( session=self._session, response_object=response, ) except BoxAPIException as err: if err.status == 409: user_status = self.get_user_status(user) translated_response = user_status.update_info(data={'is_accepted': is_accepted}) return translated_response<|fim▁end|>
def get_user_status(self, user: Optional['User'] = None) -> 'TermsOfServiceUserStatus': """
<|file_name|>playlist.py<|end_file_name|><|fim▁begin|>import asyncio import discord from discord.ext import commands if not discord.opus.is_loaded(): # the 'opus' library here is opus.dll on windows # or libopus.so on linux in the current directory # you should replace this with the location the # opus library is located in and with the proper filename. # note that on windows this DLL is automatically provided for you discord.opus.load_opus('opus') class VoiceEntry: def __init__(self, message, player): self.requester = message.author self.channel = message.channel self.player = player def __str__(self): fmt = '*{0.title}* uploaded by {0.uploader} and requested by {1.display_name}' duration = self.player.duration if duration: fmt = fmt + ' [length: {0[0]}m {0[1]}s]'.format(divmod(duration, 60)) return fmt.format(self.player, self.requester) class VoiceState: def __init__(self, bot): self.current = None self.voice = None self.bot = bot self.play_next_song = asyncio.Event() self.songs = asyncio.Queue() self.skip_votes = set() # a set of user_ids that voted self.audio_player = self.bot.loop.create_task(self.audio_player_task()) def is_playing(self): if self.voice is None or self.current is None: return False player = self.current.player return not player.is_done() @property def player(self): return self.current.player def skip(self): self.skip_votes.clear() if self.is_playing(): self.player.stop() def toggle_next(self): self.bot.loop.call_soon_threadsafe(self.play_next_song.set) async def audio_player_task(self): while True: self.play_next_song.clear() self.current = await self.songs.get() await self.bot.send_message(self.current.channel, 'Now playing ' + str(self.current)) self.current.player.start() await self.play_next_song.wait() class Music: """Voice related commands. Works in multiple servers at once. """ def __init__(self, bot): self.bot = bot self.voice_states = {} def get_voice_state(self, server): state = self.voice_states.get(server.id) if state is None: state = VoiceState(self.bot) self.voice_states[server.id] = state return state async def create_voice_client(self, channel): voice = await self.bot.join_voice_channel(channel) state = self.get_voice_state(channel.server) state.voice = voice def __unload(self): for state in self.voice_states.values(): try: state.audio_player.cancel() if state.voice: self.bot.loop.create_task(state.voice.disconnect()) except: pass @commands.command(pass_context=True, no_pm=True) async def join(self, ctx, *, channel : discord.Channel): """Joins a voice channel.""" try: await self.create_voice_client(channel) except discord.ClientException: await self.bot.say('Already in a voice channel...') except discord.InvalidArgument: await self.bot.say('This is not a voice channel...') else: await self.bot.say('Ready to play audio in ' + channel.name) @commands.command(pass_context=True, no_pm=True) async def summon(self, ctx): """Summons the bot to join your voice channel.""" summoned_channel = ctx.message.author.voice_channel if summoned_channel is None: await self.bot.say('You are not in a voice channel.') return False state = self.get_voice_state(ctx.message.server) if state.voice is None: state.voice = await self.bot.join_voice_channel(summoned_channel) else: await state.voice.move_to(summoned_channel) return True @commands.command(pass_context=True, no_pm=True) async def play(self, ctx, *, song : str): """Plays a song. If there is a song currently in the queue, then it is queued until the next song is done playing. This command automatically searches as well from YouTube. The list of supported sites can be found here: https://rg3.github.io/youtube-dl/supportedsites.html """ state = self.get_voice_state(ctx.message.server) opts = { 'default_search': 'auto', 'quiet': True, } if state.voice is None: success = await ctx.invoke(self.summon) if not success: return try: player = await state.voice.create_ytdl_player(song, ytdl_options=opts, after=state.toggle_next) except Exception as e: fmt = 'An error occurred while processing this request: ```py\n{}: {}\n```' await self.bot.send_message(ctx.message.channel, fmt.format(type(e).__name__, e)) else: player.volume = 0.6 entry = VoiceEntry(ctx.message, player) await self.bot.say('Enqueued ' + str(entry)) await state.songs.put(entry) @commands.command(pass_context=True, no_pm=True) async def volume(self, ctx, value : int): """Sets the volume of the currently playing song.""" state = self.get_voice_state(ctx.message.server) if state.is_playing(): player = state.player player.volume = value / 100 await self.bot.say('Set the volume to {:.0%}'.format(player.volume)) @commands.command(pass_context=True, no_pm=True) async def pause(self, ctx): """Pauses the currently played song.""" state = self.get_voice_state(ctx.message.server) if state.is_playing(): player = state.player player.pause() @commands.command(pass_context=True, no_pm=True) async def resume(self, ctx): """Resumes the currently played song.""" state = self.get_voice_state(ctx.message.server) if state.is_playing(): player = state.player player.resume() @commands.command(pass_context=True, no_pm=True) async def stop(self, ctx): """Stops playing audio and leaves the voice channel. This also clears the queue. """ server = ctx.message.server state = self.get_voice_state(server)<|fim▁hole|> try: state.audio_player.cancel() del self.voice_states[server.id] await state.voice.disconnect() except: pass @commands.command(pass_context=True, no_pm=True) async def skip(self, ctx): """Vote to skip a song. The song requester can automatically skip. 3 skip votes are needed for the song to be skipped. """ state = self.get_voice_state(ctx.message.server) if not state.is_playing(): await self.bot.say('Not playing any music right now...') return voter = ctx.message.author if voter == state.current.requester: await self.bot.say('Requester requested skipping song...') state.skip() elif voter.id not in state.skip_votes: state.skip_votes.add(voter.id) total_votes = len(state.skip_votes) if total_votes >= 3: await self.bot.say('Skip vote passed, skipping song...') state.skip() else: await self.bot.say('Skip vote added, currently at [{}/3]'.format(total_votes)) else: await self.bot.say('You have already voted to skip this song.') @commands.command(pass_context=True, no_pm=True) async def playing(self, ctx): """Shows info about the currently played song.""" state = self.get_voice_state(ctx.message.server) if state.current is None: await self.bot.say('Not playing anything.') else: skip_count = len(state.skip_votes) await self.bot.say('Now playing {} [skips: {}/3]'.format(state.current, skip_count)) bot = commands.Bot(command_prefix=commands.when_mentioned_or('$'), description='A playlist example for discord.py') bot.add_cog(Music(bot)) @bot.event async def on_ready(): print('Logged in as:\n{0} (ID: {0.id})'.format(bot.user)) bot.run('token')<|fim▁end|>
if state.is_playing(): player = state.player player.stop()
<|file_name|>archive_rt.py<|end_file_name|><|fim▁begin|># # Gordon McMillan (as inspired and influenced by Greg Stein) # # subclasses may not need marshal or struct, but since they're # builtin, importing is safe. # # While an Archive is really an abstraction for any "filesystem # within a file", it is tuned for use with imputil.FuncImporter. # This assumes it contains python code objects, indexed by the # the internal name (ie, no '.py'). # See carchive.py for a more general archive (contains anything) # that can be understood by a C program. #archive_rt is a stripped down version of MEInc.Dist.archive. #It has had all building logic removed. #It's purpose is to bootstrap the Python installation. import marshal import struct class Archive: """ A base class for a repository of python code objects. The extract method is used by imputil.ArchiveImporter to get code objects by name (fully qualified name), so an enduser "import a.b" would become extract('a.__init__') extract('a.b') """ MAGIC = 'PYL\0' HDRLEN = 12 # default is MAGIC followed by python's magic, int pos of toc TOCPOS = 8 TRLLEN = 0 # default - no trailer TOCTMPLT = {} # os = None def __init__(self, path=None, start=0): "Initialize an Archive. If path is omitted, it will be an empty Archive." self.toc = None self.path = path self.start = start import imp self.pymagic = imp.get_magic() if path is not None: self.lib = open(self.path, 'rb') self.checkmagic() self.loadtoc() ####### Sub-methods of __init__ - override as needed ############# def checkmagic(self): """ Overridable. Check to see if the file object self.lib actually has a file we understand. """ self.lib.seek(self.start) #default - magic is at start of file if self.lib.read(len(self.MAGIC)) != self.MAGIC: raise RuntimeError, "%s is not a valid %s archive file" \ % (self.path, self.__class__.__name__) if self.lib.read(len(self.pymagic)) != self.pymagic: raise RuntimeError, "%s has version mismatch to dll" % (self.path) def loadtoc(self): """ Overridable. Default: After magic comes an int (4 byte native) giving the position of the TOC within self.lib. Default: The TOC is a marshal-able string. """ self.lib.seek(self.start + self.TOCPOS) (offset,) = struct.unpack('=i', self.lib.read(4)) self.lib.seek(self.start + offset) self.toc = marshal.load(self.lib) ######## This is what is called by FuncImporter ####### ## Since an Archive is flat, we ignore parent and modname. def get_code(self, parent, modname, fqname): print "parent: ", parent print "modname: ", modname print "fqname: ", fqname return self.extract(fqname) # None if not found, (ispkg, code) otherwise if rslt is None: return None ispkg, code = rslt if ispkg: return ispkg, code, {'__path__': []} return rslt ####### Core method - Override as needed ######### def extract(self, name): """ Get the object corresponding to name, or None. For use with imputil ArchiveImporter, object is a python code object. 'name' is the name as specified in an 'import name'. 'import a.b' will become: extract('a') (return None because 'a' is not a code object) extract('a.__init__') (return a code object) extract('a.b') (return a code object) Default implementation: self.toc is a dict self.toc[name] is pos self.lib has the code object marshal-ed at pos """ ispkg, pos = self.toc.get(name, (0, None)) if pos is None: return None self.lib.seek(self.start + pos) return ispkg, marshal.load(self.lib) ######################################################################## # Informational methods def contents(self): """Return a list of the contents Default implementation assumes self.toc is a dict like object. Not required by ArchiveImporter. """ return self.toc.keys() ######################################################################## # Building ####### Top level method - shouldn't need overriding ####### ## def build(self, path, lTOC): ## """Create an archive file of name 'path'. ## lTOC is a 'logical TOC' - a list of (name, path, ...) ## where name is the internal name, eg 'a' ## and path is a file to get the object from, eg './a.pyc'. ## """ ## self.path = path ## self.lib = open(path, 'wb') ## #reserve space for the header ## if self.HDRLEN: ## self.lib.write('\0'*self.HDRLEN) ## ## #create an empty toc ## ## if type(self.TOCTMPLT) == type({}): ## self.toc = {} ## else: # assume callable ## self.toc = self.TOCTMPLT() ## ## for tocentry in lTOC: ## self.add(tocentry) # the guts of the archive ## ## tocpos = self.lib.tell() ## self.save_toc(tocpos) ## if self.TRLLEN: ## self.save_trailer(tocpos) ## if self.HDRLEN: ## self.update_headers(tocpos) ## self.lib.close() ## ## ## ####### manages keeping the internal TOC and the guts in sync ####### ## def add(self, entry): ## """Override this to influence the mechanics of the Archive. ## Assumes entry is a seq beginning with (nm, pth, ...) where ## nm is the key by which we'll be asked for the object. ## pth is the name of where we find the object. Overrides of ## get_obj_from can make use of further elements in entry. ## """ ## if self.os is None: ## import os ## self.os = os ## nm = entry[0] ## pth = entry[1] ## ispkg = self.os.path.splitext(self.os.path.basename(pth))[0] == '__init__' ## self.toc[nm] = (ispkg, self.lib.tell()) ## f = open(entry[1], 'rb') ## f.seek(8) #skip magic and timestamp ## self.lib.write(f.read()) ## ## def save_toc(self, tocpos): ## """Default - toc is a dict ## Gets marshaled to self.lib ## """ ## marshal.dump(self.toc, self.lib) ## ## def save_trailer(self, tocpos): ## """Default - not used""" ## pass ## ## def update_headers(self, tocpos):<|fim▁hole|>## self.lib.write(struct.pack('=i', tocpos)) ############################################################## # # ZlibArchive - an archive with compressed entries # class ZlibArchive(Archive): MAGIC = 'PYZ\0' TOCPOS = 8 HDRLEN = 12 TRLLEN = 0 TOCTMPLT = {} LEVEL = 9 def __init__(self, path=None, offset=0): Archive.__init__(self, path, offset) # dynamic import so not imported if not needed global zlib import zlib def extract(self, name): (ispkg, pos, lngth) = self.toc.get(name, (0, None, 0)) if pos is None: return None self.lib.seek(self.start + pos) return ispkg, marshal.loads(zlib.decompress(self.lib.read(lngth))) ## def add(self, entry): ## if self.os is None: ## import os ## self.os = os ## nm = entry[0] ## pth = entry[1] ## ispkg = self.os.path.splitext(self.os.path.basename(pth))[0] == '__init__' ## f = open(pth, 'rb') ## f.seek(8) #skip magic and timestamp ## obj = zlib.compress(f.read(), self.LEVEL) ## self.toc[nm] = (ispkg, self.lib.tell(), len(obj)) ## self.lib.write(obj) ##<|fim▁end|>
## """Default - MAGIC + Python's magic + tocpos""" ## self.lib.seek(self.start) ## self.lib.write(self.MAGIC) ## self.lib.write(self.pymagic)
<|file_name|>permissions.ts<|end_file_name|><|fim▁begin|>import { AccessToken, Project, User, UserFeatureFlag, UserRole } from '@dev/translatr-model'; import { map } from 'rxjs/operators'; // General export const isAdmin = (user?: User): boolean => user !== undefined && user.role === UserRole.Admin; // Users export const hasCreateUserPermission = () => map(isAdmin); export const hasUserPermissionToDeleteUser = (me: User, user: User) => me !== undefined && me.id !== user.id && isAdmin(me); export const hasEditUserPermission = (user: User) => map((me?: User) => (me !== undefined && me.id === user.id) || isAdmin(me)); export const hasDeleteUserPermission = (user: User) => map((me?: User) => hasUserPermissionToDeleteUser(me, user)); export const hasDeleteAllUsersPermission = (users: User[]) =><|fim▁hole|> map((me?: User) => users .map((user: User) => hasUserPermissionToDeleteUser(me, user)) .reduce((acc: boolean, next: boolean) => acc && next, true) ); // Projects export const hasUserPermissionToDeleteProject = (me: User, project: Project) => (me !== undefined && me.id === project.ownerId) || isAdmin(me); export const hasEditProjectPermission = (project: Project) => map((me?: User) => (me !== undefined && me.id === project.ownerId) || isAdmin(me)); export const hasDeleteProjectPermission = (project: Project) => map((me?: User) => hasUserPermissionToDeleteProject(me, project)); export const hasDeleteAllProjectsPermission = (projects: Project[]) => map((me?: User) => projects .map((project: Project) => hasUserPermissionToDeleteProject(me, project)) .reduce((acc: boolean, next: boolean) => acc && next, true) ); // Access Tokens export const hasUserPermissionToEditAccessToken = (me: User, accessToken: AccessToken) => (me !== undefined && me.id === accessToken.userId) || isAdmin(me); export const hasUserPermissionToDeleteAccessToken = (me: User, accessToken: AccessToken) => (me !== undefined && me.id === accessToken.userId) || isAdmin(me); export const hasEditAccessTokenPermission = (accessToken: AccessToken) => map((me?: User) => hasUserPermissionToEditAccessToken(me, accessToken)); export const hasDeleteAccessTokenPermission = (accessToken: AccessToken) => map((me?: User) => hasUserPermissionToDeleteAccessToken(me, accessToken)); export const hasDeleteAllAccessTokensPermission = (accessTokens: AccessToken[]) => map((me?: User) => accessTokens .map((accessToken: AccessToken) => hasUserPermissionToDeleteAccessToken(me, accessToken)) .reduce((acc: boolean, next: boolean) => acc && next, true) ); // Feature Flags export const hasUserPermissionToEditFeatureFlag = (me: User, featureFlag: UserFeatureFlag) => (me !== undefined && me.id === featureFlag.userId) || isAdmin(me); export const hasUserPermissionToDeleteFeatureFlag = (me: User, featureFlag: UserFeatureFlag) => (me !== undefined && me.id === featureFlag.userId) || isAdmin(me); export const hasEditFeatureFlagPermission = (featureFlag: UserFeatureFlag) => map((me?: User) => hasUserPermissionToEditFeatureFlag(me, featureFlag)); export const hasDeleteFeatureFlagPermission = (featureFlag: UserFeatureFlag) => map((me?: User) => hasUserPermissionToDeleteFeatureFlag(me, featureFlag)); export const hasDeleteAllFeatureFlagsPermission = (featureFlags: UserFeatureFlag[]) => map((me?: User) => featureFlags .map((featureFlag: UserFeatureFlag) => hasUserPermissionToDeleteFeatureFlag(me, featureFlag)) .reduce((acc: boolean, next: boolean) => acc && next, true) );<|fim▁end|>
<|file_name|>factorial.ts<|end_file_name|><|fim▁begin|>import { Machine, actions } from '../../src'; const { assign } = actions; // @ts-ignore const factorialMachine = Machine<{ n: number; fac: number }>( { initial: 'iteration', states: { iteration: { on: { ITERATE: [ { target: 'iteration', cond: (xs) => xs.n > 0, actions: [ assign({ fac: (xs) => xs.n * xs.fac, n: (xs) => xs.n - 1 }) ] }, { target: 'done' } ] } }, done: { onEntry: [(xs) => console.log(`The answer is ${xs.fac}`)] } } }, {}, { n: 5, fac: 1 } ); // @ts-ignore const testMachine = Machine<{ count: number }>( { initial: 'init', states: { init: { on: { ADD: [ { target: 'one', cond: (xs) => xs.count === 1 },<|fim▁hole|> { target: 'init', cond: (xs) => xs.count % 2 === 0, actions: [ assign({ count: (xs) => xs.count / 2 }) ] }, { target: 'init', actions: [ assign({ count: (xs) => xs.count * 3 + 1 }) ] } ] } }, one: {} } }, {}, { count: 11 } );<|fim▁end|>
<|file_name|>KeyParceler.java<|end_file_name|><|fim▁begin|>/* * Copyright 2013 Square Inc. * * 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 flowless;<|fim▁hole|> /** * Used by History to convert your key objects to and from instances of * {@link android.os.Parcelable}. */ public interface KeyParceler { @NonNull Parcelable toParcelable(@NonNull Object key); @NonNull Object toKey(@NonNull Parcelable parcelable); }<|fim▁end|>
import android.os.Parcelable; import android.support.annotation.NonNull;
<|file_name|>VK_SPIRV_13_Shaders.py<|end_file_name|><|fim▁begin|>import renderdoc as rd import rdtest class VK_SPIRV_13_Shaders(rdtest.TestCase): demos_test_name = 'VK_SPIRV_13_Shaders' def check_capture(self): action = self.find_action("Draw") self.check(action is not None) self.controller.SetFrameEvent(action.eventId, False) pipe: rd.PipeState = self.controller.GetPipelineState() refl: rd.ShaderReflection = pipe.GetShaderReflection(rd.ShaderStage.Vertex) disasm: str = self.controller.DisassembleShader(pipe.GetGraphicsPipelineObject(), refl, "") if (refl.inputSignature[0].varName != 'pos' or refl.inputSignature[0].compCount != 3): raise rdtest.TestFailureException("Vertex shader input 'pos' not reflected correctly") if (refl.inputSignature[1].varName != 'col' or refl.inputSignature[1].compCount != 4): raise rdtest.TestFailureException("Vertex shader input 'col' not reflected correctly") if (refl.inputSignature[2].varName != 'uv' or refl.inputSignature[2].compCount != 2): raise rdtest.TestFailureException("Vertex shader input 'uv' not reflected correctly") if (refl.outputSignature[0].varName != 'opos' or refl.outputSignature[0].compCount != 4 or refl.outputSignature[0].systemValue != rd.ShaderBuiltin.Position): raise rdtest.TestFailureException("Vertex shader output 'opos' not reflected correctly") if (refl.outputSignature[1].varName != 'outcol' or refl.outputSignature[1].compCount != 4): raise rdtest.TestFailureException("Vertex shader output 'outcol' not reflected correctly") if 'vertmain' not in disasm: raise rdtest.TestFailureException("Vertex shader disassembly failed, entry point not found") <|fim▁hole|> disasm: str = self.controller.DisassembleShader(pipe.GetGraphicsPipelineObject(), refl, "") if (refl.inputSignature[0].varName != 'incol' or refl.inputSignature[0].compCount != 4): raise rdtest.TestFailureException("Fragment shader input 'incol' not reflected correctly") if (refl.outputSignature[0].varName != 'ocol' or refl.outputSignature[0].compCount != 4 or refl.outputSignature[0].systemValue != rd.ShaderBuiltin.ColorOutput): raise rdtest.TestFailureException("Fragment shader output 'ocol' not reflected correctly") if 'fragmain' not in disasm: raise rdtest.TestFailureException("Fragment shader disassembly failed, entry point not found") rdtest.log.success("shader reflection and disassembly as expected") postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices) postvs_ref = { 0: { 'vtx': 0, 'idx': 0, 'opos': [-0.5, 0.5, 0.0, 1.0], 'outcol': [0.0, 1.0, 0.0, 1.0], }, 1: { 'vtx': 1, 'idx': 1, 'opos': [0.0, -0.5, 0.0, 1.0], 'outcol': [0.0, 1.0, 0.0, 1.0], }, 2: { 'vtx': 2, 'idx': 2, 'opos': [0.5, 0.5, 0.0, 1.0], 'outcol': [0.0, 1.0, 0.0, 1.0], }, } self.check_mesh_data(postvs_ref, postvs_data) rdtest.log.success("vertex output is as expected") self.check_pixel_value(pipe.GetOutputTargets()[0].resourceId, 0.5, 0.5, [0.0, 1.0, 0.0, 1.0]) rdtest.log.success("picked value is as expected")<|fim▁end|>
refl: rd.ShaderReflection = pipe.GetShaderReflection(rd.ShaderStage.Fragment)
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, as long as # any reuse or further development of the software attributes the # National Geospatial-Intelligence Agency (NGA) authorship as follows: # 'This software (gamification-server) # is provided to the public as a courtesy of the National # Geospatial-Intelligence Agency. # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import json from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.utils.datastructures import SortedDict from django.db.models.signals import post_save from django.db import models from gamification.badges.models import ProjectBadge, ProjectBadgeToUser from jsonfield import JSONField from mptt.models import MPTTModel, TreeForeignKey TRUE_FALSE = [(0, 'False'), (1, 'True')] class ProjectBase(models.Model): """ A generic model for GeoQ objects. """ active = models.BooleanField(default=True, help_text='If checked, this project will be listed in the active list.') created_at = models.DateTimeField(auto_now_add=True) name = models.CharField(max_length=200, help_text='Name of the project.') description = models.TextField(help_text='Details of this project that will be listed on the viewing page.') updated_at = models.DateTimeField(auto_now=True) url = models.TextField(help_text='Project Information URL', null=True) def __unicode__(self): return self.name class Meta: abstract = True ordering = ('-created_at',) class Team(MPTTModel): name = models.CharField(max_length=50) description = models.TextField(null=True, blank=True) members = models.ManyToManyField(User, null=True, blank=True) parent = TreeForeignKey('self', null=True, blank=True, related_name='children') order = models.IntegerField(default=0, null=True, blank=True, help_text='Optionally specify the order teams should appear. Lower numbers appear sooner. By default, teams appear in the order they were created.')<|fim▁hole|> background_color = models.CharField(max_length=50, null=True, blank=True, help_text='Optional - Color to use for background of all team badges') icon = models.ImageField(upload_to='badge_images', null=True, blank=True, help_text='Optional - Image to show next to team names') def __str__(self): return "%s (%s)" % (self.name, str(len(self.members.all()))) def get_all_users(self, include_self=True): u = [] if include_self: u += self.members.all() for team in self.get_descendants(): u += team.members.all() return u class Meta: ordering = ['-order', '-date_created', 'id'] class MPTTMeta: order_insertion_by = ['name'] class Project(ProjectBase): """ Top-level organizational object. """ THEMES = ( ("", "None"), ("camping", "Camping"), ("camping2", "Camping Theme 2"), ("map", "Geospatial"), ) private = models.BooleanField(default=False, help_text='If checked, hide this project from the list of projects and public badge APIs.') supervisors = models.ManyToManyField(User, blank=True, null=True, related_name="supervisors", help_text='Anyone other than site administrators that can add badges and update the site') teams = models.ManyToManyField(Team, blank=True, null=True) viewing_pass_phrase = models.CharField(max_length=200, null=True, blank=True, help_text='Phrase that must be entered to view this page.') project_closing_date = models.DateTimeField(null=True, blank=True, help_text='Date that project "closes" with countdown shown on project page. Badges can still be added after this.') visual_theme = models.CharField(max_length=20, default="none", choices=THEMES, help_text='Visual Theme used to style the project page') background_image = models.ImageField(upload_to='badge_images', null=True, blank=True, help_text='Optional - Override theme background with this image') properties = JSONField(null=True, blank=True, help_text='JSON key/value pairs associated with this object, e.g. {"badges_mode":"blue"}') query_token = models.CharField(max_length=200, null=True, blank=True, help_text='Token that must be entered by any server requesting data - not implemented yet.') allowed_api_hosts = models.TextField(null=True, blank=True, help_text='Comma-separated list of hosts (IPs or Hostnames) that can access this project via data requests - not implemented yet') @property def user_count(self): return User.objects.filter(projectbadgetouser__projectbadge__project=self).distinct().count() @property def badge_count(self): return ProjectBadgeToUser.objects.filter(projectbadge__project=self).count() def get_absolute_url(self): return reverse('project-list', args=[self.name]) class Points(models.Model): user = models.ForeignKey(User) projectbadge = models.ForeignKey(ProjectBadge) value = models.IntegerField(default=0) date_awarded = models.DateTimeField('date awarded',auto_now=True) description = models.CharField(max_length=200) def get_absolute_url(self): return reverse('points-list', args=[self.id]) class Meta: verbose_name_plural = "Points" class UserProfile(models.Model): """ from http://stackoverflow.com/questions/44109/extending-the-user-model-with-custom-fields-in-django; this is one mechanism for adding extra details (currently score for badges) to the User model """ defaultScore = 1 user = models.OneToOneField(User) score = models.IntegerField(default=defaultScore) def __str__(self): return "%s's profile" % self.user def create_user_profile(sender, instance, created, **kwargs): if created: profile, created = UserProfile.objects.get_or_create(user=instance) post_save.connect(create_user_profile, sender=User) import sys if not 'syncdb' in sys.argv[1:2] and not 'migrate' in sys.argv[1:2]: from meta_badges import *<|fim▁end|>
date_created = models.DateTimeField(auto_now_add=True)
<|file_name|>component.ts<|end_file_name|><|fim▁begin|>namespace Mist { /** * @class Component */ export class Component { static responses: any = {}; /** * @param {} component * @param {} o * @returns {} * @summary for all components */ static create<T>(component: any, ...o: any[]): T { var m = ser([component]); var n = ser(o); // initialize this.responses[m] || (this.responses[m] = {}); <|fim▁hole|> // inher response if (!this.responses[m][n]) { this.responses[m][n] = new ( component.bind.apply( component, [component].concat([].slice.apply(o)))); } // lasting response return this.responses[m][n]; } } /** * @access private * @static */ var sessions = 0; /** * @access private * @static */ function ser(conv: any[]) { return JSON.stringify( conv.map( function(v) { return v instanceof Object ? v.sessid || (v.sessid = sessions++) : v; })); } }<|fim▁end|>
<|file_name|>part2.go<|end_file_name|><|fim▁begin|>package main <|fim▁hole|> "github.com/asarturas/adventofcode/day03/solution" "fmt" ) func main() { santa := solution.NewGps(); robo := solution.NewGps(); for pos, move := range io.ReadLine() { if pos % 2 == 0 { santa.Move(move); } else { robo.Move(move); } } santa.Add(robo); fmt.Println(santa.VisitedPlaces()); }<|fim▁end|>
import( "github.com/asarturas/adventofcode/io"
<|file_name|>CheckFieldAdapter.java<|end_file_name|><|fim▁begin|>/*** * ASM: a very small and fast Java bytecode manipulation framework * Copyright (c) 2000-2007 INRIA, France Telecom * 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. * 3. 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 <|fim▁hole|> * 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.mockito.asm.util; import org.mockito.asm.AnnotationVisitor; import org.mockito.asm.Attribute; import org.mockito.asm.FieldVisitor; /** * A {@link FieldVisitor} that checks that its methods are properly used. */ public class CheckFieldAdapter implements FieldVisitor { private final FieldVisitor fv; private boolean end; public CheckFieldAdapter(final FieldVisitor fv) { this.fv = fv; } public AnnotationVisitor visitAnnotation( final String desc, final boolean visible) { checkEnd(); CheckMethodAdapter.checkDesc(desc, false); return new CheckAnnotationAdapter(fv.visitAnnotation(desc, visible)); } public void visitAttribute(final Attribute attr) { checkEnd(); if (attr == null) { throw new IllegalArgumentException("Invalid attribute (must not be null)"); } fv.visitAttribute(attr); } public void visitEnd() { checkEnd(); end = true; fv.visitEnd(); } private void checkEnd() { if (end) { throw new IllegalStateException("Cannot call a visit method after visitEnd has been called"); } } }<|fim▁end|>
<|file_name|>__main__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
#!/usr/bin/python3 import gui gui.main()
<|file_name|>sliverauth.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python -tt # vim:set ts=4 sw=4 expandtab: # # NodeManager plugin for creating credentials in slivers # (*) empower slivers to make API calls throught hmac # (*) also create a ssh key - used by the OMF resource controller # for authenticating itself with its Experiment Controller # in order to avoid spamming the DB with huge amounts of such tags, # (*) slices need to have the 'enable_hmac' tag set # (*) or the 'omf_control' tag set, respectively """ Sliver authentication support for NodeManager. """ import os import random import string import tempfile import socket import logger import tools def start(): logger.log("sliverauth: (dummy) plugin starting up...") def GetSlivers(data, config, plc): if 'OVERRIDES' in dir(config): if config.OVERRIDES.get('sliverauth') == '-1': logger.log("sliverauth: Disabled", 2) return if 'slivers' not in data: logger.log_missing_data("sliverauth.GetSlivers", 'slivers') return for sliver in data['slivers']: path = '/vservers/%s' % sliver['name'] if not os.path.exists(path): # ignore all non-plc-instantiated slivers instantiation = sliver.get('instantiation','') if instantiation == 'plc-instantiated': logger.log("sliverauth: plc-instantiated slice %s does not yet exist. IGNORING!" % sliver['name']) continue system_slice = False for chunk in sliver['attributes']: if chunk['tagname'] == "system":<|fim▁hole|> system_slice = True for chunk in sliver['attributes']: if chunk['tagname']=='enable_hmac' and not system_slice: manage_hmac (plc, sliver) if chunk['tagname']=='omf_control': manage_sshkey (plc, sliver) def SetSliverTag(plc, slice, tagname, value): node_id = tools.node_id() slivertags=plc.GetSliceTags({"name":slice,"node_id":node_id,"tagname":tagname}) if len(slivertags)==0: # looks like GetSlivers reports about delegated/nm-controller slices that do *not* belong to this node # and this is something that AddSliceTag does not like try: slivertag_id=plc.AddSliceTag(slice,tagname,value,node_id) except: logger.log_exc ("sliverauth.SetSliverTag (probably delegated) slice=%(slice)s tag=%(tagname)s node_id=%(node_id)d"%locals()) pass else: slivertag_id=slivertags[0]['slice_tag_id'] plc.UpdateSliceTag(slivertag_id,value) def find_tag (sliver, tagname): for attribute in sliver['attributes']: # for legacy, try the old-fashioned 'name' as well name = attribute.get('tagname',attribute.get('name','')) if name == tagname: return attribute['value'] return None def manage_hmac (plc, sliver): hmac = find_tag (sliver, 'hmac') if not hmac: # let python do its thing random.seed() d = [random.choice(string.letters) for x in xrange(32)] hmac = "".join(d) SetSliverTag(plc,sliver['name'],'hmac',hmac) logger.log("sliverauth: %s: setting hmac" % sliver['name']) path = '/vservers/%s/etc/planetlab' % sliver['name'] if os.path.exists(path): keyfile = '%s/key' % path if (tools.replace_file_with_string(keyfile,hmac,chmod=0400)): logger.log ("sliverauth: (over)wrote hmac into %s " % keyfile) # create the key if needed and returns the key contents def generate_sshkey (sliver): # initial version was storing stuff in the sliver directly # keyfile="/vservers/%s/home/%s/.ssh/id_rsa"%(sliver['name'],sliver['name']) # we're now storing this in the same place as the authorized_keys, which in turn # gets mounted to the user's home directory in the sliver keyfile="/home/%s/.ssh/id_rsa"%(sliver['name']) pubfile="%s.pub"%keyfile dotssh=os.path.dirname(keyfile) # create dir if needed if not os.path.isdir (dotssh): os.mkdir (dotssh, 0700) logger.log_call ( [ 'chown', "%s:slices"%(sliver['name']), dotssh ] ) if not os.path.isfile (pubfile): comment="%s@%s"%(sliver['name'],socket.gethostname()) logger.log_call( [ 'ssh-keygen', '-t', 'rsa', '-N', '', '-f', keyfile , '-C', comment] ) os.chmod (keyfile, 0400) logger.log_call ( [ 'chown', "%s:slices"%(sliver['name']), keyfile, pubfile ] ) return file(pubfile).read().strip() # a sliver can get created, deleted and re-created # the slice having the tag is not sufficient to skip key geneneration def manage_sshkey (plc, sliver): # regardless of whether the tag is there or not, we need to grab the file # if it's lost b/c e.g. the sliver was destroyed we cannot save the tags content ssh_key = generate_sshkey(sliver) old_tag = find_tag (sliver, 'ssh_key') if ssh_key <> old_tag: SetSliverTag(plc, sliver['name'], 'ssh_key', ssh_key) logger.log ("sliverauth: %s: setting ssh_key" % sliver['name'])<|fim▁end|>
if chunk['value'] in (True, 1, '1') or chunk['value'].lower() == "true":
<|file_name|>15.2.3.6-3-80.js<|end_file_name|><|fim▁begin|>/// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the /// "Use Terms"). Any redistribution of this code must retain the above /// copyright and this notice and otherwise comply with the Use Terms. /** * @path ch15/15.2/15.2.3/15.2.3.6/15.2.3.6-3-80.js * @description Object.defineProperty - 'configurable' property in 'Attributes' is an inherited accessor property (8.10.5 step 4.a) */ function testcase() { var obj = {}; <|fim▁hole|> get: function () { return true; } }); var ConstructFun = function () { }; ConstructFun.prototype = proto; var child = new ConstructFun(); Object.defineProperty(obj, "property", child); var beforeDeleted = obj.hasOwnProperty("property"); delete obj.property; var afterDeleted = obj.hasOwnProperty("property"); return beforeDeleted === true && afterDeleted === false; } runTestCase(testcase);<|fim▁end|>
var proto = {}; Object.defineProperty(proto, "configurable", {
<|file_name|>ProcessUtilTest.java<|end_file_name|><|fim▁begin|>/******************************************************************************* * Copyright (c) 2012-2015 Codenvy, S.A. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Codenvy, S.A. - initial API and implementation *******************************************************************************/ package org.eclipse.che.api.core.util; import org.testng.Assert; import org.testng.annotations.Test; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; /** @author andrew00x */ public class ProcessUtilTest { @Test public void testKill() throws Exception { final Process p = Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "sleep 10; echo wake\\ up"}); final List<String> stdout = new ArrayList<>(); final List<String> stderr = new ArrayList<>(); final IOException[] processError = new IOException[1]; final CountDownLatch latch = new CountDownLatch(1); final long start = System.currentTimeMillis(); new Thread() { public void run() { try { ProcessUtil.process(p, new LineConsumer() { @Override public void writeLine(String line) throws IOException { stdout.add(line);<|fim▁hole|> } @Override public void close() throws IOException { } }, new LineConsumer() { @Override public void writeLine(String line) throws IOException { stderr.add(line); } @Override public void close() throws IOException { } } ); } catch (IOException e) { processError[0] = e; // throw when kill process } finally { latch.countDown(); } } }.start(); Thread.sleep(1000); // give time to start process Assert.assertTrue(ProcessUtil.isAlive(p), "Process is not started."); ProcessUtil.kill(p); // kill process latch.await(15, TimeUnit.SECONDS); // should not stop here if process killed final long end = System.currentTimeMillis(); // System process sleeps 10 seconds. It is safety to check we done in less then 3 sec. Assert.assertTrue((end - start) < 3000, "Fail kill process"); System.out.println(processError[0]); //processError[0].printStackTrace(); System.out.println(stdout); System.out.println(stderr); } }<|fim▁end|>
<|file_name|>CountDurableCQEventsCommand.java<|end_file_name|><|fim▁begin|>/* * 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.geode.management.internal.cli.commands; import java.util.List; import java.util.Set; import org.springframework.shell.core.annotation.CliCommand;<|fim▁hole|> import org.apache.geode.cache.execute.ResultCollector; import org.apache.geode.distributed.DistributedMember; import org.apache.geode.management.cli.CliMetaData; import org.apache.geode.management.cli.ConverterHint; import org.apache.geode.management.cli.Result; import org.apache.geode.management.internal.cli.CliUtil; import org.apache.geode.management.internal.cli.domain.SubscriptionQueueSizeResult; import org.apache.geode.management.internal.cli.functions.GetSubscriptionQueueSizeFunction; import org.apache.geode.management.internal.cli.i18n.CliStrings; import org.apache.geode.management.internal.cli.result.ResultBuilder; import org.apache.geode.management.internal.security.ResourceOperation; import org.apache.geode.security.ResourcePermission; public class CountDurableCQEventsCommand extends InternalGfshCommand { DurableClientCommandsResultBuilder builder = new DurableClientCommandsResultBuilder(); @CliCommand(value = CliStrings.COUNT_DURABLE_CQ_EVENTS, help = CliStrings.COUNT_DURABLE_CQ_EVENTS__HELP) @CliMetaData() @ResourceOperation(resource = ResourcePermission.Resource.CLUSTER, operation = ResourcePermission.Operation.READ) public Result countDurableCqEvents( @CliOption(key = CliStrings.COUNT_DURABLE_CQ_EVENTS__DURABLE__CLIENT__ID, mandatory = true, help = CliStrings.COUNT_DURABLE_CQ_EVENTS__DURABLE__CLIENT__ID__HELP) final String durableClientId, @CliOption(key = CliStrings.COUNT_DURABLE_CQ_EVENTS__DURABLE__CQ__NAME, help = CliStrings.COUNT_DURABLE_CQ_EVENTS__DURABLE__CQ__NAME__HELP) final String cqName, @CliOption(key = {CliStrings.MEMBER, CliStrings.MEMBERS}, help = CliStrings.COUNT_DURABLE_CQ_EVENTS__MEMBER__HELP, optionContext = ConverterHint.MEMBERIDNAME) final String[] memberNameOrId, @CliOption(key = {CliStrings.GROUP, CliStrings.GROUPS}, help = CliStrings.COUNT_DURABLE_CQ_EVENTS__GROUP__HELP, optionContext = ConverterHint.MEMBERGROUP) final String[] group) { Result result; try { Set<DistributedMember> targetMembers = findMembers(group, memberNameOrId); if (targetMembers.isEmpty()) { return ResultBuilder.createUserErrorResult(CliStrings.NO_MEMBERS_FOUND_MESSAGE); } String[] params = new String[2]; params[0] = durableClientId; params[1] = cqName; final ResultCollector<?, ?> rc = CliUtil.executeFunction(new GetSubscriptionQueueSizeFunction(), params, targetMembers); final List<SubscriptionQueueSizeResult> funcResults = (List<SubscriptionQueueSizeResult>) rc.getResult(); String queueSizeColumnName; if (cqName != null && !cqName.isEmpty()) { queueSizeColumnName = CliStrings .format(CliStrings.COUNT_DURABLE_CQ_EVENTS__SUBSCRIPTION__QUEUE__SIZE__CLIENT, cqName); } else { queueSizeColumnName = CliStrings.format( CliStrings.COUNT_DURABLE_CQ_EVENTS__SUBSCRIPTION__QUEUE__SIZE__CLIENT, durableClientId); } result = builder.buildTableResultForQueueSize(funcResults, queueSizeColumnName); } catch (Exception e) { result = ResultBuilder.createGemFireErrorResult(e.getMessage()); } return result; } }<|fim▁end|>
import org.springframework.shell.core.annotation.CliOption;
<|file_name|>specs.py<|end_file_name|><|fim▁begin|>import re import os import logging from collections import defaultdict from insights.config.static import get_config from insights.config import AnalysisTarget, META_FILE_LIST, CommandSpec logger = logging.getLogger(__name__) logger.setLevel(logging.FATAL) class SpecMapper(object): """ This class wraps a tarfile-like object with spec mapping of names. """ def __init__(self, tf_object, data_spec_config=None): self.tf = tf_object self.all_names = [f for f in self.tf.getnames() if self._name_filter(f)] self.root = os.path.commonprefix(self.all_names) logger.debug("SpecMapper.root: %s", self.root) self.data_spec_config = data_spec_config if data_spec_config else get_config() self.symbolic_files = defaultdict(list) self.analysis_target = self._determine_analysis_target() self.create_symbolic_file_list() def _name_filter(self, name): return not (self.tf.isdir(name) or name.endswith(".tar.gz")) def _get_first_matching(self, pattern): for match in filter( re.compile(self.root + "?" + pattern + "$").match, self.all_names):<|fim▁hole|> def _determine_analysis_target(self): path = self._get_first_matching(META_FILE_LIST["analysis_target"]) if path: section = self.get_content(path, symbolic=False)[0].strip() return AnalysisTarget.get(section) def _extend_symbolic_files(self, symbolic_name, matches): if matches: self.symbolic_files[symbolic_name].extend(matches) def filter_commands(self, files): for f in files: if "sos_commands" in f or "insights_commands" in f or "commands/" in f: yield f def add_files(self, file_map): logger.debug("ROOT: %s", self.root) unrooted_map = { f.split(self.root)[1]: f for f in self.all_names if f != self.root } unrooted_files = set(unrooted_map) commands = set(self.filter_commands(unrooted_files)) non_commands = unrooted_files - commands if logger.level == logging.DEBUG: logger.debug("\n".join(uf for uf in sorted(unrooted_files))) for symbolic_name, spec_group in file_map.iteritems(): for spec in spec_group.get_all_specs(): # Usually just one item in paths is_command = isinstance(spec, CommandSpec) # foreman-debug archives contain flat structures of commands # that can be confused with other command outputs easily so # we'll add a ^ to the beginning of the pattern if it is not an # insights archive if '/' in spec.get_path() or self.analysis_target is not None: prefix = '' else: prefix = '^' r = spec.get_regex(prefix=prefix, analysis_target=self.analysis_target) if is_command or "_commands/" in r.pattern: filter_set = commands else: filter_set = non_commands logger.debug("Pattern: %s", r.pattern) matches = filter(r.search, filter_set) if matches: matches = [unrooted_map[m] for m in matches] # In order to prevent matching *dumb* symlinks in some # archive formats, we are going to filter out symlinks when # calculating matches for CommandSpecs if is_command: matches = filter(lambda n: not self.tf.issym(n), matches) # filter out directories that match matches = [m for m in matches if not self.tf.isdir(m)] if not matches: continue # In order to prevent accidental duplication when matching # files, we only allow the first matched file to be added # to the working set for non-pattern file specs. if not spec.is_multi_output() and len(matches) > 1: logger.debug("Non multi-output file had multiple matches: %s", matches) self._extend_symbolic_files(symbolic_name, [matches[0]]) else: self._extend_symbolic_files(symbolic_name, matches) break # only add the first matching pattern def _add_meta_files(self): for symbolic_name, suffix in META_FILE_LIST.items(): archive_path = self._get_first_matching(suffix) if archive_path: self._extend_symbolic_files(symbolic_name, [archive_path]) def create_symbolic_file_list(self): self.add_files(self.data_spec_config.get_spec_lists()) if not self.analysis_target: self.add_files(self.data_spec_config.get_meta_specs()) else: self._add_meta_files() def get_content(self, path, split=True, symbolic=True, default=""): """Returns file content from path, where path is the full pathname inside the archive""" if symbolic: path = self.symbolic_files.get(path, [""])[0] content = self.tf.extractfile(path) if path in self.all_names else default return list(content.splitlines()) if split else content def exists(self, path, symbolic=True): return path in self.symbolic_files if symbolic else path in self.all_names<|fim▁end|>
return match
<|file_name|>price.ts<|end_file_name|><|fim▁begin|>// third-party deps import { reduce, sortBy, isNil, isEmpty, mapValues, each, Dictionary } from 'lodash'; import { IHttpService, ILogService, IPromise } from 'angular'; import * as moment from 'moment'; type ILocalStorageService = angular.local.storage.ILocalStorageService; // internal deps import { ILineItem } from './line-item'; import { SHORT_DATE_FORMAT } from '../config'; import { IState as IAppConfig, ConfigService } from '../../app/config'; <|fim▁hole|> size: string; } export interface IPriceGroup { date: string; price: number; items: IPriceGroupItem[]; } // response format from API // { // '2016-07-12': [{ // date: 'xxx', // price: 'xxx', // items: 'xxx' // }] // } export type PriceGroupsByDate = Dictionary<IPriceGroup[]>; // {'2016-07-12': GroupKeyToPriceMap, ...} export type PricesByDate = Dictionary<GroupKeyToPriceMap>; // consumer price format // { // '24-big|3-big|': 75, // '34-big|76-big|': 80, // '5-medium|82-medium|': 55, // ... // } export type GroupKeyToPriceMap = Dictionary<number>; export type PriceList = Dictionary<number>; /* tslint:disable */ // export const priceList: PriceList = { // // big ----------------------------------------------------------------------- // // full // 'meat-big|garnish-big|salad-big': 70, // 'fish-big|garnish-big|salad-big': 90, // // no meat/fish // 'garnish-big|salad-big': 45, // // no salad (meat included) // 'meat-big|garnish-big': 55, // // no salad (fish included) // 'fish-big|garnish-big': 75, // // no garnish (meat included) // 'meat-big|salad-big': 55, // // no garnish (fish included) // 'fish-big|salad-big': 75, // 'salad-big': 25, // 'meat-big': 35, // 'fish-big': 55, // 'garnish-big': 30, // // medium -------------------------------------------------------------------- // // full // 'meat-medium|garnish-medium|salad-medium': 45, // 'fish-medium|garnish-medium|salad-medium': 55, // // no meat/fish // 'garnish-medium|salad-medium': 35, // // no salad (meat included) // 'meat-medium|garnish-medium': 40, // // no salad (fish included) // 'fish-medium|garnish-medium': 50, // // no garnish (meat included) // 'meat-medium|salad-medium': 40, // // no garnish (fish included) // 'fish-medium|salad-medium': 50, // 'salad-medium': 20, // 'meat-medium': 30, // 'fish-medium': 45, // 'garnish-medium': 20 // }; /* tslint:enable */ // todo: a lot of performance issues export class PriceService { private lConfig: IAppConfig; constructor( private $http: IHttpService, private $log: ILogService, // private $timeout: ITimeoutService, private localStorageService: ILocalStorageService, private configService: ConfigService ) { 'ngInject'; this.configService.get().first().subscribe(config => this.lConfig = config); } fetchPriceGroupsForActualDays(): IPromise<PricesByDate> { const startDate = moment().format(SHORT_DATE_FORMAT); const endDate = moment().add(1, 'weeks').endOf('week').format(SHORT_DATE_FORMAT); const url = this.lConfig.apiUrl + '/prices?startDate=' + startDate + '&endDate=' + endDate; return this.$http.get<PriceGroupsByDate>(url, {cache: true}) .then(res => res.data) .then(priceGroupsByData => { const pricesByDate = this.priceGroupsByDateToPricesByDate(priceGroupsByData); this.storeToLocalStorage(pricesByDate); return pricesByDate; }); } priceGroupsByDateToPricesByDate(priceGroupsByDate: PriceGroupsByDate): PricesByDate { return mapValues(priceGroupsByDate, priceGroups => { return this.convertPriceGroupsToKeyPrice(priceGroups); }); } calcPriceForAll(orderLineItems: ILineItem[], date: string): number { if (orderLineItems.length === 0) { return 0; } let prices = this.getPricesFromLocalStorage(date); if (isEmpty(prices)) { return 0; } const orderGroupKey = this.groupKeyForLineItems(orderLineItems); let price = prices[orderGroupKey]; if (isNil(price)) { price = this.calcFallbackPriceFor(orderLineItems, prices); this.$log.warn('Price: Price not found! Calculate sum of product prices.', price, orderLineItems, prices); } return price; } // todo: find out more clean solution // createPriceGroupsForAllMenus(menus: IMenu[]): IPriceGroup[] { // let priceGroups = []; // each(menus, menu => { // priceGroups = union(priceGroups, this.createPriceGroupsForDayMenu(menu)); // }); // return priceGroups; // } // // todo: generalize for any amount of menu products and sizes // createPriceGroupsForDayMenu(menu: IMenu): IPriceGroup[] { // let meat, // garnish, // salad, // meatGarnishPriceGroupBig, // meatGarnishPriceGroupMedium, // garnishSaladPriceGroupBig, // garnishSaladPriceGroupMedium; // if (menu.products.length === 3) { // meat = menu.products[0]; // garnish = menu.products[1]; // salad = menu.products[2]; // } else { // meat = menu.products[0]; // salad = menu.products[1]; // } // const perProductPriceGroupsBig = this.createPerProductPriceGroups(menu, 'big'); // const perProductPriceGroupsMedium = this.createPerProductPriceGroups(menu, 'medium'); // const allProductsPriceGroupBig = this.createPriceGroupForProductsCombination(menu.products, menu.date, 'big'); // const allProductsPriceGroupMedium = this.createPriceGroupForProductsCombination(menu.products, menu.date, 'medium'); // const meatSaladPriceGroupBig = this.createPriceGroupForProductsCombination([meat, salad], menu.date, 'big'); // const meatSaladPriceGroupMedium = this.createPriceGroupForProductsCombination([meat, salad], menu.date, 'medium'); // if (garnish) { // meatGarnishPriceGroupBig = this.createPriceGroupForProductsCombination([meat, garnish], menu.date, 'big'); // meatGarnishPriceGroupMedium = this.createPriceGroupForProductsCombination([meat, garnish], menu.date, 'medium'); // garnishSaladPriceGroupBig = this.createPriceGroupForProductsCombination([garnish, salad], menu.date, 'big'); // garnishSaladPriceGroupMedium = this.createPriceGroupForProductsCombination([garnish, salad], menu.date, 'medium'); // } // let groups = union( // perProductPriceGroupsBig, // perProductPriceGroupsMedium, // [ // allProductsPriceGroupBig, // allProductsPriceGroupMedium, // meatSaladPriceGroupBig, // meatSaladPriceGroupMedium, // ] // ); // if (garnish) { // groups = union( // groups, // [ // meatGarnishPriceGroupBig, // meatGarnishPriceGroupMedium, // garnishSaladPriceGroupBig, // garnishSaladPriceGroupMedium // ] // ); // } // return groups; // } // createPriceGroupForProductsCombination(products: IProduct[], date: string, size: string): IPriceGroup { // const price = this.calcPriceForProductCombination(products, size); // const items = this.createPriceGroupItemsForAll(products, size); // return {date, price, items}; // } // pushPriceGroups(groups: IPriceGroup[]): void { // each(groups, group => { // const url = this.lConfig.apiUrl + '/prices/' + group.date; // this.$timeout(() => { // this.$http.put(url, group); // }, 1000); // }); // } // private calcPriceForProductCombination(products: IProduct[], size: string): number { // const key = map(products, product => product.type + '-' + size).join('|'); // return priceList[key]; // } // private createPerProductPriceGroups(menu: IMenu, size: string): IPriceGroup[] { // return map(menu.products, product => { // return this.createPriceGroupForProductsCombination([product], menu.date, size); // }); // } // private createPriceGroupItemsForAll(products: IProduct[], size: string): IPriceGroupItem[] { // return map(products, product => { // return { // size, // productId: product.id // }; // }); // } private groupKeyForLineItems(lineItems: ILineItem[]): string { const sortedLineItems = sortBy(lineItems, 'product.id'); return reduce(sortedLineItems, (key, lineItem) => { return key + this.groupKeyForLineItem(lineItem); }, ''); } private groupKeyForLineItem(lineItem: ILineItem): string { return lineItem.product.id + '-' + lineItem.size + '|'; } private groupKeyForPriceGroup(priceGroup: IPriceGroup): string { const sortedPriceGroupItems = sortBy(priceGroup.items, 'productId'); return reduce(sortedPriceGroupItems, (key, priceItem) => { return key + priceItem.productId + '-' + priceItem.size + '|'; }, ''); } private convertPriceGroupsToKeyPrice(priceGroups: IPriceGroup[]): GroupKeyToPriceMap { const keyPriceHash = {}; each(priceGroups, priceGroup => { const groupKey = this.groupKeyForPriceGroup(priceGroup); keyPriceHash[groupKey] = priceGroup.price; }); return keyPriceHash; } private calcFallbackPriceFor(lineItems: ILineItem[], prices: GroupKeyToPriceMap): number { return reduce(lineItems, (_, lineItem) => { return prices[this.groupKeyForLineItem(lineItem)]; }, 0); } private storeToLocalStorage(prices: PricesByDate): boolean { if (!prices) { return false; } return this.localStorageService.set('pricesByDate', prices); } private getPricesFromLocalStorage(date: string): GroupKeyToPriceMap { const prices = this.localStorageService.get('pricesByDate'); if (!prices) { return {}; } return prices[date] || {}; } }<|fim▁end|>
export interface IPriceGroupItem { productId: number;
<|file_name|>ring-king-one-direction.go<|end_file_name|><|fim▁begin|>package main import ( "fmt" "math/rand" "sync" "time" ) var wg sync.WaitGroup type Process struct { in chan int out chan int id int } func (process *Process) run() { for { go func() { process.out <- process.id fmt.Printf("sent right (%d)\n", process.id) }() l1 := <-process.in go func() { process.out <- l1 fmt.Printf("sent right 2 (%d)\n", process.id) }() l2 := <-process.in // rename: I behave like my left neighbour l := l2 r := process.id process.id = l1 if l == process.id || r == process.id { // I'm talking to myself fmt.Printf("I'm the king (%d)!", process.id) wg.Done() return } if process.id < l || process.id < r { fmt.Printf("die! (%d)\n", process.id) break<|fim▁hole|> // after dying just forward messages go func() { for { tmp := <-process.in process.out <- tmp } }() } func main() { rand.Seed(time.Now().UTC().UnixNano()) n := 1024 processes := make([]Process, n) channels := make([]chan int, n) for i := 0; i < n; i++ { channels[i] = make(chan int) } perm := rand.Perm(n) for i := 0; i < n; i++ { processes[i].id = perm[i] processes[i].in = channels[(i-1+n)%n] processes[i].out = channels[i%n] } wg.Add(1) for i := 0; i < n; i++ { go processes[i].run() } wg.Wait() // for king election }<|fim▁end|>
} else { fmt.Printf("live! (%d)\n", process.id) } }
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>r""" Utilities and helper classes/functions ====================================== This module contains two very important classes (Project and Workspace) as well as a number of helper classes. """ import logging as logging<|fim▁hole|>from ._project import * # You can add info to the logger message by inserting the desired %(item) # For a list of available items see: # https://docs.python.org/3/library/logging.html#logrecord-attributes # NOTE: If the calling locations appears as 'root' it's because the logger # was not given a name in a file somewhere. A good option is __name__. log_format = \ '-' * 60 + '\n\ %(levelname)-11s: %(message)s \n\ SOURCE : %(name)s.%(funcName)s \n\ TIME STAMP : %(asctime)s\ \n' + '-' * 60 logging.basicConfig(level=logging.WARNING, format=log_format) del log_format def _get_version(): from openpnm.__version__ import __version__ return __version__.strip(".dev0")<|fim▁end|>
from .misc import * from ._settings import * from ._workspace import *
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>// min example #include <cassert> #include <iostream> #include <algorithm> using namespace std; int main () { cout << "min(1,2)==" << min(1,2) << endl; assert(min(1,2) == 1); cout << "min(2,1)==" << min(2,1) << endl; cout << "min('a','z')==" << min('a','z') << endl; assert(min('a','z') != 'a'); cout << "min(3.14,2.72)==" << min(3.14,2.72) << endl;<|fim▁hole|> return 0; }<|fim▁end|>
assert(min(3.14,2.72) == 2.72);
<|file_name|>gdt.rs<|end_file_name|><|fim▁begin|>use core::mem::size_of; use core::ptr; use core::sync::atomic::{AtomicU8, Ordering}; use x86_64::structures::gdt::SegmentSelector;<|fim▁hole|>use x86_64::structures::tss::TaskStateSegment; use x86_64::{PrivilegeLevel, VirtAddr}; pub use x86_64::structures::gdt::Descriptor; use crate::memory::constants::GDT_ADDR; pub const DOUBLE_FAULT_IST_INDEX: usize = 0; /// Max size is fixed so we can have an array of these const GDT_MAX_SIZE: usize = 8; pub struct GdtBuilder { addr: VirtAddr, next_entry: usize, } impl GdtBuilder { unsafe fn new(addr: VirtAddr) -> Self { Self { addr, next_entry: 1, // first entry is the null descriptor, so it is not free } } pub fn add_entry(&mut self, entry: Descriptor) -> SegmentSelector { let base: *mut u64 = self.addr.as_mut_ptr(); let index = self.next_entry; unsafe { match entry { Descriptor::UserSegment(value) => { assert!(index + 1 < GDT_MAX_SIZE, "GDT full"); ptr::write(base.add(self.next_entry), value); self.next_entry += 1; }, Descriptor::SystemSegment(value_low, value_high) => { assert!(index + 2 < GDT_MAX_SIZE, "GDT full"); ptr::write(base.add(self.next_entry), value_low); ptr::write(base.add(self.next_entry + 1), value_high); self.next_entry += 2; }, }; } SegmentSelector::new(index as u16, PrivilegeLevel::Ring0) } pub unsafe fn load(self) { use core::mem::size_of; use x86_64::instructions::tables::{lgdt, DescriptorTablePointer}; let ptr = DescriptorTablePointer { base: self.addr, limit: (self.next_entry * size_of::<u64>() - 1) as u16, }; lgdt(&ptr); } } static USED_GDTS: AtomicU8 = AtomicU8::new(0); /// Adds to an array of immutable GDTs, one for each processor core pub fn create_new() -> GdtBuilder { let index = USED_GDTS.fetch_add(1, Ordering::SeqCst); let new_gdt_base = GDT_ADDR.as_u64() + (index as u64) * (GDT_MAX_SIZE * size_of::<u64>()) as u64; unsafe { GdtBuilder::new(VirtAddr::new(new_gdt_base)) } }<|fim▁end|>
<|file_name|>macro-use-all.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // aux-build:two_macros.rs #[macro_use] extern crate two_macros; pub fn main() { macro_one!(); macro_two!();<|fim▁hole|><|fim▁end|>
}
<|file_name|>HealthyInfoDetailEntity.java<|end_file_name|><|fim▁begin|>package com.dream.plmm.bean; /** * Created by likun on 16/8/19. */ public class HealthyInfoDetailEntity { /** * count : 1754 * description : 平时要注意开窗通风,要多吃“补氧”食物,例如葵花子油、杏仁、奇异果、红薯等,还要多进行一些慢跑等有氧运动,这些都助于身体吸纳氧气 * fcount : 0 * id : 10 * img : /lore/150731/af4811aaf581c7369c4c425d449ab94d.jpg * keywords : 身体 缺氧 症状 心功能不全 内分泌系统 * loreclass : 12 * message : <p> </p> <p> 现在,制氧机已经超越了医疗抢救机器这一概念,成为家庭中一件时髦的健康器材,尤其受到老人的青睐。那么,怎么知道自己身体是否缺氧,又如何为身体补氧呢? </p> <p> 以下这些症状就预示我们身体可能出现了缺氧。神经系统:精神差、打哈欠、整天感觉疲倦、无力、记忆力变差、注意力不能集中、工作能力下降、失眠、痴呆。心血管系统:经常头晕、心慌、胸闷、憋气、血压不正常、面色灰暗、眼睑或肢体水肿。胃肠、内分泌系统:食欲变差、经常便秘、胃胀痛、烦躁、易感冒。肌肉骨骼系统:容易抽筋、腰腿酸痛或关节痛。皮肤黏膜:容易口腔溃烂、咽喉发炎、牙龈出血等。 </p> <p> 如果身体出现一些缺氧的症状该怎么办呢?平时要注意开窗通风,要多吃“补氧”食物,例如葵花子油、杏仁、奇异果、红薯等,还要多进行一些慢跑等有氧运动,这些都助于身体吸纳氧气。 </p> <p> 当身体有明显缺氧症,并经过开窗、食补、运动等方式仍不能缓解症状时,尤其是有明确的慢性缺氧性疾病如慢性阻塞性肺病、心功能不全等,采用家庭吸氧比较好。 </p> <br> * rcount : 0 * status : true * time : 1438305244000 * title : 身体缺氧五大信号又该如何为身体补氧呢? * url : http://www.tngou.net/lore/show/10 */ private int count; private String description; private int fcount; private int id; private String img;<|fim▁hole|> private boolean status; private long time; private String title; private String url; public int getCount() { return count; } public void setCount(int count) { this.count = count; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public int getFcount() { return fcount; } public void setFcount(int fcount) { this.fcount = fcount; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getImg() { return img; } public void setImg(String img) { this.img = img; } public String getKeywords() { return keywords; } public void setKeywords(String keywords) { this.keywords = keywords; } public int getLoreclass() { return loreclass; } public void setLoreclass(int loreclass) { this.loreclass = loreclass; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public int getRcount() { return rcount; } public void setRcount(int rcount) { this.rcount = rcount; } public boolean isStatus() { return status; } public void setStatus(boolean status) { this.status = status; } public long getTime() { return time; } public void setTime(long time) { this.time = time; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } }<|fim▁end|>
private String keywords; private int loreclass; private String message; private int rcount;
<|file_name|>add-userid.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import absolute_import, division, unicode_literals # Copyright (C) 2018 Ben McGinnes <[email protected]> # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # # This program 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.1 of the License, or (at your option) # any later version. # # This program 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 and the GNU<|fim▁hole|># You should have received a copy of the GNU General Public License and the GNU # Lesser General Public along with this program; if not, see # <https://www.gnu.org/licenses/>. import gpg import os.path print(""" This script adds a new user ID to an existing key. The gpg-agent and pinentry are invoked to enter the passphrase. """) c = gpg.Context() homedir = input("Enter the GPG configuration directory path (optional): ") fpr0 = input("Enter the fingerprint of the key to modify: ") uid_name = input("Enter the name of the user ID: ") uid_email = input("Enter the email address of the user ID: ") uid_cmnt = input("Enter a comment to include (optional): ") if homedir.startswith("~"): if os.path.exists(os.path.expanduser(homedir)) is True: c.home_dir = os.path.expanduser(homedir) else: pass elif os.path.exists(homedir) is True: c.home_dir = homedir else: pass fpr = "".join(fpr0.split()) if uid_cmnt: userid = "{0} ({1}) <{2}>".format(uid_name, uid_cmnt, uid_email) else: userid = "{0} <{2}>".format(uid_name, uid_email) key = c.get_key(fpr, secret=True) c.key_add_uid(key, userid)<|fim▁end|>
# Lesser General Public License for more details. #
<|file_name|>ShieldIcon.tsx<|end_file_name|><|fim▁begin|><|fim▁hole|>import { createIcon } from '../Icon'; export const ShieldIcon = createIcon( <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" />, 'ShieldIcon' );<|fim▁end|>
import * as React from 'react';
<|file_name|>drop.ts<|end_file_name|><|fim▁begin|>import * as R_drop from '../ramda/dist/src/drop'; declare const number: number; declare const string: string; declare const boolean_array: boolean[];<|fim▁hole|>// @dts-jest:pass R_drop(number, string); // @dts-jest:pass R_drop(number, boolean_array);<|fim▁end|>
<|file_name|>issue-6344-let.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. struct A { x: uint } impl Drop for A { fn drop(&mut self) {} } pub fn main() { let a = A { x: 0 }; <|fim▁hole|><|fim▁end|>
let A { x: ref x } = a; info!("{:?}", x) }
<|file_name|>DeleteDelta.java<|end_file_name|><|fim▁begin|>/** * 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. * * Copyright 2012-2017 the original author or authors. */ package org.assertj.core.util.diff; import java.util.List; /** * Initially copied from https://code.google.com/p/java-diff-utils/. * <p> * Describes the delete-delta between original and revised texts. * * @author <a href="[email protected]">Dmitry Naumenko</a> * @param <T> The type of the compared elements in the 'lines'. */ public class DeleteDelta<T> extends Delta<T> { /** * Creates a change delta with the two given chunks. * * @param original * The original chunk. Must not be {@code null}. * @param revised * The original chunk. Must not be {@code null}. */ public DeleteDelta(Chunk<T> original, Chunk<T> revised) { super(original, revised); } /** * {@inheritDoc} */ @Override public void applyTo(List<T> target) throws IllegalStateException {<|fim▁hole|> for (int i = 0; i < size; i++) { target.remove(position); } } @Override public TYPE getType() { return Delta.TYPE.DELETE; } @Override public void verify(List<T> target) throws IllegalStateException { getOriginal().verify(target); } }<|fim▁end|>
verify(target); int position = getOriginal().getPosition(); int size = getOriginal().size();
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python <|fim▁hole|> if __name__ == "__main__": from django.core.management import execute_from_command_line os.environ.setdefault("DJANGO_SETTINGS_MODULE", "worldmap.settings") execute_from_command_line(sys.argv)<|fim▁end|>
import os import sys
<|file_name|>routes.js<|end_file_name|><|fim▁begin|>// These are the pages you can go to. // They are all wrapped in the App component, which should contain the navbar etc // See http://blog.mxstbr.com/2016/01/react-apps-with-pages for more information // about the code splitting business import { getAsyncInjectors } from './utils/asyncInjectors'; const errorLoading = (err) => { console.error('Dynamic page loading failed', err); // eslint-disable-line no-console }; const loadModule = (cb) => (componentModule) => { cb(null, componentModule.default); }; export default function createRoutes(store) { // create reusable async injectors using getAsyncInjectors factory const { injectReducer, injectSagas } = getAsyncInjectors(store); return [ { path: '/', name: 'home', getComponent(nextState, cb) { const importModules = Promise.all([ import('containers/HomePage/reducer'), import('containers/HomePage/sagas'), import('containers/HomePage'), ]); const renderRoute = loadModule(cb); importModules.then(([reducer, sagas, component]) => { injectReducer('home', reducer.default); injectSagas(sagas.default); renderRoute(component); }); importModules.catch(errorLoading); }, }, { path: '/features', name: 'features', getComponent(nextState, cb) { import('containers/FeaturePage') .then(loadModule(cb)) .catch(errorLoading); }, }, { path: '/login', name: 'login', getComponent(nextState, cb) { const importModules = Promise.all([ import('containers/LoginPage/reducer'), import('containers/LoginPage/sagas'), import('containers/LoginPage'), ]); const renderRoute = loadModule(cb); importModules.then(([reducer, sagas, component]) => { injectReducer('loginPage', reducer.default); injectSagas(sagas.default); renderRoute(component); }); importModules.catch(errorLoading); }, }, { path: '/signup', name: 'signup', getComponent(nextState, cb) { const importModules = Promise.all([ import('containers/SignupPage/reducer'), import('containers/SignupPage/sagas'), import('containers/SignupPage'), ]); const renderRoute = loadModule(cb); importModules.then(([reducer, sagas, component]) => { injectReducer('signupPage', reducer.default); injectSagas(sagas.default); renderRoute(component); }); importModules.catch(errorLoading); }, }, { path: '/restorepassword', name: 'restorepassword', getComponent(nextState, cb) { const importModules = Promise.all([ import('containers/PasswordRestorePage/reducer'), import('containers/PasswordRestorePage/sagas'), import('containers/PasswordRestorePage'), ]); const renderRoute = loadModule(cb); importModules.then(([reducer, sagas, component]) => { injectReducer('passwordRestorePage', reducer.default); injectSagas(sagas.default); renderRoute(component); }); importModules.catch(errorLoading); }, }, { path: '/trackingpage', name: 'trackingpage', getComponent(nextState, cb) { const importModules = Promise.all([ import('containers/TrackingPage/reducer'), import('containers/TrackingPage/sagas'), import('containers/TrackingPage'), ]); const renderRoute = loadModule(cb); importModules.then(([reducer, sagas, component]) => { injectReducer('trackingPage', reducer.default); injectSagas(sagas.default); renderRoute(component); }); importModules.catch(errorLoading); }, }, { path: '/userprofile', name: 'userprofilepage', getComponent(nextState, cb) { const importModules = Promise.all([ import('containers/UserProfilePage/reducer'), import('containers/UserProfilePage/sagas'), import('containers/UserProfilePage'), ]); const renderRoute = loadModule(cb); importModules.then(([reducer, sagas, component]) => { injectReducer('userProfilePage', reducer.default); injectSagas(sagas.default); renderRoute(component); }); importModules.catch(errorLoading); }, }, { path: '*',<|fim▁hole|> name: 'notfound', getComponent(nextState, cb) { import('containers/NotFoundPage') .then(loadModule(cb)) .catch(errorLoading); }, }, ]; }<|fim▁end|>
<|file_name|>login.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import { FormControl, Validators, FormGroup, FormArray, FormBuilder } from '@angular/forms'; import { Store } from '@ngrx/store'; import { StoreMainActions, State } from "app-shared"; import { AuthService, LoggingService } from 'app-shared'; @Component({ selector: 'login', templateUrl: './login.component.html' }) export class LoginComponent implements OnInit { public formMain: FormGroup; public waiting: boolean; public errorApi: IErrorApi; public errorLogin: boolean; public showPassword: boolean = false; public returnUrl: string; constructor( private authService: AuthService, private route: ActivatedRoute, private router: Router, private fb: FormBuilder, private loggingService: LoggingService, private store: Store<State.global> ) { } public ngOnInit() { let isLogin, hasLogin; if (window.localStorage.userName) { hasLogin = true; isLogin = window.localStorage.userName; } //If a token is set, do not allow users to hit the login page and route them to the index page if (window.sessionStorage.token) { //this.router.navigate(['/']); // 2DO: Breaks automated testing, not essential but would be nice } window.clearTimeout(this.authService.sessionTimer); // When the page is loaded, clear any legacy timeouts this.authService.logOutModal = null; // Get rid of logout modal if it persists this.formMain = this.fb.group({ // <-- the parent FormGroup userName: [isLogin || 'someUser', [Validators.required]], password: ['123456', [Validators.required]], remember: [hasLogin] }); // get return url from route parameters or default to '/' this.returnUrl = this.route.snapshot.queryParams['returnUrl'] || '/'; } <|fim▁hole|> * Submit the form */ public onLogin() { this.waiting = true; this.errorApi = null; this.errorLogin = false; // If the remember checkbox was checked if (this.formMain.value.remember) { window.localStorage.userName = this.formMain.value.userName; // Store the username } else { delete window.localStorage.userName; // Delete the username } this.authService.logIn(this.formMain.value).subscribe( (success) => { // If the API response returns 200 but the login is invalid if (success.status == 401 || success.status == 403) { this.errorLogin = true; } // Valid Login else { this.loggingService.identify(this.formMain.value.email); // Identify user to mixpanel this.loggingService.trackEvent('User Logged In'); this.router.navigate([this.returnUrl]); } }, (error) => { this.errorLogin = true; //error.errorMsg = 'Error logging in' //this.errorApi = error; }, () => { this.waiting = false; this.errorApi = null; this.errorLogin = false; } ) } // end onSubmit }<|fim▁end|>
/**
<|file_name|>script.js<|end_file_name|><|fim▁begin|>(function(){ if ( !window.File || !window.FileReader || !window.FileList || !window.Blob) return alert('La API de Archivos no es compatible con tu navegador. Considera actualizarlo.'); var Fractal = { loaded: false, imagen: null, tipo: "mandelbrot", busy: false, mode: 0, lastTime: 0, properties: { width:500, height:500 }, dimensions: { x:{s:0,e:0}, y:{s:0,e:0} }, iniciate: function(){ Fractal.loaded = true; Fractal.resetDimentions(); UI.setFractalprop(); }, clear: function(){ Fractal.loaded = false; Fractal.imagen = null; }, resetDimentions: function(){ var d = fractal[Fractal.tipo].prototype.dim; Fractal.dimensions = { x:{s:d.x.s,e:d.x.e}, y:{s:d.y.s,e:d.y.e} }; UI.setDimensions(); }, render: function(){ var self = this; Fractal.dimensions = UI.getDimensions(); if ( !Fractal.loaded || Fractal.busy ) return alert("El Fractal está ocupado"); if ( ! Fractal.paleta.loaded ) return alert("Cargar una paleta"); Fractal.busy = true; UI.rendering(); setTimeout(function(){ Fractal.lastTime = Date.now(); Fractal.imagen = new engine.Imagen(); var process = new engine.ProcessMulti( "fractal.worker.js", Fractal.imagen, UI.getWorkers(), FractalProcessing); // Asignar paleta //process.on("paint",function(f){return self.paleta.getColor(f);}); // Al terminar de procesar: process.on("end",function(){ Fractal.busy = false; Fractal.lastTime = Date.now() - Fractal.lastTime; <|fim▁hole|> UI.setFractalprop(); // Guardar imagen del fractal Fractal.imagen = process.source; UI.rendered(); }); console.log(Fractal.properties); Fractal.imagen.create( Fractal.properties.width , Fractal.properties.height ); //if ( Fractal.paleta.loaded ) { // Usar paleta process.loop({ fractal_nom: Fractal.tipo }, {x:0,y:0}, {x:Fractal.properties.width,y:Fractal.properties.height}, Fractal.dimensions, Fractal.paleta ); //} else return alert("La paleta no está cargada"); },100); }, calcularZoom: function(pos,medidas){ var offset_x = - Fractal.dimensions.x.s, offset_y = - Fractal.dimensions.y.s, w = Fractal.dimensions.x.e - Fractal.dimensions.x.s, h = Fractal.dimensions.y.e - Fractal.dimensions.y.s; Fractal.dimensions.x.s = ( pos.x / Fractal.properties.width ) * w - offset_x; Fractal.dimensions.y.s = ( pos.y / Fractal.properties.height ) * h - offset_y; Fractal.dimensions.x.e = ( ( pos.x + medidas ) / Fractal.properties.width ) * w - offset_x; Fractal.dimensions.y.e = ( ( pos.y + medidas ) / Fractal.properties.height ) * h - offset_y; UI.setDimensions(); }, calcularDesplazo: function(x,y){ var offset_x = - Fractal.dimensions.x.s, offset_y = - Fractal.dimensions.y.s, w = Fractal.dimensions.x.e - Fractal.dimensions.x.s, h = Fractal.dimensions.y.e - Fractal.dimensions.y.s, desplazo = { h: ( x / Fractal.properties.width ) * w - offset_x - Fractal.dimensions.x.s, v: ( y / Fractal.properties.height ) * h - offset_y - Fractal.dimensions.y.s }; Fractal.dimensions.x.s += desplazo.h; Fractal.dimensions.y.s += desplazo.v; Fractal.dimensions.x.e += desplazo.h; Fractal.dimensions.y.e += desplazo.v; console.log({h:desplazo.h,v:desplazo.v},{x:x,y:y}); UI.setDimensions(); }, paleta: null }; engine.MyCanvas.init(Fractal.properties.width,Fractal.properties.height); var UI = { $els: {}, init: function(){ this.$els.Fractal = {}; this.$els.Fractal.fetchType = $("#fractalType"); this.$els.Fractal.fileName = this.$els.Fractal.fetchType.children('a:first'); this.$els.Fractal.selectType = this.$els.Fractal.fetchType.children('select#tipoFractal'); this.$els.Fractal.settings = $("#FractalSettings"); this.$els.Fractal.complejos = this.$els.Fractal.settings.find('ul#complejos'); this.$els.Fractal.dims = { s_x: this.$els.Fractal.complejos.find('output[name="s_x"]'), s_y: this.$els.Fractal.complejos.find('output[name="s_y"]'), e_x: this.$els.Fractal.complejos.find('output[name="e_x"]'), e_y: this.$els.Fractal.complejos.find('output[name="e_y"]') }; this.$els.Fractal.modo = this.$els.Fractal.settings.find("#modes .btn-group"); this.$els.Fractal.workers = this.$els.Fractal.settings.find('input[name="workers"]'); this.$els.paleta = { divs: { select: $("#paletaSelect"), selected: $("#paletaSelected"), current: $("a#paleta") }, forms: { select: $('select#palletSelect'), input: $('input#paletteInput') }, slide: { list: $('ul#paletaShow'), button: $('a#paletaSlide') } }; this.$els.paleta.forms.selectLoad = this.$els.paleta.divs.select.find('button'); this.$els.Fractal.suave = this.$els.Fractal.settings.find('input#softTransition'); this.$els.Fractal.renderButton = this.$els.Fractal.settings.find('button[name="render"]'); this.$els.Fractal.renderButton.removeAttr("disabled"); this.setEventos(); }, setEventos: function(){ this.$els.Fractal.fileName.click(function(e){ Fractal.clear(); UI.fileSelect(false); }); this.$els.paleta.divs.current.click(function(e){ Fractal.paleta.clear(); UI.paletaSelect(false); }); this.$els.paleta.forms.selectLoad.click(function(e){ Fractal.paleta.ajaxFetch( UI.$els.paleta.forms.select.val() ); }); this.$els.Fractal.renderButton.click(function(e){ Fractal.render(); }); this.$els.Fractal.suave.on('change',function(e){ Fractal.paleta.suavizado = e.currentTarget.checked; }); Fractal.paleta.suavizado = this.$els.Fractal.suave[0].checked; this.$els.paleta.slide.button.click(UI.paletaSlide); this.$els.Fractal.modo.on('click','label',function(e){ var $this = $(this), selected = $this.children('input').val(); UI.$els.Fractal.modo.find('label.active').removeClass('active'); $this.addClass("active"); if ( selected == "zoom" ) Fractal.mode = 0; else Fractal.mode = 1; }); this.$els.Fractal.settings.find('span#resetDim').click(function(){ Fractal.resetDimentions(); }); this.$els.Fractal.selectType.on('change',UI.typeChange); this.$els.paleta.forms.input.on('change',Fractal.paleta.loadFile); // Dispararse en la primera dibujada $(engine.MyCanvas.el).on('mousedown',UI.mouse.down); $(engine.MyCanvas.el).on('mouseup',UI.mouse.up); $(engine.MyCanvas.el).on('mousemove',UI.mouse.move); }, typeChange: function(e){ var v = $(e.target).val(); if ( v != "" ) { UI.fileSelect(true); UI.$els.Fractal.fileName.children('small').html(e.target.selectedOptions[0].innerHTML); Fractal.tipo = v; Fractal.iniciate(); } }, fileSelect: function(activate){ if ( ( activate == undefined ) || activate ){ this.$els.Fractal.fileName.show(); this.$els.Fractal.selectType.hide(); } else { this.$els.Fractal.selectType.show().val("Elige Fractal"); this.$els.Fractal.fileName.hide(); } }, mouse: { pressed: false, startPos:{x:0,y:0}, endPos:{x:0,y:0}, getCoords: function(e){ var rect = engine.MyCanvas.el.getBoundingClientRect(); return { x: e.clientX - rect.left, y: e.clientY - rect.top }; }, down: function(e){ if ( UI.mouse.pressed ) return UI.mouse.up(e); if ( e.which != 1 ) return; UI.mouse.pressed = true; UI.mouse.startPos = UI.mouse.getCoords(e); }, up: function(e){ if ( !UI.mouse.pressed || e.which != 1 ) return; UI.mouse.pressed = false; UI.mouse.endPos = UI.mouse.getCoords(e); if ( Fractal.mode == 0 ) { var pos = { x: Math.min(UI.mouse.startPos.x,UI.mouse.endPos.x), y: Math.min(UI.mouse.startPos.y,UI.mouse.endPos.y) }, width = Math.max(UI.mouse.startPos.x,UI.mouse.endPos.x) - pos.x, height = Math.max(UI.mouse.startPos.y,UI.mouse.endPos.y) - pos.y; Fractal.calcularZoom(pos,Math.max(width,height)); } else Fractal.calcularDesplazo(UI.mouse.endPos.x - UI.mouse.startPos.x , UI.mouse.endPos.y - UI.mouse.startPos.y); Fractal.render(); }, move: function(e){ if ( !UI.mouse.pressed ) return; var endPos = UI.mouse.getCoords(e), startPos = UI.mouse.startPos; engine.MyCanvas.renderImg( Fractal.imagen ); var context = engine.MyCanvas.context; context.beginPath(); if ( Fractal.mode == 0 ) { var pos = { x: Math.min(startPos.x,endPos.x), y: Math.min(startPos.y,endPos.y) }, width = Math.max(startPos.x,endPos.x) - pos.x, height = Math.max(startPos.y,endPos.y) - pos.y; context.rect(pos.x,pos.y, width,height); } else { context.moveTo(startPos.x,startPos.y); context.lineTo(endPos.x,endPos.y); } context.lineWidth = 2; context.strokeStyle = 'red'; context.stroke(); } }, paletaSelect: function(activate){ if ( ( activate == undefined ) || activate ){ this.$els.paleta.divs.select.hide(); this.$els.paleta.divs.selected.show(); this.paletaDraw(); } else { this.$els.paleta.divs.selected.hide(); this.$els.paleta.divs.select.show(); } }, setFractalprop: function(){ var $lis = this.$els.Fractal.settings.find('ul#datos li'); $lis.eq(0).find('span').html(Fractal.properties.width+"x"+Fractal.properties.height); var $time = $lis.eq(1).children('b'); $time.children('span').remove(); var $span = $('<span></span>'); $span.html(Fractal.lastTime + "ms").addClass("animate new"); $time.append( $span ); $span.focus().removeClass("new"); }, setDimensions: function(){ this.$els.Fractal.dims.s_x.html(Fractal.dimensions.x.s); this.$els.Fractal.dims.s_y.html(Fractal.dimensions.y.s); this.$els.Fractal.dims.e_x.html(Fractal.dimensions.x.e); this.$els.Fractal.dims.e_y.html(Fractal.dimensions.y.e); }, getDimensions: function(){ var $dim = this.$els.Fractal.dims; return ret = {x: { s: parseFloat( $dim.s_x.html() ), e: parseFloat( $dim.e_x.html() ) },y:{ s: parseFloat( $dim.s_y.html() ), e: parseFloat( $dim.e_y.html() ) }}; }, getWorkers: function(){ var v = parseInt(this.$els.Fractal.workers.val()); if ( v < 1 || v > 20 ) { v = 1; this.$els.Fractal.workers.val(v); } return v; }, rendering: function(){ UI.$els.Fractal.renderButton.html("... rendering ...").attr("disabled",""); $('body').addClass("cargando"); }, rendered: function(){ UI.$els.Fractal.renderButton.html("Render").removeAttr("disabled"); $('body').removeClass('cargando'); $('#modes').show(); }, paletaSlide: function(){ var lista = UI.$els.paleta.slide.list, boton = UI.$els.paleta.slide.button; if ( boton.hasClass("active") ){ boton.removeClass("active"); boton.html("Mostrar Paleta"); lista.slideUp("slow"); } else { boton.addClass("active"); lista.slideDown("slow"); boton.html("Ocultar Paleta"); } }, paletaDraw: function(){ var $lista = this.$els.paleta.slide.list; $lista.empty(); for (var i = 0; i < Fractal.paleta.json.length; i++) { var row = Fractal.paleta.json[i]; $lista.append( $('<li></li>').html('<span class="color" style="background-color:rgb('+ row[1].r+','+row[1].g+','+row[1].b+');"></span> ' + row[0]) ); }; } }; Fractal.paleta = new engine.Paleta(UI); UI.init(); Fractal.iniciate(); })();<|fim▁end|>
process.render(); console.log("Tiempo: " + Fractal.lastTime);
<|file_name|>atmega328p.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> impl chips::Chip for Chip { fn flash_size() -> usize { 32 * 1024 // 32 KB } fn memory_size() -> usize { 2 * 1024 // 2KB } fn io_ports() -> Vec<io::Port> { vec![ io::Port::new(0x03), // PINB io::Port::new(0x04), // DDRB io::Port::new(0x05), // PORTB io::Port::new(0x06), // PINC io::Port::new(0x07), // DDRC io::Port::new(0x08), // PORTC io::Port::new(0x09), // PIND io::Port::new(0x0a), // DDRD io::Port::new(0x0b), // PORTD ] } }<|fim▁end|>
use chips; use io; pub struct Chip;
<|file_name|>ghost.py<|end_file_name|><|fim▁begin|>################################################### # This is a basic script to carry on a conversation<|fim▁hole|>################################################### # create service ghost = Runtime.start("ghost", "WebGui") ear = Runtime.start("ear", "WebkitSpeechRecognition") ghostchat = Runtime.start("ghostchat", "ProgramAB") htmlfilter = Runtime.start("htmlfilter", "HtmlFilter") mouth = Runtime.start("mouth", "NaturalReaderSpeech") # creating the connections and routes # - I'll need to check on these - might # need to just "attach" some services together ear.addTextListener(ghostchat) ghostchat.addTextListener(htmlfilter) htmlfilter.addTextListener(mouth) # start a chatbot session ghostchat.startSession("ProgramAB/bots", "ghostchat") voices = mouth.getVoices() # I've also tried removing this because I got an iteration error for this line # for voice in voices: # NaturalReaderSpeech.setVoice("Ryan")<|fim▁end|>
# with ghost
<|file_name|>filter-options.ts<|end_file_name|><|fim▁begin|>/** * @module HomeModule */ /** */ /** * Options used by the {@link FilterComponent}. */ export interface FilterOptions { items: FilterItems; searchFields: Array<string>; }<|fim▁hole|> * should be different. * - type sepcifies what kind of input should be show for this filter item. */ export interface FilterItems { [index: number]: { name: string; options: Array<string>; order?: { default: Number; [propName: string]: Number; }; type: string; }; }<|fim▁end|>
/** * A single item used to filter. * - It can contain differernt ordering priorities if needed. For example, if the order for mobile
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup from os import path, environ from sys import argv here = path.abspath(path.dirname(__file__)) try: if argv[1] == "test": environ['PYTHONPATH'] = here except IndexError: pass with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='libfs', version='0.1', description='Library Filesystem', long_description=long_description, author='Christof Hanke', author_email='[email protected]', url='https://github.com/ya-induhvidual/libfs', packages=['Libfs'], license='MIT', install_requires=['llfuse', 'mutagenx'], test_suite="test/test_all.py", scripts=['scripts/libfs.py'], keywords='fuse multimedia', classifiers=[<|fim▁hole|> 'Intended Audience :: End Users/Desktop', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3', 'Operating System :: MacOS :: MacOS X', 'Operating System :: POSIX :: BSD :: FreeBSD', 'Operating System :: POSIX :: Linux', 'Topic :: System :: Filesystems' ], )<|fim▁end|>
'Development Status :: 4 - Beta',
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! Primitive auto completion and type quering on ASTs #![doc(html_root_url = "https://docs.rs/gluon_completion/0.17.2")] // # GLUON extern crate gluon_base as base; use std::{borrow::Cow, cmp::Ordering, iter::once, path::PathBuf, sync::Arc}; use codespan::ByteOffset; use either::Either; use crate::base::{ ast::{ self, walk_expr, walk_pattern, AstType, Expr, Pattern, PatternField, SpannedExpr, SpannedIdent, SpannedPattern, Typed, TypedIdent, Visitor, }, filename_to_module, fnv::{FnvMap, FnvSet}, kind::ArcKind, metadata::Metadata, pos::{self, BytePos, HasSpan, Span, Spanned}, resolve, scoped_map::ScopedMap, symbol::{Name, Symbol, SymbolRef}, types::{ walk_type_, AliasData, ArcType, ControlVisitation, Generic, NullInterner, Type, TypeEnv, TypeExt, }, }; #[derive(Clone, Debug)] pub struct Found<'a, 'ast> { pub match_: Option<Match<'a, 'ast>>, pub near_matches: Vec<Match<'a, 'ast>>, pub enclosing_matches: Vec<Match<'a, 'ast>>, } impl<'a, 'ast> Found<'a, 'ast> { fn enclosing_match(&self) -> &Match<'a, 'ast> { self.enclosing_matches.last().unwrap() } } #[derive(Clone, Debug)] pub enum Match<'a, 'ast> { Expr(&'a SpannedExpr<'ast, Symbol>), Pattern(&'a SpannedPattern<'ast, Symbol>), Ident(Span<BytePos>, &'a Symbol, ArcType), Type(Span<BytePos>, &'a SymbolRef, ArcKind), } impl<'a, 'ast> Match<'a, 'ast> { pub fn span(&self) -> Span<BytePos> { match *self { Match::Expr(expr) => expr.span, Match::Pattern(pattern) => pattern.span, Match::Ident(span, ..) | Match::Type(span, ..) => span, } } } trait OnFound { fn on_ident(&mut self, ident: &TypedIdent) { let _ = ident; } fn on_type_ident(&mut self, ident: &Generic<Symbol>) { let _ = ident; } fn on_pattern(&mut self, pattern: &SpannedPattern<Symbol>) { let _ = pattern; } fn on_alias(&mut self, alias: &AliasData<Symbol, ArcType>) { let _ = alias; } } impl OnFound for () {} impl<'a, T> OnFound for &'a mut T where T: OnFound + 'a, { fn on_ident(&mut self, ident: &TypedIdent) { (**self).on_ident(ident) } fn on_type_ident(&mut self, ident: &Generic<Symbol>) { (**self).on_type_ident(ident) } fn on_pattern(&mut self, pattern: &SpannedPattern<Symbol>) { (**self).on_pattern(pattern) } fn on_alias(&mut self, alias: &AliasData<Symbol, ArcType>) { (**self).on_alias(alias) } } #[derive(Debug, PartialEq)] pub struct Suggestion { pub name: String, pub typ: Either<ArcKind, ArcType>, } struct Suggest<E> { env: E, stack: ScopedMap<Symbol, ArcType>, type_stack: ScopedMap<Symbol, ArcKind>, patterns: ScopedMap<Symbol, ArcType>, } impl<E> Suggest<E> where E: TypeEnv<Type = ArcType>, { fn new(env: E) -> Suggest<E> { Suggest { env, stack: ScopedMap::new(), type_stack: ScopedMap::new(), patterns: ScopedMap::new(), } } } impl<E> OnFound for Suggest<E> where E: TypeEnv<Type = ArcType>, { fn on_ident(&mut self, ident: &TypedIdent) { self.stack.insert(ident.name.clone(), ident.typ.clone()); } fn on_type_ident(&mut self, gen: &Generic<Symbol>) { self.type_stack.insert(gen.id.clone(), gen.kind.clone()); } fn on_pattern(&mut self, pattern: &SpannedPattern<Symbol>) { match &pattern.value { Pattern::As(id, pat) => { self.stack.insert( id.value.clone(), pat.try_type_of(&self.env).unwrap_or_else(|_| Type::hole()), ); self.on_pattern(pat); } Pattern::Ident(id) => { self.stack.insert(id.name.clone(), id.typ.clone()); } Pattern::Record { typ, fields, .. } => { let unaliased = resolve::remove_aliases(&self.env, NullInterner::new(), typ.clone()); for field in &**fields { match field { PatternField::Type { name } => { if let Some(field) = unaliased .type_field_iter() .find(|field| field.name.name_eq(&name.value)) { self.on_alias(&field.typ); } } PatternField::Value { name, value } => match value { Some(ref value) => self.on_pattern(value), None => { let name = name.value.clone(); let typ = unaliased .row_iter() .find(|f| f.name.name_eq(&name)) .map(|f| f.typ.clone()) // If we did not find a matching field in the type, default to a // type hole so that the user at least gets completion on the name .unwrap_or_else(Type::hole); self.stack.insert(name, typ); } }, } } } Pattern::Tuple { elems: args, .. } | Pattern::Constructor(_, args) => { for arg in &**args { self.on_pattern(arg); } } Pattern::Literal(_) | Pattern::Error => (), } } fn on_alias(&mut self, alias: &AliasData<Symbol, ArcType>) { // Insert variant constructors into the local scope let aliased_type = alias.unresolved_type().remove_forall(); if let Type::Variant(ref row) = **aliased_type { for field in row.row_iter().cloned() { self.stack.insert(field.name.clone(), field.typ.clone()); self.patterns.insert(field.name, field.typ); } } self.type_stack.insert( alias.name.clone(), alias .unresolved_type() .kind(&Default::default()) .into_owned(), ); } } #[derive(Debug)] enum MatchState<'a, 'ast> { NotFound, Empty, Found(Match<'a, 'ast>), } struct FindVisitor<'a, 'ast, F> { pos: BytePos, on_found: F, found: MatchState<'a, 'ast>, enclosing_matches: Vec<Match<'a, 'ast>>, near_matches: Vec<Match<'a, 'ast>>, /// The span of the currently inspected expression, used to determine if a position is in that /// expression or outside it (macro expanded) source_span: Span<BytePos>, } impl<'a, 'ast, F> FindVisitor<'a, 'ast, F> { fn select_spanned<I, S, T>(&self, iter: I, mut span: S) -> (bool, Option<T>) where I: IntoIterator<Item = T>, S: FnMut(&T) -> Span<BytePos>, { let mut iter = iter.into_iter().peekable(); let mut prev = None; loop { match iter.peek() { Some(expr) => { match span(expr).containment(self.pos) { Ordering::Equal => { break; } Ordering::Less if prev.is_some() => { // Select the previous expression return (true, prev); } _ => (), } } None => return (true, prev), } prev = iter.next(); } (false, iter.next()) } fn is_macro_expanded(&self, span: Span<BytePos>) -> bool { span.start().0 == 0 || !self.source_span.contains(span) } } struct VisitUnExpanded<'a: 'e, 'e, 'ast, F: 'e>(&'e mut FindVisitor<'a, 'ast, F>); impl<'a, 'e, 'ast, F> Visitor<'a, 'ast> for VisitUnExpanded<'a, 'e, 'ast, F> where F: OnFound, { type Ident = Symbol; fn visit_expr(&mut self, e: &'a SpannedExpr<'ast, Self::Ident>) { if let MatchState::NotFound = self.0.found { if !self.0.is_macro_expanded(e.span) { self.0.visit_expr(e); } else { match e.value { Expr::TypeBindings(ref type_bindings, ref e) => { for type_binding in &**type_bindings { self.0.on_found.on_alias( type_binding .finalized_alias .as_ref() .expect("ICE: Expected alias to be set"), ); } self.0.visit_expr(e); } Expr::LetBindings(ref bindings, ref e) => { for binding in bindings { self.0.on_found.on_pattern(&binding.name); } self.0.visit_expr(e); } _ => walk_expr(self, e), } } } } fn visit_pattern(&mut self, e: &'a SpannedPattern<'ast, Self::Ident>) { if !self.0.is_macro_expanded(e.span) { self.0.visit_pattern(e); } else { // Add variables into scope self.0.on_found.on_pattern(e); walk_pattern(self, &e.value); } } } enum Variant<'a, 'ast> { Pattern(&'a SpannedPattern<'ast, Symbol>), Ident(&'a SpannedIdent<Symbol>), FieldIdent(&'a Spanned<Symbol, BytePos>, &'a ArcType), Type(&'a AstType<'ast, Symbol>), Expr(&'a SpannedExpr<'ast, Symbol>), } impl<'a, 'ast, F> FindVisitor<'a, 'ast, F> where F: OnFound, { fn visit_one<I>(&mut self, iter: I) where I: IntoIterator<Item = &'a SpannedExpr<'ast, Symbol>>, { let (_, expr) = self.select_spanned(iter, |e| e.span); self.visit_expr(expr.unwrap()); } fn visit_any<I>(&mut self, iter: I) where I: IntoIterator<Item = Variant<'a, 'ast>>, { let (_, sel) = self.select_spanned(iter, |x| match *x { Variant::Pattern(p) => p.span, Variant::Ident(e) => e.span, Variant::FieldIdent(e, _) => e.span, Variant::Type(t) => t.span(), Variant::Expr(e) => e.span, }); match sel { Some(sel) => match sel { Variant::Pattern(pattern) => self.visit_pattern(pattern), Variant::Ident(ident) => { if ident.span.containment(self.pos) == Ordering::Equal { self.found = MatchState::Found(Match::Ident( ident.span, &ident.value.name, ident.value.typ.clone(), )); } else { self.found = MatchState::Empty; } } Variant::FieldIdent(ident, record_type) => { if ident.span.containment(self.pos) == Ordering::Equal { let record_type = resolve::remove_aliases( &crate::base::ast::EmptyEnv::default(), NullInterner::new(), record_type.clone(), ); let either = record_type .row_iter() .find(|field| field.name.name_eq(&ident.value)) .map(|field| Either::Left(field.typ.clone())) .or_else(|| { record_type .type_field_iter() .find(|field| field.name.name_eq(&ident.value)) .map(|field| { Either::Right( field.typ.kind(&Default::default()).into_owned(), ) }) }) .unwrap_or_else(|| Either::Left(Type::hole())); self.found = MatchState::Found(match either { Either::Left(typ) => Match::Ident(ident.span, &ident.value, typ), Either::Right(kind) => Match::Type(ident.span, &ident.value, kind), }); } else { self.found = MatchState::Empty; } } Variant::Type(t) => self.visit_ast_type(t), Variant::Expr(expr) => self.visit_expr(expr), }, None => self.found = MatchState::Empty, } } fn visit_pattern(&mut self, current: &'a SpannedPattern<'ast, Symbol>) { if current.span.containment(self.pos) == Ordering::Equal { self.enclosing_matches.push(Match::Pattern(current)); } else { self.near_matches.push(Match::Pattern(current)); } match current.value { Pattern::As(_, ref pat) => self.visit_pattern(pat), Pattern::Constructor(ref id, ref args) => { let id_span = Span::new( current.span.start(), current.span.start() + ByteOffset::from(id.as_ref().len() as i64), ); if id_span.containment(self.pos) == Ordering::Equal { self.found = MatchState::Found(Match::Pattern(current)); return; } let (_, pattern) = self.select_spanned(&**args, |e| e.span); match pattern { Some(pattern) => self.visit_pattern(pattern), None => self.found = MatchState::Empty, } } Pattern::Record { ref typ, ref fields, .. } => { let (on_whitespace, selected) = self.select_spanned(&**fields, |field| match field { PatternField::Type { name } => name.span, PatternField::Value { name, value } => Span::new( name.span.start(), value.as_ref().map_or(name.span.end(), |p| p.span.end()), ), }); if on_whitespace { self.found = MatchState::Empty; } else if let Some(either) = selected { match either { PatternField::Type { name } => { if name.span.containment(self.pos) == Ordering::Equal { let field_type = typ .type_field_iter() .find(|it| it.name.name_eq(&name.value)) .map(|it| it.typ.as_type()) .unwrap_or(typ); self.found = MatchState::Found(Match::Ident( name.span, &name.value, field_type.clone(), )); } else { self.found = MatchState::Empty; } } PatternField::Value { name, value } => { match (name.span.containment(self.pos), &value) { (Ordering::Equal, _) => { let field_type = typ .row_iter() .find(|it| it.name.name_eq(&name.value)) .map(|it| &it.typ) .unwrap_or(typ); self.found = MatchState::Found(Match::Ident( name.span, &name.value, field_type.clone(), )); } (Ordering::Greater, &Some(ref pattern)) => { self.visit_pattern(pattern) } _ => self.found = MatchState::Empty, } } } } else { self.found = MatchState::Empty; } } Pattern::Tuple { ref elems, .. } => { let (_, field) = self.select_spanned(&**elems, |elem| elem.span); self.visit_pattern(field.unwrap()); } Pattern::Ident(_) | Pattern::Literal(_) | Pattern::Error => { self.found = if current.span.containment(self.pos) == Ordering::Equal { MatchState::Found(Match::Pattern(current)) } else { MatchState::Empty }; } } } fn visit_expr(&mut self, current: &'a SpannedExpr<'ast, Symbol>) { // When inside a macro expanded expression we do a exhaustive search for an unexpanded // expression if self.is_macro_expanded(current.span) { VisitUnExpanded(self).visit_expr(current); return; } if current.span.containment(self.pos) == Ordering::Equal { self.enclosing_matches.push(Match::Expr(current)); } else { self.near_matches.push(Match::Expr(current)); } match current.value { Expr::Ident(_) | Expr::Literal(_) => { self.found = if current.span.containment(self.pos) == Ordering::Equal { MatchState::Found(Match::Expr(current)) } else { MatchState::Empty }; } Expr::App { ref func, ref args, .. } => { self.visit_one(once(&**func).chain(&**args)); } Expr::IfElse(ref pred, ref if_true, ref if_false) => { self.visit_one([pred, if_true, if_false].iter().map(|x| &***x)) } Expr::Match(ref expr, ref alts) => { let iter = once(Ok(&**expr)).chain(alts.iter().map(Err)); let (_, sel) = self.select_spanned(iter, |x| match *x { Ok(e) => e.span, Err(alt) => Span::new(alt.pattern.span.start(), alt.expr.span.end()), }); match sel.unwrap() { Ok(expr) => { self.enclosing_matches.push(Match::Expr(expr)); self.visit_expr(expr) } Err(alt) => { self.on_found.on_pattern(&alt.pattern); let iter = [Ok(&alt.pattern), Err(&alt.expr)]; let (_, sel) = self.select_spanned(iter.iter().cloned(), |x| match *x { Ok(p) => p.span, Err(e) => e.span, }); match sel.unwrap() { Ok(pattern) => self.visit_pattern(pattern), Err(expr) => self.visit_expr(expr), } } } } Expr::Infix { ref lhs, ref op, ref rhs, .. } => match ( lhs.span.containment(self.pos), rhs.span.containment(self.pos), ) { (Ordering::Greater, Ordering::Less) => { self.found = MatchState::Found(Match::Ident( op.span, &op.value.name, op.value.typ.clone(), )); } (_, Ordering::Greater) | (_, Ordering::Equal) => self.visit_expr(rhs), _ => self.visit_expr(lhs), }, Expr::LetBindings(ref bindings, ref expr) => { if bindings.is_recursive() { for bind in bindings { self.on_found.on_pattern(&bind.name); } } match self.select_spanned(bindings, |b| { Span::new(b.name.span.start(), b.expr.span.end()) }) { (false, Some(bind)) => { for arg in &*bind.args { self.on_found.on_ident(&arg.name.value); } let iter = once(Variant::Pattern(&bind.name)) .chain(bind.args.iter().map(|arg| Variant::Ident(&arg.name))) .chain(bind.typ.iter().map(Variant::Type)) .chain(once(Variant::Expr(&bind.expr))); self.visit_any(iter) } _ => { if !bindings.is_recursive() { for bind in bindings { self.on_found.on_pattern(&bind.name); } } self.visit_expr(expr) } } } Expr::TypeBindings(ref type_bindings, ref expr) => { for type_binding in &**type_bindings { self.on_found.on_alias( type_binding .finalized_alias .as_ref() .expect("ICE: Expected alias to be set"), ); } let iter = type_bindings .iter() .map(Either::Left) .chain(Some(Either::Right(expr))); match self.select_spanned(iter, |x| x.either(|b| b.span(), |e| e.span)) { (_, Some(either)) => match either { Either::Left(bind) => { if bind.name.span.containment(self.pos) == Ordering::Equal { self.found = MatchState::Found(Match::Type( bind.name.span, &bind.alias.value.name, bind.alias.value.kind(&Default::default()).into_owned(), )); } else { for param in bind.alias.value.params() { self.on_found.on_type_ident(param); } self.visit_ast_type(bind.alias.value.aliased_type()) } } Either::Right(expr) => self.visit_expr(expr), }, _ => unreachable!(), } } Expr::Projection(ref expr, ref id, ref typ) => { if expr.span.containment(self.pos) <= Ordering::Equal { self.visit_expr(expr); } else { self.enclosing_matches.push(Match::Expr(current)); self.found = MatchState::Found(Match::Ident(current.span, id, typ.clone())); } } Expr::Array(ref array) => self.visit_one(&*array.exprs), Expr::Record { ref base, typ: ref record_type, .. } => { let iter = current .value .field_iter() .flat_map(|either| { either .map_left(|field| once(Variant::FieldIdent(&field.name, record_type))) .map_right(|field| { once(Variant::FieldIdent(&field.name, record_type)) .chain(field.value.as_ref().map(Variant::Expr)) }) }) .chain(base.as_ref().map(|base| Variant::Expr(base))); self.visit_any(iter) } Expr::Lambda(ref lambda) => { for arg in &*lambda.args { self.on_found.on_ident(&arg.name.value); } let selection = self.select_spanned(&*lambda.args, |arg| arg.name.span); match selection { (false, Some(arg)) => { self.found = MatchState::Found(Match::Ident( arg.name.span, &arg.name.value.name, arg.name.value.typ.clone(), )); } _ => self.visit_expr(&lambda.body), } } Expr::Tuple { elems: ref exprs, .. } | Expr::Block(ref exprs) => { if exprs.is_empty() { self.found = MatchState::Found(Match::Expr(current)); } else { self.visit_one(&**exprs) } } Expr::Do(ref do_expr) => { let iter = do_expr .id .as_ref() .map(Either::Left) .into_iter() .chain(once(Either::Right(&do_expr.bound))) .chain(once(Either::Right(&do_expr.body))); match self.select_spanned(iter, |x| x.either(|i| i.span, |e| e.span)) { (_, Some(either)) => match either { Either::Left(ident) => self.visit_pattern(ident), Either::Right(expr) => self.visit_expr(expr), }, _ => unreachable!(), } } Expr::MacroExpansion { ref replacement, .. } => self.visit_expr(replacement), Expr::Annotated(..) => unimplemented!(), // FIXME Expr::Error(..) => (), } } fn visit_ast_type(&mut self, typ: &'a AstType<'ast, Symbol>) { match **typ { // ExtendRow do not have spans set properly so recurse unconditionally Type::ExtendRow { .. } | Type::ExtendTypeRow { .. } => (), _ if typ.span().containment(self.pos) != Ordering::Equal => return, _ => (), } match **typ { Type::Ident(ref id) => { self.found = MatchState::Found(Match::Type(typ.span(), &id.name, id.typ.clone())); } Type::Builtin(ref builtin) => { self.found = MatchState::Found(Match::Type( typ.span(), builtin.symbol(), typ.kind(&Default::default()).into_owned(), )); } Type::Generic(ref gen) => { self.found = MatchState::Found(Match::Type(typ.span(), &gen.id, gen.kind.clone())); } Type::Alias(ref alias) => { self.found = MatchState::Found(Match::Type( typ.span(), &alias.name, typ.kind(&Default::default()).into_owned(), )); } Type::Forall(ref params, ref typ) => { for param in &**params { self.on_found.on_type_ident(param); } self.visit_ast_type(typ); } _ => walk_type_( typ, &mut ControlVisitation(|typ: &'a AstType<'ast, Symbol>| self.visit_ast_type(typ)), ), } } } fn complete_at<'a, 'ast, F>( on_found: F, source_span: Span<BytePos>, expr: &'a SpannedExpr<'ast, Symbol>, pos: BytePos, ) -> Result<Found<'a, 'ast>, ()> where F: OnFound, { let mut visitor = FindVisitor { pos: pos, on_found: on_found, found: MatchState::NotFound, enclosing_matches: vec![Match::Expr(expr)], near_matches: vec![], source_span, }; visitor.visit_expr(expr); let enclosing_matches = visitor.enclosing_matches; let near_matches = visitor.near_matches; match visitor.found { MatchState::Found(match_) => Ok(Found { match_: Some(match_), enclosing_matches, near_matches, }), MatchState::Empty => Ok(Found { match_: None, enclosing_matches, near_matches, }), MatchState::NotFound => Err(()), } }<|fim▁hole|> fn extract(self, found: &Found<'a, '_>) -> Result<Self::Output, ()>; fn match_extract(self, match_: &Match<'a, '_>) -> Result<Self::Output, ()>; } #[derive(Clone, Copy)] pub struct TypeAt<'a> { pub env: &'a dyn TypeEnv<Type = ArcType>, } impl<'a> Extract<'a> for TypeAt<'a> { type Output = Either<ArcKind, ArcType>; fn extract(self, found: &Found<'a, '_>) -> Result<Self::Output, ()> { match found.match_ { Some(ref match_) => self.match_extract(match_), None => self.match_extract(found.enclosing_match()), } } fn match_extract(self, found: &Match) -> Result<Self::Output, ()> { Ok(match *found { Match::Expr(expr) => expr .try_type_of(self.env) .map(Either::Right) .map_err(|_| ())?, Match::Ident(_, _, ref typ) => Either::Right(typ.clone()), Match::Type(_, _, ref kind) => Either::Left(kind.clone()), Match::Pattern(pattern) => pattern .try_type_of(self.env) .map(Either::Right) .map_err(|_| ())?, }) } } #[derive(Clone, Copy)] pub struct IdentAt; impl<'a> Extract<'a> for IdentAt { type Output = &'a SymbolRef; fn extract(self, found: &Found<'a, '_>) -> Result<Self::Output, ()> { match found.match_ { Some(ref match_) => self.match_extract(match_), None => self.match_extract(found.enclosing_match()), } } fn match_extract(self, found: &Match<'a, '_>) -> Result<Self::Output, ()> { Ok(match found { Match::Expr(Spanned { value: Expr::Ident(id), .. }) | Match::Pattern(Spanned { value: Pattern::Ident(id), .. }) => &id.name, Match::Ident(_, id, _) => id, Match::Pattern(Spanned { value: Pattern::As(id, _), .. }) => &id.value, Match::Type(_, id, _) => id, _ => return Err(()), }) } } #[derive(Copy, Clone)] pub struct SpanAt; impl<'a> Extract<'a> for SpanAt { type Output = Span<BytePos>; fn extract(self, found: &Found) -> Result<Self::Output, ()> { match found.match_ { Some(ref match_) => self.match_extract(match_), None => self.match_extract(found.enclosing_match()), } } fn match_extract(self, found: &Match) -> Result<Self::Output, ()> { Ok(found.span()) } } macro_rules! tuple_extract { ($first: ident) => { }; ($first: ident $($id: ident)+) => { tuple_extract_!{$first $($id)+} tuple_extract!{$($id)+} }; } macro_rules! tuple_extract_ { ($($id: ident)*) => { #[allow(non_snake_case)] impl<'a, $($id : Extract<'a>),*> Extract<'a> for ( $($id),* ) { type Output = ( $($id::Output),* ); fn extract(self, found: &Found<'a, '_>) -> Result<Self::Output, ()> { let ( $($id),* ) = self; Ok(( $( $id.extract(found)? ),* )) } fn match_extract(self, found: &Match<'a, '_>) -> Result<Self::Output, ()> { let ( $($id),* ) = self; Ok(( $( $id.match_extract(found)? ),* )) } } }; } tuple_extract! {A B C D E F G H} pub fn completion<'a, 'ast, T>( extract: T, source_span: Span<BytePos>, expr: &'a SpannedExpr<'ast, Symbol>, pos: BytePos, ) -> Result<T::Output, ()> where T: Extract<'a>, { let found = complete_at((), source_span, expr, pos)?; extract.extract(&found) } pub fn find<'ast, T>( env: &T, source_span: Span<BytePos>, expr: &SpannedExpr<'ast, Symbol>, pos: BytePos, ) -> Result<Either<ArcKind, ArcType>, ()> where T: TypeEnv<Type = ArcType>, { let extract = TypeAt { env }; completion(extract, source_span, expr, pos) } pub fn find_all_symbols<'ast>( source_span: Span<BytePos>, expr: &SpannedExpr<'ast, Symbol>, pos: BytePos, ) -> Result<(String, Vec<Span<BytePos>>), ()> { let extract = IdentAt; completion(extract, source_span, expr, pos).map(|symbol| { struct ExtractIdents<'b> { result: Vec<Span<BytePos>>, symbol: &'b SymbolRef, } impl<'a, 'b> Visitor<'a, '_> for ExtractIdents<'b> { type Ident = Symbol; fn visit_expr(&mut self, e: &'a SpannedExpr<Self::Ident>) { match e.value { Expr::Ident(ref id) if id.name == *self.symbol => { self.result.push(e.span); } _ => walk_expr(self, e), } } fn visit_pattern(&mut self, p: &'a SpannedPattern<Self::Ident>) { match p.value { Pattern::As(ref id, ref pat) if id.value == *self.symbol => { self.result.push(p.span); walk_pattern(self, &pat.value); } Pattern::Ident(ref id) if id.name == *self.symbol => { self.result.push(p.span); } _ => walk_pattern(self, &p.value), } } } let mut visitor = ExtractIdents { result: Vec::new(), symbol, }; visitor.visit_expr(expr); (visitor.symbol.declared_name().to_string(), visitor.result) }) } pub fn symbol<'a, 'ast>( source_span: Span<BytePos>, expr: &'a SpannedExpr<'ast, Symbol>, pos: BytePos, ) -> Result<&'a SymbolRef, ()> { let extract = IdentAt; completion(extract, source_span, expr, pos) } pub type SpCompletionSymbol<'a, 'ast> = Spanned<CompletionSymbol<'a, 'ast>, BytePos>; #[derive(Debug, PartialEq)] pub struct CompletionSymbol<'a, 'ast> { pub name: &'a Symbol, pub content: CompletionSymbolContent<'a, 'ast>, pub children: Vec<SpCompletionSymbol<'a, 'ast>>, } #[derive(Debug, PartialEq)] pub enum CompletionValueKind { Parameter, Binding, } #[derive(Debug, PartialEq)] pub enum CompletionSymbolContent<'a, 'ast> { Value { typ: &'a ArcType, kind: CompletionValueKind, expr: Option<&'a SpannedExpr<'ast, Symbol>>, }, Type { typ: &'a AstType<'ast, Symbol>, }, } pub fn all_symbols<'a, 'ast>( source_span: Span<BytePos>, expr: &'a SpannedExpr<'ast, Symbol>, ) -> Vec<SpCompletionSymbol<'a, 'ast>> { struct AllIdents<'r, 'a, 'ast> { source_span: Span<BytePos>, result: &'r mut Vec<Spanned<CompletionSymbol<'a, 'ast>, BytePos>>, } impl<'a, 'ast> Visitor<'a, 'ast> for AllIdents<'_, 'a, 'ast> { type Ident = Symbol; fn visit_ast_type(&mut self, typ: &'a ast::AstType<'ast, Self::Ident>) { match &**typ { Type::Record(_) | Type::Variant(_) | Type::Effect(_) => { for field in base::types::row_iter(typ) { let mut children = Vec::new(); idents_of(self.source_span, &field.typ, &mut children); self.result.push(pos::spanned( field.name.span, CompletionSymbol { name: &field.name.value, content: CompletionSymbolContent::Type { typ: &field.typ }, children, }, )); } } _ => ast::walk_ast_type(self, typ), } } fn visit_expr(&mut self, e: &'a SpannedExpr<'ast, Self::Ident>) { if self.source_span.contains(e.span) { let source_span = self.source_span; match &e.value { Expr::TypeBindings(binds, expr) => { self.result.extend(binds.iter().map(|bind| { let mut children = Vec::new(); idents_of(source_span, &bind.alias, &mut children); pos::spanned( bind.name.span, CompletionSymbol { name: bind .finalized_alias .as_ref() .map(|alias| &alias.name) .unwrap_or(&bind.name.value), content: CompletionSymbolContent::Type { typ: &bind.alias.unresolved_type(), }, children, }, ) })); self.visit_expr(expr); } Expr::LetBindings(binds, expr) => { for bind in binds { let mut children = Vec::new(); children.extend(bind.args.iter().map(|arg| { pos::spanned( arg.name.span, CompletionSymbol { name: &arg.name.value.name, content: CompletionSymbolContent::Value { typ: &arg.name.value.typ, kind: CompletionValueKind::Parameter, expr: None, }, children: Vec::new(), }, ) })); idents_of(source_span, &bind.expr, &mut children); match &bind.name.value { Pattern::Ident(id) => { self.result.push(pos::spanned( bind.name.span, CompletionSymbol { name: &id.name, content: CompletionSymbolContent::Value { typ: &id.typ, kind: CompletionValueKind::Binding, expr: Some(&bind.expr), }, children, }, )); } _ => self.result.extend(children), } } self.visit_expr(expr); } _ => walk_expr(self, e), } } else { walk_expr(self, e); } } } trait Visit<'a, 'ast> { type Ident: 'a + 'ast; fn visit(&'a self, visitor: &mut impl Visitor<'a, 'ast, Ident = Self::Ident>); } impl<'a, 'ast, I> Visit<'a, 'ast> for SpannedExpr<'ast, I> where I: 'a + 'ast, { type Ident = I; fn visit(&'a self, visitor: &mut impl Visitor<'a, 'ast, Ident = Self::Ident>) { visitor.visit_expr(self) } } impl<'a, 'ast, I> Visit<'a, 'ast> for ArcType<I> where I: 'a + 'ast, { type Ident = I; fn visit(&'a self, visitor: &mut impl Visitor<'a, 'ast, Ident = Self::Ident>) { visitor.visit_typ(self) } } impl<'a, 'ast, I> Visit<'a, 'ast> for ast::AstType<'ast, I> where I: 'a + 'ast, { type Ident = I; fn visit(&'a self, visitor: &mut impl Visitor<'a, 'ast, Ident = Self::Ident>) { visitor.visit_ast_type(self) } } impl<'a, 'ast, I> Visit<'a, 'ast> for ast::SpannedAlias<'ast, I> where I: 'a + 'ast, { type Ident = I; fn visit(&'a self, visitor: &mut impl Visitor<'a, 'ast, Ident = Self::Ident>) { visitor.visit_alias(self) } } fn idents_of<'a, 'ast>( source_span: Span<BytePos>, v: &'a impl Visit<'a, 'ast, Ident = Symbol>, result: &mut Vec<Spanned<CompletionSymbol<'a, 'ast>, BytePos>>, ) { let mut visitor = AllIdents { source_span, result, }; v.visit(&mut visitor) } let mut result = Vec::new(); idents_of(source_span, expr, &mut result); result } pub fn suggest<'ast, T>( env: &T, source_span: Span<BytePos>, expr: &SpannedExpr<'ast, Symbol>, pos: BytePos, ) -> Vec<Suggestion> where T: TypeEnv<Type = ArcType>, { SuggestionQuery::default().suggest(env, source_span, expr, pos) } pub struct SuggestionQuery { pub paths: Vec<PathBuf>, pub modules: Vec<Cow<'static, str>>, pub prefix_filter: bool, pub span: Option<Span<BytePos>>, } impl Default for SuggestionQuery { fn default() -> Self { SuggestionQuery { paths: Vec::new(), modules: Vec::new(), prefix_filter: true, span: None, } } } impl SuggestionQuery { pub fn new() -> Self { Self::default() } fn filter(&self, name: &str, prefix: &str) -> bool { !self.prefix_filter || name.starts_with(prefix) } fn suggest_fields_of_type( &self, result: &mut Vec<Suggestion>, fields: &[PatternField<'_, Symbol>], prefix: &str, typ: &ArcType, ) { let existing_fields: FnvSet<&str> = ast::pattern_names(fields) .map(|name| name.value.as_ref()) .collect(); let should_suggest = |name: &str| { // Filter out fields that has already been defined in the pattern (!existing_fields.contains(name) && self.filter(name, prefix)) // But keep exact matches to keep that suggestion when the user has typed a whole // field || name == prefix }; let fields = typ .row_iter() .filter(|field| should_suggest(field.name.declared_name())) .map(|field| Suggestion { name: field.name.declared_name().into(), typ: Either::Right(field.typ.clone()), }); let types = typ .type_field_iter() .filter(|field| should_suggest(field.name.declared_name())) .map(|field| Suggestion { name: field.name.declared_name().into(), typ: Either::Right(field.typ.clone().into_type()), }); result.extend(fields.chain(types)); } fn expr_iter<'e, 'ast>( &'e self, stack: &'e ScopedMap<Symbol, ArcType>, expr: &'e SpannedExpr<'ast, Symbol>, ) -> impl Iterator<Item = (&'e Symbol, &'e ArcType)> { if let Expr::Ident(ref ident) = expr.value { Either::Left( stack.iter().filter(move |&(k, _)| { self.filter(k.declared_name(), ident.name.declared_name()) }), ) } else { Either::Right(None.into_iter()) } } pub fn suggest<'ast, T>( &self, env: &T, source_span: Span<BytePos>, expr: &SpannedExpr<'ast, Symbol>, pos: BytePos, ) -> Vec<Suggestion> where T: TypeEnv<Type = ArcType>, { let mut suggest = Suggest::new(env); let found = match complete_at(&mut suggest, source_span, expr, pos) { Ok(x) => x, Err(()) => return vec![], }; let mut result = vec![]; let enclosing_match = found.enclosing_matches.last().unwrap(); match found.match_ { Some(match_) => match match_ { Match::Expr(expr) => match expr.value { Expr::Ident(ref id) if id.name.is_global() => { let name = id.name.definition_name(); self.suggest_module_import(env, name, &mut result); } Expr::Ident(ref id) => { self.suggest_local( &mut result, &suggest, &enclosing_match, id.name.declared_name(), ); } _ => self.suggest_local(&mut result, &suggest, &enclosing_match, ""), }, Match::Pattern(pattern) => { let prefix = match pattern.value { Pattern::Constructor(ref id, _) | Pattern::Ident(ref id) => id.as_ref(), Pattern::Record { ref fields, .. } => { if let Ok(typ) = expr.try_type_of(&env) { let typ = resolve::remove_aliases(env, NullInterner::new(), typ); self.suggest_fields_of_type(&mut result, fields, "", &typ); } "" } _ => "", }; result.extend( suggest .patterns .iter() .filter(|&(name, _)| self.filter(name.declared_name(), prefix)) .map(|(name, typ)| Suggestion { name: name.declared_name().into(), typ: Either::Right(typ.clone()), }), ); } Match::Ident(_, ident, _) => match *enclosing_match { Match::Expr(context) => match context.value { Expr::Projection(ref expr, _, _) => { if let Ok(typ) = expr.try_type_of(&env) { let typ = resolve::remove_aliases(&env, NullInterner::new(), typ); let id = ident.as_ref(); let iter = typ .row_iter() .filter(move |field| self.filter(field.name.as_ref(), id)) .map(|field| (field.name.clone(), field.typ.clone())); result.extend(iter.map(|(name, typ)| Suggestion { name: name.declared_name().into(), typ: Either::Right(typ), })); } } Expr::Ident(ref id) if id.name.is_global() => { self.suggest_module_import(env, id.name.as_pretty_str(), &mut result); } _ => { self.suggest_local( &mut result, &suggest, enclosing_match, ident.declared_name(), ); if let Expr::Record { .. } = context.value { self.suggest_local_type( &mut result, &suggest, enclosing_match, ident.declared_name(), ); } } }, Match::Pattern(&Spanned { value: Pattern::Record { ref typ, ref fields, .. }, .. }) => { let typ = resolve::remove_aliases_cow(env, NullInterner::new(), typ); self.suggest_fields_of_type( &mut result, fields, ident.declared_name(), &typ, ); } _ => (), }, Match::Type(_, ident, _) => self.suggest_local_type( &mut result, &suggest, enclosing_match, ident.declared_name(), ), }, None => match *enclosing_match { Match::Expr(..) | Match::Ident(..) => { self.suggest_local(&mut result, &suggest, &enclosing_match, ""); if let Match::Expr(Spanned { value: Expr::Record { .. }, .. }) = *enclosing_match { self.suggest_local_type(&mut result, &suggest, enclosing_match, ""); } } Match::Type(_, ident, _) => self.suggest_local_type( &mut result, &suggest, enclosing_match, ident.declared_name(), ), Match::Pattern(pattern) => match pattern.value { Pattern::Record { ref fields, .. } => { if let Ok(typ) = pattern.try_type_of(env) { let typ = resolve::remove_aliases(env, NullInterner::new(), typ); self.suggest_fields_of_type(&mut result, fields, "", &typ); } } _ => result.extend(suggest.patterns.iter().map(|(name, typ)| Suggestion { name: name.declared_name().into(), typ: Either::Right(typ.clone()), })), }, }, } result } fn suggest_local<T>( &self, result: &mut Vec<Suggestion>, suggest: &Suggest<T>, context: &Match, ident: &str, ) where T: TypeEnv<Type = ArcType>, { result.extend( suggest .stack .iter() .filter(move |&(k, _)| self.filter(k.declared_name(), ident)) .filter(|&(k, _)| match context { // If inside a record expression, remove any fields that have already been used Match::Expr(&Spanned { value: Expr::Record { ref types, ref exprs, .. }, .. }) => exprs .iter() .map(|field| &field.name) .chain(types.iter().map(|field| &field.name)) .all(|already_used_field| already_used_field.value != *k), _ => true, }) .map(|(k, typ)| Suggestion { name: k.declared_name().into(), typ: Either::Right(typ.clone()), }), ) } fn suggest_local_type<T>( &self, result: &mut Vec<Suggestion>, suggest: &Suggest<T>, context: &Match, ident: &str, ) where T: TypeEnv<Type = ArcType>, { result.extend( suggest .type_stack .iter() .filter(|&(k, _)| self.filter(k.declared_name(), ident)) .filter(|&(k, _)| match context { // If inside a record expression, remove any fields that have already been used Match::Expr(&Spanned { value: Expr::Record { ref types, ref exprs, .. }, .. }) => exprs .iter() .map(|field| &field.name) .chain(types.iter().map(|field| &field.name)) .all(|already_used_field| already_used_field.value != *k), _ => true, }) .map(|(name, kind)| Suggestion { name: name.declared_name().into(), typ: Either::Left(kind.clone()), }), ); } fn suggest_module_import<T>(&self, env: &T, path: &str, suggestions: &mut Vec<Suggestion>) where T: TypeEnv<Type = ArcType>, { use std::ffi::OsStr; let path = Name::new(path); let base = PathBuf::from(path.module().as_str().replace(".", "/")); let modules = self .paths .iter() .flat_map(|root| { let walk_root = root.join(&*base); walkdir::WalkDir::new(walk_root) .into_iter() .filter_map(|entry| entry.ok()) .filter_map(move |entry| { if entry.file_type().is_file() && entry.path().extension() == Some(OsStr::new("glu")) { let unprefixed_file = entry .path() .strip_prefix(&*root) .expect("Root is not a prefix of path from walk_dir"); unprefixed_file.to_str().map(filename_to_module) } else { None } }) }) .collect::<Vec<String>>(); suggestions.extend( modules .iter() .map(|s| &s[..]) .chain(self.modules.iter().map(|s| &s[..])) .filter(|module| self.filter(module, path.as_str())) .map(|module| { let name = module[path.module().as_str().len()..] .trim_start_matches('.') .split('.') .next() .unwrap() .to_string(); Suggestion { name, typ: Either::Right( env.find_type(SymbolRef::new(module)) .unwrap_or_else(Type::hole), ), } }), ); suggestions.sort_by(|l, r| l.name.cmp(&r.name)); suggestions.dedup_by(|l, r| l.name == r.name); } pub fn suggest_metadata<'a, 'b, 'ast, T>( &self, env: &'a FnvMap<Symbol, Arc<Metadata>>, type_env: &T, source_span: Span<BytePos>, expr: &'b SpannedExpr<'ast, Symbol>, pos: BytePos, name: &str, ) -> Option<&'a Metadata> where T: TypeEnv<Type = ArcType>, { let mut suggest = Suggest::new(type_env); complete_at(&mut suggest, source_span, expr, pos) .ok() .and_then(|found| { let enclosing_match = found.enclosing_matches.last().unwrap(); match found.match_ { Some(match_) => match match_ { Match::Expr(expr) => { let suggestion = self .expr_iter(&suggest.stack, expr) .find(|&(stack_name, _)| stack_name.declared_name() == name); if let Some((name, _)) = suggestion { env.get(name) } else { None } } Match::Ident(_, _, _) => match *enclosing_match { Match::Expr(&Spanned { value: Expr::Projection(ref expr, _, _), .. }) => { if let Expr::Ident(ref expr_ident) = expr.value { env.get(&expr_ident.name) .and_then(|metadata| metadata.module.get(name)) } else { None } } _ => None, }, _ => None, }, None => match *enclosing_match { Match::Expr(..) | Match::Ident(..) => suggest .stack .iter() .find(|&(stack_name, _)| stack_name.declared_name() == name) .and_then(|t| env.get(t.0)), _ => None, }, } }) .map(|m| &**m) } } #[derive(Debug, PartialEq)] pub struct SignatureHelp { pub name: String, pub typ: ArcType, pub index: Option<u32>, } pub fn signature_help<'ast>( env: &dyn TypeEnv<Type = ArcType>, source_span: Span<BytePos>, expr: &SpannedExpr<'ast, Symbol>, pos: BytePos, ) -> Option<SignatureHelp> { complete_at((), source_span, expr, pos) .ok() .and_then(|found| { let applications = found .enclosing_matches .iter() .chain(&found.near_matches) .rev() // Stop searching for an application if it would mean we exit a nested expression // Ie. `test { abc = func }` // ^ // Should not return the signature for `test` but for `func` .take_while(|enclosing_match| match **enclosing_match { Match::Expr(expr) => match expr.value { Expr::Ident(..) | Expr::Literal(..) | Expr::Projection(..) | Expr::App { .. } | Expr::Tuple { .. } => true, Expr::Record { ref exprs, ref base, .. } => exprs.is_empty() && base.is_none(), _ => false, }, _ => false, }) .filter_map(|enclosing_match| match *enclosing_match { Match::Expr(expr) => match expr.value { Expr::App { ref func, ref args, .. } => func.try_type_of(env).ok().map(|typ| { let name = match func.value { Expr::Ident(ref id) => id.name.declared_name().to_string(), Expr::Projection(_, ref name, _) => { name.declared_name().to_string() } _ => "".to_string(), }; let index = if args.first().map_or(false, |arg| pos >= arg.span.start()) { Some( args.iter() .position(|arg| pos <= arg.span.end()) .unwrap_or_else(|| args.len()) as u32, ) } else { None }; SignatureHelp { name, typ, index } }), _ => None, }, _ => None, }); let any_expr = found .enclosing_matches .iter() .chain(&found.near_matches) .rev() .filter_map(|enclosing_match| match *enclosing_match { Match::Expr(expr) => { let name = match expr.value { Expr::Ident(ref id) => id.name.declared_name().to_string(), Expr::Projection(_, ref name, _) => name.declared_name().to_string(), _ => "".to_string(), }; expr.value.try_type_of(env).ok().map(|typ| SignatureHelp { name, typ, index: if pos > expr.span.end() { Some(0) } else { None }, }) } _ => None, }); applications.chain(any_expr).next() }) } pub fn get_metadata<'a, 'ast>( env: &'a FnvMap<Symbol, Arc<Metadata>>, source_span: Span<BytePos>, expr: &'a SpannedExpr<'ast, Symbol>, pos: BytePos, ) -> Option<&'a Metadata> { complete_at((), source_span, expr, pos) .ok() .and_then(|found| { let e = found.enclosing_match().clone(); found.match_.map(|m| (m, e)) }) .and_then(|(match_, enclosing_match)| match match_ { Match::Expr(expr) => { if let Expr::Ident(ref id) = expr.value { env.get(&id.name) } else { None } } Match::Ident(_, id, _typ) => match enclosing_match { Match::Expr(&Spanned { value: Expr::Projection(ref expr, _, _), .. }) => { if let Expr::Ident(ref expr_id) = expr.value { env.get(&expr_id.name) .and_then(|metadata| metadata.module.get(id.as_str())) } else { None } } Match::Expr(&Spanned { value: Expr::Infix { .. }, .. }) => env.get(id), _ => env.get(id), }, _ => None, }) .map(|m| &**m) } pub fn suggest_metadata<'a, 'ast, T>( env: &'a FnvMap<Symbol, Arc<Metadata>>, type_env: &T, source_span: Span<BytePos>, expr: &'a SpannedExpr<'ast, Symbol>, pos: BytePos, name: &'a str, ) -> Option<&'a Metadata> where T: TypeEnv<Type = ArcType>, { SuggestionQuery::new().suggest_metadata(env, type_env, source_span, expr, pos, name) }<|fim▁end|>
pub trait Extract<'a>: Sized { type Output;
<|file_name|>sub.js<|end_file_name|><|fim▁begin|>var assert = require('assert'); var num = require('../'); test('sub', function() { assert.equal(num.sub(0, 0), '0'); assert.equal(num.sub('0', '-0'), '0'); assert.equal(num.sub('1.0', '-1.0'), '2.0'); assert.equal(num('987654321987654321.12345678901').sub(100.012), '987654321987654221.11145678901'); assert.equal(num(100.012).sub(num('987654321987654321.12345678901')), '-987654321987654221.11145678901'); }); <|fim▁hole|> var one = num(1.2); var two = num(-1.2); assert.equal(one, '1.2'); assert.equal(two, '-1.2'); one.sub(two); assert.equal(one, '1.2'); assert.equal(two, '-1.2'); two.sub(one); assert.equal(one, '1.2'); assert.equal(two, '-1.2'); });<|fim▁end|>
test('sub#constness', function() {
<|file_name|>test_opsgenie_alert.py<|end_file_name|><|fim▁begin|># # 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. # import json import unittest import requests_mock from airflow.exceptions import AirflowException from airflow.models import Connection from airflow.providers.opsgenie.hooks.opsgenie_alert import OpsgenieAlertHook from airflow.utils import db class TestOpsgenieAlertHook(unittest.TestCase): conn_id = 'opsgenie_conn_id_test' opsgenie_alert_endpoint = 'https://api.opsgenie.com/v2/alerts' _payload = { 'message': 'An example alert message', 'alias': 'Life is too short for no alias', 'description': 'Every alert needs a description', 'responders': [ {'id': '4513b7ea-3b91-438f-b7e4-e3e54af9147c', 'type': 'team'}, {'name': 'NOC', 'type': 'team'}, {'id': 'bb4d9938-c3c2-455d-aaab-727aa701c0d8', 'type': 'user'}, {'username': '[email protected]', 'type': 'user'}, {'id': 'aee8a0de-c80f-4515-a232-501c0bc9d715', 'type': 'escalation'}, {'name': 'Nightwatch Escalation', 'type': 'escalation'}, {'id': '80564037-1984-4f38-b98e-8a1f662df552', 'type': 'schedule'}, {'name': 'First Responders Schedule', 'type': 'schedule'} ], 'visibleTo': [ {'id': '4513b7ea-3b91-438f-b7e4-e3e54af9147c', 'type': 'team'},<|fim▁hole|> {'name': 'rocket_team', 'type': 'team'}, {'id': 'bb4d9938-c3c2-455d-aaab-727aa701c0d8', 'type': 'user'}, {'username': '[email protected]', 'type': 'user'} ], 'actions': ['Restart', 'AnExampleAction'], 'tags': ['OverwriteQuietHours', 'Critical'], 'details': {'key1': 'value1', 'key2': 'value2'}, 'entity': 'An example entity', 'source': 'Airflow', 'priority': 'P1', 'user': 'Jesse', 'note': 'Write this down' } _mock_success_response_body = { "result": "Request will be processed", "took": 0.302, "requestId": "43a29c5c-3dbf-4fa4-9c26-f4f71023e120" } def setUp(self): db.merge_conn( Connection( conn_id=self.conn_id, host='https://api.opsgenie.com/', password='eb243592-faa2-4ba2-a551q-1afdf565c889' ) ) def test_get_api_key(self): hook = OpsgenieAlertHook(opsgenie_conn_id=self.conn_id) api_key = hook._get_api_key() self.assertEqual('eb243592-faa2-4ba2-a551q-1afdf565c889', api_key) def test_get_conn_defaults_host(self): hook = OpsgenieAlertHook() hook.get_conn() self.assertEqual('https://api.opsgenie.com', hook.base_url) @requests_mock.mock() def test_call_with_success(self, m): hook = OpsgenieAlertHook(opsgenie_conn_id=self.conn_id) m.post( self.opsgenie_alert_endpoint, status_code=202, json=self._mock_success_response_body ) resp = hook.execute(payload=self._payload) self.assertEqual(resp.status_code, 202) self.assertEqual(resp.json(), self._mock_success_response_body) @requests_mock.mock() def test_api_key_set(self, m): hook = OpsgenieAlertHook(opsgenie_conn_id=self.conn_id) m.post( self.opsgenie_alert_endpoint, status_code=202, json=self._mock_success_response_body ) resp = hook.execute(payload=self._payload) self.assertEqual(resp.request.headers.get('Authorization'), 'GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889') @requests_mock.mock() def test_api_key_not_set(self, m): hook = OpsgenieAlertHook() m.post( self.opsgenie_alert_endpoint, status_code=202, json=self._mock_success_response_body ) with self.assertRaises(AirflowException): hook.execute(payload=self._payload) @requests_mock.mock() def test_payload_set(self, m): hook = OpsgenieAlertHook(opsgenie_conn_id=self.conn_id) m.post( self.opsgenie_alert_endpoint, status_code=202, json=self._mock_success_response_body ) resp = hook.execute(payload=self._payload) self.assertEqual(json.loads(resp.request.body), self._payload)<|fim▁end|>
<|file_name|>client.rs<|end_file_name|><|fim▁begin|>use connection::{ConnectionInfo, IntoConnectionInfo, Connection, connect, PubSub, connect_pubsub, ConnectionLike}; use types::{RedisResult, Value}; /// The client type. #[derive(Debug, Clone)] pub struct Client { connection_info: ConnectionInfo, } /// The client acts as connector to the redis server. By itself it does not /// do much other than providing a convenient way to fetch a connection from /// it. In the future the plan is to provide a connection pool in the client. /// /// When opening a client a URL in the following format should be used: /// /// ```plain /// redis://host:port/db /// ``` /// /// Example usage:: /// /// ```rust,no_run /// let client = redis::Client::open("redis://127.0.0.1/").unwrap(); /// let con = client.get_connection().unwrap(); /// ``` impl Client { /// Connects to a redis server and returns a client. This does not /// actually open a connection yet but it does perform some basic /// checks on the URL that might make the operation fail. pub fn open<T: IntoConnectionInfo>(params: T) -> RedisResult<Client> { Ok(Client { connection_info: try!(params.into_connection_info()) }) } /// Instructs the client to actually connect to redis and returns a /// connection object. The connection object can be used to send /// commands to the server. This can fail with a variety of errors /// (like unreachable host) so it's important that you handle those /// errors. pub fn get_connection(&self) -> RedisResult<Connection> { Ok(try!(connect(&self.connection_info))) } /// Returns a PubSub connection. A pubsub connection can be used to /// listen to messages coming in through the redis publish/subscribe /// system. /// /// Note that redis' pubsub operates across all databases. pub fn get_pubsub(&self) -> RedisResult<PubSub> { Ok(try!(connect_pubsub(&self.connection_info))) } }<|fim▁hole|> fn req_packed_command(&self, cmd: &[u8]) -> RedisResult<Value> { try!(self.get_connection()).req_packed_command(cmd) } fn req_packed_commands(&self, cmd: &[u8], offset: usize, count: usize) -> RedisResult<Vec<Value>> { try!(self.get_connection()).req_packed_commands(cmd, offset, count) } fn get_db(&self) -> i64 { self.connection_info.db } }<|fim▁end|>
impl ConnectionLike for Client {
<|file_name|>shirtsinbulk.d.ts<|end_file_name|><|fim▁begin|>// TypeScript Version: 2.1 import * as React from 'react';<|fim▁hole|><|fim▁end|>
import { IconBaseProps } from 'react-icon-base'; export default class FaShirtsinbulk extends React.Component<IconBaseProps, any> { }
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># # 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. # """Test runner objects that's only for end-to-end tests. This package defines runners, which are used to execute test pipeline and verify results. """ # Protect against environments where dataflow runner is not available.<|fim▁hole|>from __future__ import absolute_import try: from apache_beam.runners.dataflow.test_dataflow_runner import TestDataflowRunner from apache_beam.runners.direct.test_direct_runner import TestDirectRunner except ImportError: pass # pylint: enable=wrong-import-order, wrong-import-position<|fim▁end|>
# pylint: disable=wrong-import-order, wrong-import-position
<|file_name|>user_timeline_event.py<|end_file_name|><|fim▁begin|># listenbrainz-server - Server for the ListenBrainz project. # # Copyright (C) 2021 Param Singh <[email protected]> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program 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 for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA import sqlalchemy import pydantic import ujson from datetime import datetime from data.model.user_timeline_event import ( UserTimelineEvent, UserTimelineEventType, UserTimelineEventMetadata, RecordingRecommendationMetadata, NotificationMetadata, ) from enum import Enum from listenbrainz import db from listenbrainz.db.exceptions import DatabaseException from typing import List def create_user_timeline_event( user_id: int, event_type: UserTimelineEventType, metadata: UserTimelineEventMetadata, ) -> UserTimelineEvent: """ Creates a user timeline event in the database and returns the event. """ try: with db.engine.connect() as connection: result = connection.execute(sqlalchemy.text(""" INSERT INTO user_timeline_event (user_id, event_type, metadata) VALUES (:user_id, :event_type, :metadata) RETURNING id, user_id, event_type, metadata, created """), { 'user_id': user_id, 'event_type': event_type.value, 'metadata': ujson.dumps(metadata.dict()), } ) r = dict(result.fetchone()) return UserTimelineEvent(**r) except Exception as e: raise DatabaseException(str(e)) def create_user_track_recommendation_event(user_id: int, metadata: RecordingRecommendationMetadata) -> UserTimelineEvent: """ Creates a track recommendation event in the database and returns it. """ return create_user_timeline_event( user_id=user_id, event_type=UserTimelineEventType.RECORDING_RECOMMENDATION, metadata=metadata, ) def create_user_notification_event(user_id: int, metadata: NotificationMetadata) -> UserTimelineEvent: """ Create a notification event in the database and returns it. """ return create_user_timeline_event( user_id=user_id, event_type=UserTimelineEventType.NOTIFICATION, metadata=metadata ) def get_user_timeline_events(user_id: int, event_type: UserTimelineEventType, count: int = 50) -> List[UserTimelineEvent]: """ Gets user timeline events of the specified type associated with the specified user. The optional `count` parameter can be used to control the number of events being returned. """ with db.engine.connect() as connection: result = connection.execute(sqlalchemy.text(""" SELECT id, user_id, event_type, metadata, created FROM user_timeline_event WHERE user_id = :user_id AND event_type = :event_type ORDER BY created LIMIT :count """), { 'user_id': user_id, 'event_type': event_type.value, 'count': count, }) return [UserTimelineEvent(**row) for row in result.fetchall()] def get_user_track_recommendation_events(user_id: int, count: int = 50) -> List[UserTimelineEvent]: """ Gets track recommendation events created by the specified user. The optional `count` parameter can be used to control the number of events being returned. """ return get_user_timeline_events( user_id=user_id, event_type=UserTimelineEventType.RECORDING_RECOMMENDATION, count=count, ) def get_recording_recommendation_events_for_feed(user_ids: List[int], min_ts: int, max_ts: int, count: int) -> List[UserTimelineEvent]: """ Gets a list of recording_recommendation events for specified users. user_ids is a tuple of user row IDs. """ with db.engine.connect() as connection: result = connection.execute(sqlalchemy.text(""" SELECT id, user_id, event_type, metadata, created FROM user_timeline_event WHERE user_id IN :user_ids AND created > :min_ts AND created < :max_ts AND event_type = :event_type ORDER BY created DESC LIMIT :count """), { "user_ids": tuple(user_ids), "min_ts": datetime.utcfromtimestamp(min_ts),<|fim▁hole|> "event_type": UserTimelineEventType.RECORDING_RECOMMENDATION.value, }) return [UserTimelineEvent(**row) for row in result.fetchall()] def get_user_notification_events(user_id: int, count: int = 50) -> List[UserTimelineEvent]: """ Gets notification posted on the user's timeline. The optional `count` parameter can be used to control the number of events being returned. """ return get_user_timeline_events( user_id=user_id, event_type=UserTimelineEventType.NOTIFICATION, count=count )<|fim▁end|>
"max_ts": datetime.utcfromtimestamp(max_ts), "count": count,
<|file_name|>OnPageSelectedListener.java<|end_file_name|><|fim▁begin|>package com.kit.imagelib.imagelooker; public interface OnPageSelectedListener { public void onPageSelected();<|fim▁hole|> }<|fim▁end|>
<|file_name|>driver.cpp<|end_file_name|><|fim▁begin|>//******************************************************** // * // Instructor: Franck Xia * // Class: CS236 Fall 2002 * // Assignment: Program 6 * // Programmer: It's you * // File name: driver.cpp *<|fim▁hole|>//******************************************************** #define SUCCESSFUL 0 #include <iostream> #include <list> #include <string> #include <fstream> #include <cstring> #include "signal.h" #include "parser.h" #include "scanner.h" using std::cout; using std::endl; char str_token_type[30][10]; // the array is global // The following part declare an array of record to keep a single character // lexeme and the type of lexeme useful for the parser const int CTL_CHAR_OFFSET = 32; lexeme_type_t lexeme_type[] = { // the first field of each record is a chacater, the second one its enTokens code // all the characters appear in the ascii code value ascedent order. // as the first 32 ascii chacaters are controlled characters, they are not // included. to access an appropriate record of a character, we can use the ascii // value of the character - 32 as the index to this array. { ' ', U },{'!',U},{'"',U},{'#',U}, { '$', SCANEOF },{'%',U},{'&',U},{ '\'',U}, { '(', LPAREN }, { ')', RPAREN }, { '*', MULTOP }, { '+', ADDOP }, { ',', COMMA }, { '-', SUBOP },{'.',U}, { '/', DIVOP }, { '0', U }, {'1',U}, {'2',U}, {'3',U}, {'4',U}, { '5', U }, {'6',U}, {'7',U}, {'8',U}, {'9',U}, { ':', U }, { ';', SEMICOL }, { '<', LESS }, { '=', ASSIGNOP }, { '>', GREAT },{'?',U},{'@',U }, { 'A', U },{'B',U},{'C',U},{'D',U},{'E',U},{'F',U},{'G',U}, { 'H',U},{'I',U},{'J',U},{'K',U},{'L',U},{'M',U},{'N',U}, { 'O',U},{'P',U},{'Q',U},{'R',U},{'S',U},{'T',U},{'U',U}, { 'V',U},{'W',U},{'X',U},{'Y',U},{'Z',U}, { '[', LBRACK },{'\\',U}, { ']', RBRACK },{'^',U},{'_',U},{'`',U}, { 'a', U },{'b',U},{'c',U},{'d',U},{'e',U},{'f',U},{'g',U}, { 'h', U },{'i',U},{'j',U},{'k',U},{'l',U},{'m',U},{'n',U}, { 'o', U },{'p',U},{'q',U},{'r',U},{'s',U},{'t',U},{'u',U}, { 'v', U },{'w',U},{'x',U},{'y',U},{'z',U}, { '{', U },{'|',U},{'}',U},{'~',U} }; int main() { // The following lines avoid a huge switch statement char tt[10]; int c; std::ifstream token_file( "tokens_file.dat" ); c = 0; // the starting value of enTokens type is set to 0 while ( c < 30 && token_file >> tt ) { std::strcpy( str_token_type[c++], tt ); } std::list<std::string> program_list; std::list<std::string>::const_iterator itrTest; CScanner scanner; Parser parsing; //program_list.push_back(std::string("a=b+3.14156 - 7.8182;$")); //program_list.push_back(std::string("a=c*b-d; $")); //program_list.push_back(std::string("a=c+b$ ")); //program_list.push_back(std::string("a=c*(b-d);$")); //program_list.push_back(std::string("a=c+b*d;$")); //program_list.push_back(std::string("a=(c+b)*d;$")); //program_list.push_back(std::string("a=(c+b)*d;$ ")); //program_list.push_back(std::string("a=(c+b)*d ; b=a-e*t; $")); //program_list.push_back(std::string("a=1+b $")); program_list.push_back(std::string("b=[1.0,2.1;3.5,4.6];$")); program_list.push_back(std::string("b=[1.0,2.1;3.5,4.6]+1.0;$")); program_list.push_back(std::string("b=[1.0,2.1;3.5,4.6]-1.0;$")); program_list.push_back(std::string("b=1.0+[1.0,2.1;3.5,4.6];$")); program_list.push_back(std::string("b=1.0-[1.0,2.1;3.5,4.6];$")); program_list.push_back(std::string("b=2.0*[1.0,2.1;3.5,4.6];$")); program_list.push_back(std::string("b=[1.0,2.1;3.5,4.6]*2.0;$")); program_list.push_back(std::string("b=1.0+2.1;$")); program_list.push_back(std::string("b=1.0-2.1;$")); program_list.push_back(std::string("b=3.0*2.1;$")); program_list.push_back(std::string("b=[1.0,2.1;3.5,4.6];$")); program_list.push_back(std::string("b=[1.0,2.1;3.5];$")); program_list.push_back(std::string("b=[1.0,2.1;3.5,4.6]+[1.0,2.1;3.5,4.6];$")); program_list.push_back(std::string("b=[1.0,2.1]+[1.0,2.1;3.5,4.6];$")); program_list.push_back(std::string("b=[1.0,2.1;3.5,4.6]+[2.1;4.6];$")); program_list.push_back(std::string("b=[1.0,2.1;3.5,4.6]-[1.0,2.1;3.5,4.6];$")); program_list.push_back(std::string("b=[1.0,2.1;3.5,4.6]-[1.0,2.1];$")); program_list.push_back(std::string("b=[1.0;3.5]-[1.0,2.1;3.5,4.6];$")); program_list.push_back(std::string("b=[1.0,2.1;3.5,4.6]+[1.0,2.1;3.5,4.6];$")); program_list.push_back(std::string("b=[1.0;3.5]*[1.0,2.1;3.5,4.6];$")); program_list.push_back(std::string("b=[1.0;3.5]*[1.0,2.1];$")); itrTest = program_list.begin(); while(itrTest != program_list.end()) { try { cout << *itrTest << endl; scanner.generate_token_list(*itrTest); // now scanner should contain a list of lexemes ready for parsing CToken_List ajb_temp=scanner.get_token_list(); parsing.parse(ajb_temp); cout << "\nA New Program\n\n"; } catch (CSignal e) { cout << e.get_message() <<endl <<endl <<endl; // Get the message } itrTest++; } return (SUCCESSFUL); }<|fim▁end|>
// Function: driver program testing the parser * // *
<|file_name|>sort.rs<|end_file_name|><|fim▁begin|>use par_exec::{Executor, WorkAmount, JobIterBuild, ExecutorJobError, JobExecuteError}; use super::{Set, SetManager, merge}; pub trait SortManager { type S: Set; type E; fn sort<SF>(&mut self, set: &mut Self::S, pred: SF) -> Result<(), Self::E> where SF: Fn(usize, usize) -> bool; } pub trait RetrieveSortManager { type SortM; fn retrieve(&mut self) -> &mut Self::SortM; } pub trait RetrieveSetManager { type SetM; fn retrieve(&mut self) -> &mut Self::SetM; } #[derive(Debug)] pub enum SortError<SE, SME, SRE> { Set(SE), SetManager(SME), Sort(SRE) } #[derive(Debug)] pub enum Error<ExecE, SE, SME, SRE> { EmptySet, Executor(ExecutorJobError<ExecE, JobExecuteError<SortError<SE, SME, SRE>, merge::Error<SE, SME>>>), } pub fn sort<Exec, LC, S, SetM, SortM, WA, F>(amount: WA, pred: F, exec: &mut Exec) -> Result<S, Error<Exec::E, S::E, SetM::E, SortM::E>> where LC: RetrieveSortManager<SortM = SortM> + RetrieveSetManager<SetM = SetM>, Exec: Executor<LC = LC>, S: Set<T = usize> + Send + Sync + 'static, SetM: SetManager<S = S>, SortM: SortManager<S = S>, S::E: Send + 'static, SetM::E: Send + 'static, SortM::E: Send + 'static, WA: WorkAmount, Exec::JIB: JobIterBuild<WA>, F: Fn(usize, usize) -> bool + Sync + Send + 'static { use std::sync::Arc; let map_pred = Arc::new(pred); let reduce_pred = map_pred.clone(); match exec.try_execute_job( amount, move |local_context, input_indices| { let mut sort_chunk = { let mut set_manager = <LC as RetrieveSetManager>::retrieve(local_context); try!(set_manager.make_set(None).map_err(SortError::SetManager)) }; for index in input_indices { try!(sort_chunk.add(index).map_err(SortError::Set)); } let mut sort_manager = <LC as RetrieveSortManager>::retrieve(local_context); try!(sort_manager.sort(&mut sort_chunk, |a, b| map_pred(a, b)).map_err(SortError::Sort)); Ok(sort_chunk) }, move |local_context, set_a, set_b| merge::merge(<LC as RetrieveSetManager>::retrieve(local_context), set_a, set_b, |&a, &b| reduce_pred(a, b))) { Ok(None) => Err(Error::EmptySet), Ok(Some(sorted_set)) => Ok(sorted_set), Err(e) => Err(Error::Executor(e)), } } #[cfg(test)] mod tests { extern crate rand; use std::sync::Arc; use self::rand::Rng; use super::{RetrieveSortManager, RetrieveSetManager, sort};<|fim▁hole|> struct LocalContext(vec::Manager<usize>); impl RetrieveSortManager for LocalContext { type SortM = vec::Manager<usize>; fn retrieve(&mut self) -> &mut Self::SortM { &mut self.0 } } impl RetrieveSetManager for LocalContext { type SetM = vec::Manager<usize>; fn retrieve(&mut self) -> &mut Self::SetM { &mut self.0 } } #[test] fn parallel_sort() { let total = 131072; let mut rng = rand::thread_rng(); let vec: Arc<Vec<u64>> = Arc::new((0 .. total).map(|_| rng.gen()).collect()); let exec: ParallelExecutor<_> = Default::default(); let mut exec = exec.start(|| LocalContext(vec::Manager::new())).unwrap(); let vec_clone = vec.clone(); let sorted_indices = sort( ByEqualChunks::new(vec.len()), move |ia, ib| vec_clone[ia] < vec_clone[ib], &mut exec).unwrap(); assert_eq!(sorted_indices.len(), total); for i in 1 .. total { assert!(vec[sorted_indices[i - 1]] <= vec[sorted_indices[i]]); } } }<|fim▁end|>
use super::super::vec; use par_exec::{Executor, WorkAmount}; use par_exec::par::{ParallelExecutor, ByEqualChunks};
<|file_name|>graph.py<|end_file_name|><|fim▁begin|>""" Unit tests for nyx.panel.graph. """ import datetime import unittest import stem.control import nyx.curses import nyx.panel.graph import test from test import require_curses from mock import patch EXPECTED_BLANK_GRAPH = """ Download: 0 b 0 b 5s 10 15 """.rstrip() EXPECTED_ACCOUNTING = """ Accounting (awake) Time to reset: 01:02 37.7 Kb / 842.0 Kb 16.0 Kb / 74.1 Kb """.strip() EXPECTED_GRAPH = """ Download: 5 Kb * * 2 Kb ** * * ****<|fim▁hole|> 5s 10 15 """.rstrip() class TestGraphPanel(unittest.TestCase): def test_x_axis_labels(self): test_inputs = { 0: {}, 7: {}, 10: {5: '25s'}, 15: {5: '25s', 10: '50'}, 20: {5: '25s', 10: '50', 15: '1m'}, 25: {5: '25s', 10: '50', 15: '1m', 20: '1.6'}, 45: {5: '25s', 10: '50', 15: '1m', 20: '1.6', 25: '2.0', 30: '2.5', 35: '2.9', 40: '3.3'}, 80: {10: '50s', 20: '1m', 30: '2.5', 40: '3.3', 50: '4.1', 60: '5.0', 70: '5.8'}, # spaced more since wide } for width, expected in test_inputs.items(): self.assertEqual(expected, nyx.panel.graph._x_axis_labels(nyx.panel.graph.Interval.FIVE_SECONDS, width)) test_inputs = { nyx.panel.graph.Interval.EACH_SECOND: { 10: '10s', 20: '20', 30: '30', 40: '40', 50: '50', 60: '1m', 70: '1.1' }, nyx.panel.graph.Interval.FIVE_SECONDS: { 10: '50s', 20: '1m', 30: '2.5', 40: '3.3', 50: '4.1', 60: '5.0', 70: '5.8' }, nyx.panel.graph.Interval.THIRTY_SECONDS: { 10: '5m', 20: '10', 30: '15', 40: '20', 50: '25', 60: '30', 70: '35' }, nyx.panel.graph.Interval.MINUTELY: { 10: '10m', 20: '20', 30: '30', 40: '40', 50: '50', 60: '1h', 70: '1.1' }, nyx.panel.graph.Interval.FIFTEEN_MINUTE: { 10: '2h', 20: '5', 30: '7', 40: '10', 50: '12', 60: '15', 70: '17' }, nyx.panel.graph.Interval.THIRTY_MINUTE: { 10: '5h', 20: '10', 30: '15', 40: '20', 50: '1d', 60: '1.2', 70: '1.4' }, nyx.panel.graph.Interval.HOURLY: { 10: '10h', 20: '20', 30: '1d', 40: '1.6', 50: '2.0', 60: '2.5', 70: '2.9' }, nyx.panel.graph.Interval.DAILY: { 10: '10d', 20: '20', 30: '30', 40: '40', 50: '50', 60: '60', 70: '70' }, } for interval, expected in test_inputs.items(): self.assertEqual(expected, nyx.panel.graph._x_axis_labels(interval, 80)) def test_y_axis_labels(self): data = nyx.panel.graph.ConnectionStats() # check with both even and odd height since that determines an offset in the middle self.assertEqual({2: '10', 4: '7', 6: '5', 9: '2', 11: '0'}, nyx.panel.graph._y_axis_labels(12, data.primary, 0, 10)) self.assertEqual({2: '10', 4: '6', 6: '3', 8: '0'}, nyx.panel.graph._y_axis_labels(9, data.primary, 0, 10)) # check where the min and max are the same self.assertEqual({2: '0', 11: '0'}, nyx.panel.graph._y_axis_labels(12, data.primary, 0, 0)) @require_curses @patch('nyx.panel.graph.tor_controller') def test_draw_subgraph_blank(self, tor_controller_mock): tor_controller_mock().get_info.return_value = None data = nyx.panel.graph.BandwidthStats() rendered = test.render(nyx.panel.graph._draw_subgraph, data.primary, 0, 30, 7, nyx.panel.graph.Bounds.LOCAL_MAX, nyx.panel.graph.Interval.EACH_SECOND, nyx.curses.Color.CYAN, '*') self.assertEqual(EXPECTED_BLANK_GRAPH, rendered.content) @require_curses @patch('nyx.panel.graph.tor_controller') def test_draw_subgraph(self, tor_controller_mock): tor_controller_mock().get_info.return_value = '543,543 421,421 551,551 710,710 200,200 175,175 188,188 250,250 377,377' data = nyx.panel.graph.BandwidthStats() rendered = test.render(nyx.panel.graph._draw_subgraph, data.primary, 0, 30, 7, nyx.panel.graph.Bounds.LOCAL_MAX, nyx.panel.graph.Interval.EACH_SECOND, nyx.curses.Color.CYAN, '*') self.assertEqual(EXPECTED_GRAPH, rendered.content) @require_curses @patch('nyx.panel.graph.tor_controller') def test_draw_accounting_stats(self, tor_controller_mock): tor_controller_mock().is_alive.return_value = True accounting_stat = stem.control.AccountingStats( 1410723598.276578, 'awake', datetime.datetime(2014, 9, 14, 19, 41), 62, 4837, 102944, 107781, 2050, 7440, 9490, ) rendered = test.render(nyx.panel.graph._draw_accounting_stats, 0, accounting_stat) self.assertEqual(EXPECTED_ACCOUNTING, rendered.content) @require_curses @patch('nyx.panel.graph.tor_controller') def test_draw_accounting_stats_disconnected(self, tor_controller_mock): tor_controller_mock().is_alive.return_value = False rendered = test.render(nyx.panel.graph._draw_accounting_stats, 0, None) self.assertEqual('Accounting: Connection Closed...', rendered.content)<|fim▁end|>
0 b *********
<|file_name|>TimeParseBenchmark.java<|end_file_name|><|fim▁begin|>/* * Licensed to Metamarkets Group Inc. (Metamarkets) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Metamarkets 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 io.druid.benchmark; import com.google.common.base.Function; import io.druid.java.util.common.parsers.TimestampParser; import org.joda.time.DateTime; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Mode; import org.openjdk.jmh.annotations.OutputTimeUnit; import org.openjdk.jmh.annotations.Param; import org.openjdk.jmh.annotations.Scope; import org.openjdk.jmh.annotations.Setup; import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.infra.Blackhole; import org.openjdk.jmh.runner.Runner; import org.openjdk.jmh.runner.RunnerException; import org.openjdk.jmh.runner.options.Options; import org.openjdk.jmh.runner.options.OptionsBuilder; import java.text.SimpleDateFormat; import java.util.Date; import java.util.concurrent.TimeUnit; @State(Scope.Benchmark) public class TimeParseBenchmark { // 1 million rows int numRows = 1000000; // Number of batches of same times @Param({"10000", "100000", "500000", "1000000"}) int numBatches; static final String DATA_FORMAT = "MM/dd/yyyy HH:mm:ss Z"; static Function<String, DateTime> timeFn = TimestampParser.createTimestampParser(DATA_FORMAT); private String[] rows; @Setup public void setup() { SimpleDateFormat format = new SimpleDateFormat(DATA_FORMAT); long start = System.currentTimeMillis(); int rowsPerBatch = numRows / numBatches; int numRowInBatch = 0; rows = new String[numRows]; for (int i = 0; i < numRows; ++i) { if (numRowInBatch >= rowsPerBatch) { numRowInBatch = 0; start += 5000; // new batch, add 5 seconds } rows[i] = format.format(new Date(start)); numRowInBatch++; } } @Benchmark @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) public void parseNoContext(Blackhole blackhole) { for (String row : rows) { blackhole.consume(timeFn.apply(row).getMillis()); } } @Benchmark @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) public void parseWithContext(Blackhole blackhole) { String lastTimeString = null; long lastTime = 0L; for (String row : rows) { if (!row.equals(lastTimeString)) { lastTimeString = row; lastTime = timeFn.apply(row).getMillis(); } blackhole.consume(lastTime); } } <|fim▁hole|> { Options opt = new OptionsBuilder() .include(TimeParseBenchmark.class.getSimpleName()) .warmupIterations(1) .measurementIterations(10) .forks(1) .build(); new Runner(opt).run(); } }<|fim▁end|>
public static void main(String[] args) throws RunnerException
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals <|fim▁hole|> name = 'developers'<|fim▁end|>
from django.apps import AppConfig class DevelopersConfig(AppConfig):
<|file_name|>slope_orientation.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import getopt import sys class SlopeOrientation: def __init__(self, dem, out_layer): print "Entering SlopeOrientation" #ALGORITHM: Aspect # INPUT <ParameterRaster> # BAND <ParameterNumber> # COMPUTE_EDGES <ParameterBoolean> # ZEVENBERGEN <ParameterBoolean> # TRIG_ANGLE <ParameterBoolean> # ZERO_FLAT <ParameterBoolean> # OUTPUT <OutputRaster><|fim▁hole|> def main(): try: opts, args = getopt.getopt(sys.argv[1:], '') except: pass n = SlopeOrientation(args[0]) if __name__ == '__main__': main()<|fim▁end|>
processing.runalg("gdalogr:aspect", dem, 1, False, False, False, False, out_layer)
<|file_name|>ast.rs<|end_file_name|><|fim▁begin|>//! # Abstract Syntax Tree //! //! This module defines the abstact syntax tree and how the nodes in the tree are evaluated //! Tree nodes are generated by the parser //! Each tree node has it's own struct associated with it use itertools::{join, Itertools}; use error::Error; use stdlib::Stdlib; use to_javascript::ToJavaScript; /// Define the number node /// JavaScript uses 64-bit floating point numbers so f64 is used #[derive(Clone, Debug, PartialEq)] pub struct NumberExpression { pub value: f64, } impl NumberExpression { pub fn new(value: f64) -> NumberExpression { NumberExpression { value } } } impl ToJavaScript for NumberExpression {<|fim▁hole|> fn eval(&mut self, _stdlib: &mut Stdlib) -> Result<String, Error> { Ok(format!("{}", self.value)) } } /// Define the identifier node /// We represent identifiers as strings. When evaluating the quotes around the stings are removed #[derive(Clone, Debug, PartialEq)] pub struct IdentifierExpression { pub value: String, } impl IdentifierExpression { pub fn new(value: String) -> IdentifierExpression { IdentifierExpression { value } } } impl ToJavaScript for IdentifierExpression { // For evaluating identifiers, we first check the variable table. // Then we check the function table. // If nothing is found in either table, then return an error fn eval(&mut self, stdlib: &mut Stdlib) -> Result<String, Error> { if let Some(_) = stdlib.variable_table.get(&self.value) { // TODO: Remove clone here Ok(self.value.clone()) } else if let Some(_) = stdlib.function_table.get(&self.value) { Ok(self.value.clone()) } else { // TODO: Remove clone here Err(Error::undefined_var(self.value.clone())) } } } /// Define the boolean node #[derive(Clone, Debug, PartialEq)] pub struct BooleanExpression { pub value: bool, } impl BooleanExpression { pub fn new(value: bool) -> BooleanExpression { BooleanExpression { value } } } impl ToJavaScript for BooleanExpression { // Evaluation of boolean means just converting the boolean to a string fn eval(&mut self, _stdlib: &mut Stdlib) -> Result<String, Error> { Ok(self.value.to_string()) } } /// Define the string node #[derive(Clone, Debug, PartialEq)] pub struct StringExpression { pub value: String, } impl StringExpression { pub fn new(value: String) -> StringExpression { StringExpression { value } } } impl ToJavaScript for StringExpression { // Evaluating the string node is just retuning the value fn eval(&mut self, _stdlib: &mut Stdlib) -> Result<String, Error> { // TODO: Remove this clone Ok(self.value.clone()) } } /// Define the list node #[derive(Clone, Debug, PartialEq)] pub struct ListExpression { pub value: Vec<Box<Expression>>, // A list can be optionally quoted qouted: bool, } impl ListExpression { pub fn new(qouted: bool, value: Vec<Box<Expression>>) -> ListExpression { ListExpression { qouted, value } } pub fn new_quoted(value: Vec<Box<Expression>>) -> ListExpression { ListExpression { qouted: true, value, } } pub fn new_unquoted(value: Vec<Box<Expression>>) -> ListExpression { ListExpression { qouted: false, value, } } // This function formats a Robin list to a JS array e.g. (1 2 3 4) => [1, 2, 3] // This function is called when an identifier isn't present as the first node fn format_list(&mut self, stdlib: &mut Stdlib) -> Result<String, Error> { // TODO: Remove clone // Evaluate each node and join them with a comma let args = join( self.value .clone() .into_iter() .map(|mut e| e.eval(stdlib)) .fold_results(vec![], |mut i, expr| { i.push(expr); i })?, ",", ); Ok(format!("[{}]", args)) } // This function handles a function being called e.g. ((lambda (n) (+ n 1)) 5) fn eval_lambda_call(&mut self, stdlib: &mut Stdlib) -> Result<String, Error> { let mut function_args = self.value.clone(); let (lambda, args) = function_args.split_first_mut().unwrap(); match lambda { // The first argument should be a list box Expression::List(inner_list) // TODO: Remove clone // The first node within the list should be "lambda" if inner_list.value[0].clone().to_string() == "lambda" => { // Evaluate each expression and join them with a comma let args = join( args.into_iter().map(|e| e.eval(stdlib)).fold_results( vec![], |mut i, expr| { i.push(expr); i }, )?, ",", ); Ok(format!("({})({})", lambda.eval(stdlib)?, args)) }, // TODO: See if this is correct _ => self.eval_function(stdlib), } } // This funciton handles evaluating a function called. // e.g. (console.log "Hello, world!") => console.log("Hello, world!") fn eval_function(&mut self, stdlib: &mut Stdlib) -> Result<String, Error> { // Create a copy of the function args for later formatting let mut function_args = self.value.clone(); // Get the name of the function then the arguments // TODO: Remove unwrap here let (name, args) = function_args.split_first_mut().unwrap(); // Check if the function is in a table let expr_name = name.eval(stdlib)?; // Get the function from the table match (name, stdlib.function_table.clone().get(&expr_name)) { // Call the function // TODO: Remove clone (box Expression::Identifier(_), Some(func)) => func(expr_name.clone(), args, stdlib), // Otherwise, format the function (box Expression::Identifier(_), _) => { let args = join( args.into_iter().map(|e| e.eval(stdlib)).fold_results( vec![], |mut i, expr| { i.push(expr); i }, )?, ",", ); Ok(format!("({}({}))", expr_name, args)) } // If nothing matches, convert to a JS array _ => self.format_list(stdlib), } } } impl ToJavaScript for ListExpression { fn eval(&mut self, stdlib: &mut Stdlib) -> Result<String, Error> { // The expression is quoted automatically if the ' is used // We send all the arguments when evaluating match (self.qouted, self.value.get(0)) { // Handle lists with quotes (true, _) => stdlib.function_table.get(&String::from("quote")).unwrap()( "quote".to_string(), self.value.as_mut_slice(), stdlib, ), // Handle lambda calls (false, Some(box Expression::List(_))) => self.eval_lambda_call(stdlib), // Handle function calls (false, Some(_)) => self.eval_function(stdlib), // Handle empty strings (false, _) => Ok(String::from("[]")), } } } // The Expression enum is the AST tree // Each node in the AST has an associated struct #[derive(Clone, Debug, PartialEq)] pub enum Expression { Number(NumberExpression), Identifier(IdentifierExpression), Boolean(BooleanExpression), String(StringExpression), List(ListExpression), } // Consider using ToString impl Expression { // Used to convert expressions to string pub fn to_string(self) -> String { match self { Expression::Number(expr) => expr.value.to_string(), Expression::Identifier(expr) => expr.value, Expression::Boolean(expr) => expr.value.to_string(), Expression::String(expr) => expr.value, Expression::List(ref list_expr) => { // Call to_string for each node member and join them with a comma let list_fmt = list_expr .value .clone() .into_iter() .map(|expr| expr.to_string()) .collect::<Vec<String>>() .join(","); format!("[{}]", list_fmt) } } } } impl ToJavaScript for Expression { // Evaluate each node by delegating to the structs evaluate function fn eval(&mut self, stdlib: &mut Stdlib) -> Result<String, Error> { match self { // Delegate to the node's evaluate function Expression::Number(expr) => expr.eval(stdlib), Expression::Identifier(expr) => expr.eval(stdlib), Expression::Boolean(expr) => expr.eval(stdlib), Expression::String(expr) => expr.eval(stdlib), Expression::List(expr) => expr.eval(stdlib), } } }<|fim▁end|>
// Evaluation of numbers means just converting the number to a string
<|file_name|>collection.rs<|end_file_name|><|fim▁begin|>/* Copyright 2017 Christopher Bacher * * 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. */ //! The collection module contains matchers for asserting properties of collections and iterators. use super::super::*; use std::cmp::Ordering; use std::fmt::Debug; use std::iter::FromIterator; /// Matches if the asserted collection contains *all and only* the expected elements in any order. pub struct ContainsInAnyOrder<T> { expected_elements: Vec<T> } /// Matches if the asserted collection contains *all and only* of the expected elements in any order. /// /// #Examples /// ```rust /// # #[macro_use] extern crate galvanic_assert; /// use galvanic_assert::matchers::collection::*; /// # fn main() { /// assert_that!(&vec![1,2,3,4,5,6], contains_in_any_order(vec![2,4,1,5,3,6])); /// assert_that!( /// // 6 is missing /// assert_that!(&vec![1,2,3,4,5,6], contains_in_any_order(vec![2,4,1,5,3])), /// panics /// ); /// assert_that!( /// // 7 is added /// assert_that!(&vec![1,2,3,4,5,6], contains_in_any_order(vec![2,4,1,5,3,6,7])), /// panics /// ); /// # } pub fn contains_in_any_order<'a,T:'a,I:'a,J:'a>(expected_elements: I) -> Box<Matcher<J> + 'a> where T: PartialEq + Debug, I: IntoIterator<Item=T>, J: IntoIterator<Item=T>, ContainsInAnyOrder<T>: Matcher<J> { Box::new(ContainsInAnyOrder { expected_elements: expected_elements.into_iter().collect() }) } impl<T,I> Matcher<I> for ContainsInAnyOrder<T> where T: PartialEq + Debug, for<'all> &'all I: IntoIterator<Item=&'all T> + Debug { fn check(&self, actual: &I) -> MatchResult { let repr = format!("{:?}", actual); let builder = MatchResultBuilder::for_("contains_in_any_order"); let mut expected_elements = Vec::from_iter(self.expected_elements.iter()); for ref element in actual.into_iter() { let maybe_pos = expected_elements.iter() .position(|candidate| element == candidate); if let Some(idx) = maybe_pos { expected_elements.remove(idx); } else { return builder.failed_because( &format!("{} contains an unexpected element: {:?}", repr, element) ); } } if !expected_elements.is_empty() { builder.failed_because( &format!("{} did not contain the following elements: {:?}", repr, expected_elements) ) } else { builder.matched() } } } /// Matches if the asserted collection contains *all and only* of the expected elements in the given order. pub struct ContainsInOrder<T> { expected_elements: Vec<T> } /// Matches if the asserted collection contains *all and only* of the expected elements in the given order. /// /// #Examples /// ```rust /// # #[macro_use] extern crate galvanic_assert; /// use galvanic_assert::matchers::collection::*; /// # fn main() { /// assert_that!(&vec![1,2,3,4,5,6], contains_in_order(vec![1,2,3,4,5,6])); /// assert_that!( /// // 6 is missing /// assert_that!(&vec![1,2,3,4,5,6], contains_in_order(vec![1,2,3,4,5])), /// panics /// ); /// assert_that!( /// // 7 is added /// assert_that!(&vec![1,2,3,4,5,6], contains_in_order(vec![1,2,3,4,5,6,7])), /// panics /// ); /// # } pub fn contains_in_order<'a,T:'a,I:'a,J:'a>(expected_elements: I) -> Box<Matcher<J> + 'a> where T: PartialEq + Debug, I: IntoIterator<Item=T>, J: IntoIterator<Item=T>, ContainsInOrder<T>: Matcher<J> { Box::new(ContainsInOrder { expected_elements: expected_elements.into_iter().collect() }) } impl<T, I> Matcher<I> for ContainsInOrder<T> where T: PartialEq + Debug, for<'all> &'all I: IntoIterator<Item=&'all T> + Debug { fn check(&self, actual: &I) -> MatchResult { let builder = MatchResultBuilder::for_("contains_in_order"); let actual_list: Vec<_> = actual.into_iter().collect(); if actual_list.len() > self.expected_elements.len() { return builder.failed_because( &format!("The expected list is shorter than the actual list by {} elements", actual_list.len() - self.expected_elements.len()) ); } if actual_list.len() < self.expected_elements.len() { return builder.failed_because( &format!("The actual list is shorter than the expected list by {} elements", self.expected_elements.len() - actual_list.len()) ); } let nonmatching: Vec<_> = actual_list.into_iter() .zip(self.expected_elements.iter()) .filter(|&(act, exp)| act != exp) .collect(); if !nonmatching.is_empty() { builder.failed_because( &format!("the following actual/expected pairs do not match: {:?}", nonmatching) ) } else { builder.matched() } } } /// Matches if the asserted collection contains *all* (possibly more) of the expected elements. pub struct ContainsSubset<T> { expected_elements: Vec<T> } /// Matches if the asserted collection contains *all* (possibly more) of the expected elements. /// /// #Examples /// ```rust /// # #[macro_use] extern crate galvanic_assert; /// use galvanic_assert::matchers::collection::*; /// # fn main() { /// assert_that!(&vec![1,2,3,4,5,6], contains_subset(vec![3,1,2,4])); /// # } pub fn contains_subset<'a,T:'a,I:'a,J:'a>(expected_elements: I) -> Box<Matcher<J> + 'a> where T: PartialEq + Debug, I: IntoIterator<Item=T>, J: IntoIterator<Item=T>, ContainsSubset<T>: Matcher<J> { Box::new(ContainsSubset { expected_elements: expected_elements.into_iter().collect() }) } impl<T, I> Matcher<I> for ContainsSubset<T> where T: PartialEq + Debug, for<'all >&'all I: IntoIterator<Item=&'all T> + Debug { fn check(&self, actual: &I) -> MatchResult { let repr = format!("{:?}", actual); let builder = MatchResultBuilder::for_("contains_subset"); let mut expected_elements = Vec::from_iter(self.expected_elements.iter()); for element in actual.into_iter() { let maybe_pos = expected_elements.iter() .position(|candidate| element == *candidate); if let Some(idx) = maybe_pos { expected_elements.remove(idx); } } if !expected_elements.is_empty() { builder.failed_because( &format!("{} did not contain the following elements: {:?}", repr, expected_elements) ) } else { builder.matched() } } } /// Matches if the asserted (single) value is contained in the expected elements. pub struct ContainedIn<T> { expected_to_contain: Vec<T> } /// Matches if the asserted (single) value is contained in the expected elements. /// /// #Examples /// ```rust /// # #[macro_use] extern crate galvanic_assert; /// use galvanic_assert::matchers::collection::*; /// # fn main() { /// assert_that!(&5, contained_in(vec![1,2,3,4,5,6,7,8])); /// # } pub fn contained_in<'a,T:'a,I>(expected_to_contain: I) -> Box<Matcher<T> + 'a> where T: PartialEq + Debug, I: IntoIterator<Item=T> { Box::new(ContainedIn { expected_to_contain: expected_to_contain.into_iter().collect() }) } impl<T> Matcher<T> for ContainedIn<T> where T: PartialEq + Debug { fn check(&self, element: &T) -> MatchResult { let builder = MatchResultBuilder::for_("containd_in"); if let None = self.expected_to_contain.iter().position(|e| e == element) { builder.failed_because( &format!("{:?} does not contain: {:?}", self.expected_to_contain, element) ) } else { builder.matched() } } } fn sorted_according_to<'a,T:'a, I, P:'a>( predicate: P, expected_ordering: Option<Ordering>, is_strict: bool, ) -> Box<Matcher<I> + 'a> where T: Ord + Debug, for<'all> &'all I: IntoIterator<Item=&'all T>, for<'all> P: Fn(&'all T, &'all T) -> Ordering { Box::new(move |elements: &I| { let builder = MatchResultBuilder::for_("sorted_according_to"); let window_iter = elements.into_iter().zip({ let mut second = elements.into_iter(); second.next(); second }); let mut prev_ordering = expected_ordering; for (first, second) in window_iter { let ordering = predicate(first, second); if prev_ordering.map(|o| o != ordering && ordering != Ordering::Equal).unwrap_or(false) { return builder.failed_because( &format!("Ordering of iterable is not monotone: {:?}) not {:?} {:?}", first, prev_ordering, second) ); } if is_strict && ordering == Ordering::Equal { return builder.failed_because( &format!("Ordering of iterable is not strictly monotone: {:?}) == {:?}", first, second) ); } if prev_ordering.is_none() && ordering != Ordering::Equal { prev_ordering = Some(ordering) } } builder.matched() }) } /// Matches if the elements in the asserted collection are sorted weakly monotone according to the given `predicate` in the expected order. /// /// The `predicate` is applied to all consecutive pairs of elements and returns the `Ordering` of the pair. /// The ordering is allowed to be weakly monotone, i.e., equal elements are allowed to follow each other. /// An empty collection is assumed to be always sorted. /// /// #Examples /// ```rust /// # #[macro_use] extern crate galvanic_assert; /// use galvanic_assert::matchers::collection::*; /// use std::cmp::Ordering; /// # fn main() { /// assert_that!(&vec![1,2,2,3,3,4,5,6], sorted_by(|a: &i32, b: &i32| a.cmp(b), Ordering::Less)); /// # } pub fn sorted_by<'a, T: 'a, I: 'a, P: 'a>(predicate: P, expected_ordering: Ordering) -> Box<Matcher<I> + 'a> where T: Ord + Debug, for<'all> &'all I: IntoIterator<Item=&'all T>, for<'all> P: Fn(&'all T, &'all T) -> Ordering { rename_matcher("sorted_by".to_owned(), sorted_according_to(predicate, Some(expected_ordering), false)) } /// Matches if the elements in the asserted collection are sorted strictly monotone according to the given `predicate` in the expected order`. /// /// The `predicate` is applied to all consecutive pairs of elements and returns the `Ordering` of the pair. /// The ordering is allowed to be weakly monotone, i.e., equal elements are allowed to follow each other. /// An empty collection is assumed to be always sorted. /// /// #Examples /// ```rust /// # #[macro_use] extern crate galvanic_assert; /// use galvanic_assert::matchers::collection::*; /// use std::cmp::Ordering; /// # fn main() { /// assert_that!(&vec![1,2,3,4,5,6], sorted_strictly_by(|a: &i32, b: &i32| a.cmp(b), Ordering::Less)); /// # } pub fn sorted_strictly_by<'a, T: 'a, I: 'a, P: 'a>(predicate: P, expected_ordering: Ordering) -> Box<Matcher<I> + 'a> where T: Ord + Debug, for<'all> &'all I: IntoIterator<Item=&'all T>, for<'all> P: Fn(&'all T, &'all T) -> Ordering { rename_matcher("sorted_strictly_by".to_owned(), sorted_according_to(predicate, Some(expected_ordering), true)) } /// Matches if the elements in the asserted collection are sorted weakly monotone according to the given `predicate` in any order. /// /// The `predicate` is applied to all consecutive pairs of elements and returns the `Ordering` of the pair. /// The first `Ordering` different to `Ordering::Equal` defines the expected order of the collection. /// The ordering is allowed to be weakly monotone, i.e., equal elements are allowed to follow each other. /// An empty collection is assumed to be always sorted. /// /// #Examples /// ```rust /// # #[macro_use] extern crate galvanic_assert; /// use galvanic_assert::matchers::collection::*; /// # fn main() { /// assert_that!(&vec![5,4,3,3,2,1,1], sorted_by_in_any_order(|a: &i32, b: &i32| a.cmp(b))); /// assert_that!(&vec![1,1,2,3,3,4,5], sorted_by_in_any_order(|a: &i32, b: &i32| a.cmp(b))); /// # } pub fn sorted_by_in_any_order<'a, T: 'a, I: 'a, P: 'a>(predicate: P) -> Box<Matcher<I> + 'a> where T: Ord + Debug, for<'all> &'all I: IntoIterator<Item=&'all T>, for<'all> P: Fn(&'all T, &'all T) -> Ordering { rename_matcher("sorted_by_in_any_order".to_owned(), sorted_according_to(predicate, None, false)) } /// Matches if the elements in the asserted collection are sorted strictly monotone according to the given `predicate` in any order. /// /// The `predicate` is applied to all consecutive pairs of elements and returns the `Ordering` of the pair. /// The first `Ordering` different to `Ordering::Equal` defines the expected order of the collection. /// The ordering is allowed to be weakly monotone, i.e., equal elements are allowed to follow each other. /// An empty collection is assumed to be always sorted. /// /// #Examples /// ```rust /// # #[macro_use] extern crate galvanic_assert; /// use galvanic_assert::matchers::collection::*; /// # fn main() { /// assert_that!(&vec![5,4,3,2,1], sorted_strictly_by_in_any_order(|a: &i32, b: &i32| a.cmp(b))); /// assert_that!(&vec![1,2,3,4,5], sorted_strictly_by_in_any_order(|a: &i32, b: &i32| a.cmp(b))); /// # } pub fn sorted_strictly_by_in_any_order<'a, T: 'a, I: 'a, P: 'a>(predicate: P) -> Box<Matcher<I> + 'a> where T: Ord + Debug, for<'all> &'all I: IntoIterator<Item=&'all T>, for<'all> P: Fn(&'all T, &'all T) -> Ordering { rename_matcher("sorted_strictly_by_in_any_order".to_owned(), sorted_according_to(predicate, None, true)) } /// Matches if the asserted collection is sorted weakly ascending. /// /// An empty collection is assumed to be always sorted. /// /// #Examples /// ```rust /// # #[macro_use] extern crate galvanic_assert; /// use galvanic_assert::matchers::collection::*; /// # fn main() { /// assert_that!(&vec![1,2,2,3,4,4,5], sorted_ascending()); /// # } pub fn sorted_ascending<'a, T: 'a, I: 'a>() -> Box<Matcher<I> + 'a> where T: Ord + Debug, for<'all> &'all I: IntoIterator<Item=&'all T> { sorted_by(|a: &T, b: &T| a.cmp(b), Ordering::Less) } /// Matches if the asserted collection is sorted strictly ascending. /// /// An empty collection is assumed to be always sorted. /// /// #Examples /// ```rust /// # #[macro_use] extern crate galvanic_assert; /// use galvanic_assert::matchers::collection::*; /// # fn main() { /// assert_that!(&vec![1,2,3,4,5], sorted_strictly_ascending()); /// # } pub fn sorted_strictly_ascending<'a, T: 'a, I: 'a>() -> Box<Matcher<I> + 'a> where T: Ord + Debug, for<'all> &'all I: IntoIterator<Item=&'all T> { sorted_strictly_by(|a: &T, b: &T| a.cmp(b), Ordering::Less) } /// Matches if the asserted collection is sorted weakly descending. /// /// An empty collection is assumed to be always sorted. /// /// #Examples /// ```rust /// # #[macro_use] extern crate galvanic_assert; /// use galvanic_assert::matchers::collection::*; /// # fn main() { /// assert_that!(&vec![5,4,4,3,3,2,1], sorted_descending()); /// # } pub fn sorted_descending<'a, T: 'a, I: 'a>() -> Box<Matcher<I> + 'a> where T: Ord + Debug, for<'all> &'all I: IntoIterator<Item=&'all T> { sorted_by(|a: &T, b: &T| a.cmp(b), Ordering::Greater) } /// Matches if the asserted collection is sorted strictly descending. /// /// An empty collection is assumed to be always sorted. /// /// #Examples /// ```rust /// # #[macro_use] extern crate galvanic_assert; /// use galvanic_assert::matchers::collection::*; /// # fn main() { /// assert_that!(&vec![5,4,3,2,1], sorted_strictly_descending()); /// # } pub fn sorted_strictly_descending<'a, T: 'a, I: 'a>() -> Box<Matcher<I> + 'a> where T: Ord + Debug, for<'all> &'all I: IntoIterator<Item=&'all T> { sorted_strictly_by(|a: &T, b: &T| a.cmp(b), Ordering::Greater) } /// Matches if all elements in the asserted collection satisfy the given `predicate`. /// /// An empty collection always satisfies this matcher as all (=no) element satisfies the predicate. /// /// #Examples /// ```rust /// # #[macro_use] extern crate galvanic_assert; /// use galvanic_assert::matchers::collection::*; /// # fn main() { /// assert_that!(&vec![1,2,3,4,5], all_elements_satisfy(|&a| 0 <= a && a < 100)); /// # } pub fn all_elements_satisfy<'a, T: 'a, I, P: 'a>(predicate: P) -> Box<Matcher<I> + 'a> where T: Debug, for<'all> &'all I: IntoIterator<Item=&'all T>, for<'all> P: Fn(&'all T) -> bool { Box::new(move |elements: &I| { let builder = MatchResultBuilder::for_("all_elements_satisfy"); let nonsatisfying_elements: Vec<_> = elements.into_iter().filter(|e| !predicate(e)).collect(); if !nonsatisfying_elements.is_empty() { builder.failed_because( &format!("the following elements do not satisfy the predicate: {:?}", nonsatisfying_elements) ) } else { builder.matched() } }) } /// Matches if at least one element in the asserted collection satisfy the given `predicate`. /// /// An empty collection never satisfies this matcher as no element satisfies the predicate. /// /// #Examples /// ```rust /// # #[macro_use] extern crate galvanic_assert; /// use galvanic_assert::matchers::collection::*; /// # fn main() { /// assert_that!(&vec![1,2,3,4,5], some_elements_satisfy(|&a| 2 <= a && a < 5)); /// # } pub fn some_elements_satisfy<'a, T: 'a, I, P: 'a>(predicate: P) -> Box<Matcher<I> + 'a> where T: Debug, for<'all> &'all I: IntoIterator<Item=&'all T>, for<'all> P: Fn(&'all T) -> bool { Box::new(move |elements: &I| { let builder = MatchResultBuilder::for_("some_elements_satisfy"); if !elements.into_iter().any(|ref e| predicate(e)) { builder.failed_because("no elements satisfy the predicate") } else { builder.matched() } }) } /// Matches if the map-like collection contains the given key/value pair. /// /// The `Matcher` tests for this by converting the map-like data structure /// into a key/value pair iterator. /// /// The alternative would be to use the Index trait though experiments showed /// that this would not be composable with `all_of!` or `any_of!`. pub struct HasEntry<K,V> { key: K, value: V } /// Matches if the map-like collection contains the given key/value pair. /// /// The `Matcher` tests for this by converting the map-like data structure /// into a key/value pair iterator. /// /// The alternative would be to use the Index trait though experiments showed /// that this would not be composable with `all_of!` or `any_of!`. /// /// #Examples /// ```rust /// # #[macro_use] extern crate galvanic_assert; /// use galvanic_assert::matchers::collection::*; /// # fn main() { /// let mut map = std::collections::HashMap::<i32,i32>::new(); /// map.insert(0, 2); /// map.insert(1, 2); /// map.insert(2, 5); /// map.insert(3, 3); /// map.insert(4, 3); /// /// assert_that!(&map, has_entry(1, 2)); /// # } pub fn has_entry<'a,K:'a,V:'a,M:'a>(key: K, value: V) -> Box<Matcher<M> + 'a> where K: PartialEq + Debug, V: PartialEq + Debug, for<'all> &'all M: IntoIterator<Item=(&'all K, &'all V)> { Box::new(HasEntry { key, value }) } impl<K,V,M> Matcher<M> for HasEntry<K,V> where K: PartialEq + Debug, V: PartialEq + Debug, for<'all> &'all M: IntoIterator<Item=(&'all K, &'all V)> { fn check(&self, map: &M) -> MatchResult { let builder = MatchResultBuilder::for_("has_entry"); let mut same_keys = Vec::new(); let mut same_values = Vec::new(); for (key, value) in map.into_iter() { if key == &self.key && value == &self.value { return builder.matched() } if key == &self.key { same_keys.push(value); } if value == &self.value { same_values.push(key); } } builder.failed_because(&format!( "Entry ({:?}, {:?}) not found.\n\tEntries with same key: {:?}\n\tEntries with same value: {:?}", &self.key, &self.value, same_keys, same_values )) } } /// Matches if the map-like collection contains the given key. /// /// The `Matcher` tests for this by converting the map-like data structure /// into a key/value pair iterator. /// /// The alternative would be to use the Index trait though experiments showed /// that this would not be composable with `all_of!` or `any_of!`. pub struct HasKey<K> { key: K } /// Matches if the map-like collection contains the given key. /// /// The `Matcher` tests for this by converting the map-like data structure /// into a key/value pair iterator. /// /// The alternative would be to use the Index trait though experiments showed /// that this would not be composable with `all_of!` or `any_of!`. /// /// #Examples /// ```rust /// # #[macro_use] extern crate galvanic_assert; /// use galvanic_assert::matchers::collection::*; /// # fn main() { /// let mut map = std::collections::HashMap::<i32,i32>::new(); /// map.insert(0, 2); /// map.insert(1, 2); /// map.insert(2, 5); /// map.insert(3, 3); /// map.insert(4, 3); /// /// assert_that!(&map, has_key(2)); /// # } pub fn has_key<'a, K:'a, V, M>(key: K) -> Box<Matcher<M> + 'a> where K: PartialEq + Debug, for<'all> &'all M: IntoIterator<Item=(&'all K, &'all V)> { Box::new(HasKey { key }) } impl<K,V,M> Matcher<M> for HasKey<K> where K: PartialEq + Debug, for<'all> &'all M: IntoIterator<Item=(&'all K, &'all V)> { fn check(&self, map: &M) -> MatchResult { let builder = MatchResultBuilder::for_("has_key"); for (key, _) in map.into_iter() { if key == &self.key { return builder.matched(); } } builder.failed_because(&format!("No entrywith key {:?} found", &self.key)) } } /// Matches if the map-like collection contains the given value. /// /// The `Matcher` tests for this by converting the map-like data structure /// into a key/value pair iterator. pub struct HasValue<V> { value: V } /// Matches if the map-like collection contains the given value. /// /// The `Matcher` tests for this by converting the map-like data structure /// into a key/value pair iterator. /// /// #Examples /// ```rust /// # #[macro_use] extern crate galvanic_assert; /// use galvanic_assert::matchers::collection::*; /// # fn main() { /// let mut map = std::collections::HashMap::<i32,i32>::new(); /// map.insert(0, 2); /// map.insert(1, 2); /// map.insert(2, 5); /// map.insert(3, 3); /// map.insert(4, 3); /// /// assert_that!(&map, has_value(3)); /// # } pub fn has_value<'a, K, V:'a, M>(value: V) -> Box<Matcher<M> + 'a> where V: PartialEq + Debug, for<'all> &'all M: IntoIterator<Item=(&'all K, &'all V)> { Box::new(HasValue { value }) } impl<K,V,M> Matcher<M> for HasValue<V> where V: PartialEq + Debug, for<'all> &'all M: IntoIterator<Item=(&'all K, &'all V)> { fn check(&self, map: &M) -> MatchResult { let builder = MatchResultBuilder::for_("has_value"); for (_, value) in map.into_iter() {<|fim▁hole|> if value == &self.value { return builder.matched(); } } builder.failed_because(&format!("No entry with value {:?} found", &self.value)) } }<|fim▁end|>
<|file_name|>test_ftp.py<|end_file_name|><|fim▁begin|>from scoring_engine.engine.basic_check import CHECKS_BIN_PATH from tests.scoring_engine.checks.check_test import CheckTest <|fim▁hole|> properties = { 'remotefilepath': '/adir/textfile.txt', 'filecontents': 'Sample contents' } accounts = { 'testuser': 'testpass' } cmd = CHECKS_BIN_PATH + "/ftp_check '127.0.0.1' 1234 'testuser' 'testpass' '/adir/textfile.txt' 'Sample contents'"<|fim▁end|>
class TestFTPCheck(CheckTest): check_name = 'FTPCheck'
<|file_name|>TrxFormController.java<|end_file_name|><|fim▁begin|>/* * TrxFormController.java * * Created on Jan 9, 2010 8:22:32 PM * * Copyright (c) 2002 - 2010 : Swayam Inc. * * P R O P R I E T A R Y & C O N F I D E N T I A L * * The copyright of this document is vested in Swayam Inc. without * whose prior written permission its contents must not be published, * adapted or reproduced in any form or disclosed or * issued to any third party. */ package com.swayam.ims.webapp.controller.trx; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.Controller; /** * <|fim▁hole|> */ public abstract class TrxFormController implements Controller { final TrxModeIndicator modeIndicator; private String formView; public TrxFormController(TrxModeIndicator modeIndicator) { this.modeIndicator = modeIndicator; } public final void setFormView(String formView) { this.formView = formView; } public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { ModelAndView modelNView = new ModelAndView(formView); modelNView.addObject("isPurchaseMode", modeIndicator.isPurchaseMode()); return modelNView; } }<|fim▁end|>
* @author paawak
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django.utils.translation import ugettext_lazy as _ugl <|fim▁hole|><|fim▁end|>
default_app_config = 'django_sendgrid_parse.apps.DjangoSendgridParseAppConfig'
<|file_name|>all_10.js<|end_file_name|><|fim▁begin|>var searchData= [ ['textobject',['TextObject',['../class_oxy_1_1_framework_1_1_objects_1_1_text_object.html',1,'Oxy::Framework::Objects']]], ['textrenderer',['TextRenderer',['../class_oxy_1_1_framework_1_1_text_renderer.html',1,'Oxy::Framework']]], ['textrenderer',['TextRenderer',['../class_oxy_1_1_framework_1_1_text_renderer.html#aaefdc30b6a2d1b161cf9561092425ea6',1,'Oxy::Framework::TextRenderer']]], ['texture',['Texture',['../class_oxy_1_1_framework_1_1_text_renderer.html#a8f88234b584876dbbdb015c3e1d4636b',1,'Oxy::Framework::TextRenderer']]],<|fim▁hole|><|fim▁end|>
['translate',['Translate',['../class_oxy_1_1_framework_1_1_graphics.html#ac854767976984446279c8cfbc04f2099',1,'Oxy::Framework::Graphics']]] ];
<|file_name|>facebook-login.service.spec.ts<|end_file_name|><|fim▁begin|>import { HttpClientTestingModule } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; import { UserService } from '../core/user/user.service'; import { FacebookLoginService } from './facebook-login.service'; class MockUserService { setLoginData = jasmine.createSpy(); }<|fim▁hole|> describe('FacebookLoginService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [HttpClientTestingModule], providers: [ FacebookLoginService, { provide: UserService, useClass: MockUserService } ] }); }); it('should be created', inject([FacebookLoginService], (service: FacebookLoginService) => { expect(service).toBeTruthy(); })); });<|fim▁end|>
<|file_name|>MathUtil.java<|end_file_name|><|fim▁begin|>/* * Copyright 2013 Google Inc. * * 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<|fim▁hole|> * 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.google.maps.android; import static java.lang.Math.*; /** * Utility functions that are used my both PolyUtil and SphericalUtil. */ class MathUtil { /** * The earth's radius, in meters. * Mean radius as defined by IUGG. */ static final double EARTH_RADIUS = 6371009; /** * Restrict x to the range [low, high]. */ static double clamp(double x, double low, double high) { return x < low ? low : (x > high ? high : x); } /** * Wraps the given value into the inclusive-exclusive interval between min and max. * @param n The value to wrap. * @param min The minimum. * @param max The maximum. */ static double wrap(double n, double min, double max) { return (n >= min && n < max) ? n : (mod(n - min, max - min) + min); } /** * Returns the non-negative remainder of x / m. * @param x The operand. * @param m The modulus. */ static double mod(double x, double m) { return ((x % m) + m) % m; } /** * Returns mercator Y corresponding to latitude. * See http://en.wikipedia.org/wiki/Mercator_projection . */ static double mercator(double lat) { return log(tan(lat * 0.5 + PI/4)); } /** * Returns latitude from mercator Y. */ static double inverseMercator(double y) { return 2 * atan(exp(y)) - PI / 2; } /** * Returns haversine(angle-in-radians). * hav(x) == (1 - cos(x)) / 2 == sin(x / 2)^2. */ static double hav(double x) { double sinHalf = sin(x * 0.5); return sinHalf * sinHalf; } /** * Computes inverse haversine. Has good numerical stability around 0. * arcHav(x) == acos(1 - 2 * x) == 2 * asin(sqrt(x)). * The argument must be in [0, 1], and the result is positive. */ static double arcHav(double x) { return 2 * asin(sqrt(x)); } // Given h==hav(x), returns sin(abs(x)). static double sinFromHav(double h) { return 2 * sqrt(h * (1 - h)); } // Returns hav(asin(x)). static double havFromSin(double x) { double x2 = x * x; return x2 / (1 + sqrt(1 - x2)) * .5; } // Returns sin(arcHav(x) + arcHav(y)). static double sinSumFromHav(double x, double y) { double a = sqrt(x * (1 - x)); double b = sqrt(y * (1 - y)); return 2 * (a + b - 2 * (a * y + b * x)); } /** * Returns hav() of distance from (lat1, lng1) to (lat2, lng2) on the unit sphere. */ static double havDistance(double lat1, double lat2, double dLng) { return hav(lat1 - lat2) + hav(dLng) * cos(lat1) * cos(lat2); } }<|fim▁end|>
* * Unless required by applicable law or agreed to in writing, software
<|file_name|>objdump.rs<|end_file_name|><|fim▁begin|>extern crate capstone; extern crate macho; use capstone::prelude::*; use std::env; use std::fs; use std::io::Read; use std::process; fn main() { let cs = Capstone::new() .x86() .mode(arch::x86::ArchMode::Mode64) .build() .expect("Failed to create capstone handle"); let args: Vec<_> = env::args().collect(); if args.len() != 2 { println!("Usage: {} <file>", args[0]); return; } let mut fh = fs::File::open(&args[1]).unwrap(); let mut buf: Vec<u8> = Vec::new(); let _ = fh.read_to_end(&mut buf); let header = macho::MachObject::parse(&buf[..]).unwrap(); // Find the text segment for segment in header.segments { if segment.segname == "__TEXT" { for section in segment.sections { if section.sectname == "__text" { let text = &buf[section.offset as usize ..(u64::from(section.offset) + section.size) as usize];<|fim▁hole|> match cs.disasm_all(text, section.addr) { Ok(insns) => { println!("Got {} instructions", insns.len()); for i in insns.iter() { println!("{}", i); } } Err(err) => { println!("Error: {}", err); process::exit(1); } } return; } } } } panic!("No __TEXT segment"); }<|fim▁end|>
<|file_name|>VRSS.cpp<|end_file_name|><|fim▁begin|>/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program 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 for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "simulation/ElementsCommon.h" int VIRS_update(UPDATE_FUNC_ARGS); int VRSS_graphics(GRAPHICS_FUNC_ARGS) { *pixel_mode |= NO_DECO; return 1; } void VRSS_init_element(ELEMENT_INIT_FUNC_ARGS) { elem->Identifier = "DEFAULT_PT_VRSS"; elem->Name = "VRSS"; elem->Colour = COLPACK(0xD408CD); elem->MenuVisible = 0; elem->MenuSection = SC_SOLIDS; elem->Enabled = 1; elem->Advection = 0.0f; elem->AirDrag = 0.00f * CFDS; elem->AirLoss = 0.90f; elem->Loss = 0.00f; elem->Collision = 0.0f; elem->Gravity = 0.0f; elem->Diffusion = 0.00f; elem->HotAir = 0.000f * CFDS; elem->Falldown = 0; elem->Flammable = 0; elem->Explosive = 0; elem->Meltable = 0; elem->Hardness = 1; elem->Weight = 100; elem->DefaultProperties.temp = R_TEMP + 273.15f; elem->HeatConduct = 251; elem->Latent = 0; elem->Description = "Solid Virus. Turns everything it touches into virus."; elem->State = ST_SOLID; elem->Properties = TYPE_SOLID; elem->LowPressureTransitionThreshold = IPL; elem->LowPressureTransitionElement = NT; elem->HighPressureTransitionThreshold = IPH; elem->HighPressureTransitionElement = NT; elem->LowTemperatureTransitionThreshold = ITL; elem->LowTemperatureTransitionElement = NT; elem->HighTemperatureTransitionThreshold = 305.0f; elem->HighTemperatureTransitionElement = PT_VIRS; elem->DefaultProperties.pavg[1] = 250;<|fim▁hole|>}<|fim▁end|>
elem->Update = &VIRS_update; elem->Graphics = &VRSS_graphics; elem->Init = &VRSS_init_element;
<|file_name|>0008_auto_20161209_0129.py<|end_file_name|><|fim▁begin|><|fim▁hole|># -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-12-09 01:29 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [("hordak", "0007_auto_20161209_0111")] operations = [ migrations.RenameField("Account", "has_statements", "is_bank_account") ]<|fim▁end|>
<|file_name|>iotrace-test.cc<|end_file_name|><|fim▁begin|>#include "config.h" #include <arki/tests/tests.h> #include <arki/iotrace.h> namespace { using namespace std; using namespace arki; using namespace arki::tests; class Tests : public TestCase { using TestCase::TestCase; void register_tests() override; } test("arki_iotrace"); void Tests::register_tests() { add_method("empty", [] { }); }<|fim▁hole|>}<|fim▁end|>
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>from rest_framework import serializers from models import SurveyDraft from taggit.models import Tag class WritableJSONField(serializers.Field): """ Serializer for JSONField -- required to make field writable""" """ ALSO REQUIRED because the default JSONField serialization includes the `u` prefix on strings when running Django 1.8, resulting in invalid JSON """ def __init__(self, **kwargs): self.allow_blank= kwargs.pop('allow_blank', False) super(WritableJSONField, self).__init__(**kwargs) def to_internal_value(self, data): if (not data) and (not self.required): return None else: try: return json.loads(data) except Exception as e: raise serializers.ValidationError( u'Unable to parse JSON: {}'.format(e)) def to_representation(self, value): return value class ListSurveyDraftSerializer(serializers.HyperlinkedModelSerializer):<|fim▁hole|> summary = WritableJSONField(required=False) class DetailSurveyDraftSerializer(serializers.HyperlinkedModelSerializer): tags = serializers.SerializerMethodField('get_tag_names') summary = WritableJSONField(required=False) class Meta: model = SurveyDraft fields = ('id', 'name', 'body', 'summary', 'date_modified', 'description', 'tags') def get_tag_names(self, obj): return obj.tags.names() class TagSerializer(serializers.HyperlinkedModelSerializer): count = serializers.SerializerMethodField() label = serializers.CharField(source='name') class Meta: model = Tag fields = ('id', 'label', 'count') def get_count(self, obj): return SurveyDraft.objects.filter(tags__name__in=[obj.name])\ .filter(user=self.context.get('request', None).user)\ .filter(asset_type='question')\ .count()<|fim▁end|>
class Meta: model = SurveyDraft fields = ('id', 'name', 'asset_type', 'summary', 'date_modified', 'description')
<|file_name|>PostDeleteEventListenerImpl.java<|end_file_name|><|fim▁begin|>package org.hivedb.hibernate.simplified; import org.apache.log4j.Logger; import org.hibernate.HibernateException; import org.hibernate.action.Executable; import org.hibernate.event.PostDeleteEvent; import org.hibernate.event.PostDeleteEventListener; import org.hivedb.Hive; import org.hivedb.HiveLockableException; import org.hivedb.configuration.EntityConfig; import org.hivedb.configuration.EntityHiveConfig; import org.hivedb.hibernate.HiveIndexer; import org.hivedb.util.classgen.ReflectionTools; import org.hivedb.util.functional.Transform; import org.hivedb.util.functional.Unary; import java.io.Serializable; /** * This is an alternative way of deleting the hive indexes after successful * transaction completion (instead of using a custom Interceptor) and up * for discussion. Hooked up via org.hibernate.cfg.Configuration. * getEventListeners().setPostDeleteEventListeners * * @author mellwanger */ public class PostDeleteEventListenerImpl implements PostDeleteEventListener { private static final Logger log = Logger.getLogger(PostInsertEventListenerImpl.class); private final EntityHiveConfig hiveConfig; private final HiveIndexer indexer; public PostDeleteEventListenerImpl(EntityHiveConfig hiveConfig, Hive hive) { this.hiveConfig = hiveConfig; indexer = new HiveIndexer(hive); } public void onPostDelete(final PostDeleteEvent event) { event.getSession().getActionQueue().execute(new Executable() { public void afterTransactionCompletion(boolean success) { if (success) { deleteIndexes(event.getEntity()); } } public void beforeExecutions() throws HibernateException { // TODO Auto-generated method stub } public void execute() throws HibernateException { // TODO Auto-generated method stub } public Serializable[] getPropertySpaces() { // TODO Auto-generated method stub return null; } public boolean hasAfterTransactionCompletion() { return true; } }); } @SuppressWarnings("unchecked") private Class resolveEntityClass(Class clazz) { return ReflectionTools.whichIsImplemented( clazz, Transform.map(new Unary<EntityConfig, Class>() { public Class f(EntityConfig entityConfig) { return entityConfig.getRepresentedInterface(); } }, hiveConfig.getEntityConfigs())); } private void deleteIndexes(Object entity) {<|fim▁hole|> final Class<?> resolvedEntityClass = resolveEntityClass(entity.getClass()); if (resolvedEntityClass != null) indexer.delete(hiveConfig.getEntityConfig(entity.getClass()), entity); } catch (HiveLockableException e) { log.warn(e); } } }<|fim▁end|>
try {
<|file_name|>geo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # encoding: utf-8 import os import geoip2.database from geoip2.errors import AddressNotFoundError from cortexutils.analyzer import Analyzer class MaxMindAnalyzer(Analyzer): def dump_city(self, city): return { 'confidence': city.confidence, 'geoname_id': city.geoname_id, 'name': city.name, 'names': city.names } def dump_continent(self, continent): return { 'code': continent.code, 'geoname_id': continent.geoname_id, 'name': continent.name, 'names': continent.names, } def dump_country(self, country): return { 'confidence': country.confidence, 'geoname_id': country.geoname_id, 'iso_code': country.iso_code, 'name': country.name, 'names': country.names } def dump_location(self, location): return { 'accuracy_radius': location.accuracy_radius,<|fim▁hole|> } def dump_traits(self, traits): return { 'autonomous_system_number': traits.autonomous_system_number, 'autonomous_system_organization': traits.autonomous_system_organization, 'domain': traits.domain, 'ip_address': traits.ip_address, 'is_anonymous_proxy': traits.is_anonymous_proxy, 'is_satellite_provider': traits.is_satellite_provider, 'isp': traits.isp, 'organization': traits.organization, 'user_type': traits.user_type } def summary(self, raw): taxonomies = [] level = "info" namespace = "MaxMind" predicate = "Location" if "continent" in raw: value = "{}/{}".format(raw["country"]["name"], raw["continent"]["name"]) taxonomies.append(self.build_taxonomy(level, namespace, predicate, value)) return {"taxonomies": taxonomies} def run(self): Analyzer.run(self) if self.data_type == 'ip': try: data = self.get_data() city = geoip2.database.Reader(os.path.dirname(__file__) + '/GeoLite2-City.mmdb').city(data) self.report({ 'city': self.dump_city(city.city), 'continent': self.dump_continent(city.continent), 'country': self.dump_country(city.country), 'location': self.dump_location(city.location), 'registered_country': self.dump_country(city.registered_country), 'represented_country': self.dump_country(city.represented_country), 'subdivisions': self.dump_country(city.subdivisions.most_specific), 'traits': self.dump_traits(city.traits) }) except ValueError as e: self.error('Invalid IP address') except AddressNotFoundError as e: self.error('Unknown IP address') except Exception as e: self.unexpectedError(type(e)) else: self.notSupported() if __name__ == '__main__': MaxMindAnalyzer().run()<|fim▁end|>
'latitude': location.latitude, 'longitude': location.longitude, 'metro_code': location.metro_code, 'time_zone': location.time_zone
<|file_name|>properties.mako.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // This file is a Mako template: http://www.makotemplates.org/ // Please note that valid Rust syntax may be mangled by the Mako parser. // For example, Vec<&Foo> will be mangled as Vec&Foo>. To work around these issues, the code // can be escaped. In the above example, Vec<<&Foo> or Vec< &Foo> achieves the desired result of Vec<&Foo>. <%namespace name="helpers" file="/helpers.mako.rs" /> #[cfg(feature = "servo")] use app_units::Au; use servo_arc::{Arc, UniqueArc}; use std::borrow::Cow; use std::collections::HashSet; use std::{fmt, mem, ops}; #[cfg(feature = "gecko")] use std::ptr; #[cfg(feature = "servo")] use cssparser::RGBA; use cssparser::{Parser, TokenSerializationType, serialize_identifier}; use cssparser::ParserInput; #[cfg(feature = "servo")] use euclid::SideOffsets2D; use computed_values; use context::QuirksMode; use error_reporting::NullReporter; use font_metrics::FontMetricsProvider; #[cfg(feature = "gecko")] use gecko_bindings::bindings; #[cfg(feature = "gecko")] use gecko_bindings::structs::{self, nsCSSPropertyID}; #[cfg(feature = "servo")] use logical_geometry::{LogicalMargin, PhysicalSide}; use logical_geometry::WritingMode; use media_queries::Device; use parser::ParserContext; use properties::animated_properties::AnimatableLonghand; #[cfg(feature = "gecko")] use properties::longhands::system_font::SystemFont; use selector_parser::PseudoElement; use selectors::parser::SelectorParseError; #[cfg(feature = "servo")] use servo_config::prefs::PREFS; use shared_lock::StylesheetGuards; use style_traits::{PARSING_MODE_DEFAULT, HasViewportPercentage, ToCss, ParseError}; use style_traits::{PropertyDeclarationParseError, StyleParseError, ValueParseError}; use stylesheets::{CssRuleType, MallocSizeOf, MallocSizeOfFn, Origin, UrlExtraData}; #[cfg(feature = "servo")] use values::Either; use values::generics::text::LineHeight; use values::computed; use values::computed::NonNegativeAu; use cascade_info::CascadeInfo; use rule_tree::{CascadeLevel, StrongRuleNode}; use self::computed_value_flags::ComputedValueFlags; use style_adjuster::StyleAdjuster; #[cfg(feature = "servo")] use values::specified::BorderStyle; pub use self::declaration_block::*; #[cfg(feature = "gecko")] #[macro_export] macro_rules! property_name { ($s: tt) => { atom!($s) } } #[cfg(feature = "gecko")] macro_rules! impl_bitflags_conversions { ($name: ident) => { impl From<u8> for $name { fn from(bits: u8) -> $name { $name::from_bits(bits).expect("bits contain valid flag") } } impl From<$name> for u8 { fn from(v: $name) -> u8 { v.bits() } } }; } <%! from data import Method, Keyword, to_rust_ident, to_camel_case, SYSTEM_FONT_LONGHANDS import os.path %> #[path="${repr(os.path.join(os.path.dirname(__file__), 'computed_value_flags.rs'))[1:-1]}"] pub mod computed_value_flags; #[path="${repr(os.path.join(os.path.dirname(__file__), 'declaration_block.rs'))[1:-1]}"] pub mod declaration_block; /// Conversion with fewer impls than From/Into pub trait MaybeBoxed<Out> { /// Convert fn maybe_boxed(self) -> Out; } /// This is where we store extra font data while /// while computing font sizes. #[derive(Clone, Debug)] pub struct FontComputationData { /// font-size keyword values (and font-size-relative values applied /// to keyword values) need to preserve their identity as originating /// from keywords and relative font sizes. We store this information /// out of band in the ComputedValues. When None, the font size on the /// current struct was computed from a value that was not a keyword /// or a chain of font-size-relative values applying to successive parents /// terminated by a keyword. When Some, this means the font-size was derived /// from a keyword value or a keyword value on some ancestor with only /// font-size-relative keywords and regular inheritance in between. The /// integer stores the final ratio of the chain of font size relative values. /// and is 1 when there was just a keyword and no relative values. /// /// When this is Some, we compute font sizes by computing the keyword against /// the generic font, and then multiplying it by the ratio. pub font_size_keyword: Option<(longhands::font_size::KeywordSize, f32)> } impl FontComputationData { /// Assigns values for variables in struct FontComputationData pub fn new(font_size_keyword: Option<(longhands::font_size::KeywordSize, f32)>) -> Self { FontComputationData { font_size_keyword: font_size_keyword } } /// Assigns default values for variables in struct FontComputationData pub fn default_font_size_keyword() -> Option<(longhands::font_size::KeywordSize, f32)> { Some((Default::default(), 1.)) } /// Gets a FontComputationData with the default values. pub fn default_values() -> Self { Self::new(Self::default_font_size_keyword()) } } impl<T> MaybeBoxed<T> for T { #[inline] fn maybe_boxed(self) -> T { self } } impl<T> MaybeBoxed<Box<T>> for T { #[inline] fn maybe_boxed(self) -> Box<T> { Box::new(self) } } macro_rules! expanded { ( $( $name: ident: $value: expr ),+ ) => { expanded!( $( $name: $value, )+ ) }; ( $( $name: ident: $value: expr, )+ ) => { Longhands { $( $name: MaybeBoxed::maybe_boxed($value), )+ } } } /// A module with all the code for longhand properties. #[allow(missing_docs)] pub mod longhands { <%include file="/longhand/background.mako.rs" /> <%include file="/longhand/border.mako.rs" /> <%include file="/longhand/box.mako.rs" /> <%include file="/longhand/color.mako.rs" /> <%include file="/longhand/column.mako.rs" /> <%include file="/longhand/counters.mako.rs" /> <%include file="/longhand/effects.mako.rs" /> <%include file="/longhand/font.mako.rs" /> <%include file="/longhand/inherited_box.mako.rs" /> <%include file="/longhand/inherited_table.mako.rs" /> <%include file="/longhand/inherited_text.mako.rs" /> <%include file="/longhand/list.mako.rs" /> <%include file="/longhand/margin.mako.rs" /> <%include file="/longhand/outline.mako.rs" /> <%include file="/longhand/padding.mako.rs" /> <%include file="/longhand/pointing.mako.rs" /> <%include file="/longhand/position.mako.rs" /> <%include file="/longhand/table.mako.rs" /> <%include file="/longhand/text.mako.rs" /> <%include file="/longhand/ui.mako.rs" /> <%include file="/longhand/inherited_svg.mako.rs" /> <%include file="/longhand/svg.mako.rs" /> <%include file="/longhand/xul.mako.rs" /> } macro_rules! unwrap_or_initial { ($prop: ident) => (unwrap_or_initial!($prop, $prop)); ($prop: ident, $expr: expr) => ($expr.unwrap_or_else(|| $prop::get_initial_specified_value())); } /// A module with code for all the shorthand css properties, and a few /// serialization helpers. #[allow(missing_docs)] pub mod shorthands { use cssparser::Parser; use parser::{Parse, ParserContext}; use style_traits::{ParseError, StyleParseError}; use values::specified; <%include file="/shorthand/serialize.mako.rs" /> <%include file="/shorthand/background.mako.rs" /> <%include file="/shorthand/border.mako.rs" /> <%include file="/shorthand/box.mako.rs" /> <%include file="/shorthand/column.mako.rs" /> <%include file="/shorthand/font.mako.rs" /> <%include file="/shorthand/inherited_text.mako.rs" /> <%include file="/shorthand/list.mako.rs" /> <%include file="/shorthand/margin.mako.rs" /> <%include file="/shorthand/mask.mako.rs" /> <%include file="/shorthand/outline.mako.rs" /> <%include file="/shorthand/padding.mako.rs" /> <%include file="/shorthand/position.mako.rs" /> <%include file="/shorthand/inherited_svg.mako.rs" /> <%include file="/shorthand/text.mako.rs" /> // We don't defined the 'all' shorthand using the regular helpers:shorthand // mechanism, since it causes some very large types to be generated. <% data.declare_shorthand("all", [p.name for p in data.longhands if p.name not in ['direction', 'unicode-bidi']], spec="https://drafts.csswg.org/css-cascade-3/#all-shorthand") %> } /// A module with all the code related to animated properties. /// /// This needs to be "included" by mako at least after all longhand modules, /// given they populate the global data. pub mod animated_properties { <%include file="/helpers/animated_properties.mako.rs" /> } /// A longhand or shorthand porperty #[derive(Copy, Clone, Debug)] pub struct NonCustomPropertyId(usize); impl From<LonghandId> for NonCustomPropertyId { fn from(id: LonghandId) -> Self { NonCustomPropertyId(id as usize) } } impl From<ShorthandId> for NonCustomPropertyId { fn from(id: ShorthandId) -> Self { NonCustomPropertyId((id as usize) + ${len(data.longhands)}) } } /// A set of longhand properties #[derive(Clone, PartialEq)] pub struct NonCustomPropertyIdSet { storage: [u32; (${len(data.longhands) + len(data.shorthands)} - 1 + 32) / 32] } impl NonCustomPropertyIdSet { /// Return whether the given property is in the set #[inline] pub fn contains(&self, id: NonCustomPropertyId) -> bool { let bit = id.0; (self.storage[bit / 32] & (1 << (bit % 32))) != 0 } } <%def name="static_non_custom_property_id_set(name, is_member)"> static ${name}: NonCustomPropertyIdSet = NonCustomPropertyIdSet { <% storage = [0] * ((len(data.longhands) + len(data.shorthands) - 1 + 32) / 32) for i, property in enumerate(data.longhands + data.shorthands): if is_member(property): storage[i / 32] |= 1 << (i % 32) %> storage: [${", ".join("0x%x" % word for word in storage)}] }; </%def> <%def name="static_longhand_id_set(name, is_member)"> static ${name}: LonghandIdSet = LonghandIdSet { <% storage = [0] * ((len(data.longhands) - 1 + 32) / 32) for i, property in enumerate(data.longhands): if is_member(property): storage[i / 32] |= 1 << (i % 32) %> storage: [${", ".join("0x%x" % word for word in storage)}] }; </%def> /// A set of longhand properties #[derive(Clone, PartialEq)] pub struct LonghandIdSet { storage: [u32; (${len(data.longhands)} - 1 + 32) / 32] } impl LonghandIdSet { /// Create an empty set #[inline] pub fn new() -> LonghandIdSet { LonghandIdSet { storage: [0; (${len(data.longhands)} - 1 + 32) / 32] } } /// Return whether the given property is in the set #[inline] pub fn contains(&self, id: LonghandId) -> bool { let bit = id as usize; (self.storage[bit / 32] & (1 << (bit % 32))) != 0 } /// Add the given property to the set #[inline] pub fn insert(&mut self, id: LonghandId) { let bit = id as usize; self.storage[bit / 32] |= 1 << (bit % 32); } /// Remove the given property from the set #[inline] pub fn remove(&mut self, id: LonghandId) { let bit = id as usize; self.storage[bit / 32] &= !(1 << (bit % 32)); } /// Clear all bits #[inline] pub fn clear(&mut self) { for cell in &mut self.storage { *cell = 0 } } /// Set the corresponding bit of AnimatableLonghand. pub fn set_animatable_longhand_bit(&mut self, property: &AnimatableLonghand) { match *property { % for prop in data.longhands: % if prop.animatable: AnimatableLonghand::${prop.camel_case} => self.insert(LonghandId::${prop.camel_case}), % endif % endfor } } /// Return true if the corresponding bit of AnimatableLonghand is set. pub fn has_animatable_longhand_bit(&self, property: &AnimatableLonghand) -> bool { match *property { % for prop in data.longhands: % if prop.animatable: AnimatableLonghand::${prop.camel_case} => self.contains(LonghandId::${prop.camel_case}), % endif % endfor } } } /// A specialized set of PropertyDeclarationId pub struct PropertyDeclarationIdSet { longhands: LonghandIdSet, // FIXME: Use a HashSet instead? This Vec is usually small, so linear scan might be ok. custom: Vec<::custom_properties::Name>, } impl PropertyDeclarationIdSet { /// Empty set pub fn new() -> Self { PropertyDeclarationIdSet { longhands: LonghandIdSet::new(), custom: Vec::new(), } } /// Returns whether the given ID is in the set pub fn contains(&mut self, id: PropertyDeclarationId) -> bool { match id { PropertyDeclarationId::Longhand(id) => self.longhands.contains(id), PropertyDeclarationId::Custom(name) => self.custom.contains(name), } } /// Insert the given ID in the set pub fn insert(&mut self, id: PropertyDeclarationId) { match id { PropertyDeclarationId::Longhand(id) => self.longhands.insert(id), PropertyDeclarationId::Custom(name) => { if !self.custom.contains(name) { self.custom.push(name.clone()) } } } } } /// An enum to represent a CSS Wide keyword. #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[derive(Copy, Clone, Debug, Eq, PartialEq, ToCss)] pub enum CSSWideKeyword { /// The `initial` keyword. Initial, /// The `inherit` keyword. Inherit, /// The `unset` keyword. Unset, } impl CSSWideKeyword { fn to_str(&self) -> &'static str { match *self { CSSWideKeyword::Initial => "initial", CSSWideKeyword::Inherit => "inherit", CSSWideKeyword::Unset => "unset", } } /// Takes the result of cssparser::Parser::expect_ident() and converts it /// to a CSSWideKeyword. pub fn from_ident<'i>(ident: &str) -> Option<Self> { match_ignore_ascii_case! { ident, // If modifying this set of keyword, also update values::CustomIdent::from_ident "initial" => Some(CSSWideKeyword::Initial), "inherit" => Some(CSSWideKeyword::Inherit), "unset" => Some(CSSWideKeyword::Unset), _ => None } } } impl CSSWideKeyword { fn parse(input: &mut Parser) -> Result<Self, ()> { let ident = input.expect_ident().map_err(|_| ())?.clone(); input.expect_exhausted().map_err(|_| ())?; CSSWideKeyword::from_ident(&ident).ok_or(()) } } bitflags! { /// A set of flags for properties. pub flags PropertyFlags: u8 { /// This property requires a stacking context. const CREATES_STACKING_CONTEXT = 1 << 0, /// This property has values that can establish a containing block for /// fixed positioned and absolutely positioned elements. const FIXPOS_CB = 1 << 1, /// This property has values that can establish a containing block for /// absolutely positioned elements. const ABSPOS_CB = 1 << 2, /// This shorthand property is an alias of another property. const SHORTHAND_ALIAS_PROPERTY = 1 << 3, /// This longhand property applies to ::first-letter. const APPLIES_TO_FIRST_LETTER = 1 << 4, /// This longhand property applies to ::first-line. const APPLIES_TO_FIRST_LINE = 1 << 5, /// This longhand property applies to ::placeholder. const APPLIES_TO_PLACEHOLDER = 1 << 6, } } /// An identifier for a given longhand property. #[derive(Clone, Copy, Eq, PartialEq, Debug)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum LonghandId { % for i, property in enumerate(data.longhands): /// ${property.name} ${property.camel_case} = ${i}, % endfor } impl LonghandId { /// Get the name of this longhand property. pub fn name(&self) -> &'static str { match *self { % for property in data.longhands: LonghandId::${property.camel_case} => "${property.name}", % endfor } } fn inherited(&self) -> bool { ${static_longhand_id_set("INHERITED", lambda p: p.style_struct.inherited)} INHERITED.contains(*self) } fn shorthands(&self) -> &'static [ShorthandId] { // first generate longhand to shorthands lookup map // // NOTE(emilio): This currently doesn't exclude the "all" shorthand. It // could potentially do so, which would speed up serialization // algorithms and what not, I guess. <% longhand_to_shorthand_map = {} for shorthand in data.shorthands: for sub_property in shorthand.sub_properties: if sub_property.ident not in longhand_to_shorthand_map: longhand_to_shorthand_map[sub_property.ident] = [] longhand_to_shorthand_map[sub_property.ident].append(shorthand.camel_case) for shorthand_list in longhand_to_shorthand_map.itervalues(): shorthand_list.sort() %> // based on lookup results for each longhand, create result arrays % for property in data.longhands: static ${property.ident.upper()}: &'static [ShorthandId] = &[ % for shorthand in longhand_to_shorthand_map.get(property.ident, []): ShorthandId::${shorthand}, % endfor ]; % endfor match *self { % for property in data.longhands: LonghandId::${property.camel_case} => ${property.ident.upper()}, % endfor } } fn parse_value<'i, 't>(&self, context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<PropertyDeclaration, ParseError<'i>> { match *self { % for property in data.longhands: LonghandId::${property.camel_case} => { % if not property.derived_from: longhands::${property.ident}::parse_declared(context, input) % else: Err(PropertyDeclarationParseError::UnknownProperty("${property.ident}".into()).into()) % endif } % endfor } } /// If this is a logical property, return the corresponding physical one in the given writing mode. /// Otherwise, return unchanged. pub fn to_physical(&self, wm: WritingMode) -> Self { match *self { % for property in data.longhands: % if property.logical: LonghandId::${property.camel_case} => { <%helpers:logical_setter_helper name="${property.name}"> <%def name="inner(physical_ident)"> LonghandId::${to_camel_case(physical_ident)} </%def> </%helpers:logical_setter_helper> } % endif % endfor _ => *self } } /// Returns PropertyFlags for given longhand property. pub fn flags(&self) -> PropertyFlags { match *self { % for property in data.longhands: LonghandId::${property.camel_case} => % for flag in property.flags: ${flag} | % endfor PropertyFlags::empty(), % endfor } } /// Only a few properties are allowed to depend on the visited state of /// links. When cascading visited styles, we can save time by only /// processing these properties. fn is_visited_dependent(&self) -> bool { matches!(*self, % if product == "gecko": LonghandId::ColumnRuleColor | LonghandId::TextEmphasisColor | LonghandId::WebkitTextFillColor | LonghandId::WebkitTextStrokeColor | LonghandId::TextDecorationColor | LonghandId::Fill | LonghandId::Stroke | LonghandId::CaretColor | % endif LonghandId::Color | LonghandId::BackgroundColor | LonghandId::BorderTopColor | LonghandId::BorderRightColor | LonghandId::BorderBottomColor | LonghandId::BorderLeftColor | LonghandId::OutlineColor ) } /// Returns true if the property is one that is ignored when document /// colors are disabled. fn is_ignored_when_document_colors_disabled(&self) -> bool { matches!(*self, ${" | ".join([("LonghandId::" + p.camel_case) for p in data.longhands if p.ignored_when_colors_disabled])} ) } /// The computed value of some properties depends on the (sometimes /// computed) value of *other* properties. /// /// So we classify properties into "early" and "other", such that the only /// dependencies can be from "other" to "early". /// /// Unfortunately, it’s not easy to check that this classification is /// correct. fn is_early_property(&self) -> bool { matches!(*self, % if product == 'gecko': LonghandId::TextOrientation | LonghandId::AnimationName | LonghandId::TransitionProperty | LonghandId::XLang | LonghandId::XTextZoom | LonghandId::MozScriptLevel | LonghandId::MozMinFontSizeRatio | % endif LonghandId::FontSize | LonghandId::FontFamily | LonghandId::Color | LonghandId::TextDecorationLine | LonghandId::WritingMode | LonghandId::Direction ) } } /// An identifier for a given shorthand property. #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[derive(Clone, Copy, Debug, Eq, PartialEq, ToCss)] pub enum ShorthandId { % for property in data.shorthands: /// ${property.name} ${property.camel_case}, % endfor } impl ShorthandId { /// Get the name for this shorthand property. pub fn name(&self) -> &'static str { match *self { % for property in data.shorthands: ShorthandId::${property.camel_case} => "${property.name}", % endfor } } /// Get the longhand ids that form this shorthand. pub fn longhands(&self) -> &'static [LonghandId] { % for property in data.shorthands: static ${property.ident.upper()}: &'static [LonghandId] = &[ % for sub in property.sub_properties: LonghandId::${sub.camel_case}, % endfor ]; % endfor match *self { % for property in data.shorthands: ShorthandId::${property.camel_case} => ${property.ident.upper()}, % endfor } } /// Try to serialize the given declarations as this shorthand. /// /// Returns an error if writing to the stream fails, or if the declarations /// do not map to a shorthand. pub fn longhands_to_css<'a, W, I>(&self, declarations: I, dest: &mut W) -> fmt::Result where W: fmt::Write, I: Iterator<Item=&'a PropertyDeclaration>, { match *self { ShorthandId::All => { // No need to try to serialize the declarations as the 'all' // shorthand, since it only accepts CSS-wide keywords (and // variable references), which will be handled in // get_shorthand_appendable_value. Err(fmt::Error) } % for property in data.shorthands_except_all(): ShorthandId::${property.camel_case} => { match shorthands::${property.ident}::LonghandsToSerialize::from_iter(declarations) { Ok(longhands) => longhands.to_css(dest), Err(_) => Err(fmt::Error) } }, % endfor } } /// Finds and returns an appendable value for the given declarations. /// /// Returns the optional appendable value. pub fn get_shorthand_appendable_value<'a, I>(self, declarations: I) -> Option<AppendableValue<'a, I::IntoIter>> where I: IntoIterator<Item=&'a PropertyDeclaration>, I::IntoIter: Clone, { let declarations = declarations.into_iter(); // Only cloning iterators (a few pointers each) not declarations. let mut declarations2 = declarations.clone(); let mut declarations3 = declarations.clone(); let first_declaration = match declarations2.next() { Some(declaration) => declaration, None => return None }; // https://drafts.csswg.org/css-variables/#variables-in-shorthands if let Some(css) = first_declaration.with_variables_from_shorthand(self) { if declarations2.all(|d| d.with_variables_from_shorthand(self) == Some(css)) { return Some(AppendableValue::Css { css: css, with_variables: true, }); } return None; } // Check whether they are all the same CSS-wide keyword. if let Some(keyword) = first_declaration.get_css_wide_keyword() { if declarations2.all(|d| d.get_css_wide_keyword() == Some(keyword)) { return Some(AppendableValue::Css { css: keyword.to_str(), with_variables: false, }); } return None; } // Check whether all declarations can be serialized as part of shorthand. if declarations3.all(|d| d.may_serialize_as_part_of_shorthand()) { return Some(AppendableValue::DeclarationsForShorthand(self, declarations)); } None } /// Returns PropertyFlags for given shorthand property. pub fn flags(&self) -> PropertyFlags { match *self { % for property in data.shorthands: ShorthandId::${property.camel_case} => % for flag in property.flags: ${flag} | % endfor PropertyFlags::empty(), % endfor } } fn parse_into<'i, 't>(&self, declarations: &mut SourcePropertyDeclaration, context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<(), ParseError<'i>> { match *self { % for shorthand in data.shorthands_except_all(): ShorthandId::${shorthand.camel_case} => { shorthands::${shorthand.ident}::parse_into(declarations, context, input) } % endfor // 'all' accepts no value other than CSS-wide keywords ShorthandId::All => Err(StyleParseError::UnspecifiedError.into()) } } } /// Servo's representation of a declared value for a given `T`, which is the /// declared value for that property. #[derive(Clone, PartialEq, Eq, Debug)] pub enum DeclaredValue<'a, T: 'a> { /// A known specified value from the stylesheet. Value(&'a T), /// An unparsed value that contains `var()` functions. WithVariables(&'a Arc<UnparsedValue>), /// An CSS-wide keyword. CSSWideKeyword(CSSWideKeyword), } /// A variant of DeclaredValue that owns its data. This separation exists so /// that PropertyDeclaration can avoid embedding a DeclaredValue (and its /// extra discriminant word) and synthesize dependent DeclaredValues for /// PropertyDeclaration instances as needed. #[derive(Clone, PartialEq, Eq, Debug)] pub enum DeclaredValueOwned<T> { /// A known specified value from the stylesheet. Value(T), /// An unparsed value that contains `var()` functions. WithVariables(Arc<UnparsedValue>), /// An CSS-wide keyword. CSSWideKeyword(CSSWideKeyword), } impl<T> DeclaredValueOwned<T> { /// Creates a dependent DeclaredValue from this DeclaredValueOwned. fn borrow(&self) -> DeclaredValue<T> { match *self { DeclaredValueOwned::Value(ref v) => DeclaredValue::Value(v), DeclaredValueOwned::WithVariables(ref v) => DeclaredValue::WithVariables(v), DeclaredValueOwned::CSSWideKeyword(v) => DeclaredValue::CSSWideKeyword(v), } } } /// An unparsed property value that contains `var()` functions. #[derive(PartialEq, Eq, Debug)] pub struct UnparsedValue { /// The css serialization for this value. css: String, /// The first token type for this serialization. first_token_type: TokenSerializationType, /// The url data for resolving url values. url_data: UrlExtraData, /// The shorthand this came from. from_shorthand: Option<ShorthandId>, } impl UnparsedValue { fn substitute_variables(&self, longhand_id: LonghandId, custom_properties: &Option<Arc<::custom_properties::CustomPropertiesMap>>, quirks_mode: QuirksMode) -> PropertyDeclaration { ::custom_properties::substitute(&self.css, self.first_token_type, custom_properties) .ok() .and_then(|css| { // As of this writing, only the base URL is used for property values: let reporter = NullReporter; let context = ParserContext::new(Origin::Author, &self.url_data, &reporter, None, PARSING_MODE_DEFAULT, quirks_mode); let mut input = ParserInput::new(&css); Parser::new(&mut input).parse_entirely(|input| { match self.from_shorthand { None => longhand_id.parse_value(&context, input), Some(ShorthandId::All) => { // No need to parse the 'all' shorthand as anything other than a CSS-wide // keyword, after variable substitution. Err(SelectorParseError::UnexpectedIdent("all".into()).into()) } % for shorthand in data.shorthands_except_all(): Some(ShorthandId::${shorthand.camel_case}) => { shorthands::${shorthand.ident}::parse_value(&context, input) .map(|longhands| { match longhand_id { % for property in shorthand.sub_properties: LonghandId::${property.camel_case} => { PropertyDeclaration::${property.camel_case}( longhands.${property.ident} ) } % endfor _ => unreachable!() } }) } % endfor } }) .ok() }) .unwrap_or_else(|| { // Invalid at computed-value time. let keyword = if longhand_id.inherited() { CSSWideKeyword::Inherit } else { CSSWideKeyword::Initial }; PropertyDeclaration::CSSWideKeyword(longhand_id, keyword) }) } } impl<'a, T: HasViewportPercentage> HasViewportPercentage for DeclaredValue<'a, T> { fn has_viewport_percentage(&self) -> bool { match *self { DeclaredValue::Value(ref v) => v.has_viewport_percentage(), DeclaredValue::WithVariables(_) => { panic!("DeclaredValue::has_viewport_percentage without \ resolving variables!") }, DeclaredValue::CSSWideKeyword(_) => false, } } } impl<'a, T: ToCss> ToCss for DeclaredValue<'a, T> { fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write, { match *self { DeclaredValue::Value(ref inner) => inner.to_css(dest), DeclaredValue::WithVariables(ref with_variables) => { // https://drafts.csswg.org/css-variables/#variables-in-shorthands if with_variables.from_shorthand.is_none() { dest.write_str(&*with_variables.css)? } Ok(()) }, DeclaredValue::CSSWideKeyword(ref keyword) => keyword.to_css(dest), } } } /// An identifier for a given property declaration, which can be either a /// longhand or a custom property. #[derive(PartialEq, Clone, Copy)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum PropertyDeclarationId<'a> { /// A longhand. Longhand(LonghandId), /// A custom property declaration. Custom(&'a ::custom_properties::Name), } impl<'a> ToCss for PropertyDeclarationId<'a> { fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write, { match *self { PropertyDeclarationId::Longhand(id) => dest.write_str(id.name()), PropertyDeclarationId::Custom(_) => { serialize_identifier(&self.name(), dest) } } } } impl<'a> PropertyDeclarationId<'a> { /// Whether a given declaration id is either the same as `other`, or a /// longhand of it. pub fn is_or_is_longhand_of(&self, other: &PropertyId) -> bool { match *self { PropertyDeclarationId::Longhand(id) => { match *other { PropertyId::Longhand(other_id) => id == other_id, PropertyId::Shorthand(shorthand) => self.is_longhand_of(shorthand), PropertyId::Custom(_) => false, } } PropertyDeclarationId::Custom(name) => { matches!(*other, PropertyId::Custom(ref other_name) if name == other_name) } } } /// Whether a given declaration id is a longhand belonging to this /// shorthand. pub fn is_longhand_of(&self, shorthand: ShorthandId) -> bool { match *self { PropertyDeclarationId::Longhand(ref id) => id.shorthands().contains(&shorthand), _ => false, } } /// Returns the name of the property without CSS escaping. pub fn name(&self) -> Cow<'static, str> { match *self { PropertyDeclarationId::Longhand(id) => id.name().into(), PropertyDeclarationId::Custom(name) => { use std::fmt::Write; let mut s = String::new(); write!(&mut s, "--{}", name).unwrap(); s.into() } } } } /// Servo's representation of a CSS property, that is, either a longhand, a /// shorthand, or a custom property. #[derive(Eq, PartialEq, Clone)] pub enum PropertyId { /// A longhand property. Longhand(LonghandId), /// A shorthand property. Shorthand(ShorthandId), /// A custom property. Custom(::custom_properties::Name), } impl fmt::Debug for PropertyId { fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { self.to_css(formatter) } } impl ToCss for PropertyId { fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write, { match *self { PropertyId::Longhand(id) => dest.write_str(id.name()), PropertyId::Shorthand(id) => dest.write_str(id.name()), PropertyId::Custom(_) => { serialize_identifier(&self.name(), dest) } } } } impl PropertyId { /// Returns a given property from the string `s`. /// /// Returns Err(()) for unknown non-custom properties pub fn parse(property_name: &str) -> Result<Self, ()> { if let Ok(name) = ::custom_properties::parse_name(property_name) { return Ok(PropertyId::Custom(::custom_properties::Name::from(name))) } // FIXME(https://github.com/rust-lang/rust/issues/33156): remove this enum and use PropertyId // when stable Rust allows destructors in statics. pub enum StaticId { Longhand(LonghandId), Shorthand(ShorthandId), } ascii_case_insensitive_phf_map! { static_id -> StaticId = { % for (kind, properties) in [("Longhand", data.longhands), ("Shorthand", data.shorthands)]: % for property in properties: % for name in [property.name] + property.alias: "${name}" => StaticId::${kind}(${kind}Id::${property.camel_case}), % endfor % endfor % endfor } } match static_id(property_name) { Some(&StaticId::Longhand(id)) => Ok(PropertyId::Longhand(id)), Some(&StaticId::Shorthand(id)) => Ok(PropertyId::Shorthand(id)), None => Err(()), } } /// Returns a property id from Gecko's nsCSSPropertyID. #[cfg(feature = "gecko")] #[allow(non_upper_case_globals)] pub fn from_nscsspropertyid(id: nsCSSPropertyID) -> Result<Self, ()> { use gecko_bindings::structs::*; match id { % for property in data.longhands: ${helpers.to_nscsspropertyid(property.ident)} => { Ok(PropertyId::Longhand(LonghandId::${property.camel_case})) } % for alias in property.alias: ${helpers.alias_to_nscsspropertyid(alias)} => { Ok(PropertyId::Longhand(LonghandId::${property.camel_case})) } % endfor % endfor % for property in data.shorthands: ${helpers.to_nscsspropertyid(property.ident)} => { Ok(PropertyId::Shorthand(ShorthandId::${property.camel_case})) } % for alias in property.alias: ${helpers.alias_to_nscsspropertyid(alias)} => { Ok(PropertyId::Shorthand(ShorthandId::${property.camel_case})) } % endfor % endfor _ => Err(()) } } /// Returns an nsCSSPropertyID. #[cfg(feature = "gecko")] #[allow(non_upper_case_globals)] pub fn to_nscsspropertyid(&self) -> Result<nsCSSPropertyID, ()> { use gecko_bindings::structs::*; match *self { PropertyId::Longhand(id) => match id { % for property in data.longhands: LonghandId::${property.camel_case} => { Ok(${helpers.to_nscsspropertyid(property.ident)}) } % endfor }, PropertyId::Shorthand(id) => match id { % for property in data.shorthands: ShorthandId::${property.camel_case} => { Ok(${helpers.to_nscsspropertyid(property.ident)}) } % endfor }, _ => Err(()) } } /// Given this property id, get it either as a shorthand or as a /// `PropertyDeclarationId`. pub fn as_shorthand(&self) -> Result<ShorthandId, PropertyDeclarationId> { match *self { PropertyId::Shorthand(id) => Ok(id), PropertyId::Longhand(id) => Err(PropertyDeclarationId::Longhand(id)), PropertyId::Custom(ref name) => Err(PropertyDeclarationId::Custom(name)), } } /// Returns the name of the property without CSS escaping. pub fn name(&self) -> Cow<'static, str> { match *self { PropertyId::Shorthand(id) => id.name().into(), PropertyId::Longhand(id) => id.name().into(), PropertyId::Custom(ref name) => { use std::fmt::Write; let mut s = String::new(); write!(&mut s, "--{}", name).unwrap(); s.into() } } } fn check_allowed_in(&self, rule_type: CssRuleType, stylesheet_origin: Origin) -> Result<(), PropertyDeclarationParseError<'static>> { let id: NonCustomPropertyId; match *self { // Custom properties are allowed everywhere PropertyId::Custom(_) => return Ok(()), PropertyId::Shorthand(shorthand_id) => id = shorthand_id.into(), PropertyId::Longhand(longhand_id) => id = longhand_id.into(), } <% id_set = static_non_custom_property_id_set %> ${id_set("DISALLOWED_IN_KEYFRAME_BLOCK", lambda p: not p.allowed_in_keyframe_block)} ${id_set("DISALLOWED_IN_PAGE_RULE", lambda p: not p.allowed_in_page_rule)} match rule_type { CssRuleType::Keyframe if DISALLOWED_IN_KEYFRAME_BLOCK.contains(id) => { return Err(PropertyDeclarationParseError::AnimationPropertyInKeyframeBlock) } CssRuleType::Page if DISALLOWED_IN_PAGE_RULE.contains(id) => { return Err(PropertyDeclarationParseError::NotAllowedInPageRule) } _ => {} } // For properties that are experimental but not internal, the pref will // control its availability in all sheets. For properties that are // both experimental and internal, the pref only controls its // availability in non-UA sheets (and in UA sheets it is always available). ${id_set("INTERNAL", lambda p: p.internal)} % if product == "servo": ${id_set("EXPERIMENTAL", lambda p: p.experimental)} % endif % if product == "gecko": use gecko_bindings::structs::root::mozilla; static EXPERIMENTAL: NonCustomPropertyIdSet = NonCustomPropertyIdSet { <% grouped = [] properties = data.longhands + data.shorthands while properties: grouped.append(properties[:32]) properties = properties[32:] %> storage: [ % for group in grouped: (0 % for i, property in enumerate(group): | ((mozilla::SERVO_PREF_ENABLED_${property.gecko_pref_ident} as u32) << ${i}) % endfor ), % endfor ] }; % endif let passes_pref_check = || { % if product == "servo": static PREF_NAME: [Option< &str>; ${len(data.longhands) + len(data.shorthands)}] = [ % for property in data.longhands + data.shorthands: % if property.experimental: Some("${property.experimental}"), % else: None, % endif % endfor ]; match PREF_NAME[id.0] { None => true, Some(pref) => PREFS.get(pref).as_boolean().unwrap_or(false) } % endif % if product == "gecko": use gecko_bindings::structs; let id = self.to_nscsspropertyid().unwrap(); unsafe { structs::nsCSSProps_gPropertyEnabled[id as usize] } % endif }; if INTERNAL.contains(id) { if stylesheet_origin != Origin::UserAgent { if EXPERIMENTAL.contains(id) { if !passes_pref_check() { return Err(PropertyDeclarationParseError::ExperimentalProperty); } } else { return Err(PropertyDeclarationParseError::UnknownProperty(self.name().into())); } } } else { if EXPERIMENTAL.contains(id) && !passes_pref_check() { return Err(PropertyDeclarationParseError::ExperimentalProperty); } } Ok(()) } } /// Servo's representation for a property declaration. #[derive(PartialEq, Clone)] pub enum PropertyDeclaration { % for property in data.longhands: /// ${property.name} % if property.boxed: ${property.camel_case}(Box<longhands::${property.ident}::SpecifiedValue>), % else: ${property.camel_case}(longhands::${property.ident}::SpecifiedValue), % endif % endfor /// A css-wide keyword. CSSWideKeyword(LonghandId, CSSWideKeyword), /// An unparsed value that contains `var()` functions. WithVariables(LonghandId, Arc<UnparsedValue>), /// A custom property declaration, with the property name and the declared /// value. Custom(::custom_properties::Name, DeclaredValueOwned<Box<::custom_properties::SpecifiedValue>>), } impl HasViewportPercentage for PropertyDeclaration { fn has_viewport_percentage(&self) -> bool { match *self { % for property in data.longhands: PropertyDeclaration::${property.camel_case}(ref val) => { val.has_viewport_percentage() }, % endfor PropertyDeclaration::WithVariables(..) => { panic!("DeclaredValue::has_viewport_percentage without \ resolving variables!") }, PropertyDeclaration::CSSWideKeyword(..) => false, PropertyDeclaration::Custom(_, ref val) => { val.borrow().has_viewport_percentage() } } } } impl fmt::Debug for PropertyDeclaration { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.id().to_css(f)?; f.write_str(": ")?; self.to_css(f) } } impl ToCss for PropertyDeclaration { fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write, { match *self { % for property in data.longhands: % if not property.derived_from: PropertyDeclaration::${property.camel_case}(ref value) => value.to_css(dest), % endif % endfor PropertyDeclaration::CSSWideKeyword(_, keyword) => keyword.to_css(dest), PropertyDeclaration::WithVariables(_, ref with_variables) => { // https://drafts.csswg.org/css-variables/#variables-in-shorthands match with_variables.from_shorthand { // Normally, we shouldn't be printing variables here if they came from // shorthands. But we should allow properties that came from shorthand // aliases. That also matches with the Gecko behavior. Some(shorthand) if shorthand.flags().contains(SHORTHAND_ALIAS_PROPERTY) => dest.write_str(&*with_variables.css)?, None => dest.write_str(&*with_variables.css)?, _ => {}, } Ok(()) }, PropertyDeclaration::Custom(_, ref value) => value.borrow().to_css(dest), % if any(property.derived_from for property in data.longhands): _ => Err(fmt::Error), % endif } } } impl MallocSizeOf for PropertyDeclaration { fn malloc_size_of_children(&self, _malloc_size_of: MallocSizeOfFn) -> usize { // The variants of PropertyDeclaration mostly (entirely?) contain // scalars, so this is reasonable. 0 } } impl PropertyDeclaration { /// Given a property declaration, return the property declaration id. pub fn id(&self) -> PropertyDeclarationId { match *self { PropertyDeclaration::Custom(ref name, _) => { return PropertyDeclarationId::Custom(name) } PropertyDeclaration::CSSWideKeyword(id, _) | PropertyDeclaration::WithVariables(id, _) => { return PropertyDeclarationId::Longhand(id) } _ => {} } let longhand_id = match *self { % for property in data.longhands: PropertyDeclaration::${property.camel_case}(..) => { LonghandId::${property.camel_case} } % endfor PropertyDeclaration::CSSWideKeyword(..) |<|fim▁hole|> PropertyDeclaration::WithVariables(..) | PropertyDeclaration::Custom(..) => { debug_assert!(false, "unreachable"); // This value is never used, but having an expression of the same "shape" // as for other variants helps the optimizer compile this `match` expression // to a lookup table. LonghandId::BackgroundColor } }; PropertyDeclarationId::Longhand(longhand_id) } fn with_variables_from_shorthand(&self, shorthand: ShorthandId) -> Option< &str> { match *self { PropertyDeclaration::WithVariables(_, ref with_variables) => { if let Some(s) = with_variables.from_shorthand { if s == shorthand { Some(&*with_variables.css) } else { None } } else { // Normally, longhand property that doesn't come from a shorthand // should return None here. But we return Some to longhands if they // came from a shorthand alias. Because for example, we should be able to // get -moz-transform's value from transform. if shorthand.flags().contains(SHORTHAND_ALIAS_PROPERTY) { return Some(&*with_variables.css); } None } }, _ => None, } } /// Returns a CSS-wide keyword if the declaration's value is one. pub fn get_css_wide_keyword(&self) -> Option<CSSWideKeyword> { match *self { PropertyDeclaration::CSSWideKeyword(_, keyword) => Some(keyword), _ => None, } } /// Returns whether or not the property is set by a system font #[cfg(feature = "gecko")] pub fn get_system(&self) -> Option<SystemFont> { match *self { % for prop in SYSTEM_FONT_LONGHANDS: PropertyDeclaration::${to_camel_case(prop)}(ref prop) => { prop.get_system() } % endfor _ => None, } } /// Is it the default value of line-height? pub fn is_default_line_height(&self) -> bool { match *self { PropertyDeclaration::LineHeight(LineHeight::Normal) => true, _ => false } } #[cfg(feature = "servo")] /// Dummy method to avoid cfg()s pub fn get_system(&self) -> Option<()> { None } /// Returns whether the declaration may be serialized as part of a shorthand. /// /// This method returns false if this declaration contains variable or has a /// CSS-wide keyword value, since these values cannot be serialized as part /// of a shorthand. /// /// Caller should check `with_variables_from_shorthand()` and whether all /// needed declarations has the same CSS-wide keyword first. /// /// Note that, serialization of a shorthand may still fail because of other /// property-specific requirement even when this method returns true for all /// the longhand declarations. pub fn may_serialize_as_part_of_shorthand(&self) -> bool { match *self { PropertyDeclaration::CSSWideKeyword(..) | PropertyDeclaration::WithVariables(..) => false, PropertyDeclaration::Custom(..) => unreachable!("Serializing a custom property as part of shorthand?"), _ => true, } } /// Return whether the value is stored as it was in the CSS source, /// preserving whitespace (as opposed to being parsed into a more abstract /// data structure). /// /// This is the case of custom properties and values that contain /// unsubstituted variables. pub fn value_is_unparsed(&self) -> bool { match *self { PropertyDeclaration::WithVariables(..) => true, PropertyDeclaration::Custom(_, ref value) => { !matches!(value.borrow(), DeclaredValue::CSSWideKeyword(..)) } _ => false, } } /// The shorthands that this longhand is part of. pub fn shorthands(&self) -> &'static [ShorthandId] { match self.id() { PropertyDeclarationId::Longhand(id) => id.shorthands(), PropertyDeclarationId::Custom(..) => &[], } } /// Returns true if this property is one of the animable properties, false /// otherwise. pub fn is_animatable(&self) -> bool { match *self { % for property in data.longhands: PropertyDeclaration::${property.camel_case}(_) => { % if property.animatable: true % else: false % endif } % endfor PropertyDeclaration::CSSWideKeyword(id, _) | PropertyDeclaration::WithVariables(id, _) => match id { % for property in data.longhands: LonghandId::${property.camel_case} => { % if property.animatable: true % else: false % endif } % endfor }, PropertyDeclaration::Custom(..) => false, } } /// The `context` parameter controls this: /// /// https://drafts.csswg.org/css-animations/#keyframes /// > The <declaration-list> inside of <keyframe-block> accepts any CSS property /// > except those defined in this specification, /// > but does accept the `animation-play-state` property and interprets it specially. /// /// This will not actually parse Importance values, and will always set things /// to Importance::Normal. Parsing Importance values is the job of PropertyDeclarationParser, /// we only set them here so that we don't have to reallocate pub fn parse_into<'i, 't>(declarations: &mut SourcePropertyDeclaration, id: PropertyId, context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<(), PropertyDeclarationParseError<'i>> { assert!(declarations.is_empty()); let rule_type = context.rule_type(); debug_assert!(rule_type == CssRuleType::Keyframe || rule_type == CssRuleType::Page || rule_type == CssRuleType::Style, "Declarations are only expected inside a keyframe, page, or style rule."); id.check_allowed_in(rule_type, context.stylesheet_origin)?; match id { PropertyId::Custom(name) => { let value = match input.try(|i| CSSWideKeyword::parse(i)) { Ok(keyword) => DeclaredValueOwned::CSSWideKeyword(keyword), Err(()) => match ::custom_properties::SpecifiedValue::parse(context, input) { Ok(value) => DeclaredValueOwned::Value(value), Err(e) => return Err(PropertyDeclarationParseError::InvalidValue(name.to_string().into(), ValueParseError::from_parse_error(e))), } }; declarations.push(PropertyDeclaration::Custom(name, value)); Ok(()) } PropertyId::Longhand(id) => { input.try(|i| CSSWideKeyword::parse(i)).map(|keyword| { PropertyDeclaration::CSSWideKeyword(id, keyword) }).or_else(|()| { input.look_for_var_functions(); let start = input.state(); input.parse_entirely(|input| id.parse_value(context, input)) .or_else(|err| { while let Ok(_) = input.next() {} // Look for var() after the error. if input.seen_var_functions() { input.reset(&start); let (first_token_type, css) = ::custom_properties::parse_non_custom_with_var(input).map_err(|e| { PropertyDeclarationParseError::InvalidValue(id.name().into(), ValueParseError::from_parse_error(e)) })?; Ok(PropertyDeclaration::WithVariables(id, Arc::new(UnparsedValue { css: css.into_owned(), first_token_type: first_token_type, url_data: context.url_data.clone(), from_shorthand: None, }))) } else { Err(PropertyDeclarationParseError::InvalidValue(id.name().into(), ValueParseError::from_parse_error(err))) } }) }).map(|declaration| { declarations.push(declaration) }) } PropertyId::Shorthand(id) => { if let Ok(keyword) = input.try(|i| CSSWideKeyword::parse(i)) { if id == ShorthandId::All { declarations.all_shorthand = AllShorthand::CSSWideKeyword(keyword) } else { for &longhand in id.longhands() { declarations.push(PropertyDeclaration::CSSWideKeyword(longhand, keyword)) } } Ok(()) } else { input.look_for_var_functions(); let start = input.state(); // Not using parse_entirely here: each ${shorthand.ident}::parse_into function // needs to do so *before* pushing to `declarations`. id.parse_into(declarations, context, input).or_else(|err| { while let Ok(_) = input.next() {} // Look for var() after the error. if input.seen_var_functions() { input.reset(&start); let (first_token_type, css) = ::custom_properties::parse_non_custom_with_var(input).map_err(|e| { PropertyDeclarationParseError::InvalidValue(id.name().into(), ValueParseError::from_parse_error(e)) })?; let unparsed = Arc::new(UnparsedValue { css: css.into_owned(), first_token_type: first_token_type, url_data: context.url_data.clone(), from_shorthand: Some(id), }); if id == ShorthandId::All { declarations.all_shorthand = AllShorthand::WithVariables(unparsed) } else { for &longhand in id.longhands() { declarations.push( PropertyDeclaration::WithVariables(longhand, unparsed.clone()) ) } } Ok(()) } else { Err(PropertyDeclarationParseError::InvalidValue(id.name().into(), ValueParseError::from_parse_error(err))) } }) } } } } } const MAX_SUB_PROPERTIES_PER_SHORTHAND_EXCEPT_ALL: usize = ${max(len(s.sub_properties) for s in data.shorthands_except_all())}; type SourcePropertyDeclarationArray = [PropertyDeclaration; MAX_SUB_PROPERTIES_PER_SHORTHAND_EXCEPT_ALL]; /// A stack-allocated vector of `PropertyDeclaration` /// large enough to parse one CSS `key: value` declaration. /// (Shorthands expand to multiple `PropertyDeclaration`s.) pub struct SourcePropertyDeclaration { declarations: ::arrayvec::ArrayVec<SourcePropertyDeclarationArray>, /// Stored separately to keep MAX_SUB_PROPERTIES_PER_SHORTHAND_EXCEPT_ALL smaller. all_shorthand: AllShorthand, } impl SourcePropertyDeclaration { /// Create one. It’s big, try not to move it around. #[inline] pub fn new() -> Self { SourcePropertyDeclaration { declarations: ::arrayvec::ArrayVec::new(), all_shorthand: AllShorthand::NotSet, } } /// Similar to Vec::drain: leaves this empty when the return value is dropped. pub fn drain(&mut self) -> SourcePropertyDeclarationDrain { SourcePropertyDeclarationDrain { declarations: self.declarations.drain(..), all_shorthand: mem::replace(&mut self.all_shorthand, AllShorthand::NotSet), } } /// Reset to initial state pub fn clear(&mut self) { self.declarations.clear(); self.all_shorthand = AllShorthand::NotSet; } fn is_empty(&self) -> bool { self.declarations.is_empty() && matches!(self.all_shorthand, AllShorthand::NotSet) } fn push(&mut self, declaration: PropertyDeclaration) { let over_capacity = self.declarations.push(declaration).is_some(); debug_assert!(!over_capacity); } } /// Return type of SourcePropertyDeclaration::drain pub struct SourcePropertyDeclarationDrain<'a> { declarations: ::arrayvec::Drain<'a, SourcePropertyDeclarationArray>, all_shorthand: AllShorthand, } enum AllShorthand { NotSet, CSSWideKeyword(CSSWideKeyword), WithVariables(Arc<UnparsedValue>) } #[cfg(feature = "gecko")] pub use gecko_properties::style_structs; /// The module where all the style structs are defined. #[cfg(feature = "servo")] pub mod style_structs { use fnv::FnvHasher; use super::longhands; use std::hash::{Hash, Hasher}; use logical_geometry::WritingMode; use media_queries::Device; use values::computed::NonNegativeAu; % for style_struct in data.active_style_structs(): % if style_struct.name == "Font": #[derive(Clone, Debug)] % else: #[derive(PartialEq, Clone, Debug)] % endif #[cfg_attr(feature = "servo", derive(HeapSizeOf))] /// The ${style_struct.name} style struct. pub struct ${style_struct.name} { % for longhand in style_struct.longhands: /// The ${longhand.name} computed value. pub ${longhand.ident}: longhands::${longhand.ident}::computed_value::T, % endfor % if style_struct.name == "Font": /// The font hash, used for font caching. pub hash: u64, % endif } % if style_struct.name == "Font": impl PartialEq for ${style_struct.name} { fn eq(&self, other: &${style_struct.name}) -> bool { self.hash == other.hash % for longhand in style_struct.longhands: && self.${longhand.ident} == other.${longhand.ident} % endfor } } % endif impl ${style_struct.name} { % for longhand in style_struct.longhands: % if longhand.logical: ${helpers.logical_setter(name=longhand.name)} % else: % if longhand.is_vector: /// Set ${longhand.name}. #[allow(non_snake_case)] #[inline] pub fn set_${longhand.ident}<I>(&mut self, v: I) where I: IntoIterator<Item = longhands::${longhand.ident} ::computed_value::single_value::T>, I::IntoIter: ExactSizeIterator { self.${longhand.ident} = longhands::${longhand.ident}::computed_value ::T(v.into_iter().collect()); } % else: /// Set ${longhand.name}. #[allow(non_snake_case)] #[inline] pub fn set_${longhand.ident}(&mut self, v: longhands::${longhand.ident}::computed_value::T) { self.${longhand.ident} = v; } % endif /// Set ${longhand.name} from other struct. #[allow(non_snake_case)] #[inline] pub fn copy_${longhand.ident}_from(&mut self, other: &Self) { self.${longhand.ident} = other.${longhand.ident}.clone(); } /// Reset ${longhand.name} from the initial struct. #[allow(non_snake_case)] #[inline] pub fn reset_${longhand.ident}(&mut self, other: &Self) { self.copy_${longhand.ident}_from(other) } % if longhand.need_clone: /// Get the computed value for ${longhand.name}. #[allow(non_snake_case)] #[inline] pub fn clone_${longhand.ident}(&self) -> longhands::${longhand.ident}::computed_value::T { self.${longhand.ident}.clone() } % endif % endif % if longhand.need_index: /// If this longhand is indexed, get the number of elements. #[allow(non_snake_case)] pub fn ${longhand.ident}_count(&self) -> usize { self.${longhand.ident}.0.len() } /// If this longhand is indexed, get the element at given /// index. #[allow(non_snake_case)] pub fn ${longhand.ident}_at(&self, index: usize) -> longhands::${longhand.ident}::computed_value::SingleComputedValue { self.${longhand.ident}.0[index].clone() } % endif % endfor % if style_struct.name == "Border": % for side in ["top", "right", "bottom", "left"]: /// Whether the border-${side} property has nonzero width. #[allow(non_snake_case)] pub fn border_${side}_has_nonzero_width(&self) -> bool { self.border_${side}_width != NonNegativeAu::zero() } % endfor % elif style_struct.name == "Font": /// Computes a font hash in order to be able to cache fonts /// effectively in GFX and layout. pub fn compute_font_hash(&mut self) { // Corresponds to the fields in // `gfx::font_template::FontTemplateDescriptor`. let mut hasher: FnvHasher = Default::default(); hasher.write_u16(self.font_weight.0); self.font_stretch.hash(&mut hasher); self.font_family.hash(&mut hasher); self.hash = hasher.finish() } /// (Servo does not handle MathML, so this just calls copy_font_size_from) pub fn inherit_font_size_from(&mut self, parent: &Self, _: Option<NonNegativeAu>, _: &Device) -> bool { self.copy_font_size_from(parent); false } /// (Servo does not handle MathML, so this just calls set_font_size) pub fn apply_font_size(&mut self, v: longhands::font_size::computed_value::T, _: &Self, _: &Device) -> Option<NonNegativeAu> { self.set_font_size(v); None } /// (Servo does not handle MathML, so this does nothing) pub fn apply_unconstrained_font_size(&mut self, _: NonNegativeAu) { } % elif style_struct.name == "Outline": /// Whether the outline-width property is non-zero. #[inline] pub fn outline_has_nonzero_width(&self) -> bool { self.outline_width != NonNegativeAu::zero() } % elif style_struct.name == "Text": /// Whether the text decoration has an underline. #[inline] pub fn has_underline(&self) -> bool { self.text_decoration_line.contains(longhands::text_decoration_line::UNDERLINE) } /// Whether the text decoration has an overline. #[inline] pub fn has_overline(&self) -> bool { self.text_decoration_line.contains(longhands::text_decoration_line::OVERLINE) } /// Whether the text decoration has a line through. #[inline] pub fn has_line_through(&self) -> bool { self.text_decoration_line.contains(longhands::text_decoration_line::LINE_THROUGH) } % elif style_struct.name == "Box": /// Sets the display property, but without touching /// __servo_display_for_hypothetical_box, except when the /// adjustment comes from root or item display fixups. pub fn set_adjusted_display(&mut self, dpy: longhands::display::computed_value::T, is_item_or_root: bool) { self.set_display(dpy); if is_item_or_root { self.set__servo_display_for_hypothetical_box(dpy); } } % endif } % endfor } % for style_struct in data.active_style_structs(): impl style_structs::${style_struct.name} { % for longhand in style_struct.longhands: % if longhand.need_index: /// Iterate over the values of ${longhand.name}. #[allow(non_snake_case)] #[inline] pub fn ${longhand.ident}_iter(&self) -> ${longhand.camel_case}Iter { ${longhand.camel_case}Iter { style_struct: self, current: 0, max: self.${longhand.ident}_count(), } } /// Get a value mod `index` for the property ${longhand.name}. #[allow(non_snake_case)] #[inline] pub fn ${longhand.ident}_mod(&self, index: usize) -> longhands::${longhand.ident}::computed_value::SingleComputedValue { self.${longhand.ident}_at(index % self.${longhand.ident}_count()) } % endif % endfor % if style_struct.name == "Box": /// Returns whether there is any animation specified with /// animation-name other than `none`. pub fn specifies_animations(&self) -> bool { self.animation_name_iter().any(|name| name.0.is_some()) } /// Returns whether there are any transitions specified. #[cfg(feature = "servo")] pub fn specifies_transitions(&self) -> bool { self.transition_duration_iter() .take(self.transition_property_count()) .any(|t| t.seconds() > 0.) } % endif } % for longhand in style_struct.longhands: % if longhand.need_index: /// An iterator over the values of the ${longhand.name} properties. pub struct ${longhand.camel_case}Iter<'a> { style_struct: &'a style_structs::${style_struct.name}, current: usize, max: usize, } impl<'a> Iterator for ${longhand.camel_case}Iter<'a> { type Item = longhands::${longhand.ident}::computed_value::SingleComputedValue; fn next(&mut self) -> Option<Self::Item> { self.current += 1; if self.current <= self.max { Some(self.style_struct.${longhand.ident}_at(self.current - 1)) } else { None } } } % endif % endfor % endfor #[cfg(feature = "gecko")] pub use gecko_properties::{ComputedValues, ComputedValuesInner}; #[cfg(feature = "servo")] #[cfg_attr(feature = "servo", derive(Clone, Debug))] /// Actual data of ComputedValues, to match up with Gecko pub struct ComputedValuesInner { % for style_struct in data.active_style_structs(): ${style_struct.ident}: Arc<style_structs::${style_struct.name}>, % endfor custom_properties: Option<Arc<::custom_properties::CustomPropertiesMap>>, /// The writing mode of this computed values struct. pub writing_mode: WritingMode, /// The keyword behind the current font-size property, if any pub font_computation_data: FontComputationData, /// A set of flags we use to store misc information regarding this style. pub flags: ComputedValueFlags, /// The rule node representing the ordered list of rules matched for this /// node. Can be None for default values and text nodes. This is /// essentially an optimization to avoid referencing the root rule node. pub rules: Option<StrongRuleNode>, /// The element's computed values if visited, only computed if there's a /// relevant link for this element. A element's "relevant link" is the /// element being matched if it is a link or the nearest ancestor link. visited_style: Option<Arc<ComputedValues>>, } /// The struct that Servo uses to represent computed values. /// /// This struct contains an immutable atomically-reference-counted pointer to /// every kind of style struct. /// /// When needed, the structs may be copied in order to get mutated. #[cfg(feature = "servo")] #[cfg_attr(feature = "servo", derive(Clone, Debug))] pub struct ComputedValues { /// The actual computed values /// /// In Gecko the outer ComputedValues is actually a style context, /// whereas ComputedValuesInner is the core set of computed values. /// /// We maintain this distinction in servo to reduce the amount of special casing. inner: ComputedValuesInner, } #[cfg(feature = "servo")] impl ComputedValues { /// Create a new refcounted `ComputedValues` pub fn new( _: &Device, _: Option<<&ComputedValues>, _: Option<<&PseudoElement>, custom_properties: Option<Arc<::custom_properties::CustomPropertiesMap>>, writing_mode: WritingMode, font_size_keyword: Option<(longhands::font_size::KeywordSize, f32)>, flags: ComputedValueFlags, rules: Option<StrongRuleNode>, visited_style: Option<Arc<ComputedValues>>, % for style_struct in data.active_style_structs(): ${style_struct.ident}: Arc<style_structs::${style_struct.name}>, % endfor ) -> Arc<Self> { Arc::new(Self { inner: ComputedValuesInner::new( custom_properties, writing_mode, font_size_keyword, flags, rules, visited_style, % for style_struct in data.active_style_structs(): ${style_struct.ident}, % endfor ) }) } /// Get the initial computed values. pub fn initial_values() -> &'static Self { &*INITIAL_SERVO_VALUES } } #[cfg(feature = "servo")] impl ComputedValuesInner { /// Construct a `ComputedValuesInner` instance. pub fn new( custom_properties: Option<Arc<::custom_properties::CustomPropertiesMap>>, writing_mode: WritingMode, font_size_keyword: Option<(longhands::font_size::KeywordSize, f32)>, flags: ComputedValueFlags, rules: Option<StrongRuleNode>, visited_style: Option<Arc<ComputedValues>>, % for style_struct in data.active_style_structs(): ${style_struct.ident}: Arc<style_structs::${style_struct.name}>, % endfor ) -> Self { ComputedValuesInner { custom_properties: custom_properties, writing_mode: writing_mode, font_computation_data: FontComputationData::new(font_size_keyword), rules: rules, visited_style: visited_style, flags: flags, % for style_struct in data.active_style_structs(): ${style_struct.ident}: ${style_struct.ident}, % endfor } } } #[cfg(feature = "servo")] impl ops::Deref for ComputedValues { type Target = ComputedValuesInner; fn deref(&self) -> &ComputedValuesInner { &self.inner } } #[cfg(feature = "servo")] impl ops::DerefMut for ComputedValues { fn deref_mut(&mut self) -> &mut ComputedValuesInner { &mut self.inner } } #[cfg(feature = "servo")] impl ComputedValuesInner { % for style_struct in data.active_style_structs(): /// Clone the ${style_struct.name} struct. #[inline] pub fn clone_${style_struct.name_lower}(&self) -> Arc<style_structs::${style_struct.name}> { self.${style_struct.ident}.clone() } /// Get a immutable reference to the ${style_struct.name} struct. #[inline] pub fn get_${style_struct.name_lower}(&self) -> &style_structs::${style_struct.name} { &self.${style_struct.ident} } /// Gets an immutable reference to the refcounted value that wraps /// `${style_struct.name}`. pub fn ${style_struct.name_lower}_arc(&self) -> &Arc<style_structs::${style_struct.name}> { &self.${style_struct.ident} } /// Get a mutable reference to the ${style_struct.name} struct. #[inline] pub fn mutate_${style_struct.name_lower}(&mut self) -> &mut style_structs::${style_struct.name} { Arc::make_mut(&mut self.${style_struct.ident}) } % endfor /// Gets a reference to the rule node. Panic if no rule node exists. pub fn rules(&self) -> &StrongRuleNode { self.rules.as_ref().unwrap() } /// Whether there is a visited style. pub fn has_visited_style(&self) -> bool { self.visited_style.is_some() } /// Gets a reference to the visited style, if any. pub fn get_visited_style(&self) -> Option< & ComputedValues> { self.visited_style.as_ref().map(|x| &**x) } /// Gets a reference to the visited style. Panic if no visited style exists. pub fn visited_style(&self) -> &ComputedValues { self.get_visited_style().unwrap() } /// Clone the visited style. Used for inheriting parent styles in /// StyleBuilder::for_inheritance. pub fn clone_visited_style(&self) -> Option<Arc<ComputedValues>> { self.visited_style.clone() } // Aah! The << in the return type below is not valid syntax, but we must // escape < that way for Mako. /// Gets a reference to the custom properties map (if one exists). pub fn get_custom_properties(&self) -> Option<<&::custom_properties::CustomPropertiesMap> { self.custom_properties.as_ref().map(|x| &**x) } /// Get the custom properties map if necessary. /// /// Cloning the Arc here is fine because it only happens in the case where /// we have custom properties, and those are both rare and expensive. pub fn custom_properties(&self) -> Option<Arc<::custom_properties::CustomPropertiesMap>> { self.custom_properties.clone() } /// Whether this style has a -moz-binding value. This is always false for /// Servo for obvious reasons. pub fn has_moz_binding(&self) -> bool { false } /// Returns whether this style's display value is equal to contents. /// /// Since this isn't supported in Servo, this is always false for Servo. pub fn is_display_contents(&self) -> bool { false } #[inline] /// Returns whether the "content" property for the given style is completely /// ineffective, and would yield an empty `::before` or `::after` /// pseudo-element. pub fn ineffective_content_property(&self) -> bool { use properties::longhands::content::computed_value::T; match self.get_counters().content { T::Normal | T::None => true, T::Items(ref items) => items.is_empty(), } } /// Whether the current style is multicolumn. #[inline] pub fn is_multicol(&self) -> bool { let style = self.get_column(); match style.column_width { Either::First(_width) => true, Either::Second(_auto) => match style.column_count { Either::First(_n) => true, Either::Second(_auto) => false, } } } /// Resolves the currentColor keyword. /// /// Any color value from computed values (except for the 'color' property /// itself) should go through this method. /// /// Usage example: /// let top_color = style.resolve_color(style.Border.border_top_color); #[inline] pub fn resolve_color(&self, color: computed::Color) -> RGBA { color.to_rgba(self.get_color().color) } /// Get the logical computed inline size. #[inline] pub fn content_inline_size(&self) -> computed::LengthOrPercentageOrAuto { let position_style = self.get_position(); if self.writing_mode.is_vertical() { position_style.height } else { position_style.width } } /// Get the logical computed block size. #[inline] pub fn content_block_size(&self) -> computed::LengthOrPercentageOrAuto { let position_style = self.get_position(); if self.writing_mode.is_vertical() { position_style.width } else { position_style.height } } /// Get the logical computed min inline size. #[inline] pub fn min_inline_size(&self) -> computed::LengthOrPercentage { let position_style = self.get_position(); if self.writing_mode.is_vertical() { position_style.min_height } else { position_style.min_width } } /// Get the logical computed min block size. #[inline] pub fn min_block_size(&self) -> computed::LengthOrPercentage { let position_style = self.get_position(); if self.writing_mode.is_vertical() { position_style.min_width } else { position_style.min_height } } /// Get the logical computed max inline size. #[inline] pub fn max_inline_size(&self) -> computed::LengthOrPercentageOrNone { let position_style = self.get_position(); if self.writing_mode.is_vertical() { position_style.max_height } else { position_style.max_width } } /// Get the logical computed max block size. #[inline] pub fn max_block_size(&self) -> computed::LengthOrPercentageOrNone { let position_style = self.get_position(); if self.writing_mode.is_vertical() { position_style.max_width } else { position_style.max_height } } /// Get the logical computed padding for this writing mode. #[inline] pub fn logical_padding(&self) -> LogicalMargin<computed::LengthOrPercentage> { let padding_style = self.get_padding(); LogicalMargin::from_physical(self.writing_mode, SideOffsets2D::new( padding_style.padding_top.0, padding_style.padding_right.0, padding_style.padding_bottom.0, padding_style.padding_left.0, )) } /// Get the logical border width #[inline] pub fn border_width_for_writing_mode(&self, writing_mode: WritingMode) -> LogicalMargin<Au> { let border_style = self.get_border(); LogicalMargin::from_physical(writing_mode, SideOffsets2D::new( border_style.border_top_width.0, border_style.border_right_width.0, border_style.border_bottom_width.0, border_style.border_left_width.0, )) } /// Gets the logical computed border widths for this style. #[inline] pub fn logical_border_width(&self) -> LogicalMargin<Au> { self.border_width_for_writing_mode(self.writing_mode) } /// Gets the logical computed margin from this style. #[inline] pub fn logical_margin(&self) -> LogicalMargin<computed::LengthOrPercentageOrAuto> { let margin_style = self.get_margin(); LogicalMargin::from_physical(self.writing_mode, SideOffsets2D::new( margin_style.margin_top, margin_style.margin_right, margin_style.margin_bottom, margin_style.margin_left, )) } /// Gets the logical position from this style. #[inline] pub fn logical_position(&self) -> LogicalMargin<computed::LengthOrPercentageOrAuto> { // FIXME(SimonSapin): should be the writing mode of the containing block, maybe? let position_style = self.get_position(); LogicalMargin::from_physical(self.writing_mode, SideOffsets2D::new( position_style.top, position_style.right, position_style.bottom, position_style.left, )) } /// Return true if the effects force the transform style to be Flat pub fn overrides_transform_style(&self) -> bool { use computed_values::mix_blend_mode; let effects = self.get_effects(); // TODO(gw): Add clip-path, isolation, mask-image, mask-border-source when supported. effects.opacity < 1.0 || !effects.filter.0.is_empty() || !effects.clip.is_auto() || effects.mix_blend_mode != mix_blend_mode::T::normal } /// https://drafts.csswg.org/css-transforms/#grouping-property-values pub fn get_used_transform_style(&self) -> computed_values::transform_style::T { use computed_values::transform_style; let box_ = self.get_box(); if self.overrides_transform_style() { transform_style::T::flat } else { // Return the computed value if not overridden by the above exceptions box_.transform_style } } /// Whether given this transform value, the compositor would require a /// layer. pub fn transform_requires_layer(&self) -> bool { // Check if the transform matrix is 2D or 3D if let Some(ref transform_list) = self.get_box().transform.0 { for transform in transform_list { match *transform { computed_values::transform::ComputedOperation::Perspective(..) => { return true; } computed_values::transform::ComputedOperation::Matrix(m) => { // See http://dev.w3.org/csswg/css-transforms/#2d-matrix if m.m31 != 0.0 || m.m32 != 0.0 || m.m13 != 0.0 || m.m23 != 0.0 || m.m43 != 0.0 || m.m14 != 0.0 || m.m24 != 0.0 || m.m34 != 0.0 || m.m33 != 1.0 || m.m44 != 1.0 { return true; } } computed_values::transform::ComputedOperation::Translate(_, _, z) => { if z != Au(0) { return true; } } _ => {} } } } // Neither perspective nor transform present false } /// Serializes the computed value of this property as a string. pub fn computed_value_to_string(&self, property: PropertyDeclarationId) -> String { match property { % for style_struct in data.active_style_structs(): % for longhand in style_struct.longhands: PropertyDeclarationId::Longhand(LonghandId::${longhand.camel_case}) => { self.${style_struct.ident}.${longhand.ident}.to_css_string() } % endfor % endfor PropertyDeclarationId::Custom(name) => { self.custom_properties .as_ref() .and_then(|map| map.get(name)) .map(|value| value.to_css_string()) .unwrap_or(String::new()) } } } } /// Return a WritingMode bitflags from the relevant CSS properties. pub fn get_writing_mode(inheritedbox_style: &style_structs::InheritedBox) -> WritingMode { use logical_geometry; let mut flags = WritingMode::empty(); match inheritedbox_style.clone_direction() { computed_values::direction::T::ltr => {}, computed_values::direction::T::rtl => { flags.insert(logical_geometry::FLAG_RTL); }, } match inheritedbox_style.clone_writing_mode() { computed_values::writing_mode::T::horizontal_tb => {}, computed_values::writing_mode::T::vertical_rl => { flags.insert(logical_geometry::FLAG_VERTICAL); }, computed_values::writing_mode::T::vertical_lr => { flags.insert(logical_geometry::FLAG_VERTICAL); flags.insert(logical_geometry::FLAG_VERTICAL_LR); }, % if product == "gecko": computed_values::writing_mode::T::sideways_rl => { flags.insert(logical_geometry::FLAG_VERTICAL); flags.insert(logical_geometry::FLAG_SIDEWAYS); }, computed_values::writing_mode::T::sideways_lr => { flags.insert(logical_geometry::FLAG_VERTICAL); flags.insert(logical_geometry::FLAG_VERTICAL_LR); flags.insert(logical_geometry::FLAG_LINE_INVERTED); flags.insert(logical_geometry::FLAG_SIDEWAYS); }, % endif } % if product == "gecko": // If FLAG_SIDEWAYS is already set, this means writing-mode is either // sideways-rl or sideways-lr, and for both of these values, // text-orientation has no effect. if !flags.intersects(logical_geometry::FLAG_SIDEWAYS) { match inheritedbox_style.clone_text_orientation() { computed_values::text_orientation::T::mixed => {}, computed_values::text_orientation::T::upright => { flags.insert(logical_geometry::FLAG_UPRIGHT); }, computed_values::text_orientation::T::sideways => { flags.insert(logical_geometry::FLAG_SIDEWAYS); }, } } % endif flags } % if product == "gecko": pub use ::servo_arc::RawOffsetArc as BuilderArc; /// Clone an arc, returning a regular arc fn clone_arc<T: 'static>(x: &BuilderArc<T>) -> Arc<T> { Arc::from_raw_offset(x.clone()) } % else: pub use ::servo_arc::Arc as BuilderArc; /// Clone an arc, returning a regular arc fn clone_arc<T: 'static>(x: &BuilderArc<T>) -> Arc<T> { x.clone() } % endif /// A reference to a style struct of the parent, or our own style struct. pub enum StyleStructRef<'a, T: 'static> { /// A borrowed struct from the parent, for example, for inheriting style. Borrowed(&'a BuilderArc<T>), /// An owned struct, that we've already mutated. Owned(UniqueArc<T>), /// Temporarily vacated, will panic if accessed Vacated, } impl<'a, T: 'a> StyleStructRef<'a, T> where T: Clone, { /// Ensure a mutable reference of this value exists, either cloning the /// borrowed value, or returning the owned one. pub fn mutate(&mut self) -> &mut T { if let StyleStructRef::Borrowed(v) = *self { *self = StyleStructRef::Owned(UniqueArc::new((**v).clone())); } match *self { StyleStructRef::Owned(ref mut v) => v, StyleStructRef::Borrowed(..) => unreachable!(), StyleStructRef::Vacated => panic!("Accessed vacated style struct") } } /// Extract a unique Arc from this struct, vacating it. /// /// The vacated state is a transient one, please put the Arc back /// when done via `put()`. This function is to be used to separate /// the struct being mutated from the computed context pub fn take(&mut self) -> UniqueArc<T> { use std::mem::replace; let inner = replace(self, StyleStructRef::Vacated); match inner { StyleStructRef::Owned(arc) => arc, StyleStructRef::Borrowed(arc) => UniqueArc::new((**arc).clone()), StyleStructRef::Vacated => panic!("Accessed vacated style struct"), } } /// Replace vacated ref with an arc pub fn put(&mut self, arc: UniqueArc<T>) { debug_assert!(matches!(*self, StyleStructRef::Vacated)); *self = StyleStructRef::Owned(arc); } /// Get a mutable reference to the owned struct, or `None` if the struct /// hasn't been mutated. pub fn get_if_mutated(&mut self) -> Option<<&mut T> { match *self { StyleStructRef::Owned(ref mut v) => Some(v), StyleStructRef::Borrowed(..) => None, StyleStructRef::Vacated => panic!("Accessed vacated style struct") } } /// Returns an `Arc` to the internal struct, constructing one if /// appropriate. pub fn build(self) -> Arc<T> { match self { StyleStructRef::Owned(v) => v.shareable(), StyleStructRef::Borrowed(v) => clone_arc(v), StyleStructRef::Vacated => panic!("Accessed vacated style struct") } } } impl<'a, T: 'a> ops::Deref for StyleStructRef<'a, T> { type Target = T; fn deref(&self) -> &T { match *self { StyleStructRef::Owned(ref v) => &**v, StyleStructRef::Borrowed(v) => &**v, StyleStructRef::Vacated => panic!("Accessed vacated style struct") } } } /// A type used to compute a struct with minimal overhead. /// /// This allows holding references to the parent/default computed values without /// actually cloning them, until we either build the style, or mutate the /// inherited value. pub struct StyleBuilder<'a> { /// The device we're using to compute style. /// /// This provides access to viewport unit ratios, etc. pub device: &'a Device, /// The style we're inheriting from. /// /// This is effectively /// `parent_style.unwrap_or(device.default_computed_values())`. inherited_style: &'a ComputedValues, /// The style we're inheriting from for properties that don't inherit from /// ::first-line. This is the same as inherited_style, unless /// inherited_style is a ::first-line style. inherited_style_ignoring_first_line: &'a ComputedValues, /// The style we're getting reset structs from. reset_style: &'a ComputedValues, /// The style we're inheriting from explicitly, or none if we're the root of /// a subtree. parent_style: Option<<&'a ComputedValues>, /// The rule node representing the ordered list of rules matched for this /// node. rules: Option<StrongRuleNode>, custom_properties: Option<Arc<::custom_properties::CustomPropertiesMap>>, /// The pseudo-element this style will represent. pseudo: Option<<&'a PseudoElement>, /// The writing mode flags. /// /// TODO(emilio): Make private. pub writing_mode: WritingMode, /// The keyword behind the current font-size property, if any. pub font_size_keyword: Option<(longhands::font_size::KeywordSize, f32)>, /// Flags for the computed value. pub flags: ComputedValueFlags, /// The element's style if visited, only computed if there's a relevant link /// for this element. A element's "relevant link" is the element being /// matched if it is a link or the nearest ancestor link. visited_style: Option<Arc<ComputedValues>>, % for style_struct in data.active_style_structs(): ${style_struct.ident}: StyleStructRef<'a, style_structs::${style_struct.name}>, % endfor } impl<'a> StyleBuilder<'a> { /// Trivially construct a `StyleBuilder`. fn new( device: &'a Device, parent_style: Option<<&'a ComputedValues>, parent_style_ignoring_first_line: Option<<&'a ComputedValues>, pseudo: Option<<&'a PseudoElement>, cascade_flags: CascadeFlags, rules: Option<StrongRuleNode>, custom_properties: Option<Arc<::custom_properties::CustomPropertiesMap>>, writing_mode: WritingMode, font_size_keyword: Option<(longhands::font_size::KeywordSize, f32)>, flags: ComputedValueFlags, visited_style: Option<Arc<ComputedValues>>, ) -> Self { debug_assert_eq!(parent_style.is_some(), parent_style_ignoring_first_line.is_some()); #[cfg(feature = "gecko")] debug_assert!(parent_style.is_none() || ptr::eq(parent_style.unwrap(), parent_style_ignoring_first_line.unwrap()) || parent_style.unwrap().pseudo() == Some(PseudoElement::FirstLine)); let reset_style = device.default_computed_values(); let inherited_style = parent_style.unwrap_or(reset_style); let inherited_style_ignoring_first_line = parent_style_ignoring_first_line.unwrap_or(reset_style); // FIXME(bz): INHERIT_ALL seems like a fundamentally broken idea. I'm // 99% sure it should give incorrect behavior for table anonymous box // backgrounds, for example. This code doesn't attempt to make it play // nice with inherited_style_ignoring_first_line. let reset_style = if cascade_flags.contains(INHERIT_ALL) { inherited_style } else { reset_style }; StyleBuilder { device, parent_style, inherited_style, inherited_style_ignoring_first_line, reset_style, pseudo, rules, custom_properties, writing_mode, font_size_keyword, flags, visited_style, % for style_struct in data.active_style_structs(): % if style_struct.inherited: ${style_struct.ident}: StyleStructRef::Borrowed(inherited_style.${style_struct.name_lower}_arc()), % else: ${style_struct.ident}: StyleStructRef::Borrowed(reset_style.${style_struct.name_lower}_arc()), % endif % endfor } } /// Creates a StyleBuilder holding only references to the structs of `s`, in /// order to create a derived style. pub fn for_derived_style( device: &'a Device, style_to_derive_from: &'a ComputedValues, parent_style: Option<<&'a ComputedValues>, pseudo: Option<<&'a PseudoElement>, ) -> Self { let reset_style = device.default_computed_values(); let inherited_style = parent_style.unwrap_or(reset_style); #[cfg(feature = "gecko")] debug_assert!(parent_style.is_none() || parent_style.unwrap().pseudo() != Some(PseudoElement::FirstLine)); StyleBuilder { device, parent_style, inherited_style, // None of our callers pass in ::first-line parent styles. inherited_style_ignoring_first_line: inherited_style, reset_style, pseudo, rules: None, // FIXME(emilio): Dubious... custom_properties: style_to_derive_from.custom_properties(), writing_mode: style_to_derive_from.writing_mode, font_size_keyword: style_to_derive_from.font_computation_data.font_size_keyword, flags: style_to_derive_from.flags, visited_style: style_to_derive_from.clone_visited_style(), % for style_struct in data.active_style_structs(): ${style_struct.ident}: StyleStructRef::Borrowed( style_to_derive_from.${style_struct.name_lower}_arc() ), % endfor } } % for property in data.longhands: % if property.ident != "font_size": /// Inherit `${property.ident}` from our parent style. #[allow(non_snake_case)] pub fn inherit_${property.ident}(&mut self) { let inherited_struct = % if property.style_struct.inherited: self.inherited_style.get_${property.style_struct.name_lower}(); % else: self.inherited_style_ignoring_first_line.get_${property.style_struct.name_lower}(); % endif self.${property.style_struct.ident}.mutate() .copy_${property.ident}_from( inherited_struct, % if property.logical: self.writing_mode, % endif ); } /// Reset `${property.ident}` to the initial value. #[allow(non_snake_case)] pub fn reset_${property.ident}(&mut self) { let reset_struct = self.reset_style.get_${property.style_struct.name_lower}(); self.${property.style_struct.ident}.mutate() .reset_${property.ident}( reset_struct, % if property.logical: self.writing_mode, % endif ); } % if not property.is_vector: /// Set the `${property.ident}` to the computed value `value`. #[allow(non_snake_case)] pub fn set_${property.ident}( &mut self, value: longhands::${property.ident}::computed_value::T ) { self.${property.style_struct.ident}.mutate() .set_${property.ident}( value, % if property.logical: self.writing_mode, % elif product == "gecko" and property.ident in ["content", "list_style_type"]: self.device, % endif ); } % endif % endif % endfor /// Inherits style from the parent element, accounting for the default /// computed values that need to be provided as well. pub fn for_inheritance( device: &'a Device, parent: &'a ComputedValues, pseudo: Option<<&'a PseudoElement>, ) -> Self { // FIXME(emilio): This Some(parent) here is inconsistent with what we // usually do if `parent` is the default computed values, but that's // fine, and we want to eventually get rid of it. Self::new( device, Some(parent), Some(parent), pseudo, CascadeFlags::empty(), /* rules = */ None, parent.custom_properties(), parent.writing_mode, parent.font_computation_data.font_size_keyword, parent.flags, parent.clone_visited_style() ) } /// Returns whether we have a visited style. pub fn has_visited_style(&self) -> bool { self.visited_style.is_some() } /// Returns whether we're a pseudo-elements style. pub fn is_pseudo_element(&self) -> bool { self.pseudo.map_or(false, |p| !p.is_anon_box()) } /// Returns the style we're getting reset properties from. pub fn default_style(&self) -> &'a ComputedValues { self.reset_style } % for style_struct in data.active_style_structs(): /// Gets an immutable view of the current `${style_struct.name}` style. pub fn get_${style_struct.name_lower}(&self) -> &style_structs::${style_struct.name} { &self.${style_struct.ident} } /// Gets a mutable view of the current `${style_struct.name}` style. pub fn mutate_${style_struct.name_lower}(&mut self) -> &mut style_structs::${style_struct.name} { self.${style_struct.ident}.mutate() } /// Gets a mutable view of the current `${style_struct.name}` style. pub fn take_${style_struct.name_lower}(&mut self) -> UniqueArc<style_structs::${style_struct.name}> { self.${style_struct.ident}.take() } /// Gets a mutable view of the current `${style_struct.name}` style. pub fn put_${style_struct.name_lower}(&mut self, s: UniqueArc<style_structs::${style_struct.name}>) { self.${style_struct.ident}.put(s) } /// Gets a mutable view of the current `${style_struct.name}` style, /// only if it's been mutated before. pub fn get_${style_struct.name_lower}_if_mutated(&mut self) -> Option<<&mut style_structs::${style_struct.name}> { self.${style_struct.ident}.get_if_mutated() } /// Reset the current `${style_struct.name}` style to its default value. pub fn reset_${style_struct.name_lower}_struct(&mut self) { self.${style_struct.ident} = StyleStructRef::Borrowed(self.reset_style.${style_struct.name_lower}_arc()); } % endfor /// Returns whether this computed style represents a floated object. pub fn floated(&self) -> bool { self.get_box().clone_float() != longhands::float::computed_value::T::none } /// Returns whether this computed style represents an out of flow-positioned /// object. pub fn out_of_flow_positioned(&self) -> bool { use properties::longhands::position::computed_value::T as position; matches!(self.get_box().clone_position(), position::absolute | position::fixed) } /// Whether this style has a top-layer style. That's implemented in Gecko /// via the -moz-top-layer property, but servo doesn't have any concept of a /// top layer (yet, it's needed for fullscreen). #[cfg(feature = "servo")] pub fn in_top_layer(&self) -> bool { false } /// Whether this style has a top-layer style. #[cfg(feature = "gecko")] pub fn in_top_layer(&self) -> bool { matches!(self.get_box().clone__moz_top_layer(), longhands::_moz_top_layer::computed_value::T::top) } /// Turns this `StyleBuilder` into a proper `ComputedValues` instance. pub fn build(self) -> Arc<ComputedValues> { ComputedValues::new( self.device, self.parent_style, self.pseudo, self.custom_properties, self.writing_mode, self.font_size_keyword, self.flags, self.rules, self.visited_style, % for style_struct in data.active_style_structs(): self.${style_struct.ident}.build(), % endfor ) } /// Get the custom properties map if necessary. /// /// Cloning the Arc here is fine because it only happens in the case where /// we have custom properties, and those are both rare and expensive. fn custom_properties(&self) -> Option<Arc<::custom_properties::CustomPropertiesMap>> { self.custom_properties.clone() } /// Access to various information about our inherited styles. We don't /// expose an inherited ComputedValues directly, because in the /// ::first-line case some of the inherited information needs to come from /// one ComputedValues instance and some from a different one. /// Inherited font bits. pub fn inherited_font_computation_data(&self) -> &FontComputationData { &self.inherited_style.font_computation_data } /// Inherited writing-mode. pub fn inherited_writing_mode(&self) -> &WritingMode { &self.inherited_style.writing_mode } /// Inherited style flags. pub fn inherited_flags(&self) -> &ComputedValueFlags { &self.inherited_style.flags } /// And access to inherited style structs. % for style_struct in data.active_style_structs(): /// Gets our inherited `${style_struct.name}`. We don't name these /// accessors `inherited_${style_struct.name_lower}` because we already /// have things like "box" vs "inherited_box" as struct names. Do the /// next-best thing and call them `parent_${style_struct.name_lower}` /// instead. pub fn get_parent_${style_struct.name_lower}(&self) -> &style_structs::${style_struct.name} { % if style_struct.inherited: self.inherited_style.get_${style_struct.name_lower}() % else: self.inherited_style_ignoring_first_line.get_${style_struct.name_lower}() % endif } % endfor } #[cfg(feature = "servo")] pub use self::lazy_static_module::INITIAL_SERVO_VALUES; // Use a module to work around #[cfg] on lazy_static! not being applied to every generated item. #[cfg(feature = "servo")] #[allow(missing_docs)] mod lazy_static_module { use logical_geometry::WritingMode; use servo_arc::Arc; use super::{ComputedValues, ComputedValuesInner, longhands, style_structs, FontComputationData}; use super::computed_value_flags::ComputedValueFlags; /// The initial values for all style structs as defined by the specification. lazy_static! { pub static ref INITIAL_SERVO_VALUES: ComputedValues = ComputedValues { inner: ComputedValuesInner { % for style_struct in data.active_style_structs(): ${style_struct.ident}: Arc::new(style_structs::${style_struct.name} { % for longhand in style_struct.longhands: ${longhand.ident}: longhands::${longhand.ident}::get_initial_value(), % endfor % if style_struct.name == "Font": hash: 0, % endif }), % endfor custom_properties: None, writing_mode: WritingMode::empty(), font_computation_data: FontComputationData::default_values(), rules: None, visited_style: None, flags: ComputedValueFlags::empty(), } }; } } /// A per-longhand function that performs the CSS cascade for that longhand. pub type CascadePropertyFn = extern "Rust" fn(declaration: &PropertyDeclaration, context: &mut computed::Context, cascade_info: &mut Option<<&mut CascadeInfo>); /// A per-longhand array of functions to perform the CSS cascade on each of /// them, effectively doing virtual dispatch. static CASCADE_PROPERTY: [CascadePropertyFn; ${len(data.longhands)}] = [ % for property in data.longhands: longhands::${property.ident}::cascade_property, % endfor ]; bitflags! { /// A set of flags to tweak the behavior of the `cascade` function. pub flags CascadeFlags: u8 { /// Whether to inherit all styles from the parent. If this flag is not /// present, non-inherited styles are reset to their initial values. const INHERIT_ALL = 1, /// Whether to skip any display style fixup for root element, flex/grid /// item, and ruby descendants. const SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP = 1 << 1, /// Whether to only cascade properties that are visited dependent. const VISITED_DEPENDENT_ONLY = 1 << 2, /// Whether the given element we're styling is the document element, /// that is, matches :root. /// /// Not set for native anonymous content since some NAC form their own /// root, but share the device. /// /// This affects some style adjustments, like blockification, and means /// that it may affect global state, like the Device's root font-size. const IS_ROOT_ELEMENT = 1 << 3, /// Whether to convert display:contents into display:inline. This /// is used by Gecko to prevent display:contents on generated /// content. const PROHIBIT_DISPLAY_CONTENTS = 1 << 4, /// Whether we're styling the ::-moz-fieldset-content anonymous box. const IS_FIELDSET_CONTENT = 1 << 5, /// Whether we're computing the style of a link, either visited or /// unvisited. const IS_LINK = 1 << 6, /// Whether we're computing the style of a link element that happens to /// be visited. const IS_VISITED_LINK = 1 << 7, } } /// Performs the CSS cascade, computing new styles for an element from its parent style. /// /// The arguments are: /// /// * `device`: Used to get the initial viewport and other external state. /// /// * `rule_node`: The rule node in the tree that represent the CSS rules that /// matched. /// /// * `parent_style`: The parent style, if applicable; if `None`, this is the root node. /// /// Returns the computed values. /// * `flags`: Various flags. /// pub fn cascade( device: &Device, pseudo: Option<<&PseudoElement>, rule_node: &StrongRuleNode, guards: &StylesheetGuards, parent_style: Option<<&ComputedValues>, parent_style_ignoring_first_line: Option<<&ComputedValues>, layout_parent_style: Option<<&ComputedValues>, visited_style: Option<Arc<ComputedValues>>, cascade_info: Option<<&mut CascadeInfo>, font_metrics_provider: &FontMetricsProvider, flags: CascadeFlags, quirks_mode: QuirksMode ) -> Arc<ComputedValues> { debug_assert_eq!(parent_style.is_some(), parent_style_ignoring_first_line.is_some()); #[cfg(feature = "gecko")] debug_assert!(parent_style.is_none() || ptr::eq(parent_style.unwrap(), parent_style_ignoring_first_line.unwrap()) || parent_style.unwrap().pseudo() == Some(PseudoElement::FirstLine)); let iter_declarations = || { rule_node.self_and_ancestors().flat_map(|node| { let cascade_level = node.cascade_level(); let source = node.style_source(); let declarations = if source.is_some() { source.read(cascade_level.guard(guards)).declarations() } else { // The root node has no style source. &[] }; let node_importance = node.importance(); let property_restriction = pseudo.and_then(|p| p.property_restriction()); declarations .iter() // Yield declarations later in source order (with more precedence) first. .rev() .filter_map(move |&(ref declaration, declaration_importance)| { if let Some(property_restriction) = property_restriction { // declaration.id() is either a longhand or a custom // property. Custom properties are always allowed, but // longhands are only allowed if they have our // property_restriction flag set. if let PropertyDeclarationId::Longhand(id) = declaration.id() { if !id.flags().contains(property_restriction) { return None } } } if declaration_importance == node_importance { Some((declaration, cascade_level)) } else { None } }) }) }; apply_declarations( device, pseudo, rule_node, iter_declarations, parent_style, parent_style_ignoring_first_line, layout_parent_style, visited_style, cascade_info, font_metrics_provider, flags, quirks_mode, ) } /// NOTE: This function expects the declaration with more priority to appear /// first. #[allow(unused_mut)] // conditionally compiled code for "position" pub fn apply_declarations<'a, F, I>( device: &Device, pseudo: Option<<&PseudoElement>, rules: &StrongRuleNode, iter_declarations: F, parent_style: Option<<&ComputedValues>, parent_style_ignoring_first_line: Option<<&ComputedValues>, layout_parent_style: Option<<&ComputedValues>, visited_style: Option<Arc<ComputedValues>>, mut cascade_info: Option<<&mut CascadeInfo>, font_metrics_provider: &FontMetricsProvider, flags: CascadeFlags, quirks_mode: QuirksMode, ) -> Arc<ComputedValues> where F: Fn() -> I, I: Iterator<Item = (&'a PropertyDeclaration, CascadeLevel)>, { debug_assert!(layout_parent_style.is_none() || parent_style.is_some()); debug_assert_eq!(parent_style.is_some(), parent_style_ignoring_first_line.is_some()); #[cfg(feature = "gecko")] debug_assert!(parent_style.is_none() || ptr::eq(parent_style.unwrap(), parent_style_ignoring_first_line.unwrap()) || parent_style.unwrap().pseudo() == Some(PseudoElement::FirstLine)); let (inherited_style, layout_parent_style) = match parent_style { Some(parent_style) => { (parent_style, layout_parent_style.unwrap_or(parent_style)) }, None => { (device.default_computed_values(), device.default_computed_values()) } }; let inherited_custom_properties = inherited_style.custom_properties(); let mut custom_properties = None; let mut seen_custom = HashSet::new(); for (declaration, _cascade_level) in iter_declarations() { if let PropertyDeclaration::Custom(ref name, ref value) = *declaration { ::custom_properties::cascade( &mut custom_properties, &inherited_custom_properties, &mut seen_custom, name, value.borrow()); } } let custom_properties = ::custom_properties::finish_cascade( custom_properties, &inherited_custom_properties); let mut context = computed::Context { is_root_element: flags.contains(IS_ROOT_ELEMENT), // We'd really like to own the rules here to avoid refcount traffic, but // animation's usage of `apply_declarations` make this tricky. See bug // 1375525. builder: StyleBuilder::new( device, parent_style, parent_style_ignoring_first_line, pseudo, flags, Some(rules.clone()), custom_properties, WritingMode::empty(), inherited_style.font_computation_data.font_size_keyword, ComputedValueFlags::empty(), visited_style, ), font_metrics_provider: font_metrics_provider, cached_system_font: None, in_media_query: false, quirks_mode: quirks_mode, for_smil_animation: false, }; let ignore_colors = !device.use_document_colors(); let default_background_color_decl = if ignore_colors { let color = device.default_background_color(); Some(PropertyDeclaration::BackgroundColor(color.into())) } else { None }; // Set computed values, overwriting earlier declarations for the same // property. let mut seen = LonghandIdSet::new(); // Declaration blocks are stored in increasing precedence order, we want // them in decreasing order here. // // We could (and used to) use a pattern match here, but that bloats this // function to over 100K of compiled code! // // To improve i-cache behavior, we outline the individual functions and use // virtual dispatch instead. % for category_to_cascade_now in ["early", "other"]: % if category_to_cascade_now == "early": // Pull these out so that we can compute them in a specific order // without introducing more iterations. let mut font_size = None; let mut font_family = None; % endif for (declaration, cascade_level) in iter_declarations() { let mut declaration = match *declaration { PropertyDeclaration::WithVariables(id, ref unparsed) => { Cow::Owned(unparsed.substitute_variables( id, &context.builder.custom_properties, context.quirks_mode )) } ref d => Cow::Borrowed(d) }; let longhand_id = match declaration.id() { PropertyDeclarationId::Longhand(id) => id, PropertyDeclarationId::Custom(..) => continue, }; // Only a few properties are allowed to depend on the visited state // of links. When cascading visited styles, we can save time by // only processing these properties. if flags.contains(VISITED_DEPENDENT_ONLY) && !longhand_id.is_visited_dependent() { continue } // When document colors are disabled, skip properties that are // marked as ignored in that mode, if they come from a UA or // user style sheet. if ignore_colors && longhand_id.is_ignored_when_document_colors_disabled() && !matches!(cascade_level, CascadeLevel::UANormal | CascadeLevel::UserNormal | CascadeLevel::UserImportant | CascadeLevel::UAImportant) { let non_transparent_background = match *declaration { PropertyDeclaration::BackgroundColor(ref color) => { // Treat background-color a bit differently. If the specified // color is anything other than a fully transparent color, convert // it into the Device's default background color. color.is_non_transparent() } _ => continue }; // FIXME: moving this out of `match` is a work around for borrows being lexical. if non_transparent_background { declaration = Cow::Borrowed(default_background_color_decl.as_ref().unwrap()); } } if % if category_to_cascade_now == "early": ! % endif longhand_id.is_early_property() { continue } <% maybe_to_physical = ".to_physical(writing_mode)" if category_to_cascade_now != "early" else "" %> let physical_longhand_id = longhand_id ${maybe_to_physical}; if seen.contains(physical_longhand_id) { continue } seen.insert(physical_longhand_id); % if category_to_cascade_now == "early": if LonghandId::FontSize == longhand_id { font_size = Some(declaration.clone()); continue; } if LonghandId::FontFamily == longhand_id { font_family = Some(declaration.clone()); continue; } % endif let discriminant = longhand_id as usize; (CASCADE_PROPERTY[discriminant])(&*declaration, &mut context, &mut cascade_info); } % if category_to_cascade_now == "early": let writing_mode = get_writing_mode(context.builder.get_inheritedbox()); context.builder.writing_mode = writing_mode; let mut _skip_font_family = false; % if product == "gecko": // <svg:text> is not affected by text zoom, and it uses a preshint to // disable it. We fix up the struct when this happens by unzooming // its contained font values, which will have been zoomed in the parent if seen.contains(LonghandId::XTextZoom) { let zoom = context.builder.get_font().gecko().mAllowZoom; let parent_zoom = context.style().get_parent_font().gecko().mAllowZoom; if zoom != parent_zoom { debug_assert!(!zoom, "We only ever disable text zoom (in svg:text), never enable it"); // can't borrow both device and font, use the take/put machinery let mut font = context.builder.take_font(); font.unzoom_fonts(context.device()); context.builder.put_font(font); } } // Whenever a single generic value is specified, gecko will do a bunch of // recalculation walking up the rule tree, including handling the font-size stuff. // It basically repopulates the font struct with the default font for a given // generic and language. We handle the font-size stuff separately, so this boils // down to just copying over the font-family lists (no other aspect of the default // font can be configured). if seen.contains(LonghandId::XLang) || font_family.is_some() { // if just the language changed, the inherited generic is all we need let mut generic = inherited_style.get_font().gecko().mGenericID; if let Some(ref declaration) = font_family { if let PropertyDeclaration::FontFamily(ref fam) = **declaration { if let Some(id) = fam.single_generic() { generic = id; // In case of a specified font family with a single generic, we will // end up setting font family below, but its value would get // overwritten later in the pipeline when cascading. // // We instead skip cascading font-family in that case. // // In case of the language changing, we wish for a specified font- // family to override this, so we do not skip cascading then. _skip_font_family = true; } } } // In case of just the language changing, the parent could have had no generic, // which Gecko just does regular cascading with. Do the same. // This can only happen in the case where the language changed but the family did not if generic != structs::kGenericFont_NONE { let pres_context = context.builder.device.pres_context(); let gecko_font = context.builder.mutate_font().gecko_mut(); gecko_font.mGenericID = generic; unsafe { bindings::Gecko_nsStyleFont_PrefillDefaultForGeneric( gecko_font, pres_context, generic, ); } } } % endif // It is important that font_size is computed before // the late properties (for em units), but after font-family // (for the base-font-size dependence for default and keyword font-sizes) // Additionally, when we support system fonts they will have to be // computed early, and *before* font_family, so I'm including // font_family here preemptively instead of keeping it within // the early properties. // // To avoid an extra iteration, we just pull out the property // during the early iteration and cascade them in order // after it. if !_skip_font_family { if let Some(ref declaration) = font_family { let discriminant = LonghandId::FontFamily as usize; (CASCADE_PROPERTY[discriminant])(declaration, &mut context, &mut cascade_info); % if product == "gecko": let device = context.builder.device; if let PropertyDeclaration::FontFamily(ref val) = **declaration { if val.get_system().is_some() { context.builder.mutate_font().fixup_system(); } else { context.builder.mutate_font().fixup_none_generic(device); } } % endif } } if let Some(ref declaration) = font_size { let discriminant = LonghandId::FontSize as usize; (CASCADE_PROPERTY[discriminant])(declaration, &mut context, &mut cascade_info); % if product == "gecko": // Font size must be explicitly inherited to handle lang changes and // scriptlevel changes. } else if seen.contains(LonghandId::XLang) || seen.contains(LonghandId::MozScriptLevel) || seen.contains(LonghandId::MozMinFontSizeRatio) || font_family.is_some() { let discriminant = LonghandId::FontSize as usize; let size = PropertyDeclaration::CSSWideKeyword( LonghandId::FontSize, CSSWideKeyword::Inherit); (CASCADE_PROPERTY[discriminant])(&size, &mut context, &mut cascade_info); % endif } % endif % endfor let mut builder = context.builder; { StyleAdjuster::new(&mut builder) .adjust(layout_parent_style, flags); } % if product == "gecko": if let Some(ref mut bg) = builder.get_background_if_mutated() { bg.fill_arrays(); } if let Some(ref mut svg) = builder.get_svg_if_mutated() { svg.fill_arrays(); } % endif % if product == "servo": if seen.contains(LonghandId::FontStyle) || seen.contains(LonghandId::FontWeight) || seen.contains(LonghandId::FontStretch) || seen.contains(LonghandId::FontFamily) { builder.mutate_font().compute_font_hash(); } % endif builder.build() } /// See StyleAdjuster::adjust_for_border_width. pub fn adjust_border_width(style: &mut StyleBuilder) { % for side in ["top", "right", "bottom", "left"]: // Like calling to_computed_value, which wouldn't type check. if style.get_border().clone_border_${side}_style().none_or_hidden() && style.get_border().border_${side}_has_nonzero_width() { style.set_border_${side}_width(NonNegativeAu::zero()); } % endfor } /// Adjusts borders as appropriate to account for a fragment's status as the /// first or last fragment within the range of an element. /// /// Specifically, this function sets border widths to zero on the sides for /// which the fragment is not outermost. #[cfg(feature = "servo")] #[inline] pub fn modify_border_style_for_inline_sides(style: &mut Arc<ComputedValues>, is_first_fragment_of_element: bool, is_last_fragment_of_element: bool) { fn modify_side(style: &mut Arc<ComputedValues>, side: PhysicalSide) { { let border = &style.border; let current_style = match side { PhysicalSide::Left => (border.border_left_width, border.border_left_style), PhysicalSide::Right => (border.border_right_width, border.border_right_style), PhysicalSide::Top => (border.border_top_width, border.border_top_style), PhysicalSide::Bottom => (border.border_bottom_width, border.border_bottom_style), }; if current_style == (NonNegativeAu::zero(), BorderStyle::none) { return; } } let mut style = Arc::make_mut(style); let border = Arc::make_mut(&mut style.border); match side { PhysicalSide::Left => { border.border_left_width = NonNegativeAu::zero(); border.border_left_style = BorderStyle::none; } PhysicalSide::Right => { border.border_right_width = NonNegativeAu::zero(); border.border_right_style = BorderStyle::none; } PhysicalSide::Bottom => { border.border_bottom_width = NonNegativeAu::zero(); border.border_bottom_style = BorderStyle::none; } PhysicalSide::Top => { border.border_top_width = NonNegativeAu::zero(); border.border_top_style = BorderStyle::none; } } } if !is_first_fragment_of_element { let side = style.writing_mode.inline_start_physical_side(); modify_side(style, side) } if !is_last_fragment_of_element { let side = style.writing_mode.inline_end_physical_side(); modify_side(style, side) } } #[macro_export] macro_rules! css_properties_accessors { ($macro_name: ident) => { $macro_name! { % for kind, props in [("Longhand", data.longhands), ("Shorthand", data.shorthands)]: % for property in props: % if not property.derived_from and not property.internal: % for name in [property.name] + property.alias: % if '-' in name: [${to_rust_ident(name).capitalize()}, Set${to_rust_ident(name).capitalize()}, PropertyId::${kind}(${kind}Id::${property.camel_case})], % endif [${to_camel_case(name)}, Set${to_camel_case(name)}, PropertyId::${kind}(${kind}Id::${property.camel_case})], % endfor % endif % endfor % endfor } } } #[macro_export] macro_rules! longhand_properties_idents { ($macro_name: ident) => { $macro_name! { % for property in data.longhands: { ${property.ident}, ${"true" if property.boxed else "false"} } % endfor } } }<|fim▁end|>
<|file_name|>SerialExceptionTest.java<|end_file_name|><|fim▁begin|>/* * 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.harmony.sql.tests.javax.sql.rowset.serial; import javax.sql.rowset.serial.SerialException; import junit.framework.TestCase; import org.apache.harmony.testframework.serialization.SerializationTest; public class SerialExceptionTest extends TestCase { /** * @tests serialization/deserialization compatibility. */ public void testSerializationSelf() throws Exception { SerializationTest.verifySelf(new SerialException()); } /** * @tests serialization/deserialization compatibility with RI. */ public void testSerializationCompatibility() throws Exception { SerializationTest.verifyGolden(this, new SerialException()); }<|fim▁hole|><|fim▁end|>
}
<|file_name|>BasicPantheonGenerator.java<|end_file_name|><|fim▁begin|>package pl.dzielins42.dmtools.generator.religion; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import pl.dzielins42.dmtools.model.enumeration.Alignment; import pl.dzielins42.dmtools.model.enumeration.Gender; import pl.dzielins42.dmtools.model.religion.Deity; import pl.dzielins42.dmtools.model.religion.Domain; import pl.dzielins42.dmtools.model.religion.Pantheon; import pl.dzielins42.dmtools.util.ProbabilityDistributionTable; public class BasicPantheonGenerator implements PantheonGenerator<BasicPantheonGeneratorOptions> { protected final int MAX_DIVINE_RANK = 25; public Pantheon generate(BasicPantheonGeneratorOptions options) { // Validate options if (options == null || options.getRandom() == null || options.getDomainsProbability() == null || options.getNameGenerator() == null) { throw new IllegalArgumentException(); } // Generate number of deities as random number between minDeitiesNumber // and maxDeitiesNumber int numberOfDeities = options.getMinDeitiesNumber(); if (options.getMinDeitiesNumber() != options.getMaxDeitiesNumber()) { numberOfDeities += options.getRandom().nextInt(options.getMaxDeitiesNumber() - options.getMinDeitiesNumber() + 1); } // Generate each deity independently List<Deity> deities = new ArrayList<Deity>(numberOfDeities); Deity deity; for (int i = 0; i < numberOfDeities; i++) { deity = generateDeity(options); deities.add(deity); } return new Pantheon("The Pantheon", deities); } protected Deity generateDeity(BasicPantheonGeneratorOptions options) { // Generate rank // TODO higher ranks should be rarer, probably by some mathematical // formula // Basic pantheons should have a few greater deities (16-20) but mostly // intermediate deities (11-15) and lesser deities (6-10), demigods // (1-5) and heroes (0) if the pantheon size enables it. There should // not be many overdeities (21+). int rank = options.getRandom().nextInt(MAX_DIVINE_RANK + 1); // Generate domains // Number of deity's domains is its ceiling of its rank divided by 5 int numberOfDomains = (int) Math.ceil(((double) rank) / 5.0d); // Temporarily it is 3 numberOfDomains = 3; // If it is overdeity, its power is beyond domain partitioning - it has // power over every domain List<Domain> domains = new ArrayList<Domain>(); Domain domain; while (domains.size() < numberOfDomains) { domain = options.getDomainsProbability().getRandom(options.getRandom()); if (!domains.contains(domain)) { domains.add(domain); } } Alignment alignment = getRandomAlignmentForDomains(domains, options); Gender gender = Gender.values()[options.getRandom().nextInt(Gender.values().length)]; Deity deity = new Deity(options.getNameGenerator().generate(gender, options), alignment, gender, rank, domains); return deity; }<|fim▁hole|> * Returns deity's {@link Domain} list suited for pre-drawn * {@link Alignment}. * * @param alignment * deity's alignment. * @param options * generation options. * @return deity's {@link Domain} list suited for pre-drawn * {@link Alignment}. */ protected Domain getRandomDomainForAlignment(Alignment alignment, BasicPantheonGeneratorOptions options) { return null; } /** * Returns deity's {@link Alignment} suited for pre-drawn {@link Domain} * list. For each domain, probability for each alignment is retrieved using * {@link Domain#getAlignmentProbabilities()} method. Values are used to * create new {@link ProbabilityDistributionTable}, which is used to get * returned alignment. * * @param domains * list of domains of the deity. * @param options * generation options. * @return deity's {@link Alignment} suited for pre-drawn {@link Domain} * list. */ protected Alignment getRandomAlignmentForDomains(List<Domain> domains, BasicPantheonGeneratorOptions options) { // TODO maybe return random alignment based on uniform distribution if (domains == null || domains.isEmpty()) { throw new IllegalArgumentException(); } double[] probabilities = new double[Alignment.values().length]; Arrays.fill(probabilities, 1.0d); for (Domain domain : domains) { for (int i = 0; i < probabilities.length; i++) { probabilities[i] *= domain.getAlignmentProbabilities().getProbabilities().get(i); } } ProbabilityDistributionTable<Alignment> tempPdt = new ProbabilityDistributionTable<Alignment>(Alignment.values(), probabilities); return tempPdt.getRandom(options.getRandom()); } }<|fim▁end|>
/**
<|file_name|>quote_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Copyright (c) 2012 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. import optparse import quote import sys import unittest verbose = False # Wrapped versions of the functions that we're testing, so that during # debugging we can more easily see what their inputs were. def VerboseQuote(in_string, specials, *args, **kwargs): if verbose: sys.stdout.write('Invoking quote(%s, %s, %s)\n' % (repr(in_string), repr(specials), ', '.join([repr(a) for a in args] + [repr(k) + ':' + repr(v) for k, v in kwargs]))) return quote.quote(in_string, specials, *args, **kwargs) def VerboseUnquote(in_string, specials, *args, **kwargs): if verbose: sys.stdout.write('Invoking unquote(%s, %s, %s)\n' % (repr(in_string), repr(specials), ', '.join([repr(a) for a in args] + [repr(k) + ':' + repr(v) for k, v in kwargs]))) return quote.unquote(in_string, specials, *args, **kwargs) class TestQuote(unittest.TestCase): # test utilities def generic_test(self, fn, in_args, expected_out_obj): actual = apply(fn, in_args) self.assertEqual(actual, expected_out_obj) def check_invertible(self, in_string, specials, escape='\\'): q = VerboseQuote(in_string, specials, escape) qq = VerboseUnquote(q, specials, escape) self.assertEqual(''.join(qq), in_string) def run_test_tuples(self, test_tuples): for func, in_args, expected in test_tuples: self.generic_test(func, in_args, expected) def testQuote(self): test_tuples = [[VerboseQuote, ['foo, bar, baz, and quux too!', 'abc'], 'foo, \\b\\ar, \\b\\az, \\and quux too!'], [VerboseQuote, ['when \\ appears in the input', 'a'], 'when \\\\ \\appe\\ars in the input']] self.run_test_tuples(test_tuples) def testUnquote(self): test_tuples = [[VerboseUnquote,<|fim▁hole|> ['key\\:still_key:value\\:more_value', ':'], ['key:still_key', ':', 'value:more_value']], [VerboseUnquote, ['about that sep\\ar\\ator in the beginning', 'ab'], ['', 'ab', 'out th', 'a', 't separator in the ', 'b', 'eginning']], [VerboseUnquote, ['the rain in spain fall\\s ma\\i\\nly on the plains', 'ins'], ['the ra', 'in', ' ', 'in', ' ', 's', 'pa', 'in', ' falls mainly o', 'n', ' the pla', 'ins']], ] self.run_test_tuples(test_tuples) def testInvertible(self): self.check_invertible('abcdefg', 'bc') self.check_invertible('a\\bcdefg', 'bc') self.check_invertible('ab\\cdefg', 'bc') self.check_invertible('\\ab\\cdefg', 'abc') self.check_invertible('abcde\\fg', 'efg') self.check_invertible('a\\b', '') # Invoke this file directly for simple manual testing. For running # the unittests, use the -t flag. Any flags to be passed to the # unittest module should be passed as after the optparse processing, # e.g., "quote_test.py -t -- -v" to pass the -v flag to the unittest # module. def main(argv): global verbose parser = optparse.OptionParser( usage='Usage: %prog [options] word...') parser.add_option('-s', '--special-chars', dest='special_chars', default=':', help='Special characters to quote (default is ":")') parser.add_option('-q', '--quote', dest='quote', default='\\', help='Quote or escape character (default is "\")') parser.add_option('-t', '--run-tests', dest='tests', action='store_true', help='Run built-in tests\n') parser.add_option('-u', '--unquote-input', dest='unquote_input', action='store_true', help='Unquote command line argument') parser.add_option('-v', '--verbose', dest='verbose', action='store_true', help='Verbose test output') options, args = parser.parse_args(argv) if options.verbose: verbose = True num_errors = 0 if options.tests: sys.argv = [sys.argv[0]] + args unittest.main() else: for word in args: # NB: there are inputs x for which quote(unquote(x) != x, but # there should be no input x for which unquote(quote(x)) != x. if options.unquote_input: qq = quote.unquote(word, options.special_chars, options.quote) sys.stdout.write('unquote(%s) = %s\n' % (word, ''.join(qq))) # There is no expected output for unquote -- this is just for # manual testing, so it is okay that we do not (and cannot) # update num_errors here. else: q = quote.quote(word, options.special_chars, options.quote) qq = quote.unquote(q, options.special_chars, options.quote) sys.stdout.write('quote(%s) = %s, unquote(%s) = %s\n' % (word, q, q, ''.join(qq))) if word != ''.join(qq): num_errors += 1 if num_errors > 0: sys.stderr.write('[ FAILED ] %d test failures\n' % num_errors) return num_errors if __name__ == '__main__': sys.exit(main(sys.argv[1:]))<|fim▁end|>
<|file_name|>predicates.rs<|end_file_name|><|fim▁begin|>use std::fmt::{Display, Formatter}; use std::fmt::Error; pub trait Predicate<T>: Display where T: Display { fn name(&self) -> &str; fn len(&self) -> usize; fn ids(&self) -> &Vec<T>; fn is_empty(&self) -> bool; } #[derive(Debug)] pub struct Pred<'a, T> where T: Display { name: &'a str, ids: Vec<T>, } impl <'a, T> Pred<'a, T> where T: Display { pub fn new(name: &'a str, ids: Vec<T>) -> Pred<'a, T> { Pred{ name: name, ids: ids } } } #[derive(Debug, PartialEq)] pub enum ID<'a> { Literal(&'a str), Variable(&'a str), } #[derive(Debug)] pub enum Stmt<'a> { Fact(Pred<'a, ID<'a>>), Rule(Pred<'a, ID<'a>>, Vec<Pred<'a, ID<'a>>>), Query(Pred<'a, ID<'a>>), } impl<'a> Display for Stmt<'a> { fn fmt(&self, f: &mut Formatter) -> Result<(), Error> { match *self { Stmt::Fact(ref pred) => write!(f, "{}.", pred), Stmt::Rule(ref head, ref tail) => { write!(f, "{} :- ", head).unwrap(); tail.iter().fold(true, |first, elem| { if !first { write!(f, ", ").unwrap(); } write!(f, "{}", elem).unwrap(); false }); write!(f, ".") } Stmt::Query(ref pred) => write!(f, "{}?", pred), } } } impl<'a, T> Display for Pred<'a, T> where T: Display { fn fmt(&self, f: &mut Formatter) -> Result<(), Error> { write!(f, "{}(", self.name).unwrap(); for (i, ch) in self.ids.iter().enumerate() { if i == 0 { write!(f, "{}", ch).unwrap(); } else { write!(f, ",{}", ch).unwrap(); } } write!(f, ")") } } impl<'a> Display for ID<'a> { fn fmt(&self, f: &mut Formatter) -> Result<(), Error> { match *self { ID::Literal(x) => write!(f, "'{}'", x), ID::Variable(x) => write!(f, "{}", x), } } } impl<'a, T> Predicate<T> for Pred<'a, T> where T: Display { fn len(&self) -> usize { self.ids.len() } fn name(&self) -> &str { self.name } fn ids(&self) -> &Vec<T> { &self.ids } fn is_empty(&self) -> bool { self.ids.is_empty()<|fim▁hole|>} #[cfg(test)] mod tests { use super::{Stmt, ID, Pred}; #[test] fn queries() { let test = Stmt::Query(Pred::new( "foo", vec![ID::Literal("bar"), ID::Literal("baz")], )); assert_eq!(format!("{}", test), "foo('bar','baz')?"); let single = Stmt::Query(Pred::new( "foo", vec![ID::Literal("bar")], )); assert_eq!(format!("{}", single), "foo('bar')?"); } #[test] fn facts() { let test = Stmt::Fact(Pred::new( "foo", vec![ID::Literal("bar"), ID::Literal("baz")], )); assert_eq!(format!("{}", test), "foo('bar','baz')."); let single = Stmt::Fact(Pred::new( "foo", vec![ID::Literal("bar")], )); assert_eq!(format!("{}", single), "foo('bar')."); } }<|fim▁end|>
}
<|file_name|>FairExhibitors.jest.tsx<|end_file_name|><|fim▁begin|>import { FairExhibitors_Test_Query } from "v2/__generated__/FairExhibitors_Test_Query.graphql"<|fim▁hole|>import { setupTestWrapperTL } from "v2/DevTools/setupTestWrapper" import { screen } from "@testing-library/react" jest.unmock("react-relay") jest.mock("v2/Utils/Hooks/useMatchMedia", () => ({ __internal__useMatchMedia: () => false, })) jest.mock("v2/System/Router/useRouter", () => ({ useRouter: () => ({ match: { location: { query: "", }, }, }), })) describe("FairExhibitors", () => { const { renderWithRelay } = setupTestWrapperTL<FairExhibitors_Test_Query>({ Component: FairExhibitorsFragmentContainer, query: graphql` query FairExhibitors_Test_Query($id: String!) @relay_test_operation { fair(id: $id) @principalField { ...FairExhibitors_fair } } `, variables: { id: "fair" }, }) afterEach(() => { jest.clearAllMocks() }) it("renders the exhibitors group", () => { renderWithRelay(FAIR_FIXTURE) expect(screen.getByText("A")).toBeInTheDocument() expect(screen.getByText("C")).toBeInTheDocument() expect(screen.getByText("D")).toBeInTheDocument() }) it("renders partners", () => { renderWithRelay(FAIR_FIXTURE) expect(screen.getByText("Partner 1")).toBeInTheDocument() expect(screen.getByText("Partner 3")).toBeInTheDocument() expect(screen.getByText("Partner 4")).toBeInTheDocument() }) }) const FAIR_FIXTURE = { Fair: () => ({ exhibitorsGroupedByName: [ { letter: "A", exhibitors: [ { partner: { internalID: "551db9a6726169422f4d0600", name: "Partner 1", cities: [], }, }, { partner: { internalID: "5a2025c78b0c144e0bba965e", name: "Partner 2", cities: [], }, }, ], }, { letter: "C", exhibitors: [ { partner: { internalID: "5266d825a09a67eac50001f1", name: "Partner 3", cities: [], }, }, ], }, { letter: "D", exhibitors: [ { partner: { internalID: "5694406501925b322c00010b", name: "Partner 4", cities: [], }, }, ], }, ], }), }<|fim▁end|>
import { graphql } from "react-relay" import { FairExhibitorsFragmentContainer } from "../FairExhibitors"
<|file_name|>type2name.cpp<|end_file_name|><|fim▁begin|>/*******************************************************************\ Module: Type Naming for C Author: Daniel Kroening, [email protected] \*******************************************************************/ #include <ctype.h> #include <i2string.h> #include <std_types.h> #include "type2name.h" /*******************************************************************\ Function: type2name Inputs: Outputs: Purpose: \*******************************************************************/ std::string type2name(const typet &type) { std::string result; if(type.id()=="") throw "Empty type encountered."; else if(type.id()=="empty") result+="V"; else if(type.id()=="signedbv") result+="S" + type.width().as_string(); else if(type.id()=="unsignedbv") result+="U" + type.width().as_string(); else if(type.is_bool()) result+="B"; else if(type.id()=="integer") result+="I"; else if(type.id()=="real") result+="R"; else if(type.id()=="complex") result+="C"; else if(type.id()=="float") result+="F"; else if(type.id()=="floatbv") result+="F" + type.width().as_string(); else if(type.id()=="fixed") result+="X"; else if(type.id()=="fixedbv") result+="X" + type.width().as_string(); else if(type.id()=="natural") result+="N"; else if(type.id()=="pointer") result+="*"; else if(type.id()=="reference") result+="&"; else if(type.is_code()) { const code_typet &t = to_code_type(type); const code_typet::argumentst arguments = t.arguments(); result+="P("; for (code_typet::argumentst::const_iterator it = arguments.begin(); it!=arguments.end(); it++) { result+=type2name(it->type()); result+="'" + it->get_identifier().as_string() + "'|"; } result.resize(result.size()-1); result+=")"; } else if(type.is_array()) { const array_typet &t = to_array_type(type); result+="ARR" + t.size().value().as_string(); } else if(type.id()=="incomplete_array") { result+="ARR?"; } else if(type.id()=="symbol") { result+="SYM#" + type.identifier().as_string() + "#"; } else if(type.id()=="struct" || type.id()=="union") { if(type.id()=="struct") result +="ST"; if(type.id()=="union") result +="UN"; const struct_typet &t = to_struct_type(type); const struct_typet::componentst &components = t.components(); result+="["; for(struct_typet::componentst::const_iterator it = components.begin(); it!=components.end(); it++) { result+=type2name(it->type()); result+="'" + it->name().as_string() + "'|"; } result.resize(result.size()-1); result+="]"; } else if(type.id()=="incomplete_struct") result +="ST?"; else if(type.id()=="incomplete_union") result +="UN?"; else if(type.id()=="c_enum") result +="EN" + type.width().as_string(); else if(type.id()=="incomplete_c_enum") result +="EN?"; else if(type.id()=="c_bitfield") { result+="BF" + type.size().as_string(); } else { throw (std::string("Unknown type '") + type.id().as_string() + "' encountered."); } if(type.has_subtype()) { result+="{"; result+=type2name(type.subtype()); result+="}"; } if(type.has_subtypes()) {<|fim▁hole|> result+="|"; } result.resize(result.size()-1); result+="$"; } return result; }<|fim▁end|>
result+="$"; forall_subtypes(it, type) { result+=type2name(*it);
<|file_name|>c_ai_basenpc.cpp<|end_file_name|><|fim▁begin|>//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// // // Purpose: // // $NoKeywords: $ //=============================================================================// #include "cbase.h" #include "c_AI_BaseNPC.h" #include "engine/IVDebugOverlay.h" #ifdef HL2_DLL #include "c_basehlplayer.h" #endif #include "death_pose.h" // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" IMPLEMENT_CLIENTCLASS_DT( C_AI_BaseNPC, DT_AI_BaseNPC, CAI_BaseNPC ) RecvPropInt( RECVINFO( m_lifeState ) ), RecvPropBool( RECVINFO( m_bPerformAvoidance ) ), RecvPropBool( RECVINFO( m_bIsMoving ) ), RecvPropBool( RECVINFO( m_bFadeCorpse ) ), RecvPropInt( RECVINFO ( m_iDeathPose) ), RecvPropInt( RECVINFO( m_iDeathFrame) ), RecvPropInt( RECVINFO( m_iSpeedModRadius ) ), RecvPropInt( RECVINFO( m_iSpeedModSpeed ) ), RecvPropInt( RECVINFO( m_bSpeedModActive ) ), RecvPropBool( RECVINFO( m_bImportanRagdoll ) ), END_RECV_TABLE() extern ConVar cl_npc_speedmod_intime; bool NPC_IsImportantNPC( C_BaseAnimating *pAnimating ) { C_AI_BaseNPC *pBaseNPC = dynamic_cast < C_AI_BaseNPC* > ( pAnimating ); if ( pBaseNPC == NULL ) return false; return pBaseNPC->ImportantRagdoll(); } C_AI_BaseNPC::C_AI_BaseNPC() { } //----------------------------------------------------------------------------- // Makes ragdolls ignore npcclip brushes //----------------------------------------------------------------------------- unsigned int C_AI_BaseNPC::PhysicsSolidMaskForEntity( void ) const { // This allows ragdolls to move through npcclip brushes if ( !IsRagdoll() ) { return MASK_NPCSOLID; } return MASK_SOLID; } void C_AI_BaseNPC::ClientThink( void ) { BaseClass::ClientThink(); #ifdef HL2_DLL C_BaseHLPlayer *pPlayer = dynamic_cast<C_BaseHLPlayer*>( C_BasePlayer::GetLocalPlayer() ); if ( ShouldModifyPlayerSpeed() == true ) { if ( pPlayer ) { float flDist = (GetAbsOrigin() - pPlayer->GetAbsOrigin()).LengthSqr(); if ( flDist <= GetSpeedModifyRadius() ) { if ( pPlayer->m_hClosestNPC ) { if ( pPlayer->m_hClosestNPC != this ) { float flDistOther = (pPlayer->m_hClosestNPC->GetAbsOrigin() - pPlayer->GetAbsOrigin()).Length(); //If I'm closer than the other NPC then replace it with myself. if ( flDist < flDistOther ) { pPlayer->m_hClosestNPC = this; pPlayer->m_flSpeedModTime = gpGlobals->curtime + cl_npc_speedmod_intime.GetFloat(); } } } else { pPlayer->m_hClosestNPC = this; pPlayer->m_flSpeedModTime = gpGlobals->curtime + cl_npc_speedmod_intime.GetFloat();<|fim▁hole|> } } } #endif // HL2_DLL } void C_AI_BaseNPC::OnDataChanged( DataUpdateType_t type ) { BaseClass::OnDataChanged( type ); if ( ShouldModifyPlayerSpeed() == true ) { SetNextClientThink( CLIENT_THINK_ALWAYS ); } } void C_AI_BaseNPC::GetRagdollCurSequence( matrix3x4_t *curBones, float flTime ) { GetRagdollCurSequenceWithDeathPose( this, curBones, flTime, m_iDeathPose, m_iDeathFrame ); }<|fim▁end|>
}
<|file_name|>TextPasteCommand.cpp<|end_file_name|><|fim▁begin|>/* This file is part of the KDE project * Copyright (C) 2009 Pierre Stirnweiss <[email protected]> * Copyright (C) 2011 Boudewijn Rempt <[email protected]> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA.*/ #include "TextPasteCommand.h" #include <KoTextEditor.h> #include <KoTextDocument.h> #include <KoTextPaste.h> #include <KoChangeTracker.h> #include <KoShapeController.h> #include <klocale.h> #include <kdebug.h> #include <kaction.h> #include <QTextDocument> #include <QApplication> #include <QMimeData> #include "ChangeTrackedDeleteCommand.h" #include "DeleteCommand.h" #include "KoDocumentRdfBase.h" #ifdef SHOULD_BUILD_RDF #include <Soprano/Soprano> #else namespace Soprano { class Model { }; } #endif TextPasteCommand::TextPasteCommand(const QMimeData *mimeData, QTextDocument *document, KoShapeController *shapeController, KoCanvasBase *canvas, KUndo2Command *parent, bool pasteAsText) : KUndo2Command (parent), m_mimeData(mimeData), m_document(document), m_rdf(0), m_shapeController(shapeController), m_canvas(canvas), m_pasteAsText(pasteAsText), m_first(true) { m_rdf = qobject_cast<KoDocumentRdfBase*>(shapeController->resourceManager()->resource(KoText::DocumentRdf).value<QObject*>()); if (m_pasteAsText) setText(i18nc("(qtundo-format)", "Paste As Text")); else setText(i18nc("(qtundo-format)", "Paste")); } void TextPasteCommand::undo() { KUndo2Command::undo(); } void TextPasteCommand::redo() { if (m_document.isNull()) return;<|fim▁hole|> if (!m_first) { KUndo2Command::redo(); } else { editor->beginEditBlock(); //this is needed so Qt does not merge successive paste actions together m_first = false; if (editor->hasSelection()) { //TODO editor->addCommand(new DeleteCommand(DeleteCommand::NextChar, m_document.data(), m_shapeController, this)); } // check for mime type if (m_mimeData->hasFormat(KoOdf::mimeType(KoOdf::Text)) || m_mimeData->hasFormat(KoOdf::mimeType(KoOdf::OpenOfficeClipboard)) ) { KoOdf::DocumentType odfType = KoOdf::Text; if (!m_mimeData->hasFormat(KoOdf::mimeType(odfType))) { odfType = KoOdf::OpenOfficeClipboard; } if (m_pasteAsText) { editor->insertText(m_mimeData->text()); } else { QSharedPointer<Soprano::Model> rdfModel; #ifdef SHOULD_BUILD_RDF if(!m_rdf) { rdfModel = QSharedPointer<Soprano::Model>(Soprano::createModel()); } else { rdfModel = m_rdf->model(); } #endif KoTextPaste paste(editor, m_shapeController, rdfModel, m_canvas, this); paste.paste(odfType, m_mimeData); #ifdef SHOULD_BUILD_RDF if (m_rdf) { m_rdf->updateInlineRdfStatements(editor->document()); } #endif } } else if (!m_pasteAsText && m_mimeData->hasHtml()) { editor->insertHtml(m_mimeData->html()); } else if (m_pasteAsText || m_mimeData->hasText()) { editor->insertText(m_mimeData->text()); } editor->endEditBlock(); //see above beginEditBlock } }<|fim▁end|>
KoTextDocument textDocument(m_document); KoTextEditor *editor = textDocument.textEditor();
<|file_name|>OpenmrsProfile.java<|end_file_name|><|fim▁begin|>/** * This Source Code Form is subject to the terms of the Mozilla Public License, * v. 2.0. If a copy of the MPL was not distributed with this file, You can * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.annotation; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Place it on classes which you want to be beans created conditionally based on<|fim▁hole|>@Target( { ElementType.TYPE }) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface OpenmrsProfile { public String openmrsVersion() default ""; public String[] modules() default {}; }<|fim▁end|>
* OpenMRS version and/or started modules. * * @since 1.10, 1.9.8, 1.8.5, 1.7.5 */
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main //go:generate go run main.go import ( "os" chart "github.com/wcharczuk/go-chart/v2" ) func main() { /* In this example we add a new type of series, a `SimpleMovingAverageSeries` that takes another series as a required argument. InnerSeries only needs to implement `ValuesProvider`, so really you could chain `SimpleMovingAverageSeries` together if you wanted. */ mainSeries := chart.ContinuousSeries{ Name: "A test series", XValues: chart.Seq{Sequence: chart.NewLinearSequence().WithStart(1.0).WithEnd(100.0)}.Values(), //generates a []float64 from 1.0 to 100.0 in 1.0 step increments, or 100 elements. YValues: chart.Seq{Sequence: chart.NewRandomSequence().WithLen(100).WithMin(0).WithMax(100)}.Values(), //generates a []float64 randomly from 0 to 100 with 100 elements. } // note we create a LinearRegressionSeries series by assignin the inner series. // we need to use a reference because `.Render()` needs to modify state within the series. linRegSeries := &chart.LinearRegressionSeries{ InnerSeries: mainSeries, } // we can optionally set the `WindowSize` property which alters how the moving average is calculated. graph := chart.Chart{ Series: []chart.Series{ mainSeries, linRegSeries, }, } f, _ := os.Create("output.png") defer f.Close() graph.Render(chart.PNG, f)<|fim▁hole|><|fim▁end|>
}
<|file_name|>0006_auto_20161015_2113.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2016-10-16 00:13 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [<|fim▁hole|> ] operations = [ migrations.AlterField( model_name='media', name='media_service', field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='api.MediaService'), ), ]<|fim▁end|>
('api', '0005_queue_name'),
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import mdDialog from './mdDialog.vue'; import mdDialogTitle from './mdDialogTitle.vue'; import mdDialogContent from './mdDialogContent.vue'; import mdDialogActions from './mdDialogActions.vue'; import mdDialogAlert from './presets/mdDialogAlert.vue'; import mdDialogConfirm from './presets/mdDialogConfirm.vue'; import mdDialogPrompt from './presets/mdDialogPrompt.vue'; import mdDialogTheme from './mdDialog.theme'; export default function install(Vue) { Vue.component('md-dialog', mdDialog); Vue.component('md-dialog-title', mdDialogTitle); Vue.component('md-dialog-content', mdDialogContent); Vue.component('md-dialog-actions', mdDialogActions); /* Presets */ Vue.component('md-dialog-alert', mdDialogAlert); Vue.component('md-dialog-confirm', mdDialogConfirm);<|fim▁hole|>}<|fim▁end|>
Vue.component('md-dialog-prompt', mdDialogPrompt); Vue.material.styles.push(mdDialogTheme);
<|file_name|>basic_no_conf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ This example explores how logging behaves if no special configuration is performed. conclusions: - we get an error printout which DOES NOT stop the program that we do not have handlers. "No handlers could be found for logger "root"" This is printed once and then no more. this is true for both "__main__" and "root" which is the logger you get when you do 'logging.getLogger()' """ import logging # logger = logging.getLogger(__name__) logger = logging.getLogger() print("warning") logger.warning("this is a warning message") print("debug") logger.debug("this is a debug message")<|fim▁hole|><|fim▁end|>
print("error") logger.error("this is an error message")
<|file_name|>point_vector.go<|end_file_name|><|fim▁begin|>// Copyright 2017 Google 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. package s2 // Shape interface enforcement var ( _ Shape = (*PointVector)(nil) )<|fim▁hole|>// PointVector is a Shape representing a set of Points. Each point // is represented as a degenerate edge with the same starting and ending // vertices. // // This type is useful for adding a collection of points to an ShapeIndex. // // Its methods are on *PointVector due to implementation details of ShapeIndex. type PointVector []Point func (p *PointVector) NumEdges() int { return len(*p) } func (p *PointVector) Edge(i int) Edge { return Edge{(*p)[i], (*p)[i]} } func (p *PointVector) ReferencePoint() ReferencePoint { return OriginReferencePoint(false) } func (p *PointVector) NumChains() int { return len(*p) } func (p *PointVector) Chain(i int) Chain { return Chain{i, 1} } func (p *PointVector) ChainEdge(i, j int) Edge { return Edge{(*p)[i], (*p)[j]} } func (p *PointVector) ChainPosition(e int) ChainPosition { return ChainPosition{e, 0} } func (p *PointVector) Dimension() int { return 0 } func (p *PointVector) IsEmpty() bool { return defaultShapeIsEmpty(p) } func (p *PointVector) IsFull() bool { return defaultShapeIsFull(p) } func (p *PointVector) typeTag() typeTag { return typeTagPointVector } func (p *PointVector) privateInterface() {}<|fim▁end|>
<|file_name|>set_cookie.rs<|end_file_name|><|fim▁begin|>use header::{Header, HeaderFormat}; use std::fmt::{self, Display}; use std::str::from_utf8; use cookie::Cookie; use cookie::CookieJar; /// `Set-Cookie` header, defined [RFC6265](http://tools.ietf.org/html/rfc6265#section-4.1) /// /// The Set-Cookie HTTP response header is used to send cookies from the /// server to the user agent. /// /// Informally, the Set-Cookie response header contains the header name /// "Set-Cookie" followed by a ":" and a cookie. Each cookie begins with /// a name-value-pair, followed by zero or more attribute-value pairs. /// /// # ABNF /// ```plain /// set-cookie-header = "Set-Cookie:" SP set-cookie-string /// set-cookie-string = cookie-pair *( ";" SP cookie-av ) /// cookie-pair = cookie-name "=" cookie-value /// cookie-name = token /// cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE ) /// cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E /// ; US-ASCII characters excluding CTLs, /// ; whitespace DQUOTE, comma, semicolon, /// ; and backslash /// token = <token, defined in [RFC2616], Section 2.2> /// /// cookie-av = expires-av / max-age-av / domain-av / /// path-av / secure-av / httponly-av / /// extension-av /// expires-av = "Expires=" sane-cookie-date /// sane-cookie-date = <rfc1123-date, defined in [RFC2616], Section 3.3.1> /// max-age-av = "Max-Age=" non-zero-digit *DIGIT /// ; In practice, both expires-av and max-age-av /// ; are limited to dates representable by the /// ; user agent. /// non-zero-digit = %x31-39 /// ; digits 1 through 9 /// domain-av = "Domain=" domain-value /// domain-value = <subdomain> /// ; defined in [RFC1034], Section 3.5, as /// ; enhanced by [RFC1123], Section 2.1 /// path-av = "Path=" path-value /// path-value = <any CHAR except CTLs or ";"> /// secure-av = "Secure" /// httponly-av = "HttpOnly" /// extension-av = <any CHAR except CTLs or ";"> /// ``` /// /// # Example values /// * `SID=31d4d96e407aad42` /// * `lang=en-US; Expires=Wed, 09 Jun 2021 10:18:14 GMT` /// * `lang=; Expires=Sun, 06 Nov 1994 08:49:37 GMT` /// * `lang=en-US; Path=/; Domain=example.com` /// /// # Example /// ``` /// # extern crate hyper; /// # extern crate cookie; /// # fn main() { /// // extern crate cookie; /// /// use hyper::header::{Headers, SetCookie}; /// use cookie::Cookie as CookiePair; /// /// let mut headers = Headers::new(); /// let mut cookie = CookiePair::new("foo".to_owned(), "bar".to_owned()); /// /// cookie.path = Some("/path".to_owned()); /// cookie.domain = Some("example.com".to_owned()); /// /// headers.set( /// SetCookie(vec![ /// cookie, /// CookiePair::new("baz".to_owned(), "quux".to_owned()), /// ]) /// ); /// # } /// ``` #[derive(Clone, PartialEq, Debug)] pub struct SetCookie(pub Vec<Cookie>); __hyper__deref!(SetCookie => Vec<Cookie>); impl Header for SetCookie { fn header_name() -> &'static str { "Set-Cookie" } fn parse_header(raw: &[Vec<u8>]) -> ::Result<SetCookie> { let mut set_cookies = Vec::with_capacity(raw.len()); for set_cookies_raw in raw { if let Ok(s) = from_utf8(&set_cookies_raw[..]) { if let Ok(cookie) = s.parse() { set_cookies.push(cookie); } } } if !set_cookies.is_empty() { Ok(SetCookie(set_cookies)) } else { Err(::Error::Header) } } } impl HeaderFormat for SetCookie { fn fmt_header(&self, f: &mut fmt::Formatter) -> fmt::Result { for (i, cookie) in self.0.iter().enumerate() { if i != 0 { try!(f.write_str("\r\nSet-Cookie: ")); } try!(Display::fmt(cookie, f)); } Ok(()) } } impl SetCookie { /// Use this to create SetCookie header from CookieJar using /// calculated delta. pub fn from_cookie_jar(jar: &CookieJar) -> SetCookie { SetCookie(jar.delta()) } /// Use this on client to apply changes from SetCookie to CookieJar. /// Note that this will `panic!` if `CookieJar` is not root. pub fn apply_to_cookie_jar(&self, jar: &mut CookieJar) { for cookie in self.iter() { jar.add_original(cookie.clone()) } } } #[test] fn test_parse() { let h = Header::parse_header(&[b"foo=bar; HttpOnly".to_vec()][..]); let mut c1 = Cookie::new("foo".to_owned(), "bar".to_owned()); c1.httponly = true; assert_eq!(h.ok(), Some(SetCookie(vec![c1]))); } #[test] fn test_fmt() { use header::Headers; let mut cookie = Cookie::new("foo".to_owned(), "bar".to_owned()); cookie.httponly = true; cookie.path = Some("/p".to_owned()); let cookies = SetCookie(vec![cookie, Cookie::new("baz".to_owned(), "quux".to_owned())]); let mut headers = Headers::new(); headers.set(cookies); assert_eq!( &headers.to_string()[..], "Set-Cookie: foo=bar; HttpOnly; Path=/p\r\nSet-Cookie: baz=quux; Path=/\r\n"); } #[test] fn cookie_jar() { let jar = CookieJar::new(b"secret"); let cookie = Cookie::new("foo".to_owned(), "bar".to_owned()); jar.encrypted().add(cookie); let cookies = SetCookie::from_cookie_jar(&jar); let mut new_jar = CookieJar::new(b"secret"); cookies.apply_to_cookie_jar(&mut new_jar); assert_eq!(jar.encrypted().find("foo"), new_jar.encrypted().find("foo")); assert_eq!(jar.iter().collect::<Vec<Cookie>>(), new_jar.iter().collect::<Vec<Cookie>>());<|fim▁hole|>}<|fim▁end|>
<|file_name|>CreateTodoForm.js<|end_file_name|><|fim▁begin|>import {Component} from 'react';<|fim▁hole|>import './CreateTodoForm.styl'; class CreateTodoForm extends Component { render() { return ( <form className="create-todo-form" onSubmit={this.props.handleSubmit} autoComplete="off"> <input type="text" placeholder="Todo text..." {...this.props.fields.text}></input> <button type="submit">Create</button> </form> ); } } CreateTodoForm.propTypes = { fields: React.PropTypes.object.isRequired, handleSubmit: React.PropTypes.func.isRequired }; export default reduxForm({ form: 'CreateTodoForm', fields: ['text'] })(CreateTodoForm);<|fim▁end|>
import {reduxForm} from 'redux-form';
<|file_name|>DataDigest.ts<|end_file_name|><|fim▁begin|>namespace KGS { export class DataDigest { public timestamp: Date = new Date(); public perfstamp: number = performance.now(); public username: boolean = false; public joinedChannelIds: boolean = false; public joinFailedChannelIds: number[]; public notifyChannelId: number; public channels: { [channelId: number]: boolean } = {}; public touchChannel(channelId: number) { this.channels[channelId] = true; } public channelOwners: { [channelId: number]: boolean } = {}; public touchChannelOwners(channelId: number) { this.channelOwners[channelId] = true; } public channelUsers: { [channelId: number]: boolean } = {}; public touchChannelUsers(channelId: number) { this.channelUsers[channelId] = true; } public channelGames: { [channelId: number]: boolean } = {}; public touchChannelGames(channelId: number) { this.channelGames[channelId] = true; } public channelChat: { [channelId: number]: boolean } = {}; public touchChannelChat(channelId: number) { this.channelChat[channelId] = true; } public users: { [name: string]: boolean } = {}; public touchUser(name: string) { this.users[name] = true; } public gameTrees: { [channelId: number]: boolean } = {}; public touchGameTree(channelId: number) { this.gameTrees[channelId] = true; }<|fim▁hole|> public gameActions: { [channelId: number]: boolean } = {}; public touchGameActions(channelId: number) { this.gameActions[channelId] = true; } public automatch: boolean = false; } }<|fim▁end|>
public gameClocks: { [channelId: number]: boolean } = {}; public touchGameClocks(channelId: number) { this.gameClocks[channelId] = true; }
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap;<|fim▁hole|> *nucleotide_counts(strain).get(&c).unwrap() } pub fn nucleotide_counts (strain: &str) -> HashMap<char, usize> { let mut map = HashMap::new(); // Default values for c in "AGTC".chars() { map.insert(c, 0); } // Count occurrences for c in strain.chars() { *map.get_mut(&c).unwrap() += 1 } map }<|fim▁end|>
pub fn count (c: char, strain: &str) -> usize {
<|file_name|>master.py<|end_file_name|><|fim▁begin|>"""Controlles a bunch of remotes.""" import asyncio import functools import logging import os import pathlib import signal import sys import traceback from implant import commands, connect, core, testing log = logging.getLogger(__name__) PLUGINS_ENTRY_POINT_GROUP = 'implant.plugins' def parse_command(line): """Parse a command from line.""" args = [] kwargs = {} command, *parts = line.split(' ') for part in parts: if '=' in part: k, v = part.split('=') kwargs[k] = v else: args.append(part) return command, args, kwargs async def _execute_command(io_queues, line): default_lines = { b'e\n': (b'implant.commands:Echo data=bar\n', {}), b'i\n': (b'implant.core:InvokeImport fullname=implant.commands\n', {}), b'\n': (b'implant.commands:SystemLoad data=bar\n', {}), } if line in default_lines: line, _ = default_lines[line] command_name, _, params = parse_command(line[:-1].decode()) log.info("sending: %s %s", command_name, params) try: result = await io_queues.execute(command_name, **params) except Exception as ex: # noqa log.error("Error:\n%s", traceback.format_exc()) else: return result async def log_remote_stderr(remote): # await remote.launched() if remote.stderr: log.info("Logging remote stderr: %s", remote) async for line in remote.stderr: log.debug("\tRemote #%s: %s", remote.pid, line[:-1].decode()) class Console: def __init__(self, connectors, *, loop=None, **options): self.loop = loop if loop is not None else asyncio.get_event_loop() self.options = options self.connectors = connectors async def feed_stdin_to_remotes(self, remotes): try: async with core.Incomming(pipe=sys.stdin, loop=self.loop) as reader: while True: line = await reader.readline() if line == b'': break result = await asyncio.gather( *(_execute_command(remote, line) for remote, *_ in remotes.values()), loop=self.loop ) print("< {}\n >".format(result), end="") except asyncio.CancelledError: log.info("Terminating...") except Exception as ex: log.info(ex) for remote, fut_remote, error_log in remotes.values(): fut_remote.cancel() await fut_remote<|fim▁hole|> async def connect(self): remotes = {} for connector, default_args in self.connectors.items(): if remotes.get(connector, None) is not None: log.warning('Process for %s already launched! Skipping...', connector) continue remote = await connector.launch( options=self.options, **default_args, loop=self.loop ) fut_remote = asyncio.ensure_future(remote.communicate(), loop=self.loop) error_log = asyncio.ensure_future(log_remote_stderr(remote), loop=self.loop) remotes[connector] = (remote, fut_remote, error_log) return remotes async def run(self): never_ending = asyncio.Future(loop=self.loop) remotes = await self.connect() feeder = asyncio.ensure_future(self.feed_stdin_to_remotes(remotes), loop=self.loop) def _sigint_handler(): log.info('SIGINT...') never_ending.cancel() self.loop.add_signal_handler(signal.SIGINT, _sigint_handler) try: await never_ending except asyncio.CancelledError: log.debug('Cancelled') pass feeder.cancel() await feeder def main(debug=False, log_config=None): log.info('deballator master process: %s', os.getpid()) loop = asyncio.get_event_loop() # replace existing signal handler with noop as long as our remotes are not fully running # otherwise cancellation of process startup will lead to orphaned remote processes def noop(): log.error('Noop on signal SIGINT') loop.add_signal_handler(signal.SIGINT, noop) options = { 'debug': debug, 'log_config': log_config, # 'venv': False, # 'venv': True, # 'venv': '~/.implant', } # if debug: # log.setLevel(logging.DEBUG) console = Console({ # testing.PipeConnector(loop=loop): {}, connect.Local(): { 'python_bin': pathlib.Path('~/.pyenv/versions/3.5.2/bin/python').expanduser(), }, # connect.Ssh(hostname='localhost'): { # 'python_bin': pathlib.Path('~/.pyenv/versions/3.5.2/bin/python').expanduser(), # }, # connect.Lxd( # container='zesty', # hostname='localhost', # ): { # 'python_bin': pathlib.Path('/usr/bin/python3').expanduser() # }, }, loop=loop, **options) task = asyncio.ensure_future(console.run()) try: loop.run_until_complete(task) except KeyboardInterrupt: log.error('Keyboard interrupt...') task.cancel() loop.run_until_complete(task) except BaseException as ex: core.log.error("Error %s:\n%s", type(ex), traceback.format_exc()) finally: for task in asyncio.Task.all_tasks(): if not task.done(): log.error("pending: %s", task) log.info(' - '.join(["this is the end"] * 3)) loop.stop() loop.close()<|fim▁end|>
error_log.cancel() await error_log
<|file_name|>modulegen__gcc_LP64.py<|end_file_name|><|fim▁begin|>from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) return True pybindgen.settings.error_handler = ErrorHandler() import sys def module_init(): root_module = Module('ns.network', cpp_namespace='::ns3') return root_module def register_types(module): root_module = module.get_root() ## packetbb.h (module 'network'): ns3::PbbAddressLength [enumeration] module.add_enum('PbbAddressLength', ['IPV4', 'IPV6']) ## ethernet-header.h (module 'network'): ns3::ethernet_header_t [enumeration] module.add_enum('ethernet_header_t', ['LENGTH', 'VLAN', 'QINQ']) ## address.h (module 'network'): ns3::Address [class] module.add_class('Address') ## address.h (module 'network'): ns3::Address::MaxSize_e [enumeration] module.add_enum('MaxSize_e', ['MAX_SIZE'], outer_class=root_module['ns3::Address']) ## application-container.h (module 'network'): ns3::ApplicationContainer [class] module.add_class('ApplicationContainer') ## trace-helper.h (module 'network'): ns3::AsciiTraceHelper [class] module.add_class('AsciiTraceHelper') ## trace-helper.h (module 'network'): ns3::AsciiTraceHelperForDevice [class] module.add_class('AsciiTraceHelperForDevice', allow_subclassing=True) ## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList [class] module.add_class('AttributeConstructionList', import_from_module='ns.core') ## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item [struct] module.add_class('Item', import_from_module='ns.core', outer_class=root_module['ns3::AttributeConstructionList']) ## buffer.h (module 'network'): ns3::Buffer [class] module.add_class('Buffer') ## buffer.h (module 'network'): ns3::Buffer::Iterator [class] module.add_class('Iterator', outer_class=root_module['ns3::Buffer']) ## packet.h (module 'network'): ns3::ByteTagIterator [class] module.add_class('ByteTagIterator') ## packet.h (module 'network'): ns3::ByteTagIterator::Item [class] module.add_class('Item', outer_class=root_module['ns3::ByteTagIterator']) ## byte-tag-list.h (module 'network'): ns3::ByteTagList [class] module.add_class('ByteTagList') ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator [class] module.add_class('Iterator', outer_class=root_module['ns3::ByteTagList']) ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item [struct] module.add_class('Item', outer_class=root_module['ns3::ByteTagList::Iterator']) ## callback.h (module 'core'): ns3::CallbackBase [class] module.add_class('CallbackBase', import_from_module='ns.core') ## channel-list.h (module 'network'): ns3::ChannelList [class] module.add_class('ChannelList') ## data-rate.h (module 'network'): ns3::DataRate [class] module.add_class('DataRate') ## event-id.h (module 'core'): ns3::EventId [class] module.add_class('EventId', import_from_module='ns.core') ## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress [class] module.add_class('Inet6SocketAddress') ## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress [class] root_module['ns3::Inet6SocketAddress'].implicitly_converts_to(root_module['ns3::Address']) ## inet-socket-address.h (module 'network'): ns3::InetSocketAddress [class] module.add_class('InetSocketAddress') ## inet-socket-address.h (module 'network'): ns3::InetSocketAddress [class] root_module['ns3::InetSocketAddress'].implicitly_converts_to(root_module['ns3::Address']) ## ipv4-address.h (module 'network'): ns3::Ipv4Address [class] module.add_class('Ipv4Address') ## ipv4-address.h (module 'network'): ns3::Ipv4Address [class] root_module['ns3::Ipv4Address'].implicitly_converts_to(root_module['ns3::Address']) ## ipv4-address.h (module 'network'): ns3::Ipv4Mask [class] module.add_class('Ipv4Mask') ## ipv6-address.h (module 'network'): ns3::Ipv6Address [class] module.add_class('Ipv6Address') ## ipv6-address.h (module 'network'): ns3::Ipv6Address [class] root_module['ns3::Ipv6Address'].implicitly_converts_to(root_module['ns3::Address']) ## ipv6-address.h (module 'network'): ns3::Ipv6Prefix [class] module.add_class('Ipv6Prefix') ## mac48-address.h (module 'network'): ns3::Mac48Address [class] module.add_class('Mac48Address') ## mac48-address.h (module 'network'): ns3::Mac48Address [class] root_module['ns3::Mac48Address'].implicitly_converts_to(root_module['ns3::Address']) ## mac64-address.h (module 'network'): ns3::Mac64Address [class] module.add_class('Mac64Address') ## mac64-address.h (module 'network'): ns3::Mac64Address [class] root_module['ns3::Mac64Address'].implicitly_converts_to(root_module['ns3::Address']) ## net-device-container.h (module 'network'): ns3::NetDeviceContainer [class] module.add_class('NetDeviceContainer') ## node-container.h (module 'network'): ns3::NodeContainer [class] module.add_class('NodeContainer') ## node-list.h (module 'network'): ns3::NodeList [class] module.add_class('NodeList') ## object-base.h (module 'core'): ns3::ObjectBase [class] module.add_class('ObjectBase', allow_subclassing=True, import_from_module='ns.core') ## object.h (module 'core'): ns3::ObjectDeleter [struct] module.add_class('ObjectDeleter', import_from_module='ns.core') ## object-factory.h (module 'core'): ns3::ObjectFactory [class] module.add_class('ObjectFactory', import_from_module='ns.core') ## packet-metadata.h (module 'network'): ns3::PacketMetadata [class] module.add_class('PacketMetadata') ## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item [struct] module.add_class('Item', outer_class=root_module['ns3::PacketMetadata']) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item [enumeration] module.add_enum('', ['PAYLOAD', 'HEADER', 'TRAILER'], outer_class=root_module['ns3::PacketMetadata::Item']) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::ItemIterator [class] module.add_class('ItemIterator', outer_class=root_module['ns3::PacketMetadata']) ## packet-socket-address.h (module 'network'): ns3::PacketSocketAddress [class] module.add_class('PacketSocketAddress') ## packet-socket-address.h (module 'network'): ns3::PacketSocketAddress [class] root_module['ns3::PacketSocketAddress'].implicitly_converts_to(root_module['ns3::Address']) ## packet-socket-helper.h (module 'network'): ns3::PacketSocketHelper [class] module.add_class('PacketSocketHelper') ## packet.h (module 'network'): ns3::PacketTagIterator [class] module.add_class('PacketTagIterator') ## packet.h (module 'network'): ns3::PacketTagIterator::Item [class] module.add_class('Item', outer_class=root_module['ns3::PacketTagIterator']) ## packet-tag-list.h (module 'network'): ns3::PacketTagList [class] module.add_class('PacketTagList') ## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData [struct] module.add_class('TagData', outer_class=root_module['ns3::PacketTagList']) ## packetbb.h (module 'network'): ns3::PbbAddressTlvBlock [class] module.add_class('PbbAddressTlvBlock') ## packetbb.h (module 'network'): ns3::PbbTlvBlock [class] module.add_class('PbbTlvBlock') ## pcap-file.h (module 'network'): ns3::PcapFile [class] module.add_class('PcapFile') ## trace-helper.h (module 'network'): ns3::PcapHelper [class] module.add_class('PcapHelper') ## trace-helper.h (module 'network'): ns3::PcapHelper [enumeration] module.add_enum('', ['DLT_NULL', 'DLT_EN10MB', 'DLT_PPP', 'DLT_RAW', 'DLT_IEEE802_11', 'DLT_PRISM_HEADER', 'DLT_IEEE802_11_RADIO'], outer_class=root_module['ns3::PcapHelper']) ## trace-helper.h (module 'network'): ns3::PcapHelperForDevice [class] module.add_class('PcapHelperForDevice', allow_subclassing=True) ## random-variable.h (module 'core'): ns3::RandomVariable [class] module.add_class('RandomVariable', import_from_module='ns.core') ## rng-seed-manager.h (module 'core'): ns3::RngSeedManager [class] module.add_class('RngSeedManager', import_from_module='ns.core') ## sequence-number.h (module 'network'): ns3::SequenceNumber<unsigned int, int> [class] module.add_class('SequenceNumber32') ## sequence-number.h (module 'network'): ns3::SequenceNumber<unsigned short, short> [class] module.add_class('SequenceNumber16') ## random-variable.h (module 'core'): ns3::SequentialVariable [class] module.add_class('SequentialVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariable']) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter> [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Object', 'ns3::ObjectBase', 'ns3::ObjectDeleter'], parent=root_module['ns3::ObjectBase'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simulator.h (module 'core'): ns3::Simulator [class] module.add_class('Simulator', destructor_visibility='private', import_from_module='ns.core') ## system-wall-clock-ms.h (module 'core'): ns3::SystemWallClockMs [class] module.add_class('SystemWallClockMs', import_from_module='ns.core') ## tag.h (module 'network'): ns3::Tag [class] module.add_class('Tag', parent=root_module['ns3::ObjectBase']) ## tag-buffer.h (module 'network'): ns3::TagBuffer [class] module.add_class('TagBuffer') ## random-variable.h (module 'core'): ns3::TriangularVariable [class] module.add_class('TriangularVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariable']) ## type-id.h (module 'core'): ns3::TypeId [class] module.add_class('TypeId', import_from_module='ns.core') ## type-id.h (module 'core'): ns3::TypeId::AttributeFlag [enumeration] module.add_enum('AttributeFlag', ['ATTR_GET', 'ATTR_SET', 'ATTR_CONSTRUCT', 'ATTR_SGC'], outer_class=root_module['ns3::TypeId'], import_from_module='ns.core') ## type-id.h (module 'core'): ns3::TypeId::AttributeInformation [struct] module.add_class('AttributeInformation', import_from_module='ns.core', outer_class=root_module['ns3::TypeId']) ## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation [struct] module.add_class('TraceSourceInformation', import_from_module='ns.core', outer_class=root_module['ns3::TypeId']) ## random-variable.h (module 'core'): ns3::UniformVariable [class] module.add_class('UniformVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariable']) ## random-variable.h (module 'core'): ns3::WeibullVariable [class] module.add_class('WeibullVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariable']) ## random-variable.h (module 'core'): ns3::ZetaVariable [class] module.add_class('ZetaVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariable']) ## random-variable.h (module 'core'): ns3::ZipfVariable [class] module.add_class('ZipfVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariable']) ## empty.h (module 'core'): ns3::empty [class] module.add_class('empty', import_from_module='ns.core') ## int64x64-double.h (module 'core'): ns3::int64x64_t [class] module.add_class('int64x64_t', import_from_module='ns.core') ## chunk.h (module 'network'): ns3::Chunk [class] module.add_class('Chunk', parent=root_module['ns3::ObjectBase']) ## random-variable.h (module 'core'): ns3::ConstantVariable [class] module.add_class('ConstantVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariable']) ## random-variable.h (module 'core'): ns3::DeterministicVariable [class] module.add_class('DeterministicVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariable']) ## random-variable.h (module 'core'): ns3::EmpiricalVariable [class] module.add_class('EmpiricalVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariable']) ## random-variable.h (module 'core'): ns3::ErlangVariable [class] module.add_class('ErlangVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariable']) ## random-variable.h (module 'core'): ns3::ExponentialVariable [class] module.add_class('ExponentialVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariable']) ## flow-id-tag.h (module 'network'): ns3::FlowIdTag [class] module.add_class('FlowIdTag', parent=root_module['ns3::Tag']) ## random-variable.h (module 'core'): ns3::GammaVariable [class] module.add_class('GammaVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariable']) ## header.h (module 'network'): ns3::Header [class] module.add_class('Header', parent=root_module['ns3::Chunk']) ## random-variable.h (module 'core'): ns3::IntEmpiricalVariable [class] module.add_class('IntEmpiricalVariable', import_from_module='ns.core', parent=root_module['ns3::EmpiricalVariable']) ## llc-snap-header.h (module 'network'): ns3::LlcSnapHeader [class] module.add_class('LlcSnapHeader', parent=root_module['ns3::Header']) ## random-variable.h (module 'core'): ns3::LogNormalVariable [class] module.add_class('LogNormalVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariable']) ## random-variable.h (module 'core'): ns3::NormalVariable [class] module.add_class('NormalVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariable']) ## object.h (module 'core'): ns3::Object [class] module.add_class('Object', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >']) ## object.h (module 'core'): ns3::Object::AggregateIterator [class] module.add_class('AggregateIterator', import_from_module='ns.core', outer_class=root_module['ns3::Object']) ## packet-burst.h (module 'network'): ns3::PacketBurst [class] module.add_class('PacketBurst', parent=root_module['ns3::Object']) ## random-variable.h (module 'core'): ns3::ParetoVariable [class] module.add_class('ParetoVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariable']) ## pcap-file-wrapper.h (module 'network'): ns3::PcapFileWrapper [class] module.add_class('PcapFileWrapper', parent=root_module['ns3::Object']) ## queue.h (module 'network'): ns3::Queue [class] module.add_class('Queue', parent=root_module['ns3::Object']) ## queue.h (module 'network'): ns3::Queue::QueueMode [enumeration] module.add_enum('QueueMode', ['QUEUE_MODE_PACKETS', 'QUEUE_MODE_BYTES'], outer_class=root_module['ns3::Queue']) ## radiotap-header.h (module 'network'): ns3::RadiotapHeader [class] module.add_class('RadiotapHeader', parent=root_module['ns3::Header']) ## radiotap-header.h (module 'network'): ns3::RadiotapHeader [enumeration] module.add_enum('', ['FRAME_FLAG_NONE', 'FRAME_FLAG_CFP', 'FRAME_FLAG_SHORT_PREAMBLE', 'FRAME_FLAG_WEP', 'FRAME_FLAG_FRAGMENTED', 'FRAME_FLAG_FCS_INCLUDED', 'FRAME_FLAG_DATA_PADDING', 'FRAME_FLAG_BAD_FCS', 'FRAME_FLAG_SHORT_GUARD'], outer_class=root_module['ns3::RadiotapHeader']) ## radiotap-header.h (module 'network'): ns3::RadiotapHeader [enumeration] module.add_enum('', ['CHANNEL_FLAG_NONE', 'CHANNEL_FLAG_TURBO', 'CHANNEL_FLAG_CCK', 'CHANNEL_FLAG_OFDM', 'CHANNEL_FLAG_SPECTRUM_2GHZ', 'CHANNEL_FLAG_SPECTRUM_5GHZ', 'CHANNEL_FLAG_PASSIVE', 'CHANNEL_FLAG_DYNAMIC', 'CHANNEL_FLAG_GFSK'], outer_class=root_module['ns3::RadiotapHeader']) ## red-queue.h (module 'network'): ns3::RedQueue [class] module.add_class('RedQueue', parent=root_module['ns3::Queue']) ## red-queue.h (module 'network'): ns3::RedQueue [enumeration] module.add_enum('', ['DTYPE_NONE', 'DTYPE_FORCED', 'DTYPE_UNFORCED'], outer_class=root_module['ns3::RedQueue']) ## red-queue.h (module 'network'): ns3::RedQueue::Stats [struct] module.add_class('Stats', outer_class=root_module['ns3::RedQueue']) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeChecker', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeChecker>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeValue', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeValue>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::CallbackImplBase', 'ns3::empty', 'ns3::DefaultDeleter<ns3::CallbackImplBase>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::EventImpl', 'ns3::empty', 'ns3::DefaultDeleter<ns3::EventImpl>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::NixVector', 'ns3::empty', 'ns3::DefaultDeleter<ns3::NixVector>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::OutputStreamWrapper', 'ns3::empty', 'ns3::DefaultDeleter<ns3::OutputStreamWrapper>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::Packet', 'ns3::empty', 'ns3::DefaultDeleter<ns3::Packet>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbAddressBlock, ns3::empty, ns3::DefaultDeleter<ns3::PbbAddressBlock> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::PbbAddressBlock', 'ns3::empty', 'ns3::DefaultDeleter<ns3::PbbAddressBlock>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbMessage, ns3::empty, ns3::DefaultDeleter<ns3::PbbMessage> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::PbbMessage', 'ns3::empty', 'ns3::DefaultDeleter<ns3::PbbMessage>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbPacket, ns3::Header, ns3::DefaultDeleter<ns3::PbbPacket> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::PbbPacket', 'ns3::Header', 'ns3::DefaultDeleter<ns3::PbbPacket>'], parent=root_module['ns3::Header'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbTlv, ns3::empty, ns3::DefaultDeleter<ns3::PbbTlv> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::PbbTlv', 'ns3::empty', 'ns3::DefaultDeleter<ns3::PbbTlv>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> > [class] module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::TraceSourceAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::TraceSourceAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## socket.h (module 'network'): ns3::Socket [class] module.add_class('Socket', parent=root_module['ns3::Object']) ## socket.h (module 'network'): ns3::Socket::SocketErrno [enumeration] module.add_enum('SocketErrno', ['ERROR_NOTERROR', 'ERROR_ISCONN', 'ERROR_NOTCONN', 'ERROR_MSGSIZE', 'ERROR_AGAIN', 'ERROR_SHUTDOWN', 'ERROR_OPNOTSUPP', 'ERROR_AFNOSUPPORT', 'ERROR_INVAL', 'ERROR_BADF', 'ERROR_NOROUTETOHOST', 'ERROR_NODEV', 'ERROR_ADDRNOTAVAIL', 'ERROR_ADDRINUSE', 'SOCKET_ERRNO_LAST'], outer_class=root_module['ns3::Socket']) ## socket.h (module 'network'): ns3::Socket::SocketType [enumeration] module.add_enum('SocketType', ['NS3_SOCK_STREAM', 'NS3_SOCK_SEQPACKET', 'NS3_SOCK_DGRAM', 'NS3_SOCK_RAW'], outer_class=root_module['ns3::Socket']) ## socket.h (module 'network'): ns3::SocketAddressTag [class] module.add_class('SocketAddressTag', parent=root_module['ns3::Tag']) ## socket-factory.h (module 'network'): ns3::SocketFactory [class] module.add_class('SocketFactory', parent=root_module['ns3::Object']) ## socket.h (module 'network'): ns3::SocketIpTtlTag [class] module.add_class('SocketIpTtlTag', parent=root_module['ns3::Tag']) ## socket.h (module 'network'): ns3::SocketSetDontFragmentTag [class] module.add_class('SocketSetDontFragmentTag', parent=root_module['ns3::Tag']) ## nstime.h (module 'core'): ns3::Time [class] module.add_class('Time', import_from_module='ns.core') ## nstime.h (module 'core'): ns3::Time::Unit [enumeration] module.add_enum('Unit', ['S', 'MS', 'US', 'NS', 'PS', 'FS', 'LAST'], outer_class=root_module['ns3::Time'], import_from_module='ns.core') ## nstime.h (module 'core'): ns3::Time [class] root_module['ns3::Time'].implicitly_converts_to(root_module['ns3::int64x64_t']) ## trace-source-accessor.h (module 'core'): ns3::TraceSourceAccessor [class] module.add_class('TraceSourceAccessor', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >']) ## trailer.h (module 'network'): ns3::Trailer [class] module.add_class('Trailer', parent=root_module['ns3::Chunk']) ## application.h (module 'network'): ns3::Application [class] module.add_class('Application', parent=root_module['ns3::Object']) ## attribute.h (module 'core'): ns3::AttributeAccessor [class] module.add_class('AttributeAccessor', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >']) ## attribute.h (module 'core'): ns3::AttributeChecker [class] module.add_class('AttributeChecker', allow_subclassing=False, automatic_type_narrowing=True, import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >']) ## attribute.h (module 'core'): ns3::AttributeValue [class] module.add_class('AttributeValue', allow_subclassing=False, automatic_type_narrowing=True, import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >']) ## boolean.h (module 'core'): ns3::BooleanChecker [class] module.add_class('BooleanChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) ## boolean.h (module 'core'): ns3::BooleanValue [class] module.add_class('BooleanValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## callback.h (module 'core'): ns3::CallbackChecker [class] module.add_class('CallbackChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) ## callback.h (module 'core'): ns3::CallbackImplBase [class] module.add_class('CallbackImplBase', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >']) ## callback.h (module 'core'): ns3::CallbackValue [class] module.add_class('CallbackValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## channel.h (module 'network'): ns3::Channel [class] module.add_class('Channel', parent=root_module['ns3::Object']) ## data-rate.h (module 'network'): ns3::DataRateChecker [class] module.add_class('DataRateChecker', parent=root_module['ns3::AttributeChecker']) ## data-rate.h (module 'network'): ns3::DataRateValue [class] module.add_class('DataRateValue', parent=root_module['ns3::AttributeValue']) ## drop-tail-queue.h (module 'network'): ns3::DropTailQueue [class] module.add_class('DropTailQueue', parent=root_module['ns3::Queue']) ## attribute.h (module 'core'): ns3::EmptyAttributeValue [class] module.add_class('EmptyAttributeValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## error-model.h (module 'network'): ns3::ErrorModel [class] module.add_class('ErrorModel', parent=root_module['ns3::Object']) ## ethernet-header.h (module 'network'): ns3::EthernetHeader [class] module.add_class('EthernetHeader', parent=root_module['ns3::Header']) ## ethernet-trailer.h (module 'network'): ns3::EthernetTrailer [class] module.add_class('EthernetTrailer', parent=root_module['ns3::Trailer']) ## event-impl.h (module 'core'): ns3::EventImpl [class] module.add_class('EventImpl', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >']) ## ipv4-address.h (module 'network'): ns3::Ipv4AddressChecker [class] module.add_class('Ipv4AddressChecker', parent=root_module['ns3::AttributeChecker']) ## ipv4-address.h (module 'network'): ns3::Ipv4AddressValue [class] module.add_class('Ipv4AddressValue', parent=root_module['ns3::AttributeValue']) ## ipv4-address.h (module 'network'): ns3::Ipv4MaskChecker [class] module.add_class('Ipv4MaskChecker', parent=root_module['ns3::AttributeChecker']) ## ipv4-address.h (module 'network'): ns3::Ipv4MaskValue [class] module.add_class('Ipv4MaskValue', parent=root_module['ns3::AttributeValue']) ## ipv6-address.h (module 'network'): ns3::Ipv6AddressChecker [class] module.add_class('Ipv6AddressChecker', parent=root_module['ns3::AttributeChecker']) ## ipv6-address.h (module 'network'): ns3::Ipv6AddressValue [class] module.add_class('Ipv6AddressValue', parent=root_module['ns3::AttributeValue']) ## ipv6-address.h (module 'network'): ns3::Ipv6PrefixChecker [class] module.add_class('Ipv6PrefixChecker', parent=root_module['ns3::AttributeChecker']) ## ipv6-address.h (module 'network'): ns3::Ipv6PrefixValue [class] module.add_class('Ipv6PrefixValue', parent=root_module['ns3::AttributeValue']) ## error-model.h (module 'network'): ns3::ListErrorModel [class] module.add_class('ListErrorModel', parent=root_module['ns3::ErrorModel']) ## mac48-address.h (module 'network'): ns3::Mac48AddressChecker [class] module.add_class('Mac48AddressChecker', parent=root_module['ns3::AttributeChecker']) ## mac48-address.h (module 'network'): ns3::Mac48AddressValue [class] module.add_class('Mac48AddressValue', parent=root_module['ns3::AttributeValue']) ## net-device.h (module 'network'): ns3::NetDevice [class] module.add_class('NetDevice', parent=root_module['ns3::Object']) ## net-device.h (module 'network'): ns3::NetDevice::PacketType [enumeration] module.add_enum('PacketType', ['PACKET_HOST', 'NS3_PACKET_HOST', 'PACKET_BROADCAST', 'NS3_PACKET_BROADCAST', 'PACKET_MULTICAST', 'NS3_PACKET_MULTICAST', 'PACKET_OTHERHOST', 'NS3_PACKET_OTHERHOST'], outer_class=root_module['ns3::NetDevice']) ## nix-vector.h (module 'network'): ns3::NixVector [class] module.add_class('NixVector', parent=root_module['ns3::SimpleRefCount< ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >']) ## node.h (module 'network'): ns3::Node [class] module.add_class('Node', parent=root_module['ns3::Object']) ## object-factory.h (module 'core'): ns3::ObjectFactoryChecker [class] module.add_class('ObjectFactoryChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) ## object-factory.h (module 'core'): ns3::ObjectFactoryValue [class] module.add_class('ObjectFactoryValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper [class] module.add_class('OutputStreamWrapper', parent=root_module['ns3::SimpleRefCount< ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >']) ## packet.h (module 'network'): ns3::Packet [class] module.add_class('Packet', parent=root_module['ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >']) ## packet-socket.h (module 'network'): ns3::PacketSocket [class] module.add_class('PacketSocket', parent=root_module['ns3::Socket']) ## packet-socket-factory.h (module 'network'): ns3::PacketSocketFactory [class] module.add_class('PacketSocketFactory', parent=root_module['ns3::SocketFactory']) ## packetbb.h (module 'network'): ns3::PbbAddressBlock [class] module.add_class('PbbAddressBlock', parent=root_module['ns3::SimpleRefCount< ns3::PbbAddressBlock, ns3::empty, ns3::DefaultDeleter<ns3::PbbAddressBlock> >']) ## packetbb.h (module 'network'): ns3::PbbAddressBlockIpv4 [class] module.add_class('PbbAddressBlockIpv4', parent=root_module['ns3::PbbAddressBlock']) ## packetbb.h (module 'network'): ns3::PbbAddressBlockIpv6 [class] module.add_class('PbbAddressBlockIpv6', parent=root_module['ns3::PbbAddressBlock']) ## packetbb.h (module 'network'): ns3::PbbMessage [class] module.add_class('PbbMessage', parent=root_module['ns3::SimpleRefCount< ns3::PbbMessage, ns3::empty, ns3::DefaultDeleter<ns3::PbbMessage> >']) ## packetbb.h (module 'network'): ns3::PbbMessageIpv4 [class] module.add_class('PbbMessageIpv4', parent=root_module['ns3::PbbMessage']) ## packetbb.h (module 'network'): ns3::PbbMessageIpv6 [class] module.add_class('PbbMessageIpv6', parent=root_module['ns3::PbbMessage']) ## packetbb.h (module 'network'): ns3::PbbPacket [class] module.add_class('PbbPacket', parent=root_module['ns3::SimpleRefCount< ns3::PbbPacket, ns3::Header, ns3::DefaultDeleter<ns3::PbbPacket> >']) ## packetbb.h (module 'network'): ns3::PbbTlv [class] module.add_class('PbbTlv', parent=root_module['ns3::SimpleRefCount< ns3::PbbTlv, ns3::empty, ns3::DefaultDeleter<ns3::PbbTlv> >']) ## random-variable.h (module 'core'): ns3::RandomVariableChecker [class] module.add_class('RandomVariableChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) ## random-variable.h (module 'core'): ns3::RandomVariableValue [class] module.add_class('RandomVariableValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## error-model.h (module 'network'): ns3::RateErrorModel [class] module.add_class('RateErrorModel', parent=root_module['ns3::ErrorModel']) ## error-model.h (module 'network'): ns3::RateErrorModel::ErrorUnit [enumeration] module.add_enum('ErrorUnit', ['ERROR_UNIT_BIT', 'ERROR_UNIT_BYTE', 'ERROR_UNIT_PACKET'], outer_class=root_module['ns3::RateErrorModel']) ## error-model.h (module 'network'): ns3::ReceiveListErrorModel [class] module.add_class('ReceiveListErrorModel', parent=root_module['ns3::ErrorModel']) ## simple-channel.h (module 'network'): ns3::SimpleChannel [class] module.add_class('SimpleChannel', parent=root_module['ns3::Channel']) ## simple-net-device.h (module 'network'): ns3::SimpleNetDevice [class] module.add_class('SimpleNetDevice', parent=root_module['ns3::NetDevice']) ## nstime.h (module 'core'): ns3::TimeChecker [class] module.add_class('TimeChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) ## nstime.h (module 'core'): ns3::TimeValue [class] module.add_class('TimeValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## type-id.h (module 'core'): ns3::TypeIdChecker [class] module.add_class('TypeIdChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker']) ## type-id.h (module 'core'): ns3::TypeIdValue [class] module.add_class('TypeIdValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue']) ## address.h (module 'network'): ns3::AddressChecker [class] module.add_class('AddressChecker', parent=root_module['ns3::AttributeChecker']) ## address.h (module 'network'): ns3::AddressValue [class] module.add_class('AddressValue', parent=root_module['ns3::AttributeValue']) ## packetbb.h (module 'network'): ns3::PbbAddressTlv [class] module.add_class('PbbAddressTlv', parent=root_module['ns3::PbbTlv']) module.add_container('std::list< ns3::Ptr< ns3::Packet > >', 'ns3::Ptr< ns3::Packet >', container_type='list') module.add_container('std::list< unsigned int >', 'unsigned int', container_type='list') typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyRxEndOkCallback') typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyRxEndOkCallback*') typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyRxEndOkCallback&') typehandlers.add_type_alias('ns3::SequenceNumber< unsigned short, short >', 'ns3::SequenceNumber16') typehandlers.add_type_alias('ns3::SequenceNumber< unsigned short, short >*', 'ns3::SequenceNumber16*') typehandlers.add_type_alias('ns3::SequenceNumber< unsigned short, short >&', 'ns3::SequenceNumber16&') typehandlers.add_type_alias('ns3::SequenceNumber< unsigned int, int >', 'ns3::SequenceNumber32') typehandlers.add_type_alias('ns3::SequenceNumber< unsigned int, int >*', 'ns3::SequenceNumber32*') typehandlers.add_type_alias('ns3::SequenceNumber< unsigned int, int >&', 'ns3::SequenceNumber32&') typehandlers.add_type_alias('ns3::RngSeedManager', 'ns3::SeedManager') typehandlers.add_type_alias('ns3::RngSeedManager*', 'ns3::SeedManager*') typehandlers.add_type_alias('ns3::RngSeedManager&', 'ns3::SeedManager&') module.add_typedef(root_module['ns3::RngSeedManager'], 'SeedManager') typehandlers.add_type_alias('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyRxStartCallback') typehandlers.add_type_alias('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyRxStartCallback*') typehandlers.add_type_alias('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyRxStartCallback&') typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyTxStartCallback') typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyTxStartCallback*') typehandlers.add_type_alias('ns3::Callback< bool, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyTxStartCallback&') typehandlers.add_type_alias('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyRxEndErrorCallback') typehandlers.add_type_alias('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyRxEndErrorCallback*') typehandlers.add_type_alias('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyRxEndErrorCallback&') typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ns3::GenericPhyTxEndCallback') typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', 'ns3::GenericPhyTxEndCallback*') typehandlers.add_type_alias('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', 'ns3::GenericPhyTxEndCallback&') ## Register a nested module for the namespace FatalImpl nested_module = module.add_cpp_namespace('FatalImpl') register_types_ns3_FatalImpl(nested_module) ## Register a nested module for the namespace addressUtils nested_module = module.add_cpp_namespace('addressUtils') register_types_ns3_addressUtils(nested_module) def register_types_ns3_FatalImpl(module): root_module = module.get_root() def register_types_ns3_addressUtils(module): root_module = module.get_root() def register_methods(root_module): register_Ns3Address_methods(root_module, root_module['ns3::Address']) register_Ns3ApplicationContainer_methods(root_module, root_module['ns3::ApplicationContainer']) register_Ns3AsciiTraceHelper_methods(root_module, root_module['ns3::AsciiTraceHelper']) register_Ns3AsciiTraceHelperForDevice_methods(root_module, root_module['ns3::AsciiTraceHelperForDevice']) register_Ns3AttributeConstructionList_methods(root_module, root_module['ns3::AttributeConstructionList']) register_Ns3AttributeConstructionListItem_methods(root_module, root_module['ns3::AttributeConstructionList::Item']) register_Ns3Buffer_methods(root_module, root_module['ns3::Buffer']) register_Ns3BufferIterator_methods(root_module, root_module['ns3::Buffer::Iterator']) register_Ns3ByteTagIterator_methods(root_module, root_module['ns3::ByteTagIterator']) register_Ns3ByteTagIteratorItem_methods(root_module, root_module['ns3::ByteTagIterator::Item']) register_Ns3ByteTagList_methods(root_module, root_module['ns3::ByteTagList']) register_Ns3ByteTagListIterator_methods(root_module, root_module['ns3::ByteTagList::Iterator']) register_Ns3ByteTagListIteratorItem_methods(root_module, root_module['ns3::ByteTagList::Iterator::Item']) register_Ns3CallbackBase_methods(root_module, root_module['ns3::CallbackBase']) register_Ns3ChannelList_methods(root_module, root_module['ns3::ChannelList']) register_Ns3DataRate_methods(root_module, root_module['ns3::DataRate']) register_Ns3EventId_methods(root_module, root_module['ns3::EventId']) register_Ns3Inet6SocketAddress_methods(root_module, root_module['ns3::Inet6SocketAddress']) register_Ns3InetSocketAddress_methods(root_module, root_module['ns3::InetSocketAddress']) register_Ns3Ipv4Address_methods(root_module, root_module['ns3::Ipv4Address']) register_Ns3Ipv4Mask_methods(root_module, root_module['ns3::Ipv4Mask']) register_Ns3Ipv6Address_methods(root_module, root_module['ns3::Ipv6Address']) register_Ns3Ipv6Prefix_methods(root_module, root_module['ns3::Ipv6Prefix']) register_Ns3Mac48Address_methods(root_module, root_module['ns3::Mac48Address']) register_Ns3Mac64Address_methods(root_module, root_module['ns3::Mac64Address']) register_Ns3NetDeviceContainer_methods(root_module, root_module['ns3::NetDeviceContainer']) register_Ns3NodeContainer_methods(root_module, root_module['ns3::NodeContainer']) register_Ns3NodeList_methods(root_module, root_module['ns3::NodeList']) register_Ns3ObjectBase_methods(root_module, root_module['ns3::ObjectBase']) register_Ns3ObjectDeleter_methods(root_module, root_module['ns3::ObjectDeleter']) register_Ns3ObjectFactory_methods(root_module, root_module['ns3::ObjectFactory']) register_Ns3PacketMetadata_methods(root_module, root_module['ns3::PacketMetadata']) register_Ns3PacketMetadataItem_methods(root_module, root_module['ns3::PacketMetadata::Item']) register_Ns3PacketMetadataItemIterator_methods(root_module, root_module['ns3::PacketMetadata::ItemIterator']) register_Ns3PacketSocketAddress_methods(root_module, root_module['ns3::PacketSocketAddress']) register_Ns3PacketSocketHelper_methods(root_module, root_module['ns3::PacketSocketHelper']) register_Ns3PacketTagIterator_methods(root_module, root_module['ns3::PacketTagIterator']) register_Ns3PacketTagIteratorItem_methods(root_module, root_module['ns3::PacketTagIterator::Item']) register_Ns3PacketTagList_methods(root_module, root_module['ns3::PacketTagList']) register_Ns3PacketTagListTagData_methods(root_module, root_module['ns3::PacketTagList::TagData']) register_Ns3PbbAddressTlvBlock_methods(root_module, root_module['ns3::PbbAddressTlvBlock']) register_Ns3PbbTlvBlock_methods(root_module, root_module['ns3::PbbTlvBlock']) register_Ns3PcapFile_methods(root_module, root_module['ns3::PcapFile']) register_Ns3PcapHelper_methods(root_module, root_module['ns3::PcapHelper']) register_Ns3PcapHelperForDevice_methods(root_module, root_module['ns3::PcapHelperForDevice']) register_Ns3RandomVariable_methods(root_module, root_module['ns3::RandomVariable']) register_Ns3RngSeedManager_methods(root_module, root_module['ns3::RngSeedManager']) register_Ns3SequenceNumber32_methods(root_module, root_module['ns3::SequenceNumber32']) register_Ns3SequenceNumber16_methods(root_module, root_module['ns3::SequenceNumber16']) register_Ns3SequentialVariable_methods(root_module, root_module['ns3::SequentialVariable']) register_Ns3SimpleRefCount__Ns3Object_Ns3ObjectBase_Ns3ObjectDeleter_methods(root_module, root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >']) register_Ns3Simulator_methods(root_module, root_module['ns3::Simulator']) register_Ns3SystemWallClockMs_methods(root_module, root_module['ns3::SystemWallClockMs']) register_Ns3Tag_methods(root_module, root_module['ns3::Tag']) register_Ns3TagBuffer_methods(root_module, root_module['ns3::TagBuffer']) register_Ns3TriangularVariable_methods(root_module, root_module['ns3::TriangularVariable']) register_Ns3TypeId_methods(root_module, root_module['ns3::TypeId']) register_Ns3TypeIdAttributeInformation_methods(root_module, root_module['ns3::TypeId::AttributeInformation']) register_Ns3TypeIdTraceSourceInformation_methods(root_module, root_module['ns3::TypeId::TraceSourceInformation']) register_Ns3UniformVariable_methods(root_module, root_module['ns3::UniformVariable']) register_Ns3WeibullVariable_methods(root_module, root_module['ns3::WeibullVariable']) register_Ns3ZetaVariable_methods(root_module, root_module['ns3::ZetaVariable']) register_Ns3ZipfVariable_methods(root_module, root_module['ns3::ZipfVariable']) register_Ns3Empty_methods(root_module, root_module['ns3::empty']) register_Ns3Int64x64_t_methods(root_module, root_module['ns3::int64x64_t']) register_Ns3Chunk_methods(root_module, root_module['ns3::Chunk']) register_Ns3ConstantVariable_methods(root_module, root_module['ns3::ConstantVariable']) register_Ns3DeterministicVariable_methods(root_module, root_module['ns3::DeterministicVariable']) register_Ns3EmpiricalVariable_methods(root_module, root_module['ns3::EmpiricalVariable']) register_Ns3ErlangVariable_methods(root_module, root_module['ns3::ErlangVariable']) register_Ns3ExponentialVariable_methods(root_module, root_module['ns3::ExponentialVariable']) register_Ns3FlowIdTag_methods(root_module, root_module['ns3::FlowIdTag']) register_Ns3GammaVariable_methods(root_module, root_module['ns3::GammaVariable']) register_Ns3Header_methods(root_module, root_module['ns3::Header']) register_Ns3IntEmpiricalVariable_methods(root_module, root_module['ns3::IntEmpiricalVariable']) register_Ns3LlcSnapHeader_methods(root_module, root_module['ns3::LlcSnapHeader']) register_Ns3LogNormalVariable_methods(root_module, root_module['ns3::LogNormalVariable']) register_Ns3NormalVariable_methods(root_module, root_module['ns3::NormalVariable']) register_Ns3Object_methods(root_module, root_module['ns3::Object']) register_Ns3ObjectAggregateIterator_methods(root_module, root_module['ns3::Object::AggregateIterator']) register_Ns3PacketBurst_methods(root_module, root_module['ns3::PacketBurst']) register_Ns3ParetoVariable_methods(root_module, root_module['ns3::ParetoVariable']) register_Ns3PcapFileWrapper_methods(root_module, root_module['ns3::PcapFileWrapper']) register_Ns3Queue_methods(root_module, root_module['ns3::Queue']) register_Ns3RadiotapHeader_methods(root_module, root_module['ns3::RadiotapHeader']) register_Ns3RedQueue_methods(root_module, root_module['ns3::RedQueue']) register_Ns3RedQueueStats_methods(root_module, root_module['ns3::RedQueue::Stats']) register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >']) register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >']) register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >']) register_Ns3SimpleRefCount__Ns3CallbackImplBase_Ns3Empty_Ns3DefaultDeleter__lt__ns3CallbackImplBase__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >']) register_Ns3SimpleRefCount__Ns3EventImpl_Ns3Empty_Ns3DefaultDeleter__lt__ns3EventImpl__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >']) register_Ns3SimpleRefCount__Ns3NixVector_Ns3Empty_Ns3DefaultDeleter__lt__ns3NixVector__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >']) register_Ns3SimpleRefCount__Ns3OutputStreamWrapper_Ns3Empty_Ns3DefaultDeleter__lt__ns3OutputStreamWrapper__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >']) register_Ns3SimpleRefCount__Ns3Packet_Ns3Empty_Ns3DefaultDeleter__lt__ns3Packet__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >']) register_Ns3SimpleRefCount__Ns3PbbAddressBlock_Ns3Empty_Ns3DefaultDeleter__lt__ns3PbbAddressBlock__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::PbbAddressBlock, ns3::empty, ns3::DefaultDeleter<ns3::PbbAddressBlock> >']) register_Ns3SimpleRefCount__Ns3PbbMessage_Ns3Empty_Ns3DefaultDeleter__lt__ns3PbbMessage__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::PbbMessage, ns3::empty, ns3::DefaultDeleter<ns3::PbbMessage> >']) register_Ns3SimpleRefCount__Ns3PbbPacket_Ns3Header_Ns3DefaultDeleter__lt__ns3PbbPacket__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::PbbPacket, ns3::Header, ns3::DefaultDeleter<ns3::PbbPacket> >']) register_Ns3SimpleRefCount__Ns3PbbTlv_Ns3Empty_Ns3DefaultDeleter__lt__ns3PbbTlv__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::PbbTlv, ns3::empty, ns3::DefaultDeleter<ns3::PbbTlv> >']) register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >']) register_Ns3Socket_methods(root_module, root_module['ns3::Socket']) register_Ns3SocketAddressTag_methods(root_module, root_module['ns3::SocketAddressTag']) register_Ns3SocketFactory_methods(root_module, root_module['ns3::SocketFactory']) register_Ns3SocketIpTtlTag_methods(root_module, root_module['ns3::SocketIpTtlTag']) register_Ns3SocketSetDontFragmentTag_methods(root_module, root_module['ns3::SocketSetDontFragmentTag']) register_Ns3Time_methods(root_module, root_module['ns3::Time']) register_Ns3TraceSourceAccessor_methods(root_module, root_module['ns3::TraceSourceAccessor']) register_Ns3Trailer_methods(root_module, root_module['ns3::Trailer']) register_Ns3Application_methods(root_module, root_module['ns3::Application']) register_Ns3AttributeAccessor_methods(root_module, root_module['ns3::AttributeAccessor']) register_Ns3AttributeChecker_methods(root_module, root_module['ns3::AttributeChecker']) register_Ns3AttributeValue_methods(root_module, root_module['ns3::AttributeValue']) register_Ns3BooleanChecker_methods(root_module, root_module['ns3::BooleanChecker']) register_Ns3BooleanValue_methods(root_module, root_module['ns3::BooleanValue']) register_Ns3CallbackChecker_methods(root_module, root_module['ns3::CallbackChecker']) register_Ns3CallbackImplBase_methods(root_module, root_module['ns3::CallbackImplBase']) register_Ns3CallbackValue_methods(root_module, root_module['ns3::CallbackValue']) register_Ns3Channel_methods(root_module, root_module['ns3::Channel']) register_Ns3DataRateChecker_methods(root_module, root_module['ns3::DataRateChecker']) register_Ns3DataRateValue_methods(root_module, root_module['ns3::DataRateValue']) register_Ns3DropTailQueue_methods(root_module, root_module['ns3::DropTailQueue']) register_Ns3EmptyAttributeValue_methods(root_module, root_module['ns3::EmptyAttributeValue']) register_Ns3ErrorModel_methods(root_module, root_module['ns3::ErrorModel']) register_Ns3EthernetHeader_methods(root_module, root_module['ns3::EthernetHeader']) register_Ns3EthernetTrailer_methods(root_module, root_module['ns3::EthernetTrailer']) register_Ns3EventImpl_methods(root_module, root_module['ns3::EventImpl']) register_Ns3Ipv4AddressChecker_methods(root_module, root_module['ns3::Ipv4AddressChecker']) register_Ns3Ipv4AddressValue_methods(root_module, root_module['ns3::Ipv4AddressValue']) register_Ns3Ipv4MaskChecker_methods(root_module, root_module['ns3::Ipv4MaskChecker']) register_Ns3Ipv4MaskValue_methods(root_module, root_module['ns3::Ipv4MaskValue']) register_Ns3Ipv6AddressChecker_methods(root_module, root_module['ns3::Ipv6AddressChecker']) register_Ns3Ipv6AddressValue_methods(root_module, root_module['ns3::Ipv6AddressValue']) register_Ns3Ipv6PrefixChecker_methods(root_module, root_module['ns3::Ipv6PrefixChecker']) register_Ns3Ipv6PrefixValue_methods(root_module, root_module['ns3::Ipv6PrefixValue']) register_Ns3ListErrorModel_methods(root_module, root_module['ns3::ListErrorModel']) register_Ns3Mac48AddressChecker_methods(root_module, root_module['ns3::Mac48AddressChecker']) register_Ns3Mac48AddressValue_methods(root_module, root_module['ns3::Mac48AddressValue']) register_Ns3NetDevice_methods(root_module, root_module['ns3::NetDevice']) register_Ns3NixVector_methods(root_module, root_module['ns3::NixVector']) register_Ns3Node_methods(root_module, root_module['ns3::Node']) register_Ns3ObjectFactoryChecker_methods(root_module, root_module['ns3::ObjectFactoryChecker']) register_Ns3ObjectFactoryValue_methods(root_module, root_module['ns3::ObjectFactoryValue']) register_Ns3OutputStreamWrapper_methods(root_module, root_module['ns3::OutputStreamWrapper']) register_Ns3Packet_methods(root_module, root_module['ns3::Packet']) register_Ns3PacketSocket_methods(root_module, root_module['ns3::PacketSocket']) register_Ns3PacketSocketFactory_methods(root_module, root_module['ns3::PacketSocketFactory']) register_Ns3PbbAddressBlock_methods(root_module, root_module['ns3::PbbAddressBlock']) register_Ns3PbbAddressBlockIpv4_methods(root_module, root_module['ns3::PbbAddressBlockIpv4']) register_Ns3PbbAddressBlockIpv6_methods(root_module, root_module['ns3::PbbAddressBlockIpv6']) register_Ns3PbbMessage_methods(root_module, root_module['ns3::PbbMessage']) register_Ns3PbbMessageIpv4_methods(root_module, root_module['ns3::PbbMessageIpv4']) register_Ns3PbbMessageIpv6_methods(root_module, root_module['ns3::PbbMessageIpv6']) register_Ns3PbbPacket_methods(root_module, root_module['ns3::PbbPacket']) register_Ns3PbbTlv_methods(root_module, root_module['ns3::PbbTlv']) register_Ns3RandomVariableChecker_methods(root_module, root_module['ns3::RandomVariableChecker']) register_Ns3RandomVariableValue_methods(root_module, root_module['ns3::RandomVariableValue']) register_Ns3RateErrorModel_methods(root_module, root_module['ns3::RateErrorModel']) register_Ns3ReceiveListErrorModel_methods(root_module, root_module['ns3::ReceiveListErrorModel']) register_Ns3SimpleChannel_methods(root_module, root_module['ns3::SimpleChannel']) register_Ns3SimpleNetDevice_methods(root_module, root_module['ns3::SimpleNetDevice']) register_Ns3TimeChecker_methods(root_module, root_module['ns3::TimeChecker']) register_Ns3TimeValue_methods(root_module, root_module['ns3::TimeValue']) register_Ns3TypeIdChecker_methods(root_module, root_module['ns3::TypeIdChecker']) register_Ns3TypeIdValue_methods(root_module, root_module['ns3::TypeIdValue']) register_Ns3AddressChecker_methods(root_module, root_module['ns3::AddressChecker']) register_Ns3AddressValue_methods(root_module, root_module['ns3::AddressValue']) register_Ns3PbbAddressTlv_methods(root_module, root_module['ns3::PbbAddressTlv']) return def register_Ns3Address_methods(root_module, cls): cls.add_binary_comparison_operator('<') cls.add_binary_comparison_operator('!=') cls.add_output_stream_operator() cls.add_binary_comparison_operator('==') ## address.h (module 'network'): ns3::Address::Address() [constructor] cls.add_constructor([]) ## address.h (module 'network'): ns3::Address::Address(uint8_t type, uint8_t const * buffer, uint8_t len) [constructor] cls.add_constructor([param('uint8_t', 'type'), param('uint8_t const *', 'buffer'), param('uint8_t', 'len')]) ## address.h (module 'network'): ns3::Address::Address(ns3::Address const & address) [copy constructor] cls.add_constructor([param('ns3::Address const &', 'address')]) ## address.h (module 'network'): bool ns3::Address::CheckCompatible(uint8_t type, uint8_t len) const [member function] cls.add_method('CheckCompatible', 'bool', [param('uint8_t', 'type'), param('uint8_t', 'len')], is_const=True) ## address.h (module 'network'): uint32_t ns3::Address::CopyAllFrom(uint8_t const * buffer, uint8_t len) [member function] cls.add_method('CopyAllFrom', 'uint32_t', [param('uint8_t const *', 'buffer'), param('uint8_t', 'len')]) ## address.h (module 'network'): uint32_t ns3::Address::CopyAllTo(uint8_t * buffer, uint8_t len) const [member function] cls.add_method('CopyAllTo', 'uint32_t', [param('uint8_t *', 'buffer'), param('uint8_t', 'len')], is_const=True) ## address.h (module 'network'): uint32_t ns3::Address::CopyFrom(uint8_t const * buffer, uint8_t len) [member function] cls.add_method('CopyFrom', 'uint32_t', [param('uint8_t const *', 'buffer'), param('uint8_t', 'len')]) ## address.h (module 'network'): uint32_t ns3::Address::CopyTo(uint8_t * buffer) const [member function] cls.add_method('CopyTo', 'uint32_t', [param('uint8_t *', 'buffer')], is_const=True) ## address.h (module 'network'): void ns3::Address::Deserialize(ns3::TagBuffer buffer) [member function] cls.add_method('Deserialize', 'void', [param('ns3::TagBuffer', 'buffer')]) ## address.h (module 'network'): uint8_t ns3::Address::GetLength() const [member function] cls.add_method('GetLength', 'uint8_t', [], is_const=True) ## address.h (module 'network'): uint32_t ns3::Address::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True) ## address.h (module 'network'): bool ns3::Address::IsInvalid() const [member function] cls.add_method('IsInvalid', 'bool', [], is_const=True) ## address.h (module 'network'): bool ns3::Address::IsMatchingType(uint8_t type) const [member function] cls.add_method('IsMatchingType', 'bool', [param('uint8_t', 'type')], is_const=True) ## address.h (module 'network'): static uint8_t ns3::Address::Register() [member function] cls.add_method('Register', 'uint8_t', [], is_static=True) ## address.h (module 'network'): void ns3::Address::Serialize(ns3::TagBuffer buffer) const [member function] cls.add_method('Serialize', 'void', [param('ns3::TagBuffer', 'buffer')], is_const=True) return def register_Ns3ApplicationContainer_methods(root_module, cls): ## application-container.h (module 'network'): ns3::ApplicationContainer::ApplicationContainer(ns3::ApplicationContainer const & arg0) [copy constructor] cls.add_constructor([param('ns3::ApplicationContainer const &', 'arg0')]) ## application-container.h (module 'network'): ns3::ApplicationContainer::ApplicationContainer() [constructor] cls.add_constructor([]) ## application-container.h (module 'network'): ns3::ApplicationContainer::ApplicationContainer(ns3::Ptr<ns3::Application> application) [constructor] cls.add_constructor([param('ns3::Ptr< ns3::Application >', 'application')]) ## application-container.h (module 'network'): ns3::ApplicationContainer::ApplicationContainer(std::string name) [constructor] cls.add_constructor([param('std::string', 'name')]) ## application-container.h (module 'network'): void ns3::ApplicationContainer::Add(ns3::ApplicationContainer other) [member function] cls.add_method('Add', 'void', [param('ns3::ApplicationContainer', 'other')]) ## application-container.h (module 'network'): void ns3::ApplicationContainer::Add(ns3::Ptr<ns3::Application> application) [member function] cls.add_method('Add', 'void', [param('ns3::Ptr< ns3::Application >', 'application')]) ## application-container.h (module 'network'): void ns3::ApplicationContainer::Add(std::string name) [member function] cls.add_method('Add', 'void', [param('std::string', 'name')]) ## application-container.h (module 'network'): __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::Application>*,std::vector<ns3::Ptr<ns3::Application>, std::allocator<ns3::Ptr<ns3::Application> > > > ns3::ApplicationContainer::Begin() const [member function] cls.add_method('Begin', '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Application > const, std::vector< ns3::Ptr< ns3::Application > > >', [], is_const=True) ## application-container.h (module 'network'): __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::Application>*,std::vector<ns3::Ptr<ns3::Application>, std::allocator<ns3::Ptr<ns3::Application> > > > ns3::ApplicationContainer::End() const [member function] cls.add_method('End', '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Application > const, std::vector< ns3::Ptr< ns3::Application > > >', [], is_const=True) ## application-container.h (module 'network'): ns3::Ptr<ns3::Application> ns3::ApplicationContainer::Get(uint32_t i) const [member function] cls.add_method('Get', 'ns3::Ptr< ns3::Application >', [param('uint32_t', 'i')], is_const=True) ## application-container.h (module 'network'): uint32_t ns3::ApplicationContainer::GetN() const [member function] cls.add_method('GetN', 'uint32_t', [], is_const=True) ## application-container.h (module 'network'): void ns3::ApplicationContainer::Start(ns3::Time start) [member function] cls.add_method('Start', 'void', [param('ns3::Time', 'start')]) ## application-container.h (module 'network'): void ns3::ApplicationContainer::Stop(ns3::Time stop) [member function] cls.add_method('Stop', 'void', [param('ns3::Time', 'stop')]) return def register_Ns3AsciiTraceHelper_methods(root_module, cls): ## trace-helper.h (module 'network'): ns3::AsciiTraceHelper::AsciiTraceHelper(ns3::AsciiTraceHelper const & arg0) [copy constructor] cls.add_constructor([param('ns3::AsciiTraceHelper const &', 'arg0')]) ## trace-helper.h (module 'network'): ns3::AsciiTraceHelper::AsciiTraceHelper() [constructor] cls.add_constructor([]) ## trace-helper.h (module 'network'): ns3::Ptr<ns3::OutputStreamWrapper> ns3::AsciiTraceHelper::CreateFileStream(std::string filename, std::_Ios_Openmode filemode=std::ios_base::out) [member function] cls.add_method('CreateFileStream', 'ns3::Ptr< ns3::OutputStreamWrapper >', [param('std::string', 'filename'), param('std::_Ios_Openmode', 'filemode', default_value='std::ios_base::out')]) ## trace-helper.h (module 'network'): static void ns3::AsciiTraceHelper::DefaultDequeueSinkWithContext(ns3::Ptr<ns3::OutputStreamWrapper> file, std::string context, ns3::Ptr<const ns3::Packet> p) [member function] cls.add_method('DefaultDequeueSinkWithContext', 'void', [param('ns3::Ptr< ns3::OutputStreamWrapper >', 'file'), param('std::string', 'context'), param('ns3::Ptr< ns3::Packet const >', 'p')], is_static=True) ## trace-helper.h (module 'network'): static void ns3::AsciiTraceHelper::DefaultDequeueSinkWithoutContext(ns3::Ptr<ns3::OutputStreamWrapper> file, ns3::Ptr<const ns3::Packet> p) [member function] cls.add_method('DefaultDequeueSinkWithoutContext', 'void', [param('ns3::Ptr< ns3::OutputStreamWrapper >', 'file'), param('ns3::Ptr< ns3::Packet const >', 'p')], is_static=True) ## trace-helper.h (module 'network'): static void ns3::AsciiTraceHelper::DefaultDropSinkWithContext(ns3::Ptr<ns3::OutputStreamWrapper> file, std::string context, ns3::Ptr<const ns3::Packet> p) [member function] cls.add_method('DefaultDropSinkWithContext', 'void', [param('ns3::Ptr< ns3::OutputStreamWrapper >', 'file'), param('std::string', 'context'), param('ns3::Ptr< ns3::Packet const >', 'p')], is_static=True) ## trace-helper.h (module 'network'): static void ns3::AsciiTraceHelper::DefaultDropSinkWithoutContext(ns3::Ptr<ns3::OutputStreamWrapper> file, ns3::Ptr<const ns3::Packet> p) [member function] cls.add_method('DefaultDropSinkWithoutContext', 'void', [param('ns3::Ptr< ns3::OutputStreamWrapper >', 'file'), param('ns3::Ptr< ns3::Packet const >', 'p')], is_static=True) ## trace-helper.h (module 'network'): static void ns3::AsciiTraceHelper::DefaultEnqueueSinkWithContext(ns3::Ptr<ns3::OutputStreamWrapper> file, std::string context, ns3::Ptr<const ns3::Packet> p) [member function] cls.add_method('DefaultEnqueueSinkWithContext', 'void', [param('ns3::Ptr< ns3::OutputStreamWrapper >', 'file'), param('std::string', 'context'), param('ns3::Ptr< ns3::Packet const >', 'p')], is_static=True) ## trace-helper.h (module 'network'): static void ns3::AsciiTraceHelper::DefaultEnqueueSinkWithoutContext(ns3::Ptr<ns3::OutputStreamWrapper> file, ns3::Ptr<const ns3::Packet> p) [member function] cls.add_method('DefaultEnqueueSinkWithoutContext', 'void', [param('ns3::Ptr< ns3::OutputStreamWrapper >', 'file'), param('ns3::Ptr< ns3::Packet const >', 'p')], is_static=True) ## trace-helper.h (module 'network'): static void ns3::AsciiTraceHelper::DefaultReceiveSinkWithContext(ns3::Ptr<ns3::OutputStreamWrapper> file, std::string context, ns3::Ptr<const ns3::Packet> p) [member function] cls.add_method('DefaultReceiveSinkWithContext', 'void', [param('ns3::Ptr< ns3::OutputStreamWrapper >', 'file'), param('std::string', 'context'), param('ns3::Ptr< ns3::Packet const >', 'p')], is_static=True) ## trace-helper.h (module 'network'): static void ns3::AsciiTraceHelper::DefaultReceiveSinkWithoutContext(ns3::Ptr<ns3::OutputStreamWrapper> file, ns3::Ptr<const ns3::Packet> p) [member function] cls.add_method('DefaultReceiveSinkWithoutContext', 'void', [param('ns3::Ptr< ns3::OutputStreamWrapper >', 'file'), param('ns3::Ptr< ns3::Packet const >', 'p')], is_static=True) ## trace-helper.h (module 'network'): std::string ns3::AsciiTraceHelper::GetFilenameFromDevice(std::string prefix, ns3::Ptr<ns3::NetDevice> device, bool useObjectNames=true) [member function] cls.add_method('GetFilenameFromDevice', 'std::string', [param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'device'), param('bool', 'useObjectNames', default_value='true')]) ## trace-helper.h (module 'network'): std::string ns3::AsciiTraceHelper::GetFilenameFromInterfacePair(std::string prefix, ns3::Ptr<ns3::Object> object, uint32_t interface, bool useObjectNames=true) [member function] cls.add_method('GetFilenameFromInterfacePair', 'std::string', [param('std::string', 'prefix'), param('ns3::Ptr< ns3::Object >', 'object'), param('uint32_t', 'interface'), param('bool', 'useObjectNames', default_value='true')]) return def register_Ns3AsciiTraceHelperForDevice_methods(root_module, cls): ## trace-helper.h (module 'network'): ns3::AsciiTraceHelperForDevice::AsciiTraceHelperForDevice(ns3::AsciiTraceHelperForDevice const & arg0) [copy constructor] cls.add_constructor([param('ns3::AsciiTraceHelperForDevice const &', 'arg0')]) ## trace-helper.h (module 'network'): ns3::AsciiTraceHelperForDevice::AsciiTraceHelperForDevice() [constructor] cls.add_constructor([]) ## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAscii(std::string prefix, ns3::Ptr<ns3::NetDevice> nd, bool explicitFilename=false) [member function] cls.add_method('EnableAscii', 'void', [param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'explicitFilename', default_value='false')]) ## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAscii(ns3::Ptr<ns3::OutputStreamWrapper> stream, ns3::Ptr<ns3::NetDevice> nd) [member function] cls.add_method('EnableAscii', 'void', [param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream'), param('ns3::Ptr< ns3::NetDevice >', 'nd')]) ## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAscii(std::string prefix, std::string ndName, bool explicitFilename=false) [member function] cls.add_method('EnableAscii', 'void', [param('std::string', 'prefix'), param('std::string', 'ndName'), param('bool', 'explicitFilename', default_value='false')]) ## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAscii(ns3::Ptr<ns3::OutputStreamWrapper> stream, std::string ndName) [member function] cls.add_method('EnableAscii', 'void', [param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream'), param('std::string', 'ndName')]) ## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAscii(std::string prefix, ns3::NetDeviceContainer d) [member function] cls.add_method('EnableAscii', 'void', [param('std::string', 'prefix'), param('ns3::NetDeviceContainer', 'd')]) ## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAscii(ns3::Ptr<ns3::OutputStreamWrapper> stream, ns3::NetDeviceContainer d) [member function] cls.add_method('EnableAscii', 'void', [param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream'), param('ns3::NetDeviceContainer', 'd')]) ## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAscii(std::string prefix, ns3::NodeContainer n) [member function] cls.add_method('EnableAscii', 'void', [param('std::string', 'prefix'), param('ns3::NodeContainer', 'n')]) ## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAscii(ns3::Ptr<ns3::OutputStreamWrapper> stream, ns3::NodeContainer n) [member function] cls.add_method('EnableAscii', 'void', [param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream'), param('ns3::NodeContainer', 'n')]) ## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAscii(std::string prefix, uint32_t nodeid, uint32_t deviceid, bool explicitFilename) [member function] cls.add_method('EnableAscii', 'void', [param('std::string', 'prefix'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid'), param('bool', 'explicitFilename')]) ## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAscii(ns3::Ptr<ns3::OutputStreamWrapper> stream, uint32_t nodeid, uint32_t deviceid) [member function] cls.add_method('EnableAscii', 'void', [param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid')]) ## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAsciiAll(std::string prefix) [member function] cls.add_method('EnableAsciiAll', 'void', [param('std::string', 'prefix')]) ## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAsciiAll(ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function] cls.add_method('EnableAsciiAll', 'void', [param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')]) ## trace-helper.h (module 'network'): void ns3::AsciiTraceHelperForDevice::EnableAsciiInternal(ns3::Ptr<ns3::OutputStreamWrapper> stream, std::string prefix, ns3::Ptr<ns3::NetDevice> nd, bool explicitFilename) [member function] cls.add_method('EnableAsciiInternal', 'void', [param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream'), param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'explicitFilename')], is_pure_virtual=True, is_virtual=True) return def register_Ns3AttributeConstructionList_methods(root_module, cls): ## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::AttributeConstructionList(ns3::AttributeConstructionList const & arg0) [copy constructor] cls.add_constructor([param('ns3::AttributeConstructionList const &', 'arg0')]) ## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::AttributeConstructionList() [constructor] cls.add_constructor([]) ## attribute-construction-list.h (module 'core'): void ns3::AttributeConstructionList::Add(std::string name, ns3::Ptr<ns3::AttributeChecker const> checker, ns3::Ptr<ns3::AttributeValue> value) [member function] cls.add_method('Add', 'void', [param('std::string', 'name'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker'), param('ns3::Ptr< ns3::AttributeValue >', 'value')]) ## attribute-construction-list.h (module 'core'): std::_List_const_iterator<ns3::AttributeConstructionList::Item> ns3::AttributeConstructionList::Begin() const [member function] cls.add_method('Begin', 'std::_List_const_iterator< ns3::AttributeConstructionList::Item >', [], is_const=True) ## attribute-construction-list.h (module 'core'): std::_List_const_iterator<ns3::AttributeConstructionList::Item> ns3::AttributeConstructionList::End() const [member function] cls.add_method('End', 'std::_List_const_iterator< ns3::AttributeConstructionList::Item >', [], is_const=True) ## attribute-construction-list.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::AttributeConstructionList::Find(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('Find', 'ns3::Ptr< ns3::AttributeValue >', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True) return def register_Ns3AttributeConstructionListItem_methods(root_module, cls): ## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::Item() [constructor] cls.add_constructor([]) ## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::Item(ns3::AttributeConstructionList::Item const & arg0) [copy constructor] cls.add_constructor([param('ns3::AttributeConstructionList::Item const &', 'arg0')]) ## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::checker [variable] cls.add_instance_attribute('checker', 'ns3::Ptr< ns3::AttributeChecker const >', is_const=False) ## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::name [variable] cls.add_instance_attribute('name', 'std::string', is_const=False) ## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::value [variable] cls.add_instance_attribute('value', 'ns3::Ptr< ns3::AttributeValue >', is_const=False) return def register_Ns3Buffer_methods(root_module, cls): ## buffer.h (module 'network'): ns3::Buffer::Buffer() [constructor] cls.add_constructor([]) ## buffer.h (module 'network'): ns3::Buffer::Buffer(uint32_t dataSize) [constructor] cls.add_constructor([param('uint32_t', 'dataSize')]) ## buffer.h (module 'network'): ns3::Buffer::Buffer(uint32_t dataSize, bool initialize) [constructor] cls.add_constructor([param('uint32_t', 'dataSize'), param('bool', 'initialize')]) ## buffer.h (module 'network'): ns3::Buffer::Buffer(ns3::Buffer const & o) [copy constructor] cls.add_constructor([param('ns3::Buffer const &', 'o')]) ## buffer.h (module 'network'): bool ns3::Buffer::AddAtEnd(uint32_t end) [member function] cls.add_method('AddAtEnd', 'bool', [param('uint32_t', 'end')]) ## buffer.h (module 'network'): void ns3::Buffer::AddAtEnd(ns3::Buffer const & o) [member function] cls.add_method('AddAtEnd', 'void', [param('ns3::Buffer const &', 'o')]) ## buffer.h (module 'network'): bool ns3::Buffer::AddAtStart(uint32_t start) [member function] cls.add_method('AddAtStart', 'bool', [param('uint32_t', 'start')]) ## buffer.h (module 'network'): ns3::Buffer::Iterator ns3::Buffer::Begin() const [member function] cls.add_method('Begin', 'ns3::Buffer::Iterator', [], is_const=True) ## buffer.h (module 'network'): void ns3::Buffer::CopyData(std::ostream * os, uint32_t size) const [member function] cls.add_method('CopyData', 'void', [param('std::ostream *', 'os'), param('uint32_t', 'size')], is_const=True) ## buffer.h (module 'network'): uint32_t ns3::Buffer::CopyData(uint8_t * buffer, uint32_t size) const [member function] cls.add_method('CopyData', 'uint32_t', [param('uint8_t *', 'buffer'), param('uint32_t', 'size')], is_const=True) ## buffer.h (module 'network'): ns3::Buffer ns3::Buffer::CreateFragment(uint32_t start, uint32_t length) const [member function] cls.add_method('CreateFragment', 'ns3::Buffer', [param('uint32_t', 'start'), param('uint32_t', 'length')], is_const=True) ## buffer.h (module 'network'): ns3::Buffer ns3::Buffer::CreateFullCopy() const [member function] cls.add_method('CreateFullCopy', 'ns3::Buffer', [], is_const=True) ## buffer.h (module 'network'): uint32_t ns3::Buffer::Deserialize(uint8_t const * buffer, uint32_t size) [member function] cls.add_method('Deserialize', 'uint32_t', [param('uint8_t const *', 'buffer'), param('uint32_t', 'size')]) ## buffer.h (module 'network'): ns3::Buffer::Iterator ns3::Buffer::End() const [member function] cls.add_method('End', 'ns3::Buffer::Iterator', [], is_const=True) ## buffer.h (module 'network'): int32_t ns3::Buffer::GetCurrentEndOffset() const [member function] cls.add_method('GetCurrentEndOffset', 'int32_t', [], is_const=True) ## buffer.h (module 'network'): int32_t ns3::Buffer::GetCurrentStartOffset() const [member function] cls.add_method('GetCurrentStartOffset', 'int32_t', [], is_const=True) ## buffer.h (module 'network'): uint32_t ns3::Buffer::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True) ## buffer.h (module 'network'): uint32_t ns3::Buffer::GetSize() const [member function] cls.add_method('GetSize', 'uint32_t', [], is_const=True) ## buffer.h (module 'network'): uint8_t const * ns3::Buffer::PeekData() const [member function] cls.add_method('PeekData', 'uint8_t const *', [], is_const=True) ## buffer.h (module 'network'): void ns3::Buffer::RemoveAtEnd(uint32_t end) [member function] cls.add_method('RemoveAtEnd', 'void', [param('uint32_t', 'end')]) ## buffer.h (module 'network'): void ns3::Buffer::RemoveAtStart(uint32_t start) [member function] cls.add_method('RemoveAtStart', 'void', [param('uint32_t', 'start')]) ## buffer.h (module 'network'): uint32_t ns3::Buffer::Serialize(uint8_t * buffer, uint32_t maxSize) const [member function] cls.add_method('Serialize', 'uint32_t', [param('uint8_t *', 'buffer'), param('uint32_t', 'maxSize')], is_const=True) return def register_Ns3BufferIterator_methods(root_module, cls): ## buffer.h (module 'network'): ns3::Buffer::Iterator::Iterator(ns3::Buffer::Iterator const & arg0) [copy constructor] cls.add_constructor([param('ns3::Buffer::Iterator const &', 'arg0')]) ## buffer.h (module 'network'): ns3::Buffer::Iterator::Iterator() [constructor] cls.add_constructor([]) ## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::CalculateIpChecksum(uint16_t size) [member function] cls.add_method('CalculateIpChecksum', 'uint16_t', [param('uint16_t', 'size')]) ## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::CalculateIpChecksum(uint16_t size, uint32_t initialChecksum) [member function] cls.add_method('CalculateIpChecksum', 'uint16_t', [param('uint16_t', 'size'), param('uint32_t', 'initialChecksum')]) ## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::GetDistanceFrom(ns3::Buffer::Iterator const & o) const [member function] cls.add_method('GetDistanceFrom', 'uint32_t', [param('ns3::Buffer::Iterator const &', 'o')], is_const=True) ## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::GetSize() const [member function] cls.add_method('GetSize', 'uint32_t', [], is_const=True) ## buffer.h (module 'network'): bool ns3::Buffer::Iterator::IsEnd() const [member function] cls.add_method('IsEnd', 'bool', [], is_const=True) ## buffer.h (module 'network'): bool ns3::Buffer::Iterator::IsStart() const [member function] cls.add_method('IsStart', 'bool', [], is_const=True) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::Next() [member function] cls.add_method('Next', 'void', []) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::Next(uint32_t delta) [member function] cls.add_method('Next', 'void', [param('uint32_t', 'delta')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::Prev() [member function] cls.add_method('Prev', 'void', []) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::Prev(uint32_t delta) [member function] cls.add_method('Prev', 'void', [param('uint32_t', 'delta')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::Read(uint8_t * buffer, uint32_t size) [member function] cls.add_method('Read', 'void', [param('uint8_t *', 'buffer'), param('uint32_t', 'size')]) ## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::ReadLsbtohU16() [member function] cls.add_method('ReadLsbtohU16', 'uint16_t', []) ## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::ReadLsbtohU32() [member function] cls.add_method('ReadLsbtohU32', 'uint32_t', []) ## buffer.h (module 'network'): uint64_t ns3::Buffer::Iterator::ReadLsbtohU64() [member function] cls.add_method('ReadLsbtohU64', 'uint64_t', []) ## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::ReadNtohU16() [member function] cls.add_method('ReadNtohU16', 'uint16_t', []) ## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::ReadNtohU32() [member function] cls.add_method('ReadNtohU32', 'uint32_t', []) ## buffer.h (module 'network'): uint64_t ns3::Buffer::Iterator::ReadNtohU64() [member function] cls.add_method('ReadNtohU64', 'uint64_t', []) ## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::ReadU16() [member function] cls.add_method('ReadU16', 'uint16_t', []) ## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::ReadU32() [member function] cls.add_method('ReadU32', 'uint32_t', []) ## buffer.h (module 'network'): uint64_t ns3::Buffer::Iterator::ReadU64() [member function] cls.add_method('ReadU64', 'uint64_t', []) ## buffer.h (module 'network'): uint8_t ns3::Buffer::Iterator::ReadU8() [member function] cls.add_method('ReadU8', 'uint8_t', []) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::Write(uint8_t const * buffer, uint32_t size) [member function] cls.add_method('Write', 'void', [param('uint8_t const *', 'buffer'), param('uint32_t', 'size')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::Write(ns3::Buffer::Iterator start, ns3::Buffer::Iterator end) [member function] cls.add_method('Write', 'void', [param('ns3::Buffer::Iterator', 'start'), param('ns3::Buffer::Iterator', 'end')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtolsbU16(uint16_t data) [member function] cls.add_method('WriteHtolsbU16', 'void', [param('uint16_t', 'data')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtolsbU32(uint32_t data) [member function] cls.add_method('WriteHtolsbU32', 'void', [param('uint32_t', 'data')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtolsbU64(uint64_t data) [member function] cls.add_method('WriteHtolsbU64', 'void', [param('uint64_t', 'data')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtonU16(uint16_t data) [member function] cls.add_method('WriteHtonU16', 'void', [param('uint16_t', 'data')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtonU32(uint32_t data) [member function] cls.add_method('WriteHtonU32', 'void', [param('uint32_t', 'data')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtonU64(uint64_t data) [member function] cls.add_method('WriteHtonU64', 'void', [param('uint64_t', 'data')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU16(uint16_t data) [member function] cls.add_method('WriteU16', 'void', [param('uint16_t', 'data')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU32(uint32_t data) [member function] cls.add_method('WriteU32', 'void', [param('uint32_t', 'data')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU64(uint64_t data) [member function] cls.add_method('WriteU64', 'void', [param('uint64_t', 'data')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU8(uint8_t data) [member function] cls.add_method('WriteU8', 'void', [param('uint8_t', 'data')]) ## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU8(uint8_t data, uint32_t len) [member function] cls.add_method('WriteU8', 'void', [param('uint8_t', 'data'), param('uint32_t', 'len')]) return def register_Ns3ByteTagIterator_methods(root_module, cls): ## packet.h (module 'network'): ns3::ByteTagIterator::ByteTagIterator(ns3::ByteTagIterator const & arg0) [copy constructor] cls.add_constructor([param('ns3::ByteTagIterator const &', 'arg0')]) ## packet.h (module 'network'): bool ns3::ByteTagIterator::HasNext() const [member function] cls.add_method('HasNext', 'bool', [], is_const=True) ## packet.h (module 'network'): ns3::ByteTagIterator::Item ns3::ByteTagIterator::Next() [member function] cls.add_method('Next', 'ns3::ByteTagIterator::Item', []) return def register_Ns3ByteTagIteratorItem_methods(root_module, cls): ## packet.h (module 'network'): ns3::ByteTagIterator::Item::Item(ns3::ByteTagIterator::Item const & arg0) [copy constructor] cls.add_constructor([param('ns3::ByteTagIterator::Item const &', 'arg0')]) ## packet.h (module 'network'): uint32_t ns3::ByteTagIterator::Item::GetEnd() const [member function] cls.add_method('GetEnd', 'uint32_t', [], is_const=True) ## packet.h (module 'network'): uint32_t ns3::ByteTagIterator::Item::GetStart() const [member function] cls.add_method('GetStart', 'uint32_t', [], is_const=True) ## packet.h (module 'network'): void ns3::ByteTagIterator::Item::GetTag(ns3::Tag & tag) const [member function] cls.add_method('GetTag', 'void', [param('ns3::Tag &', 'tag')], is_const=True) ## packet.h (module 'network'): ns3::TypeId ns3::ByteTagIterator::Item::GetTypeId() const [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_const=True) return def register_Ns3ByteTagList_methods(root_module, cls): ## byte-tag-list.h (module 'network'): ns3::ByteTagList::ByteTagList() [constructor] cls.add_constructor([]) ## byte-tag-list.h (module 'network'): ns3::ByteTagList::ByteTagList(ns3::ByteTagList const & o) [copy constructor] cls.add_constructor([param('ns3::ByteTagList const &', 'o')]) ## byte-tag-list.h (module 'network'): ns3::TagBuffer ns3::ByteTagList::Add(ns3::TypeId tid, uint32_t bufferSize, int32_t start, int32_t end) [member function] cls.add_method('Add', 'ns3::TagBuffer', [param('ns3::TypeId', 'tid'), param('uint32_t', 'bufferSize'), param('int32_t', 'start'), param('int32_t', 'end')]) ## byte-tag-list.h (module 'network'): void ns3::ByteTagList::Add(ns3::ByteTagList const & o) [member function] cls.add_method('Add', 'void', [param('ns3::ByteTagList const &', 'o')]) ## byte-tag-list.h (module 'network'): void ns3::ByteTagList::AddAtEnd(int32_t adjustment, int32_t appendOffset) [member function] cls.add_method('AddAtEnd', 'void', [param('int32_t', 'adjustment'), param('int32_t', 'appendOffset')]) ## byte-tag-list.h (module 'network'): void ns3::ByteTagList::AddAtStart(int32_t adjustment, int32_t prependOffset) [member function] cls.add_method('AddAtStart', 'void', [param('int32_t', 'adjustment'), param('int32_t', 'prependOffset')]) ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator ns3::ByteTagList::Begin(int32_t offsetStart, int32_t offsetEnd) const [member function] cls.add_method('Begin', 'ns3::ByteTagList::Iterator', [param('int32_t', 'offsetStart'), param('int32_t', 'offsetEnd')], is_const=True) ## byte-tag-list.h (module 'network'): void ns3::ByteTagList::RemoveAll() [member function] cls.add_method('RemoveAll', 'void', []) return def register_Ns3ByteTagListIterator_methods(root_module, cls): ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Iterator(ns3::ByteTagList::Iterator const & arg0) [copy constructor] cls.add_constructor([param('ns3::ByteTagList::Iterator const &', 'arg0')]) ## byte-tag-list.h (module 'network'): uint32_t ns3::ByteTagList::Iterator::GetOffsetStart() const [member function] cls.add_method('GetOffsetStart', 'uint32_t', [], is_const=True) ## byte-tag-list.h (module 'network'): bool ns3::ByteTagList::Iterator::HasNext() const [member function] cls.add_method('HasNext', 'bool', [], is_const=True) ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item ns3::ByteTagList::Iterator::Next() [member function] cls.add_method('Next', 'ns3::ByteTagList::Iterator::Item', []) return def register_Ns3ByteTagListIteratorItem_methods(root_module, cls): ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::Item(ns3::ByteTagList::Iterator::Item const & arg0) [copy constructor] cls.add_constructor([param('ns3::ByteTagList::Iterator::Item const &', 'arg0')]) ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::Item(ns3::TagBuffer buf) [constructor] cls.add_constructor([param('ns3::TagBuffer', 'buf')]) ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::buf [variable] cls.add_instance_attribute('buf', 'ns3::TagBuffer', is_const=False) ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::end [variable] cls.add_instance_attribute('end', 'int32_t', is_const=False) ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::size [variable] cls.add_instance_attribute('size', 'uint32_t', is_const=False) ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::start [variable] cls.add_instance_attribute('start', 'int32_t', is_const=False) ## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::tid [variable] cls.add_instance_attribute('tid', 'ns3::TypeId', is_const=False) return def register_Ns3CallbackBase_methods(root_module, cls): ## callback.h (module 'core'): ns3::CallbackBase::CallbackBase(ns3::CallbackBase const & arg0) [copy constructor] cls.add_constructor([param('ns3::CallbackBase const &', 'arg0')]) ## callback.h (module 'core'): ns3::CallbackBase::CallbackBase() [constructor] cls.add_constructor([]) ## callback.h (module 'core'): ns3::Ptr<ns3::CallbackImplBase> ns3::CallbackBase::GetImpl() const [member function] cls.add_method('GetImpl', 'ns3::Ptr< ns3::CallbackImplBase >', [], is_const=True) ## callback.h (module 'core'): ns3::CallbackBase::CallbackBase(ns3::Ptr<ns3::CallbackImplBase> impl) [constructor] cls.add_constructor([param('ns3::Ptr< ns3::CallbackImplBase >', 'impl')], visibility='protected') ## callback.h (module 'core'): static std::string ns3::CallbackBase::Demangle(std::string const & mangled) [member function] cls.add_method('Demangle', 'std::string', [param('std::string const &', 'mangled')], is_static=True, visibility='protected') return def register_Ns3ChannelList_methods(root_module, cls): ## channel-list.h (module 'network'): ns3::ChannelList::ChannelList() [constructor] cls.add_constructor([]) ## channel-list.h (module 'network'): ns3::ChannelList::ChannelList(ns3::ChannelList const & arg0) [copy constructor] cls.add_constructor([param('ns3::ChannelList const &', 'arg0')]) ## channel-list.h (module 'network'): static uint32_t ns3::ChannelList::Add(ns3::Ptr<ns3::Channel> channel) [member function] cls.add_method('Add', 'uint32_t', [param('ns3::Ptr< ns3::Channel >', 'channel')], is_static=True) ## channel-list.h (module 'network'): static __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::Channel>*,std::vector<ns3::Ptr<ns3::Channel>, std::allocator<ns3::Ptr<ns3::Channel> > > > ns3::ChannelList::Begin() [member function] cls.add_method('Begin', '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Channel > const, std::vector< ns3::Ptr< ns3::Channel > > >', [], is_static=True) ## channel-list.h (module 'network'): static __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::Channel>*,std::vector<ns3::Ptr<ns3::Channel>, std::allocator<ns3::Ptr<ns3::Channel> > > > ns3::ChannelList::End() [member function] cls.add_method('End', '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Channel > const, std::vector< ns3::Ptr< ns3::Channel > > >', [], is_static=True) ## channel-list.h (module 'network'): static ns3::Ptr<ns3::Channel> ns3::ChannelList::GetChannel(uint32_t n) [member function] cls.add_method('GetChannel', 'ns3::Ptr< ns3::Channel >', [param('uint32_t', 'n')], is_static=True) ## channel-list.h (module 'network'): static uint32_t ns3::ChannelList::GetNChannels() [member function] cls.add_method('GetNChannels', 'uint32_t', [], is_static=True) return def register_Ns3DataRate_methods(root_module, cls): cls.add_output_stream_operator() cls.add_binary_comparison_operator('!=') cls.add_binary_comparison_operator('<') cls.add_binary_comparison_operator('<=') cls.add_binary_comparison_operator('==') cls.add_binary_comparison_operator('>') cls.add_binary_comparison_operator('>=') ## data-rate.h (module 'network'): ns3::DataRate::DataRate(ns3::DataRate const & arg0) [copy constructor] cls.add_constructor([param('ns3::DataRate const &', 'arg0')]) ## data-rate.h (module 'network'): ns3::DataRate::DataRate() [constructor] cls.add_constructor([]) ## data-rate.h (module 'network'): ns3::DataRate::DataRate(uint64_t bps) [constructor] cls.add_constructor([param('uint64_t', 'bps')]) ## data-rate.h (module 'network'): ns3::DataRate::DataRate(std::string rate) [constructor] cls.add_constructor([param('std::string', 'rate')]) ## data-rate.h (module 'network'): double ns3::DataRate::CalculateTxTime(uint32_t bytes) const [member function] cls.add_method('CalculateTxTime', 'double', [param('uint32_t', 'bytes')], is_const=True) ## data-rate.h (module 'network'): uint64_t ns3::DataRate::GetBitRate() const [member function] cls.add_method('GetBitRate', 'uint64_t', [], is_const=True) return def register_Ns3EventId_methods(root_module, cls): cls.add_binary_comparison_operator('!=') cls.add_binary_comparison_operator('==') ## event-id.h (module 'core'): ns3::EventId::EventId(ns3::EventId const & arg0) [copy constructor] cls.add_constructor([param('ns3::EventId const &', 'arg0')]) ## event-id.h (module 'core'): ns3::EventId::EventId() [constructor] cls.add_constructor([]) ## event-id.h (module 'core'): ns3::EventId::EventId(ns3::Ptr<ns3::EventImpl> const & impl, uint64_t ts, uint32_t context, uint32_t uid) [constructor] cls.add_constructor([param('ns3::Ptr< ns3::EventImpl > const &', 'impl'), param('uint64_t', 'ts'), param('uint32_t', 'context'), param('uint32_t', 'uid')]) ## event-id.h (module 'core'): void ns3::EventId::Cancel() [member function] cls.add_method('Cancel', 'void', []) ## event-id.h (module 'core'): uint32_t ns3::EventId::GetContext() const [member function] cls.add_method('GetContext', 'uint32_t', [], is_const=True) ## event-id.h (module 'core'): uint64_t ns3::EventId::GetTs() const [member function] cls.add_method('GetTs', 'uint64_t', [], is_const=True) ## event-id.h (module 'core'): uint32_t ns3::EventId::GetUid() const [member function] cls.add_method('GetUid', 'uint32_t', [], is_const=True) ## event-id.h (module 'core'): bool ns3::EventId::IsExpired() const [member function] cls.add_method('IsExpired', 'bool', [], is_const=True) ## event-id.h (module 'core'): bool ns3::EventId::IsRunning() const [member function] cls.add_method('IsRunning', 'bool', [], is_const=True) ## event-id.h (module 'core'): ns3::EventImpl * ns3::EventId::PeekEventImpl() const [member function] cls.add_method('PeekEventImpl', 'ns3::EventImpl *', [], is_const=True) return def register_Ns3Inet6SocketAddress_methods(root_module, cls): ## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Inet6SocketAddress const & arg0) [copy constructor] cls.add_constructor([param('ns3::Inet6SocketAddress const &', 'arg0')]) ## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Ipv6Address ipv6, uint16_t port) [constructor] cls.add_constructor([param('ns3::Ipv6Address', 'ipv6'), param('uint16_t', 'port')]) ## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Ipv6Address ipv6) [constructor] cls.add_constructor([param('ns3::Ipv6Address', 'ipv6')]) ## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(uint16_t port) [constructor] cls.add_constructor([param('uint16_t', 'port')]) ## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(char const * ipv6, uint16_t port) [constructor] cls.add_constructor([param('char const *', 'ipv6'), param('uint16_t', 'port')]) ## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(char const * ipv6) [constructor] cls.add_constructor([param('char const *', 'ipv6')]) ## inet6-socket-address.h (module 'network'): static ns3::Inet6SocketAddress ns3::Inet6SocketAddress::ConvertFrom(ns3::Address const & addr) [member function] cls.add_method('ConvertFrom', 'ns3::Inet6SocketAddress', [param('ns3::Address const &', 'addr')], is_static=True) ## inet6-socket-address.h (module 'network'): ns3::Ipv6Address ns3::Inet6SocketAddress::GetIpv6() const [member function] cls.add_method('GetIpv6', 'ns3::Ipv6Address', [], is_const=True) ## inet6-socket-address.h (module 'network'): uint16_t ns3::Inet6SocketAddress::GetPort() const [member function] cls.add_method('GetPort', 'uint16_t', [], is_const=True) ## inet6-socket-address.h (module 'network'): static bool ns3::Inet6SocketAddress::IsMatchingType(ns3::Address const & addr) [member function] cls.add_method('IsMatchingType', 'bool', [param('ns3::Address const &', 'addr')], is_static=True) ## inet6-socket-address.h (module 'network'): void ns3::Inet6SocketAddress::SetIpv6(ns3::Ipv6Address ipv6) [member function] cls.add_method('SetIpv6', 'void', [param('ns3::Ipv6Address', 'ipv6')]) ## inet6-socket-address.h (module 'network'): void ns3::Inet6SocketAddress::SetPort(uint16_t port) [member function] cls.add_method('SetPort', 'void', [param('uint16_t', 'port')]) return def register_Ns3InetSocketAddress_methods(root_module, cls): ## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(ns3::InetSocketAddress const & arg0) [copy constructor] cls.add_constructor([param('ns3::InetSocketAddress const &', 'arg0')]) ## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(ns3::Ipv4Address ipv4, uint16_t port) [constructor] cls.add_constructor([param('ns3::Ipv4Address', 'ipv4'), param('uint16_t', 'port')]) ## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(ns3::Ipv4Address ipv4) [constructor] cls.add_constructor([param('ns3::Ipv4Address', 'ipv4')]) ## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(uint16_t port) [constructor] cls.add_constructor([param('uint16_t', 'port')]) ## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(char const * ipv4, uint16_t port) [constructor] cls.add_constructor([param('char const *', 'ipv4'), param('uint16_t', 'port')]) ## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(char const * ipv4) [constructor] cls.add_constructor([param('char const *', 'ipv4')]) ## inet-socket-address.h (module 'network'): static ns3::InetSocketAddress ns3::InetSocketAddress::ConvertFrom(ns3::Address const & address) [member function] cls.add_method('ConvertFrom', 'ns3::InetSocketAddress', [param('ns3::Address const &', 'address')], is_static=True) ## inet-socket-address.h (module 'network'): ns3::Ipv4Address ns3::InetSocketAddress::GetIpv4() const [member function] cls.add_method('GetIpv4', 'ns3::Ipv4Address', [], is_const=True) ## inet-socket-address.h (module 'network'): uint16_t ns3::InetSocketAddress::GetPort() const [member function] cls.add_method('GetPort', 'uint16_t', [], is_const=True) ## inet-socket-address.h (module 'network'): static bool ns3::InetSocketAddress::IsMatchingType(ns3::Address const & address) [member function] cls.add_method('IsMatchingType', 'bool', [param('ns3::Address const &', 'address')], is_static=True) ## inet-socket-address.h (module 'network'): void ns3::InetSocketAddress::SetIpv4(ns3::Ipv4Address address) [member function] cls.add_method('SetIpv4', 'void', [param('ns3::Ipv4Address', 'address')]) ## inet-socket-address.h (module 'network'): void ns3::InetSocketAddress::SetPort(uint16_t port) [member function] cls.add_method('SetPort', 'void', [param('uint16_t', 'port')]) return def register_Ns3Ipv4Address_methods(root_module, cls): cls.add_binary_comparison_operator('<') cls.add_binary_comparison_operator('!=') cls.add_output_stream_operator() cls.add_binary_comparison_operator('==') ## ipv4-address.h (module 'network'): ns3::Ipv4Address::Ipv4Address(ns3::Ipv4Address const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv4Address const &', 'arg0')]) ## ipv4-address.h (module 'network'): ns3::Ipv4Address::Ipv4Address() [constructor] cls.add_constructor([]) ## ipv4-address.h (module 'network'): ns3::Ipv4Address::Ipv4Address(uint32_t address) [constructor] cls.add_constructor([param('uint32_t', 'address')]) ## ipv4-address.h (module 'network'): ns3::Ipv4Address::Ipv4Address(char const * address) [constructor] cls.add_constructor([param('char const *', 'address')]) ## ipv4-address.h (module 'network'): ns3::Ipv4Address ns3::Ipv4Address::CombineMask(ns3::Ipv4Mask const & mask) const [member function] cls.add_method('CombineMask', 'ns3::Ipv4Address', [param('ns3::Ipv4Mask const &', 'mask')], is_const=True) ## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::ConvertFrom(ns3::Address const & address) [member function] cls.add_method('ConvertFrom', 'ns3::Ipv4Address', [param('ns3::Address const &', 'address')], is_static=True) ## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::Deserialize(uint8_t const * buf) [member function] cls.add_method('Deserialize', 'ns3::Ipv4Address', [param('uint8_t const *', 'buf')], is_static=True) ## ipv4-address.h (module 'network'): uint32_t ns3::Ipv4Address::Get() const [member function] cls.add_method('Get', 'uint32_t', [], is_const=True) ## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetAny() [member function] cls.add_method('GetAny', 'ns3::Ipv4Address', [], is_static=True) ## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetBroadcast() [member function] cls.add_method('GetBroadcast', 'ns3::Ipv4Address', [], is_static=True) ## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetLoopback() [member function] cls.add_method('GetLoopback', 'ns3::Ipv4Address', [], is_static=True) ## ipv4-address.h (module 'network'): ns3::Ipv4Address ns3::Ipv4Address::GetSubnetDirectedBroadcast(ns3::Ipv4Mask const & mask) const [member function] cls.add_method('GetSubnetDirectedBroadcast', 'ns3::Ipv4Address', [param('ns3::Ipv4Mask const &', 'mask')], is_const=True) ## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetZero() [member function] cls.add_method('GetZero', 'ns3::Ipv4Address', [], is_static=True) ## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsBroadcast() const [member function] cls.add_method('IsBroadcast', 'bool', [], is_const=True) ## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsEqual(ns3::Ipv4Address const & other) const [member function] cls.add_method('IsEqual', 'bool', [param('ns3::Ipv4Address const &', 'other')], is_const=True) ## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsLocalMulticast() const [member function] cls.add_method('IsLocalMulticast', 'bool', [], is_const=True) ## ipv4-address.h (module 'network'): static bool ns3::Ipv4Address::IsMatchingType(ns3::Address const & address) [member function] cls.add_method('IsMatchingType', 'bool', [param('ns3::Address const &', 'address')], is_static=True) ## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsMulticast() const [member function] cls.add_method('IsMulticast', 'bool', [], is_const=True) ## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsSubnetDirectedBroadcast(ns3::Ipv4Mask const & mask) const [member function] cls.add_method('IsSubnetDirectedBroadcast', 'bool', [param('ns3::Ipv4Mask const &', 'mask')], is_const=True) ## ipv4-address.h (module 'network'): void ns3::Ipv4Address::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True) ## ipv4-address.h (module 'network'): void ns3::Ipv4Address::Serialize(uint8_t * buf) const [member function] cls.add_method('Serialize', 'void', [param('uint8_t *', 'buf')], is_const=True) ## ipv4-address.h (module 'network'): void ns3::Ipv4Address::Set(uint32_t address) [member function] cls.add_method('Set', 'void', [param('uint32_t', 'address')]) ## ipv4-address.h (module 'network'): void ns3::Ipv4Address::Set(char const * address) [member function] cls.add_method('Set', 'void', [param('char const *', 'address')]) return def register_Ns3Ipv4Mask_methods(root_module, cls): cls.add_binary_comparison_operator('!=') cls.add_output_stream_operator() cls.add_binary_comparison_operator('==') ## ipv4-address.h (module 'network'): ns3::Ipv4Mask::Ipv4Mask(ns3::Ipv4Mask const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv4Mask const &', 'arg0')]) ## ipv4-address.h (module 'network'): ns3::Ipv4Mask::Ipv4Mask() [constructor] cls.add_constructor([]) ## ipv4-address.h (module 'network'): ns3::Ipv4Mask::Ipv4Mask(uint32_t mask) [constructor] cls.add_constructor([param('uint32_t', 'mask')]) ## ipv4-address.h (module 'network'): ns3::Ipv4Mask::Ipv4Mask(char const * mask) [constructor] cls.add_constructor([param('char const *', 'mask')]) ## ipv4-address.h (module 'network'): uint32_t ns3::Ipv4Mask::Get() const [member function] cls.add_method('Get', 'uint32_t', [], is_const=True) ## ipv4-address.h (module 'network'): uint32_t ns3::Ipv4Mask::GetInverse() const [member function] cls.add_method('GetInverse', 'uint32_t', [], is_const=True) ## ipv4-address.h (module 'network'): static ns3::Ipv4Mask ns3::Ipv4Mask::GetLoopback() [member function] cls.add_method('GetLoopback', 'ns3::Ipv4Mask', [], is_static=True) ## ipv4-address.h (module 'network'): static ns3::Ipv4Mask ns3::Ipv4Mask::GetOnes() [member function] cls.add_method('GetOnes', 'ns3::Ipv4Mask', [], is_static=True) ## ipv4-address.h (module 'network'): uint16_t ns3::Ipv4Mask::GetPrefixLength() const [member function] cls.add_method('GetPrefixLength', 'uint16_t', [], is_const=True) ## ipv4-address.h (module 'network'): static ns3::Ipv4Mask ns3::Ipv4Mask::GetZero() [member function] cls.add_method('GetZero', 'ns3::Ipv4Mask', [], is_static=True) ## ipv4-address.h (module 'network'): bool ns3::Ipv4Mask::IsEqual(ns3::Ipv4Mask other) const [member function] cls.add_method('IsEqual', 'bool', [param('ns3::Ipv4Mask', 'other')], is_const=True) ## ipv4-address.h (module 'network'): bool ns3::Ipv4Mask::IsMatch(ns3::Ipv4Address a, ns3::Ipv4Address b) const [member function] cls.add_method('IsMatch', 'bool', [param('ns3::Ipv4Address', 'a'), param('ns3::Ipv4Address', 'b')], is_const=True) ## ipv4-address.h (module 'network'): void ns3::Ipv4Mask::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True) ## ipv4-address.h (module 'network'): void ns3::Ipv4Mask::Set(uint32_t mask) [member function] cls.add_method('Set', 'void', [param('uint32_t', 'mask')]) return def register_Ns3Ipv6Address_methods(root_module, cls): cls.add_binary_comparison_operator('<') cls.add_binary_comparison_operator('!=') cls.add_output_stream_operator() cls.add_binary_comparison_operator('==') ## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address() [constructor] cls.add_constructor([]) ## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address(char const * address) [constructor] cls.add_constructor([param('char const *', 'address')]) ## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address(uint8_t * address) [constructor] cls.add_constructor([param('uint8_t *', 'address')]) ## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address(ns3::Ipv6Address const & addr) [copy constructor] cls.add_constructor([param('ns3::Ipv6Address const &', 'addr')]) ## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address(ns3::Ipv6Address const * addr) [constructor] cls.add_constructor([param('ns3::Ipv6Address const *', 'addr')]) ## ipv6-address.h (module 'network'): ns3::Ipv6Address ns3::Ipv6Address::CombinePrefix(ns3::Ipv6Prefix const & prefix) [member function] cls.add_method('CombinePrefix', 'ns3::Ipv6Address', [param('ns3::Ipv6Prefix const &', 'prefix')]) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::ConvertFrom(ns3::Address const & address) [member function] cls.add_method('ConvertFrom', 'ns3::Ipv6Address', [param('ns3::Address const &', 'address')], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::Deserialize(uint8_t const * buf) [member function] cls.add_method('Deserialize', 'ns3::Ipv6Address', [param('uint8_t const *', 'buf')], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetAllHostsMulticast() [member function] cls.add_method('GetAllHostsMulticast', 'ns3::Ipv6Address', [], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetAllNodesMulticast() [member function] cls.add_method('GetAllNodesMulticast', 'ns3::Ipv6Address', [], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetAllRoutersMulticast() [member function] cls.add_method('GetAllRoutersMulticast', 'ns3::Ipv6Address', [], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetAny() [member function] cls.add_method('GetAny', 'ns3::Ipv6Address', [], is_static=True) ## ipv6-address.h (module 'network'): void ns3::Ipv6Address::GetBytes(uint8_t * buf) const [member function] cls.add_method('GetBytes', 'void', [param('uint8_t *', 'buf')], is_const=True) ## ipv6-address.h (module 'network'): ns3::Ipv4Address ns3::Ipv6Address::GetIpv4MappedAddress() const [member function] cls.add_method('GetIpv4MappedAddress', 'ns3::Ipv4Address', [], is_const=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetLoopback() [member function] cls.add_method('GetLoopback', 'ns3::Ipv6Address', [], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetOnes() [member function] cls.add_method('GetOnes', 'ns3::Ipv6Address', [], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetZero() [member function] cls.add_method('GetZero', 'ns3::Ipv6Address', [], is_static=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsAllHostsMulticast() const [member function] cls.add_method('IsAllHostsMulticast', 'bool', [], is_const=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsAllNodesMulticast() const [member function] cls.add_method('IsAllNodesMulticast', 'bool', [], is_const=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsAllRoutersMulticast() const [member function] cls.add_method('IsAllRoutersMulticast', 'bool', [], is_const=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsAny() const [member function] cls.add_method('IsAny', 'bool', [], is_const=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsEqual(ns3::Ipv6Address const & other) const [member function] cls.add_method('IsEqual', 'bool', [param('ns3::Ipv6Address const &', 'other')], is_const=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsIpv4MappedAddress() [member function] cls.add_method('IsIpv4MappedAddress', 'bool', []) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsLinkLocal() const [member function] cls.add_method('IsLinkLocal', 'bool', [], is_const=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsLinkLocalMulticast() const [member function] cls.add_method('IsLinkLocalMulticast', 'bool', [], is_const=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsLocalhost() const [member function] cls.add_method('IsLocalhost', 'bool', [], is_const=True) ## ipv6-address.h (module 'network'): static bool ns3::Ipv6Address::IsMatchingType(ns3::Address const & address) [member function] cls.add_method('IsMatchingType', 'bool', [param('ns3::Address const &', 'address')], is_static=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsMulticast() const [member function] cls.add_method('IsMulticast', 'bool', [], is_const=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsSolicitedMulticast() const [member function] cls.add_method('IsSolicitedMulticast', 'bool', [], is_const=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredAddress(ns3::Mac48Address addr, ns3::Ipv6Address prefix) [member function] cls.add_method('MakeAutoconfiguredAddress', 'ns3::Ipv6Address', [param('ns3::Mac48Address', 'addr'), param('ns3::Ipv6Address', 'prefix')], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(ns3::Mac48Address mac) [member function] cls.add_method('MakeAutoconfiguredLinkLocalAddress', 'ns3::Ipv6Address', [param('ns3::Mac48Address', 'mac')], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeIpv4MappedAddress(ns3::Ipv4Address addr) [member function] cls.add_method('MakeIpv4MappedAddress', 'ns3::Ipv6Address', [param('ns3::Ipv4Address', 'addr')], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeSolicitedAddress(ns3::Ipv6Address addr) [member function] cls.add_method('MakeSolicitedAddress', 'ns3::Ipv6Address', [param('ns3::Ipv6Address', 'addr')], is_static=True) ## ipv6-address.h (module 'network'): void ns3::Ipv6Address::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True) ## ipv6-address.h (module 'network'): void ns3::Ipv6Address::Serialize(uint8_t * buf) const [member function] cls.add_method('Serialize', 'void', [param('uint8_t *', 'buf')], is_const=True) ## ipv6-address.h (module 'network'): void ns3::Ipv6Address::Set(char const * address) [member function] cls.add_method('Set', 'void', [param('char const *', 'address')]) ## ipv6-address.h (module 'network'): void ns3::Ipv6Address::Set(uint8_t * address) [member function] cls.add_method('Set', 'void', [param('uint8_t *', 'address')]) return def register_Ns3Ipv6Prefix_methods(root_module, cls): cls.add_binary_comparison_operator('!=') cls.add_output_stream_operator() cls.add_binary_comparison_operator('==') ## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix() [constructor] cls.add_constructor([]) ## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(uint8_t * prefix) [constructor] cls.add_constructor([param('uint8_t *', 'prefix')]) ## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(char const * prefix) [constructor] cls.add_constructor([param('char const *', 'prefix')]) ## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(uint8_t prefix) [constructor] cls.add_constructor([param('uint8_t', 'prefix')]) ## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(ns3::Ipv6Prefix const & prefix) [copy constructor] cls.add_constructor([param('ns3::Ipv6Prefix const &', 'prefix')]) ## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(ns3::Ipv6Prefix const * prefix) [constructor] cls.add_constructor([param('ns3::Ipv6Prefix const *', 'prefix')]) ## ipv6-address.h (module 'network'): void ns3::Ipv6Prefix::GetBytes(uint8_t * buf) const [member function] cls.add_method('GetBytes', 'void', [param('uint8_t *', 'buf')], is_const=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Prefix ns3::Ipv6Prefix::GetLoopback() [member function] cls.add_method('GetLoopback', 'ns3::Ipv6Prefix', [], is_static=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Prefix ns3::Ipv6Prefix::GetOnes() [member function] cls.add_method('GetOnes', 'ns3::Ipv6Prefix', [], is_static=True) ## ipv6-address.h (module 'network'): uint8_t ns3::Ipv6Prefix::GetPrefixLength() const [member function] cls.add_method('GetPrefixLength', 'uint8_t', [], is_const=True) ## ipv6-address.h (module 'network'): static ns3::Ipv6Prefix ns3::Ipv6Prefix::GetZero() [member function] cls.add_method('GetZero', 'ns3::Ipv6Prefix', [], is_static=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Prefix::IsEqual(ns3::Ipv6Prefix const & other) const [member function] cls.add_method('IsEqual', 'bool', [param('ns3::Ipv6Prefix const &', 'other')], is_const=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6Prefix::IsMatch(ns3::Ipv6Address a, ns3::Ipv6Address b) const [member function] cls.add_method('IsMatch', 'bool', [param('ns3::Ipv6Address', 'a'), param('ns3::Ipv6Address', 'b')], is_const=True) ## ipv6-address.h (module 'network'): void ns3::Ipv6Prefix::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True) return def register_Ns3Mac48Address_methods(root_module, cls): cls.add_binary_comparison_operator('<') cls.add_binary_comparison_operator('!=') cls.add_output_stream_operator() cls.add_binary_comparison_operator('==') ## mac48-address.h (module 'network'): ns3::Mac48Address::Mac48Address(ns3::Mac48Address const & arg0) [copy constructor] cls.add_constructor([param('ns3::Mac48Address const &', 'arg0')]) ## mac48-address.h (module 'network'): ns3::Mac48Address::Mac48Address() [constructor] cls.add_constructor([]) ## mac48-address.h (module 'network'): ns3::Mac48Address::Mac48Address(char const * str) [constructor] cls.add_constructor([param('char const *', 'str')]) ## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::Allocate() [member function] cls.add_method('Allocate', 'ns3::Mac48Address', [], is_static=True) ## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::ConvertFrom(ns3::Address const & address) [member function] cls.add_method('ConvertFrom', 'ns3::Mac48Address', [param('ns3::Address const &', 'address')], is_static=True) ## mac48-address.h (module 'network'): void ns3::Mac48Address::CopyFrom(uint8_t const * buffer) [member function] cls.add_method('CopyFrom', 'void', [param('uint8_t const *', 'buffer')]) ## mac48-address.h (module 'network'): void ns3::Mac48Address::CopyTo(uint8_t * buffer) const [member function] cls.add_method('CopyTo', 'void', [param('uint8_t *', 'buffer')], is_const=True) ## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetBroadcast() [member function] cls.add_method('GetBroadcast', 'ns3::Mac48Address', [], is_static=True) ## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetMulticast(ns3::Ipv4Address address) [member function] cls.add_method('GetMulticast', 'ns3::Mac48Address', [param('ns3::Ipv4Address', 'address')], is_static=True) ## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetMulticast(ns3::Ipv6Address address) [member function] cls.add_method('GetMulticast', 'ns3::Mac48Address', [param('ns3::Ipv6Address', 'address')], is_static=True) ## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetMulticast6Prefix() [member function] cls.add_method('GetMulticast6Prefix', 'ns3::Mac48Address', [], is_static=True) ## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetMulticastPrefix() [member function] cls.add_method('GetMulticastPrefix', 'ns3::Mac48Address', [], is_static=True) ## mac48-address.h (module 'network'): bool ns3::Mac48Address::IsBroadcast() const [member function] cls.add_method('IsBroadcast', 'bool', [], is_const=True) ## mac48-address.h (module 'network'): bool ns3::Mac48Address::IsGroup() const [member function] cls.add_method('IsGroup', 'bool', [], is_const=True) ## mac48-address.h (module 'network'): static bool ns3::Mac48Address::IsMatchingType(ns3::Address const & address) [member function] cls.add_method('IsMatchingType', 'bool', [param('ns3::Address const &', 'address')], is_static=True) return def register_Ns3Mac64Address_methods(root_module, cls): cls.add_binary_comparison_operator('!=') cls.add_output_stream_operator() cls.add_binary_comparison_operator('==') ## mac64-address.h (module 'network'): ns3::Mac64Address::Mac64Address(ns3::Mac64Address const & arg0) [copy constructor] cls.add_constructor([param('ns3::Mac64Address const &', 'arg0')]) ## mac64-address.h (module 'network'): ns3::Mac64Address::Mac64Address() [constructor] cls.add_constructor([]) ## mac64-address.h (module 'network'): ns3::Mac64Address::Mac64Address(char const * str) [constructor] cls.add_constructor([param('char const *', 'str')]) ## mac64-address.h (module 'network'): static ns3::Mac64Address ns3::Mac64Address::Allocate() [member function] cls.add_method('Allocate', 'ns3::Mac64Address', [], is_static=True) ## mac64-address.h (module 'network'): static ns3::Mac64Address ns3::Mac64Address::ConvertFrom(ns3::Address const & address) [member function] cls.add_method('ConvertFrom', 'ns3::Mac64Address', [param('ns3::Address const &', 'address')], is_static=True) ## mac64-address.h (module 'network'): void ns3::Mac64Address::CopyFrom(uint8_t const * buffer) [member function] cls.add_method('CopyFrom', 'void', [param('uint8_t const *', 'buffer')]) ## mac64-address.h (module 'network'): void ns3::Mac64Address::CopyTo(uint8_t * buffer) const [member function] cls.add_method('CopyTo', 'void', [param('uint8_t *', 'buffer')], is_const=True) ## mac64-address.h (module 'network'): static bool ns3::Mac64Address::IsMatchingType(ns3::Address const & address) [member function] cls.add_method('IsMatchingType', 'bool', [param('ns3::Address const &', 'address')], is_static=True) return def register_Ns3NetDeviceContainer_methods(root_module, cls): ## net-device-container.h (module 'network'): ns3::NetDeviceContainer::NetDeviceContainer(ns3::NetDeviceContainer const & arg0) [copy constructor] cls.add_constructor([param('ns3::NetDeviceContainer const &', 'arg0')]) ## net-device-container.h (module 'network'): ns3::NetDeviceContainer::NetDeviceContainer() [constructor] cls.add_constructor([]) ## net-device-container.h (module 'network'): ns3::NetDeviceContainer::NetDeviceContainer(ns3::Ptr<ns3::NetDevice> dev) [constructor] cls.add_constructor([param('ns3::Ptr< ns3::NetDevice >', 'dev')]) ## net-device-container.h (module 'network'): ns3::NetDeviceContainer::NetDeviceContainer(std::string devName) [constructor] cls.add_constructor([param('std::string', 'devName')]) ## net-device-container.h (module 'network'): ns3::NetDeviceContainer::NetDeviceContainer(ns3::NetDeviceContainer const & a, ns3::NetDeviceContainer const & b) [constructor] cls.add_constructor([param('ns3::NetDeviceContainer const &', 'a'), param('ns3::NetDeviceContainer const &', 'b')]) ## net-device-container.h (module 'network'): void ns3::NetDeviceContainer::Add(ns3::NetDeviceContainer other) [member function] cls.add_method('Add', 'void', [param('ns3::NetDeviceContainer', 'other')]) ## net-device-container.h (module 'network'): void ns3::NetDeviceContainer::Add(ns3::Ptr<ns3::NetDevice> device) [member function] cls.add_method('Add', 'void', [param('ns3::Ptr< ns3::NetDevice >', 'device')]) ## net-device-container.h (module 'network'): void ns3::NetDeviceContainer::Add(std::string deviceName) [member function] cls.add_method('Add', 'void', [param('std::string', 'deviceName')]) ## net-device-container.h (module 'network'): __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::NetDevice>*,std::vector<ns3::Ptr<ns3::NetDevice>, std::allocator<ns3::Ptr<ns3::NetDevice> > > > ns3::NetDeviceContainer::Begin() const [member function] cls.add_method('Begin', '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::NetDevice > const, std::vector< ns3::Ptr< ns3::NetDevice > > >', [], is_const=True) ## net-device-container.h (module 'network'): __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::NetDevice>*,std::vector<ns3::Ptr<ns3::NetDevice>, std::allocator<ns3::Ptr<ns3::NetDevice> > > > ns3::NetDeviceContainer::End() const [member function] cls.add_method('End', '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::NetDevice > const, std::vector< ns3::Ptr< ns3::NetDevice > > >', [], is_const=True) ## net-device-container.h (module 'network'): ns3::Ptr<ns3::NetDevice> ns3::NetDeviceContainer::Get(uint32_t i) const [member function] cls.add_method('Get', 'ns3::Ptr< ns3::NetDevice >', [param('uint32_t', 'i')], is_const=True) ## net-device-container.h (module 'network'): uint32_t ns3::NetDeviceContainer::GetN() const [member function] cls.add_method('GetN', 'uint32_t', [], is_const=True) return def register_Ns3NodeContainer_methods(root_module, cls): ## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & arg0) [copy constructor] cls.add_constructor([param('ns3::NodeContainer const &', 'arg0')]) ## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer() [constructor] cls.add_constructor([]) ## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::Ptr<ns3::Node> node) [constructor] cls.add_constructor([param('ns3::Ptr< ns3::Node >', 'node')]) ## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(std::string nodeName) [constructor] cls.add_constructor([param('std::string', 'nodeName')]) ## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b) [constructor] cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b')]) ## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b, ns3::NodeContainer const & c) [constructor] cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b'), param('ns3::NodeContainer const &', 'c')]) ## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b, ns3::NodeContainer const & c, ns3::NodeContainer const & d) [constructor] cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b'), param('ns3::NodeContainer const &', 'c'), param('ns3::NodeContainer const &', 'd')]) ## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b, ns3::NodeContainer const & c, ns3::NodeContainer const & d, ns3::NodeContainer const & e) [constructor] cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b'), param('ns3::NodeContainer const &', 'c'), param('ns3::NodeContainer const &', 'd'), param('ns3::NodeContainer const &', 'e')]) ## node-container.h (module 'network'): void ns3::NodeContainer::Add(ns3::NodeContainer other) [member function] cls.add_method('Add', 'void', [param('ns3::NodeContainer', 'other')]) ## node-container.h (module 'network'): void ns3::NodeContainer::Add(ns3::Ptr<ns3::Node> node) [member function] cls.add_method('Add', 'void', [param('ns3::Ptr< ns3::Node >', 'node')]) ## node-container.h (module 'network'): void ns3::NodeContainer::Add(std::string nodeName) [member function] cls.add_method('Add', 'void', [param('std::string', 'nodeName')]) ## node-container.h (module 'network'): __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeContainer::Begin() const [member function] cls.add_method('Begin', '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node > const, std::vector< ns3::Ptr< ns3::Node > > >', [], is_const=True) ## node-container.h (module 'network'): void ns3::NodeContainer::Create(uint32_t n) [member function] cls.add_method('Create', 'void', [param('uint32_t', 'n')]) ## node-container.h (module 'network'): void ns3::NodeContainer::Create(uint32_t n, uint32_t systemId) [member function] cls.add_method('Create', 'void', [param('uint32_t', 'n'), param('uint32_t', 'systemId')]) ## node-container.h (module 'network'): __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeContainer::End() const [member function] cls.add_method('End', '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node > const, std::vector< ns3::Ptr< ns3::Node > > >', [], is_const=True) ## node-container.h (module 'network'): ns3::Ptr<ns3::Node> ns3::NodeContainer::Get(uint32_t i) const [member function] cls.add_method('Get', 'ns3::Ptr< ns3::Node >', [param('uint32_t', 'i')], is_const=True) ## node-container.h (module 'network'): static ns3::NodeContainer ns3::NodeContainer::GetGlobal() [member function] cls.add_method('GetGlobal', 'ns3::NodeContainer', [], is_static=True) ## node-container.h (module 'network'): uint32_t ns3::NodeContainer::GetN() const [member function] cls.add_method('GetN', 'uint32_t', [], is_const=True) return def register_Ns3NodeList_methods(root_module, cls): ## node-list.h (module 'network'): ns3::NodeList::NodeList() [constructor] cls.add_constructor([]) ## node-list.h (module 'network'): ns3::NodeList::NodeList(ns3::NodeList const & arg0) [copy constructor] cls.add_constructor([param('ns3::NodeList const &', 'arg0')]) ## node-list.h (module 'network'): static uint32_t ns3::NodeList::Add(ns3::Ptr<ns3::Node> node) [member function] cls.add_method('Add', 'uint32_t', [param('ns3::Ptr< ns3::Node >', 'node')], is_static=True) ## node-list.h (module 'network'): static __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeList::Begin() [member function] cls.add_method('Begin', '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node > const, std::vector< ns3::Ptr< ns3::Node > > >', [], is_static=True) ## node-list.h (module 'network'): static __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeList::End() [member function] cls.add_method('End', '__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node > const, std::vector< ns3::Ptr< ns3::Node > > >', [], is_static=True) ## node-list.h (module 'network'): static uint32_t ns3::NodeList::GetNNodes() [member function] cls.add_method('GetNNodes', 'uint32_t', [], is_static=True) ## node-list.h (module 'network'): static ns3::Ptr<ns3::Node> ns3::NodeList::GetNode(uint32_t n) [member function] cls.add_method('GetNode', 'ns3::Ptr< ns3::Node >', [param('uint32_t', 'n')], is_static=True) return def register_Ns3ObjectBase_methods(root_module, cls): ## object-base.h (module 'core'): ns3::ObjectBase::ObjectBase() [constructor] cls.add_constructor([]) ## object-base.h (module 'core'): ns3::ObjectBase::ObjectBase(ns3::ObjectBase const & arg0) [copy constructor] cls.add_constructor([param('ns3::ObjectBase const &', 'arg0')]) ## object-base.h (module 'core'): void ns3::ObjectBase::GetAttribute(std::string name, ns3::AttributeValue & value) const [member function] cls.add_method('GetAttribute', 'void', [param('std::string', 'name'), param('ns3::AttributeValue &', 'value')], is_const=True) ## object-base.h (module 'core'): bool ns3::ObjectBase::GetAttributeFailSafe(std::string name, ns3::AttributeValue & attribute) const [member function] cls.add_method('GetAttributeFailSafe', 'bool', [param('std::string', 'name'), param('ns3::AttributeValue &', 'attribute')], is_const=True) ## object-base.h (module 'core'): ns3::TypeId ns3::ObjectBase::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## object-base.h (module 'core'): static ns3::TypeId ns3::ObjectBase::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## object-base.h (module 'core'): void ns3::ObjectBase::SetAttribute(std::string name, ns3::AttributeValue const & value) [member function] cls.add_method('SetAttribute', 'void', [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) ## object-base.h (module 'core'): bool ns3::ObjectBase::SetAttributeFailSafe(std::string name, ns3::AttributeValue const & value) [member function] cls.add_method('SetAttributeFailSafe', 'bool', [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) ## object-base.h (module 'core'): bool ns3::ObjectBase::TraceConnect(std::string name, std::string context, ns3::CallbackBase const & cb) [member function] cls.add_method('TraceConnect', 'bool', [param('std::string', 'name'), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')]) ## object-base.h (module 'core'): bool ns3::ObjectBase::TraceConnectWithoutContext(std::string name, ns3::CallbackBase const & cb) [member function] cls.add_method('TraceConnectWithoutContext', 'bool', [param('std::string', 'name'), param('ns3::CallbackBase const &', 'cb')]) ## object-base.h (module 'core'): bool ns3::ObjectBase::TraceDisconnect(std::string name, std::string context, ns3::CallbackBase const & cb) [member function] cls.add_method('TraceDisconnect', 'bool', [param('std::string', 'name'), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')]) ## object-base.h (module 'core'): bool ns3::ObjectBase::TraceDisconnectWithoutContext(std::string name, ns3::CallbackBase const & cb) [member function] cls.add_method('TraceDisconnectWithoutContext', 'bool', [param('std::string', 'name'), param('ns3::CallbackBase const &', 'cb')]) ## object-base.h (module 'core'): void ns3::ObjectBase::ConstructSelf(ns3::AttributeConstructionList const & attributes) [member function] cls.add_method('ConstructSelf', 'void', [param('ns3::AttributeConstructionList const &', 'attributes')], visibility='protected') ## object-base.h (module 'core'): void ns3::ObjectBase::NotifyConstructionCompleted() [member function] cls.add_method('NotifyConstructionCompleted', 'void', [], visibility='protected', is_virtual=True) return def register_Ns3ObjectDeleter_methods(root_module, cls): ## object.h (module 'core'): ns3::ObjectDeleter::ObjectDeleter() [constructor] cls.add_constructor([]) ## object.h (module 'core'): ns3::ObjectDeleter::ObjectDeleter(ns3::ObjectDeleter const & arg0) [copy constructor] cls.add_constructor([param('ns3::ObjectDeleter const &', 'arg0')]) ## object.h (module 'core'): static void ns3::ObjectDeleter::Delete(ns3::Object * object) [member function] cls.add_method('Delete', 'void', [param('ns3::Object *', 'object')], is_static=True) return def register_Ns3ObjectFactory_methods(root_module, cls): cls.add_output_stream_operator() ## object-factory.h (module 'core'): ns3::ObjectFactory::ObjectFactory(ns3::ObjectFactory const & arg0) [copy constructor] cls.add_constructor([param('ns3::ObjectFactory const &', 'arg0')]) ## object-factory.h (module 'core'): ns3::ObjectFactory::ObjectFactory() [constructor] cls.add_constructor([]) ## object-factory.h (module 'core'): ns3::ObjectFactory::ObjectFactory(std::string typeId) [constructor] cls.add_constructor([param('std::string', 'typeId')]) ## object-factory.h (module 'core'): ns3::Ptr<ns3::Object> ns3::ObjectFactory::Create() const [member function] cls.add_method('Create', 'ns3::Ptr< ns3::Object >', [], is_const=True) ## object-factory.h (module 'core'): ns3::TypeId ns3::ObjectFactory::GetTypeId() const [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_const=True) ## object-factory.h (module 'core'): void ns3::ObjectFactory::Set(std::string name, ns3::AttributeValue const & value) [member function] cls.add_method('Set', 'void', [param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')]) ## object-factory.h (module 'core'): void ns3::ObjectFactory::SetTypeId(ns3::TypeId tid) [member function] cls.add_method('SetTypeId', 'void', [param('ns3::TypeId', 'tid')]) ## object-factory.h (module 'core'): void ns3::ObjectFactory::SetTypeId(char const * tid) [member function] cls.add_method('SetTypeId', 'void', [param('char const *', 'tid')]) ## object-factory.h (module 'core'): void ns3::ObjectFactory::SetTypeId(std::string tid) [member function] cls.add_method('SetTypeId', 'void', [param('std::string', 'tid')]) return def register_Ns3PacketMetadata_methods(root_module, cls): ## packet-metadata.h (module 'network'): ns3::PacketMetadata::PacketMetadata(uint64_t uid, uint32_t size) [constructor] cls.add_constructor([param('uint64_t', 'uid'), param('uint32_t', 'size')]) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::PacketMetadata(ns3::PacketMetadata const & o) [copy constructor] cls.add_constructor([param('ns3::PacketMetadata const &', 'o')]) ## packet-metadata.h (module 'network'): void ns3::PacketMetadata::AddAtEnd(ns3::PacketMetadata const & o) [member function] cls.add_method('AddAtEnd', 'void', [param('ns3::PacketMetadata const &', 'o')]) ## packet-metadata.h (module 'network'): void ns3::PacketMetadata::AddHeader(ns3::Header const & header, uint32_t size) [member function] cls.add_method('AddHeader', 'void', [param('ns3::Header const &', 'header'), param('uint32_t', 'size')]) ## packet-metadata.h (module 'network'): void ns3::PacketMetadata::AddPaddingAtEnd(uint32_t end) [member function] cls.add_method('AddPaddingAtEnd', 'void', [param('uint32_t', 'end')]) ## packet-metadata.h (module 'network'): void ns3::PacketMetadata::AddTrailer(ns3::Trailer const & trailer, uint32_t size) [member function] cls.add_method('AddTrailer', 'void', [param('ns3::Trailer const &', 'trailer'), param('uint32_t', 'size')]) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::ItemIterator ns3::PacketMetadata::BeginItem(ns3::Buffer buffer) const [member function] cls.add_method('BeginItem', 'ns3::PacketMetadata::ItemIterator', [param('ns3::Buffer', 'buffer')], is_const=True) ## packet-metadata.h (module 'network'): ns3::PacketMetadata ns3::PacketMetadata::CreateFragment(uint32_t start, uint32_t end) const [member function] cls.add_method('CreateFragment', 'ns3::PacketMetadata', [param('uint32_t', 'start'), param('uint32_t', 'end')], is_const=True) ## packet-metadata.h (module 'network'): uint32_t ns3::PacketMetadata::Deserialize(uint8_t const * buffer, uint32_t size) [member function] cls.add_method('Deserialize', 'uint32_t', [param('uint8_t const *', 'buffer'), param('uint32_t', 'size')]) ## packet-metadata.h (module 'network'): static void ns3::PacketMetadata::Enable() [member function] cls.add_method('Enable', 'void', [], is_static=True) ## packet-metadata.h (module 'network'): static void ns3::PacketMetadata::EnableChecking() [member function] cls.add_method('EnableChecking', 'void', [], is_static=True) ## packet-metadata.h (module 'network'): uint32_t ns3::PacketMetadata::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True) ## packet-metadata.h (module 'network'): uint64_t ns3::PacketMetadata::GetUid() const [member function] cls.add_method('GetUid', 'uint64_t', [], is_const=True) ## packet-metadata.h (module 'network'): void ns3::PacketMetadata::RemoveAtEnd(uint32_t end) [member function] cls.add_method('RemoveAtEnd', 'void', [param('uint32_t', 'end')]) ## packet-metadata.h (module 'network'): void ns3::PacketMetadata::RemoveAtStart(uint32_t start) [member function] cls.add_method('RemoveAtStart', 'void', [param('uint32_t', 'start')]) ## packet-metadata.h (module 'network'): void ns3::PacketMetadata::RemoveHeader(ns3::Header const & header, uint32_t size) [member function] cls.add_method('RemoveHeader', 'void', [param('ns3::Header const &', 'header'), param('uint32_t', 'size')]) ## packet-metadata.h (module 'network'): void ns3::PacketMetadata::RemoveTrailer(ns3::Trailer const & trailer, uint32_t size) [member function] cls.add_method('RemoveTrailer', 'void', [param('ns3::Trailer const &', 'trailer'), param('uint32_t', 'size')]) ## packet-metadata.h (module 'network'): uint32_t ns3::PacketMetadata::Serialize(uint8_t * buffer, uint32_t maxSize) const [member function] cls.add_method('Serialize', 'uint32_t', [param('uint8_t *', 'buffer'), param('uint32_t', 'maxSize')], is_const=True) return def register_Ns3PacketMetadataItem_methods(root_module, cls): ## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::Item() [constructor] cls.add_constructor([]) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::Item(ns3::PacketMetadata::Item const & arg0) [copy constructor] cls.add_constructor([param('ns3::PacketMetadata::Item const &', 'arg0')]) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::current [variable] cls.add_instance_attribute('current', 'ns3::Buffer::Iterator', is_const=False) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::currentSize [variable] cls.add_instance_attribute('currentSize', 'uint32_t', is_const=False) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::currentTrimedFromEnd [variable] cls.add_instance_attribute('currentTrimedFromEnd', 'uint32_t', is_const=False) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::currentTrimedFromStart [variable] cls.add_instance_attribute('currentTrimedFromStart', 'uint32_t', is_const=False) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::isFragment [variable] cls.add_instance_attribute('isFragment', 'bool', is_const=False) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::tid [variable] cls.add_instance_attribute('tid', 'ns3::TypeId', is_const=False) return def register_Ns3PacketMetadataItemIterator_methods(root_module, cls): ## packet-metadata.h (module 'network'): ns3::PacketMetadata::ItemIterator::ItemIterator(ns3::PacketMetadata::ItemIterator const & arg0) [copy constructor] cls.add_constructor([param('ns3::PacketMetadata::ItemIterator const &', 'arg0')]) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::ItemIterator::ItemIterator(ns3::PacketMetadata const * metadata, ns3::Buffer buffer) [constructor] cls.add_constructor([param('ns3::PacketMetadata const *', 'metadata'), param('ns3::Buffer', 'buffer')]) ## packet-metadata.h (module 'network'): bool ns3::PacketMetadata::ItemIterator::HasNext() const [member function] cls.add_method('HasNext', 'bool', [], is_const=True) ## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item ns3::PacketMetadata::ItemIterator::Next() [member function] cls.add_method('Next', 'ns3::PacketMetadata::Item', []) return def register_Ns3PacketSocketAddress_methods(root_module, cls): ## packet-socket-address.h (module 'network'): ns3::PacketSocketAddress::PacketSocketAddress(ns3::PacketSocketAddress const & arg0) [copy constructor] cls.add_constructor([param('ns3::PacketSocketAddress const &', 'arg0')]) ## packet-socket-address.h (module 'network'): ns3::PacketSocketAddress::PacketSocketAddress() [constructor] cls.add_constructor([]) ## packet-socket-address.h (module 'network'): static ns3::PacketSocketAddress ns3::PacketSocketAddress::ConvertFrom(ns3::Address const & address) [member function] cls.add_method('ConvertFrom', 'ns3::PacketSocketAddress', [param('ns3::Address const &', 'address')], is_static=True) ## packet-socket-address.h (module 'network'): ns3::Address ns3::PacketSocketAddress::GetPhysicalAddress() const [member function] cls.add_method('GetPhysicalAddress', 'ns3::Address', [], is_const=True) ## packet-socket-address.h (module 'network'): uint16_t ns3::PacketSocketAddress::GetProtocol() const [member function] cls.add_method('GetProtocol', 'uint16_t', [], is_const=True) ## packet-socket-address.h (module 'network'): uint32_t ns3::PacketSocketAddress::GetSingleDevice() const [member function] cls.add_method('GetSingleDevice', 'uint32_t', [], is_const=True) ## packet-socket-address.h (module 'network'): static bool ns3::PacketSocketAddress::IsMatchingType(ns3::Address const & address) [member function] cls.add_method('IsMatchingType', 'bool', [param('ns3::Address const &', 'address')], is_static=True) ## packet-socket-address.h (module 'network'): bool ns3::PacketSocketAddress::IsSingleDevice() const [member function] cls.add_method('IsSingleDevice', 'bool', [], is_const=True) ## packet-socket-address.h (module 'network'): void ns3::PacketSocketAddress::SetAllDevices() [member function] cls.add_method('SetAllDevices', 'void', []) ## packet-socket-address.h (module 'network'): void ns3::PacketSocketAddress::SetPhysicalAddress(ns3::Address const address) [member function] cls.add_method('SetPhysicalAddress', 'void', [param('ns3::Address const', 'address')]) ## packet-socket-address.h (module 'network'): void ns3::PacketSocketAddress::SetProtocol(uint16_t protocol) [member function] cls.add_method('SetProtocol', 'void', [param('uint16_t', 'protocol')]) ## packet-socket-address.h (module 'network'): void ns3::PacketSocketAddress::SetSingleDevice(uint32_t device) [member function] cls.add_method('SetSingleDevice', 'void', [param('uint32_t', 'device')]) return def register_Ns3PacketSocketHelper_methods(root_module, cls): ## packet-socket-helper.h (module 'network'): ns3::PacketSocketHelper::PacketSocketHelper() [constructor] cls.add_constructor([]) ## packet-socket-helper.h (module 'network'): ns3::PacketSocketHelper::PacketSocketHelper(ns3::PacketSocketHelper const & arg0) [copy constructor] cls.add_constructor([param('ns3::PacketSocketHelper const &', 'arg0')]) ## packet-socket-helper.h (module 'network'): void ns3::PacketSocketHelper::Install(ns3::Ptr<ns3::Node> node) const [member function] cls.add_method('Install', 'void', [param('ns3::Ptr< ns3::Node >', 'node')], is_const=True) ## packet-socket-helper.h (module 'network'): void ns3::PacketSocketHelper::Install(std::string nodeName) const [member function] cls.add_method('Install', 'void', [param('std::string', 'nodeName')], is_const=True) ## packet-socket-helper.h (module 'network'): void ns3::PacketSocketHelper::Install(ns3::NodeContainer c) const [member function] cls.add_method('Install', 'void', [param('ns3::NodeContainer', 'c')], is_const=True) return def register_Ns3PacketTagIterator_methods(root_module, cls): ## packet.h (module 'network'): ns3::PacketTagIterator::PacketTagIterator(ns3::PacketTagIterator const & arg0) [copy constructor] cls.add_constructor([param('ns3::PacketTagIterator const &', 'arg0')]) ## packet.h (module 'network'): bool ns3::PacketTagIterator::HasNext() const [member function] cls.add_method('HasNext', 'bool', [], is_const=True) ## packet.h (module 'network'): ns3::PacketTagIterator::Item ns3::PacketTagIterator::Next() [member function] cls.add_method('Next', 'ns3::PacketTagIterator::Item', []) return def register_Ns3PacketTagIteratorItem_methods(root_module, cls): ## packet.h (module 'network'): ns3::PacketTagIterator::Item::Item(ns3::PacketTagIterator::Item const & arg0) [copy constructor] cls.add_constructor([param('ns3::PacketTagIterator::Item const &', 'arg0')]) ## packet.h (module 'network'): void ns3::PacketTagIterator::Item::GetTag(ns3::Tag & tag) const [member function] cls.add_method('GetTag', 'void', [param('ns3::Tag &', 'tag')], is_const=True) ## packet.h (module 'network'): ns3::TypeId ns3::PacketTagIterator::Item::GetTypeId() const [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_const=True) return def register_Ns3PacketTagList_methods(root_module, cls): ## packet-tag-list.h (module 'network'): ns3::PacketTagList::PacketTagList() [constructor] cls.add_constructor([]) ## packet-tag-list.h (module 'network'): ns3::PacketTagList::PacketTagList(ns3::PacketTagList const & o) [copy constructor] cls.add_constructor([param('ns3::PacketTagList const &', 'o')]) ## packet-tag-list.h (module 'network'): void ns3::PacketTagList::Add(ns3::Tag const & tag) const [member function] cls.add_method('Add', 'void', [param('ns3::Tag const &', 'tag')], is_const=True) ## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData const * ns3::PacketTagList::Head() const [member function] cls.add_method('Head', 'ns3::PacketTagList::TagData const *', [], is_const=True) ## packet-tag-list.h (module 'network'): bool ns3::PacketTagList::Peek(ns3::Tag & tag) const [member function] cls.add_method('Peek', 'bool', [param('ns3::Tag &', 'tag')], is_const=True) ## packet-tag-list.h (module 'network'): bool ns3::PacketTagList::Remove(ns3::Tag & tag) [member function] cls.add_method('Remove', 'bool', [param('ns3::Tag &', 'tag')]) ## packet-tag-list.h (module 'network'): void ns3::PacketTagList::RemoveAll() [member function] cls.add_method('RemoveAll', 'void', []) return def register_Ns3PacketTagListTagData_methods(root_module, cls): ## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::TagData() [constructor] cls.add_constructor([]) ## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::TagData(ns3::PacketTagList::TagData const & arg0) [copy constructor] cls.add_constructor([param('ns3::PacketTagList::TagData const &', 'arg0')]) ## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::count [variable] cls.add_instance_attribute('count', 'uint32_t', is_const=False) ## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::data [variable] cls.add_instance_attribute('data', 'uint8_t [ 20 ]', is_const=False) ## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::next [variable] cls.add_instance_attribute('next', 'ns3::PacketTagList::TagData *', is_const=False) ## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::tid [variable] cls.add_instance_attribute('tid', 'ns3::TypeId', is_const=False) return def register_Ns3PbbAddressTlvBlock_methods(root_module, cls): cls.add_binary_comparison_operator('==') cls.add_binary_comparison_operator('!=') ## packetbb.h (module 'network'): ns3::PbbAddressTlvBlock::PbbAddressTlvBlock(ns3::PbbAddressTlvBlock const & arg0) [copy constructor] cls.add_constructor([param('ns3::PbbAddressTlvBlock const &', 'arg0')]) ## packetbb.h (module 'network'): ns3::PbbAddressTlvBlock::PbbAddressTlvBlock() [constructor] cls.add_constructor([]) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressTlv> ns3::PbbAddressTlvBlock::Back() const [member function] cls.add_method('Back', 'ns3::Ptr< ns3::PbbAddressTlv >', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbAddressTlv> > ns3::PbbAddressTlvBlock::Begin() [member function] cls.add_method('Begin', 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', []) ## packetbb.h (module 'network'): std::_List_const_iterator<ns3::Ptr<ns3::PbbAddressTlv> > ns3::PbbAddressTlvBlock::Begin() const [member function] cls.add_method('Begin', 'std::_List_const_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', [], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbAddressTlvBlock::Clear() [member function] cls.add_method('Clear', 'void', []) ## packetbb.h (module 'network'): void ns3::PbbAddressTlvBlock::Deserialize(ns3::Buffer::Iterator & start) [member function] cls.add_method('Deserialize', 'void', [param('ns3::Buffer::Iterator &', 'start')]) ## packetbb.h (module 'network'): bool ns3::PbbAddressTlvBlock::Empty() const [member function] cls.add_method('Empty', 'bool', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbAddressTlv> > ns3::PbbAddressTlvBlock::End() [member function] cls.add_method('End', 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', []) ## packetbb.h (module 'network'): std::_List_const_iterator<ns3::Ptr<ns3::PbbAddressTlv> > ns3::PbbAddressTlvBlock::End() const [member function] cls.add_method('End', 'std::_List_const_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbAddressTlv> > ns3::PbbAddressTlvBlock::Erase(std::_List_iterator<ns3::Ptr<ns3::PbbAddressTlv> > position) [member function] cls.add_method('Erase', 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'position')]) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbAddressTlv> > ns3::PbbAddressTlvBlock::Erase(std::_List_iterator<ns3::Ptr<ns3::PbbAddressTlv> > first, std::_List_iterator<ns3::Ptr<ns3::PbbAddressTlv> > last) [member function] cls.add_method('Erase', 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'first'), param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'last')]) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressTlv> ns3::PbbAddressTlvBlock::Front() const [member function] cls.add_method('Front', 'ns3::Ptr< ns3::PbbAddressTlv >', [], is_const=True) ## packetbb.h (module 'network'): uint32_t ns3::PbbAddressTlvBlock::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbAddressTlv> > ns3::PbbAddressTlvBlock::Insert(std::_List_iterator<ns3::Ptr<ns3::PbbAddressTlv> > position, ns3::Ptr<ns3::PbbAddressTlv> const tlv) [member function] cls.add_method('Insert', 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'position'), param('ns3::Ptr< ns3::PbbAddressTlv > const', 'tlv')]) ## packetbb.h (module 'network'): void ns3::PbbAddressTlvBlock::PopBack() [member function] cls.add_method('PopBack', 'void', []) ## packetbb.h (module 'network'): void ns3::PbbAddressTlvBlock::PopFront() [member function] cls.add_method('PopFront', 'void', []) ## packetbb.h (module 'network'): void ns3::PbbAddressTlvBlock::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbAddressTlvBlock::Print(std::ostream & os, int level) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os'), param('int', 'level')], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbAddressTlvBlock::PushBack(ns3::Ptr<ns3::PbbAddressTlv> tlv) [member function] cls.add_method('PushBack', 'void', [param('ns3::Ptr< ns3::PbbAddressTlv >', 'tlv')]) ## packetbb.h (module 'network'): void ns3::PbbAddressTlvBlock::PushFront(ns3::Ptr<ns3::PbbAddressTlv> tlv) [member function] cls.add_method('PushFront', 'void', [param('ns3::Ptr< ns3::PbbAddressTlv >', 'tlv')]) ## packetbb.h (module 'network'): void ns3::PbbAddressTlvBlock::Serialize(ns3::Buffer::Iterator & start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator &', 'start')], is_const=True) ## packetbb.h (module 'network'): int ns3::PbbAddressTlvBlock::Size() const [member function] cls.add_method('Size', 'int', [], is_const=True) return def register_Ns3PbbTlvBlock_methods(root_module, cls): cls.add_binary_comparison_operator('==') cls.add_binary_comparison_operator('!=') ## packetbb.h (module 'network'): ns3::PbbTlvBlock::PbbTlvBlock(ns3::PbbTlvBlock const & arg0) [copy constructor] cls.add_constructor([param('ns3::PbbTlvBlock const &', 'arg0')]) ## packetbb.h (module 'network'): ns3::PbbTlvBlock::PbbTlvBlock() [constructor] cls.add_constructor([]) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbTlv> ns3::PbbTlvBlock::Back() const [member function] cls.add_method('Back', 'ns3::Ptr< ns3::PbbTlv >', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbTlv> > ns3::PbbTlvBlock::Begin() [member function] cls.add_method('Begin', 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', []) ## packetbb.h (module 'network'): std::_List_const_iterator<ns3::Ptr<ns3::PbbTlv> > ns3::PbbTlvBlock::Begin() const [member function] cls.add_method('Begin', 'std::_List_const_iterator< ns3::Ptr< ns3::PbbTlv > >', [], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbTlvBlock::Clear() [member function] cls.add_method('Clear', 'void', []) ## packetbb.h (module 'network'): void ns3::PbbTlvBlock::Deserialize(ns3::Buffer::Iterator & start) [member function] cls.add_method('Deserialize', 'void', [param('ns3::Buffer::Iterator &', 'start')]) ## packetbb.h (module 'network'): bool ns3::PbbTlvBlock::Empty() const [member function] cls.add_method('Empty', 'bool', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbTlv> > ns3::PbbTlvBlock::End() [member function] cls.add_method('End', 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', []) ## packetbb.h (module 'network'): std::_List_const_iterator<ns3::Ptr<ns3::PbbTlv> > ns3::PbbTlvBlock::End() const [member function] cls.add_method('End', 'std::_List_const_iterator< ns3::Ptr< ns3::PbbTlv > >', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbTlv> > ns3::PbbTlvBlock::Erase(std::_List_iterator<ns3::Ptr<ns3::PbbTlv> > position) [member function] cls.add_method('Erase', 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', [param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'position')]) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbTlv> > ns3::PbbTlvBlock::Erase(std::_List_iterator<ns3::Ptr<ns3::PbbTlv> > first, std::_List_iterator<ns3::Ptr<ns3::PbbTlv> > last) [member function] cls.add_method('Erase', 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', [param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'first'), param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'last')]) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbTlv> ns3::PbbTlvBlock::Front() const [member function] cls.add_method('Front', 'ns3::Ptr< ns3::PbbTlv >', [], is_const=True) ## packetbb.h (module 'network'): uint32_t ns3::PbbTlvBlock::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbTlv> > ns3::PbbTlvBlock::Insert(std::_List_iterator<ns3::Ptr<ns3::PbbTlv> > position, ns3::Ptr<ns3::PbbTlv> const tlv) [member function] cls.add_method('Insert', 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', [param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'position'), param('ns3::Ptr< ns3::PbbTlv > const', 'tlv')]) ## packetbb.h (module 'network'): void ns3::PbbTlvBlock::PopBack() [member function] cls.add_method('PopBack', 'void', []) ## packetbb.h (module 'network'): void ns3::PbbTlvBlock::PopFront() [member function] cls.add_method('PopFront', 'void', []) ## packetbb.h (module 'network'): void ns3::PbbTlvBlock::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbTlvBlock::Print(std::ostream & os, int level) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os'), param('int', 'level')], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbTlvBlock::PushBack(ns3::Ptr<ns3::PbbTlv> tlv) [member function] cls.add_method('PushBack', 'void', [param('ns3::Ptr< ns3::PbbTlv >', 'tlv')]) ## packetbb.h (module 'network'): void ns3::PbbTlvBlock::PushFront(ns3::Ptr<ns3::PbbTlv> tlv) [member function] cls.add_method('PushFront', 'void', [param('ns3::Ptr< ns3::PbbTlv >', 'tlv')]) ## packetbb.h (module 'network'): void ns3::PbbTlvBlock::Serialize(ns3::Buffer::Iterator & start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator &', 'start')], is_const=True) ## packetbb.h (module 'network'): int ns3::PbbTlvBlock::Size() const [member function] cls.add_method('Size', 'int', [], is_const=True) return def register_Ns3PcapFile_methods(root_module, cls): ## pcap-file.h (module 'network'): ns3::PcapFile::PcapFile() [constructor] cls.add_constructor([]) ## pcap-file.h (module 'network'): void ns3::PcapFile::Clear() [member function] cls.add_method('Clear', 'void', []) ## pcap-file.h (module 'network'): void ns3::PcapFile::Close() [member function] cls.add_method('Close', 'void', []) ## pcap-file.h (module 'network'): static bool ns3::PcapFile::Diff(std::string const & f1, std::string const & f2, uint32_t & sec, uint32_t & usec, uint32_t snapLen=ns3::PcapFile::SNAPLEN_DEFAULT) [member function] cls.add_method('Diff', 'bool', [param('std::string const &', 'f1'), param('std::string const &', 'f2'), param('uint32_t &', 'sec'), param('uint32_t &', 'usec'), param('uint32_t', 'snapLen', default_value='ns3::PcapFile::SNAPLEN_DEFAULT')], is_static=True) ## pcap-file.h (module 'network'): bool ns3::PcapFile::Eof() const [member function] cls.add_method('Eof', 'bool', [], is_const=True) ## pcap-file.h (module 'network'): bool ns3::PcapFile::Fail() const [member function] cls.add_method('Fail', 'bool', [], is_const=True) ## pcap-file.h (module 'network'): uint32_t ns3::PcapFile::GetDataLinkType() [member function] cls.add_method('GetDataLinkType', 'uint32_t', []) ## pcap-file.h (module 'network'): uint32_t ns3::PcapFile::GetMagic() [member function] cls.add_method('GetMagic', 'uint32_t', []) ## pcap-file.h (module 'network'): uint32_t ns3::PcapFile::GetSigFigs() [member function] cls.add_method('GetSigFigs', 'uint32_t', []) ## pcap-file.h (module 'network'): uint32_t ns3::PcapFile::GetSnapLen() [member function] cls.add_method('GetSnapLen', 'uint32_t', []) ## pcap-file.h (module 'network'): bool ns3::PcapFile::GetSwapMode() [member function] cls.add_method('GetSwapMode', 'bool', []) ## pcap-file.h (module 'network'): int32_t ns3::PcapFile::GetTimeZoneOffset() [member function] cls.add_method('GetTimeZoneOffset', 'int32_t', []) ## pcap-file.h (module 'network'): uint16_t ns3::PcapFile::GetVersionMajor() [member function] cls.add_method('GetVersionMajor', 'uint16_t', []) ## pcap-file.h (module 'network'): uint16_t ns3::PcapFile::GetVersionMinor() [member function] cls.add_method('GetVersionMinor', 'uint16_t', []) ## pcap-file.h (module 'network'): void ns3::PcapFile::Init(uint32_t dataLinkType, uint32_t snapLen=ns3::PcapFile::SNAPLEN_DEFAULT, int32_t timeZoneCorrection=ns3::PcapFile::ZONE_DEFAULT, bool swapMode=false) [member function] cls.add_method('Init', 'void', [param('uint32_t', 'dataLinkType'), param('uint32_t', 'snapLen', default_value='ns3::PcapFile::SNAPLEN_DEFAULT'), param('int32_t', 'timeZoneCorrection', default_value='ns3::PcapFile::ZONE_DEFAULT'), param('bool', 'swapMode', default_value='false')]) ## pcap-file.h (module 'network'): void ns3::PcapFile::Open(std::string const & filename, std::_Ios_Openmode mode) [member function] cls.add_method('Open', 'void', [param('std::string const &', 'filename'), param('std::_Ios_Openmode', 'mode')]) ## pcap-file.h (module 'network'): void ns3::PcapFile::Read(uint8_t * const data, uint32_t maxBytes, uint32_t & tsSec, uint32_t & tsUsec, uint32_t & inclLen, uint32_t & origLen, uint32_t & readLen) [member function] cls.add_method('Read', 'void', [param('uint8_t * const', 'data'), param('uint32_t', 'maxBytes'), param('uint32_t &', 'tsSec'), param('uint32_t &', 'tsUsec'), param('uint32_t &', 'inclLen'), param('uint32_t &', 'origLen'), param('uint32_t &', 'readLen')]) ## pcap-file.h (module 'network'): void ns3::PcapFile::Write(uint32_t tsSec, uint32_t tsUsec, uint8_t const * const data, uint32_t totalLen) [member function] cls.add_method('Write', 'void', [param('uint32_t', 'tsSec'), param('uint32_t', 'tsUsec'), param('uint8_t const * const', 'data'), param('uint32_t', 'totalLen')]) ## pcap-file.h (module 'network'): void ns3::PcapFile::Write(uint32_t tsSec, uint32_t tsUsec, ns3::Ptr<const ns3::Packet> p) [member function] cls.add_method('Write', 'void', [param('uint32_t', 'tsSec'), param('uint32_t', 'tsUsec'), param('ns3::Ptr< ns3::Packet const >', 'p')]) ## pcap-file.h (module 'network'): void ns3::PcapFile::Write(uint32_t tsSec, uint32_t tsUsec, ns3::Header & header, ns3::Ptr<const ns3::Packet> p) [member function] cls.add_method('Write', 'void', [param('uint32_t', 'tsSec'), param('uint32_t', 'tsUsec'), param('ns3::Header &', 'header'), param('ns3::Ptr< ns3::Packet const >', 'p')]) ## pcap-file.h (module 'network'): ns3::PcapFile::SNAPLEN_DEFAULT [variable] cls.add_static_attribute('SNAPLEN_DEFAULT', 'uint32_t const', is_const=True) ## pcap-file.h (module 'network'): ns3::PcapFile::ZONE_DEFAULT [variable] cls.add_static_attribute('ZONE_DEFAULT', 'int32_t const', is_const=True) return def register_Ns3PcapHelper_methods(root_module, cls): ## trace-helper.h (module 'network'): ns3::PcapHelper::PcapHelper(ns3::PcapHelper const & arg0) [copy constructor] cls.add_constructor([param('ns3::PcapHelper const &', 'arg0')]) ## trace-helper.h (module 'network'): ns3::PcapHelper::PcapHelper() [constructor] cls.add_constructor([]) ## trace-helper.h (module 'network'): ns3::Ptr<ns3::PcapFileWrapper> ns3::PcapHelper::CreateFile(std::string filename, std::_Ios_Openmode filemode, uint32_t dataLinkType, uint32_t snapLen=65535, int32_t tzCorrection=0) [member function] cls.add_method('CreateFile', 'ns3::Ptr< ns3::PcapFileWrapper >', [param('std::string', 'filename'), param('std::_Ios_Openmode', 'filemode'), param('uint32_t', 'dataLinkType'), param('uint32_t', 'snapLen', default_value='65535'), param('int32_t', 'tzCorrection', default_value='0')]) ## trace-helper.h (module 'network'): std::string ns3::PcapHelper::GetFilenameFromDevice(std::string prefix, ns3::Ptr<ns3::NetDevice> device, bool useObjectNames=true) [member function] cls.add_method('GetFilenameFromDevice', 'std::string', [param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'device'), param('bool', 'useObjectNames', default_value='true')]) ## trace-helper.h (module 'network'): std::string ns3::PcapHelper::GetFilenameFromInterfacePair(std::string prefix, ns3::Ptr<ns3::Object> object, uint32_t interface, bool useObjectNames=true) [member function] cls.add_method('GetFilenameFromInterfacePair', 'std::string', [param('std::string', 'prefix'), param('ns3::Ptr< ns3::Object >', 'object'), param('uint32_t', 'interface'), param('bool', 'useObjectNames', default_value='true')]) return def register_Ns3PcapHelperForDevice_methods(root_module, cls): ## trace-helper.h (module 'network'): ns3::PcapHelperForDevice::PcapHelperForDevice(ns3::PcapHelperForDevice const & arg0) [copy constructor] cls.add_constructor([param('ns3::PcapHelperForDevice const &', 'arg0')]) ## trace-helper.h (module 'network'): ns3::PcapHelperForDevice::PcapHelperForDevice() [constructor] cls.add_constructor([]) ## trace-helper.h (module 'network'): void ns3::PcapHelperForDevice::EnablePcap(std::string prefix, ns3::Ptr<ns3::NetDevice> nd, bool promiscuous=false, bool explicitFilename=false) [member function] cls.add_method('EnablePcap', 'void', [param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'promiscuous', default_value='false'), param('bool', 'explicitFilename', default_value='false')]) ## trace-helper.h (module 'network'): void ns3::PcapHelperForDevice::EnablePcap(std::string prefix, std::string ndName, bool promiscuous=false, bool explicitFilename=false) [member function] cls.add_method('EnablePcap', 'void', [param('std::string', 'prefix'), param('std::string', 'ndName'), param('bool', 'promiscuous', default_value='false'), param('bool', 'explicitFilename', default_value='false')]) ## trace-helper.h (module 'network'): void ns3::PcapHelperForDevice::EnablePcap(std::string prefix, ns3::NetDeviceContainer d, bool promiscuous=false) [member function] cls.add_method('EnablePcap', 'void', [param('std::string', 'prefix'), param('ns3::NetDeviceContainer', 'd'), param('bool', 'promiscuous', default_value='false')]) ## trace-helper.h (module 'network'): void ns3::PcapHelperForDevice::EnablePcap(std::string prefix, ns3::NodeContainer n, bool promiscuous=false) [member function] cls.add_method('EnablePcap', 'void', [param('std::string', 'prefix'), param('ns3::NodeContainer', 'n'), param('bool', 'promiscuous', default_value='false')]) ## trace-helper.h (module 'network'): void ns3::PcapHelperForDevice::EnablePcap(std::string prefix, uint32_t nodeid, uint32_t deviceid, bool promiscuous=false) [member function] cls.add_method('EnablePcap', 'void', [param('std::string', 'prefix'), param('uint32_t', 'nodeid'), param('uint32_t', 'deviceid'), param('bool', 'promiscuous', default_value='false')]) ## trace-helper.h (module 'network'): void ns3::PcapHelperForDevice::EnablePcapAll(std::string prefix, bool promiscuous=false) [member function] cls.add_method('EnablePcapAll', 'void', [param('std::string', 'prefix'), param('bool', 'promiscuous', default_value='false')]) ## trace-helper.h (module 'network'): void ns3::PcapHelperForDevice::EnablePcapInternal(std::string prefix, ns3::Ptr<ns3::NetDevice> nd, bool promiscuous, bool explicitFilename) [member function] cls.add_method('EnablePcapInternal', 'void', [param('std::string', 'prefix'), param('ns3::Ptr< ns3::NetDevice >', 'nd'), param('bool', 'promiscuous'), param('bool', 'explicitFilename')], is_pure_virtual=True, is_virtual=True) return def register_Ns3RandomVariable_methods(root_module, cls): cls.add_output_stream_operator() ## random-variable.h (module 'core'): ns3::RandomVariable::RandomVariable() [constructor] cls.add_constructor([]) ## random-variable.h (module 'core'): ns3::RandomVariable::RandomVariable(ns3::RandomVariable const & o) [copy constructor] cls.add_constructor([param('ns3::RandomVariable const &', 'o')]) ## random-variable.h (module 'core'): uint32_t ns3::RandomVariable::GetInteger() const [member function] cls.add_method('GetInteger', 'uint32_t', [], is_const=True) ## random-variable.h (module 'core'): double ns3::RandomVariable::GetValue() const [member function] cls.add_method('GetValue', 'double', [], is_const=True) return def register_Ns3RngSeedManager_methods(root_module, cls): ## rng-seed-manager.h (module 'core'): ns3::RngSeedManager::RngSeedManager() [constructor] cls.add_constructor([]) ## rng-seed-manager.h (module 'core'): ns3::RngSeedManager::RngSeedManager(ns3::RngSeedManager const & arg0) [copy constructor] cls.add_constructor([param('ns3::RngSeedManager const &', 'arg0')]) ## rng-seed-manager.h (module 'core'): static uint64_t ns3::RngSeedManager::GetNextStreamIndex() [member function] cls.add_method('GetNextStreamIndex', 'uint64_t', [], is_static=True) ## rng-seed-manager.h (module 'core'): static uint64_t ns3::RngSeedManager::GetRun() [member function] cls.add_method('GetRun', 'uint64_t', [], is_static=True) ## rng-seed-manager.h (module 'core'): static uint32_t ns3::RngSeedManager::GetSeed() [member function] cls.add_method('GetSeed', 'uint32_t', [], is_static=True) ## rng-seed-manager.h (module 'core'): static void ns3::RngSeedManager::SetRun(uint64_t run) [member function] cls.add_method('SetRun', 'void', [param('uint64_t', 'run')], is_static=True) ## rng-seed-manager.h (module 'core'): static void ns3::RngSeedManager::SetSeed(uint32_t seed) [member function] cls.add_method('SetSeed', 'void', [param('uint32_t', 'seed')], is_static=True) return def register_Ns3SequenceNumber32_methods(root_module, cls): cls.add_binary_comparison_operator('!=') cls.add_binary_numeric_operator('+', root_module['ns3::SequenceNumber32'], root_module['ns3::SequenceNumber32'], param('ns3::SequenceNumber< unsigned int, int > const &', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::SequenceNumber32'], root_module['ns3::SequenceNumber32'], param('int', 'right')) cls.add_inplace_numeric_operator('+=', param('int', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::SequenceNumber32'], root_module['ns3::SequenceNumber32'], param('int', 'right')) cls.add_inplace_numeric_operator('-=', param('int', 'right')) cls.add_binary_comparison_operator('<') cls.add_binary_comparison_operator('<=') cls.add_binary_comparison_operator('==') cls.add_binary_comparison_operator('>') cls.add_binary_comparison_operator('>=') ## sequence-number.h (module 'network'): ns3::SequenceNumber<unsigned int, int>::SequenceNumber() [constructor] cls.add_constructor([]) ## sequence-number.h (module 'network'): ns3::SequenceNumber<unsigned int, int>::SequenceNumber(unsigned int value) [constructor] cls.add_constructor([param('unsigned int', 'value')]) ## sequence-number.h (module 'network'): ns3::SequenceNumber<unsigned int, int>::SequenceNumber(ns3::SequenceNumber<unsigned int, int> const & value) [copy constructor] cls.add_constructor([param('ns3::SequenceNumber< unsigned int, int > const &', 'value')]) ## sequence-number.h (module 'network'): unsigned int ns3::SequenceNumber<unsigned int, int>::GetValue() const [member function] cls.add_method('GetValue', 'unsigned int', [], is_const=True) return def register_Ns3SequenceNumber16_methods(root_module, cls): cls.add_binary_comparison_operator('!=') cls.add_binary_numeric_operator('+', root_module['ns3::SequenceNumber16'], root_module['ns3::SequenceNumber16'], param('ns3::SequenceNumber< unsigned short, short > const &', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::SequenceNumber16'], root_module['ns3::SequenceNumber16'], param('short int', 'right')) cls.add_inplace_numeric_operator('+=', param('short int', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::SequenceNumber16'], root_module['ns3::SequenceNumber16'], param('short int', 'right')) cls.add_inplace_numeric_operator('-=', param('short int', 'right')) cls.add_binary_comparison_operator('<') cls.add_binary_comparison_operator('<=') cls.add_binary_comparison_operator('==') cls.add_binary_comparison_operator('>') cls.add_binary_comparison_operator('>=') ## sequence-number.h (module 'network'): ns3::SequenceNumber<unsigned short, short>::SequenceNumber() [constructor] cls.add_constructor([]) ## sequence-number.h (module 'network'): ns3::SequenceNumber<unsigned short, short>::SequenceNumber(short unsigned int value) [constructor] cls.add_constructor([param('short unsigned int', 'value')]) ## sequence-number.h (module 'network'): ns3::SequenceNumber<unsigned short, short>::SequenceNumber(ns3::SequenceNumber<unsigned short, short> const & value) [copy constructor] cls.add_constructor([param('ns3::SequenceNumber< unsigned short, short > const &', 'value')]) ## sequence-number.h (module 'network'): short unsigned int ns3::SequenceNumber<unsigned short, short>::GetValue() const [member function] cls.add_method('GetValue', 'short unsigned int', [], is_const=True) return def register_Ns3SequentialVariable_methods(root_module, cls): ## random-variable.h (module 'core'): ns3::SequentialVariable::SequentialVariable(ns3::SequentialVariable const & arg0) [copy constructor] cls.add_constructor([param('ns3::SequentialVariable const &', 'arg0')]) ## random-variable.h (module 'core'): ns3::SequentialVariable::SequentialVariable(double f, double l, double i=1, uint32_t c=1) [constructor] cls.add_constructor([param('double', 'f'), param('double', 'l'), param('double', 'i', default_value='1'), param('uint32_t', 'c', default_value='1')]) ## random-variable.h (module 'core'): ns3::SequentialVariable::SequentialVariable(double f, double l, ns3::RandomVariable const & i, uint32_t c=1) [constructor] cls.add_constructor([param('double', 'f'), param('double', 'l'), param('ns3::RandomVariable const &', 'i'), param('uint32_t', 'c', default_value='1')]) return def register_Ns3SimpleRefCount__Ns3Object_Ns3ObjectBase_Ns3ObjectDeleter_methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter>::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter>::SimpleRefCount(ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter> const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter>::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3Simulator_methods(root_module, cls): ## simulator.h (module 'core'): ns3::Simulator::Simulator(ns3::Simulator const & arg0) [copy constructor] cls.add_constructor([param('ns3::Simulator const &', 'arg0')]) ## simulator.h (module 'core'): static void ns3::Simulator::Cancel(ns3::EventId const & id) [member function] cls.add_method('Cancel', 'void', [param('ns3::EventId const &', 'id')], is_static=True) ## simulator.h (module 'core'): static void ns3::Simulator::Destroy() [member function] cls.add_method('Destroy', 'void', [], is_static=True) ## simulator.h (module 'core'): static uint32_t ns3::Simulator::GetContext() [member function] cls.add_method('GetContext', 'uint32_t', [], is_static=True) ## simulator.h (module 'core'): static ns3::Time ns3::Simulator::GetDelayLeft(ns3::EventId const & id) [member function] cls.add_method('GetDelayLeft', 'ns3::Time', [param('ns3::EventId const &', 'id')], is_static=True) ## simulator.h (module 'core'): static ns3::Ptr<ns3::SimulatorImpl> ns3::Simulator::GetImplementation() [member function] cls.add_method('GetImplementation', 'ns3::Ptr< ns3::SimulatorImpl >', [], is_static=True) ## simulator.h (module 'core'): static ns3::Time ns3::Simulator::GetMaximumSimulationTime() [member function] cls.add_method('GetMaximumSimulationTime', 'ns3::Time', [], is_static=True) ## simulator.h (module 'core'): static uint32_t ns3::Simulator::GetSystemId() [member function] cls.add_method('GetSystemId', 'uint32_t', [], is_static=True) ## simulator.h (module 'core'): static bool ns3::Simulator::IsExpired(ns3::EventId const & id) [member function] cls.add_method('IsExpired', 'bool', [param('ns3::EventId const &', 'id')], is_static=True) ## simulator.h (module 'core'): static bool ns3::Simulator::IsFinished() [member function] cls.add_method('IsFinished', 'bool', [], is_static=True) ## simulator.h (module 'core'): static ns3::Time ns3::Simulator::Now() [member function] cls.add_method('Now', 'ns3::Time', [], is_static=True) ## simulator.h (module 'core'): static void ns3::Simulator::Remove(ns3::EventId const & id) [member function] cls.add_method('Remove', 'void', [param('ns3::EventId const &', 'id')], is_static=True) ## simulator.h (module 'core'): static void ns3::Simulator::SetImplementation(ns3::Ptr<ns3::SimulatorImpl> impl) [member function] cls.add_method('SetImplementation', 'void', [param('ns3::Ptr< ns3::SimulatorImpl >', 'impl')], is_static=True) ## simulator.h (module 'core'): static void ns3::Simulator::SetScheduler(ns3::ObjectFactory schedulerFactory) [member function] cls.add_method('SetScheduler', 'void', [param('ns3::ObjectFactory', 'schedulerFactory')], is_static=True) ## simulator.h (module 'core'): static void ns3::Simulator::Stop() [member function] cls.add_method('Stop', 'void', [], is_static=True) ## simulator.h (module 'core'): static void ns3::Simulator::Stop(ns3::Time const & time) [member function] cls.add_method('Stop', 'void', [param('ns3::Time const &', 'time')], is_static=True) return def register_Ns3SystemWallClockMs_methods(root_module, cls): ## system-wall-clock-ms.h (module 'core'): ns3::SystemWallClockMs::SystemWallClockMs(ns3::SystemWallClockMs const & arg0) [copy constructor] cls.add_constructor([param('ns3::SystemWallClockMs const &', 'arg0')]) ## system-wall-clock-ms.h (module 'core'): ns3::SystemWallClockMs::SystemWallClockMs() [constructor] cls.add_constructor([]) ## system-wall-clock-ms.h (module 'core'): int64_t ns3::SystemWallClockMs::End() [member function] cls.add_method('End', 'int64_t', []) ## system-wall-clock-ms.h (module 'core'): int64_t ns3::SystemWallClockMs::GetElapsedReal() const [member function] cls.add_method('GetElapsedReal', 'int64_t', [], is_const=True) ## system-wall-clock-ms.h (module 'core'): int64_t ns3::SystemWallClockMs::GetElapsedSystem() const [member function] cls.add_method('GetElapsedSystem', 'int64_t', [], is_const=True) ## system-wall-clock-ms.h (module 'core'): int64_t ns3::SystemWallClockMs::GetElapsedUser() const [member function] cls.add_method('GetElapsedUser', 'int64_t', [], is_const=True) ## system-wall-clock-ms.h (module 'core'): void ns3::SystemWallClockMs::Start() [member function] cls.add_method('Start', 'void', []) return def register_Ns3Tag_methods(root_module, cls): ## tag.h (module 'network'): ns3::Tag::Tag() [constructor] cls.add_constructor([]) ## tag.h (module 'network'): ns3::Tag::Tag(ns3::Tag const & arg0) [copy constructor] cls.add_constructor([param('ns3::Tag const &', 'arg0')]) ## tag.h (module 'network'): void ns3::Tag::Deserialize(ns3::TagBuffer i) [member function] cls.add_method('Deserialize', 'void', [param('ns3::TagBuffer', 'i')], is_pure_virtual=True, is_virtual=True) ## tag.h (module 'network'): uint32_t ns3::Tag::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## tag.h (module 'network'): static ns3::TypeId ns3::Tag::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## tag.h (module 'network'): void ns3::Tag::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_pure_virtual=True, is_const=True, is_virtual=True) ## tag.h (module 'network'): void ns3::Tag::Serialize(ns3::TagBuffer i) const [member function] cls.add_method('Serialize', 'void', [param('ns3::TagBuffer', 'i')], is_pure_virtual=True, is_const=True, is_virtual=True) return def register_Ns3TagBuffer_methods(root_module, cls): ## tag-buffer.h (module 'network'): ns3::TagBuffer::TagBuffer(ns3::TagBuffer const & arg0) [copy constructor] cls.add_constructor([param('ns3::TagBuffer const &', 'arg0')]) ## tag-buffer.h (module 'network'): ns3::TagBuffer::TagBuffer(uint8_t * start, uint8_t * end) [constructor] cls.add_constructor([param('uint8_t *', 'start'), param('uint8_t *', 'end')]) ## tag-buffer.h (module 'network'): void ns3::TagBuffer::CopyFrom(ns3::TagBuffer o) [member function] cls.add_method('CopyFrom', 'void', [param('ns3::TagBuffer', 'o')]) ## tag-buffer.h (module 'network'): void ns3::TagBuffer::Read(uint8_t * buffer, uint32_t size) [member function] cls.add_method('Read', 'void', [param('uint8_t *', 'buffer'), param('uint32_t', 'size')]) ## tag-buffer.h (module 'network'): double ns3::TagBuffer::ReadDouble() [member function] cls.add_method('ReadDouble', 'double', []) ## tag-buffer.h (module 'network'): uint16_t ns3::TagBuffer::ReadU16() [member function] cls.add_method('ReadU16', 'uint16_t', []) ## tag-buffer.h (module 'network'): uint32_t ns3::TagBuffer::ReadU32() [member function] cls.add_method('ReadU32', 'uint32_t', []) ## tag-buffer.h (module 'network'): uint64_t ns3::TagBuffer::ReadU64() [member function] cls.add_method('ReadU64', 'uint64_t', []) ## tag-buffer.h (module 'network'): uint8_t ns3::TagBuffer::ReadU8() [member function] cls.add_method('ReadU8', 'uint8_t', []) ## tag-buffer.h (module 'network'): void ns3::TagBuffer::TrimAtEnd(uint32_t trim) [member function] cls.add_method('TrimAtEnd', 'void', [param('uint32_t', 'trim')]) ## tag-buffer.h (module 'network'): void ns3::TagBuffer::Write(uint8_t const * buffer, uint32_t size) [member function] cls.add_method('Write', 'void', [param('uint8_t const *', 'buffer'), param('uint32_t', 'size')]) ## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteDouble(double v) [member function] cls.add_method('WriteDouble', 'void', [param('double', 'v')]) ## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteU16(uint16_t data) [member function] cls.add_method('WriteU16', 'void', [param('uint16_t', 'data')]) ## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteU32(uint32_t data) [member function] cls.add_method('WriteU32', 'void', [param('uint32_t', 'data')]) ## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteU64(uint64_t v) [member function] cls.add_method('WriteU64', 'void', [param('uint64_t', 'v')]) ## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteU8(uint8_t v) [member function] cls.add_method('WriteU8', 'void', [param('uint8_t', 'v')]) return def register_Ns3TriangularVariable_methods(root_module, cls): ## random-variable.h (module 'core'): ns3::TriangularVariable::TriangularVariable(ns3::TriangularVariable const & arg0) [copy constructor] cls.add_constructor([param('ns3::TriangularVariable const &', 'arg0')]) ## random-variable.h (module 'core'): ns3::TriangularVariable::TriangularVariable() [constructor] cls.add_constructor([]) ## random-variable.h (module 'core'): ns3::TriangularVariable::TriangularVariable(double s, double l, double mean) [constructor] cls.add_constructor([param('double', 's'), param('double', 'l'), param('double', 'mean')]) return def register_Ns3TypeId_methods(root_module, cls): cls.add_binary_comparison_operator('<') cls.add_binary_comparison_operator('!=') cls.add_output_stream_operator() cls.add_binary_comparison_operator('==') ## type-id.h (module 'core'): ns3::TypeId::TypeId(char const * name) [constructor] cls.add_constructor([param('char const *', 'name')]) ## type-id.h (module 'core'): ns3::TypeId::TypeId() [constructor] cls.add_constructor([]) ## type-id.h (module 'core'): ns3::TypeId::TypeId(ns3::TypeId const & o) [copy constructor] cls.add_constructor([param('ns3::TypeId const &', 'o')]) ## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddAttribute(std::string name, std::string help, ns3::AttributeValue const & initialValue, ns3::Ptr<ns3::AttributeAccessor const> accessor, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('AddAttribute', 'ns3::TypeId', [param('std::string', 'name'), param('std::string', 'help'), param('ns3::AttributeValue const &', 'initialValue'), param('ns3::Ptr< ns3::AttributeAccessor const >', 'accessor'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')]) ## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddAttribute(std::string name, std::string help, uint32_t flags, ns3::AttributeValue const & initialValue, ns3::Ptr<ns3::AttributeAccessor const> accessor, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('AddAttribute', 'ns3::TypeId', [param('std::string', 'name'), param('std::string', 'help'), param('uint32_t', 'flags'), param('ns3::AttributeValue const &', 'initialValue'), param('ns3::Ptr< ns3::AttributeAccessor const >', 'accessor'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')]) ## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddTraceSource(std::string name, std::string help, ns3::Ptr<ns3::TraceSourceAccessor const> accessor) [member function] cls.add_method('AddTraceSource', 'ns3::TypeId', [param('std::string', 'name'), param('std::string', 'help'), param('ns3::Ptr< ns3::TraceSourceAccessor const >', 'accessor')]) ## type-id.h (module 'core'): ns3::TypeId::AttributeInformation ns3::TypeId::GetAttribute(uint32_t i) const [member function] cls.add_method('GetAttribute', 'ns3::TypeId::AttributeInformation', [param('uint32_t', 'i')], is_const=True) ## type-id.h (module 'core'): std::string ns3::TypeId::GetAttributeFullName(uint32_t i) const [member function] cls.add_method('GetAttributeFullName', 'std::string', [param('uint32_t', 'i')], is_const=True) ## type-id.h (module 'core'): uint32_t ns3::TypeId::GetAttributeN() const [member function] cls.add_method('GetAttributeN', 'uint32_t', [], is_const=True) ## type-id.h (module 'core'): ns3::Callback<ns3::ObjectBase*,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> ns3::TypeId::GetConstructor() const [member function] cls.add_method('GetConstructor', 'ns3::Callback< ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', [], is_const=True) ## type-id.h (module 'core'): std::string ns3::TypeId::GetGroupName() const [member function] cls.add_method('GetGroupName', 'std::string', [], is_const=True) ## type-id.h (module 'core'): std::string ns3::TypeId::GetName() const [member function] cls.add_method('GetName', 'std::string', [], is_const=True) ## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::GetParent() const [member function] cls.add_method('GetParent', 'ns3::TypeId', [], is_const=True) ## type-id.h (module 'core'): static ns3::TypeId ns3::TypeId::GetRegistered(uint32_t i) [member function] cls.add_method('GetRegistered', 'ns3::TypeId', [param('uint32_t', 'i')], is_static=True) ## type-id.h (module 'core'): static uint32_t ns3::TypeId::GetRegisteredN() [member function] cls.add_method('GetRegisteredN', 'uint32_t', [], is_static=True) ## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation ns3::TypeId::GetTraceSource(uint32_t i) const [member function] cls.add_method('GetTraceSource', 'ns3::TypeId::TraceSourceInformation', [param('uint32_t', 'i')], is_const=True) ## type-id.h (module 'core'): uint32_t ns3::TypeId::GetTraceSourceN() const [member function] cls.add_method('GetTraceSourceN', 'uint32_t', [], is_const=True) ## type-id.h (module 'core'): uint16_t ns3::TypeId::GetUid() const [member function] cls.add_method('GetUid', 'uint16_t', [], is_const=True) ## type-id.h (module 'core'): bool ns3::TypeId::HasConstructor() const [member function] cls.add_method('HasConstructor', 'bool', [], is_const=True) ## type-id.h (module 'core'): bool ns3::TypeId::HasParent() const [member function] cls.add_method('HasParent', 'bool', [], is_const=True) ## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::HideFromDocumentation() [member function] cls.add_method('HideFromDocumentation', 'ns3::TypeId', []) ## type-id.h (module 'core'): bool ns3::TypeId::IsChildOf(ns3::TypeId other) const [member function] cls.add_method('IsChildOf', 'bool', [param('ns3::TypeId', 'other')], is_const=True) ## type-id.h (module 'core'): bool ns3::TypeId::LookupAttributeByName(std::string name, ns3::TypeId::AttributeInformation * info) const [member function] cls.add_method('LookupAttributeByName', 'bool', [param('std::string', 'name'), param('ns3::TypeId::AttributeInformation *', 'info', transfer_ownership=False)], is_const=True) ## type-id.h (module 'core'): static ns3::TypeId ns3::TypeId::LookupByName(std::string name) [member function] cls.add_method('LookupByName', 'ns3::TypeId', [param('std::string', 'name')], is_static=True) ## type-id.h (module 'core'): ns3::Ptr<ns3::TraceSourceAccessor const> ns3::TypeId::LookupTraceSourceByName(std::string name) const [member function] cls.add_method('LookupTraceSourceByName', 'ns3::Ptr< ns3::TraceSourceAccessor const >', [param('std::string', 'name')], is_const=True) ## type-id.h (module 'core'): bool ns3::TypeId::MustHideFromDocumentation() const [member function] cls.add_method('MustHideFromDocumentation', 'bool', [], is_const=True) ## type-id.h (module 'core'): bool ns3::TypeId::SetAttributeInitialValue(uint32_t i, ns3::Ptr<ns3::AttributeValue const> initialValue) [member function] cls.add_method('SetAttributeInitialValue', 'bool', [param('uint32_t', 'i'), param('ns3::Ptr< ns3::AttributeValue const >', 'initialValue')]) ## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::SetGroupName(std::string groupName) [member function] cls.add_method('SetGroupName', 'ns3::TypeId', [param('std::string', 'groupName')]) ## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::SetParent(ns3::TypeId tid) [member function] cls.add_method('SetParent', 'ns3::TypeId', [param('ns3::TypeId', 'tid')]) ## type-id.h (module 'core'): void ns3::TypeId::SetUid(uint16_t tid) [member function] cls.add_method('SetUid', 'void', [param('uint16_t', 'tid')]) return def register_Ns3TypeIdAttributeInformation_methods(root_module, cls): ## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::AttributeInformation() [constructor] cls.add_constructor([]) ## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::AttributeInformation(ns3::TypeId::AttributeInformation const & arg0) [copy constructor] cls.add_constructor([param('ns3::TypeId::AttributeInformation const &', 'arg0')]) ## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::accessor [variable] cls.add_instance_attribute('accessor', 'ns3::Ptr< ns3::AttributeAccessor const >', is_const=False) ## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::checker [variable] cls.add_instance_attribute('checker', 'ns3::Ptr< ns3::AttributeChecker const >', is_const=False) ## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::flags [variable] cls.add_instance_attribute('flags', 'uint32_t', is_const=False) ## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::help [variable] cls.add_instance_attribute('help', 'std::string', is_const=False) ## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::initialValue [variable] cls.add_instance_attribute('initialValue', 'ns3::Ptr< ns3::AttributeValue const >', is_const=False) ## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::name [variable] cls.add_instance_attribute('name', 'std::string', is_const=False) ## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::originalInitialValue [variable] cls.add_instance_attribute('originalInitialValue', 'ns3::Ptr< ns3::AttributeValue const >', is_const=False) return def register_Ns3TypeIdTraceSourceInformation_methods(root_module, cls): ## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::TraceSourceInformation() [constructor] cls.add_constructor([]) ## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::TraceSourceInformation(ns3::TypeId::TraceSourceInformation const & arg0) [copy constructor] cls.add_constructor([param('ns3::TypeId::TraceSourceInformation const &', 'arg0')]) ## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::accessor [variable] cls.add_instance_attribute('accessor', 'ns3::Ptr< ns3::TraceSourceAccessor const >', is_const=False) ## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::help [variable] cls.add_instance_attribute('help', 'std::string', is_const=False) ## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::name [variable] cls.add_instance_attribute('name', 'std::string', is_const=False) return def register_Ns3UniformVariable_methods(root_module, cls): ## random-variable.h (module 'core'): ns3::UniformVariable::UniformVariable(ns3::UniformVariable const & arg0) [copy constructor] cls.add_constructor([param('ns3::UniformVariable const &', 'arg0')]) ## random-variable.h (module 'core'): ns3::UniformVariable::UniformVariable() [constructor] cls.add_constructor([]) ## random-variable.h (module 'core'): ns3::UniformVariable::UniformVariable(double s, double l) [constructor] cls.add_constructor([param('double', 's'), param('double', 'l')]) ## random-variable.h (module 'core'): uint32_t ns3::UniformVariable::GetInteger(uint32_t s, uint32_t l) [member function] cls.add_method('GetInteger', 'uint32_t', [param('uint32_t', 's'), param('uint32_t', 'l')]) ## random-variable.h (module 'core'): double ns3::UniformVariable::GetValue() const [member function] cls.add_method('GetValue', 'double', [], is_const=True) ## random-variable.h (module 'core'): double ns3::UniformVariable::GetValue(double s, double l) [member function] cls.add_method('GetValue', 'double', [param('double', 's'), param('double', 'l')]) return def register_Ns3WeibullVariable_methods(root_module, cls): ## random-variable.h (module 'core'): ns3::WeibullVariable::WeibullVariable(ns3::WeibullVariable const & arg0) [copy constructor] cls.add_constructor([param('ns3::WeibullVariable const &', 'arg0')]) ## random-variable.h (module 'core'): ns3::WeibullVariable::WeibullVariable() [constructor] cls.add_constructor([]) ## random-variable.h (module 'core'): ns3::WeibullVariable::WeibullVariable(double m) [constructor] cls.add_constructor([param('double', 'm')]) ## random-variable.h (module 'core'): ns3::WeibullVariable::WeibullVariable(double m, double s) [constructor] cls.add_constructor([param('double', 'm'), param('double', 's')]) ## random-variable.h (module 'core'): ns3::WeibullVariable::WeibullVariable(double m, double s, double b) [constructor] cls.add_constructor([param('double', 'm'), param('double', 's'), param('double', 'b')]) return def register_Ns3ZetaVariable_methods(root_module, cls): ## random-variable.h (module 'core'): ns3::ZetaVariable::ZetaVariable(ns3::ZetaVariable const & arg0) [copy constructor] cls.add_constructor([param('ns3::ZetaVariable const &', 'arg0')]) ## random-variable.h (module 'core'): ns3::ZetaVariable::ZetaVariable(double alpha) [constructor] cls.add_constructor([param('double', 'alpha')]) ## random-variable.h (module 'core'): ns3::ZetaVariable::ZetaVariable() [constructor] cls.add_constructor([]) return def register_Ns3ZipfVariable_methods(root_module, cls): ## random-variable.h (module 'core'): ns3::ZipfVariable::ZipfVariable(ns3::ZipfVariable const & arg0) [copy constructor] cls.add_constructor([param('ns3::ZipfVariable const &', 'arg0')]) ## random-variable.h (module 'core'): ns3::ZipfVariable::ZipfVariable(long int N, double alpha) [constructor] cls.add_constructor([param('long int', 'N'), param('double', 'alpha')]) ## random-variable.h (module 'core'): ns3::ZipfVariable::ZipfVariable() [constructor] cls.add_constructor([]) return def register_Ns3Empty_methods(root_module, cls): ## empty.h (module 'core'): ns3::empty::empty() [constructor] cls.add_constructor([]) ## empty.h (module 'core'): ns3::empty::empty(ns3::empty const & arg0) [copy constructor] cls.add_constructor([param('ns3::empty const &', 'arg0')]) return def register_Ns3Int64x64_t_methods(root_module, cls): cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long long unsigned int const', 'right')) cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long unsigned int const', 'right')) cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('unsigned int const', 'right')) cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('short unsigned int const', 'right')) cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('unsigned char const', 'right')) cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long long int const', 'right')) cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long int const', 'right')) cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('int const', 'right')) cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('short int const', 'right')) cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('signed char const', 'right')) cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('double const', 'right')) cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long long unsigned int const', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long unsigned int const', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('unsigned int const', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('short unsigned int const', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('unsigned char const', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long long int const', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long int const', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('int const', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('short int const', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('signed char const', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('double const', 'right')) cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long long unsigned int const', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long unsigned int const', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('unsigned int const', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('short unsigned int const', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('unsigned char const', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long long int const', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long int const', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('int const', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('short int const', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('signed char const', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('double const', 'right')) cls.add_unary_numeric_operator('-') cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long long unsigned int const', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long unsigned int const', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('unsigned int const', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('short unsigned int const', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('unsigned char const', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long long int const', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('long int const', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('int const', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('short int const', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('signed char const', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('double const', 'right')) cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right')) cls.add_binary_comparison_operator('<') cls.add_binary_comparison_operator('>') cls.add_binary_comparison_operator('!=') cls.add_inplace_numeric_operator('*=', param('ns3::int64x64_t const &', 'right')) cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', 'right')) cls.add_inplace_numeric_operator('-=', param('ns3::int64x64_t const &', 'right')) cls.add_inplace_numeric_operator('/=', param('ns3::int64x64_t const &', 'right')) cls.add_output_stream_operator() cls.add_binary_comparison_operator('<=') cls.add_binary_comparison_operator('==') cls.add_binary_comparison_operator('>=') ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t() [constructor] cls.add_constructor([]) ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t(double v) [constructor] cls.add_constructor([param('double', 'v')]) ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t(int v) [constructor] cls.add_constructor([param('int', 'v')]) ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t(long int v) [constructor] cls.add_constructor([param('long int', 'v')]) ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t(long long int v) [constructor] cls.add_constructor([param('long long int', 'v')]) ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t(unsigned int v) [constructor] cls.add_constructor([param('unsigned int', 'v')]) ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t(long unsigned int v) [constructor] cls.add_constructor([param('long unsigned int', 'v')]) ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t(int64_t hi, uint64_t lo) [constructor] cls.add_constructor([param('int64_t', 'hi'), param('uint64_t', 'lo')]) ## int64x64-double.h (module 'core'): ns3::int64x64_t::int64x64_t(ns3::int64x64_t const & o) [copy constructor] cls.add_constructor([param('ns3::int64x64_t const &', 'o')]) ## int64x64-double.h (module 'core'): double ns3::int64x64_t::GetDouble() const [member function] cls.add_method('GetDouble', 'double', [], is_const=True) ## int64x64-double.h (module 'core'): int64_t ns3::int64x64_t::GetHigh() const [member function] cls.add_method('GetHigh', 'int64_t', [], is_const=True) ## int64x64-double.h (module 'core'): uint64_t ns3::int64x64_t::GetLow() const [member function] cls.add_method('GetLow', 'uint64_t', [], is_const=True) ## int64x64-double.h (module 'core'): static ns3::int64x64_t ns3::int64x64_t::Invert(uint64_t v) [member function] cls.add_method('Invert', 'ns3::int64x64_t', [param('uint64_t', 'v')], is_static=True) ## int64x64-double.h (module 'core'): void ns3::int64x64_t::MulByInvert(ns3::int64x64_t const & o) [member function] cls.add_method('MulByInvert', 'void', [param('ns3::int64x64_t const &', 'o')]) return def register_Ns3Chunk_methods(root_module, cls): ## chunk.h (module 'network'): ns3::Chunk::Chunk() [constructor] cls.add_constructor([]) ## chunk.h (module 'network'): ns3::Chunk::Chunk(ns3::Chunk const & arg0) [copy constructor] cls.add_constructor([param('ns3::Chunk const &', 'arg0')]) ## chunk.h (module 'network'): uint32_t ns3::Chunk::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_pure_virtual=True, is_virtual=True) ## chunk.h (module 'network'): static ns3::TypeId ns3::Chunk::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## chunk.h (module 'network'): void ns3::Chunk::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_pure_virtual=True, is_const=True, is_virtual=True) return def register_Ns3ConstantVariable_methods(root_module, cls): ## random-variable.h (module 'core'): ns3::ConstantVariable::ConstantVariable(ns3::ConstantVariable const & arg0) [copy constructor] cls.add_constructor([param('ns3::ConstantVariable const &', 'arg0')]) ## random-variable.h (module 'core'): ns3::ConstantVariable::ConstantVariable() [constructor] cls.add_constructor([]) ## random-variable.h (module 'core'): ns3::ConstantVariable::ConstantVariable(double c) [constructor] cls.add_constructor([param('double', 'c')]) ## random-variable.h (module 'core'): void ns3::ConstantVariable::SetConstant(double c) [member function] cls.add_method('SetConstant', 'void', [param('double', 'c')]) return def register_Ns3DeterministicVariable_methods(root_module, cls): ## random-variable.h (module 'core'): ns3::DeterministicVariable::DeterministicVariable(ns3::DeterministicVariable const & arg0) [copy constructor] cls.add_constructor([param('ns3::DeterministicVariable const &', 'arg0')]) ## random-variable.h (module 'core'): ns3::DeterministicVariable::DeterministicVariable(double * d, uint32_t c) [constructor] cls.add_constructor([param('double *', 'd'), param('uint32_t', 'c')]) return def register_Ns3EmpiricalVariable_methods(root_module, cls): ## random-variable.h (module 'core'): ns3::EmpiricalVariable::EmpiricalVariable(ns3::EmpiricalVariable const & arg0) [copy constructor] cls.add_constructor([param('ns3::EmpiricalVariable const &', 'arg0')]) ## random-variable.h (module 'core'): ns3::EmpiricalVariable::EmpiricalVariable() [constructor] cls.add_constructor([]) ## random-variable.h (module 'core'): void ns3::EmpiricalVariable::CDF(double v, double c) [member function] cls.add_method('CDF', 'void', [param('double', 'v'), param('double', 'c')]) return def register_Ns3ErlangVariable_methods(root_module, cls): ## random-variable.h (module 'core'): ns3::ErlangVariable::ErlangVariable(ns3::ErlangVariable const & arg0) [copy constructor] cls.add_constructor([param('ns3::ErlangVariable const &', 'arg0')]) ## random-variable.h (module 'core'): ns3::ErlangVariable::ErlangVariable() [constructor] cls.add_constructor([]) ## random-variable.h (module 'core'): ns3::ErlangVariable::ErlangVariable(unsigned int k, double lambda) [constructor] cls.add_constructor([param('unsigned int', 'k'), param('double', 'lambda')]) ## random-variable.h (module 'core'): double ns3::ErlangVariable::GetValue() const [member function] cls.add_method('GetValue', 'double', [], is_const=True) ## random-variable.h (module 'core'): double ns3::ErlangVariable::GetValue(unsigned int k, double lambda) const [member function] cls.add_method('GetValue', 'double', [param('unsigned int', 'k'), param('double', 'lambda')], is_const=True) return def register_Ns3ExponentialVariable_methods(root_module, cls): ## random-variable.h (module 'core'): ns3::ExponentialVariable::ExponentialVariable(ns3::ExponentialVariable const & arg0) [copy constructor] cls.add_constructor([param('ns3::ExponentialVariable const &', 'arg0')]) ## random-variable.h (module 'core'): ns3::ExponentialVariable::ExponentialVariable() [constructor] cls.add_constructor([]) ## random-variable.h (module 'core'): ns3::ExponentialVariable::ExponentialVariable(double m) [constructor] cls.add_constructor([param('double', 'm')]) ## random-variable.h (module 'core'): ns3::ExponentialVariable::ExponentialVariable(double m, double b) [constructor] cls.add_constructor([param('double', 'm'), param('double', 'b')]) return def register_Ns3FlowIdTag_methods(root_module, cls): ## flow-id-tag.h (module 'network'): ns3::FlowIdTag::FlowIdTag(ns3::FlowIdTag const & arg0) [copy constructor] cls.add_constructor([param('ns3::FlowIdTag const &', 'arg0')]) ## flow-id-tag.h (module 'network'): ns3::FlowIdTag::FlowIdTag() [constructor] cls.add_constructor([]) ## flow-id-tag.h (module 'network'): ns3::FlowIdTag::FlowIdTag(uint32_t flowId) [constructor] cls.add_constructor([param('uint32_t', 'flowId')]) ## flow-id-tag.h (module 'network'): static uint32_t ns3::FlowIdTag::AllocateFlowId() [member function] cls.add_method('AllocateFlowId', 'uint32_t', [], is_static=True) ## flow-id-tag.h (module 'network'): void ns3::FlowIdTag::Deserialize(ns3::TagBuffer buf) [member function] cls.add_method('Deserialize', 'void', [param('ns3::TagBuffer', 'buf')], is_virtual=True) ## flow-id-tag.h (module 'network'): uint32_t ns3::FlowIdTag::GetFlowId() const [member function] cls.add_method('GetFlowId', 'uint32_t', [], is_const=True) ## flow-id-tag.h (module 'network'): ns3::TypeId ns3::FlowIdTag::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## flow-id-tag.h (module 'network'): uint32_t ns3::FlowIdTag::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## flow-id-tag.h (module 'network'): static ns3::TypeId ns3::FlowIdTag::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## flow-id-tag.h (module 'network'): void ns3::FlowIdTag::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## flow-id-tag.h (module 'network'): void ns3::FlowIdTag::Serialize(ns3::TagBuffer buf) const [member function] cls.add_method('Serialize', 'void', [param('ns3::TagBuffer', 'buf')], is_const=True, is_virtual=True) ## flow-id-tag.h (module 'network'): void ns3::FlowIdTag::SetFlowId(uint32_t flowId) [member function] cls.add_method('SetFlowId', 'void', [param('uint32_t', 'flowId')]) return def register_Ns3GammaVariable_methods(root_module, cls): ## random-variable.h (module 'core'): ns3::GammaVariable::GammaVariable(ns3::GammaVariable const & arg0) [copy constructor] cls.add_constructor([param('ns3::GammaVariable const &', 'arg0')]) ## random-variable.h (module 'core'): ns3::GammaVariable::GammaVariable() [constructor] cls.add_constructor([]) ## random-variable.h (module 'core'): ns3::GammaVariable::GammaVariable(double alpha, double beta) [constructor] cls.add_constructor([param('double', 'alpha'), param('double', 'beta')]) ## random-variable.h (module 'core'): double ns3::GammaVariable::GetValue() const [member function] cls.add_method('GetValue', 'double', [], is_const=True) ## random-variable.h (module 'core'): double ns3::GammaVariable::GetValue(double alpha, double beta) const [member function] cls.add_method('GetValue', 'double', [param('double', 'alpha'), param('double', 'beta')], is_const=True) return def register_Ns3Header_methods(root_module, cls): cls.add_output_stream_operator() ## header.h (module 'network'): ns3::Header::Header() [constructor] cls.add_constructor([]) ## header.h (module 'network'): ns3::Header::Header(ns3::Header const & arg0) [copy constructor] cls.add_constructor([param('ns3::Header const &', 'arg0')]) ## header.h (module 'network'): uint32_t ns3::Header::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_pure_virtual=True, is_virtual=True) ## header.h (module 'network'): uint32_t ns3::Header::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## header.h (module 'network'): static ns3::TypeId ns3::Header::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## header.h (module 'network'): void ns3::Header::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_pure_virtual=True, is_const=True, is_virtual=True) ## header.h (module 'network'): void ns3::Header::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_pure_virtual=True, is_const=True, is_virtual=True) return def register_Ns3IntEmpiricalVariable_methods(root_module, cls): ## random-variable.h (module 'core'): ns3::IntEmpiricalVariable::IntEmpiricalVariable(ns3::IntEmpiricalVariable const & arg0) [copy constructor] cls.add_constructor([param('ns3::IntEmpiricalVariable const &', 'arg0')]) ## random-variable.h (module 'core'): ns3::IntEmpiricalVariable::IntEmpiricalVariable() [constructor] cls.add_constructor([]) return def register_Ns3LlcSnapHeader_methods(root_module, cls): ## llc-snap-header.h (module 'network'): ns3::LlcSnapHeader::LlcSnapHeader(ns3::LlcSnapHeader const & arg0) [copy constructor] cls.add_constructor([param('ns3::LlcSnapHeader const &', 'arg0')]) ## llc-snap-header.h (module 'network'): ns3::LlcSnapHeader::LlcSnapHeader() [constructor] cls.add_constructor([]) ## llc-snap-header.h (module 'network'): uint32_t ns3::LlcSnapHeader::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) ## llc-snap-header.h (module 'network'): ns3::TypeId ns3::LlcSnapHeader::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## llc-snap-header.h (module 'network'): uint32_t ns3::LlcSnapHeader::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## llc-snap-header.h (module 'network'): uint16_t ns3::LlcSnapHeader::GetType() [member function] cls.add_method('GetType', 'uint16_t', []) ## llc-snap-header.h (module 'network'): static ns3::TypeId ns3::LlcSnapHeader::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## llc-snap-header.h (module 'network'): void ns3::LlcSnapHeader::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## llc-snap-header.h (module 'network'): void ns3::LlcSnapHeader::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) ## llc-snap-header.h (module 'network'): void ns3::LlcSnapHeader::SetType(uint16_t type) [member function] cls.add_method('SetType', 'void', [param('uint16_t', 'type')]) return def register_Ns3LogNormalVariable_methods(root_module, cls): ## random-variable.h (module 'core'): ns3::LogNormalVariable::LogNormalVariable(ns3::LogNormalVariable const & arg0) [copy constructor] cls.add_constructor([param('ns3::LogNormalVariable const &', 'arg0')]) ## random-variable.h (module 'core'): ns3::LogNormalVariable::LogNormalVariable(double mu, double sigma) [constructor] cls.add_constructor([param('double', 'mu'), param('double', 'sigma')]) return def register_Ns3NormalVariable_methods(root_module, cls): ## random-variable.h (module 'core'): ns3::NormalVariable::NormalVariable(ns3::NormalVariable const & arg0) [copy constructor] cls.add_constructor([param('ns3::NormalVariable const &', 'arg0')]) ## random-variable.h (module 'core'): ns3::NormalVariable::NormalVariable() [constructor] cls.add_constructor([]) ## random-variable.h (module 'core'): ns3::NormalVariable::NormalVariable(double m, double v) [constructor] cls.add_constructor([param('double', 'm'), param('double', 'v')]) ## random-variable.h (module 'core'): ns3::NormalVariable::NormalVariable(double m, double v, double b) [constructor] cls.add_constructor([param('double', 'm'), param('double', 'v'), param('double', 'b')]) return def register_Ns3Object_methods(root_module, cls): ## object.h (module 'core'): ns3::Object::Object() [constructor] cls.add_constructor([]) ## object.h (module 'core'): void ns3::Object::AggregateObject(ns3::Ptr<ns3::Object> other) [member function] cls.add_method('AggregateObject', 'void', [param('ns3::Ptr< ns3::Object >', 'other')]) ## object.h (module 'core'): void ns3::Object::Dispose() [member function] cls.add_method('Dispose', 'void', []) ## object.h (module 'core'): ns3::Object::AggregateIterator ns3::Object::GetAggregateIterator() const [member function] cls.add_method('GetAggregateIterator', 'ns3::Object::AggregateIterator', [], is_const=True) ## object.h (module 'core'): ns3::TypeId ns3::Object::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## object.h (module 'core'): static ns3::TypeId ns3::Object::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## object.h (module 'core'): void ns3::Object::Start() [member function] cls.add_method('Start', 'void', []) ## object.h (module 'core'): ns3::Object::Object(ns3::Object const & o) [copy constructor] cls.add_constructor([param('ns3::Object const &', 'o')], visibility='protected') ## object.h (module 'core'): void ns3::Object::DoDispose() [member function] cls.add_method('DoDispose', 'void', [], visibility='protected', is_virtual=True) ## object.h (module 'core'): void ns3::Object::DoStart() [member function] cls.add_method('DoStart', 'void', [], visibility='protected', is_virtual=True) ## object.h (module 'core'): void ns3::Object::NotifyNewAggregate() [member function] cls.add_method('NotifyNewAggregate', 'void', [], visibility='protected', is_virtual=True) return def register_Ns3ObjectAggregateIterator_methods(root_module, cls): ## object.h (module 'core'): ns3::Object::AggregateIterator::AggregateIterator(ns3::Object::AggregateIterator const & arg0) [copy constructor] cls.add_constructor([param('ns3::Object::AggregateIterator const &', 'arg0')]) ## object.h (module 'core'): ns3::Object::AggregateIterator::AggregateIterator() [constructor] cls.add_constructor([]) ## object.h (module 'core'): bool ns3::Object::AggregateIterator::HasNext() const [member function] cls.add_method('HasNext', 'bool', [], is_const=True) ## object.h (module 'core'): ns3::Ptr<ns3::Object const> ns3::Object::AggregateIterator::Next() [member function] cls.add_method('Next', 'ns3::Ptr< ns3::Object const >', []) return def register_Ns3PacketBurst_methods(root_module, cls): ## packet-burst.h (module 'network'): ns3::PacketBurst::PacketBurst(ns3::PacketBurst const & arg0) [copy constructor] cls.add_constructor([param('ns3::PacketBurst const &', 'arg0')]) ## packet-burst.h (module 'network'): ns3::PacketBurst::PacketBurst() [constructor] cls.add_constructor([]) ## packet-burst.h (module 'network'): void ns3::PacketBurst::AddPacket(ns3::Ptr<ns3::Packet> packet) [member function] cls.add_method('AddPacket', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet')]) ## packet-burst.h (module 'network'): std::_List_const_iterator<ns3::Ptr<ns3::Packet> > ns3::PacketBurst::Begin() const [member function] cls.add_method('Begin', 'std::_List_const_iterator< ns3::Ptr< ns3::Packet > >', [], is_const=True) ## packet-burst.h (module 'network'): ns3::Ptr<ns3::PacketBurst> ns3::PacketBurst::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::PacketBurst >', [], is_const=True) ## packet-burst.h (module 'network'): std::_List_const_iterator<ns3::Ptr<ns3::Packet> > ns3::PacketBurst::End() const [member function] cls.add_method('End', 'std::_List_const_iterator< ns3::Ptr< ns3::Packet > >', [], is_const=True) ## packet-burst.h (module 'network'): uint32_t ns3::PacketBurst::GetNPackets() const [member function] cls.add_method('GetNPackets', 'uint32_t', [], is_const=True) ## packet-burst.h (module 'network'): std::list<ns3::Ptr<ns3::Packet>, std::allocator<ns3::Ptr<ns3::Packet> > > ns3::PacketBurst::GetPackets() const [member function] cls.add_method('GetPackets', 'std::list< ns3::Ptr< ns3::Packet > >', [], is_const=True) ## packet-burst.h (module 'network'): uint32_t ns3::PacketBurst::GetSize() const [member function] cls.add_method('GetSize', 'uint32_t', [], is_const=True) ## packet-burst.h (module 'network'): static ns3::TypeId ns3::PacketBurst::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## packet-burst.h (module 'network'): void ns3::PacketBurst::DoDispose() [member function] cls.add_method('DoDispose', 'void', [], visibility='private', is_virtual=True) return def register_Ns3ParetoVariable_methods(root_module, cls): ## random-variable.h (module 'core'): ns3::ParetoVariable::ParetoVariable(ns3::ParetoVariable const & arg0) [copy constructor] cls.add_constructor([param('ns3::ParetoVariable const &', 'arg0')]) ## random-variable.h (module 'core'): ns3::ParetoVariable::ParetoVariable() [constructor] cls.add_constructor([]) ## random-variable.h (module 'core'): ns3::ParetoVariable::ParetoVariable(double m) [constructor] cls.add_constructor([param('double', 'm')]) ## random-variable.h (module 'core'): ns3::ParetoVariable::ParetoVariable(double m, double s) [constructor] cls.add_constructor([param('double', 'm'), param('double', 's')]) ## random-variable.h (module 'core'): ns3::ParetoVariable::ParetoVariable(double m, double s, double b) [constructor] cls.add_constructor([param('double', 'm'), param('double', 's'), param('double', 'b')]) ## random-variable.h (module 'core'): ns3::ParetoVariable::ParetoVariable(std::pair<double,double> params) [constructor] cls.add_constructor([param('std::pair< double, double >', 'params')]) ## random-variable.h (module 'core'): ns3::ParetoVariable::ParetoVariable(std::pair<double,double> params, double b) [constructor] cls.add_constructor([param('std::pair< double, double >', 'params'), param('double', 'b')]) return def register_Ns3PcapFileWrapper_methods(root_module, cls): ## pcap-file-wrapper.h (module 'network'): static ns3::TypeId ns3::PcapFileWrapper::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## pcap-file-wrapper.h (module 'network'): ns3::PcapFileWrapper::PcapFileWrapper() [constructor] cls.add_constructor([]) ## pcap-file-wrapper.h (module 'network'): bool ns3::PcapFileWrapper::Fail() const [member function] cls.add_method('Fail', 'bool', [], is_const=True) ## pcap-file-wrapper.h (module 'network'): bool ns3::PcapFileWrapper::Eof() const [member function] cls.add_method('Eof', 'bool', [], is_const=True) ## pcap-file-wrapper.h (module 'network'): void ns3::PcapFileWrapper::Clear() [member function] cls.add_method('Clear', 'void', []) ## pcap-file-wrapper.h (module 'network'): void ns3::PcapFileWrapper::Open(std::string const & filename, std::_Ios_Openmode mode) [member function] cls.add_method('Open', 'void', [param('std::string const &', 'filename'), param('std::_Ios_Openmode', 'mode')]) ## pcap-file-wrapper.h (module 'network'): void ns3::PcapFileWrapper::Close() [member function] cls.add_method('Close', 'void', []) ## pcap-file-wrapper.h (module 'network'): void ns3::PcapFileWrapper::Init(uint32_t dataLinkType, uint32_t snapLen=std::numeric_limits<unsigned int>::max(), int32_t tzCorrection=ns3::PcapFile::ZONE_DEFAULT) [member function] cls.add_method('Init', 'void', [param('uint32_t', 'dataLinkType'), param('uint32_t', 'snapLen', default_value='std::numeric_limits<unsigned int>::max()'), param('int32_t', 'tzCorrection', default_value='ns3::PcapFile::ZONE_DEFAULT')]) ## pcap-file-wrapper.h (module 'network'): void ns3::PcapFileWrapper::Write(ns3::Time t, ns3::Ptr<const ns3::Packet> p) [member function] cls.add_method('Write', 'void', [param('ns3::Time', 't'), param('ns3::Ptr< ns3::Packet const >', 'p')]) ## pcap-file-wrapper.h (module 'network'): void ns3::PcapFileWrapper::Write(ns3::Time t, ns3::Header & header, ns3::Ptr<const ns3::Packet> p) [member function] cls.add_method('Write', 'void', [param('ns3::Time', 't'), param('ns3::Header &', 'header'), param('ns3::Ptr< ns3::Packet const >', 'p')]) ## pcap-file-wrapper.h (module 'network'): void ns3::PcapFileWrapper::Write(ns3::Time t, uint8_t const * buffer, uint32_t length) [member function] cls.add_method('Write', 'void', [param('ns3::Time', 't'), param('uint8_t const *', 'buffer'), param('uint32_t', 'length')]) ## pcap-file-wrapper.h (module 'network'): uint32_t ns3::PcapFileWrapper::GetMagic() [member function] cls.add_method('GetMagic', 'uint32_t', []) ## pcap-file-wrapper.h (module 'network'): uint16_t ns3::PcapFileWrapper::GetVersionMajor() [member function] cls.add_method('GetVersionMajor', 'uint16_t', []) ## pcap-file-wrapper.h (module 'network'): uint16_t ns3::PcapFileWrapper::GetVersionMinor() [member function] cls.add_method('GetVersionMinor', 'uint16_t', []) ## pcap-file-wrapper.h (module 'network'): int32_t ns3::PcapFileWrapper::GetTimeZoneOffset() [member function] cls.add_method('GetTimeZoneOffset', 'int32_t', []) ## pcap-file-wrapper.h (module 'network'): uint32_t ns3::PcapFileWrapper::GetSigFigs() [member function] cls.add_method('GetSigFigs', 'uint32_t', []) ## pcap-file-wrapper.h (module 'network'): uint32_t ns3::PcapFileWrapper::GetSnapLen() [member function] cls.add_method('GetSnapLen', 'uint32_t', []) ## pcap-file-wrapper.h (module 'network'): uint32_t ns3::PcapFileWrapper::GetDataLinkType() [member function] cls.add_method('GetDataLinkType', 'uint32_t', []) return def register_Ns3Queue_methods(root_module, cls): ## queue.h (module 'network'): ns3::Queue::Queue(ns3::Queue const & arg0) [copy constructor] cls.add_constructor([param('ns3::Queue const &', 'arg0')]) ## queue.h (module 'network'): ns3::Queue::Queue() [constructor] cls.add_constructor([]) ## queue.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Queue::Dequeue() [member function] cls.add_method('Dequeue', 'ns3::Ptr< ns3::Packet >', []) ## queue.h (module 'network'): void ns3::Queue::DequeueAll() [member function] cls.add_method('DequeueAll', 'void', []) ## queue.h (module 'network'): bool ns3::Queue::Enqueue(ns3::Ptr<ns3::Packet> p) [member function] cls.add_method('Enqueue', 'bool', [param('ns3::Ptr< ns3::Packet >', 'p')]) ## queue.h (module 'network'): uint32_t ns3::Queue::GetNBytes() const [member function] cls.add_method('GetNBytes', 'uint32_t', [], is_const=True) ## queue.h (module 'network'): uint32_t ns3::Queue::GetNPackets() const [member function] cls.add_method('GetNPackets', 'uint32_t', [], is_const=True) ## queue.h (module 'network'): uint32_t ns3::Queue::GetTotalDroppedBytes() const [member function] cls.add_method('GetTotalDroppedBytes', 'uint32_t', [], is_const=True) ## queue.h (module 'network'): uint32_t ns3::Queue::GetTotalDroppedPackets() const [member function] cls.add_method('GetTotalDroppedPackets', 'uint32_t', [], is_const=True) ## queue.h (module 'network'): uint32_t ns3::Queue::GetTotalReceivedBytes() const [member function] cls.add_method('GetTotalReceivedBytes', 'uint32_t', [], is_const=True) ## queue.h (module 'network'): uint32_t ns3::Queue::GetTotalReceivedPackets() const [member function] cls.add_method('GetTotalReceivedPackets', 'uint32_t', [], is_const=True) ## queue.h (module 'network'): static ns3::TypeId ns3::Queue::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## queue.h (module 'network'): bool ns3::Queue::IsEmpty() const [member function] cls.add_method('IsEmpty', 'bool', [], is_const=True) ## queue.h (module 'network'): ns3::Ptr<const ns3::Packet> ns3::Queue::Peek() const [member function] cls.add_method('Peek', 'ns3::Ptr< ns3::Packet const >', [], is_const=True) ## queue.h (module 'network'): void ns3::Queue::ResetStatistics() [member function] cls.add_method('ResetStatistics', 'void', []) ## queue.h (module 'network'): void ns3::Queue::Drop(ns3::Ptr<ns3::Packet> packet) [member function] cls.add_method('Drop', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet')], visibility='protected') ## queue.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Queue::DoDequeue() [member function] cls.add_method('DoDequeue', 'ns3::Ptr< ns3::Packet >', [], is_pure_virtual=True, visibility='private', is_virtual=True) ## queue.h (module 'network'): bool ns3::Queue::DoEnqueue(ns3::Ptr<ns3::Packet> p) [member function] cls.add_method('DoEnqueue', 'bool', [param('ns3::Ptr< ns3::Packet >', 'p')], is_pure_virtual=True, visibility='private', is_virtual=True) ## queue.h (module 'network'): ns3::Ptr<const ns3::Packet> ns3::Queue::DoPeek() const [member function] cls.add_method('DoPeek', 'ns3::Ptr< ns3::Packet const >', [], is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) return def register_Ns3RadiotapHeader_methods(root_module, cls): ## radiotap-header.h (module 'network'): ns3::RadiotapHeader::RadiotapHeader(ns3::RadiotapHeader const & arg0) [copy constructor] cls.add_constructor([param('ns3::RadiotapHeader const &', 'arg0')]) ## radiotap-header.h (module 'network'): ns3::RadiotapHeader::RadiotapHeader() [constructor] cls.add_constructor([]) ## radiotap-header.h (module 'network'): uint32_t ns3::RadiotapHeader::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) ## radiotap-header.h (module 'network'): uint8_t ns3::RadiotapHeader::GetAntennaNoisePower() const [member function] cls.add_method('GetAntennaNoisePower', 'uint8_t', [], is_const=True) ## radiotap-header.h (module 'network'): uint8_t ns3::RadiotapHeader::GetAntennaSignalPower() const [member function] cls.add_method('GetAntennaSignalPower', 'uint8_t', [], is_const=True) ## radiotap-header.h (module 'network'): uint16_t ns3::RadiotapHeader::GetChannelFlags() const [member function] cls.add_method('GetChannelFlags', 'uint16_t', [], is_const=True) ## radiotap-header.h (module 'network'): uint16_t ns3::RadiotapHeader::GetChannelFrequency() const [member function] cls.add_method('GetChannelFrequency', 'uint16_t', [], is_const=True) ## radiotap-header.h (module 'network'): uint8_t ns3::RadiotapHeader::GetFrameFlags() const [member function] cls.add_method('GetFrameFlags', 'uint8_t', [], is_const=True) ## radiotap-header.h (module 'network'): ns3::TypeId ns3::RadiotapHeader::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## radiotap-header.h (module 'network'): uint8_t ns3::RadiotapHeader::GetRate() const [member function] cls.add_method('GetRate', 'uint8_t', [], is_const=True) ## radiotap-header.h (module 'network'): uint32_t ns3::RadiotapHeader::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## radiotap-header.h (module 'network'): uint64_t ns3::RadiotapHeader::GetTsft() const [member function] cls.add_method('GetTsft', 'uint64_t', [], is_const=True) ## radiotap-header.h (module 'network'): static ns3::TypeId ns3::RadiotapHeader::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## radiotap-header.h (module 'network'): void ns3::RadiotapHeader::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## radiotap-header.h (module 'network'): void ns3::RadiotapHeader::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) ## radiotap-header.h (module 'network'): void ns3::RadiotapHeader::SetAntennaNoisePower(double noise) [member function] cls.add_method('SetAntennaNoisePower', 'void', [param('double', 'noise')]) ## radiotap-header.h (module 'network'): void ns3::RadiotapHeader::SetAntennaSignalPower(double signal) [member function] cls.add_method('SetAntennaSignalPower', 'void', [param('double', 'signal')]) ## radiotap-header.h (module 'network'): void ns3::RadiotapHeader::SetChannelFrequencyAndFlags(uint16_t frequency, uint16_t flags) [member function] cls.add_method('SetChannelFrequencyAndFlags', 'void', [param('uint16_t', 'frequency'), param('uint16_t', 'flags')]) ## radiotap-header.h (module 'network'): void ns3::RadiotapHeader::SetFrameFlags(uint8_t flags) [member function] cls.add_method('SetFrameFlags', 'void', [param('uint8_t', 'flags')]) ## radiotap-header.h (module 'network'): void ns3::RadiotapHeader::SetRate(uint8_t rate) [member function] cls.add_method('SetRate', 'void', [param('uint8_t', 'rate')]) ## radiotap-header.h (module 'network'): void ns3::RadiotapHeader::SetTsft(uint64_t tsft) [member function] cls.add_method('SetTsft', 'void', [param('uint64_t', 'tsft')]) return def register_Ns3RedQueue_methods(root_module, cls): ## red-queue.h (module 'network'): ns3::RedQueue::RedQueue(ns3::RedQueue const & arg0) [copy constructor] cls.add_constructor([param('ns3::RedQueue const &', 'arg0')]) ## red-queue.h (module 'network'): ns3::RedQueue::RedQueue() [constructor] cls.add_constructor([]) ## red-queue.h (module 'network'): ns3::Queue::QueueMode ns3::RedQueue::GetMode() [member function] cls.add_method('GetMode', 'ns3::Queue::QueueMode', []) ## red-queue.h (module 'network'): uint32_t ns3::RedQueue::GetQueueSize() [member function] cls.add_method('GetQueueSize', 'uint32_t', []) ## red-queue.h (module 'network'): ns3::RedQueue::Stats ns3::RedQueue::GetStats() [member function] cls.add_method('GetStats', 'ns3::RedQueue::Stats', []) ## red-queue.h (module 'network'): static ns3::TypeId ns3::RedQueue::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## red-queue.h (module 'network'): void ns3::RedQueue::SetMode(ns3::Queue::QueueMode mode) [member function] cls.add_method('SetMode', 'void', [param('ns3::Queue::QueueMode', 'mode')]) ## red-queue.h (module 'network'): void ns3::RedQueue::SetQueueLimit(uint32_t lim) [member function] cls.add_method('SetQueueLimit', 'void', [param('uint32_t', 'lim')]) ## red-queue.h (module 'network'): void ns3::RedQueue::SetTh(double minTh, double maxTh) [member function] cls.add_method('SetTh', 'void', [param('double', 'minTh'), param('double', 'maxTh')]) ## red-queue.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::RedQueue::DoDequeue() [member function] cls.add_method('DoDequeue', 'ns3::Ptr< ns3::Packet >', [], visibility='private', is_virtual=True) ## red-queue.h (module 'network'): bool ns3::RedQueue::DoEnqueue(ns3::Ptr<ns3::Packet> p) [member function] cls.add_method('DoEnqueue', 'bool', [param('ns3::Ptr< ns3::Packet >', 'p')], visibility='private', is_virtual=True) ## red-queue.h (module 'network'): ns3::Ptr<const ns3::Packet> ns3::RedQueue::DoPeek() const [member function] cls.add_method('DoPeek', 'ns3::Ptr< ns3::Packet const >', [], is_const=True, visibility='private', is_virtual=True) return def register_Ns3RedQueueStats_methods(root_module, cls): ## red-queue.h (module 'network'): ns3::RedQueue::Stats::Stats() [constructor] cls.add_constructor([]) ## red-queue.h (module 'network'): ns3::RedQueue::Stats::Stats(ns3::RedQueue::Stats const & arg0) [copy constructor] cls.add_constructor([param('ns3::RedQueue::Stats const &', 'arg0')]) ## red-queue.h (module 'network'): ns3::RedQueue::Stats::forcedDrop [variable] cls.add_instance_attribute('forcedDrop', 'uint32_t', is_const=False) ## red-queue.h (module 'network'): ns3::RedQueue::Stats::qLimDrop [variable] cls.add_instance_attribute('qLimDrop', 'uint32_t', is_const=False) ## red-queue.h (module 'network'): ns3::RedQueue::Stats::unforcedDrop [variable] cls.add_instance_attribute('unforcedDrop', 'uint32_t', is_const=False) return def register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >::SimpleRefCount(ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter< ns3::AttributeAccessor > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >::SimpleRefCount(ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter< ns3::AttributeChecker > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >::SimpleRefCount(ns3::SimpleRefCount<ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter< ns3::AttributeValue > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3CallbackImplBase_Ns3Empty_Ns3DefaultDeleter__lt__ns3CallbackImplBase__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >::SimpleRefCount(ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter< ns3::CallbackImplBase > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3EventImpl_Ns3Empty_Ns3DefaultDeleter__lt__ns3EventImpl__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >::SimpleRefCount(ns3::SimpleRefCount<ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter< ns3::EventImpl > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3NixVector_Ns3Empty_Ns3DefaultDeleter__lt__ns3NixVector__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >::SimpleRefCount(ns3::SimpleRefCount<ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::NixVector, ns3::empty, ns3::DefaultDeleter< ns3::NixVector > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3OutputStreamWrapper_Ns3Empty_Ns3DefaultDeleter__lt__ns3OutputStreamWrapper__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >::SimpleRefCount(ns3::SimpleRefCount<ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter< ns3::OutputStreamWrapper > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3Packet_Ns3Empty_Ns3DefaultDeleter__lt__ns3Packet__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >::SimpleRefCount(ns3::SimpleRefCount<ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter< ns3::Packet > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3PbbAddressBlock_Ns3Empty_Ns3DefaultDeleter__lt__ns3PbbAddressBlock__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbAddressBlock, ns3::empty, ns3::DefaultDeleter<ns3::PbbAddressBlock> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbAddressBlock, ns3::empty, ns3::DefaultDeleter<ns3::PbbAddressBlock> >::SimpleRefCount(ns3::SimpleRefCount<ns3::PbbAddressBlock, ns3::empty, ns3::DefaultDeleter<ns3::PbbAddressBlock> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::PbbAddressBlock, ns3::empty, ns3::DefaultDeleter< ns3::PbbAddressBlock > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::PbbAddressBlock, ns3::empty, ns3::DefaultDeleter<ns3::PbbAddressBlock> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3PbbMessage_Ns3Empty_Ns3DefaultDeleter__lt__ns3PbbMessage__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbMessage, ns3::empty, ns3::DefaultDeleter<ns3::PbbMessage> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbMessage, ns3::empty, ns3::DefaultDeleter<ns3::PbbMessage> >::SimpleRefCount(ns3::SimpleRefCount<ns3::PbbMessage, ns3::empty, ns3::DefaultDeleter<ns3::PbbMessage> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::PbbMessage, ns3::empty, ns3::DefaultDeleter< ns3::PbbMessage > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::PbbMessage, ns3::empty, ns3::DefaultDeleter<ns3::PbbMessage> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3PbbPacket_Ns3Header_Ns3DefaultDeleter__lt__ns3PbbPacket__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbPacket, ns3::Header, ns3::DefaultDeleter<ns3::PbbPacket> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbPacket, ns3::Header, ns3::DefaultDeleter<ns3::PbbPacket> >::SimpleRefCount(ns3::SimpleRefCount<ns3::PbbPacket, ns3::Header, ns3::DefaultDeleter<ns3::PbbPacket> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::PbbPacket, ns3::Header, ns3::DefaultDeleter< ns3::PbbPacket > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::PbbPacket, ns3::Header, ns3::DefaultDeleter<ns3::PbbPacket> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3PbbTlv_Ns3Empty_Ns3DefaultDeleter__lt__ns3PbbTlv__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbTlv, ns3::empty, ns3::DefaultDeleter<ns3::PbbTlv> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::PbbTlv, ns3::empty, ns3::DefaultDeleter<ns3::PbbTlv> >::SimpleRefCount(ns3::SimpleRefCount<ns3::PbbTlv, ns3::empty, ns3::DefaultDeleter<ns3::PbbTlv> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::PbbTlv, ns3::empty, ns3::DefaultDeleter< ns3::PbbTlv > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::PbbTlv, ns3::empty, ns3::DefaultDeleter<ns3::PbbTlv> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, cls): ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >::SimpleRefCount() [constructor] cls.add_constructor([]) ## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >::SimpleRefCount(ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> > const & o) [copy constructor] cls.add_constructor([param('ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter< ns3::TraceSourceAccessor > > const &', 'o')]) ## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >::Cleanup() [member function] cls.add_method('Cleanup', 'void', [], is_static=True) return def register_Ns3Socket_methods(root_module, cls):<|fim▁hole|> cls.add_constructor([]) ## socket.h (module 'network'): int ns3::Socket::Bind(ns3::Address const & address) [member function] cls.add_method('Bind', 'int', [param('ns3::Address const &', 'address')], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): int ns3::Socket::Bind() [member function] cls.add_method('Bind', 'int', [], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): int ns3::Socket::Bind6() [member function] cls.add_method('Bind6', 'int', [], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): void ns3::Socket::BindToNetDevice(ns3::Ptr<ns3::NetDevice> netdevice) [member function] cls.add_method('BindToNetDevice', 'void', [param('ns3::Ptr< ns3::NetDevice >', 'netdevice')], is_virtual=True) ## socket.h (module 'network'): int ns3::Socket::Close() [member function] cls.add_method('Close', 'int', [], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): int ns3::Socket::Connect(ns3::Address const & address) [member function] cls.add_method('Connect', 'int', [param('ns3::Address const &', 'address')], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): static ns3::Ptr<ns3::Socket> ns3::Socket::CreateSocket(ns3::Ptr<ns3::Node> node, ns3::TypeId tid) [member function] cls.add_method('CreateSocket', 'ns3::Ptr< ns3::Socket >', [param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::TypeId', 'tid')], is_static=True) ## socket.h (module 'network'): bool ns3::Socket::GetAllowBroadcast() const [member function] cls.add_method('GetAllowBroadcast', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## socket.h (module 'network'): ns3::Ptr<ns3::NetDevice> ns3::Socket::GetBoundNetDevice() [member function] cls.add_method('GetBoundNetDevice', 'ns3::Ptr< ns3::NetDevice >', []) ## socket.h (module 'network'): ns3::Socket::SocketErrno ns3::Socket::GetErrno() const [member function] cls.add_method('GetErrno', 'ns3::Socket::SocketErrno', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## socket.h (module 'network'): ns3::Ptr<ns3::Node> ns3::Socket::GetNode() const [member function] cls.add_method('GetNode', 'ns3::Ptr< ns3::Node >', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## socket.h (module 'network'): uint32_t ns3::Socket::GetRxAvailable() const [member function] cls.add_method('GetRxAvailable', 'uint32_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## socket.h (module 'network'): int ns3::Socket::GetSockName(ns3::Address & address) const [member function] cls.add_method('GetSockName', 'int', [param('ns3::Address &', 'address')], is_pure_virtual=True, is_const=True, is_virtual=True) ## socket.h (module 'network'): ns3::Socket::SocketType ns3::Socket::GetSocketType() const [member function] cls.add_method('GetSocketType', 'ns3::Socket::SocketType', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## socket.h (module 'network'): uint32_t ns3::Socket::GetTxAvailable() const [member function] cls.add_method('GetTxAvailable', 'uint32_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## socket.h (module 'network'): static ns3::TypeId ns3::Socket::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## socket.h (module 'network'): bool ns3::Socket::IsRecvPktInfo() const [member function] cls.add_method('IsRecvPktInfo', 'bool', [], is_const=True) ## socket.h (module 'network'): int ns3::Socket::Listen() [member function] cls.add_method('Listen', 'int', [], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Socket::Recv(uint32_t maxSize, uint32_t flags) [member function] cls.add_method('Recv', 'ns3::Ptr< ns3::Packet >', [param('uint32_t', 'maxSize'), param('uint32_t', 'flags')], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Socket::Recv() [member function] cls.add_method('Recv', 'ns3::Ptr< ns3::Packet >', []) ## socket.h (module 'network'): int ns3::Socket::Recv(uint8_t * buf, uint32_t size, uint32_t flags) [member function] cls.add_method('Recv', 'int', [param('uint8_t *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags')]) ## socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Socket::RecvFrom(uint32_t maxSize, uint32_t flags, ns3::Address & fromAddress) [member function] cls.add_method('RecvFrom', 'ns3::Ptr< ns3::Packet >', [param('uint32_t', 'maxSize'), param('uint32_t', 'flags'), param('ns3::Address &', 'fromAddress')], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Socket::RecvFrom(ns3::Address & fromAddress) [member function] cls.add_method('RecvFrom', 'ns3::Ptr< ns3::Packet >', [param('ns3::Address &', 'fromAddress')]) ## socket.h (module 'network'): int ns3::Socket::RecvFrom(uint8_t * buf, uint32_t size, uint32_t flags, ns3::Address & fromAddress) [member function] cls.add_method('RecvFrom', 'int', [param('uint8_t *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags'), param('ns3::Address &', 'fromAddress')]) ## socket.h (module 'network'): int ns3::Socket::Send(ns3::Ptr<ns3::Packet> p, uint32_t flags) [member function] cls.add_method('Send', 'int', [param('ns3::Ptr< ns3::Packet >', 'p'), param('uint32_t', 'flags')], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): int ns3::Socket::Send(ns3::Ptr<ns3::Packet> p) [member function] cls.add_method('Send', 'int', [param('ns3::Ptr< ns3::Packet >', 'p')]) ## socket.h (module 'network'): int ns3::Socket::Send(uint8_t const * buf, uint32_t size, uint32_t flags) [member function] cls.add_method('Send', 'int', [param('uint8_t const *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags')]) ## socket.h (module 'network'): int ns3::Socket::SendTo(ns3::Ptr<ns3::Packet> p, uint32_t flags, ns3::Address const & toAddress) [member function] cls.add_method('SendTo', 'int', [param('ns3::Ptr< ns3::Packet >', 'p'), param('uint32_t', 'flags'), param('ns3::Address const &', 'toAddress')], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): int ns3::Socket::SendTo(uint8_t const * buf, uint32_t size, uint32_t flags, ns3::Address const & address) [member function] cls.add_method('SendTo', 'int', [param('uint8_t const *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags'), param('ns3::Address const &', 'address')]) ## socket.h (module 'network'): void ns3::Socket::SetAcceptCallback(ns3::Callback<bool, ns3::Ptr<ns3::Socket>, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> connectionRequest, ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> newConnectionCreated) [member function] cls.add_method('SetAcceptCallback', 'void', [param('ns3::Callback< bool, ns3::Ptr< ns3::Socket >, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'connectionRequest'), param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'newConnectionCreated')]) ## socket.h (module 'network'): bool ns3::Socket::SetAllowBroadcast(bool allowBroadcast) [member function] cls.add_method('SetAllowBroadcast', 'bool', [param('bool', 'allowBroadcast')], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): void ns3::Socket::SetCloseCallbacks(ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> normalClose, ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> errorClose) [member function] cls.add_method('SetCloseCallbacks', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'normalClose'), param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'errorClose')]) ## socket.h (module 'network'): void ns3::Socket::SetConnectCallback(ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> connectionSucceeded, ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> connectionFailed) [member function] cls.add_method('SetConnectCallback', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'connectionSucceeded'), param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'connectionFailed')]) ## socket.h (module 'network'): void ns3::Socket::SetDataSentCallback(ns3::Callback<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> dataSent) [member function] cls.add_method('SetDataSentCallback', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'dataSent')]) ## socket.h (module 'network'): void ns3::Socket::SetRecvCallback(ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> arg0) [member function] cls.add_method('SetRecvCallback', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'arg0')]) ## socket.h (module 'network'): void ns3::Socket::SetRecvPktInfo(bool flag) [member function] cls.add_method('SetRecvPktInfo', 'void', [param('bool', 'flag')]) ## socket.h (module 'network'): void ns3::Socket::SetSendCallback(ns3::Callback<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> sendCb) [member function] cls.add_method('SetSendCallback', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'sendCb')]) ## socket.h (module 'network'): int ns3::Socket::ShutdownRecv() [member function] cls.add_method('ShutdownRecv', 'int', [], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): int ns3::Socket::ShutdownSend() [member function] cls.add_method('ShutdownSend', 'int', [], is_pure_virtual=True, is_virtual=True) ## socket.h (module 'network'): void ns3::Socket::DoDispose() [member function] cls.add_method('DoDispose', 'void', [], visibility='protected', is_virtual=True) ## socket.h (module 'network'): void ns3::Socket::NotifyConnectionFailed() [member function] cls.add_method('NotifyConnectionFailed', 'void', [], visibility='protected') ## socket.h (module 'network'): bool ns3::Socket::NotifyConnectionRequest(ns3::Address const & from) [member function] cls.add_method('NotifyConnectionRequest', 'bool', [param('ns3::Address const &', 'from')], visibility='protected') ## socket.h (module 'network'): void ns3::Socket::NotifyConnectionSucceeded() [member function] cls.add_method('NotifyConnectionSucceeded', 'void', [], visibility='protected') ## socket.h (module 'network'): void ns3::Socket::NotifyDataRecv() [member function] cls.add_method('NotifyDataRecv', 'void', [], visibility='protected') ## socket.h (module 'network'): void ns3::Socket::NotifyDataSent(uint32_t size) [member function] cls.add_method('NotifyDataSent', 'void', [param('uint32_t', 'size')], visibility='protected') ## socket.h (module 'network'): void ns3::Socket::NotifyErrorClose() [member function] cls.add_method('NotifyErrorClose', 'void', [], visibility='protected') ## socket.h (module 'network'): void ns3::Socket::NotifyNewConnectionCreated(ns3::Ptr<ns3::Socket> socket, ns3::Address const & from) [member function] cls.add_method('NotifyNewConnectionCreated', 'void', [param('ns3::Ptr< ns3::Socket >', 'socket'), param('ns3::Address const &', 'from')], visibility='protected') ## socket.h (module 'network'): void ns3::Socket::NotifyNormalClose() [member function] cls.add_method('NotifyNormalClose', 'void', [], visibility='protected') ## socket.h (module 'network'): void ns3::Socket::NotifySend(uint32_t spaceAvailable) [member function] cls.add_method('NotifySend', 'void', [param('uint32_t', 'spaceAvailable')], visibility='protected') return def register_Ns3SocketAddressTag_methods(root_module, cls): ## socket.h (module 'network'): ns3::SocketAddressTag::SocketAddressTag(ns3::SocketAddressTag const & arg0) [copy constructor] cls.add_constructor([param('ns3::SocketAddressTag const &', 'arg0')]) ## socket.h (module 'network'): ns3::SocketAddressTag::SocketAddressTag() [constructor] cls.add_constructor([]) ## socket.h (module 'network'): void ns3::SocketAddressTag::Deserialize(ns3::TagBuffer i) [member function] cls.add_method('Deserialize', 'void', [param('ns3::TagBuffer', 'i')], is_virtual=True) ## socket.h (module 'network'): ns3::Address ns3::SocketAddressTag::GetAddress() const [member function] cls.add_method('GetAddress', 'ns3::Address', [], is_const=True) ## socket.h (module 'network'): ns3::TypeId ns3::SocketAddressTag::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## socket.h (module 'network'): uint32_t ns3::SocketAddressTag::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## socket.h (module 'network'): static ns3::TypeId ns3::SocketAddressTag::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## socket.h (module 'network'): void ns3::SocketAddressTag::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## socket.h (module 'network'): void ns3::SocketAddressTag::Serialize(ns3::TagBuffer i) const [member function] cls.add_method('Serialize', 'void', [param('ns3::TagBuffer', 'i')], is_const=True, is_virtual=True) ## socket.h (module 'network'): void ns3::SocketAddressTag::SetAddress(ns3::Address addr) [member function] cls.add_method('SetAddress', 'void', [param('ns3::Address', 'addr')]) return def register_Ns3SocketFactory_methods(root_module, cls): ## socket-factory.h (module 'network'): ns3::SocketFactory::SocketFactory(ns3::SocketFactory const & arg0) [copy constructor] cls.add_constructor([param('ns3::SocketFactory const &', 'arg0')]) ## socket-factory.h (module 'network'): ns3::SocketFactory::SocketFactory() [constructor] cls.add_constructor([]) ## socket-factory.h (module 'network'): ns3::Ptr<ns3::Socket> ns3::SocketFactory::CreateSocket() [member function] cls.add_method('CreateSocket', 'ns3::Ptr< ns3::Socket >', [], is_pure_virtual=True, is_virtual=True) ## socket-factory.h (module 'network'): static ns3::TypeId ns3::SocketFactory::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) return def register_Ns3SocketIpTtlTag_methods(root_module, cls): ## socket.h (module 'network'): ns3::SocketIpTtlTag::SocketIpTtlTag(ns3::SocketIpTtlTag const & arg0) [copy constructor] cls.add_constructor([param('ns3::SocketIpTtlTag const &', 'arg0')]) ## socket.h (module 'network'): ns3::SocketIpTtlTag::SocketIpTtlTag() [constructor] cls.add_constructor([]) ## socket.h (module 'network'): void ns3::SocketIpTtlTag::Deserialize(ns3::TagBuffer i) [member function] cls.add_method('Deserialize', 'void', [param('ns3::TagBuffer', 'i')], is_virtual=True) ## socket.h (module 'network'): ns3::TypeId ns3::SocketIpTtlTag::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## socket.h (module 'network'): uint32_t ns3::SocketIpTtlTag::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## socket.h (module 'network'): uint8_t ns3::SocketIpTtlTag::GetTtl() const [member function] cls.add_method('GetTtl', 'uint8_t', [], is_const=True) ## socket.h (module 'network'): static ns3::TypeId ns3::SocketIpTtlTag::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## socket.h (module 'network'): void ns3::SocketIpTtlTag::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## socket.h (module 'network'): void ns3::SocketIpTtlTag::Serialize(ns3::TagBuffer i) const [member function] cls.add_method('Serialize', 'void', [param('ns3::TagBuffer', 'i')], is_const=True, is_virtual=True) ## socket.h (module 'network'): void ns3::SocketIpTtlTag::SetTtl(uint8_t ttl) [member function] cls.add_method('SetTtl', 'void', [param('uint8_t', 'ttl')]) return def register_Ns3SocketSetDontFragmentTag_methods(root_module, cls): ## socket.h (module 'network'): ns3::SocketSetDontFragmentTag::SocketSetDontFragmentTag(ns3::SocketSetDontFragmentTag const & arg0) [copy constructor] cls.add_constructor([param('ns3::SocketSetDontFragmentTag const &', 'arg0')]) ## socket.h (module 'network'): ns3::SocketSetDontFragmentTag::SocketSetDontFragmentTag() [constructor] cls.add_constructor([]) ## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Deserialize(ns3::TagBuffer i) [member function] cls.add_method('Deserialize', 'void', [param('ns3::TagBuffer', 'i')], is_virtual=True) ## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Disable() [member function] cls.add_method('Disable', 'void', []) ## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Enable() [member function] cls.add_method('Enable', 'void', []) ## socket.h (module 'network'): ns3::TypeId ns3::SocketSetDontFragmentTag::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## socket.h (module 'network'): uint32_t ns3::SocketSetDontFragmentTag::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## socket.h (module 'network'): static ns3::TypeId ns3::SocketSetDontFragmentTag::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## socket.h (module 'network'): bool ns3::SocketSetDontFragmentTag::IsEnabled() const [member function] cls.add_method('IsEnabled', 'bool', [], is_const=True) ## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Serialize(ns3::TagBuffer i) const [member function] cls.add_method('Serialize', 'void', [param('ns3::TagBuffer', 'i')], is_const=True, is_virtual=True) return def register_Ns3Time_methods(root_module, cls): cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right')) cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right')) cls.add_binary_comparison_operator('<') cls.add_binary_comparison_operator('>') cls.add_binary_comparison_operator('!=') cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', 'right')) cls.add_inplace_numeric_operator('-=', param('ns3::Time const &', 'right')) cls.add_output_stream_operator() cls.add_binary_comparison_operator('<=') cls.add_binary_comparison_operator('==') cls.add_binary_comparison_operator('>=') ## nstime.h (module 'core'): ns3::Time::Time() [constructor] cls.add_constructor([]) ## nstime.h (module 'core'): ns3::Time::Time(ns3::Time const & o) [copy constructor] cls.add_constructor([param('ns3::Time const &', 'o')]) ## nstime.h (module 'core'): ns3::Time::Time(double v) [constructor] cls.add_constructor([param('double', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(int v) [constructor] cls.add_constructor([param('int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long int v) [constructor] cls.add_constructor([param('long int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long int v) [constructor] cls.add_constructor([param('long long int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(unsigned int v) [constructor] cls.add_constructor([param('unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long unsigned int v) [constructor] cls.add_constructor([param('long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor] cls.add_constructor([param('long long unsigned int', 'v')]) ## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor] cls.add_constructor([param('std::string const &', 's')]) ## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & value) [constructor] cls.add_constructor([param('ns3::int64x64_t const &', 'value')]) ## nstime.h (module 'core'): int ns3::Time::Compare(ns3::Time const & o) const [member function] cls.add_method('Compare', 'int', [param('ns3::Time const &', 'o')], is_const=True) ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & from, ns3::Time::Unit timeUnit) [member function] cls.add_method('From', 'ns3::Time', [param('ns3::int64x64_t const &', 'from'), param('ns3::Time::Unit', 'timeUnit')], is_static=True) ## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function] cls.add_method('From', 'ns3::Time', [param('ns3::int64x64_t const &', 'value')], is_static=True) ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit timeUnit) [member function] cls.add_method('FromDouble', 'ns3::Time', [param('double', 'value'), param('ns3::Time::Unit', 'timeUnit')], is_static=True) ## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit timeUnit) [member function] cls.add_method('FromInteger', 'ns3::Time', [param('uint64_t', 'value'), param('ns3::Time::Unit', 'timeUnit')], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetDouble() const [member function] cls.add_method('GetDouble', 'double', [], is_const=True) ## nstime.h (module 'core'): int64_t ns3::Time::GetFemtoSeconds() const [member function] cls.add_method('GetFemtoSeconds', 'int64_t', [], is_const=True) ## nstime.h (module 'core'): int64_t ns3::Time::GetInteger() const [member function] cls.add_method('GetInteger', 'int64_t', [], is_const=True) ## nstime.h (module 'core'): int64_t ns3::Time::GetMicroSeconds() const [member function] cls.add_method('GetMicroSeconds', 'int64_t', [], is_const=True) ## nstime.h (module 'core'): int64_t ns3::Time::GetMilliSeconds() const [member function] cls.add_method('GetMilliSeconds', 'int64_t', [], is_const=True) ## nstime.h (module 'core'): int64_t ns3::Time::GetNanoSeconds() const [member function] cls.add_method('GetNanoSeconds', 'int64_t', [], is_const=True) ## nstime.h (module 'core'): int64_t ns3::Time::GetPicoSeconds() const [member function] cls.add_method('GetPicoSeconds', 'int64_t', [], is_const=True) ## nstime.h (module 'core'): static ns3::Time::Unit ns3::Time::GetResolution() [member function] cls.add_method('GetResolution', 'ns3::Time::Unit', [], is_static=True) ## nstime.h (module 'core'): double ns3::Time::GetSeconds() const [member function] cls.add_method('GetSeconds', 'double', [], is_const=True) ## nstime.h (module 'core'): int64_t ns3::Time::GetTimeStep() const [member function] cls.add_method('GetTimeStep', 'int64_t', [], is_const=True) ## nstime.h (module 'core'): bool ns3::Time::IsNegative() const [member function] cls.add_method('IsNegative', 'bool', [], is_const=True) ## nstime.h (module 'core'): bool ns3::Time::IsPositive() const [member function] cls.add_method('IsPositive', 'bool', [], is_const=True) ## nstime.h (module 'core'): bool ns3::Time::IsStrictlyNegative() const [member function] cls.add_method('IsStrictlyNegative', 'bool', [], is_const=True) ## nstime.h (module 'core'): bool ns3::Time::IsStrictlyPositive() const [member function] cls.add_method('IsStrictlyPositive', 'bool', [], is_const=True) ## nstime.h (module 'core'): bool ns3::Time::IsZero() const [member function] cls.add_method('IsZero', 'bool', [], is_const=True) ## nstime.h (module 'core'): static void ns3::Time::SetResolution(ns3::Time::Unit resolution) [member function] cls.add_method('SetResolution', 'void', [param('ns3::Time::Unit', 'resolution')], is_static=True) ## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit timeUnit) const [member function] cls.add_method('To', 'ns3::int64x64_t', [param('ns3::Time::Unit', 'timeUnit')], is_const=True) ## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit timeUnit) const [member function] cls.add_method('ToDouble', 'double', [param('ns3::Time::Unit', 'timeUnit')], is_const=True) ## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit timeUnit) const [member function] cls.add_method('ToInteger', 'int64_t', [param('ns3::Time::Unit', 'timeUnit')], is_const=True) return def register_Ns3TraceSourceAccessor_methods(root_module, cls): ## trace-source-accessor.h (module 'core'): ns3::TraceSourceAccessor::TraceSourceAccessor(ns3::TraceSourceAccessor const & arg0) [copy constructor] cls.add_constructor([param('ns3::TraceSourceAccessor const &', 'arg0')]) ## trace-source-accessor.h (module 'core'): ns3::TraceSourceAccessor::TraceSourceAccessor() [constructor] cls.add_constructor([]) ## trace-source-accessor.h (module 'core'): bool ns3::TraceSourceAccessor::Connect(ns3::ObjectBase * obj, std::string context, ns3::CallbackBase const & cb) const [member function] cls.add_method('Connect', 'bool', [param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')], is_pure_virtual=True, is_const=True, is_virtual=True) ## trace-source-accessor.h (module 'core'): bool ns3::TraceSourceAccessor::ConnectWithoutContext(ns3::ObjectBase * obj, ns3::CallbackBase const & cb) const [member function] cls.add_method('ConnectWithoutContext', 'bool', [param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('ns3::CallbackBase const &', 'cb')], is_pure_virtual=True, is_const=True, is_virtual=True) ## trace-source-accessor.h (module 'core'): bool ns3::TraceSourceAccessor::Disconnect(ns3::ObjectBase * obj, std::string context, ns3::CallbackBase const & cb) const [member function] cls.add_method('Disconnect', 'bool', [param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')], is_pure_virtual=True, is_const=True, is_virtual=True) ## trace-source-accessor.h (module 'core'): bool ns3::TraceSourceAccessor::DisconnectWithoutContext(ns3::ObjectBase * obj, ns3::CallbackBase const & cb) const [member function] cls.add_method('DisconnectWithoutContext', 'bool', [param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('ns3::CallbackBase const &', 'cb')], is_pure_virtual=True, is_const=True, is_virtual=True) return def register_Ns3Trailer_methods(root_module, cls): cls.add_output_stream_operator() ## trailer.h (module 'network'): ns3::Trailer::Trailer() [constructor] cls.add_constructor([]) ## trailer.h (module 'network'): ns3::Trailer::Trailer(ns3::Trailer const & arg0) [copy constructor] cls.add_constructor([param('ns3::Trailer const &', 'arg0')]) ## trailer.h (module 'network'): uint32_t ns3::Trailer::Deserialize(ns3::Buffer::Iterator end) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'end')], is_pure_virtual=True, is_virtual=True) ## trailer.h (module 'network'): uint32_t ns3::Trailer::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## trailer.h (module 'network'): static ns3::TypeId ns3::Trailer::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## trailer.h (module 'network'): void ns3::Trailer::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_pure_virtual=True, is_const=True, is_virtual=True) ## trailer.h (module 'network'): void ns3::Trailer::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_pure_virtual=True, is_const=True, is_virtual=True) return def register_Ns3Application_methods(root_module, cls): ## application.h (module 'network'): ns3::Application::Application(ns3::Application const & arg0) [copy constructor] cls.add_constructor([param('ns3::Application const &', 'arg0')]) ## application.h (module 'network'): ns3::Application::Application() [constructor] cls.add_constructor([]) ## application.h (module 'network'): ns3::Ptr<ns3::Node> ns3::Application::GetNode() const [member function] cls.add_method('GetNode', 'ns3::Ptr< ns3::Node >', [], is_const=True) ## application.h (module 'network'): static ns3::TypeId ns3::Application::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## application.h (module 'network'): void ns3::Application::SetNode(ns3::Ptr<ns3::Node> node) [member function] cls.add_method('SetNode', 'void', [param('ns3::Ptr< ns3::Node >', 'node')]) ## application.h (module 'network'): void ns3::Application::SetStartTime(ns3::Time start) [member function] cls.add_method('SetStartTime', 'void', [param('ns3::Time', 'start')]) ## application.h (module 'network'): void ns3::Application::SetStopTime(ns3::Time stop) [member function] cls.add_method('SetStopTime', 'void', [param('ns3::Time', 'stop')]) ## application.h (module 'network'): void ns3::Application::DoDispose() [member function] cls.add_method('DoDispose', 'void', [], visibility='protected', is_virtual=True) ## application.h (module 'network'): void ns3::Application::DoStart() [member function] cls.add_method('DoStart', 'void', [], visibility='protected', is_virtual=True) ## application.h (module 'network'): void ns3::Application::StartApplication() [member function] cls.add_method('StartApplication', 'void', [], visibility='private', is_virtual=True) ## application.h (module 'network'): void ns3::Application::StopApplication() [member function] cls.add_method('StopApplication', 'void', [], visibility='private', is_virtual=True) return def register_Ns3AttributeAccessor_methods(root_module, cls): ## attribute.h (module 'core'): ns3::AttributeAccessor::AttributeAccessor(ns3::AttributeAccessor const & arg0) [copy constructor] cls.add_constructor([param('ns3::AttributeAccessor const &', 'arg0')]) ## attribute.h (module 'core'): ns3::AttributeAccessor::AttributeAccessor() [constructor] cls.add_constructor([]) ## attribute.h (module 'core'): bool ns3::AttributeAccessor::Get(ns3::ObjectBase const * object, ns3::AttributeValue & attribute) const [member function] cls.add_method('Get', 'bool', [param('ns3::ObjectBase const *', 'object'), param('ns3::AttributeValue &', 'attribute')], is_pure_virtual=True, is_const=True, is_virtual=True) ## attribute.h (module 'core'): bool ns3::AttributeAccessor::HasGetter() const [member function] cls.add_method('HasGetter', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## attribute.h (module 'core'): bool ns3::AttributeAccessor::HasSetter() const [member function] cls.add_method('HasSetter', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## attribute.h (module 'core'): bool ns3::AttributeAccessor::Set(ns3::ObjectBase * object, ns3::AttributeValue const & value) const [member function] cls.add_method('Set', 'bool', [param('ns3::ObjectBase *', 'object', transfer_ownership=False), param('ns3::AttributeValue const &', 'value')], is_pure_virtual=True, is_const=True, is_virtual=True) return def register_Ns3AttributeChecker_methods(root_module, cls): ## attribute.h (module 'core'): ns3::AttributeChecker::AttributeChecker(ns3::AttributeChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::AttributeChecker const &', 'arg0')]) ## attribute.h (module 'core'): ns3::AttributeChecker::AttributeChecker() [constructor] cls.add_constructor([]) ## attribute.h (module 'core'): bool ns3::AttributeChecker::Check(ns3::AttributeValue const & value) const [member function] cls.add_method('Check', 'bool', [param('ns3::AttributeValue const &', 'value')], is_pure_virtual=True, is_const=True, is_virtual=True) ## attribute.h (module 'core'): bool ns3::AttributeChecker::Copy(ns3::AttributeValue const & source, ns3::AttributeValue & destination) const [member function] cls.add_method('Copy', 'bool', [param('ns3::AttributeValue const &', 'source'), param('ns3::AttributeValue &', 'destination')], is_pure_virtual=True, is_const=True, is_virtual=True) ## attribute.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::AttributeChecker::Create() const [member function] cls.add_method('Create', 'ns3::Ptr< ns3::AttributeValue >', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## attribute.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::AttributeChecker::CreateValidValue(ns3::AttributeValue const & value) const [member function] cls.add_method('CreateValidValue', 'ns3::Ptr< ns3::AttributeValue >', [param('ns3::AttributeValue const &', 'value')], is_const=True) ## attribute.h (module 'core'): std::string ns3::AttributeChecker::GetUnderlyingTypeInformation() const [member function] cls.add_method('GetUnderlyingTypeInformation', 'std::string', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## attribute.h (module 'core'): std::string ns3::AttributeChecker::GetValueTypeName() const [member function] cls.add_method('GetValueTypeName', 'std::string', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## attribute.h (module 'core'): bool ns3::AttributeChecker::HasUnderlyingTypeInformation() const [member function] cls.add_method('HasUnderlyingTypeInformation', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) return def register_Ns3AttributeValue_methods(root_module, cls): ## attribute.h (module 'core'): ns3::AttributeValue::AttributeValue(ns3::AttributeValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::AttributeValue const &', 'arg0')]) ## attribute.h (module 'core'): ns3::AttributeValue::AttributeValue() [constructor] cls.add_constructor([]) ## attribute.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::AttributeValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## attribute.h (module 'core'): bool ns3::AttributeValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_pure_virtual=True, is_virtual=True) ## attribute.h (module 'core'): std::string ns3::AttributeValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_pure_virtual=True, is_const=True, is_virtual=True) return def register_Ns3BooleanChecker_methods(root_module, cls): ## boolean.h (module 'core'): ns3::BooleanChecker::BooleanChecker() [constructor] cls.add_constructor([]) ## boolean.h (module 'core'): ns3::BooleanChecker::BooleanChecker(ns3::BooleanChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::BooleanChecker const &', 'arg0')]) return def register_Ns3BooleanValue_methods(root_module, cls): cls.add_output_stream_operator() ## boolean.h (module 'core'): ns3::BooleanValue::BooleanValue(ns3::BooleanValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::BooleanValue const &', 'arg0')]) ## boolean.h (module 'core'): ns3::BooleanValue::BooleanValue() [constructor] cls.add_constructor([]) ## boolean.h (module 'core'): ns3::BooleanValue::BooleanValue(bool value) [constructor] cls.add_constructor([param('bool', 'value')]) ## boolean.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::BooleanValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## boolean.h (module 'core'): bool ns3::BooleanValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## boolean.h (module 'core'): bool ns3::BooleanValue::Get() const [member function] cls.add_method('Get', 'bool', [], is_const=True) ## boolean.h (module 'core'): std::string ns3::BooleanValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## boolean.h (module 'core'): void ns3::BooleanValue::Set(bool value) [member function] cls.add_method('Set', 'void', [param('bool', 'value')]) return def register_Ns3CallbackChecker_methods(root_module, cls): ## callback.h (module 'core'): ns3::CallbackChecker::CallbackChecker() [constructor] cls.add_constructor([]) ## callback.h (module 'core'): ns3::CallbackChecker::CallbackChecker(ns3::CallbackChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::CallbackChecker const &', 'arg0')]) return def register_Ns3CallbackImplBase_methods(root_module, cls): ## callback.h (module 'core'): ns3::CallbackImplBase::CallbackImplBase() [constructor] cls.add_constructor([]) ## callback.h (module 'core'): ns3::CallbackImplBase::CallbackImplBase(ns3::CallbackImplBase const & arg0) [copy constructor] cls.add_constructor([param('ns3::CallbackImplBase const &', 'arg0')]) ## callback.h (module 'core'): bool ns3::CallbackImplBase::IsEqual(ns3::Ptr<ns3::CallbackImplBase const> other) const [member function] cls.add_method('IsEqual', 'bool', [param('ns3::Ptr< ns3::CallbackImplBase const >', 'other')], is_pure_virtual=True, is_const=True, is_virtual=True) return def register_Ns3CallbackValue_methods(root_module, cls): ## callback.h (module 'core'): ns3::CallbackValue::CallbackValue(ns3::CallbackValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::CallbackValue const &', 'arg0')]) ## callback.h (module 'core'): ns3::CallbackValue::CallbackValue() [constructor] cls.add_constructor([]) ## callback.h (module 'core'): ns3::CallbackValue::CallbackValue(ns3::CallbackBase const & base) [constructor] cls.add_constructor([param('ns3::CallbackBase const &', 'base')]) ## callback.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::CallbackValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## callback.h (module 'core'): bool ns3::CallbackValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## callback.h (module 'core'): std::string ns3::CallbackValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## callback.h (module 'core'): void ns3::CallbackValue::Set(ns3::CallbackBase base) [member function] cls.add_method('Set', 'void', [param('ns3::CallbackBase', 'base')]) return def register_Ns3Channel_methods(root_module, cls): ## channel.h (module 'network'): ns3::Channel::Channel(ns3::Channel const & arg0) [copy constructor] cls.add_constructor([param('ns3::Channel const &', 'arg0')]) ## channel.h (module 'network'): ns3::Channel::Channel() [constructor] cls.add_constructor([]) ## channel.h (module 'network'): ns3::Ptr<ns3::NetDevice> ns3::Channel::GetDevice(uint32_t i) const [member function] cls.add_method('GetDevice', 'ns3::Ptr< ns3::NetDevice >', [param('uint32_t', 'i')], is_pure_virtual=True, is_const=True, is_virtual=True) ## channel.h (module 'network'): uint32_t ns3::Channel::GetId() const [member function] cls.add_method('GetId', 'uint32_t', [], is_const=True) ## channel.h (module 'network'): uint32_t ns3::Channel::GetNDevices() const [member function] cls.add_method('GetNDevices', 'uint32_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## channel.h (module 'network'): static ns3::TypeId ns3::Channel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) return def register_Ns3DataRateChecker_methods(root_module, cls): ## data-rate.h (module 'network'): ns3::DataRateChecker::DataRateChecker() [constructor] cls.add_constructor([]) ## data-rate.h (module 'network'): ns3::DataRateChecker::DataRateChecker(ns3::DataRateChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::DataRateChecker const &', 'arg0')]) return def register_Ns3DataRateValue_methods(root_module, cls): ## data-rate.h (module 'network'): ns3::DataRateValue::DataRateValue() [constructor] cls.add_constructor([]) ## data-rate.h (module 'network'): ns3::DataRateValue::DataRateValue(ns3::DataRateValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::DataRateValue const &', 'arg0')]) ## data-rate.h (module 'network'): ns3::DataRateValue::DataRateValue(ns3::DataRate const & value) [constructor] cls.add_constructor([param('ns3::DataRate const &', 'value')]) ## data-rate.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::DataRateValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## data-rate.h (module 'network'): bool ns3::DataRateValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## data-rate.h (module 'network'): ns3::DataRate ns3::DataRateValue::Get() const [member function] cls.add_method('Get', 'ns3::DataRate', [], is_const=True) ## data-rate.h (module 'network'): std::string ns3::DataRateValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## data-rate.h (module 'network'): void ns3::DataRateValue::Set(ns3::DataRate const & value) [member function] cls.add_method('Set', 'void', [param('ns3::DataRate const &', 'value')]) return def register_Ns3DropTailQueue_methods(root_module, cls): ## drop-tail-queue.h (module 'network'): ns3::DropTailQueue::DropTailQueue(ns3::DropTailQueue const & arg0) [copy constructor] cls.add_constructor([param('ns3::DropTailQueue const &', 'arg0')]) ## drop-tail-queue.h (module 'network'): ns3::DropTailQueue::DropTailQueue() [constructor] cls.add_constructor([]) ## drop-tail-queue.h (module 'network'): ns3::Queue::QueueMode ns3::DropTailQueue::GetMode() [member function] cls.add_method('GetMode', 'ns3::Queue::QueueMode', []) ## drop-tail-queue.h (module 'network'): static ns3::TypeId ns3::DropTailQueue::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## drop-tail-queue.h (module 'network'): void ns3::DropTailQueue::SetMode(ns3::Queue::QueueMode mode) [member function] cls.add_method('SetMode', 'void', [param('ns3::Queue::QueueMode', 'mode')]) ## drop-tail-queue.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::DropTailQueue::DoDequeue() [member function] cls.add_method('DoDequeue', 'ns3::Ptr< ns3::Packet >', [], visibility='private', is_virtual=True) ## drop-tail-queue.h (module 'network'): bool ns3::DropTailQueue::DoEnqueue(ns3::Ptr<ns3::Packet> p) [member function] cls.add_method('DoEnqueue', 'bool', [param('ns3::Ptr< ns3::Packet >', 'p')], visibility='private', is_virtual=True) ## drop-tail-queue.h (module 'network'): ns3::Ptr<const ns3::Packet> ns3::DropTailQueue::DoPeek() const [member function] cls.add_method('DoPeek', 'ns3::Ptr< ns3::Packet const >', [], is_const=True, visibility='private', is_virtual=True) return def register_Ns3EmptyAttributeValue_methods(root_module, cls): ## attribute.h (module 'core'): ns3::EmptyAttributeValue::EmptyAttributeValue(ns3::EmptyAttributeValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::EmptyAttributeValue const &', 'arg0')]) ## attribute.h (module 'core'): ns3::EmptyAttributeValue::EmptyAttributeValue() [constructor] cls.add_constructor([]) ## attribute.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::EmptyAttributeValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, visibility='private', is_virtual=True) ## attribute.h (module 'core'): bool ns3::EmptyAttributeValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], visibility='private', is_virtual=True) ## attribute.h (module 'core'): std::string ns3::EmptyAttributeValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, visibility='private', is_virtual=True) return def register_Ns3ErrorModel_methods(root_module, cls): ## error-model.h (module 'network'): ns3::ErrorModel::ErrorModel(ns3::ErrorModel const & arg0) [copy constructor] cls.add_constructor([param('ns3::ErrorModel const &', 'arg0')]) ## error-model.h (module 'network'): ns3::ErrorModel::ErrorModel() [constructor] cls.add_constructor([]) ## error-model.h (module 'network'): void ns3::ErrorModel::Disable() [member function] cls.add_method('Disable', 'void', []) ## error-model.h (module 'network'): void ns3::ErrorModel::Enable() [member function] cls.add_method('Enable', 'void', []) ## error-model.h (module 'network'): static ns3::TypeId ns3::ErrorModel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## error-model.h (module 'network'): bool ns3::ErrorModel::IsCorrupt(ns3::Ptr<ns3::Packet> pkt) [member function] cls.add_method('IsCorrupt', 'bool', [param('ns3::Ptr< ns3::Packet >', 'pkt')]) ## error-model.h (module 'network'): bool ns3::ErrorModel::IsEnabled() const [member function] cls.add_method('IsEnabled', 'bool', [], is_const=True) ## error-model.h (module 'network'): void ns3::ErrorModel::Reset() [member function] cls.add_method('Reset', 'void', []) ## error-model.h (module 'network'): bool ns3::ErrorModel::DoCorrupt(ns3::Ptr<ns3::Packet> arg0) [member function] cls.add_method('DoCorrupt', 'bool', [param('ns3::Ptr< ns3::Packet >', 'arg0')], is_pure_virtual=True, visibility='private', is_virtual=True) ## error-model.h (module 'network'): void ns3::ErrorModel::DoReset() [member function] cls.add_method('DoReset', 'void', [], is_pure_virtual=True, visibility='private', is_virtual=True) return def register_Ns3EthernetHeader_methods(root_module, cls): ## ethernet-header.h (module 'network'): ns3::EthernetHeader::EthernetHeader(ns3::EthernetHeader const & arg0) [copy constructor] cls.add_constructor([param('ns3::EthernetHeader const &', 'arg0')]) ## ethernet-header.h (module 'network'): ns3::EthernetHeader::EthernetHeader(bool hasPreamble) [constructor] cls.add_constructor([param('bool', 'hasPreamble')]) ## ethernet-header.h (module 'network'): ns3::EthernetHeader::EthernetHeader() [constructor] cls.add_constructor([]) ## ethernet-header.h (module 'network'): uint32_t ns3::EthernetHeader::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) ## ethernet-header.h (module 'network'): ns3::Mac48Address ns3::EthernetHeader::GetDestination() const [member function] cls.add_method('GetDestination', 'ns3::Mac48Address', [], is_const=True) ## ethernet-header.h (module 'network'): uint32_t ns3::EthernetHeader::GetHeaderSize() const [member function] cls.add_method('GetHeaderSize', 'uint32_t', [], is_const=True) ## ethernet-header.h (module 'network'): ns3::TypeId ns3::EthernetHeader::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## ethernet-header.h (module 'network'): uint16_t ns3::EthernetHeader::GetLengthType() const [member function] cls.add_method('GetLengthType', 'uint16_t', [], is_const=True) ## ethernet-header.h (module 'network'): ns3::ethernet_header_t ns3::EthernetHeader::GetPacketType() const [member function] cls.add_method('GetPacketType', 'ns3::ethernet_header_t', [], is_const=True) ## ethernet-header.h (module 'network'): uint64_t ns3::EthernetHeader::GetPreambleSfd() const [member function] cls.add_method('GetPreambleSfd', 'uint64_t', [], is_const=True) ## ethernet-header.h (module 'network'): uint32_t ns3::EthernetHeader::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## ethernet-header.h (module 'network'): ns3::Mac48Address ns3::EthernetHeader::GetSource() const [member function] cls.add_method('GetSource', 'ns3::Mac48Address', [], is_const=True) ## ethernet-header.h (module 'network'): static ns3::TypeId ns3::EthernetHeader::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## ethernet-header.h (module 'network'): void ns3::EthernetHeader::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## ethernet-header.h (module 'network'): void ns3::EthernetHeader::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) ## ethernet-header.h (module 'network'): void ns3::EthernetHeader::SetDestination(ns3::Mac48Address destination) [member function] cls.add_method('SetDestination', 'void', [param('ns3::Mac48Address', 'destination')]) ## ethernet-header.h (module 'network'): void ns3::EthernetHeader::SetLengthType(uint16_t size) [member function] cls.add_method('SetLengthType', 'void', [param('uint16_t', 'size')]) ## ethernet-header.h (module 'network'): void ns3::EthernetHeader::SetPreambleSfd(uint64_t preambleSfd) [member function] cls.add_method('SetPreambleSfd', 'void', [param('uint64_t', 'preambleSfd')]) ## ethernet-header.h (module 'network'): void ns3::EthernetHeader::SetSource(ns3::Mac48Address source) [member function] cls.add_method('SetSource', 'void', [param('ns3::Mac48Address', 'source')]) return def register_Ns3EthernetTrailer_methods(root_module, cls): ## ethernet-trailer.h (module 'network'): ns3::EthernetTrailer::EthernetTrailer(ns3::EthernetTrailer const & arg0) [copy constructor] cls.add_constructor([param('ns3::EthernetTrailer const &', 'arg0')]) ## ethernet-trailer.h (module 'network'): ns3::EthernetTrailer::EthernetTrailer() [constructor] cls.add_constructor([]) ## ethernet-trailer.h (module 'network'): void ns3::EthernetTrailer::CalcFcs(ns3::Ptr<const ns3::Packet> p) [member function] cls.add_method('CalcFcs', 'void', [param('ns3::Ptr< ns3::Packet const >', 'p')]) ## ethernet-trailer.h (module 'network'): bool ns3::EthernetTrailer::CheckFcs(ns3::Ptr<const ns3::Packet> p) const [member function] cls.add_method('CheckFcs', 'bool', [param('ns3::Ptr< ns3::Packet const >', 'p')], is_const=True) ## ethernet-trailer.h (module 'network'): uint32_t ns3::EthernetTrailer::Deserialize(ns3::Buffer::Iterator end) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'end')], is_virtual=True) ## ethernet-trailer.h (module 'network'): void ns3::EthernetTrailer::EnableFcs(bool enable) [member function] cls.add_method('EnableFcs', 'void', [param('bool', 'enable')]) ## ethernet-trailer.h (module 'network'): uint32_t ns3::EthernetTrailer::GetFcs() [member function] cls.add_method('GetFcs', 'uint32_t', []) ## ethernet-trailer.h (module 'network'): ns3::TypeId ns3::EthernetTrailer::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## ethernet-trailer.h (module 'network'): uint32_t ns3::EthernetTrailer::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## ethernet-trailer.h (module 'network'): uint32_t ns3::EthernetTrailer::GetTrailerSize() const [member function] cls.add_method('GetTrailerSize', 'uint32_t', [], is_const=True) ## ethernet-trailer.h (module 'network'): static ns3::TypeId ns3::EthernetTrailer::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## ethernet-trailer.h (module 'network'): void ns3::EthernetTrailer::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## ethernet-trailer.h (module 'network'): void ns3::EthernetTrailer::Serialize(ns3::Buffer::Iterator end) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'end')], is_const=True, is_virtual=True) ## ethernet-trailer.h (module 'network'): void ns3::EthernetTrailer::SetFcs(uint32_t fcs) [member function] cls.add_method('SetFcs', 'void', [param('uint32_t', 'fcs')]) return def register_Ns3EventImpl_methods(root_module, cls): ## event-impl.h (module 'core'): ns3::EventImpl::EventImpl(ns3::EventImpl const & arg0) [copy constructor] cls.add_constructor([param('ns3::EventImpl const &', 'arg0')]) ## event-impl.h (module 'core'): ns3::EventImpl::EventImpl() [constructor] cls.add_constructor([]) ## event-impl.h (module 'core'): void ns3::EventImpl::Cancel() [member function] cls.add_method('Cancel', 'void', []) ## event-impl.h (module 'core'): void ns3::EventImpl::Invoke() [member function] cls.add_method('Invoke', 'void', []) ## event-impl.h (module 'core'): bool ns3::EventImpl::IsCancelled() [member function] cls.add_method('IsCancelled', 'bool', []) ## event-impl.h (module 'core'): void ns3::EventImpl::Notify() [member function] cls.add_method('Notify', 'void', [], is_pure_virtual=True, visibility='protected', is_virtual=True) return def register_Ns3Ipv4AddressChecker_methods(root_module, cls): ## ipv4-address.h (module 'network'): ns3::Ipv4AddressChecker::Ipv4AddressChecker() [constructor] cls.add_constructor([]) ## ipv4-address.h (module 'network'): ns3::Ipv4AddressChecker::Ipv4AddressChecker(ns3::Ipv4AddressChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv4AddressChecker const &', 'arg0')]) return def register_Ns3Ipv4AddressValue_methods(root_module, cls): ## ipv4-address.h (module 'network'): ns3::Ipv4AddressValue::Ipv4AddressValue() [constructor] cls.add_constructor([]) ## ipv4-address.h (module 'network'): ns3::Ipv4AddressValue::Ipv4AddressValue(ns3::Ipv4AddressValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv4AddressValue const &', 'arg0')]) ## ipv4-address.h (module 'network'): ns3::Ipv4AddressValue::Ipv4AddressValue(ns3::Ipv4Address const & value) [constructor] cls.add_constructor([param('ns3::Ipv4Address const &', 'value')]) ## ipv4-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Ipv4AddressValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## ipv4-address.h (module 'network'): bool ns3::Ipv4AddressValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## ipv4-address.h (module 'network'): ns3::Ipv4Address ns3::Ipv4AddressValue::Get() const [member function] cls.add_method('Get', 'ns3::Ipv4Address', [], is_const=True) ## ipv4-address.h (module 'network'): std::string ns3::Ipv4AddressValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## ipv4-address.h (module 'network'): void ns3::Ipv4AddressValue::Set(ns3::Ipv4Address const & value) [member function] cls.add_method('Set', 'void', [param('ns3::Ipv4Address const &', 'value')]) return def register_Ns3Ipv4MaskChecker_methods(root_module, cls): ## ipv4-address.h (module 'network'): ns3::Ipv4MaskChecker::Ipv4MaskChecker() [constructor] cls.add_constructor([]) ## ipv4-address.h (module 'network'): ns3::Ipv4MaskChecker::Ipv4MaskChecker(ns3::Ipv4MaskChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv4MaskChecker const &', 'arg0')]) return def register_Ns3Ipv4MaskValue_methods(root_module, cls): ## ipv4-address.h (module 'network'): ns3::Ipv4MaskValue::Ipv4MaskValue() [constructor] cls.add_constructor([]) ## ipv4-address.h (module 'network'): ns3::Ipv4MaskValue::Ipv4MaskValue(ns3::Ipv4MaskValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv4MaskValue const &', 'arg0')]) ## ipv4-address.h (module 'network'): ns3::Ipv4MaskValue::Ipv4MaskValue(ns3::Ipv4Mask const & value) [constructor] cls.add_constructor([param('ns3::Ipv4Mask const &', 'value')]) ## ipv4-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Ipv4MaskValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## ipv4-address.h (module 'network'): bool ns3::Ipv4MaskValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## ipv4-address.h (module 'network'): ns3::Ipv4Mask ns3::Ipv4MaskValue::Get() const [member function] cls.add_method('Get', 'ns3::Ipv4Mask', [], is_const=True) ## ipv4-address.h (module 'network'): std::string ns3::Ipv4MaskValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## ipv4-address.h (module 'network'): void ns3::Ipv4MaskValue::Set(ns3::Ipv4Mask const & value) [member function] cls.add_method('Set', 'void', [param('ns3::Ipv4Mask const &', 'value')]) return def register_Ns3Ipv6AddressChecker_methods(root_module, cls): ## ipv6-address.h (module 'network'): ns3::Ipv6AddressChecker::Ipv6AddressChecker() [constructor] cls.add_constructor([]) ## ipv6-address.h (module 'network'): ns3::Ipv6AddressChecker::Ipv6AddressChecker(ns3::Ipv6AddressChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv6AddressChecker const &', 'arg0')]) return def register_Ns3Ipv6AddressValue_methods(root_module, cls): ## ipv6-address.h (module 'network'): ns3::Ipv6AddressValue::Ipv6AddressValue() [constructor] cls.add_constructor([]) ## ipv6-address.h (module 'network'): ns3::Ipv6AddressValue::Ipv6AddressValue(ns3::Ipv6AddressValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv6AddressValue const &', 'arg0')]) ## ipv6-address.h (module 'network'): ns3::Ipv6AddressValue::Ipv6AddressValue(ns3::Ipv6Address const & value) [constructor] cls.add_constructor([param('ns3::Ipv6Address const &', 'value')]) ## ipv6-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Ipv6AddressValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6AddressValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## ipv6-address.h (module 'network'): ns3::Ipv6Address ns3::Ipv6AddressValue::Get() const [member function] cls.add_method('Get', 'ns3::Ipv6Address', [], is_const=True) ## ipv6-address.h (module 'network'): std::string ns3::Ipv6AddressValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## ipv6-address.h (module 'network'): void ns3::Ipv6AddressValue::Set(ns3::Ipv6Address const & value) [member function] cls.add_method('Set', 'void', [param('ns3::Ipv6Address const &', 'value')]) return def register_Ns3Ipv6PrefixChecker_methods(root_module, cls): ## ipv6-address.h (module 'network'): ns3::Ipv6PrefixChecker::Ipv6PrefixChecker() [constructor] cls.add_constructor([]) ## ipv6-address.h (module 'network'): ns3::Ipv6PrefixChecker::Ipv6PrefixChecker(ns3::Ipv6PrefixChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv6PrefixChecker const &', 'arg0')]) return def register_Ns3Ipv6PrefixValue_methods(root_module, cls): ## ipv6-address.h (module 'network'): ns3::Ipv6PrefixValue::Ipv6PrefixValue() [constructor] cls.add_constructor([]) ## ipv6-address.h (module 'network'): ns3::Ipv6PrefixValue::Ipv6PrefixValue(ns3::Ipv6PrefixValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::Ipv6PrefixValue const &', 'arg0')]) ## ipv6-address.h (module 'network'): ns3::Ipv6PrefixValue::Ipv6PrefixValue(ns3::Ipv6Prefix const & value) [constructor] cls.add_constructor([param('ns3::Ipv6Prefix const &', 'value')]) ## ipv6-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Ipv6PrefixValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## ipv6-address.h (module 'network'): bool ns3::Ipv6PrefixValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## ipv6-address.h (module 'network'): ns3::Ipv6Prefix ns3::Ipv6PrefixValue::Get() const [member function] cls.add_method('Get', 'ns3::Ipv6Prefix', [], is_const=True) ## ipv6-address.h (module 'network'): std::string ns3::Ipv6PrefixValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## ipv6-address.h (module 'network'): void ns3::Ipv6PrefixValue::Set(ns3::Ipv6Prefix const & value) [member function] cls.add_method('Set', 'void', [param('ns3::Ipv6Prefix const &', 'value')]) return def register_Ns3ListErrorModel_methods(root_module, cls): ## error-model.h (module 'network'): ns3::ListErrorModel::ListErrorModel(ns3::ListErrorModel const & arg0) [copy constructor] cls.add_constructor([param('ns3::ListErrorModel const &', 'arg0')]) ## error-model.h (module 'network'): ns3::ListErrorModel::ListErrorModel() [constructor] cls.add_constructor([]) ## error-model.h (module 'network'): std::list<unsigned int, std::allocator<unsigned int> > ns3::ListErrorModel::GetList() const [member function] cls.add_method('GetList', 'std::list< unsigned int >', [], is_const=True) ## error-model.h (module 'network'): static ns3::TypeId ns3::ListErrorModel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## error-model.h (module 'network'): void ns3::ListErrorModel::SetList(std::list<unsigned int, std::allocator<unsigned int> > const & packetlist) [member function] cls.add_method('SetList', 'void', [param('std::list< unsigned int > const &', 'packetlist')]) ## error-model.h (module 'network'): bool ns3::ListErrorModel::DoCorrupt(ns3::Ptr<ns3::Packet> p) [member function] cls.add_method('DoCorrupt', 'bool', [param('ns3::Ptr< ns3::Packet >', 'p')], visibility='private', is_virtual=True) ## error-model.h (module 'network'): void ns3::ListErrorModel::DoReset() [member function] cls.add_method('DoReset', 'void', [], visibility='private', is_virtual=True) return def register_Ns3Mac48AddressChecker_methods(root_module, cls): ## mac48-address.h (module 'network'): ns3::Mac48AddressChecker::Mac48AddressChecker() [constructor] cls.add_constructor([]) ## mac48-address.h (module 'network'): ns3::Mac48AddressChecker::Mac48AddressChecker(ns3::Mac48AddressChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::Mac48AddressChecker const &', 'arg0')]) return def register_Ns3Mac48AddressValue_methods(root_module, cls): ## mac48-address.h (module 'network'): ns3::Mac48AddressValue::Mac48AddressValue() [constructor] cls.add_constructor([]) ## mac48-address.h (module 'network'): ns3::Mac48AddressValue::Mac48AddressValue(ns3::Mac48AddressValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::Mac48AddressValue const &', 'arg0')]) ## mac48-address.h (module 'network'): ns3::Mac48AddressValue::Mac48AddressValue(ns3::Mac48Address const & value) [constructor] cls.add_constructor([param('ns3::Mac48Address const &', 'value')]) ## mac48-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Mac48AddressValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## mac48-address.h (module 'network'): bool ns3::Mac48AddressValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## mac48-address.h (module 'network'): ns3::Mac48Address ns3::Mac48AddressValue::Get() const [member function] cls.add_method('Get', 'ns3::Mac48Address', [], is_const=True) ## mac48-address.h (module 'network'): std::string ns3::Mac48AddressValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## mac48-address.h (module 'network'): void ns3::Mac48AddressValue::Set(ns3::Mac48Address const & value) [member function] cls.add_method('Set', 'void', [param('ns3::Mac48Address const &', 'value')]) return def register_Ns3NetDevice_methods(root_module, cls): ## net-device.h (module 'network'): ns3::NetDevice::NetDevice() [constructor] cls.add_constructor([]) ## net-device.h (module 'network'): ns3::NetDevice::NetDevice(ns3::NetDevice const & arg0) [copy constructor] cls.add_constructor([param('ns3::NetDevice const &', 'arg0')]) ## net-device.h (module 'network'): void ns3::NetDevice::AddLinkChangeCallback(ns3::Callback<void,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> callback) [member function] cls.add_method('AddLinkChangeCallback', 'void', [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], is_pure_virtual=True, is_virtual=True) ## net-device.h (module 'network'): ns3::Address ns3::NetDevice::GetAddress() const [member function] cls.add_method('GetAddress', 'ns3::Address', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): ns3::Address ns3::NetDevice::GetBroadcast() const [member function] cls.add_method('GetBroadcast', 'ns3::Address', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): ns3::Ptr<ns3::Channel> ns3::NetDevice::GetChannel() const [member function] cls.add_method('GetChannel', 'ns3::Ptr< ns3::Channel >', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): uint32_t ns3::NetDevice::GetIfIndex() const [member function] cls.add_method('GetIfIndex', 'uint32_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): uint16_t ns3::NetDevice::GetMtu() const [member function] cls.add_method('GetMtu', 'uint16_t', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): ns3::Address ns3::NetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function] cls.add_method('GetMulticast', 'ns3::Address', [param('ns3::Ipv4Address', 'multicastGroup')], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): ns3::Address ns3::NetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function] cls.add_method('GetMulticast', 'ns3::Address', [param('ns3::Ipv6Address', 'addr')], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): ns3::Ptr<ns3::Node> ns3::NetDevice::GetNode() const [member function] cls.add_method('GetNode', 'ns3::Ptr< ns3::Node >', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): static ns3::TypeId ns3::NetDevice::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## net-device.h (module 'network'): bool ns3::NetDevice::IsBridge() const [member function] cls.add_method('IsBridge', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): bool ns3::NetDevice::IsBroadcast() const [member function] cls.add_method('IsBroadcast', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): bool ns3::NetDevice::IsLinkUp() const [member function] cls.add_method('IsLinkUp', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): bool ns3::NetDevice::IsMulticast() const [member function] cls.add_method('IsMulticast', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): bool ns3::NetDevice::IsPointToPoint() const [member function] cls.add_method('IsPointToPoint', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): bool ns3::NetDevice::NeedsArp() const [member function] cls.add_method('NeedsArp', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## net-device.h (module 'network'): bool ns3::NetDevice::Send(ns3::Ptr<ns3::Packet> packet, ns3::Address const & dest, uint16_t protocolNumber) [member function] cls.add_method('Send', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], is_pure_virtual=True, is_virtual=True) ## net-device.h (module 'network'): bool ns3::NetDevice::SendFrom(ns3::Ptr<ns3::Packet> packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function] cls.add_method('SendFrom', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], is_pure_virtual=True, is_virtual=True) ## net-device.h (module 'network'): void ns3::NetDevice::SetAddress(ns3::Address address) [member function] cls.add_method('SetAddress', 'void', [param('ns3::Address', 'address')], is_pure_virtual=True, is_virtual=True) ## net-device.h (module 'network'): void ns3::NetDevice::SetIfIndex(uint32_t const index) [member function] cls.add_method('SetIfIndex', 'void', [param('uint32_t const', 'index')], is_pure_virtual=True, is_virtual=True) ## net-device.h (module 'network'): bool ns3::NetDevice::SetMtu(uint16_t const mtu) [member function] cls.add_method('SetMtu', 'bool', [param('uint16_t const', 'mtu')], is_pure_virtual=True, is_virtual=True) ## net-device.h (module 'network'): void ns3::NetDevice::SetNode(ns3::Ptr<ns3::Node> node) [member function] cls.add_method('SetNode', 'void', [param('ns3::Ptr< ns3::Node >', 'node')], is_pure_virtual=True, is_virtual=True) ## net-device.h (module 'network'): void ns3::NetDevice::SetPromiscReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> cb) [member function] cls.add_method('SetPromiscReceiveCallback', 'void', [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'cb')], is_pure_virtual=True, is_virtual=True) ## net-device.h (module 'network'): void ns3::NetDevice::SetReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] cls.add_method('SetReceiveCallback', 'void', [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')], is_pure_virtual=True, is_virtual=True) ## net-device.h (module 'network'): bool ns3::NetDevice::SupportsSendFrom() const [member function] cls.add_method('SupportsSendFrom', 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) return def register_Ns3NixVector_methods(root_module, cls): cls.add_output_stream_operator() ## nix-vector.h (module 'network'): ns3::NixVector::NixVector() [constructor] cls.add_constructor([]) ## nix-vector.h (module 'network'): ns3::NixVector::NixVector(ns3::NixVector const & o) [copy constructor] cls.add_constructor([param('ns3::NixVector const &', 'o')]) ## nix-vector.h (module 'network'): void ns3::NixVector::AddNeighborIndex(uint32_t newBits, uint32_t numberOfBits) [member function] cls.add_method('AddNeighborIndex', 'void', [param('uint32_t', 'newBits'), param('uint32_t', 'numberOfBits')]) ## nix-vector.h (module 'network'): uint32_t ns3::NixVector::BitCount(uint32_t numberOfNeighbors) const [member function] cls.add_method('BitCount', 'uint32_t', [param('uint32_t', 'numberOfNeighbors')], is_const=True) ## nix-vector.h (module 'network'): ns3::Ptr<ns3::NixVector> ns3::NixVector::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::NixVector >', [], is_const=True) ## nix-vector.h (module 'network'): uint32_t ns3::NixVector::Deserialize(uint32_t const * buffer, uint32_t size) [member function] cls.add_method('Deserialize', 'uint32_t', [param('uint32_t const *', 'buffer'), param('uint32_t', 'size')]) ## nix-vector.h (module 'network'): uint32_t ns3::NixVector::ExtractNeighborIndex(uint32_t numberOfBits) [member function] cls.add_method('ExtractNeighborIndex', 'uint32_t', [param('uint32_t', 'numberOfBits')]) ## nix-vector.h (module 'network'): uint32_t ns3::NixVector::GetRemainingBits() [member function] cls.add_method('GetRemainingBits', 'uint32_t', []) ## nix-vector.h (module 'network'): uint32_t ns3::NixVector::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True) ## nix-vector.h (module 'network'): uint32_t ns3::NixVector::Serialize(uint32_t * buffer, uint32_t maxSize) const [member function] cls.add_method('Serialize', 'uint32_t', [param('uint32_t *', 'buffer'), param('uint32_t', 'maxSize')], is_const=True) return def register_Ns3Node_methods(root_module, cls): ## node.h (module 'network'): ns3::Node::Node(ns3::Node const & arg0) [copy constructor] cls.add_constructor([param('ns3::Node const &', 'arg0')]) ## node.h (module 'network'): ns3::Node::Node() [constructor] cls.add_constructor([]) ## node.h (module 'network'): ns3::Node::Node(uint32_t systemId) [constructor] cls.add_constructor([param('uint32_t', 'systemId')]) ## node.h (module 'network'): uint32_t ns3::Node::AddApplication(ns3::Ptr<ns3::Application> application) [member function] cls.add_method('AddApplication', 'uint32_t', [param('ns3::Ptr< ns3::Application >', 'application')]) ## node.h (module 'network'): uint32_t ns3::Node::AddDevice(ns3::Ptr<ns3::NetDevice> device) [member function] cls.add_method('AddDevice', 'uint32_t', [param('ns3::Ptr< ns3::NetDevice >', 'device')]) ## node.h (module 'network'): static bool ns3::Node::ChecksumEnabled() [member function] cls.add_method('ChecksumEnabled', 'bool', [], is_static=True) ## node.h (module 'network'): ns3::Ptr<ns3::Application> ns3::Node::GetApplication(uint32_t index) const [member function] cls.add_method('GetApplication', 'ns3::Ptr< ns3::Application >', [param('uint32_t', 'index')], is_const=True) ## node.h (module 'network'): ns3::Ptr<ns3::NetDevice> ns3::Node::GetDevice(uint32_t index) const [member function] cls.add_method('GetDevice', 'ns3::Ptr< ns3::NetDevice >', [param('uint32_t', 'index')], is_const=True) ## node.h (module 'network'): uint32_t ns3::Node::GetId() const [member function] cls.add_method('GetId', 'uint32_t', [], is_const=True) ## node.h (module 'network'): uint32_t ns3::Node::GetNApplications() const [member function] cls.add_method('GetNApplications', 'uint32_t', [], is_const=True) ## node.h (module 'network'): uint32_t ns3::Node::GetNDevices() const [member function] cls.add_method('GetNDevices', 'uint32_t', [], is_const=True) ## node.h (module 'network'): uint32_t ns3::Node::GetSystemId() const [member function] cls.add_method('GetSystemId', 'uint32_t', [], is_const=True) ## node.h (module 'network'): static ns3::TypeId ns3::Node::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## node.h (module 'network'): void ns3::Node::RegisterDeviceAdditionListener(ns3::Callback<void,ns3::Ptr<ns3::NetDevice>,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> listener) [member function] cls.add_method('RegisterDeviceAdditionListener', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'listener')]) ## node.h (module 'network'): void ns3::Node::RegisterProtocolHandler(ns3::Callback<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> handler, uint16_t protocolType, ns3::Ptr<ns3::NetDevice> device, bool promiscuous=false) [member function] cls.add_method('RegisterProtocolHandler', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'handler'), param('uint16_t', 'protocolType'), param('ns3::Ptr< ns3::NetDevice >', 'device'), param('bool', 'promiscuous', default_value='false')]) ## node.h (module 'network'): void ns3::Node::UnregisterDeviceAdditionListener(ns3::Callback<void,ns3::Ptr<ns3::NetDevice>,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> listener) [member function] cls.add_method('UnregisterDeviceAdditionListener', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'listener')]) ## node.h (module 'network'): void ns3::Node::UnregisterProtocolHandler(ns3::Callback<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> handler) [member function] cls.add_method('UnregisterProtocolHandler', 'void', [param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'handler')]) ## node.h (module 'network'): void ns3::Node::DoDispose() [member function] cls.add_method('DoDispose', 'void', [], visibility='protected', is_virtual=True) ## node.h (module 'network'): void ns3::Node::DoStart() [member function] cls.add_method('DoStart', 'void', [], visibility='protected', is_virtual=True) return def register_Ns3ObjectFactoryChecker_methods(root_module, cls): ## object-factory.h (module 'core'): ns3::ObjectFactoryChecker::ObjectFactoryChecker() [constructor] cls.add_constructor([]) ## object-factory.h (module 'core'): ns3::ObjectFactoryChecker::ObjectFactoryChecker(ns3::ObjectFactoryChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::ObjectFactoryChecker const &', 'arg0')]) return def register_Ns3ObjectFactoryValue_methods(root_module, cls): ## object-factory.h (module 'core'): ns3::ObjectFactoryValue::ObjectFactoryValue() [constructor] cls.add_constructor([]) ## object-factory.h (module 'core'): ns3::ObjectFactoryValue::ObjectFactoryValue(ns3::ObjectFactoryValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::ObjectFactoryValue const &', 'arg0')]) ## object-factory.h (module 'core'): ns3::ObjectFactoryValue::ObjectFactoryValue(ns3::ObjectFactory const & value) [constructor] cls.add_constructor([param('ns3::ObjectFactory const &', 'value')]) ## object-factory.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::ObjectFactoryValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## object-factory.h (module 'core'): bool ns3::ObjectFactoryValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## object-factory.h (module 'core'): ns3::ObjectFactory ns3::ObjectFactoryValue::Get() const [member function] cls.add_method('Get', 'ns3::ObjectFactory', [], is_const=True) ## object-factory.h (module 'core'): std::string ns3::ObjectFactoryValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## object-factory.h (module 'core'): void ns3::ObjectFactoryValue::Set(ns3::ObjectFactory const & value) [member function] cls.add_method('Set', 'void', [param('ns3::ObjectFactory const &', 'value')]) return def register_Ns3OutputStreamWrapper_methods(root_module, cls): ## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper::OutputStreamWrapper(ns3::OutputStreamWrapper const & arg0) [copy constructor] cls.add_constructor([param('ns3::OutputStreamWrapper const &', 'arg0')]) ## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper::OutputStreamWrapper(std::string filename, std::_Ios_Openmode filemode) [constructor] cls.add_constructor([param('std::string', 'filename'), param('std::_Ios_Openmode', 'filemode')]) ## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper::OutputStreamWrapper(std::ostream * os) [constructor] cls.add_constructor([param('std::ostream *', 'os')]) ## output-stream-wrapper.h (module 'network'): std::ostream * ns3::OutputStreamWrapper::GetStream() [member function] cls.add_method('GetStream', 'std::ostream *', []) return def register_Ns3Packet_methods(root_module, cls): cls.add_output_stream_operator() ## packet.h (module 'network'): ns3::Packet::Packet() [constructor] cls.add_constructor([]) ## packet.h (module 'network'): ns3::Packet::Packet(ns3::Packet const & o) [copy constructor] cls.add_constructor([param('ns3::Packet const &', 'o')]) ## packet.h (module 'network'): ns3::Packet::Packet(uint32_t size) [constructor] cls.add_constructor([param('uint32_t', 'size')]) ## packet.h (module 'network'): ns3::Packet::Packet(uint8_t const * buffer, uint32_t size, bool magic) [constructor] cls.add_constructor([param('uint8_t const *', 'buffer'), param('uint32_t', 'size'), param('bool', 'magic')]) ## packet.h (module 'network'): ns3::Packet::Packet(uint8_t const * buffer, uint32_t size) [constructor] cls.add_constructor([param('uint8_t const *', 'buffer'), param('uint32_t', 'size')]) ## packet.h (module 'network'): void ns3::Packet::AddAtEnd(ns3::Ptr<const ns3::Packet> packet) [member function] cls.add_method('AddAtEnd', 'void', [param('ns3::Ptr< ns3::Packet const >', 'packet')]) ## packet.h (module 'network'): void ns3::Packet::AddByteTag(ns3::Tag const & tag) const [member function] cls.add_method('AddByteTag', 'void', [param('ns3::Tag const &', 'tag')], is_const=True) ## packet.h (module 'network'): void ns3::Packet::AddHeader(ns3::Header const & header) [member function] cls.add_method('AddHeader', 'void', [param('ns3::Header const &', 'header')]) ## packet.h (module 'network'): void ns3::Packet::AddPacketTag(ns3::Tag const & tag) const [member function] cls.add_method('AddPacketTag', 'void', [param('ns3::Tag const &', 'tag')], is_const=True) ## packet.h (module 'network'): void ns3::Packet::AddPaddingAtEnd(uint32_t size) [member function] cls.add_method('AddPaddingAtEnd', 'void', [param('uint32_t', 'size')]) ## packet.h (module 'network'): void ns3::Packet::AddTrailer(ns3::Trailer const & trailer) [member function] cls.add_method('AddTrailer', 'void', [param('ns3::Trailer const &', 'trailer')]) ## packet.h (module 'network'): ns3::PacketMetadata::ItemIterator ns3::Packet::BeginItem() const [member function] cls.add_method('BeginItem', 'ns3::PacketMetadata::ItemIterator', [], is_const=True) ## packet.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Packet::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::Packet >', [], is_const=True) ## packet.h (module 'network'): uint32_t ns3::Packet::CopyData(uint8_t * buffer, uint32_t size) const [member function] cls.add_method('CopyData', 'uint32_t', [param('uint8_t *', 'buffer'), param('uint32_t', 'size')], is_const=True) ## packet.h (module 'network'): void ns3::Packet::CopyData(std::ostream * os, uint32_t size) const [member function] cls.add_method('CopyData', 'void', [param('std::ostream *', 'os'), param('uint32_t', 'size')], is_const=True) ## packet.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Packet::CreateFragment(uint32_t start, uint32_t length) const [member function] cls.add_method('CreateFragment', 'ns3::Ptr< ns3::Packet >', [param('uint32_t', 'start'), param('uint32_t', 'length')], is_const=True) ## packet.h (module 'network'): static void ns3::Packet::EnableChecking() [member function] cls.add_method('EnableChecking', 'void', [], is_static=True) ## packet.h (module 'network'): static void ns3::Packet::EnablePrinting() [member function] cls.add_method('EnablePrinting', 'void', [], is_static=True) ## packet.h (module 'network'): bool ns3::Packet::FindFirstMatchingByteTag(ns3::Tag & tag) const [member function] cls.add_method('FindFirstMatchingByteTag', 'bool', [param('ns3::Tag &', 'tag')], is_const=True) ## packet.h (module 'network'): ns3::ByteTagIterator ns3::Packet::GetByteTagIterator() const [member function] cls.add_method('GetByteTagIterator', 'ns3::ByteTagIterator', [], is_const=True) ## packet.h (module 'network'): ns3::Ptr<ns3::NixVector> ns3::Packet::GetNixVector() const [member function] cls.add_method('GetNixVector', 'ns3::Ptr< ns3::NixVector >', [], is_const=True) ## packet.h (module 'network'): ns3::PacketTagIterator ns3::Packet::GetPacketTagIterator() const [member function] cls.add_method('GetPacketTagIterator', 'ns3::PacketTagIterator', [], is_const=True) ## packet.h (module 'network'): uint32_t ns3::Packet::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True) ## packet.h (module 'network'): uint32_t ns3::Packet::GetSize() const [member function] cls.add_method('GetSize', 'uint32_t', [], is_const=True) ## packet.h (module 'network'): uint64_t ns3::Packet::GetUid() const [member function] cls.add_method('GetUid', 'uint64_t', [], is_const=True) ## packet.h (module 'network'): uint8_t const * ns3::Packet::PeekData() const [member function] cls.add_method('PeekData', 'uint8_t const *', [], deprecated=True, is_const=True) ## packet.h (module 'network'): uint32_t ns3::Packet::PeekHeader(ns3::Header & header) const [member function] cls.add_method('PeekHeader', 'uint32_t', [param('ns3::Header &', 'header')], is_const=True) ## packet.h (module 'network'): bool ns3::Packet::PeekPacketTag(ns3::Tag & tag) const [member function] cls.add_method('PeekPacketTag', 'bool', [param('ns3::Tag &', 'tag')], is_const=True) ## packet.h (module 'network'): uint32_t ns3::Packet::PeekTrailer(ns3::Trailer & trailer) [member function] cls.add_method('PeekTrailer', 'uint32_t', [param('ns3::Trailer &', 'trailer')]) ## packet.h (module 'network'): void ns3::Packet::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True) ## packet.h (module 'network'): void ns3::Packet::PrintByteTags(std::ostream & os) const [member function] cls.add_method('PrintByteTags', 'void', [param('std::ostream &', 'os')], is_const=True) ## packet.h (module 'network'): void ns3::Packet::PrintPacketTags(std::ostream & os) const [member function] cls.add_method('PrintPacketTags', 'void', [param('std::ostream &', 'os')], is_const=True) ## packet.h (module 'network'): void ns3::Packet::RemoveAllByteTags() [member function] cls.add_method('RemoveAllByteTags', 'void', []) ## packet.h (module 'network'): void ns3::Packet::RemoveAllPacketTags() [member function] cls.add_method('RemoveAllPacketTags', 'void', []) ## packet.h (module 'network'): void ns3::Packet::RemoveAtEnd(uint32_t size) [member function] cls.add_method('RemoveAtEnd', 'void', [param('uint32_t', 'size')]) ## packet.h (module 'network'): void ns3::Packet::RemoveAtStart(uint32_t size) [member function] cls.add_method('RemoveAtStart', 'void', [param('uint32_t', 'size')]) ## packet.h (module 'network'): uint32_t ns3::Packet::RemoveHeader(ns3::Header & header) [member function] cls.add_method('RemoveHeader', 'uint32_t', [param('ns3::Header &', 'header')]) ## packet.h (module 'network'): bool ns3::Packet::RemovePacketTag(ns3::Tag & tag) [member function] cls.add_method('RemovePacketTag', 'bool', [param('ns3::Tag &', 'tag')]) ## packet.h (module 'network'): uint32_t ns3::Packet::RemoveTrailer(ns3::Trailer & trailer) [member function] cls.add_method('RemoveTrailer', 'uint32_t', [param('ns3::Trailer &', 'trailer')]) ## packet.h (module 'network'): uint32_t ns3::Packet::Serialize(uint8_t * buffer, uint32_t maxSize) const [member function] cls.add_method('Serialize', 'uint32_t', [param('uint8_t *', 'buffer'), param('uint32_t', 'maxSize')], is_const=True) ## packet.h (module 'network'): void ns3::Packet::SetNixVector(ns3::Ptr<ns3::NixVector> arg0) [member function] cls.add_method('SetNixVector', 'void', [param('ns3::Ptr< ns3::NixVector >', 'arg0')]) return def register_Ns3PacketSocket_methods(root_module, cls): ## packet-socket.h (module 'network'): ns3::PacketSocket::PacketSocket(ns3::PacketSocket const & arg0) [copy constructor] cls.add_constructor([param('ns3::PacketSocket const &', 'arg0')]) ## packet-socket.h (module 'network'): ns3::PacketSocket::PacketSocket() [constructor] cls.add_constructor([]) ## packet-socket.h (module 'network'): int ns3::PacketSocket::Bind() [member function] cls.add_method('Bind', 'int', [], is_virtual=True) ## packet-socket.h (module 'network'): int ns3::PacketSocket::Bind(ns3::Address const & address) [member function] cls.add_method('Bind', 'int', [param('ns3::Address const &', 'address')], is_virtual=True) ## packet-socket.h (module 'network'): int ns3::PacketSocket::Bind6() [member function] cls.add_method('Bind6', 'int', [], is_virtual=True) ## packet-socket.h (module 'network'): int ns3::PacketSocket::Close() [member function] cls.add_method('Close', 'int', [], is_virtual=True) ## packet-socket.h (module 'network'): int ns3::PacketSocket::Connect(ns3::Address const & address) [member function] cls.add_method('Connect', 'int', [param('ns3::Address const &', 'address')], is_virtual=True) ## packet-socket.h (module 'network'): bool ns3::PacketSocket::GetAllowBroadcast() const [member function] cls.add_method('GetAllowBroadcast', 'bool', [], is_const=True, is_virtual=True) ## packet-socket.h (module 'network'): ns3::Socket::SocketErrno ns3::PacketSocket::GetErrno() const [member function] cls.add_method('GetErrno', 'ns3::Socket::SocketErrno', [], is_const=True, is_virtual=True) ## packet-socket.h (module 'network'): ns3::Ptr<ns3::Node> ns3::PacketSocket::GetNode() const [member function] cls.add_method('GetNode', 'ns3::Ptr< ns3::Node >', [], is_const=True, is_virtual=True) ## packet-socket.h (module 'network'): uint32_t ns3::PacketSocket::GetRxAvailable() const [member function] cls.add_method('GetRxAvailable', 'uint32_t', [], is_const=True, is_virtual=True) ## packet-socket.h (module 'network'): int ns3::PacketSocket::GetSockName(ns3::Address & address) const [member function] cls.add_method('GetSockName', 'int', [param('ns3::Address &', 'address')], is_const=True, is_virtual=True) ## packet-socket.h (module 'network'): ns3::Socket::SocketType ns3::PacketSocket::GetSocketType() const [member function] cls.add_method('GetSocketType', 'ns3::Socket::SocketType', [], is_const=True, is_virtual=True) ## packet-socket.h (module 'network'): uint32_t ns3::PacketSocket::GetTxAvailable() const [member function] cls.add_method('GetTxAvailable', 'uint32_t', [], is_const=True, is_virtual=True) ## packet-socket.h (module 'network'): static ns3::TypeId ns3::PacketSocket::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## packet-socket.h (module 'network'): int ns3::PacketSocket::Listen() [member function] cls.add_method('Listen', 'int', [], is_virtual=True) ## packet-socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::PacketSocket::Recv(uint32_t maxSize, uint32_t flags) [member function] cls.add_method('Recv', 'ns3::Ptr< ns3::Packet >', [param('uint32_t', 'maxSize'), param('uint32_t', 'flags')], is_virtual=True) ## packet-socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::PacketSocket::RecvFrom(uint32_t maxSize, uint32_t flags, ns3::Address & fromAddress) [member function] cls.add_method('RecvFrom', 'ns3::Ptr< ns3::Packet >', [param('uint32_t', 'maxSize'), param('uint32_t', 'flags'), param('ns3::Address &', 'fromAddress')], is_virtual=True) ## packet-socket.h (module 'network'): int ns3::PacketSocket::Send(ns3::Ptr<ns3::Packet> p, uint32_t flags) [member function] cls.add_method('Send', 'int', [param('ns3::Ptr< ns3::Packet >', 'p'), param('uint32_t', 'flags')], is_virtual=True) ## packet-socket.h (module 'network'): int ns3::PacketSocket::SendTo(ns3::Ptr<ns3::Packet> p, uint32_t flags, ns3::Address const & toAddress) [member function] cls.add_method('SendTo', 'int', [param('ns3::Ptr< ns3::Packet >', 'p'), param('uint32_t', 'flags'), param('ns3::Address const &', 'toAddress')], is_virtual=True) ## packet-socket.h (module 'network'): bool ns3::PacketSocket::SetAllowBroadcast(bool allowBroadcast) [member function] cls.add_method('SetAllowBroadcast', 'bool', [param('bool', 'allowBroadcast')], is_virtual=True) ## packet-socket.h (module 'network'): void ns3::PacketSocket::SetNode(ns3::Ptr<ns3::Node> node) [member function] cls.add_method('SetNode', 'void', [param('ns3::Ptr< ns3::Node >', 'node')]) ## packet-socket.h (module 'network'): int ns3::PacketSocket::ShutdownRecv() [member function] cls.add_method('ShutdownRecv', 'int', [], is_virtual=True) ## packet-socket.h (module 'network'): int ns3::PacketSocket::ShutdownSend() [member function] cls.add_method('ShutdownSend', 'int', [], is_virtual=True) ## packet-socket.h (module 'network'): void ns3::PacketSocket::DoDispose() [member function] cls.add_method('DoDispose', 'void', [], visibility='private', is_virtual=True) return def register_Ns3PacketSocketFactory_methods(root_module, cls): ## packet-socket-factory.h (module 'network'): ns3::PacketSocketFactory::PacketSocketFactory(ns3::PacketSocketFactory const & arg0) [copy constructor] cls.add_constructor([param('ns3::PacketSocketFactory const &', 'arg0')]) ## packet-socket-factory.h (module 'network'): ns3::PacketSocketFactory::PacketSocketFactory() [constructor] cls.add_constructor([]) ## packet-socket-factory.h (module 'network'): ns3::Ptr<ns3::Socket> ns3::PacketSocketFactory::CreateSocket() [member function] cls.add_method('CreateSocket', 'ns3::Ptr< ns3::Socket >', [], is_virtual=True) ## packet-socket-factory.h (module 'network'): static ns3::TypeId ns3::PacketSocketFactory::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) return def register_Ns3PbbAddressBlock_methods(root_module, cls): cls.add_binary_comparison_operator('==') cls.add_binary_comparison_operator('!=') ## packetbb.h (module 'network'): ns3::PbbAddressBlock::PbbAddressBlock(ns3::PbbAddressBlock const & arg0) [copy constructor] cls.add_constructor([param('ns3::PbbAddressBlock const &', 'arg0')]) ## packetbb.h (module 'network'): ns3::PbbAddressBlock::PbbAddressBlock() [constructor] cls.add_constructor([]) ## packetbb.h (module 'network'): ns3::Address ns3::PbbAddressBlock::AddressBack() const [member function] cls.add_method('AddressBack', 'ns3::Address', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Address> ns3::PbbAddressBlock::AddressBegin() [member function] cls.add_method('AddressBegin', 'std::_List_iterator< ns3::Address >', []) ## packetbb.h (module 'network'): std::_List_const_iterator<ns3::Address> ns3::PbbAddressBlock::AddressBegin() const [member function] cls.add_method('AddressBegin', 'std::_List_const_iterator< ns3::Address >', [], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbAddressBlock::AddressClear() [member function] cls.add_method('AddressClear', 'void', []) ## packetbb.h (module 'network'): bool ns3::PbbAddressBlock::AddressEmpty() const [member function] cls.add_method('AddressEmpty', 'bool', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Address> ns3::PbbAddressBlock::AddressEnd() [member function] cls.add_method('AddressEnd', 'std::_List_iterator< ns3::Address >', []) ## packetbb.h (module 'network'): std::_List_const_iterator<ns3::Address> ns3::PbbAddressBlock::AddressEnd() const [member function] cls.add_method('AddressEnd', 'std::_List_const_iterator< ns3::Address >', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Address> ns3::PbbAddressBlock::AddressErase(std::_List_iterator<ns3::Address> position) [member function] cls.add_method('AddressErase', 'std::_List_iterator< ns3::Address >', [param('std::_List_iterator< ns3::Address >', 'position')]) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Address> ns3::PbbAddressBlock::AddressErase(std::_List_iterator<ns3::Address> first, std::_List_iterator<ns3::Address> last) [member function] cls.add_method('AddressErase', 'std::_List_iterator< ns3::Address >', [param('std::_List_iterator< ns3::Address >', 'first'), param('std::_List_iterator< ns3::Address >', 'last')]) ## packetbb.h (module 'network'): ns3::Address ns3::PbbAddressBlock::AddressFront() const [member function] cls.add_method('AddressFront', 'ns3::Address', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Address> ns3::PbbAddressBlock::AddressInsert(std::_List_iterator<ns3::Address> position, ns3::Address const value) [member function] cls.add_method('AddressInsert', 'std::_List_iterator< ns3::Address >', [param('std::_List_iterator< ns3::Address >', 'position'), param('ns3::Address const', 'value')]) ## packetbb.h (module 'network'): void ns3::PbbAddressBlock::AddressPopBack() [member function] cls.add_method('AddressPopBack', 'void', []) ## packetbb.h (module 'network'): void ns3::PbbAddressBlock::AddressPopFront() [member function] cls.add_method('AddressPopFront', 'void', []) ## packetbb.h (module 'network'): void ns3::PbbAddressBlock::AddressPushBack(ns3::Address address) [member function] cls.add_method('AddressPushBack', 'void', [param('ns3::Address', 'address')]) ## packetbb.h (module 'network'): void ns3::PbbAddressBlock::AddressPushFront(ns3::Address address) [member function] cls.add_method('AddressPushFront', 'void', [param('ns3::Address', 'address')]) ## packetbb.h (module 'network'): int ns3::PbbAddressBlock::AddressSize() const [member function] cls.add_method('AddressSize', 'int', [], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbAddressBlock::Deserialize(ns3::Buffer::Iterator & start) [member function] cls.add_method('Deserialize', 'void', [param('ns3::Buffer::Iterator &', 'start')]) ## packetbb.h (module 'network'): uint32_t ns3::PbbAddressBlock::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True) ## packetbb.h (module 'network'): uint8_t ns3::PbbAddressBlock::PrefixBack() const [member function] cls.add_method('PrefixBack', 'uint8_t', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<unsigned char> ns3::PbbAddressBlock::PrefixBegin() [member function] cls.add_method('PrefixBegin', 'std::_List_iterator< unsigned char >', []) ## packetbb.h (module 'network'): std::_List_const_iterator<unsigned char> ns3::PbbAddressBlock::PrefixBegin() const [member function] cls.add_method('PrefixBegin', 'std::_List_const_iterator< unsigned char >', [], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbAddressBlock::PrefixClear() [member function] cls.add_method('PrefixClear', 'void', []) ## packetbb.h (module 'network'): bool ns3::PbbAddressBlock::PrefixEmpty() const [member function] cls.add_method('PrefixEmpty', 'bool', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<unsigned char> ns3::PbbAddressBlock::PrefixEnd() [member function] cls.add_method('PrefixEnd', 'std::_List_iterator< unsigned char >', []) ## packetbb.h (module 'network'): std::_List_const_iterator<unsigned char> ns3::PbbAddressBlock::PrefixEnd() const [member function] cls.add_method('PrefixEnd', 'std::_List_const_iterator< unsigned char >', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<unsigned char> ns3::PbbAddressBlock::PrefixErase(std::_List_iterator<unsigned char> position) [member function] cls.add_method('PrefixErase', 'std::_List_iterator< unsigned char >', [param('std::_List_iterator< unsigned char >', 'position')]) ## packetbb.h (module 'network'): std::_List_iterator<unsigned char> ns3::PbbAddressBlock::PrefixErase(std::_List_iterator<unsigned char> first, std::_List_iterator<unsigned char> last) [member function] cls.add_method('PrefixErase', 'std::_List_iterator< unsigned char >', [param('std::_List_iterator< unsigned char >', 'first'), param('std::_List_iterator< unsigned char >', 'last')]) ## packetbb.h (module 'network'): uint8_t ns3::PbbAddressBlock::PrefixFront() const [member function] cls.add_method('PrefixFront', 'uint8_t', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<unsigned char> ns3::PbbAddressBlock::PrefixInsert(std::_List_iterator<unsigned char> position, uint8_t const value) [member function] cls.add_method('PrefixInsert', 'std::_List_iterator< unsigned char >', [param('std::_List_iterator< unsigned char >', 'position'), param('uint8_t const', 'value')]) ## packetbb.h (module 'network'): void ns3::PbbAddressBlock::PrefixPopBack() [member function] cls.add_method('PrefixPopBack', 'void', []) ## packetbb.h (module 'network'): void ns3::PbbAddressBlock::PrefixPopFront() [member function] cls.add_method('PrefixPopFront', 'void', []) ## packetbb.h (module 'network'): void ns3::PbbAddressBlock::PrefixPushBack(uint8_t prefix) [member function] cls.add_method('PrefixPushBack', 'void', [param('uint8_t', 'prefix')]) ## packetbb.h (module 'network'): void ns3::PbbAddressBlock::PrefixPushFront(uint8_t prefix) [member function] cls.add_method('PrefixPushFront', 'void', [param('uint8_t', 'prefix')]) ## packetbb.h (module 'network'): int ns3::PbbAddressBlock::PrefixSize() const [member function] cls.add_method('PrefixSize', 'int', [], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbAddressBlock::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbAddressBlock::Print(std::ostream & os, int level) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os'), param('int', 'level')], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbAddressBlock::Serialize(ns3::Buffer::Iterator & start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator &', 'start')], is_const=True) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressTlv> ns3::PbbAddressBlock::TlvBack() [member function] cls.add_method('TlvBack', 'ns3::Ptr< ns3::PbbAddressTlv >', []) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressTlv> const ns3::PbbAddressBlock::TlvBack() const [member function] cls.add_method('TlvBack', 'ns3::Ptr< ns3::PbbAddressTlv > const', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbAddressTlv> > ns3::PbbAddressBlock::TlvBegin() [member function] cls.add_method('TlvBegin', 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', []) ## packetbb.h (module 'network'): std::_List_const_iterator<ns3::Ptr<ns3::PbbAddressTlv> > ns3::PbbAddressBlock::TlvBegin() const [member function] cls.add_method('TlvBegin', 'std::_List_const_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', [], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbAddressBlock::TlvClear() [member function] cls.add_method('TlvClear', 'void', []) ## packetbb.h (module 'network'): bool ns3::PbbAddressBlock::TlvEmpty() const [member function] cls.add_method('TlvEmpty', 'bool', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbAddressTlv> > ns3::PbbAddressBlock::TlvEnd() [member function] cls.add_method('TlvEnd', 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', []) ## packetbb.h (module 'network'): std::_List_const_iterator<ns3::Ptr<ns3::PbbAddressTlv> > ns3::PbbAddressBlock::TlvEnd() const [member function] cls.add_method('TlvEnd', 'std::_List_const_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbAddressTlv> > ns3::PbbAddressBlock::TlvErase(std::_List_iterator<ns3::Ptr<ns3::PbbAddressTlv> > position) [member function] cls.add_method('TlvErase', 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'position')]) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbAddressTlv> > ns3::PbbAddressBlock::TlvErase(std::_List_iterator<ns3::Ptr<ns3::PbbAddressTlv> > first, std::_List_iterator<ns3::Ptr<ns3::PbbAddressTlv> > last) [member function] cls.add_method('TlvErase', 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'first'), param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'last')]) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressTlv> ns3::PbbAddressBlock::TlvFront() [member function] cls.add_method('TlvFront', 'ns3::Ptr< ns3::PbbAddressTlv >', []) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressTlv> const ns3::PbbAddressBlock::TlvFront() const [member function] cls.add_method('TlvFront', 'ns3::Ptr< ns3::PbbAddressTlv > const', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbAddressTlv> > ns3::PbbAddressBlock::TlvInsert(std::_List_iterator<ns3::Ptr<ns3::PbbAddressTlv> > position, ns3::Ptr<ns3::PbbTlv> const value) [member function] cls.add_method('TlvInsert', 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressTlv > >', 'position'), param('ns3::Ptr< ns3::PbbTlv > const', 'value')]) ## packetbb.h (module 'network'): void ns3::PbbAddressBlock::TlvPopBack() [member function] cls.add_method('TlvPopBack', 'void', []) ## packetbb.h (module 'network'): void ns3::PbbAddressBlock::TlvPopFront() [member function] cls.add_method('TlvPopFront', 'void', []) ## packetbb.h (module 'network'): void ns3::PbbAddressBlock::TlvPushBack(ns3::Ptr<ns3::PbbAddressTlv> address) [member function] cls.add_method('TlvPushBack', 'void', [param('ns3::Ptr< ns3::PbbAddressTlv >', 'address')]) ## packetbb.h (module 'network'): void ns3::PbbAddressBlock::TlvPushFront(ns3::Ptr<ns3::PbbAddressTlv> address) [member function] cls.add_method('TlvPushFront', 'void', [param('ns3::Ptr< ns3::PbbAddressTlv >', 'address')]) ## packetbb.h (module 'network'): int ns3::PbbAddressBlock::TlvSize() const [member function] cls.add_method('TlvSize', 'int', [], is_const=True) ## packetbb.h (module 'network'): ns3::Address ns3::PbbAddressBlock::DeserializeAddress(uint8_t * buffer) const [member function] cls.add_method('DeserializeAddress', 'ns3::Address', [param('uint8_t *', 'buffer')], is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) ## packetbb.h (module 'network'): uint8_t ns3::PbbAddressBlock::GetAddressLength() const [member function] cls.add_method('GetAddressLength', 'uint8_t', [], is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) ## packetbb.h (module 'network'): void ns3::PbbAddressBlock::PrintAddress(std::ostream & os, std::_List_const_iterator<ns3::Address> iter) const [member function] cls.add_method('PrintAddress', 'void', [param('std::ostream &', 'os'), param('std::_List_const_iterator< ns3::Address >', 'iter')], is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) ## packetbb.h (module 'network'): void ns3::PbbAddressBlock::SerializeAddress(uint8_t * buffer, std::_List_const_iterator<ns3::Address> iter) const [member function] cls.add_method('SerializeAddress', 'void', [param('uint8_t *', 'buffer'), param('std::_List_const_iterator< ns3::Address >', 'iter')], is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) return def register_Ns3PbbAddressBlockIpv4_methods(root_module, cls): ## packetbb.h (module 'network'): ns3::PbbAddressBlockIpv4::PbbAddressBlockIpv4(ns3::PbbAddressBlockIpv4 const & arg0) [copy constructor] cls.add_constructor([param('ns3::PbbAddressBlockIpv4 const &', 'arg0')]) ## packetbb.h (module 'network'): ns3::PbbAddressBlockIpv4::PbbAddressBlockIpv4() [constructor] cls.add_constructor([]) ## packetbb.h (module 'network'): ns3::Address ns3::PbbAddressBlockIpv4::DeserializeAddress(uint8_t * buffer) const [member function] cls.add_method('DeserializeAddress', 'ns3::Address', [param('uint8_t *', 'buffer')], is_const=True, visibility='protected', is_virtual=True) ## packetbb.h (module 'network'): uint8_t ns3::PbbAddressBlockIpv4::GetAddressLength() const [member function] cls.add_method('GetAddressLength', 'uint8_t', [], is_const=True, visibility='protected', is_virtual=True) ## packetbb.h (module 'network'): void ns3::PbbAddressBlockIpv4::PrintAddress(std::ostream & os, std::_List_const_iterator<ns3::Address> iter) const [member function] cls.add_method('PrintAddress', 'void', [param('std::ostream &', 'os'), param('std::_List_const_iterator< ns3::Address >', 'iter')], is_const=True, visibility='protected', is_virtual=True) ## packetbb.h (module 'network'): void ns3::PbbAddressBlockIpv4::SerializeAddress(uint8_t * buffer, std::_List_const_iterator<ns3::Address> iter) const [member function] cls.add_method('SerializeAddress', 'void', [param('uint8_t *', 'buffer'), param('std::_List_const_iterator< ns3::Address >', 'iter')], is_const=True, visibility='protected', is_virtual=True) return def register_Ns3PbbAddressBlockIpv6_methods(root_module, cls): ## packetbb.h (module 'network'): ns3::PbbAddressBlockIpv6::PbbAddressBlockIpv6(ns3::PbbAddressBlockIpv6 const & arg0) [copy constructor] cls.add_constructor([param('ns3::PbbAddressBlockIpv6 const &', 'arg0')]) ## packetbb.h (module 'network'): ns3::PbbAddressBlockIpv6::PbbAddressBlockIpv6() [constructor] cls.add_constructor([]) ## packetbb.h (module 'network'): ns3::Address ns3::PbbAddressBlockIpv6::DeserializeAddress(uint8_t * buffer) const [member function] cls.add_method('DeserializeAddress', 'ns3::Address', [param('uint8_t *', 'buffer')], is_const=True, visibility='protected', is_virtual=True) ## packetbb.h (module 'network'): uint8_t ns3::PbbAddressBlockIpv6::GetAddressLength() const [member function] cls.add_method('GetAddressLength', 'uint8_t', [], is_const=True, visibility='protected', is_virtual=True) ## packetbb.h (module 'network'): void ns3::PbbAddressBlockIpv6::PrintAddress(std::ostream & os, std::_List_const_iterator<ns3::Address> iter) const [member function] cls.add_method('PrintAddress', 'void', [param('std::ostream &', 'os'), param('std::_List_const_iterator< ns3::Address >', 'iter')], is_const=True, visibility='protected', is_virtual=True) ## packetbb.h (module 'network'): void ns3::PbbAddressBlockIpv6::SerializeAddress(uint8_t * buffer, std::_List_const_iterator<ns3::Address> iter) const [member function] cls.add_method('SerializeAddress', 'void', [param('uint8_t *', 'buffer'), param('std::_List_const_iterator< ns3::Address >', 'iter')], is_const=True, visibility='protected', is_virtual=True) return def register_Ns3PbbMessage_methods(root_module, cls): cls.add_binary_comparison_operator('==') cls.add_binary_comparison_operator('!=') ## packetbb.h (module 'network'): ns3::PbbMessage::PbbMessage(ns3::PbbMessage const & arg0) [copy constructor] cls.add_constructor([param('ns3::PbbMessage const &', 'arg0')]) ## packetbb.h (module 'network'): ns3::PbbMessage::PbbMessage() [constructor] cls.add_constructor([]) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressBlock> ns3::PbbMessage::AddressBlockBack() [member function] cls.add_method('AddressBlockBack', 'ns3::Ptr< ns3::PbbAddressBlock >', []) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressBlock> const ns3::PbbMessage::AddressBlockBack() const [member function] cls.add_method('AddressBlockBack', 'ns3::Ptr< ns3::PbbAddressBlock > const', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbAddressBlock> > ns3::PbbMessage::AddressBlockBegin() [member function] cls.add_method('AddressBlockBegin', 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', []) ## packetbb.h (module 'network'): std::_List_const_iterator<ns3::Ptr<ns3::PbbAddressBlock> > ns3::PbbMessage::AddressBlockBegin() const [member function] cls.add_method('AddressBlockBegin', 'std::_List_const_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', [], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbMessage::AddressBlockClear() [member function] cls.add_method('AddressBlockClear', 'void', []) ## packetbb.h (module 'network'): bool ns3::PbbMessage::AddressBlockEmpty() const [member function] cls.add_method('AddressBlockEmpty', 'bool', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbAddressBlock> > ns3::PbbMessage::AddressBlockEnd() [member function] cls.add_method('AddressBlockEnd', 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', []) ## packetbb.h (module 'network'): std::_List_const_iterator<ns3::Ptr<ns3::PbbAddressBlock> > ns3::PbbMessage::AddressBlockEnd() const [member function] cls.add_method('AddressBlockEnd', 'std::_List_const_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbAddressBlock> > ns3::PbbMessage::AddressBlockErase(std::_List_iterator<ns3::Ptr<ns3::PbbAddressBlock> > position) [member function] cls.add_method('AddressBlockErase', 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', 'position')]) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbAddressBlock> > ns3::PbbMessage::AddressBlockErase(std::_List_iterator<ns3::Ptr<ns3::PbbAddressBlock> > first, std::_List_iterator<ns3::Ptr<ns3::PbbAddressBlock> > last) [member function] cls.add_method('AddressBlockErase', 'std::_List_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', [param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', 'first'), param('std::_List_iterator< ns3::Ptr< ns3::PbbAddressBlock > >', 'last')]) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressBlock> ns3::PbbMessage::AddressBlockFront() [member function] cls.add_method('AddressBlockFront', 'ns3::Ptr< ns3::PbbAddressBlock >', []) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressBlock> const ns3::PbbMessage::AddressBlockFront() const [member function] cls.add_method('AddressBlockFront', 'ns3::Ptr< ns3::PbbAddressBlock > const', [], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbMessage::AddressBlockPopBack() [member function] cls.add_method('AddressBlockPopBack', 'void', []) ## packetbb.h (module 'network'): void ns3::PbbMessage::AddressBlockPopFront() [member function] cls.add_method('AddressBlockPopFront', 'void', []) ## packetbb.h (module 'network'): void ns3::PbbMessage::AddressBlockPushBack(ns3::Ptr<ns3::PbbAddressBlock> block) [member function] cls.add_method('AddressBlockPushBack', 'void', [param('ns3::Ptr< ns3::PbbAddressBlock >', 'block')]) ## packetbb.h (module 'network'): void ns3::PbbMessage::AddressBlockPushFront(ns3::Ptr<ns3::PbbAddressBlock> block) [member function] cls.add_method('AddressBlockPushFront', 'void', [param('ns3::Ptr< ns3::PbbAddressBlock >', 'block')]) ## packetbb.h (module 'network'): int ns3::PbbMessage::AddressBlockSize() const [member function] cls.add_method('AddressBlockSize', 'int', [], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbMessage::Deserialize(ns3::Buffer::Iterator & start) [member function] cls.add_method('Deserialize', 'void', [param('ns3::Buffer::Iterator &', 'start')]) ## packetbb.h (module 'network'): static ns3::Ptr<ns3::PbbMessage> ns3::PbbMessage::DeserializeMessage(ns3::Buffer::Iterator & start) [member function] cls.add_method('DeserializeMessage', 'ns3::Ptr< ns3::PbbMessage >', [param('ns3::Buffer::Iterator &', 'start')], is_static=True) ## packetbb.h (module 'network'): uint8_t ns3::PbbMessage::GetHopCount() const [member function] cls.add_method('GetHopCount', 'uint8_t', [], is_const=True) ## packetbb.h (module 'network'): uint8_t ns3::PbbMessage::GetHopLimit() const [member function] cls.add_method('GetHopLimit', 'uint8_t', [], is_const=True) ## packetbb.h (module 'network'): ns3::Address ns3::PbbMessage::GetOriginatorAddress() const [member function] cls.add_method('GetOriginatorAddress', 'ns3::Address', [], is_const=True) ## packetbb.h (module 'network'): uint16_t ns3::PbbMessage::GetSequenceNumber() const [member function] cls.add_method('GetSequenceNumber', 'uint16_t', [], is_const=True) ## packetbb.h (module 'network'): uint32_t ns3::PbbMessage::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True) ## packetbb.h (module 'network'): uint8_t ns3::PbbMessage::GetType() const [member function] cls.add_method('GetType', 'uint8_t', [], is_const=True) ## packetbb.h (module 'network'): bool ns3::PbbMessage::HasHopCount() const [member function] cls.add_method('HasHopCount', 'bool', [], is_const=True) ## packetbb.h (module 'network'): bool ns3::PbbMessage::HasHopLimit() const [member function] cls.add_method('HasHopLimit', 'bool', [], is_const=True) ## packetbb.h (module 'network'): bool ns3::PbbMessage::HasOriginatorAddress() const [member function] cls.add_method('HasOriginatorAddress', 'bool', [], is_const=True) ## packetbb.h (module 'network'): bool ns3::PbbMessage::HasSequenceNumber() const [member function] cls.add_method('HasSequenceNumber', 'bool', [], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbMessage::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbMessage::Print(std::ostream & os, int level) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os'), param('int', 'level')], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbMessage::Serialize(ns3::Buffer::Iterator & start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator &', 'start')], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbMessage::SetHopCount(uint8_t hopcount) [member function] cls.add_method('SetHopCount', 'void', [param('uint8_t', 'hopcount')]) ## packetbb.h (module 'network'): void ns3::PbbMessage::SetHopLimit(uint8_t hoplimit) [member function] cls.add_method('SetHopLimit', 'void', [param('uint8_t', 'hoplimit')]) ## packetbb.h (module 'network'): void ns3::PbbMessage::SetOriginatorAddress(ns3::Address address) [member function] cls.add_method('SetOriginatorAddress', 'void', [param('ns3::Address', 'address')]) ## packetbb.h (module 'network'): void ns3::PbbMessage::SetSequenceNumber(uint16_t seqnum) [member function] cls.add_method('SetSequenceNumber', 'void', [param('uint16_t', 'seqnum')]) ## packetbb.h (module 'network'): void ns3::PbbMessage::SetType(uint8_t type) [member function] cls.add_method('SetType', 'void', [param('uint8_t', 'type')]) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbTlv> ns3::PbbMessage::TlvBack() [member function] cls.add_method('TlvBack', 'ns3::Ptr< ns3::PbbTlv >', []) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbTlv> const ns3::PbbMessage::TlvBack() const [member function] cls.add_method('TlvBack', 'ns3::Ptr< ns3::PbbTlv > const', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbTlv> > ns3::PbbMessage::TlvBegin() [member function] cls.add_method('TlvBegin', 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', []) ## packetbb.h (module 'network'): std::_List_const_iterator<ns3::Ptr<ns3::PbbTlv> > ns3::PbbMessage::TlvBegin() const [member function] cls.add_method('TlvBegin', 'std::_List_const_iterator< ns3::Ptr< ns3::PbbTlv > >', [], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbMessage::TlvClear() [member function] cls.add_method('TlvClear', 'void', []) ## packetbb.h (module 'network'): bool ns3::PbbMessage::TlvEmpty() const [member function] cls.add_method('TlvEmpty', 'bool', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbTlv> > ns3::PbbMessage::TlvEnd() [member function] cls.add_method('TlvEnd', 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', []) ## packetbb.h (module 'network'): std::_List_const_iterator<ns3::Ptr<ns3::PbbTlv> > ns3::PbbMessage::TlvEnd() const [member function] cls.add_method('TlvEnd', 'std::_List_const_iterator< ns3::Ptr< ns3::PbbTlv > >', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbTlv> > ns3::PbbMessage::TlvErase(std::_List_iterator<ns3::Ptr<ns3::PbbTlv> > position) [member function] cls.add_method('TlvErase', 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', [param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'position')]) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbTlv> > ns3::PbbMessage::TlvErase(std::_List_iterator<ns3::Ptr<ns3::PbbTlv> > first, std::_List_iterator<ns3::Ptr<ns3::PbbTlv> > last) [member function] cls.add_method('TlvErase', 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', [param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'first'), param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'last')]) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbTlv> ns3::PbbMessage::TlvFront() [member function] cls.add_method('TlvFront', 'ns3::Ptr< ns3::PbbTlv >', []) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbTlv> const ns3::PbbMessage::TlvFront() const [member function] cls.add_method('TlvFront', 'ns3::Ptr< ns3::PbbTlv > const', [], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbMessage::TlvPopBack() [member function] cls.add_method('TlvPopBack', 'void', []) ## packetbb.h (module 'network'): void ns3::PbbMessage::TlvPopFront() [member function] cls.add_method('TlvPopFront', 'void', []) ## packetbb.h (module 'network'): void ns3::PbbMessage::TlvPushBack(ns3::Ptr<ns3::PbbTlv> tlv) [member function] cls.add_method('TlvPushBack', 'void', [param('ns3::Ptr< ns3::PbbTlv >', 'tlv')]) ## packetbb.h (module 'network'): void ns3::PbbMessage::TlvPushFront(ns3::Ptr<ns3::PbbTlv> tlv) [member function] cls.add_method('TlvPushFront', 'void', [param('ns3::Ptr< ns3::PbbTlv >', 'tlv')]) ## packetbb.h (module 'network'): int ns3::PbbMessage::TlvSize() const [member function] cls.add_method('TlvSize', 'int', [], is_const=True) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressBlock> ns3::PbbMessage::AddressBlockDeserialize(ns3::Buffer::Iterator & start) const [member function] cls.add_method('AddressBlockDeserialize', 'ns3::Ptr< ns3::PbbAddressBlock >', [param('ns3::Buffer::Iterator &', 'start')], is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) ## packetbb.h (module 'network'): ns3::Address ns3::PbbMessage::DeserializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function] cls.add_method('DeserializeOriginatorAddress', 'ns3::Address', [param('ns3::Buffer::Iterator &', 'start')], is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) ## packetbb.h (module 'network'): ns3::PbbAddressLength ns3::PbbMessage::GetAddressLength() const [member function] cls.add_method('GetAddressLength', 'ns3::PbbAddressLength', [], is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) ## packetbb.h (module 'network'): void ns3::PbbMessage::PrintOriginatorAddress(std::ostream & os) const [member function] cls.add_method('PrintOriginatorAddress', 'void', [param('std::ostream &', 'os')], is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) ## packetbb.h (module 'network'): void ns3::PbbMessage::SerializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function] cls.add_method('SerializeOriginatorAddress', 'void', [param('ns3::Buffer::Iterator &', 'start')], is_pure_virtual=True, is_const=True, visibility='protected', is_virtual=True) return def register_Ns3PbbMessageIpv4_methods(root_module, cls): ## packetbb.h (module 'network'): ns3::PbbMessageIpv4::PbbMessageIpv4(ns3::PbbMessageIpv4 const & arg0) [copy constructor] cls.add_constructor([param('ns3::PbbMessageIpv4 const &', 'arg0')]) ## packetbb.h (module 'network'): ns3::PbbMessageIpv4::PbbMessageIpv4() [constructor] cls.add_constructor([]) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressBlock> ns3::PbbMessageIpv4::AddressBlockDeserialize(ns3::Buffer::Iterator & start) const [member function] cls.add_method('AddressBlockDeserialize', 'ns3::Ptr< ns3::PbbAddressBlock >', [param('ns3::Buffer::Iterator &', 'start')], is_const=True, visibility='protected', is_virtual=True) ## packetbb.h (module 'network'): ns3::Address ns3::PbbMessageIpv4::DeserializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function] cls.add_method('DeserializeOriginatorAddress', 'ns3::Address', [param('ns3::Buffer::Iterator &', 'start')], is_const=True, visibility='protected', is_virtual=True) ## packetbb.h (module 'network'): ns3::PbbAddressLength ns3::PbbMessageIpv4::GetAddressLength() const [member function] cls.add_method('GetAddressLength', 'ns3::PbbAddressLength', [], is_const=True, visibility='protected', is_virtual=True) ## packetbb.h (module 'network'): void ns3::PbbMessageIpv4::PrintOriginatorAddress(std::ostream & os) const [member function] cls.add_method('PrintOriginatorAddress', 'void', [param('std::ostream &', 'os')], is_const=True, visibility='protected', is_virtual=True) ## packetbb.h (module 'network'): void ns3::PbbMessageIpv4::SerializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function] cls.add_method('SerializeOriginatorAddress', 'void', [param('ns3::Buffer::Iterator &', 'start')], is_const=True, visibility='protected', is_virtual=True) return def register_Ns3PbbMessageIpv6_methods(root_module, cls): ## packetbb.h (module 'network'): ns3::PbbMessageIpv6::PbbMessageIpv6(ns3::PbbMessageIpv6 const & arg0) [copy constructor] cls.add_constructor([param('ns3::PbbMessageIpv6 const &', 'arg0')]) ## packetbb.h (module 'network'): ns3::PbbMessageIpv6::PbbMessageIpv6() [constructor] cls.add_constructor([]) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbAddressBlock> ns3::PbbMessageIpv6::AddressBlockDeserialize(ns3::Buffer::Iterator & start) const [member function] cls.add_method('AddressBlockDeserialize', 'ns3::Ptr< ns3::PbbAddressBlock >', [param('ns3::Buffer::Iterator &', 'start')], is_const=True, visibility='protected', is_virtual=True) ## packetbb.h (module 'network'): ns3::Address ns3::PbbMessageIpv6::DeserializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function] cls.add_method('DeserializeOriginatorAddress', 'ns3::Address', [param('ns3::Buffer::Iterator &', 'start')], is_const=True, visibility='protected', is_virtual=True) ## packetbb.h (module 'network'): ns3::PbbAddressLength ns3::PbbMessageIpv6::GetAddressLength() const [member function] cls.add_method('GetAddressLength', 'ns3::PbbAddressLength', [], is_const=True, visibility='protected', is_virtual=True) ## packetbb.h (module 'network'): void ns3::PbbMessageIpv6::PrintOriginatorAddress(std::ostream & os) const [member function] cls.add_method('PrintOriginatorAddress', 'void', [param('std::ostream &', 'os')], is_const=True, visibility='protected', is_virtual=True) ## packetbb.h (module 'network'): void ns3::PbbMessageIpv6::SerializeOriginatorAddress(ns3::Buffer::Iterator & start) const [member function] cls.add_method('SerializeOriginatorAddress', 'void', [param('ns3::Buffer::Iterator &', 'start')], is_const=True, visibility='protected', is_virtual=True) return def register_Ns3PbbPacket_methods(root_module, cls): cls.add_binary_comparison_operator('==') cls.add_binary_comparison_operator('!=') ## packetbb.h (module 'network'): ns3::PbbPacket::PbbPacket(ns3::PbbPacket const & arg0) [copy constructor] cls.add_constructor([param('ns3::PbbPacket const &', 'arg0')]) ## packetbb.h (module 'network'): ns3::PbbPacket::PbbPacket() [constructor] cls.add_constructor([]) ## packetbb.h (module 'network'): uint32_t ns3::PbbPacket::Deserialize(ns3::Buffer::Iterator start) [member function] cls.add_method('Deserialize', 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbTlv> > ns3::PbbPacket::Erase(std::_List_iterator<ns3::Ptr<ns3::PbbTlv> > position) [member function] cls.add_method('Erase', 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', [param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'position')]) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbTlv> > ns3::PbbPacket::Erase(std::_List_iterator<ns3::Ptr<ns3::PbbTlv> > first, std::_List_iterator<ns3::Ptr<ns3::PbbTlv> > last) [member function] cls.add_method('Erase', 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', [param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'first'), param('std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', 'last')]) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbMessage> > ns3::PbbPacket::Erase(std::_List_iterator<ns3::Ptr<ns3::PbbMessage> > position) [member function] cls.add_method('Erase', 'std::_List_iterator< ns3::Ptr< ns3::PbbMessage > >', [param('std::_List_iterator< ns3::Ptr< ns3::PbbMessage > >', 'position')]) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbMessage> > ns3::PbbPacket::Erase(std::_List_iterator<ns3::Ptr<ns3::PbbMessage> > first, std::_List_iterator<ns3::Ptr<ns3::PbbMessage> > last) [member function] cls.add_method('Erase', 'std::_List_iterator< ns3::Ptr< ns3::PbbMessage > >', [param('std::_List_iterator< ns3::Ptr< ns3::PbbMessage > >', 'first'), param('std::_List_iterator< ns3::Ptr< ns3::PbbMessage > >', 'last')]) ## packetbb.h (module 'network'): ns3::TypeId ns3::PbbPacket::GetInstanceTypeId() const [member function] cls.add_method('GetInstanceTypeId', 'ns3::TypeId', [], is_const=True, is_virtual=True) ## packetbb.h (module 'network'): uint16_t ns3::PbbPacket::GetSequenceNumber() const [member function] cls.add_method('GetSequenceNumber', 'uint16_t', [], is_const=True) ## packetbb.h (module 'network'): uint32_t ns3::PbbPacket::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True, is_virtual=True) ## packetbb.h (module 'network'): static ns3::TypeId ns3::PbbPacket::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## packetbb.h (module 'network'): uint8_t ns3::PbbPacket::GetVersion() const [member function] cls.add_method('GetVersion', 'uint8_t', [], is_const=True) ## packetbb.h (module 'network'): bool ns3::PbbPacket::HasSequenceNumber() const [member function] cls.add_method('HasSequenceNumber', 'bool', [], is_const=True) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbMessage> ns3::PbbPacket::MessageBack() [member function] cls.add_method('MessageBack', 'ns3::Ptr< ns3::PbbMessage >', []) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbMessage> const ns3::PbbPacket::MessageBack() const [member function] cls.add_method('MessageBack', 'ns3::Ptr< ns3::PbbMessage > const', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbMessage> > ns3::PbbPacket::MessageBegin() [member function] cls.add_method('MessageBegin', 'std::_List_iterator< ns3::Ptr< ns3::PbbMessage > >', []) ## packetbb.h (module 'network'): std::_List_const_iterator<ns3::Ptr<ns3::PbbMessage> > ns3::PbbPacket::MessageBegin() const [member function] cls.add_method('MessageBegin', 'std::_List_const_iterator< ns3::Ptr< ns3::PbbMessage > >', [], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbPacket::MessageClear() [member function] cls.add_method('MessageClear', 'void', []) ## packetbb.h (module 'network'): bool ns3::PbbPacket::MessageEmpty() const [member function] cls.add_method('MessageEmpty', 'bool', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbMessage> > ns3::PbbPacket::MessageEnd() [member function] cls.add_method('MessageEnd', 'std::_List_iterator< ns3::Ptr< ns3::PbbMessage > >', []) ## packetbb.h (module 'network'): std::_List_const_iterator<ns3::Ptr<ns3::PbbMessage> > ns3::PbbPacket::MessageEnd() const [member function] cls.add_method('MessageEnd', 'std::_List_const_iterator< ns3::Ptr< ns3::PbbMessage > >', [], is_const=True) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbMessage> ns3::PbbPacket::MessageFront() [member function] cls.add_method('MessageFront', 'ns3::Ptr< ns3::PbbMessage >', []) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbMessage> const ns3::PbbPacket::MessageFront() const [member function] cls.add_method('MessageFront', 'ns3::Ptr< ns3::PbbMessage > const', [], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbPacket::MessagePopBack() [member function] cls.add_method('MessagePopBack', 'void', []) ## packetbb.h (module 'network'): void ns3::PbbPacket::MessagePopFront() [member function] cls.add_method('MessagePopFront', 'void', []) ## packetbb.h (module 'network'): void ns3::PbbPacket::MessagePushBack(ns3::Ptr<ns3::PbbMessage> message) [member function] cls.add_method('MessagePushBack', 'void', [param('ns3::Ptr< ns3::PbbMessage >', 'message')]) ## packetbb.h (module 'network'): void ns3::PbbPacket::MessagePushFront(ns3::Ptr<ns3::PbbMessage> message) [member function] cls.add_method('MessagePushFront', 'void', [param('ns3::Ptr< ns3::PbbMessage >', 'message')]) ## packetbb.h (module 'network'): int ns3::PbbPacket::MessageSize() const [member function] cls.add_method('MessageSize', 'int', [], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbPacket::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) ## packetbb.h (module 'network'): void ns3::PbbPacket::Serialize(ns3::Buffer::Iterator start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator', 'start')], is_const=True, is_virtual=True) ## packetbb.h (module 'network'): void ns3::PbbPacket::SetSequenceNumber(uint16_t number) [member function] cls.add_method('SetSequenceNumber', 'void', [param('uint16_t', 'number')]) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbTlv> ns3::PbbPacket::TlvBack() [member function] cls.add_method('TlvBack', 'ns3::Ptr< ns3::PbbTlv >', []) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbTlv> const ns3::PbbPacket::TlvBack() const [member function] cls.add_method('TlvBack', 'ns3::Ptr< ns3::PbbTlv > const', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbTlv> > ns3::PbbPacket::TlvBegin() [member function] cls.add_method('TlvBegin', 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', []) ## packetbb.h (module 'network'): std::_List_const_iterator<ns3::Ptr<ns3::PbbTlv> > ns3::PbbPacket::TlvBegin() const [member function] cls.add_method('TlvBegin', 'std::_List_const_iterator< ns3::Ptr< ns3::PbbTlv > >', [], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbPacket::TlvClear() [member function] cls.add_method('TlvClear', 'void', []) ## packetbb.h (module 'network'): bool ns3::PbbPacket::TlvEmpty() const [member function] cls.add_method('TlvEmpty', 'bool', [], is_const=True) ## packetbb.h (module 'network'): std::_List_iterator<ns3::Ptr<ns3::PbbTlv> > ns3::PbbPacket::TlvEnd() [member function] cls.add_method('TlvEnd', 'std::_List_iterator< ns3::Ptr< ns3::PbbTlv > >', []) ## packetbb.h (module 'network'): std::_List_const_iterator<ns3::Ptr<ns3::PbbTlv> > ns3::PbbPacket::TlvEnd() const [member function] cls.add_method('TlvEnd', 'std::_List_const_iterator< ns3::Ptr< ns3::PbbTlv > >', [], is_const=True) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbTlv> ns3::PbbPacket::TlvFront() [member function] cls.add_method('TlvFront', 'ns3::Ptr< ns3::PbbTlv >', []) ## packetbb.h (module 'network'): ns3::Ptr<ns3::PbbTlv> const ns3::PbbPacket::TlvFront() const [member function] cls.add_method('TlvFront', 'ns3::Ptr< ns3::PbbTlv > const', [], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbPacket::TlvPopBack() [member function] cls.add_method('TlvPopBack', 'void', []) ## packetbb.h (module 'network'): void ns3::PbbPacket::TlvPopFront() [member function] cls.add_method('TlvPopFront', 'void', []) ## packetbb.h (module 'network'): void ns3::PbbPacket::TlvPushBack(ns3::Ptr<ns3::PbbTlv> tlv) [member function] cls.add_method('TlvPushBack', 'void', [param('ns3::Ptr< ns3::PbbTlv >', 'tlv')]) ## packetbb.h (module 'network'): void ns3::PbbPacket::TlvPushFront(ns3::Ptr<ns3::PbbTlv> tlv) [member function] cls.add_method('TlvPushFront', 'void', [param('ns3::Ptr< ns3::PbbTlv >', 'tlv')]) ## packetbb.h (module 'network'): int ns3::PbbPacket::TlvSize() const [member function] cls.add_method('TlvSize', 'int', [], is_const=True) return def register_Ns3PbbTlv_methods(root_module, cls): cls.add_binary_comparison_operator('==') cls.add_binary_comparison_operator('!=') ## packetbb.h (module 'network'): ns3::PbbTlv::PbbTlv(ns3::PbbTlv const & arg0) [copy constructor] cls.add_constructor([param('ns3::PbbTlv const &', 'arg0')]) ## packetbb.h (module 'network'): ns3::PbbTlv::PbbTlv() [constructor] cls.add_constructor([]) ## packetbb.h (module 'network'): void ns3::PbbTlv::Deserialize(ns3::Buffer::Iterator & start) [member function] cls.add_method('Deserialize', 'void', [param('ns3::Buffer::Iterator &', 'start')]) ## packetbb.h (module 'network'): uint32_t ns3::PbbTlv::GetSerializedSize() const [member function] cls.add_method('GetSerializedSize', 'uint32_t', [], is_const=True) ## packetbb.h (module 'network'): uint8_t ns3::PbbTlv::GetType() const [member function] cls.add_method('GetType', 'uint8_t', [], is_const=True) ## packetbb.h (module 'network'): uint8_t ns3::PbbTlv::GetTypeExt() const [member function] cls.add_method('GetTypeExt', 'uint8_t', [], is_const=True) ## packetbb.h (module 'network'): ns3::Buffer ns3::PbbTlv::GetValue() const [member function] cls.add_method('GetValue', 'ns3::Buffer', [], is_const=True) ## packetbb.h (module 'network'): bool ns3::PbbTlv::HasTypeExt() const [member function] cls.add_method('HasTypeExt', 'bool', [], is_const=True) ## packetbb.h (module 'network'): bool ns3::PbbTlv::HasValue() const [member function] cls.add_method('HasValue', 'bool', [], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbTlv::Print(std::ostream & os) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os')], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbTlv::Print(std::ostream & os, int level) const [member function] cls.add_method('Print', 'void', [param('std::ostream &', 'os'), param('int', 'level')], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbTlv::Serialize(ns3::Buffer::Iterator & start) const [member function] cls.add_method('Serialize', 'void', [param('ns3::Buffer::Iterator &', 'start')], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbTlv::SetType(uint8_t type) [member function] cls.add_method('SetType', 'void', [param('uint8_t', 'type')]) ## packetbb.h (module 'network'): void ns3::PbbTlv::SetTypeExt(uint8_t type) [member function] cls.add_method('SetTypeExt', 'void', [param('uint8_t', 'type')]) ## packetbb.h (module 'network'): void ns3::PbbTlv::SetValue(ns3::Buffer start) [member function] cls.add_method('SetValue', 'void', [param('ns3::Buffer', 'start')]) ## packetbb.h (module 'network'): void ns3::PbbTlv::SetValue(uint8_t const * buffer, uint32_t size) [member function] cls.add_method('SetValue', 'void', [param('uint8_t const *', 'buffer'), param('uint32_t', 'size')]) ## packetbb.h (module 'network'): uint8_t ns3::PbbTlv::GetIndexStart() const [member function] cls.add_method('GetIndexStart', 'uint8_t', [], is_const=True, visibility='protected') ## packetbb.h (module 'network'): uint8_t ns3::PbbTlv::GetIndexStop() const [member function] cls.add_method('GetIndexStop', 'uint8_t', [], is_const=True, visibility='protected') ## packetbb.h (module 'network'): bool ns3::PbbTlv::HasIndexStart() const [member function] cls.add_method('HasIndexStart', 'bool', [], is_const=True, visibility='protected') ## packetbb.h (module 'network'): bool ns3::PbbTlv::HasIndexStop() const [member function] cls.add_method('HasIndexStop', 'bool', [], is_const=True, visibility='protected') ## packetbb.h (module 'network'): bool ns3::PbbTlv::IsMultivalue() const [member function] cls.add_method('IsMultivalue', 'bool', [], is_const=True, visibility='protected') ## packetbb.h (module 'network'): void ns3::PbbTlv::SetIndexStart(uint8_t index) [member function] cls.add_method('SetIndexStart', 'void', [param('uint8_t', 'index')], visibility='protected') ## packetbb.h (module 'network'): void ns3::PbbTlv::SetIndexStop(uint8_t index) [member function] cls.add_method('SetIndexStop', 'void', [param('uint8_t', 'index')], visibility='protected') ## packetbb.h (module 'network'): void ns3::PbbTlv::SetMultivalue(bool isMultivalue) [member function] cls.add_method('SetMultivalue', 'void', [param('bool', 'isMultivalue')], visibility='protected') return def register_Ns3RandomVariableChecker_methods(root_module, cls): ## random-variable.h (module 'core'): ns3::RandomVariableChecker::RandomVariableChecker() [constructor] cls.add_constructor([]) ## random-variable.h (module 'core'): ns3::RandomVariableChecker::RandomVariableChecker(ns3::RandomVariableChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::RandomVariableChecker const &', 'arg0')]) return def register_Ns3RandomVariableValue_methods(root_module, cls): ## random-variable.h (module 'core'): ns3::RandomVariableValue::RandomVariableValue() [constructor] cls.add_constructor([]) ## random-variable.h (module 'core'): ns3::RandomVariableValue::RandomVariableValue(ns3::RandomVariableValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::RandomVariableValue const &', 'arg0')]) ## random-variable.h (module 'core'): ns3::RandomVariableValue::RandomVariableValue(ns3::RandomVariable const & value) [constructor] cls.add_constructor([param('ns3::RandomVariable const &', 'value')]) ## random-variable.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::RandomVariableValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## random-variable.h (module 'core'): bool ns3::RandomVariableValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## random-variable.h (module 'core'): ns3::RandomVariable ns3::RandomVariableValue::Get() const [member function] cls.add_method('Get', 'ns3::RandomVariable', [], is_const=True) ## random-variable.h (module 'core'): std::string ns3::RandomVariableValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## random-variable.h (module 'core'): void ns3::RandomVariableValue::Set(ns3::RandomVariable const & value) [member function] cls.add_method('Set', 'void', [param('ns3::RandomVariable const &', 'value')]) return def register_Ns3RateErrorModel_methods(root_module, cls): ## error-model.h (module 'network'): ns3::RateErrorModel::RateErrorModel(ns3::RateErrorModel const & arg0) [copy constructor] cls.add_constructor([param('ns3::RateErrorModel const &', 'arg0')]) ## error-model.h (module 'network'): ns3::RateErrorModel::RateErrorModel() [constructor] cls.add_constructor([]) ## error-model.h (module 'network'): double ns3::RateErrorModel::GetRate() const [member function] cls.add_method('GetRate', 'double', [], is_const=True) ## error-model.h (module 'network'): static ns3::TypeId ns3::RateErrorModel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## error-model.h (module 'network'): ns3::RateErrorModel::ErrorUnit ns3::RateErrorModel::GetUnit() const [member function] cls.add_method('GetUnit', 'ns3::RateErrorModel::ErrorUnit', [], is_const=True) ## error-model.h (module 'network'): void ns3::RateErrorModel::SetRandomVariable(ns3::RandomVariable const & ranvar) [member function] cls.add_method('SetRandomVariable', 'void', [param('ns3::RandomVariable const &', 'ranvar')]) ## error-model.h (module 'network'): void ns3::RateErrorModel::SetRate(double rate) [member function] cls.add_method('SetRate', 'void', [param('double', 'rate')]) ## error-model.h (module 'network'): void ns3::RateErrorModel::SetUnit(ns3::RateErrorModel::ErrorUnit error_unit) [member function] cls.add_method('SetUnit', 'void', [param('ns3::RateErrorModel::ErrorUnit', 'error_unit')]) ## error-model.h (module 'network'): bool ns3::RateErrorModel::DoCorrupt(ns3::Ptr<ns3::Packet> p) [member function] cls.add_method('DoCorrupt', 'bool', [param('ns3::Ptr< ns3::Packet >', 'p')], visibility='private', is_virtual=True) ## error-model.h (module 'network'): bool ns3::RateErrorModel::DoCorruptBit(ns3::Ptr<ns3::Packet> p) [member function] cls.add_method('DoCorruptBit', 'bool', [param('ns3::Ptr< ns3::Packet >', 'p')], visibility='private', is_virtual=True) ## error-model.h (module 'network'): bool ns3::RateErrorModel::DoCorruptByte(ns3::Ptr<ns3::Packet> p) [member function] cls.add_method('DoCorruptByte', 'bool', [param('ns3::Ptr< ns3::Packet >', 'p')], visibility='private', is_virtual=True) ## error-model.h (module 'network'): bool ns3::RateErrorModel::DoCorruptPkt(ns3::Ptr<ns3::Packet> p) [member function] cls.add_method('DoCorruptPkt', 'bool', [param('ns3::Ptr< ns3::Packet >', 'p')], visibility='private', is_virtual=True) ## error-model.h (module 'network'): void ns3::RateErrorModel::DoReset() [member function] cls.add_method('DoReset', 'void', [], visibility='private', is_virtual=True) return def register_Ns3ReceiveListErrorModel_methods(root_module, cls): ## error-model.h (module 'network'): ns3::ReceiveListErrorModel::ReceiveListErrorModel(ns3::ReceiveListErrorModel const & arg0) [copy constructor] cls.add_constructor([param('ns3::ReceiveListErrorModel const &', 'arg0')]) ## error-model.h (module 'network'): ns3::ReceiveListErrorModel::ReceiveListErrorModel() [constructor] cls.add_constructor([]) ## error-model.h (module 'network'): std::list<unsigned int, std::allocator<unsigned int> > ns3::ReceiveListErrorModel::GetList() const [member function] cls.add_method('GetList', 'std::list< unsigned int >', [], is_const=True) ## error-model.h (module 'network'): static ns3::TypeId ns3::ReceiveListErrorModel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## error-model.h (module 'network'): void ns3::ReceiveListErrorModel::SetList(std::list<unsigned int, std::allocator<unsigned int> > const & packetlist) [member function] cls.add_method('SetList', 'void', [param('std::list< unsigned int > const &', 'packetlist')]) ## error-model.h (module 'network'): bool ns3::ReceiveListErrorModel::DoCorrupt(ns3::Ptr<ns3::Packet> p) [member function] cls.add_method('DoCorrupt', 'bool', [param('ns3::Ptr< ns3::Packet >', 'p')], visibility='private', is_virtual=True) ## error-model.h (module 'network'): void ns3::ReceiveListErrorModel::DoReset() [member function] cls.add_method('DoReset', 'void', [], visibility='private', is_virtual=True) return def register_Ns3SimpleChannel_methods(root_module, cls): ## simple-channel.h (module 'network'): ns3::SimpleChannel::SimpleChannel(ns3::SimpleChannel const & arg0) [copy constructor] cls.add_constructor([param('ns3::SimpleChannel const &', 'arg0')]) ## simple-channel.h (module 'network'): ns3::SimpleChannel::SimpleChannel() [constructor] cls.add_constructor([]) ## simple-channel.h (module 'network'): void ns3::SimpleChannel::Add(ns3::Ptr<ns3::SimpleNetDevice> device) [member function] cls.add_method('Add', 'void', [param('ns3::Ptr< ns3::SimpleNetDevice >', 'device')]) ## simple-channel.h (module 'network'): ns3::Ptr<ns3::NetDevice> ns3::SimpleChannel::GetDevice(uint32_t i) const [member function] cls.add_method('GetDevice', 'ns3::Ptr< ns3::NetDevice >', [param('uint32_t', 'i')], is_const=True, is_virtual=True) ## simple-channel.h (module 'network'): uint32_t ns3::SimpleChannel::GetNDevices() const [member function] cls.add_method('GetNDevices', 'uint32_t', [], is_const=True, is_virtual=True) ## simple-channel.h (module 'network'): static ns3::TypeId ns3::SimpleChannel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## simple-channel.h (module 'network'): void ns3::SimpleChannel::Send(ns3::Ptr<ns3::Packet> p, uint16_t protocol, ns3::Mac48Address to, ns3::Mac48Address from, ns3::Ptr<ns3::SimpleNetDevice> sender) [member function] cls.add_method('Send', 'void', [param('ns3::Ptr< ns3::Packet >', 'p'), param('uint16_t', 'protocol'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from'), param('ns3::Ptr< ns3::SimpleNetDevice >', 'sender')]) return def register_Ns3SimpleNetDevice_methods(root_module, cls): ## simple-net-device.h (module 'network'): ns3::SimpleNetDevice::SimpleNetDevice(ns3::SimpleNetDevice const & arg0) [copy constructor] cls.add_constructor([param('ns3::SimpleNetDevice const &', 'arg0')]) ## simple-net-device.h (module 'network'): ns3::SimpleNetDevice::SimpleNetDevice() [constructor] cls.add_constructor([]) ## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::AddLinkChangeCallback(ns3::Callback<void,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> callback) [member function] cls.add_method('AddLinkChangeCallback', 'void', [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], is_virtual=True) ## simple-net-device.h (module 'network'): ns3::Address ns3::SimpleNetDevice::GetAddress() const [member function] cls.add_method('GetAddress', 'ns3::Address', [], is_const=True, is_virtual=True) ## simple-net-device.h (module 'network'): ns3::Address ns3::SimpleNetDevice::GetBroadcast() const [member function] cls.add_method('GetBroadcast', 'ns3::Address', [], is_const=True, is_virtual=True) ## simple-net-device.h (module 'network'): ns3::Ptr<ns3::Channel> ns3::SimpleNetDevice::GetChannel() const [member function] cls.add_method('GetChannel', 'ns3::Ptr< ns3::Channel >', [], is_const=True, is_virtual=True) ## simple-net-device.h (module 'network'): uint32_t ns3::SimpleNetDevice::GetIfIndex() const [member function] cls.add_method('GetIfIndex', 'uint32_t', [], is_const=True, is_virtual=True) ## simple-net-device.h (module 'network'): uint16_t ns3::SimpleNetDevice::GetMtu() const [member function] cls.add_method('GetMtu', 'uint16_t', [], is_const=True, is_virtual=True) ## simple-net-device.h (module 'network'): ns3::Address ns3::SimpleNetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function] cls.add_method('GetMulticast', 'ns3::Address', [param('ns3::Ipv4Address', 'multicastGroup')], is_const=True, is_virtual=True) ## simple-net-device.h (module 'network'): ns3::Address ns3::SimpleNetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function] cls.add_method('GetMulticast', 'ns3::Address', [param('ns3::Ipv6Address', 'addr')], is_const=True, is_virtual=True) ## simple-net-device.h (module 'network'): ns3::Ptr<ns3::Node> ns3::SimpleNetDevice::GetNode() const [member function] cls.add_method('GetNode', 'ns3::Ptr< ns3::Node >', [], is_const=True, is_virtual=True) ## simple-net-device.h (module 'network'): static ns3::TypeId ns3::SimpleNetDevice::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) ## simple-net-device.h (module 'network'): bool ns3::SimpleNetDevice::IsBridge() const [member function] cls.add_method('IsBridge', 'bool', [], is_const=True, is_virtual=True) ## simple-net-device.h (module 'network'): bool ns3::SimpleNetDevice::IsBroadcast() const [member function] cls.add_method('IsBroadcast', 'bool', [], is_const=True, is_virtual=True) ## simple-net-device.h (module 'network'): bool ns3::SimpleNetDevice::IsLinkUp() const [member function] cls.add_method('IsLinkUp', 'bool', [], is_const=True, is_virtual=True) ## simple-net-device.h (module 'network'): bool ns3::SimpleNetDevice::IsMulticast() const [member function] cls.add_method('IsMulticast', 'bool', [], is_const=True, is_virtual=True) ## simple-net-device.h (module 'network'): bool ns3::SimpleNetDevice::IsPointToPoint() const [member function] cls.add_method('IsPointToPoint', 'bool', [], is_const=True, is_virtual=True) ## simple-net-device.h (module 'network'): bool ns3::SimpleNetDevice::NeedsArp() const [member function] cls.add_method('NeedsArp', 'bool', [], is_const=True, is_virtual=True) ## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::Receive(ns3::Ptr<ns3::Packet> packet, uint16_t protocol, ns3::Mac48Address to, ns3::Mac48Address from) [member function] cls.add_method('Receive', 'void', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('uint16_t', 'protocol'), param('ns3::Mac48Address', 'to'), param('ns3::Mac48Address', 'from')]) ## simple-net-device.h (module 'network'): bool ns3::SimpleNetDevice::Send(ns3::Ptr<ns3::Packet> packet, ns3::Address const & dest, uint16_t protocolNumber) [member function] cls.add_method('Send', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], is_virtual=True) ## simple-net-device.h (module 'network'): bool ns3::SimpleNetDevice::SendFrom(ns3::Ptr<ns3::Packet> packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function] cls.add_method('SendFrom', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')], is_virtual=True) ## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::SetAddress(ns3::Address address) [member function] cls.add_method('SetAddress', 'void', [param('ns3::Address', 'address')], is_virtual=True) ## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::SetChannel(ns3::Ptr<ns3::SimpleChannel> channel) [member function] cls.add_method('SetChannel', 'void', [param('ns3::Ptr< ns3::SimpleChannel >', 'channel')]) ## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::SetIfIndex(uint32_t const index) [member function] cls.add_method('SetIfIndex', 'void', [param('uint32_t const', 'index')], is_virtual=True) ## simple-net-device.h (module 'network'): bool ns3::SimpleNetDevice::SetMtu(uint16_t const mtu) [member function] cls.add_method('SetMtu', 'bool', [param('uint16_t const', 'mtu')], is_virtual=True) ## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::SetNode(ns3::Ptr<ns3::Node> node) [member function] cls.add_method('SetNode', 'void', [param('ns3::Ptr< ns3::Node >', 'node')], is_virtual=True) ## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::SetPromiscReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> cb) [member function] cls.add_method('SetPromiscReceiveCallback', 'void', [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'cb')], is_virtual=True) ## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::SetReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> cb) [member function] cls.add_method('SetReceiveCallback', 'void', [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')], is_virtual=True) ## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::SetReceiveErrorModel(ns3::Ptr<ns3::ErrorModel> em) [member function] cls.add_method('SetReceiveErrorModel', 'void', [param('ns3::Ptr< ns3::ErrorModel >', 'em')]) ## simple-net-device.h (module 'network'): bool ns3::SimpleNetDevice::SupportsSendFrom() const [member function] cls.add_method('SupportsSendFrom', 'bool', [], is_const=True, is_virtual=True) ## simple-net-device.h (module 'network'): void ns3::SimpleNetDevice::DoDispose() [member function] cls.add_method('DoDispose', 'void', [], visibility='protected', is_virtual=True) return def register_Ns3TimeChecker_methods(root_module, cls): ## nstime.h (module 'core'): ns3::TimeChecker::TimeChecker() [constructor] cls.add_constructor([]) ## nstime.h (module 'core'): ns3::TimeChecker::TimeChecker(ns3::TimeChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::TimeChecker const &', 'arg0')]) return def register_Ns3TimeValue_methods(root_module, cls): ## nstime.h (module 'core'): ns3::TimeValue::TimeValue() [constructor] cls.add_constructor([]) ## nstime.h (module 'core'): ns3::TimeValue::TimeValue(ns3::TimeValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::TimeValue const &', 'arg0')]) ## nstime.h (module 'core'): ns3::TimeValue::TimeValue(ns3::Time const & value) [constructor] cls.add_constructor([param('ns3::Time const &', 'value')]) ## nstime.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::TimeValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## nstime.h (module 'core'): bool ns3::TimeValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## nstime.h (module 'core'): ns3::Time ns3::TimeValue::Get() const [member function] cls.add_method('Get', 'ns3::Time', [], is_const=True) ## nstime.h (module 'core'): std::string ns3::TimeValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## nstime.h (module 'core'): void ns3::TimeValue::Set(ns3::Time const & value) [member function] cls.add_method('Set', 'void', [param('ns3::Time const &', 'value')]) return def register_Ns3TypeIdChecker_methods(root_module, cls): ## type-id.h (module 'core'): ns3::TypeIdChecker::TypeIdChecker() [constructor] cls.add_constructor([]) ## type-id.h (module 'core'): ns3::TypeIdChecker::TypeIdChecker(ns3::TypeIdChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::TypeIdChecker const &', 'arg0')]) return def register_Ns3TypeIdValue_methods(root_module, cls): ## type-id.h (module 'core'): ns3::TypeIdValue::TypeIdValue() [constructor] cls.add_constructor([]) ## type-id.h (module 'core'): ns3::TypeIdValue::TypeIdValue(ns3::TypeIdValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::TypeIdValue const &', 'arg0')]) ## type-id.h (module 'core'): ns3::TypeIdValue::TypeIdValue(ns3::TypeId const & value) [constructor] cls.add_constructor([param('ns3::TypeId const &', 'value')]) ## type-id.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::TypeIdValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## type-id.h (module 'core'): bool ns3::TypeIdValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## type-id.h (module 'core'): ns3::TypeId ns3::TypeIdValue::Get() const [member function] cls.add_method('Get', 'ns3::TypeId', [], is_const=True) ## type-id.h (module 'core'): std::string ns3::TypeIdValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## type-id.h (module 'core'): void ns3::TypeIdValue::Set(ns3::TypeId const & value) [member function] cls.add_method('Set', 'void', [param('ns3::TypeId const &', 'value')]) return def register_Ns3AddressChecker_methods(root_module, cls): ## address.h (module 'network'): ns3::AddressChecker::AddressChecker() [constructor] cls.add_constructor([]) ## address.h (module 'network'): ns3::AddressChecker::AddressChecker(ns3::AddressChecker const & arg0) [copy constructor] cls.add_constructor([param('ns3::AddressChecker const &', 'arg0')]) return def register_Ns3AddressValue_methods(root_module, cls): ## address.h (module 'network'): ns3::AddressValue::AddressValue() [constructor] cls.add_constructor([]) ## address.h (module 'network'): ns3::AddressValue::AddressValue(ns3::AddressValue const & arg0) [copy constructor] cls.add_constructor([param('ns3::AddressValue const &', 'arg0')]) ## address.h (module 'network'): ns3::AddressValue::AddressValue(ns3::Address const & value) [constructor] cls.add_constructor([param('ns3::Address const &', 'value')]) ## address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::AddressValue::Copy() const [member function] cls.add_method('Copy', 'ns3::Ptr< ns3::AttributeValue >', [], is_const=True, is_virtual=True) ## address.h (module 'network'): bool ns3::AddressValue::DeserializeFromString(std::string value, ns3::Ptr<ns3::AttributeChecker const> checker) [member function] cls.add_method('DeserializeFromString', 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) ## address.h (module 'network'): ns3::Address ns3::AddressValue::Get() const [member function] cls.add_method('Get', 'ns3::Address', [], is_const=True) ## address.h (module 'network'): std::string ns3::AddressValue::SerializeToString(ns3::Ptr<ns3::AttributeChecker const> checker) const [member function] cls.add_method('SerializeToString', 'std::string', [param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_const=True, is_virtual=True) ## address.h (module 'network'): void ns3::AddressValue::Set(ns3::Address const & value) [member function] cls.add_method('Set', 'void', [param('ns3::Address const &', 'value')]) return def register_Ns3PbbAddressTlv_methods(root_module, cls): ## packetbb.h (module 'network'): ns3::PbbAddressTlv::PbbAddressTlv() [constructor] cls.add_constructor([]) ## packetbb.h (module 'network'): ns3::PbbAddressTlv::PbbAddressTlv(ns3::PbbAddressTlv const & arg0) [copy constructor] cls.add_constructor([param('ns3::PbbAddressTlv const &', 'arg0')]) ## packetbb.h (module 'network'): uint8_t ns3::PbbAddressTlv::GetIndexStart() const [member function] cls.add_method('GetIndexStart', 'uint8_t', [], is_const=True) ## packetbb.h (module 'network'): uint8_t ns3::PbbAddressTlv::GetIndexStop() const [member function] cls.add_method('GetIndexStop', 'uint8_t', [], is_const=True) ## packetbb.h (module 'network'): bool ns3::PbbAddressTlv::HasIndexStart() const [member function] cls.add_method('HasIndexStart', 'bool', [], is_const=True) ## packetbb.h (module 'network'): bool ns3::PbbAddressTlv::HasIndexStop() const [member function] cls.add_method('HasIndexStop', 'bool', [], is_const=True) ## packetbb.h (module 'network'): bool ns3::PbbAddressTlv::IsMultivalue() const [member function] cls.add_method('IsMultivalue', 'bool', [], is_const=True) ## packetbb.h (module 'network'): void ns3::PbbAddressTlv::SetIndexStart(uint8_t index) [member function] cls.add_method('SetIndexStart', 'void', [param('uint8_t', 'index')]) ## packetbb.h (module 'network'): void ns3::PbbAddressTlv::SetIndexStop(uint8_t index) [member function] cls.add_method('SetIndexStop', 'void', [param('uint8_t', 'index')]) ## packetbb.h (module 'network'): void ns3::PbbAddressTlv::SetMultivalue(bool isMultivalue) [member function] cls.add_method('SetMultivalue', 'void', [param('bool', 'isMultivalue')]) return def register_functions(root_module): module = root_module ## address.h (module 'network'): extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeAddressChecker() [free function] module.add_function('MakeAddressChecker', 'ns3::Ptr< ns3::AttributeChecker const >', []) ## data-rate.h (module 'network'): extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeDataRateChecker() [free function] module.add_function('MakeDataRateChecker', 'ns3::Ptr< ns3::AttributeChecker const >', []) ## ipv4-address.h (module 'network'): extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeIpv4AddressChecker() [free function] module.add_function('MakeIpv4AddressChecker', 'ns3::Ptr< ns3::AttributeChecker const >', []) ## ipv4-address.h (module 'network'): extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeIpv4MaskChecker() [free function] module.add_function('MakeIpv4MaskChecker', 'ns3::Ptr< ns3::AttributeChecker const >', []) ## ipv6-address.h (module 'network'): extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeIpv6AddressChecker() [free function] module.add_function('MakeIpv6AddressChecker', 'ns3::Ptr< ns3::AttributeChecker const >', []) ## ipv6-address.h (module 'network'): extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeIpv6PrefixChecker() [free function] module.add_function('MakeIpv6PrefixChecker', 'ns3::Ptr< ns3::AttributeChecker const >', []) ## mac48-address.h (module 'network'): extern ns3::Ptr<ns3::AttributeChecker const> ns3::MakeMac48AddressChecker() [free function] module.add_function('MakeMac48AddressChecker', 'ns3::Ptr< ns3::AttributeChecker const >', []) ## address-utils.h (module 'network'): extern void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Address & ad, uint32_t len) [free function] module.add_function('ReadFrom', 'void', [param('ns3::Buffer::Iterator &', 'i'), param('ns3::Address &', 'ad'), param('uint32_t', 'len')]) ## address-utils.h (module 'network'): extern void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Ipv4Address & ad) [free function] module.add_function('ReadFrom', 'void', [param('ns3::Buffer::Iterator &', 'i'), param('ns3::Ipv4Address &', 'ad')]) ## address-utils.h (module 'network'): extern void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Ipv6Address & ad) [free function] module.add_function('ReadFrom', 'void', [param('ns3::Buffer::Iterator &', 'i'), param('ns3::Ipv6Address &', 'ad')]) ## address-utils.h (module 'network'): extern void ns3::ReadFrom(ns3::Buffer::Iterator & i, ns3::Mac48Address & ad) [free function] module.add_function('ReadFrom', 'void', [param('ns3::Buffer::Iterator &', 'i'), param('ns3::Mac48Address &', 'ad')]) ## address-utils.h (module 'network'): extern void ns3::WriteTo(ns3::Buffer::Iterator & i, ns3::Address const & ad) [free function] module.add_function('WriteTo', 'void', [param('ns3::Buffer::Iterator &', 'i'), param('ns3::Address const &', 'ad')]) ## address-utils.h (module 'network'): extern void ns3::WriteTo(ns3::Buffer::Iterator & i, ns3::Ipv4Address ad) [free function] module.add_function('WriteTo', 'void', [param('ns3::Buffer::Iterator &', 'i'), param('ns3::Ipv4Address', 'ad')]) ## address-utils.h (module 'network'): extern void ns3::WriteTo(ns3::Buffer::Iterator & i, ns3::Ipv6Address ad) [free function] module.add_function('WriteTo', 'void', [param('ns3::Buffer::Iterator &', 'i'), param('ns3::Ipv6Address', 'ad')]) ## address-utils.h (module 'network'): extern void ns3::WriteTo(ns3::Buffer::Iterator & i, ns3::Mac48Address ad) [free function] module.add_function('WriteTo', 'void', [param('ns3::Buffer::Iterator &', 'i'), param('ns3::Mac48Address', 'ad')]) register_functions_ns3_FatalImpl(module.get_submodule('FatalImpl'), root_module) register_functions_ns3_addressUtils(module.get_submodule('addressUtils'), root_module) return def register_functions_ns3_FatalImpl(module, root_module): return def register_functions_ns3_addressUtils(module, root_module): ## address-utils.h (module 'network'): extern bool ns3::addressUtils::IsMulticast(ns3::Address const & ad) [free function] module.add_function('IsMulticast', 'bool', [param('ns3::Address const &', 'ad')]) return def main(): out = FileCodeSink(sys.stdout) root_module = module_init() register_types(root_module) register_methods(root_module) register_functions(root_module) root_module.generate(out) if __name__ == '__main__': main()<|fim▁end|>
## socket.h (module 'network'): ns3::Socket::Socket(ns3::Socket const & arg0) [copy constructor] cls.add_constructor([param('ns3::Socket const &', 'arg0')]) ## socket.h (module 'network'): ns3::Socket::Socket() [constructor]
<|file_name|>Data.java<|end_file_name|><|fim▁begin|>package ibxm; /* A data array dynamically loaded from an InputStream. */ public class Data { private int bufLen; private byte[] buffer; private java.io.InputStream stream; public Data( java.io.InputStream inputStream ) throws java.io.IOException { bufLen = 1 << 16; buffer = new byte[ bufLen ]; stream = inputStream; readFully( stream, buffer, 0, bufLen ); } public Data( byte[] data ) { bufLen = data.length; buffer = data; } public byte sByte( int offset ) throws java.io.IOException { load( offset, 1 ); return buffer[ offset ]; } public int uByte( int offset ) throws java.io.IOException { load( offset, 1 ); return buffer[ offset ] & 0xFF; } public int ubeShort( int offset ) throws java.io.IOException { load( offset, 2 ); return ( ( buffer[ offset ] & 0xFF ) << 8 ) | ( buffer[ offset + 1 ] & 0xFF ); } public int uleShort( int offset ) throws java.io.IOException { load( offset, 2 ); return ( buffer[ offset ] & 0xFF ) | ( ( buffer[ offset + 1 ] & 0xFF ) << 8 ); } public int uleInt( int offset ) throws java.io.IOException { load( offset, 4 ); int value = buffer[ offset ] & 0xFF; value = value | ( ( buffer[ offset + 1 ] & 0xFF ) << 8 ); value = value | ( ( buffer[ offset + 2 ] & 0xFF ) << 16 ); value = value | ( ( buffer[ offset + 3 ] & 0x7F ) << 24 ); return value; } public String strLatin1( int offset, int length ) throws java.io.IOException { load( offset, length ); char[] str = new char[ length ]; for( int idx = 0; idx < length; idx++ ) { int chr = buffer[ offset + idx ] & 0xFF; str[ idx ] = chr < 32 ? 32 : ( char ) chr; } return new String( str ); } public String strCp850( int offset, int length ) throws java.io.IOException { load( offset, length ); try { char[] str = new String( buffer, offset, length, "Cp850" ).toCharArray(); for( int idx = 0; idx < str.length; idx++ ) { str[ idx ] = str[ idx ] < 32 ? 32 : str[ idx ]; } return new String( str ); } catch( java.io.UnsupportedEncodingException e ) { return strLatin1( offset, length ); } } public short[] samS8( int offset, int length ) throws java.io.IOException { load( offset, length ); short[] sampleData = new short[ length ]; for( int idx = 0; idx < length; idx++ ) { sampleData[ idx ] = ( short ) ( buffer[ offset + idx ] << 8 ); } return sampleData; } public short[] samS8D( int offset, int length ) throws java.io.IOException { load( offset, length ); short[] sampleData = new short[ length ]; int sam = 0; for( int idx = 0; idx < length; idx++ ) { sam += buffer[ offset + idx ]; sampleData[ idx ] = ( short ) ( sam << 8 ); } return sampleData; } public short[] samU8( int offset, int length ) throws java.io.IOException { load( offset, length ); short[] sampleData = new short[ length ]; for( int idx = 0; idx < length; idx++ ) { sampleData[ idx ] = ( short ) ( ( ( buffer[ offset + idx ] & 0xFF ) - 128 ) << 8 ); } return sampleData; } public short[] samS16( int offset, int samples ) throws java.io.IOException { load( offset, samples * 2 ); short[] sampleData = new short[ samples ]; for( int idx = 0; idx < samples; idx++ ) { sampleData[ idx ] = ( short ) ( ( buffer[ offset + idx * 2 ] & 0xFF ) | ( buffer[ offset + idx * 2 + 1 ] << 8 ) ); } return sampleData; } public short[] samS16D( int offset, int samples ) throws java.io.IOException { load( offset, samples * 2 ); short[] sampleData = new short[ samples ]; int sam = 0; for( int idx = 0; idx < samples; idx++ ) { sam += ( buffer[ offset + idx * 2 ] & 0xFF ) | ( buffer[ offset + idx * 2 + 1 ] << 8 ); sampleData[ idx ] = ( short ) sam; } return sampleData;<|fim▁hole|> public short[] samU16( int offset, int samples ) throws java.io.IOException { load( offset, samples * 2 ); short[] sampleData = new short[ samples ]; for( int idx = 0; idx < samples; idx++ ) { int sam = ( buffer[ offset + idx * 2 ] & 0xFF ) | ( ( buffer[ offset + idx * 2 + 1 ] & 0xFF ) << 8 ); sampleData[ idx ] = ( short ) ( sam - 32768 ); } return sampleData; } private void load( int offset, int length ) throws java.io.IOException { while( offset + length > bufLen ) { int newBufLen = bufLen << 1; byte[] newBuf = new byte[ newBufLen ]; System.arraycopy( buffer, 0, newBuf, 0, bufLen ); if( stream != null ) { readFully( stream, newBuf, bufLen, newBufLen - bufLen ); } bufLen = newBufLen; buffer = newBuf; } } private static void readFully( java.io.InputStream inputStream, byte[] buffer, int offset, int length ) throws java.io.IOException { int read = 1, end = offset + length; while( read > 0 ) { read = inputStream.read( buffer, offset, end - offset ); offset += read; } } }<|fim▁end|>
}
<|file_name|>test_resource.py<|end_file_name|><|fim▁begin|># 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. from openstack.tests.unit import base from openstack.orchestration.v1 import resource FAKE_ID = '32e39358-2422-4ad0-a1b5-dd60696bf564' FAKE_NAME = 'test_stack' FAKE = { 'links': [{ 'href': 'http://res_link', 'rel': 'self' }, { 'href': 'http://stack_link', 'rel': 'stack'<|fim▁hole|> 'required_by': [], 'resource_type': 'OS::Heat::FakeResource', 'status': 'CREATE_COMPLETE', 'status_reason': 'state changed', 'updated_time': '2015-03-09T12:15:57.233772', } class TestResource(base.TestCase): def test_basic(self): sot = resource.Resource() self.assertEqual('resource', sot.resource_key) self.assertEqual('resources', sot.resources_key) self.assertEqual('/stacks/%(stack_name)s/%(stack_id)s/resources', sot.base_path) self.assertFalse(sot.allow_create) self.assertFalse(sot.allow_retrieve) self.assertFalse(sot.allow_commit) self.assertFalse(sot.allow_delete) self.assertTrue(sot.allow_list) def test_make_it(self): sot = resource.Resource(**FAKE) self.assertEqual(FAKE['links'], sot.links) self.assertEqual(FAKE['logical_resource_id'], sot.logical_resource_id) self.assertEqual(FAKE['name'], sot.name) self.assertEqual(FAKE['physical_resource_id'], sot.physical_resource_id) self.assertEqual(FAKE['required_by'], sot.required_by) self.assertEqual(FAKE['resource_type'], sot.resource_type) self.assertEqual(FAKE['status'], sot.status) self.assertEqual(FAKE['status_reason'], sot.status_reason) self.assertEqual(FAKE['updated_time'], sot.updated_at)<|fim▁end|>
}], 'logical_resource_id': 'the_resource', 'name': 'the_resource', 'physical_resource_id': '9f38ab5a-37c8-4e40-9702-ce27fc5f6954',
<|file_name|>hi.py<|end_file_name|><|fim▁begin|># !usr/bin/env python # -*- coding: utf-8 -*- # # Licensed under a 3-clause BSD license. # # @Author: Brian Cherinka # @Date: 2018-10-11 17:51:43 # @Last modified by: Brian Cherinka # @Last Modified time: 2018-11-29 17:23:15 from __future__ import print_function, division, absolute_import import numpy as np import astropy import astropy.units as u import marvin.tools from marvin.tools.quantities.spectrum import Spectrum from marvin.utils.general.general import get_drpall_table<|fim▁hole|> from .base import VACMixIn, VACTarget def choose_best_spectrum(par1, par2, conf_thresh=0.1): '''choose optimal HI spectrum based on the following criteria: (1) If both detected and unconfused, choose highest SNR (2) If both detected and both confused, choose lower confusion prob. (3) If both detected and one confused, choose non-confused (4) If one non-confused detection and one non-detection, go with detection (5) If one confused detetion and one non-detection, go with non-detection (6) If niether detected, choose lowest rms par1 and par2 are dictionaries with the following parameters: program - gbt or alfalfa snr - integrated SNR rms - rms noise level conf_prob - confusion probability conf_thresh = maximum confusion probability below which we classify the object as essentially unconfused. Default to 0.1 following (Stark+21) ''' programs = [par1['program'],par2['program']] sel_high_snr = np.argmax([par1['snr'],par2['snr']]) sel_low_rms = np.argmin([par1['rms'],par2['rms']]) sel_low_conf = np.argmin([par1['conf_prob'],par2['conf_prob']]) #both detected if (par1['snr'] > 0) & (par2['snr'] > 0): if (par1['conf_prob'] <= conf_thresh) & (par2['conf_prob'] <= conf_thresh): pick = sel_high_snr elif (par1['conf_prob'] <= conf_thresh) & (par2['conf_prob'] > conf_thresh): pick = 0 elif (par1['conf_prob'] > conf_thresh) & (par2['conf_prob'] <= conf_thresh): pick = 1 elif (par1['conf_prob'] > conf_thresh) & (par2['conf_prob'] > conf_thresh): pick = sel_low_conf #both nondetected elif (par1['snr'] <= 0) & (par2['snr'] <= 0): pick = sel_low_rms #one detected elif (par1['snr'] > 0) & (par2['snr'] <= 0): if par1['conf_prob'] < conf_thresh: pick=0 else: pick=1 elif (par1['snr'] <= 0) & (par2['snr'] > 0): if par2['conf_prob'] < conf_thresh: pick=1 else: pick=0 return programs[pick] class HIVAC(VACMixIn): """Provides access to the MaNGA-HI VAC. VAC name: HI URL: https://www.sdss.org/dr17/data_access/value-added-catalogs/?vac_id=hi-manga-data-release-1 Description: Returns HI summary data and spectra Authors: David Stark and Karen Masters """ # Required parameters name = 'HI' description = 'Returns HI summary data and spectra' version = {'MPL-7': 'v1_0_1', 'DR15': 'v1_0_1', 'DR16': 'v1_0_2', 'DR17': 'v2_0_1', 'MPL-11': 'v2_0_1'} display_name = 'HI' url = 'https://www.sdss.org/dr17/data_access/value-added-catalogs/?vac_id=hi-manga-data-release-1' # optional Marvin Tools to attach your vac to include = (marvin.tools.cube.Cube, marvin.tools.maps.Maps, marvin.tools.modelcube.ModelCube) # optional methods to attach to your main VAC tool in ~marvin.tools.vacs.VACs add_methods = ['plot_mass_fraction'] # Required method def set_summary_file(self, release): ''' Sets the path to the HI summary file ''' # define the variables to build a unique path to your VAC file self.path_params = {'ver': self.version[release], 'type': 'all', 'program': 'GBT16A_095'} # get_path returns False if the files do not exist locally self.summary_file = self.get_path("mangahisum", path_params=self.path_params) def set_program(self,plateifu): # download the vac from the SAS if it does not already exist locally if not self.file_exists(self.summary_file): self.summary_file = self.download_vac('mangahisum', path_params=self.path_params) # Find all entries in summary file with this plate-ifu. # Need the full summary file data. # Find best entry between GBT/ALFALFA based on dept and confusion. # Then update self.path_params['program'] with alfalfa or gbt. summary = HITarget(plateifu, vacfile=self.summary_file)._data galinfo = summary[summary['plateifu'] == plateifu] if len(galinfo) == 1 and galinfo['session']=='ALFALFA': program = 'alfalfa' elif len(galinfo) in [0, 1]: # if no entry found or session is GBT, default program to gbt program = 'gbt' else: par1 = {'program': 'gbt','snr': 0.,'rms': galinfo[0]['rms'], 'conf_prob': galinfo[0]['conf_prob']} par2 = {'program': 'gbt','snr': 0.,'rms': galinfo[1]['rms'], 'conf_prob': galinfo[1]['conf_prob']} if galinfo[0]['session']=='ALFALFA': par1['program'] = 'alfalfa' if galinfo[1]['session']=='ALFALFA': par2['program'] = 'alfalfa' if galinfo[0]['fhi'] > 0: par1['snr'] = galinfo[0]['fhi']/galinfo[0]['efhi'] if galinfo[1]['fhi'] > 0: par2['snr'] = galinfo[1]['fhi']/galinfo[1]['efhi'] program = choose_best_spectrum(par1,par2) log.info('Using HI data from {0}'.format(program)) # get path to ancillary VAC file for target HI spectra self.update_path_params({'program':program}) # Required method def get_target(self, parent_object): ''' Accesses VAC data for a specific target from a Marvin Tool object ''' # get any parameters you need from the parent object plateifu = parent_object.plateifu self.update_path_params({'plateifu': plateifu}) if parent_object.release in ['DR17', 'MPL-11']: self.set_program(plateifu) specfile = self.get_path('mangahispectra', path_params=self.path_params) # create container for more complex return data hidata = HITarget(plateifu, vacfile=self.summary_file, specfile=specfile) # get the spectral data for that row if it exists if hidata._indata and not self.file_exists(specfile): hidata._specfile = self.download_vac('mangahispectra', path_params=self.path_params) return hidata class HITarget(VACTarget): ''' A customized target class to also display HI spectra This class handles data from both the HI summary file and the individual spectral files. Row data from the summary file for the given target is returned via the `data` property. Spectral data can be displayed via the the `plot_spectrum` method. Parameters: targetid (str): The plateifu or mangaid designation vacfile (str): The path of the VAC summary file specfile (str): The path to the HI spectra Attributes: data: The target row data from the main VAC file targetid (str): The target identifier ''' def __init__(self, targetid, vacfile, specfile=None): super(HITarget, self).__init__(targetid, vacfile) self._specfile = specfile self._specdata = None def plot_spectrum(self): ''' Plot the HI spectrum ''' if self._specfile: if not self._specdata: self._specdata = self._get_data(self._specfile) vel = self._specdata['VHI'][0] flux = self._specdata['FHI'][0] spec = Spectrum(flux, unit=u.Jy, wavelength=vel, wavelength_unit=u.km / u.s) ax = spec.plot( ylabel='HI\ Flux\ Density', xlabel='Velocity', title=self.targetid, ytrim='minmax' ) return ax return None # # Functions to become available on your VAC in marvin.tools.vacs.VACs def plot_mass_fraction(vacdata_object): ''' Plot the HI mass fraction Computes and plots the HI mass fraction using the NSA elliptical Petrosian stellar mass from the MaNGA DRPall file. Only plots data for subset of targets in both the HI VAC and the DRPall file. Parameters: vacdata_object (object): The `~.VACDataClass` instance of the HI VAC Example: >>> from marvin.tools.vacs import VACs >>> v = VACs() >>> hi = v.HI >>> hi.plot_mass_fraction() ''' drpall = get_drpall_table() drpall.add_index('plateifu') data = vacdata_object.data[1].data subset = drpall.loc[data['plateifu']] log_stmass = np.log10(subset['nsa_elpetro_mass']) diff = data['logMHI'] - log_stmass fig, axes = scatplot( log_stmass, diff, with_hist=False, ylim=[-5, 5], xlabel=r'log $M_*$', ylabel=r'log $M_{HI}/M_*$', ) return axes[0]<|fim▁end|>
from marvin.utils.plot.scatter import plot as scatplot from marvin import log
<|file_name|>latex.py<|end_file_name|><|fim▁begin|>"""LaTeX Exporter class""" <|fim▁hole|># Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import os from traitlets import Unicode, default from traitlets.config import Config from nbconvert.filters.highlight import Highlight2Latex from nbconvert.filters.filter_links import resolve_references from .templateexporter import TemplateExporter class LatexExporter(TemplateExporter): """ Exports to a Latex template. Inherit from this class if your template is LaTeX based and you need custom tranformers/filters. Inherit from it if you are writing your own HTML template and need custom tranformers/filters. If you don't need custom tranformers/filters, just change the 'template_file' config option. Place your template in the special "/latex" subfolder of the "../templates" folder. """ @default('file_extension') def _file_extension_default(self): return '.tex' @default('template_file') def _template_file_default(self): return 'article.tplx' # Latex constants @default('default_template_path') def _default_template_path_default(self): return os.path.join("..", "templates", "latex") @default('template_skeleton_path') def _template_skeleton_path_default(self): return os.path.join("..", "templates", "latex", "skeleton") #Extension that the template files use. template_extension = Unicode(".tplx").tag(config=True) output_mimetype = 'text/latex' def default_filters(self): for x in super(LatexExporter, self).default_filters(): yield x yield ('resolve_references', resolve_references) @property def default_config(self): c = Config({ 'NbConvertBase': { 'display_data_priority' : ['text/latex', 'application/pdf', 'image/png', 'image/jpeg', 'image/svg+xml', 'text/markdown', 'text/plain'] }, 'ExtractOutputPreprocessor': { 'enabled':True }, 'SVG2PDFPreprocessor': { 'enabled':True }, 'LatexPreprocessor': { 'enabled':True }, 'SphinxPreprocessor': { 'enabled':True }, 'HighlightMagicsPreprocessor': { 'enabled':True } }) c.merge(super(LatexExporter,self).default_config) return c def from_notebook_node(self, nb, resources=None, **kw): langinfo = nb.metadata.get('language_info', {}) lexer = langinfo.get('pygments_lexer', langinfo.get('name', None)) self.register_filter('highlight_code', Highlight2Latex(pygments_lexer=lexer, parent=self)) return super(LatexExporter, self).from_notebook_node(nb, resources, **kw) def _create_environment(self): environment = super(LatexExporter, self)._create_environment() # Set special Jinja2 syntax that will not conflict with latex. environment.block_start_string = "((*" environment.block_end_string = "*))" environment.variable_start_string = "(((" environment.variable_end_string = ")))" environment.comment_start_string = "((=" environment.comment_end_string = "=))" return environment<|fim▁end|>
<|file_name|>macros.rs<|end_file_name|><|fim▁begin|>macro_rules! assert_almost_eq { ($cond1:expr, $cond2:expr, $err:expr) => ({ use std::num::Float; let c1 = $cond1;<|fim▁hole|> assert!((c1 - c2).abs() < $err, "{} is not almost equal to {}", c1, c2); }) }<|fim▁end|>
let c2 = $cond2;
<|file_name|>storwize_svc_common.py<|end_file_name|><|fim▁begin|># Copyright 2015 IBM Corp. # 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 math import paramiko import random import re import time import unicodedata from eventlet import greenthread from oslo_concurrency import processutils from oslo_config import cfg from oslo_log import log as logging from oslo_serialization import jsonutils as json from oslo_service import loopingcall from oslo_utils import excutils from oslo_utils import strutils from oslo_utils import units import six from cinder import context from cinder import exception from cinder.i18n import _ from cinder import objects from cinder.objects import fields from cinder import ssh_utils from cinder import utils as cinder_utils from cinder.volume import configuration from cinder.volume import driver from cinder.volume.drivers.ibm.storwize_svc import ( replication as storwize_rep) from cinder.volume.drivers.ibm.storwize_svc import storwize_const from cinder.volume.drivers.san import san from cinder.volume import qos_specs from cinder.volume import utils from cinder.volume import volume_types INTERVAL_1_SEC = 1 DEFAULT_TIMEOUT = 15 LOG = logging.getLogger(__name__) storwize_svc_opts = [ cfg.ListOpt('storwize_svc_volpool_name', default=['volpool'], help='Comma separated list of storage system storage ' 'pools for volumes.'), cfg.IntOpt('storwize_svc_vol_rsize', default=2, min=-1, max=100, help='Storage system space-efficiency parameter for volumes ' '(percentage)'), cfg.IntOpt('storwize_svc_vol_warning', default=0, min=-1, max=100, help='Storage system threshold for volume capacity warnings ' '(percentage)'), cfg.BoolOpt('storwize_svc_vol_autoexpand', default=True, help='Storage system autoexpand parameter for volumes ' '(True/False)'), cfg.IntOpt('storwize_svc_vol_grainsize', default=256, help='Storage system grain size parameter for volumes ' '(32/64/128/256)'), cfg.BoolOpt('storwize_svc_vol_compression', default=False, help='Storage system compression option for volumes'), cfg.BoolOpt('storwize_svc_vol_easytier', default=True, help='Enable Easy Tier for volumes'), cfg.StrOpt('storwize_svc_vol_iogrp', default='0', help='The I/O group in which to allocate volumes. It can be a ' 'comma-separated list in which case the driver will select an ' 'io_group based on least number of volumes associated with the ' 'io_group.'), cfg.IntOpt('storwize_svc_flashcopy_timeout', default=120, min=1, max=600, help='Maximum number of seconds to wait for FlashCopy to be ' 'prepared.'), cfg.BoolOpt('storwize_svc_multihostmap_enabled', default=True, help='This option no longer has any affect. It is deprecated ' 'and will be removed in the next release.', deprecated_for_removal=True), cfg.BoolOpt('storwize_svc_allow_tenant_qos', default=False, help='Allow tenants to specify QOS on create'), cfg.StrOpt('storwize_svc_stretched_cluster_partner', default=None, help='If operating in stretched cluster mode, specify the ' 'name of the pool in which mirrored copies are stored.' 'Example: "pool2"'), cfg.StrOpt('storwize_san_secondary_ip', default=None, help='Specifies secondary management IP or hostname to be ' 'used if san_ip is invalid or becomes inaccessible.'), cfg.BoolOpt('storwize_svc_vol_nofmtdisk', default=False, help='Specifies that the volume not be formatted during ' 'creation.'), cfg.IntOpt('storwize_svc_flashcopy_rate', default=50, min=1, max=100, help='Specifies the Storwize FlashCopy copy rate to be used ' 'when creating a full volume copy. The default is rate ' 'is 50, and the valid rates are 1-100.'), cfg.StrOpt('storwize_svc_mirror_pool', default=None, help='Specifies the name of the pool in which mirrored copy ' 'is stored. Example: "pool2"'), cfg.IntOpt('cycle_period_seconds', default=300, min=60, max=86400, help='This defines an optional cycle period that applies to ' 'Global Mirror relationships with a cycling mode of multi. ' 'A Global Mirror relationship using the multi cycling_mode ' 'performs a complete cycle at most once each period. ' 'The default is 300 seconds, and the valid seconds ' 'are 60-86400.'), ] CONF = cfg.CONF CONF.register_opts(storwize_svc_opts, group=configuration.SHARED_CONF_GROUP) class StorwizeSSH(object): """SSH interface to IBM Storwize family and SVC storage systems.""" def __init__(self, run_ssh): self._ssh = run_ssh def _run_ssh(self, ssh_cmd): try: return self._ssh(ssh_cmd) except processutils.ProcessExecutionError as e: msg = (_('CLI Exception output:\n command: %(cmd)s\n ' 'stdout: %(out)s\n stderr: %(err)s.') % {'cmd': ssh_cmd, 'out': e.stdout, 'err': e.stderr}) LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg) def run_ssh_info(self, ssh_cmd, delim='!', with_header=False): """Run an SSH command and return parsed output.""" raw = self._run_ssh(ssh_cmd) return CLIResponse(raw, ssh_cmd=ssh_cmd, delim=delim, with_header=with_header) def run_ssh_assert_no_output(self, ssh_cmd): """Run an SSH command and assert no output returned.""" out, err = self._run_ssh(ssh_cmd) if len(out.strip()) != 0: msg = (_('Expected no output from CLI command %(cmd)s, ' 'got %(out)s.') % {'cmd': ' '.join(ssh_cmd), 'out': out}) LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg) def run_ssh_check_created(self, ssh_cmd): """Run an SSH command and return the ID of the created object.""" out, err = self._run_ssh(ssh_cmd) try: match_obj = re.search(r'\[([0-9]+)\],? successfully created', out) return match_obj.group(1) except (AttributeError, IndexError): msg = (_('Failed to parse CLI output:\n command: %(cmd)s\n ' 'stdout: %(out)s\n stderr: %(err)s.') % {'cmd': ssh_cmd, 'out': out, 'err': err}) LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg) def lsnode(self, node_id=None): with_header = True ssh_cmd = ['svcinfo', 'lsnode', '-delim', '!'] if node_id: with_header = False ssh_cmd.append(node_id) return self.run_ssh_info(ssh_cmd, with_header=with_header) def lslicense(self): ssh_cmd = ['svcinfo', 'lslicense', '-delim', '!'] return self.run_ssh_info(ssh_cmd)[0] def lsguicapabilities(self): ssh_cmd = ['svcinfo', 'lsguicapabilities', '-delim', '!'] return self.run_ssh_info(ssh_cmd)[0] def lssystem(self): ssh_cmd = ['svcinfo', 'lssystem', '-delim', '!'] return self.run_ssh_info(ssh_cmd)[0] def lsmdiskgrp(self, pool): ssh_cmd = ['svcinfo', 'lsmdiskgrp', '-bytes', '-delim', '!', '"%s"' % pool] try: return self.run_ssh_info(ssh_cmd)[0] except exception.VolumeBackendAPIException as ex: LOG.warning("Failed to get pool %(pool)s info. " "Exception: %(ex)s.", {'pool': pool, 'ex': ex}) return None def lsiogrp(self): ssh_cmd = ['svcinfo', 'lsiogrp', '-delim', '!'] return self.run_ssh_info(ssh_cmd, with_header=True) def lsportip(self): ssh_cmd = ['svcinfo', 'lsportip', '-delim', '!'] return self.run_ssh_info(ssh_cmd, with_header=True) @staticmethod def _create_port_arg(port_type, port_name): if port_type == 'initiator': port = ['-iscsiname'] else: port = ['-hbawwpn'] port.append(port_name) return port def mkhost(self, host_name, port_type, port_name): port = self._create_port_arg(port_type, port_name) ssh_cmd = ['svctask', 'mkhost', '-force'] + port ssh_cmd += ['-name', '"%s"' % host_name] return self.run_ssh_check_created(ssh_cmd) def addhostport(self, host, port_type, port_name): port = self._create_port_arg(port_type, port_name) ssh_cmd = ['svctask', 'addhostport', '-force'] + port + ['"%s"' % host] self.run_ssh_assert_no_output(ssh_cmd) def lshost(self, host=None): with_header = True ssh_cmd = ['svcinfo', 'lshost', '-delim', '!'] if host: with_header = False ssh_cmd.append('"%s"' % host) return self.run_ssh_info(ssh_cmd, with_header=with_header) def add_chap_secret(self, secret, host): ssh_cmd = ['svctask', 'chhost', '-chapsecret', secret, '"%s"' % host] self.run_ssh_assert_no_output(ssh_cmd) def lsiscsiauth(self): ssh_cmd = ['svcinfo', 'lsiscsiauth', '-delim', '!'] return self.run_ssh_info(ssh_cmd, with_header=True) def lsfabric(self, wwpn=None, host=None): ssh_cmd = ['svcinfo', 'lsfabric', '-delim', '!'] if wwpn: ssh_cmd.extend(['-wwpn', wwpn]) elif host: ssh_cmd.extend(['-host', '"%s"' % host]) else: msg = (_('Must pass wwpn or host to lsfabric.')) LOG.error(msg) raise exception.VolumeDriverException(message=msg) return self.run_ssh_info(ssh_cmd, with_header=True) def mkvdiskhostmap(self, host, vdisk, lun, multihostmap): """Map vdisk to host. If vdisk already mapped and multihostmap is True, use the force flag. """ ssh_cmd = ['svctask', 'mkvdiskhostmap', '-host', '"%s"' % host, vdisk] if lun: ssh_cmd.insert(ssh_cmd.index(vdisk), '-scsi') ssh_cmd.insert(ssh_cmd.index(vdisk), lun) if multihostmap: ssh_cmd.insert(ssh_cmd.index('mkvdiskhostmap') + 1, '-force') try: self.run_ssh_check_created(ssh_cmd) result_lun = self.get_vdiskhostmapid(vdisk, host) if result_lun is None or (lun and lun != result_lun): msg = (_('mkvdiskhostmap error:\n command: %(cmd)s\n ' 'lun: %(lun)s\n result_lun: %(result_lun)s') % {'cmd': ssh_cmd, 'lun': lun, 'result_lun': result_lun}) LOG.error(msg) raise exception.VolumeDriverException(message=msg) return result_lun except Exception as ex: if (not multihostmap and hasattr(ex, 'message') and 'CMMVC6071E' in ex.message): LOG.error('storwize_svc_multihostmap_enabled is set ' 'to False, not allowing multi host mapping.') raise exception.VolumeDriverException( message=_('CMMVC6071E The VDisk-to-host mapping was not ' 'created because the VDisk is already mapped ' 'to a host.\n"')) with excutils.save_and_reraise_exception(): LOG.error('Error mapping VDisk-to-host') def mkrcrelationship(self, master, aux, system, asyncmirror, cyclingmode=False): ssh_cmd = ['svctask', 'mkrcrelationship', '-master', master, '-aux', aux, '-cluster', system] if asyncmirror: ssh_cmd.append('-global') if cyclingmode: ssh_cmd.extend(['-cyclingmode', 'multi']) return self.run_ssh_check_created(ssh_cmd) def rmrcrelationship(self, relationship, force=False): ssh_cmd = ['svctask', 'rmrcrelationship'] if force: ssh_cmd += ['-force'] ssh_cmd += [relationship] self.run_ssh_assert_no_output(ssh_cmd) def switchrelationship(self, relationship, aux=True): primary = 'aux' if aux else 'master' ssh_cmd = ['svctask', 'switchrcrelationship', '-primary', primary, relationship] self.run_ssh_assert_no_output(ssh_cmd) def startrcrelationship(self, rc_rel, primary=None): ssh_cmd = ['svctask', 'startrcrelationship', '-force'] if primary: ssh_cmd.extend(['-primary', primary]) ssh_cmd.append(rc_rel) self.run_ssh_assert_no_output(ssh_cmd) def ch_rcrelationship_cycleperiod(self, relationship, cycle_period_seconds): # Note: Can only change one attribute at a time, # so define two ch_rcrelationship_xxx here if cycle_period_seconds: ssh_cmd = ['svctask', 'chrcrelationship'] ssh_cmd.extend(['-cycleperiodseconds', six.text_type(cycle_period_seconds)]) ssh_cmd.append(relationship) self.run_ssh_assert_no_output(ssh_cmd) def ch_rcrelationship_changevolume(self, relationship, changevolume, master): # Note: Can only change one attribute at a time, # so define two ch_rcrelationship_xxx here if changevolume: ssh_cmd = ['svctask', 'chrcrelationship'] if master: ssh_cmd.extend(['-masterchange', changevolume]) else: ssh_cmd.extend(['-auxchange', changevolume]) ssh_cmd.append(relationship) self.run_ssh_assert_no_output(ssh_cmd) def stoprcrelationship(self, relationship, access=False): ssh_cmd = ['svctask', 'stoprcrelationship'] if access: ssh_cmd.append('-access') ssh_cmd.append(relationship) self.run_ssh_assert_no_output(ssh_cmd) def lsrcrelationship(self, rc_rel): ssh_cmd = ['svcinfo', 'lsrcrelationship', '-delim', '!', rc_rel] return self.run_ssh_info(ssh_cmd) def lspartnership(self, system_name): key_value = 'name=%s' % system_name ssh_cmd = ['svcinfo', 'lspartnership', '-filtervalue', key_value, '-delim', '!'] return self.run_ssh_info(ssh_cmd, with_header=True) def lspartnershipcandidate(self): ssh_cmd = ['svcinfo', 'lspartnershipcandidate', '-delim', '!'] return self.run_ssh_info(ssh_cmd, with_header=True) def mkippartnership(self, ip_v4, bandwith=1000, backgroundcopyrate=50): ssh_cmd = ['svctask', 'mkippartnership', '-type', 'ipv4', '-clusterip', ip_v4, '-linkbandwidthmbits', six.text_type(bandwith), '-backgroundcopyrate', six.text_type(backgroundcopyrate)] return self.run_ssh_assert_no_output(ssh_cmd) def mkfcpartnership(self, system_name, bandwith=1000, backgroundcopyrate=50): ssh_cmd = ['svctask', 'mkfcpartnership', '-linkbandwidthmbits', six.text_type(bandwith), '-backgroundcopyrate', six.text_type(backgroundcopyrate), system_name] return self.run_ssh_assert_no_output(ssh_cmd) def chpartnership(self, partnership_id, start=True): action = '-start' if start else '-stop' ssh_cmd = ['svctask', 'chpartnership', action, partnership_id] return self.run_ssh_assert_no_output(ssh_cmd) def rmvdiskhostmap(self, host, vdisk): ssh_cmd = ['svctask', 'rmvdiskhostmap', '-host', '"%s"' % host, '"%s"' % vdisk] self.run_ssh_assert_no_output(ssh_cmd) def lsvdiskhostmap(self, vdisk): ssh_cmd = ['svcinfo', 'lsvdiskhostmap', '-delim', '!', '"%s"' % vdisk] return self.run_ssh_info(ssh_cmd, with_header=True) def lshostvdiskmap(self, host): ssh_cmd = ['svcinfo', 'lshostvdiskmap', '-delim', '!', '"%s"' % host] return self.run_ssh_info(ssh_cmd, with_header=True) def get_vdiskhostmapid(self, vdisk, host): resp = self.lsvdiskhostmap(vdisk) for mapping_info in resp: if mapping_info['host_name'] == host: lun_id = mapping_info['SCSI_id'] return lun_id return None def rmhost(self, host): ssh_cmd = ['svctask', 'rmhost', '"%s"' % host] self.run_ssh_assert_no_output(ssh_cmd) def mkvdisk(self, name, size, units, pool, opts, params): ssh_cmd = ['svctask', 'mkvdisk', '-name', '"%s"' % name, '-mdiskgrp', '"%s"' % pool, '-iogrp', six.text_type(opts['iogrp']), '-size', size, '-unit', units] + params try: return self.run_ssh_check_created(ssh_cmd) except Exception as ex: if hasattr(ex, 'msg') and 'CMMVC6372W' in ex.msg: vdisk = self.lsvdisk(name) if vdisk: LOG.warning('CMMVC6372W The virtualized storage ' 'capacity that the cluster is using is ' 'approaching the virtualized storage ' 'capacity that is licensed.') return vdisk['id'] with excutils.save_and_reraise_exception(): LOG.exception('Failed to create vdisk %(vol)s.', {'vol': name}) def rmvdisk(self, vdisk, force=True): ssh_cmd = ['svctask', 'rmvdisk'] if force: ssh_cmd += ['-force'] ssh_cmd += ['"%s"' % vdisk] self.run_ssh_assert_no_output(ssh_cmd) def lsvdisk(self, vdisk): """Return vdisk attributes or None if it doesn't exist.""" ssh_cmd = ['svcinfo', 'lsvdisk', '-bytes', '-delim', '!', '"%s"' % vdisk] out, err = self._ssh(ssh_cmd, check_exit_code=False) if not err: return CLIResponse((out, err), ssh_cmd=ssh_cmd, delim='!', with_header=False)[0] if 'CMMVC5754E' in err: return None msg = (_('CLI Exception output:\n command: %(cmd)s\n ' 'stdout: %(out)s\n stderr: %(err)s.') % {'cmd': ssh_cmd, 'out': out, 'err': err}) LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg) def lsvdisks_from_filter(self, filter_name, value): """Performs an lsvdisk command, filtering the results as specified. Returns an iterable for all matching vdisks. """ ssh_cmd = ['svcinfo', 'lsvdisk', '-bytes', '-delim', '!', '-filtervalue', '%s=%s' % (filter_name, value)] return self.run_ssh_info(ssh_cmd, with_header=True) def chvdisk(self, vdisk, params): ssh_cmd = ['svctask', 'chvdisk'] + params + ['"%s"' % vdisk] self.run_ssh_assert_no_output(ssh_cmd) def movevdisk(self, vdisk, iogrp): ssh_cmd = ['svctask', 'movevdisk', '-iogrp', iogrp, '"%s"' % vdisk] self.run_ssh_assert_no_output(ssh_cmd) def expandvdisksize(self, vdisk, amount): ssh_cmd = ( ['svctask', 'expandvdisksize', '-size', six.text_type(amount), '-unit', 'gb', '"%s"' % vdisk]) self.run_ssh_assert_no_output(ssh_cmd) def mkfcmap(self, source, target, full_copy, copy_rate, consistgrp=None): ssh_cmd = ['svctask', 'mkfcmap', '-source', '"%s"' % source, '-target', '"%s"' % target, '-autodelete'] if not full_copy: ssh_cmd.extend(['-copyrate', '0']) else: ssh_cmd.extend(['-copyrate', six.text_type(copy_rate)]) if consistgrp: ssh_cmd.extend(['-consistgrp', consistgrp]) out, err = self._ssh(ssh_cmd, check_exit_code=False) if 'successfully created' not in out: msg = (_('CLI Exception output:\n command: %(cmd)s\n ' 'stdout: %(out)s\n stderr: %(err)s.') % {'cmd': ssh_cmd, 'out': out, 'err': err}) LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg) try: match_obj = re.search(r'FlashCopy Mapping, id \[([0-9]+)\], ' 'successfully created', out) fc_map_id = match_obj.group(1) except (AttributeError, IndexError): msg = (_('Failed to parse CLI output:\n command: %(cmd)s\n ' 'stdout: %(out)s\n stderr: %(err)s.') % {'cmd': ssh_cmd, 'out': out, 'err': err}) LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg) return fc_map_id def prestartfcmap(self, fc_map_id): ssh_cmd = ['svctask', 'prestartfcmap', fc_map_id] self.run_ssh_assert_no_output(ssh_cmd) def startfcmap(self, fc_map_id): ssh_cmd = ['svctask', 'startfcmap', fc_map_id] self.run_ssh_assert_no_output(ssh_cmd) def prestartfcconsistgrp(self, fc_consist_group): ssh_cmd = ['svctask', 'prestartfcconsistgrp', fc_consist_group] self.run_ssh_assert_no_output(ssh_cmd) def startfcconsistgrp(self, fc_consist_group): ssh_cmd = ['svctask', 'startfcconsistgrp', fc_consist_group] self.run_ssh_assert_no_output(ssh_cmd) def stopfcconsistgrp(self, fc_consist_group): ssh_cmd = ['svctask', 'stopfcconsistgrp', fc_consist_group] self.run_ssh_assert_no_output(ssh_cmd) def chfcmap(self, fc_map_id, copyrate='50', autodel='on'): ssh_cmd = ['svctask', 'chfcmap', '-copyrate', copyrate, '-autodelete', autodel, fc_map_id] self.run_ssh_assert_no_output(ssh_cmd) def stopfcmap(self, fc_map_id): ssh_cmd = ['svctask', 'stopfcmap', fc_map_id] self.run_ssh_assert_no_output(ssh_cmd) def rmfcmap(self, fc_map_id): ssh_cmd = ['svctask', 'rmfcmap', '-force', fc_map_id] self.run_ssh_assert_no_output(ssh_cmd) def lsvdiskfcmappings(self, vdisk): ssh_cmd = ['svcinfo', 'lsvdiskfcmappings', '-delim', '!', '"%s"' % vdisk] return self.run_ssh_info(ssh_cmd, with_header=True) def lsfcmap(self, fc_map_id): ssh_cmd = ['svcinfo', 'lsfcmap', '-filtervalue', 'id=%s' % fc_map_id, '-delim', '!'] return self.run_ssh_info(ssh_cmd, with_header=True) def lsfcconsistgrp(self, fc_consistgrp): ssh_cmd = ['svcinfo', 'lsfcconsistgrp', '-delim', '!', fc_consistgrp] out, err = self._ssh(ssh_cmd) return CLIResponse((out, err), ssh_cmd=ssh_cmd, delim='!', with_header=False) def mkfcconsistgrp(self, fc_consist_group): ssh_cmd = ['svctask', 'mkfcconsistgrp', '-name', fc_consist_group] return self.run_ssh_check_created(ssh_cmd) def rmfcconsistgrp(self, fc_consist_group): ssh_cmd = ['svctask', 'rmfcconsistgrp', '-force', fc_consist_group] return self.run_ssh_assert_no_output(ssh_cmd) def addvdiskcopy(self, vdisk, dest_pool, params, auto_delete): ssh_cmd = (['svctask', 'addvdiskcopy'] + params + ['-mdiskgrp', '"%s"' % dest_pool]) if auto_delete: ssh_cmd += ['-autodelete'] ssh_cmd += ['"%s"' % vdisk] return self.run_ssh_check_created(ssh_cmd) def lsvdiskcopy(self, vdisk, copy_id=None): ssh_cmd = ['svcinfo', 'lsvdiskcopy', '-delim', '!'] with_header = True if copy_id: ssh_cmd += ['-copy', copy_id] with_header = False ssh_cmd += ['"%s"' % vdisk] return self.run_ssh_info(ssh_cmd, with_header=with_header) def lsvdisksyncprogress(self, vdisk, copy_id): ssh_cmd = ['svcinfo', 'lsvdisksyncprogress', '-delim', '!', '-copy', copy_id, '"%s"' % vdisk] return self.run_ssh_info(ssh_cmd, with_header=True)[0] def rmvdiskcopy(self, vdisk, copy_id): ssh_cmd = ['svctask', 'rmvdiskcopy', '-copy', copy_id, '"%s"' % vdisk] self.run_ssh_assert_no_output(ssh_cmd) def addvdiskaccess(self, vdisk, iogrp): ssh_cmd = ['svctask', 'addvdiskaccess', '-iogrp', iogrp, '"%s"' % vdisk] self.run_ssh_assert_no_output(ssh_cmd) def rmvdiskaccess(self, vdisk, iogrp): ssh_cmd = ['svctask', 'rmvdiskaccess', '-iogrp', iogrp, '"%s"' % vdisk] self.run_ssh_assert_no_output(ssh_cmd) def lsportfc(self, node_id): ssh_cmd = ['svcinfo', 'lsportfc', '-delim', '!', '-filtervalue', 'node_id=%s' % node_id] return self.run_ssh_info(ssh_cmd, with_header=True) def migratevdisk(self, vdisk, dest_pool, copy_id='0'): ssh_cmd = ['svctask', 'migratevdisk', '-mdiskgrp', dest_pool, '-copy', copy_id, '-vdisk', vdisk] self.run_ssh_assert_no_output(ssh_cmd) class StorwizeHelpers(object): # All the supported QoS key are saved in this dict. When a new # key is going to add, three values MUST be set: # 'default': to indicate the value, when the parameter is disabled. # 'param': to indicate the corresponding parameter in the command. # 'type': to indicate the type of this value. WAIT_TIME = 5 svc_qos_keys = {'IOThrottling': {'default': '0', 'param': 'rate', 'type': int}} def __init__(self, run_ssh): self.ssh = StorwizeSSH(run_ssh) self.check_fcmapping_interval = 3 @staticmethod def handle_keyerror(cmd, out): msg = (_('Could not find key in output of command %(cmd)s: %(out)s.') % {'out': out, 'cmd': cmd}) raise exception.VolumeBackendAPIException(data=msg) def compression_enabled(self): """Return whether or not compression is enabled for this system.""" resp = self.ssh.lslicense() keys = ['license_compression_enclosures', 'license_compression_capacity'] for key in keys: if resp.get(key, '0') != '0': return True # lslicense is not used for V9000 compression check # compression_enclosures and compression_capacity are # always 0. V9000 uses license_scheme 9846 as an # indicator and can always do compression try: resp = self.ssh.lsguicapabilities() if resp.get('license_scheme', '0') == '9846': return True except exception.VolumeBackendAPIException: LOG.exception("Failed to fetch licensing scheme.") return False def replication_licensed(self): """Return whether or not replication is enabled for this system.""" # Uses product_key as an indicator to check # whether replication is supported in storage. try: resp = self.ssh.lsguicapabilities() product_key = resp.get('product_key', '0') if product_key in storwize_const.REP_CAP_DEVS: return True except exception.VolumeBackendAPIException as war: LOG.warning("Failed to run lsguicapability. Exception: %s.", war) return False def get_system_info(self): """Return system's name, ID, and code level.""" resp = self.ssh.lssystem() level = resp['code_level'] match_obj = re.search('([0-9].){3}[0-9]', level) if match_obj is None: msg = _('Failed to get code level (%s).') % level raise exception.VolumeBackendAPIException(data=msg) code_level = match_obj.group().split('.') return {'code_level': tuple([int(x) for x in code_level]), 'system_name': resp['name'], 'system_id': resp['id']} def get_pool_attrs(self, pool): """Return attributes for the specified pool.""" return self.ssh.lsmdiskgrp(pool) def is_pool_defined(self, pool_name): """Check if vdisk is defined.""" attrs = self.get_pool_attrs(pool_name) return attrs is not None<|fim▁hole|> def get_available_io_groups(self): """Return list of available IO groups.""" iogrps = [] resp = self.ssh.lsiogrp() for iogrp in resp: try: if int(iogrp['node_count']) > 0: iogrps.append(int(iogrp['id'])) except KeyError: self.handle_keyerror('lsiogrp', iogrp) except ValueError: msg = (_('Expected integer for node_count, ' 'svcinfo lsiogrp returned: %(node)s.') % {'node': iogrp['node_count']}) raise exception.VolumeBackendAPIException(data=msg) return iogrps def get_vdisk_count_by_io_group(self): res = {} resp = self.ssh.lsiogrp() for iogrp in resp: try: if int(iogrp['node_count']) > 0: res[int(iogrp['id'])] = int(iogrp['vdisk_count']) except KeyError: self.handle_keyerror('lsiogrp', iogrp) except ValueError: msg = (_('Expected integer for node_count, ' 'svcinfo lsiogrp returned: %(node)s') % {'node': iogrp['node_count']}) raise exception.VolumeBackendAPIException(data=msg) return res def select_io_group(self, state, opts): selected_iog = 0 iog_list = StorwizeHelpers._get_valid_requested_io_groups(state, opts) if len(iog_list) == 0: raise exception.InvalidInput( reason=_('Given I/O group(s) %(iogrp)s not valid; available ' 'I/O groups are %(avail)s.') % {'iogrp': opts['iogrp'], 'avail': state['available_iogrps']}) iog_vdc = self.get_vdisk_count_by_io_group() LOG.debug("IO group current balance %s", iog_vdc) min_vdisk_count = iog_vdc[iog_list[0]] selected_iog = iog_list[0] for iog in iog_list: if iog_vdc[iog] < min_vdisk_count: min_vdisk_count = iog_vdc[iog] selected_iog = iog LOG.debug("Selected io_group is %d", selected_iog) return selected_iog def get_volume_io_group(self, vol_name): vdisk = self.ssh.lsvdisk(vol_name) if vdisk: resp = self.ssh.lsiogrp() for iogrp in resp: if iogrp['name'] == vdisk['IO_group_name']: return int(iogrp['id']) return None def get_node_info(self): """Return dictionary containing information on system's nodes.""" nodes = {} resp = self.ssh.lsnode() for node_data in resp: try: if node_data['status'] != 'online': continue node = {} node['id'] = node_data['id'] node['name'] = node_data['name'] node['IO_group'] = node_data['IO_group_id'] node['iscsi_name'] = node_data['iscsi_name'] node['WWNN'] = node_data['WWNN'] node['status'] = node_data['status'] node['WWPN'] = [] node['ipv4'] = [] node['ipv6'] = [] node['enabled_protocols'] = [] nodes[node['id']] = node except KeyError: self.handle_keyerror('lsnode', node_data) return nodes def add_iscsi_ip_addrs(self, storage_nodes): """Add iSCSI IP addresses to system node information.""" resp = self.ssh.lsportip() for ip_data in resp: try: state = ip_data['state'] if ip_data['node_id'] in storage_nodes and ( state == 'configured' or state == 'online'): node = storage_nodes[ip_data['node_id']] if len(ip_data['IP_address']): node['ipv4'].append(ip_data['IP_address']) if len(ip_data['IP_address_6']): node['ipv6'].append(ip_data['IP_address_6']) except KeyError: self.handle_keyerror('lsportip', ip_data) def add_fc_wwpns(self, storage_nodes): """Add FC WWPNs to system node information.""" for key in storage_nodes: node = storage_nodes[key] wwpns = set(node['WWPN']) resp = self.ssh.lsportfc(node_id=node['id']) for port_info in resp: if (port_info['type'] == 'fc' and port_info['status'] == 'active'): wwpns.add(port_info['WWPN']) node['WWPN'] = list(wwpns) LOG.info('WWPN on node %(node)s: %(wwpn)s.', {'node': node['id'], 'wwpn': node['WWPN']}) def add_chap_secret_to_host(self, host_name): """Generate and store a randomly-generated CHAP secret for the host.""" chap_secret = utils.generate_password() self.ssh.add_chap_secret(chap_secret, host_name) return chap_secret def get_chap_secret_for_host(self, host_name): """Generate and store a randomly-generated CHAP secret for the host.""" resp = self.ssh.lsiscsiauth() host_found = False for host_data in resp: try: if host_data['name'] == host_name: host_found = True if host_data['iscsi_auth_method'] == 'chap': return host_data['iscsi_chap_secret'] except KeyError: self.handle_keyerror('lsiscsiauth', host_data) if not host_found: msg = _('Failed to find host %s.') % host_name raise exception.VolumeBackendAPIException(data=msg) return None def get_conn_fc_wwpns(self, host): wwpns = set() resp = self.ssh.lsfabric(host=host) for wwpn in resp.select('local_wwpn'): if wwpn is not None: wwpns.add(wwpn) return list(wwpns) def get_host_from_connector(self, connector, volume_name=None, iscsi=False): """Return the Storwize host described by the connector.""" LOG.debug('Enter: get_host_from_connector: %s.', connector) # If we have FC information, we have a faster lookup option host_name = None if 'wwpns' in connector and not iscsi: for wwpn in connector['wwpns']: resp = self.ssh.lsfabric(wwpn=wwpn) for wwpn_info in resp: try: if (wwpn_info['remote_wwpn'] and wwpn_info['name'] and wwpn_info['remote_wwpn'].lower() == wwpn.lower()): host_name = wwpn_info['name'] break except KeyError: self.handle_keyerror('lsfabric', wwpn_info) if host_name: break if host_name: LOG.debug('Leave: get_host_from_connector: host %s.', host_name) return host_name def update_host_list(host, host_list): idx = host_list.index(host) del host_list[idx] host_list.insert(0, host) # That didn't work, so try exhaustive search hosts_info = self.ssh.lshost() host_list = list(hosts_info.select('name')) # If we have a "real" connector, we might be able to find the # host entry with fewer queries if we move the host entries # that contain the connector's host property value to the front # of the list if 'host' in connector: # order host_list such that the host entries that # contain the connector's host name are at the # beginning of the list for host in host_list: if re.search(connector['host'], host): update_host_list(host, host_list) # If we have a volume name we have a potential fast path # for finding the matching host for that volume. # Add the host_names that have mappings for our volume to the # head of the list of host names to search them first if volume_name: hosts_map_info = self.ssh.lsvdiskhostmap(volume_name) hosts_map_info_list = list(hosts_map_info.select('host_name')) # remove the fast path host names from the end of the list # and move to the front so they are only searched for once. for host in hosts_map_info_list: update_host_list(host, host_list) found = False for name in host_list: try: resp = self.ssh.lshost(host=name) except exception.VolumeBackendAPIException as ex: LOG.debug("Exception message: %s", ex.msg) if 'CMMVC5754E' in ex.msg: LOG.debug("CMMVC5754E found in CLI exception.") # CMMVC5754E: The specified object does not exist # The host has been deleted while walking the list. # This is a result of a host change on the SVC that # is out of band to this request. continue # unexpected error so reraise it with excutils.save_and_reraise_exception(): pass if iscsi: if 'initiator' in connector: for iscsi in resp.select('iscsi_name'): if iscsi == connector['initiator']: host_name = name found = True break elif 'wwpns' in connector and len(connector['wwpns']): connector_wwpns = [str(x).lower() for x in connector['wwpns']] for wwpn in resp.select('WWPN'): if wwpn and wwpn.lower() in connector_wwpns: host_name = name found = True break if found: break LOG.debug('Leave: get_host_from_connector: host %s.', host_name) return host_name def create_host(self, connector, iscsi=False): """Create a new host on the storage system. We create a host name and associate it with the given connection information. The host name will be a cleaned up version of the given host name (at most 55 characters), plus a random 8-character suffix to avoid collisions. The total length should be at most 63 characters. """ LOG.debug('Enter: create_host: host %s.', connector['host']) # Before we start, make sure host name is a string and that we have at # least one port. host_name = connector['host'] if not isinstance(host_name, six.string_types): msg = _('create_host: Host name is not unicode or string.') LOG.error(msg) raise exception.VolumeDriverException(message=msg) ports = [] if iscsi: if 'initiator' in connector: ports.append(['initiator', '%s' % connector['initiator']]) else: msg = _('create_host: No initiators supplied.') else: if 'wwpns' in connector: for wwpn in connector['wwpns']: ports.append(['wwpn', '%s' % wwpn]) else: msg = _('create_host: No wwpns supplied.') if not len(ports): LOG.error(msg) raise exception.VolumeDriverException(message=msg) # Build a host name for the Storwize host - first clean up the name if isinstance(host_name, six.text_type): host_name = unicodedata.normalize('NFKD', host_name).encode( 'ascii', 'replace').decode('ascii') for num in range(0, 128): ch = str(chr(num)) if not ch.isalnum() and ch not in [' ', '.', '-', '_']: host_name = host_name.replace(ch, '-') # Storwize doesn't like hostname that doesn't starts with letter or _. if not re.match('^[A-Za-z]', host_name): host_name = '_' + host_name # Add a random 8-character suffix to avoid collisions rand_id = str(random.randint(0, 99999999)).zfill(8) host_name = '%s-%s' % (host_name[:55], rand_id) # Create a host with one port port = ports.pop(0) self.ssh.mkhost(host_name, port[0], port[1]) # Add any additional ports to the host for port in ports: self.ssh.addhostport(host_name, port[0], port[1]) LOG.debug('Leave: create_host: host %(host)s - %(host_name)s.', {'host': connector['host'], 'host_name': host_name}) return host_name def delete_host(self, host_name): self.ssh.rmhost(host_name) def map_vol_to_host(self, volume_name, host_name, multihostmap): """Create a mapping between a volume to a host.""" LOG.debug('Enter: map_vol_to_host: volume %(volume_name)s to ' 'host %(host_name)s.', {'volume_name': volume_name, 'host_name': host_name}) # Check if this volume is already mapped to this host result_lun = self.ssh.get_vdiskhostmapid(volume_name, host_name) if result_lun is None: result_lun = self.ssh.mkvdiskhostmap(host_name, volume_name, None, multihostmap) LOG.debug('Leave: map_vol_to_host: LUN %(result_lun)s, volume ' '%(volume_name)s, host %(host_name)s.', {'result_lun': result_lun, 'volume_name': volume_name, 'host_name': host_name}) return int(result_lun) def unmap_vol_from_host(self, volume_name, host_name): """Unmap the volume and delete the host if it has no more mappings.""" LOG.debug('Enter: unmap_vol_from_host: volume %(volume_name)s from ' 'host %(host_name)s.', {'volume_name': volume_name, 'host_name': host_name}) # Check if the mapping exists resp = self.ssh.lsvdiskhostmap(volume_name) if not len(resp): LOG.warning('unmap_vol_from_host: No mapping of volume ' '%(vol_name)s to any host found.', {'vol_name': volume_name}) return host_name if host_name is None: if len(resp) > 1: LOG.warning('unmap_vol_from_host: Multiple mappings of ' 'volume %(vol_name)s found, no host ' 'specified.', {'vol_name': volume_name}) return else: host_name = resp[0]['host_name'] else: found = False for h in resp.select('host_name'): if h == host_name: found = True if not found: LOG.warning('unmap_vol_from_host: No mapping of volume ' '%(vol_name)s to host %(host)s found.', {'vol_name': volume_name, 'host': host_name}) return host_name # We now know that the mapping exists self.ssh.rmvdiskhostmap(host_name, volume_name) LOG.debug('Leave: unmap_vol_from_host: volume %(volume_name)s from ' 'host %(host_name)s.', {'volume_name': volume_name, 'host_name': host_name}) return host_name def check_host_mapped_vols(self, host_name): return self.ssh.lshostvdiskmap(host_name) @staticmethod def build_default_opts(config): # Ignore capitalization cluster_partner = config.storwize_svc_stretched_cluster_partner opt = {'rsize': config.storwize_svc_vol_rsize, 'warning': config.storwize_svc_vol_warning, 'autoexpand': config.storwize_svc_vol_autoexpand, 'grainsize': config.storwize_svc_vol_grainsize, 'compression': config.storwize_svc_vol_compression, 'easytier': config.storwize_svc_vol_easytier, 'iogrp': config.storwize_svc_vol_iogrp, 'qos': None, 'stretched_cluster': cluster_partner, 'replication': False, 'nofmtdisk': config.storwize_svc_vol_nofmtdisk, 'mirror_pool': config.storwize_svc_mirror_pool, 'cycle_period_seconds': config.cycle_period_seconds} return opt @staticmethod def check_vdisk_opts(state, opts): # Check that grainsize is 32/64/128/256 if opts['grainsize'] not in [32, 64, 128, 256]: raise exception.InvalidInput( reason=_('Illegal value specified for ' 'storwize_svc_vol_grainsize: set to either ' '32, 64, 128, or 256.')) # Check that compression is supported if opts['compression'] and not state['compression_enabled']: raise exception.InvalidInput( reason=_('System does not support compression.')) # Check that rsize is set if compression is set if opts['compression'] and opts['rsize'] == -1: raise exception.InvalidInput( reason=_('If compression is set to True, rsize must ' 'also be set (not equal to -1).')) # Check cycle_period_seconds are in 60-86400 if opts['cycle_period_seconds'] not in range(60, 86401): raise exception.InvalidInput( reason=_('cycle_period_seconds should be integer ' 'between 60 and 86400.')) iogs = StorwizeHelpers._get_valid_requested_io_groups(state, opts) if len(iogs) == 0: raise exception.InvalidInput( reason=_('Given I/O group(s) %(iogrp)s not valid; available ' 'I/O groups are %(avail)s.') % {'iogrp': opts['iogrp'], 'avail': state['available_iogrps']}) if opts['nofmtdisk'] and opts['rsize'] != -1: raise exception.InvalidInput( reason=_('If nofmtdisk is set to True, rsize must ' 'also be set to -1.')) @staticmethod def _get_valid_requested_io_groups(state, opts): given_iogs = str(opts['iogrp']) iog_list = given_iogs.split(',') # convert to int iog_list = list(map(int, iog_list)) LOG.debug("Requested iogroups %s", iog_list) LOG.debug("Available iogroups %s", state['available_iogrps']) filtiog = set(iog_list).intersection(state['available_iogrps']) iog_list = list(filtiog) LOG.debug("Filtered (valid) requested iogroups %s", iog_list) return iog_list def _get_opts_from_specs(self, opts, specs): qos = {} for k, value in specs.items(): # Get the scope, if using scope format key_split = k.split(':') if len(key_split) == 1: scope = None key = key_split[0] else: scope = key_split[0] key = key_split[1] # We generally do not look at capabilities in the driver, but # replication is a special case where the user asks for # a volume to be replicated, and we want both the scheduler and # the driver to act on the value. if ((not scope or scope == 'capabilities') and key == 'replication'): scope = None key = 'replication' words = value.split() if not (words and len(words) == 2 and words[0] == '<is>'): LOG.error('Replication must be specified as ' '\'<is> True\' or \'<is> False\'.') del words[0] value = words[0] # Add the QoS. if scope and scope == 'qos': if key in self.svc_qos_keys.keys(): try: type_fn = self.svc_qos_keys[key]['type'] value = type_fn(value) qos[key] = value except ValueError: continue # Any keys that the driver should look at should have the # 'drivers' scope. if scope and scope != 'drivers': continue if key in opts: this_type = type(opts[key]).__name__ if this_type == 'int': value = int(value) elif this_type == 'bool': value = strutils.bool_from_string(value) opts[key] = value if len(qos) != 0: opts['qos'] = qos return opts def _get_qos_from_volume_metadata(self, volume_metadata): """Return the QoS information from the volume metadata.""" qos = {} for i in volume_metadata: k = i.get('key', None) value = i.get('value', None) key_split = k.split(':') if len(key_split) == 1: scope = None key = key_split[0] else: scope = key_split[0] key = key_split[1] # Add the QoS. if scope and scope == 'qos': if key in self.svc_qos_keys.keys(): try: type_fn = self.svc_qos_keys[key]['type'] value = type_fn(value) qos[key] = value except ValueError: continue return qos def _wait_for_a_condition(self, testmethod, timeout=None, interval=INTERVAL_1_SEC, raise_exception=False): start_time = time.time() if timeout is None: timeout = DEFAULT_TIMEOUT def _inner(): try: testValue = testmethod() except Exception as ex: if raise_exception: LOG.exception("_wait_for_a_condition: %s" " execution failed.", testmethod.__name__) raise exception.VolumeBackendAPIException(data=ex) else: testValue = False LOG.debug('Helper.' '_wait_for_condition: %(method_name)s ' 'execution failed for %(exception)s.', {'method_name': testmethod.__name__, 'exception': ex.message}) if testValue: raise loopingcall.LoopingCallDone() if int(time.time()) - start_time > timeout: msg = (_('CommandLineHelper._wait_for_condition: %s timeout.') % testmethod.__name__) LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg) timer = loopingcall.FixedIntervalLoopingCall(_inner) timer.start(interval=interval).wait() def get_vdisk_params(self, config, state, type_id, volume_type=None, volume_metadata=None): """Return the parameters for creating the vdisk. Takes volume type and defaults from config options into account. """ opts = self.build_default_opts(config) ctxt = context.get_admin_context() if volume_type is None and type_id is not None: volume_type = volume_types.get_volume_type(ctxt, type_id) if volume_type: qos_specs_id = volume_type.get('qos_specs_id') specs = dict(volume_type).get('extra_specs') # NOTE(vhou): We prefer the qos_specs association # and over-ride any existing # extra-specs settings if present if qos_specs_id is not None: kvs = qos_specs.get_qos_specs(ctxt, qos_specs_id)['specs'] # Merge the qos_specs into extra_specs and qos_specs has higher # priority than extra_specs if they have different values for # the same key. specs.update(kvs) opts = self._get_opts_from_specs(opts, specs) if (opts['qos'] is None and config.storwize_svc_allow_tenant_qos and volume_metadata): qos = self._get_qos_from_volume_metadata(volume_metadata) if len(qos) != 0: opts['qos'] = qos self.check_vdisk_opts(state, opts) return opts @staticmethod def _get_vdisk_create_params(opts, add_copies=False): easytier = 'on' if opts['easytier'] else 'off' if opts['rsize'] == -1: params = [] if opts['nofmtdisk']: params.append('-nofmtdisk') else: params = ['-rsize', '%s%%' % str(opts['rsize']), '-autoexpand', '-warning', '%s%%' % str(opts['warning'])] if not opts['autoexpand']: params.remove('-autoexpand') if opts['compression']: params.append('-compressed') else: params.extend(['-grainsize', str(opts['grainsize'])]) if add_copies and opts['mirror_pool']: params.extend(['-copies', '2']) params.extend(['-easytier', easytier]) return params def create_vdisk(self, name, size, units, pool, opts): LOG.debug('Enter: create_vdisk: vdisk %s.', name) mdiskgrp = pool if opts['mirror_pool']: if not self.is_pool_defined(opts['mirror_pool']): raise exception.InvalidInput( reason=_('The pool %s in which mirrored copy is stored ' 'is invalid') % opts['mirror_pool']) # The syntax of pool SVC expects is pool:mirror_pool in # mdiskgrp for mirror volume mdiskgrp = '%s:%s' % (pool, opts['mirror_pool']) params = self._get_vdisk_create_params( opts, add_copies=True if opts['mirror_pool'] else False) self.ssh.mkvdisk(name, size, units, mdiskgrp, opts, params) LOG.debug('Leave: _create_vdisk: volume %s.', name) def get_vdisk_attributes(self, vdisk): attrs = self.ssh.lsvdisk(vdisk) return attrs def is_vdisk_defined(self, vdisk_name): """Check if vdisk is defined.""" attrs = self.get_vdisk_attributes(vdisk_name) return attrs is not None def find_vdisk_copy_id(self, vdisk, pool): resp = self.ssh.lsvdiskcopy(vdisk) for copy_id, mdisk_grp in resp.select('copy_id', 'mdisk_grp_name'): if mdisk_grp == pool: return copy_id msg = _('Failed to find a vdisk copy in the expected pool.') LOG.error(msg) raise exception.VolumeDriverException(message=msg) def get_vdisk_copy_attrs(self, vdisk, copy_id): return self.ssh.lsvdiskcopy(vdisk, copy_id=copy_id)[0] def get_vdisk_copies(self, vdisk): copies = {'primary': None, 'secondary': None} resp = self.ssh.lsvdiskcopy(vdisk) for copy_id, status, sync, primary, mdisk_grp in ( resp.select('copy_id', 'status', 'sync', 'primary', 'mdisk_grp_name')): copy = {'copy_id': copy_id, 'status': status, 'sync': sync, 'primary': primary, 'mdisk_grp_name': mdisk_grp, 'sync_progress': None} if copy['sync'] != 'yes': progress_info = self.ssh.lsvdisksyncprogress(vdisk, copy_id) copy['sync_progress'] = progress_info['progress'] if copy['primary'] == 'yes': copies['primary'] = copy else: copies['secondary'] = copy return copies def _prepare_fc_map(self, fc_map_id, timeout): self.ssh.prestartfcmap(fc_map_id) mapping_ready = False max_retries = (timeout // self.WAIT_TIME) + 1 for try_number in range(1, max_retries): mapping_attrs = self._get_flashcopy_mapping_attributes(fc_map_id) if (mapping_attrs is None or 'status' not in mapping_attrs): break if mapping_attrs['status'] == 'prepared': mapping_ready = True break elif mapping_attrs['status'] == 'stopped': self.ssh.prestartfcmap(fc_map_id) elif mapping_attrs['status'] != 'preparing': msg = (_('Unexecpted mapping status %(status)s for mapping ' '%(id)s. Attributes: %(attr)s.') % {'status': mapping_attrs['status'], 'id': fc_map_id, 'attr': mapping_attrs}) LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg) greenthread.sleep(self.WAIT_TIME) if not mapping_ready: msg = (_('Mapping %(id)s prepare failed to complete within the' 'allotted %(to)d seconds timeout. Terminating.') % {'id': fc_map_id, 'to': timeout}) LOG.error(msg) raise exception.VolumeDriverException(message=msg) def start_fc_consistgrp(self, fc_consistgrp): self.ssh.startfcconsistgrp(fc_consistgrp) def create_fc_consistgrp(self, fc_consistgrp): self.ssh.mkfcconsistgrp(fc_consistgrp) def delete_fc_consistgrp(self, fc_consistgrp): self.ssh.rmfcconsistgrp(fc_consistgrp) def stop_fc_consistgrp(self, fc_consistgrp): self.ssh.stopfcconsistgrp(fc_consistgrp) def run_consistgrp_snapshots(self, fc_consistgrp, snapshots, state, config, timeout): model_update = {'status': fields.GroupSnapshotStatus.AVAILABLE} snapshots_model_update = [] try: for snapshot in snapshots: opts = self.get_vdisk_params(config, state, snapshot['volume_type_id']) volume = snapshot.volume if not volume: msg = (_("Can't get volume from snapshot: %(id)s") % {"id": snapshot.id}) LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg) pool = utils.extract_host(volume.host, 'pool') self.create_flashcopy_to_consistgrp(snapshot['volume_name'], snapshot['name'], fc_consistgrp, config, opts, False, pool=pool) self.prepare_fc_consistgrp(fc_consistgrp, timeout) self.start_fc_consistgrp(fc_consistgrp) # There is CG limitation that could not create more than 128 CGs. # After start CG, we delete CG to avoid CG limitation. # Cinder general will maintain the CG and snapshots relationship. self.delete_fc_consistgrp(fc_consistgrp) except exception.VolumeBackendAPIException as err: model_update['status'] = fields.GroupSnapshotStatus.ERROR # Release cg self.delete_fc_consistgrp(fc_consistgrp) LOG.error("Failed to create CGSnapshot. " "Exception: %s.", err) for snapshot in snapshots: snapshots_model_update.append( {'id': snapshot['id'], 'status': model_update['status']}) return model_update, snapshots_model_update def delete_consistgrp_snapshots(self, fc_consistgrp, snapshots): """Delete flashcopy maps and consistent group.""" model_update = {'status': fields.GroupSnapshotStatus.DELETED} snapshots_model_update = [] try: for snapshot in snapshots: self.delete_vdisk(snapshot['name'], True) except exception.VolumeBackendAPIException as err: model_update['status'] = ( fields.GroupSnapshotStatus.ERROR_DELETING) LOG.error("Failed to delete the snapshot %(snap)s of " "CGSnapshot. Exception: %(exception)s.", {'snap': snapshot['name'], 'exception': err}) for snapshot in snapshots: snapshots_model_update.append( {'id': snapshot['id'], 'status': model_update['status']}) return model_update, snapshots_model_update def prepare_fc_consistgrp(self, fc_consistgrp, timeout): """Prepare FC Consistency Group.""" self.ssh.prestartfcconsistgrp(fc_consistgrp) def prepare_fc_consistgrp_success(): mapping_ready = False mapping_attrs = self._get_flashcopy_consistgrp_attr(fc_consistgrp) if (mapping_attrs is None or 'status' not in mapping_attrs): pass if mapping_attrs['status'] == 'prepared': mapping_ready = True elif mapping_attrs['status'] == 'stopped': self.ssh.prestartfcconsistgrp(fc_consistgrp) elif mapping_attrs['status'] != 'preparing': msg = (_('Unexpected mapping status %(status)s for mapping' '%(id)s. Attributes: %(attr)s.') % {'status': mapping_attrs['status'], 'id': fc_consistgrp, 'attr': mapping_attrs}) LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg) return mapping_ready self._wait_for_a_condition(prepare_fc_consistgrp_success, timeout) def create_cg_from_source(self, group, fc_consistgrp, sources, targets, state, config, timeout): """Create consistence group from source""" LOG.debug('Enter: create_cg_from_source: cg %(cg)s' ' source %(source)s, target %(target)s', {'cg': fc_consistgrp, 'source': sources, 'target': targets}) model_update = {'status': fields.GroupStatus.AVAILABLE} ctxt = context.get_admin_context() try: for source, target in zip(sources, targets): opts = self.get_vdisk_params(config, state, source['volume_type_id']) pool = utils.extract_host(target['host'], 'pool') self.create_flashcopy_to_consistgrp(source['name'], target['name'], fc_consistgrp, config, opts, True, pool=pool) self.prepare_fc_consistgrp(fc_consistgrp, timeout) self.start_fc_consistgrp(fc_consistgrp) self.delete_fc_consistgrp(fc_consistgrp) volumes_model_update = self._get_volume_model_updates( ctxt, targets, group['id'], model_update['status']) except exception.VolumeBackendAPIException as err: model_update['status'] = fields.GroupStatus.ERROR volumes_model_update = self._get_volume_model_updates( ctxt, targets, group['id'], model_update['status']) with excutils.save_and_reraise_exception(): # Release cg self.delete_fc_consistgrp(fc_consistgrp) LOG.error("Failed to create CG from CGsnapshot. " "Exception: %s", err) return model_update, volumes_model_update LOG.debug('Leave: create_cg_from_source.') return model_update, volumes_model_update def _get_volume_model_updates(self, ctxt, volumes, cgId, status='available'): """Update the volume model's status and return it.""" volume_model_updates = [] LOG.info("Updating status for CG: %(id)s.", {'id': cgId}) if volumes: for volume in volumes: volume_model_updates.append({'id': volume['id'], 'status': status}) else: LOG.info("No volume found for CG: %(cg)s.", {'cg': cgId}) return volume_model_updates def run_flashcopy(self, source, target, timeout, copy_rate, full_copy=True): """Create a FlashCopy mapping from the source to the target.""" LOG.debug('Enter: run_flashcopy: execute FlashCopy from source ' '%(source)s to target %(target)s.', {'source': source, 'target': target}) fc_map_id = self.ssh.mkfcmap(source, target, full_copy, copy_rate) self._prepare_fc_map(fc_map_id, timeout) self.ssh.startfcmap(fc_map_id) LOG.debug('Leave: run_flashcopy: FlashCopy started from ' '%(source)s to %(target)s.', {'source': source, 'target': target}) def create_flashcopy_to_consistgrp(self, source, target, consistgrp, config, opts, full_copy=False, pool=None): """Create a FlashCopy mapping and add to consistent group.""" LOG.debug('Enter: create_flashcopy_to_consistgrp: create FlashCopy' ' from source %(source)s to target %(target)s' 'Then add the flashcopy to %(cg)s.', {'source': source, 'target': target, 'cg': consistgrp}) src_attrs = self.get_vdisk_attributes(source) if src_attrs is None: msg = (_('create_copy: Source vdisk %(src)s ' 'does not exist.') % {'src': source}) LOG.error(msg) raise exception.VolumeDriverException(message=msg) src_size = src_attrs['capacity'] # In case we need to use a specific pool if not pool: pool = src_attrs['mdisk_grp_name'] opts['iogrp'] = src_attrs['IO_group_id'] self.create_vdisk(target, src_size, 'b', pool, opts) self.ssh.mkfcmap(source, target, full_copy, config.storwize_svc_flashcopy_rate, consistgrp=consistgrp) LOG.debug('Leave: create_flashcopy_to_consistgrp: ' 'FlashCopy started from %(source)s to %(target)s.', {'source': source, 'target': target}) def _get_vdisk_fc_mappings(self, vdisk): """Return FlashCopy mappings that this vdisk is associated with.""" mapping_ids = [] resp = self.ssh.lsvdiskfcmappings(vdisk) for id in resp.select('id'): mapping_ids.append(id) return mapping_ids def _get_flashcopy_mapping_attributes(self, fc_map_id): resp = self.ssh.lsfcmap(fc_map_id) if not len(resp): return None return resp[0] def _get_flashcopy_consistgrp_attr(self, fc_map_id): resp = self.ssh.lsfcconsistgrp(fc_map_id) if not len(resp): return None return resp[0] def _check_vdisk_fc_mappings(self, name, allow_snaps=True, allow_fctgt=False): """FlashCopy mapping check helper.""" LOG.debug('Loopcall: _check_vdisk_fc_mappings(), vdisk %s.', name) mapping_ids = self._get_vdisk_fc_mappings(name) wait_for_copy = False for map_id in mapping_ids: attrs = self._get_flashcopy_mapping_attributes(map_id) # We should ignore GMCV flash copies if not attrs or 'yes' == attrs['rc_controlled']: continue source = attrs['source_vdisk_name'] target = attrs['target_vdisk_name'] copy_rate = attrs['copy_rate'] status = attrs['status'] if allow_fctgt and target == name and status == 'copying': self.ssh.stopfcmap(map_id) attrs = self._get_flashcopy_mapping_attributes(map_id) if attrs: status = attrs['status'] if copy_rate == '0': if source == name: # Vdisk with snapshots. Return False if snapshot # not allowed. if not allow_snaps: raise loopingcall.LoopingCallDone(retvalue=False) self.ssh.chfcmap(map_id, copyrate='50', autodel='on') wait_for_copy = True else: # A snapshot if target != name: msg = (_('Vdisk %(name)s not involved in ' 'mapping %(src)s -> %(tgt)s.') % {'name': name, 'src': source, 'tgt': target}) LOG.error(msg) raise exception.VolumeDriverException(message=msg) if status in ['copying', 'prepared']: self.ssh.stopfcmap(map_id) # Need to wait for the fcmap to change to # stopped state before remove fcmap wait_for_copy = True elif status in ['stopping', 'preparing']: wait_for_copy = True else: self.ssh.rmfcmap(map_id) # Case 4: Copy in progress - wait and will autodelete else: if status == 'prepared': self.ssh.stopfcmap(map_id) self.ssh.rmfcmap(map_id) elif status in ['idle_or_copied', 'stopped']: # Prepare failed or stopped self.ssh.rmfcmap(map_id) else: wait_for_copy = True if not wait_for_copy or not len(mapping_ids): raise loopingcall.LoopingCallDone(retvalue=True) def ensure_vdisk_no_fc_mappings(self, name, allow_snaps=True, allow_fctgt=False): """Ensure vdisk has no flashcopy mappings.""" timer = loopingcall.FixedIntervalLoopingCall( self._check_vdisk_fc_mappings, name, allow_snaps, allow_fctgt) # Create a timer greenthread. The default volume service heart # beat is every 10 seconds. The flashcopy usually takes hours # before it finishes. Don't set the sleep interval shorter # than the heartbeat. Otherwise volume service heartbeat # will not be serviced. LOG.debug('Calling _ensure_vdisk_no_fc_mappings: vdisk %s.', name) ret = timer.start(interval=self.check_fcmapping_interval).wait() timer.stop() return ret def start_relationship(self, volume_name, primary=None): vol_attrs = self.get_vdisk_attributes(volume_name) if vol_attrs['RC_name']: self.ssh.startrcrelationship(vol_attrs['RC_name'], primary) def stop_relationship(self, volume_name, access=False): vol_attrs = self.get_vdisk_attributes(volume_name) if vol_attrs['RC_name']: self.ssh.stoprcrelationship(vol_attrs['RC_name'], access=access) def create_relationship(self, master, aux, system, asyncmirror, cyclingmode=False, masterchange=None, cycle_period_seconds=None): try: rc_id = self.ssh.mkrcrelationship(master, aux, system, asyncmirror, cyclingmode) except exception.VolumeBackendAPIException as e: # CMMVC5959E is the code in Stowize storage, meaning that # there is a relationship that already has this name on the # master cluster. if 'CMMVC5959E' not in e: # If there is no relation between the primary and the # secondary back-end storage, the exception is raised. raise if rc_id: # We need setup master and aux change volumes for gmcv # before we can start remote relationship # aux change volume must be set on target site if cycle_period_seconds: self.change_relationship_cycleperiod(master, cycle_period_seconds) if masterchange: self.change_relationship_changevolume(master, masterchange, True) else: self.start_relationship(master) def change_relationship_changevolume(self, volume_name, change_volume, master): vol_attrs = self.get_vdisk_attributes(volume_name) if vol_attrs['RC_name'] and change_volume: self.ssh.ch_rcrelationship_changevolume(vol_attrs['RC_name'], change_volume, master) def change_relationship_cycleperiod(self, volume_name, cycle_period_seconds): vol_attrs = self.get_vdisk_attributes(volume_name) if vol_attrs['RC_name'] and cycle_period_seconds: self.ssh.ch_rcrelationship_cycleperiod(vol_attrs['RC_name'], cycle_period_seconds) def delete_relationship(self, volume_name): vol_attrs = self.get_vdisk_attributes(volume_name) if vol_attrs['RC_name']: self.ssh.rmrcrelationship(vol_attrs['RC_name'], True) def get_relationship_info(self, volume_name): vol_attrs = self.get_vdisk_attributes(volume_name) if not vol_attrs or not vol_attrs['RC_name']: LOG.info("Unable to get remote copy information for " "volume %s", volume_name) return relationship = self.ssh.lsrcrelationship(vol_attrs['RC_name']) return relationship[0] if len(relationship) > 0 else None def delete_rc_volume(self, volume_name, target_vol=False): vol_name = volume_name if target_vol: vol_name = storwize_const.REPLICA_AUX_VOL_PREFIX + volume_name try: rel_info = self.get_relationship_info(vol_name) if rel_info: self.delete_relationship(vol_name) # Delete change volume self.delete_vdisk( storwize_const.REPLICA_CHG_VOL_PREFIX + vol_name, False) self.delete_vdisk(vol_name, False) except Exception as e: msg = (_('Unable to delete the volume for ' 'volume %(vol)s. Exception: %(err)s.'), {'vol': vol_name, 'err': e}) LOG.exception(msg) raise exception.VolumeDriverException(message=msg) def switch_relationship(self, relationship, aux=True): self.ssh.switchrelationship(relationship, aux) def get_partnership_info(self, system_name): partnership = self.ssh.lspartnership(system_name) return partnership[0] if len(partnership) > 0 else None def get_partnershipcandidate_info(self, system_name): candidates = self.ssh.lspartnershipcandidate() for candidate in candidates: if system_name == candidate['name']: return candidate return None def mkippartnership(self, ip_v4, bandwith=1000, copyrate=50): self.ssh.mkippartnership(ip_v4, bandwith, copyrate) def mkfcpartnership(self, system_name, bandwith=1000, copyrate=50): self.ssh.mkfcpartnership(system_name, bandwith, copyrate) def chpartnership(self, partnership_id): self.ssh.chpartnership(partnership_id) def delete_vdisk(self, vdisk, force): """Ensures that vdisk is not part of FC mapping and deletes it.""" LOG.debug('Enter: delete_vdisk: vdisk %s.', vdisk) if not self.is_vdisk_defined(vdisk): LOG.info('Tried to delete non-existent vdisk %s.', vdisk) return self.ensure_vdisk_no_fc_mappings(vdisk, allow_snaps=True, allow_fctgt=True) self.ssh.rmvdisk(vdisk, force=force) LOG.debug('Leave: delete_vdisk: vdisk %s.', vdisk) def create_copy(self, src, tgt, src_id, config, opts, full_copy, pool=None): """Create a new snapshot using FlashCopy.""" LOG.debug('Enter: create_copy: snapshot %(src)s to %(tgt)s.', {'tgt': tgt, 'src': src}) src_attrs = self.get_vdisk_attributes(src) if src_attrs is None: msg = (_('create_copy: Source vdisk %(src)s (%(src_id)s) ' 'does not exist.') % {'src': src, 'src_id': src_id}) LOG.error(msg) raise exception.VolumeDriverException(message=msg) src_size = src_attrs['capacity'] # In case we need to use a specific pool if not pool: pool = src_attrs['mdisk_grp_name'] opts['iogrp'] = src_attrs['IO_group_id'] self.create_vdisk(tgt, src_size, 'b', pool, opts) timeout = config.storwize_svc_flashcopy_timeout try: self.run_flashcopy(src, tgt, timeout, config.storwize_svc_flashcopy_rate, full_copy=full_copy) except Exception: with excutils.save_and_reraise_exception(): self.delete_vdisk(tgt, True) LOG.debug('Leave: _create_copy: snapshot %(tgt)s from ' 'vdisk %(src)s.', {'tgt': tgt, 'src': src}) def extend_vdisk(self, vdisk, amount): self.ssh.expandvdisksize(vdisk, amount) def add_vdisk_copy(self, vdisk, dest_pool, volume_type, state, config, auto_delete=False): """Add a vdisk copy in the given pool.""" resp = self.ssh.lsvdiskcopy(vdisk) if len(resp) > 1: msg = (_('add_vdisk_copy failed: A copy of volume %s exists. ' 'Adding another copy would exceed the limit of ' '2 copies.') % vdisk) raise exception.VolumeDriverException(message=msg) orig_copy_id = resp[0].get("copy_id", None) if orig_copy_id is None: msg = (_('add_vdisk_copy started without a vdisk copy in the ' 'expected pool.')) LOG.error(msg) raise exception.VolumeDriverException(message=msg) if volume_type is None: opts = self.get_vdisk_params(config, state, None) else: opts = self.get_vdisk_params(config, state, volume_type['id'], volume_type=volume_type) params = self._get_vdisk_create_params(opts) try: new_copy_id = self.ssh.addvdiskcopy(vdisk, dest_pool, params, auto_delete) except exception.VolumeBackendAPIException as e: msg = (_('Unable to add vdiskcopy for volume %(vol)s. ' 'Exception: %(err)s.'), {'vol': vdisk, 'err': e}) LOG.exception(msg) raise exception.VolumeDriverException(message=msg) return (orig_copy_id, new_copy_id) def is_vdisk_copy_synced(self, vdisk, copy_id): sync = self.ssh.lsvdiskcopy(vdisk, copy_id=copy_id)[0]['sync'] if sync == 'yes': return True return False def rm_vdisk_copy(self, vdisk, copy_id): self.ssh.rmvdiskcopy(vdisk, copy_id) def lsvdiskcopy(self, vdisk, copy_id=None): return self.ssh.lsvdiskcopy(vdisk, copy_id) @staticmethod def can_migrate_to_host(host, state): if 'location_info' not in host['capabilities']: return None info = host['capabilities']['location_info'] try: (dest_type, dest_id, dest_pool) = info.split(':') except ValueError: return None if (dest_type != 'StorwizeSVCDriver' or dest_id != state['system_id']): return None return dest_pool def add_vdisk_qos(self, vdisk, qos): """Add the QoS configuration to the volume.""" for key, value in qos.items(): if key in self.svc_qos_keys.keys(): param = self.svc_qos_keys[key]['param'] self.ssh.chvdisk(vdisk, ['-' + param, str(value)]) def update_vdisk_qos(self, vdisk, qos): """Update all the QoS in terms of a key and value. svc_qos_keys saves all the supported QoS parameters. Going through this dict, we set the new values to all the parameters. If QoS is available in the QoS configuration, the value is taken from it; if not, the value will be set to default. """ for key, value in self.svc_qos_keys.items(): param = value['param'] if key in qos.keys(): # If the value is set in QoS, take the value from # the QoS configuration. v = qos[key] else: # If not, set the value to default. v = value['default'] self.ssh.chvdisk(vdisk, ['-' + param, str(v)]) def disable_vdisk_qos(self, vdisk, qos): """Disable the QoS.""" for key, value in qos.items(): if key in self.svc_qos_keys.keys(): param = self.svc_qos_keys[key]['param'] # Take the default value. value = self.svc_qos_keys[key]['default'] self.ssh.chvdisk(vdisk, ['-' + param, value]) def change_vdisk_options(self, vdisk, changes, opts, state): if 'warning' in opts: opts['warning'] = '%s%%' % str(opts['warning']) if 'easytier' in opts: opts['easytier'] = 'on' if opts['easytier'] else 'off' if 'autoexpand' in opts: opts['autoexpand'] = 'on' if opts['autoexpand'] else 'off' for key in changes: self.ssh.chvdisk(vdisk, ['-' + key, opts[key]]) def change_vdisk_iogrp(self, vdisk, state, iogrp): if state['code_level'] < (6, 4, 0, 0): LOG.debug('Ignore change IO group as storage code level is ' '%(code_level)s, below the required 6.4.0.0.', {'code_level': state['code_level']}) else: self.ssh.movevdisk(vdisk, str(iogrp[0])) self.ssh.addvdiskaccess(vdisk, str(iogrp[0])) self.ssh.rmvdiskaccess(vdisk, str(iogrp[1])) def vdisk_by_uid(self, vdisk_uid): """Returns the properties of the vdisk with the specified UID. Returns None if no such disk exists. """ vdisks = self.ssh.lsvdisks_from_filter('vdisk_UID', vdisk_uid) if len(vdisks) == 0: return None if len(vdisks) != 1: msg = (_('Expected single vdisk returned from lsvdisk when ' 'filtering on vdisk_UID. %(count)s were returned.') % {'count': len(vdisks)}) LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg) vdisk = vdisks.result[0] return self.ssh.lsvdisk(vdisk['name']) def is_vdisk_in_use(self, vdisk): """Returns True if the specified vdisk is mapped to at least 1 host.""" resp = self.ssh.lsvdiskhostmap(vdisk) return len(resp) != 0 def rename_vdisk(self, vdisk, new_name): self.ssh.chvdisk(vdisk, ['-name', new_name]) def change_vdisk_primary_copy(self, vdisk, copy_id): self.ssh.chvdisk(vdisk, ['-primary', copy_id]) def migratevdisk(self, vdisk, dest_pool, copy_id='0'): self.ssh.migratevdisk(vdisk, dest_pool, copy_id) class CLIResponse(object): """Parse SVC CLI output and generate iterable.""" def __init__(self, raw, ssh_cmd=None, delim='!', with_header=True): super(CLIResponse, self).__init__() if ssh_cmd: self.ssh_cmd = ' '.join(ssh_cmd) else: self.ssh_cmd = 'None' self.raw = raw self.delim = delim self.with_header = with_header self.result = self._parse() def select(self, *keys): for a in self.result: vs = [] for k in keys: v = a.get(k, None) if isinstance(v, six.string_types) or v is None: v = [v] if isinstance(v, list): vs.append(v) for item in zip(*vs): if len(item) == 1: yield item[0] else: yield item def __getitem__(self, key): try: return self.result[key] except KeyError: msg = (_('Did not find the expected key %(key)s in %(fun)s: ' '%(raw)s.') % {'key': key, 'fun': self.ssh_cmd, 'raw': self.raw}) raise exception.VolumeBackendAPIException(data=msg) def __iter__(self): for a in self.result: yield a def __len__(self): return len(self.result) def _parse(self): def get_reader(content, delim): for line in content.lstrip().splitlines(): line = line.strip() if line: yield line.split(delim) else: yield [] if isinstance(self.raw, six.string_types): stdout, stderr = self.raw, '' else: stdout, stderr = self.raw reader = get_reader(stdout, self.delim) result = [] if self.with_header: hds = tuple() for row in reader: hds = row break for row in reader: cur = dict() if len(hds) != len(row): msg = (_('Unexpected CLI response: header/row mismatch. ' 'header: %(header)s, row: %(row)s.') % {'header': hds, 'row': row}) raise exception.VolumeBackendAPIException(data=msg) for k, v in zip(hds, row): CLIResponse.append_dict(cur, k, v) result.append(cur) else: cur = dict() for row in reader: if row: CLIResponse.append_dict(cur, row[0], ' '.join(row[1:])) elif cur: # start new section result.append(cur) cur = dict() if cur: result.append(cur) return result @staticmethod def append_dict(dict_, key, value): key, value = key.strip(), value.strip() obj = dict_.get(key, None) if obj is None: dict_[key] = value elif isinstance(obj, list): obj.append(value) dict_[key] = obj else: dict_[key] = [obj, value] return dict_ class StorwizeSVCCommonDriver(san.SanDriver, driver.ManageableVD, driver.MigrateVD, driver.CloneableImageVD): """IBM Storwize V7000 SVC abstract base class for iSCSI/FC volume drivers. Version history: .. code-block:: none 1.0 - Initial driver 1.1 - FC support, create_cloned_volume, volume type support, get_volume_stats, minor bug fixes 1.2.0 - Added retype 1.2.1 - Code refactor, improved exception handling 1.2.2 - Fix bug #1274123 (races in host-related functions) 1.2.3 - Fix Fibre Channel connectivity: bug #1279758 (add delim to lsfabric, clear unused data from connections, ensure matching WWPNs by comparing lower case 1.2.4 - Fix bug #1278035 (async migration/retype) 1.2.5 - Added support for manage_existing (unmanage is inherited) 1.2.6 - Added QoS support in terms of I/O throttling rate 1.3.1 - Added support for volume replication 1.3.2 - Added support for consistency group 1.3.3 - Update driver to use ABC metaclasses 2.0 - Code refactor, split init file and placed shared methods for FC and iSCSI within the StorwizeSVCCommonDriver class 2.1 - Added replication V2 support to the global/metro mirror mode 2.1.1 - Update replication to version 2.1 """ VERSION = "2.1.1" VDISKCOPYOPS_INTERVAL = 600 DEFAULT_GR_SLEEP = random.randint(20, 500) / 100.0 def __init__(self, *args, **kwargs): super(StorwizeSVCCommonDriver, self).__init__(*args, **kwargs) self.configuration.append_config_values(storwize_svc_opts) self._backend_name = self.configuration.safe_get('volume_backend_name') self.active_ip = self.configuration.san_ip self.inactive_ip = self.configuration.storwize_san_secondary_ip self._master_backend_helpers = StorwizeHelpers(self._run_ssh) self._aux_backend_helpers = None self._helpers = self._master_backend_helpers self._vdiskcopyops = {} self._vdiskcopyops_loop = None self.protocol = None self._state = {'storage_nodes': {}, 'enabled_protocols': set(), 'compression_enabled': False, 'available_iogrps': [], 'system_name': None, 'system_id': None, 'code_level': None, } self._active_backend_id = kwargs.get('active_backend_id') # This dictionary is used to map each replication target to certain # replication manager object. self.replica_manager = {} # One driver can be configured with only one replication target # to failover. self._replica_target = {} # This boolean is used to indicate whether replication is supported # by this storage. self._replica_enabled = False # This list is used to save the supported replication modes. self._supported_replica_types = [] # This is used to save the available pools in failed-over status self._secondary_pools = None # Storwize has the limitation that can not burst more than 3 new ssh # connections within 1 second. So slow down the initialization. time.sleep(1) def do_setup(self, ctxt): """Check that we have all configuration details from the storage.""" LOG.debug('enter: do_setup') # v2.1 replication setup self._get_storwize_config() # Update the storwize state self._update_storwize_state() # Validate that the pool exists self._validate_pools_exist() # Build the list of in-progress vdisk copy operations if ctxt is None: admin_context = context.get_admin_context() else: admin_context = ctxt.elevated() volumes = objects.VolumeList.get_all_by_host(admin_context, self.host) for volume in volumes: metadata = volume.admin_metadata curr_ops = metadata.get('vdiskcopyops', None) if curr_ops: ops = [tuple(x.split(':')) for x in curr_ops.split(';')] self._vdiskcopyops[volume['id']] = ops # if vdiskcopy exists in database, start the looping call if len(self._vdiskcopyops) >= 1: self._vdiskcopyops_loop = loopingcall.FixedIntervalLoopingCall( self._check_volume_copy_ops) self._vdiskcopyops_loop.start(interval=self.VDISKCOPYOPS_INTERVAL) LOG.debug('leave: do_setup') def _update_storwize_state(self): # Get storage system name, id, and code level self._state.update(self._helpers.get_system_info()) # Check if compression is supported self._state['compression_enabled'] = (self._helpers. compression_enabled()) # Get the available I/O groups self._state['available_iogrps'] = (self._helpers. get_available_io_groups()) # Get the iSCSI and FC names of the Storwize/SVC nodes self._state['storage_nodes'] = self._helpers.get_node_info() # Add the iSCSI IP addresses and WWPNs to the storage node info self._helpers.add_iscsi_ip_addrs(self._state['storage_nodes']) self._helpers.add_fc_wwpns(self._state['storage_nodes']) # For each node, check what connection modes it supports. Delete any # nodes that do not support any types (may be partially configured). to_delete = [] for k, node in self._state['storage_nodes'].items(): if ((len(node['ipv4']) or len(node['ipv6'])) and len(node['iscsi_name'])): node['enabled_protocols'].append('iSCSI') self._state['enabled_protocols'].add('iSCSI') if len(node['WWPN']): node['enabled_protocols'].append('FC') self._state['enabled_protocols'].add('FC') if not len(node['enabled_protocols']): to_delete.append(k) for delkey in to_delete: del self._state['storage_nodes'][delkey] def _get_backend_pools(self): if not self._active_backend_id: return self.configuration.storwize_svc_volpool_name elif not self._secondary_pools: self._secondary_pools = [self._replica_target.get('pool_name')] return self._secondary_pools def _validate_pools_exist(self): # Validate that the pool exists pools = self._get_backend_pools() for pool in pools: if not self._helpers.is_pool_defined(pool): reason = (_('Failed getting details for pool %s.') % pool) raise exception.InvalidInput(reason=reason) def check_for_setup_error(self): """Ensure that the flags are set properly.""" LOG.debug('enter: check_for_setup_error') # Check that we have the system ID information if self._state['system_name'] is None: exception_msg = (_('Unable to determine system name.')) raise exception.VolumeBackendAPIException(data=exception_msg) if self._state['system_id'] is None: exception_msg = (_('Unable to determine system id.')) raise exception.VolumeBackendAPIException(data=exception_msg) # Make sure we have at least one node configured if not len(self._state['storage_nodes']): msg = _('do_setup: No configured nodes.') LOG.error(msg) raise exception.VolumeDriverException(message=msg) if self.protocol not in self._state['enabled_protocols']: # TODO(mc_nair): improve this error message by looking at # self._state['enabled_protocols'] to tell user what driver to use raise exception.InvalidInput( reason=_('The storage device does not support %(prot)s. ' 'Please configure the device to support %(prot)s or ' 'switch to a driver using a different protocol.') % {'prot': self.protocol}) required_flags = ['san_ip', 'san_ssh_port', 'san_login', 'storwize_svc_volpool_name'] for flag in required_flags: if not self.configuration.safe_get(flag): raise exception.InvalidInput(reason=_('%s is not set.') % flag) # Ensure that either password or keyfile were set if not (self.configuration.san_password or self.configuration.san_private_key): raise exception.InvalidInput( reason=_('Password or SSH private key is required for ' 'authentication: set either san_password or ' 'san_private_key option.')) opts = self._helpers.build_default_opts(self.configuration) self._helpers.check_vdisk_opts(self._state, opts) LOG.debug('leave: check_for_setup_error') def _run_ssh(self, cmd_list, check_exit_code=True, attempts=1): cinder_utils.check_ssh_injection(cmd_list) command = ' '.join(cmd_list) if not self.sshpool: try: self.sshpool = self._set_up_sshpool(self.active_ip) except paramiko.SSHException: LOG.warning('Unable to use san_ip to create SSHPool. Now ' 'attempting to use storwize_san_secondary_ip ' 'to create SSHPool.') if self._toggle_ip(): self.sshpool = self._set_up_sshpool(self.active_ip) else: LOG.warning('Unable to create SSHPool using san_ip ' 'and not able to use ' 'storwize_san_secondary_ip since it is ' 'not configured.') raise try: return self._ssh_execute(self.sshpool, command, check_exit_code, attempts) except Exception: # Need to check if creating an SSHPool storwize_san_secondary_ip # before raising an error. try: if self._toggle_ip(): LOG.warning("Unable to execute SSH command with " "%(inactive)s. Attempting to execute SSH " "command with %(active)s.", {'inactive': self.inactive_ip, 'active': self.active_ip}) self.sshpool = self._set_up_sshpool(self.active_ip) return self._ssh_execute(self.sshpool, command, check_exit_code, attempts) else: LOG.warning('Not able to use ' 'storwize_san_secondary_ip since it is ' 'not configured.') raise except Exception: with excutils.save_and_reraise_exception(): LOG.error("Error running SSH command: %s", command) def _set_up_sshpool(self, ip): password = self.configuration.san_password privatekey = self.configuration.san_private_key min_size = self.configuration.ssh_min_pool_conn max_size = self.configuration.ssh_max_pool_conn sshpool = ssh_utils.SSHPool( ip, self.configuration.san_ssh_port, self.configuration.ssh_conn_timeout, self.configuration.san_login, password=password, privatekey=privatekey, min_size=min_size, max_size=max_size) return sshpool def _ssh_execute(self, sshpool, command, check_exit_code = True, attempts=1): try: with sshpool.item() as ssh: while attempts > 0: attempts -= 1 try: return processutils.ssh_execute( ssh, command, check_exit_code=check_exit_code) except Exception as e: LOG.error('Error has occurred: %s', e) last_exception = e greenthread.sleep(self.DEFAULT_GR_SLEEP) try: raise processutils.ProcessExecutionError( exit_code=last_exception.exit_code, stdout=last_exception.stdout, stderr=last_exception.stderr, cmd=last_exception.cmd) except AttributeError: raise processutils.ProcessExecutionError( exit_code=-1, stdout="", stderr="Error running SSH command", cmd=command) except Exception: with excutils.save_and_reraise_exception(): LOG.error("Error running SSH command: %s", command) def _toggle_ip(self): # Change active_ip if storwize_san_secondary_ip is set. if self.configuration.storwize_san_secondary_ip is None: return False self.inactive_ip, self.active_ip = self.active_ip, self.inactive_ip LOG.info('Toggle active_ip from %(old)s to %(new)s.', {'old': self.inactive_ip, 'new': self.active_ip}) return True def ensure_export(self, ctxt, volume): """Check that the volume exists on the storage. The system does not "export" volumes as a Linux iSCSI target does, and therefore we just check that the volume exists on the storage. """ vol_name = self._get_target_vol(volume) volume_defined = self._helpers.is_vdisk_defined(vol_name) if not volume_defined: LOG.error('ensure_export: Volume %s not found on storage.', volume['name']) def create_export(self, ctxt, volume, connector): model_update = None return model_update def remove_export(self, ctxt, volume): pass def _get_vdisk_params(self, type_id, volume_type=None, volume_metadata=None): return self._helpers.get_vdisk_params(self.configuration, self._state, type_id, volume_type=volume_type, volume_metadata=volume_metadata) def create_volume(self, volume): LOG.debug('enter: create_volume: volume %s', volume['name']) opts = self._get_vdisk_params(volume['volume_type_id'], volume_metadata= volume.get('volume_metadata')) ctxt = context.get_admin_context() rep_type = self._get_volume_replicated_type(ctxt, volume) pool = utils.extract_host(volume['host'], 'pool') if opts['mirror_pool'] and rep_type: reason = _('Create mirror volume with replication enabled is ' 'not supported.') raise exception.InvalidInput(reason=reason) opts['iogrp'] = self._helpers.select_io_group(self._state, opts) self._helpers.create_vdisk(volume['name'], str(volume['size']), 'gb', pool, opts) if opts['qos']: self._helpers.add_vdisk_qos(volume['name'], opts['qos']) model_update = None if rep_type: replica_obj = self._get_replica_obj(rep_type) replica_obj.volume_replication_setup(ctxt, volume) model_update = {'replication_status': fields.ReplicationStatus.ENABLED} LOG.debug('leave: create_volume:\n volume: %(vol)s\n ' 'model_update %(model_update)s', {'vol': volume['name'], 'model_update': model_update}) return model_update def delete_volume(self, volume): LOG.debug('enter: delete_volume: volume %s', volume['name']) ctxt = context.get_admin_context() rep_type = self._get_volume_replicated_type(ctxt, volume) if rep_type: if self._aux_backend_helpers: self._aux_backend_helpers.delete_rc_volume(volume['name'], target_vol=True) if not self._active_backend_id: self._master_backend_helpers.delete_rc_volume(volume['name']) else: # If it's in fail over state, also try to delete the volume # in master backend try: self._master_backend_helpers.delete_rc_volume( volume['name']) except Exception as ex: LOG.error('Failed to get delete volume %(volume)s in ' 'master backend. Exception: %(err)s.', {'volume': volume['name'], 'err': ex}) else: if self._active_backend_id: msg = (_('Error: delete non-replicate volume in failover mode' ' is not allowed.')) LOG.error(msg) raise exception.VolumeDriverException(message=msg) else: self._helpers.delete_vdisk(volume['name'], False) if volume['id'] in self._vdiskcopyops: del self._vdiskcopyops[volume['id']] if not len(self._vdiskcopyops): self._vdiskcopyops_loop.stop() self._vdiskcopyops_loop = None LOG.debug('leave: delete_volume: volume %s', volume['name']) def create_snapshot(self, snapshot): ctxt = context.get_admin_context() try: # TODO(zhaochy): change to use snapshot.volume source_vol = self.db.volume_get(ctxt, snapshot['volume_id']) except Exception: msg = (_('create_snapshot: get source volume failed.')) LOG.error(msg) raise exception.VolumeDriverException(message=msg) rep_type = self._get_volume_replicated_type( ctxt, None, source_vol['volume_type_id']) if rep_type == storwize_const.GMCV: # GMCV volume will have problem to failback # when it has flash copy relationship besides change volumes msg = _('create_snapshot: Create snapshot to ' 'gmcv replication volume is not allowed.') LOG.error(msg) raise exception.VolumeDriverException(message=msg) pool = utils.extract_host(source_vol['host'], 'pool') opts = self._get_vdisk_params(source_vol['volume_type_id']) self._helpers.create_copy(snapshot['volume_name'], snapshot['name'], snapshot['volume_id'], self.configuration, opts, False, pool=pool) def delete_snapshot(self, snapshot): self._helpers.delete_vdisk(snapshot['name'], False) def create_volume_from_snapshot(self, volume, snapshot): opts = self._get_vdisk_params(volume['volume_type_id'], volume_metadata= volume.get('volume_metadata')) pool = utils.extract_host(volume['host'], 'pool') self._helpers.create_copy(snapshot['name'], volume['name'], snapshot['id'], self.configuration, opts, True, pool=pool) # The volume size is equal to the snapshot size in most # of the cases. But in some scenario, the volume size # may be bigger than the source volume size. # SVC does not support flashcopy between two volumes # with two different size. So use the snapshot size to # create volume first and then extend the volume to- # the target size. if volume['size'] > snapshot['volume_size']: # extend the new created target volume to expected size. self._extend_volume_op(volume, volume['size'], snapshot['volume_size']) if opts['qos']: self._helpers.add_vdisk_qos(volume['name'], opts['qos']) ctxt = context.get_admin_context() rep_type = self._get_volume_replicated_type(ctxt, volume) if rep_type: self._validate_replication_enabled() replica_obj = self._get_replica_obj(rep_type) replica_obj.volume_replication_setup(ctxt, volume) return {'replication_status': fields.ReplicationStatus.ENABLED} def create_cloned_volume(self, tgt_volume, src_volume): """Creates a clone of the specified volume.""" opts = self._get_vdisk_params(tgt_volume['volume_type_id'], volume_metadata= tgt_volume.get('volume_metadata')) pool = utils.extract_host(tgt_volume['host'], 'pool') self._helpers.create_copy(src_volume['name'], tgt_volume['name'], src_volume['id'], self.configuration, opts, True, pool=pool) # The source volume size is equal to target volume size # in most of the cases. But in some scenarios, the target # volume size may be bigger than the source volume size. # SVC does not support flashcopy between two volumes # with two different sizes. So use source volume size to # create target volume first and then extend target # volume to original size. if tgt_volume['size'] > src_volume['size']: # extend the new created target volume to expected size. self._extend_volume_op(tgt_volume, tgt_volume['size'], src_volume['size']) if opts['qos']: self._helpers.add_vdisk_qos(tgt_volume['name'], opts['qos']) ctxt = context.get_admin_context() rep_type = self._get_volume_replicated_type(ctxt, tgt_volume) if rep_type: self._validate_replication_enabled() replica_obj = self._get_replica_obj(rep_type) replica_obj.volume_replication_setup(ctxt, tgt_volume) return {'replication_status': fields.ReplicationStatus.ENABLED} def extend_volume(self, volume, new_size): self._extend_volume_op(volume, new_size) def _extend_volume_op(self, volume, new_size, old_size=None): LOG.debug('enter: _extend_volume_op: volume %s', volume['id']) volume_name = self._get_target_vol(volume) ret = self._helpers.ensure_vdisk_no_fc_mappings(volume_name, allow_snaps=False) if not ret: msg = (_('_extend_volume_op: Extending a volume with snapshots is ' 'not supported.')) LOG.error(msg) raise exception.VolumeDriverException(message=msg) if old_size is None: old_size = volume.size extend_amt = int(new_size) - old_size rel_info = self._helpers.get_relationship_info(volume_name) if rel_info: LOG.warning('_extend_volume_op: Extending a volume with ' 'remote copy is not recommended.') try: rep_type = rel_info['copy_type'] cyclingmode = rel_info['cycling_mode'] self._master_backend_helpers.delete_relationship( volume.name) tgt_vol = (storwize_const.REPLICA_AUX_VOL_PREFIX + volume.name) self._master_backend_helpers.extend_vdisk(volume.name, extend_amt) self._aux_backend_helpers.extend_vdisk(tgt_vol, extend_amt) tgt_sys = self._aux_backend_helpers.get_system_info() if storwize_const.GMCV_MULTI == cyclingmode: tgt_change_vol = ( storwize_const.REPLICA_CHG_VOL_PREFIX + tgt_vol) source_change_vol = ( storwize_const.REPLICA_CHG_VOL_PREFIX + volume.name) self._master_backend_helpers.extend_vdisk( source_change_vol, extend_amt) self._aux_backend_helpers.extend_vdisk( tgt_change_vol, extend_amt) src_change_opts = self._get_vdisk_params( volume.volume_type_id) cycle_period_seconds = src_change_opts.get( 'cycle_period_seconds') self._master_backend_helpers.create_relationship( volume.name, tgt_vol, tgt_sys.get('system_name'), True, True, source_change_vol, cycle_period_seconds) self._aux_backend_helpers.change_relationship_changevolume( tgt_vol, tgt_change_vol, False) self._master_backend_helpers.start_relationship( volume.name) else: self._master_backend_helpers.create_relationship( volume.name, tgt_vol, tgt_sys.get('system_name'), True if storwize_const.GLOBAL == rep_type else False) except Exception as e: msg = (_('Failed to extend a volume with remote copy ' '%(volume)s. Exception: ' '%(err)s.') % {'volume': volume.id, 'err': e}) LOG.error(msg) raise exception.VolumeDriverException(message=msg) else: self._helpers.extend_vdisk(volume_name, extend_amt) LOG.debug('leave: _extend_volume_op: volume %s', volume.id) def add_vdisk_copy(self, volume, dest_pool, vol_type, auto_delete=False): return self._helpers.add_vdisk_copy(volume, dest_pool, vol_type, self._state, self.configuration, auto_delete=auto_delete) def _add_vdisk_copy_op(self, ctxt, volume, new_op): metadata = self.db.volume_admin_metadata_get(ctxt.elevated(), volume['id']) curr_ops = metadata.get('vdiskcopyops', None) if curr_ops: curr_ops_list = [tuple(x.split(':')) for x in curr_ops.split(';')] new_ops_list = curr_ops_list.append(new_op) else: new_ops_list = [new_op] new_ops_str = ';'.join([':'.join(x) for x in new_ops_list]) self.db.volume_admin_metadata_update(ctxt.elevated(), volume['id'], {'vdiskcopyops': new_ops_str}, False) if volume['id'] in self._vdiskcopyops: self._vdiskcopyops[volume['id']].append(new_op) else: self._vdiskcopyops[volume['id']] = [new_op] # We added the first copy operation, so start the looping call if len(self._vdiskcopyops) == 1: self._vdiskcopyops_loop = loopingcall.FixedIntervalLoopingCall( self._check_volume_copy_ops) self._vdiskcopyops_loop.start(interval=self.VDISKCOPYOPS_INTERVAL) def _rm_vdisk_copy_op(self, ctxt, volume, orig_copy_id, new_copy_id): try: self._vdiskcopyops[volume['id']].remove((orig_copy_id, new_copy_id)) if not len(self._vdiskcopyops[volume['id']]): del self._vdiskcopyops[volume['id']] if not len(self._vdiskcopyops): self._vdiskcopyops_loop.stop() self._vdiskcopyops_loop = None except KeyError: LOG.error('_rm_vdisk_copy_op: Volume %s does not have any ' 'registered vdisk copy operations.', volume['id']) return except ValueError: LOG.error('_rm_vdisk_copy_op: Volume %(vol)s does not have ' 'the specified vdisk copy operation: orig=%(orig)s ' 'new=%(new)s.', {'vol': volume['id'], 'orig': orig_copy_id, 'new': new_copy_id}) return metadata = self.db.volume_admin_metadata_get(ctxt.elevated(), volume['id']) curr_ops = metadata.get('vdiskcopyops', None) if not curr_ops: LOG.error('_rm_vdisk_copy_op: Volume metadata %s does not ' 'have any registered vdisk copy operations.', volume['id']) return curr_ops_list = [tuple(x.split(':')) for x in curr_ops.split(';')] try: curr_ops_list.remove((orig_copy_id, new_copy_id)) except ValueError: LOG.error('_rm_vdisk_copy_op: Volume %(vol)s metadata does ' 'not have the specified vdisk copy operation: ' 'orig=%(orig)s new=%(new)s.', {'vol': volume['id'], 'orig': orig_copy_id, 'new': new_copy_id}) return if len(curr_ops_list): new_ops_str = ';'.join([':'.join(x) for x in curr_ops_list]) self.db.volume_admin_metadata_update(ctxt.elevated(), volume['id'], {'vdiskcopyops': new_ops_str}, False) else: self.db.volume_admin_metadata_delete(ctxt.elevated(), volume['id'], 'vdiskcopyops') def _check_volume_copy_ops(self): LOG.debug("Enter: update volume copy status.") ctxt = context.get_admin_context() copy_items = list(self._vdiskcopyops.items()) for vol_id, copy_ops in copy_items: try: volume = self.db.volume_get(ctxt, vol_id) except Exception: LOG.warning('Volume %s does not exist.', vol_id) del self._vdiskcopyops[vol_id] if not len(self._vdiskcopyops): self._vdiskcopyops_loop.stop() self._vdiskcopyops_loop = None continue for copy_op in copy_ops: try: synced = self._helpers.is_vdisk_copy_synced(volume['name'], copy_op[1]) except Exception: LOG.info('_check_volume_copy_ops: Volume %(vol)s does ' 'not have the specified vdisk copy ' 'operation: orig=%(orig)s new=%(new)s.', {'vol': volume['id'], 'orig': copy_op[0], 'new': copy_op[1]}) else: if synced: self._helpers.rm_vdisk_copy(volume['name'], copy_op[0]) self._rm_vdisk_copy_op(ctxt, volume, copy_op[0], copy_op[1]) LOG.debug("Exit: update volume copy status.") # #### V2.1 replication methods #### # def failover_host(self, context, volumes, secondary_id=None, groups=None): LOG.debug('enter: failover_host: secondary_id=%(id)s', {'id': secondary_id}) if not self._replica_enabled: msg = _("Replication is not properly enabled on backend.") LOG.error(msg) raise exception.UnableToFailOver(reason=msg) if storwize_const.FAILBACK_VALUE == secondary_id: # In this case the administrator would like to fail back. secondary_id, volumes_update = self._replication_failback(context, volumes) elif (secondary_id == self._replica_target['backend_id'] or secondary_id is None): # In this case the administrator would like to fail over. secondary_id, volumes_update = self._replication_failover(context, volumes) else: msg = (_("Invalid secondary id %s.") % secondary_id) LOG.error(msg) raise exception.InvalidReplicationTarget(reason=msg) LOG.debug('leave: failover_host: secondary_id=%(id)s', {'id': secondary_id}) return secondary_id, volumes_update, [] def _replication_failback(self, ctxt, volumes): """Fail back all the volume on the secondary backend.""" volumes_update = [] if not self._active_backend_id: LOG.info("Host has been failed back. doesn't need " "to fail back again") return None, volumes_update try: self._master_backend_helpers.get_system_info() except Exception: msg = (_("Unable to failback due to primary is not reachable.")) LOG.error(msg) raise exception.UnableToFailOver(reason=msg) unrep_volumes, rep_volumes = self._classify_volume(ctxt, volumes) # start synchronize from aux volume to master volume self._sync_with_aux(ctxt, rep_volumes) self._wait_replica_ready(ctxt, rep_volumes) rep_volumes_update = self._failback_replica_volumes(ctxt, rep_volumes) volumes_update.extend(rep_volumes_update) unrep_volumes_update = self._failover_unreplicated_volume( unrep_volumes) volumes_update.extend(unrep_volumes_update) self._helpers = self._master_backend_helpers self._active_backend_id = None # Update the storwize state self._update_storwize_state() self._update_volume_stats() return storwize_const.FAILBACK_VALUE, volumes_update def _failback_replica_volumes(self, ctxt, rep_volumes): LOG.debug('enter: _failback_replica_volumes') volumes_update = [] for volume in rep_volumes: rep_type = self._get_volume_replicated_type(ctxt, volume) replica_obj = self._get_replica_obj(rep_type) tgt_volume = storwize_const.REPLICA_AUX_VOL_PREFIX + volume['name'] rep_info = self._helpers.get_relationship_info(tgt_volume) if not rep_info: volumes_update.append( {'volume_id': volume['id'], 'updates': {'replication_status': fields.ReplicationStatus.ERROR, 'status': 'error'}}) LOG.error('_failback_replica_volumes:no rc-releationship ' 'is established between master: %(master)s and ' 'aux %(aux)s. Please re-establish the ' 'relationship and synchronize the volumes on ' 'backend storage.', {'master': volume['name'], 'aux': tgt_volume}) continue LOG.debug('_failover_replica_volumes: vol=%(vol)s, master_vol=' '%(master_vol)s, aux_vol=%(aux_vol)s, state=%(state)s' 'primary=%(primary)s', {'vol': volume['name'], 'master_vol': rep_info['master_vdisk_name'], 'aux_vol': rep_info['aux_vdisk_name'], 'state': rep_info['state'], 'primary': rep_info['primary']}) try: model_updates = replica_obj.replication_failback(volume) volumes_update.append( {'volume_id': volume['id'], 'updates': model_updates}) except exception.VolumeDriverException: LOG.error('Unable to fail back volume %(volume_id)s', {'volume_id': volume.id}) volumes_update.append( {'volume_id': volume['id'], 'updates': {'replication_status': fields.ReplicationStatus.ERROR, 'status': 'error'}}) LOG.debug('leave: _failback_replica_volumes ' 'volumes_update=%(volumes_update)s', {'volumes_update': volumes_update}) return volumes_update def _failover_unreplicated_volume(self, unreplicated_vols): volumes_update = [] for vol in unreplicated_vols: if vol.replication_driver_data: rep_data = json.loads(vol.replication_driver_data) update_status = rep_data['previous_status'] rep_data = '' else: update_status = 'error' rep_data = json.dumps({'previous_status': vol.status}) volumes_update.append( {'volume_id': vol.id, 'updates': {'status': update_status, 'replication_driver_data': rep_data}}) return volumes_update def _sync_with_aux(self, ctxt, volumes): LOG.debug('enter: _sync_with_aux ') try: rep_mgr = self._get_replica_mgr() rep_mgr.establish_target_partnership() except Exception as ex: LOG.warning('Fail to establish partnership in backend. ' 'error=%(ex)s', {'error': ex}) for volume in volumes: tgt_volume = storwize_const.REPLICA_AUX_VOL_PREFIX + volume['name'] rep_info = self._helpers.get_relationship_info(tgt_volume) if not rep_info: LOG.error('_sync_with_aux: no rc-releationship is ' 'established between master: %(master)s and aux ' '%(aux)s. Please re-establish the relationship ' 'and synchronize the volumes on backend ' 'storage.', {'master': volume['name'], 'aux': tgt_volume}) continue LOG.debug('_sync_with_aux: volume: %(volume)s rep_info:master_vol=' '%(master_vol)s, aux_vol=%(aux_vol)s, state=%(state)s, ' 'primary=%(primary)s', {'volume': volume['name'], 'master_vol': rep_info['master_vdisk_name'], 'aux_vol': rep_info['aux_vdisk_name'], 'state': rep_info['state'], 'primary': rep_info['primary']}) try: if (rep_info['state'] not in [storwize_const.REP_CONSIS_SYNC, storwize_const.REP_CONSIS_COPYING]): if rep_info['primary'] == 'master': self._helpers.start_relationship(tgt_volume) else: self._helpers.start_relationship(tgt_volume, primary='aux') except Exception as ex: LOG.warning('Fail to copy data from aux to master. master:' ' %(master)s and aux %(aux)s. Please ' 're-establish the relationship and synchronize' ' the volumes on backend storage. error=' '%(ex)s', {'master': volume['name'], 'aux': tgt_volume, 'error': ex}) LOG.debug('leave: _sync_with_aux.') def _wait_replica_ready(self, ctxt, volumes): for volume in volumes: tgt_volume = storwize_const.REPLICA_AUX_VOL_PREFIX + volume['name'] try: self._wait_replica_vol_ready(ctxt, tgt_volume) except Exception as ex: LOG.error('_wait_replica_ready: wait for volume:%(volume)s' ' remote copy synchronization failed due to ' 'error:%(err)s.', {'volume': tgt_volume, 'err': ex}) def _wait_replica_vol_ready(self, ctxt, volume): LOG.debug('enter: _wait_replica_vol_ready: volume=%(volume)s', {'volume': volume}) def _replica_vol_ready(): rep_info = self._helpers.get_relationship_info(volume) if not rep_info: msg = (_('_wait_replica_vol_ready: no rc-releationship' 'is established for volume:%(volume)s. Please ' 're-establish the rc-relationship and ' 'synchronize the volumes on backend storage.'), {'volume': volume}) LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg) LOG.debug('_replica_vol_ready:volume: %(volume)s rep_info: ' 'master_vol=%(master_vol)s, aux_vol=%(aux_vol)s, ' 'state=%(state)s, primary=%(primary)s', {'volume': volume, 'master_vol': rep_info['master_vdisk_name'], 'aux_vol': rep_info['aux_vdisk_name'], 'state': rep_info['state'], 'primary': rep_info['primary']}) if (rep_info['state'] in [storwize_const.REP_CONSIS_SYNC, storwize_const.REP_CONSIS_COPYING]): return True elif rep_info['state'] == storwize_const.REP_IDL_DISC: msg = (_('Wait synchronize failed. volume: %(volume)s'), {'volume': volume}) LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg) return False self._helpers._wait_for_a_condition( _replica_vol_ready, timeout=storwize_const.DEFAULT_RC_TIMEOUT, interval=storwize_const.DEFAULT_RC_INTERVAL, raise_exception=True) LOG.debug('leave: _wait_replica_vol_ready: volume=%(volume)s', {'volume': volume}) def _replication_failover(self, ctxt, volumes): volumes_update = [] if self._active_backend_id: LOG.info("Host has been failed over to %s", self._active_backend_id) return self._active_backend_id, volumes_update try: self._aux_backend_helpers.get_system_info() except Exception as ex: msg = (_("Unable to failover due to replication target is not " "reachable. error=%(ex)s"), {'error': ex}) LOG.error(msg) raise exception.UnableToFailOver(reason=msg) unrep_volumes, rep_volumes = self._classify_volume(ctxt, volumes) rep_volumes_update = self._failover_replica_volumes(ctxt, rep_volumes) volumes_update.extend(rep_volumes_update) unrep_volumes_update = self._failover_unreplicated_volume( unrep_volumes) volumes_update.extend(unrep_volumes_update) self._helpers = self._aux_backend_helpers self._active_backend_id = self._replica_target['backend_id'] self._secondary_pools = [self._replica_target['pool_name']] # Update the storwize state self._update_storwize_state() self._update_volume_stats() return self._active_backend_id, volumes_update def _failover_replica_volumes(self, ctxt, rep_volumes): LOG.debug('enter: _failover_replica_volumes') volumes_update = [] for volume in rep_volumes: rep_type = self._get_volume_replicated_type(ctxt, volume) replica_obj = self._get_replica_obj(rep_type) # Try do the fail-over. try: rep_info = self._aux_backend_helpers.get_relationship_info( storwize_const.REPLICA_AUX_VOL_PREFIX + volume['name']) if not rep_info: volumes_update.append( {'volume_id': volume['id'], 'updates': {'replication_status': fields.ReplicationStatus.FAILOVER_ERROR, 'status': 'error'}}) LOG.error('_failover_replica_volumes: no rc-' 'releationship is established for master:' '%(master)s. Please re-establish the rc-' 'relationship and synchronize the volumes on' ' backend storage.', {'master': volume['name']}) continue LOG.debug('_failover_replica_volumes: vol=%(vol)s, ' 'master_vol=%(master_vol)s, aux_vol=%(aux_vol)s, ' 'state=%(state)s, primary=%(primary)s', {'vol': volume['name'], 'master_vol': rep_info['master_vdisk_name'], 'aux_vol': rep_info['aux_vdisk_name'], 'state': rep_info['state'], 'primary': rep_info['primary']}) model_updates = replica_obj.failover_volume_host(ctxt, volume) volumes_update.append( {'volume_id': volume['id'], 'updates': model_updates}) except exception.VolumeDriverException: LOG.error('Unable to failover to aux volume. Please make ' 'sure that the aux volume is ready.') volumes_update.append( {'volume_id': volume['id'], 'updates': {'status': 'error', 'replication_status': fields.ReplicationStatus.FAILOVER_ERROR}}) LOG.debug('leave: _failover_replica_volumes ' 'volumes_update=%(volumes_update)s', {'volumes_update': volumes_update}) return volumes_update def _classify_volume(self, ctxt, volumes): normal_volumes = [] replica_volumes = [] for v in volumes: volume_type = self._get_volume_replicated_type(ctxt, v) if volume_type and v['status'] == 'available': replica_volumes.append(v) else: normal_volumes.append(v) return normal_volumes, replica_volumes def _get_replica_obj(self, rep_type): replica_manager = self.replica_manager[ self._replica_target['backend_id']] return replica_manager.get_replica_obj(rep_type) def _get_replica_mgr(self): replica_manager = self.replica_manager[ self._replica_target['backend_id']] return replica_manager def _get_target_vol(self, volume): tgt_vol = volume['name'] if self._active_backend_id: ctxt = context.get_admin_context() rep_type = self._get_volume_replicated_type(ctxt, volume) if rep_type: tgt_vol = (storwize_const.REPLICA_AUX_VOL_PREFIX + volume['name']) return tgt_vol def _validate_replication_enabled(self): if not self._replica_enabled: msg = _("Replication is not properly configured on backend.") LOG.error(msg) raise exception.VolumeBackendAPIException(data=msg) def _get_specs_replicated_type(self, volume_type): replication_type = None extra_specs = volume_type.get("extra_specs", {}) rep_val = extra_specs.get('replication_enabled') if rep_val == "<is> True": replication_type = extra_specs.get('replication_type', storwize_const.GLOBAL) # The format for replication_type in extra spec is in # "<in> global". Otherwise, the code will # not reach here. if replication_type != storwize_const.GLOBAL: # Pick up the replication type specified in the # extra spec from the format like "<in> global". replication_type = replication_type.split()[1] if replication_type not in storwize_const.VALID_REP_TYPES: msg = (_("Invalid replication type %s.") % replication_type) LOG.error(msg) raise exception.InvalidInput(reason=msg) return replication_type def _get_volume_replicated_type(self, ctxt, volume, vol_type_id=None): replication_type = None volume_type = None volume_type_id = volume.volume_type_id if volume else vol_type_id if volume_type_id: volume_type = objects.VolumeType.get_by_name_or_id( ctxt, volume_type_id) if volume_type: replication_type = self._get_specs_replicated_type(volume_type) return replication_type def _get_storwize_config(self): self._do_replication_setup() if self._active_backend_id and self._replica_target: self._helpers = self._aux_backend_helpers self._replica_enabled = (True if (self._helpers.replication_licensed() and self._replica_target) else False) if self._replica_enabled: self._supported_replica_types = storwize_const.VALID_REP_TYPES def _do_replication_setup(self): rep_devs = self.configuration.safe_get('replication_device') if not rep_devs: return if len(rep_devs) > 1: raise exception.InvalidInput( reason='Multiple replication devices are configured. ' 'Now only one replication_device is supported.') required_flags = ['san_ip', 'backend_id', 'san_login', 'san_password', 'pool_name'] for flag in required_flags: if flag not in rep_devs[0]: raise exception.InvalidInput( reason=_('%s is not set.') % flag) rep_target = {} rep_target['san_ip'] = rep_devs[0].get('san_ip') rep_target['backend_id'] = rep_devs[0].get('backend_id') rep_target['san_login'] = rep_devs[0].get('san_login') rep_target['san_password'] = rep_devs[0].get('san_password') rep_target['pool_name'] = rep_devs[0].get('pool_name') # Each replication target will have a corresponding replication. self._replication_initialize(rep_target) def _replication_initialize(self, target): rep_manager = storwize_rep.StorwizeSVCReplicationManager( self, target, StorwizeHelpers) if self._active_backend_id: if self._active_backend_id != target['backend_id']: msg = (_("Invalid secondary id %s.") % self._active_backend_id) LOG.error(msg) raise exception.InvalidInput(reason=msg) # Setup partnership only in non-failover state else: try: rep_manager.establish_target_partnership() except exception.VolumeDriverException: LOG.error('The replication src %(src)s has not ' 'successfully established partnership with the ' 'replica target %(tgt)s.', {'src': self.configuration.san_ip, 'tgt': target['backend_id']}) self._aux_backend_helpers = rep_manager.get_target_helpers() self.replica_manager[target['backend_id']] = rep_manager self._replica_target = target def migrate_volume(self, ctxt, volume, host): """Migrate directly if source and dest are managed by same storage. We create a new vdisk copy in the desired pool, and add the original vdisk copy to the admin_metadata of the volume to be deleted. The deletion will occur using a periodic task once the new copy is synced. :param ctxt: Context :param volume: A dictionary describing the volume to migrate :param host: A dictionary describing the host to migrate to, where host['host'] is its name, and host['capabilities'] is a dictionary of its reported capabilities. """ LOG.debug('enter: migrate_volume: id=%(id)s, host=%(host)s', {'id': volume['id'], 'host': host['host']}) false_ret = (False, None) dest_pool = self._helpers.can_migrate_to_host(host, self._state) if dest_pool is None: return false_ret ctxt = context.get_admin_context() volume_type_id = volume['volume_type_id'] if volume_type_id is not None: vol_type = volume_types.get_volume_type(ctxt, volume_type_id) else: vol_type = None resp = self._helpers.lsvdiskcopy(volume.name) if len(resp) > 1: copies = self._helpers.get_vdisk_copies(volume.name) self._helpers.migratevdisk(volume.name, dest_pool, copies['primary']['copy_id']) else: self.add_vdisk_copy(volume.name, dest_pool, vol_type, auto_delete=True) LOG.debug('leave: migrate_volume: id=%(id)s, host=%(host)s', {'id': volume.id, 'host': host['host']}) return (True, None) def _verify_retype_params(self, volume, new_opts, old_opts, need_copy, change_mirror, new_rep_type, old_rep_type): # Some volume parameters can not be changed or changed at the same # time during volume retype operation. This function checks the # retype parameters. resp = self._helpers.lsvdiskcopy(volume.name) if old_opts['mirror_pool'] and len(resp) == 1: msg = (_('Unable to retype: volume %s is a mirrorred vol. But it ' 'has only one copy in storage.') % volume.name) raise exception.VolumeDriverException(message=msg) if need_copy: # mirror volume can not add volume-copy again. if len(resp) > 1: msg = (_('Unable to retype: current action needs volume-copy. ' 'A copy of volume %s exists. Adding another copy ' 'would exceed the limit of 2 copies.') % volume.name) raise exception.VolumeDriverException(message=msg) if old_opts['mirror_pool'] or new_opts['mirror_pool']: msg = (_('Unable to retype: current action needs volume-copy, ' 'it is not allowed for mirror volume ' '%s.') % volume.name) raise exception.VolumeDriverException(message=msg) if change_mirror: if (new_opts['mirror_pool'] and not self._helpers.is_pool_defined( new_opts['mirror_pool'])): msg = (_('Unable to retype: The pool %s in which mirror copy ' 'is stored is not valid') % new_opts['mirror_pool']) raise exception.VolumeDriverException(message=msg) # There are four options for rep_type: None, metro, global, gmcv if new_rep_type or old_rep_type: # If volume is replicated, can't copy if need_copy or new_opts['mirror_pool'] or old_opts['mirror_pool']: msg = (_('Unable to retype: current action needs volume-copy, ' 'it is not allowed for replication type. ' 'Volume = %s') % volume.id) raise exception.VolumeDriverException(message=msg) if new_rep_type != old_rep_type: old_io_grp = self._helpers.get_volume_io_group(volume.name) if (old_io_grp not in StorwizeHelpers._get_valid_requested_io_groups( self._state, new_opts)): msg = (_('Unable to retype: it is not allowed to change ' 'replication type and io group at the same time.')) LOG.error(msg) raise exception.VolumeDriverException(message=msg) if new_rep_type and old_rep_type: msg = (_('Unable to retype: it is not allowed to change ' '%(old_rep_type)s volume to %(new_rep_type)s ' 'volume.') % {'old_rep_type': old_rep_type, 'new_rep_type': new_rep_type}) LOG.error(msg) raise exception.VolumeDriverException(message=msg) elif storwize_const.GMCV == new_rep_type: # To gmcv, we may change cycle_period_seconds if needed previous_cps = old_opts.get('cycle_period_seconds') new_cps = new_opts.get('cycle_period_seconds') if previous_cps != new_cps: self._helpers.change_relationship_cycleperiod(volume.name, new_cps) def retype(self, ctxt, volume, new_type, diff, host): """Convert the volume to be of the new type. Returns a boolean indicating whether the retype occurred. :param ctxt: Context :param volume: A dictionary describing the volume to migrate :param new_type: A dictionary describing the volume type to convert to :param diff: A dictionary with the difference between the two types :param host: A dictionary describing the host to migrate to, where host['host'] is its name, and host['capabilities'] is a dictionary of its reported capabilities. """ def retype_iogrp_property(volume, new, old): if new != old: self._helpers.change_vdisk_iogrp(volume['name'], self._state, (new, old)) LOG.debug('enter: retype: id=%(id)s, new_type=%(new_type)s,' 'diff=%(diff)s, host=%(host)s', {'id': volume['id'], 'new_type': new_type, 'diff': diff, 'host': host}) no_copy_keys = ['warning', 'autoexpand', 'easytier'] copy_keys = ['rsize', 'grainsize', 'compression'] all_keys = no_copy_keys + copy_keys old_opts = self._get_vdisk_params(volume['volume_type_id'], volume_metadata= volume.get('volume_matadata')) new_opts = self._get_vdisk_params(new_type['id'], volume_type=new_type) vdisk_changes = [] need_copy = False change_mirror = False for key in all_keys: if old_opts[key] != new_opts[key]: if key in copy_keys: need_copy = True break elif key in no_copy_keys: vdisk_changes.append(key) if (utils.extract_host(volume['host'], 'pool') != utils.extract_host(host['host'], 'pool')): need_copy = True if old_opts['mirror_pool'] != new_opts['mirror_pool']: change_mirror = True # Check if retype affects volume replication model_update = None new_rep_type = self._get_specs_replicated_type(new_type) old_rep_type = self._get_volume_replicated_type(ctxt, volume) old_io_grp = self._helpers.get_volume_io_group(volume['name']) new_io_grp = self._helpers.select_io_group(self._state, new_opts) self._verify_retype_params(volume, new_opts, old_opts, need_copy, change_mirror, new_rep_type, old_rep_type) if need_copy: self._check_volume_copy_ops() dest_pool = self._helpers.can_migrate_to_host(host, self._state) if dest_pool is None: return False retype_iogrp_property(volume, new_io_grp, old_io_grp) try: self.add_vdisk_copy(volume['name'], dest_pool, new_type, auto_delete=True) except exception.VolumeDriverException: # roll back changing iogrp property retype_iogrp_property(volume, old_io_grp, new_io_grp) msg = (_('Unable to retype: A copy of volume %s exists. ' 'Retyping would exceed the limit of 2 copies.'), volume['id']) raise exception.VolumeDriverException(message=msg) else: retype_iogrp_property(volume, new_io_grp, old_io_grp) self._helpers.change_vdisk_options(volume['name'], vdisk_changes, new_opts, self._state) if change_mirror: copies = self._helpers.get_vdisk_copies(volume.name) if not old_opts['mirror_pool'] and new_opts['mirror_pool']: # retype from non mirror vol to mirror vol self.add_vdisk_copy(volume['name'], new_opts['mirror_pool'], new_type) elif old_opts['mirror_pool'] and not new_opts['mirror_pool']: # retype from mirror vol to non mirror vol secondary = copies['secondary'] if secondary: self._helpers.rm_vdisk_copy( volume.name, secondary['copy_id']) else: # migrate the second copy to another pool. self._helpers.migratevdisk( volume.name, new_opts['mirror_pool'], copies['secondary']['copy_id']) if new_opts['qos']: # Add the new QoS setting to the volume. If the volume has an # old QoS setting, it will be overwritten. self._helpers.update_vdisk_qos(volume['name'], new_opts['qos']) elif old_opts['qos']: # If the old_opts contain QoS keys, disable them. self._helpers.disable_vdisk_qos(volume['name'], old_opts['qos']) # Delete replica if needed if old_rep_type and not new_rep_type: self._aux_backend_helpers.delete_rc_volume(volume['name'], target_vol=True) if storwize_const.GMCV == old_rep_type: self._helpers.delete_vdisk( storwize_const.REPLICA_CHG_VOL_PREFIX + volume['name'], False) model_update = {'replication_status': fields.ReplicationStatus.DISABLED, 'replication_driver_data': None, 'replication_extended_status': None} # Add replica if needed if not old_rep_type and new_rep_type: replica_obj = self._get_replica_obj(new_rep_type) replica_obj.volume_replication_setup(ctxt, volume) if storwize_const.GMCV == new_rep_type: # Set cycle_period_seconds if needed self._helpers.change_relationship_cycleperiod( volume['name'], new_opts.get('cycle_period_seconds')) model_update = {'replication_status': fields.ReplicationStatus.ENABLED} LOG.debug('exit: retype: ild=%(id)s, new_type=%(new_type)s,' 'diff=%(diff)s, host=%(host)s', {'id': volume['id'], 'new_type': new_type, 'diff': diff, 'host': host['host']}) return True, model_update def update_migrated_volume(self, ctxt, volume, new_volume, original_volume_status): """Return model update from Storwize for migrated volume. This method should rename the back-end volume name(id) on the destination host back to its original name(id) on the source host. :param ctxt: The context used to run the method update_migrated_volume :param volume: The original volume that was migrated to this backend :param new_volume: The migration volume object that was created on this backend as part of the migration process :param original_volume_status: The status of the original volume :returns: model_update to update DB with any needed changes """ current_name = CONF.volume_name_template % new_volume['id'] original_volume_name = CONF.volume_name_template % volume['id'] try: self._helpers.rename_vdisk(current_name, original_volume_name) rep_type = self._get_volume_replicated_type(ctxt, new_volume) if rep_type: rel_info = self._helpers.get_relationship_info(current_name) aux_vol = (storwize_const.REPLICA_AUX_VOL_PREFIX + original_volume_name) self._aux_backend_helpers.rename_vdisk( rel_info['aux_vdisk_name'], aux_vol) except exception.VolumeBackendAPIException: LOG.error('Unable to rename the logical volume ' 'for volume: %s', volume['id']) return {'_name_id': new_volume['_name_id'] or new_volume['id']} # If the back-end name(id) for the volume has been renamed, # it is OK for the volume to keep the original name(id) and there is # no need to use the column "_name_id" to establish the mapping # relationship between the volume id and the back-end volume # name(id). # Set the key "_name_id" to None for a successful rename. model_update = {'_name_id': None} return model_update def manage_existing(self, volume, ref): """Manages an existing vdisk. Renames the vdisk to match the expected name for the volume. Error checking done by manage_existing_get_size is not repeated - if we got here then we have a vdisk that isn't in use (or we don't care if it is in use. """ # Check that the reference is valid vdisk = self._manage_input_check(ref) vdisk_io_grp = self._helpers.get_volume_io_group(vdisk['name']) if vdisk_io_grp not in self._state['available_iogrps']: msg = (_("Failed to manage existing volume due to " "the volume to be managed is not in a valid " "I/O group.")) raise exception.ManageExistingVolumeTypeMismatch(reason=msg) # Add replication check ctxt = context.get_admin_context() rep_type = self._get_volume_replicated_type(ctxt, volume) vol_rep_type = None rel_info = self._helpers.get_relationship_info(vdisk['name']) copies = self._helpers.get_vdisk_copies(vdisk['name']) if rel_info: vol_rep_type = ( storwize_const.GMCV if storwize_const.GMCV_MULTI == rel_info['cycling_mode'] else rel_info['copy_type']) aux_info = self._aux_backend_helpers.get_system_info() if rel_info['aux_cluster_id'] != aux_info['system_id']: msg = (_("Failed to manage existing volume due to the aux " "cluster for volume %(volume)s is %(aux_id)s. The " "configured cluster id is %(cfg_id)s") % {'volume': vdisk['name'], 'aux_id': rel_info['aux_cluster_id'], 'cfg_id': aux_info['system_id']}) raise exception.ManageExistingVolumeTypeMismatch(reason=msg) if vol_rep_type != rep_type: msg = (_("Failed to manage existing volume due to " "the replication type of the volume to be managed is " "mismatch with the provided replication type.")) raise exception.ManageExistingVolumeTypeMismatch(reason=msg) elif storwize_const.GMCV == rep_type: if volume['volume_type_id']: rep_opts = self._get_vdisk_params( volume['volume_type_id'], volume_metadata=volume.get('volume_metadata')) # Check cycle_period_seconds rep_cps = six.text_type(rep_opts.get('cycle_period_seconds')) if rel_info['cycle_period_seconds'] != rep_cps: msg = (_("Failed to manage existing volume due to " "the cycle_period_seconds %(vol_cps)s of " "the volume to be managed is mismatch with " "cycle_period_seconds %(type_cps)s in " "the provided gmcv replication type.") % {'vol_cps': rel_info['cycle_period_seconds'], 'type_cps': rep_cps}) raise exception.ManageExistingVolumeTypeMismatch(reason=msg) if volume['volume_type_id']: opts = self._get_vdisk_params(volume['volume_type_id'], volume_metadata= volume.get('volume_metadata')) resp = self._helpers.lsvdiskcopy(vdisk['name']) expected_copy_num = 2 if opts['mirror_pool'] else 1 if len(resp) != expected_copy_num: msg = (_("Failed to manage existing volume due to mirror type " "mismatch. Volume to be managed has %(resp_len)s " "copies. mirror_pool of the chosen type is " "%(mirror_pool)s.") % {'resp_len': len(resp), 'mirror_pool': opts['mirror_pool']}) raise exception.ManageExistingVolumeTypeMismatch(reason=msg) if (opts['mirror_pool']and opts['mirror_pool'] != copies['secondary']['mdisk_grp_name']): msg = (_("Failed to manage existing volume due to mirror pool " "mismatch. The secondary pool of the volume to be " "managed is %(sec_copy_pool)s. mirror_pool of the " "chosen type is %(mirror_pool)s.") % {'sec_copy_pool': copies['secondary']['mdisk_grp_name'], 'mirror_pool': opts['mirror_pool']}) raise exception.ManageExistingVolumeTypeMismatch( reason=msg) vdisk_copy = self._helpers.get_vdisk_copy_attrs(vdisk['name'], '0') if vdisk_copy['autoexpand'] == 'on' and opts['rsize'] == -1: msg = (_("Failed to manage existing volume due to " "the volume to be managed is thin, but " "the volume type chosen is thick.")) raise exception.ManageExistingVolumeTypeMismatch(reason=msg) if not vdisk_copy['autoexpand'] and opts['rsize'] != -1: msg = (_("Failed to manage existing volume due to " "the volume to be managed is thick, but " "the volume type chosen is thin.")) raise exception.ManageExistingVolumeTypeMismatch(reason=msg) if (vdisk_copy['compressed_copy'] == 'no' and opts['compression']): msg = (_("Failed to manage existing volume due to the " "volume to be managed is not compress, but " "the volume type chosen is compress.")) raise exception.ManageExistingVolumeTypeMismatch(reason=msg) if (vdisk_copy['compressed_copy'] == 'yes' and not opts['compression']): msg = (_("Failed to manage existing volume due to the " "volume to be managed is compress, but " "the volume type chosen is not compress.")) raise exception.ManageExistingVolumeTypeMismatch(reason=msg) if (vdisk_io_grp not in StorwizeHelpers._get_valid_requested_io_groups( self._state, opts)): msg = (_("Failed to manage existing volume due to " "I/O group mismatch. The I/O group of the " "volume to be managed is %(vdisk_iogrp)s. I/O group" "of the chosen type is %(opt_iogrp)s.") % {'vdisk_iogrp': vdisk['IO_group_name'], 'opt_iogrp': opts['iogrp']}) raise exception.ManageExistingVolumeTypeMismatch(reason=msg) pool = utils.extract_host(volume['host'], 'pool') if copies['primary']['mdisk_grp_name'] != pool: msg = (_("Failed to manage existing volume due to the " "pool of the volume to be managed does not " "match the backend pool. Pool of the " "volume to be managed is %(vdisk_pool)s. Pool " "of the backend is %(backend_pool)s.") % {'vdisk_pool': copies['primary']['mdisk_grp_name'], 'backend_pool': pool}) raise exception.ManageExistingVolumeTypeMismatch(reason=msg) model_update = {} self._helpers.rename_vdisk(vdisk['name'], volume['name']) if vol_rep_type: aux_vol = storwize_const.REPLICA_AUX_VOL_PREFIX + volume['name'] self._aux_backend_helpers.rename_vdisk(rel_info['aux_vdisk_name'], aux_vol) if storwize_const.GMCV == vol_rep_type: self._helpers.rename_vdisk( rel_info['master_change_vdisk_name'], storwize_const.REPLICA_CHG_VOL_PREFIX + volume['name']) self._aux_backend_helpers.rename_vdisk( rel_info['aux_change_vdisk_name'], storwize_const.REPLICA_CHG_VOL_PREFIX + aux_vol) model_update = {'replication_status': fields.ReplicationStatus.ENABLED} return model_update def manage_existing_get_size(self, volume, ref): """Return size of an existing Vdisk for manage_existing. existing_ref is a dictionary of the form: {'source-id': <uid of disk>} or {'source-name': <name of the disk>} Optional elements are: 'manage_if_in_use': True/False (default is False) If set to True, a volume will be managed even if it is currently attached to a host system. """ # Check that the reference is valid vdisk = self._manage_input_check(ref) # Check if the disk is in use, if we need to. manage_if_in_use = ref.get('manage_if_in_use', False) if (not manage_if_in_use and self._helpers.is_vdisk_in_use(vdisk['name'])): reason = _('The specified vdisk is mapped to a host.') raise exception.ManageExistingInvalidReference(existing_ref=ref, reason=reason) return int(math.ceil(float(vdisk['capacity']) / units.Gi)) def unmanage(self, volume): """Remove the specified volume from Cinder management.""" pass def get_volume_stats(self, refresh=False): """Get volume stats. If we haven't gotten stats yet or 'refresh' is True, run update the stats first. """ if not self._stats or refresh: self._update_volume_stats() return self._stats # Add CG capability to generic volume groups def create_group(self, context, group): """Creates a group. :param context: the context of the caller. :param group: the group object. :returns: model_update """ LOG.debug("Creating group.") model_update = {'status': fields.GroupStatus.AVAILABLE} for vol_type_id in group.volume_type_ids: replication_type = self._get_volume_replicated_type( context, None, vol_type_id) if replication_type: # An unsupported configuration LOG.error('Unable to create group: create group with ' 'replication volume type is not supported.') model_update = {'status': fields.GroupStatus.ERROR} return model_update if utils.is_group_a_cg_snapshot_type(group): return {'status': fields.GroupStatus.AVAILABLE} # we'll rely on the generic group implementation if it is not a # consistency group request. raise NotImplementedError() def delete_group(self, context, group, volumes): """Deletes a group. :param context: the context of the caller. :param group: the group object. :param volumes: a list of volume objects in the group. :returns: model_update, volumes_model_update """ LOG.debug("Deleting group.") if not utils.is_group_a_cg_snapshot_type(group): # we'll rely on the generic group implementation if it is # not a consistency group request. raise NotImplementedError() model_update = {'status': fields.GroupStatus.DELETED} volumes_model_update = [] for volume in volumes: try: self._helpers.delete_vdisk(volume['name'], True) volumes_model_update.append( {'id': volume['id'], 'status': 'deleted'}) except exception.VolumeBackendAPIException as err: model_update['status'] = ( fields.GroupStatus.ERROR_DELETING) LOG.error("Failed to delete the volume %(vol)s of CG. " "Exception: %(exception)s.", {'vol': volume['name'], 'exception': err}) volumes_model_update.append( {'id': volume['id'], 'status': fields.GroupStatus.ERROR_DELETING}) return model_update, volumes_model_update def update_group(self, context, group, add_volumes=None, remove_volumes=None): """Updates a group. :param context: the context of the caller. :param group: the group object. :param add_volumes: a list of volume objects to be added. :param remove_volumes: a list of volume objects to be removed. :returns: model_update, add_volumes_update, remove_volumes_update """ LOG.debug("Updating group.") if utils.is_group_a_cg_snapshot_type(group): return None, None, None # we'll rely on the generic group implementation if it is not a # consistency group request. raise NotImplementedError() def create_group_from_src(self, context, group, volumes, group_snapshot=None, snapshots=None, source_group=None, source_vols=None): """Creates a group from source. :param context: the context of the caller. :param group: the Group object to be created. :param volumes: a list of Volume objects in the group. :param group_snapshot: the GroupSnapshot object as source. :param snapshots: a list of snapshot objects in group_snapshot. :param source_group: the Group object as source. :param source_vols: a list of volume objects in the source_group. :returns: model_update, volumes_model_update """ LOG.debug('Enter: create_group_from_src.') if not utils.is_group_a_cg_snapshot_type(group): # we'll rely on the generic volume groups implementation if it is # not a consistency group request. raise NotImplementedError() if group_snapshot and snapshots: cg_name = 'cg-' + group_snapshot.id sources = snapshots elif source_group and source_vols: cg_name = 'cg-' + source_group.id sources = source_vols else: error_msg = _("create_group_from_src must be creating from a " "group snapshot, or a source group.") raise exception.InvalidInput(reason=error_msg) LOG.debug('create_group_from_src: cg_name %(cg_name)s' ' %(sources)s', {'cg_name': cg_name, 'sources': sources}) self._helpers.create_fc_consistgrp(cg_name) timeout = self.configuration.storwize_svc_flashcopy_timeout model_update, snapshots_model = ( self._helpers.create_cg_from_source(group, cg_name, sources, volumes, self._state, self.configuration, timeout)) LOG.debug("Leave: create_group_from_src.") return model_update, snapshots_model def create_group_snapshot(self, context, group_snapshot, snapshots): """Creates a group_snapshot. :param context: the context of the caller. :param group_snapshot: the GroupSnapshot object to be created. :param snapshots: a list of Snapshot objects in the group_snapshot. :returns: model_update, snapshots_model_update """ if not utils.is_group_a_cg_snapshot_type(group_snapshot): # we'll rely on the generic group implementation if it is not a # consistency group request. raise NotImplementedError() # Use group_snapshot id as cg name cg_name = 'cg_snap-' + group_snapshot.id # Create new cg as cg_snapshot self._helpers.create_fc_consistgrp(cg_name) timeout = self.configuration.storwize_svc_flashcopy_timeout model_update, snapshots_model = ( self._helpers.run_consistgrp_snapshots(cg_name, snapshots, self._state, self.configuration, timeout)) return model_update, snapshots_model def delete_group_snapshot(self, context, group_snapshot, snapshots): """Deletes a group_snapshot. :param context: the context of the caller. :param group_snapshot: the GroupSnapshot object to be deleted. :param snapshots: a list of snapshot objects in the group_snapshot. :returns: model_update, snapshots_model_update """ if not utils.is_group_a_cg_snapshot_type(group_snapshot): # we'll rely on the generic group implementation if it is not a # consistency group request. raise NotImplementedError() cgsnapshot_id = group_snapshot.id cg_name = 'cg_snap-' + cgsnapshot_id model_update, snapshots_model = ( self._helpers.delete_consistgrp_snapshots(cg_name, snapshots)) return model_update, snapshots_model def get_pool(self, volume): attr = self._helpers.get_vdisk_attributes(volume['name']) if attr is None: msg = (_('get_pool: Failed to get attributes for volume ' '%s') % volume['name']) LOG.error(msg) raise exception.VolumeDriverException(message=msg) return attr['mdisk_grp_name'] def _update_volume_stats(self): """Retrieve stats info from volume group.""" LOG.debug("Updating volume stats.") data = {} data['vendor_name'] = 'IBM' data['driver_version'] = self.VERSION data['storage_protocol'] = self.protocol data['pools'] = [] backend_name = self.configuration.safe_get('volume_backend_name') data['volume_backend_name'] = (backend_name or self._state['system_name']) data['pools'] = [self._build_pool_stats(pool) for pool in self._get_backend_pools()] if self._replica_enabled: data['replication'] = self._replica_enabled data['replication_enabled'] = self._replica_enabled data['replication_targets'] = self._get_replication_targets() self._stats = data def _build_pool_stats(self, pool): """Build pool status""" QoS_support = True pool_stats = {} try: pool_data = self._helpers.get_pool_attrs(pool) if pool_data: easy_tier = pool_data['easy_tier'] in ['on', 'auto'] total_capacity_gb = float(pool_data['capacity']) / units.Gi free_capacity_gb = float(pool_data['free_capacity']) / units.Gi allocated_capacity_gb = (float(pool_data['used_capacity']) / units.Gi) provisioned_capacity_gb = float( pool_data['virtual_capacity']) / units.Gi rsize = self.configuration.safe_get( 'storwize_svc_vol_rsize') # rsize of -1 or 100 means fully allocate the mdisk use_thick_provisioning = rsize == -1 or rsize == 100 over_sub_ratio = self.configuration.safe_get( 'max_over_subscription_ratio') location_info = ('StorwizeSVCDriver:%(sys_id)s:%(pool)s' % {'sys_id': self._state['system_id'], 'pool': pool_data['name']}) multiattach = (self.configuration. storwize_svc_multihostmap_enabled) pool_stats = { 'pool_name': pool_data['name'], 'total_capacity_gb': total_capacity_gb, 'free_capacity_gb': free_capacity_gb, 'allocated_capacity_gb': allocated_capacity_gb, 'provisioned_capacity_gb': provisioned_capacity_gb, 'compression_support': self._state['compression_enabled'], 'reserved_percentage': self.configuration.reserved_percentage, 'QoS_support': QoS_support, 'consistencygroup_support': True, 'location_info': location_info, 'easytier_support': easy_tier, 'multiattach': multiattach, 'thin_provisioning_support': not use_thick_provisioning, 'thick_provisioning_support': use_thick_provisioning, 'max_over_subscription_ratio': over_sub_ratio, 'consistent_group_snapshot_enabled': True, } if self._replica_enabled: pool_stats.update({ 'replication_enabled': self._replica_enabled, 'replication_type': self._supported_replica_types, 'replication_targets': self._get_replication_targets(), 'replication_count': len(self._get_replication_targets()) }) except exception.VolumeBackendAPIException: msg = _('Failed getting details for pool %s.') % pool raise exception.VolumeBackendAPIException(data=msg) return pool_stats def _get_replication_targets(self): return [self._replica_target['backend_id']] def _manage_input_check(self, ref): """Verify the input of manage function.""" # Check that the reference is valid if 'source-name' in ref: manage_source = ref['source-name'] vdisk = self._helpers.get_vdisk_attributes(manage_source) elif 'source-id' in ref: manage_source = ref['source-id'] vdisk = self._helpers.vdisk_by_uid(manage_source) else: reason = _('Reference must contain source-id or ' 'source-name element.') raise exception.ManageExistingInvalidReference(existing_ref=ref, reason=reason) if vdisk is None: reason = (_('No vdisk with the UID specified by ref %s.') % manage_source) raise exception.ManageExistingInvalidReference(existing_ref=ref, reason=reason) return vdisk<|fim▁end|>